@antv/g2 5.0.16 → 5.0.17

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.
Files changed (109) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/g2-lite.min.js +3 -3
  3. package/dist/g2.min.js +3 -3
  4. package/esm/api/chart.js +5 -1
  5. package/esm/api/chart.js.map +1 -1
  6. package/esm/api/mark/types.d.ts +2 -2
  7. package/esm/component/legendCategory.js +23 -21
  8. package/esm/component/legendCategory.js.map +1 -1
  9. package/esm/component/legendContinuous.js +1 -1
  10. package/esm/component/legendContinuous.js.map +1 -1
  11. package/esm/component/title.js +2 -4
  12. package/esm/component/title.js.map +1 -1
  13. package/esm/mark/point.js +1 -1
  14. package/esm/mark/point.js.map +1 -1
  15. package/esm/runtime/component.d.ts +3 -2
  16. package/esm/runtime/component.js +62 -22
  17. package/esm/runtime/component.js.map +1 -1
  18. package/esm/runtime/layout.js +3 -3
  19. package/esm/runtime/layout.js.map +1 -1
  20. package/esm/runtime/mark.js +3 -2
  21. package/esm/runtime/mark.js.map +1 -1
  22. package/esm/runtime/plot.js +5 -5
  23. package/esm/runtime/plot.js.map +1 -1
  24. package/esm/runtime/scale.d.ts +3 -3
  25. package/esm/runtime/scale.js +21 -13
  26. package/esm/runtime/scale.js.map +1 -1
  27. package/esm/runtime/types/common.d.ts +12 -14
  28. package/esm/runtime/types/theme.d.ts +9 -13
  29. package/esm/shape/label/position/default.js +7 -2
  30. package/esm/shape/label/position/default.js.map +1 -1
  31. package/esm/shape/text/advance.js +5 -2
  32. package/esm/shape/text/advance.js.map +1 -1
  33. package/esm/spec/component.d.ts +11 -12
  34. package/esm/spec/composition.d.ts +1 -1
  35. package/esm/spec/index.d.ts +2 -1
  36. package/esm/spec/index.js.map +1 -1
  37. package/esm/spec/interaction.d.ts +1 -2
  38. package/esm/spec/mark.d.ts +1 -1
  39. package/esm/theme/academy.js +11 -32
  40. package/esm/theme/academy.js.map +1 -1
  41. package/esm/theme/classic.js +12 -33
  42. package/esm/theme/classic.js.map +1 -1
  43. package/esm/theme/classicDark.js +11 -32
  44. package/esm/theme/classicDark.js.map +1 -1
  45. package/lib/api/chart.js +5 -1
  46. package/lib/api/chart.js.map +1 -1
  47. package/lib/api/mark/types.d.ts +2 -2
  48. package/lib/component/legendCategory.js +23 -21
  49. package/lib/component/legendCategory.js.map +1 -1
  50. package/lib/component/legendContinuous.js +1 -1
  51. package/lib/component/legendContinuous.js.map +1 -1
  52. package/lib/component/title.js +2 -4
  53. package/lib/component/title.js.map +1 -1
  54. package/lib/mark/point.js +1 -1
  55. package/lib/mark/point.js.map +1 -1
  56. package/lib/runtime/component.d.ts +3 -2
  57. package/lib/runtime/component.js +64 -23
  58. package/lib/runtime/component.js.map +1 -1
  59. package/lib/runtime/layout.js +3 -3
  60. package/lib/runtime/layout.js.map +1 -1
  61. package/lib/runtime/mark.js +3 -2
  62. package/lib/runtime/mark.js.map +1 -1
  63. package/lib/runtime/plot.js +4 -4
  64. package/lib/runtime/plot.js.map +1 -1
  65. package/lib/runtime/scale.d.ts +3 -3
  66. package/lib/runtime/scale.js +21 -13
  67. package/lib/runtime/scale.js.map +1 -1
  68. package/lib/runtime/types/common.d.ts +12 -14
  69. package/lib/runtime/types/theme.d.ts +9 -13
  70. package/lib/shape/label/position/default.js +7 -2
  71. package/lib/shape/label/position/default.js.map +1 -1
  72. package/lib/shape/text/advance.js +5 -2
  73. package/lib/shape/text/advance.js.map +1 -1
  74. package/lib/spec/component.d.ts +11 -12
  75. package/lib/spec/composition.d.ts +1 -1
  76. package/lib/spec/index.d.ts +2 -1
  77. package/lib/spec/index.js.map +1 -1
  78. package/lib/spec/interaction.d.ts +1 -2
  79. package/lib/spec/mark.d.ts +1 -1
  80. package/lib/theme/academy.js +11 -32
  81. package/lib/theme/academy.js.map +1 -1
  82. package/lib/theme/classic.js +12 -33
  83. package/lib/theme/classic.js.map +1 -1
  84. package/lib/theme/classicDark.js +11 -32
  85. package/lib/theme/classicDark.js.map +1 -1
  86. package/package.json +9 -6
  87. package/src/api/chart.ts +10 -1
  88. package/src/api/mark/types.ts +5 -2
  89. package/src/component/legendCategory.ts +26 -32
  90. package/src/component/legendContinuous.ts +1 -1
  91. package/src/component/title.ts +11 -15
  92. package/src/mark/point.ts +1 -1
  93. package/src/runtime/component.ts +76 -29
  94. package/src/runtime/layout.ts +3 -3
  95. package/src/runtime/mark.ts +10 -1
  96. package/src/runtime/plot.ts +10 -8
  97. package/src/runtime/scale.ts +30 -15
  98. package/src/runtime/types/common.ts +16 -18
  99. package/src/runtime/types/theme.ts +13 -17
  100. package/src/shape/label/position/default.ts +8 -2
  101. package/src/shape/text/advance.ts +7 -2
  102. package/src/spec/component.ts +11 -12
  103. package/src/spec/composition.ts +1 -1
  104. package/src/spec/index.ts +2 -1
  105. package/src/spec/interaction.ts +1 -2
  106. package/src/spec/mark.ts +1 -1
  107. package/src/theme/academy.ts +12 -32
  108. package/src/theme/classic.ts +13 -33
  109. package/src/theme/classicDark.ts +12 -32
package/dist/g2.min.js CHANGED
@@ -1,10 +1,10 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G2={})}(this,function(E){"use strict";var S="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},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 X(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 j(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 M(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,n={exports:{}};function z(){}function W(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function G(t,e,n,r,i){if("function"!=typeof n)throw new TypeError("The listener must be a function");n=new W(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 H(t,e){0==--t._eventsCount?t._events=new z:delete t._events[e]}function V(){this._events=new z,this._eventsCount=0}r=n,D=Object.prototype.hasOwnProperty,F="~",Object.create&&(z.prototype=Object.create(null),(new z).__proto__||(F=!1)),V.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},V.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},V.prototype.listenerCount=function(t){t=F?F+t:t,t=this._events[t];return t?t.fn?1:t.length:0},V.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},V.prototype.on=function(t,e,n){return G(this,t,e,n,!1)},V.prototype.once=function(t,e,n){return G(this,t,e,n,!0)},V.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||H(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:H(this,t)}}else H(this,t);return this},V.prototype.removeAllListeners=function(t){return t?(t=F?F+t:t,this._events[t]&&H(this,t)):(this._events=new z,this._eventsCount=0),this},V.prototype.off=V.prototype.removeListener,V.prototype.addListener=V.prototype.on,V.prefixed=F,r.exports=V.EventEmitter=V;var Y=n.exports,q=1e-6,$="undefined"!=typeof Float32Array?Float32Array:Array;function U(){var t=new $(9);return $!=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 K=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 Z(){var t=new $(16);return $!=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 Q(t){var e=new $(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}function J(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 tt(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 et(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 nt(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 rt(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,k=u*g-h*p,O=u*y-f*p,E=u*e-d*p,S=h*y-f*g,A=h*e-d*g,_=f*e-d*y,T=m*_-v*A+b*S+x*E-w*O+M*k;return T?(t[0]=(s*_-l*A+c*S)*(T=1/T),t[1]=(i*A-r*_-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*_-c*O)*T,t[5]=(n*_-i*E+a*O)*T,t[6]=(y*b-p*M-e*v)*T,t[7]=(u*M-f*b+d*v)*T,t[8]=(o*A-s*E+c*k)*T,t[9]=(r*E-n*A-a*k)*T,t[10]=(p*w-g*b+e*m)*T,t[11]=(h*b-u*w-d*m)*T,t[12]=(s*O-o*S-l*k)*T,t[13]=(n*S-r*O+i*k)*T,t[14]=(g*v-p*x-y*m)*T,t[15]=(u*x-h*v+f*m)*T,t):null}function it(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 ct(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 ut(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 ht(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 ft(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 dt(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 pt(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 gt(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}function yt(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 mt(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function vt(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 bt(t,e){var n=new $(3),r=(vt(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 xt(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 wt(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 Mt(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 kt(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 Ot=kt;function Et(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 St(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)<q&&Math.abs(c-d)<q&&Math.abs(e-n)<q?et(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 At(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 _t=Object.freeze({__proto__:null,create:Z,clone:Q,copy:J,fromValues:function(t,e,n,r,i,a,o,s,l,c,u,h,f,d,p,g){var y=new $(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:tt,identity:et,transpose:nt,invert:rt,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:it,multiply:ct,translate:ut,scale:ht,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,k,O=r[0],E=r[1],r=r[2],S=Math.hypot(O,E,r);return S<q?null:(O*=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=O*E*(i=1-n)-r*S,b=E*E*i+n,x=r*E*i+O*S,w=O*r*i+E*S,M=E*r*i-O*S,k=r*r*i+n,t[0]=a*(n=O*O*i+n)+c*(m=E*O*i+r*S)+d*(r=r*O*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*k,t[9]=o*w+u*M+p*k,t[10]=s*w+h*M+g*k,t[11]=l*w+f*M+y*k,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:ft,rotateY:dt,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:pt,fromScaling:gt,fromRotation:function(t,e,n){var r,i=n[0],a=n[1],n=n[2],o=Math.hypot(i,a,n);return o<q?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:yt,fromQuat2:function(t,e){var n=new $(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)),yt(t,e,n),t},getTranslation:mt,getScaling:vt,getRotation:bt,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:xt,fromQuat:wt,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:Mt,perspective:Mt,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:kt,ortho:Ot,orthoZO:Et,lookAt:St,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:At,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],k=e[6],O=e[7],E=e[8],S=e[9],A=e[10],_=e[11],T=e[12],P=e[13],C=e[14],e=e[15];return Math.abs(n-m)<=q*Math.max(1,Math.abs(n),Math.abs(m))&&Math.abs(r-v)<=q*Math.max(1,Math.abs(r),Math.abs(v))&&Math.abs(i-b)<=q*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(a-x)<=q*Math.max(1,Math.abs(a),Math.abs(x))&&Math.abs(o-w)<=q*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-M)<=q*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(l-k)<=q*Math.max(1,Math.abs(l),Math.abs(k))&&Math.abs(c-O)<=q*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(u-E)<=q*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(h-S)<=q*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(f-A)<=q*Math.max(1,Math.abs(f),Math.abs(A))&&Math.abs(d-_)<=q*Math.max(1,Math.abs(d),Math.abs(_))&&Math.abs(p-T)<=q*Math.max(1,Math.abs(p),Math.abs(T))&&Math.abs(g-P)<=q*Math.max(1,Math.abs(g),Math.abs(P))&&Math.abs(y-C)<=q*Math.max(1,Math.abs(y),Math.abs(C))&&Math.abs(t-e)<=q*Math.max(1,Math.abs(t),Math.abs(e))},mul:ct,sub:At});function v(){var t=new $(3);return $!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Tt(t){var e=new $(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Pt(t){var e=t[0],n=t[1],t=t[2];return Math.hypot(e,n,t)}function Ct(t,e,n){var r=new $(3);return r[0]=t,r[1]=e,r[2]=n,r}function Lt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Nt(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function jt(t,e,n){t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2]}function Rt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function It(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function Bt(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 Dt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Ft(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 zt(t,e,n,r){var i=e[0],a=e[1],e=e[2];t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t[2]=e+r*(n[2]-e)}function Wt(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 Gt(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 Ht(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)<=q*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(r-a)<=q*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(t-e)<=q*Math.max(1,Math.abs(t),Math.abs(e))}var Vt=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],e=e[2]-t[2];return Math.hypot(n,r,e)},Yt=Pt;function qt(){var t=new $(4);return $!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function $t(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 Ut(){var t=new $(4);return $!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Xt(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 Kt(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 Zt(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 Qt(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}v(),qt();var Jt=function(t,e,n,r){var i=new $(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},te=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},ee=Kt,ne=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 re(t){return t.map(function(t){return Array.isArray(t)?[].concat(t):t})}v(),Ct(1,0,0),Ct(0,1,0),Ut(),Ut(),U(),r=new $(2),$!=Float32Array&&(r[0]=0,r[1]=0);var ie={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};var ae={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function oe(t){return Array.isArray(t)&&t.every(function(t){var e=t[0].toLowerCase();return ae[e]===t.length-1&&"achlmqstvz".includes(e)})}function se(t){return oe(t)&&t.every(function(t){t=t[0];return t===t.toUpperCase()})}function le(t){return se(t)&&t.every(function(t){t=t[0];return"ACLMQZ".includes(t)})}function ce(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=ae[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,ae[n]))),ae[n]););}function ue(t){return 48<=t&&t<=57}function he(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 fe(t){var e,n,r,i,a,o=t.max,s=t.pathValue,l=t.index,c=s.charCodeAt(l),u=ae[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,he(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(ue(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&&ue(n))return t.err="[path-util]: Invalid path value at index "+a+', "'+i[a]+'" illegal number';for(;o<r&&ue(i.charCodeAt(o));)o+=1,s=!0;n=i.charCodeAt(o)}if(46===n){for(c=!0,o+=1;ue(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&&ue(i.charCodeAt(o))))return t.err="[path-util]: Invalid path value at index "+o+', "'+i[o]+'" invalid integer exponent';for(;o<r&&ue(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),he(t),t.index<o&&44===s.charCodeAt(t.index)&&(t.index+=1,he(t))}if(t.index>=t.max)break;if(!(48<=(e=s.charCodeAt(t.index))&&e<=57||43===e||45===e||46===e))break}ce(t)}else t.err='[path-util]: Invalid path value "'+s[l]+'" is not a path command'}var de=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 pe(t){var o,s,l,c;return se(t)?re(t):(t=function(t){if(oe(t))return re(t);var e=new de(t);for(he(e);e.index<e.max&&!e.err.length;)fe(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 ge(t){if(le(t))return re(t);for(var e,n,r,i,a,o,s,l=pe(t),c=m({},ie),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 ye(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function me(t,e,n,r,i,a,o,s,l,c){var u=120*Math.PI/180,h=Math.PI/180*(+i||0),f=[],d=(c?(b=c[0],x=c[1],m=c[2],v=c[3]):(t=(g=ye(t,e,-h)).x,e=g.y,1<(d=(p=(t-(s=(g=ye(s,l,-h)).x))/2)*p/(n*n)+(g=(e-(l=g.y))/2)*g/(r*r))&&(n*=d=Math.sqrt(d),r*=d),d=n*n,y=r*r,m=(a=(a===o?-1:1)*Math.sqrt(Math.abs((d*y-d*g*g-y*p*p)/(d*g*g+y*p*p))))*n*g/r+(t+s)/2,v=a*-r*p/n+(e+l)/2,b=Math.asin(((e-v)/r*Math.pow(10,9)>>0)/Math.pow(10,9)),x=Math.asin(((l-v)/r*Math.pow(10,9)>>0)/Math.pow(10,9)),b=t<m?Math.PI-b:b,x=s<m?Math.PI-x:x,b<0&&(b=2*Math.PI+b),x<0&&(x=2*Math.PI+x),o&&x<b&&(b-=2*Math.PI),!o&&b<x&&(x-=2*Math.PI)),x-b),p=(Math.abs(d)>u&&(y=x,g=s,a=l,x=b+u*(o&&b<x?1:-1),f=me(s=m+n*Math.cos(x),l=v+r*Math.sin(x),n,r,i,0,o,g,a,[x,y,m,v])),d=x-b,Math.cos(b)),u=Math.sin(b),i=Math.cos(x),o=Math.sin(x),g=Math.tan(d/4),a=4/3*n*g,y=4/3*r*g,m=[t,e],v=[t+a*u,e-y*p],b=[s+a*o,l-y*i],x=[s,l];if(v[0]=2*m[0]-v[0],v[1]=2*m[1]-v[1],c)return v.concat(b,x,f);for(var w=[],M=0,k=(f=v.concat(b,x,f)).length;M<k;M+=1)w[M]=M%2?ye(f[M-1],f[M],h).y:ye(f[M],f[M+1],h).x;return w}function ve(t,e,n){var r=t[0],t=t[1];return[r+(e[0]-r)*n,t+(e[1]-t)*n]}function be(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function xe(t,e,n,r,i){var a=be([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=ve([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 we(t,e,n,r){var t=[t,e],e=[n,r],i=ve(t,e,.5),e=ve(e,i,.5),a=ve(i,e,.5),o=ve(e,a,.5),s=ve(a,o,.5),t=xe(t[0],t[1],i[0],i[1],a[0]).point,i=xe(s[0],s[1],o[0],o[1],e[0]).point;return[t.x,t.y,i.x,i.y,n,r]}function Me(t,e){var n;if(void 0===e&&(e=!1),le(n=t)&&n.every(function(t){t=t[0];return"MC".includes(t)}))return n=re(t),e?[n,[]]:n;for(var r,i=ge(t),a=m({},ie),o=[],s="",l=i.length,c=[],u=0;u<l;u+=1){i[u]&&(s=i[u][0]),o[u]=s;var h=function(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(me(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(we(f,d,u,h));case"Z":return f===p&&d===g?["C",f,d,p,g,p,g]:["C"].concat(we(f,d,p,g))}return t}(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 ke(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 Oe(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,k,O,E,S,A,_,T,P,C,L,N,j,R=0;R<=u;R+=1)b=t,x=e,w=n,M=r,k=i,O=I,E=B,S=a,A=o,_=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*((k%360+360)%360),f=(T=b===S&&x===A?{x:b,y:x}:0===w||0===P?xe(b,x,S,A,_).point:(k=(b-S)/2,T=(x-A)/2,k={x:L(M)*k+C(M)*T,y:-C(M)*k+L(M)*T},1<(T=Math.pow(k.x,2)/Math.pow(w,2)+Math.pow(k.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(k.y,2)-Math.pow(P,2)*Math.pow(k.x,2))/(Math.pow(w,2)*Math.pow(k.y,2)+Math.pow(P,2)*Math.pow(k.x,2)),O=(O!==E?1:-1)*N(T<0?0:T),N=w*k.y/P*O,T=-P*k.x/w*O,O=L(M)*N-C(M)*T+(b+S)/2,b=C(M)*N+L(M)*T+(x+A)/2,x=ke({x:1,y:0},S={x:(k.x-N)/w,y:(k.y-T)/P}),A=ke(S,{x:(-k.x-N)/w,y:(-k.y-T)/P}),!E&&0<A?A-=2*j:E&&A<0&&(A+=2*j),S=x+(A%=2*j)*_,N=w*L(S),k=P*C(S),{x:L(M)*N-C(M)*k+O,y:C(M)*N+L(M)*k+b})).x,d=T.y,D&&v.push({x:f,y:d}),F&&(p+=be(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 Ee(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,k,O,E,S,A,_,T,P,C,L=0;L<=d;L+=1)M=t,k=e,O=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*O+3*C*Math.pow(P,2)*S+Math.pow(P,3)*_,y:Math.pow(C,3)*k+3*Math.pow(C,2)*P*E+3*C*Math.pow(P,2)*A+Math.pow(P,3)*T}).x,y=M.y,h&&w.push({x:g,y:y}),f&&(m+=be(b,[g,y])),b=[g,y],p&&l<=m&&l>v[2]&&(O=(m-l)/(m-v[2]),x={x:b[0]*(1-O)+v[0]*O,y:b[1]*(1-O)+v[1]*O}),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 Se(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,k,O,E,S,A,_=0;_<=h;_+=1)x=t,w=e,M=n,k=r,O=i,E=a,A=void 0,A=1-(S=_/h),d=(x={x:Math.pow(A,2)*x+2*A*S*M+Math.pow(S,2)*O,y:Math.pow(A,2)*w+2*A*S*k+Math.pow(S,2)*E}).x,p=x.y,c&&b.push({x:d,y:p}),u&&(g+=be(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 Ae(t,e,n){for(var r,i,a,o=ge(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=xe(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=Oe(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=Ee(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=Se(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=xe((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 _e(t){return(c=l=s=0)<=Me(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 Te(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?Ee(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=ve(n,i,r),i=ve(i,a,r),a=ve(a,e,r),o=ve(n,i,r),i=ve(i,a,r),r=ve(o,i,r),[["C"].concat(n,o,r),["C"].concat(i,a,e)]):[t,t]:[t];return{s:t,ss:n,l:s}})}var Pe=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},Ce=function(t){return"function"==typeof t},A=function(t){return null==t},Le={}.toString,Ne=function(t,e){return Le.call(t)==="[object "+e+"]"},je=function(t){return Array.isArray?Array.isArray(t):Ne(t,"Array")},Re=function(t){var e=typeof t;return null!==t&&"object"==e||"function"==e};var Ie=function(t){return"object"==typeof t&&null!==t},Be=function(t){if(!Ie(t)||!Ne(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},De=function(t){if(je(t))return t.reduce(function(t,e){return Math.max(t,e)},t[0])},Fe=function(t){if(je(t))return t.reduce(function(t,e){return Math.min(t,e)},t[0])},ze=function(t,n,e){if(!je(t)&&!Be(t))return t;var r=e,i=t,a=function(t,e){r=n(r,t,e)};if(i)if(je(i))for(var o=0,s=i.length;o<s&&!1!==a(i[o],o);o++);else if(Re(i))for(var l in i)if(i.hasOwnProperty(l)&&!1===a(i[l],l))break;return r},We=function(t){return Ne(t,"String")};var Ge=function(t,e,n){return t<e?e:n<t?n:t},He=function(t){return Ne(t,"Number")};function Ve(t,e,n){return void 0===n&&(n=1e-5),Math.abs(t-e)<n}function Ye(t){return A(t)?"":t.toString()}var qe=function(t,e){return(t%e+e)%e},$e=function(t){t=Ye(t);return t.charAt(0).toLowerCase()+t.substring(1)};function Ue(t){if("object"!=typeof t||null===t)return t;if(je(t))for(var e=[],n=0,r=t.length;n<r;n++)"object"==typeof t[n]&&null!=t[n]?e[n]=Ue(t[n]):e[n]=t[n];else for(var i in e={},t)"object"==typeof t[i]&&null!=t[i]?e[i]=Ue(t[i]):e[i]=t[i];return e}var Xe=function(t){t=Ye(t);return t.charAt(0).toUpperCase()+t.substring(1)},Ke=function(t){return Ne(t,"Boolean")},Ze=function(t){return void 0===t},Qe=Ue;function Je(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 tn(a,o){var s;if(Ce(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 en=5;function nn(t,e){if(t===e)return!0;if(t&&e&&!We(t)&&!We(e)){if(Pe(t)||Pe(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;r<t.length&&(n=nn(t[r],e[r]));r++);return n}if(Ie(t)||Ie(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=nn(t[i[r]],e[i[r]]));r++);return n}}return!1}function rn(t,r){return ze(t,function(t,e,n){return r.includes(n)||(t[n]=e),t},{})}function an(){}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||en,n){var o;n.hasOwnProperty(a)&&(null!==(o=n[a])&&Be(o)?(Be(e[a])||(e[a]={}),r<i?t(e[a],o,r+1,i):e[a]=n[a]):je(o)?(e[a]=[],e[a]=e[a].concat(o)):void 0!==o&&(e[a]=o))}}(t,e[r]);return t},on=nn,sn=function(t,e,n){for(var r=0,i=We(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return void 0===t||r<i.length?n:t},ln=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 cn(t,e,n){(t.prototype=e.prototype=n).constructor=t}function un(t,e){var n,r=Object.create(t.prototype);for(n in e)r[n]=e[n];return r}function hn(){}var n="\\s*([+-]?\\d+)\\s*",r="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",fn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",dn=/^#([0-9a-f]{3,8})$/,pn=new RegExp("^rgb\\("+[n,n,n]+"\\)$"),gn=new RegExp("^rgb\\("+[fn,fn,fn]+"\\)$"),yn=new RegExp("^rgba\\("+[n,n,n,r]+"\\)$"),mn=new RegExp("^rgba\\("+[fn,fn,fn,r]+"\\)$"),vn=new RegExp("^hsl\\("+[r,fn,fn]+"\\)$"),bn=new RegExp("^hsla\\("+[r,fn,fn,r]+"\\)$"),xn={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 wn(){return this.rgb().formatHex()}function Mn(){return this.rgb().formatRgb()}function kn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=dn.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?On(e):3===n?new Sn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?En(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?En(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=pn.exec(t))?new Sn(e[1],e[2],e[3],1):(e=gn.exec(t))?new Sn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=yn.exec(t))?En(e[1],e[2],e[3],e[4]):(e=mn.exec(t))?En(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=vn.exec(t))?Pn(e[1],e[2]/100,e[3]/100,1):(e=bn.exec(t))?Pn(e[1],e[2]/100,e[3]/100,e[4]):xn.hasOwnProperty(t)?On(xn[t]):"transparent"===t?new Sn(NaN,NaN,NaN,0):null}function On(t){return new Sn(t>>16&255,t>>8&255,255&t,1)}function En(t,e,n,r){return new Sn(t=r<=0?e=n=NaN:t,e,n,r)}function Sn(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function An(){return"#"+Tn(this.r)+Tn(this.g)+Tn(this.b)}function _n(){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 Tn(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Pn(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||1<=n?t=e=NaN:e<=0&&(t=NaN),new Ln(t,e,n,r)}function Cn(t){var e,n,r,i,a,o,s,l;return t instanceof Ln?new Ln(t.h,t.s,t.l,t.opacity):(t=t instanceof hn?t:kn(t))?t instanceof Ln?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 Ln(o,s,l,t.opacity)):new Ln}function Ln(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Nn(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 jn(t,e,n,r){t-=n,n=e-r;return Math.sqrt(t*t+n*n)}function Rn(t,e){var n=Math.min.apply(Math,M([],j(t),!1)),r=Math.min.apply(Math,M([],j(e),!1));return{x:n,y:r,width:Math.max.apply(Math,M([],j(t),!1))-n,height:Math.max.apply(Math,M([],j(e),!1))-r}}function In(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,k,O,h=0;h<x.length;h++){M=e,E=r,k=i,O=x[h];var E=n*Math.sin(k)*Math.cos(O)+E*Math.cos(k)*Math.sin(O)+M;E<v&&(v=E),b<E&&(b=E)}return{x:l,y:v,width:c-l,height:b-v}}cn(hn,kn,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:wn,formatHex:wn,formatHsl:function(){return Cn(this).formatHsl()},formatRgb:Mn,toString:Mn}),cn(Sn,function(t,e,n,r){return 1===arguments.length?(i=(i=t)instanceof hn?i:kn(i))?new Sn((i=i.rgb()).r,i.g,i.b,i.opacity):new Sn:new Sn(t,e,n,null==r?1:r);var i},un(hn,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Sn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Sn(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:An,formatHex:An,formatRgb:_n,toString:_n})),cn(Ln,function(t,e,n,r){return 1===arguments.length?Cn(t):new Ln(t,e,n,null==r?1:r)},un(hn,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Ln(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Ln(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 Sn(Nn(240<=t?t-240:120+t,n,e),Nn(t,n,e),Nn(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 Bn(t,e,n,r,i,a){for(var o=-1,s=1/0,l=[n,r],c=20,u=1/(c=a&&200<a?a/10:c),h=u/10,f=0;f<=c;f++){var d=f*u,p=[i.apply(void 0,M([],j(t.concat([d])),!1)),i.apply(void 0,M([],j(e.concat([d])),!1))];(m=jn(l[0],l[1],p[0],p[1]))<s&&(o=d,s=m)}if(0===o)return{x:t[0],y:e[0]};if(1===o)return{x:t[(n=t.length)-1],y:e[n-1]};for(s=1/0,f=0;f<32&&!(h<1e-4);f++){var g=o-h,y=o+h,p=[i.apply(void 0,M([],j(t.concat([g])),!1)),i.apply(void 0,M([],j(e.concat([g])),!1))],m=jn(l[0],l[1],p[0],p[1]);0<=g&&m<s?(o=g,s=m):(g=[i.apply(void 0,M([],j(t.concat([y])),!1)),i.apply(void 0,M([],j(e.concat([y])),!1))],g=jn(l[0],l[1],g[0],g[1]),y<=1&&g<s?(o=y,s=g):h*=.5)}return{x:i.apply(void 0,M([],j(t.concat([o])),!1)),y:i.apply(void 0,M([],j(e.concat([o])),!1))}}function Dn(t,e,n,r){return jn(t,e,n,r)}function Fn(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function zn(t,e,n,r,i,a){var o,s,l,n=[n-t,r-e];return(r=n)[0]===(o=[0,0])[0]&&r[1]===o[1]?Math.sqrt((i-t)*(i-t)+(a-e)*(a-e)):(s=(n=o=r=[-n[1],n[0]])[0],l=n[1],0<(s=s*s+l*l)&&(s=1/Math.sqrt(s)),o[0]=n[0]*s,o[1]=n[1]*s,l=[i-t,a-e],Math.abs(l[0]*r[0]+l[1]*r[1]))}function Wn(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 Gn(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 Ve(r,0)?Ve(n,0)||0<=(i=-e/n)&&i<=1&&t.push(i):Ve(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 Hn(t,e,n,r,i,a,o,s,l,c,u){t=Bn([t,n,i,o],[e,r,a,s],l,c,Wn,u);return jn(t.x,t.y,l,c)}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+=jn(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 Ve(n,0)?[.5]:(t=(t-e)/n)<=1&&0<=t?[t]:[]}function $n(t,e,n,r,i,a,o,s){t=Bn([t,n,i],[e,r,a],o,s,Yn);return jn(t.x,t.y,o,s)}function Un(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(Xn(e,r,n),0<a(e[i],h)&&Xn(e,r,i);f<d;){for(Xn(e,f,d),f++,d--;a(e[f],h)<0;)f++;for(;0<a(e[d],h);)d--}0===a(e[r],h)?Xn(e,r,d):Xn(e,++d,i),d<=n&&(r=d+1),n<=d&&(i=d-1)}}(t,e,n||0,r||t.length-1,i||Kn)}function Xn(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Kn(t,e){return t<e?-1:e<t?1:0}function Zn(t,e){Qn(t,0,t.children.length,e,t)}function Qn(t,e,n,r,i){(i=i||or(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 tr(t,e){return t.minX-e.minX}function er(t,e){return t.minY-e.minY}function nr(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function rr(t){return t.maxX-t.minX+(t.maxY-t.minY)}function ir(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function ar(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function or(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function sr(t,e,n,r,i){for(var a,o=[e,n];o.length;)(n=o.pop())-(e=o.pop())<=r||(Un(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(ar(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;ar(t,s)&&(e.leaf?n.push(o):ir(t,s)?this._all(o,n):i.push(o))}e=i.pop()}return n},n.prototype.collides=function(t){var e=this.data;if(ar(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(ar(t,a)){if(e.leaf||ir(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=or([]),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||!ir(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)Zn(i=or(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=or([])).leaf=!1,i.height=r;var s=Math.ceil(a/o),l=s*Math.ceil(Math.sqrt(o));sr(t,e,n,l,this.compareMinX);for(var c=e;c<=n;c+=l){var u=Math.min(c+l-1,n);sr(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))}}Zn(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=nr(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=or(n.children.splice(i,n.children.length-i));r.height=n.height,r.leaf=n.leaf,Zn(n,this.toBBox),Zn(r,this.toBBox),e?t[e-1].children.push(r):this._splitRoot(n,r)},n.prototype._splitRoot=function(t,e){this.data=or([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Zn(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=Qn(t,0,c,this.toBBox),h=Qn(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=nr(u)+nr(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:tr,i=t.leaf?this.compareMinY:er;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=Qn(t,0,e,i),o=Qn(t,n-e,n,i),s=rr(a)+rr(o),l=e;l<n-e;l++){var c=t.children[l];Jn(a,t.leaf?i(c):c),s+=rr(a)}for(var u=n-e-1;e<=u;u--){var h=t.children[u];Jn(o,t.leaf?i(h):h),s+=rr(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():Zn(t[e],this.toBBox)};var k,lr,cr=n,n=((fn=k=k||{}).GROUP="g",fn.CIRCLE="circle",fn.ELLIPSE="ellipse",fn.IMAGE="image",fn.RECT="rect",fn.LINE="line",fn.POLYLINE="polyline",fn.POLYGON="polygon",fn.TEXT="text",fn.PATH="path",fn.HTML="html",fn.MESH="mesh",(r=lr=lr||{})[r.ZERO=0]="ZERO",r[r.NEGATIVE_ONE=1]="NEGATIVE_ONE",ur.prototype.addRenderingPlugin=function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)},ur.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)})},ur);function ur(){this.plugins=[]}hr.prototype.registerPlugin=function(e){-1===this.plugins.findIndex(function(t){return t===e})&&this.plugins.push(e)},hr.prototype.unregisterPlugin=function(e){var t=this.plugins.findIndex(function(t){return t===e});-1<t&&this.plugins.splice(t,1)},hr.prototype.getPlugins=function(){return this.plugins},hr.prototype.getPlugin=function(e){return this.plugins.find(function(t){return t.name===e})},hr.prototype.getConfig=function(){return this.config},hr.prototype.setConfig=function(t){Object.assign(this.config,t)};fn=hr;function hr(t){this.clipSpaceNearZ=lr.NEGATIVE_ONE,this.plugins=[],this.config=m({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1},t)}function fr(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function dr(t,e,n){t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2]}function pr(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function gr(t,e,n){t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n}function yr(t){return void 0===t?0:360<t||t<-360?t%360:t}function mr(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Array.isArray(t)&&3===t.length?Tt(t):He(t)?Ct(t,e,n):Ct(t[0],t[1]||e,t[2]||n)}function vr(t){return t*(Math.PI/180)}function br(t){return t*(180/Math.PI)}function xr(t,e){return 16===e.length?(n=t,r=e,o=.5*Math.PI,s=(c=j(vt(v(),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 wr(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 $(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 Mr(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=br(Math.atan2(n,e));return[t[6],t[7],a,o,r]}var kr=Z(),Or=Z(),Er=qt(),d=[v(),v(),v()],Sr=v();function Ar(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}(kr,t)&&(J(Or,kr),Or[3]=0,Or[7]=0,Or[11]=0,Or[15]=1,!(Math.abs(it(Or))<1e-8))){var t=kr[3],o=kr[7],s=kr[11],l=kr[12],c=kr[13],u=kr[14],h=kr[15];if(0!==t||0!==o||0!==s){if(Er[0]=t,Er[1]=o,Er[2]=s,Er[3]=h,!rt(Or,Or))return;nt(Or,Or),$t(i,Er,Or)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=l,e[1]=c,e[2]=u,t=kr,(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]=Pt(d[0]),Bt(d[0],d[0]),r[0]=Dt(d[0],d[1]),_r(d[1],d[1],d[0],1,-r[0]),n[1]=Pt(d[1]),Bt(d[1],d[1]),r[0]/=n[1],r[1]=Dt(d[0],d[2]),_r(d[2],d[2],d[0],1,-r[1]),r[2]=Dt(d[1],d[2]),_r(d[2],d[2],d[1],1,-r[2]),n[2]=Pt(d[2]),Bt(d[2],d[2]),r[1]/=n[2],r[2]/=n[2],Ft(Sr,d[1],d[2]),Dt(d[0],Sr)<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 _r(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}Pr.isEmpty=function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]},Pr.prototype.update=function(t,e){fr(this.center,t),fr(this.halfExtents,e),dr(this.min,this.center,this.halfExtents),pr(this.max,this.center,this.halfExtents)},Pr.prototype.setMinMax=function(t,e){pr(this.center,e,t),gr(this.center,this.center,.5),dr(this.halfExtents,e,t),gr(this.halfExtents,this.halfExtents,.5),fr(this.min,t),fr(this.max,e)},Pr.prototype.getMin=function(){return this.min},Pr.prototype.getMax=function(){return this.max},Pr.prototype.add=function(t){var e,n,r,i,a,o,s,l,c,u,h,f,d,p,g;Pr.isEmpty(t)||(Pr.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))},Pr.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],dr(this.min,n,r),pr(this.max,n,r)},Pr.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]},Pr.prototype.intersection=function(t){var e,n,r,i;return this.intersects(t)?(e=new Pr,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},Pr.prototype.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?fr([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]]},Pr.prototype.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?fr([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 Tr=Pr;function Pr(){this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}Nr.prototype.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(0<=this.normal[0])<<8)+(Number(0<=this.normal[1])<<4)+Number(0<=this.normal[2])},Nr.prototype.distanceToPoint=function(t){return Dt(t,this.normal)-this.distance},Nr.prototype.normalize=function(){var t=1/Yt(this.normal);It(this.normal,this.normal,t),this.distance*=t},Nr.prototype.intersectsLine=function(t,e,n){var r=this.distanceToPoint(t),r=r/(r-this.distanceToPoint(e)),i=0<=r&&r<=1;return i&&n&&zt(n,t,e,r),i};var Cr,Lr=Nr;function Nr(t,e){this.distance=t||0,this.normal=e||Ct(0,1,0),this.updatePNVertexFlag()}(r=Cr=Cr||{})[r.OUTSIDE=4294967295]="OUTSIDE",r[r.INSIDE=0]="INSIDE",r[r.INDETERMINATE=2147483647]="INDETERMINATE";Rr.prototype.extractFromVPMatrix=function(t){var t=j(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];Nt(this.planes[0].normal,i-e,l-a,f-c),this.planes[0].distance=t-d,Nt(this.planes[1].normal,i+e,l+a,f+c),this.planes[1].distance=t+d,Nt(this.planes[2].normal,i+n,l+o,f+u),this.planes[2].distance=t+p,Nt(this.planes[3].normal,i-n,l-o,f-u),this.planes[3].distance=t-p,Nt(this.planes[4].normal,i-r,l-s,f-h),this.planes[4].distance=t-g,Nt(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 jr=Rr;function Rr(t){if(this.planes=[],t)this.planes=t;else for(var e=0;e<6;e++)this.planes.push(new Lr)}Br.prototype.clone=function(){return new Br(this.x,this.y)},Br.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y};var Ir=Br;function Br(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}Fr.prototype.toJSON=function(){};var Dr=Fr;function Fr(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 zr,Wr,Gr,Hr="Method not implemented.",Vr="Use document.documentElement instead.";(r=zr=zr||{})[r.ORBITING=0]="ORBITING",r[r.EXPLORING=1]="EXPLORING",r[r.TRACKING=2]="TRACKING",(r=Wr=Wr||{})[r.DEFAULT=0]="DEFAULT",r[r.ROTATIONAL=1]="ROTATIONAL",r[r.TRANSLATIONAL=2]="TRANSLATIONAL",r[r.CINEMATIC=3]="CINEMATIC",(r=Gr=Gr||{})[r.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",r[r.PERSPECTIVE=1]="PERSPECTIVE";var g,Yr,qr,$r,Ur="updated",r=(i.prototype.isOrtho=function(){return this.projectionMode===Gr.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===zr.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===zr.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!==zr.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 rt(Z(),this.matrix)},i.prototype.getWorldTransform=function(){return this.matrix},i.prototype.jitterProjectionMatrix=function(t,e){t=pt(Z(),[t,e,0]);this.jitteredProjectionMatrix=ct(Z(),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===Gr.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===Gr.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===Gr.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===Gr.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===Gr.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===Gr.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=Ct(t.x-r,t.y-n,0),e=Dt(i,this.right)/Pt(this.right),r=Dt(i,this.up)/Pt(this.up);return this.pan(-e,-r),this},i.prototype.setPerspective=function(t,e,n,r){this.projectionMode=Gr.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(vr(.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===lr.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,ht(this.projectionMatrix,this.projectionMatrix,Ct(1,-1,1)),rt(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},i.prototype.setOrthographic=function(t,e,n,r,i,a){this.projectionMode=Gr.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===lr.NEGATIVE_ONE?Ot:Et)(this.projectionMatrix,s,n,r,e,i,a),ht(this.projectionMatrix,this.projectionMatrix,Ct(1,-1,1)),rt(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},i.prototype.setPosition=function(t,e,n){t=mr(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=Ct(0,1,0);return this.focalPoint=mr(t,e,n),this.trackingMode===Wr.CINEMATIC&&(t=(r=Rt(v(),this.focalPoint,this.position))[0],e=r[1],n=r[2],r=Pt(r),e=br(Math.asin(e/r)),r=90+br(Math.atan2(n,t)),dt(n=Z(),n,vr(r)),ft(n,n,vr(e)),i=Wt(v(),[0,1,0],n)),rt(this.matrix,St(Z(),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=v(),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=yr(t),this.computeMatrix(),this._getAxes(),this.type===zr.ORBITING||this.type===zr.EXPLORING?this._getPosition():this.type===zr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},i.prototype.getAzimuth=function(){return this.azimuth},i.prototype.setElevation=function(t){return this.elevation=yr(t),this.computeMatrix(),this._getAxes(),this.type===zr.ORBITING||this.type===zr.EXPLORING?this._getPosition():this.type===zr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},i.prototype.getElevation=function(){return this.elevation},i.prototype.setRoll=function(t){return this.roll=yr(t),this.computeMatrix(),this._getAxes(),this.type===zr.ORBITING||this.type===zr.EXPLORING?this._getPosition():this.type===zr.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=Xt(Ut(),[0,0,1],vr(this.roll)),e=(et(this.matrix),Xt(Ut(),[1,0,0],vr((this.rotateWorld&&this.type!==zr.TRACKING||this.type===zr.TRACKING?1:-1)*this.elevation))),n=Xt(Ut(),[0,1,0],vr((this.rotateWorld&&this.type!==zr.TRACKING||this.type===zr.TRACKING?1:-1)*this.azimuth)),n=Kt(Ut(),n,e),n=Kt(Ut(),n,t),e=wt(Z(),n);this.type===zr.ORBITING||this.type===zr.EXPLORING?(ut(this.matrix,this.matrix,this.focalPoint),ct(this.matrix,this.matrix,e),ut(this.matrix,this.matrix,[0,0,this.distance])):this.type===zr.TRACKING&&(ut(this.matrix,this.matrix,this.position),ct(this.matrix,this.matrix,e))},i.prototype._setPosition=function(t,e,n){this.position=mr(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(){Lt(this.right,mr($t(qt(),[1,0,0,0],this.matrix))),Lt(this.up,mr($t(qt(),[0,1,0,0],this.matrix))),Lt(this.forward,mr($t(qt(),[0,0,1,0],this.matrix))),Bt(this.right,this.right),Bt(this.up,this.up),Bt(this.forward,this.forward)},i.prototype._getAngles=function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=Pt(this.distanceVector);0===r?(this.elevation=0,this.azimuth=0):this.type===zr.TRACKING||this.rotateWorld?(this.elevation=br(Math.asin(e/r)),this.azimuth=br(Math.atan2(-t,-n))):(this.elevation=-br(Math.asin(e/r)),this.azimuth=-br(Math.atan2(-t,-n)))},i.prototype._getPosition=function(){Lt(this.position,mr($t(qt(),[0,0,0,1],this.matrix))),this._getDistance()},i.prototype._getFocalPoint=function(){var t,e;Gt(this.distanceVector,[0,0,-this.distance],(t=U(),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)),jt(this.focalPoint,this.position,this.distanceVector),this._getDistance()},i.prototype._getDistance=function(){this.distanceVector=Rt(v(),this.focalPoint,this.position),this.distance=Pt(this.distanceVector),this.dollyingStep=this.distance/100},i.prototype._getOrthoMatrix=function(){var t,e;this.projectionMode===Gr.ORTHOGRAPHIC&&(t=this.position,e=Xt(Ut(),[0,0,1],-this.roll*Math.PI/180),xt(this.orthoMatrix,e,Ct((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),Ct(this.zoom,this.zoom,1),t))},i.prototype.triggerUpdate=function(){var t;this.enableUpdate&&(t=this.getViewTransform(),t=ct(Z(),this.getPerspective(),t),this.getFrustum().extractFromVPMatrix(t),this.eventEmitter.emit(Ur))},i.prototype.rotate=function(t,e,n){throw new Error(Hr)},i.prototype.pan=function(t,e){throw new Error(Hr)},i.prototype.dolly=function(t){throw new Error(Hr)},i.prototype.createLandmark=function(t,e){throw new Error(Hr)},i.prototype.gotoLandmark=function(t,e){throw new Error(Hr)},i.prototype.cancelLandmarkAnimation=function(){throw new Error(Hr)},i);function i(){this.clipSpaceNearZ=lr.NEGATIVE_ONE,this.eventEmitter=new Y,this.matrix=Z(),this.right=Ct(1,0,0),this.up=Ct(0,1,0),this.forward=Ct(0,0,1),this.position=Ct(0,0,1),this.focalPoint=Ct(0,0,0),this.distanceVector=Ct(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=Z(),this.projectionMatrixInverse=Z(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=zr.EXPLORING,this.trackingMode=Wr.DEFAULT,this.projectionMode=Gr.PERSPECTIVE,this.frustum=new jr,this.orthoMatrix=Z()}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,(a=g=g||{})[a.kUnknown=0]="kUnknown",a[a.kNumber=1]="kNumber",a[a.kPercentage=2]="kPercentage",a[a.kEms=3]="kEms",a[a.kPixels=4]="kPixels",a[a.kRems=5]="kRems",a[a.kDegrees=6]="kDegrees",a[a.kRadians=7]="kRadians",a[a.kGradians=8]="kGradians",a[a.kTurns=9]="kTurns",a[a.kMilliseconds=10]="kMilliseconds",a[a.kSeconds=11]="kSeconds",a[a.kInteger=12]="kInteger",(a=Yr=Yr||{})[a.kUNumber=0]="kUNumber",a[a.kUPercent=1]="kUPercent",a[a.kULength=2]="kULength",a[a.kUAngle=3]="kUAngle",a[a.kUTime=4]="kUTime",a[a.kUOther=5]="kUOther",(a=qr=qr||{})[a.kYes=0]="kYes",a[a.kNo=1]="kNo",(a=$r=$r||{})[a.kYes=0]="kYes",a[a.kNo=1]="kNo";function Kr(t){var e=1;switch(t){case g.kPixels:case g.kDegrees:case g.kSeconds:break;case g.kMilliseconds:e=.001;break;case g.kRadians:e=180/Math.PI;break;case g.kGradians:e=.9;break;case g.kTurns:e=360}return e}function Zr(t){switch(t){case g.kNumber:case g.kInteger:return"";case g.kPercentage:return"%";case g.kEms:return"em";case g.kRems:return"rem";case g.kPixels:return"px";case g.kDegrees:return"deg";case g.kRadians:return"rad";case g.kGradians:return"grad";case g.kMilliseconds:return"ms";case g.kSeconds:return"s";case g.kTurns:return"turn"}return""}var Qr,Jr=[{name:"em",unit_type:g.kEms},{name:"px",unit_type:g.kPixels},{name:"deg",unit_type:g.kDegrees},{name:"rad",unit_type:g.kRadians},{name:"grad",unit_type:g.kGradians},{name:"ms",unit_type:g.kMilliseconds},{name:"s",unit_type:g.kSeconds},{name:"rem",unit_type:g.kRems},{name:"turn",unit_type:g.kTurns}],ti=((a=Qr=Qr||{})[a.kUnknownType=0]="kUnknownType",a[a.kUnparsedType=1]="kUnparsedType",a[a.kKeywordType=2]="kKeywordType",a[a.kUnitType=3]="kUnitType",a[a.kSumType=4]="kSumType",a[a.kProductType=5]="kProductType",a[a.kNegateType=6]="kNegateType",a[a.kInvertType=7]="kInvertType",a[a.kMinType=8]="kMinType",a[a.kMaxType=9]="kMaxType",a[a.kClampType=10]="kClampType",a[a.kTransformType=11]="kTransformType",a[a.kPositionType=12]="kPositionType",a[a.kURLImageType=13]="kURLImageType",a[a.kColorType=14]="kColorType",a[a.kUnsupportedColorType=15]="kUnsupportedColorType",function(e){return Jr.find(function(t){return t.name===e}).unit_type}),a=(ei.isAngle=function(t){return t===g.kDegrees||t===g.kRadians||t===g.kGradians||t===g.kTurns},ei.isLength=function(t){return t>=g.kEms&&t<g.kDegrees},ei.isRelativeUnit=function(t){return t===g.kPercentage||t===g.kEms||t===g.kRems},ei.isTime=function(t){return t===g.kSeconds||t===g.kMilliseconds},ei.prototype.toString=function(){return this.buildCSSText(qr.kNo,$r.kNo,"")},ei.prototype.isNumericValue=function(){return this.getType()>=Qr.kUnitType&&this.getType()<=Qr.kClampType},ei);function ei(){}t(ai,ni=a),ai.prototype.getType=function(){return Qr.kColorType},ai.prototype.to=function(t){return this};var ni,ri,ii=ai;function ai(t){var e=ni.call(this)||this;return e.colorSpace=t,e}(s=ri=ri||{})[s.Constant=0]="Constant",s[s.LinearGradient=1]="LinearGradient",s[s.RadialGradient=2]="RadialGradient";t(li,oi=a),li.prototype.clone=function(){return new li(this.type,this.value)},li.prototype.buildCSSText=function(t,e,n){return n},li.prototype.getType=function(){return Qr.kColorType};var oi,si=li;function li(t,e){var n=oi.call(this)||this;return n.type=t,n.value=e,n}t(hi,ci=a),hi.prototype.clone=function(){return new hi(this.value)},hi.prototype.getType=function(){return Qr.kKeywordType},hi.prototype.buildCSSText=function(t,e,n){return n+this.value};var ci,ui=hi;function hi(t){var e=ci.call(this)||this;return e.value=t,e}function fi(t){return t.split("").map(function(t,e){return t.toUpperCase()===t?"".concat(0!==e?"-":"").concat(t.toLowerCase()):t}).join("")}var di=Xr(function(t){return(t=void 0===t?"":t).replace(/-([a-z])/g,function(t){return t[1].toUpperCase()})});function pi(t){return"function"==typeof t}function gi(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 yi(t){switch(function(t){switch(t){case g.kNumber:case g.kInteger:return Yr.kUNumber;case g.kPercentage:return Yr.kUPercent;case g.kPixels:return Yr.kULength;case g.kMilliseconds:case g.kSeconds:return Yr.kUTime;case g.kDegrees:case g.kRadians:case g.kGradians:case g.kTurns:return Yr.kUAngle;default:return Yr.kUOther}}(t)){case Yr.kUNumber:return g.kNumber;case Yr.kULength:return g.kPixels;case Yr.kUPercent:return g.kPercentage;case Yr.kUTime:return g.kSeconds;case Yr.kUAngle:return g.kDegrees;default:return g.kUnknown}}var mi,vi={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},bi=Xr(function(t){var t=di(t),e=vi[t];return(null==e?void 0:e.alias)||t}),xi=(t(wi,mi=a),wi.prototype.clone=function(){return new wi(this.value,this.unit)},wi.prototype.equals=function(t){return this.value===t.value&&this.unit===t.unit},wi.prototype.getType=function(){return Qr.kUnitType},wi.prototype.convertTo=function(t){var e;return this.unit===t?new wi(this.value,this.unit):(e=yi(this.unit))!==yi(t)||e===g.kUnknown?null:(e=Kr(this.unit)/Kr(t),new wi(this.value*e,t))},wi.prototype.buildCSSText=function(t,e,n){switch(this.unit){case g.kUnknown:break;case g.kInteger:i=Number(this.value).toFixed(0);break;case g.kNumber:case g.kPercentage:case g.kEms:case g.kRems:case g.kPixels:case g.kDegrees:case g.kRadians:case g.kGradians:case g.kMilliseconds:case g.kSeconds:case g.kTurns:var r,i,a=this.value,o=Zr(this.unit);i=a<-999999||999999<a?(r=Zr(this.unit),!Number.isFinite(a)||Number.isNaN(a)?gi(a,r):a+(r||"")):"".concat(a).concat(o)}return n+=i},wi);function wi(t,e){void 0===e&&(e=g.kNumber);var n=mi.call(this)||this,r="string"==typeof e?(r=e)?"number"===r?g.kNumber:"percent"===r||"%"===r?g.kPercentage:ti(r):g.kUnknown:e;return n.unit=r,n.value=t,n}var Mi,ki=new xi(0,"px"),Oi=(new xi(1,"px"),new xi(0,"deg")),Ei=(t(Si,Mi=ii),Si.prototype.clone=function(){return new Si(this.r,this.g,this.b,this.alpha)},Si.prototype.buildCSSText=function(t,e,n){return n+"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")},Si);function Si(t,e,n,r,i){void 0===r&&(r=1),void 0===i&&(i=!1);var a=Mi.call(this,"rgb")||this;return a.r=t,a.g=e,a.b=n,a.alpha=r,a.isNone=i,a}function Ai(t){return Ci[t]||(Ci[t]=new ui(t)),Ci[t]}var _i,Ti,o,Pi=new ui("unset"),s=new ui("initial"),a=new ui("inherit"),Ci={"":Pi,unset:Pi,initial:s,inherit:a},Li=new Ei(0,0,0,0,!0),Ni=new Ei(0,0,0,0),ji=Xr(function(t,e,n,r){return new Ei(t,e,n,r)},function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")}),Ri=function(t,e){return void 0===e&&(e=g.kNumber),new xi(t,e)},Ii=new xi(50,"%"),Bi=(_i=_i||{},_i[_i.Standard=0]="Standard",(ii=Ti=Ti||{})[ii.ADDED=0]="ADDED",ii[ii.REMOVED=1]="REMOVED",{absolutePath:[],hasArc:!(ii[ii.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED"),segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Dr(0,0,0,0)});(s=o=o||{}).COORDINATE="<coordinate>",s.COLOR="<color>",s.PAINT="<paint>",s.NUMBER="<number>",s.ANGLE="<angle>",s.OPACITY_VALUE="<opacity-value>",s.SHADOW_BLUR="<shadow-blur>",s.LENGTH="<length>",s.PERCENTAGE="<percentage>",s.LENGTH_PERCENTAGE="<length> | <percentage>",s.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",s.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",s.LIST_OF_POINTS="<list-of-points>",s.PATH="<path>",s.FILTER="<filter>",s.Z_INDEX="<z-index>",s.OFFSET_DISTANCE="<offset-distance>",s.DEFINED_PATH="<defined-path>",s.MARKER="<marker>",s.TRANSFORM="<transform>",s.TRANSFORM_ORIGIN="<transform-origin>",s.TEXT="<text>",s.TEXT_TRANSFORM="<text-transform>";Di={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]+\.?))/},Fi="";var Di,Fi,zi=function(t){return Fi=t,Gi()};function Wi(t){throw new Error(Fi+": "+t)}function Gi(){var t=Qi(Hi);return 0<Fi.length&&Wi("Invalid input not EOF"),t}function Hi(){return Vi("linear-gradient",Di.linearGradient,qi)||Vi("repeating-linear-gradient",Di.repeatingLinearGradient,qi)||Vi("radial-gradient",Di.radialGradient,$i)||Vi("repeating-radial-gradient",Di.repeatingRadialGradient,$i)||Vi("conic-gradient",Di.conicGradient,$i)}function Vi(n,t,r){return Yi(t,function(t){var e=r();return e&&!aa(Di.comma)&&Wi("Missing comma before color stops"),{type:n,orientation:e,colorStops:Qi(Ji)}})}function Yi(t,e){t=aa(t);if(t)return aa(Di.startCall)||Wi("Missing ("),e=e(t),aa(Di.endCall)||Wi("Missing )"),e}function qi(){return ia("directional",Di.sideOrCorner,1)||ia("angular",Di.angleValue,1)}function $i(){var t,e,n=Ui();return n&&((t=[]).push(n),e=Fi,aa(Di.comma))&&((n=Ui())?t.push(n):Fi=e),t}function Ui(){var t,e=function(){var t=ia("shape",/^(circle)/i,0);t&&(t.style=ra()||Xi());return t}()||function(){var t=ia("shape",/^(ellipse)/i,0);t&&(t.style=ea()||Xi());return t}();return e?e.at=Ki():(t=Xi())?(e=t,(t=Ki())&&(e.at=t)):(t=Zi())&&(e={type:"default-radial",at:t}),e}function Xi(){return ia("extent-keyword",Di.extentKeywords,1)}function Ki(){var t;if(ia("position",/^at/,0))return(t=Zi())||Wi("Missing positioning value"),t}function Zi(){var t={x:ea(),y:ea()};if(t.x||t.y)return{type:"position",value:t}}function Qi(t){var e=t(),n=[];if(e)for(n.push(e);aa(Di.comma);)(e=t())?n.push(e):Wi("One extra comma");return n}function Ji(){var t=ia("hex",Di.hexColor,1)||Yi(Di.rgbaColor,function(){return{type:"rgba",value:Qi(ta)}})||Yi(Di.rgbColor,function(){return{type:"rgb",value:Qi(ta)}})||ia("literal",Di.literalColor,0);return t||Wi("Expected color definition"),t.length=ea(),t}function ta(){return aa(Di.number)[1]}function ea(){return ia("%",Di.percentageValue,1)||na()||ra()}function na(){return ia("position-keyword",Di.positionKeywords,1)}function ra(){return ia("px",Di.pixelValue,1)||ia("em",Di.emValue,1)}function ia(t,e,n){e=aa(e);if(e)return{type:t,value:e[n]}}function aa(t){var e=/^[\n\r\t\s]+/.exec(Fi),e=(e&&oa(e[0].length),t.exec(Fi));return e&&oa(e[0].length),e}function oa(t){Fi=Fi.substring(t)}var sa=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,la=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,ca=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,ua=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var ha={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},fa=Xr(function(t){t="angular"===t.type?Number(t.value):ha[t.value]||0;return Ri(t,"deg")}),da=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:Ri(n,i),cy:Ri(r,a)}}),pa=Xr(function(t){if(-1<t.indexOf("linear")||-1<t.indexOf("radial"))return zi(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(!A(c)&&!A(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:Ri(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 si(ri.LinearGradient,{angle:r?fa(r):Oi,steps:d}):"radial-gradient"===n&&"shape"===(r=r||[{type:"shape",value:"circle"}])[0].type&&"circle"===r[0].value?(n=(t=da(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?Ai(r):Ri(r,h)),new si(ri.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=sa.exec(t);if(n)return r=(null==(r=n[2].match(ua))?void 0:r.map(function(t){return t.split(":")}))||[],[new si(ri.LinearGradient,{angle:Ri(parseFloat(n[1]),"deg"),steps:r.map(function(t){var t=j(t,2),e=t[0],t=t[1];return{offset:Ri(100*Number(e),"%"),color:t}})})]}else if("r"===e){n=function(t){var t=la.exec(t);if(t)return t=(null==(t=t[4].match(ua))?void 0:t.map(function(t){return t.split(":")}))||[],{cx:Ri(50,"%"),cy:Ri(50,"%"),steps:t.map(function(t){var t=j(t,2),e=t[0],t=t[1];return{offset:Ri(100*Number(e),"%"),color:t}})};return null}(t);if(n&&!We(n))return[new si(ri.RadialGradient,n)]}else if("p"===e){var r=t;if(r=ca.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 ga(t){return t&&t.image}function ya(t){return t&&!A(t.r)&&!A(t.g)&&!A(t.b)}var ma=Xr(function(t){var e;return ga(t)?m({repetition:"repeat"},t):"transparent"===(t=A(t)?"":t)?Ni:pa(t="currentColor"===t?"black":t)||(e=[0,0,0,0],null!==(t=kn(t))&&(e[0]=t.r||0,e[1]=t.g||0,e[2]=t.b||0,e[3]=t.opacity),ji.apply(void 0,M([],j(e),!1)))});function va(t,e){if(ya(t)&&ya(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(Ge(e[n],0,255));return e[3]=Ge(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function ba(t,e){if(A(e))return Ri(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if(0<="px".search(t))return Ri(Number(e),"px");if(0<="deg".search(t))return Ri(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 Ri(Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(r,"g"),"*0")),t)})[0]}var xa=Xr(function(t){return ba(new RegExp("px","g"),t)}),wa=(Xr(function(t){return ba(new RegExp("%","g"),t)}),function(t){return He(t)||isFinite(Number(t))?Ri(Number(t)||0,"px"):ba(new RegExp("px|%|em|rem","g"),t)}),Ma=Xr(function(t){return ba(new RegExp("deg|rad|grad|turn","g"),t)});function ka(t){var e=0;return t.unit===g.kDegrees?e=t.value:t.unit===g.kRadians?e=br(Number(t.value)):t.unit===g.kTurns&&(e=360*Number(t.value)),e}function Oa(t,e){var n;return Array.isArray(t)?n=t.map(function(t){return Number(t)}):We(t)?n=t.split(" ").map(function(t){return Number(t)}):He(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 Ea(t){return We(t)?t.split(" ").map(function(t){return wa(t)}):t.map(function(t){return wa(t.toString())})}function Sa(t,e,n){return 0===t.value?0:t.unit===g.kPixels?Number(t.value):t.unit===g.kPercentage&&n?(n=n.nodeName===k.GROUP?n.getLocalBounds():n.geometry.contentBounds,t.value/100*n.halfExtents[e]*2):0}var Aa=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function _a(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<Aa.indexOf(e[1])&&r.push({name:e[1],params:e[2].split(" ").map(function(t){return ba(/deg|rad|grad|turn|px|%/g,t)||ma(t)})}),n.lastIndex===t.length)return r}return[]}function Ta(t){return t.toString()}var Pa=Xr(function(t){return"number"==typeof t?Ri(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Ri(Number(t)):Ri(0)});function Ca(t,e){return[t,e,Ta]}function La(n,r){return function(t,e){return[t,e,function(t){return Ta(Ge(t,n,r))}]}}function Na(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function ja(t){var e;return 0===t.parsedStyle.path.totalLength&&(t.parsedStyle.path.totalLength=Ae(t.parsedStyle.path.absolutePath,void 0,m(m({},e),{bbox:!1,length:!0})).length),t.parsedStyle.path.totalLength}function Ra(t,e){return t[0]===e[0]&&t[1]===e[1]}function Ia(t,e){for(var n,r,i,a,o,s,l,c,u,h=[],f=[],d=[],p=0;p<t.length;p++){var g=(O=t[p]).currentPoint,y=O.params,m=O.prePoint,v=void 0;switch(O.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=Rn(c,u);break;case"C":v=function(t,e,n,r,i,a,o,s){for(var l=[t,o],c=[e,s],u=Gn(t,n,i,o),h=Gn(e,r,a,s),f=0;f<u.length;f++)l.push(Wn(t,n,i,o,u[f]));for(f=0;f<h.length;f++)c.push(Wn(e,r,a,s,h[f]));return Rn(l,c)}(m[0],m[1],y[1],y[2],y[3],y[4],y[5],y[6]);break;case"A":var b=O.arcParams,v=In(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&&(O.box=v,h.push(v.x,v.x+v.width),f.push(v.y,v.y+v.height)),e&&("L"===O.command||"M"===O.command)&&O.prePoint&&O.nextPoint&&d.push(O)}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=Fe(h),w=Fe(f),M=De(h),k=De(f);if(0!==d.length)for(p=0;p<d.length;p++){var O;(g=(O=d[p]).currentPoint)[0]===x?x-=Ba(O,e).xExtra:g[0]===M&&(M+=Ba(O,e).xExtra),g[1]===w?w-=Ba(O,e).yExtra:g[1]===k&&(k+=Ba(O,e).yExtra)}return{x:x,y:w,width:M-x,height:k-w}}function Ba(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)||Ve(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 Da(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}Xr(function(t){return(We(t)?t.split(" "):t).map(Pa)});function Fa(t,e,n,r,i,a,o,s){var l,c,u;return e=Math.abs(e),n=Math.abs(n),r=vr(r=qe(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=za({x:1,y:0},o={x:(u.x-c)/e,y:(u.y-i)/n}),o=za(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 za=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 Wa(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=qe(vr(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=Ya([1,0],p),h=Ya(p,u);Va(p,u)<=-1&&(h=Math.PI);1<=Va(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:Ra(t,[c,e])?0:n,ry:Ra(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]&&Ra(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=Da((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=Da((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=Ga(u,0)).x,b=b.y,y=(m=Ga(u,1,!1)).x,m=m.y,u.startTangent=[c,b],u.endTangent=[y,m]),e.push(u)}return e}function Ga(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=Fa({x:t.prePoint[0],y:t.prePoint[1]},i,a,o,!!s,!!r,{x:t.currentPoint[0],y:t.currentPoint[1]},e),i=Fa({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 Ha(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Va(t,e){return Ha(t)*Ha(e)?(t[0]*e[0]+t[1]*e[1])/(Ha(t)*Ha(e)):1}function Ya(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(Va(t,e))}function qa(t,e,n,r){var i=(-1+Math.sqrt(2))/3*4,a=t*i,i=e*i,o=n-t,t=n+t,s=r-e,e=r+e;return[["M",o,r],["C",o,r-i,n-a,s,n,s],["C",n+a,s,t,r-i,t,r],["C",t,r+i,n+a,e,n,e],["C",n-a,e,o,r+i,o,r],["Z"]]}function $a(t,e){void 0===e&&(e=t.getLocalTransform());var n,r,i,a,o,s,l,c,u,h,f,d=[];switch(t.nodeName){case k.LINE:var p=t.parsedStyle,d=[["M",p.x1,p.y1],["L",p.x2,p.y2]];break;case k.CIRCLE:var p=t.parsedStyle,g=p.r;d=qa(g,g,p.cx,p.cy);break;case k.ELLIPSE:var g=t.parsedStyle;d=qa(g.rx,g.ry,g.cx,g.cy);break;case k.POLYLINE:case k.POLYGON:p=t.parsedStyle.points;g=p.points,p=t.nodeName===k.POLYGON,g=g.map(function(t,e){return[0===e?"M":"L",t[0],t[1]]}),p&&g.push(["Z"]),d=g;break;case k.RECT:var y=t.parsedStyle,m=y.width,v=y.height,b=y.x,x=y.y,y=y.radius,w=y&&y.some(function(t){return 0!==t});n=m,r=v,b=b,x=x,d=(w=w&&y.map(function(t){return Ge(t,0,Math.min(Math.abs(m)/2,Math.abs(v)/2))}))?(s=(y=0<n?1:-1)+(o=0<r?1:-1)!=0?1:0,[["M",y*(i=(w=j(w,4))[0])+b,x],["L",n-y*(a=w[1])+b,x],a?["A",a,a,0,0,s,n+b,o*a+x]:null,["L",n+b,r-o*(a=w[2])+x],a?["A",a,a,0,0,s,n+b-y*a,r+x]:null,["L",b+y*(a=w[3]),r+x],a?["A",a,a,0,0,s,b,r+x-o*a]:null,["L",b,o*i+x],i?["A",i,i,0,0,s,y*i+b,x]:null,["Z"]].filter(function(t){return t})):[["M",b,x],["L",b+n,x],["L",b+n,x+r],["L",b,x+r],["Z"]];break;case k.PATH:d=M([],j(t.parsedStyle.path.absolutePath),!1)}if(d.length)return l=d,c=e,u=(e=(e=t).parsedStyle).defX,h=void 0===u?0:u,f=void 0===(u=e.defY)?0:u,l.reduce(function(t,e){var n,r,i,a="";return"M"===e[0]||"L"===e[0]?(n=Ct(e[1]-h,e[2]-f,0),c&&Wt(n,n,c),a="".concat(e[0]).concat(n[0],",").concat(n[1])):"Z"===e[0]?a=e[0]:"C"===e[0]?(r=Ct(e[1]-h,e[2]-f,0),i=Ct(e[3]-h,e[4]-f,0),n=Ct(e[5]-h,e[6]-f,0),c&&(Wt(r,r,c),Wt(i,i,c),Wt(n,n,c)),a="".concat(e[0]).concat(r[0],",").concat(r[1],",").concat(i[0],",").concat(i[1],",").concat(n[0],",").concat(n[1])):"A"===e[0]?(n=Ct(e[6]-h,e[7]-f,0),c&&Wt(n,n,c),a="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(n[0],",").concat(n[1])):"Q"===e[0]&&(r=Ct(e[1]-h,e[2]-f,0),i=Ct(e[3]-h,e[4]-f,0),c&&(Wt(r,r,c),Wt(i,i,c)),a="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}")),t+a},"")}function Ua(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=ge(e)}catch(t){n=ge(""),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=Wa(n),a=(l=Ia(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 Xa=Xr(Ua);function Ka(t){return(We(t)?Xa:Ua)(t)}function Za(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=Me(t.absolutePath,!1),t.curve=f),d&&0!==d.length||(d=Me(e.absolutePath,!1),e.curve=d),[f,d]),f=_e((t=f.length!==d.length?function t(e,n,r){var i,e=Te(e),n=Te(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])!==_e(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))}))):re(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+=be(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 Qa(t,e){var n,r,i=We(t)?t.split(" ").map(function(t){var t=j(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=Dn(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,M([],j(i.map(function(t){return t[0]})),!1))),l=Math.min.apply(Math,M([],j(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 Ja(t,e){return[t.points,e.points,function(t){return t}]}var to=null;function eo(t){return function(e){var n=0;return t.map(function(t){return t===to?e[n++]:t})}}function no(t){return t}var ro={matrix:["NNNNNN",[to,to,0,0,to,to,0,0,0,0,1,0,to,to,0,1],no],matrix3d:["NNNNNNNNNNNNNNNN",no],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",eo([to,to,new xi(1)]),no],scalex:["N",eo([to,new xi(1),new xi(1)]),eo([to,new xi(1)])],scaley:["N",eo([new xi(1),to,new xi(1)]),eo([new xi(1),to])],scalez:["N",eo([new xi(1),new xi(1),to])],scale3d:["NNN",no],skew:["Aa",null,no],skewx:["A",null,eo([to,Oi])],skewy:["A",null,eo([Oi,to])],translate:["Tt",eo([to,to,ki]),no],translatex:["T",eo([to,ki,ki]),eo([to,ki])],translatey:["T",eo([ki,to,ki]),eo([ki,to])],translatez:["L",eo([ki,ki,to])],translate3d:["TTL",no]};function io(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=ro[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()?Oi:Ma(t)},N:Pa,T:wa,L:xa}[f.toUpperCase()](h):{a:Oi,n:c[0],t:ki}[f]))return[];c.push(d)}if(r.push({t:a,d:c}),n.lastIndex===t.length)return r}return[]}function ao(t){switch(t.t){case"rotatex":return i=vr(ka(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=vr(ka(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=vr(ka(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=vr(ka(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=vr(ka(t.d[0])),a=vr(ka(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=vr(ka(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=vr(ka(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=Sa(t.d[0],0,null)||0,n=Sa(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Sa(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=Sa(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=Sa(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Sa(t.d[0],0,null)||0,n=Sa(t.d[1],0,null)||0,r=Sa(t.d[2],0,null)||0,1];case"perspective":a=Sa(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 oo(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 so(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 Ar(0===(t=t).length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(ao).reduce(oo),e,n,r,i,a),[[e,n,r,a,i]]}var lo=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=co(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=co(a,u)),n[1]&&(u[2][1]=0,u[2][0]=n[0],a=co(a,u)),n[0]&&(u[2][0]=0,u[1][0]=n[0],a=co(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 co(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 uo(t){return t.toFixed(6).replace(".000000","")}function ho(e,n){var r,i;return e.decompositionPair!==n&&(e.decompositionPair=n,r=so(e)),n.decompositionPair!==e&&(n.decompositionPair=e,i=so(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=Ge(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 lo(t[0],t[1],t[2],e,t[4]).map(uo).join(",")}])}function fo(t){return t.replace(/[xy]/,"")}function po(t){return t.replace(/(x|y|z|3d)?$/,"3d")}var go=function(t,e){return"perspective"===t&&"perspective"===e||("matrix"===t||"matrix3d"===t)&&("matrix"===e||"matrix3d"===e)};function yo(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?Ri(n):Ri(n,t.unit)})})}(n)}var a=[],o=[],s=[];if(r.length!==i.length)a=[(g=ho(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=ro[l],d=ro[c],p=void 0;if(go(l,c)){var g=ho([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]&&fo(l)===fo(c))p=fo(l),u=f[2](u),h=d[2](h);else{if(!f[1]||!d[1]||po(l)!==po(c)){a=[(g=ho(r,i))[0]],o=[g[1]],s=[["matrix",[g[2]]]];break}p=po(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=yi(t.unit),c=t.convertTo(l),l=e.convertTo(l);return c&&l?(o=c.value,s=l.value,a=Zr(t.unit)):(xi.isLength(t.unit)||xi.isLength(e.unit))&&(o=Sa(t,i,n),s=Sa(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 mo=Xr(function(t){var e;return We(t)?"text-anchor"===t?[Ri(0,"px"),Ri(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:[wa(vo(e[0])),wa(vo(e[1]))]):[Ri(t[0]||0,"px"),Ri(t[1]||0,"px")]});function vo(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var bo=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:o.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:o.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:o.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:o.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:o.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:o.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:o.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:o.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:o.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:o.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:o.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:o.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:o.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:o.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:o.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:o.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:o.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:o.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:o.FILTER},{n:"clipPath",syntax:o.DEFINED_PATH},{n:"textPath",syntax:o.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:o.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:o.TRANSFORM},{n:"transformOrigin",p:100,d:function(t){return t===k.CIRCLE||t===k.ELLIPSE?"center":t===k.TEXT?"text-anchor":"left top"},l:!0,syntax:o.TRANSFORM_ORIGIN},{n:"anchor",p:99,d:function(t){return t===k.CIRCLE||t===k.ELLIPSE?"0.5 0.5":"0 0"},l:!0,syntax:o.LENGTH_PERCENTAGE_12},{n:"cx",int:!0,d:"0",syntax:o.COORDINATE},{n:"cy",int:!0,d:"0",syntax:o.COORDINATE},{n:"cz",int:!0,d:"0",syntax:o.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:o.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:o.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:o.LENGTH_PERCENTAGE},{n:"x",int:!0,d:"0",syntax:o.COORDINATE},{n:"y",int:!0,d:"0",syntax:o.COORDINATE},{n:"z",int:!0,d:"0",syntax:o.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:o.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:o.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:o.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:o.COORDINATE},{n:"y1",int:!0,l:!0,syntax:o.COORDINATE},{n:"z1",int:!0,l:!0,syntax:o.COORDINATE},{n:"x2",int:!0,l:!0,syntax:o.COORDINATE},{n:"y2",int:!0,l:!0,syntax:o.COORDINATE},{n:"z2",int:!0,l:!0,syntax:o.COORDINATE},{n:"path",int:!0,l:!0,d:"",a:["d"],syntax:o.PATH,p:50},{n:"points",int:!0,l:!0,syntax:o.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:o.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:o.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:o.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:o.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:o.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:o.NUMBER,d:function(t){return t===k.PATH||t===k.POLYGON||t===k.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:o.MARKER},{n:"markerEnd",syntax:o.MARKER},{n:"markerMid",syntax:o.MARKER},{n:"markerStartOffset",syntax:o.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:o.LENGTH,l:!0,int:!0,d:"0"}],xo=bo.filter(function(t){return!!t.l}).map(function(t){return t.n}),wo={},Mo=new WeakMap,a=(ko.prototype.registerMetadata=function(e){M([e.n],j(e.a||[]),!1).forEach(function(t){wo[t]=e})},ko.prototype.unregisterMetadata=function(t){delete wo[t]},ko.prototype.getPropertySyntax=function(t){return this.runtime.CSSPropertySyntaxFactory[t]},ko.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=wo[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<xo.length;h++)if(xo[h]in e){u=!0;break}e.fill&&(n.parsedStyle.fill=ma(e.fill)),e.stroke&&(n.parsedStyle.stroke=ma(e.stroke)),e.shadowColor&&(n.parsedStyle.shadowColor=ma(e.shadowColor)),e.filter&&(n.parsedStyle.filter=_a(e.filter)),A(e.radius)||(n.parsedStyle.radius=Oa(e.radius,4)),A(e.lineDash)||(n.parsedStyle.lineDash=Oa(e.lineDash,2)),e.points&&(n.parsedStyle.points=Qa(e.points,n)),""===e.path&&(n.parsedStyle.path=m({},Bi)),e.path&&(n.parsedStyle.path=Ka(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=Oa(e.anchor,2)),e.transform&&(n.parsedStyle.transform=io(e.transform)),e.transformOrigin&&(n.parsedStyle.transformOrigin=mo(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!==k.CIRCLE&&n.nodeName!==k.ELLIPSE||A(e.cx)&&A(e.cy))&&(n.nodeName!==k.RECT&&n.nodeName!==k.IMAGE&&n.nodeName!==k.GROUP&&n.nodeName!==k.HTML&&n.nodeName!==k.TEXT&&n.nodeName!==k.MESH||A(e.x)&&A(e.y)&&A(e.z))&&(n.nodeName!==k.LINE||A(e.x1)&&A(e.y1)&&A(e.z1)&&A(e.x2)&&A(e.y2)&&A(e.z2))||this.runtime.CSSPropertySyntaxFactory["<coordinate>"].postProcessor(n,o),A(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),A(e.offsetDistance)||this.runtime.CSSPropertySyntaxFactory["<offset-distance>"].postProcessor(n,o),e.transform&&this.runtime.CSSPropertySyntaxFactory["<transform>"].postProcessor(n,o),u&&this.updateGeometry(n)}},ko.prototype.parseProperty=function(t,e,n){var r,t=wo[t],i=e;return"unset"===(e=""!==e&&!A(e)?e:"unset")||"initial"===e||"inherit"===e?i=Ai(e):t&&(r=t.k,t=(t=t.syntax)&&this.getPropertySyntax(t),r&&-1<r.indexOf(e)?i=Ai(e):t&&t.parser&&(i=t.parser(e,n))),i},ko.prototype.computeProperty=function(t,e,n){var r=wo[t],i="g-root"===n.id,a=e;if(r){var o=r.syntax,s=r.inh,r=r.d;if(e instanceof ui){var l=e.value;if("initial"===(l="unset"===l?s&&!i?"inherit":"initial":l))A(r)||(e=this.parseProperty(t,pi(r)?r(n.nodeName):r,n));else if("inherit"===l)return s=this.tryToResolveProperty(n,t,{inherited:!0}),A(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 ui?e.value:e}return a},ko.prototype.postProcessProperty=function(t,e,n){var t=wo[t];t&&t.syntax&&(t=t.syntax&&this.getPropertySyntax(t.syntax))&&t.postProcessor&&t.postProcessor(e,n)},ko.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)},ko.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},ko.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))},ko.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 Tr),s.renderBounds||(s.renderBounds=new Tr),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===k.TEXT?delete e.anchor:y===k.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===k.POLYLINE||y===k.POLYGON||y===k.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,pr(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?Sa(a[0],0,t):0),m=(y?-1:1)*(a?Sa(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))},ko.prototype.isPropertyInheritable=function(t){t=wo[t];return!!t&&t.inh},ko);function ko(t){var e=this;this.runtime=t,bo.forEach(function(t){e.registerMetadata(t)})}Oo.prototype.calculator=function(t,e,n,r){return ka(n)};ii=Oo;function Oo(){this.parser=Ma,this.parserWithCSSDisabled=null,this.mixer=Ca}Eo.prototype.calculator=function(t,e,n,r,i){return n instanceof ui&&(n=null),i.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach(function(t){0===t.childNodes.length&&i.sceneGraphService.dirtifyToRoot(t)}),n};s=Eo;function Eo(){}Ao.prototype.calculator=function(t,e,n,r){return n instanceof ui?"none"===n.value?Li:Ni:n};var So=Ao;function Ao(){this.parser=ma,this.parserWithCSSDisabled=ma,this.mixer=va}To.prototype.calculator=function(t,e,n){return n instanceof ui?[]:n};var _o=To;function To(){this.parser=_a}function Po(t){t=t.parsedStyle.fontSize;return A(t)?null:t}Lo.prototype.calculator=function(t,e,n,r,i){var a,o;return He(n)?n:xi.isRelativeUnit(n.unit)?(i=i.styleValueRegistry,n.unit===g.kPercentage?0:n.unit===g.kEms?r.parentNode&&(o=Po(r.parentNode))?o*n.value:(i.addUnresolveProperty(r,t),0):n.unit===g.kRems?null!=(a=null==r?void 0:r.ownerDocument)&&a.documentElement&&(o=Po(r.ownerDocument.documentElement))?o*n.value:(i.addUnresolveProperty(r,t),0):void 0):n.value};var Co=Lo;function Lo(){this.parser=wa,this.parserWithCSSDisabled=null,this.mixer=Ca}jo.prototype.parser=function(t){t=Ea(He(t)?[t]:t),t=1===t.length?[t[0],t[0]]:[t[0],t[1]];return t},jo.prototype.calculator=function(t,e,n){return n.map(function(t){return t.value})};var No=jo;function jo(){this.mixer=Na}Io.prototype.parser=function(t){t=Ea(He(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},Io.prototype.calculator=function(t,e,n){return n.map(function(t){return t.value})};var Ro=Io;function Io(){this.mixer=Na}var Bo=Z();function Do(t,l){var c=l.parsedStyle.defX||0,u=l.parsedStyle.defY||0;return 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||[ki,ki])[0].value,e[1].value,0):"translatex"===s?l.translateLocal((e=t||[ki])[0].value,0,0):"translatey"===s?l.translateLocal(0,(e=t||[ki])[0].value,0):"translatez"===s?l.translateLocal(0,0,(e=t||[ki])[0].value):"translate3d"===s?l.translateLocal((e=t||[ki,ki,ki])[0].value,e[1].value,e[2].value):"rotate"===s?l.rotateLocal(0,0,ka((t||[Oi])[0])):"rotatex"===s?l.rotateLocal(ka((t||[Oi])[0]),0,0):"rotatey"===s?l.rotateLocal(0,ka((t||[Oi])[0]),0):"rotatez"===s?l.rotateLocal(0,0,ka((t||[Oi])[0])):"rotate3d"!==s&&("skew"===s?(n=(null==t?void 0:t.map(function(t){return t.value}))||[0,0],l.setLocalSkew(vr(n[0]),vr(n[1]))):"skewx"===s?(n=(null==t?void 0:t.map(function(t){return t.value}))||[0],l.setLocalSkew(vr(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],vr(n[0]))):"matrix"===s?(e=(o=j(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(tt(Bo,e,n,0,0,r,i,0,0,0,0,1,0,a+c,o+u,0,1))):"matrix3d"===s&&(tt.apply(_t,M([Bo],j(t.map(function(t){return t.value})),!1)),Bo[12]+=c,Bo[13]+=u,l.setLocalTransform(Bo)))}),l.getLocalTransform()}t(Wo,Fo=Co),Wo.prototype.postProcessor=function(t,e){var n,r;switch(t.nodeName){case k.CIRCLE:case k.ELLIPSE:var i=t.parsedStyle,a=i.cx,o=i.cy,i=i.cz;A(a)||(l=a),A(o)||(c=o),A(i)||(u=i);break;case k.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 k.RECT:case k.IMAGE:case k.GROUP:case k.HTML:case k.TEXT:case k.MESH:A(t.parsedStyle.x)||(l=t.parsedStyle.x),A(t.parsedStyle.y)||(c=t.parsedStyle.y),A(t.parsedStyle.z)||(u=t.parsedStyle.z)}t.nodeName!==k.PATH&&t.nodeName!==k.POLYLINE&&t.nodeName!==k.POLYGON&&(t.parsedStyle.defX=l||0,t.parsedStyle.defY=c||0),A(l)&&A(c)&&A(u)||-1!==e.indexOf("transform")||((e=t.parsedStyle.transform)&&e.length?Do(e,t):(n=(e=j(t.getLocalPosition(),3))[0],r=e[1],e=e[2],t.setLocalPosition(A(l)?n:l,A(c)?r:c,A(u)?e:u)))};var Fo,zo=Wo;function Wo(){return null!==Fo&&Fo.apply(this,arguments)||this}Ho.prototype.calculator=function(t,e,n,r){n=null==(n=n instanceof ui?null:n)?void 0:n.cloneNode(!0);return n&&(n.style.isMarker=!0),n};var Go=Ho;function Ho(){}Yo.prototype.calculator=function(t,e,n){return n.value};var Vo=Yo;function Yo(){this.mixer=Ca,this.parser=Pa,this.parserWithCSSDisabled=null}$o.prototype.calculator=function(t,e,n){return n.value},$o.prototype.postProcessor=function(t){var e,n=t.parsedStyle,r=n.offsetPath,n=n.offsetDistance;!r||(e=r.nodeName)!==k.LINE&&e!==k.PATH&&e!==k.POLYLINE||(e=r.getPoint(n))&&(t.parsedStyle.defX=e.x,t.parsedStyle.defY=e.y,t.setLocalPosition(e.x,e.y))};var qo=$o;function $o(){this.parser=Pa,this.parserWithCSSDisabled=null,this.mixer=La(0,1)}Xo.prototype.calculator=function(t,e,n){return n.value};var Uo=Xo;function Xo(){this.parser=Pa,this.parserWithCSSDisabled=null,this.mixer=La(0,1)}Zo.prototype.calculator=function(t,e,n){return n instanceof ui&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Dr(0,0,0,0)}:n},Zo.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===k.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 Ko=Zo;function Zo(){this.parser=Ka,this.parserWithCSSDisabled=Ka,this.mixer=Za}Jo.prototype.postProcessor=function(t,e){var n;t.nodeName!==k.POLYGON&&t.nodeName!==k.POLYLINE||-1!==e.indexOf("transform")||(n=(e=t.parsedStyle).defX,e=e.defY,t.setLocalPosition(n,e))};var Qo=Jo;function Jo(){this.parser=Qa,this.mixer=Ja}t(ns,ts=Co);var ts,es=ns;function ns(){var t=null!==ts&&ts.apply(this,arguments)||this;return t.mixer=La(0,1/0),t}is.prototype.calculator=function(t,e,n,r){return n instanceof ui?"unset"===n.value?"":n.value:"".concat(n)},is.prototype.postProcessor=function(t){t.nodeValue="".concat(t.parsedStyle.text)||""};var rs=is;function is(){}os.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 as=os;function os(){}var ss={},ls=0;var cs="undefined"!=typeof window&&void 0!==window.document;function us(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 hs(t){var e,n=t;do{if(null==(e=n.parsedStyle)?void 0:e.clipPath)return n}while(null!==(n=n.parentElement));return null}function fs(t,e){if(cs)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var ds={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};function ps(t,e,n){var r=!1,i=!1,e=!!e&&!e.isNone,n=!!n&&!n.isNone;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=e,i=n):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(i=r=!0),[r,i]}function gs(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var n=Date.now(),e=16<(e=n-Os)?0:16-e,r=bs();return ks[r]=t,1<Object.keys(ks).length||setTimeout(function(){Os=n;var e=ks;ks={},Object.keys(e).forEach(function(t){return e[t](Ms())})},e),r}function ys(t){delete ks[t]}function ms(t){return"string"!=typeof t?gs:""===t?xs.requestAnimationFrame:xs[t+"RequestAnimationFrame"]}var vs=1,bs=function(){return vs++},xs="object"==typeof self&&self.self==self?self:"object"==typeof S&&S.global==S?S:{},ws=Date.now(),Ms=function(){return xs.performance&&"function"==typeof xs.performance.now?xs.performance.now():Date.now()-ws},ks={},Os=Date.now(),Es=function(t,e){for(var n=0;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}}(["","webkit","moz","ms","o"],ms),Ss=ms(Es),As="string"!=typeof(Es=Es)?ys:""===Es?xs.cancelAnimationFrame:xs[Es+"CancelAnimationFrame"]||xs[Es+"CancelRequestAnimationFrame"],_s=(xs.requestAnimationFrame=Ss,xs.cancelAnimationFrame=As,Ts.prototype.getCallbacksNum=function(){return this.callbacks.length},Ts.prototype.tapPromise=function(t,e){this.callbacks.push(e)},Ts.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,M([],j(e),!1))}))},Ts);function Ts(){this.callbacks=[]}Cs.prototype.tapPromise=function(t,e){this.callbacks.push(e)},Cs.prototype.promise=function(){for(var i=[],t=0;t<arguments.length;t++)i[t]=arguments[t];return X(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,M([],j(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 Ps=Cs;function Cs(){this.callbacks=[]}Ns.prototype.tap=function(t,e){this.callbacks.push(e)},Ns.prototype.call=function(){var e=arguments;this.callbacks.forEach(function(t){t.apply(void 0,e)})};var Ls=Ns;function Ns(){this.callbacks=[]}Rs.prototype.tap=function(t,e){this.callbacks.push(e)},Rs.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 js=Rs;function Rs(){this.callbacks=[]}var Is=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Bs=/([\"\'])[^\'\"]+\1/;Ds.prototype.calculator=function(t,e,n,r){return n instanceof ui?[]:n},Ds.prototype.postProcessor=function(t){Do(t.parsedStyle.transform,t)};Es=Ds;function Ds(){this.parser=io,this.parserWithCSSDisabled=io,this.mixer=yo}var Fs=function(){this.parser=mo},zs=(Ws.prototype.calculator=function(t,e,n,r){return n.value},Ws.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=Ti.Z_INDEX_CHANGED)},Ws);function Ws(){this.parser=Pa}Hs.prototype.update=function(t,e){t=t.r;return{width:2*t,height:2*t}};var Gs=Hs;function Hs(){}Ys.prototype.update=function(t,e){return{width:2*t.rx,height:2*t.ry}};var Vs=Ys;function Ys(){}$s.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 qs=$s;function $s(){}Xs.prototype.update=function(t){t=t.path.rect;return{width:t.width,height:t.height}};var Us=Xs;function Xs(){}Zs.prototype.update=function(t){var t=t.points.points,e=Math.min.apply(Math,M([],j(t.map(function(t){return t[0]})),!1)),n=Math.max.apply(Math,M([],j(t.map(function(t){return t[0]})),!1)),r=Math.min.apply(Math,M([],j(t.map(function(t){return t[1]})),!1));return{width:n-e,height:Math.max.apply(Math,M([],j(t.map(function(t){return t[1]})),!1))-r}};var Ks=Zs;function Zs(){}Js.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&&!We(n)&&(r||(r=n.width,t.width=r),i||(i=n.height,t.height=i)),{width:r,height:i}};var Qs=Js;function Js(){}el.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&&!A(t)},el.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 tl=el;function el(t){this.globalRuntime=t}Object.defineProperty(rl.prototype,"name",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(rl.prototype,"layerX",{get:function(){return this.layer.x},enumerable:!1,configurable:!0}),Object.defineProperty(rl.prototype,"layerY",{get:function(){return this.layer.y},enumerable:!1,configurable:!0}),Object.defineProperty(rl.prototype,"pageX",{get:function(){return this.page.x},enumerable:!1,configurable:!0}),Object.defineProperty(rl.prototype,"pageY",{get:function(){return this.page.y},enumerable:!1,configurable:!0}),Object.defineProperty(rl.prototype,"x",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(rl.prototype,"y",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(rl.prototype,"canvasX",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(rl.prototype,"canvasY",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(rl.prototype,"viewportX",{get:function(){return this.viewport.x},enumerable:!1,configurable:!0}),Object.defineProperty(rl.prototype,"viewportY",{get:function(){return this.viewport.y},enumerable:!1,configurable:!0}),rl.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(rl.prototype,"propagationPath",{get:function(){return this.composedPath()},enumerable:!1,configurable:!0}),rl.prototype.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},rl.prototype.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},rl.prototype.stopPropagation=function(){this.propagationStopped=!0},rl.prototype.initEvent=function(){},rl.prototype.initUIEvent=function(){},rl.prototype.clone=function(){throw new Error(Hr)};var nl=rl;function rl(t){this.eventPhase=rl.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Ir,this.page=new Ir,this.canvas=new Ir,this.viewport=new Ir,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}t(ol,il=nl),Object.defineProperty(ol.prototype,"clientX",{get:function(){return this.client.x},enumerable:!1,configurable:!0}),Object.defineProperty(ol.prototype,"clientY",{get:function(){return this.client.y},enumerable:!1,configurable:!0}),Object.defineProperty(ol.prototype,"movementX",{get:function(){return this.movement.x},enumerable:!1,configurable:!0}),Object.defineProperty(ol.prototype,"movementY",{get:function(){return this.movement.y},enumerable:!1,configurable:!0}),Object.defineProperty(ol.prototype,"offsetX",{get:function(){return this.offset.x},enumerable:!1,configurable:!0}),Object.defineProperty(ol.prototype,"offsetY",{get:function(){return this.offset.y},enumerable:!1,configurable:!0}),Object.defineProperty(ol.prototype,"globalX",{get:function(){return this.global.x},enumerable:!1,configurable:!0}),Object.defineProperty(ol.prototype,"globalY",{get:function(){return this.global.y},enumerable:!1,configurable:!0}),Object.defineProperty(ol.prototype,"screenX",{get:function(){return this.screen.x},enumerable:!1,configurable:!0}),Object.defineProperty(ol.prototype,"screenY",{get:function(){return this.screen.y},enumerable:!1,configurable:!0}),ol.prototype.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},ol.prototype.initMouseEvent=function(){throw new Error(Hr)};var il,al=ol;function ol(){var t=null!==il&&il.apply(this,arguments)||this;return t.client=new Ir,t.movement=new Ir,t.offset=new Ir,t.global=new Ir,t.screen=new Ir,t}t(cl,sl=al),cl.prototype.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},cl.prototype.getPredictedEvents=function(){throw new Error("getPredictedEvents is not supported!")},cl.prototype.clone=function(){return this.manager.clonePointerEvent(this)};var sl,ll=cl;function cl(){var t=null!==sl&&sl.apply(this,arguments)||this;return t.width=0,t.height=0,t.isPrimary=!1,t}t(fl,ul=al),fl.prototype.clone=function(){return this.manager.cloneWheelEvent(this)};var ul,hl=fl;function fl(){return null!==ul&&ul.apply(this,arguments)||this}t(gl,dl=nl);var dl,pl=gl;function gl(t,e){var n=dl.call(this,null)||this;return n.type=t,n.detail=e,Object.assign(n,e),n}yl.prototype.on=function(t,e,n){return this.addEventListener(t,e,n),this},yl.prototype.addEventListener=function(t,e,n){var r,i,a,o=Ke(n)&&n||Re(n)&&n.capture,n=Re(n)&&n.once,s=pi(e)?void 0:e,l=!1,c="";return-1<t.indexOf(":")&&(i=(r=j(t.split(":"),2))[0],t=r[1],c=i,l=!0),t=o?"".concat(t,"capture"):t,e=pi(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,M([],j(e),!1))}),n?this.emitter.once(t,e,s):this.emitter.on(t,e,s),this},yl.prototype.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},yl.prototype.removeAllEventListeners=function(){this.emitter.removeAllListeners()},yl.prototype.removeEventListener=function(t,e,n){var n=Ke(n)&&n||Re(n)&&n.capture,r=pi(e)?void 0:e;return t=n?"".concat(t,"capture"):t,e=pi(e)?e:null==e?void 0:e.handleEvent,this.emitter.off(t,e,r),this},yl.prototype.emit=function(t,e){this.dispatchEvent(new pl(t,e))},yl.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};al=yl;function yl(){this.emitter=new Y}t(p,ml=al),p.isNode=function(t){return!!t.childNodes},Object.defineProperty(p.prototype,"textContent",{get:function(){var e,t,n="";this.nodeName===k.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===k.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===k.TEXT&&(this.style.text="".concat(t))},enumerable:!1,configurable:!0}),p.prototype.getRootNode=function(t){return void 0===t&&(t={}),this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this},p.prototype.hasChildNodes=function(){return 0<this.childNodes.length},p.prototype.isDefaultNamespace=function(t){throw new Error(Hr)},p.prototype.lookupNamespaceURI=function(t){throw new Error(Hr)},p.prototype.lookupPrefix=function(t){throw new Error(Hr)},p.prototype.normalize=function(){throw new Error(Hr)},p.prototype.isEqualNode=function(t){return this===t},p.prototype.isSameNode=function(t){return this.isEqualNode(t)},Object.defineProperty(p.prototype,"parent",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"parentElement",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"nextSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"previousSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"firstChild",{get:function(){return 0<this.childNodes.length?this.childNodes[0]:null},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"lastChild",{get:function(){return 0<this.childNodes.length?this.childNodes[this.childNodes.length-1]:null},enumerable:!1,configurable:!0}),p.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 p.DOCUMENT_POSITION_DISCONNECTED|p.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|p.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?p.DOCUMENT_POSITION_CONTAINED_BY|p.DOCUMENT_POSITION_FOLLOWING:p.DOCUMENT_POSITION_CONTAINS|p.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?p.DOCUMENT_POSITION_PRECEDING:p.DOCUMENT_POSITION_FOLLOWING:o===i?p.DOCUMENT_POSITION_PRECEDING:p.DOCUMENT_POSITION_FOLLOWING}return p.DOCUMENT_POSITION_FOLLOWING},p.prototype.contain=function(t){return this.contains(t)},p.prototype.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},p.prototype.getAncestor=function(t){for(var e=this;0<t&&e;)e=e.parentNode,t--;return e},p.prototype.forEach=function(e,t){void 0===t&&(t=!1),e(this)||(t?this.childNodes.slice():this.childNodes).forEach(function(t){t.forEach(e)})},p.DOCUMENT_POSITION_DISCONNECTED=1,p.DOCUMENT_POSITION_PRECEDING=2,p.DOCUMENT_POSITION_FOLLOWING=4,p.DOCUMENT_POSITION_CONTAINS=8,p.DOCUMENT_POSITION_CONTAINED_BY=16,p.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var ml,vl=p;function p(){var t=null!==ml&&ml.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}xl.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)},xl.prototype.destroy=function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()},xl.prototype.client2Viewport=function(t){var e=this.context.contextService.getBoundingClientRect();return new Ir(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))},xl.prototype.viewport2Client=function(t){var e=this.context.contextService.getBoundingClientRect();return new Ir(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))},xl.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=ct(this.tmpMatrix,n,a),a=Nt(this.tmpVec3,e/i*2-1,2*(1-t/r)-1,0);return Wt(a,a,n),new Ir(a[0],a[1])},xl.prototype.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),e=e.getViewTransform(),n=ct(this.tmpMatrix,n,e),e=Nt(this.tmpVec3,t.x,t.y,0),t=(Wt(this.tmpVec3,this.tmpVec3,n),this.context.config),n=t.width,t=t.height;return new Ir((e[0]+1)/2*n,(1-(e[1]+1)/2)*t)},xl.prototype.setPickHandler=function(t){this.pickHandler=t},xl.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})},xl.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))}},xl.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)},xl.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}}},xl.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++)vl.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);n&&e.push(n)}return e},xl.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},xl.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)},xl.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},xl.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})},xl.prototype.createPointerEvent=function(t,e,n,r){var i=this.allocateEvent(ll),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},xl.prototype.createWheelEvent=function(t){var e=this.allocateEvent(hl),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},xl.prototype.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},xl.prototype.cloneWheelEvent=function(t){var e=this.allocateEvent(hl);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},xl.prototype.clonePointerEvent=function(t,e){var n=this.allocateEvent(ll);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},xl.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},xl.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)},xl.prototype.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},xl.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)},xl.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},xl.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)},xl.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)},xl.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)},xl.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||vl.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},xl.prototype.getCursor=function(t){for(var e=t;e;){var n=!!e.getAttribute&&e.getAttribute("cursor");if(n)return n;e=vl.isNode(e)&&e.parentNode}};var bl=xl;function xl(t,e){var c=this;this.globalRuntime=t,this.context=e,this.emitter=new Y,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=Z(),this.tmpVec3=v(),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")),vl.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"),vl.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&&vl.isNode(i)&&i.parentNode);s&&s!==(vl.isNode(c.rootTarget)&&c.rootTarget.parentNode)&&s!==e.target;)s=s.parentNode;if(!s||s===(vl.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!==(vl.isNode(c.rootTarget)&&c.rootTarget.parentNode);)l.currentTarget=l.target,c.notifyTarget(l),n&&c.notifyTarget(l,"mouseenter"),vl.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!==(vl.isNode(c.rootTarget)&&c.rootTarget.parentNode);)a.currentTarget=a.target,c.notifyTarget(a),n&&c.notifyTarget(a,"mouseleave"),vl.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!==(vl.isNode(c.rootTarget)&&c.rootTarget.parentNode);)r.currentTarget=r.target,c.notifyTarget(r),n&&c.notifyTarget(r,"mouseenter"),vl.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"),vl.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)}}kl.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},kl.prototype.getOrCreateContext=function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context};var wl,Ml=kl;function kl(){}(Al=wl=wl||{})[Al.CAMERA_CHANGED=0]="CAMERA_CHANGED",Al[Al.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",Al[Al.NONE=2]="NONE";El.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()})},El.prototype.getStats=function(){return this.stats},El.prototype.disableDirtyRectangleRendering=function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(wl.CAMERA_CHANGED)},El.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())},El.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)})},El.prototype.sort=function(n,r){r.sorted&&r.dirtyReason!==Ti.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;us(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(us)},El.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},El.prototype.dirtify=function(){this.context.renderingContext.renderReasons.add(wl.DISPLAY_OBJECT_CHANGED)};var Ol=El;function El(t,e){this.globalRuntime=t,this.context=e,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new Ls,initAsync:new _s,dirtycheck:new js,cull:new js,beginFrame:new Ls,beforeRender:new Ls,render:new Ls,afterRender:new Ls,endFrame:new Ls,destroy:new Ls,pick:new Ps,pickSync:new js,pointerDown:new Ls,pointerUp:new Ls,pointerMove:new Ls,pointerOut:new Ls,pointerOver:new Ls,pointerWheel:new Ls,pointerCancel:new Ls,click:new Ls}}var Sl=/\[\s*(.*)=(.*)\s*\]/,Al=(_l.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})},_l.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})},_l.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},_l.prototype.getIdOrClassname=function(t){return t.substring(1)},_l.prototype.getAttribute=function(t){var t=t.match(Sl),e="",n="";return t&&2<t.length&&(e=t[1].replace(/"/g,""),n=t[2].replace(/"/g,"")),{name:e,value:n}},_l.prototype.attributeToString=function(t,e){return t.getAttribute&&(t=t.getAttribute(e),!A(t))&&t.toString?t.toString():""},_l);function _l(){}t(Cl,Tl=nl),Cl.ADDITION=2,Cl.MODIFICATION=1,Cl.REMOVAL=3;var Tl,b,Pl=Cl;function Cl(t,e,n,r,i,a,o,s){var l=Tl.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 Ll(t){t=t.renderable;t&&(t.renderBoundsDirty=!0,t.boundsDirty=!0)}(jl=b=b||{}).REPARENT="reparent",jl.DESTROY="destroy",jl.ATTR_MODIFIED="DOMAttrModified",jl.INSERTED="DOMNodeInserted",jl.REMOVED="removed",jl.MOUNTED="DOMNodeInsertedIntoDocument",jl.UNMOUNTED="DOMNodeRemovedFromDocument",jl.BOUNDS_CHANGED="bounds-changed",jl.CULLED="culled";var Nl=new Pl(b.REPARENT,null,"","","",0,"",""),jl=(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,A(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=Ti.ADDED),t.transformable);e&&this.dirtifyWorld(t,e),e.frozen&&this.unfreezeParentToRoot(t),r&&t.dispatchEvent(Nl)},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=Ti.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=Ct(e,n,r));n=t.transformable;Qt(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=Ct(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=Ct(e[0],e[1],e[2]||n.localScale[2]);Ht(e,n.localScale)||(Lt(n.localScale,e),this.dirtifyLocal(t,n))},l.prototype.setLocalRotation=function(t,e,n,r,i){"number"==typeof e&&(e=Jt(e,n,r,i));n=t.transformable;te(n.localRotation,e),this.dirtifyLocal(t,n)},l.prototype.setLocalSkew=function(t,e,n){"number"==typeof e&&(i=e,n=n,(r=new $(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=j(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;)Ll(n),n=n.parentNode;e&&t.forEach(function(t){Ll(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 Pl(b.ATTR_MODIFIED,t,n,n,e,Pl.MODIFICATION,n,n)),t.isCustomElement&&t.isConnected&&t.attributeChangedCallback&&t.attributeChangedCallback(e,n,n)})})},l.prototype.getPosition=function(t){var e=t.transformable;return mt(e.position,this.getWorldTransform(t,e))},l.prototype.getRotation=function(t){var e=t.transformable;return bt(e.rotation,this.getWorldTransform(t,e))},l.prototype.getScale=function(t){var e=t.transformable;return vt(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=mt(v(),e),r=bt(Ut(),e),e=vt(v(),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 Tr.isEmpty(e)?null:((n=n||new Tr).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 Tr},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 Tr).update(t.center,t.halfExtents))}),e&&(t=hs(t))&&(t=t.parsedStyle.clipPath.getBounds(e),r?t&&(r=t.intersection(r)):r=t),(r=r||new Tr)&&(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=Z(),r=(t.parentNode.transformable&&(n=rt(Z(),this.getWorldTransform(t.parentNode))),this.getBounds(t));if(!Tr.isEmpty(r))return(e=new Tr).setFromTransformedAABB(r,n),e}return this.getBounds(t)},l.prototype.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t),i=(Tr.isEmpty(i)||(r=new Tr).setFromTransformedAABB(i,this.getWorldTransform(t)),null==(t=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:t.getContextService().getBoundingClientRect());return r?(e=(t=j(r.getMin(),2))[0],t=t[1],n=(r=j(r.getMax(),2))[0],r=r[1],new Dr(e+((null==i?void 0:i.left)||0),t+((null==i?void 0:i.top)||0),n-e,r-t)):new Dr((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?ct(e.worldTransform,n.worldTransform,e.localTransform):J(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 pl(b.BOUNDS_CHANGED),this.rotate=(o=Ut(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Ct(e,n,r));var i,a,n=t.transformable;null!==t.parentNode&&t.parentNode.transformable?(Qt(r=Ut(),e[0],e[1],e[2]),i=g.getRotation(t),a=g.getRotation(t.parentNode),te(o,a),Zt(o,o),Kt(r,o,r),Kt(n.localRotation,r,i),ne(n.localRotation,n.localRotation),g.dirtifyLocal(t,n)):g.rotateLocal(t,e)}),this.rotateLocal=(i=Ut(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Ct(e,n,r));n=t.transformable;Qt(i,e[0],e[1],e[2]),ee(n.localRotation,n.localRotation,i),g.dirtifyLocal(t,n)}),this.setEulerAngles=(a=Ut(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Ct(e,n,r));n=t.transformable;null!==t.parentNode&&t.parentNode.transformable?(Qt(n.localRotation,e[0],e[1],e[2]),r=g.getRotation(t.parentNode),te(a,Zt(Ut(),r)),ee(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=Ct(e,n,r));var i,a,o,s,l,c,u,h,f,d,p,n=t.transformable;Ht(e,v())||(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,jt(n.localPosition,n.localPosition,e),g.dirtifyLocal(t,n))},this.setPosition=(r=Z(),s=v(),function(t,e){var n=t.transformable;s[0]=e[0],s[1]=e[1],s[2]=e[2]||0,Ht(g.getPosition(t),s)||(Lt(n.position,s),null!==t.parentNode&&t.parentNode.transformable?(e=t.parentNode.transformable,J(r,e.worldTransform),rt(r,r),Wt(n.localPosition,s,r)):Lt(n.localPosition,s),g.dirtifyLocal(t,n))}),this.setLocalPosition=(l=v(),function(t,e){var n=t.transformable;l[0]=e[0],l[1]=e[1],l[2]=e[2]||0,Ht(n.localPosition,l)||(Lt(n.localPosition,l),g.dirtifyLocal(t,n))}),this.translate=(c=v(),u=v(),h=v(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),Ht(e="number"==typeof e?Nt(u,e,n,r):e,c)||(jt(h,g.getPosition(t),e),g.setPosition(t,h))}),this.setRotation=function(){var o=Ut();return function(t,e,n,r,i){var a=t.transformable;"number"==typeof e&&(e=Jt(e,n,r,i)),null!==t.parentNode&&t.parentNode.transformable?(n=g.getRotation(t.parentNode),te(o,n),Zt(o,o),Kt(a.localRotation,o,e),ne(a.localRotation,a.localRotation),g.dirtifyLocal(t,a)):g.setLocalRotation(t,e)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=(n=Z(),f=v(),d=Jt(0,0,0,1),function(t){var e;0!==t.localSkew[0]||0!==t.localSkew[1]?(xt(t.localTransform,t.localRotation,t.localPosition,Ct(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||((e=et(n))[4]=Math.tan(t.localSkew[0]),e[1]=Math.tan(t.localSkew[1]),ct(t.localTransform,t.localTransform,e)),e=xt(n,d,f,t.localScale,t.origin),ct(t.localTransform,t.localTransform,e)):xt(t.localTransform,t.localRotation,t.localPosition,t.localScale,t.origin)})}var Rl={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]},Il=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,Bl=new RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),Dl=new RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),Fl=(zl.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,Rl.MetricsString+Rl.BaselineSymbol),a=Math.ceil(e.measureText(i).width),o=Math.ceil(e.measureText(Rl.BaselineSymbol).width),s=Rl.HeightMultiplier*o,o=o*Rl.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},zl.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=He(e)&&"".concat(e,"px")||"16px",a=n.split(","),o=a.length-1;0<=o;o--){var s=a[o].trim();!Bs.test(s)&&Is.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 Dr(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},zl.prototype.setGraphemeOnPath=function(){},zl.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 k=h[f].length,O=0,E=k,S=0;S<k;S++){var A=g(h[f][S]);if(c<O+A+y){E=S;break}O+=A}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")},zl.prototype.isBreakingSpace=function(t){return"string"==typeof t&&0<=Rl.BreakingSpaces.indexOf(t.charCodeAt(0))},zl.prototype.isNewline=function(t){return"string"==typeof t&&0<=Rl.Newlines.indexOf(t.charCodeAt(0))},zl.prototype.trimToBreakable=function(t){var e,t=M([],j(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},zl.prototype.canBreakInLastChar=function(t){return!t||!Il.test(t)},zl.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)},zl.prototype.findBreakableIndex=function(t){for(var e=t.length-1;0<=e;e--)if(!Il.test(t[e]))return e;return-1},zl.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},zl);function zl(t){var n=this;this.runtime=t,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,e){return!n.isBreakingSpace(e)&&!(!t||!Dl.exec(e)&&!Bl.exec(t))},this.trimByKinsokuShorui=function(t){var e,n=M([],j(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 Wl,_={},Gs=(Qs=new Qs,Ks=new Ks,(cu={})[k.CIRCLE]=new Gs,cu[k.ELLIPSE]=new Vs,cu[k.RECT]=Qs,cu[k.IMAGE]=Qs,cu[k.GROUP]=Qs,cu[k.LINE]=new qs,cu[k.TEXT]=new tl(_),cu[k.POLYLINE]=Ks,cu[k.POLYGON]=Ks,cu[k.PATH]=new Us,cu[k.HTML]=null,cu[k.MESH]=null,cu),tl=(Vs=new So,Qs=new Co,(qs={})[o.PERCENTAGE]=null,qs[o.NUMBER]=new Vo,qs[o.ANGLE]=new ii,qs[o.DEFINED_PATH]=new s,qs[o.PAINT]=Vs,qs[o.COLOR]=Vs,qs[o.FILTER]=new _o,qs[o.LENGTH]=Qs,qs[o.LENGTH_PERCENTAGE]=Qs,qs[o.LENGTH_PERCENTAGE_12]=new No,qs[o.LENGTH_PERCENTAGE_14]=new Ro,qs[o.COORDINATE]=new zo,qs[o.OFFSET_DISTANCE]=new qo,qs[o.OPACITY_VALUE]=new Uo,qs[o.PATH]=new Ko,qs[o.LIST_OF_POINTS]=new Qo,qs[o.SHADOW_BLUR]=new es,qs[o.TEXT]=new rs,qs[o.TEXT_TRANSFORM]=new as,qs[o.TRANSFORM]=new Es,qs[o.TRANSFORM_ORIGIN]=new Fs,qs[o.Z_INDEX]=new zs,qs[o.MARKER]=new Go,qs),Gl=(_.CameraContribution=r,_.AnimationTimeline=null,_.EasingFunction=null,_.offscreenCanvas=new Ml,_.nativeHTMLMap=new WeakMap,_.sceneGraphSelector=new Al,_.sceneGraphService=new jl(_),_.textService=new Fl(_),_.geometryUpdaterFactory=Gs,_.CSSPropertySyntaxFactory=tl,_.styleValueRegistry=new a(_),_.layoutRegistry=null,_.globalThis=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==S)return S;throw new Error("Unable to locate global `this`")}(),_.enableCSSParsing=!0,_.enableDataset=!1,_.enableStyleSyntax=!0,0),Hl=new Pl(b.INSERTED,null,"","","",0,"",""),Vl=new Pl(b.REMOVED,null,"","","",0,"",""),Yl=new pl(b.DESTROY),Ks=(t(c,Wl=vl),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(Hr)},c.prototype.appendChild=function(t,e){if(t.destroyed)throw new Error("Cannot append a destroyed element.");return _.sceneGraphService.attach(t,this,e),null!=(e=this.ownerDocument)&&e.defaultView&&this.ownerDocument.defaultView.mountChildren(t),Hl.relatedNode=this,t.dispatchEvent(Hl),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 Vl.relatedNode=this,t.dispatchEvent(Vl),null!=(e=t.ownerDocument)&&e.defaultView&&t.ownerDocument.defaultView.unmountChildren(t),_.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 _.sceneGraphService.matches(t,this)},c.prototype.getElementById=function(t){return _.sceneGraphService.querySelector("#".concat(t),this)},c.prototype.getElementsByName=function(t){return _.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)},c.prototype.getElementsByClassName=function(t){return _.sceneGraphService.querySelectorAll(".".concat(t),this)},c.prototype.getElementsByTagName=function(t){return _.sceneGraphService.querySelectorAll(t,this)},c.prototype.querySelector=function(t){return _.sceneGraphService.querySelector(t,this)},c.prototype.querySelectorAll=function(t){return _.sceneGraphService.querySelectorAll(t,this)},c.prototype.closest=function(t){var e=this;do{if(_.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=j(r))[0],n=n.slice(1),this.parentNode.appendChild(e,t),e.after.apply(e,M([],j(n),!1)))},c.prototype.replaceWith=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.after.apply(this,M([],j(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,M([],j(t),!1))},c.prototype.remove=function(){return this.parentNode?this.parentNode.removeChild(this):this},c.prototype.destroy=function(){this.dispatchEvent(Yl),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},c.prototype.getGeometryBounds=function(){return _.sceneGraphService.getGeometryBounds(this)},c.prototype.getRenderBounds=function(){return _.sceneGraphService.getBounds(this,!0)},c.prototype.getBounds=function(){return _.sceneGraphService.getBounds(this)},c.prototype.getLocalBounds=function(){return _.sceneGraphService.getLocalBounds(this)},c.prototype.getBoundingClientRect=function(){return _.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?_.enableCSSParsing?null:void 0:void 0===(e=this.attributes[t])&&(t=bi(t),e=this.attributes[t],_.enableCSSParsing)&&A(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(Hr)},c.prototype.getAttributeNode=function(t){throw new Error(Hr)},c.prototype.getAttributeNodeNS=function(t,e){throw new Error(Hr)},c.prototype.hasAttributeNS=function(t,e){throw new Error(Hr)},c.prototype.removeAttributeNS=function(t,e){throw new Error(Hr)},c.prototype.removeAttributeNode=function(t){throw new Error(Hr)},c.prototype.setAttributeNS=function(t,e,n){throw new Error(Hr)},c.prototype.setAttributeNode=function(t){throw new Error(Hr)},c.prototype.setAttributeNodeNS=function(t){throw new Error(Hr)},c.prototype.toggleAttribute=function(t,e){throw new Error(Hr)},c);function c(){var t=null!==Wl&&Wl.apply(this,arguments)||this;return t.entity=Gl++,t.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1,proxyNodeName:void 0},t.cullable={strategy:_i.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=_.enableCSSParsing?{anchor:Pi,opacity:Pi,fillOpacity:Pi,strokeOpacity:Pi,fill:Pi,stroke:Pi,transform:Pi,transformOrigin:Pi,visibility:Pi,pointerEvents:Pi,lineWidth:Pi,lineCap:Pi,lineJoin:Pi,increasedLineWidthForHitTesting:Pi,fontSize:Pi,fontFamily:Pi,fontStyle:Pi,fontWeight:Pi,fontVariant:Pi,textAlign:Pi,textBaseline:Pi,textTransform:Pi,zIndex:Pi,filter:Pi,shadowType:Pi}:null,t.parsedStyle={},t.attributes={},t}function ql(t){return null!=t&&t.nodeName}var $l,Ul=new Pl(b.ATTR_MODIFIED,null,null,null,null,Pl.MODIFICATION,null,null),Xl={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:""},Kl={anchor:[0,0],fill:Li,stroke:Li,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},Zl=m(m({},Kl),{opacity:1,fillOpacity:1,strokeOpacity:1,visibility:"visible",pointerEvents:"auto",lineWidth:1,lineCap:"butt",lineJoin:"miter",increasedLineWidthForHitTesting:0,fillRule:"nonzero"}),Ql=M(M([],j(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"]),!1),["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"],!1),Jl=(t(u,$l=Ks),u.prototype.destroy=function(){$l.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];ql(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=(_.enableCSSParsing&&(r.usedAttributes=Ql),{});for(e in t)i[bi(e)]=t[e];_.styleValueRegistry.processProperties(this,i,r),n.dirty=!0},u.prototype.setAttribute=function(t,e,n){void 0===n&&(n=!1);t=bi(t);Ze(e)||!n&&e===this.attributes[t]||(this.internalSetAttribute(t,e),$l.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=(_.styleValueRegistry.processProperties(this,((o={})[t]=e,o),n),r.dirty=!0,this.parsedStyle[t]);this.isConnected&&(Ul.relatedNode=this,Ul.prevValue=i,Ul.newValue=e,Ul.attrName=t,Ul.prevParsedValue=a,Ul.newParsedValue=o,this.isMutationObserved?this.dispatchEvent(Ul):(Ul.target=this).ownerDocument.defaultView.dispatchEvent(Ul,!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=j(t.getMin(),2),n=e[0],e=e[1],t=j(t.getMax(),2),r=t[0],t=t[1];return new Dr(n,e,r-n,t-e)},u.prototype.setOrigin=function(t,e,n){return _.sceneGraphService.setOrigin(this,mr(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},u.prototype.getOrigin=function(){return _.sceneGraphService.getOrigin(this)},u.prototype.setPosition=function(t,e,n){return _.sceneGraphService.setPosition(this,mr(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},u.prototype.setLocalPosition=function(t,e,n){return _.sceneGraphService.setLocalPosition(this,mr(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},u.prototype.translate=function(t,e,n){return _.sceneGraphService.translate(this,mr(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},u.prototype.translateLocal=function(t,e,n){return _.sceneGraphService.translateLocal(this,mr(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},u.prototype.getPosition=function(){return _.sceneGraphService.getPosition(this)},u.prototype.getLocalPosition=function(){return _.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=mr(t,e=e||t,n=n||t)),_.sceneGraphService.scaleLocal(this,t),this},u.prototype.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=mr(t,e=e||t,n=n||t)),_.sceneGraphService.setLocalScale(this,t),this},u.prototype.getLocalScale=function(){return _.sceneGraphService.getLocalScale(this)},u.prototype.getScale=function(){return _.sceneGraphService.getScale(this)},u.prototype.getEulerAngles=function(){return br(j(xr(v(),_.sceneGraphService.getWorldTransform(this)),3)[2])},u.prototype.getLocalEulerAngles=function(){return br(j(xr(v(),_.sceneGraphService.getLocalRotation(this)),3)[2])},u.prototype.setEulerAngles=function(t){return _.sceneGraphService.setEulerAngles(this,0,0,t),this},u.prototype.setLocalEulerAngles=function(t){return _.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},u.prototype.rotateLocal=function(t,e,n){return A(e)&&A(n)?_.sceneGraphService.rotateLocal(this,0,0,t):_.sceneGraphService.rotateLocal(this,t,e,n),this},u.prototype.rotate=function(t,e,n){return A(e)&&A(n)?_.sceneGraphService.rotate(this,0,0,t):_.sceneGraphService.rotate(this,t,e,n),this},u.prototype.setRotation=function(t,e,n,r){return _.sceneGraphService.setRotation(this,t,e,n,r),this},u.prototype.setLocalRotation=function(t,e,n,r){return _.sceneGraphService.setLocalRotation(this,t,e,n,r),this},u.prototype.setLocalSkew=function(t,e){return _.sceneGraphService.setLocalSkew(this,t,e),this},u.prototype.getRotation=function(){return _.sceneGraphService.getRotation(this)},u.prototype.getLocalRotation=function(){return _.sceneGraphService.getLocalRotation(this)},u.prototype.getLocalSkew=function(){return _.sceneGraphService.getLocalSkew(this)},u.prototype.getLocalTransform=function(){return _.sceneGraphService.getLocalTransform(this)},u.prototype.getWorldTransform=function(){return _.sceneGraphService.getWorldTransform(this)},u.prototype.setLocalTransform=function(t){return _.sceneGraphService.setLocalTransform(this,t),this},u.prototype.resetLocalTransform=function(){_.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,M([],j(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,M([],j(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=j(t,2),i=r[0],r=r[1];return i?Re(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=j(mt(v(),t),2),n=e[0],e=e[1],r=j(vt(v(),t),2),i=r[0],r=r[1],t=bt(Ut(),t),t=j(xr(v(),t),3),a=t[0],t=t[2];return wr(a||t,n,e,i,r)},u.prototype.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},u.prototype.setMatrix=function(t){var t=j(Mr(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=j(Mr(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(){_.enableCSSParsing?this.style.visibility="visible":this.forEach(function(t){t.style.visibility="visible"})},u.prototype.hide=function(){_.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=$l.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||k.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,_.enableCSSParsing?Kl:Zl,r.config.initialParsedStyle),_.enableCSSParsing&&Object.assign(r.attributes,Xl),r.initAttributes(r.config.style),_.globalThis.Proxy||function(){});return _.enableDataset&&(r.dataset=new t({},{get:function(t,e){e="".concat("data-").concat(fi(e));return void 0!==t[e]?t[e]:r.getAttribute(e)},set:function(t,e,n){return r.setAttribute("".concat("data-").concat(fi(e)),n),!0}})),_.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}var tc,ec=function(t){var e=t.name,n=t.inherits,r=t.interpolable,i=t.initialValue,t=t.syntax;_.styleValueRegistry.registerMetadata({n:e,inh:n,int:r,d:i,syntax:t})},nc=(t(rc,tc=Jl),rc);function rc(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return tc.call(this,m({type:k.CIRCLE,style:_.enableCSSParsing?m({cx:"",cy:"",r:""},e):m({},e),initialParsedStyle:{anchor:[.5,.5],transformOrigin:_.enableCSSParsing?null:[Ii,Ii]}},t))||this}t(oc,ic=Jl);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({style:_.enableCSSParsing?m({x:"",y:""},n):m({},n)},t))||this).isCustomElement=!0,e}t(cc,sc=Jl);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:k.ELLIPSE,style:_.enableCSSParsing?m({cx:"",cy:"",rx:"",ry:""},e):m({},e),initialParsedStyle:{anchor:[.5,.5],transformOrigin:_.enableCSSParsing?null:[Ii,Ii]}},t))||this}t(fc,uc=Jl);var uc,hc=fc;function fc(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return uc.call(this,m({type:k.GROUP,style:_.enableCSSParsing?m({x:"",y:"",width:"",height:""},e):m({},e)},t))||this}t(gc,dc=Jl),gc.prototype.getDomElement=function(){return this.parsedStyle.$el},gc.prototype.getBoundingClientRect=function(){return this.parsedStyle.$el.getBoundingClientRect()},gc.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},gc.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 Tr).setMinMax([t,r,0],[t+n.width,r+n.height,0]),e):null},gc.prototype.getLocalBounds=function(){if(this.parentNode){var t,e=rt(Z(),this.parentNode.getWorldTransform()),n=this.getBounds();if(!Tr.isEmpty(n))return(t=new Tr).setFromTransformedAABB(n,e),t}return this.getBounds()};var dc,pc=gc;function gc(t){var e=this,n=(t=void 0===t?{}:t).style,t=at(t,["style"]);return(e=dc.call(this,m({type:k.HTML,style:_.enableCSSParsing?m({x:"",y:"",width:"auto",height:"auto",innerHTML:""},n):m({},n)},t))||this).cullable.enable=!1,e}t(vc,yc=Jl);var yc,mc=vc;function vc(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return yc.call(this,m({type:k.IMAGE,style:_.enableCSSParsing?m({x:"",y:"",img:"",width:"",height:""},e):m({},e)},t))||this}t(wc,bc=Jl),wc.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&&ql(r)&&(this.markerStartAngle=0,r.remove()),i&&ql(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&ql(r)&&(this.markerEndAngle=0,r.remove()),i)&&ql(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))},wc.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&&ql(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))},wc.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=Fn(r,i,a,o,t),i=r.x,a=r.y,o=Wt(v(),Ct(i-s,a-n,0),e?this.getWorldTransform():this.getLocalTransform());return new Ir(o[0],o[1])},wc.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},wc.prototype.getTotalLength=function(){var t=this.parsedStyle;return Dn(t.x1,t.y1,t.x2,t.y2)};var bc,xc=wc;function wc(t){var e=this,n=(t=void 0===t?{}:t).style,t=at(t,["style"]),n=((e=bc.call(this,m({type:k.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&&ql(t)&&(e.markerStartAngle=t.getLocalEulerAngles(),e.appendChild(t)),n&&ql(n)&&(e.markerEndAngle=n.getLocalEulerAngles(),e.appendChild(n)),e.transformMarker(!0),e.transformMarker(!1),e}t(Oc,Mc=Jl),Oc.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&&ql(r)&&(this.markerStartAngle=0,r.remove()),i&&ql(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&ql(r)&&(this.markerEndAngle=0,r.remove()),i&&ql(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},Oc.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&&ql(c)&&(u=0,h=t?(o=(t=j(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=j(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))},Oc.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&&ql(t))for(var a=1;a<n.length-1;a++){var o=j(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)}},Oc.prototype.getTotalLength=function(){return ja(this)},Oc.prototype.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,n=Ae(n.path.absolutePath,t,m(m({},a),{bbox:!1,length:!0})).point,t=n.x,a=n.y,n=Wt(v(),Ct(t-r,a-i,0),e?this.getWorldTransform():this.getLocalTransform());return new Ir(n[0],n[1])},Oc.prototype.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*ja(this),e)},Oc.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},Oc.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 Mc,kc=Oc;function Oc(t){var e=this,n=(t=void 0===t?{}:t).style,t=at(t,["style"]),n=((e=Mc.call(this,m({type:k.PATH,style:_.enableCSSParsing?m({path:"",miterLimit:""},n):m({},n),initialParsedStyle:_.enableCSSParsing?null:{miterLimit:4,path:m({},Bi)}},t))||this).markerStartAngle=0,e.markerEndAngle=0,e.markerMidList=[],e.parsedStyle),t=n.markerStart,r=n.markerEnd,n=n.markerMid;return t&&ql(t)&&(e.markerStartAngle=t.getLocalEulerAngles(),e.appendChild(t)),n&&ql(n)&&e.placeMarkerMid(n),r&&ql(r)&&(e.markerEndAngle=r.getLocalEulerAngles(),e.appendChild(r)),e.transformMarker(!0),e.transformMarker(!1),e}t(Ac,Ec=Jl),Ac.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&&ql(r)&&(this.markerStartAngle=0,r.remove()),i&&ql(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&ql(r)&&(this.markerEndAngle=0,r.remove()),i&&ql(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},Ac.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&&ql(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))},Ac.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&&ql(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 Ec,Sc=Ac;function Ac(t){var e=this,n=(t=void 0===t?{}:t).style,t=at(t,["style"]),n=((e=Ec.call(this,m({type:k.POLYGON,style:_.enableCSSParsing?m({points:"",miterLimit:"",isClosed:!0},n):m({},n),initialParsedStyle:_.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&&ql(t)&&(e.markerStartAngle=t.getLocalEulerAngles(),e.appendChild(t)),n&&ql(n)&&e.placeMarkerMid(n),r&&ql(r)&&(e.markerEndAngle=r.getLocalEulerAngles(),e.appendChild(r)),e.transformMarker(!0),e.transformMarker(!1),e}t(Pc,_c=Sc),Pc.prototype.getTotalLength=function(){return this.parsedStyle.points.totalLength},Pc.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},Pc.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)}),Fn(a[s][0],a[s][1],a[s+1][0],a[s+1][1],o)),a=e.x,e=e.y,a=Wt(v(),Ct(a-r,e-i,0),t?this.getWorldTransform():this.getLocalTransform());return new Ir(a[0],a[1])},Pc.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},Pc.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 _c,Tc=Pc;function Pc(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return _c.call(this,m({type:k.POLYLINE,style:_.enableCSSParsing?m({points:"",miterLimit:"",isClosed:!1},e):m({},e),initialParsedStyle:_.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},t))||this}t(Nc,Cc=Jl);var Cc,Lc=Nc;function Nc(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return Cc.call(this,m({type:k.RECT,style:_.enableCSSParsing?m({x:"",y:"",width:"",height:"",radius:""},e):m({},e)},t))||this}t(Ic,jc=Jl),Ic.prototype.getComputedTextLength=function(){var t;return(null==(t=this.parsedStyle.metrics)?void 0:t.maxLineWidth)||0},Ic.prototype.getLineBoundingRects=function(){var t;return(null==(t=this.parsedStyle.metrics)?void 0:t.lineMetrics)||[]},Ic.prototype.isOverflowing=function(){return!!this.parsedStyle.isOverflowing};var jc,Rc=Ic;function Ic(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return jc.call(this,m({type:k.TEXT,style:_.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:_.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}Dc.prototype.define=function(t,e){this.registry[t]=e},Dc.prototype.get=function(t){return this.registry[t]};var Bc=Dc;function Dc(){this.registry={},this.define(k.CIRCLE,nc),this.define(k.ELLIPSE,lc),this.define(k.RECT,Lc),this.define(k.IMAGE,mc),this.define(k.LINE,xc),this.define(k.GROUP,hc),this.define(k.PATH,kc),this.define(k.POLYGON,Sc),this.define(k.POLYLINE,Tc),this.define(k.TEXT,Rc),this.define(k.HTML,pc)}t(Wc,Fc=vl),Object.defineProperty(Wc.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(Wc.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(Wc.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(Wc.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),Wc.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?Rc:hc),(t=new n(e)).ownerDocument=this,t)},Wc.prototype.createElementNS=function(t,e,n){return this.createElement(e,n)},Wc.prototype.cloneNode=function(t){throw new Error(Hr)},Wc.prototype.destroy=function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}},Wc.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},Wc.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)},Wc.prototype.elementFromPoint=function(a,o){return X(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]}})})},Wc.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)},Wc.prototype.elementsFromPoint=function(a,o){return X(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]}})})},Wc.prototype.appendChild=function(t,e){throw new Error(Vr)},Wc.prototype.insertBefore=function(t,e){throw new Error(Vr)},Wc.prototype.removeChild=function(t,e){throw new Error(Vr)},Wc.prototype.replaceChild=function(t,e,n){throw new Error(Vr)},Wc.prototype.append=function(){throw new Error(Vr)},Wc.prototype.prepend=function(){throw new Error(Vr)},Wc.prototype.getElementById=function(t){return this.documentElement.getElementById(t)},Wc.prototype.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},Wc.prototype.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},Wc.prototype.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},Wc.prototype.querySelector=function(t){return this.documentElement.querySelector(t)},Wc.prototype.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},Wc.prototype.find=function(t){return this.documentElement.find(t)},Wc.prototype.findAll=function(t){return this.documentElement.findAll(t)};var Fc,zc=Wc;function Wc(){var t=Fc.call(this)||this;t.defaultView=null,t.ownerDocument=null,t.nodeName="document";try{t.timeline=new _.AnimationTimeline(t)}catch(t){}var r={};return bo.forEach(function(t){var e=t.n,n=t.inh,t=t.d;n&&t&&(r[e]=pi(t)?t(k.GROUP):t)}),t.documentElement=new hc({id:"g-root",style:r}),((t.documentElement.ownerDocument=t).documentElement.parentNode=t).childNodes=[t.documentElement],t}Hc.prototype.apply=function(t){var n=t.camera,e=t.renderingService,r=t.renderingContext,i=this.strategies;e.hooks.cull.tap(Hc.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 pl(b.CULLED)),null))}),e.hooks.afterRender.tap(Hc.tag,function(t){t.cullable.visibilityPlaneMask=-1})},Hc.tag="Culling";var Gc=Hc;function Hc(t){this.strategies=t}Yc.prototype.apply=function(t){var e=t.renderingService;e.hooks.dirtycheck.tap(Yc.tag,function(t){return t&&(t.renderable.dirty||e.disableDirtyRectangleRendering()?t:null)})},Yc.tag="DirtyCheck";var Vc=Yc;function Yc(){}$c.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($c.tag,function(t){t=c.normalizeWheelEvent(t);c.context.eventService.mapEvent(t)}),t.hooks.pointerDown.tap($c.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($c.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($c.tag,this.onPointerMove),t.hooks.pointerOver.tap($c.tag,this.onPointerMove),t.hooks.pointerOut.tap($c.tag,this.onPointerMove),t.hooks.click.tap($c.tag,this.onClick),t.hooks.pointerCancel.tap($c.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)})},$c.prototype.getViewportXY=function(t){var e,n=t.offsetX,r=t.offsetY,i=t.clientX,t=t.clientY;return t=!this.context.config.supportsCSSTransform||A(n)||A(r)?(e=(i=this.context.eventService.client2Viewport(new Ir(i,t))).x,i.y):(e=n,r),{x:e,y:t}},$c.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=ds[t.type]||t.type),t},$c.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},$c.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},$c.prototype.setCursor=function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")},$c.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];Ze(i.button)&&(i.button=0),Ze(i.buttons)&&(i.buttons=1),Ze(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),Ze(i.width)&&(i.width=i.radiusX||1),Ze(i.height)&&(i.height=i.radiusY||1),Ze(i.tiltX)&&(i.tiltX=0),Ze(i.tiltY)&&(i.tiltY=0),Ze(i.pointerType)&&(i.pointerType="touch"),Ze(i.pointerId)&&(i.pointerId=i.identifier||0),Ze(i.pressure)&&(i.pressure=i.force||.5),Ze(i.twist)&&(i.twist=0),Ze(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else e.isMouseEvent(t)?(Ze((e=t).isPrimary)&&(e.isPrimary=!0),Ze(e.width)&&(e.width=1),Ze(e.height)&&(e.height=1),Ze(e.tiltX)&&(e.tiltX=0),Ze(e.tiltY)&&(e.tiltY=0),Ze(e.pointerType)&&(e.pointerType="mouse"),Ze(e.pointerId)&&(e.pointerId=1),Ze(e.pressure)&&(e.pressure=.5),Ze(e.twist)&&(e.twist=0),Ze(e.tangentialPressure)&&(e.tangentialPressure=0),e.isNormalized=!0,n.push(e)):n.push(t);return n},$c.tag="Event";var qc=$c;function $c(){var c=this;this.autoPreventDefault=!1,this.rootPointerEvent=new ll(null),this.rootWheelEvent=new hl(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 Uc=[k.CIRCLE,k.ELLIPSE,k.IMAGE,k.RECT,k.LINE,k.POLYLINE,k.POLYGON,k.TEXT,k.PATH,k.HTML],Xc=(Kc.prototype.isVisible=function(t,e){var n,r,i=e.cullable;return!i.enable||(n=e.getRenderBounds(),!Tr.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||Cr.INDETERMINATE,t.planes),i.visible=i.visibilityPlaneMask!==Cr.OUTSIDE,i.visible))},Kc.prototype.computeVisibilityWithPlaneMask=function(t,e,n,r){if(n===Cr.OUTSIDE||n===Cr.INSIDE)return n;for(var i=Cr.INSIDE,a=-1<Uc.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(Dt(u,e.getPositiveFarPoint(r[o]))+c<0)return Cr.OUTSIDE;Dt(u,e.getNegativeFarPoint(r[o]))+c<0&&(i|=l)}}return i},Kc);function Kc(){}Jc.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,_.enableCSSParsing&&_.styleValueRegistry.recalc(t),_.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),_.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(Jc.tag,function(){l.addEventListener(b.MOUNTED,r),l.addEventListener(b.UNMOUNTED,i),l.addEventListener(b.ATTR_MODIFIED,e),l.addEventListener(b.BOUNDS_CHANGED,n)}),o.hooks.destroy.tap(Jc.tag,function(){l.removeEventListener(b.MOUNTED,r),l.removeEventListener(b.UNMOUNTED,i),l.removeEventListener(b.ATTR_MODIFIED,e),l.removeEventListener(b.BOUNDS_CHANGED,n),a.toSync.clear()}),o.hooks.endFrame.tap(Jc.tag,function(){a.syncRTree()})},Jc.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=j(a.getMin(),2))[0],n=n[1],r=(a=j(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()},Jc.tag="Prepare";var Zc,Qc=Jc;function Jc(){this.toSync=new Set}(Us=Zc=Zc||{}).READY="ready",Us.BEFORE_RENDER="beforerender",Us.RERENDER="rerender",Us.AFTER_RENDER="afterrender",Us.BEFORE_DESTROY="beforedestroy",Us.AFTER_DESTROY="afterdestroy",Us.RESIZE="resize",Us.DIRTY_RECTANGLE="dirtyrectangle",Us.RENDERER_CHANGED="rendererchanged";var tu,eu=new pl(b.MOUNTED),nu=new pl(b.UNMOUNTED),ru=new pl(Zc.BEFORE_RENDER),iu=new pl(Zc.RERENDER),au=new pl(Zc.AFTER_RENDER),ou=(t(su,tu=al),su.prototype.initRenderingContext=function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},su.prototype.initDefaultCamera=function(t,e,n){var r=this,i=new _.CameraContribution;i.clipSpaceNearZ=n,i.setType(zr.EXPLORING,Wr.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(Ur,function(){r.context.renderingContext.renderReasons.add(wl.CAMERA_CHANGED)}),this.context.camera=i},su.prototype.getConfig=function(){return this.context.config},su.prototype.getRoot=function(){return this.document.documentElement},su.prototype.getCamera=function(){return this.context.camera},su.prototype.getContextService=function(){return this.context.contextService},su.prototype.getEventService=function(){return this.context.eventService},su.prototype.getRenderingService=function(){return this.context.renderingService},su.prototype.getRenderingContext=function(){return this.context.renderingContext},su.prototype.getStats=function(){return this.getRenderingService().getStats()},Object.defineProperty(su.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}),su.prototype.destroy=function(t,e){void 0===t&&(t=!0),(e=void 0===e?!1:e)||this.dispatchEvent(new pl(Zc.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 pl(Zc.AFTER_DESTROY))},su.prototype.changeSize=function(t,e){this.resize(t,e)},su.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===Gr.ORTHOGRAPHIC?n.setOrthographic(t/-2,t/2,e/2,e/-2,n.getNear(),n.getFar()):n.setAspect(t/e),this.dispatchEvent(new pl(Zc.RESIZE,{width:t,height:e}))},su.prototype.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},su.prototype.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},su.prototype.removeChild=function(t){return this.document.documentElement.removeChild(t)},su.prototype.removeChildren=function(){this.document.documentElement.removeChildren()},su.prototype.destroyChildren=function(){this.document.documentElement.destroyChildren()},su.prototype.render=function(){var t=this;this.dispatchEvent(ru),this.getRenderingService().render(this.getConfig(),function(){t.dispatchEvent(iu)}),this.dispatchEvent(au)},su.prototype.run=function(){function t(){e.render(),e.frameId=e.requestAnimationFrame(t)}var e=this;t()},su.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 cr,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new qc,new Qc,new Vc,new Gc([new Xc])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(m(m({},_),this.context)),this.context.renderingService=new Ol(_,this.context),this.context.eventService=new bl(_,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)})},su.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 pl(Zc.READY))}):r.dispatchEvent(new pl(Zc.READY)),r.readyPromise&&r.resolveReadyPromise()):r.dispatchEvent(new pl(Zc.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()})},su.prototype.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach(function(t){t.context=e.context,t.init(_)})},su.prototype.setRenderer=function(t){var e,n=this.getConfig();n.renderer!==t&&(e=n.renderer,n.renderer=t,this.destroy(!1,!0),M([],j(null==e?void 0:e.getPlugins()),!1).reverse().forEach(function(t){t.destroy(_)}),this.initRenderer(t))},su.prototype.setCursor=function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)},su.prototype.unmountChildren=function(t){var e=this;t.childNodes.forEach(function(t){e.unmountChildren(t)}),this.inited&&(t.isMutationObserved?t.dispatchEvent(nu):(nu.target=t,this.dispatchEvent(nu,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()},su.prototype.mountChildren=function(t){var e=this;this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,t.isMutationObserved?t.dispatchEvent(eu):(eu.target=t,this.dispatchEvent(eu,!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()},su.prototype.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},su.prototype.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},su.prototype.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},su.prototype.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},su.prototype.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},su.prototype.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},su);function su(t){var e=tu.call(this)||this,n=(e.Element=Jl,e.inited=!1,e.context={},e.document=new zc,(e.document.defaultView=e).customElements=new Bc,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||ls++,ss[w]&&ss[w].destroy(),ss[w]=M),a),M=o,k=s;return r&&(k=1<=(k=s||cs&&window.devicePixelRatio||1)?Math.ceil(k):1,w=a||("auto"===(a=fs(s=r,"width"))?s.offsetWidth:parseFloat(a))||r.width/k,M=o||("auto"===(a=fs(s=r,"height"))?s.offsetHeight:parseFloat(a))||r.height/k),e.devicePixelRatio=k,e.requestAnimationFrame=null!=f?f:Ss.bind(_.globalThis),e.cancelAnimationFrame=null!=d?d:As.bind(_.globalThis),e.supportsTouchEvents=null!=y?y:"ontouchstart"in _.globalThis,e.supportsPointerEvents=null!=g?g:!!_.globalThis.PointerEvent,e.isTouchEvent=null!=x?x:function(t){return e.supportsTouchEvents&&t instanceof _.globalThis.TouchEvent},e.isMouseEvent=null!=t?t:function(t){return!_.globalThis.MouseEvent||t instanceof _.globalThis.MouseEvent&&(!e.supportsPointerEvents||!(t instanceof _.globalThis.PointerEvent))},e.initRenderingContext({container:n,canvas:r,width:w,height:M,renderer:l,offscreenCanvas:i,devicePixelRatio:k,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(uu,lu=r),uu.prototype.rotate=function(t,e,n){if(this.relElevation=yr(e),this.relAzimuth=yr(t),this.relRoll=yr(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===zr.EXPLORING){e=Xt(Ut(),[1,0,0],vr((this.rotateWorld?1:-1)*this.relElevation)),t=Xt(Ut(),[0,1,0],vr((this.rotateWorld?1:-1)*this.relAzimuth)),n=Xt(Ut(),[0,0,1],vr(this.relRoll)),t=Kt(Ut(),t,e),t=Kt(Ut(),t,n),e=wt(Z(),t);ut(this.matrix,this.matrix,[0,0,-this.distance]),ct(this.matrix,this.matrix,e),ut(this.matrix,this.matrix,[0,0,this.distance])}else{if(90<Math.abs(this.elevation))return this;this.computeMatrix()}return this._getAxes(),this.type===zr.ORBITING||this.type===zr.EXPLORING?this._getPosition():this.type===zr.TRACKING&&this._getFocalPoint(),this._update(),this},uu.prototype.pan=function(t,e){t=mr(t,e,0),e=Tt(this.position);return jt(e,e,It(v(),this.right,t[0])),jt(e,e,It(v(),this.up,t[1])),this._setPosition(e),this.triggerUpdate(),this},uu.prototype.dolly=function(t){var e=this.forward,n=Tt(this.position),t=(this.dollyingStep,this.distance+t*this.dollyingStep),t=Math.max(Math.min(t,this.maxDistance),this.minDistance)-this.distance;return n[0]+=t*e[0],n[1]+=t*e[1],n[2]+=t*e[2],this._setPosition(n),this.type===zr.ORBITING||this.type===zr.EXPLORING?this._getDistance():this.type===zr.TRACKING&&jt(this.focalPoint,n,this.distanceVector),this.triggerUpdate(),this},uu.prototype.cancelLandmarkAnimation=function(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)},uu.prototype.createLandmark=function(t,e){var n,r=(e=void 0===e?{}:e).position,r=void 0===r?this.position:r,i=e.focalPoint,i=void 0===i?this.focalPoint:i,a=e.roll,e=e.zoom,o=new _.CameraContribution,r=(o.setType(this.type,void 0),o.setPosition(r[0],null!=(n=r[1])?n:this.position[1],null!=(n=r[2])?n:this.position[2]),o.setFocalPoint(i[0],null!=(r=i[1])?r:this.focalPoint[1],null!=(n=i[2])?n:this.focalPoint[2]),o.setRoll(null!=a?a:this.roll),o.setZoom(null!=e?e:this.zoom),{name:t,matrix:Q(o.getWorldTransform()),right:Tt(o.right),up:Tt(o.up),forward:Tt(o.forward),position:Tt(o.getPosition()),focalPoint:Tt(o.getFocalPoint()),distanceVector:Tt(o.getDistanceVector()),distance:o.getDistance(),dollyingStep:o.getDollyingStep(),azimuth:o.getAzimuth(),elevation:o.getElevation(),roll:o.getRoll(),relAzimuth:o.relAzimuth,relElevation:o.relElevation,relRoll:o.relRoll,zoom:o.getZoom()});return this.landmarks.push(r),r},uu.prototype.gotoLandmark=function(e,t){var n,o,r,i,s,l,c,u,h,f,d,p,g,y=this,a=(void 0===t&&(t={}),We(e)?this.landmarks.find(function(t){return t.name===e}):e);a&&(n=void 0===(n=(t=He(t)?{duration:t}:t).easing)?"linear":n,r=t.duration,o=void 0===r?100:r,r=void 0===(r=t.easingFunction)?void 0:r,t=t.onfinish,i=void 0===t?void 0:t,s=.01,0===o?(this.syncFromLandmark(a),i&&i()):(this.cancelLandmarkAnimation(),l=a.position,c=a.focalPoint,u=a.zoom,h=a.roll,f=r||_.EasingFunction(n),p=function(){y.setFocalPoint(c),y.setPosition(l),y.setRoll(h),y.setZoom(u),y.computeMatrix(),y.triggerUpdate(),i&&i()},g=function(t){var e,n,r,i,a,t=t-(d=void 0===d?t:d);o<t||(e=f(t/o),n=v(),r=v(),i=1,a=0,zt(n,y.focalPoint,c,e),zt(r,y.position,l,e),a=y.roll*(1-e)+h*e,i=y.zoom*(1-e)+u*e,y.setFocalPoint(n),y.setPosition(r),y.setRoll(a),y.setZoom(i),Vt(n,c)+Vt(r,l)<=s&&null==u&&null==h)?p():(y.computeMatrix(),y.triggerUpdate(),t<o&&(y.landmarkAnimationID=y.canvas.requestAnimationFrame(g)))},this.canvas.requestAnimationFrame(g)))},uu.prototype.syncFromLandmark=function(t){this.matrix=J(this.matrix,t.matrix),this.right=Lt(this.right,t.right),this.up=Lt(this.up,t.up),this.forward=Lt(this.forward,t.forward),this.position=Lt(this.position,t.position),this.focalPoint=Lt(this.focalPoint,t.focalPoint),this.distanceVector=Lt(this.distanceVector,t.distanceVector),this.azimuth=t.azimuth,this.elevation=t.elevation,this.roll=t.roll,this.relAzimuth=t.relAzimuth,this.relElevation=t.relElevation,this.relRoll=t.relRoll,this.dollyingStep=t.dollyingStep,this.distance=t.distance,this.zoom=t.zoom};var lu,cu=uu;function uu(){var t=null!==lu&&lu.apply(this,arguments)||this;return t.landmarks=[],t}_.CameraContribution=cu;t(du,hu=nl);var hu,fu=du;function du(t,e,n,r){t=hu.call(this,t)||this;return t.currentTime=n,t.timelineTime=r,t.target=e,t.type="finish",t.bubbles=!1,t.currentTarget=e,t.defaultPrevented=!1,t.eventPhase=t.AT_TARGET,t.timeStamp=Date.now(),t.currentTime=n,t.timelineTime=r,t}var pu=0,gu=(Object.defineProperty(yu.prototype,"pending",{get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending},enumerable:!1,configurable:!0}),Object.defineProperty(yu.prototype,"playState",{get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"},enumerable:!1,configurable:!0}),Object.defineProperty(yu.prototype,"ready",{get:function(){var n=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise(function(t,e){n.resolveReadyPromise=function(){t(n)},n.rejectReadyPromise=function(){e(new Error)}}),this.pending)||this.resolveReadyPromise(),this.readyPromise},enumerable:!1,configurable:!0}),Object.defineProperty(yu.prototype,"finished",{get:function(){var n=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise(function(t,e){n.resolveFinishedPromise=function(){t(n)},n.rejectFinishedPromise=function(){e(new Error)}}),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise},enumerable:!1,configurable:!0}),Object.defineProperty(yu.prototype,"currentTime",{get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){var e;t=Number(t),isNaN(t)||(this.timeline.restart(),this._paused||null===this._startTime||(this._startTime=Number(null==(e=this.timeline)?void 0:e.currentTime)-t/this.playbackRate),this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this)))},enumerable:!1,configurable:!0}),Object.defineProperty(yu.prototype,"startTime",{get:function(){return this._startTime},set:function(t){null!==t&&(this.updatePromises(),t=Number(t),isNaN(t)||this._paused||this._idle||(this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()))},enumerable:!1,configurable:!0}),Object.defineProperty(yu.prototype,"playbackRate",{get:function(){return this._playbackRate},set:function(t){var e;t!==this._playbackRate&&(this.updatePromises(),e=this.currentTime,this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==e&&(this.currentTime=e),this.updatePromises())},enumerable:!1,configurable:!0}),Object.defineProperty(yu.prototype,"_isFinished",{get:function(){return!this._idle&&(0<this._playbackRate&&Number(this._currentTime)>=this._totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)},enumerable:!1,configurable:!0}),Object.defineProperty(yu.prototype,"totalDuration",{get:function(){return this._totalDuration},enumerable:!1,configurable:!0}),Object.defineProperty(yu.prototype,"_needsTick",{get:function(){return this.pending||"running"===this.playState||!this._finishedFlag},enumerable:!1,configurable:!0}),yu.prototype.updatePromises=function(){var t=this.oldPlayState,e=this.pending?"pending":this.playState;return this.readyPromise&&e!==t&&("idle"===e?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===t?this.resolveReadyPromise():"pending"===e&&(this.readyPromise=void 0)),this.finishedPromise&&e!==t&&("idle"===e?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===e?this.resolveFinishedPromise():"finished"===t&&(this.finishedPromise=void 0)),this.oldPlayState=e,this.readyPromise||this.finishedPromise},yu.prototype.play=function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()},yu.prototype.pause=function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()},yu.prototype.finish=function(){this.updatePromises(),this._idle||(this.currentTime=0<this._playbackRate?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())},yu.prototype.cancel=function(){var t,e=this;this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises(),this.oncancel)&&(t=new fu(null,this,this.currentTime,null),setTimeout(function(){e.oncancel(t)}))},yu.prototype.reverse=function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()},yu.prototype.updatePlaybackRate=function(t){this.playbackRate=t},yu.prototype.targetAnimations=function(){var t;return(null==(t=this.effect)?void 0:t.target).getAnimations()},yu.prototype.markTarget=function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)},yu.prototype.unmarkTarget=function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)},yu.prototype.tick=function(t,e){this._idle||this._paused||(null===this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))},yu.prototype.rewind=function(){if(0<=this.playbackRate)this.currentTime=0;else{if(!(this._totalDuration<1/0))throw new Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this._totalDuration}},yu.prototype.persist=function(){throw new Error(Hr)},yu.prototype.addEventListener=function(t,e,n){throw new Error(Hr)},yu.prototype.removeEventListener=function(t,e,n){throw new Error(Hr)},yu.prototype.dispatchEvent=function(t){throw new Error(Hr)},yu.prototype.commitStyles=function(){throw new Error(Hr)},yu.prototype.ensureAlive=function(){var t;this.playbackRate<0&&0===this.currentTime?this._inEffect=!(null==(t=this.effect)||!t.update(-1)):this._inEffect=!(null==(t=this.effect)||!t.update(this.currentTime)),this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))},yu.prototype.tickCurrentTime=function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=0<this._playbackRate?this._totalDuration:0),this.ensureAlive())},yu.prototype.fireEvents=function(t){var e,n=this;this._isFinished?this._finishedFlag||(this.onfinish&&(e=new fu(null,this,this.currentTime,t),setTimeout(function(){n.onfinish&&n.onfinish(e)})),this._finishedFlag=!0):(this.onframe&&"running"===this.playState&&(t=new fu(null,this,this.currentTime,t),this.onframe(t)),this._finishedFlag=!1)},yu);function yu(t,e){this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,((this.effect=t).animation=this).timeline=e,this.id="".concat(pu++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null==(t=this.effect)?void 0:t.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}function mu(b,e,x,n){if(!(0<=b&&b<=1&&0<=x&&x<=1))throw new Error("bezier x values must be in [0, 1] range");if(b===e&&x===n)return function(t){return t};for(var w=new(Du?Float32Array:Array)(11),t=0;t<11;++t)w[t]=Gu(.1*t,b,x);function r(t){for(var e=0,n=1;10!==n&&w[n]<=t;++n)e+=.1;var r=e+.1*((t-w[--n])/(w[n+1]-w[n])),i=Hu(r,b,x);if(.001<=i){for(var a=t,o=r,s=b,l=x,c=0;c<Ru;++c){var u=Hu(o,s,l);if(0===u)return o;o-=(Gu(o,s,l)-a)/u}return o}if(0===i)return r;for(var h,f,d=t,p=e,g=e+.1,y=b,m=x,v=0;0<(h=Gu(f=p+(g-p)/2,y,m)-d)?g=f:p=f,Math.abs(h)>Iu&&++v<Bu;);return f}return function(t){return 0===t||1===t?t:Gu(r(t),e,n)}}function vu(t){return Math.pow(t,2)}function bu(t){return Math.pow(t,3)}function xu(t){return Math.pow(t,4)}function wu(t){return Math.pow(t,5)}function Mu(t){return Math.pow(t,6)}function ku(t){return 1-Math.cos(t*Math.PI/2)}function Ou(t){return 1-Math.sqrt(1-t*t)}function Eu(t){return t*t*(3*t-2)}function Su(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)}function Au(t,e){var n=(e=j(e=void 0===e?[]:e,2))[0],e=void 0===(e=e[1])?.5:e,n=Ge(Number(void 0===n?1:n),1,10),e=Ge(Number(e),.1,2);return 0===t||1===t?t:-n*Math.pow(2,10*(t-1))*Math.sin((t-1-e/(2*Math.PI)*Math.asin(1/n))*(2*Math.PI)/e)}function _u(t,e,n){var r=(e=j(e=void 0===e?[]:e,4))[0],i=void 0===(i=e[1])?100:i,a=void 0===(a=e[2])?10:a,e=void 0===(e=e[3])?0:e,r=Ge(void 0===r?1:r,.1,1e3),i=Ge(i,.1,1e3),a=Ge(a,.1,1e3),e=Ge(e,.1,1e3),o=Math.sqrt(i/r),i=(a=a/(2*Math.sqrt(i*r)))<1?o*Math.sqrt(1-a*a):0,r=a<1?(a*o-e)/i:-e+o,e=n?n*t/1e3:t,e=a<1?Math.exp(-e*a*o)*(+Math.cos(i*e)+r*Math.sin(i*e)):(1+r*e)*Math.exp(-e*o);return 0===t||1===t?t:1-e}function Tu(t,e){var e=j(e=void 0===e?[]:e,2),n=void 0===(n=e[0])?10:n;return("start"==e[1]?Math.ceil:Math.floor)(Ge(t,0,1)*n)/n}function Pu(t,e){var n=(e=j(e=void 0===e?[]:e,4))[0],r=e[1],i=e[2],e=e[3];return mu(n,r,i,e)(t)}function Cu(r){return function(t,e,n){return 1-r(1-t,e=void 0===e?[]:e,n)}}function Lu(r){return function(t,e,n){return void 0===e&&(e=[]),t<.5?r(2*t,e,n)/2:1-r(-2*t+2,e,n)/2}}function Nu(r){return function(t,e,n){return void 0===e&&(e=[]),t<.5?(1-r(1-2*t,e,n))/2:(r(2*t-1,e,n)+1)/2}}function ju(t){return t}var Ru=4,Iu=1e-7,Bu=10,Du="function"==typeof Float32Array,Fu=function(t,e){return 1-3*e+3*t},zu=function(t,e){return 3*e-6*t},Wu=function(t){return 3*t},Gu=function(t,e,n){return((Fu(e,n)*t+zu(e,n))*t+Wu(e))*t},Hu=function(t,e,n){return 3*Fu(e,n)*t*t+2*zu(e,n)*t+Wu(e)},So=mu(.42,0,1,1),Vu={steps:Tu,"step-start":function(t){return Tu(t,[1,"start"])},"step-end":function(t){return Tu(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":Pu,ease:function(t){return Pu(t,[.25,.1,.25,1])},in:So,out:Cu(So),"in-out":Lu(So),"out-in":Nu(So),"in-quad":vu,"out-quad":Cu(vu),"in-out-quad":Lu(vu),"out-in-quad":Nu(vu),"in-cubic":bu,"out-cubic":Cu(bu),"in-out-cubic":Lu(bu),"out-in-cubic":Nu(bu),"in-quart":xu,"out-quart":Cu(xu),"in-out-quart":Lu(xu),"out-in-quart":Nu(xu),"in-quint":wu,"out-quint":Cu(wu),"in-out-quint":Lu(wu),"out-in-quint":Nu(wu),"in-expo":Mu,"out-expo":Cu(Mu),"in-out-expo":Lu(Mu),"out-in-expo":Nu(Mu),"in-sine":ku,"out-sine":Cu(ku),"in-out-sine":Lu(ku),"out-in-sine":Nu(ku),"in-circ":Ou,"out-circ":Cu(Ou),"in-out-circ":Lu(Ou),"out-in-circ":Nu(Ou),"in-back":Eu,"out-back":Cu(Eu),"in-out-back":Lu(Eu),"out-in-back":Nu(Eu),"in-bounce":Su,"out-bounce":Cu(Su),"in-out-bounce":Lu(Su),"out-in-bounce":Nu(Su),"in-elastic":Au,"out-elastic":Cu(Au),"in-out-elastic":Lu(Au),"out-in-elastic":Nu(Au),spring:_u,"spring-in":_u,"spring-out":Cu(_u),"spring-in-out":Lu(_u),"spring-out-in":Nu(_u)},Yu=function(t){return("-"===(t=(t=t).replace(/([A-Z])/g,function(t){return"-".concat(t.toLowerCase())})).charAt(0)?t.substring(1):t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()};function qu(n,r){return function(t){var e;return 1<=t?1:(t+=r*(e=1/n))-t%e}}var Co="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",$u=new RegExp("cubic-bezier\\("+Co+","+Co+","+Co+","+Co+"\\)"),Uu=/steps\(\s*(\d+)\s*\)/,Xu=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Ku(t){var e=$u.exec(t);return e?mu.apply(void 0,M([],j(e.slice(1).map(Number)),!1)):(e=Uu.exec(t))?qu(Number(e[1]),0):(e=Xu.exec(t))?qu(Number(e[1]),{start:1,middle:.5,end:0}[e[2]]):Vu[Yu(t)]||Vu.linear}function Zu(t){return Math.abs((0!==(e=t).duration&&0!==e.iterations?("auto"===e.duration?0:Number(e.duration))*(null!=(e=e.iterations)?e:1):0)/(t.playbackRate||1));var e}var Qu=0,Ju=1,th=2,eh=3;function nh(t,e,n){c=t,i=n;var r,i,a,o,s,l=null===(l=e)?Qu:(r=i.endTime,l<Math.min(i.delay,r)?Ju:l>=Math.min(i.delay+c+i.endDelay,r)?th:eh),c=function(t,e,n,r,i){switch(r){case Ju:return"backwards"===e||"both"===e?0:null;case eh:return n-i;case th:return"forwards"===e||"both"===e?t:null;case Qu:return null}}(t,n.fill,e,l,n.delay);return null===c?null:(i="auto"===n.duration?0:n.duration,r=i,t=l,e=n.iterations,o=c,s=n.iterationStart,0===r?t!==Ju&&(s+=e):s+=o/r,e=t=s,o=n.iterationStart,s=l,a=n.iterations,c=c,i=i,e=o=0!==(o=e===1/0?o%1:e%1)||s!==th||0===a||0===c&&0!==i?o:1,s=n.iterations,a=e,c=t,i=l===th&&s===1/0?1/0:1===a?Math.floor(c)-1:Math.floor(c),o=n.direction,t=i,l=e,a="normal"===(s="normal"!==(s=o)&&"reverse"!==o&&(t=t,"alternate-reverse"===o&&(t+=1),s="normal",t!==1/0)&&t%2!=0?"reverse":s)?l:1-l,n.currentIteration=i,n.progress=a,n.easingFunction(a))}function rh(t,e,n){var a=function(t,e){for(var n={},r=0;r<t.length;r++)for(var i in t[r]){var a;ih(i)&&(a={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:Ku(t[r].easing)||e.easingFunction,value:t[r][i]},n[i]=n[i]||[],n[i].push(a))}return n}(t,e),o=function(t,e){var n,r=[];for(n in t)for(var i=t[n],a=0;a<i.length-1;a++){var o=a,s=a+1,l=i[o].computedOffset,c=i[s].computedOffset,u=l,h=c;0===a&&(u=-1/0,0===c)&&(s=o),a===i.length-2&&(h=1/0,1===l)&&(o=s),r.push({applyFrom:u,applyTo:h,startOffset:i[o].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[o].easingFunction,property:n,interpolation:function(t,e,n,r){var i=wo[t];if(i&&i.syntax&&i.int){i=_.styleValueRegistry.getPropertySyntax(i.syntax);if(i){var a,o,s,l=void 0,c=void 0,t=(c=_.enableCSSParsing?(o=_.styleValueRegistry.parseProperty(t,e,r),a=_.styleValueRegistry.parseProperty(t,n,r),l=_.styleValueRegistry.computeProperty(t,o,r),_.styleValueRegistry.computeProperty(t,a,r)):(o=i.parserWithCSSDisabled,l=o?o(e,r):e,o?o(n,r):n),i.mixer(l,c,r));if(t)return s=ah.apply(void 0,M([],j(t),!1)),function(t){return 0===t?e:1===t?n:s(t)}}}return ah(!1,!0,function(t){return t?n:e})}(n,i[o].value,i[s].value,e)})}return r.sort(function(t,e){return t.startOffset-e.startOffset}),r}(a,n);return function(r,i){if(null!==i)o.filter(function(t){return i>=t.applyFrom&&i<t.applyTo}).forEach(function(t){var e=i-t.startOffset,n=t.endOffset-t.startOffset,e=0==n?0:t.easingFunction(e/n);r.setAttribute(t.property,t.interpolation(e))});else for(var t in a)ih(t)&&r.setAttribute(t,null)}}function ih(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var ah=function(e,n,r){return function(t){t=function t(e,n,r){if("number"==typeof e&&"number"==typeof n)return e*(1-r)+n*r;if("boolean"==typeof e&&"boolean"==typeof n||"string"==typeof e&&"string"==typeof n)return r<.5?e:n;if(Array.isArray(e)&&Array.isArray(n)){for(var i=e.length,a=n.length,o=Math.max(i,a),s=[],l=0;l<o;l++)s.push(t(e[l<i?l:i-1],n[l<a?l:a-1],r));return s}throw new Error("Mismatched interpolation arguments "+e+":"+n)}(e,n,t);return!_.enableCSSParsing&&He(t)?t:r(t)}};Object.defineProperty(sh.prototype,"easing",{get:function(){return this._easing},set:function(t){this.easingFunction=Ku(t),this._easing=t},enumerable:!1,configurable:!0});var oh=sh;function sh(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=ju,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null}function lh(t,i){if(null===t)return[];for(var e=(t=Array.isArray(t)?t:function(t){var e,n=[];for(e in t)if(!(e in["easing","offset","composite"]))for(var r,i=t[e],a=(i=Array.isArray(i)?i:[i]).length,o=0;o<a;o++)n[o]||(r={},"offset"in t&&(r.offset=Number(t.offset)),"easing"in t&&(r.easing=t.easing),"composite"in t&&(r.composite=t.composite),n[o]=r),void 0!==i[o]&&null!==i[o]&&(n[o][e]=i[o]);return n.sort(function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)}),n}(t)).map(function(t){var e,n={};for(e in null!=i&&i.composite&&(n.composite="auto"),t){var r=t[e];if("offset"===e){if(null!==r){if(r=Number(r),!isFinite(r))throw new Error("Keyframe offsets must be numbers.");if(r<0||1<r)throw new Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=r}}else if("composite"===e&&-1===["replace","add","accumulate","auto"].indexOf(r))throw new Error("".concat(r," compositing is not supported"));n[e]=r}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==i?void 0:i.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n}),n=!0,r=-1/0,a=0;a<e.length;a++){var o=e[a].offset;if(A(o))n=!1;else{if(o<r)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");r=o}}if(e=e.filter(function(t){return 0<=Number(t.offset)&&Number(t.offset)<=1}),!n)for(var s=e.length,l=(e[s-1].computedOffset=Number(null!=(t=e[s-1].offset)?t:1),1<s&&(e[0].computedOffset=Number(null!=(t=e[0].offset)?t:0)),0),c=Number(e[0].computedOffset),u=1;u<s;u++){var h=e[u].computedOffset;if(!A(h)&&!A(c)){for(var f=1;f<u-l;f++)e[l+f].computedOffset=c+(Number(h)-c)*f/(u-l);l=u,c=Number(h)}}return e}var ch="backwards|forwards|both|none".split("|"),uh="reverse|alternate|alternate-reverse".split("|");function hh(t,e){return t=function(t){"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t});return t}(null!=t?t:{duration:"auto"}),n=t,t=e,r=new oh,t&&(r.fill="both",r.duration="auto"),"number"!=typeof n||isNaN(n)?void 0!==n&&Object.keys(n).forEach(function(t){void 0===n[t]||null===n[t]||"auto"===n[t]||!("number"!=typeof r[t]&&"duration"!==t||"number"==typeof n[t]&&!isNaN(n[t]))||"fill"===t&&-1===ch.indexOf(n[t])||"direction"===t&&-1===uh.indexOf(n[t])||(r[t]=n[t])}):r.duration=n,r;var n,r}dh.prototype.applyInterpolations=function(){this.interpolations(this.target,Number(this.timeFraction))},dh.prototype.update=function(t){return null!==t&&(this.timeFraction=nh(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},dh.prototype.getKeyframes=function(){return this.normalizedKeyframes},dh.prototype.setKeyframes=function(t){this.normalizedKeyframes=lh(t)},dh.prototype.getComputedTiming=function(){return this.computedTiming},dh.prototype.getTiming=function(){return this.timing},dh.prototype.updateTiming=function(e){var n=this;Object.keys(e||{}).forEach(function(t){n.timing[t]=e[t]})};var fh=dh;function dh(t,e,n){var r=this,t=(this.composite="replace",this.iterationComposite="replace",this.target=t,this.timing=hh(n,!1),(this.timing.effect=this).timing.activeDuration=Zu(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=lh(e,this.timing),this.interpolations=rh(this.normalizedKeyframes,this.timing,this.target),_.globalThis.Proxy);this.computedTiming=t?new t(this.timing,{get:function(t,e){return"duration"===e?"auto"===t.duration?0:t.duration:"fill"===e?"auto"===t.fill?"none":t.fill:"localTime"===e?r.animation&&r.animation.currentTime||null:"currentIteration"===e?r.animation&&"running"===r.animation.playState?t.currentIteration||0:null:"progress"===e?r.animation&&"running"===r.animation.playState?t.progress||0:null:t[e]},set:function(){return!0}}):this.timing}function ph(t,e){return Number(t.id)-Number(e.id)}gh.prototype.getAnimations=function(){return this.discardAnimations(),this.animations.slice()},gh.prototype.isTicking=function(){return this.inTick},gh.prototype.play=function(t,e,n){t=new fh(t,e,n),e=new gu(t,this);return this.animations.push(e),this.restartWebAnimationsNextTick(),e.updatePromises(),e.play(),e.updatePromises(),e},gh.prototype.applyDirtiedAnimation=function(t){var e=this;this.inTick||(t.markTarget(),(t=t.targetAnimations()).sort(ph),this.tick(Number(this.currentTime),!1,t.slice())[1].forEach(function(t){t=e.animations.indexOf(t);-1!==t&&e.animations.splice(t,1)}),this.applyPendingEffects())},gh.prototype.restart=function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame(function(){}),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame},gh.prototype.destroy=function(){this.document.defaultView.cancelAnimationFrame(this.frameId)},gh.prototype.applyPendingEffects=function(){this.pendingEffects.forEach(function(t){null!=t&&t.applyInterpolations()}),this.pendingEffects=[]},gh.prototype.updateAnimationsPromises=function(){this.animationsWithPromises=this.animationsWithPromises.filter(function(t){return t.updatePromises()})},gh.prototype.discardAnimations=function(){this.updateAnimationsPromises(),this.animations=this.animations.filter(function(t){return"finished"!==t.playState&&"idle"!==t.playState})},gh.prototype.restartWebAnimationsNextTick=function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))},gh.prototype.rAF=function(t){var e=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([e,t]),e},gh.prototype.requestAnimationFrame=function(e){var n=this;return this.rAF(function(t){n.updateAnimationsPromises(),e(t),n.updateAnimationsPromises()})},gh.prototype.tick=function(n,r,t){var i=this,a=(this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=n,this.ticking=!1,[]),o=[],s=[],l=[];return t.forEach(function(t){t.tick(n,r),t._inEffect?(o.push(t.effect),t.markTarget()):(a.push(t.effect),t.unmarkTarget()),t._needsTick&&(i.ticking=!0);var e=t._inEffect||t._needsTick;((t._inTimeline=e)?s:l).push(t)}),(t=this.pendingEffects).push.apply(t,M([],j(a),!1)),(t=this.pendingEffects).push.apply(t,M([],j(o),!1)),this.ticking&&this.requestAnimationFrame(function(){}),this.inTick=!1,[s,l]};Vo=gh;function gh(t){var n=this;this.document=t,this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.webAnimationsNextTick=function(t){n.currentTime=t,n.discardAnimations(),0===n.animations.length?n.timelineTicking=!1:n.requestAnimationFrame(n.webAnimationsNextTick)},this.processRafCallbacks=function(e){var t=n.rafCallbacks;n.rafCallbacks=[],e<Number(n.currentTime)&&(e=Number(n.currentTime)),n.animations.sort(ph),n.animations=n.tick(e,!0,n.animations)[0],t.forEach(function(t){t[1](e)}),n.applyPendingEffects()}}_.EasingFunction=Ku,_.AnimationTimeline=Vo;const yh="main-layer",mh="label-layer",vh="element",bh="view",xh="plot",wh="component",Mh="label",kh="area";function Oh(t,e){e=e.r;t.arc(e,e,e,0,2*Math.PI,!1)}function Eh(t,e){var n,r,i=e.rx,e=e.ry;t.ellipse?t.ellipse(i,e,i,e,0,0,2*Math.PI,!1):(n=e<i?i:e,r=e<i?1:i/e,e=e<i?e/i:1,t.save(),t.scale(r,e),t.arc(0,0,n,0,2*Math.PI))}function Sh(t,e){var n,r,i=e.x1,a=e.y1,o=e.x2,s=e.y2,l=e.defX,l=void 0===l?0:l,c=e.defY,c=void 0===c?0:c,u=e.markerStart,h=e.markerEnd,f=e.markerStartOffset,e=e.markerEndOffset,d=0,p=0,g=0,y=0,m=0;u&&ql(u)&&f&&(n=o-i,r=s-a,m=Math.atan2(r,n),d=Math.cos(m)*(f||0),p=Math.sin(m)*(f||0)),h&&ql(h)&&e&&(n=i-o,r=a-s,m=Math.atan2(r,n),g=Math.cos(m)*(e||0),y=Math.sin(m)*(e||0)),t.moveTo(i-l+d,a-c+p),t.lineTo(o-l+g,s-c+y)}function Ah(t,e){var n,r,i,a,o=e.defX,s=void 0===o?0:o,o=e.defY,l=void 0===o?0:o,o=e.markerStart,c=e.markerEnd,u=e.markerStartOffset,h=e.markerEndOffset,e=e.path,f=e.absolutePath,d=e.segments,p=0,g=0,y=0,m=0,e=0;o&&ql(o)&&u&&(i=(o=j(o.parentNode.getStartTangent(),2))[0],a=o[1],n=i[0]-a[0],r=i[1]-a[1],e=Math.atan2(r,n),p=Math.cos(e)*(u||0),g=Math.sin(e)*(u||0)),c&&ql(c)&&h&&(i=(o=j(c.parentNode.getEndTangent(),2))[0],a=o[1],n=i[0]-a[0],r=i[1]-a[1],e=Math.atan2(r,n),y=Math.cos(e)*(h||0),m=Math.sin(e)*(h||0));for(var v=0;v<f.length;v++){var b=f[v],x=b[0],w=f[v+1],M=0===v&&(0!==p||0!==g),k=(v===f.length-1||w&&("M"===w[0]||"Z"===w[0]))&&0!==y&&0!==m;switch(x){case"M":M?(t.moveTo(b[1]-s+p,b[2]-l+g),t.lineTo(b[1]-s,b[2]-l)):t.moveTo(b[1]-s,b[2]-l);break;case"L":k?t.lineTo(b[1]-s+y,b[2]-l+m):t.lineTo(b[1]-s,b[2]-l);break;case"Q":t.quadraticCurveTo(b[1]-s,b[2]-l,b[3]-s,b[4]-l),k&&t.lineTo(b[3]-s+y,b[4]-l+m);break;case"C":t.bezierCurveTo(b[1]-s,b[2]-l,b[3]-s,b[4]-l,b[5]-s,b[6]-l),k&&t.lineTo(b[5]-s+y,b[6]-l+m);break;case"A":var O,E,S=d[v].arcParams,A=S.cx,_=S.cy,T=S.rx,P=S.ry,C=S.startAngle,L=S.endAngle,N=S.xRotation,S=S.sweepFlag;t.ellipse?t.ellipse(A-s,_-l,T,P,N,C,L,!!(1-S)):(O=P<T?T:P,E=P<T?1:T/P,P=P<T?P/T:1,t.translate(A-s,_-l),t.rotate(N),t.scale(E,P),t.arc(0,0,O,C,L,!!(1-S)),t.scale(1/E,1/P),t.rotate(-N),t.translate(-(A-s),-(_-l))),k&&t.lineTo(b[6]-s+y,b[7]-l+m);break;case"Z":t.closePath()}}}function _h(t,e){var n,r,i=e.defX,a=void 0===i?0:i,i=e.defY,o=void 0===i?0:i,i=e.markerStart,s=e.markerEnd,l=e.markerStartOffset,c=e.markerEndOffset,u=e.points.points,h=u.length,e=u[0][0]-a,f=u[0][1]-o,d=u[h-1][0]-a,p=u[h-1][1]-o,g=0,y=0,m=0,v=0,b=0;i&&ql(i)&&l&&(n=u[1][0]-u[0][0],r=u[1][1]-u[0][1],b=Math.atan2(r,n),g=Math.cos(b)*(l||0),y=Math.sin(b)*(l||0)),s&&ql(s)&&c&&(n=u[h-1][0]-u[0][0],r=u[h-1][1]-u[0][1],b=Math.atan2(r,n),m=Math.cos(b)*(c||0),v=Math.sin(b)*(c||0)),t.moveTo(e+(g||m),f+(y||v));for(var x=1;x<h-1;x++){var w=u[x];t.lineTo(w[0]-a,w[1]-o)}t.lineTo(d,p)}function Th(t,e){var n,r,i=e.defX,a=void 0===i?0:i,i=e.defY,o=void 0===i?0:i,i=e.markerStart,s=e.markerEnd,l=e.markerStartOffset,c=e.markerEndOffset,u=e.points.points,h=u.length,e=u[0][0]-a,f=u[0][1]-o,d=u[h-1][0]-a,p=u[h-1][1]-o,g=0,y=0,m=0,v=0,b=0;i&&ql(i)&&l&&(n=u[1][0]-u[0][0],r=u[1][1]-u[0][1],b=Math.atan2(r,n),g=Math.cos(b)*(l||0),y=Math.sin(b)*(l||0)),s&&ql(s)&&c&&(n=u[h-2][0]-u[h-1][0],r=u[h-2][1]-u[h-1][1],b=Math.atan2(r,n),m=Math.cos(b)*(c||0),v=Math.sin(b)*(c||0)),t.moveTo(e+g,f+y);for(var x=1;x<h-1;x++){var w=u[x];t.lineTo(w[0]-a,w[1]-o)}t.lineTo(d+m,p+v)}function Ph(t,e){var n,r,i,a,o=e.radius,s=e.width,e=e.height,l=s,c=e;o&&o.some(function(t){return 0!==t})?(n=(s=0<s?1:-1)+(e=0<e?1:-1)==0,r=(o=j(o.map(function(t){return Ge(t,0,Math.min(Math.abs(l)/2,Math.abs(c)/2))}),4))[0],i=o[1],a=o[2],o=o[3],t.moveTo(s*r,0),t.lineTo(l-s*i,0),0!==i&&t.arc(l-s*i,e*i,i,-e*Math.PI/2,0<s?0:Math.PI,n),t.lineTo(l,c-e*a),0!==a&&t.arc(l-s*a,c-e*a,a,0<s?0:Math.PI,0<e?Math.PI/2:1.5*Math.PI,n),t.lineTo(s*o,c),0!==o&&t.arc(s*o,c-e*o,o,0<e?Math.PI/2:-Math.PI/2,0<s?Math.PI:0,n),t.lineTo(0,e*r),0!==r&&t.arc(s*r,e*r,r,0<s?Math.PI:0,0<e?1.5*Math.PI:Math.PI/2,n)):t.rect(0,0,l,c)}t(Nh,Ch=n),Nh.prototype.init=function(){(t={})[k.CIRCLE]=Oh,t[k.ELLIPSE]=Eh,t[k.RECT]=Ph,t[k.LINE]=Sh,t[k.POLYLINE]=Th,t[k.POLYGON]=_h,t[k.PATH]=Ah,t[k.TEXT]=void 0,t[k.GROUP]=void 0,t[k.IMAGE]=void 0,t[k.HTML]=void 0,t[k.MESH]=void 0;var t;this.context.pathGeneratorFactory=t},Nh.prototype.destroy=function(){delete this.context.pathGeneratorFactory};var Ch,Lh=Nh;function Nh(){var t=null!==Ch&&Ch.apply(this,arguments)||this;return t.name="canvas-path-generator",t}var jh=v(),Rh=v(),Ih=v(),Bh=Z(),Dh=(Fh.prototype.apply=function(t,e){var n=this,r=t.renderingService,i=t.renderingContext,a=(this.context=t,this.runtime=e,null==(t=i.root)?void 0:t.ownerDocument);r.hooks.pick.tapPromise(Fh.tag,function(e){return X(n,void 0,void 0,function(){return R(this,function(t){return[2,this.pick(a,e)]})})}),r.hooks.pickSync.tap(Fh.tag,function(t){return n.pick(a,t)})},Fh.prototype.pick=function(t,e){var n,r,i=e.topmost,a=(o=e.position).x,o=o.y,s=Nt(jh,a,o,0),a=t.elementsFromBBox(s[0],s[1],s[0],s[1]),l=[];try{for(var c=I(a),u=c.next();!u.done;u=c.next()){var h=u.value,f=h.getWorldTransform();if(this.isHit(h,s,f,!1)){var d=hs(h);if(d){var p=d.parsedStyle.clipPath;if(this.isHit(p,s,p.getWorldTransform(),!0)){if(i)return e.picked=[h],e;l.push(h)}}else{if(i)return e.picked=[h],e;l.push(h)}}}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return e.picked=l,e},Fh.tag="CanvasPicker",Fh);function Fh(){var o=this;this.isHit=function(t,e,n,r){var i=o.context.pointInPathPickerFactory[t.nodeName];if(i){var n=rt(Bh,n),e=Wt(Rh,Nt(Ih,e[0],e[1],0),n),n=t.getGeometryBounds().halfExtents,a=t.parsedStyle.anchor;if(e[0]+=(a&&a[0]||0)*n[0]*2,e[1]+=(a&&a[1]||0)*n[1]*2,i(t,new Ir(e[0],e[1]),r,o.isPointInPath,o.context,o.runtime))return!0}return!1},this.isPointInPath=function(t,e){var n=o.runtime.offscreenCanvas.getOrCreateContext(o.context.config.offscreenCanvas),r=o.context.pathGeneratorFactory[t.nodeName];return r&&(n.beginPath(),r(n,t.parsedStyle),n.closePath()),n.isPointInPath(e.x,e.y)}}function zh(t,e,n){var t=t.parsedStyle,r=t.r,i=t.fill,a=t.stroke,o=t.lineWidth,s=t.increasedLineWidthForHitTesting,t=t.pointerEvents,o=((o||0)+(s||0))/2,s=jn(r,r,e.x,e.y),e=j(ps(t,i,a),2),t=e[0],i=e[1];return t&&i||n?s<=r+o:t?s<=r:!!i&&r-o<=s&&s<=r+o}function Wh(t,e,n,r){return t/(n*n)+e/(r*r)}function Gh(t,e,n){var t=t.parsedStyle,r=t.rx,i=t.ry,a=t.fill,o=t.stroke,s=t.lineWidth,l=t.increasedLineWidthForHitTesting,t=t.pointerEvents,c=e.x,e=e.y,t=j(ps(t,a,o),2),a=t[0],o=t[1],t=((s||0)+(l||0))/2,s=(c-r)*(c-r),l=(e-i)*(e-i);return a&&o||n?Wh(s,l,r+t,i+t)<=1:a?Wh(s,l,r,i)<=1:!!o&&1<=Wh(s,l,r-t,i-t)&&Wh(s,l,r+t,i+t)<=1}function Hh(t,e,n,r,i,a){return t<=i&&i<=t+n&&e<=a&&a<=e+r}function Vh(t,e,n,r,i,a,o,s){var l=(Math.atan2(s-e,o-t)+2*Math.PI)%(2*Math.PI),t={x:t+n*Math.cos(l),y:e+n*Math.sin(l)};return jn(t.x,t.y,o,s)<=a/2}function Yh(t,e,n,r,i,a,o){var s=Math.min(t,n),l=Math.max(t,n),c=Math.min(e,r),u=Math.max(e,r),h=i/2;return s-h<=a&&a<=l+h&&c-h<=o&&o<=u+h&&zn(t,e,n,r,a,o)<=i/2}function qh(t,e,n,r,i){var a=t.length;if(!(a<2)){for(var o=0;o<a-1;o++)if(Yh(t[o][0],t[o][1],t[o+1][0],t[o+1][1],e,n,r))return!0;if(i){var i=t[0],s=t[a-1];if(Yh(i[0],i[1],s[0],s[1],e,n,r))return!0}}return!1}var $h=1e-6;function Uh(t){return Math.abs(t)<$h?0:t<0?-1:1}function Xh(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var a,o,s,l=0;l<i;l++){var c=t[l],u=t[(l+1)%i];if(o=u,((s=[e,n])[0]-(a=c)[0])*(o[1]-a[1])==(o[0]-a[0])*(s[1]-a[1])&&Math.min(a[0],o[0])<=s[0]&&s[0]<=Math.max(a[0],o[0])&&Math.min(a[1],o[1])<=s[1]&&s[1]<=Math.max(a[1],o[1]))return!0;0<Uh(c[1]-n)!=0<Uh(u[1]-n)&&Uh(e-(n-c[1])*(c[0]-u[0])/(c[1]-u[1])-c[0])<0&&(r=!r)}return r}function Kh(t,e,n){for(var r=!1,i=0;i<t.length&&!(r=Xh(t[i],e,n));i++);return r}function Zh(t,e,n){var t=t.parsedStyle,r=t.x1,i=t.y1,a=t.x2,o=t.y2,s=t.lineWidth,l=t.increasedLineWidthForHitTesting,c=t.defX,c=void 0===c?0:c,u=t.defY,u=void 0===u?0:u;return!(!j(ps(t.pointerEvents,t.fill,t.stroke),2)[1]&&!n||!s)&&Yh(r,i,a,o,(s||0)+(l||0),e.x+c,e.y+u)}function Qh(t,e,n,r,i,a){var o=t.parsedStyle,s=o.lineWidth,l=o.increasedLineWidthForHitTesting,c=o.stroke,u=o.fill,h=o.defX,h=void 0===h?0:h,f=o.defY,f=void 0===f?0:f,d=o.path,o=o.pointerEvents,p=d.segments,g=d.hasArc,y=d.polylines,d=d.polygons,o=j(ps(o,(null==d?void 0:d.length)&&u,c),2),u=o[0],c=o[1],o=ja(t),m=!1;return u||n?g?r(t,e):Kh(d,e.x+h,e.y+f)||Kh(y,e.x+h,e.y+f):c||n?function(t,e,n,r,i){for(var a=!1,o=e/2,s=0;s<t.length;s++){var l=t[s],c=l.currentPoint,u=l.params,h=l.prePoint,f=l.box;if(!f||Hh(f.x-o,f.y-o,f.width+e,f.height+e,n,r))switch(l.command){case"L":case"Z":if(a=Yh(h[0],h[1],c[0],c[1],e,n,r))return!0;break;case"Q":if(a=$n(h[0],h[1],u[1],u[2],u[3],u[4],n,r)<=e/2)return!0;break;case"C":if(a=Hn(h[0],h[1],u[1],u[2],u[3],u[4],u[5],u[6],n,r,i)<=e/2)return!0;break;case"A":l.cubicParams||(l.cubicParams=me(h[0],h[1],u[1],u[2],u[3],u[4],u[5],u[6],u[7],void 0));for(var d=l.cubicParams,p=h,g=0;g<d.length;g+=6){var y=Hn(p[0],p[1],d[g],d[g+1],d[g+2],d[g+3],d[g+4],d[g+5],n,r,i),p=[d[g+4],d[g+5]];if(a=y<=e/2)return!0}}}return a}(p,(s||0)+(l||0),e.x+h,e.y+f,o):m}function Jh(t,e,n){var t=t.parsedStyle,r=t.stroke,i=t.fill,a=t.lineWidth,o=t.increasedLineWidthForHitTesting,s=t.points,l=t.defX,l=void 0===l?0:l,c=t.defY,c=void 0===c?0:c,t=j(ps(t.pointerEvents,i,r),2),i=t[0],r=!1;return r=(r=t[1]||n?qh(s.points,(a||0)+(o||0),e.x+l,e.y+c,!0):r)||!i&&!n?r:Xh(s.points,e.x+l,e.y+c)}function tf(t,e,n){var t=t.parsedStyle,r=t.lineWidth,i=t.increasedLineWidthForHitTesting,a=t.points,o=t.defX,o=void 0===o?0:o,s=t.defY,s=void 0===s?0:s;return!(!j(ps(t.pointerEvents,t.fill,t.stroke),2)[1]&&!n||!r)&&qh(a.points,(r||0)+(i||0),e.x+o,e.y+s,!1)}function ef(t,e,n,r,i){var a,o,s,l,c,u,h,f,d,p=t.parsedStyle,g=p.radius,y=p.fill,m=p.stroke,v=p.lineWidth,b=p.increasedLineWidthForHitTesting,x=p.width,w=p.height,p=j(ps(p.pointerEvents,y,m),2),y=p[0],m=p[1],p=(v||0)+(b||0);return g&&g.some(function(t){return 0!==t})?(v=!1,(m||n)&&(h=b=0,l=x,u=w,g=g.map(function(t){return Ge(t,0,Math.min(Math.abs(x)/2,Math.abs(w)/2))}),d=p,a=e.x,o=e.y,g=j(g,4),f=g[0],s=g[1],c=g[2],g=g[3],v=Yh(b+f,h,b+l-s,h,d,a,o)||Yh(b+l,h+s,b+l,h+u-c,d,a,o)||Yh(b+l-c,h+u,b+g,h+u,d,a,o)||Yh(b,h+u-g,b,h+f,d,a,o)||Vh(b+l-s,h+s,s,Math.PI,Math.PI,d,a,o)||Vh(b+l-c,h+u-c,c,0,Math.PI,d,a,o)||Vh(b+g,h+u-g,g,Math.PI,Math.PI,d,a,o)||Vh(b+f,h+f,f,Math.PI,Math.PI,d,a,o)),v||!y&&!n?v:r(t,e)):(s=p/2,y&&m||n?Hh(0-s,0-s,x+s,w+s,e.x,e.y):y?Hh(0,0,x,w,e.x,e.y):!!m&&(c=l=0,u=x,g=w,b=p,h=e.x,f=e.y,Hh(l-(d=b/2),c-d,u,b,h,f)||Hh(l+u-d,c-d,b,g,h,f)||Hh(l+d,c+g-d,u,b,h,f)||Hh(l-d,c+d,b,g,h,f)))}function nf(t,e,n,r,i,a){var o,s=t.parsedStyle,l=s.pointerEvents,c=s.width,s=s.height;return"non-transparent-pixel"!==l||(l=i.config.offscreenCanvas,o=a.offscreenCanvas.getOrCreateCanvas(l),a=a.offscreenCanvas.getOrCreateContext(l,{willReadFrequently:!0}),o.width=c,o.height=s,i.defaultStyleRendererFactory[k.IMAGE].render(a,t.parsedStyle,t,void 0,void 0,void 0),a.getImageData(e.x,e.y,1,1).data.every(function(t){return 0!==t}))}t(of,rf=n),of.prototype.init=function(){(t={})[k.CIRCLE]=zh,t[k.ELLIPSE]=Gh,t[k.RECT]=ef,t[k.LINE]=Zh,t[k.POLYLINE]=tf,t[k.POLYGON]=Jh,t[k.PATH]=Qh,t[k.TEXT]=function(){return!0},t[k.GROUP]=null,t[k.IMAGE]=nf,t[k.HTML]=null,t[k.MESH]=null;var t;this.context.pointInPathPickerFactory=t,this.addRenderingPlugin(new Dh)},of.prototype.destroy=function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()};var rf,af=of;function of(){var t=null!==rf&&rf.apply(this,arguments)||this;return t.name="canvas-picker",t}lf.prototype.apply=function(t,c){function i(t){(t=t.target.rBushNode).aabb&&u.removedRBushNodeAABBs.push(t.aabb)}function a(t){(t=t.target.rBushNode).aabb&&u.removedRBushNodeAABBs.push(t.aabb)}var u=this,h=(this.context=t).config,f=t.camera,l=t.renderingService,d=t.renderingContext,e=t.rBushRoot,n=t.pathGeneratorFactory,p=(this.rBush=e,this.pathGeneratorFactory=n,t.contextService),g=d.root.ownerDocument.defaultView,y=(l.hooks.init.tap(lf.tag,function(){g.addEventListener(b.UNMOUNTED,i),g.addEventListener(b.CULLED,a);var t=p.getDPR(),e=h.width,n=h.height,r=p.getContext();u.clearRect(r,0,0,e*t,n*t,h.background)}),l.hooks.destroy.tap(lf.tag,function(){g.removeEventListener(b.UNMOUNTED,i),g.removeEventListener(b.CULLED,a)}),l.hooks.beginFrame.tap(lf.tag,function(){var t=p.getContext(),e=p.getDPR(),n=h.width,r=h.height,i=(a=u.canvasRendererPluginOptions).dirtyObjectNumThreshold,a=a.dirtyObjectRatioThreshold,o=(s=l.getStats()).total,s=s.rendered,o=s/o;u.clearFullScreen=l.disableDirtyRectangleRendering()||i<s&&a<o,t&&(t.resetTransform?t.resetTransform():t.setTransform(1,0,0,1,0,0),u.clearFullScreen)&&u.clearRect(t,0,0,n*e,r*e,h.background)}),function(t,e){t.isVisible()&&!t.isCulled()&&(u.renderDisplayObject(t,e,u.context,u.restoreStack,c),u.saveDirtyAABB(t)),(t.sortable.sorted||t.childNodes).forEach(function(t){y(t,e)})});l.hooks.endFrame.tap(lf.tag,function(){var e=p.getContext(),t=p.getDPR();if(gt(u.dprMatrix,[t,t,1]),ct(u.vpMatrix,u.dprMatrix,f.getOrthoMatrix()),u.clearFullScreen)y(d.root,e);else{t=u.safeMergeAABB.apply(u,M([u.mergeDirtyAABBs(u.renderQueue)],j(u.removedRBushNodeAABBs.map(function(t){var e=t.minX,n=t.minY,r=t.maxX,t=t.maxY,i=new Tr;return i.setMinMax([e,n,0],[r,t,0]),i})),!1));if(u.removedRBushNodeAABBs=[],Tr.isEmpty(t))return void(u.renderQueue=[]);var n=u.convertAABB2Rect(t),r=n.x,i=n.y,a=n.width,n=n.height,o=Wt(u.vec3a,[r,i,0],u.vpMatrix),s=Wt(u.vec3b,[r+a,i,0],u.vpMatrix),l=Wt(u.vec3c,[r,i+n,0],u.vpMatrix),r=Wt(u.vec3d,[r+a,i+n,0],u.vpMatrix),a=Math.min(o[0],s[0],r[0],l[0]),i=Math.min(o[1],s[1],r[1],l[1]),n=Math.max(o[0],s[0],r[0],l[0]),o=Math.max(o[1],s[1],r[1],l[1]),s=Math.floor(a),r=Math.floor(i),l=Math.ceil(n-a),n=Math.ceil(o-i);e.save(),u.clearRect(e,s,r,l,n,h.background),e.beginPath(),e.rect(s,r,l,n),e.clip(),e.setTransform(u.vpMatrix[0],u.vpMatrix[1],u.vpMatrix[4],u.vpMatrix[5],u.vpMatrix[12],u.vpMatrix[13]),h.renderer.getConfig().enableDirtyRectangleRenderingDebug&&g.dispatchEvent(new pl(Zc.DIRTY_RECTANGLE,{dirtyRect:{x:s,y:r,width:l,height:n}})),u.searchDirtyObjects(t).sort(function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder}).forEach(function(t){t&&t.isVisible()&&!t.isCulled()&&u.renderDisplayObject(t,e,u.context,u.restoreStack,c)}),e.restore(),u.renderQueue.forEach(function(t){u.saveDirtyAABB(t)}),u.renderQueue=[]}u.restoreStack.forEach(function(){e.restore()}),u.restoreStack=[]}),l.hooks.render.tap(lf.tag,function(t){u.clearFullScreen||u.renderQueue.push(t)})},lf.prototype.clearRect=function(t,e,n,r,i,a){t.clearRect(e,n,r,i),a&&(t.fillStyle=a,t.fillRect(e,n,r,i))},lf.prototype.renderDisplayObject=function(t,e,n,r,i){var a,o=t.nodeName,s=r[r.length-1],s=(!s||t.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_CONTAINS||(e.restore(),r.pop()),this.context.styleRendererFactory[o]),o=this.pathGeneratorFactory[o],l=t.parsedStyle.clipPath;l&&(this.applyWorldTransform(e,l),a=this.pathGeneratorFactory[l.nodeName])&&(e.save(),r.push(t),e.beginPath(),a(e,l.parsedStyle),e.closePath(),e.clip()),s&&(this.applyWorldTransform(e,t),e.save(),this.applyAttributesToContext(e,t)),o&&(e.beginPath(),o(e,t.parsedStyle),t.nodeName!==k.LINE)&&t.nodeName!==k.PATH&&t.nodeName!==k.POLYLINE&&e.closePath(),s&&(s.render(e,t.parsedStyle,t,n,this,i),e.restore()),t.renderable.dirty=!1},lf.prototype.convertAABB2Rect=function(t){var e=t.getMin(),t=t.getMax(),n=Math.floor(e[0]),e=Math.floor(e[1]);return{x:n,y:e,width:Math.ceil(t[0])-n,height:Math.ceil(t[1])-e}},lf.prototype.mergeDirtyAABBs=function(t){var n=new Tr;return t.forEach(function(t){var e=t.getRenderBounds(),e=(n.add(e),t.renderable.dirtyRenderBounds);e&&n.add(e)}),n},lf.prototype.searchDirtyObjects=function(t){var e=(n=j(t.getMin(),2))[0],n=n[1],r=(t=j(t.getMax(),2))[0],t=t[1];return this.rBush.search({minX:e,minY:n,maxX:r,maxY:t}).map(function(t){return t.displayObject})},lf.prototype.saveDirtyAABB=function(t){var e=t.renderable,t=(e.dirtyRenderBounds||(e.dirtyRenderBounds=new Tr),t.getRenderBounds());t&&e.dirtyRenderBounds.update(t.center,t.halfExtents)},lf.prototype.applyAttributesToContext=function(t,e){var n=(o=e.parsedStyle).stroke,r=o.fill,i=o.opacity,a=o.lineDash,o=o.lineDashOffset;a&&t.setLineDash(a),A(o)||(t.lineDashOffset=o),A(i)||(t.globalAlpha*=i),A(n)||Array.isArray(n)||n.isNone||(t.strokeStyle=e.attributes.stroke),A(r)||Array.isArray(r)||r.isNone||(t.fillStyle=e.attributes.fill)},lf.prototype.applyWorldTransform=function(t,e,n){var r=0,i=0,a=(e.parsedStyle||{}).anchor,o=a&&a[0]||0,a=a&&a[1]||0;0===o&&0===a||(r=-o*((o=e.geometry.contentBounds)&&2*o.halfExtents[0]||0),i=-a*(o&&2*o.halfExtents[1]||0)),n?(J(this.tmpMat4,e.getLocalTransform()),this.vec3a[0]=r,this.vec3a[1]=i,this.vec3a[2]=0,ut(this.tmpMat4,this.tmpMat4,this.vec3a),ct(this.tmpMat4,n,this.tmpMat4)):(J(this.tmpMat4,e.getWorldTransform()),this.vec3a[0]=r,this.vec3a[1]=i,this.vec3a[2]=0,ut(this.tmpMat4,this.tmpMat4,this.vec3a)),ct(this.tmpMat4,this.vpMatrix,this.tmpMat4),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])},lf.prototype.safeMergeAABB=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=new Tr;return t.forEach(function(t){n.add(t)}),n},lf.tag="CanvasRenderer";var sf=lf;function lf(t){this.canvasRendererPluginOptions=t,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.vpMatrix=Z(),this.dprMatrix=Z(),this.tmpMat4=Z(),this.vec3a=v(),this.vec3b=v(),this.vec3c=v(),this.vec3d=v()}uf.prototype.render=function(t,e,n,r,i,a){var o=e.fill,s=e.fillRule,l=e.opacity,c=e.fillOpacity,u=e.stroke,h=e.strokeOpacity,f=e.lineWidth,d=e.lineCap,p=e.lineJoin,g=e.shadowType,y=e.shadowColor,m=e.shadowBlur,v=e.filter,e=e.miterLimit,b=!A(o)&&!o.isNone,x=!A(u)&&!u.isNone&&0<f,w=0===o.alpha,v=!(!v||!v.length),y=!A(y)&&0<m,m=n.nodeName,g="inner"===g,m=x&&y&&(m===k.PATH||m===k.LINE||m===k.POLYLINE||w||g);b&&(t.globalAlpha=l*c,m||hf(n,t,y),this.fill(t,n,o,s,r,i,a),m||this.clearShadowAndFilter(t,v,y)),x&&(t.globalAlpha=l*h,t.lineWidth=f,A(e)||(t.miterLimit=e),A(d)||(t.lineCap=d),A(p)||(t.lineJoin=p),m&&(g&&(t.globalCompositeOperation="source-atop"),hf(n,t,!0),g)&&(this.stroke(t,n,u,r,i,a),t.globalCompositeOperation="source-over",this.clearShadowAndFilter(t,v,!0)),this.stroke(t,n,u,r,i,a))},uf.prototype.clearShadowAndFilter=function(t,e,n){n&&(t.shadowColor="transparent",t.shadowBlur=0),e&&(n=t.filter,!A(n))&&-1<n.indexOf("drop-shadow")&&(t.filter=n.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")},uf.prototype.fill=function(e,n,t,r,i,a,o){var s=this;Array.isArray(t)?t.forEach(function(t){e.fillStyle=s.getColor(t,n,e),r?e.fill(r):e.fill()}):(ga(t)&&(e.fillStyle=this.getPattern(t,n,e,i,a,o)),r?e.fill(r):e.fill())},uf.prototype.stroke=function(e,n,t,r,i,a){var o=this;Array.isArray(t)?t.forEach(function(t){e.strokeStyle=o.getColor(t,n,e),e.stroke()}):(ga(t)&&(e.strokeStyle=this.getPattern(t,n,e,r,i,a)),e.stroke())},uf.prototype.getPattern=function(t,e,n,r,i,a){var o,s,l,c,u,h,f;return"rect"===t.image.nodeName&&(o=(s=t.image.parsedStyle).width,s=s.height,l=r.contextService.getDPR(),c=r.config.offscreenCanvas,(u=a.offscreenCanvas.getOrCreateCanvas(c)).width=o*l,u.height=s*l,h=a.offscreenCanvas.getOrCreateContext(c),f=[],t.image.forEach(function(t){i.renderDisplayObject(t,h,r,f,a)}),f.forEach(function(){h.restore()})),this.imagePool.getOrCreatePatternSync(t,n,u,l,function(){e.renderable.dirty=!0,r.renderingService.dirtify()})},uf.prototype.getColor=function(t,e,n){var r;return t.type!==ri.LinearGradient&&t.type!==ri.RadialGradient||(r=(e=e.getGeometryBounds())&&2*e.halfExtents[0]||1,e=e&&2*e.halfExtents[1]||1,r=this.imagePool.getOrCreateGradient(m(m({type:t.type},t.value),{width:r,height:e}),n)),r};var cf=uf;function uf(t){this.imagePool=t}function hf(t,e,n){var r=t.parsedStyle,i=r.filter,a=r.shadowColor,o=r.shadowBlur,s=r.shadowOffsetX,r=r.shadowOffsetY;i&&i.length&&(e.filter=t.style.filter),n&&(e.shadowColor=a.toString(),e.shadowBlur=o||0,e.shadowOffsetX=s||0,e.shadowOffsetY=r||0)}df.prototype.render=function(t,e,n){var r=e.width,i=e.height,a=e.img,o=e.shadowColor,e=e.shadowBlur,a=We(a)?this.imagePool.getImageSync(a):(r=r||a.width,i=i||a.height,a);if(a){hf(n,t,!A(o)&&0<e);try{t.drawImage(a,0,0,r,i)}catch(t){}}};var ff=df;function df(t){this.imagePool=t}Mf.prototype.render=function(t,e,n){var r=e.lineWidth,i=e.textAlign,a=e.textBaseline,o=e.lineJoin,s=e.miterLimit,l=e.letterSpacing,c=e.stroke,u=e.fill,h=e.fillOpacity,f=e.strokeOpacity,d=e.opacity,p=e.metrics,g=e.dx,y=e.dy,m=e.shadowColor,e=e.shadowBlur,v=p.font,b=p.lines,x=p.height,w=p.lineHeight,M=p.lineMetrics,p=(t.font=v,t.lineWidth=r,t.textAlign="middle"===i?"center":i,a),k=(_.enableCSSParsing||"alphabetic"!==p||(p="bottom"),t.lineJoin=o,A(s)||(t.miterLimit=s),0),O=("middle"===a?k=-x/2-w/2:"bottom"===a||"alphabetic"===a||"ideographic"===a?k=-x:"top"!==a&&"hanging"!==a||(k=-w),g||0),v=(k+=y||0,1===b.length&&("bottom"===p?(p="middle",k-=.5*x):"top"===p&&(p="middle",k+=.5*x)),t.textBaseline=p,!A(m)&&0<e);hf(n,t,v);for(var E=0;E<b.length;E++){var S=r/2+O;k+=w,A(c)||c.isNone||!r||this.drawLetterSpacing(t,b[E],M[E],i,S,k,l,h,f,d,!0),A(u)||this.drawLetterSpacing(t,b[E],M[E],i,S,k,l,h,f,d)}},Mf.prototype.drawLetterSpacing=function(t,e,n,r,i,a,o,s,l,c,u){if(void 0===u&&(u=!1),0===o)u?this.strokeText(t,e,i,a,l):this.fillText(t,e,i,a,s,c);else{for(var h=t.textAlign,f=(t.textAlign="left",i),d=("center"===r||"middle"===r?f=i-n.width/2:"right"!==r&&"end"!==r||(f=i-n.width),Array.from(e)),p=t.measureText(e).width,g=0;g<d.length;++g){var y=d[g];u?this.strokeText(t,y,f,a,l):this.fillText(t,y,f,a,s,c),f+=p-(y=t.measureText(e.substring(g+1)).width)+o,p=y}t.textAlign=h}},Mf.prototype.fillText=function(t,e,n,r,i,a){var o,s=!A(i)&&1!==i;s&&(o=t.globalAlpha,t.globalAlpha=i*a),t.fillText(e,n,r),s&&(t.globalAlpha=o)},Mf.prototype.strokeText=function(t,e,n,r,i){var a,o=!A(i)&&1!==i;o&&(a=t.globalAlpha,t.globalAlpha=i),t.strokeText(e,n,r),o&&(t.globalAlpha=a)};var pf,gf,yf,mf,vf,bf,xf,wf=Mf;function Mf(){}function kf(){return null!==pf&&pf.apply(this,arguments)||this}function Of(){return null!==gf&&gf.apply(this,arguments)||this}function Ef(){return null!==yf&&yf.apply(this,arguments)||this}function Sf(){return null!==mf&&mf.apply(this,arguments)||this}function Af(){return null!==vf&&vf.apply(this,arguments)||this}function _f(){return null!==bf&&bf.apply(this,arguments)||this}function Tf(){return null!==xf&&xf.apply(this,arguments)||this}t(kf,pf=cf),t(Of,gf=cf),t(Ef,yf=cf),t(Sf,mf=cf),t(Af,vf=cf),t(_f,bf=cf),t(Tf,xf=cf);t(Lf,Pf=n),Lf.prototype.init=function(){var t,e=m({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),n=this.context.imagePool,r=new cf(n),n=((t={})[k.CIRCLE]=r,t[k.ELLIPSE]=r,t[k.RECT]=r,t[k.IMAGE]=new ff(n),t[k.TEXT]=new wf,t[k.LINE]=r,t[k.POLYLINE]=r,t[k.POLYGON]=r,t[k.PATH]=r,t[k.GROUP]=void 0,t[k.HTML]=void 0,t[k.MESH]=void 0,t);this.context.defaultStyleRendererFactory=n,this.context.styleRendererFactory=n,this.addRenderingPlugin(new sf(e))},Lf.prototype.destroy=function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory};var Pf,Cf=Lf;function Lf(t){void 0===t&&(t={});var e=Pf.call(this)||this;return e.options=t,e.name="canvas-renderer",e}jf.prototype.apply=function(t,r){function i(t){e.hooks.pointerWheel.call(t)}function a(t){e.hooks.click.call(t)}var o=this,e=t.renderingService,n=t.renderingContext,s=t.config,l=(this.context=t,n.root.ownerDocument.defaultView),c=function(t){e.hooks.pointerMove.call(t)},u=function(t){e.hooks.pointerUp.call(t)},h=function(t){e.hooks.pointerDown.call(t)},f=function(t){e.hooks.pointerOver.call(t)},d=function(t){e.hooks.pointerOut.call(t)},p=function(t){e.hooks.pointerCancel.call(t)};e.hooks.init.tap(jf.tag,function(){var t,e,n=o.context.contextService.getDomElement();r.globalThis.navigator.msPointerEnabled?(n.style.msContentZooming="none",n.style.msTouchAction="none"):l.supportsPointerEvents&&(n.style.touchAction="none"),l.supportsPointerEvents?(t=n,r.globalThis.document.addEventListener("pointermove",c,!0),t.addEventListener("pointerdown",h,!0),t.addEventListener("pointerleave",d,!0),t.addEventListener("pointerover",f,!0),r.globalThis.addEventListener("pointerup",u,!0),r.globalThis.addEventListener("pointercancel",p,!0)):(t=n,r.globalThis.document.addEventListener("mousemove",c,!0),t.addEventListener("mousedown",h,!0),t.addEventListener("mouseout",d,!0),t.addEventListener("mouseover",f,!0),r.globalThis.addEventListener("mouseup",u,!0)),l.supportsTouchEvents&&((e=n).addEventListener("touchstart",h,!0),e.addEventListener("touchend",u,!0),e.addEventListener("touchmove",c,!0),e.addEventListener("touchcancel",p,!0)),s.useNativeClickEvent&&n.addEventListener("click",a,!0),n.addEventListener("wheel",i,{passive:!0,capture:!0})}),e.hooks.destroy.tap(jf.tag,function(){var t,e,n=o.context.contextService.getDomElement();r.globalThis.navigator.msPointerEnabled?(n.style.msContentZooming="",n.style.msTouchAction=""):l.supportsPointerEvents&&(n.style.touchAction=""),l.supportsPointerEvents?(t=n,r.globalThis.document.removeEventListener("pointermove",c,!0),t.removeEventListener("pointerdown",h,!0),t.removeEventListener("pointerleave",d,!0),t.removeEventListener("pointerover",f,!0),r.globalThis.removeEventListener("pointerup",u,!0)):(t=n,r.globalThis.document.removeEventListener("mousemove",c,!0),t.removeEventListener("mousedown",h,!0),t.removeEventListener("mouseout",d,!0),t.removeEventListener("mouseover",f,!0),r.globalThis.removeEventListener("mouseup",u,!0)),l.supportsTouchEvents&&((e=n).removeEventListener("touchstart",h,!0),e.removeEventListener("touchend",u,!0),e.removeEventListener("touchmove",c,!0),e.removeEventListener("touchcancel",p,!0)),s.useNativeClickEvent&&n.removeEventListener("click",a,!0),n.removeEventListener("wheel",i,!0)})},jf.tag="DOMInteraction";var Nf=jf;function jf(){}t(Bf,Rf=n),Bf.prototype.init=function(){this.addRenderingPlugin(new Nf)},Bf.prototype.destroy=function(){this.removeAllRenderingPlugins()};var Rf,If=Bf;function Bf(){var t=null!==Rf&&Rf.apply(this,arguments)||this;return t.name="dom-interaction",t}Ff.prototype.joinTransformMatrix=function(t){return"matrix(".concat([t[0],t[1],t[4],t[5],t[12],t[13]].join(","),")")},Ff.prototype.apply=function(t){function i(t,e){e.style.transform=s.joinTransformMatrix(t.getWorldTransform())}function e(t){var e,n,r=t.target;r.nodeName===k.HTML&&(s.$camera||(s.$camera=s.createCamera(l)),e=s.getOrCreateEl(r),s.$camera.appendChild(e),n=r.ownerDocument.documentElement.attributes,Object.keys(n).forEach(function(t){e.style[t]=n[t]}),Object.keys(r.attributes).forEach(function(t){s.updateAttribute(t,r)}),i(r,e),_.nativeHTMLMap.set(e,r))}function n(t){(t=t.target).nodeName===k.HTML&&s.$camera&&(t=s.getOrCreateEl(t))&&(t.remove(),_.nativeHTMLMap.delete(t))}function r(t){var e=t.target;e.nodeName===k.HTML&&(t=t.attrName,s.updateAttribute(t,e))}function a(t){var e;(t=t.target).nodeName===k.HTML&&(e=s.getOrCreateEl(t),i(t,e))}function o(){var t,e;s.$camera&&(t=(e=s.context.config).width,e=e.height,s.$camera.style.width="".concat(t||0,"px"),s.$camera.style.height="".concat(e||0,"px"))}var s=this,l=t.camera,c=t.renderingContext,u=t.renderingService,h=(this.context=t,c.root.ownerDocument.defaultView);u.hooks.init.tap(Ff.tag,function(){h.addEventListener(Zc.RESIZE,o),h.addEventListener(b.MOUNTED,e),h.addEventListener(b.UNMOUNTED,n),h.addEventListener(b.ATTR_MODIFIED,r),h.addEventListener(b.BOUNDS_CHANGED,a)}),u.hooks.endFrame.tap(Ff.tag,function(){s.$camera&&c.renderReasons.has(wl.CAMERA_CHANGED)&&(s.$camera.style.transform=s.joinTransformMatrix(l.getOrthoMatrix()))}),u.hooks.destroy.tap(Ff.tag,function(){s.$camera&&s.$camera.remove(),h.removeEventListener(Zc.RESIZE,o),h.removeEventListener(b.MOUNTED,e),h.removeEventListener(b.UNMOUNTED,n),h.removeEventListener(b.ATTR_MODIFIED,r),h.removeEventListener(b.BOUNDS_CHANGED,a)})},Ff.prototype.getId=function(t){return t.id||"g-html-"+t.entity},Ff.prototype.createCamera=function(t){var e,n,r=(a=this.context.config).document,i=a.width,a=a.height,o=this.context.contextService.getDomElement(),s=o.parentNode;return s?((n=s.querySelector("#"+(e="g-canvas-camera")))||((n=r=(r||document).createElement("div")).id=e,r.style.position="absolute",r.style.left="".concat(o.offsetLeft||0,"px"),r.style.top="".concat(o.offsetTop||0,"px"),r.style.transformOrigin="left top",r.style.transform=this.joinTransformMatrix(t.getOrthoMatrix()),r.style.overflow="hidden",r.style.pointerEvents="none",r.style.width="".concat(i||0,"px"),r.style.height="".concat(a||0,"px"),s.appendChild(r)),n):null},Ff.prototype.getOrCreateEl=function(t){var e=this.context.config.document,n=this.getId(t),r=this.$camera.querySelector("#"+n);return r||(r=(e||document).createElement("div"),(t.parsedStyle.$el=r).id=n,t.name&&r.setAttribute("name",t.name),t.className&&(r.className=t.className),r.style.position="absolute",r.style.left="0px",r.style.top="0px",r.style["will-change"]="transform",r.style.transform=this.joinTransformMatrix(t.getWorldTransform())),r},Ff.prototype.updateAttribute=function(t,e){var n=this.getOrCreateEl(e);switch(t){case"innerHTML":var r=e.parsedStyle.innerHTML;We(r)?n.innerHTML=r:(n.innerHTML="",n.appendChild(r));break;case"transformOrigin":r=e.parsedStyle.transformOrigin;n.style["transform-origin"]="".concat(r[0].value," ").concat(r[1].value);break;case"width":_.enableCSSParsing?(i=e.computedStyleMap().get("width"),n.style.width=i.toString()):(i=e.parsedStyle.width,n.style.width=He(i)?"".concat(i,"px"):i.toString());break;case"height":_.enableCSSParsing?(a=e.computedStyleMap().get("height"),n.style.height=a.toString()):(a=e.parsedStyle.height,n.style.height=He(a)?"".concat(a,"px"):a.toString());break;case"zIndex":r=e.parsedStyle.zIndex;n.style["z-index"]="".concat(r);break;case"visibility":var i=e.parsedStyle.visibility;n.style.visibility=i;break;case"pointerEvents":var a=e.parsedStyle.pointerEvents;n.style.pointerEvents=a;break;case"opacity":r=e.parsedStyle.opacity;n.style.opacity="".concat(r);break;case"fill":i=e.parsedStyle.fill,a="";ya(i)?a=i.isNone?"transparent":e.getAttribute("fill"):Array.isArray(i)?a=e.getAttribute("fill"):ga(i),n.style.background=a;break;case"stroke":r=e.parsedStyle.stroke,i="";ya(r)?i=r.isNone?"transparent":e.getAttribute("stroke"):Array.isArray(r)?i=e.getAttribute("stroke"):ga(r),n.style["border-color"]=i,n.style["border-style"]="solid";break;case"lineWidth":a=e.parsedStyle.lineWidth;n.style["border-width"]="".concat(a||0,"px");break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":r=e.style.filter;n.style.filter=r}},Ff.tag="HTMLRendering";var Df=Ff;function Ff(){}t(Gf,zf=n),Gf.prototype.init=function(){this.addRenderingPlugin(new Df)},Gf.prototype.destroy=function(){this.removeAllRenderingPlugins()};var zf,Wf=Gf;function Gf(){var t=null!==zf&&zf.apply(this,arguments)||this;return t.name="html-renderer",t}Vf.prototype.getImageSync=function(t,e){return this.imageCache[t]?e&&e():this.getOrCreateImage(t).then(function(){e&&e()}),this.imageCache[t]},Vf.prototype.getOrCreateImage=function(r){var i,a=this;return this.imageCache[r]?Promise.resolve(this.imageCache[r]):(i=this.canvasConfig.createImage,new Promise(function(t,e){var n;i?n=i(r):cs&&(n=new window.Image),n&&(n.onload=function(){a.imageCache[r]=n,t(n)},n.onerror=function(t){e(t)},n.crossOrigin="Anonymous",n.src=r)}))},Vf.prototype.getOrCreatePatternSync=function(t,e,n,r,i){var a,o,s,l,c=this.generatePatternKey(t);return c&&this.patternCache[c]?this.patternCache[c]:(a=t.image,o=t.repetition,t=t.transform,l=!1,We(a)?s=this.getImageSync(a,i):n?(s=n,l=!0):s=a,(i=s&&e.createPattern(s,o))&&(n=void 0,n=t?Do(io(t),new Jl({})):et(Z()),l&&ht(n,n,[1/r,1/r,1]),i.setTransform({a:n[0],b:n[1],c:n[4],d:n[5],e:n[12],f:n[13]})),c&&i&&(this.patternCache[c]=i),i)},Vf.prototype.getOrCreateGradient=function(t,e){var n,r,i,a,o,s=this.generateGradientKey(t),l=t.type,c=t.steps,u=t.width,h=t.height,f=t.angle,d=t.cx,p=t.cy,t=t.size;return this.gradientCache[s]||(n=null,l===ri.LinearGradient?(r=u,i=h,f=vr((f=f).value),a=0+r/2,o=0+i/2,r=Math.abs(r*Math.cos(f))+Math.abs(i*Math.sin(f)),i={x1:a-Math.cos(f)*r/2,y1:o-Math.sin(f)*r/2,x2:a+Math.cos(f)*r/2,y2:o+Math.sin(f)*r/2},n=e.createLinearGradient(i.x1,i.y1,i.x2,i.y2)):l===ri.RadialGradient&&(a=u,o=h,f=p,r=t,l=(i=d).value,u=f.value,i.unit===g.kPercentage&&(l=i.value/100*a),f.unit===g.kPercentage&&(u=f.value/100*o),i=Math.max(be([0,0],[l,u]),be([0,o],[l,u]),be([a,o],[l,u]),be([a,0],[l,u])),r&&(r instanceof xi?i=r.value:r instanceof ui&&("closest-side"===r.value?i=Math.min(l,a-l,u,o-u):"farthest-side"===r.value?i=Math.max(l,a-l,u,o-u):"closest-corner"===r.value&&(i=Math.min(be([0,0],[l,u]),be([0,o],[l,u]),be([a,o],[l,u]),be([a,0],[l,u]))))),n=e.createRadialGradient(p=(h={x:l,y:u,r:i}).x,t=h.y,0,p,t,h.r)),n&&(c.forEach(function(t){var e=t.offset,t=t.color;e.unit===g.kPercentage&&null!=n&&n.addColorStop(e.value/100,t.toString())}),this.gradientCache[s]=n)),this.gradientCache[s]},Vf.prototype.generateGradientKey=function(t){var e=t.type,n=t.width,r=t.height,i=t.steps,a=t.angle,o=t.cx,s=t.cy,t=t.size;return"gradient-".concat(e,"-").concat((null==a?void 0:a.toString())||0,"-").concat((null==o?void 0:o.toString())||0,"-").concat((null==s?void 0:s.toString())||0,"-").concat((null==t?void 0:t.toString())||0,"-").concat(n,"-").concat(r,"-").concat(i.map(function(t){var e=t.offset,t=t.color;return"".concat(e).concat(t)}).join("-"))},Vf.prototype.generatePatternKey=function(t){var e=t.image,t=t.repetition;return We(e)?"pattern-".concat(e,"-").concat(t):"rect"===e.nodeName?"pattern-".concat(e.entity,"-").concat(t):void 0};var Hf=Vf;function Vf(t){this.canvasConfig=t,this.imageCache={},this.gradientCache={},this.patternCache={}}qf.prototype.apply=function(t){function e(t){var e=t.target,t=e.nodeName,n=e.attributes;t===k.IMAGE&&(t=n.img,We(t))&&a.getImageSync(t,function(){e.renderable.dirty=!0,r.dirtify()})}function n(t){var e=t.target,n=t.attrName,t=t.newValue;e.nodeName===k.IMAGE&&"img"===n&&We(t)&&a.getOrCreateImage(t).then(function(){e.renderable.dirty=!0,r.dirtify()})}var r=t.renderingService,i=t.renderingContext,a=t.imagePool,o=i.root.ownerDocument.defaultView;r.hooks.init.tap(qf.tag,function(){o.addEventListener(b.MOUNTED,e),o.addEventListener(b.ATTR_MODIFIED,n)}),r.hooks.destroy.tap(qf.tag,function(){o.removeEventListener(b.MOUNTED,e),o.removeEventListener(b.ATTR_MODIFIED,n)})},qf.tag="LoadImage";var Yf=qf;function qf(){}t(Xf,$f=n),Xf.prototype.init=function(){this.context.imagePool=new Hf(this.context.config),this.addRenderingPlugin(new Yf)},Xf.prototype.destroy=function(){this.removeAllRenderingPlugins()};var $f,Uf=Xf;function Xf(){var t=null!==$f&&$f.apply(this,arguments)||this;return t.name="image-loader",t}Zf.prototype.init=function(){var t=this.canvasConfig,e=t.container,t=t.canvas;t?(this.$canvas=t,e&&t.parentElement!==e&&e.appendChild(t),this.$container=t.parentElement,this.canvasConfig.container=this.$container):e&&(this.$container=We(e)?document.getElementById(e):e,this.$container)&&(t=document.createElement("canvas"),this.$container.appendChild(t),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=t),this.context=this.$canvas.getContext("2d"),this.resize(this.canvasConfig.width,this.canvasConfig.height)},Zf.prototype.getContext=function(){return this.context},Zf.prototype.getDomElement=function(){return this.$canvas},Zf.prototype.getDPR=function(){return this.dpr},Zf.prototype.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},Zf.prototype.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},Zf.prototype.resize=function(t,e){var n=1<=(n=this.canvasConfig.devicePixelRatio||cs&&window.devicePixelRatio||1)?Math.ceil(n):1;this.dpr=n,this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*e,n=this.$canvas,t=t,e=e,cs)&&n.style&&(n.style.width=t+"px",n.style.height=e+"px"),this.renderingContext.renderReasons.add(wl.CAMERA_CHANGED)},Zf.prototype.applyCursorStyle=function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)},Zf.prototype.toDataURL=function(r){return void 0===r&&(r={}),X(this,void 0,void 0,function(){var e,n;return R(this,function(t){return e=r.type,n=r.encoderOptions,[2,this.context.canvas.toDataURL(e,n)]})})};var Kf=Zf;function Zf(t){this.renderingContext=t.renderingContext,this.canvasConfig=t.config}t(td,Qf=n),td.prototype.init=function(){this.context.ContextService=Kf},td.prototype.destroy=function(){delete this.context.ContextService};var Qf,Jf=td;function td(){var t=null!==Qf&&Qf.apply(this,arguments)||this;return t.name="canvas-context-register",t}t(rd,ed=fn);var ed,nd=rd;function rd(t){t=ed.call(this,t)||this;return t.registerPlugin(new Jf),t.registerPlugin(new Uf),t.registerPlugin(new Lh),t.registerPlugin(new Cf),t.registerPlugin(new If),t.registerPlugin(new af),t.registerPlugin(new Wf),t}ad.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 X(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=be([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(ad.tag,function(){i.addEventListener("pointerdown",e)}),r.hooks.destroy.tap(ad.tag,function(){i.removeEventListener("pointerdown",e)})},ad.tag="Dragndrop";var id=ad;function ad(t){this.dragndropPluginOptions=t}t(ld,od=n),ld.prototype.init=function(){this.addRenderingPlugin(new id(m({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))},ld.prototype.destroy=function(){this.removeAllRenderingPlugins()},ld.prototype.setOptions=function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)};var od,sd=ld;function ld(t){void 0===t&&(t={});var e=od.call(this)||this;return e.options=t,e.name="dragndrop",e}ud.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},ud.prototype.once=function(t,e){return this.on(t,e,!0)},ud.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)},ud.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},ud.prototype.getEvents=function(){return this._events};var cd=ud;function ud(){this._events={}}const hd=()=>[["cartesian"]],fd=(hd.props={},(t={})=>{var e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)}),dd=t=>{var{startAngle:t,endAngle:e,innerRadius:n,outerRadius:r}=fd(t);return[["translate",0,.5],["reflect.y"],["translate",0,-.5],["polar",t,e,n,r]]},pd=(dd.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]]),gd=(pd.props={},()=>[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]]),yd=(gd.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[...gd(),...dd({startAngle:e,endAngle:t,innerRadius:n,outerRadius:r})]}),md=(yd.props={},(t={})=>{var e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)}),vd=t=>{var{startAngle:t,endAngle:e,innerRadius:n,outerRadius:r}=md(t);return[["transpose"],["translate",.5,.5],["reflect"],["translate",-.5,-.5],...dd({startAngle:t,endAngle:e,innerRadius:n,outerRadius:r})]},bd=(vd.props={},()=>[["parallel",0,1,0,1]]),xd=(bd.props={},({focusX:t=0,focusY:e=0,distortionX:n=2,distortionY:r=2,visual:i=!1})=>[["fisheye",t,e,n,r,i]]),wd=(xd.props={transform:!0},t=>{var{startAngle:t=-Math.PI/2,endAngle:e=3*Math.PI/2,innerRadius:n=0,outerRadius:r=1}=t;return[...bd(),...dd({startAngle:t,endAngle:e,innerRadius:n,outerRadius:r})]}),Md=(wd.props={},({value:e})=>t=>t.map(()=>e)),kd=(Md.props={},({value:e})=>t=>t.map(e)),Od=(kd.props={},({value:e})=>t=>t.map(t=>t[e])),Ed=(Od.props={},({value:t})=>()=>t);function Sd(t,e){return t.parent===e.parent?1:2}function Ad(t,e){return t+e.x}function _d(t,e){return Math.max(t,e.y)}function Td(){var s=Sd,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(Ad,0)/e.length,t.y=1+n.reduce(_d,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 Pd(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 Cd(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=Nd)):void 0===e&&(e=Ld);for(var n,r,i,a,o,t=new Id(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 Id(i[a])),r.parent=n,r.depth=n.depth+1;return t.eachBefore(Rd)}function Ld(t){return t.children}function Nd(t){return Array.isArray(t)?t[1]:null}function jd(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function Rd(t){for(var e=0;t.height=e,(t=t.parent)&&t.height<++e;);}function Id(t){this.data=t,this.depth=this.height=0,this.parent=null}function Bd(t){return null==t?null:Dd(t)}function Dd(t){if("function"!=typeof t)throw new Error;return t}function Fd(){return 0}function zd(t){return function(){return t}}Ed.props={},Id.prototype=Cd.prototype={constructor:Id,count:function(){return this.eachAfter(Pd)},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 Cd(this).eachBefore(jd)},[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 Wd=4294967296;function Gd(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&&Vd(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 qd(t[0],t[1]);case 3:return $d(t[0],t[1],t[2])}}(o=function(t,e){var n,r;if(Yd(e,t))return[e];for(n=0;n<t.length;++n)if(Hd(e,t[n])&&Yd(qd(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(Hd(qd(t[n],t[r]),e)&&Hd(qd(t[n],e),t[r])&&Hd(qd(t[r],e),t[n])&&Yd($d(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}(o,n)),i=0);return r}function Hd(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 Vd(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 Yd(t,e){for(var n=0;n<e.length;++n)if(!Vd(t,e[n]))return;return 1}function qd(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 $d(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 Ud(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 Xd(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 Kd(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 Zd(t){this._=t,this.next=null,this.previous=null}function Qd(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;Ud(r,d,i=t[2]),d=new Zd(d),r=new Zd(r),i=new Zd(i),((d.next=i.previous=r).next=d.previous=i).next=r.previous=d;t:for(l=3;l<a;++l){Ud(d._,r._,i=t[l]),i=new Zd(i),c=r.next,u=d.previous,h=r._.r,f=d._.r;do{if(h<=f){if(Xd(c._,i._)){r=c,(d.next=r).previous=d,--l;continue t}h+=c._.r,c=c.next}else{if(Xd(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=Kd(d);(i=i.next)!==r;)(s=Kd(i))<o&&(d=i,o=s);r=d.next}for(d=[r._],i=r;(i=i.next)!==r;)d.push(i._);for(i=Gd(d,e),l=0;l<a;++l)(d=t[l]).x-=i.x,d.y-=i.y;return i.r}function Jd(t){return Math.sqrt(t.value)}function tp(){var n=null,r=1,i=1,a=Fd;function e(t){var e=function(){let t=1;return()=>(t=(1664525*t+1013904223)%Wd)/Wd}();return t.x=r/2,t.y=i/2,n?t.eachBefore(ep(n)).eachAfter(np(a,.5,e)).eachBefore(rp(1)):t.eachBefore(ep(Jd)).eachAfter(np(Fd,1,e)).eachAfter(np(a,t.r/Math.min(r,i),e)).eachBefore(rp(Math.min(r,i)/(2*t.r))),t}return e.radius=function(t){return arguments.length?(n=Bd(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:zd(+t),e):a},e}function ep(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function np(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=Qd(e,l),a)for(n=0;n<i;++n)e[n].r-=a;t.r=r+a}}}function rp(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 ip(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 ap(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 op={depth:-1},sp={},lp={};function cp(t){return t.id}function up(t){return t.parentId}function hp(){var y,m=cp,v=up;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=dp(t,e-1)&&!dp(t,e-2)?t.slice(0,-1):t)[0]?t:"/"+t}),g=p.map(fp);var d=new Set(p).add("");for(const r of g)d.has(r)||(d.add(r),p.push(r),g.push(fp(r)),c.push(lp));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 Id(t),null!=(s=u(t,r,n))&&(s+="")&&(l=o.id=s,f.set(l,f.has(l)?sp: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===sp)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===lp&&1===i.children.length;)i=i.children[0],--e;for(let t=c.length-1;0<=t&&(o=c[t]).data===lp;--t)o.data=null}if(i.parent=op,i.eachBefore(function(t){t.depth=t.parent.depth+1,--e}).eachBefore(Rd),i.parent=null,0<e)throw new Error("cycle");return i}return e.id=function(t){return arguments.length?(m=Bd(t),e):m},e.parentId=function(t){return arguments.length?(v=Bd(t),e):v},e.path=function(t){return arguments.length?(y=Bd(t),e):y},e}function fp(t){let e=t.length;if(e<2)return"";for(;1<--e&&!dp(t,e););return t.slice(0,e)}function dp(e,n){if("/"===e[n]){let t=0;for(;0<n&&"\\"===e[--n];)++t;if(0==(1&t))return 1}}function pp(t,e){return t.parent===e.parent?1:2}function gp(t){var e=t.children;return e?e[0]:t.t}function yp(t){var e=t.children;return e?e[e.length-1]:t.t}function mp(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 vp(){var f=pp,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 mp(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 mp(r[i],i)),n.parent=e;return(t.parent=new mp(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=yp(o),i=gp(i),o&&i;)s=gp(s),(a=yp(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&&!yp(a)&&(a.t=o,a.m+=u-c),i&&!gp(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 bp(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}mp.prototype=Object.create(Id.prototype);ii=(1+Math.sqrt(5))/2;function xp(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?ap(o,n,r,i,M?r+=c*u/M:a):bp(o,n,r,M?n+=l*u/M:i,a),M-=u,b=x}return m}var wp=function e(a){function t(t,e,n,r,i){xp(a,t,e,n,r,i)}return t.ratio=function(t){return e(1<(t=+t)?t:1)},t}(ii);function Mp(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 kp(t,e,n,r,i){(1&t.depth?bp:ap)(t,e,n,r,i)}var Op=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?ap(o,e,n,r,f?n+=(i-n)*o.value/f:i):bp(o,e,n,f?e+=(r-e)*o.value/f:r,i),f-=o.value}else t._squarify=a=xp(d,t,e,n,r,i),a.ratio=d}return t.ratio=function(t){return e(1<(t=+t)?t:1)},t}(ii);function Ep(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 Sp(t={}){return[...Ep(t),{name:"title",scale:"identity"}]}function Ap(){return[{type:"maybeTitle",channel:"color"},{type:"maybeTooltip",channel:["x","y"]}]}function _p(){return[{type:"maybeTitle",channel:"x"},{type:"maybeTooltip",channel:["y"]}]}function Tp(t={}){return Ep(t)}function Pp(){return[{type:"maybeKey"}]}function Cp(t,e){return t.getBandWidth(t.invert(e))}function Lp(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?Cp(l,a[e]):0;var r=p?Cp(c,o[e]):0,e=g&&s?(Cp(u,s[e])/2+ +s[e])*n:0,[t,i]=t;return[t+h*n+e,i+f*r]}:t=>t}function Np(t){return parseFloat(t)/100}function jp(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?Np(e)*o:+e,"string"==typeof t?Np(t)*s:+t]]})]}function Rp(e){return"function"==typeof e?e:t=>t[e]}function Ip(t,e){return Array.from(t,Rp(e))}function Bp(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=Ip(t,e),o=Ip(t,n),s=Ip(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 Dp(t,e){return t.getBandWidth(t.invert(e))}const Fp=()=>(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=Dp(c,a[t]),n=e*(u?Dp(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))})]};Fp.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,channels:[...Sp({shapes:["rect","hollow","funnel","pyramid"]}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[...Pp(),{type:"maybeZeroY1"},{type:"maybeZeroX"}],postInference:[..._p()],interaction:{shareTooltip:!0}};const zp=()=>(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 Wp(t,e){return null==t||null==e?NaN:t<e?-1:e<t?1:e<=t?0:NaN}function Gp(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=Wp,o=(t,e)=>Wp(n(t),e),(t,e)=>n(t)-e):(a=n===Wp||n===function(t,e){return null==t||null==e?NaN:e<t?-1:t<e?1:t<=e?0:NaN}?n:Hp,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 Hp(){return 0}function Vp(t){return null===t?NaN:+t}zp.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,channels:[...Sp({shapes:["rect","hollow"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Pp(),{type:"maybeZeroY1"}],postInference:[..._p()],interaction:{shareTooltip:!0}};s=Gp(Wp);const Yp=s.right,qp=s.left,$p=Gp(Vp).center;function Up(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 Xp(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 Kp(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 Zp{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 Qp 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(Jp(this,t))}has(t){return super.has(Jp(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 Jp({_intern:t,_key:e},n){e=e(n);return t.has(e)?t.get(e):n}function t0(t){return t}function e0(t,...e){return a0(t,t0,t0,e)}function n0(t,...e){return a0(t,Array.from,t0,e)}function r0(t,e,...n){return a0(t,t0,e,n)}function i0(t,e,...n){return a0(t,Array.from,e,n)}function a0(t,u,h,f){return function t(e,n){if(n>=f.length)return h(e);var r=new Qp,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 o0(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=l0(r[t],r[e]);if(n)return n}})):(n=e.map(n),t.sort((t,e)=>l0(n[t],n[e]))),r=e,Array.from(t,t=>r[t])):e.sort(s0(n))}function s0(r=Wp){if(r===Wp)return l0;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 l0(t,e){return(null==t||!(t<=t))-(null==e||!(e<=e))||(t<e?-1:e<t?1:0)}var c0=Array.prototype.slice;function u0(t){return()=>t}const h0=Math.sqrt(50),f0=Math.sqrt(10),d0=Math.sqrt(2);function p0(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>=h0?10:r>=f0?5:r>=d0?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?p0(t,e,2*n):[a,o,s]}function g0(t,e,n){return p0(t=+t,e=+e,n=+n)[2]}function y0(t){return Math.max(1,Math.ceil(Math.log(Up(t))/Math.LN2)+1)}function m0(){var m=t0,v=Kp,b=y0;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===Kp&&([s,l]=function(t,e,n){let r;for(;;){var i=g0(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?p0(e,t,n):p0(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=g0(s,l,u)),c[c.length-1]>=l)if(l<=o&&v===Kp){const n=g0(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[Yp(c,e,0,h)].push(t[a]);return y}return e.value=function(t){return arguments.length?(m="function"==typeof t?t:u0(t),e):m},e.domain=function(t){return arguments.length?(v="function"==typeof t?t:u0([t[0],t[1]]),e):v},e.thresholds=function(t){return arguments.length?(b="function"==typeof t?t:u0(Array.isArray(t)?c0.call(t):t),e):b},e}function v0(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 b0(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 x0(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 w0(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 M0(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?l0:s0(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),M0(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(k0(n,i,r),0<o(n[a],h)&&k0(n,i,a);t<e;){for(k0(n,t,e),++t,--e;o(n[t],h)<0;)++t;for(;0<o(n[e],h);)--e}0===o(n[i],h)?k0(n,i,e):k0(n,++e,a),e<=r&&(i=e+1),r<=e&&(a=e-1)}return n}function k0(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function O0(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?x0(t):1<=e?v0(t):(n=(n-1)*e,(r=v0(M0(t,e=Math.floor(n)).subarray(0,e+1)))+(x0(t.subarray(e+1))-r)*(n-e))}function E0(n,t,r=Vp){var i,e,a;if(!isNaN(t=+t))return i=Float64Array.from(n,(t,e)=>Vp(r(n[e],e,n))),t<=0?w0(i):1<=t?b0(i):(e=Uint32Array.from(n,(t,e)=>e),a=i.length-1,M0(e,t=Math.floor(a*t),0,a,(t,e)=>l0(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<Wp(a,t):0===Wp(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 S0(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 A0(t,e){return O0(t,.5,e)}function _0(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function T0(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 P0(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 C0(t){t=t.getOptions().transformations;return t.map(([t])=>t).filter(t=>"transpose"===t).length%2!=0}function L0(t){t=t.getOptions().transformations;return t.some(([t])=>"polar"===t)}function N0(t){t=t.getOptions().transformations;return t.some(([t])=>"reflect"===t)&&t.some(([t])=>t.startsWith("transpose"))}function j0(t){t=t.getOptions().transformations;return t.some(([t])=>"helix"===t)}function R0(t){t=t.getOptions().transformations;return t.some(([t])=>"parallel"===t)}function I0(t){t=t.getOptions().transformations;return t.some(([t])=>"fisheye"===t)}function B0(t){return j0(t)||L0(t)}function D0(t){var t=t.getOptions()["transformations"],[,,,t,e]=t.find(t=>"polar"===t[0]);return[+t,+e]}function F0(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 z0=(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(e0(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]},W0=(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})]},G0=()=>(t,e,n,r)=>{return(R0(r)?W0:z0)(t,e,n,r)};G0.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,channels:[...Sp({shapes:["line","smooth"]}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"identity"}],preInference:[...Pp(),{type:"maybeGradient"},{type:"maybeSeries"}],postInference:[..._p(),{type:"maybeTitle",channel:"color"},{type:"maybeTooltip",channel:["position"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const H0=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=Lp(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))])]};H0.props={defaultShape:"hollow",defaultLabelShape:"label",composite:!1,channels:[...Sp({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:[...Pp(),{type:"maybeZeroY"},{type:"maybeZeroX"}],postInference:[{type:"maybeSize"},...Ap()]};const V0=s=>{var{cartesian:t=!1}=s;return t?jp:(t,e,n,r)=>{const{x:i,y:a}=n,o=Lp(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}};V0.props={defaultShape:"text",defaultLabelShape:"label",composite:!1,channels:[...Sp({shapes:["text","badge"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize"},{name:"rotate"}],preInference:[...Pp(),{type:"maybeTuple"},{type:"maybeVisualPosition"}],postInference:[...Ap()]};const Y0=()=>(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))})]};Y0.props={defaultShape:"cell",defaultLabelShape:"label",composite:!1,channels:[...Sp({shapes:["cell","hollow"]}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[...Pp(),{type:"maybeZeroX"},{type:"maybeZeroY"},{type:"maybeZeroPadding"}],postInference:[...Ap()]};const q0=()=>(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(e0(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]};q0.props={defaultShape:"area",defaultLabelShape:"label",composite:!1,channels:[...Sp({shapes:["area","smooth","hvh","hv","vh"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"size"},{name:"series",scale:"identity"}],preInference:[...Pp(),{type:"maybeSeries"},{type:"maybeZeroY1"},{type:"maybeZeroPadding"}],postInference:[..._p()],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const $0=c=>(t,e,n,r)=>{const{x:i,y:a,x1:o=i,y1:s=a}=n,l=Lp(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]};$0.props={defaultShape:"link",defaultLabelShape:"label",composite:!1,channels:[...Sp({shapes:["link","arc","vhv","smooth"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Pp(),{type:"maybeIdentityY"},{type:"maybeIdentityX"}],postInference:[...Ap()]};const U0=s=>{var t=s["cartesian"];return t?jp:(t,e,n,r)=>{const{x:i,y:a}=n,o=Lp(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}};U0.props={defaultShape:"image",defaultLabelShape:"label",composite:!1,channels:[...Sp({shapes:["image"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[...Pp(),{type:"maybeTuple"},{type:"maybeVisualPosition"}],postInference:[...Ap()]};const X0=()=>(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]};X0.props={defaultShape:"polygon",defaultLabelShape:"label",composite:!1,channels:[...Sp({shapes:["polygon","ribbon"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Pp()],postInference:[...Ap()]};const K0=()=>(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))})]},Z0=(K0.props={defaultShape:"box",defaultLabelShape:"label",composite:!1,channels:[...Sp({shapes:["box"]}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[...Pp(),{type:"maybeZeroX"}],postInference:[..._p()],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]});Z0.props={defaultShape:"vector",defaultLabelShape:"label",composite:!1,channels:[...Sp({shapes:["vector"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[...Pp()],postInference:[...Ap()]};const Q0=()=>(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))})]};Q0.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,channels:[...Tp({shapes:["line"]}),{name:"y",required:!0}],preInference:[...Pp(),{type:"maybeTupleY"}],postInference:[]};const J0=()=>(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))})]};J0.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,channels:[...Tp({shapes:["line"]}),{name:"x",required:!0}],preInference:[...Pp(),{type:"maybeTupleX"}],postInference:[]};const tg=(...t)=>$0(...t);function eg(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 ng(t={}){const{extendX:r=!1,extendY:s=!1}=t;return(t,e,n,i)=>{const a=eg("x",r,n,e.x),o=eg("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))})]}}tg.props={defaultShape:"connector",defaultLabelShape:"label",composite:!1,channels:[...Tp({shapes:["connector"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Pp()],postInference:[]};const rg=()=>ng();rg.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,channels:[...Tp({shapes:["range"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Pp()],postInference:[]};const ig=()=>ng({extendY:!0});ig.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,channels:[...Tp({shapes:["range"]}),{name:"x",required:!0}],preInference:[...Pp()],postInference:[]};const ag=()=>ng({extendX:!0});function og(t){return t.target.depth}function sg(t,e){return t.sourceLinks.length?t.depth:e-1}function lg(t){return function(){return t}}function cg(t,e){return hg(t.source,e.source)||t.index-e.index}function ug(t,e){return hg(t.target,e.target)||t.index-e.index}function hg(t,e){return t.y0-e.y0}function fg(t){return t.value}function dg(t){return t.index}function pg(t){return t.nodes}function gg(t){return t.links}function yg(t,e){t=t.get(e);if(t)return t;throw new Error("missing: "+e)}function mg({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 vg(){let x=0,w=0,M=1,k=1,O=24,E=8,S,A=dg,_=sg,T,P,C,L=pg,N=gg,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=>[A(t),t]));if(t.forEach((t,e)=>{t.index=e;let{source:n,target:r}=t;"object"!=typeof n&&(n=t.source=yg(g,n)),"object"!=typeof r&&(r=t.target=yg(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(P0(y.sourceLinks,fg),P0(y.targetLinks,fg)):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(v0(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(v0(t,t=>t.depth)+1,0),n=(M-x-O)/(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(_.call(null,a,e))));a.layer=i,a.x0=x+i*n,a.x1=a.x0+O,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,(k-w)/(v0(u,t=>t.length)-1)),u),h=x0(t,t=>(k-w-(t.length-1)*S)/P0(t,fg));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=(k-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(ug),n.sort(cg)}(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(hg),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(hg),o.length&&R(o,i)}}(u,d,p)}return mg(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,k,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(ug);for(const{target:{targetLinks:e}}of t)e.sort(cg)}}return e.update=function(t){return mg(t),t},e.nodeId=function(t){return arguments.length?(A="function"==typeof t?t:lg(t),e):A},e.nodeAlign=function(t){return arguments.length?(_="function"==typeof t?t:lg(t),e):_},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?(O=+t,e):O},e.nodePadding=function(t){return arguments.length?(E=S=+t,e):E},e.nodes=function(t){return arguments.length?(L="function"==typeof t?t:lg(t),e):L},e.links=function(t){return arguments.length?(N="function"==typeof t?t:lg(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],k=+t[1],e):[M-x,k-w]},e.extent=function(t){return arguments.length?(x=+t[0][0],M=+t[1][0],w=+t[0][1],k=+t[1][1],e):[[x,w],[M,k]]},e.iterations=function(t){return arguments.length?(j=+t,e):j},e}ag.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,channels:[...Tp({shapes:["range"]}),{name:"y",required:!0}],preInference:[...Pp()],postInference:[]};const bg={nodeAlign:"justify",nodeWidth:.008,nodePadding:.03,nodes:t=>t.nodes,links:t=>t.links,nodeSort:void 0,linkSort:void 0,iterations:6},xg={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?x0(t.sourceLinks,og)-1:0},justify:sg};const wg=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({},bg,h),l=vg().nodeSort(n).linkSort(c).links(l).nodes(s).nodeWidth(i).nodePadding(a).nodeDepth(o).nodeAlign("string"==(c=typeof(n=r))?xg[n]||sg:"function"==c?n:sg).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 Mg(t){return t}function kg(t){return t.reduce((n,r)=>(t,...e)=>r(n(t,...e),...e),Mg)}function Og(t){return t.replace(/( |^)[a-z]/g,t=>t.toUpperCase())}function Eg(t=""){throw new Error(t)}function Sg(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 Ag(t){return null!=t&&!Number.isNaN(t)}function st(t,e){return _g(t,e)||{}}function _g(t,n){t=Object.entries(t||{}).filter(([t])=>t.startsWith(n)).map(([t,e])=>[$e(t.replace(n,"").trim()),e]).filter(([t])=>!!t);return 0===t.length?null:Object.fromEntries(t)}function Tg(t,...n){return Object.fromEntries(Object.entries(t).filter(([e])=>n.every(t=>!e.startsWith(t))))}function Pg(t,e){return void 0===t?null:"number"==typeof t?t:(t=+t.replace("%",""),Number.isNaN(t)?null:t/100*e)}function Cg(t){return!("object"!=typeof t||t instanceof Date||null===t||Array.isArray(t))}function Lg(t){return null===t||!1===t}function Ng(t,e,n={},r=!1){return Lg(t)||Array.isArray(t)&&r?t:(r=st(t,e),ot(n,r))}function jg(t,e={}){return!Lg(t)&&!Array.isArray(t)&&Rg(t)?ot(e,t):t}function Rg(t){var e;return 0===Object.keys(t).length||({title:t,items:e}=t,void 0!==t)||void 0!==e}function Ig(t,e){return"object"==typeof t?st(t,e):t}wg.props={};const Bg={nodeId:t=>t.key,nodeWidth:.02,nodePadding:.02},Dg={type:"polygon",axis:!1,legend:!1,encode:{shape:"polygon",x:"x",y:"y"},scale:{x:{type:"identity"},y:{type:"identity"}},style:{stroke:"#000"}},Fg={type:"polygon",axis:!1,legend:!1,encode:{shape:"ribbon",x:"x",y:"y"},style:{fillOpacity:.5,stroke:void 0}},zg={textAlign:t=>t.x[0]<.5?"start":"end",position:t=>t.x[0]<.5?"right":"left",fontSize:10},Wg=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}=Bp(t,e),u=st(e,"node"),e=st(e,"link"),{key:h=t=>t.key,color:f=h}=u,{links:i,nodes:t}=wg(Object.assign(Object.assign(Object.assign({},Bg),{nodeId:Rp(h)}),i))({links:t,nodes:c});const d=st(r,"label"),{text:p=h,spacing:g=5}=d,y=at(d,["text","spacing"]),m=Rp(h);c=Ng(l,"node",{title:m,items:[{field:"value"}]},!0),h=Ng(l,"link",{title:"",items:[t=>({name:"source",value:m(t.source)}),t=>({name:"target",value:m(t.target)})]});return[ot({},Dg,{data:t,encode:Object.assign(Object.assign({},u),{color:f}),scale:n,style:st(r,"node"),labels:[Object.assign(Object.assign(Object.assign({},zg),{text:p,dx:t=>t.x[0]<.5?g:-g}),y),...a],tooltip:c,animate:Ig(s,"node"),axis:!1}),ot({},Fg,{data:i,encode:e,labels:o,style:Object.assign({fill:e.color?void 0:"#aaa",strokeWidth:0},st(r,"link")),tooltip:h,animate:Ig(s,"link")})]},Gg=(Wg.props={},t=>(t,e,n,r)=>[t,t.map(()=>[[0,0]])]);function Hg(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:Mp,treemapDice:ap,treemapSlice:bp,treemapSliceDice:kp,treemapSquarify:wp,treemapResquarify:Op};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?hp().path(p):hp():Cd)(t));function g(t){return t.x0=t.y0=0,t.x1=a,t.y1=s,t.eachBefore(y),l=[0],i&&t.eachBefore(ip),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:Rp(r)(t)).sort(e.sort):p.count(),o=wp,i=!1,s=a=1,l=[0],d=f=h=u=c=Fd,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=Dd(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:zd(+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:zd(+t),g):u},g.paddingRight=function(t){return arguments.length?(h="function"==typeof t?t:zd(+t),g):h},g.paddingBottom=function(t){return arguments.length?(f="function"==typeof t?t:zd(+t),g):f},g.paddingLeft=function(t){return arguments.length?(d="function"==typeof t?t:zd(+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)}Gg.props={defaultShape:"path",defaultLabelShape:"label",composite:!1,channels:[...Sp({shapes:["path","hollow"]}),{name:"d",scale:"identity"}],preInference:[...Pp()],postInference:[]};const Vg={fontSize:10,text:t=>t.data.name,position:"inside",fill:"#000",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>t.x1-t.x0},Yg={title:t=>t.data.name,items:[{field:"value"}]},qg=(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=Hg(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({},Vg),u),...l]},t),{tooltip:jg(c,Yg),axis:!1}))},$g=(qg.props={},{text:"",position:"inside",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>2*t.r}),Ug={title:t=>t.data.name,items:[{field:"value"}]},Xg=(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=(je(t)?hp().path(e.path):Cd)(t);return r?n.sum(t=>Rp(r)(t)).sort(e.sort):n.count(),tp().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({},$g),e),...l]},t),{tooltip:jg(c,Ug),axis:!1}))};function Kg(t,e){return x0(t,t=>e[t])}function Zg(t,e){return v0(t,t=>e[t])}function Qg(t,e){const n=2.5*Jg(t,e)-1.5*e1(t,e);return x0(t,t=>e[t]>=n?e[t]:NaN)}function Jg(t,e){return O0(t,.25,t=>e[t])}function t1(t,e){return O0(t,.5,t=>e[t])}function e1(t,e){return O0(t,.75,t=>e[t])}function n1(t,e){const n=2.5*e1(t,e)-1.5*Jg(t,e);return v0(t,t=>e[t]<=n?e[t]:NaN)}function r1(){return(t,e)=>{var n=e["encode"],{y:n,x:r}=n;const i=n["value"],a=r["value"];return[Array.from(e0(t,t=>a[+t]).values()).flatMap(t=>{const e=Qg(t,i),n=n1(t,i);return t.filter(t=>i[t]<e||i[t]>n)}),e]}}Xg.props={};const i1=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:Jg,y2:t1,y3:e1},u=Ng(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=Ng(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:Qg},c),{y4:n1})],encode:Object.assign(Object.assign({},r),l),style:s,tooltip:u,animate:Ig(o,"box")},t),{type:"point",data:n,transform:[{type:r1}],encode:r,style:Object.assign({},e),tooltip:a,animate:Ig(o,"point")}]):Object.assign({type:"box",data:n,transform:[Object.assign(Object.assign({type:"groupX",y:Kg},c),{y4:Zg})],encode:Object.assign(Object.assign({},r),l),style:i,tooltip:u},t)},a1=(i1.props={},s=>{var t=s["cartesian"];return t?jp:(t,e,n,r)=>{const{x:i,y:a}=n,o=Lp(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}});function o1(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 s1(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function l1(t){return t[0]}function c1(t){return t[1]}function u1(t,e,n){e=new h1(null==e?l1:e,null==n?c1:n,NaN,NaN,NaN,NaN);return null==t?e:e.addAll(t)}function h1(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 f1(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}a1.props={defaultShape:"shape",defaultLabelShape:"label",composite:!1,channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Pp(),{type:"maybeTuple"},{type:"maybeVisualPosition"},{type:"maybeFunctionAttribute"}]};Vs=u1.prototype=h1.prototype;function d1(t){return function(){return t}}function p1(t){return 1e-6*(t()-.5)}function g1(t){return t.index}function y1(t,e){t=t.get(e);if(t)return t;throw new Error("node not found: "+e)}function m1(c){var u,h,a,o,f,d,s=g1,n=function(t){return 1/Math.min(o[t.source.index],o[t.target.index])},r=d1(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||p1(d),o=i.y+i.vy-r.y-r.vy||p1(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=y1(r,t.source)),"object"!=typeof t.target&&(t.target=y1(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:d1(+t),l(),e):n},e.distance=function(t){return arguments.length?(r="function"==typeof t?t:d1(+t),g(),e):r},e}Vs.copy=function(){var t,e,n=new h1(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]=f1(e));else n._root=f1(r);return n},Vs.add=function(t){var e=+this._x.call(null,t),n=+this._y.call(null,t);return o1(this.cover(e,n),e,n,t)},Vs.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)o1(this,i[u],a[u],t[u]);return this},Vs.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},Vs.data=function(){var e=[];return this.visit(function(t){if(!t.length)for(;e.push(t.data),t=t.next;);}),e},Vs.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]]},Vs.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 s1(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 s1(y[3],a=(s+o)/2,c=(l+i)/2,o,i),new s1(y[2],s,c,a,i),new s1(y[1],a,l,o,c),new s1(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},Vs.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},Vs.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},Vs.root=function(){return this._root},Vs.size=function(){var e=0;return this.visit(function(t){if(!t.length)for(;++e,t=t.next;);}),e},Vs.visit=function(t){var e,n,r,i,a,o,s,l=[],c=this._root;for(c&&l.push(new s1(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 s1(e,o,s,i,a)),(e=c[2])&&l.push(new s1(e,n,s,o,a)),(e=c[1])&&l.push(new s1(e,o,r,i,s)),e=c[0])&&l.push(new s1(e,n,r,o,s));return this},Vs.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new s1(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 s1(i,a,o,c,u)),(i=h[1])&&n.push(new s1(i,c,o,s,u)),(i=h[2])&&n.push(new s1(i,a,u,c,l)),i=h[3])&&n.push(new s1(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},Vs.x=function(t){return arguments.length?(this._x=t,this):this._x},Vs.y=function(t){return arguments.length?(this._y=t,this):this._y};var v1={value:()=>{}};function b1(){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 x1(r)}function x1(t){this._=t}function w1(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=v1,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}x1.prototype=b1.prototype={constructor:x1,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]=w1(i[n],t.name,e);else if(null==e)for(n in i)i[n]=w1(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 x1(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 M1,k1,O1=0,E1=0,S1=0,A1=1e3,_1=0,T1=0,P1=0,C1="object"==typeof performance&&performance.now?performance:Date,L1="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function N1(){return T1||(L1(j1),T1=C1.now()+P1)}function j1(){T1=0}function R1(){this._call=this._time=this._next=null}function I1(t,e,n){var r=new R1;return r.restart(t,e,n),r}function B1(){T1=(_1=C1.now())+P1,O1=E1=0;try{N1(),++O1;for(var t,e=M1;e;)0<=(t=T1-e._time)&&e._call.call(void 0,t),e=e._next;--O1}finally{for(var n,r,i=M1,a=1/(O1=0);i;)i=i._call?(a>i._time&&(a=i._time),(n=i)._next):(r=i._next,i._next=null,n?n._next=r:M1=r);k1=n,F1(a),T1=0}}function D1(){var t=C1.now(),e=t-_1;A1<e&&(P1-=e,_1=t)}function F1(t){O1||(E1=E1&&clearTimeout(E1),24<t-T1?(t<1/0&&(E1=setTimeout(B1,t-C1.now()-P1)),S1=S1&&clearInterval(S1)):(S1||(_1=C1.now(),S1=setInterval(D1,A1)),O1=1,L1(B1)))}R1.prototype=I1.prototype={constructor:R1,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?N1():+n)+(null==e?0:+e),this._next||k1===this||(k1?k1._next=this:M1=this,k1=this),this._call=t,this._time=n,F1()},stop:function(){this._call&&(this._call=null,this._time=1/0,F1())}};const z1=4294967296;function W1(t){return t.x}function G1(t){return t.y}var H1=10,V1=Math.PI*(3-Math.sqrt(5));function Y1(l){var a,o=1,e=.001,s=1-Math.pow(e,1/300),c=0,u=.6,h=new Map,t=I1(i),n=b1("tick","end"),r=function(){let t=1;return()=>(t=(1664525*t+1013904223)%z1)/z1}();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=H1*Math.sqrt(.5+r),e=r*V1,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 q1={joint:!0},$1={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}},U1={type:"point",axis:!1,legend:!1,encode:{x:"x",y:"y",size:5,color:"group",shape:"point"},scale:{color:{type:"ordinal"}},style:{stroke:"#fff"}},X1={text:""};function K1(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=d1(-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:d1(+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=u1(i,W1,G1).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=p1(c))*i),0===a&&(s+=(a=p1(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=p1(c))*i),0===a&&(s+=(a=p1(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,k,O,E,S,A,_,T,n=m1(a).id(Rp(n)),P=("function"==typeof o&&I.strength(o),"function"==typeof s&&n.strength(s),Y1(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+=(O[n]-e.x)*k[n]*t}function j(){if(M){var t,e=M.length;for(k=new Array(e),O=new Array(e),t=0;t<e;++t)k[t]=isNaN(O[t]=+w(M[t],t,M))?0:+E(M[t],t,M)}}function R(){for(var t,e=_.length,n=0,r=0,i=0;i<e;++i)n+=(t=_[i]).x,r+=t.y;for(n=(n/e-S)*T,r=(r/e-A)*T,i=0;i<e;++i)(t=_[i]).x-=n,t.y-=r}e?P.force("center",(T=1,null==S&&(S=0),null==A&&(A=0),R.initialize=function(t){_=t},R.x=function(t){return arguments.length?(S=+t,R):S},R.y=function(t){return arguments.length?(A=+t,R):A},R.strength=function(t){return arguments.length?(T=+t,R):T},R)):P.force("x",(E=d1(.1),"function"!=typeof w&&(w=d1(null==w?0:+w)),N.initialize=function(t){M=t,j()},N.strength=function(t){return arguments.length?(E="function"==typeof t?t:d1(+t),j(),N):E},N.x=function(t){return arguments.length?(w="function"==typeof t?t:d1(+t),j(),N):w},N)).force("y",(x=d1(.1),"function"!=typeof y&&(y=d1(null==y?0:+y)),C.initialize=function(t){m=t,L()},C.strength=function(t){return arguments.length?(x="function"==typeof t?t:d1(+t),L(),C):x},C.y=function(t){return arguments.length?(y="function"==typeof t?t:d1(+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 Z1=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}=Bp(t,e),{nodesData:t,linksData:p}=K1({links:t,nodes:p},ot({},q1,i),e),i=Ng(l,"link",{items:[t=>({name:"source",value:Rp(u)(t.source)}),t=>({name:"target",value:Rp(u)(t.target)})]}),e=Ng(l,"node",{items:[t=>({name:"key",value:Rp(c)(t)})]},!0);return[ot({},$1,{data:p,encode:d,labels:o,style:st(r,"link"),tooltip:i,animate:Ig(s,"link")}),ot({},U1,{data:t,encode:Object.assign({},f),scale:n,style:st(r,"node"),tooltip:e,labels:[Object.assign(Object.assign({},X1),st(r,"label")),...a],animate:Ig(s,"link")})]},Q1=(Z1.props={},h=>u=>t=>{const{field:e="value",nodeSize:n,separation:r,sortBy:i,as:a=["x","y"]}=u,[o,s]=a;var t=Cd(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}}),J1=t=>Q1(Td)(t),ty=(J1.props={},t=>Q1(vp)(t)),ey=(ty.props={},{sortBy:(t,e)=>e.value-t.value}),ny={axis:!1,legend:!1,type:"point",encode:{x:"x",y:"y",size:2,shape:"point"}},ry={type:"link",encode:{x:"x",y:"y",shape:"smooth"}},iy={text:"",fontSize:10},ay=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}=ty(Object.assign(Object.assign(Object.assign({},ey),i),{field:c}))(t),t=Ng(l,"node",{title:"name",items:["value"]},!0),l=Ng(l,"link",{title:"",items:[t=>({name:"source",value:t.source.name}),t=>({name:"target",value:t.target.name})]});return[ot({},ry,{data:c,encode:st(e,"link"),scale:st(n,"link"),labels:o,style:Object.assign({stroke:"#999"},st(r,"link")),tooltip:l,animate:Ig(s,"link")}),ot({},ny,{data:i,scale:st(n,"node"),encode:st(e,"node"),labels:[Object.assign(Object.assign({},iy),st(r,"label")),...a],style:Object.assign({},st(r,"node")),tooltip:t,animate:Ig(s,"node")})]};ay.props={};var oy={},sy={},ly=34,cy=10,uy=13;function hy(t){return new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'}).join(",")+"}")}function fy(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 dy(t,e){var t=t+"",n=t.length;return n<e?new Array(e-n+1).join(0)+t:t}function py(t){var e,n=t.getUTCHours(),r=t.getUTCMinutes(),i=t.getUTCSeconds(),a=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((e=t.getUTCFullYear())<0?"-"+dy(-e,6):9999<e?"+"+dy(e,6):dy(e,4))+"-"+dy(t.getUTCMonth()+1,2)+"-"+dy(t.getUTCDate(),2)+(a?"T"+dy(n,2)+":"+dy(r,2)+":"+dy(i,2)+"."+dy(a,3)+"Z":i?"T"+dy(n,2)+":"+dy(r,2)+":"+dy(i,2)+"Z":r||n?"T"+dy(n,2)+":"+dy(r,2)+"Z":"")}function gy(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 sy;if(l)return l=!1,oy;var t,e,n=a;if(r.charCodeAt(n)===ly){for(;a++<i&&r.charCodeAt(a)!==ly||r.charCodeAt(++a)===ly;);return(t=a)>=i?s=!0:(e=r.charCodeAt(a++))===cy?l=!0:e===uy&&(l=!0,r.charCodeAt(a)===cy)&&++a,r.slice(n+1,t-1).replace(/""/g,'"')}for(;a<i;){if((e=r.charCodeAt(t=a++))===cy)l=!0;else if(e===uy)l=!0,r.charCodeAt(a)===cy&&++a;else if(e!==h)continue;return r.slice(n,t)}return s=!0,r.slice(n,i)}for(r.charCodeAt(i-1)===cy&&--i,r.charCodeAt(i-1)===uy&&--i;(e=c())!==sy;){for(var u=[];e!==oy&&e!==sy;)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?py(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=hy(n=t),function(t,e){return r(i(t),e,n)}):hy(t)})).columns=s||[],t},parseRows:n,format:function(t,e){return[(e=null==e?fy(t):e).map(o).join(r)].concat(i(t,e)).join("\n")},formatBody:function(t,e){return i(t,e=null==e?fy(t):e).join("\n")},formatRows:function(t){return t.map(a).join("\n")},formatRow:a,formatValue:o}}function yy(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;my&&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 my=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),vy=t=>{const{value:n,format:r=n.split(".").pop(),delimiter:i=",",autoType:a=!0}=t;return()=>X(void 0,void 0,void 0,function*(){var t,e=yield fetch(n);if("csv"===r)return t=yield e.text(),gy(i).parse(t,a?yy:Mg);if("json"===r)return yield e.json();throw new Error(`Unknown format: ${r}.`)})};vy.props={};const by=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}};by.props={};const xy=t=>{const{callback:e=function(t){return null!=t&&!Number.isNaN(t)}}=t;return t=>t.filter(e)},wy=(xy.props={},t=>{const e=t["callback"];return t=>Array.isArray(t)?[...t].sort(e):t});wy.props={};const My=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})};My.props={};const ky=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};ky.props={};const Oy=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))}},Ey=(Oy.props={},t=>{const e=t["value"];return()=>e}),Sy=(Ey.props={},t=>{const{callback:e=Mg}=t;return t=>e(t)}),Ay=(Sy.props={},t=>{const{callback:e=Mg}=t;return t=>Array.isArray(t)?t.map(e):t});Ay.props={};var _y=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 Ty={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 Py(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({},Ty),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=e0(r,t=>t.source),a=e0(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=P0(e,t=>t.sourceWeight)+P0(n,t=>t.targetWeight)})}if(r=e,(n="function"==typeof v?v:_y[v])&&r.sort(n),!(n=(r=e).length))throw Eg("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=e0(e,t=>t.source),l=e0(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 Cy=e=>t=>Py(e)(t),Ly=(Cy.props={},Math.PI/180),Ny=64,jy=2048;function Ry(t){return t.text}function Iy(){return"serif"}function By(){return"normal"}function Dy(t){return t.value}function Fy(){return 90*~~(2*Math.random())}function zy(){return 1}function Wy(){}function Gy(t,o,r,s){if(!o.sprite){var l=t.context,c=t.ratio;l.clearRect(0,0,(Ny<<5)/c,jy/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*Ly),f=Math.cos(o.rotate*Ly),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>=Ny<<5&&(i=0,a+=n,n=0),a+e>=jy)break;l.translate((i+(t>>1))/c,(a+(e>>1))/c),o.rotate&&l.rotate(o.rotate*Ly),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,(Ny<<5)/c,jy/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)*(Ny<<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 Hy(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function Vy(t){var e=[];let n=-1;for(;++n<t;)e[n]=0;return e}function Yy(){return document.createElement("canvas")}function qy(t){return"function"==typeof t?t:function(){return t}}const $y={archimedean:Hy,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 Uy(){let b=[256,256],r=Ry,i=Iy,p=Dy,g=By,y=Fy,m=zy,x=Hy,w=Math.random,v=Wy,M=[],k=null,O=1/0;const E=By,S=Yy,A={};return A.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=(Ny<<5)/e,t.height=jy/e,(t=t.getContext("2d")).fillStyle=t.strokeStyle="red",t.textAlign="center",{context:t,ratio:e}),l=A.board||Vy((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=A.board?[{x:0,y:0},{x:a,y:o}]:void 0;function n(){for(var t,e,n,r=Date.now();Date.now()-r<O&&++f<c;){var i=h[f];i.x=a*(w()+.5)>>1,i.y=o*(w()+.5)>>1,Gy(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:A,word:i}),u.push(i),d?A.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)}A._tags=u,A._bounds=d,f>=c&&(A.stop(),v.call(null,"end",{cloud:A,words:u,bounds:d}))}return k&&clearInterval(k),k=setInterval(n,0),n(),A},A.stop=function(){return k&&(clearInterval(k),k=null),A},A.createMask=t=>{var e=document.createElement("canvas"),[n,r]=b;if(n&&r){var i=n>>5,a=Vy((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}A.board=a,A.hasImage=!0}},A.timeInterval=function(t){O=null==t?1/0:t},A.words=function(t){M=t},A.size=function(t=[]){b=[+t[0],+t[1]]},A.text=function(t){r=qy(t)},A.font=function(t){i=qy(t)},A.fontWeight=function(t){g=qy(t)},A.rotate=function(t){y=qy(t)},A.spiral=function(t){x=$y[t]||t},A.fontSize=function(t){p=qy(t)},A.padding=function(t){m=qy(t)},A.random=function(t){w=qy(t)},A.on=function(t){v=qy(t)},A}const Xy={size:[500,500],fontSize:[14,28]};function Ky(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 Zy=f=>h=>X(void 0,void 0,void 0,function*(){var i,a,t=Object.assign({},Xy,f),e=Uy(),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 X(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=[x0(e),v0(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",Ky,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 Qy(e){return"string"==typeof e?t=>t[e]:e}Zy.props={};const Jy=t=>{const{join:e,on:n,select:i=[],as:a=i,unknown:o=NaN}=t;var[t,r]=n;const s=Qy(r),l=Qy(t),c=r0(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),{}))})},tm=(Jy.props={},t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)});tm.props={};var em,nm,rm,im,_o={exports:{}},Qs={exports:{}};function am(t){return 1-Math.abs(t)}em=(No=Qs).exports,No.exports.isNumber=function(t){return"number"==typeof t},No.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},No.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},No.exports.findMinMulti=function(t){for(var e=em.findMin(t[0]),n=1;n<t.length;n++)e=Math.min(e,em.findMin(t[n]));return e},No.exports.findMaxMulti=function(t){for(var e=em.findMax(t[0]),n=1;n<t.length;n++)e=Math.max(e,em.findMax(t[n]));return e},No.exports.inside=function(t,e,n){return t<=n&&n<=e},Ro=_o,nm=Math.log(2),rm=Ro.exports,im=Qs.exports,Ro.exports.getUnifiedMinMax=function(t,e){return rm.getUnifiedMinMaxMulti([t],e)},Ro.exports.getUnifiedMinMaxMulti=function(t,e){var n=!1,r=!1,i=im.isNumber((e=e||{}).width)?e.width:2,a=im.isNumber(e.size)?e.size:50,o=im.isNumber(e.min)?e.min:(n=!0,im.findMinMulti(t)),e=im.isNumber(e.max)?e.max:(r=!0,im.findMaxMulti(t)),t=(e-o)/(a-1);return n&&(o-=2*i*t),r&&(e+=2*i*t),{min:o,max:e}},Ro.exports.create=function(t,e){if(!t||0===t.length)return[];var n=im.isNumber((e=e||{}).size)?e.size:50,o=im.isNumber(e.width)?e.width:2,e=rm.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}(am,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),im.inside(0,c.length-1,a)&&(c[a].y+=i*f),im.inside(0,c.length-1,e+1)&&(c[e+1].y-=2*i*f),im.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},Ro.exports.getExpectedValueFromPdf=function(t){var e;if(t&&0!==t.length)return e=0,t.forEach(function(t){e+=t.x*t.y}),e},Ro.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}},Ro.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/nm,Math.pow(2,n)};var om=_o.exports;const sm=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(e0(t,e=>n.map(t=>e[t]).join("-")).values()).map(t=>{var e=om.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})})}};sm.props={};var lm={exports:{}};function cm(t){for(var e=new Array(t),n=0;n<t;++n)e[n]=0;return e}function um(t,e){for(var n=0,r=0;r<t.length;++r)n+=t[r]*e[r];return n}function hm(t){return Math.sqrt(um(t,t))}function fm(t,e,n){for(var r=0;r<e.length;++r)t[r]=e[r]*n}function dm(t,e,n,r,i){for(var a=0;a<t.length;++a)t[a]=e*n[a]+r*i[a]}function pm(i,a,o,s,l,c,u){var h=o.fx,f=um(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,dm(s.x,1,o.x,l,a),d=s.fx=i(s.x,s.fxprime),p=um(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(dm(s.x,1,o.x,l,a),d=s.fx=i(s.x,s.fxprime),p=um(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}(zo=zo=lm.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},zo.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(),k=0;k<i;++k){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 O=b[g]=0;O<d;++O)b[g]+=p[O][g];b[g]/=d}var E=p[d];if(dm(x,1+c,b,-c,E),x.fx=t(x),x.fx<p[0].fx)dm(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?(dm(w,1+h,b,-h,E),w.fx=t(w),w.fx<E.fx?m(w):S=!0):(dm(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)dm(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]}},zo.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),fm(r=a.fxprime.slice(),a.fxprime,-1);for(var c=0;c<i;++c){var u;if(l=pm(t,r,a,o,l),n.history&&n.history.push({x:a.x.slice(),fx:a.fx,fxprime:a.fxprime.slice(),alpha:l}),l?(dm(s,1,o.fxprime,-1,a.fxprime),u=um(a.fxprime,a.fxprime),u=Math.max(0,um(s,o.fxprime)/u),dm(r,u,r,-1,o.fxprime),u=a,a=o,o=u):fm(r,a.fxprime,-1),hm(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},zo.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()}),dm(a.x,1,a.x,-i,a.fxprime),!(hm(a.fxprime)<=1e-5));++o);return a},zo.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&&(fm(l,i.fxprime,-1),s=pm(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||hm(i.fxprime)<1e-5));++d);return i},zo.zeros=cm,zo.zerosM=function(t,e){return cm(t).map(function(){return cm(e)})},zo.norm2=hm,zo.weightedSum=dm,zo.scale=fm;const gm=1e-10;function ym(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=xm(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(vm(e,n[t])>n[t].radius+gm)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=vm(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+=mm(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(vm(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-gm,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 mm(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function vm(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}function bm(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),mm(t,t-(n*n-e*e+t*t)/(2*n))+mm(e,r))}function xm(t,e){var n,r,i=vm(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 wm(t,e){(e=e||{}).maxIterations=e.maxIterations||500;var n=e.initialLayout||Om;const i=e.lossFunction||Em,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=lm.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 Mm=1e-10;function km(e,n,r){return Math.min(e,n)*Math.min(e,n)*Math.PI<=r+Mm?Math.abs(e-n):lm.exports.bisect(function(t){return bm(e,n,t)-r},0,e+n)}function Om(t,e){let n=function(r,t){const i=t&&t.lossFunction?t.lossFunction:Em,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+Mm>=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=km(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=km(s.radius,x.radius,y[t].size),M=xm({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 k=i(a,r);k<e&&(e=k,n=m[t])}p(n,g)}return a}(t,e);var r=e.lossFunction||Em;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=lm.exports.zerosM(a.length,a.length),l=lm.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=km(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=lm.exports.norm2(y.map(lm.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=lm.exports.zeros(2*y.length).map(Math.random);h=lm.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)lm.exports.scale(e.history[a].x,c);return p}(t,e),t)+1e-8<r(n,t)?e:n}function Em(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]],bm(o.radius,a.radius,vm(o,a))):ym(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 Sm(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 Am=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=wm(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=Sm(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=(ym(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}})})}};Am.props={};const _m=(l,c)=>X(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 Zy(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 Tm(t,...e){return e.reduce((e,n)=>t=>e(n(t)),t)}function Pm(e,n){return n-e?t=>(t-e)/(n-e):t=>.5}function Cm(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}_m.props={};const Lm=Math.sqrt(50),Nm=Math.sqrt(10),jm=Math.sqrt(2);function Rm(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>=Lm?10:n>=Nm?5:n>=jm?2:1)*10**t:-(10**-t)/(n>=Lm?10:n>=Nm?5:n>=jm?2:1)}function Im(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>=Lm?r*=10:n>=Nm?r*=5:n>=jm&&(r*=2),e<t?-r:r}const Bm=(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=Rm(a,o,n))?(a=Math.floor(a/s)*s,o=Math.ceil(o/s)*s,s=Rm(a,o,n)):s<0&&(a=Math.ceil(a*s)/s,o=Math.floor(o*s)/s,s=Rm(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},Dm=36e5,Fm=864e5,zm=7*Fm;Fm,Fm;function Wm(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}}qo=Wm(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),Uo=Wm(1e3,t=>{t.setMilliseconds(0)},(t,e=1)=>{t.setTime(+t+1e3*e)},t=>t.getSeconds()),Ko=Wm(6e4,t=>{t.setSeconds(0,0)},(t,e=1)=>{t.setTime(+t+6e4*e)},t=>t.getMinutes()),Qo=Wm(Dm,t=>{t.setMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+Dm*e)},t=>t.getHours()),es=Wm(Fm,t=>{t.setHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+Fm*e)},t=>t.getDate()-1);const Gm=Wm(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());rs=Wm(zm,t=>{t.setDate(t.getDate()-t.getDay()%7),t.setHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+zm*e)},t=>{var e=Gm.floor(t),t=new Date(+t);return Math.floor((+t-+e)/zm)}),as=Wm(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 Hm={millisecond:qo,second:Uo,minute:Ko,hour:Qo,day:es,week:rs,month:Gm,year:as};Es=Wm(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),Fs=Wm(1e3,t=>{t.setUTCMilliseconds(0)},(t,e=1)=>{t.setTime(+t+1e3*e)},t=>t.getUTCSeconds()),zs=Wm(6e4,t=>{t.setUTCSeconds(0,0)},(t,e=1)=>{t.setTime(+t+6e4*e)},t=>t.getUTCMinutes()),Go=Wm(Dm,t=>{t.setUTCMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+Dm*e)},t=>t.getUTCHours()),qs=Wm(Fm,t=>{t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+Fm*e)},t=>t.getUTCDate()-1);const Vm=Wm(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());Ml=Wm(zm,t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+zm*e)},t=>{var e=Vm.floor(t),t=new Date(+t);return Math.floor((+t-+e)/zm)}),Al=Wm(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 Ym={millisecond:Es,second:Fs,minute:zs,hour:Go,day:qs,week:Ml,month:Vm,year:Al};function qm(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?Ym:Hm;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=Cm(i,l,0,c,s);let h;return h=u===c?[a,Im(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(Im(t,e,n),1)]}const $m=(t,e,n,r,i)=>{var a=e<t,o=a?e:t,t=a?t:e,[e,n]=qm(o,t,n,r,i),r=[e.floor(o,n),e.ceil(t,n)];return a?r.reverse():r};function Um(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)}function Xm(t){return Qm(t,"Function")}function Km(t){return null==t}var Zm={}.toString,Qm=function(t,e){return Zm.call(t)==="[object "+e+"]"},Jm=function(t){return Array.isArray?Array.isArray(t):Qm(t,"Array")};var tv=function(t){if("object"!=typeof(e=t)||null===e||!Qm(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},ev=function(t){return Qm(t,"Number")},nv=Object.values?function(t){return Object.values(t)}:function(n){var t,r=[],e=n,i=function(t,e){Xm(n)&&"prototype"===e||r.push(t)};if(e)if(Jm(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},rv=5;function iv(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||rv,n){var o;n.hasOwnProperty(a)&&(null!==(o=n[a])&&tv(o)?(tv(e[a])||(e[a]={}),r<i?t(e[a],o,r+1,i):e[a]=n[a]):Jm(o)?(e[a]=[],e[a]=e[a].concat(o)):void 0!==o&&(e[a]=o))}}(t,e[r]);return t}function av(t){return t}var ov,sv=function(t,e){if(!Um(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 lv(t){return Km(t)?0:(Um(t)?t:Object.keys(t)).length}function cv(t){return null!=t&&!Number.isNaN(t)}!function(a,o){var s;if(Xm(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(ov=ov||document.createElement("canvas").getContext("2d")).font=[a,e,i,n+"px",r].join(" "),ov.measureText(Qm(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],nv(e=void 0===e?{}:e)).join("")});const uv=e=>t=>-e(-t),hv=(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?uv(t):t},fv=(e,t)=>{var n=e===Math.E?Math.exp:t=>e**t;return t?uv(n):n},dv=(t,e,n,r)=>{var i=t<0,a=hv(r,i),r=fv(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 pv(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 ev(t)?Math.round(t):t}):i;this.output=Tm(a,r,e,t)},t.prototype.invert=void 0}}var gv,jl={exports:{}},Fl={exports:{}},yv=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))},mv=Array.prototype.concat,vv=Array.prototype.slice,bv=Fl.exports=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];yv(i)?e=mv.call(e,vv.call(i)):e.push(i)}return e},xv=(bv.wrap=function(t){return function(){return t(bv(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]}),wv=Fl.exports,Mv=Object.hasOwnProperty,kv=Object.create(null);for(gv in xv)Mv.call(xv,gv)&&(kv[xv[gv]]=gv);var Ov=jl.exports={to:{},get:{}};function Ev(t,e,n){return Math.min(Math.max(e,t),n)}function Sv(t){t=Math.round(t).toString(16).toUpperCase();return t.length<2?"0"+t:t}Ov.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=Ov.get.hsl(t),n="hsl";break;case"hwb":e=Ov.get.hwb(t),n="hwb";break;default:e=Ov.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},Ov.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]:Mv.call(xv,e[1])?((i=xv[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]=Ev(i[n],0,255);return i[3]=Ev(i[3],0,1),i},Ov.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,Ev(parseFloat(t[2]),0,100),Ev(parseFloat(t[3]),0,100),Ev(isNaN(e)?1:e,0,1)]):null},Ov.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,Ev(parseFloat(t[2]),0,100),Ev(parseFloat(t[3]),0,100),Ev(isNaN(e)?1:e,0,1)]):null},Ov.to.hex=function(){var t=wv(arguments);return"#"+Sv(t[0])+Sv(t[1])+Sv(t[2])+(t[3]<1?Sv(Math.round(255*t[3])):"")},Ov.to.rgb=function(){var t=wv(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]+")"},Ov.to.rgb.percent=function(){var t=wv(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]+")"},Ov.to.hsl=function(){var t=wv(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},Ov.to.hwb=function(){var t=wv(arguments),e="";return 4<=t.length&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},Ov.to.keyword=function(t){return kv[t.slice(0,3)]};var Av=jl.exports;function _v(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 Tv(t){var e,n,r,t=Av.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*_v(n=2*r-(r=r<.5?r*(1+n):r+n-r*n),r,e+1/3),255*_v(n,r,e),255*_v(n,r,e-1/3),t]):null):null}const Pv=(e,n)=>t=>e*(1-t)+n*t,Cv=(t,e)=>{if("number"==typeof t&&"number"==typeof e)return Pv(t,e);if("string"!=typeof t||"string"!=typeof e)return()=>t;{var n=t,r=e;const l=Tv(n),c=Tv(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})`}}},Lv=(t,e)=>{const n=Pv(t,e);return t=>Math.round(n(t))};function Nv({map:t,initKey:e},n){e=e(n);return t.has(e)?t.get(e):n}function jv(t){return"object"==typeof t?t.valueOf():t}class Rv extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=jv,null!==t)for(var[e,n]of t)this.set(e,n)}get(t){return super.get(Nv({map:this.map,initKey:this.initKey},t))}has(t){return super.has(Nv({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 Iv{constructor(t){this.options=iv({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=iv({},this.options,t),this.rescale(t)}rescale(t){}}const Bv=Symbol("defaultUnknown");function Dv(e,n,r){for(let t=0;t<n.length;t+=1)e.has(n[t])||e.set(r(n[t]),t)}function Fv(t){var{value:t,from:e,to:n,mapper:r,notFoundReturn:i}=t;let a=r.get(t);if(void 0===a){if(i!==Bv)return i;a=e.push(t)-1,r.set(t,a)}return n[a%n.length]}function zv(t){return t instanceof Date?t=>""+t:"object"==typeof t?t=>JSON.stringify(t):t=>t}class Wv extends Iv{getDefaultOptions(){return{domain:[],range:[],unknown:Bv}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&Dv(this.domainIndexMap,this.getDomain(),this.domainKey),Fv({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&Dv(this.rangeIndexMap,this.getRange(),this.rangeKey),Fv({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=zv(e),this.rangeKey=zv(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 Wv(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 Gv(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 Rv(e.map((t,e)=>{e=d[e]*p;return[t,o?Math.floor(e):e]})),g=new Rv(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 Hv extends Wv{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:Bv,flex:[]}}constructor(t){super(t)}clone(){return new Hv(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 Gv(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 Vv=(t,e,n)=>{let r,i,a=t,o=e;if(a===o&&0<n)return[a];let s=Rm(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 Yv extends Iv{getDefaultOptions(){return{range:[0],domain:[0,1],unknown:void 0,tickCount:5,tickMethod:Vv}}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 ev(e)&&ev(r)?t(e,r,n):[]}clone(){return new Yv(this.options)}}function qv(t){return Math.abs(t)<1e-15?t:parseFloat(t.toFixed(15))}const $v=[1,5,2,2.5,4,3],Uv=100*Number.EPSILON;const Xv=(n,r,t=5,i=!0,a=$v,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=lv(f),1-sv(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=(O=r,M=w*(e-1),(O-=n)<M?1-((M-O)/2)**2/(.1*O)**2:1);if(o[0]*v+o[1]*M+o[2]*b+o[3]<g.score)break;var k=Math.floor(r/w)*y-(e-1)*y,O=Math.ceil(n/w)*y;if(k<=O){var E=O-k;for(let t=0;t<=E;t+=1){var S=(k+t)*(w/y),A=S+w*(e-1),_=w,T=function(t,e,n,r,i,a){var o=lv(e),e=sv(e,t);let s=0;return t=(r%a+a)%a,1-e/(o-1)-n+(s=(t<Uv||a-t<Uv)&&r<=0&&0<=i?1:s)}(m,a,y,S,A,_),P=1-.5*((r-A)**2+(n-S)**2)/(.1*(r-n))**2,C=(l=e,C=n,l=(l-1)/(A-(L=S)),c=((c=s)-1)/(Math.max(A,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<=A)&&(g.lmin=S,g.lmax=A,g.lstep=_,g.score=L)}}t+=1}e+=1}}y+=1}var t=qv(g.lmax),e=qv(g.lmin),N=qv(g.lstep),j=Math.floor((t=(t-e)/N,Math.round(1e12*t)/1e12))+1,R=new Array(j);R[0]=qv(e);for(let t=1;t<j;t+=1)R[t]=qv(R[t-1]+N);return R};class Kv extends Iv{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:Xv}}map(t){return cv(t)?t:this.options.unknown}invert(t){return this.map(t)}clone(){return new Kv(this.options)}getTicks(){var{domain:t,tickCount:e,tickMethod:n}=this.options,[t,r]=t;return ev(t)&&ev(r)?n(t,r,e):[]}}const Zv=(t,e,n)=>{var[t,r]=t,[e,i]=e;let a,o;return Tm(o=t<r?(a=Pm(t,r),n(e,i)):(a=Pm(r,t),n(i,e)),a)},Qv=(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]=Pm(s[t],s[t+1]),o[t]=e(l[t],l[t+1]);return t=>{var e=Cm(r,t,1,i)-1,n=a[e];return Tm(o[e],n)(t)}},Jv=(t,e,n,r)=>{return(2<Math.min(t.length,e.length)?Qv:Zv)(t,e,r?Lv:n)};class tb extends Iv{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Pv,tickCount:5}}map(t){return cv(t)?this.output(t):this.options.unknown}invert(t){return cv(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 Bm}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 av}composeOutput(t,e){var{domain:n,range:r,round:i,interpolate:a}=this.options,n=Jv(n.map(t),r,a,i);this.output=Tm(n,e,t)}composeInput(t,e,n){var{domain:r,range:i}=this.options,i=Jv(i,r.map(t),Pv);this.input=Tm(e,n,i)}}class eb extends tb{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:Cv,tickMethod:Vv,tickCount:5}}chooseTransforms(){return[av,av]}clone(){return new eb(this.options)}}class nb extends Hv{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:Bv,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new nb(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}const rb=t=>t<0?-Math.sqrt(-t):Math.sqrt(t);class ib extends tb{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:Cv,tickMethod:Vv,tickCount:5}}constructor(t){super(t)}chooseTransforms(){var t,e,n,r=this.options["exponent"];return 1===r?[av,av]:(t=.5===r?rb:(e=r,t=>t<0?-((-t)**e):t**e),n=r,[t,t=>t<0?-((-t)**(1/n)):t**(1/n)])}clone(){return new ib(this.options)}}class ab extends ib{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Cv,tickMethod:Vv,tickCount:5,exponent:.5}}constructor(t){super(t)}update(t){super.update(t)}clone(){return new ab(this.options)}}class ob extends Iv{getDefaultOptions(){return{domain:[.5],range:[0,1]}}constructor(t){super(t)}map(t){return cv(t)?(t=Cm(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 ob(this.options)}rescale(){var{domain:t,range:e}=this.options;this.n=Math.min(t.length,e.length-1),this.thresholds=t}}const sb=(t,e,n,r=10)=>{var i=t<0,a=fv(r,i),o=hv(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=Vv(l,c,n))}else{t=-1===n?h-u:Math.min(h-u,n);f=Vv(u,h,t).map(a)}return s?f.reverse():f};class lb extends tb{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:Cv,tickMethod:sb,tickCount:5}}chooseNice(){return dv}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[hv(t,e),fv(t,e)]}clone(){return new lb(this.options)}}class cb extends ob{getDefaultOptions(){return{domain:[0,1],range:[.5],nice:!1,tickCount:5,tickMethod:Xv}}constructor(t){super(t)}nice(){var t,e,n=this.options["nice"];n&&([n,t,e]=this.getTickMethodOptions(),this.options.domain=Bm(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 cb(this.options)}}function ub(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 hb extends ob{getDefaultOptions(){return{domain:[],range:[],tickCount:5,unknown:void 0,tickMethod:Xv}}constructor(t){super(t)}rescale(){var{domain:t,range:e}=this.options;this.n=e.length-1,this.thresholds=ub(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 hb(this.options)}getTicks(){var{tickCount:t,domain:e,tickMethod:n}=this.options,r=e.length-1;return n(e[0],e[r],t)}}var fb=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,db=/\[([^]*?)\]/gm;function pb(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}function gb(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 yb(t,e){for(void 0===e&&(e=2),t=String(t);t.length<e;)t="0"+t;return t}var mb,Gs=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],tl=["January","February","March","April","May","June","July","August","September","October","November","December"],a=pb(tl,3),vb=gb({},{dayNamesShort:pb(Gs,3),dayNames:Gs,monthNamesShort:a,monthNames:tl,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][3<t%10?0:(t-t%10!=10?1:0)*t%10]}}),bb={D:function(t){return String(t.getDate())},DD:function(t){return yb(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return yb(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 yb(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 yb(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return yb(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return yb(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return yb(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return yb(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return yb(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return yb(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return yb(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?"-":"+")+yb(100*Math.floor(Math.abs(t)/60)+Math.abs(t)%60,4)},Z:function(t){t=t.getTimezoneOffset();return(0<t?"-":"+")+yb(Math.floor(Math.abs(t)/60),2)+":"+yb(Math.abs(t)%60,2)}},xb={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 wb=(t,e,n,r,i)=>{var a=e<t,o=a?e:t,t=a?t:e,[e,n]=qm(o,t,n,r,i),r=e.range(o,new Date(+t+1),n,!0);return a?r.reverse():r};function Mb(t){var e=t.getTimezoneOffset(),t=new Date(t);return t.setMinutes(t.getMinutes()+e,t.getSeconds(),t.getMilliseconds()),t}class kb extends tb{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:wb,interpolate:Pv,mask:void 0,utc:!1}}chooseTransforms(){return[t=>+t,t=>new Date(t)]}chooseNice(){return $m}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?Ym:Hm,s=t?Mb:av;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=xb.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=xb[t]||t).replace(db,function(t,e){return r.push(e),"@@@"}),gb(gb({},vb),n));return(t=t.replace(fb,function(t){return bb[t](e,i)})).replace(/@@@/g,function(){return r.shift()})}}clone(){return new kb(this.options)}}var Ob;let Eb=mb=class extends eb{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:av,tickMethod:Vv,tickCount:5}}constructor(t){super(t)}clone(){return new mb(this.options)}};Eb=mb=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}([pv(function(t){return[t(0),t(1)]},t=>{var[t,e]=t;return Tm(Pv(0,1),Pm(t,e))})],Eb);let Sb=Ob=class extends eb{getDefaultOptions(){return{domain:[0,.5,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:av,tickMethod:Vv,tickCount:5}}constructor(t){super(t)}clone(){return new Ob(this.options)}};function Ab(r,i){return Object.entries(r).reduce((t,[e,n])=>(t[e]=i(n,e,r),t),{})}function _b(t){return t.map((t,e)=>e)}function Tb(t){return t[t.length-1]}function Pb(t,e){const n=[[],[]];return t.forEach(t=>{n[e(t)?0:1].push(t)}),n}function Cb(n,t=n.length){if(1===t)return n.map(t=>[t]);const r=[];for(let e=0;e<n.length;e++)Cb(n.slice(e+1),t-1).forEach(t=>{r.push([n[e],...t])});return r}function Lb([t,e],[n,r]){return[t-n,e-r]}function Nb([t,e],[n,r]){return[t+n,e+r]}function jb([t,e],[n,r]){return Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))}function Rb([t,e]){return Math.atan2(e,t)}function Ib([t,e]){return Rb([t,e])+Math.PI/2}function Bb(t,e){t=Rb(t),e=Rb(e);return t<e?e-t:2*Math.PI-(t-e)}function Db(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 Fb([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 zb(t,e,n,r,i){e=Rb(Lb(r,e))+Math.PI,n=Rb(Lb(r,n))+Math.PI;t.arc(r[0],r[1],i,e,n,n-e<0)}function Wb(e,t,n,r="y",i="between"){const a="y"===r||!0===r?n:t;var n="y"===r||!0===r?90:0,t=_b(a),[r,o]=Kp(t,t=>a[t]);const s=new eb({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 Gb(t){var[t,e,n,r]=t;return[r,t,e,n]}function Hb(t,e,n){var[e,r,,i]=C0(t)?Gb(e):e,[n,a]=n,t=t.getCenter(),o=Ib(Lb(e,t)),r=Ib(Lb(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:jb(i,t),outerRadius:jb(e,t)}}function Vb(t){var{colorAttribute:t,opacityAttribute:t=t}=t;return t+"Opacity"}function Yb(t,e){return L0(t)?(e=e["transform"],`translate(${(t=t.getCenter())[0]}, ${t[1]}) `+(e||"")):""}function qb(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 $b([t],null,t,t.ownerDocument)}Sb=Ob=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}([pv(function(t){return[t(0),t(.5),t(1)]},t=>{const[e,n,r]=t,i=Tm(Pv(0,.5),Pm(e,n)),a=Tm(Pv(.5,1),Pm(n,r));return t=>(e>r?t<n?a:i:t<n?i:a)(t)})],Sb);class $b{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 $b(t,null,this._elements[0],this._document)}selectFacetAll(t){t="string"==typeof t?this._parent.querySelectorAll(t):t;return new $b(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 $b([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 $b(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 $b(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 $b([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=e0(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 e0=h.get(d);s.push([f,e0]);for(const y of e0)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 $b([],i,this._parent,this._document),new $b(a,null,this._parent,this._document),new $b(o,null,this._parent,this._document),new $b([],s,this._parent,this._document),new $b(l,null,this._parent,this._document)];return new $b(this._elements,null,this._parent,this._document,t)}merge(t){var e=[...this._elements,...t._elements],t=[...this._transitions,...t._transitions];return new $b(e,null,this._parent,this._document,void 0,t)}createElement(t){var e;return this._document?this._document.createElement(t,{}):(e=$b.registry[t])?new e:Eg("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 $b([],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}}$b.registry={g:hc,rect:Lc,circle:nc,path:kc,text:Rc,ellipse:lc,image:mc,line:xc,polygon:Sc,polyline:Tc,html:pc};const Ub={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"]}}},Xb={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=vd({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]=qb(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 hc);return Lg(u)||("function"==typeof u?n.append(()=>u(s,e,a,g)):n.append("line").call(L,r).node()),Lg(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}},Kb={type:"text",style:{x:"50%",y:"60%",textAlign:"center",textBaseline:"middle",fontSize:20,fontWeight:800,fill:"#888"}};const Zb=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({},Ub,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({},Ub,Xb,Object.assign({type:"point",data:e,scale:l,style:u,animate:"object"==typeof a?st(a,"indicator"):a},t)),ot({},Kb,{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})]},Qb=(Zb.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]});Qb.props={defaultShape:"density",defaultLabelShape:"label",composite:!1,channels:[...Sp({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:[...Pp(),{type:"maybeZeroY1"},{type:"maybeZeroX"}],postInference:[..._p()],interaction:{shareTooltip:!0}};const Jb=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]})]]};Jb.props={defaultShape:"heatmap",defaultLabelShape:"label",composite:!1,channels:[...Sp({shapes:["heatmap"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"color",scale:"identity",required:!0},{name:"size"}],preInference:[...Pp(),{type:"maybeZeroY"},{type:"maybeZeroX"}],postInference:[...Ap()]};const t2=()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"],e2=(t2.props={},()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"]),n2=(e2.props={},t=>new Hv(t)),r2=(n2.props={},t=>new eb(t)),i2=(r2.props={},t=>new Wv(t)),a2=(i2.props={},t=>new Kv(t)),o2=(a2.props={},t=>new nb(t)),s2=(o2.props={},t=>new kb(t)),l2=(s2.props={},t=>new lb(t)),c2=(l2.props={},t=>new ib(t)),u2=(c2.props={},t=>new ob(t)),h2=(u2.props={},t=>new hb(t)),f2=(h2.props={},t=>new cb(t)),d2=(f2.props={},t=>new ab(t)),p2=(d2.props={},t=>new Eb(t)),g2=(p2.props={},t=>new Yv(t));function y2(t){return function(){return t}}g2.props={};const m2=Math.abs,v2=Math.atan2,b2=Math.cos,x2=Math.max,w2=Math.min,M2=Math.sin,k2=Math.sqrt,O2=1e-12,E2=Math.PI,S2=E2/2,A2=2*E2;function _2(t){return 1<=t?S2:t<=-1?-S2:Math.asin(t)}const T2=Math.PI,P2=2*T2,C2=1e-6,L2=P2-C2;function N2(n){this._+=n[0];for(let t=1,e=n.length;t<e;++t)this._+=arguments[t]+n[t]}class j2{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?N2:function(t){var e=Math.floor(t);if(!(0<=e))throw new Error("invalid digits: "+t);if(15<e)return N2;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>C2&&(Math.abs(f*c-u*h)>C2&&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((T2-Math.acos((o+d-r)/(2*l*a)))/2))/a,r=o/l,Math.abs(d-1)>C2&&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)>C2||Math.abs(this._y1-c)>C2)&&this._append`L${l},${c}`,n&&((h=h<0?h%P2+P2:h)>L2?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>C2&&this._append`A${n},${n},0,${+(h>=T2)},${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 R2(){return new j2}function I2(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 j2(r)}function B2(t){return t.innerRadius}function D2(t){return t.outerRadius}function F2(t){return t.startAngle}function z2(t){return t.endAngle}function W2(t){return t&&t.padAngle}function G2(t,e,n,r,i,a,o){var s=t-n,l=e-r,o=(o?a:-a)/k2(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)*k2(x2(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 H2(){var _=B2,T=D2,P=y2(0),C=null,L=F2,N=z2,j=W2,R=null,I=I2(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=+_.apply(this,arguments),k=+T.apply(this,arguments),O=L.apply(this,arguments)-S2,E=N.apply(this,arguments)-S2,S=m2(E-O),A=O<E;if(R=R||(t=I()),k<M&&(e=k,k=M,M=e),k>O2?S>A2-O2?(R.moveTo(k*b2(O),k*M2(O)),R.arc(0,0,k,O,E,!A),M>O2&&(R.moveTo(M*b2(E),M*M2(E)),R.arc(0,0,M,E,O,A))):(r=e=O,i=n=E,o=a=S,f=(u=j.apply(this,arguments)/2)>O2&&(C?+C.apply(this,arguments):k2(M*M+k*k)),w=x=s=w2(m2(k-M)/2,+P.apply(this,arguments)),f>O2&&(h=_2(f/M*M2(u)),f=_2(f/k*M2(u)),(a-=2*h)>O2?(r+=h*=A?1:-1,i-=h):(a=0,r=i=(O+E)/2),(o-=2*f)>O2?(e+=f*=A?1:-1,n-=f):(o=0,e=n=(O+E)/2)),u=k*b2(e),h=k*M2(e),f=M*b2(i),O=M*M2(i),s>O2&&(d=k*b2(n),p=k*M2(n),g=M*b2(r),y=M*M2(r),S<E2)&&((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<O2))return[t+(l=(o*(e-a)-s*(t-i))/l)*n,e+l*r]}(u,h,g,y,d,p,f,O))?(S=u-E[0],v=h-E[1],b=d-E[0],m=p-E[1],v=1/M2((1<(S=(S*b+v*m)/(k2(S*S+v*v)*k2(b*b+m*m)))?0:S<-1?E2:Math.acos(S))/2),b=k2(E[0]*E[0]+E[1]*E[1]),x=w2(s,(M-b)/(v-1)),w=w2(s,(k-b)/(1+v))):x=w=0),o>O2?w>O2?(l=G2(g,y,u,h,k,w,A),c=G2(d,p,f,O,k,w,A),R.moveTo(l.cx+l.x01,l.cy+l.y01),w<s?R.arc(l.cx,l.cy,w,v2(l.y01,l.x01),v2(c.y01,c.x01),!A):(R.arc(l.cx,l.cy,w,v2(l.y01,l.x01),v2(l.y11,l.x11),!A),R.arc(0,0,k,v2(l.cy+l.y11,l.cx+l.x11),v2(c.cy+c.y11,c.cx+c.x11),!A),R.arc(c.cx,c.cy,w,v2(c.y11,c.x11),v2(c.y01,c.x01),!A))):(R.moveTo(u,h),R.arc(0,0,k,e,n,!A)):R.moveTo(u,h),M>O2&&a>O2?x>O2?(l=G2(f,O,d,p,M,-x,A),c=G2(u,h,g,y,M,-x,A),R.lineTo(l.cx+l.x01,l.cy+l.y01),x<s?R.arc(l.cx,l.cy,x,v2(l.y01,l.x01),v2(c.y01,c.x01),!A):(R.arc(l.cx,l.cy,x,v2(l.y01,l.x01),v2(l.y11,l.x11),!A),R.arc(0,0,M,v2(l.cy+l.y11,l.cx+l.x11),v2(c.cy+c.y11,c.cx+c.x11),A),R.arc(c.cx,c.cy,x,v2(c.y11,c.x11),v2(c.y01,c.x01),!A))):R.arc(0,0,M,i,r,A):R.lineTo(f,O)):R.moveTo(0,0),R.closePath(),t)return R=null,t+""||null}return e.centroid=function(){var t=(+_.apply(this,arguments)+ +T.apply(this,arguments))/2,e=(+L.apply(this,arguments)+ +N.apply(this,arguments))/2-E2/2;return[b2(e)*t,M2(e)*t]},e.innerRadius=function(t){return arguments.length?(_="function"==typeof t?t:y2(+t),e):_},e.outerRadius=function(t){return arguments.length?(T="function"==typeof t?t:y2(+t),e):T},e.cornerRadius=function(t){return arguments.length?(P="function"==typeof t?t:y2(+t),e):P},e.padRadius=function(t){return arguments.length?(C=null==t?null:"function"==typeof t?t:y2(+t),e):C},e.startAngle=function(t){return arguments.length?(L="function"==typeof t?t:y2(+t),e):L},e.endAngle=function(t){return arguments.length?(N="function"==typeof t?t:y2(+t),e):N},e.padAngle=function(t){return arguments.length?(j="function"==typeof t?t:y2(+t),e):j},e.context=function(t){return arguments.length?(R=null==t?null:t,e):R},e}function V2(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function Y2(t){this._context=t}function q2(t){return new Y2(t)}function $2(t){return t[0]}function U2(t){return t[1]}function X2(o,s){var l=y2(!0),c=null,u=q2,h=null,f=I2(e);function e(t){var e,n,r,i=(t=V2(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?$2:y2(o),s="function"==typeof s?s:void 0===s?U2:y2(s),e.x=function(t){return arguments.length?(o="function"==typeof t?t:y2(+t),e):o},e.y=function(t){return arguments.length?(s="function"==typeof t?t:y2(+t),e):s},e.defined=function(t){return arguments.length?(l="function"==typeof t?t:y2(!!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 K2(u,h,f){var d=null,p=y2(!0),g=null,y=q2,m=null,v=I2(e);function e(t){var e,n,r,i,a,o=(t=V2(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 X2().defined(p).curve(y).context(g)}return u="function"==typeof u?u:void 0===u?$2:y2(+u),h="function"==typeof h?h:y2(void 0===h?0:+h),f="function"==typeof f?f:void 0===f?U2:y2(+f),e.x=function(t){return arguments.length?(u="function"==typeof t?t:y2(+t),d=null,e):u},e.x0=function(t){return arguments.length?(u="function"==typeof t?t:y2(+t),e):u},e.x1=function(t){return arguments.length?(d=null==t?null:"function"==typeof t?t:y2(+t),e):d},e.y=function(t){return arguments.length?(h="function"==typeof t?t:y2(+t),f=null,e):h},e.y0=function(t){return arguments.length?(h="function"==typeof t?t:y2(+t),e):h},e.y1=function(t){return arguments.length?(f=null==t?null:"function"==typeof t?t:y2(+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:y2(!!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}R2.prototype=j2.prototype,Y2.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 Z2=J2(q2);function Q2(t){this._curve=t}function J2(e){function t(t){return new Q2(e(t))}return t._curve=e,t}function tx(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(J2(t)):e()._curve},t}function ex(){}function nx(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 rx(t,e){this._context=t,this._k=(1-e)/6}function ix(t,e){this._context=t,this._k=(1-e)/6}function ax(t,e,n){var r,i,a=t._x1,o=t._y1,s=t._x2,l=t._y2;t._l01_a>O2&&(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>O2&&(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 ox(t,e){this._context=t,this._alpha=e}Q2.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))}},rx.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:nx(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:nx(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 rx(t,n)}return t.tension=function(t){return e(+t)},t}(0),ix.prototype={areaStart:ex,areaEnd:ex,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:nx(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 ix(t,n)}return t.tension=function(t){return e(+t)},t}(0),ox.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:ax(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 sx=function e(n){function t(t){return n?new ox(t,n):new rx(t,0)}return t.alpha=function(t){return e(+t)},t}(.5);function lx(t,e){this._context=t,this._alpha=e}lx.prototype={areaStart:ex,areaEnd:ex,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:ax(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 cx=function e(n){function t(t){return n?new lx(t,n):new ix(t,0)}return t.alpha=function(t){return e(+t)},t}(.5);function ux(t){this._context=t}function hx(t){return new ux(t)}function fx(t,e){this._context=t,this._t=e}function dx(t){return new fx(t,.5)}function px(t){return new fx(t,0)}function gx(t){return new fx(t,1)}function yx(t,e,n){return Math.max(e,Math.min(t,n))}function mx(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(!L0(r)&&!j0(r)){var m=!!C0(r),[v,,b]=m?Gb(e):e;const[O,M]=v;var[b,v]=Lb(b,v),x=(0<b?O:O+b)+s,w=(0<v?M:M+v)+l,b=Math.abs(b)-(s+c),s=Math.abs(v)-(l+u),c=m?b:yx(b,g,y),v=m?yx(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:k}=n;m=r.getCenter(),g=Hb(r,e,[M,k]),y=H2().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()}ux.prototype={areaStart:ex,areaEnd:ex,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))}},fx.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 vx=(E,t)=>{const{colorAttribute:S,first:A=!0,last:_=!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:k}=e;const O=[A?s:f,A?l:d,_?c:p,_?u:h];s=["radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft"],C0(P)&&s.push(s.shift()),f=Object.assign(Object.assign({radius:i},Object.fromEntries(s.map((t,e)=>[t,O[e]]))),{inset:g,insetLeft:y,insetRight:m,insetBottom:v,insetTop:b,minWidth:x,maxWidth:w});return lt(mx(C,t,e,P,f)).call(L,n).style("fill","transparent").style(S,r).style(Vb(E),k).style("lineWidth",a).style("stroke",void 0===o?r:o).call(L,M).node()}},bx=(vx.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(t,e)=>vx(Object.assign({colorAttribute:"fill"},t),e)),xx=(bx.props=Object.assign(Object.assign({},vx.props),{defaultMarker:"square"}),(t,e)=>vx(Object.assign({colorAttribute:"stroke"},t),e));xx.props=Object.assign(Object.assign({},vx.props),{defaultMarker:"hollowSquare"});const wx=(t,e)=>{const{adjustPoints:s=function(t,e,n){var[t,r,i,a]=t;if(C0(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]=!!C0(c)?Gb(i):i,{color:e=a,opacity:a}=e,t=X2().curve(hx)([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 Mx(t,e,n){var[t,r,i,a]=t;if(C0(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]}wx.props={defaultMarker:"square"};const kx=(t,e)=>wx(Object.assign({adjustPoints:Mx},t),e);function Ox(t){const e="function"==typeof t?t:t.render;return class extends ac{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){e(this)}}}kx.props={defaultMarker:"square"};const Ex=Ox(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 Sx=(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?Wb(a,o,s,h,f):r,o=Yb(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(L0(y)){const c=y.getCenter();l=n=>tx(X2().curve(Z2)).angle((t,e)=>Ib(Lb(n[e],c))).radius((t,e)=>jb(n[e],c)).defined(([t,e])=>d(t)&&d(e)).curve(u)(n)}else l=X2().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 Ex).style("style1",Object.assign(Object.assign({},s),n)).style("style2",s).style("d1",e.map(l).join(",")).style("d2",l(t))).node()}},Ax=(Sx.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(n,r)=>{const i=r["coordinate"];return(...t)=>{var e=L0(i)?hx:q2;return Sx(Object.assign({curve:e},n),r)(...t)}}),_x=(Ax.props=Object.assign(Object.assign({},Sx.props),{defaultMarker:"line"}),(t,n)=>{const{alpha:r=.5}=t,i=at(t,["alpha"]),a=n["coordinate"];return(...t)=>{var e=L0(a)?cx:sx;return Sx(Object.assign({curve:e.alpha(r)},i),n)(...t)}}),Tx=(_x.props=Object.assign(Object.assign({},Sx.props),{defaultMarker:"smooth"}),(t,e)=>Sx(Object.assign({curve:gx},t),e)),Px=(Tx.props=Object.assign(Object.assign({},Sx.props),{defaultMarker:"hv"}),(t,e)=>Sx(Object.assign({curve:px},t),e)),Cx=(Px.props=Object.assign(Object.assign({},Sx.props),{defaultMarker:"vh"}),(t,e)=>Sx(Object.assign({curve:dx},t),e));Cx.props=Object.assign(Object.assign({},Sx.props),{defaultMarker:"hvh"});const Lx=(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=R2();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(Ag)&&(r=p,m=m,v=v,s=a=i=h=u=c=l=s=o=i=a=i=void 0,i=(s=Rb(Lb(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=Nb(g,a),c=Nb(y,i),u=Nb(c,o),h=Lb(o=Nb(y,o),i),y=Lb(y,i),i=Lb(g,a),a=Lb(i,s),g=Lb(g,s),s=Lb(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()}};Lx.props=Object.assign(Object.assign({},Sx.props),{defaultMarker:"line"});Ks=(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"]],Ks.style=["fill"],Us=Ks.bind(void 0),Us.style=["stroke","lineWidth"],al=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]],al.style=["fill"],r=al.bind(void 0),r.style=["fill"],cu=al.bind(void 0),cu.style=["stroke","lineWidth"],nl=(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"]]},nl.style=["fill"],So=nl.bind(void 0),So.style=["stroke","lineWidth"],Co=(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"]]},Co.style=["fill"],Vo=Co.bind(void 0),Vo.style=["stroke","lineWidth"],fn=(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"]]},fn.style=["fill"],n=fn.bind(void 0),n.style=["stroke","lineWidth"],ii=(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"]]},ii.style=["fill"],s=ii.bind(void 0),s.style=["stroke","lineWidth"],Vs=(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"]]},Vs.style=["fill"],No=Vs.bind(void 0),No.style=["stroke","lineWidth"],Qs=(t,e,n)=>[["M",t,e+n],["L",t,e-n]],Qs.style=["stroke","lineWidth"],Ro=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]],Ro.style=["stroke","lineWidth"],_o=(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]],_o.style=["stroke","lineWidth"],zo=(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]],zo.style=["stroke","lineWidth"],qo=(t,e,n)=>[["M",t-n,e],["L",t+n,e]],qo.style=["stroke","lineWidth"],Uo=(t,e,n)=>[["M",t-n,e],["L",t+n,e]],Uo.style=["stroke","lineWidth"],Ko=Uo.bind(void 0),Ko.style=["stroke","lineWidth"],Qo=(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]],Qo.style=["stroke","lineWidth"],es=(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]],es.style=["stroke","lineWidth"],rs=(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]],rs.style=["stroke","lineWidth"],as=(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]],as.style=["stroke","lineWidth"],Es=(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]];Es.style=["stroke","lineWidth"];const Nx=new Map([["bowtie",Vs],["cross",Ro],["dash",Ko],["diamond",nl],["dot",Uo],["hexagon",ii],["hollowBowtie",No],["hollowDiamond",So],["hollowHexagon",s],["hollowPoint",Us],["hollowSquare",cu],["hollowTriangle",Vo],["hollowTriangleDown",n],["hv",es],["hvh",as],["hyphen",qo],["line",Qs],["plus",zo],["point",Ks],["rect",r],["smooth",Qo],["square",al],["tick",_o],["triangleDown",fn],["triangle",Co],["vh",rs],["vhv",Es]]);const jx=(c,t)=>{const{colorAttribute:u,symbol:e,mode:h="auto"}=c,f=at(c,["colorAttribute","symbol","mode"]),d=Nx.get(e)||Nx.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]=qb(t),t=function(t,e,n,r){var i;if(1!==e.length)return n=n["size"],"fixed"!==t&&("normal"===t||I0(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(Vb(c),o).style(u,i).call(L,f).node()}},Rx=(jx.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(t,e)=>jx(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t),e)),Ix=(Rx.props=Object.assign({defaultMarker:"bowtie"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"stroke",symbol:"cross"},t),e)),Bx=(Ix.props=Object.assign({defaultMarker:"cross"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"fill",symbol:"diamond"},t),e)),Dx=(Bx.props=Object.assign({defaultMarker:"diamond"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t),e)),Fx=(Dx.props=Object.assign({defaultMarker:"hexagon"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t),e)),zx=(Fx.props=Object.assign({defaultMarker:"hollowBowtie"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t),e)),Wx=(zx.props=Object.assign({defaultMarker:"hollowDiamond"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t),e)),Gx=(Wx.props=Object.assign({defaultMarker:"hollowHexagon"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"stroke",symbol:"point"},t),e)),Hx=(Gx.props=Object.assign({defaultMarker:"hollowPoint"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"stroke",symbol:"square"},t),e)),Vx=(Hx.props=Object.assign({defaultMarker:"hollowSquare"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t),e)),Yx=(Vx.props=Object.assign({defaultMarker:"hollowTriangle"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t),e)),qx=(Yx.props=Object.assign({defaultMarker:"hollowTriangleDown"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t),e)),$x=(qx.props=Object.assign({defaultMarker:"hyphen"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"stroke",symbol:"line"},t),e)),Ux=($x.props=Object.assign({defaultMarker:"line"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"stroke",symbol:"plus"},t),e)),Xx=(Ux.props=Object.assign({defaultMarker:"plus"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"fill",symbol:"point"},t),e)),Kx=(Xx.props=Object.assign({defaultMarker:"point"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"fill",symbol:"square"},t),e)),Zx=(Kx.props=Object.assign({defaultMarker:"square"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"stroke",symbol:"tick"},t),e)),Qx=(Zx.props=Object.assign({defaultMarker:"tick"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"fill",symbol:"triangle"},t),e)),Jx=(Qx.props=Object.assign({defaultMarker:"triangle"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t),e)),tw=(Jx.props=Object.assign({defaultMarker:"triangleDown"},jx.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=R2();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*jb(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 ew(t){rw(t,!0)}function nw(t){rw(t,!1)}function rw(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)})}tw.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};t(ow,iw=hc);var iw,aw=ow;function ow(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=iw.apply(this,M([],j(t),!1))||this;return n.addEventListener(b.INSERTED,function(){nw(n)}),n}function sw(t){t=t.appendChild(new aw({class:"offscreen"}));return nw(t),t}t(uw,lw=Rc),Object.defineProperty(uw.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=sw(this)),this._offscreen},enumerable:!1,configurable:!0}),uw.prototype.disconnectedCallback=function(){var t;null!=(t=this._offscreen)&&t.destroy()};var lw,cw=uw;function uw(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return lw.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 hw(t){return t*Math.PI/180}function fw(t){return Number((180*t/Math.PI).toPrecision(5))}Object.defineProperty(pw.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(pw.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(pw.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(pw.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),pw.fromRect=function(t){return new pw(t.x,t.y,t.width,t.height)},pw.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 dw=pw;function pw(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 gw(t,e){return Ce(t)?t.apply(void 0,M([],j(e),!1)):t}function yw(t,e){function r(t){return"".concat(e,"-").concat(t)}return t=Object.fromEntries(Object.entries(t).map(function(t){var t=j(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 mw(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)bw(t,e[r]);return t}var vw,bw=function(r,i,a,o){void 0===a&&(a=0),void 0===o&&(o=5),Object.entries(i).forEach(function(t){var t=j(t,2),e=t[0],t=t[1],n=r;Object.prototype.hasOwnProperty.call(i,e)&&(t?Be(t)?(Be(r[e])||(n[e]={}),a<o?bw(r[e],t,a+1,o):n[e]=i[e]):je(t)?(n[e]=[],n[e]=n[e].concat(t)):n[e]=t:n[e]=t)})},xw=function(t){return void 0!==t&&null!=t&&!Number.isNaN(t)},ww=tn(function(t,e){var n=We(t)?t:t.style.text.toString(),e=e||Mw(t),t=e.fontSize,r=e.fontFamily,i=e.fontWeight,a=e.fontStyle,e=e.fontVariant;return(vw=vw||document.createElement("canvas").getContext("2d")).font=[a,e,i,"".concat(t,"px"),r].join(" "),vw.measureText(n).width},function(t,e){return[We(t)?t:t.style.text.toString(),Object.values(e||Mw(t)).join()].join("")}),Mw=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 kw(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function Ow(t,e){t=kw(t);t&&t.attr(e)}function Ew(t,e,n){Ow(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n=void 0===n?"...":n})}function Sw(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 Aw(t){return"function"==typeof t?t():We(t)||He(t)?new cw({style:{text:String(t)}}):t}function _w(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 Tw(t,e,n,r,i){return(r=void 0===r?!0:r)&&t===e||i&&t===n||e<t&&t<n}var Pw=function(e,n){return function(t){return e*(1-t)+n*t}};function Cw(e,t){var i,a,o,s,n,r,l;return"number"==typeof e&&"number"==typeof t?Pw(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]=Cw(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=j(t,2),e=t[0],t=t[1];e in n?r[e]=Cw(n[e],t):l[e]=t}),function(n){return Object.entries(r).forEach(function(t){var t=j(t,2),e=t[0],t=t[1];return l[e]=t(n)}),l}):function(t){return e}}function Lw(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=j([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 dw(e,n,r-e,i-n)}function Nw(n,t,e){function r(t){var e=j(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=j([0,0],2))[0],d=s[1],e=Lw(o=t.map(function(t){var e=t.width,t=t.height,n=j([f,d],2),r=n[0],n=n[1],i=j([f+e*h[0],d+t*h[1]],2);return f=i[0],d=i[1],new dw(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 Lw(s=o.map(function(t){var e=t.x,n=t.y,t=dw.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=dw.fromRect(t);return t.x=u?e:e+r(t),t.y=u?n+r(t):n,t}).map(function(t){var e,t=dw.fromRect(t);return t.x+=null!=(e=n.x)?e:0,t.y+=null!=(e=n.y)?e:0,t})}function jw(t,e,n){return[]}function Rw(t,e){return[t[0]*e,t[1]*e]}function Iw(t,e){return[t[0]+e[0],t[1]+e[1]]}function Bw(t,e){return[t[0]-e[0],t[1]-e[1]]}function Dw(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function Fw(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function zw(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function Ww(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 Gw(t,e){e=Math.pow(10,e);return~~(t*e)/e}function Hw(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 Vw(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=j(r,2))[0],l=r[1];for(var c=0,u=t.length;c<u;c+=1)s=Dw(s,x=t[c]),l=Fw(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=Rw(m=Bw(d=t[n?(c+1)%h:c+1],f),e),0!==(y=(p=zw(x,f))+(g=zw(x,d)))&&(p/=y,g/=y),y=Rw(m,-p),m=Rw(m,g),v=Iw(x,y),b=Dw(b=Iw(x,m),Fw(d,x)),b=Fw(b,Dw(d,x)),v=Dw(v=Iw(x,y=Rw(y=Bw(b,x),-p/g)),Fw(f,x)),b=Iw(x,m=Rw(m=Bw(x,v=Fw(v,Dw(f,x))),g/p)),o&&(v=Dw(v=Fw(v,s),l),b=Dw(b=Fw(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=j(r,1)[0],h.push(["C",o[0],o[1],s[0],s[1],l[0],l[1]])),h}var Yw=["$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 qw(t){var e,n,r={};for(e in t)n=e,Yw.includes(n)&&(r[e]=t[e]);return r}function $w(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)}O.prototype.selectAll=function(t){return new O("string"==typeof t?this._parent.querySelectorAll(t):t,null,this._elements[0],this._document)},O.prototype.selectFacetAll=function(t){t="string"==typeof t?this._parent.querySelectorAll(t):t;return new O(this._elements,null,this._parent,this._document,void 0,void 0,t)},O.prototype.select=function(t){t="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new O([t],null,t,this._document)},O.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=j(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 O(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 O(r,null,r[0],this._document)},O.prototype.maybeAppend=function(t,e){e=B(this,Uw,"m",Xw).call(this,"#"===t[0]?t:"#".concat(t),e);return e.attr("id",t),e},O.prototype.maybeAppendByClassName=function(t,e){t=t.toString(),e=B(this,Uw,"m",Xw).call(this,"."===t[0]?t:".".concat(t),e);return e.attr("className",t),e},O.prototype.maybeAppendByName=function(t,e){e=B(this,Uw,"m",Xw).call(this,'[name="'.concat(t,'"]'),e);return e.attr("name",t),e},O.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=e0(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 O([],a,this._parent,this._document),new O(o,null,this._parent,this._document),new O(s,null,this._parent,this._document),new O([],l,this._parent,this._document),new O(c,null,this._parent,this._document)];return new O(this._elements,null,this._parent,this._document,w)},O.prototype.merge=function(t){var e=M(M([],j(this._elements),!1),j(t._elements),!1),t=M(M([],j(this._transitions),!1),j(t._transitions),!1);return new O(e,null,this._parent,this._document,void 0,t)},O.prototype.createElement=function(t){if(this._document)return this._document.createElement(t,{});var e=O.registry[t];if(e)return new e;throw e="Unknown node type: ".concat(t),new Error(e)},O.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)},O.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 O([],null,this._parent,this._document,void 0,this._transitions)},O.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},O.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))})},O.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))})},O.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=j(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))})})},O.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))})},O.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))})},O.prototype.transition=function(n){var r=this._transitions;return this.each(function(t,e){r[e]=n.call(this,t,e)})},O.prototype.on=function(t,e){return this.each(function(){this.addEventListener(t,e)}),this},O.prototype.call=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t.call.apply(t,M([this._parent,this],j(e),!1)),this},O.prototype.node=function(){return this._elements[0]},O.prototype.nodes=function(){return this._elements},O.prototype.transitions=function(){return this._transitions.filter(function(t){return!!t})},O.prototype.parent=function(){return this._parent},Uw=new WeakSet,Xw=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 O([t],null,this._parent,this._document)},O.registry={g:hc,rect:Lc,circle:nc,path:kc,text:cw,ellipse:lc,image:mc,line:xc,polygon:Sc,polyline:Tc,html:pc};var Uw,Xw,Kw=O;function O(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=[]),Uw.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 Kw([t],null,t,t.ownerDocument)}function Zw(t,e,n){return t.querySelector(e)?x(t).select(e):x(t).append(n)}function Qw(t){if(He(t))return[t,t,t,t];if(je(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 Jw(t){var t=t.getLocalBounds(),t=j([t.min,t.max],2),e=j(t[0],2),n=e[0],e=e[1],t=j(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 tM(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function eM(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=j(t,2),n=t[0],t=t[1];"className"!==n&&"class"!==n&&(n.startsWith("show")&&eM(n,"show").startsWith(r)!==i?n===(e=r,"".concat("show").concat(tM(e)))?a[n]=t:a[n.replace(new RegExp(tM(r)),"")]=t:n.startsWith("show")||n.startsWith(r)===i||"filter"===(e=eM(n,r))&&"function"==typeof t||(a[e]=t))}),a}function nM(t,r){return Object.entries(t).reduce(function(t,e){var e=j(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(tM(n))]=e,t},{})}function rM(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=j(t,2),e=t[0],t=t[1];n.includes(e)||(-1!==r.indexOf(e)?a[e]=t:i[e]=t)}),[i,a]}function iM(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=j([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(oM,aM=ac),Object.defineProperty(oM.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=sw(this)),this._offscreen},enumerable:!1,configurable:!0}),Object.defineProperty(oM.prototype,"defaultOptions",{get:function(){return this._defaultOptions},enumerable:!1,configurable:!0}),oM.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this),this.initialized=!0},oM.prototype.disconnectedCallback=function(){var t;null!=(t=this._offscreen)&&t.destroy()},oM.prototype.attributeChangedCallback=function(t){"visibility"===t&&!function(){rw(this,"hidden"!==this.attributes.visibility)}.call(this)},oM.prototype.update=function(t,e){return this.attr(mw({},this.attributes,t=void 0===t?{}:t)),null==(t=this.render)?void 0:t.call(this,this.attributes,this,e)},oM.prototype.clear=function(){this.removeChildren()},oM.prototype.bindEvents=function(t,e){};var aM,Fs=oM;function oM(t,e){t=aM.call(this,mw({},{style:e=void 0===e?{}:e},t))||this;return t.initialized=!1,t._defaultOptions=e,t}function sM(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 lM(t,e,n){return[["M",t,e+n],["L",t,e-n]]}function cM(t,e,n){return[["M",t-n,e],["L",t+n,e]]}zs=sM,Go=cM;function uM(t){n="default",Re(e=t)&&e instanceof Image?n="image":Ce(e)?n="symbol":We(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(dM,hM=Fs),dM.prototype.render=function(t,e){var r=t.symbol,n=t.size,i=void 0===n?16:n,a=at(t,["symbol","size"]),o=uM(r);_w(!!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=Ce(r)?r:dM.getSymbol(r),t.styles(m({path:null==n?void 0:n(0,0,e)},a)))})})},dM.MARKER_SYMBOL_MAP=new Map,dM.registerSymbol=function(t,e){dM.MARKER_SYMBOL_MAP.set(t,e)},dM.getSymbol=function(t){return dM.MARKER_SYMBOL_MAP.get(t)};var hM,fM=dM;function dM(){return null!==hM&&hM.apply(this,arguments)||this}fM.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]]}),fM.registerSymbol("hyphen",function(t,e,n){return[["M",t-n,e],["L",t+n,e]]}),fM.registerSymbol("line",lM),fM.registerSymbol("plus",function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]}),fM.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]]}),fM.registerSymbol("circle",sM),fM.registerSymbol("point",zs),fM.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"]]}),fM.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"]]}),fM.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"]]}),fM.registerSymbol("diamond",function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]}),fM.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"]]}),fM.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"]]}),fM.registerSymbol("line",lM),fM.registerSymbol("dot",cM),fM.registerSymbol("dash",Go),fM.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]]}),fM.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]]}),fM.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]]}),fM.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]]}),fM.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(yM,pM=Jl),yM.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()})},yM.prototype.update=function(t){this.attr(mw({},this.attributes,t)),this.render()},yM.prototype.clear=function(){this.removeChildren()};var pM,gM=yM;function yM(t){var e=this,n=t.style,t=at(t,["style"]);return(e=pM.call(this,ot({},{type:"column"},m({style:n},t)))||this).columnsGroup=new hc({name:"columns"}),e.appendChild(e.columnsGroup),e.render(),e}t(bM,mM=Jl),bM.prototype.render=function(){var t=this.attributes,e=t.lines,t=t.areas;e&&this.renderLines(e),t&&this.renderAreas(t)},bM.prototype.clear=function(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()},bM.prototype.update=function(t){this.attr(mw({},this.attributes,t)),this.render()},bM.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()})},bM.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 mM,vM=bM;function bM(t){var e=this,n=t.style,t=at(t,["style"]);return(e=mM.call(this,ot({},{type:"lines"},m({style:n},t)))||this).linesGroup=e.appendChild(new hc),e.areasGroup=e.appendChild(new hc),e.render(),e}function xM(t,e){var n=(e=void 0===e?!1:e)?t.length-1:0,t=t.map(function(t,e){return M([e===n?"M":"L"],j(t),!1)});return e?t.reverse():t}function wM(t,e){if(void 0===e&&(e=!1),t.length<=2)return xM(t);for(var n=[],r=t.length,i=0;i<r;i+=1){var a=e?t[r-i-1]:t[i];on(a,n.slice(-2))||n.push.apply(n,M([],j(a),!1))}var o=Vw(n,!1);return e?o.unshift(M(["M"],j(t[r-1]),!1)):o.unshift(M(["M"],j(t[0]),!1)),o}function MM(t,e,n){t=Qe(t);return t.push(["L",e,n],["L",0,n],["Z"]),t}function kM(t){return 0===t.length?[0,0]:[Fe(function(t,e){if(je(t)){for(var n,r=1/0,i=0;i<t.length;i++){var a=t[i],o=Ce(e)?e(a):a[e];o<r&&(n=a,r=o)}return n}}(t,function(t){return Fe(t)||0})),De(function(t,e){if(je(t)){for(var n,r=-1/0,i=0;i<t.length;i++){var a=t[i],o=Ce(e)?e(a):a[e];r<o&&(n=a,r=o)}return n}}(t,function(t){return De(t)||0}))]}function OM(t){for(var e=Qe(t),n=e[0].length,t=j([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(AM,EM=Fs),Object.defineProperty(AM.prototype,"rawData",{get:function(){var t=this.attributes.data;return t&&0!==(null==t?void 0:t.length)?(t=Qe(t),He(t[0])?[t]:t):[[]]},enumerable:!1,configurable:!0}),Object.defineProperty(AM.prototype,"data",{get:function(){return this.attributes.isStack?OM(this.rawData):this.rawData},enumerable:!1,configurable:!0}),Object.defineProperty(AM.prototype,"scales",{get:function(){return this.createScales(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(AM.prototype,"baseline",{get:function(){var t=this.scales.y,e=j(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(AM.prototype,"containerShape",{get:function(){var t=this.attributes;return{width:t.width,height:t.height}},enumerable:!1,configurable:!0}),Object.defineProperty(AM.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=j(s.getOptions().range||[0,0],2))[0],c=u[1],l<c&&(u=j([l,c],2),c=u[0],l=u[1]),a=e.map(function(t){return t.map(function(t,e){return[o.map(e),Ge(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=wM(o),l=void 0,l=0===i?MM(s,e,n):(a=wM(t[i-1],!0),o=o[0],a[0][0]="L",M(M(M([],j(s),!1),j(a),!1),[M(["M"],j(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=xM(t[i]),s=void 0,s=0===i?MM(o,e,n):((a=xM(t[i-1],!0))[0][0]="L",M(M(M([],j(o),!1),j(a),!1),[["Z"]],!1));r.push(s)}return r})(a,t,e):(h=i,f=t,d=e,a.map(function(t){return MM((h?wM:xM)(t),f,d)}))),{lines:a.map(function(t,e){return m({stroke:n.getColor(e),path:(i?wM:xM)(t)},g)}),areas:u.map(function(t,e){return m({path:t,fill:n.getColor(e)},p)})})},enumerable:!1,configurable:!0}),Object.defineProperty(AM.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=OM(s));var e=this.createScales(s),l=e.x,c=e.y,e=j(kM(s),2),n=e[0],e=e[1],u=new eb({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}),AM.prototype.render=function(t,e){this.container=Zw(e,".container","rect").attr("className","container").node();var n=t.type,r="spark".concat(n),i="line"===n?this.linesStyle:this.columnsStyle;this.spark=Zw(e,".".concat(r),function(){return new("line"===n?vM:gM)({className:r,style:i})}).styles(i).node()},AM.prototype.getColor=function(t){var e=this.attributes.color;return je(e)?e[t%e.length]:Ce(e)?e.call(null,t):e},AM.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=j(kM(t),2),c=l[0],l=l[1],c=new eb({domain:[null!=(e=i[0])?e:c,null!=(e=i[1])?e:l],range:[o,0]});return"line"===r?{type:r,x:new eb({domain:[0,t[0].length-1],range:[0,s]}),y:c}:{type:r,x:new Hv({domain:t[0].map(function(t,e){return e}),range:[0,s],paddingInner:a?n:0}),y:c}},AM.tag="sparkline";var EM,SM=AM;function AM(t){return EM.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 _M(n){var e,r;return n?(e=["enter","update","exit"],r=Object.fromEntries(Object.entries(n).filter(function(t){t=j(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 TM(t,e){t?t.finished.then(e):e()}function PM(t,e){"update"in t?t.update(e):t.attr(e)}function CM(t,e,n){return 0===e.length?null:n?t.animate(e,n):(PM(t,{style:e.slice(-1)[0]}),null)}function LM(r,t,e){var i={},a={};return Object.entries(t).forEach(function(t){var e,t=j(t,2),n=t[0],t=t[1];A(t)||(e=r.style[n]||r.parsedStyle[n]||0)!==t&&(i[n]=e,a[n]=t)}),e?CM(r,[i,a],m({fill:"both"},e)):(PM(r,a),null)}function NM(t,e){return t.style.opacity||(t.style.opacity=1),LM(t,{opacity:0},e)}var jM,RM={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},IM={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},BM={orientation:"horizontal",showLabel:!0,type:"start"},DM=yw({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track"},"slider"),FM=yw({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),zM=(t(WM,jM=Fs),WM.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(FM.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(FM.iconLine,"-1"),"line").styles(m({x1:o,x2:o,y1:l,y2:c},t)),r.maybeAppendByClassName("".concat(FM.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)},WM);function WM(){return null!==jM&&jM.apply(this,arguments)||this}t(VM,GM=Fs),VM.prototype.renderLabel=function(t){var e=this,n=this.attributes.showLabel,r=w(this.attributes,"label"),i=r.transform,r=j(rM(at(r,["transform"]),[]),2),a=r[0],r=r[1],t=x(t).maybeAppendByClassName(FM.labelGroup,"g").styles(r),r=m(m({},IM),a),o=r.text,s=at(r,["text"]);_w(!!n,t,function(t){e.label=t.maybeAppendByClassName(FM.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()})})},VM.prototype.renderIcon=function(t){var e=this.attributes.orientation,n=m(m({orientation:e},RM),w(this.attributes,"icon")),e=this.attributes.iconShape,r=void 0===e?function(){return new zM({style:n})}:e;x(t).maybeAppendByClassName(FM.iconGroup,"g").selectAll(FM.icon.class).data([r]).join(function(t){return t.append(r).attr("className",FM.icon.name)},function(t){return t.update(n)},function(t){return t.remove()})},VM.prototype.render=function(t,e){this.renderIcon(e),this.renderLabel(e)};var GM,HM=VM;function VM(t){return GM.call(this,t,BM)||this}t($M,YM=Fs),Object.defineProperty($M.prototype,"values",{get:function(){return this.attributes.values},set:function(t){this.attributes.values=this.clampValues(t)},enumerable:!1,configurable:!0}),Object.defineProperty($M.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($M.prototype,"shape",{get:function(){var t=this.attributes,e=t.trackLength,t=t.trackSize,t=j(this.getOrientVal([[e,t],[t,e]]),2);return{width:t[0],height:t[1]}},enumerable:!1,configurable:!0}),Object.defineProperty($M.prototype,"availableSpace",{get:function(){var t=j(Qw(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}),$M.prototype.getValues=function(){return this.values},$M.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;LM(this.selectionShape.node(),this.selectionStyle,t),this.updateHandlesPosition(t)},$M.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(LM(this.startHandle,this.getHandleStyle("start"),t),LM(this.endHandle,this.getHandleStyle("end"),t))},$M.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)},$M.prototype.renderTrack=function(t){var e=this.attributes.brushable,n=w(this.attributes,"track");this.trackShape=x(t).maybeAppendByClassName(DM.track,"rect").styles(m(m({cursor:e?"crosshair":"default"},this.shape),n))},$M.prototype.renderSparkline=function(t){var n=this;_w("horizontal"===this.attributes.orientation,x(t).maybeAppendByClassName(DM.sparklineGroup,"g"),function(t){var e=n.sparklineStyle;t.maybeAppendByClassName(DM.sparkline,function(){return new SM({style:e})}).update(e)})},Object.defineProperty($M.prototype,"selectionStyle",{get:function(){var t=w(this.attributes,"selection");return m(m({},t),this.calcMask())},enumerable:!1,configurable:!0}),$M.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(DM.handle.class).data(n,function(t){return t.type}).join(function(t){return t.append(function(t){t=t.type;return new HM({style:e.getHandleStyle(t)})}).each(function(t){var e=t.type,t=(this.attr("class","".concat(DM.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()})},$M.prototype.renderSelection=function(t){this.foregroundGroup=x(t).maybeAppendByClassName(DM.foreground,"g"),this.selectionShape=this.foregroundGroup.maybeAppendByClassName(DM.selection,"rect").styles(this.selectionStyle),this.renderHandles()},$M.prototype.render=function(t,e){this.renderTrack(e),this.renderSparkline(e),this.renderSelection(e)},$M.prototype.clampValues=function(t,e){void 0===e&&(e=4);var n=j(this.range,2),r=n[0],n=n[1],i=j(this.getValues().map(function(t){return Gw(t,e)}),2),a=i[0],i=i[1],t=j((t||[a,i]).map(function(t){return Gw(t,e)}),2),o=t[0],t=t[1],s=(t<o&&(o=(s=j([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]},$M.prototype.calcMask=function(t){var t=j(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}])},$M.prototype.calcHandlePosition=function(t){var e=this.availableSpace,n=e.x,r=e.y,i=e.width,e=e.height,a=j(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])}},$M.prototype.inferTextStyle=function(t){return"horizontal"===this.attributes.orientation?{}:"start"===t?{transform:"rotate(90)",textAlign:"start"}:"end"===t?{transform:"rotate(90)",textAlign:"end"}:{}},$M.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 cw({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)},$M.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))):{}},$M.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)},$M.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({},nM(this.getHandleIconStyle(),"icon")),nM(m(m({},this.getHandleLabelStyle(t)),i),"label")),r),{orientation:e,showLabel:n,type:t,zIndex:3})},$M.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)},$M.prototype.getOrientVal=function(t){var t=j(t,2),e=t[0],t=t[1];return"horizontal"===this.attributes.orientation?e:t},$M.prototype.setValuesOffset=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=!1);var r=j(this.getValues(),2),t=[r[0]+t,r[1]+e].sort();n?this.setValues(t):this.innerSetValues(t,!0)},$M.prototype.getRatio=function(t){var e=this.availableSpace,n=e.width,e=e.height;return t/this.getOrientVal([n,e])},$M.prototype.dispatchCustomEvent=function(t,e,n){var r=this;t.on(e,function(t){t.stopPropagation(),r.dispatchEvent(new pl(n,{detail:t}))})},$M.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"))},$M.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))},$M.tag="slider";var YM,qM=$M;function $M(t){var a=YM.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]},nM(BM,"handle")),nM(RM,"handleIcon")),nM(IM,"handleLabel")))||this;return a.range=[0,1],a.onDragStart=function(i){return function(t){t.stopPropagation(),a.target=i,a.prevPos=a.getOrientVal(Sw(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(Sw(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 pl("valuechange",{detail:{oldValue:t,value:a.getValues()}});a.dispatchEvent(t)},a.selectionStartPos=0,a.selectionWidth=0,a.prevPos=0,a.target="",a}t(KM,UM=Fs),Object.defineProperty(KM.prototype,"padding",{get:function(){return Qw(this.attributes.padding)},enumerable:!1,configurable:!0}),Object.defineProperty(KM.prototype,"value",{get:function(){var t=this.attributes.value,e=j(this.range,2),n=e[0],e=e[1];return Ge(t,n,e)},enumerable:!1,configurable:!0}),Object.defineProperty(KM.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(KM.prototype,"availableSpace",{get:function(){var t=this.attributes.trackSize,e=this.trackLength,n=j(this.padding,4),r=n[0],i=n[1],a=n[2],n=n[3],t=j(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(KM.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(KM.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}),KM.prototype.getValues=function(t){void 0===t&&(t=this.value);var e=this.attributes,e=e.viewportLength/e.contentLength,n=j(this.range,2),r=n[0],t=t*(n[1]-r-e);return[t,t+e]},KM.prototype.getValue=function(){return this.value},KM.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()},nM(a,"track")),nM(o,"selection"));this.slider=x(t).maybeAppendByClassName("scrollbar",function(){return new qM({style:s})}).update(s).node()},KM.prototype.render=function(t,e){this.renderSlider(e)},KM.prototype.setValue=function(t,e){void 0===e&&(e=!1);var n=this.attributes.value,r=j(this.range,2),i=r[0],r=r[1];this.slider.setValues(this.getValues(Ge(t,i,r)),e),this.onValueChange(n)},KM.prototype.bindEvents=function(){var e=this;this.slider.addEventListener("trackClick",function(t){t.stopPropagation(),e.onTrackClick(t.detail)}),this.onHover()},KM.prototype.getOrientVal=function(t){return"horizontal"===this.attributes.orientation?t[0]:t[1]},KM.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)},KM.tag="scrollbar";var UM,XM=KM;function KM(t){var a=UM.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 pl("scroll",t={detail:{oldValue:t,value:e}})),a.dispatchEvent(new pl("valuechange",t)))},a.onTrackClick=function(t){var e,n,r,i;a.attributes.slidable&&(r=(e=j(a.getLocalPosition(),2))[0],e=e[1],n=(i=j(a.padding,4))[0],i=i[3],r=a.getOrientVal([r+i,e+n]),i=(a.getOrientVal(Sw(t))-r)/a.trackLength,a.setValue(i,!0))},a.onThumbMouseenter=function(t){a.dispatchEvent(new pl("thumbMouseenter",{detail:t.detail}))},a.onTrackMouseenter=function(t){a.dispatchEvent(new pl("trackMouseenter",{detail:t.detail}))},a.onThumbMouseleave=function(t){a.dispatchEvent(new pl("thumbMouseleave",{detail:t.detail}))},a.onTrackMouseleave=function(t){a.dispatchEvent(new pl("trackMouseleave",{detail:t.detail}))},a}var ZM={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 kc({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:[]},QM=(ot({},ZM,{style:{type:"arc"}}),ot({},ZM,{style:{}}),yw({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")),JM=yw({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function tk(t){return t.reduce(function(t,e,n){return t.push(M([0===n?"M":"L"],j(e),!1)),t},[])}function ek(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)?tk(r):e?(i=zw(r[0],e),a=n?0:1,r.reduce(function(t,e,n){return 0===n?t.push(M(["M"],j(e),!1)):t.push(M(["A",i,i,0,0,a],j(e),!1)),t},[])):[]):tk(t)}function nk(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=j([ek(t,n),ek(e.slice().reverse(),n,!0)],2),l=n[0],c=n[1],n=j([t[0],e.slice(-1)[0]],2),t=n[0],e=n[1];if("line"===a||"surround"===i)return r([M(["L"],j(e),!1)],[M(["L"],j(t),!1)]);if(o)return a=(n=j([zw(e,o),zw(t,o)],2))[0],i=n[1],r([M(["A",a,a,0,0,1],j(e),!1),M(["L"],j(e),!1)],[M(["A",i,i,0,0,0],j(t),!1),M(["L"],j(t),!1)]);throw new Error("Arc grid need to specified center")}function rk(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=j([e[l].points,e[l+1].points],2),c=nk(c[0],c[1],n);s.push({path:c,fill:o[l%o.length]})}return t.selectAll(JM.region.class).data(s,function(t,e){return e}).join(function(t){return t.append("path").each(function(t,e){t=gw(t,[t,e,s]);this.attr(t)}).attr("className",JM.region.name)},function(t){return t.transition(function(t,e){return LM(this,gw(t,[t,e,s]),r.update)})},function(t){return t.transition(function(){var t=this,e=NM(this,r.exit);return TM(e,function(){return t.remove()}),e})}).transitions()}t(ok,ik=Fs),ok.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=j(e,1)[0];return m(m({},t),{points:M(M([],j(e),!1),[n],!1)})}):s),l=x(e).maybeAppendByClassName(JM.lineGroup,"g"),e=x(e).maybeAppendByClassName(JM.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:ek(t.points,n)}}),l.selectAll(JM.line.class).data(a,function(t){return t.id}).join(function(t){return t.append("path").each(function(t,e){t=gw(qw(m({path:t.path},r)),[t,e,a]);this.attr(m({class:JM.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4]},t))})},function(t){return t.transition(function(t,e){return LM(this,gw(qw(m({path:t.path},r)),[t,e,a]),i.update)})},function(t){return t.transition(function(){var t=this,e=NM(this,i.exit);return TM(e,function(){return t.remove()}),e})}).transitions()),l=rk(e,s,t);return M(M([],j(o),!1),j(l),!1)};var ik,ak=ok;function ok(){return null!==ik&&ik.apply(this,arguments)||this}function sk(t,e){return Object.fromEntries(Object.entries(t).map(function(t){t=j(t,2);return[t[0],gw(t[1],e)]}))}function lk(t,e){return e&&Ce(e)?t.filter(e):t}var ck=tn(function(t,e){var n=e.startAngle;return(e.endAngle-n)*t+n},function(t,e){return[t,e.startAngle,e.endAngle].join()}),uk=tn(function(t,e){var n,r,i;return"linear"===e.type?(r=(n=j(e.startPos,2))[0],n=n[1],i=j(e.endPos,2),Ww([(r=j([i[0]-r,i[1]-n],2))[0],r[1]])):(i=hw(ck(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,M(M([],j(a),!1),j(r),!1)):(a=n.startAngle,r=n.endAngle,i=n.center,n=n.radius,M(M([a,r],j(i),!1),[n],!1));return"arc"===e.type&&a.push(t),a.join()});function hk(t,e,n){t=uk(t,n);return n=t,"positive"!==e?[n[1],-n[0]]:[-n[1],n[0]]}function fk(t,e){return hk(t,e.labelDirection,e)}var dk=tn(function(t,e){var n=j(e.startPos,2),r=n[0],n=n[1],e=j(e.endPos,2),e=j([e[0]-r,e[1]-n],2);return[r+e[0]*t,n+e[1]*t]},function(t,e){return M(M([t],j(e.startPos),!1),j(e.endPos),!1).join()}),pk=tn(function(t,e){var n=e.radius,r=j(e.center,2),i=r[0],r=r[1],t=hw(ck(t,e));return[i+n*Math.cos(t),r+n*Math.sin(t)]},function(t,e){return M([t,e.startAngle,e.endAngle,e.radius],j(e.center),!1).join()});function gk(t,e){return("linear"===e.type?dk:pk)(t,e)}function yk(t){return 0===uk(0,t)[1]}function mk(t){return 0===uk(0,t)[0]}function vk(t,e){return e-t==360}function bk(t,e,n,r,i){function a(t){return[n+i*Math.cos(t),r+i*Math.sin(t)]}var o=e-t,s=j([i,i],2),l=s[0],s=s[1],c=j([hw(t),hw(e)],2),u=c[0],c=c[1],h=j(a(u),2),f=h[0],h=h[1],d=j(a(c),2),p=d[0],d=d[1];return vk(t,e)?[["M",f,h],["A",l,s,0,1,0,(c=j(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 xk(t,e,n,s){var l=e.startAngle,c=e.endAngle,u=e.center,h=e.radius;return t.selectAll(QM.line.class).data([{path:bk.apply(void 0,M(M([l,c],j(u),!1),[h],!1))}],function(t,e){return e}).join(function(t){return t.append("path").attr("className",QM.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=M(M([o,e],j(n),!1),[i],!1),e=M(M([l,c],j(u),!1),[h],!1),(n=s.update)?(i=void 0===(i=n.duration)?0:i,r=Cw(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=sn(a.attributes,"__keyframe_data__");a.style.path=bk.apply(void 0,M([],j(t),!1))},o.onfinish=i),o}).styles(e)},function(t){return t.remove()}).styles(n).transitions()}function wk(t){var t=j(t,2),e=j(t[0],2),n=e[0],e=e[1],t=j(t[1],2);return{x1:n,y1:e,x2:t[0],y2:t[1]}}function Mk(e,t,n,r){function i(t){return e.selectAll(QM.line.class).data(t,function(t,e){return e}).join(function(t){return t.append("line").attr("className",function(t){return"".concat(QM.line.name," ").concat(t.className)}).styles(n).transition(function(t){return LM(this,wk(t.line),!1)})},function(t){return t.styles(n).transition(function(t){return LM(this,wk(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=j([c,u],2),p=j(d[0],2),g=p[0],p=p[1],d=j(d[1],2),y=d[0],d=d[1],u=j(f?(c=j([c=c,u=u,f=void 0===(f=f)?[0,0]:f],3),f=(u=j(c[0],2))[0],u=u[1],m=(a=j(c[1],2))[0],a=a[1],v=(c=j(c[2],2))[0],c=c[1],f=(m=j([m-f,a-u],2))[0],a=m[1],u=Math.sqrt(Math.pow(f,2)+Math.pow(a,2)),v=(m=j([-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=j(h,2))[0],l=a[1],o=(u=j([g+(h=y-g)*u,p+(s=d-p)*u],2))[0],u=u[1],s=(h=j([g+h*l,p+s*l],2))[0],l=h[1],h=i([{line:[[g+m,p+v],[o,u]],className:QM.lineFirst.name},{line:[[s,l],[y+f,d+c]],className:QM.lineSecond.name}]),t.truncRange,t.truncShape,t.lineExtension,h):i([{line:[[g+m,p+v],[y+f,d+c]],className:QM.line.name}])}function kk(t,e,n){var r,i,a,o,s,l=e.type,c=w(e,"line"),n=("linear"===l?Mk:xk)(t,e,Hw(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(QM.lineSecond.class):t.select(QM.line.class),!r||!a||"arc"===e.type&&vk(e.startAngle,e.endAngle)?(i=l.node())&&(i.style.markerEnd=void 0):((t=Aw(a)).attr(c),$w(t,s,!0),l.style("markerEnd",t).style("markerEndOffset",-o)),n}function Ok(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function Ek(t,i){var a=i.gridLength;return t.map(function(t,e){var t=t.value,n=j(gk(t,i),2),r=n[0],n=n[1],t=j(Rw(hk(t,i.gridDirection,i),a),2);return{id:e,points:[[r,n],[r+t[0],n+t[1]]]}})}function Sk(t,e,n,r){var i=w(n,"grid"),a=i.type,o=i.areaFill,s=Ok(n),l=lk(e,n.gridFilter),e=("segment"===a?Ek:function(t,o){var s,l,c=o.gridControlAngles,e=Ok(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=j(e,2),s=e[0],l=e[1],t.map(function(t,e){var t=j(gk(t.value,o),2),n=t[0],t=t[1],n=j([n-s,t-l],2),r=n[0],i=n[1],a=[];return c.forEach(function(t){var t=hw(t),t=j([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:Ce(o)?l.map(function(t,e){return gw(o,[t,e,l])}):o,animate:r,data:e});return t.selectAll(QM.grid.class).data([1]).join(function(t){return t.append(function(){return new ak({style:c})}).attr("className",QM.grid.name)},function(t){return t.transition(function(){return this.update(c)})},function(t){return t.remove()}).transitions()}Object.defineProperty(_k.prototype,"left",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(_k.prototype,"top",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(_k.prototype,"right",{get:function(){return this.x2},enumerable:!1,configurable:!0}),Object.defineProperty(_k.prototype,"bottom",{get:function(){return this.y2},enumerable:!1,configurable:!0}),Object.defineProperty(_k.prototype,"width",{get:function(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(_k.prototype,"height",{get:function(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0},enumerable:!1,configurable:!0}),_k.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]]},_k.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},_k.prototype.defined=function(t){return this[t]!==Number.MAX_VALUE&&this[t]!==-Number.MAX_VALUE};var Ak=_k;function _k(t,e,n,r){this.set(t,e,n,r)}function Tk(t,e){var n=t.getEulerAngles()||0,r=(t.setEulerAngles(0),t.getLocalBounds()),i=j(r.min,2),a=i[0],i=i[1],r=j(r.max,2),o=r[0],r=r[1],s=Pk(t),l=s.width,s=s.height,c=0,u=0,h=a,f=i,d=kw(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)),j(Qw(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 Ak((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(hw(n),h,f)}function Pk(t){return t.__bbox__||t.getBBox()}function Ck(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 Lk(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 Nk(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=Lk((r=f)[0],r[1],i[0]),o=Lk(r[0],r[1],i[1]),s=Lk(i[0],i[1],r[0]),l=Lk(i[0],i[1],r[1]),a!==o&&s!==l||0===a&&Ck(r,i[0])||0===o&&Ck(r,i[1])||0===s&&Ck(i,r[0])||!(0!==l||!Ck(i,r[1]))){if(0===Lk(f[0],e,f[1]))return Ck(f,e);u++}}while(0!==(h=(h+1)%n));return!!(1&u)}function jk(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=Tk(e,n);return r=o,a.every(function(t){return Nk(r,t)})}function Rk(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=j(e=c,4))[0],r=e[1],i=e[2],e=e[3],a=(t=j(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 Ik(t,e,l){function n(t,e){if(t){var n,r,i=Qw(l),t=Tk(t,i).flat(1),a=Tk(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(Rk(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=j(f,2))[0],f=f[1],a=-h-(d="negative"===d?0:p),h=h+d,o=(d=j(Qw(y),4))[0],s=d[1],c=d[2],d=d[3],new Ak(u+a-d,f+a-o,u+h+s,f+h+c)):(a=(d=j(e.startPos,2))[0],o=d[1],s=(u=j(e.endPos,2))[0],f=u[1],c=(h=j(mk(e)?[-y,0,y,0]:[0,y,0,-y],4))[0],d=h[1],u=h[2],y=h[3],h=Rw(fk(0,e),p),(e=new Ak(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&&!jk(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 Bk(t,e){return void 0===e&&(e={}),A(t)?0:"number"==typeof t?t:Math.floor(ww(t,e))}var Dk=function(t,e){var e=e.seq,n=void 0===e?2:e;return t.filter(function(t,e){return!(e%n&&(nw(t),1))})};var Fk=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=Dk,f=function(t){return t.forEach(r.show),t},d=2,p=t.slice(),g=t.slice(),y=Math.min.apply(Math,M([1],j(t.map(function(t){return Pk(t).width})),!1));for("linear"===n.type&&(yk(n)||mk(n))&&(s=Jw(t[0]).left,l=Jw(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&&Ik((u?M(M([u],j(g),!1),[c],!1):M([c],j(g),!1)).filter(xw),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),Ik(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=Mw(r.getTextShape(t[0])),c=Bk(s,e),u=a?Bk(a,e):c,s=Bk(o,e),h=(!A(s)&&s!==1/0||(s=Math.max.apply(null,t.map(function(t){return Pk(t).width}))),t.slice()),f=((a=j(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=Ik(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,M([],j(e),!1)),d=(o=(a=n).type,s=a.labelDirection,"linear"===o&&yk(a)?"negative"===s?"bottom":"top":"middle");if(!(c<f)){for(var p=f;p<=c;p++)if(i(p),Ik(t,n,h).length<1)return;u&&i(e)}}]]);function zk(r,i,a){var t=i.labelOverlap,t=void 0===t?[]:t;t.length&&t.forEach(function(t){var e=t.type,n=Fk.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 Wk(t){for(var e=t;e<0;)e+=360;return Math.round(e%360)}var Gk=tn(function(t,e){var t=j(t,2),n=t[0],t=t[1],e=j(e,2),r=e[0],e=e[1],n=j([n*r+t*e,n*e-t*r],2),e=n[0],t=n[1];return Math.atan2(t,e)},function(t,e){return M(M([],j(t),!1),j(e),!1).join()});function Hk(t,e,n){var r,i=n.labelAlign;return(null==(r=e.style.transform)?void 0:r.includes("rotate"))?e.getLocalEulerAngles():(r=0,e=fk(t.value,n),t=uk(t.value,n),"horizontal"===i?0:(r="perpendicular"===i?Gk([1,0],e):Gk([t[0]<0?-1:1,0],t),Tw(n=((n=fw(r))+360)%180,-90,90)||(n+=180),n))}function Vk(t,e,n){var r=n.type,i=n.labelAlign,t=fk(t,n),n=Wk(e),e=Wk(fw(Gk([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?(Tw(n,0,90,!1,!0)||Tw(n,0,90)||Tw(n,270,360))&&(a="start"):90===e?Tw(n,0,90,!1,!0)?a="start":(Tw(n,90,180)||Tw(n,270,360))&&(a="end"):270===e?Tw(n,0,90,!1,!0)?a="end":(Tw(n,90,180)||Tw(n,270,360))&&(a="start"):180===e&&(90===n?a="start":(Tw(n,0,90)||Tw(n,270,360))&&(a="end")):a="center":"parallel"===i?o=Tw(e,0,180,!0)?"top":"bottom":"horizontal"===i?Tw(e,90,270,!1)?a="end":(Tw(e,270,360,!1)||Tw(e,0,90))&&(a="start"):"perpendicular"===i&&(a=Tw(e,90,270)?"end":"start"),{textAlign:a,textBaseline:o}}function Yk(t,e,n){var r=n.showTick,i=n.tickLength,a=n.tickDirection,o=n.labelDirection,s=n.labelSpacing,l=e.indexOf(t),s=gw(s,[t,l,e]),o=j([fk(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=j(Iw(Rw(o[0],s+(1===o[1]?gw(r?i:0,[t,l,e]):0)),gk(t.value,n)),2);return{x:a[0],y:a[1]}}function qk(t,e){"text"===t.nodeName&&t.attr(e)}function $k(r){zk(this.node().childNodes,r,{hide:nw,show:ew,rotate:function(t,e){var n;e=+e,n=r,(t=t).setLocalEulerAngles(e),e=Vk(t.__data__.value,e,n),(n=t.querySelector(QM.labelItem.class))&&qk(n,e)},ellipsis:function(t,e,n){void 0===e&&(e=1/0),t&&Ew(t,e,n)},wrap:function(t,e,n){var r;t&&Ow(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 Uk(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,Ce(c)?function(){return Aw(gw(c,[a,o,s,fk(a.value,l)]))}:function(){return Aw(a.label||"")})).attr("className",QM.labelItem.name).node(),r=j(rM(sk(r,[e,u,n])),2),u=r[0],n=r[1],r=n.transform,n=at(n,["transform"]),f=(iM(t,r),Hk(e,t,i));return t.setLocalEulerAngles(+f),qk(h,m(m({},Vk(e.value,f,i)),u)),iM(t,r),t.attr(n),h}function Xk(n,f,d,p){var t=lk(f,d.labelFilter),g=w(d,"label");return n.selectAll(QM.label.class).data(t,function(t,e){return e}).join(function(t){return t.append("g").attr("className",QM.label.name).transition(function(t){return Uk(this,t,f,g,d),this.attr(Yk(t,f,d)),this.__bbox__=t.bbox,null}).call(function(){return $k.call(n,d)})},function(t){return t.transition(function(t){var e,n,r,i,a,o,s,l,c=this.querySelector(QM.labelItem.class),u=Uk(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&&nw(e),n.isVisible()&&ew(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=j((l=function(t){var e,n;return"circle"===t.nodeName?(n=(e=j(t.getLocalPosition(),2))[0],e=e[1],[n-(n=t.attr("r")),e-n]):t.getLocalPosition()})(e),2))[0],h=h[1],l=j(l(n),2),l=(s=j([(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})),TM(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=LM(this,Yk(t,f,d),p.update);return this.__bbox__=t.bbox,M(M([],j(h),!1),[c],!1)}).call(function(t){var e,t=sn(t,"_transitions").flat().filter(xw);e=function(){return $k.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=NM(this.childNodes[0],p.exit);return TM(e,function(){return x(t).remove()}),e})}).transitions()}function Kk(t,e){return hk(t,e.tickDirection,e)}var Zk=tn(function(t,e){t=j(t,2);return[[0,0],[t[0]*e,t[1]*e]]},function(t,e){return M(M([],j(t),!1),[e],!1).join()});function Qk(t,e,n,r,i,a,o){var s=Kk(t.value,a),a=(c=t,u=e,h=n,l=s,a=(a=a).tickLength,l=j(Zk(l,gw(a,[c,u,h])),2),a=j(l[0],2),c=a[0],u=a[1],h=j(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=j(rM(sk(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 Jk(t,e,n,r,i,a){o=x(this),s=t,l=e,c=n,h=(u=r).tickFormatter,f=Kk(s.value,u),u="line",Ce(h)&&(u=function(){return gw(h,[s,l,c,f])});Qk(t,e,n,o.append(u).attr("className",QM.tickItem.name),this,r,i);var o,s,l,c,u,h,f,e=j(gk(t.value,r),2);return LM(this,{x:e[0],y:e[1]},a)}var tO=yw({text:"text"},"title");function eO(t){return/\S+-\S+/g.test(t)?t.split("-").map(function(t){return t[0]}):2<t.length?[t[0]]:t.split("")}function nO(r,t){t=Object.entries(t).reduce(function(t,e){var e=j(e,2),n=e[0],e=e[1];return r.node().attr(n)||(t[n]=e),t},{});r.styles(t)}t(aO,rO=Fs),aO.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(tO.text.class);if(!a)return new dw(0,0,+r,+i);var a=a.getBBox(),o=a.width,s=a.height,a=j(Qw(n),4),l=a[0],c=a[1],u=a[2],h=a[3],n=j([0,0,+r,+i],4),f=n[0],d=n[1],p=n[2],g=n[3],a=eO(e);if(a.includes("i"))return new dw(f,d,p,g);a.forEach(function(t,e){var n;"t"===t&&(n=j(0===e?[s+u,+i-s-u]:[0,+i],2),d=n[0],g=n[1]),"r"===t&&(n=j([+r-o-h],1),p=n[0]),"b"===t&&(n=j([+i-s-l],1),g=n[0]),"l"===t&&(n=j(0===e?[o+c,+r-o-c]:[0,+r],2),f=n[0],p=n[1])});n=j(Qw(t),4),e=n[0],a=n[1],t=n[2],n=n[3],a=j([n+a,e+t],2),t=a[0],a=a[1];return new dw(f+n,d+e,p-t,g-a)},aO.prototype.getBBox=function(){return this.title?this.title.getBBox():new dw(0,0,0,0)},aO.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=j(rM(c),1)[0],h=(h=(t=t).width,r=t.height,t=t.position,i=j([+h/2,+r/2],2),a=(i=j([+i[0],+i[1],"center","middle"],4))[0],o=i[1],s=i[2],i=i[3],(t=eO(t)).includes("l")&&(a=(n=j([0,"start"],2))[0],s=n[1]),t.includes("r")&&(a=(n=j([+h,"end"],2))[0],s=n[1]),t.includes("t")&&(o=(h=j([0,"top"],2))[0],i=h[1]),t.includes("b")&&(o=(n=j([+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;_w(!!c.text,x(e),function(t){l.title=t.maybeAppendByClassName(tO.text,"text").styles(u).call(nO,{x:f,y:d,textAlign:p,textBaseline:g}).node()})};var rO,iO=aO;function aO(t){return rO.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 oO(t,e,n,r,i){var a,o,s,l,c,u,h,f,d=j(rM(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=(iM(t.node(),d),g=x(n._offscreen||n.querySelector(QM.mainGroup.class)),p=e,r=void 0===(r=(n=r).titlePosition)?"lb":r,a=n.titleSpacing,o=eO(r),g=g.node().getLocalBounds(),s=(l=j(g.min,2))[0],l=l[1],c=(g=j(g.halfExtents,2))[0],g=g[1],u=(p=j(p.node().getLocalBounds().halfExtents,2))[0],p=p[1],l=(s=j([s+c,l+g],2))[0],s=s[1],m=(a=j(Qw(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=j("start"===r?[y,n]:[n,y],2))[0],y=(r=j(Rw(Ww([-(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=LM(e.node(),{x:n,y:r},i);return iM(t.node(),d),m}function sO(e,t,o,s){var n=e.showLine,r=e.showTick,i=e.showLabel,n=_w(n,t.maybeAppendByClassName(QM.lineGroup,"g"),function(t){return kk(t,e,s)})||[],r=_w(r,t.maybeAppendByClassName(QM.tickGroup,"g"),function(t){return t=t,r=s,i=lk(o,(n=e).tickFilter),a=w(n,"tick"),t.selectAll(QM.tick.class).data(i,function(t){return t.id||t.label}).join(function(t){return t.append("g").attr("className",QM.tick.name).transition(function(t,e){return Jk.call(this,t,e,i,n,a,!1)})},function(t){return t.transition(function(t,e){return this.removeChildren(),Jk.call(this,t,e,i,n,a,r.update)})},function(t){return t.transition(function(){var t=this,e=NM(this.childNodes[0],r.exit);return TM(e,function(){return t.remove()}),e})}).transitions();var n,r,i,a})||[],i=_w(i,t.maybeAppendByClassName(QM.labelGroup,"g"),function(t){return Xk(t,o,e,s)})||[];return M(M(M([],j(n),!1),j(r),!1),j(i),!1).filter(function(t){return!!t})}t(uO,lO=Fs),uO.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=_M(void 0===e?i:e),r=_w(l,x(t).maybeAppendByClassName(QM.gridGroup,"g"),function(t){return Sk(t,h,o,f)})||[],c=x(t).maybeAppendByClassName(QM.mainGroup,"g"),i=(n&&(!this.initialized&&f.enter||this.initialized&&f.update)&&sO(o,x(this.offscreenGroup),h,_M(!1)),sO(o,x(c.node()),h,f)),e=_w(a,x(t).maybeAppendByClassName(QM.titleGroup,"g"),function(t){return e=t,n=s,i=f,a=(r=o).titleText,e.selectAll(QM.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 Aw(a)}).attr("className",QM.title.name).transition(function(){return oO(x(this),e,n,r,i.enter)})},function(t){return t.transition(function(){return oO(x(this),e,n,r,i.update)})},function(t){return t.remove()}).transitions();var e,n,r,i,a})||[];return M(M(M([],j(r),!1),j(i),!1),j(e),!1).flat().filter(function(t){return!!t})};var lO,cO=uO;function uO(t){return lO.call(this,t,ZM)||this}var hO,fO=yw({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"),dO=(t(pO,hO=Fs),Object.defineProperty(pO.prototype,"defaultPage",{get:function(){var t=this.attributes.defaultPage;return Ge(t,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(pO.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(pO.prototype,"controllerShape",{get:function(){return 1<this.totalPages?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(pO.prototype,"pageShape",{get:function(){var n,t=this.pageViews,t=j((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,M([],j(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}),pO.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(pO.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(pO.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),pO.prototype.getBBox=function(){var t=hO.prototype.getBBox.call(this),e=t.x,t=t.y,n=this.controllerShape,r=this.pageShape,i=r.pageWidth,r=r.pageHeight;return new dw(e,t,i+n.width,r)},pO.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=j(this.getFollowingPageDiff(t),2),o=i[0],r=i[1],this.playState="running",i=CM(a,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-o,", ").concat(-r,")")}],n);return TM(i,function(){e.innerCurrPage=t,e.playState="idle",e.setVisiblePages([t]),e.updatePageInfo()}),i},pO.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:Ge(n-1,0,e),this.goTo(t))},pO.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:Ge(n+1,0,e),this.goTo(t))},pO.prototype.renderClipPath=function(t){var e=this.pageShape,n=e.pageWidth,e=e.pageHeight;n&&e?(this.clipPath=t.maybeAppendByClassName(fO.clipPath,"rect").styles({width:n,height:e}),this.contentGroup.attr("clipPath",this.clipPath.node())):this.contentGroup.style.clipPath=void 0},pO.prototype.setVisiblePages=function(n){this.playWindow.children.forEach(function(t,e){(n.includes(e)?ew:nw)(t)})},pO.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,j("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=j(i.offset,3),o=j(a[0],2),s=o[0],c=o[1],l=j(a[1],2),r=l[0],o=l[1],l=j(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)},pO.prototype.updatePageInfo=function(){var t,e=this.currPage,n=this.pageViews,r=this.attributes.formatter;n.length<2||(null!=(t=this.pageInfoGroup.querySelector(fO.pageInfo.class))&&t.attr("text",r(e+1,n.length)),this.adjustControllerLayout())},pO.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])},pO.prototype.prepareFollowingPage=function(t){var e,n=this.currPage,r=this.pageViews;this.setVisiblePages([t,n]),t!==n&&(e=(n=j(this.getFollowingPageDiff(t),2))[0],n=n[1],r[t].setLocalPosition(e,n))},pO.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(fO.controller,"g");rw(t.node(),u),u&&(u=w(this.attributes,"button"),e=w(this.attributes,"pageNum"),i=(u=j(rM(u),2))[0],u=u[1],n=i.size,r=at(i,["size"]),i=!t.select(fO.prevBtnGroup.class).node(),a=t.maybeAppendByClassName(fO.prevBtnGroup,"g").styles(u),this.prevBtnGroup=a.node(),a=a.maybeAppendByClassName(fO.prevBtn,"path"),u=t.maybeAppendByClassName(fO.nextBtnGroup,"g").styles(u),this.nextBtnGroup=u.node(),[a,u.maybeAppendByClassName(fO.nextBtn,"path")].forEach(function(t){t.styles(m(m({},r),{transformOrigin:"center"})),$w(t.node(),n,!0)}),a=t.maybeAppendByClassName(fO.pageInfoGroup,"g"),this.pageInfoGroup=a.node(),a.maybeAppendByClassName(fO.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()}))},pO.prototype.render=function(t,e){e=x(e);this.renderClipPath(e),this.renderController(e),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},pO.prototype.bindEvents=function(){var t=this,e=Je(function(){return t.render(t.attributes,t)},50);this.playWindow.addEventListener(b.INSERTED,e),this.playWindow.addEventListener(b.REMOVED,e)},pO);function pO(t){var e,n,t=hO.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 hc({class:fO.contentGroup.name})),t.playWindow=t.contentGroup.appendChild(new hc({class:fO.playWindow.name})),t.innerCurrPage=t.defaultPage,t}function gO(t,e,n){return"horizontal"===(t=void 0===t?"horizontal":t)?e:n}fM.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"]]}),fM.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]]}),fM.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 yO=yw({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(bO,mO=Fs),Object.defineProperty(bO.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(bO.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(bO.prototype,"span",{get:function(){var t,e=this.attributes.span;return e?(t=(e=j(Qw(e),2))[0],e=e[1],[t/(e=t+(t=this.showValue?e:0)),t/e]):[1,1]},enumerable:!1,configurable:!0}),Object.defineProperty(bO.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=j(this.spacing,2),s=o[0],o=o[1];return t&&(t=t-e-s-o,e=j(this.span,2),a=(e=j([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(bO.prototype,"spacing",{get:function(){var t,e=this.attributes.spacing;return e?(t=(e=j(Qw(e),2))[0],e=e[1],this.showValue?[t,e]:[t,0]):[0,0]},enumerable:!1,configurable:!0}),Object.defineProperty(bO.prototype,"layout",{get:function(){var t=this.shape,e=t.markerWidth,n=t.labelWidth,r=t.valueWidth,i=t.width,t=t.height,a=j(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(bO.prototype,"scaleSize",{get:function(){var t=(t=(t=this.markerGroup.node()).querySelector(yO.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}),bO.prototype.renderMarker=function(t){var f=this,d=this.attributes.marker,p=w(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(yO.markerGroup,"g").style("zIndex",0),_w(!!d,this.markerGroup,function(){var t=f.markerGroup.node(),e=t.getElementsByClassName(yO.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=j(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",yO.marker.name).styles(p),t.appendChild(n);else x(n).attr("className",yO.marker.name).styles(p),t.appendChild(n);f.markerGroup.node().scale(1/f.markerGroup.node().getScale()[0]),$w(f.markerGroup.node(),f.scaleSize,!0)})},bO.prototype.renderLabel=function(t){var e=w(this.attributes,"label"),n=e.text,e=at(e,["text"]);this.labelGroup=t.maybeAppendByClassName(yO.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(yO.label,function(){return Aw(n)}).styles(e)},bO.prototype.renderValue=function(t){var e=this,n=w(this.attributes,"value"),r=n.text,i=at(n,["text"]);this.valueGroup=t.maybeAppendByClassName(yO.valueGroup,"g").style("zIndex",0),_w(this.showValue,this.valueGroup,function(){e.valueGroup.maybeAppendByClassName(yO.value,function(){return Aw(r)}).styles(i)})},bO.prototype.renderBackground=function(t){var e=this.shape,n=e.width,e=e.height,r=w(this.attributes,"background");this.background=t.maybeAppendByClassName(yO.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(yO.background,"rect").styles(m({width:n,height:e},r))},bO.prototype.adjustLayout=function(){var t=this.layout,e=t.labelWidth,n=t.valueWidth,r=t.height,t=j(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}),Ew(this.labelGroup.select(yO.label.class).node(),Math.ceil(e)),this.showValue&&(this.valueGroup.styles({x:t,y:r}),Ew(this.valueGroup.select(yO.value.class).node(),Math.ceil(n)))},bO.prototype.render=function(t,e){e=x(e);this.renderMarker(e),this.renderLabel(e),this.renderValue(e),this.renderBackground(e),this.adjustLayout()};var mO,vO=bO;function bO(t){return mO.call(this,t,{span:[1,1],marker:function(){return new nc({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}function xO(t,e,n){return void 0===n&&(n=!0),t?e(t):n}var wO,MO=yw({page:"item-page",navigator:"navigator",item:"item"},"items"),kO=(t(OO,wO=Fs),Object.defineProperty(OO.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(OO.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(OO.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=j(t,2);return[t[0],gw(t[1],[e,n,a])]})))}})},enumerable:!1,configurable:!0}),OO.prototype.getGridLayout=function(){var u=this,t=this.attributes,h=t.orientation,f=t.width,d=t.rowPadding,p=t.colPadding,g=j(this.navigatorShape,1)[0],t=j(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(),j(a,2)),o=a[0],a=a[1],s=(f-g-(m-1)*p)/m,t=t.getBBox().height,l=j([0,0],2),c=l[0],l=l[1];return b="horizontal"===h?(c=(n=j([b,o*(t+d)],2))[0],l=n[1],a===m-1?0:b+s+p):(c=(n=j([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}})},OO.prototype.getFlexLayout=function(){var t=this.attributes,e=t.width,n=t.height,a=t.rowPadding,o=t.colPadding,t=j(this.navigatorShape,1)[0],r=j(this.grid,2),s=r[0],l=r[1],r=j([e-t,n],2),c=r[0],u=r[1],e=j([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&&xO(g,function(t){return t<l})?(r=j([m+r,v,i],3),h=r[0],f=r[1],m=r[2]):(i=j([y+1,0,0,v+t+a],4),y=i[0],g=i[1],m=i[2],(v=i[3])+a+t<=u&&xO(y,function(t){return t<s})?(r=j([m,v,n],3),h=r[0],f=r[1],m=r[2]):(i=j([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(OO.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}),OO.prototype.ifHorizontal=function(t,e){return gO(this.attributes.orientation,t,e)},OO.prototype.flattenPage=function(e){e.querySelectorAll(MO.item.class).forEach(function(t){e.appendChild(t)}),e.querySelectorAll(MO.page.class).forEach(function(t){e.removeChild(t).destroy()})},OO.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(MO.item.class).data(this.renderData,function(t){return t.id}).join(function(t){return t.append(function(t){t=t.style;return new vO({style:t})}).attr("className",MO.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()})},OO.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=j(this.navigatorShape,2),i=r[0],r=r[1];this.navigator.update("grid"===e?{pageWidth:t-i,pageHeight:n-r}:{})},OO.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=j(t,2);return{page:t[0],layouts:t[1]}}),u=M([],j(this.navigator.getContainer().children),!1);t.forEach(function(t){var t=t.layouts,c=e.pageViews.appendChild(new hc({className:MO.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=We(t="__layout__")?t.split("."):t).forEach(function(t,e){e<i.length-1?(Re(r[t])||(r[t]=He(i[e+1])?[]:{}),r=r[t]):r[t]=n}),o.update({x:e,y:a,width:s,height:l})})}),this.relayoutNavigator()},OO.prototype.renderNavigator=function(t){var e=this.attributes.orientation,n=w(this.attributes,"nav"),r=mw({orientation:e},n),i=this;return t.selectAll(MO.navigator.class).data(["nav"]).join(function(t){return t.append(function(){return new dO({style:r})}).attr("className",MO.navigator.name).each(function(){i.navigator=this})},function(t){return t.each(function(){this.update(r)})},function(t){return t.remove()}),this.navigator},OO.prototype.getBBox=function(){return this.navigator.getBBox()},OO.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())},OO.prototype.dispatchCustomEvent=function(t,e){t=new pl(t,{detail:e});this.dispatchEvent(t)},OO);function OO(t){t=wO.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:an,mouseenter:an,mouseleave:an})||this;return t.navigatorShape=[0,0],t}var EO,SO=yw({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),AO={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},_O=(t(TO,EO=Fs),TO.prototype.render=function(t,e){var n=x(e).maybeAppendByClassName(SO.markerGroup,"g"),n=(this.renderMarker(n),x(e).maybeAppendByClassName(SO.labelGroup,"g"));this.renderLabel(n)},TO.prototype.renderMarker=function(t){var r=this,e=this.attributes,n=e.orientation,e=e.markerSymbol,i=void 0===e?gO(n,"horizontalHandle","verticalHandle"):e;_w(!!i,t,function(t){var e=w(r.attributes,"marker"),n=m({symbol:i},e);r.marker=t.maybeAppendByClassName(SO.marker,function(){return new fM({style:n})}).update(n)})},TO.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;_w(n,t,function(t){var e=w(s.attributes,"label"),n=e.text,e=at(e,["text"]),r=(null==(r=t.select(SO.marker.class))?void 0:r.node().getBBox())||{},i=r.width,r=r.height,r=j(gO(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(SO.label,"text").styles(m(m({},e),{x:i,y:a,text:u(n).toString(),textAlign:o,textBaseline:r}))})},TO);function TO(t){return EO.call(this,t,AO)||this}var PO,qs={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},CO=mw({},qs,{}),LO=mw({},qs,nM(AO,"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"}),NO=yw({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"),jO=(t(RO,PO=Fs),RO.prototype.renderTitle=function(t,e,n){var r=this.attributes,i=r.showTitle,r=r.titleText,a=j(rM(w(this.attributes,"title")),2),o=a[0],a=a[1],s=(this.titleGroup=t.maybeAppendByClassName(NO.titleGroup,"g").styles(a),m(m({width:e,height:n},o),{text:i?r:""}));this.title=this.titleGroup.maybeAppendByClassName(NO.title,function(){return new iO({style:s})}).update(s)},RO.prototype.renderItems=function(t,e){var n=e.x,r=e.y,i=e.width,e=e.height,a=j(rM(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(NO.itemsGroup,"g").styles(m({x:n,y:r},a)),this);this.itemsGroup.selectAll(NO.items.class).data(["items"]).join(function(t){return t.append(function(){return new kO({style:s})}).attr("className",NO.items.name).each(function(){l.items=x(this)})},function(t){return t.update(s)},function(t){return t.remove()})},RO.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(RO.prototype,"availableSpace",{get:function(){var t=this.attributes,e=t.showTitle,n=t.width,t=t.height;return e?this.title.node().getAvailableSpace():new dw(0,0,n,t)},enumerable:!1,configurable:!0}),RO.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=eO(t),e=(r=j(Qw(r?e:0),4))[0],a=r[1],o=r[2],r=r[3],s=(n=j(Qw(n),4))[0],l=n[1],c=n[2],n=n[3],a=(r=j([r+a,e+o],2))[0],e=r[1],r=(o=j([n+l,s+c],2))[0],n=o[1],"l"===t[0]?new dw(u.x,u.y,i.width+u.width+a+r,Math.max(i.height+n,u.height)):"t"===t[0]?new dw(u.x,u.y,Math.max(i.width+r,u.width),i.height+u.height+e+n):(s=(l=j([h.attributes.width||i.width,h.attributes.height||i.height],2))[0],c=l[1],new dw(i.x,i.y,s+u.width+a+r,c+u.height+e+n))):PO.prototype.getBBox.call(this)},RO.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()},RO);function RO(t){return PO.call(this,t,CO)||this}var IO,BO={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},DO=yw({background:"background",labelGroup:"label-group",label:"label"},"indicator"),FO=(t(zO,IO=Fs),zO.prototype.renderBackground=function(){var t,e,n,r,i,a,o;this.label&&(t=(i=this.attributes).position,o=(i=j(Qw(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(DO.background,"path").styles(m(m({},o),{path:a})),this.group.appendChild(this.label.node()))},zO.prototype.renderLabel=function(){var t=this.attributes,e=t.formatter,n=t.labelText,t=j(rM(w(this.attributes,"label")),2),r=t[0],t=t[1],r=(r.text,at(r,["text"]));this.label=x(this.group).maybeAppendByClassName(DO.labelGroup,"g").styles(t),n&&this.label.maybeAppendByClassName(DO.label,function(){return Aw(e(n))}).style("text",e(n).toString()).selectAll("text").styles(r)},zO.prototype.adjustLayout=function(){var t=j(this.point,2),e=t[0],t=t[1];this.group.attr("x",-e).attr("y",-t)},zO.prototype.getPath=function(n,t){var r=this,t=j(t,2),e=j(t[0],2),i=e[0],e=e[1],t=j(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=j(t,2),e=t[0],t=t[1];return e===o[n]?r.createCorner(t):[M(["M"],j(t[0]),!1),M(["L"],j(t[1]),!1)]});return a.push([["Z"]]),a.flat().filter(function(t,e,n){return 0===e||"M"!==t[0]})},zO.prototype.createCorner=function(t,e){void 0===e&&(e=10);var n=function(t,e){var n=(t=j(t,2))[0],t=t[1],r=(e=j(e,2))[0],e=e[1];return n!==r&&t===e}.apply(void 0,M([],j(t),!1)),t=j(t,2),r=j(t[0],2),i=r[0],r=r[1],t=j(t[1],2),a=t[0],t=t[1],a=j(n?[a-i,[i,a]]:[t-r,[r,t]],2),t=a[0],a=j(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=j([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]])},zO.prototype.bindEvents=function(){this.label.on(b.BOUNDS_CHANGED,this.renderBackground)},zO.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout()},zO);function zO(t){t=IO.call(this,t,BO)||this;return t.point=[0,0],t.group=t.appendChild(new hc({})),t.isMutationObserved=!0,t}function WO(t,e){var t=j(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 GO=yw({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function HO(t){var e=t.orientation,n=t.size,t=t.length;return gO(e,[t,n],[n,t])}function VO(t){var e=t.type,t=j(HO(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 YO(t){var i,a,o,e=t.orientation,r=t.color,n=t.block,t=t.partition,s=(l=Ce(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 ma(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(gO(e,"0","270"),")")):""}function qO(t,e){var n,r,i,a=w(e,"selection"),o=YO(e),t=t.maybeAppendByClassName(GO.selection,"path").styles(m({path:VO(e),fill:o},a)),a=t.maybeAppendByClassName(GO.clipPath,"path").styles({path:(a=(o=e).orientation,(e=o.range)?(r=(o=j(HO(o),2))[0],o=o[1],n=(e=j(e,2))[0],e=e[1],i=gO(a,n*r,0),n=gO(a,0,n*o),r=gO(a,e*r,r),[["M",i,n],["L",i,i=gO(a,o,e*o)],["L",r,i],["L",r,n],["Z"]]):[])}).node();t.style("clip-path",a)}t(XO,$O=Fs),XO.prototype.render=function(t,e){var n,r,i=x(e).maybeAppendByClassName(GO.trackGroup,"g");i=i,r=w(n=t,"track"),i.maybeAppendByClassName(GO.track,"path").styles(m({path:VO(n)},r)),qO(x(e).maybeAppendByClassName(GO.selectionGroup,"g"),t)};var $O,UO=XO;function XO(t){return $O.call(this,t,{type:"color",orientation:"horizontal",size:30,range:[0,1],length:200,block:!1,partition:[],color:["#fff","#000"],trackFill:"#e5e5e5"})||this}var KO,ZO,QO,JO,tE=tn(function(t){return{min:Math.min.apply(Math,M([],j(t.map(function(t){return t.value})),!1)),max:Math.max.apply(Math,M([],j(t.map(function(t){return t.value})),!1))}},function(t){return t.map(function(t){return t.id})}),eE=(t(h,KO=Fs),Object.defineProperty(h.prototype,"handleOffsetRatio",{get:function(){return this.ifHorizontal(.5,.5)},enumerable:!1,configurable:!0}),h.prototype.getBBox=function(){var t=this.attributes,e=t.width,t=t.height;return new dw(0,0,e,t)},h.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(NO.contentGroup,"g").styles({x:i,y:r}),i=(_w(!!t,e.maybeAppendByClassName(NO.labelGroup,"g").styles({zIndex:1}),function(t){n.renderLabel(t)}),e.maybeAppendByClassName(NO.ribbonGroup,"g").styles({zIndex:0}));this.handlesGroup=e.maybeAppendByClassName(NO.handlesGroup,"g").styles({zIndex:2}),this.renderHandles(),this.renderRibbon(i),this.renderIndicator(e),this.adjustLabel(),this.adjustHandles()},Object.defineProperty(h.prototype,"range",{get:function(){var t=this.attributes.data;return tE(t)},enumerable:!1,configurable:!0}),Object.defineProperty(h.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(h.prototype,"ribbonRange",{get:function(){var t=j(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(h.prototype,"selection",{get:function(){var t=this.range,e=t.min,t=t.max,n=this.attributes.defaultValue,e=j(void 0===n?[e,t]:n,2);return[e[0],e[1]]},enumerable:!1,configurable:!0}),h.prototype.ifHorizontal=function(t,e){return gO(this.attributes.orientation,"function"==typeof t?t():t,"function"==typeof e?e():e)},h.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(NO.title.class).data(n?[r]:[]).join(function(t){return t.append(function(){return new iO({style:o})}).attr("className",NO.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(h.prototype,"availableSpace",{get:function(){var t,e;return this.title?this.title.getAvailableSpace():(t=(e=this.attributes).width,e=e.height,new dw(0,0,t,e))},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"labelFixedSpacing",{get:function(){return this.attributes.showTick?5:0},enumerable:!1,configurable:!0}),Object.defineProperty(h.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(h.prototype,"labelBBox",{get:function(){var t,e;return this.attributes.showLabel?(this.cacheLabelBBox||(t=(e=(null==(e=this.label.querySelector(QM.labelGroup.class))?void 0:e.children.slice(-1)[0]).getBBox()).width,e=e.height,this.cacheLabelBBox=new dw(0,0,t,e)),this.cacheLabelBBox):new dw(0,0,0,0)},enumerable:!1,configurable:!0}),Object.defineProperty(h.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(h.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=j(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=j(this.ifHorizontal([n,l],[l,n]),2),s=o[0],e=o[1],i=["top","left"].includes(c)?a:0,r=j(this.ifHorizontal([t/2,i],[i,t/2]),2),l=r[0],n=r[1];return new dw(l,n,s,e)},enumerable:!1,configurable:!0}),Object.defineProperty(h.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}),h.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=mw({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(NO.ribbon,function(){return new UO({style:d})}).update(d)},h.prototype.getHandleClassName=function(t){return"".concat(NO.prefix("".concat(t,"-handle")))},h.prototype.renderHandles=function(){var t=this.attributes,e=t.showHandle,t=t.orientation,n=w(this.attributes,"handle"),r=j(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)?_O:HM,s=this;this.handlesGroup.selectAll(NO.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(NO.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()})},h.prototype.adjustHandles=function(){var t=j(this.selection,2),e=t[0],t=t[1];this.setHandlePosition("start",e),this.setHandlePosition("end",t)},h.prototype.adjustTitle=function(){var t=this.attributes,e=t.titlePosition,t=t.orientation,n=j(this.getElementsByClassName(NO.title.name),1)[0],r=this.handlesGroup.select(".".concat(this.getHandleClassName("start"))).node();n&&r&&"top-left"===e&&"horizontal"===t&&(e=j(r.getLocalBounds().min,1)[0],t=j(n.getLocalBounds().min,1)[0],n.style.x=+(this.style.x||0)+(e-t))},Object.defineProperty(h.prototype,"handleBBox",{get:function(){if(!this.cacheHandleBBox){if(!this.attributes.showHandle)return new dw(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=j([Math.max(e,r),Math.max(t,n)],2),r=e[0],t=e[1];this.cacheHandleBBox=new dw(0,0,r,t)}return this.cacheHandleBBox},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"handleShape",{get:function(){var t=this.handleBBox,e=t.width,t=t.height,n=j(this.ifHorizontal([t,e],[e,t]),2);return{width:e,height:t,size:n[0],length:n[1]}},enumerable:!1,configurable:!0}),h.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=j(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})},h.prototype.renderIndicator=function(t){var e=w(this.attributes,"indicator");this.indicator=t.maybeAppendByClassName(NO.indicator,function(){return new FO({})}).update(e)},Object.defineProperty(h.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=j([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(h.prototype,"labelStyle",{get:function(){var t=j(["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}),h.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=mw(m({showLine:!1,showGrid:!1,showTick:n,type:"linear",startPos:[0,0],endPos:[0,0],tickDirection:"negative",labelTransform:"rotate(0)"},this.labelStyle),nM(i,"tick"),nM(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(NO.label,function(){return new cO({style:s})}).node(),this.label.update(s,!1)},Object.defineProperty(h.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=j([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}),h.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=j(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))},h.prototype.bindEvents=function(){this.ribbon.on("pointerdown",this.onDragStart("ribbon")),this.ribbon.on("pointermove",this.onHovering),this.addEventListener("pointerout",this.hideIndicator)},h.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=Ge(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}),ew(this.indicator.node())):this.hideIndicator()},h.prototype.hideIndicator=function(){nw(this.indicator.node())},h.prototype.updateMouse=function(){this.attributes.slidable&&(this.style.cursor="grabbing")},h.prototype.setSelection=function(t,e){this.updateSelection(t,e)},h.prototype.updateSelection=function(t,e,n){void 0===n&&(n=!1);var r,i,a,o,s,l=j(this.selection,2),c=l[0],l=l[1],t=j([t,e],2),e=t[0],t=t[1],n=(n&&(e+=c,t+=l),this.range),c=n.min,l=n.max,u=j((n=[c,l],c=[e,t],l=this.selection,void 0===r&&(r=4),i=(n=j(n,2))[0],n=n[1],a=(c=j(c,2))[0],c=c[1],o=(l=j(l,2))[0],l=l[1],c=(a=j([a,c],2))[0],s=(a=a[1])-c,a<c&&(c=(u=j([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]:[Gw(c,r),Gw(a,r)]),2),e=u[0],t=u[1];this.update({defaultValue:[e,t]}),this.dispatchSelection()},Object.defineProperty(h.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 Ze(t)?Gw(.01*(e-n),0):t},enumerable:!1,configurable:!0}),h.prototype.getTickValue=function(t){var e=this.attributes,n=e.data,e=e.block,r=this.range.min;return e?WO(n.map(function(t){return t.value}),t).tick:(e=this.step,r+Math.round((t-r)/e)*e)},h.prototype.getValueByCanvasPoint=function(t,e){var n=this.range,r=n.min,n=n.max,i=j(this.ribbon.node().getPosition(),2),a=i[0],i=i[1],a=this.ifHorizontal(a,i),i=this.ifHorizontal.apply(this,M([],j(Sw(t)),!1));return Ge(this.getOffset(i-a,!0),r,n)},h.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)},h.prototype.dispatchSelection=function(){var t=new pl("valuechange",{detail:{value:this.selection}});this.dispatchEvent(t)},h.prototype.dispatchIndicated=function(t,e){t=new pl("indicate",{detail:{value:t,range:e}});this.dispatchEvent(t)},h);function h(t){var a=KO.call(this,t,LO)||this;return a.eventToOffsetScale=new eb({}),a.innerRibbonScale=new eb({}),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=WO(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(),j(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 nE(t){ZO||(ZO=document.createElement("table"),JO=document.createElement("tr"),QO=/^\s*<(\w+|!)[^>]*>/,JO={tr:document.createElement("tbody"),tbody:ZO,thead:ZO,tfoot:ZO,td:JO,th:JO,"*":document.createElement("div")});var e=QO.test(t)&&RegExp.$1,e=(e&&e in JO||(e="*"),JO[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 rE(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 iE={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};t(cE,aE=Fs),Object.defineProperty(cE.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),cE.prototype.getContainer=function(){return this.element},Object.defineProperty(cE.prototype,"position",{set:function(t){var t=j(t,2),e=t[0],t=t[1];this.attributes.x=e,this.attributes.y=t,this.updatePosition()},enumerable:!1,configurable:!0}),Object.defineProperty(cE.prototype,"elementSize",{get:function(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}},enumerable:!1,configurable:!0}),Object.defineProperty(cE.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 nE((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}),cE.prototype.render=function(t,e){this.renderHTMLTooltipElement(),this.updatePosition()},cE.prototype.destroy=function(){var t;null!=(t=this.element)&&t.remove(),aE.prototype.destroy.call(this)},cE.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"},cE.prototype.hide=function(){this.element.style.visibility="hidden"},cE.prototype.initShape=function(){var t=this.attributes.template;this.element=nE(t.container),this.id&&this.element.setAttribute("id",this.id)},cE.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))},cE.prototype.renderHTMLTooltipElement=function(){var r,t=this.attributes,e=t.template,n=t.title,i=t.enterable,a=t.style,t=t.content,o=rE(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,M([],j(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=j(t,2),e=t[0],n=t[1];M([r],j(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(":"),";")},""))})})},cE.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=j(l,2),n=e[0],e=e[1],t=j(a[t],2),r=t[0],t=t[1];l=[n+(o/2+i[0])*r,e+(s/2+i[1])*t]}),l},cE.prototype.setOffsetPosition=function(t){var t=j(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")},cE.prototype.updatePosition=function(){this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor()))},cE.prototype.autoPosition=function(t){var e,n,r,i,a,o,s,t=j(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=j([+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]},cE.tag="tooltip",e([(void 0===(oE=100)&&(oE=0),void 0===(sE=!0)&&(sE=!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,sE&&i.apply(t,e),r=window.setTimeout(function(){i.apply(t,e),r=null},oE))})})],cE.prototype,"updatePosition",null);var aE,oE,sE,lE=cE;function cE(t){var e=this,n=null==(n=null==(n=t.style)?void 0:n.template)?void 0:n.prefixCls,r=rE(n);return(e=aE.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=rE(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},iE),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)"},iE),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(hE,uE=hc),Object.defineProperty(hE.prototype,"margin",{get:function(){return this.$margin},set:function(t){this.$margin=Qw(t)},enumerable:!1,configurable:!0}),Object.defineProperty(hE.prototype,"padding",{get:function(){return this.$padding},set:function(t){this.$padding=Qw(t)},enumerable:!1,configurable:!0}),hE.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=j(this.$margin,4),a=i[0],o=i[1],s=i[2],i=i[3];return new dw(e-i,n-a,r+i+o,t+a+s)},hE.prototype.appendChild=function(t,e){return t.isMutationObserved=!0,uE.prototype.appendChild.call(this,t,e),t},hE.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,t=t.height,n=j(this.$padding,4),r=n[0],i=n[1],a=n[2],n=n[3],o=j(this.$margin,4),s=o[0],o=o[3];return new dw(n+o,r+s,e-n-i,t-r-a)},hE.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:Nw,grid:jw})?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){}},hE.prototype.bindEvents=function(){var e=this;this.layoutEvents.forEach(function(t){e.addEventListener(t,function(t){t.target.isMutationObserved=!0,e.layout()})})},hE.prototype.attributeChangedCallback=function(t,e,n){"margin"===t?this.margin=n:"padding"===t&&(this.padding=n),this.layout()};var uE,Ml=hE;function hE(t){var e=uE.call(this,t)||this,t=(e.layoutEvents=[b.BOUNDS_CHANGED,b.INSERTED,b.REMOVED],e.$margin=Qw(0),e.$padding=Qw(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 fE(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 X2()([[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=jb(l,t),t=jb(t,i),i=jb(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])),X2()(s)}const dE=Ox(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=>!He(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=fE(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 fM({id:"startMarker",style:Object.assign({x:0,y:0},st(a,"startMarker"))}),o=g&&new fM({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:{}))}),pE=(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 dE).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()}};pE.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const gE=Ox(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 fM({})).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)}),yE=(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 gE).call(L,n).style("x",e).style("y",t).call(L,r).call(L,i).node()}};yE.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const mE=Ox(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)}),vE=(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=Yb(d,e),i=l&&i?Wb(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 L0(d)?(e=t=>{const n=d.getCenter(),r=t.slice(0,t.length/2),i=t.slice(t.length/2);return t=K2().curve(Z2),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 tx(a())},delete t.lineX0,t.lineEndAngle=function(){return tx(o())},delete t.lineX1,t.lineInnerRadius=function(){return tx(s())},delete t.lineY0,t.lineOuterRadius=function(){return tx(l())},delete t.lineY1,t.curve=function(t){return arguments.length?e(J2(t)):e()._curve},t.angle((t,e)=>Ib(Lb(r[e],n))).outerRadius((t,e)=>jb(r[e],n)).innerRadius((t,e)=>jb(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 mE).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(C0(d)?K2().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)):K2().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 mE).style("areaStyle",s).style("connectStyle",Object.assign(Object.assign({},r),f)).style("areaPath",e(t)).style("connectPath",o.map(e).join("")).node())}},bE=(vE.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(n,r)=>{const i=r["coordinate"];return(...t)=>{var e=L0(i)?hx:q2;return vE(Object.assign({curve:e},n),r)(...t)}}),xE=(bE.props=Object.assign(Object.assign({},vE.props),{defaultMarker:"square"}),(t,n)=>{const{alpha:r=.5}=t,i=at(t,["alpha"]),a=n["coordinate"];return(...t)=>{var e=L0(a)?cx:sx;return vE(Object.assign({curve:e.alpha(r)},i),n)(...t)}}),wE=(xE.props=Object.assign(Object.assign({},vE.props),{defaultMarker:"smooth"}),(e,n)=>(...t)=>vE(Object.assign({curve:dx},e),n)(...t)),ME=(wE.props=Object.assign(Object.assign({},vE.props),{defaultMarker:"hvh"}),(e,n)=>(...t)=>vE(Object.assign({curve:px},e),n)(...t)),kE=(ME.props=Object.assign(Object.assign({},vE.props),{defaultMarker:"vh"}),(e,n)=>(...t)=>vE(Object.assign({curve:gx},e),n)(...t)),OE=(kE.props=Object.assign(Object.assign({},vE.props),{defaultMarker:"hv"}),(e,n)=>{const{arrow:r=!1}=e;return(...t)=>tw(Object.assign(Object.assign({},e),{arrow:r}),n)(...t)}),EE=(OE.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=R2();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()}});EE.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const SE=(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=R2(),L0(r)?(a=jb(t,c=r.getCenter()),a=(jb(l,c)-a)*i+a,o.moveTo(t[0],t[1]),zb(o,t,l,c,a)):C0(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()}},AE=(SE.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=R2();return o.moveTo(t[0],t[1]),L0(l)?(r=l.getCenter(),o.quadraticCurveTo(r[0],r[1],a[0],a[1])):zb(o,t,a,Fb(t,a),jb(t,a)/2),lt(c.createElement("path",{})).call(L,n).style("d",o.toString()).style("stroke",e).style("transform",i).call(L,s).node()}}),_E=(AE.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?Np(o)*l:o,i="string"==typeof i?Np(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()}});_E.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const TE=(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=R2();if(L0(t)){const o=t.getCenter();t=[...i,i[0]];const s=t.map(t=>jb(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?zb(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()}};TE.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const PE=(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=R2();return L0(e)?(n=jb(e=e.getCenter(),t),o.moveTo(t[0],t[1]),o.quadraticCurveTo(e[0],e[1],i[0],i[1]),zb(o,i,a,e,n),o.quadraticCurveTo(e[0],e[1],r[0],r[1]),zb(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()}};PE.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const CE=(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=R2(),L0(r)?([i,a]=r=r.getCenter(),o=Rb(Lb(t[0],r)),s=Rb(Lb(t[1],r)),g=jb(r,t[2]),l=jb(r,t[3]),c=jb(r,t[8]),u=jb(r,t[10]),r=jb(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()}};CE.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const LE=(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=R2(),L0(r)?([a,o]=r=r.getCenter(),s=jb(r,t[3]),l=jb(r,t[8]),g=jb(r,t[10]),c=(r=Rb(Lb(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()}};LE.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const NE=(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,L0(i=d)?(i=i.getCenter(),H2()({startAngle:0,endAngle:2*Math.PI,outerRadius:jb(r[0],i),innerRadius:jb(r[1],i)})):X2().x(t=>t[0]).y(t=>t[1])(r)),c=(c=d,e=e.transform,L0(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 jE(t,e,n){return[["M",t,e],["L",t+2*n,e-n],["L",t+2*n,e+n],["Z"]]}NE.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const RE=Ox(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,X2().x(t=>t[0]).y(t=>t[1])(n));lt(t).maybeAppend("connector","path").style("path",n).style("markerEnd",r?new fM({className:"marker",style:Object.assign(Object.assign({},i),{symbol:jE})}):null).call(L,e)});const IE=(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(C0(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 RE).call(L,n).style("points",t).style("stroke",e||r).style("transform",a).call(L,l).node()}};function BE(t){return t.replace(/-(\w)/g,function(t,e){return e.toUpperCase()})}function DE(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=Pg(a.x,c),i=Pg(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 FE(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}=Hb(e,i,[t,n]),f="inside"===r?(u+h)/2:h;e=WE(f,a,o),t=(()=>{var[t,e]=i,n=l+.5*(c-l),[n,t]="inside"===r?zE(s,f,n):Fb(t,e);return{x:n,y:t}})();return Object.assign(Object.assign({},t),{textAlign:"inside"===r?"center":"start",textBaseline:"middle",rotate:e})}function zE(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function WE(t,e,n){return e?(e=n?0:Math.sin(t)<0?90:-90,t/Math.PI*180+e):0}function GE(t,e,n,r){var{y:n,y1:i,autoRotate:a,rotateToAlignArc:o,radius:s=.5,offset:l=0}=n,e=Hb(r,e,[n,i]),{startAngle:n,endAngle:i}=e,r=r.getCenter(),n=(n+i)/2,i={textAlign:"center",textBaseline:"middle",rotate:WE(n,a,o)},{innerRadius:a,outerRadius:o}=e,[e,r]=zE(r,n,a+(o-a)*s+l);return Object.assign({x:e,y:r},i)}function HE(t,e,n){var n=n["bounds"],[n]=n;return{x:n[0],y:n[1]}}function VE(t,e,n,r){var i=n["bounds"];return 1===i.length?HE(0,0,n):(N0(r)?FE:B0(r)?GE:DE)(t,e,n,r)}function YE(t,e,n){var{innerRadius:n,outerRadius:t}=Hb(n,t,[e.y,e.y1]);return n+(t-n)}function qE(t,e,n){var{startAngle:n,endAngle:t}=Hb(n,t,[e.y,e.y1]);return(n+t)/2}function $E(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=qE(e,n,r),d=0<Math.sin(f)?1:-1,i=WE(f,i,a),a={textAlign:0<d||N0(r)?"start":"end",textBaseline:"middle",rotate:i},i=YE(e,n,r),[[e,n],[r,h],[f,i]]=function(t,e,n,r,i){var[n,a]=zE(t,e,n),[t,r]=zE(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)}IE.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var UE=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=b0(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=Rb(Lb(l(e+1),s))/Math.PI*180;return{x:i[0],y:i[1],transform:`rotate(${l})`,textAlign:"center",textBaseline:"middle"}},bottom:VE,bottomLeft:VE,bottomRight:VE,inside:VE,left:VE,outside:function(t,e,n,r){var i=n["bounds"];return 1===i.length?HE(0,0,n):(N0(r)?FE:B0(r)?$E:DE)(t,e,n,r)},right:VE,spider:function(t,e,n,r){var i,a,o,s,l,c;return B0(r)?({connectorLength:c,connectorLength2:i,connectorDistance:a}=n,o=at($E(0,e,n,r),[]),s=r.getCenter(),l=YE(e,n,r),e=qE(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 B0(r)?({connectorLength:o,connectorLength2:i,connectorDistance:a}=n,{x0:n,y0:s}=e=at($E(0,e,n,r),[]),l=r.getCenter(),r=function(t){if(B0(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=Ib([n-l[0],s-l[1]]),n=0<Math.sin(o)?1:-1,[s,l]=zE(l,o,r),e.x=s+(i+a)*n,e.y=l,e):{}},top:VE,topLeft:VE,topRight:VE});function XE(t,e,n,r,i){var a=e["position"],a=(o=n,void 0!==(a=a)?a:B0(o)?"inside":C0(o)?"right":"top"),o=r["inside"===a?"innerLabel":"label"],r=Object.assign({},o,e),e=UE[BE(a)];if(e)return Object.assign(Object.assign({},o),e(a,t,r,n,i));throw new Error("Unknown position: "+a)}const KE=(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=XE(t,e,l,c,s),{rotate:e=0,transform:o=""}=t,t=at(t,["rotate","transform"]);return lt(new dE).call(L,t).style("text",""+n).style("labelTransform",(o+` rotate(${+e}) `+r).trim()).style("labelTransformOrigin",i).style("coordCenter",l.getCenter()).call(L,a).node()}},ZE=(KE.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()}}),QE=(ZE.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(t,e)=>ZE(Object.assign({colorAttribute:"fill"},t),e)),JE=(QE.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(t,e)=>ZE(Object.assign({fill:"none",colorAttribute:"stroke"},t),e)),t5=(JE.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=R2();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 e5(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 n5(t,e,n){t=t?t():document.createElement("canvas");return t.width=e,t.height=n,t}t5.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},e5(3);const r5=function(n,r,t=16){const i=e5(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=n5(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 i5(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=n5(o,t,e).getContext("2d"),l=function(t,e){const n=(e=n5(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=r5(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=n5(o,t,e).getContext("2d");return i.putImageData(r,0,0),i}const a5=(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=x0(t,t=>t[2]),t=v0(t,t=>t[2]),c={gradient:u,opacity:h,minOpacity:d,maxOpacity:f,blur:p,useGradientOpacity:g},l=a&&o?i5(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()}},o5=(a5.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}))}}),s5=(o5.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},{BLACK:"#000",WHITE:"#fff",STROKE:"#416180"}),l5=t=>{var e={defaultColor:"#5B8FF9",defaultCategory10:"category10",defaultCategory20:"category20",defaultSize:1,elementActiveStroke:s5.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:s5.BLACK,lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:12,strokeWidth:0,connectorStroke:s5.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:s5.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:s5.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:s5.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:s5.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:s5.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:s5.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:s5.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:s5.STROKE,endMarkerFillOpacity:.95}},interaction:{active:{line:{line:{lineWidth:3}},interval:{rect:{stroke:s5.BLACK}},area:{area:{fillOpacity:.5}}},inactive:{area:{area:{fillOpacity:.3}}},selected:{},disabled:{}},axis:{arrow:!1,gridLineDash:[0,0],gridLineWidth:.5,gridStroke:s5.BLACK,gridStrokeOpacity:.05,labelAlign:"horizontal",labelFill:s5.BLACK,labelFillOpacity:.65,labelFontSize:12,labelFontWeight:"lighter",labelSpacing:8,line:!1,lineLineWidth:.5,lineStroke:s5.BLACK,lineStrokeOpacity:.45,tickLength:4,tickLineWidth:1,tickStroke:s5.BLACK,tickStrokeOpacity:.25,titleFill:s5.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:s5.BLACK,itemLabelFillOpacity:.65,itemLabelFontSize:12,itemLabelFontWeight:"lighter",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,8],itemValueFill:s5.BLACK,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"lighter",navButtonFill:s5.BLACK,navButtonFillOpacity:.65,navPageNumFill:s5.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!0,titleFill:s5.BLACK,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,tickStroke:s5.BLACK,tickStrokeOpacity:.25,rowPadding:0,colPadding:8},legendContinuous:{handleHeight:12,handleLabelFill:s5.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:s5.BLACK,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:s5.BLACK,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:s5.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:s5.BLACK,tickStrokeOpacity:.25},label:{fill:s5.BLACK,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:s5.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:s5.WHITE,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},slider:{trackSize:16,trackFill:s5.STROKE,trackFillOpacity:1,selectionFill:"#5B8FF9",selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:s5.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:s5.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:s5.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:s5.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)},c5=(l5.props={},{BLACK:"#fff",WHITE:"#000",STROKE:"#416180"}),u5=t=>{var e={defaultColor:"#5B8FF9",defaultCategory10:"category10",defaultCategory20:"category20",defaultSize:1,elementActiveStroke:c5.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:c5.BLACK,lineWidth:1}},text:{text:{fill:c5.BLACK,fillOpacity:.65,fontSize:12,strokeWidth:0,connectorStroke:c5.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:c5.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:c5.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:c5.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:c5.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:c5.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:c5.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:c5.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:c5.STROKE,endMarkerFillOpacity:.95}},interaction:{active:{line:{line:{lineWidth:3}},interval:{rect:{stroke:c5.BLACK}},area:{area:{fillOpacity:.5}}},inactive:{area:{area:{fillOpacity:.3}}},selected:{},disabled:{}},axis:{arrow:!1,gridLineDash:[0,0],gridLineWidth:.5,gridStroke:c5.BLACK,gridStrokeOpacity:.05,labelAlign:"horizontal",labelFill:c5.BLACK,labelFillOpacity:.65,labelFontSize:12,labelFontWeight:"lighter",labelSpacing:8,lineLineWidth:.5,lineStroke:c5.BLACK,lineStrokeOpacity:.45,tickLength:4,tickLineWidth:1,tickStroke:c5.BLACK,tickStrokeOpacity:.25,titleFill:c5.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:c5.BLACK,itemLabelFillOpacity:.65,itemLabelFontSize:12,itemLabelFontWeight:"lighter",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,8],itemValueFill:c5.BLACK,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"lighter",navButtonFill:c5.BLACK,navButtonFillOpacity:.45,navPageNumFill:c5.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!0,titleFill:c5.BLACK,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,tickStroke:c5.BLACK,tickStrokeOpacity:.25,rowPadding:0,colPadding:8},legendContinuous:{handleHeight:12,handleLabelFill:c5.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:c5.BLACK,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:c5.BLACK,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:c5.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:c5.BLACK,tickStrokeOpacity:.25},label:{fill:c5.BLACK,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:c5.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:c5.WHITE,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},slider:{trackSize:16,trackFill:c5.STROKE,trackFillOpacity:1,selectionFill:"#5B8FF9",selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:c5.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:c5.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{},title:{titleFill:c5.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:c5.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)},h5=(u5.props={},{BLACK:"#000",WHITE:"#fff",STROKE:"#888"}),f5=t=>{var e={defaultColor:"#4e79a7",defaultCategory10:"tableau10",defaultCategory20:"tableau10",defaultSize:1,elementActiveStroke:h5.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:h5.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:h5.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:h5.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:h5.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:h5.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:h5.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:h5.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:h5.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:h5.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:h5.STROKE,endMarkerFillOpacity:.95}},interaction:{active:{line:{line:{lineWidth:3}},interval:{rect:{stroke:h5.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:h5.BLACK,labelFillOpacity:1,labelFontSize:10,labelFontWeight:"normal",labelSpacing:4,line:!0,lineLineWidth:1,lineStroke:"#888",lineStrokeOpacity:1,tickLength:5,tickLineWidth:1,tickStroke:h5.STROKE,tickStrokeOpacity:1,titleFill:h5.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:h5.BLACK,itemLabelFillOpacity:1,itemLabelFontSize:10,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,4],itemValueFill:h5.BLACK,itemValueFillOpacity:1,itemValueFontSize:10,itemValueFontWeight:"normal",navButtonFill:h5.BLACK,navButtonFillOpacity:.45,navButtonSize:6,navPageNumFill:h5.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:10,padding:8,title:!0,titleFill:h5.BLACK,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold",titleSpacing:4,rowPadding:0,colPadding:8},legendContinuous:{handleHeight:12,handleLabelFill:h5.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:10,handleLabelFontWeight:"normal",handleMarkerFill:h5.BLACK,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:h5.BLACK,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:h5.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:h5.BLACK,fillOpacity:.65,fontSize:10,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:h5.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:h5.WHITE,fontSize:10,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},slider:{trackSize:16,trackFill:h5.STROKE,trackFillOpacity:.05,selectionFill:"#4e79a7",selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:h5.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:h5.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:10,handleLabelFontWeight:"normal"},scrollbar:{},title:{titleFill:h5.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:h5.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)};function d5(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)]}f5.props={};var p5,g5=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function y5(t){var e;if(e=g5.exec(t))return new m5({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 m5(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 v5(t,e){var n,e=d5(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+""}y5.prototype=m5.prototype,m5.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 b5={"%":(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)=>v5(100*t,e),r:v5,s:function(t,e){var n,r,i=d5(t,e);return i?(n=i[0],(i=(i=i[1])-(p5=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")+d5(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 x5(t){return t}var w5,M5=Array.prototype.map,k5=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function O5(t){var e,s,l,M=void 0===t.grouping||void 0===t.thousands?x5:(s=M5.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]+"",k=void 0===t.decimal?".":t.decimal+"",O=void 0===t.numerals?x5:(e=M5.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=y5(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"):b5[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=b5[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?k5[8+p5/3]:"")+a+(o&&"("===h?")":""),w)for(e=-1,n=t.length;++e<n;)if((r=t.charCodeAt(e))<48||57<r){a=(46===r?k+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 O(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=y5(t)).type="f",t)),e=3*Math.max(-8,Math.min(8,Math.floor((t=e,((t=d5(Math.abs(t)))?t[1]:NaN)/3)))),r=Math.pow(10,-e),i=k5[8+e/3];return function(t){return n(r*t)+i}}}}function E5(t,e,n){return t.querySelector(e)?lt(t).select(e):lt(t).append(n)}function S5(t){return Array.isArray(t)?t.join(", "):""+(t||"")}function A5(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)}Al=O5({thousands:",",grouping:[3],currency:["$",""]}),w5=Al.format,Al.formatPrefix;class _5 extends Ml{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 T5 extends _5{update(t){var e=t["subOptions"];this.attr(t),null!=(t=this.child)&&t.update(e)}}function P5(t,e){return null==(t=t.filter(t=>t.getOptions().name===e))?void 0:t[0]}function C5(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 L5(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"+Xe(t)]=e:r[t]=e}),Object.assign(Object.assign({},r),e)}function N5(t){var{innerWidth:t,innerHeight:e}=t.getOptions();return[t,e]}function j5(t){return"number"!=typeof t||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(15))}function R5(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]=Kp(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(L0(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 eb({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 I0(i)?(e=i.map("bottom"===r?[t,1]:[0,t]),"bottom"===r?(n=e[0],new eb({domain:[0,a],range:[0,1]}).map(n)):"left"===r?(n=e[1],new eb({domain:[0,o],range:[0,1]}).map(n)):t):t}}(o,s);return L0(s)||C0(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:N0(s)&&"center"===o||C0(s)&&(null==(r=a.getTicks)?void 0:r.call(a))&&["top","bottom","center","outer"].includes(o)?1-i:i,label:u(h(j5(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(j5(t),e,n)),id:String(e)}})}function I5(t,e,n){var r;return!(L0(r=e)&&C0(r)||R0(e))&&(void 0===t?!!n.getTicks:t)}function B5(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"+Og(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 D5,Fl=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?w5(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 F5=Fl(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=B5(0,0,r,o,u,c),r=Object.assign(Object.assign(Object.assign({},r),f),b),a=function(t,e){var[e,n]=N5(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]=D0(r);const[u,h]=F0(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=R5(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:S5(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:I5(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 cO({className:"axis",style:L5(i)})}}),z5=Fl(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=R5(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]=D0(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]=F0(i),[l,c]=N5(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=L5(ot({},t,a,e,Object.assign(Object.assign({type:"arc",data:i,titleText:S5(d),grid:p},g),h)));return new cO({style:rn(n,["transform"])})}}),W5=(F5.props={defaultPosition:"center",defaultSize:45,defaultOrder:0},z5.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0},e=>(...t)=>F5(Object.assign({},{crossPadding:50},e))(...t)),G5=(W5.props=Object.assign(Object.assign({},F5.props),{defaultPosition:"bottom"}),e=>(...t)=>F5(Object.assign({},{crossPadding:10},e))(...t));G5.props=Object.assign(Object.assign({},F5.props),{defaultPosition:"left"});const H5=a=>{const{important:o={}}=a,s=at(a,["important"]);return t=>{var e,{theme:n,coordinate:r,scales:i}=t;return F5(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]=F0(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 V5(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(Pe(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=Nx.get(t)||Nx.get("point");return(...t)=>{return new kc({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 Y5(t,{scales:e,library:n,markState:r}){const[i,a]=function(t,e){var n=P5(t,"shape"),r=P5(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)=>V5(t,n,0,0,{color:e}),s=t=>i+"."+a[t],l=t["itemMarker"];return P5(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 q5(t,e){var{labelFormatter:n=t=>""+t}=t,{scales:r,theme:i}=e,i={itemMarker:Y5(t,e),itemMarkerSize:(t=r,e=i.legendCategory.itemMarkerSize,(t=P5(t,"size"))?2*t.map(NaN):e),itemMarkerOpacity:function(t){if(t=P5(t,"opacity")){const n=t.getOptions()["range"];return(t,e)=>n[e]}}(r)};const a="string"==typeof n?w5(n):n,o=P5(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)}))})}H5.props=Object.assign(Object.assign({},F5.props),{defaultPosition:"center"});const $5=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}=C5(t,e,n);return{width:i,height:a}}(e,o,$5),a=A5(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:S5(c)}),q5(o,t)),{legendCategory:i={}}=n,t=L5(Object.assign({},i,e,h)),n=new T5({style:Object.assign(Object.assign({x:r.x,y:r.y,width:r.width,height:r.height},a),{subOptions:t})});return n.appendChild(new jO({className:"legend-category",style:t})),n}};function U5(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 X5(t){var t=t.getOptions()["domain"],[t,e]=[t[0],Tb(t)];return[t,e]}function K5(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:[ma(a).toString()]})),e),[l,c]=X5(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 Z5(t,e,n,r,i,a){var o=P5(t,"color"),n=function(t,e,n){var{size:r,crossPadding:i=0}=e,t=C5(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 ob){var r=o.getOptions()["range"],[i,s]=X5(o);if(o instanceof cb||o instanceof hb)return U5(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 K5(n,o,P5(t,"size"),P5(t,"opacity"),e,a)}$5.props={defaultPosition:"top",defaultOrder:1,defaultSize:40,defaultPadding:[20,10],defaultCrossPadding:[5,10]};const Q5=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=A5(d,f),{legendContinuous:c={}}=n,c=L5(Object.assign({},c,Object.assign(Object.assign({titleText:S5(p),labelAlign:"value",labelFormatter:"string"==typeof h?t=>w5(h)(t.label):h},Z5(t,r,e,u,Q5,n)),g),y)),t=new _5({style:Object.assign(Object.assign({x:i,y:a,width:o,height:s},l),{subOptions:c})});return t.appendChild(new eE({style:c})),t}},J5=(Q5.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:200,defaultLegendSize:60,defaultPadding:[20,10],defaultCrossPadding:[5,10]},e=>(...t)=>Q5(Object.assign({},{block:!0},e))(...t)),tS=(J5.props=Object.assign(Object.assign({},Q5.props),{defaultPosition:"top",defaultOrientation:"horizontal"}),n=>t=>{var e=t["scales"],e=P5(e,"size");return Q5(Object.assign({},{type:"size",data:e.getTicks().map((t,e)=>({value:t,label:String(t)}))},n))(t)}),eS=(tS.props=Object.assign(Object.assign({},Q5.props),{defaultPosition:"top",defaultOrientation:"horizontal"}),t=>tS(Object.assign({},{block:!0},t)));function nS(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"}}}eS.props=Object.assign(Object.assign({},Q5.props),{defaultPosition:"top",defaultOrientation:"horizontal"});D5={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=E5(e,".title","text").attr("className","title").call(L,Object.assign(Object.assign(Object.assign({},nS(0,n,r,l)),{fontSize:14,textBaseline:"top",text:i}),t)).node().getLocalBounds();E5(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({},nS(0,h.max[1]+s,r,l)),{fontSize:12,textBaseline:"top",text:a}),u))})}};const rS=class extends ac{constructor(t){super(t),this.descriptor=D5}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)}},iS=a=>({value:t,theme:e})=>{var{x:t,y:n,width:r,height:i}=t.bbox;return new rS({style:ot({},{style:e.title},Object.assign({x:t,y:n,width:r,height:i},a))})};function aS(t){return t.getBandWidth}function oS(t,e,n){if(!aS(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=qp(t,e);return r=n+a,t=0,e=i.length-1,i[Math.min(e,Math.max(t,r))]}function sS(t,e,n){if(!e)return t.getOptions().domain;if(!aS(t))return o=o0(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 lS(t,e,n,r,i,a){const{x:o,y:s}=i;i=(t,e)=>{var[t,n]=a.invert(t);return[oS(o,t,e),oS(s,n,e)]},t=i([t,e],!0),e=i([n,r],!1);return[sS(o,[t[0],e[0]]),sS(s,[t[1],e[1]])]}function cS(t,e){var[t,n]=t;return[e.map(t),e.map(n)+((t=e).getStep?t.getStep():0)]}iS.props={defaultPosition:"top",defaultOrder:2,defaultSize:36};const uS=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?w5(h):h;var l="horizontal"===u;const c=C0(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 qM({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(oS(n,t,!0))}},f),p))})}},hS=(uS.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1},t=>uS(Object.assign(Object.assign({},t),{orientation:"horizontal"}))),fS=(hS.props=Object.assign(Object.assign({},uS.props),{defaultPosition:"bottom"}),t=>uS(Object.assign(Object.assign({},t),{orientation:"vertical"}))),dS=(fS.props=Object.assign(Object.assign({},uS.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 XM({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}))})}}),pS=(dS.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1},t=>dS(Object.assign(Object.assign({},t),{orientation:"horizontal"}))),gS=(pS.props=Object.assign(Object.assign({},dS.props),{defaultPosition:"bottom"}),t=>dS(Object.assign(Object.assign({},t),{orientation:"vertical"}))),yS=(gS.props=Object.assign(Object.assign({},dS.props),{defaultPosition:"left"}),t=>()=>new hc),mS=(yS.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]=C0(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}}),vS=(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]=C0(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}},bS=(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]=C0(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}},xS=(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]=C0(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}},wS=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))},MS=(wS.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 kS(t,e){var n={};for(const i of e){var r=t.style[i];r&&(n[i]=r)}return n}MS.props={};const OS=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"];function ES(t){var{min:t,max:e}=t.getLocalBounds(),[t,n]=t,[e,r]=e;return[t,n,e-t,r-n]}function SS(t,e){var[n,r,i,t]=ES(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):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G2={})}(this,function(E){"use strict";var S="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},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 X(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 j(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 k(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,n={exports:{}};function z(){}function W(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function G(t,e,n,r,i){if("function"!=typeof n)throw new TypeError("The listener must be a function");n=new W(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 H(t,e){0==--t._eventsCount?t._events=new z:delete t._events[e]}function V(){this._events=new z,this._eventsCount=0}r=n,D=Object.prototype.hasOwnProperty,F="~",Object.create&&(z.prototype=Object.create(null),(new z).__proto__||(F=!1)),V.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},V.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},V.prototype.listenerCount=function(t){t=F?F+t:t,t=this._events[t];return t?t.fn?1:t.length:0},V.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},V.prototype.on=function(t,e,n){return G(this,t,e,n,!1)},V.prototype.once=function(t,e,n){return G(this,t,e,n,!0)},V.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||H(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:H(this,t)}}else H(this,t);return this},V.prototype.removeAllListeners=function(t){return t?(t=F?F+t:t,this._events[t]&&H(this,t)):(this._events=new z,this._eventsCount=0),this},V.prototype.off=V.prototype.removeListener,V.prototype.addListener=V.prototype.on,V.prefixed=F,r.exports=V.EventEmitter=V;var Y=n.exports,q=1e-6,$="undefined"!=typeof Float32Array?Float32Array:Array;function U(){var t=new $(9);return $!=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 K=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 Z(){var t=new $(16);return $!=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 Q(t){var e=new $(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}function J(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 tt(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 et(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 nt(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 rt(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,k=u*g-h*p,O=u*y-f*p,E=u*e-d*p,S=h*y-f*g,A=h*e-d*g,_=f*e-d*y,T=m*_-v*A+b*S+x*E-w*O+M*k;return T?(t[0]=(s*_-l*A+c*S)*(T=1/T),t[1]=(i*A-r*_-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*_-c*O)*T,t[5]=(n*_-i*E+a*O)*T,t[6]=(y*b-p*M-e*v)*T,t[7]=(u*M-f*b+d*v)*T,t[8]=(o*A-s*E+c*k)*T,t[9]=(r*E-n*A-a*k)*T,t[10]=(p*w-g*b+e*m)*T,t[11]=(h*b-u*w-d*m)*T,t[12]=(s*O-o*S-l*k)*T,t[13]=(n*S-r*O+i*k)*T,t[14]=(g*v-p*x-y*m)*T,t[15]=(u*x-h*v+f*m)*T,t):null}function it(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 ct(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 ut(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 ht(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 ft(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 dt(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 pt(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 gt(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}function yt(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 mt(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function vt(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 bt(t,e){var n=new $(3),r=(vt(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 xt(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 wt(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 Mt(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 kt(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 Ot=kt;function Et(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 St(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)<q&&Math.abs(c-d)<q&&Math.abs(e-n)<q?et(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 At(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 _t=Object.freeze({__proto__:null,create:Z,clone:Q,copy:J,fromValues:function(t,e,n,r,i,a,o,s,l,c,u,h,f,d,p,g){var y=new $(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:tt,identity:et,transpose:nt,invert:rt,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:it,multiply:ct,translate:ut,scale:ht,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,k,O=r[0],E=r[1],r=r[2],S=Math.hypot(O,E,r);return S<q?null:(O*=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=O*E*(i=1-n)-r*S,b=E*E*i+n,x=r*E*i+O*S,w=O*r*i+E*S,M=E*r*i-O*S,k=r*r*i+n,t[0]=a*(n=O*O*i+n)+c*(m=E*O*i+r*S)+d*(r=r*O*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*k,t[9]=o*w+u*M+p*k,t[10]=s*w+h*M+g*k,t[11]=l*w+f*M+y*k,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:ft,rotateY:dt,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:pt,fromScaling:gt,fromRotation:function(t,e,n){var r,i=n[0],a=n[1],n=n[2],o=Math.hypot(i,a,n);return o<q?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:yt,fromQuat2:function(t,e){var n=new $(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)),yt(t,e,n),t},getTranslation:mt,getScaling:vt,getRotation:bt,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:xt,fromQuat:wt,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:Mt,perspective:Mt,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:kt,ortho:Ot,orthoZO:Et,lookAt:St,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:At,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],k=e[6],O=e[7],E=e[8],S=e[9],A=e[10],_=e[11],T=e[12],P=e[13],C=e[14],e=e[15];return Math.abs(n-m)<=q*Math.max(1,Math.abs(n),Math.abs(m))&&Math.abs(r-v)<=q*Math.max(1,Math.abs(r),Math.abs(v))&&Math.abs(i-b)<=q*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(a-x)<=q*Math.max(1,Math.abs(a),Math.abs(x))&&Math.abs(o-w)<=q*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-M)<=q*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(l-k)<=q*Math.max(1,Math.abs(l),Math.abs(k))&&Math.abs(c-O)<=q*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(u-E)<=q*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(h-S)<=q*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(f-A)<=q*Math.max(1,Math.abs(f),Math.abs(A))&&Math.abs(d-_)<=q*Math.max(1,Math.abs(d),Math.abs(_))&&Math.abs(p-T)<=q*Math.max(1,Math.abs(p),Math.abs(T))&&Math.abs(g-P)<=q*Math.max(1,Math.abs(g),Math.abs(P))&&Math.abs(y-C)<=q*Math.max(1,Math.abs(y),Math.abs(C))&&Math.abs(t-e)<=q*Math.max(1,Math.abs(t),Math.abs(e))},mul:ct,sub:At});function v(){var t=new $(3);return $!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Tt(t){var e=new $(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Pt(t){var e=t[0],n=t[1],t=t[2];return Math.hypot(e,n,t)}function Ct(t,e,n){var r=new $(3);return r[0]=t,r[1]=e,r[2]=n,r}function Lt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Nt(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function jt(t,e,n){t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2]}function Rt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function It(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function Bt(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 Dt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Ft(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 zt(t,e,n,r){var i=e[0],a=e[1],e=e[2];t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t[2]=e+r*(n[2]-e)}function Wt(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 Gt(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 Ht(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)<=q*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(r-a)<=q*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(t-e)<=q*Math.max(1,Math.abs(t),Math.abs(e))}var Vt=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],e=e[2]-t[2];return Math.hypot(n,r,e)},Yt=Pt;function qt(){var t=new $(4);return $!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function $t(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 Ut(){var t=new $(4);return $!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Xt(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 Kt(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 Zt(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 Qt(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}v(),qt();var Jt=function(t,e,n,r){var i=new $(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},te=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},ee=Kt,ne=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 re(t){return t.map(function(t){return Array.isArray(t)?[].concat(t):t})}v(),Ct(1,0,0),Ct(0,1,0),Ut(),Ut(),U(),r=new $(2),$!=Float32Array&&(r[0]=0,r[1]=0);var ie={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};var ae={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function oe(t){return Array.isArray(t)&&t.every(function(t){var e=t[0].toLowerCase();return ae[e]===t.length-1&&"achlmqstvz".includes(e)})}function se(t){return oe(t)&&t.every(function(t){t=t[0];return t===t.toUpperCase()})}function le(t){return se(t)&&t.every(function(t){t=t[0];return"ACLMQZ".includes(t)})}function ce(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=ae[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,ae[n]))),ae[n]););}function ue(t){return 48<=t&&t<=57}function he(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 fe(t){var e,n,r,i,a,o=t.max,s=t.pathValue,l=t.index,c=s.charCodeAt(l),u=ae[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,he(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(ue(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&&ue(n))return t.err="[path-util]: Invalid path value at index "+a+', "'+i[a]+'" illegal number';for(;o<r&&ue(i.charCodeAt(o));)o+=1,s=!0;n=i.charCodeAt(o)}if(46===n){for(c=!0,o+=1;ue(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&&ue(i.charCodeAt(o))))return t.err="[path-util]: Invalid path value at index "+o+', "'+i[o]+'" invalid integer exponent';for(;o<r&&ue(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),he(t),t.index<o&&44===s.charCodeAt(t.index)&&(t.index+=1,he(t))}if(t.index>=t.max)break;if(!(48<=(e=s.charCodeAt(t.index))&&e<=57||43===e||45===e||46===e))break}ce(t)}else t.err='[path-util]: Invalid path value "'+s[l]+'" is not a path command'}var de=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 pe(t){var o,s,l,c;return se(t)?re(t):(t=function(t){if(oe(t))return re(t);var e=new de(t);for(he(e);e.index<e.max&&!e.err.length;)fe(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 ge(t){if(le(t))return re(t);for(var e,n,r,i,a,o,s,l=pe(t),c=m({},ie),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 ye(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function me(t,e,n,r,i,a,o,s,l,c){var u=120*Math.PI/180,h=Math.PI/180*(+i||0),f=[],d=(c?(b=c[0],x=c[1],m=c[2],v=c[3]):(t=(g=ye(t,e,-h)).x,e=g.y,1<(d=(p=(t-(s=(g=ye(s,l,-h)).x))/2)*p/(n*n)+(g=(e-(l=g.y))/2)*g/(r*r))&&(n*=d=Math.sqrt(d),r*=d),d=n*n,y=r*r,m=(a=(a===o?-1:1)*Math.sqrt(Math.abs((d*y-d*g*g-y*p*p)/(d*g*g+y*p*p))))*n*g/r+(t+s)/2,v=a*-r*p/n+(e+l)/2,b=Math.asin(((e-v)/r*Math.pow(10,9)>>0)/Math.pow(10,9)),x=Math.asin(((l-v)/r*Math.pow(10,9)>>0)/Math.pow(10,9)),b=t<m?Math.PI-b:b,x=s<m?Math.PI-x:x,b<0&&(b=2*Math.PI+b),x<0&&(x=2*Math.PI+x),o&&x<b&&(b-=2*Math.PI),!o&&b<x&&(x-=2*Math.PI)),x-b),p=(Math.abs(d)>u&&(y=x,g=s,a=l,x=b+u*(o&&b<x?1:-1),f=me(s=m+n*Math.cos(x),l=v+r*Math.sin(x),n,r,i,0,o,g,a,[x,y,m,v])),d=x-b,Math.cos(b)),u=Math.sin(b),i=Math.cos(x),o=Math.sin(x),g=Math.tan(d/4),a=4/3*n*g,y=4/3*r*g,m=[t,e],v=[t+a*u,e-y*p],b=[s+a*o,l-y*i],x=[s,l];if(v[0]=2*m[0]-v[0],v[1]=2*m[1]-v[1],c)return v.concat(b,x,f);for(var w=[],M=0,k=(f=v.concat(b,x,f)).length;M<k;M+=1)w[M]=M%2?ye(f[M-1],f[M],h).y:ye(f[M],f[M+1],h).x;return w}function ve(t,e,n){var r=t[0],t=t[1];return[r+(e[0]-r)*n,t+(e[1]-t)*n]}function be(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function xe(t,e,n,r,i){var a=be([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=ve([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 we(t,e,n,r){var t=[t,e],e=[n,r],i=ve(t,e,.5),e=ve(e,i,.5),a=ve(i,e,.5),o=ve(e,a,.5),s=ve(a,o,.5),t=xe(t[0],t[1],i[0],i[1],a[0]).point,i=xe(s[0],s[1],o[0],o[1],e[0]).point;return[t.x,t.y,i.x,i.y,n,r]}function Me(t,e){var n;if(void 0===e&&(e=!1),le(n=t)&&n.every(function(t){t=t[0];return"MC".includes(t)}))return n=re(t),e?[n,[]]:n;for(var r,i=ge(t),a=m({},ie),o=[],s="",l=i.length,c=[],u=0;u<l;u+=1){i[u]&&(s=i[u][0]),o[u]=s;var h=function(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(me(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(we(f,d,u,h));case"Z":return f===p&&d===g?["C",f,d,p,g,p,g]:["C"].concat(we(f,d,p,g))}return t}(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 ke(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 Oe(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,k,O,E,S,A,_,T,P,C,L,N,j,R=0;R<=u;R+=1)b=t,x=e,w=n,M=r,k=i,O=I,E=B,S=a,A=o,_=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*((k%360+360)%360),f=(T=b===S&&x===A?{x:b,y:x}:0===w||0===P?xe(b,x,S,A,_).point:(k=(b-S)/2,T=(x-A)/2,k={x:L(M)*k+C(M)*T,y:-C(M)*k+L(M)*T},1<(T=Math.pow(k.x,2)/Math.pow(w,2)+Math.pow(k.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(k.y,2)-Math.pow(P,2)*Math.pow(k.x,2))/(Math.pow(w,2)*Math.pow(k.y,2)+Math.pow(P,2)*Math.pow(k.x,2)),O=(O!==E?1:-1)*N(T<0?0:T),N=w*k.y/P*O,T=-P*k.x/w*O,O=L(M)*N-C(M)*T+(b+S)/2,b=C(M)*N+L(M)*T+(x+A)/2,x=ke({x:1,y:0},S={x:(k.x-N)/w,y:(k.y-T)/P}),A=ke(S,{x:(-k.x-N)/w,y:(-k.y-T)/P}),!E&&0<A?A-=2*j:E&&A<0&&(A+=2*j),S=x+(A%=2*j)*_,N=w*L(S),k=P*C(S),{x:L(M)*N-C(M)*k+O,y:C(M)*N+L(M)*k+b})).x,d=T.y,D&&v.push({x:f,y:d}),F&&(p+=be(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 Ee(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,k,O,E,S,A,_,T,P,C,L=0;L<=d;L+=1)M=t,k=e,O=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*O+3*C*Math.pow(P,2)*S+Math.pow(P,3)*_,y:Math.pow(C,3)*k+3*Math.pow(C,2)*P*E+3*C*Math.pow(P,2)*A+Math.pow(P,3)*T}).x,y=M.y,h&&w.push({x:g,y:y}),f&&(m+=be(b,[g,y])),b=[g,y],p&&l<=m&&l>v[2]&&(O=(m-l)/(m-v[2]),x={x:b[0]*(1-O)+v[0]*O,y:b[1]*(1-O)+v[1]*O}),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 Se(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,k,O,E,S,A,_=0;_<=h;_+=1)x=t,w=e,M=n,k=r,O=i,E=a,A=void 0,A=1-(S=_/h),d=(x={x:Math.pow(A,2)*x+2*A*S*M+Math.pow(S,2)*O,y:Math.pow(A,2)*w+2*A*S*k+Math.pow(S,2)*E}).x,p=x.y,c&&b.push({x:d,y:p}),u&&(g+=be(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 Ae(t,e,n){for(var r,i,a,o=ge(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=xe(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=Oe(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=Ee(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=Se(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=xe((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 _e(t){return(c=l=s=0)<=Me(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 Te(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?Ee(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=ve(n,i,r),i=ve(i,a,r),a=ve(a,e,r),o=ve(n,i,r),i=ve(i,a,r),r=ve(o,i,r),[["C"].concat(n,o,r),["C"].concat(i,a,e)]):[t,t]:[t];return{s:t,ss:n,l:s}})}var Pe=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},Ce=function(t){return"function"==typeof t},A=function(t){return null==t},Le={}.toString,Ne=function(t,e){return Le.call(t)==="[object "+e+"]"},je=function(t){return Array.isArray?Array.isArray(t):Ne(t,"Array")},Re=function(t){var e=typeof t;return null!==t&&"object"==e||"function"==e};var Ie=function(t){return"object"==typeof t&&null!==t},Be=function(t){if(!Ie(t)||!Ne(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},De=function(t){if(je(t))return t.reduce(function(t,e){return Math.max(t,e)},t[0])},Fe=function(t){if(je(t))return t.reduce(function(t,e){return Math.min(t,e)},t[0])},ze=function(t,n,e){if(!je(t)&&!Be(t))return t;var r=e,i=t,a=function(t,e){r=n(r,t,e)};if(i)if(je(i))for(var o=0,s=i.length;o<s&&!1!==a(i[o],o);o++);else if(Re(i))for(var l in i)if(i.hasOwnProperty(l)&&!1===a(i[l],l))break;return r},We=function(t){return Ne(t,"String")};var Ge=function(t,e,n){return t<e?e:n<t?n:t},He=function(t){return Ne(t,"Number")};function Ve(t,e,n){return void 0===n&&(n=1e-5),Math.abs(t-e)<n}function Ye(t){return A(t)?"":t.toString()}var qe=function(t,e){return(t%e+e)%e},$e=function(t){t=Ye(t);return t.charAt(0).toLowerCase()+t.substring(1)};function Ue(t){if("object"!=typeof t||null===t)return t;if(je(t))for(var e=[],n=0,r=t.length;n<r;n++)"object"==typeof t[n]&&null!=t[n]?e[n]=Ue(t[n]):e[n]=t[n];else for(var i in e={},t)"object"==typeof t[i]&&null!=t[i]?e[i]=Ue(t[i]):e[i]=t[i];return e}var Xe=function(t){t=Ye(t);return t.charAt(0).toUpperCase()+t.substring(1)},Ke=function(t){return Ne(t,"Boolean")},Ze=function(t){return void 0===t},Qe=Ue;function Je(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 tn(a,o){var s;if(Ce(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 en=5;function nn(t,e){if(t===e)return!0;if(t&&e&&!We(t)&&!We(e)){if(Pe(t)||Pe(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;r<t.length&&(n=nn(t[r],e[r]));r++);return n}if(Ie(t)||Ie(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=nn(t[i[r]],e[i[r]]));r++);return n}}return!1}function rn(t,r){return ze(t,function(t,e,n){return r.includes(n)||(t[n]=e),t},{})}function an(){}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||en,n){var o;n.hasOwnProperty(a)&&(null!==(o=n[a])&&Be(o)?(Be(e[a])||(e[a]={}),r<i?t(e[a],o,r+1,i):e[a]=n[a]):je(o)?(e[a]=[],e[a]=e[a].concat(o)):void 0!==o&&(e[a]=o))}}(t,e[r]);return t},on=nn,sn=function(t,e,n){for(var r=0,i=We(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return void 0===t||r<i.length?n:t},ln=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 cn(t,e,n){(t.prototype=e.prototype=n).constructor=t}function un(t,e){var n,r=Object.create(t.prototype);for(n in e)r[n]=e[n];return r}function hn(){}var n="\\s*([+-]?\\d+)\\s*",r="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",fn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",dn=/^#([0-9a-f]{3,8})$/,pn=new RegExp("^rgb\\("+[n,n,n]+"\\)$"),gn=new RegExp("^rgb\\("+[fn,fn,fn]+"\\)$"),yn=new RegExp("^rgba\\("+[n,n,n,r]+"\\)$"),mn=new RegExp("^rgba\\("+[fn,fn,fn,r]+"\\)$"),vn=new RegExp("^hsl\\("+[r,fn,fn]+"\\)$"),bn=new RegExp("^hsla\\("+[r,fn,fn,r]+"\\)$"),xn={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 wn(){return this.rgb().formatHex()}function Mn(){return this.rgb().formatRgb()}function kn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=dn.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?On(e):3===n?new Sn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?En(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?En(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=pn.exec(t))?new Sn(e[1],e[2],e[3],1):(e=gn.exec(t))?new Sn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=yn.exec(t))?En(e[1],e[2],e[3],e[4]):(e=mn.exec(t))?En(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=vn.exec(t))?Pn(e[1],e[2]/100,e[3]/100,1):(e=bn.exec(t))?Pn(e[1],e[2]/100,e[3]/100,e[4]):xn.hasOwnProperty(t)?On(xn[t]):"transparent"===t?new Sn(NaN,NaN,NaN,0):null}function On(t){return new Sn(t>>16&255,t>>8&255,255&t,1)}function En(t,e,n,r){return new Sn(t=r<=0?e=n=NaN:t,e,n,r)}function Sn(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function An(){return"#"+Tn(this.r)+Tn(this.g)+Tn(this.b)}function _n(){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 Tn(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Pn(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||1<=n?t=e=NaN:e<=0&&(t=NaN),new Ln(t,e,n,r)}function Cn(t){var e,n,r,i,a,o,s,l;return t instanceof Ln?new Ln(t.h,t.s,t.l,t.opacity):(t=t instanceof hn?t:kn(t))?t instanceof Ln?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 Ln(o,s,l,t.opacity)):new Ln}function Ln(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Nn(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 jn(t,e,n,r){t-=n,n=e-r;return Math.sqrt(t*t+n*n)}function Rn(t,e){var n=Math.min.apply(Math,k([],j(t),!1)),r=Math.min.apply(Math,k([],j(e),!1));return{x:n,y:r,width:Math.max.apply(Math,k([],j(t),!1))-n,height:Math.max.apply(Math,k([],j(e),!1))-r}}function In(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,k,O,h=0;h<x.length;h++){M=e,E=r,k=i,O=x[h];var E=n*Math.sin(k)*Math.cos(O)+E*Math.cos(k)*Math.sin(O)+M;E<v&&(v=E),b<E&&(b=E)}return{x:l,y:v,width:c-l,height:b-v}}cn(hn,kn,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:wn,formatHex:wn,formatHsl:function(){return Cn(this).formatHsl()},formatRgb:Mn,toString:Mn}),cn(Sn,function(t,e,n,r){return 1===arguments.length?(i=(i=t)instanceof hn?i:kn(i))?new Sn((i=i.rgb()).r,i.g,i.b,i.opacity):new Sn:new Sn(t,e,n,null==r?1:r);var i},un(hn,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Sn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Sn(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:An,formatHex:An,formatRgb:_n,toString:_n})),cn(Ln,function(t,e,n,r){return 1===arguments.length?Cn(t):new Ln(t,e,n,null==r?1:r)},un(hn,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Ln(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Ln(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 Sn(Nn(240<=t?t-240:120+t,n,e),Nn(t,n,e),Nn(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 Bn(t,e,n,r,i,a){for(var o=-1,s=1/0,l=[n,r],c=20,u=1/(c=a&&200<a?a/10:c),h=u/10,f=0;f<=c;f++){var d=f*u,p=[i.apply(void 0,k([],j(t.concat([d])),!1)),i.apply(void 0,k([],j(e.concat([d])),!1))];(m=jn(l[0],l[1],p[0],p[1]))<s&&(o=d,s=m)}if(0===o)return{x:t[0],y:e[0]};if(1===o)return{x:t[(n=t.length)-1],y:e[n-1]};for(s=1/0,f=0;f<32&&!(h<1e-4);f++){var g=o-h,y=o+h,p=[i.apply(void 0,k([],j(t.concat([g])),!1)),i.apply(void 0,k([],j(e.concat([g])),!1))],m=jn(l[0],l[1],p[0],p[1]);0<=g&&m<s?(o=g,s=m):(g=[i.apply(void 0,k([],j(t.concat([y])),!1)),i.apply(void 0,k([],j(e.concat([y])),!1))],g=jn(l[0],l[1],g[0],g[1]),y<=1&&g<s?(o=y,s=g):h*=.5)}return{x:i.apply(void 0,k([],j(t.concat([o])),!1)),y:i.apply(void 0,k([],j(e.concat([o])),!1))}}function Dn(t,e,n,r){return jn(t,e,n,r)}function Fn(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function zn(t,e,n,r,i,a){var o,s,l,n=[n-t,r-e];return(r=n)[0]===(o=[0,0])[0]&&r[1]===o[1]?Math.sqrt((i-t)*(i-t)+(a-e)*(a-e)):(s=(n=o=r=[-n[1],n[0]])[0],l=n[1],0<(s=s*s+l*l)&&(s=1/Math.sqrt(s)),o[0]=n[0]*s,o[1]=n[1]*s,l=[i-t,a-e],Math.abs(l[0]*r[0]+l[1]*r[1]))}function Wn(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 Gn(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 Ve(r,0)?Ve(n,0)||0<=(i=-e/n)&&i<=1&&t.push(i):Ve(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 Hn(t,e,n,r,i,a,o,s,l,c,u){t=Bn([t,n,i,o],[e,r,a,s],l,c,Wn,u);return jn(t.x,t.y,l,c)}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+=jn(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 Ve(n,0)?[.5]:(t=(t-e)/n)<=1&&0<=t?[t]:[]}function $n(t,e,n,r,i,a,o,s){t=Bn([t,n,i],[e,r,a],o,s,Yn);return jn(t.x,t.y,o,s)}function Un(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(Xn(e,r,n),0<a(e[i],h)&&Xn(e,r,i);f<d;){for(Xn(e,f,d),f++,d--;a(e[f],h)<0;)f++;for(;0<a(e[d],h);)d--}0===a(e[r],h)?Xn(e,r,d):Xn(e,++d,i),d<=n&&(r=d+1),n<=d&&(i=d-1)}}(t,e,n||0,r||t.length-1,i||Kn)}function Xn(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Kn(t,e){return t<e?-1:e<t?1:0}function Zn(t,e){Qn(t,0,t.children.length,e,t)}function Qn(t,e,n,r,i){(i=i||or(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 tr(t,e){return t.minX-e.minX}function er(t,e){return t.minY-e.minY}function nr(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function rr(t){return t.maxX-t.minX+(t.maxY-t.minY)}function ir(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function ar(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function or(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function sr(t,e,n,r,i){for(var a,o=[e,n];o.length;)(n=o.pop())-(e=o.pop())<=r||(Un(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(ar(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;ar(t,s)&&(e.leaf?n.push(o):ir(t,s)?this._all(o,n):i.push(o))}e=i.pop()}return n},n.prototype.collides=function(t){var e=this.data;if(ar(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(ar(t,a)){if(e.leaf||ir(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=or([]),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||!ir(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)Zn(i=or(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=or([])).leaf=!1,i.height=r;var s=Math.ceil(a/o),l=s*Math.ceil(Math.sqrt(o));sr(t,e,n,l,this.compareMinX);for(var c=e;c<=n;c+=l){var u=Math.min(c+l-1,n);sr(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))}}Zn(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=nr(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=or(n.children.splice(i,n.children.length-i));r.height=n.height,r.leaf=n.leaf,Zn(n,this.toBBox),Zn(r,this.toBBox),e?t[e-1].children.push(r):this._splitRoot(n,r)},n.prototype._splitRoot=function(t,e){this.data=or([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Zn(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=Qn(t,0,c,this.toBBox),h=Qn(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=nr(u)+nr(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:tr,i=t.leaf?this.compareMinY:er;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=Qn(t,0,e,i),o=Qn(t,n-e,n,i),s=rr(a)+rr(o),l=e;l<n-e;l++){var c=t.children[l];Jn(a,t.leaf?i(c):c),s+=rr(a)}for(var u=n-e-1;e<=u;u--){var h=t.children[u];Jn(o,t.leaf?i(h):h),s+=rr(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():Zn(t[e],this.toBBox)};var O,lr,cr=n,n=((fn=O=O||{}).GROUP="g",fn.CIRCLE="circle",fn.ELLIPSE="ellipse",fn.IMAGE="image",fn.RECT="rect",fn.LINE="line",fn.POLYLINE="polyline",fn.POLYGON="polygon",fn.TEXT="text",fn.PATH="path",fn.HTML="html",fn.MESH="mesh",(r=lr=lr||{})[r.ZERO=0]="ZERO",r[r.NEGATIVE_ONE=1]="NEGATIVE_ONE",ur.prototype.addRenderingPlugin=function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)},ur.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)})},ur);function ur(){this.plugins=[]}hr.prototype.registerPlugin=function(e){-1===this.plugins.findIndex(function(t){return t===e})&&this.plugins.push(e)},hr.prototype.unregisterPlugin=function(e){var t=this.plugins.findIndex(function(t){return t===e});-1<t&&this.plugins.splice(t,1)},hr.prototype.getPlugins=function(){return this.plugins},hr.prototype.getPlugin=function(e){return this.plugins.find(function(t){return t.name===e})},hr.prototype.getConfig=function(){return this.config},hr.prototype.setConfig=function(t){Object.assign(this.config,t)};fn=hr;function hr(t){this.clipSpaceNearZ=lr.NEGATIVE_ONE,this.plugins=[],this.config=m({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1},t)}function fr(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function dr(t,e,n){t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2]}function pr(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function gr(t,e,n){t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n}function yr(t){return void 0===t?0:360<t||t<-360?t%360:t}function mr(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Array.isArray(t)&&3===t.length?Tt(t):He(t)?Ct(t,e,n):Ct(t[0],t[1]||e,t[2]||n)}function vr(t){return t*(Math.PI/180)}function br(t){return t*(180/Math.PI)}function xr(t,e){return 16===e.length?(n=t,r=e,o=.5*Math.PI,s=(c=j(vt(v(),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 wr(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 $(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 Mr(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=br(Math.atan2(n,e));return[t[6],t[7],a,o,r]}var kr=Z(),Or=Z(),Er=qt(),d=[v(),v(),v()],Sr=v();function Ar(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}(kr,t)&&(J(Or,kr),Or[3]=0,Or[7]=0,Or[11]=0,Or[15]=1,!(Math.abs(it(Or))<1e-8))){var t=kr[3],o=kr[7],s=kr[11],l=kr[12],c=kr[13],u=kr[14],h=kr[15];if(0!==t||0!==o||0!==s){if(Er[0]=t,Er[1]=o,Er[2]=s,Er[3]=h,!rt(Or,Or))return;nt(Or,Or),$t(i,Er,Or)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=l,e[1]=c,e[2]=u,t=kr,(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]=Pt(d[0]),Bt(d[0],d[0]),r[0]=Dt(d[0],d[1]),_r(d[1],d[1],d[0],1,-r[0]),n[1]=Pt(d[1]),Bt(d[1],d[1]),r[0]/=n[1],r[1]=Dt(d[0],d[2]),_r(d[2],d[2],d[0],1,-r[1]),r[2]=Dt(d[1],d[2]),_r(d[2],d[2],d[1],1,-r[2]),n[2]=Pt(d[2]),Bt(d[2],d[2]),r[1]/=n[2],r[2]/=n[2],Ft(Sr,d[1],d[2]),Dt(d[0],Sr)<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 _r(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}Pr.isEmpty=function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]},Pr.prototype.update=function(t,e){fr(this.center,t),fr(this.halfExtents,e),dr(this.min,this.center,this.halfExtents),pr(this.max,this.center,this.halfExtents)},Pr.prototype.setMinMax=function(t,e){pr(this.center,e,t),gr(this.center,this.center,.5),dr(this.halfExtents,e,t),gr(this.halfExtents,this.halfExtents,.5),fr(this.min,t),fr(this.max,e)},Pr.prototype.getMin=function(){return this.min},Pr.prototype.getMax=function(){return this.max},Pr.prototype.add=function(t){var e,n,r,i,a,o,s,l,c,u,h,f,d,p,g;Pr.isEmpty(t)||(Pr.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))},Pr.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],dr(this.min,n,r),pr(this.max,n,r)},Pr.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]},Pr.prototype.intersection=function(t){var e,n,r,i;return this.intersects(t)?(e=new Pr,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},Pr.prototype.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?fr([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]]},Pr.prototype.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?fr([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 Tr=Pr;function Pr(){this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}Nr.prototype.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(0<=this.normal[0])<<8)+(Number(0<=this.normal[1])<<4)+Number(0<=this.normal[2])},Nr.prototype.distanceToPoint=function(t){return Dt(t,this.normal)-this.distance},Nr.prototype.normalize=function(){var t=1/Yt(this.normal);It(this.normal,this.normal,t),this.distance*=t},Nr.prototype.intersectsLine=function(t,e,n){var r=this.distanceToPoint(t),r=r/(r-this.distanceToPoint(e)),i=0<=r&&r<=1;return i&&n&&zt(n,t,e,r),i};var Cr,Lr=Nr;function Nr(t,e){this.distance=t||0,this.normal=e||Ct(0,1,0),this.updatePNVertexFlag()}(r=Cr=Cr||{})[r.OUTSIDE=4294967295]="OUTSIDE",r[r.INSIDE=0]="INSIDE",r[r.INDETERMINATE=2147483647]="INDETERMINATE";Rr.prototype.extractFromVPMatrix=function(t){var t=j(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];Nt(this.planes[0].normal,i-e,l-a,f-c),this.planes[0].distance=t-d,Nt(this.planes[1].normal,i+e,l+a,f+c),this.planes[1].distance=t+d,Nt(this.planes[2].normal,i+n,l+o,f+u),this.planes[2].distance=t+p,Nt(this.planes[3].normal,i-n,l-o,f-u),this.planes[3].distance=t-p,Nt(this.planes[4].normal,i-r,l-s,f-h),this.planes[4].distance=t-g,Nt(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 jr=Rr;function Rr(t){if(this.planes=[],t)this.planes=t;else for(var e=0;e<6;e++)this.planes.push(new Lr)}Br.prototype.clone=function(){return new Br(this.x,this.y)},Br.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y};var Ir=Br;function Br(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}Fr.prototype.toJSON=function(){};var Dr=Fr;function Fr(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 zr,Wr,Gr,Hr="Method not implemented.",Vr="Use document.documentElement instead.";(r=zr=zr||{})[r.ORBITING=0]="ORBITING",r[r.EXPLORING=1]="EXPLORING",r[r.TRACKING=2]="TRACKING",(r=Wr=Wr||{})[r.DEFAULT=0]="DEFAULT",r[r.ROTATIONAL=1]="ROTATIONAL",r[r.TRANSLATIONAL=2]="TRANSLATIONAL",r[r.CINEMATIC=3]="CINEMATIC",(r=Gr=Gr||{})[r.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",r[r.PERSPECTIVE=1]="PERSPECTIVE";var g,Yr,qr,$r,Ur="updated",r=(i.prototype.isOrtho=function(){return this.projectionMode===Gr.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===zr.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===zr.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!==zr.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 rt(Z(),this.matrix)},i.prototype.getWorldTransform=function(){return this.matrix},i.prototype.jitterProjectionMatrix=function(t,e){t=pt(Z(),[t,e,0]);this.jitteredProjectionMatrix=ct(Z(),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===Gr.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===Gr.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===Gr.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===Gr.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===Gr.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===Gr.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=Ct(t.x-r,t.y-n,0),e=Dt(i,this.right)/Pt(this.right),r=Dt(i,this.up)/Pt(this.up);return this.pan(-e,-r),this},i.prototype.setPerspective=function(t,e,n,r){this.projectionMode=Gr.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(vr(.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===lr.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,ht(this.projectionMatrix,this.projectionMatrix,Ct(1,-1,1)),rt(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},i.prototype.setOrthographic=function(t,e,n,r,i,a){this.projectionMode=Gr.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===lr.NEGATIVE_ONE?Ot:Et)(this.projectionMatrix,s,n,r,e,i,a),ht(this.projectionMatrix,this.projectionMatrix,Ct(1,-1,1)),rt(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},i.prototype.setPosition=function(t,e,n){t=mr(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=Ct(0,1,0);return this.focalPoint=mr(t,e,n),this.trackingMode===Wr.CINEMATIC&&(t=(r=Rt(v(),this.focalPoint,this.position))[0],e=r[1],n=r[2],r=Pt(r),e=br(Math.asin(e/r)),r=90+br(Math.atan2(n,t)),dt(n=Z(),n,vr(r)),ft(n,n,vr(e)),i=Wt(v(),[0,1,0],n)),rt(this.matrix,St(Z(),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=v(),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=yr(t),this.computeMatrix(),this._getAxes(),this.type===zr.ORBITING||this.type===zr.EXPLORING?this._getPosition():this.type===zr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},i.prototype.getAzimuth=function(){return this.azimuth},i.prototype.setElevation=function(t){return this.elevation=yr(t),this.computeMatrix(),this._getAxes(),this.type===zr.ORBITING||this.type===zr.EXPLORING?this._getPosition():this.type===zr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},i.prototype.getElevation=function(){return this.elevation},i.prototype.setRoll=function(t){return this.roll=yr(t),this.computeMatrix(),this._getAxes(),this.type===zr.ORBITING||this.type===zr.EXPLORING?this._getPosition():this.type===zr.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=Xt(Ut(),[0,0,1],vr(this.roll)),e=(et(this.matrix),Xt(Ut(),[1,0,0],vr((this.rotateWorld&&this.type!==zr.TRACKING||this.type===zr.TRACKING?1:-1)*this.elevation))),n=Xt(Ut(),[0,1,0],vr((this.rotateWorld&&this.type!==zr.TRACKING||this.type===zr.TRACKING?1:-1)*this.azimuth)),n=Kt(Ut(),n,e),n=Kt(Ut(),n,t),e=wt(Z(),n);this.type===zr.ORBITING||this.type===zr.EXPLORING?(ut(this.matrix,this.matrix,this.focalPoint),ct(this.matrix,this.matrix,e),ut(this.matrix,this.matrix,[0,0,this.distance])):this.type===zr.TRACKING&&(ut(this.matrix,this.matrix,this.position),ct(this.matrix,this.matrix,e))},i.prototype._setPosition=function(t,e,n){this.position=mr(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(){Lt(this.right,mr($t(qt(),[1,0,0,0],this.matrix))),Lt(this.up,mr($t(qt(),[0,1,0,0],this.matrix))),Lt(this.forward,mr($t(qt(),[0,0,1,0],this.matrix))),Bt(this.right,this.right),Bt(this.up,this.up),Bt(this.forward,this.forward)},i.prototype._getAngles=function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=Pt(this.distanceVector);0===r?(this.elevation=0,this.azimuth=0):this.type===zr.TRACKING||this.rotateWorld?(this.elevation=br(Math.asin(e/r)),this.azimuth=br(Math.atan2(-t,-n))):(this.elevation=-br(Math.asin(e/r)),this.azimuth=-br(Math.atan2(-t,-n)))},i.prototype._getPosition=function(){Lt(this.position,mr($t(qt(),[0,0,0,1],this.matrix))),this._getDistance()},i.prototype._getFocalPoint=function(){var t,e;Gt(this.distanceVector,[0,0,-this.distance],(t=U(),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)),jt(this.focalPoint,this.position,this.distanceVector),this._getDistance()},i.prototype._getDistance=function(){this.distanceVector=Rt(v(),this.focalPoint,this.position),this.distance=Pt(this.distanceVector),this.dollyingStep=this.distance/100},i.prototype._getOrthoMatrix=function(){var t,e;this.projectionMode===Gr.ORTHOGRAPHIC&&(t=this.position,e=Xt(Ut(),[0,0,1],-this.roll*Math.PI/180),xt(this.orthoMatrix,e,Ct((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),Ct(this.zoom,this.zoom,1),t))},i.prototype.triggerUpdate=function(){var t;this.enableUpdate&&(t=this.getViewTransform(),t=ct(Z(),this.getPerspective(),t),this.getFrustum().extractFromVPMatrix(t),this.eventEmitter.emit(Ur))},i.prototype.rotate=function(t,e,n){throw new Error(Hr)},i.prototype.pan=function(t,e){throw new Error(Hr)},i.prototype.dolly=function(t){throw new Error(Hr)},i.prototype.createLandmark=function(t,e){throw new Error(Hr)},i.prototype.gotoLandmark=function(t,e){throw new Error(Hr)},i.prototype.cancelLandmarkAnimation=function(){throw new Error(Hr)},i);function i(){this.clipSpaceNearZ=lr.NEGATIVE_ONE,this.eventEmitter=new Y,this.matrix=Z(),this.right=Ct(1,0,0),this.up=Ct(0,1,0),this.forward=Ct(0,0,1),this.position=Ct(0,0,1),this.focalPoint=Ct(0,0,0),this.distanceVector=Ct(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=Z(),this.projectionMatrixInverse=Z(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=zr.EXPLORING,this.trackingMode=Wr.DEFAULT,this.projectionMode=Gr.PERSPECTIVE,this.frustum=new jr,this.orthoMatrix=Z()}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,(a=g=g||{})[a.kUnknown=0]="kUnknown",a[a.kNumber=1]="kNumber",a[a.kPercentage=2]="kPercentage",a[a.kEms=3]="kEms",a[a.kPixels=4]="kPixels",a[a.kRems=5]="kRems",a[a.kDegrees=6]="kDegrees",a[a.kRadians=7]="kRadians",a[a.kGradians=8]="kGradians",a[a.kTurns=9]="kTurns",a[a.kMilliseconds=10]="kMilliseconds",a[a.kSeconds=11]="kSeconds",a[a.kInteger=12]="kInteger",(a=Yr=Yr||{})[a.kUNumber=0]="kUNumber",a[a.kUPercent=1]="kUPercent",a[a.kULength=2]="kULength",a[a.kUAngle=3]="kUAngle",a[a.kUTime=4]="kUTime",a[a.kUOther=5]="kUOther",(a=qr=qr||{})[a.kYes=0]="kYes",a[a.kNo=1]="kNo",(a=$r=$r||{})[a.kYes=0]="kYes",a[a.kNo=1]="kNo";function Kr(t){var e=1;switch(t){case g.kPixels:case g.kDegrees:case g.kSeconds:break;case g.kMilliseconds:e=.001;break;case g.kRadians:e=180/Math.PI;break;case g.kGradians:e=.9;break;case g.kTurns:e=360}return e}function Zr(t){switch(t){case g.kNumber:case g.kInteger:return"";case g.kPercentage:return"%";case g.kEms:return"em";case g.kRems:return"rem";case g.kPixels:return"px";case g.kDegrees:return"deg";case g.kRadians:return"rad";case g.kGradians:return"grad";case g.kMilliseconds:return"ms";case g.kSeconds:return"s";case g.kTurns:return"turn"}return""}var Qr,Jr=[{name:"em",unit_type:g.kEms},{name:"px",unit_type:g.kPixels},{name:"deg",unit_type:g.kDegrees},{name:"rad",unit_type:g.kRadians},{name:"grad",unit_type:g.kGradians},{name:"ms",unit_type:g.kMilliseconds},{name:"s",unit_type:g.kSeconds},{name:"rem",unit_type:g.kRems},{name:"turn",unit_type:g.kTurns}],ti=((a=Qr=Qr||{})[a.kUnknownType=0]="kUnknownType",a[a.kUnparsedType=1]="kUnparsedType",a[a.kKeywordType=2]="kKeywordType",a[a.kUnitType=3]="kUnitType",a[a.kSumType=4]="kSumType",a[a.kProductType=5]="kProductType",a[a.kNegateType=6]="kNegateType",a[a.kInvertType=7]="kInvertType",a[a.kMinType=8]="kMinType",a[a.kMaxType=9]="kMaxType",a[a.kClampType=10]="kClampType",a[a.kTransformType=11]="kTransformType",a[a.kPositionType=12]="kPositionType",a[a.kURLImageType=13]="kURLImageType",a[a.kColorType=14]="kColorType",a[a.kUnsupportedColorType=15]="kUnsupportedColorType",function(e){return Jr.find(function(t){return t.name===e}).unit_type}),a=(ei.isAngle=function(t){return t===g.kDegrees||t===g.kRadians||t===g.kGradians||t===g.kTurns},ei.isLength=function(t){return t>=g.kEms&&t<g.kDegrees},ei.isRelativeUnit=function(t){return t===g.kPercentage||t===g.kEms||t===g.kRems},ei.isTime=function(t){return t===g.kSeconds||t===g.kMilliseconds},ei.prototype.toString=function(){return this.buildCSSText(qr.kNo,$r.kNo,"")},ei.prototype.isNumericValue=function(){return this.getType()>=Qr.kUnitType&&this.getType()<=Qr.kClampType},ei);function ei(){}t(ai,ni=a),ai.prototype.getType=function(){return Qr.kColorType},ai.prototype.to=function(t){return this};var ni,ri,ii=ai;function ai(t){var e=ni.call(this)||this;return e.colorSpace=t,e}(s=ri=ri||{})[s.Constant=0]="Constant",s[s.LinearGradient=1]="LinearGradient",s[s.RadialGradient=2]="RadialGradient";t(li,oi=a),li.prototype.clone=function(){return new li(this.type,this.value)},li.prototype.buildCSSText=function(t,e,n){return n},li.prototype.getType=function(){return Qr.kColorType};var oi,si=li;function li(t,e){var n=oi.call(this)||this;return n.type=t,n.value=e,n}t(hi,ci=a),hi.prototype.clone=function(){return new hi(this.value)},hi.prototype.getType=function(){return Qr.kKeywordType},hi.prototype.buildCSSText=function(t,e,n){return n+this.value};var ci,ui=hi;function hi(t){var e=ci.call(this)||this;return e.value=t,e}function fi(t){return t.split("").map(function(t,e){return t.toUpperCase()===t?"".concat(0!==e?"-":"").concat(t.toLowerCase()):t}).join("")}var di=Xr(function(t){return(t=void 0===t?"":t).replace(/-([a-z])/g,function(t){return t[1].toUpperCase()})});function pi(t){return"function"==typeof t}function gi(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 yi(t){switch(function(t){switch(t){case g.kNumber:case g.kInteger:return Yr.kUNumber;case g.kPercentage:return Yr.kUPercent;case g.kPixels:return Yr.kULength;case g.kMilliseconds:case g.kSeconds:return Yr.kUTime;case g.kDegrees:case g.kRadians:case g.kGradians:case g.kTurns:return Yr.kUAngle;default:return Yr.kUOther}}(t)){case Yr.kUNumber:return g.kNumber;case Yr.kULength:return g.kPixels;case Yr.kUPercent:return g.kPercentage;case Yr.kUTime:return g.kSeconds;case Yr.kUAngle:return g.kDegrees;default:return g.kUnknown}}var mi,vi={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},bi=Xr(function(t){var t=di(t),e=vi[t];return(null==e?void 0:e.alias)||t}),xi=(t(wi,mi=a),wi.prototype.clone=function(){return new wi(this.value,this.unit)},wi.prototype.equals=function(t){return this.value===t.value&&this.unit===t.unit},wi.prototype.getType=function(){return Qr.kUnitType},wi.prototype.convertTo=function(t){var e;return this.unit===t?new wi(this.value,this.unit):(e=yi(this.unit))!==yi(t)||e===g.kUnknown?null:(e=Kr(this.unit)/Kr(t),new wi(this.value*e,t))},wi.prototype.buildCSSText=function(t,e,n){switch(this.unit){case g.kUnknown:break;case g.kInteger:i=Number(this.value).toFixed(0);break;case g.kNumber:case g.kPercentage:case g.kEms:case g.kRems:case g.kPixels:case g.kDegrees:case g.kRadians:case g.kGradians:case g.kMilliseconds:case g.kSeconds:case g.kTurns:var r,i,a=this.value,o=Zr(this.unit);i=a<-999999||999999<a?(r=Zr(this.unit),!Number.isFinite(a)||Number.isNaN(a)?gi(a,r):a+(r||"")):"".concat(a).concat(o)}return n+=i},wi);function wi(t,e){void 0===e&&(e=g.kNumber);var n=mi.call(this)||this,r="string"==typeof e?(r=e)?"number"===r?g.kNumber:"percent"===r||"%"===r?g.kPercentage:ti(r):g.kUnknown:e;return n.unit=r,n.value=t,n}var Mi,ki=new xi(0,"px"),Oi=(new xi(1,"px"),new xi(0,"deg")),Ei=(t(Si,Mi=ii),Si.prototype.clone=function(){return new Si(this.r,this.g,this.b,this.alpha)},Si.prototype.buildCSSText=function(t,e,n){return n+"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")},Si);function Si(t,e,n,r,i){void 0===r&&(r=1),void 0===i&&(i=!1);var a=Mi.call(this,"rgb")||this;return a.r=t,a.g=e,a.b=n,a.alpha=r,a.isNone=i,a}function Ai(t){return Ci[t]||(Ci[t]=new ui(t)),Ci[t]}var _i,Ti,o,Pi=new ui("unset"),s=new ui("initial"),a=new ui("inherit"),Ci={"":Pi,unset:Pi,initial:s,inherit:a},Li=new Ei(0,0,0,0,!0),Ni=new Ei(0,0,0,0),ji=Xr(function(t,e,n,r){return new Ei(t,e,n,r)},function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")}),Ri=function(t,e){return void 0===e&&(e=g.kNumber),new xi(t,e)},Ii=new xi(50,"%"),Bi=(_i=_i||{},_i[_i.Standard=0]="Standard",(ii=Ti=Ti||{})[ii.ADDED=0]="ADDED",ii[ii.REMOVED=1]="REMOVED",{absolutePath:[],hasArc:!(ii[ii.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED"),segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Dr(0,0,0,0)});(s=o=o||{}).COORDINATE="<coordinate>",s.COLOR="<color>",s.PAINT="<paint>",s.NUMBER="<number>",s.ANGLE="<angle>",s.OPACITY_VALUE="<opacity-value>",s.SHADOW_BLUR="<shadow-blur>",s.LENGTH="<length>",s.PERCENTAGE="<percentage>",s.LENGTH_PERCENTAGE="<length> | <percentage>",s.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",s.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",s.LIST_OF_POINTS="<list-of-points>",s.PATH="<path>",s.FILTER="<filter>",s.Z_INDEX="<z-index>",s.OFFSET_DISTANCE="<offset-distance>",s.DEFINED_PATH="<defined-path>",s.MARKER="<marker>",s.TRANSFORM="<transform>",s.TRANSFORM_ORIGIN="<transform-origin>",s.TEXT="<text>",s.TEXT_TRANSFORM="<text-transform>";Di={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]+\.?))/},Fi="";var Di,Fi,zi=function(t){return Fi=t,Gi()};function Wi(t){throw new Error(Fi+": "+t)}function Gi(){var t=Qi(Hi);return 0<Fi.length&&Wi("Invalid input not EOF"),t}function Hi(){return Vi("linear-gradient",Di.linearGradient,qi)||Vi("repeating-linear-gradient",Di.repeatingLinearGradient,qi)||Vi("radial-gradient",Di.radialGradient,$i)||Vi("repeating-radial-gradient",Di.repeatingRadialGradient,$i)||Vi("conic-gradient",Di.conicGradient,$i)}function Vi(n,t,r){return Yi(t,function(t){var e=r();return e&&!aa(Di.comma)&&Wi("Missing comma before color stops"),{type:n,orientation:e,colorStops:Qi(Ji)}})}function Yi(t,e){t=aa(t);if(t)return aa(Di.startCall)||Wi("Missing ("),e=e(t),aa(Di.endCall)||Wi("Missing )"),e}function qi(){return ia("directional",Di.sideOrCorner,1)||ia("angular",Di.angleValue,1)}function $i(){var t,e,n=Ui();return n&&((t=[]).push(n),e=Fi,aa(Di.comma))&&((n=Ui())?t.push(n):Fi=e),t}function Ui(){var t,e=function(){var t=ia("shape",/^(circle)/i,0);t&&(t.style=ra()||Xi());return t}()||function(){var t=ia("shape",/^(ellipse)/i,0);t&&(t.style=ea()||Xi());return t}();return e?e.at=Ki():(t=Xi())?(e=t,(t=Ki())&&(e.at=t)):(t=Zi())&&(e={type:"default-radial",at:t}),e}function Xi(){return ia("extent-keyword",Di.extentKeywords,1)}function Ki(){var t;if(ia("position",/^at/,0))return(t=Zi())||Wi("Missing positioning value"),t}function Zi(){var t={x:ea(),y:ea()};if(t.x||t.y)return{type:"position",value:t}}function Qi(t){var e=t(),n=[];if(e)for(n.push(e);aa(Di.comma);)(e=t())?n.push(e):Wi("One extra comma");return n}function Ji(){var t=ia("hex",Di.hexColor,1)||Yi(Di.rgbaColor,function(){return{type:"rgba",value:Qi(ta)}})||Yi(Di.rgbColor,function(){return{type:"rgb",value:Qi(ta)}})||ia("literal",Di.literalColor,0);return t||Wi("Expected color definition"),t.length=ea(),t}function ta(){return aa(Di.number)[1]}function ea(){return ia("%",Di.percentageValue,1)||na()||ra()}function na(){return ia("position-keyword",Di.positionKeywords,1)}function ra(){return ia("px",Di.pixelValue,1)||ia("em",Di.emValue,1)}function ia(t,e,n){e=aa(e);if(e)return{type:t,value:e[n]}}function aa(t){var e=/^[\n\r\t\s]+/.exec(Fi),e=(e&&oa(e[0].length),t.exec(Fi));return e&&oa(e[0].length),e}function oa(t){Fi=Fi.substring(t)}var sa=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,la=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,ca=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,ua=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var ha={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},fa=Xr(function(t){t="angular"===t.type?Number(t.value):ha[t.value]||0;return Ri(t,"deg")}),da=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:Ri(n,i),cy:Ri(r,a)}}),pa=Xr(function(t){if(-1<t.indexOf("linear")||-1<t.indexOf("radial"))return zi(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(!A(c)&&!A(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:Ri(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 si(ri.LinearGradient,{angle:r?fa(r):Oi,steps:d}):"radial-gradient"===n&&"shape"===(r=r||[{type:"shape",value:"circle"}])[0].type&&"circle"===r[0].value?(n=(t=da(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?Ai(r):Ri(r,h)),new si(ri.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=sa.exec(t);if(n)return r=(null==(r=n[2].match(ua))?void 0:r.map(function(t){return t.split(":")}))||[],[new si(ri.LinearGradient,{angle:Ri(parseFloat(n[1]),"deg"),steps:r.map(function(t){var t=j(t,2),e=t[0],t=t[1];return{offset:Ri(100*Number(e),"%"),color:t}})})]}else if("r"===e){n=function(t){var t=la.exec(t);if(t)return t=(null==(t=t[4].match(ua))?void 0:t.map(function(t){return t.split(":")}))||[],{cx:Ri(50,"%"),cy:Ri(50,"%"),steps:t.map(function(t){var t=j(t,2),e=t[0],t=t[1];return{offset:Ri(100*Number(e),"%"),color:t}})};return null}(t);if(n&&!We(n))return[new si(ri.RadialGradient,n)]}else if("p"===e){var r=t;if(r=ca.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 ga(t){return t&&t.image}function ya(t){return t&&!A(t.r)&&!A(t.g)&&!A(t.b)}var ma=Xr(function(t){var e;return ga(t)?m({repetition:"repeat"},t):"transparent"===(t=A(t)?"":t)?Ni:pa(t="currentColor"===t?"black":t)||(e=[0,0,0,0],null!==(t=kn(t))&&(e[0]=t.r||0,e[1]=t.g||0,e[2]=t.b||0,e[3]=t.opacity),ji.apply(void 0,k([],j(e),!1)))});function va(t,e){if(ya(t)&&ya(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(Ge(e[n],0,255));return e[3]=Ge(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function ba(t,e){if(A(e))return Ri(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if(0<="px".search(t))return Ri(Number(e),"px");if(0<="deg".search(t))return Ri(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 Ri(Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(r,"g"),"*0")),t)})[0]}var xa=Xr(function(t){return ba(new RegExp("px","g"),t)}),wa=(Xr(function(t){return ba(new RegExp("%","g"),t)}),function(t){return He(t)||isFinite(Number(t))?Ri(Number(t)||0,"px"):ba(new RegExp("px|%|em|rem","g"),t)}),Ma=Xr(function(t){return ba(new RegExp("deg|rad|grad|turn","g"),t)});function ka(t){var e=0;return t.unit===g.kDegrees?e=t.value:t.unit===g.kRadians?e=br(Number(t.value)):t.unit===g.kTurns&&(e=360*Number(t.value)),e}function Oa(t,e){var n;return Array.isArray(t)?n=t.map(function(t){return Number(t)}):We(t)?n=t.split(" ").map(function(t){return Number(t)}):He(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 Ea(t){return We(t)?t.split(" ").map(function(t){return wa(t)}):t.map(function(t){return wa(t.toString())})}function Sa(t,e,n){return 0===t.value?0:t.unit===g.kPixels?Number(t.value):t.unit===g.kPercentage&&n?(n=n.nodeName===O.GROUP?n.getLocalBounds():n.geometry.contentBounds,t.value/100*n.halfExtents[e]*2):0}var Aa=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function _a(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<Aa.indexOf(e[1])&&r.push({name:e[1],params:e[2].split(" ").map(function(t){return ba(/deg|rad|grad|turn|px|%/g,t)||ma(t)})}),n.lastIndex===t.length)return r}return[]}function Ta(t){return t.toString()}var Pa=Xr(function(t){return"number"==typeof t?Ri(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Ri(Number(t)):Ri(0)});function Ca(t,e){return[t,e,Ta]}function La(n,r){return function(t,e){return[t,e,function(t){return Ta(Ge(t,n,r))}]}}function Na(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function ja(t){var e;return 0===t.parsedStyle.path.totalLength&&(t.parsedStyle.path.totalLength=Ae(t.parsedStyle.path.absolutePath,void 0,m(m({},e),{bbox:!1,length:!0})).length),t.parsedStyle.path.totalLength}function Ra(t,e){return t[0]===e[0]&&t[1]===e[1]}function Ia(t,e){for(var n,r,i,a,o,s,l,c,u,h=[],f=[],d=[],p=0;p<t.length;p++){var g=(O=t[p]).currentPoint,y=O.params,m=O.prePoint,v=void 0;switch(O.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=Rn(c,u);break;case"C":v=function(t,e,n,r,i,a,o,s){for(var l=[t,o],c=[e,s],u=Gn(t,n,i,o),h=Gn(e,r,a,s),f=0;f<u.length;f++)l.push(Wn(t,n,i,o,u[f]));for(f=0;f<h.length;f++)c.push(Wn(e,r,a,s,h[f]));return Rn(l,c)}(m[0],m[1],y[1],y[2],y[3],y[4],y[5],y[6]);break;case"A":var b=O.arcParams,v=In(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&&(O.box=v,h.push(v.x,v.x+v.width),f.push(v.y,v.y+v.height)),e&&("L"===O.command||"M"===O.command)&&O.prePoint&&O.nextPoint&&d.push(O)}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=Fe(h),w=Fe(f),M=De(h),k=De(f);if(0!==d.length)for(p=0;p<d.length;p++){var O;(g=(O=d[p]).currentPoint)[0]===x?x-=Ba(O,e).xExtra:g[0]===M&&(M+=Ba(O,e).xExtra),g[1]===w?w-=Ba(O,e).yExtra:g[1]===k&&(k+=Ba(O,e).yExtra)}return{x:x,y:w,width:M-x,height:k-w}}function Ba(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)||Ve(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 Da(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}Xr(function(t){return(We(t)?t.split(" "):t).map(Pa)});function Fa(t,e,n,r,i,a,o,s){var l,c,u;return e=Math.abs(e),n=Math.abs(n),r=vr(r=qe(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=za({x:1,y:0},o={x:(u.x-c)/e,y:(u.y-i)/n}),o=za(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 za=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 Wa(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=qe(vr(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=Ya([1,0],p),h=Ya(p,u);Va(p,u)<=-1&&(h=Math.PI);1<=Va(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:Ra(t,[c,e])?0:n,ry:Ra(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]&&Ra(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=Da((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=Da((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=Ga(u,0)).x,b=b.y,y=(m=Ga(u,1,!1)).x,m=m.y,u.startTangent=[c,b],u.endTangent=[y,m]),e.push(u)}return e}function Ga(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=Fa({x:t.prePoint[0],y:t.prePoint[1]},i,a,o,!!s,!!r,{x:t.currentPoint[0],y:t.currentPoint[1]},e),i=Fa({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 Ha(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Va(t,e){return Ha(t)*Ha(e)?(t[0]*e[0]+t[1]*e[1])/(Ha(t)*Ha(e)):1}function Ya(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(Va(t,e))}function qa(t,e,n,r){var i=(-1+Math.sqrt(2))/3*4,a=t*i,i=e*i,o=n-t,t=n+t,s=r-e,e=r+e;return[["M",o,r],["C",o,r-i,n-a,s,n,s],["C",n+a,s,t,r-i,t,r],["C",t,r+i,n+a,e,n,e],["C",n-a,e,o,r+i,o,r],["Z"]]}function $a(t,e){void 0===e&&(e=t.getLocalTransform());var n,r,i,a,o,s,l,c,u,h,f,d,p=[];switch(t.nodeName){case O.LINE:var g=t.parsedStyle,y=g.x1,m=g.y1,v=g.x2,g=g.y2,p=[["M",void 0===y?0:y,void 0===m?0:m],["L",void 0===v?0:v,void 0===g?0:g]];break;case O.CIRCLE:var y=t.parsedStyle,m=y.r,v=void 0===m?0:m,g=y.cx,b=void 0===g?0:g,m=y.cy;p=qa(v,v,b,void 0===m?0:m);break;case O.ELLIPSE:g=t.parsedStyle,y=g.rx,v=g.ry,m=g.cx,b=void 0===m?0:m,m=g.cy;p=qa(void 0===y?0:y,void 0===v?0:v,b,void 0===m?0:m);break;case O.POLYLINE:case O.POLYGON:g=t.parsedStyle.points;y=g.points,v=t.nodeName===O.POLYGON,y=y.map(function(t,e){return[0===e?"M":"L",t[0],t[1]]}),v&&y.push(["Z"]),p=y;break;case O.RECT:var b=t.parsedStyle,m=b.width,x=void 0===m?0:m,g=b.height,w=void 0===g?0:g,m=b.x,g=void 0===m?0:m,m=b.y,m=void 0===m?0:m,b=b.radius,M=b&&b.some(function(t){return 0!==t});n=x,r=w,g=g,m=m,p=(M=M&&b.map(function(t){return Ge(t,0,Math.min(Math.abs(x)/2,Math.abs(w)/2))}))?(l=(o=0<n?1:-1)+(s=0<r?1:-1)!=0?1:0,[["M",o*(i=(M=j(M,4))[0])+g,m],["L",n-o*(a=M[1])+g,m],a?["A",a,a,0,0,l,n+g,s*a+m]:null,["L",n+g,r-s*(a=M[2])+m],a?["A",a,a,0,0,l,n+g-o*a,r+m]:null,["L",g+o*(a=M[3]),r+m],a?["A",a,a,0,0,l,g,r+m-s*a]:null,["L",g,s*i+m],i?["A",i,i,0,0,l,o*i+g,m]:null,["Z"]].filter(function(t){return t})):[["M",g,m],["L",g+n,m],["L",g+n,m+r],["L",g,m+r],["Z"]];break;case O.PATH:p=k([],j(t.parsedStyle.path.absolutePath),!1)}if(p.length)return c=p,u=e,h=(e=(e=t).parsedStyle).defX,f=void 0===h?0:h,d=void 0===(h=e.defY)?0:h,c.reduce(function(t,e){var n,r,i,a="";return"M"===e[0]||"L"===e[0]?(n=Ct(e[1]-f,e[2]-d,0),u&&Wt(n,n,u),a="".concat(e[0]).concat(n[0],",").concat(n[1])):"Z"===e[0]?a=e[0]:"C"===e[0]?(r=Ct(e[1]-f,e[2]-d,0),i=Ct(e[3]-f,e[4]-d,0),n=Ct(e[5]-f,e[6]-d,0),u&&(Wt(r,r,u),Wt(i,i,u),Wt(n,n,u)),a="".concat(e[0]).concat(r[0],",").concat(r[1],",").concat(i[0],",").concat(i[1],",").concat(n[0],",").concat(n[1])):"A"===e[0]?(n=Ct(e[6]-f,e[7]-d,0),u&&Wt(n,n,u),a="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(n[0],",").concat(n[1])):"Q"===e[0]&&(r=Ct(e[1]-f,e[2]-d,0),i=Ct(e[3]-f,e[4]-d,0),u&&(Wt(r,r,u),Wt(i,i,u)),a="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}")),t+a},"")}function Ua(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=ge(e)}catch(t){n=ge(""),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=Wa(n),a=(l=Ia(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 Xa=Xr(Ua);function Ka(t){return(We(t)?Xa:Ua)(t)}function Za(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=Me(t.absolutePath,!1),t.curve=f),d&&0!==d.length||(d=Me(e.absolutePath,!1),e.curve=d),[f,d]),f=_e((t=f.length!==d.length?function t(e,n,r){var i,e=Te(e),n=Te(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])!==_e(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))}))):re(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+=be(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 Qa(t,e){var n,r,i=We(t)?t.split(" ").map(function(t){var t=j(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=Dn(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,k([],j(i.map(function(t){return t[0]})),!1))),l=Math.min.apply(Math,k([],j(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 Ja(t,e){return[t.points,e.points,function(t){return t}]}var to=null;function eo(t){return function(e){var n=0;return t.map(function(t){return t===to?e[n++]:t})}}function no(t){return t}var ro={matrix:["NNNNNN",[to,to,0,0,to,to,0,0,0,0,1,0,to,to,0,1],no],matrix3d:["NNNNNNNNNNNNNNNN",no],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",eo([to,to,new xi(1)]),no],scalex:["N",eo([to,new xi(1),new xi(1)]),eo([to,new xi(1)])],scaley:["N",eo([new xi(1),to,new xi(1)]),eo([new xi(1),to])],scalez:["N",eo([new xi(1),new xi(1),to])],scale3d:["NNN",no],skew:["Aa",null,no],skewx:["A",null,eo([to,Oi])],skewy:["A",null,eo([Oi,to])],translate:["Tt",eo([to,to,ki]),no],translatex:["T",eo([to,ki,ki]),eo([to,ki])],translatey:["T",eo([ki,to,ki]),eo([ki,to])],translatez:["L",eo([ki,ki,to])],translate3d:["TTL",no]};function io(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=ro[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()?Oi:Ma(t)},N:Pa,T:wa,L:xa}[f.toUpperCase()](h):{a:Oi,n:c[0],t:ki}[f]))return[];c.push(d)}if(r.push({t:a,d:c}),n.lastIndex===t.length)return r}return[]}function ao(t){switch(t.t){case"rotatex":return i=vr(ka(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=vr(ka(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=vr(ka(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=vr(ka(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=vr(ka(t.d[0])),a=vr(ka(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=vr(ka(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=vr(ka(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=Sa(t.d[0],0,null)||0,n=Sa(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Sa(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=Sa(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=Sa(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Sa(t.d[0],0,null)||0,n=Sa(t.d[1],0,null)||0,r=Sa(t.d[2],0,null)||0,1];case"perspective":a=Sa(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 oo(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 so(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 Ar(0===(t=t).length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(ao).reduce(oo),e,n,r,i,a),[[e,n,r,a,i]]}var lo=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=co(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=co(a,u)),n[1]&&(u[2][1]=0,u[2][0]=n[0],a=co(a,u)),n[0]&&(u[2][0]=0,u[1][0]=n[0],a=co(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 co(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 uo(t){return t.toFixed(6).replace(".000000","")}function ho(e,n){var r,i;return e.decompositionPair!==n&&(e.decompositionPair=n,r=so(e)),n.decompositionPair!==e&&(n.decompositionPair=e,i=so(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=Ge(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 lo(t[0],t[1],t[2],e,t[4]).map(uo).join(",")}])}function fo(t){return t.replace(/[xy]/,"")}function po(t){return t.replace(/(x|y|z|3d)?$/,"3d")}var go=function(t,e){return"perspective"===t&&"perspective"===e||("matrix"===t||"matrix3d"===t)&&("matrix"===e||"matrix3d"===e)};function yo(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?Ri(n):Ri(n,t.unit)})})}(n)}var a=[],o=[],s=[];if(r.length!==i.length)a=[(g=ho(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=ro[l],d=ro[c],p=void 0;if(go(l,c)){var g=ho([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]&&fo(l)===fo(c))p=fo(l),u=f[2](u),h=d[2](h);else{if(!f[1]||!d[1]||po(l)!==po(c)){a=[(g=ho(r,i))[0]],o=[g[1]],s=[["matrix",[g[2]]]];break}p=po(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=yi(t.unit),c=t.convertTo(l),l=e.convertTo(l);return c&&l?(o=c.value,s=l.value,a=Zr(t.unit)):(xi.isLength(t.unit)||xi.isLength(e.unit))&&(o=Sa(t,i,n),s=Sa(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 mo=Xr(function(t){var e;return We(t)?"text-anchor"===t?[Ri(0,"px"),Ri(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:[wa(vo(e[0])),wa(vo(e[1]))]):[Ri(t[0]||0,"px"),Ri(t[1]||0,"px")]});function vo(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var bo=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:o.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:o.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:o.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:o.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:o.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:o.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:o.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:o.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:o.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:o.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:o.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:o.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:o.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:o.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:o.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:o.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:o.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:o.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:o.FILTER},{n:"clipPath",syntax:o.DEFINED_PATH},{n:"textPath",syntax:o.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:o.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:o.TRANSFORM},{n:"transformOrigin",p:100,d:function(t){return t===O.CIRCLE||t===O.ELLIPSE?"center":t===O.TEXT?"text-anchor":"left top"},l:!0,syntax:o.TRANSFORM_ORIGIN},{n:"anchor",p:99,d:function(t){return t===O.CIRCLE||t===O.ELLIPSE?"0.5 0.5":"0 0"},l:!0,syntax:o.LENGTH_PERCENTAGE_12},{n:"cx",int:!0,d:"0",syntax:o.COORDINATE},{n:"cy",int:!0,d:"0",syntax:o.COORDINATE},{n:"cz",int:!0,d:"0",syntax:o.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:o.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:o.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:o.LENGTH_PERCENTAGE},{n:"x",int:!0,d:"0",syntax:o.COORDINATE},{n:"y",int:!0,d:"0",syntax:o.COORDINATE},{n:"z",int:!0,d:"0",syntax:o.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:o.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:o.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:o.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:o.COORDINATE},{n:"y1",int:!0,l:!0,syntax:o.COORDINATE},{n:"z1",int:!0,l:!0,syntax:o.COORDINATE},{n:"x2",int:!0,l:!0,syntax:o.COORDINATE},{n:"y2",int:!0,l:!0,syntax:o.COORDINATE},{n:"z2",int:!0,l:!0,syntax:o.COORDINATE},{n:"path",int:!0,l:!0,d:"",a:["d"],syntax:o.PATH,p:50},{n:"points",int:!0,l:!0,syntax:o.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:o.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:o.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:o.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:o.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:o.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:o.NUMBER,d:function(t){return t===O.PATH||t===O.POLYGON||t===O.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:o.MARKER},{n:"markerEnd",syntax:o.MARKER},{n:"markerMid",syntax:o.MARKER},{n:"markerStartOffset",syntax:o.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:o.LENGTH,l:!0,int:!0,d:"0"}],xo=bo.filter(function(t){return!!t.l}).map(function(t){return t.n}),wo={},Mo=new WeakMap,a=(ko.prototype.registerMetadata=function(e){k([e.n],j(e.a||[]),!1).forEach(function(t){wo[t]=e})},ko.prototype.unregisterMetadata=function(t){delete wo[t]},ko.prototype.getPropertySyntax=function(t){return this.runtime.CSSPropertySyntaxFactory[t]},ko.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=wo[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<xo.length;h++)if(xo[h]in e){u=!0;break}e.fill&&(n.parsedStyle.fill=ma(e.fill)),e.stroke&&(n.parsedStyle.stroke=ma(e.stroke)),e.shadowColor&&(n.parsedStyle.shadowColor=ma(e.shadowColor)),e.filter&&(n.parsedStyle.filter=_a(e.filter)),A(e.radius)||(n.parsedStyle.radius=Oa(e.radius,4)),A(e.lineDash)||(n.parsedStyle.lineDash=Oa(e.lineDash,2)),e.points&&(n.parsedStyle.points=Qa(e.points,n)),""===e.path&&(n.parsedStyle.path=m({},Bi)),e.path&&(n.parsedStyle.path=Ka(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=Oa(e.anchor,2)),e.transform&&(n.parsedStyle.transform=io(e.transform)),e.transformOrigin&&(n.parsedStyle.transformOrigin=mo(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!==O.CIRCLE&&n.nodeName!==O.ELLIPSE||A(e.cx)&&A(e.cy))&&(n.nodeName!==O.RECT&&n.nodeName!==O.IMAGE&&n.nodeName!==O.GROUP&&n.nodeName!==O.HTML&&n.nodeName!==O.TEXT&&n.nodeName!==O.MESH||A(e.x)&&A(e.y)&&A(e.z))&&(n.nodeName!==O.LINE||A(e.x1)&&A(e.y1)&&A(e.z1)&&A(e.x2)&&A(e.y2)&&A(e.z2))||this.runtime.CSSPropertySyntaxFactory["<coordinate>"].postProcessor(n,o),A(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),A(e.offsetDistance)||this.runtime.CSSPropertySyntaxFactory["<offset-distance>"].postProcessor(n,o),e.transform&&this.runtime.CSSPropertySyntaxFactory["<transform>"].postProcessor(n,o),u&&this.updateGeometry(n)}},ko.prototype.parseProperty=function(t,e,n){var r,t=wo[t],i=e;return"unset"===(e=""!==e&&!A(e)?e:"unset")||"initial"===e||"inherit"===e?i=Ai(e):t&&(r=t.k,t=(t=t.syntax)&&this.getPropertySyntax(t),r&&-1<r.indexOf(e)?i=Ai(e):t&&t.parser&&(i=t.parser(e,n))),i},ko.prototype.computeProperty=function(t,e,n){var r=wo[t],i="g-root"===n.id,a=e;if(r){var o=r.syntax,s=r.inh,r=r.d;if(e instanceof ui){var l=e.value;if("initial"===(l="unset"===l?s&&!i?"inherit":"initial":l))A(r)||(e=this.parseProperty(t,pi(r)?r(n.nodeName):r,n));else if("inherit"===l)return s=this.tryToResolveProperty(n,t,{inherited:!0}),A(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 ui?e.value:e}return a},ko.prototype.postProcessProperty=function(t,e,n){var t=wo[t];t&&t.syntax&&(t=t.syntax&&this.getPropertySyntax(t.syntax))&&t.postProcessor&&t.postProcessor(e,n)},ko.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)},ko.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},ko.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))},ko.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 Tr),s.renderBounds||(s.renderBounds=new Tr),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===O.TEXT?delete e.anchor:y===O.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===O.POLYLINE||y===O.POLYGON||y===O.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,pr(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?Sa(a[0],0,t):0),m=(y?-1:1)*(a?Sa(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))},ko.prototype.isPropertyInheritable=function(t){t=wo[t];return!!t&&t.inh},ko);function ko(t){var e=this;this.runtime=t,bo.forEach(function(t){e.registerMetadata(t)})}Oo.prototype.calculator=function(t,e,n,r){return ka(n)};ii=Oo;function Oo(){this.parser=Ma,this.parserWithCSSDisabled=null,this.mixer=Ca}Eo.prototype.calculator=function(t,e,n,r,i){return n instanceof ui&&(n=null),i.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach(function(t){0===t.childNodes.length&&i.sceneGraphService.dirtifyToRoot(t)}),n};s=Eo;function Eo(){}Ao.prototype.calculator=function(t,e,n,r){return n instanceof ui?"none"===n.value?Li:Ni:n};var So=Ao;function Ao(){this.parser=ma,this.parserWithCSSDisabled=ma,this.mixer=va}To.prototype.calculator=function(t,e,n){return n instanceof ui?[]:n};var _o=To;function To(){this.parser=_a}function Po(t){t=t.parsedStyle.fontSize;return A(t)?null:t}Lo.prototype.calculator=function(t,e,n,r,i){var a,o;return He(n)?n:xi.isRelativeUnit(n.unit)?(i=i.styleValueRegistry,n.unit===g.kPercentage?0:n.unit===g.kEms?r.parentNode&&(o=Po(r.parentNode))?o*n.value:(i.addUnresolveProperty(r,t),0):n.unit===g.kRems?null!=(a=null==r?void 0:r.ownerDocument)&&a.documentElement&&(o=Po(r.ownerDocument.documentElement))?o*n.value:(i.addUnresolveProperty(r,t),0):void 0):n.value};var Co=Lo;function Lo(){this.parser=wa,this.parserWithCSSDisabled=null,this.mixer=Ca}jo.prototype.parser=function(t){t=Ea(He(t)?[t]:t),t=1===t.length?[t[0],t[0]]:[t[0],t[1]];return t},jo.prototype.calculator=function(t,e,n){return n.map(function(t){return t.value})};var No=jo;function jo(){this.mixer=Na}Io.prototype.parser=function(t){t=Ea(He(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},Io.prototype.calculator=function(t,e,n){return n.map(function(t){return t.value})};var Ro=Io;function Io(){this.mixer=Na}var Bo=Z();function Do(t,l){var c=l.parsedStyle.defX||0,u=l.parsedStyle.defY||0;return 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||[ki,ki])[0].value,e[1].value,0):"translatex"===s?l.translateLocal((e=t||[ki])[0].value,0,0):"translatey"===s?l.translateLocal(0,(e=t||[ki])[0].value,0):"translatez"===s?l.translateLocal(0,0,(e=t||[ki])[0].value):"translate3d"===s?l.translateLocal((e=t||[ki,ki,ki])[0].value,e[1].value,e[2].value):"rotate"===s?l.rotateLocal(0,0,ka((t||[Oi])[0])):"rotatex"===s?l.rotateLocal(ka((t||[Oi])[0]),0,0):"rotatey"===s?l.rotateLocal(0,ka((t||[Oi])[0]),0):"rotatez"===s?l.rotateLocal(0,0,ka((t||[Oi])[0])):"rotate3d"!==s&&("skew"===s?(n=(null==t?void 0:t.map(function(t){return t.value}))||[0,0],l.setLocalSkew(vr(n[0]),vr(n[1]))):"skewx"===s?(n=(null==t?void 0:t.map(function(t){return t.value}))||[0],l.setLocalSkew(vr(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],vr(n[0]))):"matrix"===s?(e=(o=j(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(tt(Bo,e,n,0,0,r,i,0,0,0,0,1,0,a+c,o+u,0,1))):"matrix3d"===s&&(tt.apply(_t,k([Bo],j(t.map(function(t){return t.value})),!1)),Bo[12]+=c,Bo[13]+=u,l.setLocalTransform(Bo)))}),l.getLocalTransform()}t(Wo,Fo=Co),Wo.prototype.postProcessor=function(t,e){var n,r;switch(t.nodeName){case O.CIRCLE:case O.ELLIPSE:var i=t.parsedStyle,a=i.cx,o=i.cy,i=i.cz;A(a)||(l=a),A(o)||(c=o),A(i)||(u=i);break;case O.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 O.RECT:case O.IMAGE:case O.GROUP:case O.HTML:case O.TEXT:case O.MESH:A(t.parsedStyle.x)||(l=t.parsedStyle.x),A(t.parsedStyle.y)||(c=t.parsedStyle.y),A(t.parsedStyle.z)||(u=t.parsedStyle.z)}t.nodeName!==O.PATH&&t.nodeName!==O.POLYLINE&&t.nodeName!==O.POLYGON&&(t.parsedStyle.defX=l||0,t.parsedStyle.defY=c||0),A(l)&&A(c)&&A(u)||-1!==e.indexOf("transform")||((e=t.parsedStyle.transform)&&e.length?Do(e,t):(n=(e=j(t.getLocalPosition(),3))[0],r=e[1],e=e[2],t.setLocalPosition(A(l)?n:l,A(c)?r:c,A(u)?e:u)))};var Fo,zo=Wo;function Wo(){return null!==Fo&&Fo.apply(this,arguments)||this}Ho.prototype.calculator=function(t,e,n,r){n=null==(n=n instanceof ui?null:n)?void 0:n.cloneNode(!0);return n&&(n.style.isMarker=!0),n};var Go=Ho;function Ho(){}Yo.prototype.calculator=function(t,e,n){return n.value};var Vo=Yo;function Yo(){this.mixer=Ca,this.parser=Pa,this.parserWithCSSDisabled=null}$o.prototype.calculator=function(t,e,n){return n.value},$o.prototype.postProcessor=function(t){var e,n=t.parsedStyle,r=n.offsetPath,n=n.offsetDistance;!r||(e=r.nodeName)!==O.LINE&&e!==O.PATH&&e!==O.POLYLINE||(e=r.getPoint(n))&&(t.parsedStyle.defX=e.x,t.parsedStyle.defY=e.y,t.setLocalPosition(e.x,e.y))};var qo=$o;function $o(){this.parser=Pa,this.parserWithCSSDisabled=null,this.mixer=La(0,1)}Xo.prototype.calculator=function(t,e,n){return n.value};var Uo=Xo;function Xo(){this.parser=Pa,this.parserWithCSSDisabled=null,this.mixer=La(0,1)}Zo.prototype.calculator=function(t,e,n){return n instanceof ui&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Dr(0,0,0,0)}:n},Zo.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===O.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 Ko=Zo;function Zo(){this.parser=Ka,this.parserWithCSSDisabled=Ka,this.mixer=Za}Jo.prototype.postProcessor=function(t,e){var n;t.nodeName!==O.POLYGON&&t.nodeName!==O.POLYLINE||-1!==e.indexOf("transform")||(n=(e=t.parsedStyle).defX,e=e.defY,t.setLocalPosition(n,e))};var Qo=Jo;function Jo(){this.parser=Qa,this.mixer=Ja}t(ns,ts=Co);var ts,es=ns;function ns(){var t=null!==ts&&ts.apply(this,arguments)||this;return t.mixer=La(0,1/0),t}is.prototype.calculator=function(t,e,n,r){return n instanceof ui?"unset"===n.value?"":n.value:"".concat(n)},is.prototype.postProcessor=function(t){t.nodeValue="".concat(t.parsedStyle.text)||""};var rs=is;function is(){}os.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 as=os;function os(){}var ss={},ls=0;var cs="undefined"!=typeof window&&void 0!==window.document;function us(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 hs(t){var e,n=t;do{if(null==(e=n.parsedStyle)?void 0:e.clipPath)return n}while(null!==(n=n.parentElement));return null}function fs(t,e){if(cs)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var ds={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};function ps(t,e,n){var r=!1,i=!1,e=!!e&&!e.isNone,n=!!n&&!n.isNone;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=e,i=n):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(i=r=!0),[r,i]}function gs(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var n=Date.now(),e=16<(e=n-Os)?0:16-e,r=bs();return ks[r]=t,1<Object.keys(ks).length||setTimeout(function(){Os=n;var e=ks;ks={},Object.keys(e).forEach(function(t){return e[t](Ms())})},e),r}function ys(t){delete ks[t]}function ms(t){return"string"!=typeof t?gs:""===t?xs.requestAnimationFrame:xs[t+"RequestAnimationFrame"]}var vs=1,bs=function(){return vs++},xs="object"==typeof self&&self.self==self?self:"object"==typeof S&&S.global==S?S:{},ws=Date.now(),Ms=function(){return xs.performance&&"function"==typeof xs.performance.now?xs.performance.now():Date.now()-ws},ks={},Os=Date.now(),Es=function(t,e){for(var n=0;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}}(["","webkit","moz","ms","o"],ms),Ss=ms(Es),As="string"!=typeof(Es=Es)?ys:""===Es?xs.cancelAnimationFrame:xs[Es+"CancelAnimationFrame"]||xs[Es+"CancelRequestAnimationFrame"],_s=(xs.requestAnimationFrame=Ss,xs.cancelAnimationFrame=As,Ts.prototype.getCallbacksNum=function(){return this.callbacks.length},Ts.prototype.tapPromise=function(t,e){this.callbacks.push(e)},Ts.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,k([],j(e),!1))}))},Ts);function Ts(){this.callbacks=[]}Cs.prototype.tapPromise=function(t,e){this.callbacks.push(e)},Cs.prototype.promise=function(){for(var i=[],t=0;t<arguments.length;t++)i[t]=arguments[t];return X(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,k([],j(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 Ps=Cs;function Cs(){this.callbacks=[]}Ns.prototype.tap=function(t,e){this.callbacks.push(e)},Ns.prototype.call=function(){var e=arguments;this.callbacks.forEach(function(t){t.apply(void 0,e)})};var Ls=Ns;function Ns(){this.callbacks=[]}Rs.prototype.tap=function(t,e){this.callbacks.push(e)},Rs.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 js=Rs;function Rs(){this.callbacks=[]}var Is=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Bs=/([\"\'])[^\'\"]+\1/;Ds.prototype.calculator=function(t,e,n,r){return n instanceof ui?[]:n},Ds.prototype.postProcessor=function(t){Do(t.parsedStyle.transform,t)};Es=Ds;function Ds(){this.parser=io,this.parserWithCSSDisabled=io,this.mixer=yo}var Fs=function(){this.parser=mo},zs=(Ws.prototype.calculator=function(t,e,n,r){return n.value},Ws.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=Ti.Z_INDEX_CHANGED)},Ws);function Ws(){this.parser=Pa}Hs.prototype.update=function(t,e){t=t.r;return{width:2*t,height:2*t}};var Gs=Hs;function Hs(){}Ys.prototype.update=function(t,e){return{width:2*t.rx,height:2*t.ry}};var Vs=Ys;function Ys(){}$s.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 qs=$s;function $s(){}Xs.prototype.update=function(t){t=t.path.rect;return{width:t.width,height:t.height}};var Us=Xs;function Xs(){}Zs.prototype.update=function(t){var t=t.points.points,e=Math.min.apply(Math,k([],j(t.map(function(t){return t[0]})),!1)),n=Math.max.apply(Math,k([],j(t.map(function(t){return t[0]})),!1)),r=Math.min.apply(Math,k([],j(t.map(function(t){return t[1]})),!1));return{width:n-e,height:Math.max.apply(Math,k([],j(t.map(function(t){return t[1]})),!1))-r}};var Ks=Zs;function Zs(){}Js.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&&!We(n)&&(r||(r=n.width,t.width=r),i||(i=n.height,t.height=i)),{width:r,height:i}};var Qs=Js;function Js(){}el.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&&!A(t)},el.prototype.update=function(t,e){var n,r,i,a=t.text,o=t.textAlign,s=t.lineWidth,l=t.textBaseline,c=t.dx,u=t.dy;return this.isReadyToMeasure(t,e)?(e=((null==(e=null==(e=null==e?void 0:e.ownerDocument)?void 0:e.defaultView)?void 0:e.getConfig())||{}).offscreenCanvas,a=this.globalRuntime.textService.measureText(a,t,e),e=(t.metrics=a).width,r=a.height,n=a.lineHeight,a=a.fontProperties,e=[e/2,r/2,0],r=[0,1],i=0,"center"===o||"middle"===o?(i=s/2,r=[.5,1]):"right"!==o&&"end"!==o||(i=s,r=[1,1]),o=0,"middle"===l?o=e[1]:"top"===l||"hanging"===l?o=2*e[1]:"alphabetic"===l?o=this.globalRuntime.enableCSSParsing?n-a.ascent:0:"bottom"!==l&&"ideographic"!==l||(o=0),c&&(i+=c),u&&(o+=u),t.anchor=[r[0],r[1],0],{width:2*e[0],height:2*e[1],offsetX:i,offsetY:o}):(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 tl=el;function el(t){this.globalRuntime=t}Object.defineProperty(rl.prototype,"name",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(rl.prototype,"layerX",{get:function(){return this.layer.x},enumerable:!1,configurable:!0}),Object.defineProperty(rl.prototype,"layerY",{get:function(){return this.layer.y},enumerable:!1,configurable:!0}),Object.defineProperty(rl.prototype,"pageX",{get:function(){return this.page.x},enumerable:!1,configurable:!0}),Object.defineProperty(rl.prototype,"pageY",{get:function(){return this.page.y},enumerable:!1,configurable:!0}),Object.defineProperty(rl.prototype,"x",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(rl.prototype,"y",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(rl.prototype,"canvasX",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(rl.prototype,"canvasY",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(rl.prototype,"viewportX",{get:function(){return this.viewport.x},enumerable:!1,configurable:!0}),Object.defineProperty(rl.prototype,"viewportY",{get:function(){return this.viewport.y},enumerable:!1,configurable:!0}),rl.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(rl.prototype,"propagationPath",{get:function(){return this.composedPath()},enumerable:!1,configurable:!0}),rl.prototype.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},rl.prototype.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},rl.prototype.stopPropagation=function(){this.propagationStopped=!0},rl.prototype.initEvent=function(){},rl.prototype.initUIEvent=function(){},rl.prototype.clone=function(){throw new Error(Hr)};var nl=rl;function rl(t){this.eventPhase=rl.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Ir,this.page=new Ir,this.canvas=new Ir,this.viewport=new Ir,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}t(ol,il=nl),Object.defineProperty(ol.prototype,"clientX",{get:function(){return this.client.x},enumerable:!1,configurable:!0}),Object.defineProperty(ol.prototype,"clientY",{get:function(){return this.client.y},enumerable:!1,configurable:!0}),Object.defineProperty(ol.prototype,"movementX",{get:function(){return this.movement.x},enumerable:!1,configurable:!0}),Object.defineProperty(ol.prototype,"movementY",{get:function(){return this.movement.y},enumerable:!1,configurable:!0}),Object.defineProperty(ol.prototype,"offsetX",{get:function(){return this.offset.x},enumerable:!1,configurable:!0}),Object.defineProperty(ol.prototype,"offsetY",{get:function(){return this.offset.y},enumerable:!1,configurable:!0}),Object.defineProperty(ol.prototype,"globalX",{get:function(){return this.global.x},enumerable:!1,configurable:!0}),Object.defineProperty(ol.prototype,"globalY",{get:function(){return this.global.y},enumerable:!1,configurable:!0}),Object.defineProperty(ol.prototype,"screenX",{get:function(){return this.screen.x},enumerable:!1,configurable:!0}),Object.defineProperty(ol.prototype,"screenY",{get:function(){return this.screen.y},enumerable:!1,configurable:!0}),ol.prototype.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},ol.prototype.initMouseEvent=function(){throw new Error(Hr)};var il,al=ol;function ol(){var t=null!==il&&il.apply(this,arguments)||this;return t.client=new Ir,t.movement=new Ir,t.offset=new Ir,t.global=new Ir,t.screen=new Ir,t}t(cl,sl=al),cl.prototype.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},cl.prototype.getPredictedEvents=function(){throw new Error("getPredictedEvents is not supported!")},cl.prototype.clone=function(){return this.manager.clonePointerEvent(this)};var sl,ll=cl;function cl(){var t=null!==sl&&sl.apply(this,arguments)||this;return t.width=0,t.height=0,t.isPrimary=!1,t}t(fl,ul=al),fl.prototype.clone=function(){return this.manager.cloneWheelEvent(this)};var ul,hl=fl;function fl(){return null!==ul&&ul.apply(this,arguments)||this}t(gl,dl=nl);var dl,pl=gl;function gl(t,e){var n=dl.call(this,null)||this;return n.type=t,n.detail=e,Object.assign(n,e),n}yl.prototype.on=function(t,e,n){return this.addEventListener(t,e,n),this},yl.prototype.addEventListener=function(t,e,n){var r,i,a,o=Ke(n)&&n||Re(n)&&n.capture,n=Re(n)&&n.once,s=pi(e)?void 0:e,l=!1,c="";return-1<t.indexOf(":")&&(i=(r=j(t.split(":"),2))[0],t=r[1],c=i,l=!0),t=o?"".concat(t,"capture"):t,e=pi(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,k([],j(e),!1))}),n?this.emitter.once(t,e,s):this.emitter.on(t,e,s),this},yl.prototype.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},yl.prototype.removeAllEventListeners=function(){this.emitter.removeAllListeners()},yl.prototype.removeEventListener=function(t,e,n){var n=Ke(n)&&n||Re(n)&&n.capture,r=pi(e)?void 0:e;return t=n?"".concat(t,"capture"):t,e=pi(e)?e:null==e?void 0:e.handleEvent,this.emitter.off(t,e,r),this},yl.prototype.emit=function(t,e){this.dispatchEvent(new pl(t,e))},yl.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};al=yl;function yl(){this.emitter=new Y}t(p,ml=al),p.isNode=function(t){return!!t.childNodes},Object.defineProperty(p.prototype,"textContent",{get:function(){var e,t,n="";this.nodeName===O.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===O.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===O.TEXT&&(this.style.text="".concat(t))},enumerable:!1,configurable:!0}),p.prototype.getRootNode=function(t){return void 0===t&&(t={}),this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this},p.prototype.hasChildNodes=function(){return 0<this.childNodes.length},p.prototype.isDefaultNamespace=function(t){throw new Error(Hr)},p.prototype.lookupNamespaceURI=function(t){throw new Error(Hr)},p.prototype.lookupPrefix=function(t){throw new Error(Hr)},p.prototype.normalize=function(){throw new Error(Hr)},p.prototype.isEqualNode=function(t){return this===t},p.prototype.isSameNode=function(t){return this.isEqualNode(t)},Object.defineProperty(p.prototype,"parent",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"parentElement",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"nextSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"previousSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"firstChild",{get:function(){return 0<this.childNodes.length?this.childNodes[0]:null},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"lastChild",{get:function(){return 0<this.childNodes.length?this.childNodes[this.childNodes.length-1]:null},enumerable:!1,configurable:!0}),p.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 p.DOCUMENT_POSITION_DISCONNECTED|p.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|p.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?p.DOCUMENT_POSITION_CONTAINED_BY|p.DOCUMENT_POSITION_FOLLOWING:p.DOCUMENT_POSITION_CONTAINS|p.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?p.DOCUMENT_POSITION_PRECEDING:p.DOCUMENT_POSITION_FOLLOWING:o===i?p.DOCUMENT_POSITION_PRECEDING:p.DOCUMENT_POSITION_FOLLOWING}return p.DOCUMENT_POSITION_FOLLOWING},p.prototype.contain=function(t){return this.contains(t)},p.prototype.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},p.prototype.getAncestor=function(t){for(var e=this;0<t&&e;)e=e.parentNode,t--;return e},p.prototype.forEach=function(e,t){void 0===t&&(t=!1),e(this)||(t?this.childNodes.slice():this.childNodes).forEach(function(t){t.forEach(e)})},p.DOCUMENT_POSITION_DISCONNECTED=1,p.DOCUMENT_POSITION_PRECEDING=2,p.DOCUMENT_POSITION_FOLLOWING=4,p.DOCUMENT_POSITION_CONTAINS=8,p.DOCUMENT_POSITION_CONTAINED_BY=16,p.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var ml,vl=p;function p(){var t=null!==ml&&ml.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}xl.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)},xl.prototype.destroy=function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()},xl.prototype.client2Viewport=function(t){var e=this.context.contextService.getBoundingClientRect();return new Ir(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))},xl.prototype.viewport2Client=function(t){var e=this.context.contextService.getBoundingClientRect();return new Ir(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))},xl.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=ct(this.tmpMatrix,n,a),a=Nt(this.tmpVec3,e/i*2-1,2*(1-t/r)-1,0);return Wt(a,a,n),new Ir(a[0],a[1])},xl.prototype.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),e=e.getViewTransform(),n=ct(this.tmpMatrix,n,e),e=Nt(this.tmpVec3,t.x,t.y,0),t=(Wt(this.tmpVec3,this.tmpVec3,n),this.context.config),n=t.width,t=t.height;return new Ir((e[0]+1)/2*n,(1-(e[1]+1)/2)*t)},xl.prototype.setPickHandler=function(t){this.pickHandler=t},xl.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})},xl.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))}},xl.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)},xl.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}}},xl.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++)vl.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);n&&e.push(n)}return e},xl.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},xl.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)},xl.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},xl.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})},xl.prototype.createPointerEvent=function(t,e,n,r){var i=this.allocateEvent(ll),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},xl.prototype.createWheelEvent=function(t){var e=this.allocateEvent(hl),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},xl.prototype.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},xl.prototype.cloneWheelEvent=function(t){var e=this.allocateEvent(hl);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},xl.prototype.clonePointerEvent=function(t,e){var n=this.allocateEvent(ll);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},xl.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},xl.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)},xl.prototype.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},xl.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)},xl.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},xl.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)},xl.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)},xl.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)},xl.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||vl.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},xl.prototype.getCursor=function(t){for(var e=t;e;){var n=!!e.getAttribute&&e.getAttribute("cursor");if(n)return n;e=vl.isNode(e)&&e.parentNode}};var bl=xl;function xl(t,e){var c=this;this.globalRuntime=t,this.context=e,this.emitter=new Y,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=Z(),this.tmpVec3=v(),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")),vl.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"),vl.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&&vl.isNode(i)&&i.parentNode);s&&s!==(vl.isNode(c.rootTarget)&&c.rootTarget.parentNode)&&s!==e.target;)s=s.parentNode;if(!s||s===(vl.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!==(vl.isNode(c.rootTarget)&&c.rootTarget.parentNode);)l.currentTarget=l.target,c.notifyTarget(l),n&&c.notifyTarget(l,"mouseenter"),vl.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!==(vl.isNode(c.rootTarget)&&c.rootTarget.parentNode);)a.currentTarget=a.target,c.notifyTarget(a),n&&c.notifyTarget(a,"mouseleave"),vl.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!==(vl.isNode(c.rootTarget)&&c.rootTarget.parentNode);)r.currentTarget=r.target,c.notifyTarget(r),n&&c.notifyTarget(r,"mouseenter"),vl.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"),vl.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)}}kl.prototype.getOrCreateCanvas=function(t,e){if(!this.canvas){if(t||_.offscreenCanvas)this.canvas=t||_.offscreenCanvas,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},kl.prototype.getOrCreateContext=function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context};var wl,Ml=kl;function kl(){}(Al=wl=wl||{})[Al.CAMERA_CHANGED=0]="CAMERA_CHANGED",Al[Al.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",Al[Al.NONE=2]="NONE";El.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()})},El.prototype.getStats=function(){return this.stats},El.prototype.disableDirtyRectangleRendering=function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(wl.CAMERA_CHANGED)},El.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())},El.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)})},El.prototype.sort=function(n,r){r.sorted&&r.dirtyReason!==Ti.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;us(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(us)},El.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},El.prototype.dirtify=function(){this.context.renderingContext.renderReasons.add(wl.DISPLAY_OBJECT_CHANGED)};var Ol=El;function El(t,e){this.globalRuntime=t,this.context=e,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new Ls,initAsync:new _s,dirtycheck:new js,cull:new js,beginFrame:new Ls,beforeRender:new Ls,render:new Ls,afterRender:new Ls,endFrame:new Ls,destroy:new Ls,pick:new Ps,pickSync:new js,pointerDown:new Ls,pointerUp:new Ls,pointerMove:new Ls,pointerOut:new Ls,pointerOver:new Ls,pointerWheel:new Ls,pointerCancel:new Ls,click:new Ls}}var Sl=/\[\s*(.*)=(.*)\s*\]/,Al=(_l.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})},_l.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})},_l.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},_l.prototype.getIdOrClassname=function(t){return t.substring(1)},_l.prototype.getAttribute=function(t){var t=t.match(Sl),e="",n="";return t&&2<t.length&&(e=t[1].replace(/"/g,""),n=t[2].replace(/"/g,"")),{name:e,value:n}},_l.prototype.attributeToString=function(t,e){return t.getAttribute&&(t=t.getAttribute(e),!A(t))&&t.toString?t.toString():""},_l);function _l(){}t(Cl,Tl=nl),Cl.ADDITION=2,Cl.MODIFICATION=1,Cl.REMOVAL=3;var Tl,b,Pl=Cl;function Cl(t,e,n,r,i,a,o,s){var l=Tl.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 Ll(t){t=t.renderable;t&&(t.renderBoundsDirty=!0,t.boundsDirty=!0)}(jl=b=b||{}).REPARENT="reparent",jl.DESTROY="destroy",jl.ATTR_MODIFIED="DOMAttrModified",jl.INSERTED="DOMNodeInserted",jl.REMOVED="removed",jl.MOUNTED="DOMNodeInsertedIntoDocument",jl.UNMOUNTED="DOMNodeRemovedFromDocument",jl.BOUNDS_CHANGED="bounds-changed",jl.CULLED="culled";var Nl=new Pl(b.REPARENT,null,"","","",0,"",""),jl=(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,A(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=Ti.ADDED),t.transformable);e&&this.dirtifyWorld(t,e),e.frozen&&this.unfreezeParentToRoot(t),r&&t.dispatchEvent(Nl)},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=Ti.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=Ct(e,n,r));n=t.transformable;Qt(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=Ct(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=Ct(e[0],e[1],e[2]||n.localScale[2]);Ht(e,n.localScale)||(Lt(n.localScale,e),this.dirtifyLocal(t,n))},l.prototype.setLocalRotation=function(t,e,n,r,i){"number"==typeof e&&(e=Jt(e,n,r,i));n=t.transformable;te(n.localRotation,e),this.dirtifyLocal(t,n)},l.prototype.setLocalSkew=function(t,e,n){"number"==typeof e&&(i=e,n=n,(r=new $(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=j(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;)Ll(n),n=n.parentNode;e&&t.forEach(function(t){Ll(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 Pl(b.ATTR_MODIFIED,t,n,n,e,Pl.MODIFICATION,n,n)),t.isCustomElement&&t.isConnected&&t.attributeChangedCallback&&t.attributeChangedCallback(e,n,n)})})},l.prototype.getPosition=function(t){var e=t.transformable;return mt(e.position,this.getWorldTransform(t,e))},l.prototype.getRotation=function(t){var e=t.transformable;return bt(e.rotation,this.getWorldTransform(t,e))},l.prototype.getScale=function(t){var e=t.transformable;return vt(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=mt(v(),e),r=bt(Ut(),e),e=vt(v(),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 Tr.isEmpty(e)?null:((n=n||new Tr).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 Tr},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 Tr).update(t.center,t.halfExtents))}),e&&(t=hs(t))&&(t=t.parsedStyle.clipPath.getBounds(e),r?t&&(r=t.intersection(r)):r=t),(r=r||new Tr)&&(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=Z(),r=(t.parentNode.transformable&&(n=rt(Z(),this.getWorldTransform(t.parentNode))),this.getBounds(t));if(!Tr.isEmpty(r))return(e=new Tr).setFromTransformedAABB(r,n),e}return this.getBounds(t)},l.prototype.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t),i=(Tr.isEmpty(i)||(r=new Tr).setFromTransformedAABB(i,this.getWorldTransform(t)),null==(t=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:t.getContextService().getBoundingClientRect());return r?(e=(t=j(r.getMin(),2))[0],t=t[1],n=(r=j(r.getMax(),2))[0],r=r[1],new Dr(e+((null==i?void 0:i.left)||0),t+((null==i?void 0:i.top)||0),n-e,r-t)):new Dr((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?ct(e.worldTransform,n.worldTransform,e.localTransform):J(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 pl(b.BOUNDS_CHANGED),this.rotate=(o=Ut(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Ct(e,n,r));var i,a,n=t.transformable;null!==t.parentNode&&t.parentNode.transformable?(Qt(r=Ut(),e[0],e[1],e[2]),i=g.getRotation(t),a=g.getRotation(t.parentNode),te(o,a),Zt(o,o),Kt(r,o,r),Kt(n.localRotation,r,i),ne(n.localRotation,n.localRotation),g.dirtifyLocal(t,n)):g.rotateLocal(t,e)}),this.rotateLocal=(i=Ut(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Ct(e,n,r));n=t.transformable;Qt(i,e[0],e[1],e[2]),ee(n.localRotation,n.localRotation,i),g.dirtifyLocal(t,n)}),this.setEulerAngles=(a=Ut(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Ct(e,n,r));n=t.transformable;null!==t.parentNode&&t.parentNode.transformable?(Qt(n.localRotation,e[0],e[1],e[2]),r=g.getRotation(t.parentNode),te(a,Zt(Ut(),r)),ee(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=Ct(e,n,r));var i,a,o,s,l,c,u,h,f,d,p,n=t.transformable;Ht(e,v())||(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,jt(n.localPosition,n.localPosition,e),g.dirtifyLocal(t,n))},this.setPosition=(r=Z(),s=v(),function(t,e){var n=t.transformable;s[0]=e[0],s[1]=e[1],s[2]=e[2]||0,Ht(g.getPosition(t),s)||(Lt(n.position,s),null!==t.parentNode&&t.parentNode.transformable?(e=t.parentNode.transformable,J(r,e.worldTransform),rt(r,r),Wt(n.localPosition,s,r)):Lt(n.localPosition,s),g.dirtifyLocal(t,n))}),this.setLocalPosition=(l=v(),function(t,e){var n=t.transformable;l[0]=e[0],l[1]=e[1],l[2]=e[2]||0,Ht(n.localPosition,l)||(Lt(n.localPosition,l),g.dirtifyLocal(t,n))}),this.translate=(c=v(),u=v(),h=v(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),Ht(e="number"==typeof e?Nt(u,e,n,r):e,c)||(jt(h,g.getPosition(t),e),g.setPosition(t,h))}),this.setRotation=function(){var o=Ut();return function(t,e,n,r,i){var a=t.transformable;"number"==typeof e&&(e=Jt(e,n,r,i)),null!==t.parentNode&&t.parentNode.transformable?(n=g.getRotation(t.parentNode),te(o,n),Zt(o,o),Kt(a.localRotation,o,e),ne(a.localRotation,a.localRotation),g.dirtifyLocal(t,a)):g.setLocalRotation(t,e)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=(n=Z(),f=v(),d=Jt(0,0,0,1),function(t){var e;0!==t.localSkew[0]||0!==t.localSkew[1]?(xt(t.localTransform,t.localRotation,t.localPosition,Ct(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||((e=et(n))[4]=Math.tan(t.localSkew[0]),e[1]=Math.tan(t.localSkew[1]),ct(t.localTransform,t.localTransform,e)),e=xt(n,d,f,t.localScale,t.origin),ct(t.localTransform,t.localTransform,e)):xt(t.localTransform,t.localRotation,t.localPosition,t.localScale,t.origin)})}var Rl={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]},Il=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,Bl=new RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),Dl=new RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),Fl=(zl.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.offscreenCanvasCreator.getOrCreateCanvas(e),e=this.runtime.offscreenCanvasCreator.getOrCreateContext(e,{willReadFrequently:!0}),i=(e.font=t,Rl.MetricsString+Rl.BaselineSymbol),a=Math.ceil(e.measureText(i).width),o=Math.ceil(e.measureText(Rl.BaselineSymbol).width),s=Rl.HeightMultiplier*o,o=o*Rl.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},zl.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=He(e)&&"".concat(e,"px")||"16px",a=n.split(","),o=a.length-1;0<=o;o--){var s=a[o].trim();!Bs.test(s)&&Is.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.offscreenCanvasCreator.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 Dr(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},zl.prototype.setGraphemeOnPath=function(){},zl.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.offscreenCanvasCreator.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 k=h[f].length,O=0,E=k,S=0;S<k;S++){var A=g(h[f][S]);if(c<O+A+y){E=S;break}O+=A}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")},zl.prototype.isBreakingSpace=function(t){return"string"==typeof t&&0<=Rl.BreakingSpaces.indexOf(t.charCodeAt(0))},zl.prototype.isNewline=function(t){return"string"==typeof t&&0<=Rl.Newlines.indexOf(t.charCodeAt(0))},zl.prototype.trimToBreakable=function(t){var e,t=k([],j(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},zl.prototype.canBreakInLastChar=function(t){return!t||!Il.test(t)},zl.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)},zl.prototype.findBreakableIndex=function(t){for(var e=t.length-1;0<=e;e--)if(!Il.test(t[e]))return e;return-1},zl.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},zl);function zl(t){var n=this;this.runtime=t,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,e){return!n.isBreakingSpace(e)&&!(!t||!Dl.exec(e)&&!Bl.exec(t))},this.trimByKinsokuShorui=function(t){var e,n=k([],j(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 Wl,_={},Gs=(Qs=new Qs,Ks=new Ks,(cu={})[O.CIRCLE]=new Gs,cu[O.ELLIPSE]=new Vs,cu[O.RECT]=Qs,cu[O.IMAGE]=Qs,cu[O.GROUP]=Qs,cu[O.LINE]=new qs,cu[O.TEXT]=new tl(_),cu[O.POLYLINE]=Ks,cu[O.POLYGON]=Ks,cu[O.PATH]=new Us,cu[O.HTML]=null,cu[O.MESH]=null,cu),tl=(Vs=new So,Qs=new Co,(qs={})[o.PERCENTAGE]=null,qs[o.NUMBER]=new Vo,qs[o.ANGLE]=new ii,qs[o.DEFINED_PATH]=new s,qs[o.PAINT]=Vs,qs[o.COLOR]=Vs,qs[o.FILTER]=new _o,qs[o.LENGTH]=Qs,qs[o.LENGTH_PERCENTAGE]=Qs,qs[o.LENGTH_PERCENTAGE_12]=new No,qs[o.LENGTH_PERCENTAGE_14]=new Ro,qs[o.COORDINATE]=new zo,qs[o.OFFSET_DISTANCE]=new qo,qs[o.OPACITY_VALUE]=new Uo,qs[o.PATH]=new Ko,qs[o.LIST_OF_POINTS]=new Qo,qs[o.SHADOW_BLUR]=new es,qs[o.TEXT]=new rs,qs[o.TEXT_TRANSFORM]=new as,qs[o.TRANSFORM]=new Es,qs[o.TRANSFORM_ORIGIN]=new Fs,qs[o.Z_INDEX]=new zs,qs[o.MARKER]=new Go,qs),Gl=(_.CameraContribution=r,_.AnimationTimeline=null,_.EasingFunction=null,_.offscreenCanvasCreator=new Ml,_.nativeHTMLMap=new WeakMap,_.sceneGraphSelector=new Al,_.sceneGraphService=new jl(_),_.textService=new Fl(_),_.geometryUpdaterFactory=Gs,_.CSSPropertySyntaxFactory=tl,_.styleValueRegistry=new a(_),_.layoutRegistry=null,_.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:S,_.enableCSSParsing=!0,_.enableDataset=!1,_.enableStyleSyntax=!0,0),Hl=new Pl(b.INSERTED,null,"","","",0,"",""),Vl=new Pl(b.REMOVED,null,"","","",0,"",""),Yl=new pl(b.DESTROY),Ks=(t(c,Wl=vl),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(Hr)},c.prototype.appendChild=function(t,e){if(t.destroyed)throw new Error("Cannot append a destroyed element.");return _.sceneGraphService.attach(t,this,e),null!=(e=this.ownerDocument)&&e.defaultView&&this.ownerDocument.defaultView.mountChildren(t),Hl.relatedNode=this,t.dispatchEvent(Hl),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 Vl.relatedNode=this,t.dispatchEvent(Vl),null!=(e=t.ownerDocument)&&e.defaultView&&t.ownerDocument.defaultView.unmountChildren(t),_.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 _.sceneGraphService.matches(t,this)},c.prototype.getElementById=function(t){return _.sceneGraphService.querySelector("#".concat(t),this)},c.prototype.getElementsByName=function(t){return _.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)},c.prototype.getElementsByClassName=function(t){return _.sceneGraphService.querySelectorAll(".".concat(t),this)},c.prototype.getElementsByTagName=function(t){return _.sceneGraphService.querySelectorAll(t,this)},c.prototype.querySelector=function(t){return _.sceneGraphService.querySelector(t,this)},c.prototype.querySelectorAll=function(t){return _.sceneGraphService.querySelectorAll(t,this)},c.prototype.closest=function(t){var e=this;do{if(_.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=j(r))[0],n=n.slice(1),this.parentNode.appendChild(e,t),e.after.apply(e,k([],j(n),!1)))},c.prototype.replaceWith=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.after.apply(this,k([],j(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,k([],j(t),!1))},c.prototype.remove=function(){return this.parentNode?this.parentNode.removeChild(this):this},c.prototype.destroy=function(){this.dispatchEvent(Yl),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},c.prototype.getGeometryBounds=function(){return _.sceneGraphService.getGeometryBounds(this)},c.prototype.getRenderBounds=function(){return _.sceneGraphService.getBounds(this,!0)},c.prototype.getBounds=function(){return _.sceneGraphService.getBounds(this)},c.prototype.getLocalBounds=function(){return _.sceneGraphService.getLocalBounds(this)},c.prototype.getBoundingClientRect=function(){return _.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?_.enableCSSParsing?null:void 0:void 0===(e=this.attributes[t])&&(t=bi(t),e=this.attributes[t],_.enableCSSParsing)&&A(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(Hr)},c.prototype.getAttributeNode=function(t){throw new Error(Hr)},c.prototype.getAttributeNodeNS=function(t,e){throw new Error(Hr)},c.prototype.hasAttributeNS=function(t,e){throw new Error(Hr)},c.prototype.removeAttributeNS=function(t,e){throw new Error(Hr)},c.prototype.removeAttributeNode=function(t){throw new Error(Hr)},c.prototype.setAttributeNS=function(t,e,n){throw new Error(Hr)},c.prototype.setAttributeNode=function(t){throw new Error(Hr)},c.prototype.setAttributeNodeNS=function(t){throw new Error(Hr)},c.prototype.toggleAttribute=function(t,e){throw new Error(Hr)},c);function c(){var t=null!==Wl&&Wl.apply(this,arguments)||this;return t.entity=Gl++,t.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1,proxyNodeName:void 0},t.cullable={strategy:_i.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=_.enableCSSParsing?{anchor:Pi,opacity:Pi,fillOpacity:Pi,strokeOpacity:Pi,fill:Pi,stroke:Pi,transform:Pi,transformOrigin:Pi,visibility:Pi,pointerEvents:Pi,lineWidth:Pi,lineCap:Pi,lineJoin:Pi,increasedLineWidthForHitTesting:Pi,fontSize:Pi,fontFamily:Pi,fontStyle:Pi,fontWeight:Pi,fontVariant:Pi,textAlign:Pi,textBaseline:Pi,textTransform:Pi,zIndex:Pi,filter:Pi,shadowType:Pi}:null,t.parsedStyle={},t.attributes={},t}function ql(t){return null!=t&&t.nodeName}var $l,Ul=new Pl(b.ATTR_MODIFIED,null,null,null,null,Pl.MODIFICATION,null,null),Xl={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:""},Kl={anchor:[0,0],fill:Li,stroke:Li,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},Zl=m(m({},Kl),{opacity:1,fillOpacity:1,strokeOpacity:1,visibility:"visible",pointerEvents:"auto",lineWidth:1,lineCap:"butt",lineJoin:"miter",increasedLineWidthForHitTesting:0,fillRule:"nonzero"}),Ql=k(k([],j(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"]),!1),["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"],!1),Jl=(t(u,$l=Ks),u.prototype.destroy=function(){$l.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];ql(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=(_.enableCSSParsing&&(r.usedAttributes=Ql),{});for(e in t)i[bi(e)]=t[e];_.styleValueRegistry.processProperties(this,i,r),n.dirty=!0},u.prototype.setAttribute=function(t,e,n){void 0===n&&(n=!1);t=bi(t);Ze(e)||!n&&e===this.attributes[t]||(this.internalSetAttribute(t,e),$l.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=(_.styleValueRegistry.processProperties(this,((o={})[t]=e,o),n),r.dirty=!0,this.parsedStyle[t]);this.isConnected&&(Ul.relatedNode=this,Ul.prevValue=i,Ul.newValue=e,Ul.attrName=t,Ul.prevParsedValue=a,Ul.newParsedValue=o,this.isMutationObserved?this.dispatchEvent(Ul):(Ul.target=this).ownerDocument.defaultView.dispatchEvent(Ul,!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=j(t.getMin(),2),n=e[0],e=e[1],t=j(t.getMax(),2),r=t[0],t=t[1];return new Dr(n,e,r-n,t-e)},u.prototype.setOrigin=function(t,e,n){return _.sceneGraphService.setOrigin(this,mr(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},u.prototype.getOrigin=function(){return _.sceneGraphService.getOrigin(this)},u.prototype.setPosition=function(t,e,n){return _.sceneGraphService.setPosition(this,mr(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},u.prototype.setLocalPosition=function(t,e,n){return _.sceneGraphService.setLocalPosition(this,mr(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},u.prototype.translate=function(t,e,n){return _.sceneGraphService.translate(this,mr(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},u.prototype.translateLocal=function(t,e,n){return _.sceneGraphService.translateLocal(this,mr(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},u.prototype.getPosition=function(){return _.sceneGraphService.getPosition(this)},u.prototype.getLocalPosition=function(){return _.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=mr(t,e=e||t,n=n||t)),_.sceneGraphService.scaleLocal(this,t),this},u.prototype.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=mr(t,e=e||t,n=n||t)),_.sceneGraphService.setLocalScale(this,t),this},u.prototype.getLocalScale=function(){return _.sceneGraphService.getLocalScale(this)},u.prototype.getScale=function(){return _.sceneGraphService.getScale(this)},u.prototype.getEulerAngles=function(){return br(j(xr(v(),_.sceneGraphService.getWorldTransform(this)),3)[2])},u.prototype.getLocalEulerAngles=function(){return br(j(xr(v(),_.sceneGraphService.getLocalRotation(this)),3)[2])},u.prototype.setEulerAngles=function(t){return _.sceneGraphService.setEulerAngles(this,0,0,t),this},u.prototype.setLocalEulerAngles=function(t){return _.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},u.prototype.rotateLocal=function(t,e,n){return A(e)&&A(n)?_.sceneGraphService.rotateLocal(this,0,0,t):_.sceneGraphService.rotateLocal(this,t,e,n),this},u.prototype.rotate=function(t,e,n){return A(e)&&A(n)?_.sceneGraphService.rotate(this,0,0,t):_.sceneGraphService.rotate(this,t,e,n),this},u.prototype.setRotation=function(t,e,n,r){return _.sceneGraphService.setRotation(this,t,e,n,r),this},u.prototype.setLocalRotation=function(t,e,n,r){return _.sceneGraphService.setLocalRotation(this,t,e,n,r),this},u.prototype.setLocalSkew=function(t,e){return _.sceneGraphService.setLocalSkew(this,t,e),this},u.prototype.getRotation=function(){return _.sceneGraphService.getRotation(this)},u.prototype.getLocalRotation=function(){return _.sceneGraphService.getLocalRotation(this)},u.prototype.getLocalSkew=function(){return _.sceneGraphService.getLocalSkew(this)},u.prototype.getLocalTransform=function(){return _.sceneGraphService.getLocalTransform(this)},u.prototype.getWorldTransform=function(){return _.sceneGraphService.getWorldTransform(this)},u.prototype.setLocalTransform=function(t){return _.sceneGraphService.setLocalTransform(this,t),this},u.prototype.resetLocalTransform=function(){_.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,k([],j(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,k([],j(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=j(t,2),i=r[0],r=r[1];return i?Re(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=j(mt(v(),t),2),n=e[0],e=e[1],r=j(vt(v(),t),2),i=r[0],r=r[1],t=bt(Ut(),t),t=j(xr(v(),t),3),a=t[0],t=t[2];return wr(a||t,n,e,i,r)},u.prototype.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},u.prototype.setMatrix=function(t){var t=j(Mr(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=j(Mr(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(){_.enableCSSParsing?this.style.visibility="visible":this.forEach(function(t){t.style.visibility="visible"})},u.prototype.hide=function(){_.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=$l.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||O.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,_.enableCSSParsing?Kl:Zl,r.config.initialParsedStyle),_.enableCSSParsing&&Object.assign(r.attributes,Xl),r.initAttributes(r.config.style),_.globalThis.Proxy||function(){});return _.enableDataset&&(r.dataset=new t({},{get:function(t,e){e="".concat("data-").concat(fi(e));return void 0!==t[e]?t[e]:r.getAttribute(e)},set:function(t,e,n){return r.setAttribute("".concat("data-").concat(fi(e)),n),!0}})),_.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}var tc,ec=function(t){var e=t.name,n=t.inherits,r=t.interpolable,i=t.initialValue,t=t.syntax;_.styleValueRegistry.registerMetadata({n:e,inh:n,int:r,d:i,syntax:t})},nc=(t(rc,tc=Jl),rc);function rc(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return tc.call(this,m({type:O.CIRCLE,style:_.enableCSSParsing?m({cx:"",cy:"",r:""},e):m({},e),initialParsedStyle:{anchor:[.5,.5],transformOrigin:_.enableCSSParsing?null:[Ii,Ii]}},t))||this}t(oc,ic=Jl);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({style:_.enableCSSParsing?m({x:"",y:""},n):m({},n)},t))||this).isCustomElement=!0,e}t(cc,sc=Jl);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:O.ELLIPSE,style:_.enableCSSParsing?m({cx:"",cy:"",rx:"",ry:""},e):m({},e),initialParsedStyle:{anchor:[.5,.5],transformOrigin:_.enableCSSParsing?null:[Ii,Ii]}},t))||this}t(fc,uc=Jl);var uc,hc=fc;function fc(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return uc.call(this,m({type:O.GROUP,style:_.enableCSSParsing?m({x:"",y:"",width:"",height:""},e):m({},e)},t))||this}t(gc,dc=Jl),gc.prototype.getDomElement=function(){return this.parsedStyle.$el},gc.prototype.getBoundingClientRect=function(){var t,e,n,r;return this.parsedStyle.$el?this.parsedStyle.$el.getBoundingClientRect():(t=(r=this.parsedStyle).x,e=r.y,n=r.width,r=r.height,new Dr(t,e,n,r))},gc.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},gc.prototype.getBounds=function(){var t=this.getBoundingClientRect(),e=null==(e=null==(e=this.ownerDocument)?void 0:e.defaultView)?void 0:e.getContextService().getBoundingClientRect(),n=new Tr,r=t.left-((null==e?void 0:e.left)||0),e=t.top-((null==e?void 0:e.top)||0);return n.setMinMax([r,e,0],[r+t.width,e+t.height,0]),n},gc.prototype.getLocalBounds=function(){if(this.parentNode){var t,e=rt(Z(),this.parentNode.getWorldTransform()),n=this.getBounds();if(!Tr.isEmpty(n))return(t=new Tr).setFromTransformedAABB(n,e),t}return this.getBounds()};var dc,pc=gc;function gc(t){var e=this,n=(t=void 0===t?{}:t).style,t=at(t,["style"]);return(e=dc.call(this,m({type:O.HTML,style:_.enableCSSParsing?m({x:"",y:"",width:"auto",height:"auto",innerHTML:""},n):m({},n)},t))||this).cullable.enable=!1,e}t(vc,yc=Jl);var yc,mc=vc;function vc(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return yc.call(this,m({type:O.IMAGE,style:_.enableCSSParsing?m({x:"",y:"",img:"",width:"",height:""},e):m({},e)},t))||this}t(wc,bc=Jl),wc.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&&ql(r)&&(this.markerStartAngle=0,r.remove()),i&&ql(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&ql(r)&&(this.markerEndAngle=0,r.remove()),i)&&ql(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))},wc.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&&ql(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))},wc.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=Fn(r,i,a,o,t),i=r.x,a=r.y,o=Wt(v(),Ct(i-s,a-n,0),e?this.getWorldTransform():this.getLocalTransform());return new Ir(o[0],o[1])},wc.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},wc.prototype.getTotalLength=function(){var t=this.parsedStyle;return Dn(t.x1,t.y1,t.x2,t.y2)};var bc,xc=wc;function wc(t){var e=this,n=(t=void 0===t?{}:t).style,t=at(t,["style"]),n=((e=bc.call(this,m({type:O.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&&ql(t)&&(e.markerStartAngle=t.getLocalEulerAngles(),e.appendChild(t)),n&&ql(n)&&(e.markerEndAngle=n.getLocalEulerAngles(),e.appendChild(n)),e.transformMarker(!0),e.transformMarker(!1),e}t(Oc,Mc=Jl),Oc.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&&ql(r)&&(this.markerStartAngle=0,r.remove()),i&&ql(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&ql(r)&&(this.markerEndAngle=0,r.remove()),i&&ql(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},Oc.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&&ql(c)&&(u=0,h=t?(o=(t=j(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=j(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))},Oc.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&&ql(t))for(var a=1;a<n.length-1;a++){var o=j(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)}},Oc.prototype.getTotalLength=function(){return ja(this)},Oc.prototype.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,n=Ae(n.path.absolutePath,t,m(m({},a),{bbox:!1,length:!0})).point,t=n.x,a=n.y,n=Wt(v(),Ct(t-r,a-i,0),e?this.getWorldTransform():this.getLocalTransform());return new Ir(n[0],n[1])},Oc.prototype.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*ja(this),e)},Oc.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},Oc.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 Mc,kc=Oc;function Oc(t){var e=this,n=(t=void 0===t?{}:t).style,t=at(t,["style"]),n=((e=Mc.call(this,m({type:O.PATH,style:_.enableCSSParsing?m({path:"",miterLimit:""},n):m({},n),initialParsedStyle:_.enableCSSParsing?null:{miterLimit:4,path:m({},Bi)}},t))||this).markerStartAngle=0,e.markerEndAngle=0,e.markerMidList=[],e.parsedStyle),t=n.markerStart,r=n.markerEnd,n=n.markerMid;return t&&ql(t)&&(e.markerStartAngle=t.getLocalEulerAngles(),e.appendChild(t)),n&&ql(n)&&e.placeMarkerMid(n),r&&ql(r)&&(e.markerEndAngle=r.getLocalEulerAngles(),e.appendChild(r)),e.transformMarker(!0),e.transformMarker(!1),e}t(Ac,Ec=Jl),Ac.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&&ql(r)&&(this.markerStartAngle=0,r.remove()),i&&ql(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&ql(r)&&(this.markerEndAngle=0,r.remove()),i&&ql(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},Ac.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&&ql(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))},Ac.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&&ql(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 Ec,Sc=Ac;function Ac(t){var e=this,n=(t=void 0===t?{}:t).style,t=at(t,["style"]),n=((e=Ec.call(this,m({type:O.POLYGON,style:_.enableCSSParsing?m({points:"",miterLimit:"",isClosed:!0},n):m({},n),initialParsedStyle:_.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&&ql(t)&&(e.markerStartAngle=t.getLocalEulerAngles(),e.appendChild(t)),n&&ql(n)&&e.placeMarkerMid(n),r&&ql(r)&&(e.markerEndAngle=r.getLocalEulerAngles(),e.appendChild(r)),e.transformMarker(!0),e.transformMarker(!1),e}t(Pc,_c=Sc),Pc.prototype.getTotalLength=function(){return this.parsedStyle.points.totalLength},Pc.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},Pc.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)}),Fn(a[s][0],a[s][1],a[s+1][0],a[s+1][1],o)),a=e.x,e=e.y,a=Wt(v(),Ct(a-r,e-i,0),t?this.getWorldTransform():this.getLocalTransform());return new Ir(a[0],a[1])},Pc.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},Pc.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 _c,Tc=Pc;function Pc(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return _c.call(this,m({type:O.POLYLINE,style:_.enableCSSParsing?m({points:"",miterLimit:"",isClosed:!1},e):m({},e),initialParsedStyle:_.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},t))||this}t(Nc,Cc=Jl);var Cc,Lc=Nc;function Nc(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return Cc.call(this,m({type:O.RECT,style:_.enableCSSParsing?m({x:"",y:"",width:"",height:"",radius:""},e):m({},e)},t))||this}t(Ic,jc=Jl),Ic.prototype.getComputedTextLength=function(){var t;return(null==(t=this.parsedStyle.metrics)?void 0:t.maxLineWidth)||0},Ic.prototype.getLineBoundingRects=function(){var t;return(null==(t=this.parsedStyle.metrics)?void 0:t.lineMetrics)||[]},Ic.prototype.isOverflowing=function(){return!!this.parsedStyle.isOverflowing};var jc,Rc=Ic;function Ic(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return jc.call(this,m({type:O.TEXT,style:_.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:_.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}Dc.prototype.define=function(t,e){this.registry[t]=e},Dc.prototype.get=function(t){return this.registry[t]};var Bc=Dc;function Dc(){this.registry={},this.define(O.CIRCLE,nc),this.define(O.ELLIPSE,lc),this.define(O.RECT,Lc),this.define(O.IMAGE,mc),this.define(O.LINE,xc),this.define(O.GROUP,hc),this.define(O.PATH,kc),this.define(O.POLYGON,Sc),this.define(O.POLYLINE,Tc),this.define(O.TEXT,Rc),this.define(O.HTML,pc)}t(Wc,Fc=vl),Object.defineProperty(Wc.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(Wc.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(Wc.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(Wc.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),Wc.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?Rc:hc),(t=new n(e)).ownerDocument=this,t)},Wc.prototype.createElementNS=function(t,e,n){return this.createElement(e,n)},Wc.prototype.cloneNode=function(t){throw new Error(Hr)},Wc.prototype.destroy=function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}},Wc.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},Wc.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)},Wc.prototype.elementFromPoint=function(a,o){return X(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]}})})},Wc.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)},Wc.prototype.elementsFromPoint=function(a,o){return X(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]}})})},Wc.prototype.appendChild=function(t,e){throw new Error(Vr)},Wc.prototype.insertBefore=function(t,e){throw new Error(Vr)},Wc.prototype.removeChild=function(t,e){throw new Error(Vr)},Wc.prototype.replaceChild=function(t,e,n){throw new Error(Vr)},Wc.prototype.append=function(){throw new Error(Vr)},Wc.prototype.prepend=function(){throw new Error(Vr)},Wc.prototype.getElementById=function(t){return this.documentElement.getElementById(t)},Wc.prototype.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},Wc.prototype.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},Wc.prototype.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},Wc.prototype.querySelector=function(t){return this.documentElement.querySelector(t)},Wc.prototype.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},Wc.prototype.find=function(t){return this.documentElement.find(t)},Wc.prototype.findAll=function(t){return this.documentElement.findAll(t)};var Fc,zc=Wc;function Wc(){var t=Fc.call(this)||this;t.defaultView=null,t.ownerDocument=null,t.nodeName="document";try{t.timeline=new _.AnimationTimeline(t)}catch(t){}var r={};return bo.forEach(function(t){var e=t.n,n=t.inh,t=t.d;n&&t&&(r[e]=pi(t)?t(O.GROUP):t)}),t.documentElement=new hc({id:"g-root",style:r}),((t.documentElement.ownerDocument=t).documentElement.parentNode=t).childNodes=[t.documentElement],t}Hc.prototype.apply=function(t){var n=t.camera,e=t.renderingService,r=t.renderingContext,i=this.strategies;e.hooks.cull.tap(Hc.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 pl(b.CULLED)),null))}),e.hooks.afterRender.tap(Hc.tag,function(t){t.cullable.visibilityPlaneMask=-1})},Hc.tag="Culling";var Gc=Hc;function Hc(t){this.strategies=t}Yc.prototype.apply=function(t){var e=t.renderingService;e.hooks.dirtycheck.tap(Yc.tag,function(t){return t&&(t.renderable.dirty||e.disableDirtyRectangleRendering()?t:null)})},Yc.tag="DirtyCheck";var Vc=Yc;function Yc(){}$c.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($c.tag,function(t){t=c.normalizeWheelEvent(t);c.context.eventService.mapEvent(t)}),t.hooks.pointerDown.tap($c.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($c.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($c.tag,this.onPointerMove),t.hooks.pointerOver.tap($c.tag,this.onPointerMove),t.hooks.pointerOut.tap($c.tag,this.onPointerMove),t.hooks.click.tap($c.tag,this.onClick),t.hooks.pointerCancel.tap($c.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)})},$c.prototype.getViewportXY=function(t){var e,n=t.offsetX,r=t.offsetY,i=t.clientX,t=t.clientY;return t=!this.context.config.supportsCSSTransform||A(n)||A(r)?(e=(i=this.context.eventService.client2Viewport(new Ir(i,t))).x,i.y):(e=n,r),{x:e,y:t}},$c.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=ds[t.type]||t.type),t},$c.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},$c.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},$c.prototype.setCursor=function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")},$c.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];Ze(i.button)&&(i.button=0),Ze(i.buttons)&&(i.buttons=1),Ze(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),Ze(i.width)&&(i.width=i.radiusX||1),Ze(i.height)&&(i.height=i.radiusY||1),Ze(i.tiltX)&&(i.tiltX=0),Ze(i.tiltY)&&(i.tiltY=0),Ze(i.pointerType)&&(i.pointerType="touch"),Ze(i.pointerId)&&(i.pointerId=i.identifier||0),Ze(i.pressure)&&(i.pressure=i.force||.5),Ze(i.twist)&&(i.twist=0),Ze(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else e.isMouseEvent(t)?(Ze((e=t).isPrimary)&&(e.isPrimary=!0),Ze(e.width)&&(e.width=1),Ze(e.height)&&(e.height=1),Ze(e.tiltX)&&(e.tiltX=0),Ze(e.tiltY)&&(e.tiltY=0),Ze(e.pointerType)&&(e.pointerType="mouse"),Ze(e.pointerId)&&(e.pointerId=1),Ze(e.pressure)&&(e.pressure=.5),Ze(e.twist)&&(e.twist=0),Ze(e.tangentialPressure)&&(e.tangentialPressure=0),e.isNormalized=!0,n.push(e)):n.push(t);return n},$c.tag="Event";var qc=$c;function $c(){var c=this;this.autoPreventDefault=!1,this.rootPointerEvent=new ll(null),this.rootWheelEvent=new hl(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 Uc=[O.CIRCLE,O.ELLIPSE,O.IMAGE,O.RECT,O.LINE,O.POLYLINE,O.POLYGON,O.TEXT,O.PATH,O.HTML],Xc=(Kc.prototype.isVisible=function(t,e){var n,r,i=e.cullable;return!i.enable||(n=e.getRenderBounds(),!Tr.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||Cr.INDETERMINATE,t.planes),i.visible=i.visibilityPlaneMask!==Cr.OUTSIDE,i.visible))},Kc.prototype.computeVisibilityWithPlaneMask=function(t,e,n,r){if(n===Cr.OUTSIDE||n===Cr.INSIDE)return n;for(var i=Cr.INSIDE,a=-1<Uc.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(Dt(u,e.getPositiveFarPoint(r[o]))+c<0)return Cr.OUTSIDE;Dt(u,e.getNegativeFarPoint(r[o]))+c<0&&(i|=l)}}return i},Kc);function Kc(){}Jc.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,_.enableCSSParsing&&_.styleValueRegistry.recalc(t),_.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),_.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(Jc.tag,function(){l.addEventListener(b.MOUNTED,r),l.addEventListener(b.UNMOUNTED,i),l.addEventListener(b.ATTR_MODIFIED,e),l.addEventListener(b.BOUNDS_CHANGED,n)}),o.hooks.destroy.tap(Jc.tag,function(){l.removeEventListener(b.MOUNTED,r),l.removeEventListener(b.UNMOUNTED,i),l.removeEventListener(b.ATTR_MODIFIED,e),l.removeEventListener(b.BOUNDS_CHANGED,n),a.toSync.clear()}),o.hooks.endFrame.tap(Jc.tag,function(){a.syncRTree()})},Jc.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=j(a.getMin(),2))[0],n=n[1],r=(a=j(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()},Jc.tag="Prepare";var Zc,Qc=Jc;function Jc(){this.toSync=new Set}(Us=Zc=Zc||{}).READY="ready",Us.BEFORE_RENDER="beforerender",Us.RERENDER="rerender",Us.AFTER_RENDER="afterrender",Us.BEFORE_DESTROY="beforedestroy",Us.AFTER_DESTROY="afterdestroy",Us.RESIZE="resize",Us.DIRTY_RECTANGLE="dirtyrectangle",Us.RENDERER_CHANGED="rendererchanged";var tu,eu=new pl(b.MOUNTED),nu=new pl(b.UNMOUNTED),ru=new pl(Zc.BEFORE_RENDER),iu=new pl(Zc.RERENDER),au=new pl(Zc.AFTER_RENDER),ou=(t(su,tu=al),su.prototype.initRenderingContext=function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},su.prototype.initDefaultCamera=function(t,e,n){var r=this,i=new _.CameraContribution;i.clipSpaceNearZ=n,i.setType(zr.EXPLORING,Wr.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(Ur,function(){r.context.renderingContext.renderReasons.add(wl.CAMERA_CHANGED)}),this.context.camera=i},su.prototype.getConfig=function(){return this.context.config},su.prototype.getRoot=function(){return this.document.documentElement},su.prototype.getCamera=function(){return this.context.camera},su.prototype.getContextService=function(){return this.context.contextService},su.prototype.getEventService=function(){return this.context.eventService},su.prototype.getRenderingService=function(){return this.context.renderingService},su.prototype.getRenderingContext=function(){return this.context.renderingContext},su.prototype.getStats=function(){return this.getRenderingService().getStats()},Object.defineProperty(su.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}),su.prototype.destroy=function(t,e){void 0===t&&(t=!0),(e=void 0===e?!1:e)||this.dispatchEvent(new pl(Zc.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 pl(Zc.AFTER_DESTROY))},su.prototype.changeSize=function(t,e){this.resize(t,e)},su.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===Gr.ORTHOGRAPHIC?n.setOrthographic(t/-2,t/2,e/2,e/-2,n.getNear(),n.getFar()):n.setAspect(t/e),this.dispatchEvent(new pl(Zc.RESIZE,{width:t,height:e}))},su.prototype.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},su.prototype.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},su.prototype.removeChild=function(t){return this.document.documentElement.removeChild(t)},su.prototype.removeChildren=function(){this.document.documentElement.removeChildren()},su.prototype.destroyChildren=function(){this.document.documentElement.destroyChildren()},su.prototype.render=function(){var t=this;this.dispatchEvent(ru),this.getRenderingService().render(this.getConfig(),function(){t.dispatchEvent(iu)}),this.dispatchEvent(au)},su.prototype.run=function(){function t(){e.render(),e.frameId=e.requestAnimationFrame(t)}var e=this;t()},su.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 cr,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new qc,new Qc,new Vc,new Gc([new Xc])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(m(m({},_),this.context)),this.context.renderingService=new Ol(_,this.context),this.context.eventService=new bl(_,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)})},su.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 pl(Zc.READY))}):r.dispatchEvent(new pl(Zc.READY)),r.readyPromise&&r.resolveReadyPromise()):r.dispatchEvent(new pl(Zc.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()})},su.prototype.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach(function(t){t.context=e.context,t.init(_)})},su.prototype.setRenderer=function(t){var e,n=this.getConfig();n.renderer!==t&&(e=n.renderer,n.renderer=t,this.destroy(!1,!0),k([],j(null==e?void 0:e.getPlugins()),!1).reverse().forEach(function(t){t.destroy(_)}),this.initRenderer(t))},su.prototype.setCursor=function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)},su.prototype.unmountChildren=function(t){var e=this;t.childNodes.forEach(function(t){e.unmountChildren(t)}),this.inited&&(t.isMutationObserved?t.dispatchEvent(nu):(nu.target=t,this.dispatchEvent(nu,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()},su.prototype.mountChildren=function(t){var e=this;this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,t.isMutationObserved?t.dispatchEvent(eu):(eu.target=t,this.dispatchEvent(eu,!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()},su.prototype.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},su.prototype.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},su.prototype.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},su.prototype.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},su.prototype.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},su.prototype.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},su);function su(t){var e=tu.call(this)||this,n=(e.Element=Jl,e.inited=!1,e.context={},e.document=new zc,(e.document.defaultView=e).customElements=new Bc,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||ls++,ss[w]&&ss[w].destroy(),ss[w]=M),a),M=o,k=s;return r&&(k=1<=(k=s||cs&&window.devicePixelRatio||1)?Math.ceil(k):1,w=a||("auto"===(a=fs(s=r,"width"))?s.offsetWidth:parseFloat(a))||r.width/k,M=o||("auto"===(a=fs(s=r,"height"))?s.offsetHeight:parseFloat(a))||r.height/k),i&&(_.offscreenCanvas=i),e.devicePixelRatio=k,e.requestAnimationFrame=null!=f?f:Ss.bind(_.globalThis),e.cancelAnimationFrame=null!=d?d:As.bind(_.globalThis),e.supportsTouchEvents=null!=y?y:"ontouchstart"in _.globalThis,e.supportsPointerEvents=null!=g?g:!!_.globalThis.PointerEvent,e.isTouchEvent=null!=x?x:function(t){return e.supportsTouchEvents&&t instanceof _.globalThis.TouchEvent},e.isMouseEvent=null!=t?t:function(t){return!_.globalThis.MouseEvent||t instanceof _.globalThis.MouseEvent&&(!e.supportsPointerEvents||!(t instanceof _.globalThis.PointerEvent))},e.initRenderingContext({container:n,canvas:r,width:w,height:M,renderer:l,offscreenCanvas:i,devicePixelRatio:k,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(uu,lu=r),uu.prototype.rotate=function(t,e,n){if(this.relElevation=yr(e),this.relAzimuth=yr(t),this.relRoll=yr(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===zr.EXPLORING){e=Xt(Ut(),[1,0,0],vr((this.rotateWorld?1:-1)*this.relElevation)),t=Xt(Ut(),[0,1,0],vr((this.rotateWorld?1:-1)*this.relAzimuth)),n=Xt(Ut(),[0,0,1],vr(this.relRoll)),t=Kt(Ut(),t,e),t=Kt(Ut(),t,n),e=wt(Z(),t);ut(this.matrix,this.matrix,[0,0,-this.distance]),ct(this.matrix,this.matrix,e),ut(this.matrix,this.matrix,[0,0,this.distance])}else{if(90<Math.abs(this.elevation))return this;this.computeMatrix()}return this._getAxes(),this.type===zr.ORBITING||this.type===zr.EXPLORING?this._getPosition():this.type===zr.TRACKING&&this._getFocalPoint(),this._update(),this},uu.prototype.pan=function(t,e){t=mr(t,e,0),e=Tt(this.position);return jt(e,e,It(v(),this.right,t[0])),jt(e,e,It(v(),this.up,t[1])),this._setPosition(e),this.triggerUpdate(),this},uu.prototype.dolly=function(t){var e=this.forward,n=Tt(this.position),t=(this.dollyingStep,this.distance+t*this.dollyingStep),t=Math.max(Math.min(t,this.maxDistance),this.minDistance)-this.distance;return n[0]+=t*e[0],n[1]+=t*e[1],n[2]+=t*e[2],this._setPosition(n),this.type===zr.ORBITING||this.type===zr.EXPLORING?this._getDistance():this.type===zr.TRACKING&&jt(this.focalPoint,n,this.distanceVector),this.triggerUpdate(),this},uu.prototype.cancelLandmarkAnimation=function(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)},uu.prototype.createLandmark=function(t,e){var n,r=(e=void 0===e?{}:e).position,r=void 0===r?this.position:r,i=e.focalPoint,i=void 0===i?this.focalPoint:i,a=e.roll,e=e.zoom,o=new _.CameraContribution,r=(o.setType(this.type,void 0),o.setPosition(r[0],null!=(n=r[1])?n:this.position[1],null!=(n=r[2])?n:this.position[2]),o.setFocalPoint(i[0],null!=(r=i[1])?r:this.focalPoint[1],null!=(n=i[2])?n:this.focalPoint[2]),o.setRoll(null!=a?a:this.roll),o.setZoom(null!=e?e:this.zoom),{name:t,matrix:Q(o.getWorldTransform()),right:Tt(o.right),up:Tt(o.up),forward:Tt(o.forward),position:Tt(o.getPosition()),focalPoint:Tt(o.getFocalPoint()),distanceVector:Tt(o.getDistanceVector()),distance:o.getDistance(),dollyingStep:o.getDollyingStep(),azimuth:o.getAzimuth(),elevation:o.getElevation(),roll:o.getRoll(),relAzimuth:o.relAzimuth,relElevation:o.relElevation,relRoll:o.relRoll,zoom:o.getZoom()});return this.landmarks.push(r),r},uu.prototype.gotoLandmark=function(e,t){var n,o,r,i,s,l,c,u,h,f,d,p,g,y=this,a=(void 0===t&&(t={}),We(e)?this.landmarks.find(function(t){return t.name===e}):e);a&&(n=void 0===(n=(t=He(t)?{duration:t}:t).easing)?"linear":n,r=t.duration,o=void 0===r?100:r,r=void 0===(r=t.easingFunction)?void 0:r,t=t.onfinish,i=void 0===t?void 0:t,s=.01,0===o?(this.syncFromLandmark(a),i&&i()):(this.cancelLandmarkAnimation(),l=a.position,c=a.focalPoint,u=a.zoom,h=a.roll,f=r||_.EasingFunction(n),p=function(){y.setFocalPoint(c),y.setPosition(l),y.setRoll(h),y.setZoom(u),y.computeMatrix(),y.triggerUpdate(),i&&i()},g=function(t){var e,n,r,i,a,t=t-(d=void 0===d?t:d);o<t||(e=f(t/o),n=v(),r=v(),i=1,a=0,zt(n,y.focalPoint,c,e),zt(r,y.position,l,e),a=y.roll*(1-e)+h*e,i=y.zoom*(1-e)+u*e,y.setFocalPoint(n),y.setPosition(r),y.setRoll(a),y.setZoom(i),Vt(n,c)+Vt(r,l)<=s&&null==u&&null==h)?p():(y.computeMatrix(),y.triggerUpdate(),t<o&&(y.landmarkAnimationID=y.canvas.requestAnimationFrame(g)))},this.canvas.requestAnimationFrame(g)))},uu.prototype.syncFromLandmark=function(t){this.matrix=J(this.matrix,t.matrix),this.right=Lt(this.right,t.right),this.up=Lt(this.up,t.up),this.forward=Lt(this.forward,t.forward),this.position=Lt(this.position,t.position),this.focalPoint=Lt(this.focalPoint,t.focalPoint),this.distanceVector=Lt(this.distanceVector,t.distanceVector),this.azimuth=t.azimuth,this.elevation=t.elevation,this.roll=t.roll,this.relAzimuth=t.relAzimuth,this.relElevation=t.relElevation,this.relRoll=t.relRoll,this.dollyingStep=t.dollyingStep,this.distance=t.distance,this.zoom=t.zoom};var lu,cu=uu;function uu(){var t=null!==lu&&lu.apply(this,arguments)||this;return t.landmarks=[],t}_.CameraContribution=cu;t(du,hu=nl);var hu,fu=du;function du(t,e,n,r){t=hu.call(this,t)||this;return t.currentTime=n,t.timelineTime=r,t.target=e,t.type="finish",t.bubbles=!1,t.currentTarget=e,t.defaultPrevented=!1,t.eventPhase=t.AT_TARGET,t.timeStamp=Date.now(),t.currentTime=n,t.timelineTime=r,t}var pu=0,gu=(Object.defineProperty(yu.prototype,"pending",{get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending},enumerable:!1,configurable:!0}),Object.defineProperty(yu.prototype,"playState",{get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"},enumerable:!1,configurable:!0}),Object.defineProperty(yu.prototype,"ready",{get:function(){var n=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise(function(t,e){n.resolveReadyPromise=function(){t(n)},n.rejectReadyPromise=function(){e(new Error)}}),this.pending)||this.resolveReadyPromise(),this.readyPromise},enumerable:!1,configurable:!0}),Object.defineProperty(yu.prototype,"finished",{get:function(){var n=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise(function(t,e){n.resolveFinishedPromise=function(){t(n)},n.rejectFinishedPromise=function(){e(new Error)}}),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise},enumerable:!1,configurable:!0}),Object.defineProperty(yu.prototype,"currentTime",{get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){var e;t=Number(t),isNaN(t)||(this.timeline.restart(),this._paused||null===this._startTime||(this._startTime=Number(null==(e=this.timeline)?void 0:e.currentTime)-t/this.playbackRate),this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this)))},enumerable:!1,configurable:!0}),Object.defineProperty(yu.prototype,"startTime",{get:function(){return this._startTime},set:function(t){null!==t&&(this.updatePromises(),t=Number(t),isNaN(t)||this._paused||this._idle||(this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()))},enumerable:!1,configurable:!0}),Object.defineProperty(yu.prototype,"playbackRate",{get:function(){return this._playbackRate},set:function(t){var e;t!==this._playbackRate&&(this.updatePromises(),e=this.currentTime,this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==e&&(this.currentTime=e),this.updatePromises())},enumerable:!1,configurable:!0}),Object.defineProperty(yu.prototype,"_isFinished",{get:function(){return!this._idle&&(0<this._playbackRate&&Number(this._currentTime)>=this._totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)},enumerable:!1,configurable:!0}),Object.defineProperty(yu.prototype,"totalDuration",{get:function(){return this._totalDuration},enumerable:!1,configurable:!0}),Object.defineProperty(yu.prototype,"_needsTick",{get:function(){return this.pending||"running"===this.playState||!this._finishedFlag},enumerable:!1,configurable:!0}),yu.prototype.updatePromises=function(){var t=this.oldPlayState,e=this.pending?"pending":this.playState;return this.readyPromise&&e!==t&&("idle"===e?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===t?this.resolveReadyPromise():"pending"===e&&(this.readyPromise=void 0)),this.finishedPromise&&e!==t&&("idle"===e?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===e?this.resolveFinishedPromise():"finished"===t&&(this.finishedPromise=void 0)),this.oldPlayState=e,this.readyPromise||this.finishedPromise},yu.prototype.play=function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()},yu.prototype.pause=function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()},yu.prototype.finish=function(){this.updatePromises(),this._idle||(this.currentTime=0<this._playbackRate?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())},yu.prototype.cancel=function(){var t,e=this;this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises(),this.oncancel)&&(t=new fu(null,this,this.currentTime,null),setTimeout(function(){e.oncancel(t)}))},yu.prototype.reverse=function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()},yu.prototype.updatePlaybackRate=function(t){this.playbackRate=t},yu.prototype.targetAnimations=function(){var t;return(null==(t=this.effect)?void 0:t.target).getAnimations()},yu.prototype.markTarget=function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)},yu.prototype.unmarkTarget=function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)},yu.prototype.tick=function(t,e){this._idle||this._paused||(null===this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))},yu.prototype.rewind=function(){if(0<=this.playbackRate)this.currentTime=0;else{if(!(this._totalDuration<1/0))throw new Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this._totalDuration}},yu.prototype.persist=function(){throw new Error(Hr)},yu.prototype.addEventListener=function(t,e,n){throw new Error(Hr)},yu.prototype.removeEventListener=function(t,e,n){throw new Error(Hr)},yu.prototype.dispatchEvent=function(t){throw new Error(Hr)},yu.prototype.commitStyles=function(){throw new Error(Hr)},yu.prototype.ensureAlive=function(){var t;this.playbackRate<0&&0===this.currentTime?this._inEffect=!(null==(t=this.effect)||!t.update(-1)):this._inEffect=!(null==(t=this.effect)||!t.update(this.currentTime)),this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))},yu.prototype.tickCurrentTime=function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=0<this._playbackRate?this._totalDuration:0),this.ensureAlive())},yu.prototype.fireEvents=function(t){var e,n=this;this._isFinished?this._finishedFlag||(this.onfinish&&(e=new fu(null,this,this.currentTime,t),setTimeout(function(){n.onfinish&&n.onfinish(e)})),this._finishedFlag=!0):(this.onframe&&"running"===this.playState&&(t=new fu(null,this,this.currentTime,t),this.onframe(t)),this._finishedFlag=!1)},yu);function yu(t,e){this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,((this.effect=t).animation=this).timeline=e,this.id="".concat(pu++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null==(t=this.effect)?void 0:t.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}function mu(b,e,x,n){if(!(0<=b&&b<=1&&0<=x&&x<=1))throw new Error("bezier x values must be in [0, 1] range");if(b===e&&x===n)return function(t){return t};for(var w=new(Du?Float32Array:Array)(11),t=0;t<11;++t)w[t]=Gu(.1*t,b,x);function r(t){for(var e=0,n=1;10!==n&&w[n]<=t;++n)e+=.1;var r=e+.1*((t-w[--n])/(w[n+1]-w[n])),i=Hu(r,b,x);if(.001<=i){for(var a=t,o=r,s=b,l=x,c=0;c<Ru;++c){var u=Hu(o,s,l);if(0===u)return o;o-=(Gu(o,s,l)-a)/u}return o}if(0===i)return r;for(var h,f,d=t,p=e,g=e+.1,y=b,m=x,v=0;0<(h=Gu(f=p+(g-p)/2,y,m)-d)?g=f:p=f,Math.abs(h)>Iu&&++v<Bu;);return f}return function(t){return 0===t||1===t?t:Gu(r(t),e,n)}}function vu(t){return Math.pow(t,2)}function bu(t){return Math.pow(t,3)}function xu(t){return Math.pow(t,4)}function wu(t){return Math.pow(t,5)}function Mu(t){return Math.pow(t,6)}function ku(t){return 1-Math.cos(t*Math.PI/2)}function Ou(t){return 1-Math.sqrt(1-t*t)}function Eu(t){return t*t*(3*t-2)}function Su(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)}function Au(t,e){var n=(e=j(e=void 0===e?[]:e,2))[0],e=void 0===(e=e[1])?.5:e,n=Ge(Number(void 0===n?1:n),1,10),e=Ge(Number(e),.1,2);return 0===t||1===t?t:-n*Math.pow(2,10*(t-1))*Math.sin((t-1-e/(2*Math.PI)*Math.asin(1/n))*(2*Math.PI)/e)}function _u(t,e,n){var r=(e=j(e=void 0===e?[]:e,4))[0],i=void 0===(i=e[1])?100:i,a=void 0===(a=e[2])?10:a,e=void 0===(e=e[3])?0:e,r=Ge(void 0===r?1:r,.1,1e3),i=Ge(i,.1,1e3),a=Ge(a,.1,1e3),e=Ge(e,.1,1e3),o=Math.sqrt(i/r),i=(a=a/(2*Math.sqrt(i*r)))<1?o*Math.sqrt(1-a*a):0,r=a<1?(a*o-e)/i:-e+o,e=n?n*t/1e3:t,e=a<1?Math.exp(-e*a*o)*(+Math.cos(i*e)+r*Math.sin(i*e)):(1+r*e)*Math.exp(-e*o);return 0===t||1===t?t:1-e}function Tu(t,e){var e=j(e=void 0===e?[]:e,2),n=void 0===(n=e[0])?10:n;return("start"==e[1]?Math.ceil:Math.floor)(Ge(t,0,1)*n)/n}function Pu(t,e){var n=(e=j(e=void 0===e?[]:e,4))[0],r=e[1],i=e[2],e=e[3];return mu(n,r,i,e)(t)}function Cu(r){return function(t,e,n){return 1-r(1-t,e=void 0===e?[]:e,n)}}function Lu(r){return function(t,e,n){return void 0===e&&(e=[]),t<.5?r(2*t,e,n)/2:1-r(-2*t+2,e,n)/2}}function Nu(r){return function(t,e,n){return void 0===e&&(e=[]),t<.5?(1-r(1-2*t,e,n))/2:(r(2*t-1,e,n)+1)/2}}function ju(t){return t}var Ru=4,Iu=1e-7,Bu=10,Du="function"==typeof Float32Array,Fu=function(t,e){return 1-3*e+3*t},zu=function(t,e){return 3*e-6*t},Wu=function(t){return 3*t},Gu=function(t,e,n){return((Fu(e,n)*t+zu(e,n))*t+Wu(e))*t},Hu=function(t,e,n){return 3*Fu(e,n)*t*t+2*zu(e,n)*t+Wu(e)},So=mu(.42,0,1,1),Vu={steps:Tu,"step-start":function(t){return Tu(t,[1,"start"])},"step-end":function(t){return Tu(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":Pu,ease:function(t){return Pu(t,[.25,.1,.25,1])},in:So,out:Cu(So),"in-out":Lu(So),"out-in":Nu(So),"in-quad":vu,"out-quad":Cu(vu),"in-out-quad":Lu(vu),"out-in-quad":Nu(vu),"in-cubic":bu,"out-cubic":Cu(bu),"in-out-cubic":Lu(bu),"out-in-cubic":Nu(bu),"in-quart":xu,"out-quart":Cu(xu),"in-out-quart":Lu(xu),"out-in-quart":Nu(xu),"in-quint":wu,"out-quint":Cu(wu),"in-out-quint":Lu(wu),"out-in-quint":Nu(wu),"in-expo":Mu,"out-expo":Cu(Mu),"in-out-expo":Lu(Mu),"out-in-expo":Nu(Mu),"in-sine":ku,"out-sine":Cu(ku),"in-out-sine":Lu(ku),"out-in-sine":Nu(ku),"in-circ":Ou,"out-circ":Cu(Ou),"in-out-circ":Lu(Ou),"out-in-circ":Nu(Ou),"in-back":Eu,"out-back":Cu(Eu),"in-out-back":Lu(Eu),"out-in-back":Nu(Eu),"in-bounce":Su,"out-bounce":Cu(Su),"in-out-bounce":Lu(Su),"out-in-bounce":Nu(Su),"in-elastic":Au,"out-elastic":Cu(Au),"in-out-elastic":Lu(Au),"out-in-elastic":Nu(Au),spring:_u,"spring-in":_u,"spring-out":Cu(_u),"spring-in-out":Lu(_u),"spring-out-in":Nu(_u)},Yu=function(t){return("-"===(t=(t=t).replace(/([A-Z])/g,function(t){return"-".concat(t.toLowerCase())})).charAt(0)?t.substring(1):t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()};function qu(n,r){return function(t){var e;return 1<=t?1:(t+=r*(e=1/n))-t%e}}var Co="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",$u=new RegExp("cubic-bezier\\("+Co+","+Co+","+Co+","+Co+"\\)"),Uu=/steps\(\s*(\d+)\s*\)/,Xu=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Ku(t){var e=$u.exec(t);return e?mu.apply(void 0,k([],j(e.slice(1).map(Number)),!1)):(e=Uu.exec(t))?qu(Number(e[1]),0):(e=Xu.exec(t))?qu(Number(e[1]),{start:1,middle:.5,end:0}[e[2]]):Vu[Yu(t)]||Vu.linear}function Zu(t){return Math.abs((0!==(e=t).duration&&0!==e.iterations?("auto"===e.duration?0:Number(e.duration))*(null!=(e=e.iterations)?e:1):0)/(t.playbackRate||1));var e}var Qu=0,Ju=1,th=2,eh=3;function nh(t,e,n){c=t,i=n;var r,i,a,o,s,l=null===(l=e)?Qu:(r=i.endTime,l<Math.min(i.delay,r)?Ju:l>=Math.min(i.delay+c+i.endDelay,r)?th:eh),c=function(t,e,n,r,i){switch(r){case Ju:return"backwards"===e||"both"===e?0:null;case eh:return n-i;case th:return"forwards"===e||"both"===e?t:null;case Qu:return null}}(t,n.fill,e,l,n.delay);return null===c?null:(i="auto"===n.duration?0:n.duration,r=i,t=l,e=n.iterations,o=c,s=n.iterationStart,0===r?t!==Ju&&(s+=e):s+=o/r,e=t=s,o=n.iterationStart,s=l,a=n.iterations,c=c,i=i,e=o=0!==(o=e===1/0?o%1:e%1)||s!==th||0===a||0===c&&0!==i?o:1,s=n.iterations,a=e,c=t,i=l===th&&s===1/0?1/0:1===a?Math.floor(c)-1:Math.floor(c),o=n.direction,t=i,l=e,a="normal"===(s="normal"!==(s=o)&&"reverse"!==o&&(t=t,"alternate-reverse"===o&&(t+=1),s="normal",t!==1/0)&&t%2!=0?"reverse":s)?l:1-l,n.currentIteration=i,n.progress=a,n.easingFunction(a))}function rh(t,e,n){var a=function(t,e){for(var n={},r=0;r<t.length;r++)for(var i in t[r]){var a;ih(i)&&(a={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:Ku(t[r].easing)||e.easingFunction,value:t[r][i]},n[i]=n[i]||[],n[i].push(a))}return n}(t,e),o=function(t,e){var n,r=[];for(n in t)for(var i=t[n],a=0;a<i.length-1;a++){var o=a,s=a+1,l=i[o].computedOffset,c=i[s].computedOffset,u=l,h=c;0===a&&(u=-1/0,0===c)&&(s=o),a===i.length-2&&(h=1/0,1===l)&&(o=s),r.push({applyFrom:u,applyTo:h,startOffset:i[o].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[o].easingFunction,property:n,interpolation:function(t,e,n,r){var i=wo[t];if(i&&i.syntax&&i.int){i=_.styleValueRegistry.getPropertySyntax(i.syntax);if(i){var a,o,s,l=void 0,c=void 0,t=(c=_.enableCSSParsing?(o=_.styleValueRegistry.parseProperty(t,e,r),a=_.styleValueRegistry.parseProperty(t,n,r),l=_.styleValueRegistry.computeProperty(t,o,r),_.styleValueRegistry.computeProperty(t,a,r)):(o=i.parserWithCSSDisabled,l=o?o(e,r):e,o?o(n,r):n),i.mixer(l,c,r));if(t)return s=ah.apply(void 0,k([],j(t),!1)),function(t){return 0===t?e:1===t?n:s(t)}}}return ah(!1,!0,function(t){return t?n:e})}(n,i[o].value,i[s].value,e)})}return r.sort(function(t,e){return t.startOffset-e.startOffset}),r}(a,n);return function(r,i){if(null!==i)o.filter(function(t){return i>=t.applyFrom&&i<t.applyTo}).forEach(function(t){var e=i-t.startOffset,n=t.endOffset-t.startOffset,e=0==n?0:t.easingFunction(e/n);r.setAttribute(t.property,t.interpolation(e))});else for(var t in a)ih(t)&&r.setAttribute(t,null)}}function ih(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var ah=function(e,n,r){return function(t){t=function t(e,n,r){if("number"==typeof e&&"number"==typeof n)return e*(1-r)+n*r;if("boolean"==typeof e&&"boolean"==typeof n||"string"==typeof e&&"string"==typeof n)return r<.5?e:n;if(Array.isArray(e)&&Array.isArray(n)){for(var i=e.length,a=n.length,o=Math.max(i,a),s=[],l=0;l<o;l++)s.push(t(e[l<i?l:i-1],n[l<a?l:a-1],r));return s}throw new Error("Mismatched interpolation arguments "+e+":"+n)}(e,n,t);return!_.enableCSSParsing&&He(t)?t:r(t)}};Object.defineProperty(sh.prototype,"easing",{get:function(){return this._easing},set:function(t){this.easingFunction=Ku(t),this._easing=t},enumerable:!1,configurable:!0});var oh=sh;function sh(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=ju,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null}function lh(t,i){if(null===t)return[];for(var e=(t=Array.isArray(t)?t:function(t){var e,n=[];for(e in t)if(!(e in["easing","offset","composite"]))for(var r,i=t[e],a=(i=Array.isArray(i)?i:[i]).length,o=0;o<a;o++)n[o]||(r={},"offset"in t&&(r.offset=Number(t.offset)),"easing"in t&&(r.easing=t.easing),"composite"in t&&(r.composite=t.composite),n[o]=r),void 0!==i[o]&&null!==i[o]&&(n[o][e]=i[o]);return n.sort(function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)}),n}(t)).map(function(t){var e,n={};for(e in null!=i&&i.composite&&(n.composite="auto"),t){var r=t[e];if("offset"===e){if(null!==r){if(r=Number(r),!isFinite(r))throw new Error("Keyframe offsets must be numbers.");if(r<0||1<r)throw new Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=r}}else if("composite"===e&&-1===["replace","add","accumulate","auto"].indexOf(r))throw new Error("".concat(r," compositing is not supported"));n[e]=r}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==i?void 0:i.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n}),n=!0,r=-1/0,a=0;a<e.length;a++){var o=e[a].offset;if(A(o))n=!1;else{if(o<r)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");r=o}}if(e=e.filter(function(t){return 0<=Number(t.offset)&&Number(t.offset)<=1}),!n)for(var s=e.length,l=(e[s-1].computedOffset=Number(null!=(t=e[s-1].offset)?t:1),1<s&&(e[0].computedOffset=Number(null!=(t=e[0].offset)?t:0)),0),c=Number(e[0].computedOffset),u=1;u<s;u++){var h=e[u].computedOffset;if(!A(h)&&!A(c)){for(var f=1;f<u-l;f++)e[l+f].computedOffset=c+(Number(h)-c)*f/(u-l);l=u,c=Number(h)}}return e}var ch="backwards|forwards|both|none".split("|"),uh="reverse|alternate|alternate-reverse".split("|");function hh(t,e){return t=function(t){"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t});return t}(null!=t?t:{duration:"auto"}),n=t,t=e,r=new oh,t&&(r.fill="both",r.duration="auto"),"number"!=typeof n||isNaN(n)?void 0!==n&&Object.keys(n).forEach(function(t){void 0===n[t]||null===n[t]||"auto"===n[t]||!("number"!=typeof r[t]&&"duration"!==t||"number"==typeof n[t]&&!isNaN(n[t]))||"fill"===t&&-1===ch.indexOf(n[t])||"direction"===t&&-1===uh.indexOf(n[t])||(r[t]=n[t])}):r.duration=n,r;var n,r}dh.prototype.applyInterpolations=function(){this.interpolations(this.target,Number(this.timeFraction))},dh.prototype.update=function(t){return null!==t&&(this.timeFraction=nh(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},dh.prototype.getKeyframes=function(){return this.normalizedKeyframes},dh.prototype.setKeyframes=function(t){this.normalizedKeyframes=lh(t)},dh.prototype.getComputedTiming=function(){return this.computedTiming},dh.prototype.getTiming=function(){return this.timing},dh.prototype.updateTiming=function(e){var n=this;Object.keys(e||{}).forEach(function(t){n.timing[t]=e[t]})};var fh=dh;function dh(t,e,n){var r=this,t=(this.composite="replace",this.iterationComposite="replace",this.target=t,this.timing=hh(n,!1),(this.timing.effect=this).timing.activeDuration=Zu(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=lh(e,this.timing),this.interpolations=rh(this.normalizedKeyframes,this.timing,this.target),_.globalThis.Proxy);this.computedTiming=t?new t(this.timing,{get:function(t,e){return"duration"===e?"auto"===t.duration?0:t.duration:"fill"===e?"auto"===t.fill?"none":t.fill:"localTime"===e?r.animation&&r.animation.currentTime||null:"currentIteration"===e?r.animation&&"running"===r.animation.playState?t.currentIteration||0:null:"progress"===e?r.animation&&"running"===r.animation.playState?t.progress||0:null:t[e]},set:function(){return!0}}):this.timing}function ph(t,e){return Number(t.id)-Number(e.id)}gh.prototype.getAnimations=function(){return this.discardAnimations(),this.animations.slice()},gh.prototype.isTicking=function(){return this.inTick},gh.prototype.play=function(t,e,n){t=new fh(t,e,n),e=new gu(t,this);return this.animations.push(e),this.restartWebAnimationsNextTick(),e.updatePromises(),e.play(),e.updatePromises(),e},gh.prototype.applyDirtiedAnimation=function(t){var e=this;this.inTick||(t.markTarget(),(t=t.targetAnimations()).sort(ph),this.tick(Number(this.currentTime),!1,t.slice())[1].forEach(function(t){t=e.animations.indexOf(t);-1!==t&&e.animations.splice(t,1)}),this.applyPendingEffects())},gh.prototype.restart=function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame(function(){}),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame},gh.prototype.destroy=function(){this.document.defaultView.cancelAnimationFrame(this.frameId)},gh.prototype.applyPendingEffects=function(){this.pendingEffects.forEach(function(t){null!=t&&t.applyInterpolations()}),this.pendingEffects=[]},gh.prototype.updateAnimationsPromises=function(){this.animationsWithPromises=this.animationsWithPromises.filter(function(t){return t.updatePromises()})},gh.prototype.discardAnimations=function(){this.updateAnimationsPromises(),this.animations=this.animations.filter(function(t){return"finished"!==t.playState&&"idle"!==t.playState})},gh.prototype.restartWebAnimationsNextTick=function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))},gh.prototype.rAF=function(t){var e=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([e,t]),e},gh.prototype.requestAnimationFrame=function(e){var n=this;return this.rAF(function(t){n.updateAnimationsPromises(),e(t),n.updateAnimationsPromises()})},gh.prototype.tick=function(n,r,t){var i=this,a=(this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=n,this.ticking=!1,[]),o=[],s=[],l=[];return t.forEach(function(t){t.tick(n,r),t._inEffect?(o.push(t.effect),t.markTarget()):(a.push(t.effect),t.unmarkTarget()),t._needsTick&&(i.ticking=!0);var e=t._inEffect||t._needsTick;((t._inTimeline=e)?s:l).push(t)}),(t=this.pendingEffects).push.apply(t,k([],j(a),!1)),(t=this.pendingEffects).push.apply(t,k([],j(o),!1)),this.ticking&&this.requestAnimationFrame(function(){}),this.inTick=!1,[s,l]};Vo=gh;function gh(t){var n=this;this.document=t,this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.webAnimationsNextTick=function(t){n.currentTime=t,n.discardAnimations(),0===n.animations.length?n.timelineTicking=!1:n.requestAnimationFrame(n.webAnimationsNextTick)},this.processRafCallbacks=function(e){var t=n.rafCallbacks;n.rafCallbacks=[],e<Number(n.currentTime)&&(e=Number(n.currentTime)),n.animations.sort(ph),n.animations=n.tick(e,!0,n.animations)[0],t.forEach(function(t){t[1](e)}),n.applyPendingEffects()}}_.EasingFunction=Ku,_.AnimationTimeline=Vo;const yh="main-layer",mh="label-layer",vh="element",bh="view",xh="plot",wh="component",Mh="label",kh="area";function Oh(t,e){e=e.r;t.arc(e,e,e,0,2*Math.PI,!1)}function Eh(t,e){var n,r,i=e.rx,e=e.ry;t.ellipse?t.ellipse(i,e,i,e,0,0,2*Math.PI,!1):(n=e<i?i:e,r=e<i?1:i/e,e=e<i?e/i:1,t.save(),t.scale(r,e),t.arc(0,0,n,0,2*Math.PI))}function Sh(t,e){var n,r,i=e.x1,a=e.y1,o=e.x2,s=e.y2,l=e.defX,l=void 0===l?0:l,c=e.defY,c=void 0===c?0:c,u=e.markerStart,h=e.markerEnd,f=e.markerStartOffset,e=e.markerEndOffset,d=0,p=0,g=0,y=0,m=0;u&&ql(u)&&f&&(n=o-i,r=s-a,m=Math.atan2(r,n),d=Math.cos(m)*(f||0),p=Math.sin(m)*(f||0)),h&&ql(h)&&e&&(n=i-o,r=a-s,m=Math.atan2(r,n),g=Math.cos(m)*(e||0),y=Math.sin(m)*(e||0)),t.moveTo(i-l+d,a-c+p),t.lineTo(o-l+g,s-c+y)}function Ah(t,e){var n,r,i,a,o=e.defX,s=void 0===o?0:o,o=e.defY,l=void 0===o?0:o,o=e.markerStart,c=e.markerEnd,u=e.markerStartOffset,h=e.markerEndOffset,e=e.path,f=e.absolutePath,d=e.segments,p=0,g=0,y=0,m=0,e=0;o&&ql(o)&&u&&(i=(o=j(o.parentNode.getStartTangent(),2))[0],a=o[1],n=i[0]-a[0],r=i[1]-a[1],e=Math.atan2(r,n),p=Math.cos(e)*(u||0),g=Math.sin(e)*(u||0)),c&&ql(c)&&h&&(i=(o=j(c.parentNode.getEndTangent(),2))[0],a=o[1],n=i[0]-a[0],r=i[1]-a[1],e=Math.atan2(r,n),y=Math.cos(e)*(h||0),m=Math.sin(e)*(h||0));for(var v=0;v<f.length;v++){var b=f[v],x=b[0],w=f[v+1],M=0===v&&(0!==p||0!==g),k=(v===f.length-1||w&&("M"===w[0]||"Z"===w[0]))&&0!==y&&0!==m;switch(x){case"M":M?(t.moveTo(b[1]-s+p,b[2]-l+g),t.lineTo(b[1]-s,b[2]-l)):t.moveTo(b[1]-s,b[2]-l);break;case"L":k?t.lineTo(b[1]-s+y,b[2]-l+m):t.lineTo(b[1]-s,b[2]-l);break;case"Q":t.quadraticCurveTo(b[1]-s,b[2]-l,b[3]-s,b[4]-l),k&&t.lineTo(b[3]-s+y,b[4]-l+m);break;case"C":t.bezierCurveTo(b[1]-s,b[2]-l,b[3]-s,b[4]-l,b[5]-s,b[6]-l),k&&t.lineTo(b[5]-s+y,b[6]-l+m);break;case"A":var O,E,S=d[v].arcParams,A=S.cx,_=S.cy,T=S.rx,P=S.ry,C=S.startAngle,L=S.endAngle,N=S.xRotation,S=S.sweepFlag;t.ellipse?t.ellipse(A-s,_-l,T,P,N,C,L,!!(1-S)):(O=P<T?T:P,E=P<T?1:T/P,P=P<T?P/T:1,t.translate(A-s,_-l),t.rotate(N),t.scale(E,P),t.arc(0,0,O,C,L,!!(1-S)),t.scale(1/E,1/P),t.rotate(-N),t.translate(-(A-s),-(_-l))),k&&t.lineTo(b[6]-s+y,b[7]-l+m);break;case"Z":t.closePath()}}}function _h(t,e){var n,r,i=e.defX,a=void 0===i?0:i,i=e.defY,o=void 0===i?0:i,i=e.markerStart,s=e.markerEnd,l=e.markerStartOffset,c=e.markerEndOffset,u=e.points.points,h=u.length,e=u[0][0]-a,f=u[0][1]-o,d=u[h-1][0]-a,p=u[h-1][1]-o,g=0,y=0,m=0,v=0,b=0;i&&ql(i)&&l&&(n=u[1][0]-u[0][0],r=u[1][1]-u[0][1],b=Math.atan2(r,n),g=Math.cos(b)*(l||0),y=Math.sin(b)*(l||0)),s&&ql(s)&&c&&(n=u[h-1][0]-u[0][0],r=u[h-1][1]-u[0][1],b=Math.atan2(r,n),m=Math.cos(b)*(c||0),v=Math.sin(b)*(c||0)),t.moveTo(e+(g||m),f+(y||v));for(var x=1;x<h-1;x++){var w=u[x];t.lineTo(w[0]-a,w[1]-o)}t.lineTo(d,p)}function Th(t,e){var n,r,i=e.defX,a=void 0===i?0:i,i=e.defY,o=void 0===i?0:i,i=e.markerStart,s=e.markerEnd,l=e.markerStartOffset,c=e.markerEndOffset,u=e.points.points,h=u.length,e=u[0][0]-a,f=u[0][1]-o,d=u[h-1][0]-a,p=u[h-1][1]-o,g=0,y=0,m=0,v=0,b=0;i&&ql(i)&&l&&(n=u[1][0]-u[0][0],r=u[1][1]-u[0][1],b=Math.atan2(r,n),g=Math.cos(b)*(l||0),y=Math.sin(b)*(l||0)),s&&ql(s)&&c&&(n=u[h-2][0]-u[h-1][0],r=u[h-2][1]-u[h-1][1],b=Math.atan2(r,n),m=Math.cos(b)*(c||0),v=Math.sin(b)*(c||0)),t.moveTo(e+g,f+y);for(var x=1;x<h-1;x++){var w=u[x];t.lineTo(w[0]-a,w[1]-o)}t.lineTo(d+m,p+v)}function Ph(t,e){var n,r,i,a,o=e.radius,s=e.width,e=e.height,l=s,c=e;o&&o.some(function(t){return 0!==t})?(n=(s=0<s?1:-1)+(e=0<e?1:-1)==0,r=(o=j(o.map(function(t){return Ge(t,0,Math.min(Math.abs(l)/2,Math.abs(c)/2))}),4))[0],i=o[1],a=o[2],o=o[3],t.moveTo(s*r,0),t.lineTo(l-s*i,0),0!==i&&t.arc(l-s*i,e*i,i,-e*Math.PI/2,0<s?0:Math.PI,n),t.lineTo(l,c-e*a),0!==a&&t.arc(l-s*a,c-e*a,a,0<s?0:Math.PI,0<e?Math.PI/2:1.5*Math.PI,n),t.lineTo(s*o,c),0!==o&&t.arc(s*o,c-e*o,o,0<e?Math.PI/2:-Math.PI/2,0<s?Math.PI:0,n),t.lineTo(0,e*r),0!==r&&t.arc(s*r,e*r,r,0<s?Math.PI:0,0<e?1.5*Math.PI:Math.PI/2,n)):t.rect(0,0,l,c)}t(Nh,Ch=n),Nh.prototype.init=function(){(t={})[O.CIRCLE]=Oh,t[O.ELLIPSE]=Eh,t[O.RECT]=Ph,t[O.LINE]=Sh,t[O.POLYLINE]=Th,t[O.POLYGON]=_h,t[O.PATH]=Ah,t[O.TEXT]=void 0,t[O.GROUP]=void 0,t[O.IMAGE]=void 0,t[O.HTML]=void 0,t[O.MESH]=void 0;var t;this.context.pathGeneratorFactory=t},Nh.prototype.destroy=function(){delete this.context.pathGeneratorFactory};var Ch,Lh=Nh;function Nh(){var t=null!==Ch&&Ch.apply(this,arguments)||this;return t.name="canvas-path-generator",t}var jh=v(),Rh=v(),Ih=v(),Bh=Z(),Dh=(Fh.prototype.apply=function(t,e){var n=this,r=t.renderingService,i=t.renderingContext,a=(this.context=t,this.runtime=e,null==(t=i.root)?void 0:t.ownerDocument);r.hooks.pick.tapPromise(Fh.tag,function(e){return X(n,void 0,void 0,function(){return R(this,function(t){return[2,this.pick(a,e)]})})}),r.hooks.pickSync.tap(Fh.tag,function(t){return n.pick(a,t)})},Fh.prototype.pick=function(t,e){var n,r,i=e.topmost,a=(o=e.position).x,o=o.y,s=Nt(jh,a,o,0),a=t.elementsFromBBox(s[0],s[1],s[0],s[1]),l=[];try{for(var c=I(a),u=c.next();!u.done;u=c.next()){var h=u.value,f=h.getWorldTransform();if(this.isHit(h,s,f,!1)){var d=hs(h);if(d){var p=d.parsedStyle.clipPath;if(this.isHit(p,s,p.getWorldTransform(),!0)){if(i)return e.picked=[h],e;l.push(h)}}else{if(i)return e.picked=[h],e;l.push(h)}}}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return e.picked=l,e},Fh.tag="CanvasPicker",Fh);function Fh(){var o=this;this.isHit=function(t,e,n,r){var i=o.context.pointInPathPickerFactory[t.nodeName];if(i){var n=rt(Bh,n),e=Wt(Rh,Nt(Ih,e[0],e[1],0),n),n=t.getGeometryBounds().halfExtents,a=t.parsedStyle.anchor;if(e[0]+=(a&&a[0]||0)*n[0]*2,e[1]+=(a&&a[1]||0)*n[1]*2,i(t,new Ir(e[0],e[1]),r,o.isPointInPath,o.context,o.runtime))return!0}return!1},this.isPointInPath=function(t,e){var n=o.runtime.offscreenCanvasCreator.getOrCreateContext(o.context.config.offscreenCanvas),r=o.context.pathGeneratorFactory[t.nodeName];return r&&(n.beginPath(),r(n,t.parsedStyle),n.closePath()),n.isPointInPath(e.x,e.y)}}function zh(t,e,n){var t=t.parsedStyle,r=t.r,i=t.fill,a=t.stroke,o=t.lineWidth,s=t.increasedLineWidthForHitTesting,t=t.pointerEvents,o=((o||0)+(s||0))/2,s=jn(r,r,e.x,e.y),e=j(ps(t,i,a),2),t=e[0],i=e[1];return t&&i||n?s<=r+o:t?s<=r:!!i&&r-o<=s&&s<=r+o}function Wh(t,e,n,r){return t/(n*n)+e/(r*r)}function Gh(t,e,n){var t=t.parsedStyle,r=t.rx,i=t.ry,a=t.fill,o=t.stroke,s=t.lineWidth,l=t.increasedLineWidthForHitTesting,t=t.pointerEvents,c=e.x,e=e.y,t=j(ps(t,a,o),2),a=t[0],o=t[1],t=((s||0)+(l||0))/2,s=(c-r)*(c-r),l=(e-i)*(e-i);return a&&o||n?Wh(s,l,r+t,i+t)<=1:a?Wh(s,l,r,i)<=1:!!o&&1<=Wh(s,l,r-t,i-t)&&Wh(s,l,r+t,i+t)<=1}function Hh(t,e,n,r,i,a){return t<=i&&i<=t+n&&e<=a&&a<=e+r}function Vh(t,e,n,r,i,a,o,s){var l=(Math.atan2(s-e,o-t)+2*Math.PI)%(2*Math.PI),t={x:t+n*Math.cos(l),y:e+n*Math.sin(l)};return jn(t.x,t.y,o,s)<=a/2}function Yh(t,e,n,r,i,a,o){var s=Math.min(t,n),l=Math.max(t,n),c=Math.min(e,r),u=Math.max(e,r),h=i/2;return s-h<=a&&a<=l+h&&c-h<=o&&o<=u+h&&zn(t,e,n,r,a,o)<=i/2}function qh(t,e,n,r,i){var a=t.length;if(!(a<2)){for(var o=0;o<a-1;o++)if(Yh(t[o][0],t[o][1],t[o+1][0],t[o+1][1],e,n,r))return!0;if(i){var i=t[0],s=t[a-1];if(Yh(i[0],i[1],s[0],s[1],e,n,r))return!0}}return!1}var $h=1e-6;function Uh(t){return Math.abs(t)<$h?0:t<0?-1:1}function Xh(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var a,o,s,l=0;l<i;l++){var c=t[l],u=t[(l+1)%i];if(o=u,((s=[e,n])[0]-(a=c)[0])*(o[1]-a[1])==(o[0]-a[0])*(s[1]-a[1])&&Math.min(a[0],o[0])<=s[0]&&s[0]<=Math.max(a[0],o[0])&&Math.min(a[1],o[1])<=s[1]&&s[1]<=Math.max(a[1],o[1]))return!0;0<Uh(c[1]-n)!=0<Uh(u[1]-n)&&Uh(e-(n-c[1])*(c[0]-u[0])/(c[1]-u[1])-c[0])<0&&(r=!r)}return r}function Kh(t,e,n){for(var r=!1,i=0;i<t.length&&!(r=Xh(t[i],e,n));i++);return r}function Zh(t,e,n){var t=t.parsedStyle,r=t.x1,i=t.y1,a=t.x2,o=t.y2,s=t.lineWidth,l=t.increasedLineWidthForHitTesting,c=t.defX,c=void 0===c?0:c,u=t.defY,u=void 0===u?0:u;return!(!j(ps(t.pointerEvents,t.fill,t.stroke),2)[1]&&!n||!s)&&Yh(r,i,a,o,(s||0)+(l||0),e.x+c,e.y+u)}function Qh(t,e,n,r,i,a){var o=t.parsedStyle,s=o.lineWidth,l=o.increasedLineWidthForHitTesting,c=o.stroke,u=o.fill,h=o.defX,h=void 0===h?0:h,f=o.defY,f=void 0===f?0:f,d=o.path,o=o.pointerEvents,p=d.segments,g=d.hasArc,y=d.polylines,d=d.polygons,o=j(ps(o,(null==d?void 0:d.length)&&u,c),2),u=o[0],c=o[1],o=ja(t),m=!1;return u||n?g?r(t,e):Kh(d,e.x+h,e.y+f)||Kh(y,e.x+h,e.y+f):c||n?function(t,e,n,r,i){for(var a=!1,o=e/2,s=0;s<t.length;s++){var l=t[s],c=l.currentPoint,u=l.params,h=l.prePoint,f=l.box;if(!f||Hh(f.x-o,f.y-o,f.width+e,f.height+e,n,r))switch(l.command){case"L":case"Z":if(a=Yh(h[0],h[1],c[0],c[1],e,n,r))return!0;break;case"Q":if(a=$n(h[0],h[1],u[1],u[2],u[3],u[4],n,r)<=e/2)return!0;break;case"C":if(a=Hn(h[0],h[1],u[1],u[2],u[3],u[4],u[5],u[6],n,r,i)<=e/2)return!0;break;case"A":l.cubicParams||(l.cubicParams=me(h[0],h[1],u[1],u[2],u[3],u[4],u[5],u[6],u[7],void 0));for(var d=l.cubicParams,p=h,g=0;g<d.length;g+=6){var y=Hn(p[0],p[1],d[g],d[g+1],d[g+2],d[g+3],d[g+4],d[g+5],n,r,i),p=[d[g+4],d[g+5]];if(a=y<=e/2)return!0}}}return a}(p,(s||0)+(l||0),e.x+h,e.y+f,o):m}function Jh(t,e,n){var t=t.parsedStyle,r=t.stroke,i=t.fill,a=t.lineWidth,o=t.increasedLineWidthForHitTesting,s=t.points,l=t.defX,l=void 0===l?0:l,c=t.defY,c=void 0===c?0:c,t=j(ps(t.pointerEvents,i,r),2),i=t[0],r=!1;return r=(r=t[1]||n?qh(s.points,(a||0)+(o||0),e.x+l,e.y+c,!0):r)||!i&&!n?r:Xh(s.points,e.x+l,e.y+c)}function tf(t,e,n){var t=t.parsedStyle,r=t.lineWidth,i=t.increasedLineWidthForHitTesting,a=t.points,o=t.defX,o=void 0===o?0:o,s=t.defY,s=void 0===s?0:s;return!(!j(ps(t.pointerEvents,t.fill,t.stroke),2)[1]&&!n||!r)&&qh(a.points,(r||0)+(i||0),e.x+o,e.y+s,!1)}function ef(t,e,n,r,i){var a,o,s,l,c,u,h,f,d,p=t.parsedStyle,g=p.radius,y=p.fill,m=p.stroke,v=p.lineWidth,b=p.increasedLineWidthForHitTesting,x=p.width,w=p.height,p=j(ps(p.pointerEvents,y,m),2),y=p[0],m=p[1],p=(v||0)+(b||0);return g&&g.some(function(t){return 0!==t})?(v=!1,(m||n)&&(h=b=0,l=x,u=w,g=g.map(function(t){return Ge(t,0,Math.min(Math.abs(x)/2,Math.abs(w)/2))}),d=p,a=e.x,o=e.y,g=j(g,4),f=g[0],s=g[1],c=g[2],g=g[3],v=Yh(b+f,h,b+l-s,h,d,a,o)||Yh(b+l,h+s,b+l,h+u-c,d,a,o)||Yh(b+l-c,h+u,b+g,h+u,d,a,o)||Yh(b,h+u-g,b,h+f,d,a,o)||Vh(b+l-s,h+s,s,Math.PI,Math.PI,d,a,o)||Vh(b+l-c,h+u-c,c,0,Math.PI,d,a,o)||Vh(b+g,h+u-g,g,Math.PI,Math.PI,d,a,o)||Vh(b+f,h+f,f,Math.PI,Math.PI,d,a,o)),v||!y&&!n?v:r(t,e)):(s=p/2,y&&m||n?Hh(0-s,0-s,x+s,w+s,e.x,e.y):y?Hh(0,0,x,w,e.x,e.y):!!m&&(c=l=0,u=x,g=w,b=p,h=e.x,f=e.y,Hh(l-(d=b/2),c-d,u,b,h,f)||Hh(l+u-d,c-d,b,g,h,f)||Hh(l+d,c+g-d,u,b,h,f)||Hh(l-d,c+d,b,g,h,f)))}function nf(t,e,n,r,i,a){var o,s=t.parsedStyle,l=s.pointerEvents,c=s.width,s=s.height;return"non-transparent-pixel"!==l||(l=i.config.offscreenCanvas,o=a.offscreenCanvasCreator.getOrCreateCanvas(l),a=a.offscreenCanvasCreator.getOrCreateContext(l,{willReadFrequently:!0}),o.width=c,o.height=s,i.defaultStyleRendererFactory[O.IMAGE].render(a,t.parsedStyle,t,void 0,void 0,void 0),a.getImageData(e.x,e.y,1,1).data.every(function(t){return 0!==t}))}t(of,rf=n),of.prototype.init=function(){(t={})[O.CIRCLE]=zh,t[O.ELLIPSE]=Gh,t[O.RECT]=ef,t[O.LINE]=Zh,t[O.POLYLINE]=tf,t[O.POLYGON]=Jh,t[O.PATH]=Qh,t[O.TEXT]=function(){return!0},t[O.GROUP]=null,t[O.IMAGE]=nf,t[O.HTML]=null,t[O.MESH]=null;var t;this.context.pointInPathPickerFactory=t,this.addRenderingPlugin(new Dh)},of.prototype.destroy=function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()};var rf,af=of;function of(){var t=null!==rf&&rf.apply(this,arguments)||this;return t.name="canvas-picker",t}lf.prototype.apply=function(t,c){function i(t){(t=t.target.rBushNode).aabb&&u.removedRBushNodeAABBs.push(t.aabb)}function a(t){(t=t.target.rBushNode).aabb&&u.removedRBushNodeAABBs.push(t.aabb)}var u=this,h=(this.context=t).config,f=t.camera,l=t.renderingService,d=t.renderingContext,e=t.rBushRoot,n=t.pathGeneratorFactory,p=(this.rBush=e,this.pathGeneratorFactory=n,t.contextService),g=d.root.ownerDocument.defaultView,y=(l.hooks.init.tap(lf.tag,function(){g.addEventListener(b.UNMOUNTED,i),g.addEventListener(b.CULLED,a);var t=p.getDPR(),e=h.width,n=h.height,r=p.getContext();u.clearRect(r,0,0,e*t,n*t,h.background)}),l.hooks.destroy.tap(lf.tag,function(){g.removeEventListener(b.UNMOUNTED,i),g.removeEventListener(b.CULLED,a)}),l.hooks.beginFrame.tap(lf.tag,function(){var t=p.getContext(),e=p.getDPR(),n=h.width,r=h.height,i=(a=u.canvasRendererPluginOptions).dirtyObjectNumThreshold,a=a.dirtyObjectRatioThreshold,o=(s=l.getStats()).total,s=s.rendered,o=s/o;u.clearFullScreen=l.disableDirtyRectangleRendering()||i<s&&a<o,t&&(t.resetTransform?t.resetTransform():t.setTransform(1,0,0,1,0,0),u.clearFullScreen)&&u.clearRect(t,0,0,n*e,r*e,h.background)}),function(t,e){t.isVisible()&&!t.isCulled()&&(u.renderDisplayObject(t,e,u.context,u.restoreStack,c),u.saveDirtyAABB(t)),(t.sortable.sorted||t.childNodes).forEach(function(t){y(t,e)})});l.hooks.endFrame.tap(lf.tag,function(){var e=p.getContext(),t=p.getDPR();if(gt(u.dprMatrix,[t,t,1]),ct(u.vpMatrix,u.dprMatrix,f.getOrthoMatrix()),u.clearFullScreen)y(d.root,e);else{t=u.safeMergeAABB.apply(u,k([u.mergeDirtyAABBs(u.renderQueue)],j(u.removedRBushNodeAABBs.map(function(t){var e=t.minX,n=t.minY,r=t.maxX,t=t.maxY,i=new Tr;return i.setMinMax([e,n,0],[r,t,0]),i})),!1));if(u.removedRBushNodeAABBs=[],Tr.isEmpty(t))return void(u.renderQueue=[]);var n=u.convertAABB2Rect(t),r=n.x,i=n.y,a=n.width,n=n.height,o=Wt(u.vec3a,[r,i,0],u.vpMatrix),s=Wt(u.vec3b,[r+a,i,0],u.vpMatrix),l=Wt(u.vec3c,[r,i+n,0],u.vpMatrix),r=Wt(u.vec3d,[r+a,i+n,0],u.vpMatrix),a=Math.min(o[0],s[0],r[0],l[0]),i=Math.min(o[1],s[1],r[1],l[1]),n=Math.max(o[0],s[0],r[0],l[0]),o=Math.max(o[1],s[1],r[1],l[1]),s=Math.floor(a),r=Math.floor(i),l=Math.ceil(n-a),n=Math.ceil(o-i);e.save(),u.clearRect(e,s,r,l,n,h.background),e.beginPath(),e.rect(s,r,l,n),e.clip(),e.setTransform(u.vpMatrix[0],u.vpMatrix[1],u.vpMatrix[4],u.vpMatrix[5],u.vpMatrix[12],u.vpMatrix[13]),h.renderer.getConfig().enableDirtyRectangleRenderingDebug&&g.dispatchEvent(new pl(Zc.DIRTY_RECTANGLE,{dirtyRect:{x:s,y:r,width:l,height:n}})),u.searchDirtyObjects(t).sort(function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder}).forEach(function(t){t&&t.isVisible()&&!t.isCulled()&&u.renderDisplayObject(t,e,u.context,u.restoreStack,c)}),e.restore(),u.renderQueue.forEach(function(t){u.saveDirtyAABB(t)}),u.renderQueue=[]}u.restoreStack.forEach(function(){e.restore()}),u.restoreStack=[]}),l.hooks.render.tap(lf.tag,function(t){u.clearFullScreen||u.renderQueue.push(t)})},lf.prototype.clearRect=function(t,e,n,r,i,a){t.clearRect(e,n,r,i),a&&(t.fillStyle=a,t.fillRect(e,n,r,i))},lf.prototype.renderDisplayObject=function(t,e,n,r,i){var a,o=t.nodeName,s=r[r.length-1],s=(!s||t.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_CONTAINS||(e.restore(),r.pop()),this.context.styleRendererFactory[o]),o=this.pathGeneratorFactory[o],l=t.parsedStyle.clipPath;l&&(this.applyWorldTransform(e,l),a=this.pathGeneratorFactory[l.nodeName])&&(e.save(),r.push(t),e.beginPath(),a(e,l.parsedStyle),e.closePath(),e.clip()),s&&(this.applyWorldTransform(e,t),e.save(),this.applyAttributesToContext(e,t)),o&&(e.beginPath(),o(e,t.parsedStyle),t.nodeName!==O.LINE)&&t.nodeName!==O.PATH&&t.nodeName!==O.POLYLINE&&e.closePath(),s&&(s.render(e,t.parsedStyle,t,n,this,i),e.restore()),t.renderable.dirty=!1},lf.prototype.convertAABB2Rect=function(t){var e=t.getMin(),t=t.getMax(),n=Math.floor(e[0]),e=Math.floor(e[1]);return{x:n,y:e,width:Math.ceil(t[0])-n,height:Math.ceil(t[1])-e}},lf.prototype.mergeDirtyAABBs=function(t){var n=new Tr;return t.forEach(function(t){var e=t.getRenderBounds(),e=(n.add(e),t.renderable.dirtyRenderBounds);e&&n.add(e)}),n},lf.prototype.searchDirtyObjects=function(t){var e=(n=j(t.getMin(),2))[0],n=n[1],r=(t=j(t.getMax(),2))[0],t=t[1];return this.rBush.search({minX:e,minY:n,maxX:r,maxY:t}).map(function(t){return t.displayObject})},lf.prototype.saveDirtyAABB=function(t){var e=t.renderable,t=(e.dirtyRenderBounds||(e.dirtyRenderBounds=new Tr),t.getRenderBounds());t&&e.dirtyRenderBounds.update(t.center,t.halfExtents)},lf.prototype.applyAttributesToContext=function(t,e){var n=(o=e.parsedStyle).stroke,r=o.fill,i=o.opacity,a=o.lineDash,o=o.lineDashOffset;a&&t.setLineDash(a),A(o)||(t.lineDashOffset=o),A(i)||(t.globalAlpha*=i),A(n)||Array.isArray(n)||n.isNone||(t.strokeStyle=e.attributes.stroke),A(r)||Array.isArray(r)||r.isNone||(t.fillStyle=e.attributes.fill)},lf.prototype.applyWorldTransform=function(t,e,n){var r=0,i=0,a=(e.parsedStyle||{}).anchor,o=a&&a[0]||0,a=a&&a[1]||0;0===o&&0===a||(r=-o*((o=e.geometry.contentBounds)&&2*o.halfExtents[0]||0),i=-a*(o&&2*o.halfExtents[1]||0)),n?(J(this.tmpMat4,e.getLocalTransform()),this.vec3a[0]=r,this.vec3a[1]=i,this.vec3a[2]=0,ut(this.tmpMat4,this.tmpMat4,this.vec3a),ct(this.tmpMat4,n,this.tmpMat4)):(J(this.tmpMat4,e.getWorldTransform()),this.vec3a[0]=r,this.vec3a[1]=i,this.vec3a[2]=0,ut(this.tmpMat4,this.tmpMat4,this.vec3a)),ct(this.tmpMat4,this.vpMatrix,this.tmpMat4),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])},lf.prototype.safeMergeAABB=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=new Tr;return t.forEach(function(t){n.add(t)}),n},lf.tag="CanvasRenderer";var sf=lf;function lf(t){this.canvasRendererPluginOptions=t,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.vpMatrix=Z(),this.dprMatrix=Z(),this.tmpMat4=Z(),this.vec3a=v(),this.vec3b=v(),this.vec3c=v(),this.vec3d=v()}uf.prototype.render=function(t,e,n,r,i,a){var o=e.fill,s=e.fillRule,l=e.opacity,c=e.fillOpacity,u=e.stroke,h=e.strokeOpacity,f=e.lineWidth,d=e.lineCap,p=e.lineJoin,g=e.shadowType,y=e.shadowColor,m=e.shadowBlur,v=e.filter,e=e.miterLimit,b=!A(o)&&!o.isNone,x=!A(u)&&!u.isNone&&0<f,w=0===o.alpha,v=!(!v||!v.length),y=!A(y)&&0<m,m=n.nodeName,g="inner"===g,m=x&&y&&(m===O.PATH||m===O.LINE||m===O.POLYLINE||w||g);b&&(t.globalAlpha=l*c,m||hf(n,t,y),this.fill(t,n,o,s,r,i,a),m||this.clearShadowAndFilter(t,v,y)),x&&(t.globalAlpha=l*h,t.lineWidth=f,A(e)||(t.miterLimit=e),A(d)||(t.lineCap=d),A(p)||(t.lineJoin=p),m&&(g&&(t.globalCompositeOperation="source-atop"),hf(n,t,!0),g)&&(this.stroke(t,n,u,r,i,a),t.globalCompositeOperation="source-over",this.clearShadowAndFilter(t,v,!0)),this.stroke(t,n,u,r,i,a))},uf.prototype.clearShadowAndFilter=function(t,e,n){n&&(t.shadowColor="transparent",t.shadowBlur=0),e&&(n=t.filter,!A(n))&&-1<n.indexOf("drop-shadow")&&(t.filter=n.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")},uf.prototype.fill=function(e,n,t,r,i,a,o){var s=this;Array.isArray(t)?t.forEach(function(t){e.fillStyle=s.getColor(t,n,e),r?e.fill(r):e.fill()}):(ga(t)&&(e.fillStyle=this.getPattern(t,n,e,i,a,o)),r?e.fill(r):e.fill())},uf.prototype.stroke=function(e,n,t,r,i,a){var o=this;Array.isArray(t)?t.forEach(function(t){e.strokeStyle=o.getColor(t,n,e),e.stroke()}):(ga(t)&&(e.strokeStyle=this.getPattern(t,n,e,r,i,a)),e.stroke())},uf.prototype.getPattern=function(t,e,n,r,i,a){var o,s,l,c,u,h,f;return"rect"===t.image.nodeName&&(o=(s=t.image.parsedStyle).width,s=s.height,l=r.contextService.getDPR(),c=r.config.offscreenCanvas,(u=a.offscreenCanvasCreator.getOrCreateCanvas(c)).width=o*l,u.height=s*l,h=a.offscreenCanvasCreator.getOrCreateContext(c),f=[],t.image.forEach(function(t){i.renderDisplayObject(t,h,r,f,a)}),f.forEach(function(){h.restore()})),this.imagePool.getOrCreatePatternSync(t,n,u,l,function(){e.renderable.dirty=!0,r.renderingService.dirtify()})},uf.prototype.getColor=function(t,e,n){var r;return t.type!==ri.LinearGradient&&t.type!==ri.RadialGradient||(r=(e=e.getGeometryBounds())&&2*e.halfExtents[0]||1,e=e&&2*e.halfExtents[1]||1,r=this.imagePool.getOrCreateGradient(m(m({type:t.type},t.value),{width:r,height:e}),n)),r};var cf=uf;function uf(t){this.imagePool=t}function hf(t,e,n){var r=t.parsedStyle,i=r.filter,a=r.shadowColor,o=r.shadowBlur,s=r.shadowOffsetX,r=r.shadowOffsetY;i&&i.length&&(e.filter=t.style.filter),n&&(e.shadowColor=a.toString(),e.shadowBlur=o||0,e.shadowOffsetX=s||0,e.shadowOffsetY=r||0)}df.prototype.render=function(t,e,n){var r=e.width,i=e.height,a=e.img,o=e.shadowColor,e=e.shadowBlur,a=We(a)?this.imagePool.getImageSync(a):(r=r||a.width,i=i||a.height,a);if(a){hf(n,t,!A(o)&&0<e);try{t.drawImage(a,0,0,r,i)}catch(t){}}};var ff=df;function df(t){this.imagePool=t}Mf.prototype.render=function(t,e,n){var r=e.lineWidth,i=e.textAlign,a=e.textBaseline,o=e.lineJoin,s=e.miterLimit,l=e.letterSpacing,c=e.stroke,u=e.fill,h=e.fillOpacity,f=e.strokeOpacity,d=e.opacity,p=e.metrics,g=e.dx,y=e.dy,m=e.shadowColor,e=e.shadowBlur,v=p.font,b=p.lines,x=p.height,w=p.lineHeight,M=p.lineMetrics,p=(t.font=v,t.lineWidth=r,t.textAlign="middle"===i?"center":i,a),k=(_.enableCSSParsing||"alphabetic"!==p||(p="bottom"),t.lineJoin=o,A(s)||(t.miterLimit=s),0),O=("middle"===a?k=-x/2-w/2:"bottom"===a||"alphabetic"===a||"ideographic"===a?k=-x:"top"!==a&&"hanging"!==a||(k=-w),g||0),v=(k+=y||0,1===b.length&&("bottom"===p?(p="middle",k-=.5*x):"top"===p&&(p="middle",k+=.5*x)),t.textBaseline=p,!A(m)&&0<e);hf(n,t,v);for(var E=0;E<b.length;E++){var S=r/2+O;k+=w,A(c)||c.isNone||!r||this.drawLetterSpacing(t,b[E],M[E],i,S,k,l,h,f,d,!0),A(u)||this.drawLetterSpacing(t,b[E],M[E],i,S,k,l,h,f,d)}},Mf.prototype.drawLetterSpacing=function(t,e,n,r,i,a,o,s,l,c,u){if(void 0===u&&(u=!1),0===o)u?this.strokeText(t,e,i,a,l):this.fillText(t,e,i,a,s,c);else{for(var h=t.textAlign,f=(t.textAlign="left",i),d=("center"===r||"middle"===r?f=i-n.width/2:"right"!==r&&"end"!==r||(f=i-n.width),Array.from(e)),p=t.measureText(e).width,g=0;g<d.length;++g){var y=d[g];u?this.strokeText(t,y,f,a,l):this.fillText(t,y,f,a,s,c),f+=p-(y=t.measureText(e.substring(g+1)).width)+o,p=y}t.textAlign=h}},Mf.prototype.fillText=function(t,e,n,r,i,a){var o,s=!A(i)&&1!==i;s&&(o=t.globalAlpha,t.globalAlpha=i*a),t.fillText(e,n,r),s&&(t.globalAlpha=o)},Mf.prototype.strokeText=function(t,e,n,r,i){var a,o=!A(i)&&1!==i;o&&(a=t.globalAlpha,t.globalAlpha=i),t.strokeText(e,n,r),o&&(t.globalAlpha=a)};var pf,gf,yf,mf,vf,bf,xf,wf=Mf;function Mf(){}function kf(){return null!==pf&&pf.apply(this,arguments)||this}function Of(){return null!==gf&&gf.apply(this,arguments)||this}function Ef(){return null!==yf&&yf.apply(this,arguments)||this}function Sf(){return null!==mf&&mf.apply(this,arguments)||this}function Af(){return null!==vf&&vf.apply(this,arguments)||this}function _f(){return null!==bf&&bf.apply(this,arguments)||this}function Tf(){return null!==xf&&xf.apply(this,arguments)||this}t(kf,pf=cf),t(Of,gf=cf),t(Ef,yf=cf),t(Sf,mf=cf),t(Af,vf=cf),t(_f,bf=cf),t(Tf,xf=cf);t(Lf,Pf=n),Lf.prototype.init=function(){var t,e=m({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),n=this.context.imagePool,r=new cf(n),n=((t={})[O.CIRCLE]=r,t[O.ELLIPSE]=r,t[O.RECT]=r,t[O.IMAGE]=new ff(n),t[O.TEXT]=new wf,t[O.LINE]=r,t[O.POLYLINE]=r,t[O.POLYGON]=r,t[O.PATH]=r,t[O.GROUP]=void 0,t[O.HTML]=void 0,t[O.MESH]=void 0,t);this.context.defaultStyleRendererFactory=n,this.context.styleRendererFactory=n,this.addRenderingPlugin(new sf(e))},Lf.prototype.destroy=function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory};var Pf,Cf=Lf;function Lf(t){void 0===t&&(t={});var e=Pf.call(this)||this;return e.options=t,e.name="canvas-renderer",e}jf.prototype.apply=function(t,r){function i(t){e.hooks.pointerWheel.call(t)}function a(t){e.hooks.click.call(t)}var o=this,e=t.renderingService,n=t.renderingContext,s=t.config,l=(this.context=t,n.root.ownerDocument.defaultView),c=function(t){e.hooks.pointerMove.call(t)},u=function(t){e.hooks.pointerUp.call(t)},h=function(t){e.hooks.pointerDown.call(t)},f=function(t){e.hooks.pointerOver.call(t)},d=function(t){e.hooks.pointerOut.call(t)},p=function(t){e.hooks.pointerCancel.call(t)};e.hooks.init.tap(jf.tag,function(){var t,e,n=o.context.contextService.getDomElement();r.globalThis.navigator.msPointerEnabled?(n.style.msContentZooming="none",n.style.msTouchAction="none"):l.supportsPointerEvents&&(n.style.touchAction="none"),l.supportsPointerEvents?(t=n,r.globalThis.document.addEventListener("pointermove",c,!0),t.addEventListener("pointerdown",h,!0),t.addEventListener("pointerleave",d,!0),t.addEventListener("pointerover",f,!0),r.globalThis.addEventListener("pointerup",u,!0),r.globalThis.addEventListener("pointercancel",p,!0)):(t=n,r.globalThis.document.addEventListener("mousemove",c,!0),t.addEventListener("mousedown",h,!0),t.addEventListener("mouseout",d,!0),t.addEventListener("mouseover",f,!0),r.globalThis.addEventListener("mouseup",u,!0)),l.supportsTouchEvents&&((e=n).addEventListener("touchstart",h,!0),e.addEventListener("touchend",u,!0),e.addEventListener("touchmove",c,!0),e.addEventListener("touchcancel",p,!0)),s.useNativeClickEvent&&n.addEventListener("click",a,!0),n.addEventListener("wheel",i,{passive:!0,capture:!0})}),e.hooks.destroy.tap(jf.tag,function(){var t,e,n=o.context.contextService.getDomElement();r.globalThis.navigator.msPointerEnabled?(n.style.msContentZooming="",n.style.msTouchAction=""):l.supportsPointerEvents&&(n.style.touchAction=""),l.supportsPointerEvents?(t=n,r.globalThis.document.removeEventListener("pointermove",c,!0),t.removeEventListener("pointerdown",h,!0),t.removeEventListener("pointerleave",d,!0),t.removeEventListener("pointerover",f,!0),r.globalThis.removeEventListener("pointerup",u,!0)):(t=n,r.globalThis.document.removeEventListener("mousemove",c,!0),t.removeEventListener("mousedown",h,!0),t.removeEventListener("mouseout",d,!0),t.removeEventListener("mouseover",f,!0),r.globalThis.removeEventListener("mouseup",u,!0)),l.supportsTouchEvents&&((e=n).removeEventListener("touchstart",h,!0),e.removeEventListener("touchend",u,!0),e.removeEventListener("touchmove",c,!0),e.removeEventListener("touchcancel",p,!0)),s.useNativeClickEvent&&n.removeEventListener("click",a,!0),n.removeEventListener("wheel",i,!0)})},jf.tag="DOMInteraction";var Nf=jf;function jf(){}t(Bf,Rf=n),Bf.prototype.init=function(){this.addRenderingPlugin(new Nf)},Bf.prototype.destroy=function(){this.removeAllRenderingPlugins()};var Rf,If=Bf;function Bf(){var t=null!==Rf&&Rf.apply(this,arguments)||this;return t.name="dom-interaction",t}Ff.prototype.joinTransformMatrix=function(t){return"matrix(".concat([t[0],t[1],t[4],t[5],t[12],t[13]].join(","),")")},Ff.prototype.apply=function(t){function i(t,e){e.style.transform=s.joinTransformMatrix(t.getWorldTransform())}function e(t){var e,n,r=t.target;r.nodeName===O.HTML&&(s.$camera||(s.$camera=s.createCamera(l)),e=s.getOrCreateEl(r),s.$camera.appendChild(e),n=r.ownerDocument.documentElement.attributes,Object.keys(n).forEach(function(t){e.style[t]=n[t]}),Object.keys(r.attributes).forEach(function(t){s.updateAttribute(t,r)}),i(r,e),_.nativeHTMLMap.set(e,r))}function n(t){(t=t.target).nodeName===O.HTML&&s.$camera&&(t=s.getOrCreateEl(t))&&(t.remove(),_.nativeHTMLMap.delete(t))}function r(t){var e=t.target;e.nodeName===O.HTML&&(t=t.attrName,s.updateAttribute(t,e))}function a(t){var e;(t=t.target).nodeName===O.HTML&&(e=s.getOrCreateEl(t),i(t,e))}function o(){var t,e;s.$camera&&(t=(e=s.context.config).width,e=e.height,s.$camera.style.width="".concat(t||0,"px"),s.$camera.style.height="".concat(e||0,"px"))}var s=this,l=t.camera,c=t.renderingContext,u=t.renderingService,h=(this.context=t,c.root.ownerDocument.defaultView);u.hooks.init.tap(Ff.tag,function(){h.addEventListener(Zc.RESIZE,o),h.addEventListener(b.MOUNTED,e),h.addEventListener(b.UNMOUNTED,n),h.addEventListener(b.ATTR_MODIFIED,r),h.addEventListener(b.BOUNDS_CHANGED,a)}),u.hooks.endFrame.tap(Ff.tag,function(){s.$camera&&c.renderReasons.has(wl.CAMERA_CHANGED)&&(s.$camera.style.transform=s.joinTransformMatrix(l.getOrthoMatrix()))}),u.hooks.destroy.tap(Ff.tag,function(){s.$camera&&s.$camera.remove(),h.removeEventListener(Zc.RESIZE,o),h.removeEventListener(b.MOUNTED,e),h.removeEventListener(b.UNMOUNTED,n),h.removeEventListener(b.ATTR_MODIFIED,r),h.removeEventListener(b.BOUNDS_CHANGED,a)})},Ff.prototype.getId=function(t){return t.id||"g-html-"+t.entity},Ff.prototype.createCamera=function(t){var e,n,r=(a=this.context.config).document,i=a.width,a=a.height,o=this.context.contextService.getDomElement(),s=o.parentNode;return s?((n=s.querySelector("#"+(e="g-canvas-camera")))||((n=r=(r||document).createElement("div")).id=e,r.style.position="absolute",r.style.left="".concat(o.offsetLeft||0,"px"),r.style.top="".concat(o.offsetTop||0,"px"),r.style.transformOrigin="left top",r.style.transform=this.joinTransformMatrix(t.getOrthoMatrix()),r.style.overflow="hidden",r.style.pointerEvents="none",r.style.width="".concat(i||0,"px"),r.style.height="".concat(a||0,"px"),s.appendChild(r)),n):null},Ff.prototype.getOrCreateEl=function(t){var e=this.context.config.document,n=this.getId(t),r=this.$camera.querySelector("#"+n);return r||(r=(e||document).createElement("div"),(t.parsedStyle.$el=r).id=n,t.name&&r.setAttribute("name",t.name),t.className&&(r.className=t.className),r.style.position="absolute",r.style.left="0px",r.style.top="0px",r.style["will-change"]="transform",r.style.transform=this.joinTransformMatrix(t.getWorldTransform())),r},Ff.prototype.updateAttribute=function(t,e){var n=this.getOrCreateEl(e);switch(t){case"innerHTML":var r=e.parsedStyle.innerHTML;We(r)?n.innerHTML=r:(n.innerHTML="",n.appendChild(r));break;case"transformOrigin":r=e.parsedStyle.transformOrigin;n.style["transform-origin"]="".concat(r[0].value," ").concat(r[1].value);break;case"width":_.enableCSSParsing?(i=e.computedStyleMap().get("width"),n.style.width=i.toString()):(i=e.parsedStyle.width,n.style.width=He(i)?"".concat(i,"px"):i.toString());break;case"height":_.enableCSSParsing?(a=e.computedStyleMap().get("height"),n.style.height=a.toString()):(a=e.parsedStyle.height,n.style.height=He(a)?"".concat(a,"px"):a.toString());break;case"zIndex":r=e.parsedStyle.zIndex;n.style["z-index"]="".concat(r);break;case"visibility":var i=e.parsedStyle.visibility;n.style.visibility=i;break;case"pointerEvents":var a=e.parsedStyle.pointerEvents;n.style.pointerEvents=a;break;case"opacity":r=e.parsedStyle.opacity;n.style.opacity="".concat(r);break;case"fill":i=e.parsedStyle.fill,a="";ya(i)?a=i.isNone?"transparent":e.getAttribute("fill"):Array.isArray(i)?a=e.getAttribute("fill"):ga(i),n.style.background=a;break;case"stroke":r=e.parsedStyle.stroke,i="";ya(r)?i=r.isNone?"transparent":e.getAttribute("stroke"):Array.isArray(r)?i=e.getAttribute("stroke"):ga(r),n.style["border-color"]=i,n.style["border-style"]="solid";break;case"lineWidth":a=e.parsedStyle.lineWidth;n.style["border-width"]="".concat(a||0,"px");break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":r=e.style.filter;n.style.filter=r}},Ff.tag="HTMLRendering";var Df=Ff;function Ff(){}t(Gf,zf=n),Gf.prototype.init=function(){this.addRenderingPlugin(new Df)},Gf.prototype.destroy=function(){this.removeAllRenderingPlugins()};var zf,Wf=Gf;function Gf(){var t=null!==zf&&zf.apply(this,arguments)||this;return t.name="html-renderer",t}Vf.prototype.getImageSync=function(t,e){return this.imageCache[t]?e&&e():this.getOrCreateImage(t).then(function(){e&&e()}),this.imageCache[t]},Vf.prototype.getOrCreateImage=function(r){var i,a=this;return this.imageCache[r]?Promise.resolve(this.imageCache[r]):(i=this.canvasConfig.createImage,new Promise(function(t,e){var n;i?n=i(r):cs&&(n=new window.Image),n&&(n.onload=function(){a.imageCache[r]=n,t(n)},n.onerror=function(t){e(t)},n.crossOrigin="Anonymous",n.src=r)}))},Vf.prototype.getOrCreatePatternSync=function(t,e,n,r,i){var a,o,s,l,c=this.generatePatternKey(t);return c&&this.patternCache[c]?this.patternCache[c]:(a=t.image,o=t.repetition,t=t.transform,l=!1,We(a)?s=this.getImageSync(a,i):n?(s=n,l=!0):s=a,(i=s&&e.createPattern(s,o))&&(n=void 0,n=t?Do(io(t),new Jl({})):et(Z()),l&&ht(n,n,[1/r,1/r,1]),i.setTransform({a:n[0],b:n[1],c:n[4],d:n[5],e:n[12],f:n[13]})),c&&i&&(this.patternCache[c]=i),i)},Vf.prototype.getOrCreateGradient=function(t,e){var n,r,i,a,o,s=this.generateGradientKey(t),l=t.type,c=t.steps,u=t.width,h=t.height,f=t.angle,d=t.cx,p=t.cy,t=t.size;return this.gradientCache[s]||(n=null,l===ri.LinearGradient?(r=u,i=h,f=vr((f=f).value),a=0+r/2,o=0+i/2,r=Math.abs(r*Math.cos(f))+Math.abs(i*Math.sin(f)),i={x1:a-Math.cos(f)*r/2,y1:o-Math.sin(f)*r/2,x2:a+Math.cos(f)*r/2,y2:o+Math.sin(f)*r/2},n=e.createLinearGradient(i.x1,i.y1,i.x2,i.y2)):l===ri.RadialGradient&&(a=u,o=h,f=p,r=t,l=(i=d).value,u=f.value,i.unit===g.kPercentage&&(l=i.value/100*a),f.unit===g.kPercentage&&(u=f.value/100*o),i=Math.max(be([0,0],[l,u]),be([0,o],[l,u]),be([a,o],[l,u]),be([a,0],[l,u])),r&&(r instanceof xi?i=r.value:r instanceof ui&&("closest-side"===r.value?i=Math.min(l,a-l,u,o-u):"farthest-side"===r.value?i=Math.max(l,a-l,u,o-u):"closest-corner"===r.value&&(i=Math.min(be([0,0],[l,u]),be([0,o],[l,u]),be([a,o],[l,u]),be([a,0],[l,u]))))),n=e.createRadialGradient(p=(h={x:l,y:u,r:i}).x,t=h.y,0,p,t,h.r)),n&&(c.forEach(function(t){var e=t.offset,t=t.color;e.unit===g.kPercentage&&null!=n&&n.addColorStop(e.value/100,t.toString())}),this.gradientCache[s]=n)),this.gradientCache[s]},Vf.prototype.generateGradientKey=function(t){var e=t.type,n=t.width,r=t.height,i=t.steps,a=t.angle,o=t.cx,s=t.cy,t=t.size;return"gradient-".concat(e,"-").concat((null==a?void 0:a.toString())||0,"-").concat((null==o?void 0:o.toString())||0,"-").concat((null==s?void 0:s.toString())||0,"-").concat((null==t?void 0:t.toString())||0,"-").concat(n,"-").concat(r,"-").concat(i.map(function(t){var e=t.offset,t=t.color;return"".concat(e).concat(t)}).join("-"))},Vf.prototype.generatePatternKey=function(t){var e=t.image,t=t.repetition;return We(e)?"pattern-".concat(e,"-").concat(t):"rect"===e.nodeName?"pattern-".concat(e.entity,"-").concat(t):void 0};var Hf=Vf;function Vf(t){this.canvasConfig=t,this.imageCache={},this.gradientCache={},this.patternCache={}}qf.prototype.apply=function(t){function e(t){var e=t.target,t=e.nodeName,n=e.attributes;t===O.IMAGE&&(t=n.img,We(t))&&a.getImageSync(t,function(){e.renderable.dirty=!0,r.dirtify()})}function n(t){var e=t.target,n=t.attrName,t=t.newValue;e.nodeName===O.IMAGE&&"img"===n&&We(t)&&a.getOrCreateImage(t).then(function(){e.renderable.dirty=!0,r.dirtify()})}var r=t.renderingService,i=t.renderingContext,a=t.imagePool,o=i.root.ownerDocument.defaultView;r.hooks.init.tap(qf.tag,function(){o.addEventListener(b.MOUNTED,e),o.addEventListener(b.ATTR_MODIFIED,n)}),r.hooks.destroy.tap(qf.tag,function(){o.removeEventListener(b.MOUNTED,e),o.removeEventListener(b.ATTR_MODIFIED,n)})},qf.tag="LoadImage";var Yf=qf;function qf(){}t(Xf,$f=n),Xf.prototype.init=function(){this.context.imagePool=new Hf(this.context.config),this.addRenderingPlugin(new Yf)},Xf.prototype.destroy=function(){this.removeAllRenderingPlugins()};var $f,Uf=Xf;function Xf(){var t=null!==$f&&$f.apply(this,arguments)||this;return t.name="image-loader",t}Zf.prototype.init=function(){var t=this.canvasConfig,e=t.container,t=t.canvas;t?(this.$canvas=t,e&&t.parentElement!==e&&e.appendChild(t),this.$container=t.parentElement,this.canvasConfig.container=this.$container):e&&(this.$container=We(e)?document.getElementById(e):e,this.$container)&&(t=document.createElement("canvas"),this.$container.appendChild(t),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=t),this.context=this.$canvas.getContext("2d"),this.resize(this.canvasConfig.width,this.canvasConfig.height)},Zf.prototype.getContext=function(){return this.context},Zf.prototype.getDomElement=function(){return this.$canvas},Zf.prototype.getDPR=function(){return this.dpr},Zf.prototype.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},Zf.prototype.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},Zf.prototype.resize=function(t,e){var n=1<=(n=this.canvasConfig.devicePixelRatio||cs&&window.devicePixelRatio||1)?Math.ceil(n):1;this.dpr=n,this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*e,n=this.$canvas,t=t,e=e,cs)&&n.style&&(n.style.width=t+"px",n.style.height=e+"px"),this.renderingContext.renderReasons.add(wl.CAMERA_CHANGED)},Zf.prototype.applyCursorStyle=function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)},Zf.prototype.toDataURL=function(r){return void 0===r&&(r={}),X(this,void 0,void 0,function(){var e,n;return R(this,function(t){return e=r.type,n=r.encoderOptions,[2,this.context.canvas.toDataURL(e,n)]})})};var Kf=Zf;function Zf(t){this.renderingContext=t.renderingContext,this.canvasConfig=t.config}t(td,Qf=n),td.prototype.init=function(){this.context.ContextService=Kf},td.prototype.destroy=function(){delete this.context.ContextService};var Qf,Jf=td;function td(){var t=null!==Qf&&Qf.apply(this,arguments)||this;return t.name="canvas-context-register",t}t(rd,ed=fn);var ed,nd=rd;function rd(t){t=ed.call(this,t)||this;return t.registerPlugin(new Jf),t.registerPlugin(new Uf),t.registerPlugin(new Lh),t.registerPlugin(new Cf),t.registerPlugin(new If),t.registerPlugin(new af),t.registerPlugin(new Wf),t}ad.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 X(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=be([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(ad.tag,function(){i.addEventListener("pointerdown",e)}),r.hooks.destroy.tap(ad.tag,function(){i.removeEventListener("pointerdown",e)})},ad.tag="Dragndrop";var id=ad;function ad(t){this.dragndropPluginOptions=t}t(ld,od=n),ld.prototype.init=function(){this.addRenderingPlugin(new id(m({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))},ld.prototype.destroy=function(){this.removeAllRenderingPlugins()},ld.prototype.setOptions=function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)};var od,sd=ld;function ld(t){void 0===t&&(t={});var e=od.call(this)||this;return e.options=t,e.name="dragndrop",e}ud.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},ud.prototype.once=function(t,e){return this.on(t,e,!0)},ud.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)},ud.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},ud.prototype.getEvents=function(){return this._events};var cd=ud;function ud(){this._events={}}const hd=()=>[["cartesian"]],fd=(hd.props={},(t={})=>{var e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)}),dd=t=>{var{startAngle:t,endAngle:e,innerRadius:n,outerRadius:r}=fd(t);return[["translate",0,.5],["reflect.y"],["translate",0,-.5],["polar",t,e,n,r]]},pd=(dd.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]]),gd=(pd.props={},()=>[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]]),yd=(gd.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[...gd(),...dd({startAngle:e,endAngle:t,innerRadius:n,outerRadius:r})]}),md=(yd.props={},(t={})=>{var e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)}),vd=t=>{var{startAngle:t,endAngle:e,innerRadius:n,outerRadius:r}=md(t);return[["transpose"],["translate",.5,.5],["reflect"],["translate",-.5,-.5],...dd({startAngle:t,endAngle:e,innerRadius:n,outerRadius:r})]},bd=(vd.props={},()=>[["parallel",0,1,0,1]]),xd=(bd.props={},({focusX:t=0,focusY:e=0,distortionX:n=2,distortionY:r=2,visual:i=!1})=>[["fisheye",t,e,n,r,i]]),wd=(xd.props={transform:!0},t=>{var{startAngle:t=-Math.PI/2,endAngle:e=3*Math.PI/2,innerRadius:n=0,outerRadius:r=1}=t;return[...bd(),...dd({startAngle:t,endAngle:e,innerRadius:n,outerRadius:r})]}),Md=(wd.props={},({value:e})=>t=>t.map(()=>e)),kd=(Md.props={},({value:e})=>t=>t.map(e)),Od=(kd.props={},({value:e})=>t=>t.map(t=>t[e])),Ed=(Od.props={},({value:t})=>()=>t);function Sd(t,e){return t.parent===e.parent?1:2}function Ad(t,e){return t+e.x}function _d(t,e){return Math.max(t,e.y)}function Td(){var s=Sd,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(Ad,0)/e.length,t.y=1+n.reduce(_d,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 Pd(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 Cd(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=Nd)):void 0===e&&(e=Ld);for(var n,r,i,a,o,t=new Id(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 Id(i[a])),r.parent=n,r.depth=n.depth+1;return t.eachBefore(Rd)}function Ld(t){return t.children}function Nd(t){return Array.isArray(t)?t[1]:null}function jd(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function Rd(t){for(var e=0;t.height=e,(t=t.parent)&&t.height<++e;);}function Id(t){this.data=t,this.depth=this.height=0,this.parent=null}function Bd(t){return null==t?null:Dd(t)}function Dd(t){if("function"!=typeof t)throw new Error;return t}function Fd(){return 0}function zd(t){return function(){return t}}Ed.props={},Id.prototype=Cd.prototype={constructor:Id,count:function(){return this.eachAfter(Pd)},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 Cd(this).eachBefore(jd)},[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 Wd=4294967296;function Gd(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&&Vd(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 qd(t[0],t[1]);case 3:return $d(t[0],t[1],t[2])}}(o=function(t,e){var n,r;if(Yd(e,t))return[e];for(n=0;n<t.length;++n)if(Hd(e,t[n])&&Yd(qd(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(Hd(qd(t[n],t[r]),e)&&Hd(qd(t[n],e),t[r])&&Hd(qd(t[r],e),t[n])&&Yd($d(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}(o,n)),i=0);return r}function Hd(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 Vd(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 Yd(t,e){for(var n=0;n<e.length;++n)if(!Vd(t,e[n]))return;return 1}function qd(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 $d(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 Ud(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 Xd(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 Kd(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 Zd(t){this._=t,this.next=null,this.previous=null}function Qd(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;Ud(r,d,i=t[2]),d=new Zd(d),r=new Zd(r),i=new Zd(i),((d.next=i.previous=r).next=d.previous=i).next=r.previous=d;t:for(l=3;l<a;++l){Ud(d._,r._,i=t[l]),i=new Zd(i),c=r.next,u=d.previous,h=r._.r,f=d._.r;do{if(h<=f){if(Xd(c._,i._)){r=c,(d.next=r).previous=d,--l;continue t}h+=c._.r,c=c.next}else{if(Xd(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=Kd(d);(i=i.next)!==r;)(s=Kd(i))<o&&(d=i,o=s);r=d.next}for(d=[r._],i=r;(i=i.next)!==r;)d.push(i._);for(i=Gd(d,e),l=0;l<a;++l)(d=t[l]).x-=i.x,d.y-=i.y;return i.r}function Jd(t){return Math.sqrt(t.value)}function tp(){var n=null,r=1,i=1,a=Fd;function e(t){var e=function(){let t=1;return()=>(t=(1664525*t+1013904223)%Wd)/Wd}();return t.x=r/2,t.y=i/2,n?t.eachBefore(ep(n)).eachAfter(np(a,.5,e)).eachBefore(rp(1)):t.eachBefore(ep(Jd)).eachAfter(np(Fd,1,e)).eachAfter(np(a,t.r/Math.min(r,i),e)).eachBefore(rp(Math.min(r,i)/(2*t.r))),t}return e.radius=function(t){return arguments.length?(n=Bd(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:zd(+t),e):a},e}function ep(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function np(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=Qd(e,l),a)for(n=0;n<i;++n)e[n].r-=a;t.r=r+a}}}function rp(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 ip(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 ap(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 op={depth:-1},sp={},lp={};function cp(t){return t.id}function up(t){return t.parentId}function hp(){var y,m=cp,v=up;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=dp(t,e-1)&&!dp(t,e-2)?t.slice(0,-1):t)[0]?t:"/"+t}),g=p.map(fp);var d=new Set(p).add("");for(const r of g)d.has(r)||(d.add(r),p.push(r),g.push(fp(r)),c.push(lp));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 Id(t),null!=(s=u(t,r,n))&&(s+="")&&(l=o.id=s,f.set(l,f.has(l)?sp: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===sp)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===lp&&1===i.children.length;)i=i.children[0],--e;for(let t=c.length-1;0<=t&&(o=c[t]).data===lp;--t)o.data=null}if(i.parent=op,i.eachBefore(function(t){t.depth=t.parent.depth+1,--e}).eachBefore(Rd),i.parent=null,0<e)throw new Error("cycle");return i}return e.id=function(t){return arguments.length?(m=Bd(t),e):m},e.parentId=function(t){return arguments.length?(v=Bd(t),e):v},e.path=function(t){return arguments.length?(y=Bd(t),e):y},e}function fp(t){let e=t.length;if(e<2)return"";for(;1<--e&&!dp(t,e););return t.slice(0,e)}function dp(e,n){if("/"===e[n]){let t=0;for(;0<n&&"\\"===e[--n];)++t;if(0==(1&t))return 1}}function pp(t,e){return t.parent===e.parent?1:2}function gp(t){var e=t.children;return e?e[0]:t.t}function yp(t){var e=t.children;return e?e[e.length-1]:t.t}function mp(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 vp(){var f=pp,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 mp(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 mp(r[i],i)),n.parent=e;return(t.parent=new mp(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=yp(o),i=gp(i),o&&i;)s=gp(s),(a=yp(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&&!yp(a)&&(a.t=o,a.m+=u-c),i&&!gp(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 bp(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}mp.prototype=Object.create(Id.prototype);ii=(1+Math.sqrt(5))/2;function xp(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?ap(o,n,r,i,M?r+=c*u/M:a):bp(o,n,r,M?n+=l*u/M:i,a),M-=u,b=x}return m}var wp=function e(a){function t(t,e,n,r,i){xp(a,t,e,n,r,i)}return t.ratio=function(t){return e(1<(t=+t)?t:1)},t}(ii);function Mp(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 kp(t,e,n,r,i){(1&t.depth?bp:ap)(t,e,n,r,i)}var Op=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?ap(o,e,n,r,f?n+=(i-n)*o.value/f:i):bp(o,e,n,f?e+=(r-e)*o.value/f:r,i),f-=o.value}else t._squarify=a=xp(d,t,e,n,r,i),a.ratio=d}return t.ratio=function(t){return e(1<(t=+t)?t:1)},t}(ii);function Ep(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 Sp(t={}){return[...Ep(t),{name:"title",scale:"identity"}]}function Ap(){return[{type:"maybeTitle",channel:"color"},{type:"maybeTooltip",channel:["x","y"]}]}function _p(){return[{type:"maybeTitle",channel:"x"},{type:"maybeTooltip",channel:["y"]}]}function Tp(t={}){return Ep(t)}function Pp(){return[{type:"maybeKey"}]}function Cp(t,e){return t.getBandWidth(t.invert(e))}function Lp(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?Cp(l,a[e]):0;var r=p?Cp(c,o[e]):0,e=g&&s?(Cp(u,s[e])/2+ +s[e])*n:0,[t,i]=t;return[t+h*n+e,i+f*r]}:t=>t}function Np(t){return parseFloat(t)/100}function jp(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?Np(e)*o:+e,"string"==typeof t?Np(t)*s:+t]]})]}function Rp(e){return"function"==typeof e?e:t=>t[e]}function Ip(t,e){return Array.from(t,Rp(e))}function Bp(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=Ip(t,e),o=Ip(t,n),s=Ip(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 Dp(t,e){return t.getBandWidth(t.invert(e))}const Fp=()=>(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=Dp(c,a[t]),n=e*(u?Dp(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))})]};Fp.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,channels:[...Sp({shapes:["rect","hollow","funnel","pyramid"]}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[...Pp(),{type:"maybeZeroY1"},{type:"maybeZeroX"}],postInference:[..._p()],interaction:{shareTooltip:!0}};const zp=()=>(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 Wp(t,e){return null==t||null==e?NaN:t<e?-1:e<t?1:e<=t?0:NaN}function Gp(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=Wp,o=(t,e)=>Wp(n(t),e),(t,e)=>n(t)-e):(a=n===Wp||n===function(t,e){return null==t||null==e?NaN:e<t?-1:t<e?1:t<=e?0:NaN}?n:Hp,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 Hp(){return 0}function Vp(t){return null===t?NaN:+t}zp.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,channels:[...Sp({shapes:["rect","hollow"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Pp(),{type:"maybeZeroY1"}],postInference:[..._p()],interaction:{shareTooltip:!0}};s=Gp(Wp);const Yp=s.right,qp=s.left,$p=Gp(Vp).center;function Up(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 Xp(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 Kp(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 Zp{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 Qp 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(Jp(this,t))}has(t){return super.has(Jp(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 Jp({_intern:t,_key:e},n){e=e(n);return t.has(e)?t.get(e):n}function t0(t){return t}function e0(t,...e){return a0(t,t0,t0,e)}function n0(t,...e){return a0(t,Array.from,t0,e)}function r0(t,e,...n){return a0(t,t0,e,n)}function i0(t,e,...n){return a0(t,Array.from,e,n)}function a0(t,u,h,f){return function t(e,n){if(n>=f.length)return h(e);var r=new Qp,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 o0(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=l0(r[t],r[e]);if(n)return n}})):(n=e.map(n),t.sort((t,e)=>l0(n[t],n[e]))),r=e,Array.from(t,t=>r[t])):e.sort(s0(n))}function s0(r=Wp){if(r===Wp)return l0;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 l0(t,e){return(null==t||!(t<=t))-(null==e||!(e<=e))||(t<e?-1:e<t?1:0)}var c0=Array.prototype.slice;function u0(t){return()=>t}const h0=Math.sqrt(50),f0=Math.sqrt(10),d0=Math.sqrt(2);function p0(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>=h0?10:r>=f0?5:r>=d0?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?p0(t,e,2*n):[a,o,s]}function g0(t,e,n){return p0(t=+t,e=+e,n=+n)[2]}function y0(t){return Math.max(1,Math.ceil(Math.log(Up(t))/Math.LN2)+1)}function m0(){var m=t0,v=Kp,b=y0;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===Kp&&([s,l]=function(t,e,n){let r;for(;;){var i=g0(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?p0(e,t,n):p0(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=g0(s,l,u)),c[c.length-1]>=l)if(l<=o&&v===Kp){const n=g0(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[Yp(c,e,0,h)].push(t[a]);return y}return e.value=function(t){return arguments.length?(m="function"==typeof t?t:u0(t),e):m},e.domain=function(t){return arguments.length?(v="function"==typeof t?t:u0([t[0],t[1]]),e):v},e.thresholds=function(t){return arguments.length?(b="function"==typeof t?t:u0(Array.isArray(t)?c0.call(t):t),e):b},e}function v0(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 b0(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 x0(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 w0(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 M0(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?l0:s0(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),M0(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(k0(n,i,r),0<o(n[a],h)&&k0(n,i,a);t<e;){for(k0(n,t,e),++t,--e;o(n[t],h)<0;)++t;for(;0<o(n[e],h);)--e}0===o(n[i],h)?k0(n,i,e):k0(n,++e,a),e<=r&&(i=e+1),r<=e&&(a=e-1)}return n}function k0(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function O0(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?x0(t):1<=e?v0(t):(n=(n-1)*e,(r=v0(M0(t,e=Math.floor(n)).subarray(0,e+1)))+(x0(t.subarray(e+1))-r)*(n-e))}function E0(n,t,r=Vp){var i,e,a;if(!isNaN(t=+t))return i=Float64Array.from(n,(t,e)=>Vp(r(n[e],e,n))),t<=0?w0(i):1<=t?b0(i):(e=Uint32Array.from(n,(t,e)=>e),a=i.length-1,M0(e,t=Math.floor(a*t),0,a,(t,e)=>l0(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<Wp(a,t):0===Wp(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 S0(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 A0(t,e){return O0(t,.5,e)}function _0(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function T0(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 P0(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 C0(t){t=t.getOptions().transformations;return t.map(([t])=>t).filter(t=>"transpose"===t).length%2!=0}function L0(t){t=t.getOptions().transformations;return t.some(([t])=>"polar"===t)}function N0(t){t=t.getOptions().transformations;return t.some(([t])=>"reflect"===t)&&t.some(([t])=>t.startsWith("transpose"))}function j0(t){t=t.getOptions().transformations;return t.some(([t])=>"helix"===t)}function R0(t){t=t.getOptions().transformations;return t.some(([t])=>"parallel"===t)}function I0(t){t=t.getOptions().transformations;return t.some(([t])=>"fisheye"===t)}function B0(t){return j0(t)||L0(t)}function D0(t){var t=t.getOptions()["transformations"],[,,,t,e]=t.find(t=>"polar"===t[0]);return[+t,+e]}function F0(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 z0=(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(e0(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]},W0=(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})]},G0=()=>(t,e,n,r)=>{return(R0(r)?W0:z0)(t,e,n,r)};G0.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,channels:[...Sp({shapes:["line","smooth"]}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"identity"}],preInference:[...Pp(),{type:"maybeGradient"},{type:"maybeSeries"}],postInference:[..._p(),{type:"maybeTitle",channel:"color"},{type:"maybeTooltip",channel:["position"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const H0=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=Lp(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))])]};H0.props={defaultShape:"hollow",defaultLabelShape:"label",composite:!1,channels:[...Sp({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",quantitative:"sqrt"},{name:"dx",scale:"identity"},{name:"dy",scale:"identity"}],preInference:[...Pp(),{type:"maybeZeroY"},{type:"maybeZeroX"}],postInference:[{type:"maybeSize"},...Ap()]};const V0=s=>{var{cartesian:t=!1}=s;return t?jp:(t,e,n,r)=>{const{x:i,y:a}=n,o=Lp(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}};V0.props={defaultShape:"text",defaultLabelShape:"label",composite:!1,channels:[...Sp({shapes:["text","badge"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize"},{name:"rotate"}],preInference:[...Pp(),{type:"maybeTuple"},{type:"maybeVisualPosition"}],postInference:[...Ap()]};const Y0=()=>(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))})]};Y0.props={defaultShape:"cell",defaultLabelShape:"label",composite:!1,channels:[...Sp({shapes:["cell","hollow"]}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[...Pp(),{type:"maybeZeroX"},{type:"maybeZeroY"},{type:"maybeZeroPadding"}],postInference:[...Ap()]};const q0=()=>(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(e0(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]};q0.props={defaultShape:"area",defaultLabelShape:"label",composite:!1,channels:[...Sp({shapes:["area","smooth","hvh","hv","vh"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"size"},{name:"series",scale:"identity"}],preInference:[...Pp(),{type:"maybeSeries"},{type:"maybeZeroY1"},{type:"maybeZeroPadding"}],postInference:[..._p()],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const $0=c=>(t,e,n,r)=>{const{x:i,y:a,x1:o=i,y1:s=a}=n,l=Lp(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]};$0.props={defaultShape:"link",defaultLabelShape:"label",composite:!1,channels:[...Sp({shapes:["link","arc","vhv","smooth"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Pp(),{type:"maybeIdentityY"},{type:"maybeIdentityX"}],postInference:[...Ap()]};const U0=s=>{var t=s["cartesian"];return t?jp:(t,e,n,r)=>{const{x:i,y:a}=n,o=Lp(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}};U0.props={defaultShape:"image",defaultLabelShape:"label",composite:!1,channels:[...Sp({shapes:["image"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[...Pp(),{type:"maybeTuple"},{type:"maybeVisualPosition"}],postInference:[...Ap()]};const X0=()=>(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]};X0.props={defaultShape:"polygon",defaultLabelShape:"label",composite:!1,channels:[...Sp({shapes:["polygon","ribbon"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Pp()],postInference:[...Ap()]};const K0=()=>(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))})]},Z0=(K0.props={defaultShape:"box",defaultLabelShape:"label",composite:!1,channels:[...Sp({shapes:["box"]}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[...Pp(),{type:"maybeZeroX"}],postInference:[..._p()],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]});Z0.props={defaultShape:"vector",defaultLabelShape:"label",composite:!1,channels:[...Sp({shapes:["vector"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[...Pp()],postInference:[...Ap()]};const Q0=()=>(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))})]};Q0.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,channels:[...Tp({shapes:["line"]}),{name:"y",required:!0}],preInference:[...Pp(),{type:"maybeTupleY"}],postInference:[]};const J0=()=>(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))})]};J0.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,channels:[...Tp({shapes:["line"]}),{name:"x",required:!0}],preInference:[...Pp(),{type:"maybeTupleX"}],postInference:[]};const tg=(...t)=>$0(...t);function eg(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 ng(t={}){const{extendX:r=!1,extendY:s=!1}=t;return(t,e,n,i)=>{const a=eg("x",r,n,e.x),o=eg("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))})]}}tg.props={defaultShape:"connector",defaultLabelShape:"label",composite:!1,channels:[...Tp({shapes:["connector"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Pp()],postInference:[]};const rg=()=>ng();rg.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,channels:[...Tp({shapes:["range"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Pp()],postInference:[]};const ig=()=>ng({extendY:!0});ig.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,channels:[...Tp({shapes:["range"]}),{name:"x",required:!0}],preInference:[...Pp()],postInference:[]};const ag=()=>ng({extendX:!0});function og(t){return t.target.depth}function sg(t,e){return t.sourceLinks.length?t.depth:e-1}function lg(t){return function(){return t}}function cg(t,e){return hg(t.source,e.source)||t.index-e.index}function ug(t,e){return hg(t.target,e.target)||t.index-e.index}function hg(t,e){return t.y0-e.y0}function fg(t){return t.value}function dg(t){return t.index}function pg(t){return t.nodes}function gg(t){return t.links}function yg(t,e){t=t.get(e);if(t)return t;throw new Error("missing: "+e)}function mg({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 vg(){let x=0,w=0,M=1,k=1,O=24,E=8,S,A=dg,_=sg,T,P,C,L=pg,N=gg,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=>[A(t),t]));if(t.forEach((t,e)=>{t.index=e;let{source:n,target:r}=t;"object"!=typeof n&&(n=t.source=yg(g,n)),"object"!=typeof r&&(r=t.target=yg(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(P0(y.sourceLinks,fg),P0(y.targetLinks,fg)):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(v0(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(v0(t,t=>t.depth)+1,0),n=(M-x-O)/(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(_.call(null,a,e))));a.layer=i,a.x0=x+i*n,a.x1=a.x0+O,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,(k-w)/(v0(u,t=>t.length)-1)),u),h=x0(t,t=>(k-w-(t.length-1)*S)/P0(t,fg));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=(k-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(ug),n.sort(cg)}(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(hg),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(hg),o.length&&R(o,i)}}(u,d,p)}return mg(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,k,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(ug);for(const{target:{targetLinks:e}}of t)e.sort(cg)}}return e.update=function(t){return mg(t),t},e.nodeId=function(t){return arguments.length?(A="function"==typeof t?t:lg(t),e):A},e.nodeAlign=function(t){return arguments.length?(_="function"==typeof t?t:lg(t),e):_},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?(O=+t,e):O},e.nodePadding=function(t){return arguments.length?(E=S=+t,e):E},e.nodes=function(t){return arguments.length?(L="function"==typeof t?t:lg(t),e):L},e.links=function(t){return arguments.length?(N="function"==typeof t?t:lg(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],k=+t[1],e):[M-x,k-w]},e.extent=function(t){return arguments.length?(x=+t[0][0],M=+t[1][0],w=+t[0][1],k=+t[1][1],e):[[x,w],[M,k]]},e.iterations=function(t){return arguments.length?(j=+t,e):j},e}ag.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,channels:[...Tp({shapes:["range"]}),{name:"y",required:!0}],preInference:[...Pp()],postInference:[]};const bg={nodeAlign:"justify",nodeWidth:.008,nodePadding:.03,nodes:t=>t.nodes,links:t=>t.links,nodeSort:void 0,linkSort:void 0,iterations:6},xg={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?x0(t.sourceLinks,og)-1:0},justify:sg};const wg=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({},bg,h),l=vg().nodeSort(n).linkSort(c).links(l).nodes(s).nodeWidth(i).nodePadding(a).nodeDepth(o).nodeAlign("string"==(c=typeof(n=r))?xg[n]||sg:"function"==c?n:sg).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 Mg(t){return t}function kg(t){return t.reduce((n,r)=>(t,...e)=>r(n(t,...e),...e),Mg)}function Og(t){return t.replace(/( |^)[a-z]/g,t=>t.toUpperCase())}function Eg(t=""){throw new Error(t)}function Sg(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 Ag(t){return null!=t&&!Number.isNaN(t)}function st(t,e){return _g(t,e)||{}}function _g(t,n){t=Object.entries(t||{}).filter(([t])=>t.startsWith(n)).map(([t,e])=>[$e(t.replace(n,"").trim()),e]).filter(([t])=>!!t);return 0===t.length?null:Object.fromEntries(t)}function Tg(t,...n){return Object.fromEntries(Object.entries(t).filter(([e])=>n.every(t=>!e.startsWith(t))))}function Pg(t,e){return void 0===t?null:"number"==typeof t?t:(t=+t.replace("%",""),Number.isNaN(t)?null:t/100*e)}function Cg(t){return!("object"!=typeof t||t instanceof Date||null===t||Array.isArray(t))}function Lg(t){return null===t||!1===t}function Ng(t,e,n={},r=!1){return Lg(t)||Array.isArray(t)&&r?t:(r=st(t,e),ot(n,r))}function jg(t,e={}){return!Lg(t)&&!Array.isArray(t)&&Rg(t)?ot(e,t):t}function Rg(t){var e;return 0===Object.keys(t).length||({title:t,items:e}=t,void 0!==t)||void 0!==e}function Ig(t,e){return"object"==typeof t?st(t,e):t}wg.props={};const Bg={nodeId:t=>t.key,nodeWidth:.02,nodePadding:.02},Dg={type:"polygon",axis:!1,legend:!1,encode:{shape:"polygon",x:"x",y:"y"},scale:{x:{type:"identity"},y:{type:"identity"}},style:{stroke:"#000"}},Fg={type:"polygon",axis:!1,legend:!1,encode:{shape:"ribbon",x:"x",y:"y"},style:{fillOpacity:.5,stroke:void 0}},zg={textAlign:t=>t.x[0]<.5?"start":"end",position:t=>t.x[0]<.5?"right":"left",fontSize:10},Wg=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}=Bp(t,e),u=st(e,"node"),e=st(e,"link"),{key:h=t=>t.key,color:f=h}=u,{links:i,nodes:t}=wg(Object.assign(Object.assign(Object.assign({},Bg),{nodeId:Rp(h)}),i))({links:t,nodes:c});const d=st(r,"label"),{text:p=h,spacing:g=5}=d,y=at(d,["text","spacing"]),m=Rp(h);c=Ng(l,"node",{title:m,items:[{field:"value"}]},!0),h=Ng(l,"link",{title:"",items:[t=>({name:"source",value:m(t.source)}),t=>({name:"target",value:m(t.target)})]});return[ot({},Dg,{data:t,encode:Object.assign(Object.assign({},u),{color:f}),scale:n,style:st(r,"node"),labels:[Object.assign(Object.assign(Object.assign({},zg),{text:p,dx:t=>t.x[0]<.5?g:-g}),y),...a],tooltip:c,animate:Ig(s,"node"),axis:!1}),ot({},Fg,{data:i,encode:e,labels:o,style:Object.assign({fill:e.color?void 0:"#aaa",strokeWidth:0},st(r,"link")),tooltip:h,animate:Ig(s,"link")})]},Gg=(Wg.props={},t=>(t,e,n,r)=>[t,t.map(()=>[[0,0]])]);function Hg(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:Mp,treemapDice:ap,treemapSlice:bp,treemapSliceDice:kp,treemapSquarify:wp,treemapResquarify:Op};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?hp().path(p):hp():Cd)(t));function g(t){return t.x0=t.y0=0,t.x1=a,t.y1=s,t.eachBefore(y),l=[0],i&&t.eachBefore(ip),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:Rp(r)(t)).sort(e.sort):p.count(),o=wp,i=!1,s=a=1,l=[0],d=f=h=u=c=Fd,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=Dd(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:zd(+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:zd(+t),g):u},g.paddingRight=function(t){return arguments.length?(h="function"==typeof t?t:zd(+t),g):h},g.paddingBottom=function(t){return arguments.length?(f="function"==typeof t?t:zd(+t),g):f},g.paddingLeft=function(t){return arguments.length?(d="function"==typeof t?t:zd(+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)}Gg.props={defaultShape:"path",defaultLabelShape:"label",composite:!1,channels:[...Sp({shapes:["path","hollow"]}),{name:"d",scale:"identity"}],preInference:[...Pp()],postInference:[]};const Vg={fontSize:10,text:t=>t.data.name,position:"inside",fill:"#000",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>t.x1-t.x0},Yg={title:t=>t.data.name,items:[{field:"value"}]},qg=(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=Hg(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({},Vg),u),...l]},t),{tooltip:jg(c,Yg),axis:!1}))},$g=(qg.props={},{text:"",position:"inside",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>2*t.r}),Ug={title:t=>t.data.name,items:[{field:"value"}]},Xg=(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=(je(t)?hp().path(e.path):Cd)(t);return r?n.sum(t=>Rp(r)(t)).sort(e.sort):n.count(),tp().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({},$g),e),...l]},t),{tooltip:jg(c,Ug),axis:!1}))};function Kg(t,e){return x0(t,t=>e[t])}function Zg(t,e){return v0(t,t=>e[t])}function Qg(t,e){const n=2.5*Jg(t,e)-1.5*e1(t,e);return x0(t,t=>e[t]>=n?e[t]:NaN)}function Jg(t,e){return O0(t,.25,t=>e[t])}function t1(t,e){return O0(t,.5,t=>e[t])}function e1(t,e){return O0(t,.75,t=>e[t])}function n1(t,e){const n=2.5*e1(t,e)-1.5*Jg(t,e);return v0(t,t=>e[t]<=n?e[t]:NaN)}function r1(){return(t,e)=>{var n=e["encode"],{y:n,x:r}=n;const i=n["value"],a=r["value"];return[Array.from(e0(t,t=>a[+t]).values()).flatMap(t=>{const e=Qg(t,i),n=n1(t,i);return t.filter(t=>i[t]<e||i[t]>n)}),e]}}Xg.props={};const i1=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:Jg,y2:t1,y3:e1},u=Ng(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=Ng(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:Qg},c),{y4:n1})],encode:Object.assign(Object.assign({},r),l),style:s,tooltip:u,animate:Ig(o,"box")},t),{type:"point",data:n,transform:[{type:r1}],encode:r,style:Object.assign({},e),tooltip:a,animate:Ig(o,"point")}]):Object.assign({type:"box",data:n,transform:[Object.assign(Object.assign({type:"groupX",y:Kg},c),{y4:Zg})],encode:Object.assign(Object.assign({},r),l),style:i,tooltip:u},t)},a1=(i1.props={},s=>{var t=s["cartesian"];return t?jp:(t,e,n,r)=>{const{x:i,y:a}=n,o=Lp(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}});function o1(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 s1(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function l1(t){return t[0]}function c1(t){return t[1]}function u1(t,e,n){e=new h1(null==e?l1:e,null==n?c1:n,NaN,NaN,NaN,NaN);return null==t?e:e.addAll(t)}function h1(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 f1(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}a1.props={defaultShape:"shape",defaultLabelShape:"label",composite:!1,channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Pp(),{type:"maybeTuple"},{type:"maybeVisualPosition"},{type:"maybeFunctionAttribute"}]};Vs=u1.prototype=h1.prototype;function d1(t){return function(){return t}}function p1(t){return 1e-6*(t()-.5)}function g1(t){return t.index}function y1(t,e){t=t.get(e);if(t)return t;throw new Error("node not found: "+e)}function m1(c){var u,h,a,o,f,d,s=g1,n=function(t){return 1/Math.min(o[t.source.index],o[t.target.index])},r=d1(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||p1(d),o=i.y+i.vy-r.y-r.vy||p1(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=y1(r,t.source)),"object"!=typeof t.target&&(t.target=y1(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:d1(+t),l(),e):n},e.distance=function(t){return arguments.length?(r="function"==typeof t?t:d1(+t),g(),e):r},e}Vs.copy=function(){var t,e,n=new h1(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]=f1(e));else n._root=f1(r);return n},Vs.add=function(t){var e=+this._x.call(null,t),n=+this._y.call(null,t);return o1(this.cover(e,n),e,n,t)},Vs.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)o1(this,i[u],a[u],t[u]);return this},Vs.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},Vs.data=function(){var e=[];return this.visit(function(t){if(!t.length)for(;e.push(t.data),t=t.next;);}),e},Vs.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]]},Vs.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 s1(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 s1(y[3],a=(s+o)/2,c=(l+i)/2,o,i),new s1(y[2],s,c,a,i),new s1(y[1],a,l,o,c),new s1(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},Vs.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},Vs.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},Vs.root=function(){return this._root},Vs.size=function(){var e=0;return this.visit(function(t){if(!t.length)for(;++e,t=t.next;);}),e},Vs.visit=function(t){var e,n,r,i,a,o,s,l=[],c=this._root;for(c&&l.push(new s1(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 s1(e,o,s,i,a)),(e=c[2])&&l.push(new s1(e,n,s,o,a)),(e=c[1])&&l.push(new s1(e,o,r,i,s)),e=c[0])&&l.push(new s1(e,n,r,o,s));return this},Vs.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new s1(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 s1(i,a,o,c,u)),(i=h[1])&&n.push(new s1(i,c,o,s,u)),(i=h[2])&&n.push(new s1(i,a,u,c,l)),i=h[3])&&n.push(new s1(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},Vs.x=function(t){return arguments.length?(this._x=t,this):this._x},Vs.y=function(t){return arguments.length?(this._y=t,this):this._y};var v1={value:()=>{}};function b1(){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 x1(r)}function x1(t){this._=t}function w1(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=v1,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}x1.prototype=b1.prototype={constructor:x1,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]=w1(i[n],t.name,e);else if(null==e)for(n in i)i[n]=w1(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 x1(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 M1,k1,O1=0,E1=0,S1=0,A1=1e3,_1=0,T1=0,P1=0,C1="object"==typeof performance&&performance.now?performance:Date,L1="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function N1(){return T1||(L1(j1),T1=C1.now()+P1)}function j1(){T1=0}function R1(){this._call=this._time=this._next=null}function I1(t,e,n){var r=new R1;return r.restart(t,e,n),r}function B1(){T1=(_1=C1.now())+P1,O1=E1=0;try{N1(),++O1;for(var t,e=M1;e;)0<=(t=T1-e._time)&&e._call.call(void 0,t),e=e._next;--O1}finally{for(var n,r,i=M1,a=1/(O1=0);i;)i=i._call?(a>i._time&&(a=i._time),(n=i)._next):(r=i._next,i._next=null,n?n._next=r:M1=r);k1=n,F1(a),T1=0}}function D1(){var t=C1.now(),e=t-_1;A1<e&&(P1-=e,_1=t)}function F1(t){O1||(E1=E1&&clearTimeout(E1),24<t-T1?(t<1/0&&(E1=setTimeout(B1,t-C1.now()-P1)),S1=S1&&clearInterval(S1)):(S1||(_1=C1.now(),S1=setInterval(D1,A1)),O1=1,L1(B1)))}R1.prototype=I1.prototype={constructor:R1,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?N1():+n)+(null==e?0:+e),this._next||k1===this||(k1?k1._next=this:M1=this,k1=this),this._call=t,this._time=n,F1()},stop:function(){this._call&&(this._call=null,this._time=1/0,F1())}};const z1=4294967296;function W1(t){return t.x}function G1(t){return t.y}var H1=10,V1=Math.PI*(3-Math.sqrt(5));function Y1(l){var a,o=1,e=.001,s=1-Math.pow(e,1/300),c=0,u=.6,h=new Map,t=I1(i),n=b1("tick","end"),r=function(){let t=1;return()=>(t=(1664525*t+1013904223)%z1)/z1}();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=H1*Math.sqrt(.5+r),e=r*V1,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 q1={joint:!0},$1={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}},U1={type:"point",axis:!1,legend:!1,encode:{x:"x",y:"y",size:5,color:"group",shape:"point"},scale:{color:{type:"ordinal"}},style:{stroke:"#fff"}},X1={text:""};function K1(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=d1(-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:d1(+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=u1(i,W1,G1).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=p1(c))*i),0===a&&(s+=(a=p1(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=p1(c))*i),0===a&&(s+=(a=p1(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,k,O,E,S,A,_,T,n=m1(a).id(Rp(n)),P=("function"==typeof o&&I.strength(o),"function"==typeof s&&n.strength(s),Y1(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+=(O[n]-e.x)*k[n]*t}function j(){if(M){var t,e=M.length;for(k=new Array(e),O=new Array(e),t=0;t<e;++t)k[t]=isNaN(O[t]=+w(M[t],t,M))?0:+E(M[t],t,M)}}function R(){for(var t,e=_.length,n=0,r=0,i=0;i<e;++i)n+=(t=_[i]).x,r+=t.y;for(n=(n/e-S)*T,r=(r/e-A)*T,i=0;i<e;++i)(t=_[i]).x-=n,t.y-=r}e?P.force("center",(T=1,null==S&&(S=0),null==A&&(A=0),R.initialize=function(t){_=t},R.x=function(t){return arguments.length?(S=+t,R):S},R.y=function(t){return arguments.length?(A=+t,R):A},R.strength=function(t){return arguments.length?(T=+t,R):T},R)):P.force("x",(E=d1(.1),"function"!=typeof w&&(w=d1(null==w?0:+w)),N.initialize=function(t){M=t,j()},N.strength=function(t){return arguments.length?(E="function"==typeof t?t:d1(+t),j(),N):E},N.x=function(t){return arguments.length?(w="function"==typeof t?t:d1(+t),j(),N):w},N)).force("y",(x=d1(.1),"function"!=typeof y&&(y=d1(null==y?0:+y)),C.initialize=function(t){m=t,L()},C.strength=function(t){return arguments.length?(x="function"==typeof t?t:d1(+t),L(),C):x},C.y=function(t){return arguments.length?(y="function"==typeof t?t:d1(+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 Z1=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}=Bp(t,e),{nodesData:t,linksData:p}=K1({links:t,nodes:p},ot({},q1,i),e),i=Ng(l,"link",{items:[t=>({name:"source",value:Rp(u)(t.source)}),t=>({name:"target",value:Rp(u)(t.target)})]}),e=Ng(l,"node",{items:[t=>({name:"key",value:Rp(c)(t)})]},!0);return[ot({},$1,{data:p,encode:d,labels:o,style:st(r,"link"),tooltip:i,animate:Ig(s,"link")}),ot({},U1,{data:t,encode:Object.assign({},f),scale:n,style:st(r,"node"),tooltip:e,labels:[Object.assign(Object.assign({},X1),st(r,"label")),...a],animate:Ig(s,"link")})]},Q1=(Z1.props={},h=>u=>t=>{const{field:e="value",nodeSize:n,separation:r,sortBy:i,as:a=["x","y"]}=u,[o,s]=a;var t=Cd(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}}),J1=t=>Q1(Td)(t),ty=(J1.props={},t=>Q1(vp)(t)),ey=(ty.props={},{sortBy:(t,e)=>e.value-t.value}),ny={axis:!1,legend:!1,type:"point",encode:{x:"x",y:"y",size:2,shape:"point"}},ry={type:"link",encode:{x:"x",y:"y",shape:"smooth"}},iy={text:"",fontSize:10},ay=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}=ty(Object.assign(Object.assign(Object.assign({},ey),i),{field:c}))(t),t=Ng(l,"node",{title:"name",items:["value"]},!0),l=Ng(l,"link",{title:"",items:[t=>({name:"source",value:t.source.name}),t=>({name:"target",value:t.target.name})]});return[ot({},ry,{data:c,encode:st(e,"link"),scale:st(n,"link"),labels:o,style:Object.assign({stroke:"#999"},st(r,"link")),tooltip:l,animate:Ig(s,"link")}),ot({},ny,{data:i,scale:st(n,"node"),encode:st(e,"node"),labels:[Object.assign(Object.assign({},iy),st(r,"label")),...a],style:Object.assign({},st(r,"node")),tooltip:t,animate:Ig(s,"node")})]};ay.props={};var oy={},sy={},ly=34,cy=10,uy=13;function hy(t){return new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'}).join(",")+"}")}function fy(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 dy(t,e){var t=t+"",n=t.length;return n<e?new Array(e-n+1).join(0)+t:t}function py(t){var e,n=t.getUTCHours(),r=t.getUTCMinutes(),i=t.getUTCSeconds(),a=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((e=t.getUTCFullYear())<0?"-"+dy(-e,6):9999<e?"+"+dy(e,6):dy(e,4))+"-"+dy(t.getUTCMonth()+1,2)+"-"+dy(t.getUTCDate(),2)+(a?"T"+dy(n,2)+":"+dy(r,2)+":"+dy(i,2)+"."+dy(a,3)+"Z":i?"T"+dy(n,2)+":"+dy(r,2)+":"+dy(i,2)+"Z":r||n?"T"+dy(n,2)+":"+dy(r,2)+"Z":"")}function gy(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 sy;if(l)return l=!1,oy;var t,e,n=a;if(r.charCodeAt(n)===ly){for(;a++<i&&r.charCodeAt(a)!==ly||r.charCodeAt(++a)===ly;);return(t=a)>=i?s=!0:(e=r.charCodeAt(a++))===cy?l=!0:e===uy&&(l=!0,r.charCodeAt(a)===cy)&&++a,r.slice(n+1,t-1).replace(/""/g,'"')}for(;a<i;){if((e=r.charCodeAt(t=a++))===cy)l=!0;else if(e===uy)l=!0,r.charCodeAt(a)===cy&&++a;else if(e!==h)continue;return r.slice(n,t)}return s=!0,r.slice(n,i)}for(r.charCodeAt(i-1)===cy&&--i,r.charCodeAt(i-1)===uy&&--i;(e=c())!==sy;){for(var u=[];e!==oy&&e!==sy;)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?py(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=hy(n=t),function(t,e){return r(i(t),e,n)}):hy(t)})).columns=s||[],t},parseRows:n,format:function(t,e){return[(e=null==e?fy(t):e).map(o).join(r)].concat(i(t,e)).join("\n")},formatBody:function(t,e){return i(t,e=null==e?fy(t):e).join("\n")},formatRows:function(t){return t.map(a).join("\n")},formatRow:a,formatValue:o}}function yy(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;my&&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 my=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),vy=t=>{const{value:n,format:r=n.split(".").pop(),delimiter:i=",",autoType:a=!0}=t;return()=>X(void 0,void 0,void 0,function*(){var t,e=yield fetch(n);if("csv"===r)return t=yield e.text(),gy(i).parse(t,a?yy:Mg);if("json"===r)return yield e.json();throw new Error(`Unknown format: ${r}.`)})};vy.props={};const by=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}};by.props={};const xy=t=>{const{callback:e=function(t){return null!=t&&!Number.isNaN(t)}}=t;return t=>t.filter(e)},wy=(xy.props={},t=>{const e=t["callback"];return t=>Array.isArray(t)?[...t].sort(e):t});wy.props={};const My=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})};My.props={};const ky=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};ky.props={};const Oy=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))}},Ey=(Oy.props={},t=>{const e=t["value"];return()=>e}),Sy=(Ey.props={},t=>{const{callback:e=Mg}=t;return t=>e(t)}),Ay=(Sy.props={},t=>{const{callback:e=Mg}=t;return t=>Array.isArray(t)?t.map(e):t});Ay.props={};var _y=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 Ty={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 Py(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({},Ty),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=e0(r,t=>t.source),a=e0(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=P0(e,t=>t.sourceWeight)+P0(n,t=>t.targetWeight)})}if(r=e,(n="function"==typeof v?v:_y[v])&&r.sort(n),!(n=(r=e).length))throw Eg("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=e0(e,t=>t.source),l=e0(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 Cy=e=>t=>Py(e)(t),Ly=(Cy.props={},Math.PI/180),Ny=64,jy=2048;function Ry(t){return t.text}function Iy(){return"serif"}function By(){return"normal"}function Dy(t){return t.value}function Fy(){return 90*~~(2*Math.random())}function zy(){return 1}function Wy(){}function Gy(t,o,r,s){if(!o.sprite){var l=t.context,c=t.ratio;l.clearRect(0,0,(Ny<<5)/c,jy/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*Ly),f=Math.cos(o.rotate*Ly),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>=Ny<<5&&(i=0,a+=n,n=0),a+e>=jy)break;l.translate((i+(t>>1))/c,(a+(e>>1))/c),o.rotate&&l.rotate(o.rotate*Ly),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,(Ny<<5)/c,jy/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)*(Ny<<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 Hy(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function Vy(t){var e=[];let n=-1;for(;++n<t;)e[n]=0;return e}function Yy(){return document.createElement("canvas")}function qy(t){return"function"==typeof t?t:function(){return t}}const $y={archimedean:Hy,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 Uy(){let b=[256,256],r=Ry,i=Iy,p=Dy,g=By,y=Fy,m=zy,x=Hy,w=Math.random,v=Wy,M=[],k=null,O=1/0;const E=By,S=Yy,A={};return A.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=(Ny<<5)/e,t.height=jy/e,(t=t.getContext("2d")).fillStyle=t.strokeStyle="red",t.textAlign="center",{context:t,ratio:e}),l=A.board||Vy((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=A.board?[{x:0,y:0},{x:a,y:o}]:void 0;function n(){for(var t,e,n,r=Date.now();Date.now()-r<O&&++f<c;){var i=h[f];i.x=a*(w()+.5)>>1,i.y=o*(w()+.5)>>1,Gy(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:A,word:i}),u.push(i),d?A.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)}A._tags=u,A._bounds=d,f>=c&&(A.stop(),v.call(null,"end",{cloud:A,words:u,bounds:d}))}return k&&clearInterval(k),k=setInterval(n,0),n(),A},A.stop=function(){return k&&(clearInterval(k),k=null),A},A.createMask=t=>{var e=document.createElement("canvas"),[n,r]=b;if(n&&r){var i=n>>5,a=Vy((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}A.board=a,A.hasImage=!0}},A.timeInterval=function(t){O=null==t?1/0:t},A.words=function(t){M=t},A.size=function(t=[]){b=[+t[0],+t[1]]},A.text=function(t){r=qy(t)},A.font=function(t){i=qy(t)},A.fontWeight=function(t){g=qy(t)},A.rotate=function(t){y=qy(t)},A.spiral=function(t){x=$y[t]||t},A.fontSize=function(t){p=qy(t)},A.padding=function(t){m=qy(t)},A.random=function(t){w=qy(t)},A.on=function(t){v=qy(t)},A}const Xy={size:[500,500],fontSize:[14,28]};function Ky(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 Zy=f=>h=>X(void 0,void 0,void 0,function*(){var i,a,t=Object.assign({},Xy,f),e=Uy(),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 X(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=[x0(e),v0(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",Ky,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 Qy(e){return"string"==typeof e?t=>t[e]:e}Zy.props={};const Jy=t=>{const{join:e,on:n,select:i=[],as:a=i,unknown:o=NaN}=t;var[t,r]=n;const s=Qy(r),l=Qy(t),c=r0(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),{}))})},tm=(Jy.props={},t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)});tm.props={};var em,nm,rm,im,_o={exports:{}},Qs={exports:{}};function am(t){return 1-Math.abs(t)}em=(No=Qs).exports,No.exports.isNumber=function(t){return"number"==typeof t},No.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},No.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},No.exports.findMinMulti=function(t){for(var e=em.findMin(t[0]),n=1;n<t.length;n++)e=Math.min(e,em.findMin(t[n]));return e},No.exports.findMaxMulti=function(t){for(var e=em.findMax(t[0]),n=1;n<t.length;n++)e=Math.max(e,em.findMax(t[n]));return e},No.exports.inside=function(t,e,n){return t<=n&&n<=e},Ro=_o,nm=Math.log(2),rm=Ro.exports,im=Qs.exports,Ro.exports.getUnifiedMinMax=function(t,e){return rm.getUnifiedMinMaxMulti([t],e)},Ro.exports.getUnifiedMinMaxMulti=function(t,e){var n=!1,r=!1,i=im.isNumber((e=e||{}).width)?e.width:2,a=im.isNumber(e.size)?e.size:50,o=im.isNumber(e.min)?e.min:(n=!0,im.findMinMulti(t)),e=im.isNumber(e.max)?e.max:(r=!0,im.findMaxMulti(t)),t=(e-o)/(a-1);return n&&(o-=2*i*t),r&&(e+=2*i*t),{min:o,max:e}},Ro.exports.create=function(t,e){if(!t||0===t.length)return[];var n=im.isNumber((e=e||{}).size)?e.size:50,o=im.isNumber(e.width)?e.width:2,e=rm.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}(am,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),im.inside(0,c.length-1,a)&&(c[a].y+=i*f),im.inside(0,c.length-1,e+1)&&(c[e+1].y-=2*i*f),im.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},Ro.exports.getExpectedValueFromPdf=function(t){var e;if(t&&0!==t.length)return e=0,t.forEach(function(t){e+=t.x*t.y}),e},Ro.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}},Ro.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/nm,Math.pow(2,n)};var om=_o.exports;const sm=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(e0(t,e=>n.map(t=>e[t]).join("-")).values()).map(t=>{var e=om.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})})}};sm.props={};var lm={exports:{}};function cm(t){for(var e=new Array(t),n=0;n<t;++n)e[n]=0;return e}function um(t,e){for(var n=0,r=0;r<t.length;++r)n+=t[r]*e[r];return n}function hm(t){return Math.sqrt(um(t,t))}function fm(t,e,n){for(var r=0;r<e.length;++r)t[r]=e[r]*n}function dm(t,e,n,r,i){for(var a=0;a<t.length;++a)t[a]=e*n[a]+r*i[a]}function pm(i,a,o,s,l,c,u){var h=o.fx,f=um(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,dm(s.x,1,o.x,l,a),d=s.fx=i(s.x,s.fxprime),p=um(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(dm(s.x,1,o.x,l,a),d=s.fx=i(s.x,s.fxprime),p=um(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}(zo=zo=lm.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},zo.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(),k=0;k<i;++k){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 O=b[g]=0;O<d;++O)b[g]+=p[O][g];b[g]/=d}var E=p[d];if(dm(x,1+c,b,-c,E),x.fx=t(x),x.fx<p[0].fx)dm(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?(dm(w,1+h,b,-h,E),w.fx=t(w),w.fx<E.fx?m(w):S=!0):(dm(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)dm(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]}},zo.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),fm(r=a.fxprime.slice(),a.fxprime,-1);for(var c=0;c<i;++c){var u;if(l=pm(t,r,a,o,l),n.history&&n.history.push({x:a.x.slice(),fx:a.fx,fxprime:a.fxprime.slice(),alpha:l}),l?(dm(s,1,o.fxprime,-1,a.fxprime),u=um(a.fxprime,a.fxprime),u=Math.max(0,um(s,o.fxprime)/u),dm(r,u,r,-1,o.fxprime),u=a,a=o,o=u):fm(r,a.fxprime,-1),hm(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},zo.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()}),dm(a.x,1,a.x,-i,a.fxprime),!(hm(a.fxprime)<=1e-5));++o);return a},zo.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&&(fm(l,i.fxprime,-1),s=pm(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||hm(i.fxprime)<1e-5));++d);return i},zo.zeros=cm,zo.zerosM=function(t,e){return cm(t).map(function(){return cm(e)})},zo.norm2=hm,zo.weightedSum=dm,zo.scale=fm;const gm=1e-10;function ym(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=xm(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(vm(e,n[t])>n[t].radius+gm)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=vm(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+=mm(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(vm(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-gm,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 mm(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function vm(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}function bm(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),mm(t,t-(n*n-e*e+t*t)/(2*n))+mm(e,r))}function xm(t,e){var n,r,i=vm(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 wm(t,e){(e=e||{}).maxIterations=e.maxIterations||500;var n=e.initialLayout||Om;const i=e.lossFunction||Em,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=lm.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 Mm=1e-10;function km(e,n,r){return Math.min(e,n)*Math.min(e,n)*Math.PI<=r+Mm?Math.abs(e-n):lm.exports.bisect(function(t){return bm(e,n,t)-r},0,e+n)}function Om(t,e){let n=function(r,t){const i=t&&t.lossFunction?t.lossFunction:Em,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+Mm>=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=km(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=km(s.radius,x.radius,y[t].size),M=xm({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 k=i(a,r);k<e&&(e=k,n=m[t])}p(n,g)}return a}(t,e);var r=e.lossFunction||Em;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=lm.exports.zerosM(a.length,a.length),l=lm.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=km(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=lm.exports.norm2(y.map(lm.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=lm.exports.zeros(2*y.length).map(Math.random);h=lm.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)lm.exports.scale(e.history[a].x,c);return p}(t,e),t)+1e-8<r(n,t)?e:n}function Em(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]],bm(o.radius,a.radius,vm(o,a))):ym(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 Sm(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 Am=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=wm(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=Sm(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=(ym(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}})})}};Am.props={};const _m=(l,c)=>X(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 Zy(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 Tm(t,...e){return e.reduce((e,n)=>t=>e(n(t)),t)}function Pm(e,n){return n-e?t=>(t-e)/(n-e):t=>.5}function Cm(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}_m.props={};const Lm=Math.sqrt(50),Nm=Math.sqrt(10),jm=Math.sqrt(2);function Rm(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>=Lm?10:n>=Nm?5:n>=jm?2:1)*10**t:-(10**-t)/(n>=Lm?10:n>=Nm?5:n>=jm?2:1)}function Im(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>=Lm?r*=10:n>=Nm?r*=5:n>=jm&&(r*=2),e<t?-r:r}const Bm=(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=Rm(a,o,n))?(a=Math.floor(a/s)*s,o=Math.ceil(o/s)*s,s=Rm(a,o,n)):s<0&&(a=Math.ceil(a*s)/s,o=Math.floor(o*s)/s,s=Rm(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},Dm=36e5,Fm=864e5,zm=7*Fm;Fm,Fm;function Wm(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}}qo=Wm(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),Uo=Wm(1e3,t=>{t.setMilliseconds(0)},(t,e=1)=>{t.setTime(+t+1e3*e)},t=>t.getSeconds()),Ko=Wm(6e4,t=>{t.setSeconds(0,0)},(t,e=1)=>{t.setTime(+t+6e4*e)},t=>t.getMinutes()),Qo=Wm(Dm,t=>{t.setMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+Dm*e)},t=>t.getHours()),es=Wm(Fm,t=>{t.setHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+Fm*e)},t=>t.getDate()-1);const Gm=Wm(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());rs=Wm(zm,t=>{t.setDate(t.getDate()-t.getDay()%7),t.setHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+zm*e)},t=>{var e=Gm.floor(t),t=new Date(+t);return Math.floor((+t-+e)/zm)}),as=Wm(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 Hm={millisecond:qo,second:Uo,minute:Ko,hour:Qo,day:es,week:rs,month:Gm,year:as};Es=Wm(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),Fs=Wm(1e3,t=>{t.setUTCMilliseconds(0)},(t,e=1)=>{t.setTime(+t+1e3*e)},t=>t.getUTCSeconds()),zs=Wm(6e4,t=>{t.setUTCSeconds(0,0)},(t,e=1)=>{t.setTime(+t+6e4*e)},t=>t.getUTCMinutes()),Go=Wm(Dm,t=>{t.setUTCMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+Dm*e)},t=>t.getUTCHours()),qs=Wm(Fm,t=>{t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+Fm*e)},t=>t.getUTCDate()-1);const Vm=Wm(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());Ml=Wm(zm,t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+zm*e)},t=>{var e=Vm.floor(t),t=new Date(+t);return Math.floor((+t-+e)/zm)}),Al=Wm(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 Ym={millisecond:Es,second:Fs,minute:zs,hour:Go,day:qs,week:Ml,month:Vm,year:Al};function qm(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?Ym:Hm;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=Cm(i,l,0,c,s);let h;return h=u===c?[a,Im(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(Im(t,e,n),1)]}const $m=(t,e,n,r,i)=>{var a=e<t,o=a?e:t,t=a?t:e,[e,n]=qm(o,t,n,r,i),r=[e.floor(o,n),e.ceil(t,n)];return a?r.reverse():r};function Um(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)}function Xm(t){return Qm(t,"Function")}function Km(t){return null==t}var Zm={}.toString,Qm=function(t,e){return Zm.call(t)==="[object "+e+"]"},Jm=function(t){return Array.isArray?Array.isArray(t):Qm(t,"Array")};var tv=function(t){if("object"!=typeof(e=t)||null===e||!Qm(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},ev=function(t){return Qm(t,"Number")},nv=Object.values?function(t){return Object.values(t)}:function(n){var t,r=[],e=n,i=function(t,e){Xm(n)&&"prototype"===e||r.push(t)};if(e)if(Jm(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},rv=5;function iv(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||rv,n){var o;n.hasOwnProperty(a)&&(null!==(o=n[a])&&tv(o)?(tv(e[a])||(e[a]={}),r<i?t(e[a],o,r+1,i):e[a]=n[a]):Jm(o)?(e[a]=[],e[a]=e[a].concat(o)):void 0!==o&&(e[a]=o))}}(t,e[r]);return t}function av(t){return t}var ov,sv=function(t,e){if(!Um(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 lv(t){return Km(t)?0:(Um(t)?t:Object.keys(t)).length}function cv(t){return null!=t&&!Number.isNaN(t)}!function(a,o){var s;if(Xm(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(ov=ov||document.createElement("canvas").getContext("2d")).font=[a,e,i,n+"px",r].join(" "),ov.measureText(Qm(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],nv(e=void 0===e?{}:e)).join("")});const uv=e=>t=>-e(-t),hv=(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?uv(t):t},fv=(e,t)=>{var n=e===Math.E?Math.exp:t=>e**t;return t?uv(n):n},dv=(t,e,n,r)=>{var i=t<0,a=hv(r,i),r=fv(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 pv(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 ev(t)?Math.round(t):t}):i;this.output=Tm(a,r,e,t)},t.prototype.invert=void 0}}var gv,jl={exports:{}},Fl={exports:{}},yv=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))},mv=Array.prototype.concat,vv=Array.prototype.slice,bv=Fl.exports=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];yv(i)?e=mv.call(e,vv.call(i)):e.push(i)}return e},xv=(bv.wrap=function(t){return function(){return t(bv(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]}),wv=Fl.exports,Mv=Object.hasOwnProperty,kv=Object.create(null);for(gv in xv)Mv.call(xv,gv)&&(kv[xv[gv]]=gv);var Ov=jl.exports={to:{},get:{}};function Ev(t,e,n){return Math.min(Math.max(e,t),n)}function Sv(t){t=Math.round(t).toString(16).toUpperCase();return t.length<2?"0"+t:t}Ov.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=Ov.get.hsl(t),n="hsl";break;case"hwb":e=Ov.get.hwb(t),n="hwb";break;default:e=Ov.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},Ov.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]:Mv.call(xv,e[1])?((i=xv[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]=Ev(i[n],0,255);return i[3]=Ev(i[3],0,1),i},Ov.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,Ev(parseFloat(t[2]),0,100),Ev(parseFloat(t[3]),0,100),Ev(isNaN(e)?1:e,0,1)]):null},Ov.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,Ev(parseFloat(t[2]),0,100),Ev(parseFloat(t[3]),0,100),Ev(isNaN(e)?1:e,0,1)]):null},Ov.to.hex=function(){var t=wv(arguments);return"#"+Sv(t[0])+Sv(t[1])+Sv(t[2])+(t[3]<1?Sv(Math.round(255*t[3])):"")},Ov.to.rgb=function(){var t=wv(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]+")"},Ov.to.rgb.percent=function(){var t=wv(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]+")"},Ov.to.hsl=function(){var t=wv(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},Ov.to.hwb=function(){var t=wv(arguments),e="";return 4<=t.length&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},Ov.to.keyword=function(t){return kv[t.slice(0,3)]};var Av=jl.exports;function _v(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 Tv(t){var e,n,r,t=Av.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*_v(n=2*r-(r=r<.5?r*(1+n):r+n-r*n),r,e+1/3),255*_v(n,r,e),255*_v(n,r,e-1/3),t]):null):null}const Pv=(e,n)=>t=>e*(1-t)+n*t,Cv=(t,e)=>{if("number"==typeof t&&"number"==typeof e)return Pv(t,e);if("string"!=typeof t||"string"!=typeof e)return()=>t;{var n=t,r=e;const l=Tv(n),c=Tv(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})`}}},Lv=(t,e)=>{const n=Pv(t,e);return t=>Math.round(n(t))};function Nv({map:t,initKey:e},n){e=e(n);return t.has(e)?t.get(e):n}function jv(t){return"object"==typeof t?t.valueOf():t}class Rv extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=jv,null!==t)for(var[e,n]of t)this.set(e,n)}get(t){return super.get(Nv({map:this.map,initKey:this.initKey},t))}has(t){return super.has(Nv({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 Iv{constructor(t){this.options=iv({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=iv({},this.options,t),this.rescale(t)}rescale(t){}}const Bv=Symbol("defaultUnknown");function Dv(e,n,r){for(let t=0;t<n.length;t+=1)e.has(n[t])||e.set(r(n[t]),t)}function Fv(t){var{value:t,from:e,to:n,mapper:r,notFoundReturn:i}=t;let a=r.get(t);if(void 0===a){if(i!==Bv)return i;a=e.push(t)-1,r.set(t,a)}return n[a%n.length]}function zv(t){return t instanceof Date?t=>""+t:"object"==typeof t?t=>JSON.stringify(t):t=>t}class Wv extends Iv{getDefaultOptions(){return{domain:[],range:[],unknown:Bv}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&Dv(this.domainIndexMap,this.getDomain(),this.domainKey),Fv({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&Dv(this.rangeIndexMap,this.getRange(),this.rangeKey),Fv({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=zv(e),this.rangeKey=zv(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 Wv(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 Gv(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 Rv(e.map((t,e)=>{e=d[e]*p;return[t,o?Math.floor(e):e]})),g=new Rv(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 Hv extends Wv{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:Bv,flex:[]}}constructor(t){super(t)}clone(){return new Hv(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 Gv(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 Vv=(t,e,n)=>{let r,i,a=t,o=e;if(a===o&&0<n)return[a];let s=Rm(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 Yv extends Iv{getDefaultOptions(){return{range:[0],domain:[0,1],unknown:void 0,tickCount:5,tickMethod:Vv}}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 ev(e)&&ev(r)?t(e,r,n):[]}clone(){return new Yv(this.options)}}function qv(t){return Math.abs(t)<1e-15?t:parseFloat(t.toFixed(15))}const $v=[1,5,2,2.5,4,3],Uv=100*Number.EPSILON;const Xv=(n,r,t=5,i=!0,a=$v,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=lv(f),1-sv(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=(O=r,M=w*(e-1),(O-=n)<M?1-((M-O)/2)**2/(.1*O)**2:1);if(o[0]*v+o[1]*M+o[2]*b+o[3]<g.score)break;var k=Math.floor(r/w)*y-(e-1)*y,O=Math.ceil(n/w)*y;if(k<=O){var E=O-k;for(let t=0;t<=E;t+=1){var S=(k+t)*(w/y),A=S+w*(e-1),_=w,T=function(t,e,n,r,i,a){var o=lv(e),e=sv(e,t);let s=0;return t=(r%a+a)%a,1-e/(o-1)-n+(s=(t<Uv||a-t<Uv)&&r<=0&&0<=i?1:s)}(m,a,y,S,A,_),P=1-.5*((r-A)**2+(n-S)**2)/(.1*(r-n))**2,C=(l=e,C=n,l=(l-1)/(A-(L=S)),c=((c=s)-1)/(Math.max(A,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<=A)&&(g.lmin=S,g.lmax=A,g.lstep=_,g.score=L)}}t+=1}e+=1}}y+=1}var t=qv(g.lmax),e=qv(g.lmin),N=qv(g.lstep),j=Math.floor((t=(t-e)/N,Math.round(1e12*t)/1e12))+1,R=new Array(j);R[0]=qv(e);for(let t=1;t<j;t+=1)R[t]=qv(R[t-1]+N);return R};class Kv extends Iv{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:Xv}}map(t){return cv(t)?t:this.options.unknown}invert(t){return this.map(t)}clone(){return new Kv(this.options)}getTicks(){var{domain:t,tickCount:e,tickMethod:n}=this.options,[t,r]=t;return ev(t)&&ev(r)?n(t,r,e):[]}}const Zv=(t,e,n)=>{var[t,r]=t,[e,i]=e;let a,o;return Tm(o=t<r?(a=Pm(t,r),n(e,i)):(a=Pm(r,t),n(i,e)),a)},Qv=(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]=Pm(s[t],s[t+1]),o[t]=e(l[t],l[t+1]);return t=>{var e=Cm(r,t,1,i)-1,n=a[e];return Tm(o[e],n)(t)}},Jv=(t,e,n,r)=>{return(2<Math.min(t.length,e.length)?Qv:Zv)(t,e,r?Lv:n)};class tb extends Iv{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Pv,tickCount:5}}map(t){return cv(t)?this.output(t):this.options.unknown}invert(t){return cv(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 Bm}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 av}composeOutput(t,e){var{domain:n,range:r,round:i,interpolate:a}=this.options,n=Jv(n.map(t),r,a,i);this.output=Tm(n,e,t)}composeInput(t,e,n){var{domain:r,range:i}=this.options,i=Jv(i,r.map(t),Pv);this.input=Tm(e,n,i)}}class eb extends tb{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:Cv,tickMethod:Vv,tickCount:5}}chooseTransforms(){return[av,av]}clone(){return new eb(this.options)}}class nb extends Hv{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:Bv,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new nb(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}const rb=t=>t<0?-Math.sqrt(-t):Math.sqrt(t);class ib extends tb{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:Cv,tickMethod:Vv,tickCount:5}}constructor(t){super(t)}chooseTransforms(){var t,e,n,r=this.options["exponent"];return 1===r?[av,av]:(t=.5===r?rb:(e=r,t=>t<0?-((-t)**e):t**e),n=r,[t,t=>t<0?-((-t)**(1/n)):t**(1/n)])}clone(){return new ib(this.options)}}class ab extends ib{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Cv,tickMethod:Vv,tickCount:5,exponent:.5}}constructor(t){super(t)}update(t){super.update(t)}clone(){return new ab(this.options)}}class ob extends Iv{getDefaultOptions(){return{domain:[.5],range:[0,1]}}constructor(t){super(t)}map(t){return cv(t)?(t=Cm(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 ob(this.options)}rescale(){var{domain:t,range:e}=this.options;this.n=Math.min(t.length,e.length-1),this.thresholds=t}}const sb=(t,e,n,r=10)=>{var i=t<0,a=fv(r,i),o=hv(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=Vv(l,c,n))}else{t=-1===n?h-u:Math.min(h-u,n);f=Vv(u,h,t).map(a)}return s?f.reverse():f};class lb extends tb{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:Cv,tickMethod:sb,tickCount:5}}chooseNice(){return dv}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[hv(t,e),fv(t,e)]}clone(){return new lb(this.options)}}class cb extends ob{getDefaultOptions(){return{domain:[0,1],range:[.5],nice:!1,tickCount:5,tickMethod:Xv}}constructor(t){super(t)}nice(){var t,e,n=this.options["nice"];n&&([n,t,e]=this.getTickMethodOptions(),this.options.domain=Bm(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 cb(this.options)}}function ub(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 hb extends ob{getDefaultOptions(){return{domain:[],range:[],tickCount:5,unknown:void 0,tickMethod:Xv}}constructor(t){super(t)}rescale(){var{domain:t,range:e}=this.options;this.n=e.length-1,this.thresholds=ub(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 hb(this.options)}getTicks(){var{tickCount:t,domain:e,tickMethod:n}=this.options,r=e.length-1;return n(e[0],e[r],t)}}var fb=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,db=/\[([^]*?)\]/gm;function pb(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}function gb(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 yb(t,e){for(void 0===e&&(e=2),t=String(t);t.length<e;)t="0"+t;return t}var mb,Gs=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],tl=["January","February","March","April","May","June","July","August","September","October","November","December"],a=pb(tl,3),vb=gb({},{dayNamesShort:pb(Gs,3),dayNames:Gs,monthNamesShort:a,monthNames:tl,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][3<t%10?0:(t-t%10!=10?1:0)*t%10]}}),bb={D:function(t){return String(t.getDate())},DD:function(t){return yb(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return yb(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 yb(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 yb(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return yb(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return yb(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return yb(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return yb(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return yb(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return yb(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return yb(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?"-":"+")+yb(100*Math.floor(Math.abs(t)/60)+Math.abs(t)%60,4)},Z:function(t){t=t.getTimezoneOffset();return(0<t?"-":"+")+yb(Math.floor(Math.abs(t)/60),2)+":"+yb(Math.abs(t)%60,2)}},xb={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 wb=(t,e,n,r,i)=>{var a=e<t,o=a?e:t,t=a?t:e,[e,n]=qm(o,t,n,r,i),r=e.range(o,new Date(+t+1),n,!0);return a?r.reverse():r};function Mb(t){var e=t.getTimezoneOffset(),t=new Date(t);return t.setMinutes(t.getMinutes()+e,t.getSeconds(),t.getMilliseconds()),t}class kb extends tb{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:wb,interpolate:Pv,mask:void 0,utc:!1}}chooseTransforms(){return[t=>+t,t=>new Date(t)]}chooseNice(){return $m}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?Ym:Hm,s=t?Mb:av;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=xb.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=xb[t]||t).replace(db,function(t,e){return r.push(e),"@@@"}),gb(gb({},vb),n));return(t=t.replace(fb,function(t){return bb[t](e,i)})).replace(/@@@/g,function(){return r.shift()})}}clone(){return new kb(this.options)}}var Ob;let Eb=mb=class extends eb{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:av,tickMethod:Vv,tickCount:5}}constructor(t){super(t)}clone(){return new mb(this.options)}};Eb=mb=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}([pv(function(t){return[t(0),t(1)]},t=>{var[t,e]=t;return Tm(Pv(0,1),Pm(t,e))})],Eb);let Sb=Ob=class extends eb{getDefaultOptions(){return{domain:[0,.5,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:av,tickMethod:Vv,tickCount:5}}constructor(t){super(t)}clone(){return new Ob(this.options)}};function Ab(r,i){return Object.entries(r).reduce((t,[e,n])=>(t[e]=i(n,e,r),t),{})}function _b(t){return t.map((t,e)=>e)}function Tb(t){return t[t.length-1]}function Pb(t,e){const n=[[],[]];return t.forEach(t=>{n[e(t)?0:1].push(t)}),n}function Cb(n,t=n.length){if(1===t)return n.map(t=>[t]);const r=[];for(let e=0;e<n.length;e++)Cb(n.slice(e+1),t-1).forEach(t=>{r.push([n[e],...t])});return r}function Lb([t,e],[n,r]){return[t-n,e-r]}function Nb([t,e],[n,r]){return[t+n,e+r]}function jb([t,e],[n,r]){return Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))}function Rb([t,e]){return Math.atan2(e,t)}function Ib([t,e]){return Rb([t,e])+Math.PI/2}function Bb(t,e){t=Rb(t),e=Rb(e);return t<e?e-t:2*Math.PI-(t-e)}function Db(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 Fb([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 zb(t,e,n,r,i){e=Rb(Lb(r,e))+Math.PI,n=Rb(Lb(r,n))+Math.PI;t.arc(r[0],r[1],i,e,n,n-e<0)}function Wb(e,t,n,r="y",i="between"){const a="y"===r||!0===r?n:t;var n="y"===r||!0===r?90:0,t=_b(a),[r,o]=Kp(t,t=>a[t]);const s=new eb({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 Gb(t){var[t,e,n,r]=t;return[r,t,e,n]}function Hb(t,e,n){var[e,r,,i]=C0(t)?Gb(e):e,[n,a]=n,t=t.getCenter(),o=Ib(Lb(e,t)),r=Ib(Lb(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:jb(i,t),outerRadius:jb(e,t)}}function Vb(t){var{colorAttribute:t,opacityAttribute:t=t}=t;return t+"Opacity"}function Yb(t,e){return L0(t)?(e=e["transform"],`translate(${(t=t.getCenter())[0]}, ${t[1]}) `+(e||"")):""}function qb(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 $b([t],null,t,t.ownerDocument)}Sb=Ob=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}([pv(function(t){return[t(0),t(.5),t(1)]},t=>{const[e,n,r]=t,i=Tm(Pv(0,.5),Pm(e,n)),a=Tm(Pv(.5,1),Pm(n,r));return t=>(e>r?t<n?a:i:t<n?i:a)(t)})],Sb);class $b{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 $b(t,null,this._elements[0],this._document)}selectFacetAll(t){t="string"==typeof t?this._parent.querySelectorAll(t):t;return new $b(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 $b([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 $b(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 $b(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 $b([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=e0(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 e0=h.get(d);s.push([f,e0]);for(const y of e0)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 $b([],i,this._parent,this._document),new $b(a,null,this._parent,this._document),new $b(o,null,this._parent,this._document),new $b([],s,this._parent,this._document),new $b(l,null,this._parent,this._document)];return new $b(this._elements,null,this._parent,this._document,t)}merge(t){var e=[...this._elements,...t._elements],t=[...this._transitions,...t._transitions];return new $b(e,null,this._parent,this._document,void 0,t)}createElement(t){var e;return this._document?this._document.createElement(t,{}):(e=$b.registry[t])?new e:Eg("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 $b([],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}}$b.registry={g:hc,rect:Lc,circle:nc,path:kc,text:Rc,ellipse:lc,image:mc,line:xc,polygon:Sc,polyline:Tc,html:pc};const Ub={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"]}}},Xb={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=vd({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]=qb(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 hc);return Lg(u)||("function"==typeof u?n.append(()=>u(s,e,a,g)):n.append("line").call(L,r).node()),Lg(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}},Kb={type:"text",style:{x:"50%",y:"60%",textAlign:"center",textBaseline:"middle",fontSize:20,fontWeight:800,fill:"#888"}};const Zb=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({},Ub,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({},Ub,Xb,Object.assign({type:"point",data:e,scale:l,style:u,animate:"object"==typeof a?st(a,"indicator"):a},t)),ot({},Kb,{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})]},Qb=(Zb.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]});Qb.props={defaultShape:"density",defaultLabelShape:"label",composite:!1,channels:[...Sp({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:[...Pp(),{type:"maybeZeroY1"},{type:"maybeZeroX"}],postInference:[..._p()],interaction:{shareTooltip:!0}};const Jb=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]})]]};Jb.props={defaultShape:"heatmap",defaultLabelShape:"label",composite:!1,channels:[...Sp({shapes:["heatmap"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"color",scale:"identity",required:!0},{name:"size"}],preInference:[...Pp(),{type:"maybeZeroY"},{type:"maybeZeroX"}],postInference:[...Ap()]};const t2=()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"],e2=(t2.props={},()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"]),n2=(e2.props={},t=>new Hv(t)),r2=(n2.props={},t=>new eb(t)),i2=(r2.props={},t=>new Wv(t)),a2=(i2.props={},t=>new Kv(t)),o2=(a2.props={},t=>new nb(t)),s2=(o2.props={},t=>new kb(t)),l2=(s2.props={},t=>new lb(t)),c2=(l2.props={},t=>new ib(t)),u2=(c2.props={},t=>new ob(t)),h2=(u2.props={},t=>new hb(t)),f2=(h2.props={},t=>new cb(t)),d2=(f2.props={},t=>new ab(t)),p2=(d2.props={},t=>new Eb(t)),g2=(p2.props={},t=>new Yv(t));function y2(t){return function(){return t}}g2.props={};const m2=Math.abs,v2=Math.atan2,b2=Math.cos,x2=Math.max,w2=Math.min,M2=Math.sin,k2=Math.sqrt,O2=1e-12,E2=Math.PI,S2=E2/2,A2=2*E2;function _2(t){return 1<=t?S2:t<=-1?-S2:Math.asin(t)}const T2=Math.PI,P2=2*T2,C2=1e-6,L2=P2-C2;function N2(n){this._+=n[0];for(let t=1,e=n.length;t<e;++t)this._+=arguments[t]+n[t]}class j2{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?N2:function(t){var e=Math.floor(t);if(!(0<=e))throw new Error("invalid digits: "+t);if(15<e)return N2;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>C2&&(Math.abs(f*c-u*h)>C2&&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((T2-Math.acos((o+d-r)/(2*l*a)))/2))/a,r=o/l,Math.abs(d-1)>C2&&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)>C2||Math.abs(this._y1-c)>C2)&&this._append`L${l},${c}`,n&&((h=h<0?h%P2+P2:h)>L2?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>C2&&this._append`A${n},${n},0,${+(h>=T2)},${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 R2(){return new j2}function I2(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 j2(r)}function B2(t){return t.innerRadius}function D2(t){return t.outerRadius}function F2(t){return t.startAngle}function z2(t){return t.endAngle}function W2(t){return t&&t.padAngle}function G2(t,e,n,r,i,a,o){var s=t-n,l=e-r,o=(o?a:-a)/k2(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)*k2(x2(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 H2(){var _=B2,T=D2,P=y2(0),C=null,L=F2,N=z2,j=W2,R=null,I=I2(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=+_.apply(this,arguments),k=+T.apply(this,arguments),O=L.apply(this,arguments)-S2,E=N.apply(this,arguments)-S2,S=m2(E-O),A=O<E;if(R=R||(t=I()),k<M&&(e=k,k=M,M=e),k>O2?S>A2-O2?(R.moveTo(k*b2(O),k*M2(O)),R.arc(0,0,k,O,E,!A),M>O2&&(R.moveTo(M*b2(E),M*M2(E)),R.arc(0,0,M,E,O,A))):(r=e=O,i=n=E,o=a=S,f=(u=j.apply(this,arguments)/2)>O2&&(C?+C.apply(this,arguments):k2(M*M+k*k)),w=x=s=w2(m2(k-M)/2,+P.apply(this,arguments)),f>O2&&(h=_2(f/M*M2(u)),f=_2(f/k*M2(u)),(a-=2*h)>O2?(r+=h*=A?1:-1,i-=h):(a=0,r=i=(O+E)/2),(o-=2*f)>O2?(e+=f*=A?1:-1,n-=f):(o=0,e=n=(O+E)/2)),u=k*b2(e),h=k*M2(e),f=M*b2(i),O=M*M2(i),s>O2&&(d=k*b2(n),p=k*M2(n),g=M*b2(r),y=M*M2(r),S<E2)&&((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<O2))return[t+(l=(o*(e-a)-s*(t-i))/l)*n,e+l*r]}(u,h,g,y,d,p,f,O))?(S=u-E[0],v=h-E[1],b=d-E[0],m=p-E[1],v=1/M2((1<(S=(S*b+v*m)/(k2(S*S+v*v)*k2(b*b+m*m)))?0:S<-1?E2:Math.acos(S))/2),b=k2(E[0]*E[0]+E[1]*E[1]),x=w2(s,(M-b)/(v-1)),w=w2(s,(k-b)/(1+v))):x=w=0),o>O2?w>O2?(l=G2(g,y,u,h,k,w,A),c=G2(d,p,f,O,k,w,A),R.moveTo(l.cx+l.x01,l.cy+l.y01),w<s?R.arc(l.cx,l.cy,w,v2(l.y01,l.x01),v2(c.y01,c.x01),!A):(R.arc(l.cx,l.cy,w,v2(l.y01,l.x01),v2(l.y11,l.x11),!A),R.arc(0,0,k,v2(l.cy+l.y11,l.cx+l.x11),v2(c.cy+c.y11,c.cx+c.x11),!A),R.arc(c.cx,c.cy,w,v2(c.y11,c.x11),v2(c.y01,c.x01),!A))):(R.moveTo(u,h),R.arc(0,0,k,e,n,!A)):R.moveTo(u,h),M>O2&&a>O2?x>O2?(l=G2(f,O,d,p,M,-x,A),c=G2(u,h,g,y,M,-x,A),R.lineTo(l.cx+l.x01,l.cy+l.y01),x<s?R.arc(l.cx,l.cy,x,v2(l.y01,l.x01),v2(c.y01,c.x01),!A):(R.arc(l.cx,l.cy,x,v2(l.y01,l.x01),v2(l.y11,l.x11),!A),R.arc(0,0,M,v2(l.cy+l.y11,l.cx+l.x11),v2(c.cy+c.y11,c.cx+c.x11),A),R.arc(c.cx,c.cy,x,v2(c.y11,c.x11),v2(c.y01,c.x01),!A))):R.arc(0,0,M,i,r,A):R.lineTo(f,O)):R.moveTo(0,0),R.closePath(),t)return R=null,t+""||null}return e.centroid=function(){var t=(+_.apply(this,arguments)+ +T.apply(this,arguments))/2,e=(+L.apply(this,arguments)+ +N.apply(this,arguments))/2-E2/2;return[b2(e)*t,M2(e)*t]},e.innerRadius=function(t){return arguments.length?(_="function"==typeof t?t:y2(+t),e):_},e.outerRadius=function(t){return arguments.length?(T="function"==typeof t?t:y2(+t),e):T},e.cornerRadius=function(t){return arguments.length?(P="function"==typeof t?t:y2(+t),e):P},e.padRadius=function(t){return arguments.length?(C=null==t?null:"function"==typeof t?t:y2(+t),e):C},e.startAngle=function(t){return arguments.length?(L="function"==typeof t?t:y2(+t),e):L},e.endAngle=function(t){return arguments.length?(N="function"==typeof t?t:y2(+t),e):N},e.padAngle=function(t){return arguments.length?(j="function"==typeof t?t:y2(+t),e):j},e.context=function(t){return arguments.length?(R=null==t?null:t,e):R},e}function V2(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function Y2(t){this._context=t}function q2(t){return new Y2(t)}function $2(t){return t[0]}function U2(t){return t[1]}function X2(o,s){var l=y2(!0),c=null,u=q2,h=null,f=I2(e);function e(t){var e,n,r,i=(t=V2(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?$2:y2(o),s="function"==typeof s?s:void 0===s?U2:y2(s),e.x=function(t){return arguments.length?(o="function"==typeof t?t:y2(+t),e):o},e.y=function(t){return arguments.length?(s="function"==typeof t?t:y2(+t),e):s},e.defined=function(t){return arguments.length?(l="function"==typeof t?t:y2(!!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 K2(u,h,f){var d=null,p=y2(!0),g=null,y=q2,m=null,v=I2(e);function e(t){var e,n,r,i,a,o=(t=V2(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 X2().defined(p).curve(y).context(g)}return u="function"==typeof u?u:void 0===u?$2:y2(+u),h="function"==typeof h?h:y2(void 0===h?0:+h),f="function"==typeof f?f:void 0===f?U2:y2(+f),e.x=function(t){return arguments.length?(u="function"==typeof t?t:y2(+t),d=null,e):u},e.x0=function(t){return arguments.length?(u="function"==typeof t?t:y2(+t),e):u},e.x1=function(t){return arguments.length?(d=null==t?null:"function"==typeof t?t:y2(+t),e):d},e.y=function(t){return arguments.length?(h="function"==typeof t?t:y2(+t),f=null,e):h},e.y0=function(t){return arguments.length?(h="function"==typeof t?t:y2(+t),e):h},e.y1=function(t){return arguments.length?(f=null==t?null:"function"==typeof t?t:y2(+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:y2(!!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}R2.prototype=j2.prototype,Y2.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 Z2=J2(q2);function Q2(t){this._curve=t}function J2(e){function t(t){return new Q2(e(t))}return t._curve=e,t}function tx(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(J2(t)):e()._curve},t}function ex(){}function nx(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 rx(t,e){this._context=t,this._k=(1-e)/6}function ix(t,e){this._context=t,this._k=(1-e)/6}function ax(t,e,n){var r,i,a=t._x1,o=t._y1,s=t._x2,l=t._y2;t._l01_a>O2&&(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>O2&&(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 ox(t,e){this._context=t,this._alpha=e}Q2.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))}},rx.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:nx(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:nx(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 rx(t,n)}return t.tension=function(t){return e(+t)},t}(0),ix.prototype={areaStart:ex,areaEnd:ex,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:nx(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 ix(t,n)}return t.tension=function(t){return e(+t)},t}(0),ox.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:ax(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 sx=function e(n){function t(t){return n?new ox(t,n):new rx(t,0)}return t.alpha=function(t){return e(+t)},t}(.5);function lx(t,e){this._context=t,this._alpha=e}lx.prototype={areaStart:ex,areaEnd:ex,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:ax(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 cx=function e(n){function t(t){return n?new lx(t,n):new ix(t,0)}return t.alpha=function(t){return e(+t)},t}(.5);function ux(t){this._context=t}function hx(t){return new ux(t)}function fx(t,e){this._context=t,this._t=e}function dx(t){return new fx(t,.5)}function px(t){return new fx(t,0)}function gx(t){return new fx(t,1)}function yx(t,e,n){return Math.max(e,Math.min(t,n))}function mx(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(!L0(r)&&!j0(r)){var m=!!C0(r),[v,,b]=m?Gb(e):e;const[O,M]=v;var[b,v]=Lb(b,v),x=(0<b?O:O+b)+s,w=(0<v?M:M+v)+l,b=Math.abs(b)-(s+c),s=Math.abs(v)-(l+u),c=m?b:yx(b,g,y),v=m?yx(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:k}=n;m=r.getCenter(),g=Hb(r,e,[M,k]),y=H2().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()}ux.prototype={areaStart:ex,areaEnd:ex,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))}},fx.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 vx=(E,t)=>{const{colorAttribute:S,first:A=!0,last:_=!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:k}=e;const O=[A?s:f,A?l:d,_?c:p,_?u:h];s=["radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft"],C0(P)&&s.push(s.shift()),f=Object.assign(Object.assign({radius:i},Object.fromEntries(s.map((t,e)=>[t,O[e]]))),{inset:g,insetLeft:y,insetRight:m,insetBottom:v,insetTop:b,minWidth:x,maxWidth:w});return lt(mx(C,t,e,P,f)).call(L,n).style("fill","transparent").style(S,r).style(Vb(E),k).style("lineWidth",a).style("stroke",void 0===o?r:o).call(L,M).node()}},bx=(vx.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(t,e)=>vx(Object.assign({colorAttribute:"fill"},t),e)),xx=(bx.props=Object.assign(Object.assign({},vx.props),{defaultMarker:"square"}),(t,e)=>vx(Object.assign({colorAttribute:"stroke"},t),e));xx.props=Object.assign(Object.assign({},vx.props),{defaultMarker:"hollowSquare"});const wx=(t,e)=>{const{adjustPoints:s=function(t,e,n){var[t,r,i,a]=t;if(C0(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]=!!C0(c)?Gb(i):i,{color:e=a,opacity:a}=e,t=X2().curve(hx)([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 Mx(t,e,n){var[t,r,i,a]=t;if(C0(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]}wx.props={defaultMarker:"square"};const kx=(t,e)=>wx(Object.assign({adjustPoints:Mx},t),e);function Ox(t){const e="function"==typeof t?t:t.render;return class extends ac{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){e(this)}}}kx.props={defaultMarker:"square"};const Ex=Ox(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 Sx=(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?Wb(a,o,s,h,f):r,o=Yb(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(L0(y)){const c=y.getCenter();l=n=>tx(X2().curve(Z2)).angle((t,e)=>Ib(Lb(n[e],c))).radius((t,e)=>jb(n[e],c)).defined(([t,e])=>d(t)&&d(e)).curve(u)(n)}else l=X2().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 Ex).style("style1",Object.assign(Object.assign({},s),n)).style("style2",s).style("d1",e.map(l).join(",")).style("d2",l(t))).node()}},Ax=(Sx.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(n,r)=>{const i=r["coordinate"];return(...t)=>{var e=L0(i)?hx:q2;return Sx(Object.assign({curve:e},n),r)(...t)}}),_x=(Ax.props=Object.assign(Object.assign({},Sx.props),{defaultMarker:"line"}),(t,n)=>{const{alpha:r=.5}=t,i=at(t,["alpha"]),a=n["coordinate"];return(...t)=>{var e=L0(a)?cx:sx;return Sx(Object.assign({curve:e.alpha(r)},i),n)(...t)}}),Tx=(_x.props=Object.assign(Object.assign({},Sx.props),{defaultMarker:"smooth"}),(t,e)=>Sx(Object.assign({curve:gx},t),e)),Px=(Tx.props=Object.assign(Object.assign({},Sx.props),{defaultMarker:"hv"}),(t,e)=>Sx(Object.assign({curve:px},t),e)),Cx=(Px.props=Object.assign(Object.assign({},Sx.props),{defaultMarker:"vh"}),(t,e)=>Sx(Object.assign({curve:dx},t),e));Cx.props=Object.assign(Object.assign({},Sx.props),{defaultMarker:"hvh"});const Lx=(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=R2();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(Ag)&&(r=p,m=m,v=v,s=a=i=h=u=c=l=s=o=i=a=i=void 0,i=(s=Rb(Lb(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=Nb(g,a),c=Nb(y,i),u=Nb(c,o),h=Lb(o=Nb(y,o),i),y=Lb(y,i),i=Lb(g,a),a=Lb(i,s),g=Lb(g,s),s=Lb(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()}};Lx.props=Object.assign(Object.assign({},Sx.props),{defaultMarker:"line"});S=(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"]],S.style=["fill"],Ks=S.bind(void 0),Ks.style=["stroke","lineWidth"],Us=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]],Us.style=["fill"],al=Us.bind(void 0),al.style=["fill"],r=Us.bind(void 0),r.style=["stroke","lineWidth"],cu=(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"]]},cu.style=["fill"],nl=cu.bind(void 0),nl.style=["stroke","lineWidth"],So=(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"]]},So.style=["fill"],Co=So.bind(void 0),Co.style=["stroke","lineWidth"],Vo=(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"]]},Vo.style=["fill"],fn=Vo.bind(void 0),fn.style=["stroke","lineWidth"],n=(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"]]},n.style=["fill"],ii=n.bind(void 0),ii.style=["stroke","lineWidth"],s=(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"]]},s.style=["fill"],Vs=s.bind(void 0),Vs.style=["stroke","lineWidth"],No=(t,e,n)=>[["M",t,e+n],["L",t,e-n]],No.style=["stroke","lineWidth"],Qs=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]],Qs.style=["stroke","lineWidth"],Ro=(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]],Ro.style=["stroke","lineWidth"],_o=(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]],_o.style=["stroke","lineWidth"],zo=(t,e,n)=>[["M",t-n,e],["L",t+n,e]],zo.style=["stroke","lineWidth"],qo=(t,e,n)=>[["M",t-n,e],["L",t+n,e]],qo.style=["stroke","lineWidth"],Uo=qo.bind(void 0),Uo.style=["stroke","lineWidth"],Ko=(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]],Ko.style=["stroke","lineWidth"],Qo=(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]],Qo.style=["stroke","lineWidth"],es=(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]],es.style=["stroke","lineWidth"],rs=(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]],rs.style=["stroke","lineWidth"],as=(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]];as.style=["stroke","lineWidth"];const Nx=new Map([["bowtie",s],["cross",Qs],["dash",Uo],["diamond",cu],["dot",qo],["hexagon",n],["hollowBowtie",Vs],["hollowDiamond",nl],["hollowHexagon",ii],["hollowPoint",Ks],["hollowSquare",r],["hollowTriangle",Co],["hollowTriangleDown",fn],["hv",Qo],["hvh",rs],["hyphen",zo],["line",No],["plus",_o],["point",S],["rect",al],["smooth",Ko],["square",Us],["tick",Ro],["triangleDown",Vo],["triangle",So],["vh",es],["vhv",as]]);const jx=(c,t)=>{const{colorAttribute:u,symbol:e,mode:h="auto"}=c,f=at(c,["colorAttribute","symbol","mode"]),d=Nx.get(e)||Nx.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]=qb(t),t=function(t,e,n,r){var i;if(1!==e.length)return n=n["size"],"fixed"!==t&&("normal"===t||I0(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(Vb(c),o).style(u,i).call(L,f).node()}},Rx=(jx.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(t,e)=>jx(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t),e)),Ix=(Rx.props=Object.assign({defaultMarker:"bowtie"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"stroke",symbol:"cross"},t),e)),Bx=(Ix.props=Object.assign({defaultMarker:"cross"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"fill",symbol:"diamond"},t),e)),Dx=(Bx.props=Object.assign({defaultMarker:"diamond"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t),e)),Fx=(Dx.props=Object.assign({defaultMarker:"hexagon"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t),e)),zx=(Fx.props=Object.assign({defaultMarker:"hollowBowtie"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t),e)),Wx=(zx.props=Object.assign({defaultMarker:"hollowDiamond"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t),e)),Gx=(Wx.props=Object.assign({defaultMarker:"hollowHexagon"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"stroke",symbol:"point"},t),e)),Hx=(Gx.props=Object.assign({defaultMarker:"hollowPoint"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"stroke",symbol:"square"},t),e)),Vx=(Hx.props=Object.assign({defaultMarker:"hollowSquare"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t),e)),Yx=(Vx.props=Object.assign({defaultMarker:"hollowTriangle"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t),e)),qx=(Yx.props=Object.assign({defaultMarker:"hollowTriangleDown"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t),e)),$x=(qx.props=Object.assign({defaultMarker:"hyphen"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"stroke",symbol:"line"},t),e)),Ux=($x.props=Object.assign({defaultMarker:"line"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"stroke",symbol:"plus"},t),e)),Xx=(Ux.props=Object.assign({defaultMarker:"plus"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"fill",symbol:"point"},t),e)),Kx=(Xx.props=Object.assign({defaultMarker:"point"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"fill",symbol:"square"},t),e)),Zx=(Kx.props=Object.assign({defaultMarker:"square"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"stroke",symbol:"tick"},t),e)),Qx=(Zx.props=Object.assign({defaultMarker:"tick"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"fill",symbol:"triangle"},t),e)),Jx=(Qx.props=Object.assign({defaultMarker:"triangle"},jx.props),(t,e)=>jx(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t),e)),tw=(Jx.props=Object.assign({defaultMarker:"triangleDown"},jx.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=R2();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*jb(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 ew(t){rw(t,!0)}function nw(t){rw(t,!1)}function rw(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)})}tw.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};t(ow,iw=hc);var iw,aw=ow;function ow(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=iw.apply(this,k([],j(t),!1))||this;return n.addEventListener(b.INSERTED,function(){nw(n)}),n}function sw(t){t=t.appendChild(new aw({class:"offscreen"}));return nw(t),t}t(uw,lw=Rc),Object.defineProperty(uw.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=sw(this)),this._offscreen},enumerable:!1,configurable:!0}),uw.prototype.disconnectedCallback=function(){var t;null!=(t=this._offscreen)&&t.destroy()};var lw,cw=uw;function uw(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return lw.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 hw(t){return t*Math.PI/180}function fw(t){return Number((180*t/Math.PI).toPrecision(5))}Object.defineProperty(pw.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(pw.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(pw.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(pw.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),pw.fromRect=function(t){return new pw(t.x,t.y,t.width,t.height)},pw.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 dw=pw;function pw(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 gw(t,e){return Ce(t)?t.apply(void 0,k([],j(e),!1)):t}function yw(t,e){function r(t){return"".concat(e,"-").concat(t)}return t=Object.fromEntries(Object.entries(t).map(function(t){var t=j(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 mw(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)bw(t,e[r]);return t}var vw,bw=function(r,i,a,o){void 0===a&&(a=0),void 0===o&&(o=5),Object.entries(i).forEach(function(t){var t=j(t,2),e=t[0],t=t[1],n=r;Object.prototype.hasOwnProperty.call(i,e)&&(t?Be(t)?(Be(r[e])||(n[e]={}),a<o?bw(r[e],t,a+1,o):n[e]=i[e]):je(t)?(n[e]=[],n[e]=n[e].concat(t)):n[e]=t:n[e]=t)})},xw=function(t){return void 0!==t&&null!=t&&!Number.isNaN(t)},ww=tn(function(t,e){var n=We(t)?t:t.style.text.toString(),e=e||Mw(t),t=e.fontSize,r=e.fontFamily,i=e.fontWeight,a=e.fontStyle,e=e.fontVariant;return(vw=vw||document.createElement("canvas").getContext("2d")).font=[a,e,i,"".concat(t,"px"),r].join(" "),vw.measureText(n).width},function(t,e){return[We(t)?t:t.style.text.toString(),Object.values(e||Mw(t)).join()].join("")}),Mw=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 kw(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function Ow(t,e){t=kw(t);t&&t.attr(e)}function Ew(t,e,n){Ow(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n=void 0===n?"...":n})}function Sw(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 Aw(t){return"function"==typeof t?t():We(t)||He(t)?new cw({style:{text:String(t)}}):t}function _w(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 Tw(t,e,n,r,i){return(r=void 0===r?!0:r)&&t===e||i&&t===n||e<t&&t<n}var Pw=function(e,n){return function(t){return e*(1-t)+n*t}};function Cw(e,t){var i,a,o,s,n,r,l;return"number"==typeof e&&"number"==typeof t?Pw(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]=Cw(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=j(t,2),e=t[0],t=t[1];e in n?r[e]=Cw(n[e],t):l[e]=t}),function(n){return Object.entries(r).forEach(function(t){var t=j(t,2),e=t[0],t=t[1];return l[e]=t(n)}),l}):function(t){return e}}function Lw(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=j([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 dw(e,n,r-e,i-n)}function Nw(n,t,e){function r(t){var e=j(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=j([0,0],2))[0],d=s[1],e=Lw(o=t.map(function(t){var e=t.width,t=t.height,n=j([f,d],2),r=n[0],n=n[1],i=j([f+e*h[0],d+t*h[1]],2);return f=i[0],d=i[1],new dw(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 Lw(s=o.map(function(t){var e=t.x,n=t.y,t=dw.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=dw.fromRect(t);return t.x=u?e:e+r(t),t.y=u?n+r(t):n,t}).map(function(t){var e,t=dw.fromRect(t);return t.x+=null!=(e=n.x)?e:0,t.y+=null!=(e=n.y)?e:0,t})}function jw(t,e,n){return[]}function Rw(t,e){return[t[0]*e,t[1]*e]}function Iw(t,e){return[t[0]+e[0],t[1]+e[1]]}function Bw(t,e){return[t[0]-e[0],t[1]-e[1]]}function Dw(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function Fw(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function zw(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function Ww(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 Gw(t,e){e=Math.pow(10,e);return~~(t*e)/e}function Hw(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 Vw(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=j(r,2))[0],l=r[1];for(var c=0,u=t.length;c<u;c+=1)s=Dw(s,x=t[c]),l=Fw(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=Rw(m=Bw(d=t[n?(c+1)%h:c+1],f),e),0!==(y=(p=zw(x,f))+(g=zw(x,d)))&&(p/=y,g/=y),y=Rw(m,-p),m=Rw(m,g),v=Iw(x,y),b=Dw(b=Iw(x,m),Fw(d,x)),b=Fw(b,Dw(d,x)),v=Dw(v=Iw(x,y=Rw(y=Bw(b,x),-p/g)),Fw(f,x)),b=Iw(x,m=Rw(m=Bw(x,v=Fw(v,Dw(f,x))),g/p)),o&&(v=Dw(v=Fw(v,s),l),b=Dw(b=Fw(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=j(r,1)[0],h.push(["C",o[0],o[1],s[0],s[1],l[0],l[1]])),h}var Yw=["$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 qw(t){var e,n,r={};for(e in t)n=e,Yw.includes(n)&&(r[e]=t[e]);return r}function $w(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=j(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,Uw,"m",Xw).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,Uw,"m",Xw).call(this,"."===t[0]?t:".".concat(t),e);return e.attr("className",t),e},M.prototype.maybeAppendByName=function(t,e){e=B(this,Uw,"m",Xw).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=e0(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=k(k([],j(this._elements),!1),j(t._elements),!1),t=k(k([],j(this._transitions),!1),j(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=j(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,k([this._parent,this],j(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},Uw=new WeakSet,Xw=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:hc,rect:Lc,circle:nc,path:kc,text:cw,ellipse:lc,image:mc,line:xc,polygon:Sc,polyline:Tc,html:pc};var Uw,Xw,Kw=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=[]),Uw.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 Kw([t],null,t,t.ownerDocument)}function Zw(t,e,n){return t.querySelector(e)?x(t).select(e):x(t).append(n)}function Qw(t){if(He(t))return[t,t,t,t];if(je(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 Jw(t){var t=t.getLocalBounds(),t=j([t.min,t.max],2),e=j(t[0],2),n=e[0],e=e[1],t=j(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 tM(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function eM(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=j(t,2),n=t[0],t=t[1];"className"!==n&&"class"!==n&&(n.startsWith("show")&&eM(n,"show").startsWith(r)!==i?n===(e=r,"".concat("show").concat(tM(e)))?a[n]=t:a[n.replace(new RegExp(tM(r)),"")]=t:n.startsWith("show")||n.startsWith(r)===i||"filter"===(e=eM(n,r))&&"function"==typeof t||(a[e]=t))}),a}function nM(t,r){return Object.entries(t).reduce(function(t,e){var e=j(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(tM(n))]=e,t},{})}function rM(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=j(t,2),e=t[0],t=t[1];n.includes(e)||(-1!==r.indexOf(e)?a[e]=t:i[e]=t)}),[i,a]}function iM(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=j([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(oM,aM=ac),Object.defineProperty(oM.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=sw(this)),this._offscreen},enumerable:!1,configurable:!0}),Object.defineProperty(oM.prototype,"defaultOptions",{get:function(){return this._defaultOptions},enumerable:!1,configurable:!0}),oM.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this),this.initialized=!0},oM.prototype.disconnectedCallback=function(){var t;null!=(t=this._offscreen)&&t.destroy()},oM.prototype.attributeChangedCallback=function(t){"visibility"===t&&!function(){rw(this,"hidden"!==this.attributes.visibility)}.call(this)},oM.prototype.update=function(t,e){return this.attr(mw({},this.attributes,t=void 0===t?{}:t)),null==(t=this.render)?void 0:t.call(this,this.attributes,this,e)},oM.prototype.clear=function(){this.removeChildren()},oM.prototype.bindEvents=function(t,e){};var aM,Es=oM;function oM(t,e){t=aM.call(this,mw({},{style:e=void 0===e?{}:e},t))||this;return t.initialized=!1,t._defaultOptions=e,t}function sM(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 lM(t,e,n){return[["M",t,e+n],["L",t,e-n]]}function cM(t,e,n){return[["M",t-n,e],["L",t+n,e]]}Fs=sM,zs=cM;function uM(t){n="default",Re(e=t)&&e instanceof Image?n="image":Ce(e)?n="symbol":We(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(dM,hM=Es),dM.prototype.render=function(t,e){var r=t.symbol,n=t.size,i=void 0===n?16:n,a=at(t,["symbol","size"]),o=uM(r);_w(!!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=Ce(r)?r:dM.getSymbol(r),t.styles(m({path:null==n?void 0:n(0,0,e)},a)))})})},dM.MARKER_SYMBOL_MAP=new Map,dM.registerSymbol=function(t,e){dM.MARKER_SYMBOL_MAP.set(t,e)},dM.getSymbol=function(t){return dM.MARKER_SYMBOL_MAP.get(t)};var hM,fM=dM;function dM(){return null!==hM&&hM.apply(this,arguments)||this}fM.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]]}),fM.registerSymbol("hyphen",function(t,e,n){return[["M",t-n,e],["L",t+n,e]]}),fM.registerSymbol("line",lM),fM.registerSymbol("plus",function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]}),fM.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]]}),fM.registerSymbol("circle",sM),fM.registerSymbol("point",Fs),fM.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"]]}),fM.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"]]}),fM.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"]]}),fM.registerSymbol("diamond",function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]}),fM.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"]]}),fM.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"]]}),fM.registerSymbol("line",lM),fM.registerSymbol("dot",cM),fM.registerSymbol("dash",zs),fM.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]]}),fM.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]]}),fM.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]]}),fM.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]]}),fM.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(yM,pM=Jl),yM.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()})},yM.prototype.update=function(t){this.attr(mw({},this.attributes,t)),this.render()},yM.prototype.clear=function(){this.removeChildren()};var pM,gM=yM;function yM(t){var e=this,n=t.style,t=at(t,["style"]);return(e=pM.call(this,ot({},{type:"column"},m({style:n},t)))||this).columnsGroup=new hc({name:"columns"}),e.appendChild(e.columnsGroup),e.render(),e}t(bM,mM=Jl),bM.prototype.render=function(){var t=this.attributes,e=t.lines,t=t.areas;e&&this.renderLines(e),t&&this.renderAreas(t)},bM.prototype.clear=function(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()},bM.prototype.update=function(t){this.attr(mw({},this.attributes,t)),this.render()},bM.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()})},bM.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 mM,vM=bM;function bM(t){var e=this,n=t.style,t=at(t,["style"]);return(e=mM.call(this,ot({},{type:"lines"},m({style:n},t)))||this).linesGroup=e.appendChild(new hc),e.areasGroup=e.appendChild(new hc),e.render(),e}function xM(t,e){var n=(e=void 0===e?!1:e)?t.length-1:0,t=t.map(function(t,e){return k([e===n?"M":"L"],j(t),!1)});return e?t.reverse():t}function wM(t,e){if(void 0===e&&(e=!1),t.length<=2)return xM(t);for(var n=[],r=t.length,i=0;i<r;i+=1){var a=e?t[r-i-1]:t[i];on(a,n.slice(-2))||n.push.apply(n,k([],j(a),!1))}var o=Vw(n,!1);return e?o.unshift(k(["M"],j(t[r-1]),!1)):o.unshift(k(["M"],j(t[0]),!1)),o}function MM(t,e,n){t=Qe(t);return t.push(["L",e,n],["L",0,n],["Z"]),t}function kM(t){return 0===t.length?[0,0]:[Fe(function(t,e){if(je(t)){for(var n,r=1/0,i=0;i<t.length;i++){var a=t[i],o=Ce(e)?e(a):a[e];o<r&&(n=a,r=o)}return n}}(t,function(t){return Fe(t)||0})),De(function(t,e){if(je(t)){for(var n,r=-1/0,i=0;i<t.length;i++){var a=t[i],o=Ce(e)?e(a):a[e];r<o&&(n=a,r=o)}return n}}(t,function(t){return De(t)||0}))]}function OM(t){for(var e=Qe(t),n=e[0].length,t=j([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(AM,EM=Es),Object.defineProperty(AM.prototype,"rawData",{get:function(){var t=this.attributes.data;return t&&0!==(null==t?void 0:t.length)?(t=Qe(t),He(t[0])?[t]:t):[[]]},enumerable:!1,configurable:!0}),Object.defineProperty(AM.prototype,"data",{get:function(){return this.attributes.isStack?OM(this.rawData):this.rawData},enumerable:!1,configurable:!0}),Object.defineProperty(AM.prototype,"scales",{get:function(){return this.createScales(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(AM.prototype,"baseline",{get:function(){var t=this.scales.y,e=j(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(AM.prototype,"containerShape",{get:function(){var t=this.attributes;return{width:t.width,height:t.height}},enumerable:!1,configurable:!0}),Object.defineProperty(AM.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=j(s.getOptions().range||[0,0],2))[0],c=u[1],l<c&&(u=j([l,c],2),c=u[0],l=u[1]),a=e.map(function(t){return t.map(function(t,e){return[o.map(e),Ge(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=wM(o),l=void 0,l=0===i?MM(s,e,n):(a=wM(t[i-1],!0),o=o[0],a[0][0]="L",k(k(k([],j(s),!1),j(a),!1),[k(["M"],j(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=xM(t[i]),s=void 0,s=0===i?MM(o,e,n):((a=xM(t[i-1],!0))[0][0]="L",k(k(k([],j(o),!1),j(a),!1),[["Z"]],!1));r.push(s)}return r})(a,t,e):(h=i,f=t,d=e,a.map(function(t){return MM((h?wM:xM)(t),f,d)}))),{lines:a.map(function(t,e){return m({stroke:n.getColor(e),path:(i?wM:xM)(t)},g)}),areas:u.map(function(t,e){return m({path:t,fill:n.getColor(e)},p)})})},enumerable:!1,configurable:!0}),Object.defineProperty(AM.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=OM(s));var e=this.createScales(s),l=e.x,c=e.y,e=j(kM(s),2),n=e[0],e=e[1],u=new eb({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}),AM.prototype.render=function(t,e){this.container=Zw(e,".container","rect").attr("className","container").node();var n=t.type,r="spark".concat(n),i="line"===n?this.linesStyle:this.columnsStyle;this.spark=Zw(e,".".concat(r),function(){return new("line"===n?vM:gM)({className:r,style:i})}).styles(i).node()},AM.prototype.getColor=function(t){var e=this.attributes.color;return je(e)?e[t%e.length]:Ce(e)?e.call(null,t):e},AM.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=j(kM(t),2),c=l[0],l=l[1],c=new eb({domain:[null!=(e=i[0])?e:c,null!=(e=i[1])?e:l],range:[o,0]});return"line"===r?{type:r,x:new eb({domain:[0,t[0].length-1],range:[0,s]}),y:c}:{type:r,x:new Hv({domain:t[0].map(function(t,e){return e}),range:[0,s],paddingInner:a?n:0}),y:c}},AM.tag="sparkline";var EM,SM=AM;function AM(t){return EM.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 _M(n){var e,r;return n?(e=["enter","update","exit"],r=Object.fromEntries(Object.entries(n).filter(function(t){t=j(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 TM(t,e){t?t.finished.then(e):e()}function PM(t,e){"update"in t?t.update(e):t.attr(e)}function CM(t,e,n){return 0===e.length?null:n?t.animate(e,n):(PM(t,{style:e.slice(-1)[0]}),null)}function LM(r,t,e){var i={},a={};return Object.entries(t).forEach(function(t){var e,t=j(t,2),n=t[0],t=t[1];A(t)||(e=r.style[n]||r.parsedStyle[n]||0)!==t&&(i[n]=e,a[n]=t)}),e?CM(r,[i,a],m({fill:"both"},e)):(PM(r,a),null)}function NM(t,e){return t.style.opacity||(t.style.opacity=1),LM(t,{opacity:0},e)}var jM,RM={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},IM={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},BM={orientation:"horizontal",showLabel:!0,type:"start"},DM=yw({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track"},"slider"),FM=yw({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),zM=(t(WM,jM=Es),WM.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(FM.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(FM.iconLine,"-1"),"line").styles(m({x1:o,x2:o,y1:l,y2:c},t)),r.maybeAppendByClassName("".concat(FM.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)},WM);function WM(){return null!==jM&&jM.apply(this,arguments)||this}t(VM,GM=Es),VM.prototype.renderLabel=function(t){var e=this,n=this.attributes.showLabel,r=w(this.attributes,"label"),i=r.transform,r=j(rM(at(r,["transform"]),[]),2),a=r[0],r=r[1],t=x(t).maybeAppendByClassName(FM.labelGroup,"g").styles(r),r=m(m({},IM),a),o=r.text,s=at(r,["text"]);_w(!!n,t,function(t){e.label=t.maybeAppendByClassName(FM.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()})})},VM.prototype.renderIcon=function(t){var e=this.attributes.orientation,n=m(m({orientation:e},RM),w(this.attributes,"icon")),e=this.attributes.iconShape,r=void 0===e?function(){return new zM({style:n})}:e;x(t).maybeAppendByClassName(FM.iconGroup,"g").selectAll(FM.icon.class).data([r]).join(function(t){return t.append(r).attr("className",FM.icon.name)},function(t){return t.update(n)},function(t){return t.remove()})},VM.prototype.render=function(t,e){this.renderIcon(e),this.renderLabel(e)};var GM,HM=VM;function VM(t){return GM.call(this,t,BM)||this}t($M,YM=Es),Object.defineProperty($M.prototype,"values",{get:function(){return this.attributes.values},set:function(t){this.attributes.values=this.clampValues(t)},enumerable:!1,configurable:!0}),Object.defineProperty($M.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($M.prototype,"shape",{get:function(){var t=this.attributes,e=t.trackLength,t=t.trackSize,t=j(this.getOrientVal([[e,t],[t,e]]),2);return{width:t[0],height:t[1]}},enumerable:!1,configurable:!0}),Object.defineProperty($M.prototype,"availableSpace",{get:function(){var t=j(Qw(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}),$M.prototype.getValues=function(){return this.values},$M.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;LM(this.selectionShape.node(),this.selectionStyle,t),this.updateHandlesPosition(t)},$M.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(LM(this.startHandle,this.getHandleStyle("start"),t),LM(this.endHandle,this.getHandleStyle("end"),t))},$M.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)},$M.prototype.renderTrack=function(t){var e=this.attributes.brushable,n=w(this.attributes,"track");this.trackShape=x(t).maybeAppendByClassName(DM.track,"rect").styles(m(m({cursor:e?"crosshair":"default"},this.shape),n))},$M.prototype.renderSparkline=function(t){var n=this;_w("horizontal"===this.attributes.orientation,x(t).maybeAppendByClassName(DM.sparklineGroup,"g"),function(t){var e=n.sparklineStyle;t.maybeAppendByClassName(DM.sparkline,function(){return new SM({style:e})}).update(e)})},Object.defineProperty($M.prototype,"selectionStyle",{get:function(){var t=w(this.attributes,"selection");return m(m({},t),this.calcMask())},enumerable:!1,configurable:!0}),$M.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(DM.handle.class).data(n,function(t){return t.type}).join(function(t){return t.append(function(t){t=t.type;return new HM({style:e.getHandleStyle(t)})}).each(function(t){var e=t.type,t=(this.attr("class","".concat(DM.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()})},$M.prototype.renderSelection=function(t){this.foregroundGroup=x(t).maybeAppendByClassName(DM.foreground,"g"),this.selectionShape=this.foregroundGroup.maybeAppendByClassName(DM.selection,"rect").styles(this.selectionStyle),this.renderHandles()},$M.prototype.render=function(t,e){this.renderTrack(e),this.renderSparkline(e),this.renderSelection(e)},$M.prototype.clampValues=function(t,e){void 0===e&&(e=4);var n=j(this.range,2),r=n[0],n=n[1],i=j(this.getValues().map(function(t){return Gw(t,e)}),2),a=i[0],i=i[1],t=j((t||[a,i]).map(function(t){return Gw(t,e)}),2),o=t[0],t=t[1],s=(t<o&&(o=(s=j([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]},$M.prototype.calcMask=function(t){var t=j(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}])},$M.prototype.calcHandlePosition=function(t){var e=this.availableSpace,n=e.x,r=e.y,i=e.width,e=e.height,a=j(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])}},$M.prototype.inferTextStyle=function(t){return"horizontal"===this.attributes.orientation?{}:"start"===t?{transform:"rotate(90)",textAlign:"start"}:"end"===t?{transform:"rotate(90)",textAlign:"end"}:{}},$M.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 cw({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)},$M.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))):{}},$M.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)},$M.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({},nM(this.getHandleIconStyle(),"icon")),nM(m(m({},this.getHandleLabelStyle(t)),i),"label")),r),{orientation:e,showLabel:n,type:t,zIndex:3})},$M.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)},$M.prototype.getOrientVal=function(t){var t=j(t,2),e=t[0],t=t[1];return"horizontal"===this.attributes.orientation?e:t},$M.prototype.setValuesOffset=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=!1);var r=j(this.getValues(),2),t=[r[0]+t,r[1]+e].sort();n?this.setValues(t):this.innerSetValues(t,!0)},$M.prototype.getRatio=function(t){var e=this.availableSpace,n=e.width,e=e.height;return t/this.getOrientVal([n,e])},$M.prototype.dispatchCustomEvent=function(t,e,n){var r=this;t.on(e,function(t){t.stopPropagation(),r.dispatchEvent(new pl(n,{detail:t}))})},$M.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"))},$M.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))},$M.tag="slider";var YM,qM=$M;function $M(t){var a=YM.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]},nM(BM,"handle")),nM(RM,"handleIcon")),nM(IM,"handleLabel")))||this;return a.range=[0,1],a.onDragStart=function(i){return function(t){t.stopPropagation(),a.target=i,a.prevPos=a.getOrientVal(Sw(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(Sw(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 pl("valuechange",{detail:{oldValue:t,value:a.getValues()}});a.dispatchEvent(t)},a.selectionStartPos=0,a.selectionWidth=0,a.prevPos=0,a.target="",a}t(KM,UM=Es),Object.defineProperty(KM.prototype,"padding",{get:function(){return Qw(this.attributes.padding)},enumerable:!1,configurable:!0}),Object.defineProperty(KM.prototype,"value",{get:function(){var t=this.attributes.value,e=j(this.range,2),n=e[0],e=e[1];return Ge(t,n,e)},enumerable:!1,configurable:!0}),Object.defineProperty(KM.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(KM.prototype,"availableSpace",{get:function(){var t=this.attributes.trackSize,e=this.trackLength,n=j(this.padding,4),r=n[0],i=n[1],a=n[2],n=n[3],t=j(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(KM.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(KM.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}),KM.prototype.getValues=function(t){void 0===t&&(t=this.value);var e=this.attributes,e=e.viewportLength/e.contentLength,n=j(this.range,2),r=n[0],t=t*(n[1]-r-e);return[t,t+e]},KM.prototype.getValue=function(){return this.value},KM.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()},nM(a,"track")),nM(o,"selection"));this.slider=x(t).maybeAppendByClassName("scrollbar",function(){return new qM({style:s})}).update(s).node()},KM.prototype.render=function(t,e){this.renderSlider(e)},KM.prototype.setValue=function(t,e){void 0===e&&(e=!1);var n=this.attributes.value,r=j(this.range,2),i=r[0],r=r[1];this.slider.setValues(this.getValues(Ge(t,i,r)),e),this.onValueChange(n)},KM.prototype.bindEvents=function(){var e=this;this.slider.addEventListener("trackClick",function(t){t.stopPropagation(),e.onTrackClick(t.detail)}),this.onHover()},KM.prototype.getOrientVal=function(t){return"horizontal"===this.attributes.orientation?t[0]:t[1]},KM.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)},KM.tag="scrollbar";var UM,XM=KM;function KM(t){var a=UM.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 pl("scroll",t={detail:{oldValue:t,value:e}})),a.dispatchEvent(new pl("valuechange",t)))},a.onTrackClick=function(t){var e,n,r,i;a.attributes.slidable&&(r=(e=j(a.getLocalPosition(),2))[0],e=e[1],n=(i=j(a.padding,4))[0],i=i[3],r=a.getOrientVal([r+i,e+n]),i=(a.getOrientVal(Sw(t))-r)/a.trackLength,a.setValue(i,!0))},a.onThumbMouseenter=function(t){a.dispatchEvent(new pl("thumbMouseenter",{detail:t.detail}))},a.onTrackMouseenter=function(t){a.dispatchEvent(new pl("trackMouseenter",{detail:t.detail}))},a.onThumbMouseleave=function(t){a.dispatchEvent(new pl("thumbMouseleave",{detail:t.detail}))},a.onTrackMouseleave=function(t){a.dispatchEvent(new pl("trackMouseleave",{detail:t.detail}))},a}var ZM={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 kc({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:[]},QM=(ot({},ZM,{style:{type:"arc"}}),ot({},ZM,{style:{}}),yw({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")),JM=yw({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function tk(t){return t.reduce(function(t,e,n){return t.push(k([0===n?"M":"L"],j(e),!1)),t},[])}function ek(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)?tk(r):e?(i=zw(r[0],e),a=n?0:1,r.reduce(function(t,e,n){return 0===n?t.push(k(["M"],j(e),!1)):t.push(k(["A",i,i,0,0,a],j(e),!1)),t},[])):[]):tk(t)}function nk(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=j([ek(t,n),ek(e.slice().reverse(),n,!0)],2),l=n[0],c=n[1],n=j([t[0],e.slice(-1)[0]],2),t=n[0],e=n[1];if("line"===a||"surround"===i)return r([k(["L"],j(e),!1)],[k(["L"],j(t),!1)]);if(o)return a=(n=j([zw(e,o),zw(t,o)],2))[0],i=n[1],r([k(["A",a,a,0,0,1],j(e),!1),k(["L"],j(e),!1)],[k(["A",i,i,0,0,0],j(t),!1),k(["L"],j(t),!1)]);throw new Error("Arc grid need to specified center")}function rk(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=j([e[l].points,e[l+1].points],2),c=nk(c[0],c[1],n);s.push({path:c,fill:o[l%o.length]})}return t.selectAll(JM.region.class).data(s,function(t,e){return e}).join(function(t){return t.append("path").each(function(t,e){t=gw(t,[t,e,s]);this.attr(t)}).attr("className",JM.region.name)},function(t){return t.transition(function(t,e){return LM(this,gw(t,[t,e,s]),r.update)})},function(t){return t.transition(function(){var t=this,e=NM(this,r.exit);return TM(e,function(){return t.remove()}),e})}).transitions()}t(ok,ik=Es),ok.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=j(e,1)[0];return m(m({},t),{points:k(k([],j(e),!1),[n],!1)})}):s),l=x(e).maybeAppendByClassName(JM.lineGroup,"g"),e=x(e).maybeAppendByClassName(JM.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:ek(t.points,n)}}),l.selectAll(JM.line.class).data(a,function(t){return t.id}).join(function(t){return t.append("path").each(function(t,e){t=gw(qw(m({path:t.path},r)),[t,e,a]);this.attr(m({class:JM.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4]},t))})},function(t){return t.transition(function(t,e){return LM(this,gw(qw(m({path:t.path},r)),[t,e,a]),i.update)})},function(t){return t.transition(function(){var t=this,e=NM(this,i.exit);return TM(e,function(){return t.remove()}),e})}).transitions()),l=rk(e,s,t);return k(k([],j(o),!1),j(l),!1)};var ik,ak=ok;function ok(){return null!==ik&&ik.apply(this,arguments)||this}function sk(t,e){return Object.fromEntries(Object.entries(t).map(function(t){t=j(t,2);return[t[0],gw(t[1],e)]}))}function lk(t,e){return e&&Ce(e)?t.filter(e):t}var ck=tn(function(t,e){var n=e.startAngle;return(e.endAngle-n)*t+n},function(t,e){return[t,e.startAngle,e.endAngle].join()}),uk=tn(function(t,e){var n,r,i;return"linear"===e.type?(r=(n=j(e.startPos,2))[0],n=n[1],i=j(e.endPos,2),Ww([(r=j([i[0]-r,i[1]-n],2))[0],r[1]])):(i=hw(ck(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,k(k([],j(a),!1),j(r),!1)):(a=n.startAngle,r=n.endAngle,i=n.center,n=n.radius,k(k([a,r],j(i),!1),[n],!1));return"arc"===e.type&&a.push(t),a.join()});function hk(t,e,n){t=uk(t,n);return n=t,"positive"!==e?[n[1],-n[0]]:[-n[1],n[0]]}function fk(t,e){return hk(t,e.labelDirection,e)}var dk=tn(function(t,e){var n=j(e.startPos,2),r=n[0],n=n[1],e=j(e.endPos,2),e=j([e[0]-r,e[1]-n],2);return[r+e[0]*t,n+e[1]*t]},function(t,e){return k(k([t],j(e.startPos),!1),j(e.endPos),!1).join()}),pk=tn(function(t,e){var n=e.radius,r=j(e.center,2),i=r[0],r=r[1],t=hw(ck(t,e));return[i+n*Math.cos(t),r+n*Math.sin(t)]},function(t,e){return k([t,e.startAngle,e.endAngle,e.radius],j(e.center),!1).join()});function gk(t,e){return("linear"===e.type?dk:pk)(t,e)}function yk(t){return 0===uk(0,t)[1]}function mk(t){return 0===uk(0,t)[0]}function vk(t,e){return e-t==360}function bk(t,e,n,r,i){function a(t){return[n+i*Math.cos(t),r+i*Math.sin(t)]}var o=e-t,s=j([i,i],2),l=s[0],s=s[1],c=j([hw(t),hw(e)],2),u=c[0],c=c[1],h=j(a(u),2),f=h[0],h=h[1],d=j(a(c),2),p=d[0],d=d[1];return vk(t,e)?[["M",f,h],["A",l,s,0,1,0,(c=j(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 xk(t,e,n,s){var l=e.startAngle,c=e.endAngle,u=e.center,h=e.radius;return t.selectAll(QM.line.class).data([{path:bk.apply(void 0,k(k([l,c],j(u),!1),[h],!1))}],function(t,e){return e}).join(function(t){return t.append("path").attr("className",QM.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=k(k([o,e],j(n),!1),[i],!1),e=k(k([l,c],j(u),!1),[h],!1),(n=s.update)?(i=void 0===(i=n.duration)?0:i,r=Cw(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=sn(a.attributes,"__keyframe_data__");a.style.path=bk.apply(void 0,k([],j(t),!1))},o.onfinish=i),o}).styles(e)},function(t){return t.remove()}).styles(n).transitions()}function wk(t){var t=j(t,2),e=j(t[0],2),n=e[0],e=e[1],t=j(t[1],2);return{x1:n,y1:e,x2:t[0],y2:t[1]}}function Mk(e,t,n,r){function i(t){return e.selectAll(QM.line.class).data(t,function(t,e){return e}).join(function(t){return t.append("line").attr("className",function(t){return"".concat(QM.line.name," ").concat(t.className)}).styles(n).transition(function(t){return LM(this,wk(t.line),!1)})},function(t){return t.styles(n).transition(function(t){return LM(this,wk(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=j([c,u],2),p=j(d[0],2),g=p[0],p=p[1],d=j(d[1],2),y=d[0],d=d[1],u=j(f?(c=j([c=c,u=u,f=void 0===(f=f)?[0,0]:f],3),f=(u=j(c[0],2))[0],u=u[1],m=(a=j(c[1],2))[0],a=a[1],v=(c=j(c[2],2))[0],c=c[1],f=(m=j([m-f,a-u],2))[0],a=m[1],u=Math.sqrt(Math.pow(f,2)+Math.pow(a,2)),v=(m=j([-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=j(h,2))[0],l=a[1],o=(u=j([g+(h=y-g)*u,p+(s=d-p)*u],2))[0],u=u[1],s=(h=j([g+h*l,p+s*l],2))[0],l=h[1],h=i([{line:[[g+m,p+v],[o,u]],className:QM.lineFirst.name},{line:[[s,l],[y+f,d+c]],className:QM.lineSecond.name}]),t.truncRange,t.truncShape,t.lineExtension,h):i([{line:[[g+m,p+v],[y+f,d+c]],className:QM.line.name}])}function kk(t,e,n){var r,i,a,o,s,l=e.type,c=w(e,"line"),n=("linear"===l?Mk:xk)(t,e,Hw(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(QM.lineSecond.class):t.select(QM.line.class),!r||!a||"arc"===e.type&&vk(e.startAngle,e.endAngle)?(i=l.node())&&(i.style.markerEnd=void 0):((t=Aw(a)).attr(c),$w(t,s,!0),l.style("markerEnd",t).style("markerEndOffset",-o)),n}function Ok(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function Ek(t,i){var a=i.gridLength;return t.map(function(t,e){var t=t.value,n=j(gk(t,i),2),r=n[0],n=n[1],t=j(Rw(hk(t,i.gridDirection,i),a),2);return{id:e,points:[[r,n],[r+t[0],n+t[1]]]}})}function Sk(t,e,n,r){var i=w(n,"grid"),a=i.type,o=i.areaFill,s=Ok(n),l=lk(e,n.gridFilter),e=("segment"===a?Ek:function(t,o){var s,l,c=o.gridControlAngles,e=Ok(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=j(e,2),s=e[0],l=e[1],t.map(function(t,e){var t=j(gk(t.value,o),2),n=t[0],t=t[1],n=j([n-s,t-l],2),r=n[0],i=n[1],a=[];return c.forEach(function(t){var t=hw(t),t=j([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:Ce(o)?l.map(function(t,e){return gw(o,[t,e,l])}):o,animate:r,data:e});return t.selectAll(QM.grid.class).data([1]).join(function(t){return t.append(function(){return new ak({style:c})}).attr("className",QM.grid.name)},function(t){return t.transition(function(){return this.update(c)})},function(t){return t.remove()}).transitions()}Object.defineProperty(_k.prototype,"left",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(_k.prototype,"top",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(_k.prototype,"right",{get:function(){return this.x2},enumerable:!1,configurable:!0}),Object.defineProperty(_k.prototype,"bottom",{get:function(){return this.y2},enumerable:!1,configurable:!0}),Object.defineProperty(_k.prototype,"width",{get:function(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(_k.prototype,"height",{get:function(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0},enumerable:!1,configurable:!0}),_k.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]]},_k.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},_k.prototype.defined=function(t){return this[t]!==Number.MAX_VALUE&&this[t]!==-Number.MAX_VALUE};var Ak=_k;function _k(t,e,n,r){this.set(t,e,n,r)}function Tk(t,e){var n=t.getEulerAngles()||0,r=(t.setEulerAngles(0),t.getLocalBounds()),i=j(r.min,2),a=i[0],i=i[1],r=j(r.max,2),o=r[0],r=r[1],s=Pk(t),l=s.width,s=s.height,c=0,u=0,h=a,f=i,d=kw(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)),j(Qw(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 Ak((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(hw(n),h,f)}function Pk(t){return t.__bbox__||t.getBBox()}function Ck(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 Lk(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 Nk(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=Lk((r=f)[0],r[1],i[0]),o=Lk(r[0],r[1],i[1]),s=Lk(i[0],i[1],r[0]),l=Lk(i[0],i[1],r[1]),a!==o&&s!==l||0===a&&Ck(r,i[0])||0===o&&Ck(r,i[1])||0===s&&Ck(i,r[0])||!(0!==l||!Ck(i,r[1]))){if(0===Lk(f[0],e,f[1]))return Ck(f,e);u++}}while(0!==(h=(h+1)%n));return!!(1&u)}function jk(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=Tk(e,n);return r=o,a.every(function(t){return Nk(r,t)})}function Rk(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=j(e=c,4))[0],r=e[1],i=e[2],e=e[3],a=(t=j(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 Ik(t,e,l){function n(t,e){if(t){var n,r,i=Qw(l),t=Tk(t,i).flat(1),a=Tk(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(Rk(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=j(f,2))[0],f=f[1],a=-h-(d="negative"===d?0:p),h=h+d,o=(d=j(Qw(y),4))[0],s=d[1],c=d[2],d=d[3],new Ak(u+a-d,f+a-o,u+h+s,f+h+c)):(a=(d=j(e.startPos,2))[0],o=d[1],s=(u=j(e.endPos,2))[0],f=u[1],c=(h=j(mk(e)?[-y,0,y,0]:[0,y,0,-y],4))[0],d=h[1],u=h[2],y=h[3],h=Rw(fk(0,e),p),(e=new Ak(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&&!jk(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 Bk(t,e){return void 0===e&&(e={}),A(t)?0:"number"==typeof t?t:Math.floor(ww(t,e))}var Dk=function(t,e){var e=e.seq,n=void 0===e?2:e;return t.filter(function(t,e){return!(e%n&&(nw(t),1))})};var Fk=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=Dk,f=function(t){return t.forEach(r.show),t},d=2,p=t.slice(),g=t.slice(),y=Math.min.apply(Math,k([1],j(t.map(function(t){return Pk(t).width})),!1));for("linear"===n.type&&(yk(n)||mk(n))&&(s=Jw(t[0]).left,l=Jw(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&&Ik((u?k(k([u],j(g),!1),[c],!1):k([c],j(g),!1)).filter(xw),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),Ik(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=Mw(r.getTextShape(t[0])),c=Bk(s,e),u=a?Bk(a,e):c,s=Bk(o,e),h=(!A(s)&&s!==1/0||(s=Math.max.apply(null,t.map(function(t){return Pk(t).width}))),t.slice()),f=((a=j(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=Ik(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,k([],j(e),!1)),d=(o=(a=n).type,s=a.labelDirection,"linear"===o&&yk(a)?"negative"===s?"bottom":"top":"middle");if(!(c<f)){for(var p=f;p<=c;p++)if(i(p),Ik(t,n,h).length<1)return;u&&i(e)}}]]);function zk(r,i,a){var t=i.labelOverlap,t=void 0===t?[]:t;t.length&&t.forEach(function(t){var e=t.type,n=Fk.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 Wk(t){for(var e=t;e<0;)e+=360;return Math.round(e%360)}var Gk=tn(function(t,e){var t=j(t,2),n=t[0],t=t[1],e=j(e,2),r=e[0],e=e[1],n=j([n*r+t*e,n*e-t*r],2),e=n[0],t=n[1];return Math.atan2(t,e)},function(t,e){return k(k([],j(t),!1),j(e),!1).join()});function Hk(t,e,n){var r,i=n.labelAlign;return(null==(r=e.style.transform)?void 0:r.includes("rotate"))?e.getLocalEulerAngles():(r=0,e=fk(t.value,n),t=uk(t.value,n),"horizontal"===i?0:(r="perpendicular"===i?Gk([1,0],e):Gk([t[0]<0?-1:1,0],t),Tw(n=((n=fw(r))+360)%180,-90,90)||(n+=180),n))}function Vk(t,e,n){var r=n.type,i=n.labelAlign,t=fk(t,n),n=Wk(e),e=Wk(fw(Gk([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?(Tw(n,0,90,!1,!0)||Tw(n,0,90)||Tw(n,270,360))&&(a="start"):90===e?Tw(n,0,90,!1,!0)?a="start":(Tw(n,90,180)||Tw(n,270,360))&&(a="end"):270===e?Tw(n,0,90,!1,!0)?a="end":(Tw(n,90,180)||Tw(n,270,360))&&(a="start"):180===e&&(90===n?a="start":(Tw(n,0,90)||Tw(n,270,360))&&(a="end")):a="center":"parallel"===i?o=Tw(e,0,180,!0)?"top":"bottom":"horizontal"===i?Tw(e,90,270,!1)?a="end":(Tw(e,270,360,!1)||Tw(e,0,90))&&(a="start"):"perpendicular"===i&&(a=Tw(e,90,270)?"end":"start"),{textAlign:a,textBaseline:o}}function Yk(t,e,n){var r=n.showTick,i=n.tickLength,a=n.tickDirection,o=n.labelDirection,s=n.labelSpacing,l=e.indexOf(t),s=gw(s,[t,l,e]),o=j([fk(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=j(Iw(Rw(o[0],s+(1===o[1]?gw(r?i:0,[t,l,e]):0)),gk(t.value,n)),2);return{x:a[0],y:a[1]}}function qk(t,e){"text"===t.nodeName&&t.attr(e)}function $k(r){zk(this.node().childNodes,r,{hide:nw,show:ew,rotate:function(t,e){var n;e=+e,n=r,(t=t).setLocalEulerAngles(e),e=Vk(t.__data__.value,e,n),(n=t.querySelector(QM.labelItem.class))&&qk(n,e)},ellipsis:function(t,e,n){void 0===e&&(e=1/0),t&&Ew(t,e,n)},wrap:function(t,e,n){var r;t&&Ow(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 Uk(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,Ce(c)?function(){return Aw(gw(c,[a,o,s,fk(a.value,l)]))}:function(){return Aw(a.label||"")})).attr("className",QM.labelItem.name).node(),r=j(rM(sk(r,[e,u,n])),2),u=r[0],n=r[1],r=n.transform,n=at(n,["transform"]),f=(iM(t,r),Hk(e,t,i));return t.setLocalEulerAngles(+f),qk(h,m(m({},Vk(e.value,f,i)),u)),iM(t,r),t.attr(n),h}function Xk(n,f,d,p){var t=lk(f,d.labelFilter),g=w(d,"label");return n.selectAll(QM.label.class).data(t,function(t,e){return e}).join(function(t){return t.append("g").attr("className",QM.label.name).transition(function(t){return Uk(this,t,f,g,d),this.attr(Yk(t,f,d)),this.__bbox__=t.bbox,null}).call(function(){return $k.call(n,d)})},function(t){return t.transition(function(t){var e,n,r,i,a,o,s,l,c=this.querySelector(QM.labelItem.class),u=Uk(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&&nw(e),n.isVisible()&&ew(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=j((l=function(t){var e,n;return"circle"===t.nodeName?(n=(e=j(t.getLocalPosition(),2))[0],e=e[1],[n-(n=t.attr("r")),e-n]):t.getLocalPosition()})(e),2))[0],h=h[1],l=j(l(n),2),l=(s=j([(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})),TM(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=LM(this,Yk(t,f,d),p.update);return this.__bbox__=t.bbox,k(k([],j(h),!1),[c],!1)}).call(function(t){var e,t=sn(t,"_transitions").flat().filter(xw);e=function(){return $k.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=NM(this.childNodes[0],p.exit);return TM(e,function(){return x(t).remove()}),e})}).transitions()}function Kk(t,e){return hk(t,e.tickDirection,e)}var Zk=tn(function(t,e){t=j(t,2);return[[0,0],[t[0]*e,t[1]*e]]},function(t,e){return k(k([],j(t),!1),[e],!1).join()});function Qk(t,e,n,r,i,a,o){var s=Kk(t.value,a),a=(c=t,u=e,h=n,l=s,a=(a=a).tickLength,l=j(Zk(l,gw(a,[c,u,h])),2),a=j(l[0],2),c=a[0],u=a[1],h=j(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=j(rM(sk(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 Jk(t,e,n,r,i,a){o=x(this),s=t,l=e,c=n,h=(u=r).tickFormatter,f=Kk(s.value,u),u="line",Ce(h)&&(u=function(){return gw(h,[s,l,c,f])});Qk(t,e,n,o.append(u).attr("className",QM.tickItem.name),this,r,i);var o,s,l,c,u,h,f,e=j(gk(t.value,r),2);return LM(this,{x:e[0],y:e[1]},a)}var tO=yw({text:"text"},"title");function eO(t){return/\S+-\S+/g.test(t)?t.split("-").map(function(t){return t[0]}):2<t.length?[t[0]]:t.split("")}function nO(r,t){t=Object.entries(t).reduce(function(t,e){var e=j(e,2),n=e[0],e=e[1];return r.node().attr(n)||(t[n]=e),t},{});r.styles(t)}t(aO,rO=Es),aO.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(tO.text.class);if(!a)return new dw(0,0,+r,+i);var a=a.getBBox(),o=a.width,s=a.height,a=j(Qw(n),4),l=a[0],c=a[1],u=a[2],h=a[3],n=j([0,0,+r,+i],4),f=n[0],d=n[1],p=n[2],g=n[3],a=eO(e);if(a.includes("i"))return new dw(f,d,p,g);a.forEach(function(t,e){var n;"t"===t&&(n=j(0===e?[s+u,+i-s-u]:[0,+i],2),d=n[0],g=n[1]),"r"===t&&(n=j([+r-o-h],1),p=n[0]),"b"===t&&(n=j([+i-s-l],1),g=n[0]),"l"===t&&(n=j(0===e?[o+c,+r-o-c]:[0,+r],2),f=n[0],p=n[1])});n=j(Qw(t),4),e=n[0],a=n[1],t=n[2],n=n[3],a=j([n+a,e+t],2),t=a[0],a=a[1];return new dw(f+n,d+e,p-t,g-a)},aO.prototype.getBBox=function(){return this.title?this.title.getBBox():new dw(0,0,0,0)},aO.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=j(rM(c),1)[0],h=(h=(t=t).width,r=t.height,t=t.position,i=j([+h/2,+r/2],2),a=(i=j([+i[0],+i[1],"center","middle"],4))[0],o=i[1],s=i[2],i=i[3],(t=eO(t)).includes("l")&&(a=(n=j([0,"start"],2))[0],s=n[1]),t.includes("r")&&(a=(n=j([+h,"end"],2))[0],s=n[1]),t.includes("t")&&(o=(h=j([0,"top"],2))[0],i=h[1]),t.includes("b")&&(o=(n=j([+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;_w(!!c.text,x(e),function(t){l.title=t.maybeAppendByClassName(tO.text,"text").styles(u).call(nO,{x:f,y:d,textAlign:p,textBaseline:g}).node()})};var rO,iO=aO;function aO(t){return rO.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 oO(t,e,n,r,i){var a,o,s,l,c,u,h,f,d=j(rM(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=(iM(t.node(),d),g=x(n._offscreen||n.querySelector(QM.mainGroup.class)),p=e,r=void 0===(r=(n=r).titlePosition)?"lb":r,a=n.titleSpacing,o=eO(r),g=g.node().getLocalBounds(),s=(l=j(g.min,2))[0],l=l[1],c=(g=j(g.halfExtents,2))[0],g=g[1],u=(p=j(p.node().getLocalBounds().halfExtents,2))[0],p=p[1],l=(s=j([s+c,l+g],2))[0],s=s[1],m=(a=j(Qw(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=j("start"===r?[y,n]:[n,y],2))[0],y=(r=j(Rw(Ww([-(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=LM(e.node(),{x:n,y:r},i);return iM(t.node(),d),m}function sO(e,t,o,s){var n=e.showLine,r=e.showTick,i=e.showLabel,n=_w(n,t.maybeAppendByClassName(QM.lineGroup,"g"),function(t){return kk(t,e,s)})||[],r=_w(r,t.maybeAppendByClassName(QM.tickGroup,"g"),function(t){return t=t,r=s,i=lk(o,(n=e).tickFilter),a=w(n,"tick"),t.selectAll(QM.tick.class).data(i,function(t){return t.id||t.label}).join(function(t){return t.append("g").attr("className",QM.tick.name).transition(function(t,e){return Jk.call(this,t,e,i,n,a,!1)})},function(t){return t.transition(function(t,e){return this.removeChildren(),Jk.call(this,t,e,i,n,a,r.update)})},function(t){return t.transition(function(){var t=this,e=NM(this.childNodes[0],r.exit);return TM(e,function(){return t.remove()}),e})}).transitions();var n,r,i,a})||[],i=_w(i,t.maybeAppendByClassName(QM.labelGroup,"g"),function(t){return Xk(t,o,e,s)})||[];return k(k(k([],j(n),!1),j(r),!1),j(i),!1).filter(function(t){return!!t})}t(uO,lO=Es),uO.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=_M(void 0===e?i:e),r=_w(l,x(t).maybeAppendByClassName(QM.gridGroup,"g"),function(t){return Sk(t,h,o,f)})||[],c=x(t).maybeAppendByClassName(QM.mainGroup,"g"),i=(n&&(!this.initialized&&f.enter||this.initialized&&f.update)&&sO(o,x(this.offscreenGroup),h,_M(!1)),sO(o,x(c.node()),h,f)),e=_w(a,x(t).maybeAppendByClassName(QM.titleGroup,"g"),function(t){return e=t,n=s,i=f,a=(r=o).titleText,e.selectAll(QM.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 Aw(a)}).attr("className",QM.title.name).transition(function(){return oO(x(this),e,n,r,i.enter)})},function(t){return t.transition(function(){return oO(x(this),e,n,r,i.update)})},function(t){return t.remove()}).transitions();var e,n,r,i,a})||[];return k(k(k([],j(r),!1),j(i),!1),j(e),!1).flat().filter(function(t){return!!t})};var lO,cO=uO;function uO(t){return lO.call(this,t,ZM)||this}var hO,fO=yw({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"),dO=(t(pO,hO=Es),Object.defineProperty(pO.prototype,"defaultPage",{get:function(){var t=this.attributes.defaultPage;return Ge(t,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(pO.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(pO.prototype,"controllerShape",{get:function(){return 1<this.totalPages?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(pO.prototype,"pageShape",{get:function(){var n,t=this.pageViews,t=j((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,k([],j(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}),pO.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(pO.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(pO.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),pO.prototype.getBBox=function(){var t=hO.prototype.getBBox.call(this),e=t.x,t=t.y,n=this.controllerShape,r=this.pageShape,i=r.pageWidth,r=r.pageHeight;return new dw(e,t,i+n.width,r)},pO.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=j(this.getFollowingPageDiff(t),2),o=i[0],r=i[1],this.playState="running",i=CM(a,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-o,", ").concat(-r,")")}],n);return TM(i,function(){e.innerCurrPage=t,e.playState="idle",e.setVisiblePages([t]),e.updatePageInfo()}),i},pO.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:Ge(n-1,0,e),this.goTo(t))},pO.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:Ge(n+1,0,e),this.goTo(t))},pO.prototype.renderClipPath=function(t){var e=this.pageShape,n=e.pageWidth,e=e.pageHeight;n&&e?(this.clipPath=t.maybeAppendByClassName(fO.clipPath,"rect").styles({width:n,height:e}),this.contentGroup.attr("clipPath",this.clipPath.node())):this.contentGroup.style.clipPath=void 0},pO.prototype.setVisiblePages=function(n){this.playWindow.children.forEach(function(t,e){(n.includes(e)?ew:nw)(t)})},pO.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,j("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=j(i.offset,3),o=j(a[0],2),s=o[0],c=o[1],l=j(a[1],2),r=l[0],o=l[1],l=j(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)},pO.prototype.updatePageInfo=function(){var t,e=this.currPage,n=this.pageViews,r=this.attributes.formatter;n.length<2||(null!=(t=this.pageInfoGroup.querySelector(fO.pageInfo.class))&&t.attr("text",r(e+1,n.length)),this.adjustControllerLayout())},pO.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])},pO.prototype.prepareFollowingPage=function(t){var e,n=this.currPage,r=this.pageViews;this.setVisiblePages([t,n]),t!==n&&(e=(n=j(this.getFollowingPageDiff(t),2))[0],n=n[1],r[t].setLocalPosition(e,n))},pO.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(fO.controller,"g");rw(t.node(),u),u&&(u=w(this.attributes,"button"),e=w(this.attributes,"pageNum"),i=(u=j(rM(u),2))[0],u=u[1],n=i.size,r=at(i,["size"]),i=!t.select(fO.prevBtnGroup.class).node(),a=t.maybeAppendByClassName(fO.prevBtnGroup,"g").styles(u),this.prevBtnGroup=a.node(),a=a.maybeAppendByClassName(fO.prevBtn,"path"),u=t.maybeAppendByClassName(fO.nextBtnGroup,"g").styles(u),this.nextBtnGroup=u.node(),[a,u.maybeAppendByClassName(fO.nextBtn,"path")].forEach(function(t){t.styles(m(m({},r),{transformOrigin:"center"})),$w(t.node(),n,!0)}),a=t.maybeAppendByClassName(fO.pageInfoGroup,"g"),this.pageInfoGroup=a.node(),a.maybeAppendByClassName(fO.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()}))},pO.prototype.render=function(t,e){e=x(e);this.renderClipPath(e),this.renderController(e),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},pO.prototype.bindEvents=function(){var t=this,e=Je(function(){return t.render(t.attributes,t)},50);this.playWindow.addEventListener(b.INSERTED,e),this.playWindow.addEventListener(b.REMOVED,e)},pO);function pO(t){var e,n,t=hO.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 hc({class:fO.contentGroup.name})),t.playWindow=t.contentGroup.appendChild(new hc({class:fO.playWindow.name})),t.innerCurrPage=t.defaultPage,t}function gO(t,e,n){return"horizontal"===(t=void 0===t?"horizontal":t)?e:n}fM.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"]]}),fM.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]]}),fM.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 yO=yw({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(bO,mO=Es),Object.defineProperty(bO.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(bO.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(bO.prototype,"span",{get:function(){var t,e=this.attributes.span;return e?(t=(e=j(Qw(e),2))[0],e=e[1],[t/(e=t+(t=this.showValue?e:0)),t/e]):[1,1]},enumerable:!1,configurable:!0}),Object.defineProperty(bO.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=j(this.spacing,2),s=o[0],o=o[1];return t&&(t=t-e-s-o,e=j(this.span,2),a=(e=j([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(bO.prototype,"spacing",{get:function(){var t,e=this.attributes.spacing;return e?(t=(e=j(Qw(e),2))[0],e=e[1],this.showValue?[t,e]:[t,0]):[0,0]},enumerable:!1,configurable:!0}),Object.defineProperty(bO.prototype,"layout",{get:function(){var t=this.shape,e=t.markerWidth,n=t.labelWidth,r=t.valueWidth,i=t.width,t=t.height,a=j(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(bO.prototype,"scaleSize",{get:function(){var t=(t=(t=this.markerGroup.node()).querySelector(yO.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}),bO.prototype.renderMarker=function(t){var f=this,d=this.attributes.marker,p=w(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(yO.markerGroup,"g").style("zIndex",0),_w(!!d,this.markerGroup,function(){var t=f.markerGroup.node(),e=t.getElementsByClassName(yO.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=j(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",yO.marker.name).styles(p),t.appendChild(n);else x(n).attr("className",yO.marker.name).styles(p),t.appendChild(n);f.markerGroup.node().scale(1/f.markerGroup.node().getScale()[0]),$w(f.markerGroup.node(),f.scaleSize,!0)})},bO.prototype.renderLabel=function(t){var e=w(this.attributes,"label"),n=e.text,e=at(e,["text"]);this.labelGroup=t.maybeAppendByClassName(yO.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(yO.label,function(){return Aw(n)}).styles(e)},bO.prototype.renderValue=function(t){var e=this,n=w(this.attributes,"value"),r=n.text,i=at(n,["text"]);this.valueGroup=t.maybeAppendByClassName(yO.valueGroup,"g").style("zIndex",0),_w(this.showValue,this.valueGroup,function(){e.valueGroup.maybeAppendByClassName(yO.value,function(){return Aw(r)}).styles(i)})},bO.prototype.renderBackground=function(t){var e=this.shape,n=e.width,e=e.height,r=w(this.attributes,"background");this.background=t.maybeAppendByClassName(yO.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(yO.background,"rect").styles(m({width:n,height:e},r))},bO.prototype.adjustLayout=function(){var t=this.layout,e=t.labelWidth,n=t.valueWidth,r=t.height,t=j(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}),Ew(this.labelGroup.select(yO.label.class).node(),Math.ceil(e)),this.showValue&&(this.valueGroup.styles({x:t,y:r}),Ew(this.valueGroup.select(yO.value.class).node(),Math.ceil(n)))},bO.prototype.render=function(t,e){e=x(e);this.renderMarker(e),this.renderLabel(e),this.renderValue(e),this.renderBackground(e),this.adjustLayout()};var mO,vO=bO;function bO(t){return mO.call(this,t,{span:[1,1],marker:function(){return new nc({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}function xO(t,e,n){return void 0===n&&(n=!0),t?e(t):n}var wO,MO=yw({page:"item-page",navigator:"navigator",item:"item"},"items"),kO=(t(OO,wO=Es),Object.defineProperty(OO.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(OO.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(OO.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=j(t,2);return[t[0],gw(t[1],[e,n,a])]})))}})},enumerable:!1,configurable:!0}),OO.prototype.getGridLayout=function(){var u=this,t=this.attributes,h=t.orientation,f=t.width,d=t.rowPadding,p=t.colPadding,g=j(this.navigatorShape,1)[0],t=j(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(),j(a,2)),o=a[0],a=a[1],s=(f-g-(m-1)*p)/m,t=t.getBBox().height,l=j([0,0],2),c=l[0],l=l[1];return b="horizontal"===h?(c=(n=j([b,o*(t+d)],2))[0],l=n[1],a===m-1?0:b+s+p):(c=(n=j([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}})},OO.prototype.getFlexLayout=function(){var t=this.attributes,e=t.width,n=t.height,a=t.rowPadding,o=t.colPadding,t=j(this.navigatorShape,1)[0],r=j(this.grid,2),s=r[0],l=r[1],r=j([e-t,n],2),c=r[0],u=r[1],e=j([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&&xO(g,function(t){return t<l})?(r=j([m+r,v,i],3),h=r[0],f=r[1],m=r[2]):(i=j([y+1,0,0,v+t+a],4),y=i[0],g=i[1],m=i[2],(v=i[3])+a+t<=u&&xO(y,function(t){return t<s})?(r=j([m,v,n],3),h=r[0],f=r[1],m=r[2]):(i=j([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(OO.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}),OO.prototype.ifHorizontal=function(t,e){return gO(this.attributes.orientation,t,e)},OO.prototype.flattenPage=function(e){e.querySelectorAll(MO.item.class).forEach(function(t){e.appendChild(t)}),e.querySelectorAll(MO.page.class).forEach(function(t){e.removeChild(t).destroy()})},OO.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(MO.item.class).data(this.renderData,function(t){return t.id}).join(function(t){return t.append(function(t){t=t.style;return new vO({style:t})}).attr("className",MO.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()})},OO.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=j(this.navigatorShape,2),i=r[0],r=r[1];this.navigator.update("grid"===e?{pageWidth:t-i,pageHeight:n-r}:{})},OO.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=j(t,2);return{page:t[0],layouts:t[1]}}),u=k([],j(this.navigator.getContainer().children),!1);t.forEach(function(t){var t=t.layouts,c=e.pageViews.appendChild(new hc({className:MO.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=We(t="__layout__")?t.split("."):t).forEach(function(t,e){e<i.length-1?(Re(r[t])||(r[t]=He(i[e+1])?[]:{}),r=r[t]):r[t]=n}),o.update({x:e,y:a,width:s,height:l})})}),this.relayoutNavigator()},OO.prototype.renderNavigator=function(t){var e=this.attributes.orientation,n=w(this.attributes,"nav"),r=mw({orientation:e},n),i=this;return t.selectAll(MO.navigator.class).data(["nav"]).join(function(t){return t.append(function(){return new dO({style:r})}).attr("className",MO.navigator.name).each(function(){i.navigator=this})},function(t){return t.each(function(){this.update(r)})},function(t){return t.remove()}),this.navigator},OO.prototype.getBBox=function(){return this.navigator.getBBox()},OO.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())},OO.prototype.dispatchCustomEvent=function(t,e){t=new pl(t,{detail:e});this.dispatchEvent(t)},OO);function OO(t){t=wO.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:an,mouseenter:an,mouseleave:an})||this;return t.navigatorShape=[0,0],t}var EO,SO=yw({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),AO={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},_O=(t(TO,EO=Es),TO.prototype.render=function(t,e){var n=x(e).maybeAppendByClassName(SO.markerGroup,"g"),n=(this.renderMarker(n),x(e).maybeAppendByClassName(SO.labelGroup,"g"));this.renderLabel(n)},TO.prototype.renderMarker=function(t){var r=this,e=this.attributes,n=e.orientation,e=e.markerSymbol,i=void 0===e?gO(n,"horizontalHandle","verticalHandle"):e;_w(!!i,t,function(t){var e=w(r.attributes,"marker"),n=m({symbol:i},e);r.marker=t.maybeAppendByClassName(SO.marker,function(){return new fM({style:n})}).update(n)})},TO.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;_w(n,t,function(t){var e=w(s.attributes,"label"),n=e.text,e=at(e,["text"]),r=(null==(r=t.select(SO.marker.class))?void 0:r.node().getBBox())||{},i=r.width,r=r.height,r=j(gO(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(SO.label,"text").styles(m(m({},e),{x:i,y:a,text:u(n).toString(),textAlign:o,textBaseline:r}))})},TO);function TO(t){return EO.call(this,t,AO)||this}var PO,Go={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},CO=mw({},Go,{}),LO=mw({},Go,nM(AO,"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"}),NO=yw({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"),jO=(t(RO,PO=Es),RO.prototype.renderTitle=function(t,e,n){var r=this.attributes,i=r.showTitle,r=r.titleText,a=j(rM(w(this.attributes,"title")),2),o=a[0],a=a[1],s=(this.titleGroup=t.maybeAppendByClassName(NO.titleGroup,"g").styles(a),m(m({width:e,height:n},o),{text:i?r:""}));this.title=this.titleGroup.maybeAppendByClassName(NO.title,function(){return new iO({style:s})}).update(s)},RO.prototype.renderItems=function(t,e){var n=e.x,r=e.y,i=e.width,e=e.height,a=j(rM(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(NO.itemsGroup,"g").styles(m({x:n,y:r},a)),this);this.itemsGroup.selectAll(NO.items.class).data(["items"]).join(function(t){return t.append(function(){return new kO({style:s})}).attr("className",NO.items.name).each(function(){l.items=x(this)})},function(t){return t.update(s)},function(t){return t.remove()})},RO.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(RO.prototype,"availableSpace",{get:function(){var t=this.attributes,e=t.showTitle,n=t.width,t=t.height;return e?this.title.node().getAvailableSpace():new dw(0,0,n,t)},enumerable:!1,configurable:!0}),RO.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=eO(t),e=(r=j(Qw(r?e:0),4))[0],a=r[1],o=r[2],r=r[3],s=(n=j(Qw(n),4))[0],l=n[1],c=n[2],n=n[3],a=(r=j([r+a,e+o],2))[0],e=r[1],r=(o=j([n+l,s+c],2))[0],n=o[1],"l"===t[0]?new dw(u.x,u.y,i.width+u.width+a+r,Math.max(i.height+n,u.height)):"t"===t[0]?new dw(u.x,u.y,Math.max(i.width+r,u.width),i.height+u.height+e+n):(s=(l=j([h.attributes.width||i.width,h.attributes.height||i.height],2))[0],c=l[1],new dw(i.x,i.y,s+u.width+a+r,c+u.height+e+n))):PO.prototype.getBBox.call(this)},RO.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()},RO);function RO(t){return PO.call(this,t,CO)||this}var IO,BO={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},DO=yw({background:"background",labelGroup:"label-group",label:"label"},"indicator"),FO=(t(zO,IO=Es),zO.prototype.renderBackground=function(){var t,e,n,r,i,a,o;this.label&&(t=(i=this.attributes).position,o=(i=j(Qw(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(DO.background,"path").styles(m(m({},o),{path:a})),this.group.appendChild(this.label.node()))},zO.prototype.renderLabel=function(){var t=this.attributes,e=t.formatter,n=t.labelText,t=j(rM(w(this.attributes,"label")),2),r=t[0],t=t[1],r=(r.text,at(r,["text"]));this.label=x(this.group).maybeAppendByClassName(DO.labelGroup,"g").styles(t),n&&this.label.maybeAppendByClassName(DO.label,function(){return Aw(e(n))}).style("text",e(n).toString()).selectAll("text").styles(r)},zO.prototype.adjustLayout=function(){var t=j(this.point,2),e=t[0],t=t[1];this.group.attr("x",-e).attr("y",-t)},zO.prototype.getPath=function(n,t){var r=this,t=j(t,2),e=j(t[0],2),i=e[0],e=e[1],t=j(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=j(t,2),e=t[0],t=t[1];return e===o[n]?r.createCorner(t):[k(["M"],j(t[0]),!1),k(["L"],j(t[1]),!1)]});return a.push([["Z"]]),a.flat().filter(function(t,e,n){return 0===e||"M"!==t[0]})},zO.prototype.createCorner=function(t,e){void 0===e&&(e=10);var n=function(t,e){var n=(t=j(t,2))[0],t=t[1],r=(e=j(e,2))[0],e=e[1];return n!==r&&t===e}.apply(void 0,k([],j(t),!1)),t=j(t,2),r=j(t[0],2),i=r[0],r=r[1],t=j(t[1],2),a=t[0],t=t[1],a=j(n?[a-i,[i,a]]:[t-r,[r,t]],2),t=a[0],a=j(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=j([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]])},zO.prototype.bindEvents=function(){this.label.on(b.BOUNDS_CHANGED,this.renderBackground)},zO.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout()},zO);function zO(t){t=IO.call(this,t,BO)||this;return t.point=[0,0],t.group=t.appendChild(new hc({})),t.isMutationObserved=!0,t}function WO(t,e){var t=j(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 GO=yw({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function HO(t){var e=t.orientation,n=t.size,t=t.length;return gO(e,[t,n],[n,t])}function VO(t){var e=t.type,t=j(HO(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 YO(t){var i,a,o,e=t.orientation,r=t.color,n=t.block,t=t.partition,s=(l=Ce(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 ma(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(gO(e,"0","270"),")")):""}function qO(t,e){var n,r,i,a=w(e,"selection"),o=YO(e),t=t.maybeAppendByClassName(GO.selection,"path").styles(m({path:VO(e),fill:o},a)),a=t.maybeAppendByClassName(GO.clipPath,"path").styles({path:(a=(o=e).orientation,(e=o.range)?(r=(o=j(HO(o),2))[0],o=o[1],n=(e=j(e,2))[0],e=e[1],i=gO(a,n*r,0),n=gO(a,0,n*o),r=gO(a,e*r,r),[["M",i,n],["L",i,i=gO(a,o,e*o)],["L",r,i],["L",r,n],["Z"]]):[])}).node();t.style("clip-path",a)}t(XO,$O=Es),XO.prototype.render=function(t,e){var n,r,i=x(e).maybeAppendByClassName(GO.trackGroup,"g");i=i,r=w(n=t,"track"),i.maybeAppendByClassName(GO.track,"path").styles(m({path:VO(n)},r)),qO(x(e).maybeAppendByClassName(GO.selectionGroup,"g"),t)};var $O,UO=XO;function XO(t){return $O.call(this,t,{type:"color",orientation:"horizontal",size:30,range:[0,1],length:200,block:!1,partition:[],color:["#fff","#000"],trackFill:"#e5e5e5"})||this}var KO,ZO,QO,JO,tE=tn(function(t){return{min:Math.min.apply(Math,k([],j(t.map(function(t){return t.value})),!1)),max:Math.max.apply(Math,k([],j(t.map(function(t){return t.value})),!1))}},function(t){return t.map(function(t){return t.id})}),eE=(t(h,KO=Es),Object.defineProperty(h.prototype,"handleOffsetRatio",{get:function(){return this.ifHorizontal(.5,.5)},enumerable:!1,configurable:!0}),h.prototype.getBBox=function(){var t=this.attributes,e=t.width,t=t.height;return new dw(0,0,e,t)},h.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(NO.contentGroup,"g").styles({x:i,y:r}),i=(_w(!!t,e.maybeAppendByClassName(NO.labelGroup,"g").styles({zIndex:1}),function(t){n.renderLabel(t)}),e.maybeAppendByClassName(NO.ribbonGroup,"g").styles({zIndex:0}));this.handlesGroup=e.maybeAppendByClassName(NO.handlesGroup,"g").styles({zIndex:2}),this.renderHandles(),this.renderRibbon(i),this.renderIndicator(e),this.adjustLabel(),this.adjustHandles()},Object.defineProperty(h.prototype,"range",{get:function(){var t=this.attributes.data;return tE(t)},enumerable:!1,configurable:!0}),Object.defineProperty(h.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(h.prototype,"ribbonRange",{get:function(){var t=j(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(h.prototype,"selection",{get:function(){var t=this.range,e=t.min,t=t.max,n=this.attributes.defaultValue,e=j(void 0===n?[e,t]:n,2);return[e[0],e[1]]},enumerable:!1,configurable:!0}),h.prototype.ifHorizontal=function(t,e){return gO(this.attributes.orientation,"function"==typeof t?t():t,"function"==typeof e?e():e)},h.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(NO.title.class).data(n?[r]:[]).join(function(t){return t.append(function(){return new iO({style:o})}).attr("className",NO.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(h.prototype,"availableSpace",{get:function(){var t,e;return this.title?this.title.getAvailableSpace():(t=(e=this.attributes).width,e=e.height,new dw(0,0,t,e))},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"labelFixedSpacing",{get:function(){return this.attributes.showTick?5:0},enumerable:!1,configurable:!0}),Object.defineProperty(h.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(h.prototype,"labelBBox",{get:function(){var t,e;return this.attributes.showLabel?(this.cacheLabelBBox||(t=(e=(null==(e=this.label.querySelector(QM.labelGroup.class))?void 0:e.children.slice(-1)[0]).getBBox()).width,e=e.height,this.cacheLabelBBox=new dw(0,0,t,e)),this.cacheLabelBBox):new dw(0,0,0,0)},enumerable:!1,configurable:!0}),Object.defineProperty(h.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(h.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=j(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=j(this.ifHorizontal([n,l],[l,n]),2),s=o[0],e=o[1],i=["top","left"].includes(c)?a:0,r=j(this.ifHorizontal([t/2,i],[i,t/2]),2),l=r[0],n=r[1];return new dw(l,n,s,e)},enumerable:!1,configurable:!0}),Object.defineProperty(h.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}),h.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=mw({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(NO.ribbon,function(){return new UO({style:d})}).update(d)},h.prototype.getHandleClassName=function(t){return"".concat(NO.prefix("".concat(t,"-handle")))},h.prototype.renderHandles=function(){var t=this.attributes,e=t.showHandle,t=t.orientation,n=w(this.attributes,"handle"),r=j(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)?_O:HM,s=this;this.handlesGroup.selectAll(NO.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(NO.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()})},h.prototype.adjustHandles=function(){var t=j(this.selection,2),e=t[0],t=t[1];this.setHandlePosition("start",e),this.setHandlePosition("end",t)},h.prototype.adjustTitle=function(){var t=this.attributes,e=t.titlePosition,t=t.orientation,n=j(this.getElementsByClassName(NO.title.name),1)[0],r=this.handlesGroup.select(".".concat(this.getHandleClassName("start"))).node();n&&r&&"top-left"===e&&"horizontal"===t&&(e=j(r.getLocalBounds().min,1)[0],t=j(n.getLocalBounds().min,1)[0],n.style.x=+(this.style.x||0)+(e-t))},Object.defineProperty(h.prototype,"handleBBox",{get:function(){if(!this.cacheHandleBBox){if(!this.attributes.showHandle)return new dw(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=j([Math.max(e,r),Math.max(t,n)],2),r=e[0],t=e[1];this.cacheHandleBBox=new dw(0,0,r,t)}return this.cacheHandleBBox},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"handleShape",{get:function(){var t=this.handleBBox,e=t.width,t=t.height,n=j(this.ifHorizontal([t,e],[e,t]),2);return{width:e,height:t,size:n[0],length:n[1]}},enumerable:!1,configurable:!0}),h.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=j(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})},h.prototype.renderIndicator=function(t){var e=w(this.attributes,"indicator");this.indicator=t.maybeAppendByClassName(NO.indicator,function(){return new FO({})}).update(e)},Object.defineProperty(h.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=j([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(h.prototype,"labelStyle",{get:function(){var t=j(["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}),h.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=mw(m({showLine:!1,showGrid:!1,showTick:n,type:"linear",startPos:[0,0],endPos:[0,0],tickDirection:"negative",labelTransform:"rotate(0)"},this.labelStyle),nM(i,"tick"),nM(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(NO.label,function(){return new cO({style:s})}).node(),this.label.update(s,!1)},Object.defineProperty(h.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=j([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}),h.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=j(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))},h.prototype.bindEvents=function(){this.ribbon.on("pointerdown",this.onDragStart("ribbon")),this.ribbon.on("pointermove",this.onHovering),this.addEventListener("pointerout",this.hideIndicator)},h.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=Ge(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}),ew(this.indicator.node())):this.hideIndicator()},h.prototype.hideIndicator=function(){nw(this.indicator.node())},h.prototype.updateMouse=function(){this.attributes.slidable&&(this.style.cursor="grabbing")},h.prototype.setSelection=function(t,e){this.updateSelection(t,e)},h.prototype.updateSelection=function(t,e,n){void 0===n&&(n=!1);var r,i,a,o,s,l=j(this.selection,2),c=l[0],l=l[1],t=j([t,e],2),e=t[0],t=t[1],n=(n&&(e+=c,t+=l),this.range),c=n.min,l=n.max,u=j((n=[c,l],c=[e,t],l=this.selection,void 0===r&&(r=4),i=(n=j(n,2))[0],n=n[1],a=(c=j(c,2))[0],c=c[1],o=(l=j(l,2))[0],l=l[1],c=(a=j([a,c],2))[0],s=(a=a[1])-c,a<c&&(c=(u=j([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]:[Gw(c,r),Gw(a,r)]),2),e=u[0],t=u[1];this.update({defaultValue:[e,t]}),this.dispatchSelection()},Object.defineProperty(h.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 Ze(t)?Gw(.01*(e-n),0):t},enumerable:!1,configurable:!0}),h.prototype.getTickValue=function(t){var e=this.attributes,n=e.data,e=e.block,r=this.range.min;return e?WO(n.map(function(t){return t.value}),t).tick:(e=this.step,r+Math.round((t-r)/e)*e)},h.prototype.getValueByCanvasPoint=function(t,e){var n=this.range,r=n.min,n=n.max,i=j(this.ribbon.node().getPosition(),2),a=i[0],i=i[1],a=this.ifHorizontal(a,i),i=this.ifHorizontal.apply(this,k([],j(Sw(t)),!1));return Ge(this.getOffset(i-a,!0),r,n)},h.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)},h.prototype.dispatchSelection=function(){var t=new pl("valuechange",{detail:{value:this.selection}});this.dispatchEvent(t)},h.prototype.dispatchIndicated=function(t,e){t=new pl("indicate",{detail:{value:t,range:e}});this.dispatchEvent(t)},h);function h(t){var a=KO.call(this,t,LO)||this;return a.eventToOffsetScale=new eb({}),a.innerRibbonScale=new eb({}),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=WO(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(),j(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 nE(t){ZO||(ZO=document.createElement("table"),JO=document.createElement("tr"),QO=/^\s*<(\w+|!)[^>]*>/,JO={tr:document.createElement("tbody"),tbody:ZO,thead:ZO,tfoot:ZO,td:JO,th:JO,"*":document.createElement("div")});var e=QO.test(t)&&RegExp.$1,e=(e&&e in JO||(e="*"),JO[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 rE(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 iE={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};t(cE,aE=Es),Object.defineProperty(cE.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),cE.prototype.getContainer=function(){return this.element},Object.defineProperty(cE.prototype,"position",{set:function(t){var t=j(t,2),e=t[0],t=t[1];this.attributes.x=e,this.attributes.y=t,this.updatePosition()},enumerable:!1,configurable:!0}),Object.defineProperty(cE.prototype,"elementSize",{get:function(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}},enumerable:!1,configurable:!0}),Object.defineProperty(cE.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 nE((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}),cE.prototype.render=function(t,e){this.renderHTMLTooltipElement(),this.updatePosition()},cE.prototype.destroy=function(){var t;null!=(t=this.element)&&t.remove(),aE.prototype.destroy.call(this)},cE.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"},cE.prototype.hide=function(){this.element.style.visibility="hidden"},cE.prototype.initShape=function(){var t=this.attributes.template;this.element=nE(t.container),this.id&&this.element.setAttribute("id",this.id)},cE.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))},cE.prototype.renderHTMLTooltipElement=function(){var r,t=this.attributes,e=t.template,n=t.title,i=t.enterable,a=t.style,t=t.content,o=rE(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,k([],j(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=j(t,2),e=t[0],n=t[1];k([r],j(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(":"),";")},""))})})},cE.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=j(l,2),n=e[0],e=e[1],t=j(a[t],2),r=t[0],t=t[1];l=[n+(o/2+i[0])*r,e+(s/2+i[1])*t]}),l},cE.prototype.setOffsetPosition=function(t){var t=j(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")},cE.prototype.updatePosition=function(){this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor()))},cE.prototype.autoPosition=function(t){var e,n,r,i,a,o,s,t=j(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=j([+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]},cE.tag="tooltip",e([(void 0===(oE=100)&&(oE=0),void 0===(sE=!0)&&(sE=!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,sE&&i.apply(t,e),r=window.setTimeout(function(){i.apply(t,e),r=null},oE))})})],cE.prototype,"updatePosition",null);var aE,oE,sE,lE=cE;function cE(t){var e=this,n=null==(n=null==(n=t.style)?void 0:n.template)?void 0:n.prefixCls,r=rE(n);return(e=aE.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=rE(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},iE),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)"},iE),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(hE,uE=hc),Object.defineProperty(hE.prototype,"margin",{get:function(){return this.$margin},set:function(t){this.$margin=Qw(t)},enumerable:!1,configurable:!0}),Object.defineProperty(hE.prototype,"padding",{get:function(){return this.$padding},set:function(t){this.$padding=Qw(t)},enumerable:!1,configurable:!0}),hE.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=j(this.$margin,4),a=i[0],o=i[1],s=i[2],i=i[3];return new dw(e-i,n-a,r+i+o,t+a+s)},hE.prototype.appendChild=function(t,e){return t.isMutationObserved=!0,uE.prototype.appendChild.call(this,t,e),t},hE.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,t=t.height,n=j(this.$padding,4),r=n[0],i=n[1],a=n[2],n=n[3],o=j(this.$margin,4),s=o[0],o=o[3];return new dw(n+o,r+s,e-n-i,t-r-a)},hE.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:Nw,grid:jw})?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){}},hE.prototype.bindEvents=function(){var e=this;this.layoutEvents.forEach(function(t){e.addEventListener(t,function(t){t.target.isMutationObserved=!0,e.layout()})})},hE.prototype.attributeChangedCallback=function(t,e,n){"margin"===t?this.margin=n:"padding"===t&&(this.padding=n),this.layout()};var uE,qs=hE;function hE(t){var e=uE.call(this,t)||this,t=(e.layoutEvents=[b.BOUNDS_CHANGED,b.INSERTED,b.REMOVED],e.$margin=Qw(0),e.$padding=Qw(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 fE(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 X2()([[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=jb(l,t),t=jb(t,i),i=jb(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])),X2()(s)}const dE=Ox(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=>!He(t))?t.children.forEach(t=>t.remove()):(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=fE(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 fM({id:"startMarker",style:Object.assign({x:0,y:0},st(a,"startMarker"))}),o=g&&new fM({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:{}))}),pE=(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 dE).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()}};pE.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const gE=Ox(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 fM({})).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)}),yE=(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 gE).call(L,n).style("x",e).style("y",t).call(L,r).call(L,i).node()}};yE.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const mE=Ox(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)}),vE=(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=Yb(d,e),i=l&&i?Wb(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 L0(d)?(e=t=>{const n=d.getCenter(),r=t.slice(0,t.length/2),i=t.slice(t.length/2);return t=K2().curve(Z2),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 tx(a())},delete t.lineX0,t.lineEndAngle=function(){return tx(o())},delete t.lineX1,t.lineInnerRadius=function(){return tx(s())},delete t.lineY0,t.lineOuterRadius=function(){return tx(l())},delete t.lineY1,t.curve=function(t){return arguments.length?e(J2(t)):e()._curve},t.angle((t,e)=>Ib(Lb(r[e],n))).outerRadius((t,e)=>jb(r[e],n)).innerRadius((t,e)=>jb(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 mE).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(C0(d)?K2().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)):K2().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 mE).style("areaStyle",s).style("connectStyle",Object.assign(Object.assign({},r),f)).style("areaPath",e(t)).style("connectPath",o.map(e).join("")).node())}},bE=(vE.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(n,r)=>{const i=r["coordinate"];return(...t)=>{var e=L0(i)?hx:q2;return vE(Object.assign({curve:e},n),r)(...t)}}),xE=(bE.props=Object.assign(Object.assign({},vE.props),{defaultMarker:"square"}),(t,n)=>{const{alpha:r=.5}=t,i=at(t,["alpha"]),a=n["coordinate"];return(...t)=>{var e=L0(a)?cx:sx;return vE(Object.assign({curve:e.alpha(r)},i),n)(...t)}}),wE=(xE.props=Object.assign(Object.assign({},vE.props),{defaultMarker:"smooth"}),(e,n)=>(...t)=>vE(Object.assign({curve:dx},e),n)(...t)),ME=(wE.props=Object.assign(Object.assign({},vE.props),{defaultMarker:"hvh"}),(e,n)=>(...t)=>vE(Object.assign({curve:px},e),n)(...t)),kE=(ME.props=Object.assign(Object.assign({},vE.props),{defaultMarker:"vh"}),(e,n)=>(...t)=>vE(Object.assign({curve:gx},e),n)(...t)),OE=(kE.props=Object.assign(Object.assign({},vE.props),{defaultMarker:"hv"}),(e,n)=>{const{arrow:r=!1}=e;return(...t)=>tw(Object.assign(Object.assign({},e),{arrow:r}),n)(...t)}),EE=(OE.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=R2();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()}});EE.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const SE=(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=R2(),L0(r)?(a=jb(t,c=r.getCenter()),a=(jb(l,c)-a)*i+a,o.moveTo(t[0],t[1]),zb(o,t,l,c,a)):C0(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()}},AE=(SE.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=R2();return o.moveTo(t[0],t[1]),L0(l)?(r=l.getCenter(),o.quadraticCurveTo(r[0],r[1],a[0],a[1])):zb(o,t,a,Fb(t,a),jb(t,a)/2),lt(c.createElement("path",{})).call(L,n).style("d",o.toString()).style("stroke",e).style("transform",i).call(L,s).node()}}),_E=(AE.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?Np(o)*l:o,i="string"==typeof i?Np(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()}});_E.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const TE=(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=R2();if(L0(t)){const o=t.getCenter();t=[...i,i[0]];const s=t.map(t=>jb(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?zb(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()}};TE.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const PE=(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=R2();return L0(e)?(n=jb(e=e.getCenter(),t),o.moveTo(t[0],t[1]),o.quadraticCurveTo(e[0],e[1],i[0],i[1]),zb(o,i,a,e,n),o.quadraticCurveTo(e[0],e[1],r[0],r[1]),zb(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()}};PE.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const CE=(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=R2(),L0(r)?([i,a]=r=r.getCenter(),o=Rb(Lb(t[0],r)),s=Rb(Lb(t[1],r)),g=jb(r,t[2]),l=jb(r,t[3]),c=jb(r,t[8]),u=jb(r,t[10]),r=jb(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()}};CE.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const LE=(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=R2(),L0(r)?([a,o]=r=r.getCenter(),s=jb(r,t[3]),l=jb(r,t[8]),g=jb(r,t[10]),c=(r=Rb(Lb(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()}};LE.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const NE=(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,L0(i=d)?(i=i.getCenter(),H2()({startAngle:0,endAngle:2*Math.PI,outerRadius:jb(r[0],i),innerRadius:jb(r[1],i)})):X2().x(t=>t[0]).y(t=>t[1])(r)),c=(c=d,e=e.transform,L0(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 jE(t,e,n){return[["M",t,e],["L",t+2*n,e-n],["L",t+2*n,e+n],["Z"]]}NE.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const RE=Ox(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,X2().x(t=>t[0]).y(t=>t[1])(n));lt(t).maybeAppend("connector","path").style("path",n).style("markerEnd",r?new fM({className:"marker",style:Object.assign(Object.assign({},i),{symbol:jE})}):null).call(L,e)});const IE=(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(C0(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 RE).call(L,n).style("points",t).style("stroke",e||r).style("transform",a).call(L,l).node()}};function BE(t){return t.replace(/-(\w)/g,function(t,e){return e.toUpperCase()})}function DE(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=Pg(a.x,c),i=Pg(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 FE(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}=Hb(e,i,[t,n]),f="inside"===r?(u+h)/2:h;e=WE(f,a,o),t=(()=>{var[t,e]=i,n=l+.5*(c-l),[n,t]="inside"===r?zE(s,f,n):Fb(t,e);return{x:n,y:t}})();return Object.assign(Object.assign({},t),{textAlign:"inside"===r?"center":"start",textBaseline:"middle",rotate:e})}function zE(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function WE(t,e,n){return e?(e=n?0:Math.sin(t)<0?90:-90,t/Math.PI*180+e):0}function GE(t,e,n,r){var{y:n,y1:i,autoRotate:a,rotateToAlignArc:o,radius:s=.5,offset:l=0}=n,e=Hb(r,e,[n,i]),{startAngle:n,endAngle:i}=e,r=r.getCenter(),n=(n+i)/2,i={textAlign:"center",textBaseline:"middle",rotate:WE(n,a,o)},{innerRadius:a,outerRadius:o}=e,[e,r]=zE(r,n,a+(o-a)*s+l);return Object.assign({x:e,y:r},i)}function HE(t){return void 0===t?null:t}function VE(t,e,n){var n=n["bounds"],[n]=n;return{x:HE(n[0]),y:HE(n[1])}}function YE(t,e,n,r){var i=n["bounds"];return 1===i.length?VE(0,0,n):(N0(r)?FE:B0(r)?GE:DE)(t,e,n,r)}function qE(t,e,n){var{innerRadius:n,outerRadius:t}=Hb(n,t,[e.y,e.y1]);return n+(t-n)}function $E(t,e,n){var{startAngle:n,endAngle:t}=Hb(n,t,[e.y,e.y1]);return(n+t)/2}function UE(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=$E(e,n,r),d=0<Math.sin(f)?1:-1,i=WE(f,i,a),a={textAlign:0<d||N0(r)?"start":"end",textBaseline:"middle",rotate:i},i=qE(e,n,r),[[e,n],[r,h],[f,i]]=function(t,e,n,r,i){var[n,a]=zE(t,e,n),[t,r]=zE(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)}IE.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var XE=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=b0(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=Rb(Lb(l(e+1),s))/Math.PI*180;return{x:i[0],y:i[1],transform:`rotate(${l})`,textAlign:"center",textBaseline:"middle"}},bottom:YE,bottomLeft:YE,bottomRight:YE,inside:YE,left:YE,outside:function(t,e,n,r){var i=n["bounds"];return 1===i.length?VE(0,0,n):(N0(r)?FE:B0(r)?UE:DE)(t,e,n,r)},right:YE,spider:function(t,e,n,r){var i,a,o,s,l,c;return B0(r)?({connectorLength:c,connectorLength2:i,connectorDistance:a}=n,o=at(UE(0,e,n,r),[]),s=r.getCenter(),l=qE(e,n,r),e=$E(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 B0(r)?({connectorLength:o,connectorLength2:i,connectorDistance:a}=n,{x0:n,y0:s}=e=at(UE(0,e,n,r),[]),l=r.getCenter(),r=function(t){if(B0(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=Ib([n-l[0],s-l[1]]),n=0<Math.sin(o)?1:-1,[s,l]=zE(l,o,r),e.x=s+(i+a)*n,e.y=l,e):{}},top:YE,topLeft:YE,topRight:YE});function KE(t,e,n,r,i){var a=e["position"],a=(o=n,void 0!==(a=a)?a:B0(o)?"inside":C0(o)?"right":"top"),o=r["inside"===a?"innerLabel":"label"],r=Object.assign({},o,e),e=XE[BE(a)];if(e)return Object.assign(Object.assign({},o),e(a,t,r,n,i));throw new Error("Unknown position: "+a)}const ZE=(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=KE(t,e,l,c,s),{rotate:e=0,transform:o=""}=t,t=at(t,["rotate","transform"]);return lt(new dE).call(L,t).style("text",""+n).style("labelTransform",(o+` rotate(${+e}) `+r).trim()).style("labelTransformOrigin",i).style("coordCenter",l.getCenter()).call(L,a).node()}},QE=(ZE.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()}}),JE=(QE.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(t,e)=>QE(Object.assign({colorAttribute:"fill"},t),e)),t5=(JE.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(t,e)=>QE(Object.assign({fill:"none",colorAttribute:"stroke"},t),e)),e5=(t5.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=R2();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 n5(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 r5(t,e,n){t=t?t():document.createElement("canvas");return t.width=e,t.height=n,t}e5.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},n5(3);const i5=function(n,r,t=16){const i=n5(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=r5(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 a5(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=r5(o,t,e).getContext("2d"),l=function(t,e){const n=(e=r5(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=i5(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=r5(o,t,e).getContext("2d");return i.putImageData(r,0,0),i}const o5=(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=x0(t,t=>t[2]),t=v0(t,t=>t[2]),c={gradient:u,opacity:h,minOpacity:d,maxOpacity:f,blur:p,useGradientOpacity:g},l=a&&o?a5(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()}},s5=(o5.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}))}}),l5=(s5.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},{BLACK:"#000",WHITE:"#fff",STROKE:"#416180"}),c5="#5B8FF9",u5=t=>{var e={color:c5,size:1,category10:"category10",category20:"category20",enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},view:{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:l5.BLACK,lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:12,strokeWidth:0,connectorStroke:l5.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:l5.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:l5.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:l5.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:l5.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:l5.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:l5.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:l5.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:l5.STROKE,endMarkerFillOpacity:.95}},axis:{arrow:!1,gridLineDash:[0,0],gridLineWidth:.5,gridStroke:l5.BLACK,gridStrokeOpacity:.05,labelAlign:"horizontal",labelFill:l5.BLACK,labelFillOpacity:.65,labelFontSize:12,labelFontWeight:"lighter",labelSpacing:8,line:!1,lineLineWidth:.5,lineStroke:l5.BLACK,lineStrokeOpacity:.45,tickLength:4,tickLineWidth:1,tickStroke:l5.BLACK,tickStrokeOpacity:.25,titleFill:l5.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:l5.BLACK,itemLabelFillOpacity:.65,itemLabelFontSize:12,itemLabelFontWeight:"lighter",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,8],itemValueFill:l5.BLACK,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"lighter",navButtonFill:l5.BLACK,navButtonFillOpacity:.65,navPageNumFill:l5.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!0,titleFill:l5.BLACK,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,tickStroke:l5.BLACK,tickStrokeOpacity:.25,rowPadding:0,colPadding:8},legendContinuous:{handleHeight:12,handleLabelFill:l5.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:l5.BLACK,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:l5.BLACK,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:l5.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:l5.BLACK,tickStrokeOpacity:.25},label:{fill:l5.BLACK,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:l5.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:l5.WHITE,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},slider:{trackSize:16,trackFill:l5.STROKE,trackFillOpacity:1,selectionFill:c5,selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:l5.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:l5.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:{spacing:8,titleFill:l5.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:l5.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)},h5=(u5.props={},{BLACK:"#fff",WHITE:"#000",STROKE:"#416180"}),f5="#5B8FF9",d5=t=>{var e={color:f5,category10:"category10",category20:"category20",size:1,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},view:{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:h5.BLACK,lineWidth:1}},text:{text:{fill:h5.BLACK,fillOpacity:.65,fontSize:12,strokeWidth:0,connectorStroke:h5.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:h5.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:h5.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:h5.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:h5.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:h5.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:h5.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:h5.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:h5.STROKE,endMarkerFillOpacity:.95}},axis:{arrow:!1,gridLineDash:[0,0],gridLineWidth:.5,gridStroke:h5.BLACK,gridStrokeOpacity:.05,labelAlign:"horizontal",labelFill:h5.BLACK,labelFillOpacity:.65,labelFontSize:12,labelFontWeight:"lighter",labelSpacing:8,lineLineWidth:.5,lineStroke:h5.BLACK,lineStrokeOpacity:.45,tickLength:4,tickLineWidth:1,tickStroke:h5.BLACK,tickStrokeOpacity:.25,titleFill:h5.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:h5.BLACK,itemLabelFillOpacity:.65,itemLabelFontSize:12,itemLabelFontWeight:"lighter",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,8],itemValueFill:h5.BLACK,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"lighter",navButtonFill:h5.BLACK,navButtonFillOpacity:.45,navPageNumFill:h5.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!0,titleFill:h5.BLACK,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,tickStroke:h5.BLACK,tickStrokeOpacity:.25,rowPadding:0,colPadding:8},legendContinuous:{handleHeight:12,handleLabelFill:h5.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:h5.BLACK,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:h5.BLACK,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:h5.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:h5.BLACK,tickStrokeOpacity:.25},label:{fill:h5.BLACK,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:h5.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:h5.WHITE,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},slider:{trackSize:16,trackFill:h5.STROKE,trackFillOpacity:1,selectionFill:f5,selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:h5.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:h5.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{},title:{titleFill:h5.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:h5.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)},p5=(d5.props={},{BLACK:"#000",WHITE:"#fff",STROKE:"#888"}),g5="#4e79a7",y5=t=>{var e={color:g5,size:1,category10:"tableau10",category20:"tableau10",enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},view:{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:p5.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:p5.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:p5.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:p5.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:p5.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:p5.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:p5.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:p5.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:p5.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:p5.STROKE,endMarkerFillOpacity:.95}},axis:{arrow:!1,gridLineDash:[0,0],gridLineWidth:1,gridStroke:"#ddd",gridStrokeOpacity:1,labelAlign:"horizontal",labelAutoRotate:!1,labelFill:p5.BLACK,labelFillOpacity:1,labelFontSize:10,labelFontWeight:"normal",labelSpacing:4,line:!0,lineLineWidth:1,lineStroke:"#888",lineStrokeOpacity:1,tickLength:5,tickLineWidth:1,tickStroke:p5.STROKE,tickStrokeOpacity:1,titleFill:p5.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:p5.BLACK,itemLabelFillOpacity:1,itemLabelFontSize:10,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,4],itemValueFill:p5.BLACK,itemValueFillOpacity:1,itemValueFontSize:10,itemValueFontWeight:"normal",navButtonFill:p5.BLACK,navButtonFillOpacity:.45,navButtonSize:6,navPageNumFill:p5.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:10,padding:8,title:!0,titleFill:p5.BLACK,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold",titleSpacing:4,rowPadding:0,colPadding:8},legendContinuous:{handleHeight:12,handleLabelFill:p5.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:10,handleLabelFontWeight:"normal",handleMarkerFill:p5.BLACK,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:p5.BLACK,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:p5.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:p5.BLACK,fillOpacity:.65,fontSize:10,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:p5.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:p5.WHITE,fontSize:10,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},slider:{trackSize:16,trackFill:p5.STROKE,trackFillOpacity:.05,selectionFill:g5,selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:p5.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:p5.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:10,handleLabelFontWeight:"normal"},scrollbar:{},title:{titleFill:p5.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:p5.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)};function m5(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)]}y5.props={};var v5,b5=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function x5(t){var e;if(e=b5.exec(t))return new w5({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 w5(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 M5(t,e){var n,e=m5(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+""}x5.prototype=w5.prototype,w5.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 k5={"%":(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)=>M5(100*t,e),r:M5,s:function(t,e){var n,r,i=m5(t,e);return i?(n=i[0],(i=(i=i[1])-(v5=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")+m5(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 O5(t){return t}var E5,S5=Array.prototype.map,A5=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function _5(t){var e,s,l,M=void 0===t.grouping||void 0===t.thousands?O5:(s=S5.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]+"",k=void 0===t.decimal?".":t.decimal+"",O=void 0===t.numerals?O5:(e=S5.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=x5(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"):k5[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=k5[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?A5[8+v5/3]:"")+a+(o&&"("===h?")":""),w)for(e=-1,n=t.length;++e<n;)if((r=t.charCodeAt(e))<48||57<r){a=(46===r?k+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 O(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=x5(t)).type="f",t)),e=3*Math.max(-8,Math.min(8,Math.floor((t=e,((t=m5(Math.abs(t)))?t[1]:NaN)/3)))),r=Math.pow(10,-e),i=A5[8+e/3];return function(t){return n(r*t)+i}}}}function T5(t,e,n){return t.querySelector(e)?lt(t).select(e):lt(t).append(n)}function P5(t){return Array.isArray(t)?t.join(", "):""+(t||"")}function C5(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)}Ml=_5({thousands:",",grouping:[3],currency:["$",""]}),E5=Ml.format,Ml.formatPrefix;class L5 extends qs{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 N5 extends L5{update(t){var e=t["subOptions"];this.attr(t),null!=(t=this.child)&&t.update(e)}}function j5(t,e){return null==(t=t.filter(t=>t.getOptions().name===e))?void 0:t[0]}function R5(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 I5(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"+Xe(t)]=e:r[t]=e}),Object.assign(Object.assign({},r),e)}function B5(t){var{innerWidth:t,innerHeight:e}=t.getOptions();return[t,e]}function D5(t){return"number"!=typeof t||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(15))}function F5(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]=Kp(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(L0(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 eb({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 I0(i)?(e=i.map("bottom"===r?[t,1]:[0,t]),"bottom"===r?(n=e[0],new eb({domain:[0,a],range:[0,1]}).map(n)):"left"===r?(n=e[1],new eb({domain:[0,o],range:[0,1]}).map(n)):t):t}}(o,s);return L0(s)||C0(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:N0(s)&&"center"===o||C0(s)&&(null==(r=a.getTicks)?void 0:r.call(a))&&["top","bottom","center","outer"].includes(o)?1-i:i,label:u(h(D5(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(D5(t),e,n)),id:String(e)}})}function z5(t,e,n){var r;return!(L0(r=e)&&C0(r)||R0(e))&&(void 0===t?!!n.getTicks:t)}function W5(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"+Og(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 G5,Al=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?E5(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 H5=Al(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=W5(0,0,r,o,u,c),r=Object.assign(Object.assign(Object.assign({},r),f),b),a=function(t,e){var[e,n]=B5(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]=D0(r);const[u,h]=F0(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=F5(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:P5(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:z5(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 cO({className:"axis",style:I5(i)})}}),V5=Al(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=F5(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]=D0(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]=F0(i),[l,c]=B5(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=I5(ot({},t,a,e,Object.assign(Object.assign({type:"arc",data:i,titleText:P5(d),grid:p},g),h)));return new cO({style:rn(n,["transform"])})}}),Y5=(H5.props={defaultPosition:"center",defaultSize:45,defaultOrder:0},V5.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0},e=>(...t)=>H5(Object.assign({},{crossPadding:50},e))(...t)),q5=(Y5.props=Object.assign(Object.assign({},H5.props),{defaultPosition:"bottom"}),e=>(...t)=>H5(Object.assign({},{crossPadding:10},e))(...t));q5.props=Object.assign(Object.assign({},H5.props),{defaultPosition:"left"});const $5=a=>{const{important:o={}}=a,s=at(a,["important"]);return t=>{var e,{theme:n,coordinate:r,scales:i}=t;return H5(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]=F0(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 U5(t,e){const{scales:n,library:a,markState:r}=e,[i,o]=function(t,e){var n=j5(t,"shape"),r=j5(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]}(n,r),{itemMarker:s,itemMarkerSize:l}=t,c=(t,e)=>{var n;const r=(null==(n=null==(n=a["shape."+t])?void 0:n.props)?void 0:n.defaultMarker)||function(t){if(Pe(t))return t[t.length-1]}(t.split(".")),i="function"==typeof l?l(e):l;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=Nx.get(t)||Nx.get("point");return(...t)=>{return new kc({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})})}}(r,{color:e.color})(0,0,i)},u=t=>i+"."+o[t];return j5(n,"shape")&&!s?(t,e)=>c(u(e),t):"function"==typeof s?(t,e)=>{e=s(t.id,e);return"string"==typeof e?c(e,t):e}:(t,e)=>c(s||u(e),t)}function X5(t,e){var{labelFormatter:n=t=>""+t}=t,{scales:r,theme:i}=e,i=i.legendCategory.itemMarkerSize,a=(i=i,(a=j5(a=r,"size"))instanceof Kv?2*a.map(NaN):i),i={itemMarker:U5(Object.assign(Object.assign({},t),{itemMarkerSize:a}),e),itemMarkerSize:a,itemMarkerOpacity:function(t){if(t=j5(t,"opacity")){const n=t.getOptions()["range"];return(t,e)=>n[e]}}(r)};const o="string"==typeof n?E5(n):n,s=j5(r,"color");t=r.find(t=>0<t.getOptions().domain.length).getOptions().domain;const l=s?t=>s.map(t):()=>e.theme.color;return Object.assign(Object.assign({},i),{data:t.map(t=>({id:t,label:o(t),color:l(t)}))})}$5.props=Object.assign(Object.assign({},H5.props),{defaultPosition:"center"});const K5=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}=R5(t,e,n);return{width:i,height:a}}(e,o,K5),a=C5(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:P5(c)}),X5(o,t)),{legendCategory:i={}}=n,t=I5(Object.assign({},i,e,h)),n=new N5({style:Object.assign(Object.assign({x:r.x,y:r.y,width:r.width,height:r.height},a),{subOptions:t})});return n.appendChild(new jO({className:"legend-category",style:t})),n}};function Z5(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 Q5(t){var t=t.getOptions()["domain"],[t,e]=[t[0],Tb(t)];return[t,e]}function J5(t,e,n,r,i,a){const o=t["length"];var i=i.color?a.legendContinuous.ribbonFill||"black":a.color;const s=e||(a=i,i=(e=n||r).getOptions(),(e=e.clone()).update(Object.assign(Object.assign({},i),{range:[ma(a).toString()]})),e),[l,c]=Q5(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 tS(t,e,n,r,i,a){var o=j5(t,"color"),n=function(t,e,n){var{size:r,crossPadding:i=0}=e,t=R5(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 ob){var r=o.getOptions()["range"],[i,s]=Q5(o);if(o instanceof cb||o instanceof hb)return Z5(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 J5(n,o,j5(t,"size"),j5(t,"opacity"),e,a)}K5.props={defaultPosition:"top",defaultOrder:1,defaultSize:40,defaultPadding:[20,10],defaultCrossPadding:[5,10]};const eS=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=C5(d,f),{legendContinuous:c={}}=n,c=I5(Object.assign({},c,Object.assign(Object.assign({titleText:P5(p),labelAlign:"value",labelFormatter:"string"==typeof h?t=>E5(h)(t.label):h},tS(t,r,e,u,eS,n)),g),y)),t=new L5({style:Object.assign(Object.assign({x:i,y:a,width:o,height:s},l),{subOptions:c})});return t.appendChild(new eE({style:c})),t}},nS=(eS.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:200,defaultLegendSize:60,defaultPadding:[20,10],defaultCrossPadding:[5,10]},e=>(...t)=>eS(Object.assign({},{block:!0},e))(...t)),rS=(nS.props=Object.assign(Object.assign({},eS.props),{defaultPosition:"top",defaultOrientation:"horizontal"}),n=>t=>{var e=t["scales"],e=j5(e,"size");return eS(Object.assign({},{type:"size",data:e.getTicks().map((t,e)=>({value:t,label:String(t)}))},n))(t)}),iS=(rS.props=Object.assign(Object.assign({},eS.props),{defaultPosition:"top",defaultOrientation:"horizontal"}),t=>rS(Object.assign({},{block:!0},t)));function aS(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"}}}iS.props=Object.assign(Object.assign({},eS.props),{defaultPosition:"top",defaultOrientation:"horizontal"});G5={render(t,e){const{y:n,width:r,title:i,subtitle:a,spacing:o=2,align:s="left"}=t,l=at(t,["x","y","width","title","subtitle","spacing","align"]);t=st(l,"title");const c=st(l,"subtitle"),u=T5(e,".title","text").attr("className","title").call(L,Object.assign(Object.assign(Object.assign({},aS(0,n,r,s)),{fontSize:14,textBaseline:"top",text:i}),t)).node().getLocalBounds();T5(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({},aS(0,u.max[1]+o,r,s)),{fontSize:12,textBaseline:"top",text:a}),c))})}};const oS=class extends ac{constructor(t){super(t),this.descriptor=G5}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)}},sS=a=>({value:t,theme:e})=>{var{x:t,y:n,width:r,height:i}=t.bbox;return new oS({style:ot({},e.title,Object.assign({x:t,y:n,width:r,height:i},a))})};function lS(t){return t.getBandWidth}function cS(t,e,n){if(!lS(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=qp(t,e);return r=n+a,t=0,e=i.length-1,i[Math.min(e,Math.max(t,r))]}function uS(t,e,n){if(!e)return t.getOptions().domain;if(!lS(t))return o=o0(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 hS(t,e,n,r,i,a){const{x:o,y:s}=i;i=(t,e)=>{var[t,n]=a.invert(t);return[cS(o,t,e),cS(s,n,e)]},t=i([t,e],!0),e=i([n,r],!1);return[uS(o,[t[0],e[0]]),uS(s,[t[1],e[1]])]}function fS(t,e){var[t,n]=t;return[e.map(t),e.map(n)+((t=e).getStep?t.getStep():0)]}sS.props={defaultPosition:"top",defaultOrder:2,defaultSize:36};const dS=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?E5(h):h;var l="horizontal"===u;const c=C0(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 qM({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(cS(n,t,!0))}},f),p))})}},pS=(dS.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1},t=>dS(Object.assign(Object.assign({},t),{orientation:"horizontal"}))),gS=(pS.props=Object.assign(Object.assign({},dS.props),{defaultPosition:"bottom"}),t=>dS(Object.assign(Object.assign({},t),{orientation:"vertical"}))),yS=(gS.props=Object.assign(Object.assign({},dS.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 XM({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}))})}}),mS=(yS.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1},t=>yS(Object.assign(Object.assign({},t),{orientation:"horizontal"}))),vS=(mS.props=Object.assign(Object.assign({},yS.props),{defaultPosition:"bottom"}),t=>yS(Object.assign(Object.assign({},t),{orientation:"vertical"}))),bS=(vS.props=Object.assign(Object.assign({},yS.props),{defaultPosition:"left"}),t=>()=>new hc),xS=(bS.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]=C0(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}}),wS=(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]=C0(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}},MS=(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]=C0(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}},kS=(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]=C0(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}},OS=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))},ES=(OS.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 SS(t,e){var n={};for(const i of e){var r=t.style[i];r&&(n[i]=r)}return n}ES.props={};const AS=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"];function _S(t){var{min:t,max:e}=t.getLocalBounds(),[t,n]=t,[e,r]=e;return[t,n,e-t,r-n]}function TS(t,e){var[n,r,i,t]=_S(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 AS(t,e){t.__data__=e.__data__,t.className=e.className,t.markType=e.markType,e.parentNode.replaceChild(t,e)}function _S(t,e){return t.indexOf(e)===t.lastIndexOf(e)}function TS(t){var e,t=$a(t);if(t&&(_S(e=t,"m")&&_S(e,"M")))return t}function PS(t,e,n,r){var i,a,o,s,l,c,u,h,f,d=e["nodeName"],p=n["nodeName"],g=TS(e),y=TS(n);if(d===p&&"path"!==d||(void 0===g||void 0===y))return p=n,d=r,[a,o,v,s]=ES(i=e),f=i.style.transform,l=p.style.transform,[c,m,u,h]=(AS(p,i),ES(p)),f=[Object.assign({transform:`${f?f+" ":""}translate(${a-c}, ${o-m}) scale(${v/u}, ${s/h})`},kS(i,OS)),Object.assign({transform:`${l?l+" ":""}translate(0, 0) scale(1, 1)`},kS(p,OS))],p.animate(f,d);{a=g;const b="path"===(o=(c=t)["nodeName"])?c:(AS(o=new kc({style:Object.assign(Object.assign({},kS(c,OS)),{d:a})}),c),o);var m=[Object.assign({path:g},kS(e,OS)),Object.assign({path:y},kS(n,OS))],v=b.animate(m,r);return v.onfinish=()=>{b.style.transform="none",Sg(b,n)},b.style.transform="none",v}}const CS=p=>(t,e,n)=>{[r="pack"]=[p.split];var r="function"==typeof r?r:SS,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,PS(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 PS(t,new kc({style:Object.assign({path:f[e]},kS(s,OS))}),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 PS(t,t,new kc({style:{path:d[e],fill:u.style.fill}}),h)}),e]}}return null},LS=(CS.props={},(m,v)=>{const b=(ec({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:o.NUMBER}),v)["coordinate"];return(t,e,n)=>{const[r]=t;if(!L0(b))return mS(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=H2().cornerRadius(e).padAngle(a*Math.PI/180),f=Hb(b,t,[c,u]),{startAngle:d,endAngle:p}=f,g=new kc({}),y=t=>{g.attr({d:h(t),transform:`translate(${i[0]}, ${i[1]})`});t=$a(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}}),NS=(LS.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}}),jS=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}},RS=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))},IS=(RS.props={},(o,s)=>(t,e,n)=>{const[r]=t;var{height:t,width:i}=r.getBoundingClientRect();const a=new kc({style:{path:`M0,0L${i},0L${i},${t}L0,${t}Z`}});r.appendChild(a),r.style.clipPath=a;i=mS(o,s)([a],e,n);return i.finished.then(()=>{a.remove(),r.style.clipPath=null}),i}),BS=(IS.props={},(o,s)=>(t,e,n)=>{const[r]=t;var{height:t,width:i}=r.getBoundingClientRect();const a=new kc({style:{path:`M0,0L${i},0L${i},${t}L0,${t}Z`}});r.appendChild(a),r.style.clipPath=a;i=bS(o,s)([a],e,n);return i.finished.then(()=>{a.remove(),r.style.clipPath=null}),i}),DS=(BS.props={},{visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1});function FS(t,e,n,r){t.style[e]=n,r&&t.children.forEach(t=>FS(t,e,n,r))}function zS(t){FS(t,"visibility","hidden",!0)}function WS(t){FS(t,"visibility","visible",!0)}function GS(t){return lt(t).selectAll("."+vh).nodes().filter(t=>!t.__removed__)}function HS(t,e){return VS(t,e).flatMap(({container:t})=>GS(t))}function VS(e,t){return t.filter(t=>t!==e&&t.options.parentKey===e.options.key)}function YS(t){return lt(t).select("."+xh).node()}function qS(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 $S(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 US(t){return t=>t.__data__.color}function XS(t){const e=t.scale["x"];return t=>{t=t.__data__.x;return e.invert(t)}}function KS(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 ZS(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:DS[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 QS(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 JS(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 t3(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=o0(t,(t,e)=>{t=t.__data__.x,e=e.__data__.x;return t-e});for(let t=1;t<e.length;t++){var n=R2();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(),Ab(c,t=>l(t,s))),{fill:i=s.getAttribute("fill")}=r,a=at(r,["fill"]),o=new kc({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 e3(n,t,e){var r,i,a,o=t=>{var e=n.style["transform"];return e?e+" "+t:t};return L0(e)?(a=n.__data__["points"],[a,i]=C0(e)?Gb(a):a,r=Lb(a,a=e.getCenter()),i=Lb(i,a),a=Rb(r)+Bb(r,i)/2,o(`translate(${t*Math.cos(a)}, ${t*Math.sin(a)})`)):C0(e)?o(`translate(${t}, 0)`):o(`translate(0, ${-t})`)}function n3(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 aS(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 aS(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 mx(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=Ab(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(aS)})()?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 r3(t,e){t=t.getRootNode().defaultView.getContextService().getDomElement();null!=t&&t.style&&(t.style.cursor=e)}function i3(t,e,r){return t.find(n=>Object.entries(e).every(([t,e])=>r(n)[t]===e))}function a3(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=e0(h,o);t=JS(h,a);const[p,g]=t3(Object.assign({elements:h,valueof:t,link:n,coordinate:l},st(u.active,"link"))),[y,m,v]=n3(Object.assign({document:e.ownerDocument,scale:s,coordinate:l,background:r,valueof:t},st(u.active,"background"))),{setState:b,removeState:x,hasState:w}=ZS(ot(u,{active:Object.assign({},(null==(n=u.active)?void 0:n.offset)&&{transform:(...t)=>{var e=u.active.offset(...t),[,t]=t;return e3(h[t],e,l)}})}),t);let M;const k=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)}})}},O=(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(()=>{O(),M=null},i)):O())},S=()=>{O()},A=(e.addEventListener("pointerover",k),e.addEventListener("pointerout",E),e.addEventListener("pointerleave",S),t=>{t=t.nativeEvent;t||O(!1)}),_=t=>{var e=t["nativeEvent"];!e&&(e=t.data["data"],t=i3(h,e,a))&&k({target:t,nativeEvent:!1})};return c.on("element:highlight",_),c.on("element:unhighlight",A),()=>{e.removeEventListener("pointerover",k),e.removeEventListener("pointerout",E),e.removeEventListener("pointerleave",S),c.off("element:highlight",_),c.off("element:unhighlight",A);for(const t of h)m(t),g(t)}}function o3(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 a3(YS(t),Object.assign({elements:GS,datum:KS(r),groupKey:l?l(r):void 0,coordinate:o,scale:a,state:QS(i,[["active",c?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:c,link:u,delay:s,emitter:n},h))}}function s3(t){return o3(Object.assign(Object.assign({},t),{createGroup:XS}))}function l3(t){return o3(Object.assign(Object.assign({},t),{createGroup:US}))}function c3(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=e0(m,d);t=JS(m,f);const[x,w]=t3(Object.assign({link:p,elements:m,valueof:t,coordinate:n},st(a.selected,"link"))),[M,k]=n3(Object.assign({document:e.ownerDocument,background:r,coordinate:n,scale:i,valueof:t},st(a.selected,"background"))),{setState:O,removeState:o,hasState:E}=ZS(ot(a,{selected:Object.assign({},(null==(r=a.selected)?void 0:r.offset)&&{transform:(...t)=>{var e=a.selected.offset(...t),[,t]=t;return e3(m[t],e,n)}})}),t),S=(t=!0)=>{for(const e of m)o(e,"selected","unselected"),w(e),k(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)?O(l,"selected"):(O(l,"unselected"),w(l)),l!==i&&k(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)O(u,"unselected"),w(u),k(u)}else{e=t.some(t=>E(t,"selected"));for(const h of m)c.has(h)?O(h,"selected"):E(h,"selected")||O(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=i3(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 u3(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 c3(YS(t),Object.assign({elements:GS,datum:KS(r),groupKey:s?s(r):void 0,coordinate:a,scale:o,state:QS(i,[["selected",l?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:l,link:c,emitter:n},u))}}function h3(t){return u3(Object.assign(Object.assign({},t),{createGroup:XS}))}function f3(t){return u3(Object.assign(Object.assign({},t),{createGroup:US}))}function d3(t){var{wait:O=20,leading:E,trailing:S=!1,labelFormatter:A=t=>""+t}=t,_=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=o0(t.map(t=>d[t])),u=ot({},e),h=u.marks.find(t=>"line"===t.type);t=v0(r0(t,t=>v0(t,t=>+f[t])/x0(t,t=>+f[t]),t=>l[t]).values());ot(h,{scale:{y:{domain:[1/t,t]}}});const p=YS(r),g=r.getElementsByClassName(vh);const y=e0(r.getElementsByClassName(Mh),t=>t.__data__.key.split("-")[0]),m=new xc({style:Object.assign({x1:0,y1:0,x2:0,y2:p.getAttribute("height"),stroke:"black",lineWidth:1},st(_,"rule"))}),v=new Rc({style:Object.assign({x:0,y:p.getAttribute("height"),text:"",fontSize:10},st(_,"label"))}),b=(m.append(v),p.appendChild(m),(t,e,n)=>{var[t]=t.invert(n),n=e.invert(t);return c[$p(c,n)]}),x=(t,e)=>{m.setAttribute("x1",t[0]),m.setAttribute("x2",t[0]),v.setAttribute("text",A(e))};let w;var M;const k=ln(t=>{t=qS(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[Gp(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)}}},O,{leading:E,trailing:S});return M=[0,0],X(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[Gp(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",k),p.addEventListener("pointermove",k),p.addEventListener("pointerleave",k),()=>{m.remove(),p.removeEventListener("pointerenter",k),p.removeEventListener("pointermove",k),p.removeEventListener("pointerleave",k)}}}function p3({wait:l=30,leading:c,trailing:u=!1}){return t=>{const{options:r,update:i,container:e}=t,a=YS(e),o=ot({},r);for(const s of o.marks)s.animate=!1;const n=ln(t=>{var e,n,t=qS(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 g3=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 y3(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 m3(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:y3(r,a)}}),o.emit("element:"+i,r),o.emit(n+":"+i,r)):o.emit(e+":"+i,t))}}function v3(){return(t,e,n)=>{const{container:r,view:i}=t,a=m3(g3.CLICK,i,n,t=>1===t.detail),o=m3(g3.DBLCLICK,i,n,t=>2===t.detail),s=m3(g3.POINTER_TAP,i,n),l=m3(g3.POINTER_DOWN,i,n),c=m3(g3.POINTER_UP,i,n),u=m3(g3.POINTER_OVER,i,n),h=m3(g3.POINTER_OUT,i,n),f=m3(g3.POINTER_MOVE,i,n),d=m3(g3.POINTER_ENTER,i,n),p=m3(g3.POINTER_LEAVE,i,n),g=m3(g3.POINTER_UPOUTSIDE,i,n),y=m3(g3.DRAG_START,i,n),m=m3(g3.DRAG,i,n),v=m3(g3.DRAG_END,i,n),b=m3(g3.DRAG_ENTER,i,n),x=m3(g3.DRAG_LEAVE,i,n),w=m3(g3.DRAG_OVER,i,n),M=m3(g3.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 b3({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 lE({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 x3({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 w3(t){var e=t["tooltipElement"];e&&(e.destroy(),t.tooltipElement=void 0)}function M3(t){var e=t["value"];return Object.assign(Object.assign({},t),{value:void 0===e?"undefined":e})}function k3(t,e){var{color:t,series:n}=t,{color:e,series:r}=e,i=t=>t&&t.invert&&!(t instanceof Kv)&&!(t instanceof Yv);return i(n)?n.invert(r):r&&r!==e?r:!i(t)||(n=t.invert(e),Array.isArray(n))?null:n}function O3(t){var e=t.getAttribute("fill"),n=t.getAttribute("stroke"),t=t["__data__"],{color:t=e&&"transparent"!==e?e:n}=t;return t}function E3(t,e=t=>t){t=new Map(t.map(t=>[e(t),t]));return Array.from(t.values())}function S3(n,s,l,t=n.map(t=>t.__data__)){const e=t=>t instanceof Date?+t:t;var r=E3(t.map(t=>t.title),e).filter(Ag),t=t.flatMap((r,t)=>{const i=n[t],{items:e=[],title:a}=r;t=e.filter(Ag);const o=void 0!==l?l:e.length<=1;return t.map(t=>{var{color:e=O3(i),name:n}=t,t=at(t,["color","name"]),n=o?k3(s,r)||n:n||k3(s,r);return Object.assign(Object.assign({},t),{color:e,name:n||a})})}).map(M3);return Object.assign(Object.assign({},0<r.length&&{title:r.join(",")}),{items:E3(t,t=>`(${e(t.name)}, ${e(t.value)}, ${e(t.color)})`)})}function A3(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=S0(n),g=S0(e);const[y,m,v,b]=u?(n=Math.min(a,o)/2,a=Rb(Lb([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 xc({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 _3(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function T3(t,e){return Array.from(t.values()).some(t=>{return null==(t=t.interaction)?void 0:t[e]})}function P3(t,e){return void 0===t?e:t}function C3(t){var{title:t,items:e}=t;return 0===e.length&&void 0===t}function L3(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:k=0,startY:O=0,body:E=!0,single:S=!0,position:A,enterable:_,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=C0(v),L=L0(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,[o0(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 o0([t[n],e[n]])})(t);return r>=t&&r<=e})},l=ln(t=>{var e=qS(p,t);if(e){var n=p.getRenderBounds();const c=n.min[0],u=n.min[1],h=[e[0]-k,e[1]-O];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]=o0([n[0],n[n.length-1]]);return t<r||i<t?null:e[(0,Gp(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[$e(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[w0(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=S3(n,m,w,l);g&&l.items.sort((t,e)=>g(t)-g(e)),y&&(l.items=l.items.filter(y)),0===n.length||C3(l)?B():(E&&b3({root:p,data:l,x:e[0]+c,y:e[1]+u,render:x,event:t,single:S,position:A,enterable:_,mount:T,bounding:P}),b&&(n=s.map(t=>t[1]),A3(p,n,Object.assign(Object.assign({},Y),{plotWidth:D,plotHeight:F,mainWidth:z,mainHeight:W,insetLeft:G,insetTop:H,startX:k,startY:O,transposed:C,polar:L}))),M.emit("tooltip:show",Object.assign(Object.assign({},t),{nativeEvent:!0,data:{data:{x:oS(m.x,I(h),!0)}}})))}},n,{leading:r,trailing:i}),B=()=>{x3({root:p,single:S,emitter:M,mount:T}),b&&_3(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=()=>{x3({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),w3(p),b&&_3(p)}}function N3(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),k=e0(w,f),O=ln(t=>{var e,n,r,i=t["target"];!M.has(i)||(e=f(i),e=1===(e=k.get(e)).length?function(n){var{title:t,items:e=[]}=t=n["__data__"],e=e.filter(Ag).map(t=>{var{color:e=O3(n)}=t,t=at(t,["color"]);return Object.assign(Object.assign({},t),{color:e})}).map(M3);return Object.assign(Object.assign({},t&&{title:t}),{items:e})}(e[0]):S3(e,o,l),c&&e.items.sort((t,e)=>c(t)-c(e)),u&&(e.items=e.items.filter(u)),C3(e))?x3({root:a,single:d,emitter:h,mount:v}):({offsetX:n,offsetY:r}=t,x&&b3({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:y3(i,m)}})))},e,{leading:n,trailing:r}),E=t=>{t=t.target;M.has(t)&&x3({root:a,single:d,emitter:h,mount:v})},S=({nativeEvent:t,data:e})=>{var n,r,i;t||(t=i3(w,e.data,y))&&({x:e,y:n,width:r,height:i}=t.getBBox(),O({target:t,offsetX:e+r/2,offsetY:n+i/2}))},A=({nativeEvent:t}={})=>{t||x3({root:a,single:d,emitter:h,nativeEvent:!1,mount:v})};return h.on("tooltip:show",S),h.on("tooltip:hide",A),i||(a.addEventListener("pointerover",O),a.addEventListener("pointermove",O),a.addEventListener("pointerout",E)),()=>{i||(a.removeEventListener("pointerover",O),a.removeEventListener("pointermove",O),a.removeEventListener("pointerout",E)),h.off("tooltip:show",S),h.off("tooltip:hide",A),w3(a)}}function j3(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=T3(o,"seriesTooltip"),c=T3(o,"crosshairs"),r=YS(r),l=P3(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 L3(r,Object.assign(Object.assign({},y),{elements:GS,scale:a,coordinate:s,crosshairs:P3(f,c),item:p,emitter:n}));if(l&&g){l=t.filter(t=>t!==e&&t.options.parentKey===e.options.key);const u=HS(e,t),a=l[0].view.scale;t=r.getBounds(),l=t.min[0],t=t.min[1];return L3(r.parentNode.parentNode,Object.assign(Object.assign({},y),{elements:()=>u,scale:a,coordinate:s,crosshairs:P3(f,c),item:p,startX:l,startY:t,emitter:n}))}return N3(r,Object.assign(Object.assign({},y),{datum:KS(i),elements:GS,scale:a,coordinate:s,groupKey:h?XS(i):void 0,item:p,emitter:n,view:i}))}}const R3="legend-category",I3="items-item",B3="legend-category-item-marker",D3="legend-category-item-label";function F3(t){return t.getElementsByClassName(B3)[0]}function z3(t){return t.getElementsByClassName(D3)[0]}function W3(t){return t.getElementsByClassName(I3)}function G3(t){return t.getElementsByClassName(R3)}function H3(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function V3(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}=ZS(f,void 0),{setState:g,removeState:y}=ZS(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=()=>{r3(t,"pointer")},w=()=>{r3(t,"default")},M=n=>X(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 k=n=>X(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()))}),O=e=>X(this,void 0,void 0,function*(){var t=e["nativeEvent"];t||(v=m.map(o),yield r(v),b())});return s.on("legend:filter",k),s.on("legend:reset",O),()=>{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",k),s.off("legend:reset",O)}}function Y3(){return(t,e,r)=>{const{container:i,view:a,options:o,update:s}=t;t=G3(i);const l=(r,i)=>X(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}=H3(t).scales[0];return V3(i,{legends:W3,marker:F3,label:z3,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 q3(){return(t,e,a)=>{const{container:n,view:r,options:i}=t;t=G3(n);const o=GS(n);var s=QS(i,["active","inactive"]),l=JS(o,KS(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=H3(d).scales[0].name,y=W3(d),m=(t=>{var{scale:{[t]:t}}=r;return t})(g),v=e0(o,t=>m.invert(t.__data__[g]));var{state:u={}}=d.attributes,{inactive:u={}}=u;const{setState:b,removeState:x}=ZS(s,l);var h={inactive:st(u,"marker")},u={inactive:st(u,"label")};const{setState:w,removeState:M}=ZS(h),{setState:k,removeState:O}=ZS(u),E=t=>{for(const r of y){var e=F3(r),n=z3(r);(r===t||null===t?(M(e,"inactive"),O):(w(e,"inactive"),k))(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}}))},A=new Map;for(const C of y){var f=t=>{S(t,C)};C.addEventListener("pointerover",f),A.set(C,f)}const _=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||_({nativeEvent:!1})};d.addEventListener("pointerleave",_),a.on("legend:highlight",T),a.on("legend:unhighlight",P);c.push(()=>{d.removeEventListener(_),a.off("legend:highlight",T),a.off("legend:unhighlight",P);for(var[t,e]of A)t.removeEventListener(e)})}return()=>c.forEach(t=>t())}}function $3(t,e){for(var[n,r]of Object.entries(e))t.style(n,r)}const U3=Ox(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(Tg(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(Tg(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:k=h}=M,M=at(M,["render"]),O=st(c,"handleSE"),{render:E=h}=O,O=at(O,["render"]),S=st(c,"handleSW"),{render:h=h}=S,S=at(S,["render"]);var A=i=>()=>{return new(Ox(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($3,Object.assign({width:i,height:a},Tg(c,"handle"))),t.maybeAppend("handle-n",A(d)).style("x",u).style("y",-u).style("width",i-s).style("height",s).style("fill","transparent").call($3,f),t.maybeAppend("handle-e",A(g)).style("x",i-u).style("y",u).style("width",s).style("height",a-s).style("fill","transparent").call($3,p),t.maybeAppend("handle-s",A(m)).style("x",u).style("y",a-u).style("width",i-s).style("height",s).style("fill","transparent").call($3,y),t.maybeAppend("handle-w",A(b)).style("x",-u).style("y",u).style("width",s).style("height",a-s).style("fill","transparent").call($3,v),t.maybeAppend("handle-nw",A(w)).style("x",-u).style("y",-u).style("width",s).style("height",s).style("fill","transparent").call($3,x),t.maybeAppend("handle-ne",A(k)).style("x",i-u).style("y",-u).style("width",s).style("height",s).style("fill","transparent").call($3,M),t.maybeAppend("handle-se",A(E)).style("x",i-u).style("y",a-u).style("width",s).style("height",s).style("fill","transparent").call($3,O),t.maybeAppend("handle-sw",A(h)).style("x",-u).style("y",a-u).style("width",s).style("height",s).style("fill","transparent").call($3,S)}});function X3(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,k=(r3(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 kc({style:Object.assign(Object.assign({},f),{fill:n,fillOpacity:r,stroke:i,pointerEvents:"none"})}),y=new U3({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 U3({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)},O=(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 PS(t,e){t.__data__=e.__data__,t.className=e.className,t.markType=e.markType,e.parentNode.replaceChild(t,e)}function CS(t,e){return t.indexOf(e)===t.lastIndexOf(e)}function LS(t){var e,t=$a(t);if(t&&(CS(e=t,"m")&&CS(e,"M")))return t}function NS(t,e,n,r){var i,a,o,s,l,c,u,h,f,d=e["nodeName"],p=n["nodeName"],g=LS(e),y=LS(n);if(d===p&&"path"!==d||(void 0===g||void 0===y))return p=n,d=r,[a,o,v,s]=_S(i=e),f=i.style.transform,l=p.style.transform,[c,m,u,h]=(PS(p,i),_S(p)),f=[Object.assign({transform:`${f?f+" ":""}translate(${a-c}, ${o-m}) scale(${v/u}, ${s/h})`},SS(i,AS)),Object.assign({transform:`${l?l+" ":""}translate(0, 0) scale(1, 1)`},SS(p,AS))],p.animate(f,d);{a=g;const b="path"===(o=(c=t)["nodeName"])?c:(PS(o=new kc({style:Object.assign(Object.assign({},SS(c,AS)),{d:a})}),c),o);var m=[Object.assign({path:g},SS(e,AS)),Object.assign({path:y},SS(n,AS))],v=b.animate(m,r);return v.onfinish=()=>{b.style.transform="none",Sg(b,n)},b.style.transform="none",v}}const jS=p=>(t,e,n)=>{[r="pack"]=[p.split];var r="function"==typeof r?r:TS,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,NS(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 NS(t,new kc({style:Object.assign({path:f[e]},SS(s,AS))}),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 NS(t,t,new kc({style:{path:d[e],fill:u.style.fill}}),h)}),e]}}return null},RS=(jS.props={},(m,v)=>{const b=(ec({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:o.NUMBER}),v)["coordinate"];return(t,e,n)=>{const[r]=t;if(!L0(b))return xS(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=H2().cornerRadius(e).padAngle(a*Math.PI/180),f=Hb(b,t,[c,u]),{startAngle:d,endAngle:p}=f,g=new kc({}),y=t=>{g.attr({d:h(t),transform:`translate(${i[0]}, ${i[1]})`});t=$a(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}}),IS=(RS.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}}),BS=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}},DS=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))},FS=(DS.props={},(o,s)=>(t,e,n)=>{const[r]=t;var{height:t,width:i}=r.getBoundingClientRect();const a=new kc({style:{path:`M0,0L${i},0L${i},${t}L0,${t}Z`}});r.appendChild(a),r.style.clipPath=a;i=xS(o,s)([a],e,n);return i.finished.then(()=>{a.remove(),r.style.clipPath=null}),i}),zS=(FS.props={},(o,s)=>(t,e,n)=>{const[r]=t;var{height:t,width:i}=r.getBoundingClientRect();const a=new kc({style:{path:`M0,0L${i},0L${i},${t}L0,${t}Z`}});r.appendChild(a),r.style.clipPath=a;i=MS(o,s)([a],e,n);return i.finished.then(()=>{a.remove(),r.style.clipPath=null}),i}),WS=(zS.props={},{visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1});function GS(t,e,n,r){t.style[e]=n,r&&t.children.forEach(t=>GS(t,e,n,r))}function HS(t){GS(t,"visibility","hidden",!0)}function VS(t){GS(t,"visibility","visible",!0)}function YS(t){return lt(t).selectAll("."+vh).nodes().filter(t=>!t.__removed__)}function qS(t,e){return $S(t,e).flatMap(({container:t})=>YS(t))}function $S(e,t){return t.filter(t=>t!==e&&t.options.parentKey===e.options.key)}function US(t){return lt(t).select("."+xh).node()}function XS(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 KS(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 ZS(t){return t=>t.__data__.color}function QS(t){const e=t.scale["x"];return t=>{t=t.__data__.x;return e.invert(t)}}function JS(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 t3(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:WS[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 e3(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 n3(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 r3(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=o0(t,(t,e)=>{t=t.__data__.x,e=e.__data__.x;return t-e});for(let t=1;t<e.length;t++){var n=R2();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(),Ab(c,t=>l(t,s))),{fill:i=s.getAttribute("fill")}=r,a=at(r,["fill"]),o=new kc({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 i3(n,t,e){var r,i,a,o=t=>{var e=n.style["transform"];return e?e+" "+t:t};return L0(e)?(a=n.__data__["points"],[a,i]=C0(e)?Gb(a):a,r=Lb(a,a=e.getCenter()),i=Lb(i,a),a=Rb(r)+Bb(r,i)/2,o(`translate(${t*Math.cos(a)}, ${t*Math.sin(a)})`)):C0(e)?o(`translate(${t}, 0)`):o(`translate(0, ${-t})`)}function a3(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 lS(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 lS(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 mx(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=Ab(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(lS)})()?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 o3(t,e){t=t.getRootNode().defaultView.getContextService().getDomElement();null!=t&&t.style&&(t.style.cursor=e)}function s3(t,e,r){return t.find(n=>Object.entries(e).every(([t,e])=>r(n)[t]===e))}function l3(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=e0(h,o);t=n3(h,a);const[p,g]=r3(Object.assign({elements:h,valueof:t,link:n,coordinate:l},st(u.active,"link"))),[y,m,v]=a3(Object.assign({document:e.ownerDocument,scale:s,coordinate:l,background:r,valueof:t},st(u.active,"background"))),{setState:b,removeState:x,hasState:w}=t3(ot(u,{active:Object.assign({},(null==(n=u.active)?void 0:n.offset)&&{transform:(...t)=>{var e=u.active.offset(...t),[,t]=t;return i3(h[t],e,l)}})}),t);let M;const k=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)}})}},O=(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(()=>{O(),M=null},i)):O())},S=()=>{O()},A=(e.addEventListener("pointerover",k),e.addEventListener("pointerout",E),e.addEventListener("pointerleave",S),t=>{t=t.nativeEvent;t||O(!1)}),_=t=>{var e=t["nativeEvent"];!e&&(e=t.data["data"],t=s3(h,e,a))&&k({target:t,nativeEvent:!1})};return c.on("element:highlight",_),c.on("element:unhighlight",A),()=>{e.removeEventListener("pointerover",k),e.removeEventListener("pointerout",E),e.removeEventListener("pointerleave",S),c.off("element:highlight",_),c.off("element:unhighlight",A);for(const t of h)m(t),g(t)}}function c3(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 l3(US(t),Object.assign({elements:YS,datum:JS(r),groupKey:l?l(r):void 0,coordinate:o,scale:a,state:e3(i,[["active",c?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:c,link:u,delay:s,emitter:n},h))}}function u3(t){return c3(Object.assign(Object.assign({},t),{createGroup:QS}))}function h3(t){return c3(Object.assign(Object.assign({},t),{createGroup:ZS}))}function f3(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=e0(m,d);t=n3(m,f);const[x,w]=r3(Object.assign({link:p,elements:m,valueof:t,coordinate:n},st(a.selected,"link"))),[M,k]=a3(Object.assign({document:e.ownerDocument,background:r,coordinate:n,scale:i,valueof:t},st(a.selected,"background"))),{setState:O,removeState:o,hasState:E}=t3(ot(a,{selected:Object.assign({},(null==(r=a.selected)?void 0:r.offset)&&{transform:(...t)=>{var e=a.selected.offset(...t),[,t]=t;return i3(m[t],e,n)}})}),t),S=(t=!0)=>{for(const e of m)o(e,"selected","unselected"),w(e),k(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)?O(l,"selected"):(O(l,"unselected"),w(l)),l!==i&&k(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)O(u,"unselected"),w(u),k(u)}else{e=t.some(t=>E(t,"selected"));for(const h of m)c.has(h)?O(h,"selected"):E(h,"selected")||O(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=s3(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 d3(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 f3(US(t),Object.assign({elements:YS,datum:JS(r),groupKey:s?s(r):void 0,coordinate:a,scale:o,state:e3(i,[["selected",l?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:l,link:c,emitter:n},u))}}function p3(t){return d3(Object.assign(Object.assign({},t),{createGroup:QS}))}function g3(t){return d3(Object.assign(Object.assign({},t),{createGroup:ZS}))}function y3(t){var{wait:O=20,leading:E,trailing:S=!1,labelFormatter:A=t=>""+t}=t,_=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=o0(t.map(t=>d[t])),u=ot({},e),h=u.marks.find(t=>"line"===t.type);t=v0(r0(t,t=>v0(t,t=>+f[t])/x0(t,t=>+f[t]),t=>l[t]).values());ot(h,{scale:{y:{domain:[1/t,t]}}});const p=US(r),g=r.getElementsByClassName(vh);const y=e0(r.getElementsByClassName(Mh),t=>t.__data__.key.split("-")[0]),m=new xc({style:Object.assign({x1:0,y1:0,x2:0,y2:p.getAttribute("height"),stroke:"black",lineWidth:1},st(_,"rule"))}),v=new Rc({style:Object.assign({x:0,y:p.getAttribute("height"),text:"",fontSize:10},st(_,"label"))}),b=(m.append(v),p.appendChild(m),(t,e,n)=>{var[t]=t.invert(n),n=e.invert(t);return c[$p(c,n)]}),x=(t,e)=>{m.setAttribute("x1",t[0]),m.setAttribute("x2",t[0]),v.setAttribute("text",A(e))};let w;var M;const k=ln(t=>{t=XS(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[Gp(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)}}},O,{leading:E,trailing:S});return M=[0,0],X(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[Gp(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",k),p.addEventListener("pointermove",k),p.addEventListener("pointerleave",k),()=>{m.remove(),p.removeEventListener("pointerenter",k),p.removeEventListener("pointermove",k),p.removeEventListener("pointerleave",k)}}}function m3({wait:l=30,leading:c,trailing:u=!1}){return t=>{const{options:r,update:i,container:e}=t,a=US(e),o=ot({},r);for(const s of o.marks)s.animate=!1;const n=ln(t=>{var e,n,t=XS(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 v3=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 b3(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 x3(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:b3(r,a)}}),o.emit("element:"+i,r),o.emit(n+":"+i,r)):o.emit(e+":"+i,t))}}function w3(){return(t,e,n)=>{const{container:r,view:i}=t,a=x3(v3.CLICK,i,n,t=>1===t.detail),o=x3(v3.DBLCLICK,i,n,t=>2===t.detail),s=x3(v3.POINTER_TAP,i,n),l=x3(v3.POINTER_DOWN,i,n),c=x3(v3.POINTER_UP,i,n),u=x3(v3.POINTER_OVER,i,n),h=x3(v3.POINTER_OUT,i,n),f=x3(v3.POINTER_MOVE,i,n),d=x3(v3.POINTER_ENTER,i,n),p=x3(v3.POINTER_LEAVE,i,n),g=x3(v3.POINTER_UPOUTSIDE,i,n),y=x3(v3.DRAG_START,i,n),m=x3(v3.DRAG,i,n),v=x3(v3.DRAG_END,i,n),b=x3(v3.DRAG_ENTER,i,n),x=x3(v3.DRAG_LEAVE,i,n),w=x3(v3.DRAG_OVER,i,n),M=x3(v3.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 M3({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 lE({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 k3({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 O3(t){var e=t["tooltipElement"];e&&(e.destroy(),t.tooltipElement=void 0)}function E3(t){var e=t["value"];return Object.assign(Object.assign({},t),{value:void 0===e?"undefined":e})}function S3(t,e){var{color:t,series:n}=t,{color:e,series:r}=e,i=t=>t&&t.invert&&!(t instanceof Kv)&&!(t instanceof Yv);return i(n)?n.invert(r):r&&r!==e?r:!i(t)||(n=t.invert(e),Array.isArray(n))?null:n}function A3(t){var e=t.getAttribute("fill"),n=t.getAttribute("stroke"),t=t["__data__"],{color:t=e&&"transparent"!==e?e:n}=t;return t}function _3(t,e=t=>t){t=new Map(t.map(t=>[e(t),t]));return Array.from(t.values())}function T3(n,s,l,t=n.map(t=>t.__data__)){const e=t=>t instanceof Date?+t:t;var r=_3(t.map(t=>t.title),e).filter(Ag),t=t.flatMap((r,t)=>{const i=n[t],{items:e=[],title:a}=r;t=e.filter(Ag);const o=void 0!==l?l:e.length<=1;return t.map(t=>{var{color:e=A3(i),name:n}=t,t=at(t,["color","name"]),n=o?S3(s,r)||n:n||S3(s,r);return Object.assign(Object.assign({},t),{color:e,name:n||a})})}).map(E3);return Object.assign(Object.assign({},0<r.length&&{title:r.join(",")}),{items:_3(t,t=>`(${e(t.name)}, ${e(t.value)}, ${e(t.color)})`)})}function P3(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=S0(n),g=S0(e);const[y,m,v,b]=u?(n=Math.min(a,o)/2,a=Rb(Lb([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 xc({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 C3(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function L3(t,e){return Array.from(t.values()).some(t=>{return null==(t=t.interaction)?void 0:t[e]})}function N3(t,e){return void 0===t?e:t}function j3(t){var{title:t,items:e}=t;return 0===e.length&&void 0===t}function R3(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:k=0,startY:O=0,body:E=!0,single:S=!0,position:A,enterable:_,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=C0(v),L=L0(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,[o0(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 o0([t[n],e[n]])})(t);return r>=t&&r<=e})},l=ln(t=>{var e=XS(p,t);if(e){var n=p.getRenderBounds();const c=n.min[0],u=n.min[1],h=[e[0]-k,e[1]-O];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]=o0([n[0],n[n.length-1]]);return t<r||i<t?null:e[(0,Gp(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[$e(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[w0(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=T3(n,m,w,l);g&&l.items.sort((t,e)=>g(t)-g(e)),y&&(l.items=l.items.filter(y)),0===n.length||j3(l)?B():(E&&M3({root:p,data:l,x:e[0]+c,y:e[1]+u,render:x,event:t,single:S,position:A,enterable:_,mount:T,bounding:P}),b&&(n=s.map(t=>t[1]),P3(p,n,Object.assign(Object.assign({},Y),{plotWidth:D,plotHeight:F,mainWidth:z,mainHeight:W,insetLeft:G,insetTop:H,startX:k,startY:O,transposed:C,polar:L}))),M.emit("tooltip:show",Object.assign(Object.assign({},t),{nativeEvent:!0,data:{data:{x:cS(m.x,I(h),!0)}}})))}},n,{leading:r,trailing:i}),B=()=>{k3({root:p,single:S,emitter:M,mount:T}),b&&C3(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=()=>{k3({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),O3(p),b&&C3(p)}}function I3(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),k=e0(w,f),O=ln(t=>{var e,n,r,i=t["target"];!M.has(i)||(e=f(i),e=1===(e=k.get(e)).length?function(n){var{title:t,items:e=[]}=t=n["__data__"],e=e.filter(Ag).map(t=>{var{color:e=A3(n)}=t,t=at(t,["color"]);return Object.assign(Object.assign({},t),{color:e})}).map(E3);return Object.assign(Object.assign({},t&&{title:t}),{items:e})}(e[0]):T3(e,o,l),c&&e.items.sort((t,e)=>c(t)-c(e)),u&&(e.items=e.items.filter(u)),j3(e))?k3({root:a,single:d,emitter:h,mount:v}):({offsetX:n,offsetY:r}=t,x&&M3({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:b3(i,m)}})))},e,{leading:n,trailing:r}),E=t=>{t=t.target;M.has(t)&&k3({root:a,single:d,emitter:h,mount:v})},S=({nativeEvent:t,data:e})=>{var n,r,i;t||(t=s3(w,e.data,y))&&({x:e,y:n,width:r,height:i}=t.getBBox(),O({target:t,offsetX:e+r/2,offsetY:n+i/2}))},A=({nativeEvent:t}={})=>{t||k3({root:a,single:d,emitter:h,nativeEvent:!1,mount:v})};return h.on("tooltip:show",S),h.on("tooltip:hide",A),i||(a.addEventListener("pointerover",O),a.addEventListener("pointermove",O),a.addEventListener("pointerout",E)),()=>{i||(a.removeEventListener("pointerover",O),a.removeEventListener("pointermove",O),a.removeEventListener("pointerout",E)),h.off("tooltip:show",S),h.off("tooltip:hide",A),O3(a)}}function B3(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=L3(o,"seriesTooltip"),c=L3(o,"crosshairs"),r=US(r),l=N3(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 R3(r,Object.assign(Object.assign({},y),{elements:YS,scale:a,coordinate:s,crosshairs:N3(f,c),item:p,emitter:n}));if(l&&g){l=t.filter(t=>t!==e&&t.options.parentKey===e.options.key);const u=qS(e,t),a=l[0].view.scale;t=r.getBounds(),l=t.min[0],t=t.min[1];return R3(r.parentNode.parentNode,Object.assign(Object.assign({},y),{elements:()=>u,scale:a,coordinate:s,crosshairs:N3(f,c),item:p,startX:l,startY:t,emitter:n}))}return I3(r,Object.assign(Object.assign({},y),{datum:JS(i),elements:YS,scale:a,coordinate:s,groupKey:h?QS(i):void 0,item:p,emitter:n,view:i}))}}const D3="legend-category",F3="items-item",z3="legend-category-item-marker",W3="legend-category-item-label";function G3(t){return t.getElementsByClassName(z3)[0]}function H3(t){return t.getElementsByClassName(W3)[0]}function V3(t){return t.getElementsByClassName(F3)}function Y3(t){return t.getElementsByClassName(D3)}function q3(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function $3(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}=t3(f,void 0),{setState:g,removeState:y}=t3(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=()=>{o3(t,"pointer")},w=()=>{o3(t,"default")},M=n=>X(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 k=n=>X(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()))}),O=e=>X(this,void 0,void 0,function*(){var t=e["nativeEvent"];t||(v=m.map(o),yield r(v),b())});return s.on("legend:filter",k),s.on("legend:reset",O),()=>{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",k),s.off("legend:reset",O)}}function U3(){return(t,e,r)=>{const{container:i,view:a,options:o,update:s}=t;t=Y3(i);const l=(r,i)=>X(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}=q3(t).scales[0];return $3(i,{legends:V3,marker:G3,label:H3,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 X3(){return(t,e,a)=>{const{container:n,view:r,options:i}=t;t=Y3(n);const o=YS(n);var s=e3(i,["active","inactive"]),l=n3(o,JS(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=q3(d).scales[0].name,y=V3(d),m=(t=>{var{scale:{[t]:t}}=r;return t})(g),v=e0(o,t=>m.invert(t.__data__[g]));var{state:u={}}=d.attributes,{inactive:u={}}=u;const{setState:b,removeState:x}=t3(s,l);var h={inactive:st(u,"marker")},u={inactive:st(u,"label")};const{setState:w,removeState:M}=t3(h),{setState:k,removeState:O}=t3(u),E=t=>{for(const r of y){var e=G3(r),n=H3(r);(r===t||null===t?(M(e,"inactive"),O):(w(e,"inactive"),k))(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}}))},A=new Map;for(const C of y){var f=t=>{S(t,C)};C.addEventListener("pointerover",f),A.set(C,f)}const _=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||_({nativeEvent:!1})};d.addEventListener("pointerleave",_),a.on("legend:highlight",T),a.on("legend:unhighlight",P);c.push(()=>{d.removeEventListener(_),a.off("legend:highlight",T),a.off("legend:unhighlight",P);for(var[t,e]of A)t.removeEventListener(e)})}return()=>c.forEach(t=>t())}}function K3(t,e){for(var[n,r]of Object.entries(e))t.style(n,r)}const Z3=Ox(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(Tg(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(Tg(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:k=h}=M,M=at(M,["render"]),O=st(c,"handleSE"),{render:E=h}=O,O=at(O,["render"]),S=st(c,"handleSW"),{render:h=h}=S,S=at(S,["render"]);var A=i=>()=>{return new(Ox(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(K3,Object.assign({width:i,height:a},Tg(c,"handle"))),t.maybeAppend("handle-n",A(d)).style("x",u).style("y",-u).style("width",i-s).style("height",s).style("fill","transparent").call(K3,f),t.maybeAppend("handle-e",A(g)).style("x",i-u).style("y",u).style("width",s).style("height",a-s).style("fill","transparent").call(K3,p),t.maybeAppend("handle-s",A(m)).style("x",u).style("y",a-u).style("width",i-s).style("height",s).style("fill","transparent").call(K3,y),t.maybeAppend("handle-w",A(b)).style("x",-u).style("y",u).style("width",s).style("height",a-s).style("fill","transparent").call(K3,v),t.maybeAppend("handle-nw",A(w)).style("x",-u).style("y",-u).style("width",s).style("height",s).style("fill","transparent").call(K3,x),t.maybeAppend("handle-ne",A(k)).style("x",i-u).style("y",-u).style("width",s).style("height",s).style("fill","transparent").call(K3,M),t.maybeAppend("handle-se",A(E)).style("x",i-u).style("y",a-u).style("width",s).style("height",s).style("fill","transparent").call(K3,O),t.maybeAppend("handle-sw",A(h)).style("x",-u).style("y",a-u).style("width",s).style("height",s).style("fill","transparent").call(K3,S)}});function Q3(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,k=(o3(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 kc({style:Object.assign(Object.assign({},f),{fill:n,fillOpacity:r,stroke:i,pointerEvents:"none"})}),y=new Z3({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 Z3({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)},O=(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"}},A=t=>T(t)||_(t),_=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]=$S(l,t);y&&A(e)?A(e)&&(g=[t,n]):(k(t,n),v=!0)},C=t=>{var e,n,r,i,a,o,s=t["target"],t=$S(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=$S(l,t),[e,n,r,i]=E(d,p),v=!1,o(e,n,r,i,t))},N=t=>{t=t.target;y&&!A(t)&&O()},j=t=>{t=t.target;y&&A(t)&&!v?T(t)?r3(l,"move"):_(t)&&r3(l,S[t.id].cursor):r3(l,"crosshair")},R=()=>{r3(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||k(t,e),d=[t,e],p=[n,r],E([t,e],[n,r],i)},remove(t=!0){y&&O(t)},destroy(){y&&O(!1),r3(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 K3(e,t,n){return t.filter(t=>{return t!==e&&({interaction:t={}}=t.options,Object.values(t).find(t=>t.brushKey===n))})}function Z3(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=JS(y,a),n=st(e,"mask");const{setState:b,removeState:x}=ZS(p,i),w=new Map,{width:M,height:k,x:O=0,y:E=0}=f(t);a=s||[0,0,M,k];const S=()=>{for(const t of[...y,...v])x(t,"active","inactive")},A=(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")},_=()=>{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 Lc({style:{x:t+O,y:e+E,width:n-t,height:r-e}}),b(o,"inactive"),b(a,"active")}},P=X3(t,Object.assign(Object.assign({},n),{extent:a,brushRegion:o,reverse:l,selectedHandles:r,brushended:t=>{var e=h?_:S;t&&g.emit("brush:remove",{nativeEvent:!0}),e()},brushed:(t,e,n,r,i)=>{var a=lS(t,e,n,r,c,u);i&&g.emit("brush:highlight",{nativeEvent:!0,data:{selection:a}}),(h?T:A)(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=cS(t,e),e=cS(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 Q3(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=YS(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],Z3(s.parentNode.parentNode,Object.assign(Object.assign({elements:()=>HS(t,e),datum:KS(VS(t,e).map(t=>t.view)),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:[r,i,a,o],state:QS(VS(t,e).map(t=>t.options),h),emitter:n,scale:f,coordinate:d,selectedHandles:void 0},u),m));const p=Z3(s,Object.assign(Object.assign({elements:GS,key:t=>t.__data__.key,siblings:()=>{return K3(t,e,y).map(t=>YS(t.container))},datum:KS([l,...K3(t,e,y).map(t=>t.view)]),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0,state:QS([c,...K3(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 J3(t,e,n,r,i){var[,i,,a]=i;return[t,i,n,a]}function tA(t){return Q3(Object.assign(Object.assign({},t),{brushRegion:J3,selectedHandles:["handle-e","handle-w"]}))}function eA(t,e,n,r,i){var[i,,a]=i;return[i,e,a,r]}function nA(t){return Q3(Object.assign(Object.assign({},t),{brushRegion:eA,selectedHandles:["handle-n","handle-s"]}))}const rA="axis",iA="axis-hot-area";function aA(t){return t.getElementsByClassName(rA)}function oA(t){return t.getElementsByClassName("axis-line")[0]}function sA(t){return t.getElementsByClassName("axis-main-group")[0].getLocalBounds()}function lA(t,e){var{cross:n,offsetX:i}=e,e=at(e,["cross","offsetX","offsetY"]),r=sA(t),[t]=oA(t).getLocalBounds().min;const[a,o]=r.min,[s,l]=r.max;r=2*(s-a);return{brushRegion:eA,hotZone:new Lc({className:iA,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 cA(t,e){var{offsetY:i,cross:n=!1}=e,e=at(e,["offsetY","offsetX","cross"]),r=sA(t),[,t]=oA(t).getLocalBounds().min;const[a,o]=r.min,[s,l]=r.max;r=l-o;return{brushRegion:J3,hotZone:new Lc({className:iA,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 uA(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}=ZS(u,JS(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))}},k=(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(sS(n,i))})(n,t)),e&&h.emit("brushAxis:highlight",{nativeEvent:!0,data:{selection:(()=>{if(!O)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})()}})}),O=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)?cA:lA)(P,{offsetY:o,offsetX:l,cross:O,zIndex:999,fill:"transparent"});P.parentNode.appendChild(C);var S=X3(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 k(a,t)},brushed(t,e,n,r,i){m.set(P,N(t,e,n,r)),k(a,i)}}));E.push(S)}const A=(t={})=>{t=t.nativeEvent;t||E.forEach(t=>t.remove(!1))},_=(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=_(t,e,n),e=_(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",A),h.on("brushAxis:highlight",T),()=>{E.forEach(t=>t.destroy()),h.off("brushAxis:remove",A),h.off("brushAxis:highlight",T)}}function hA(l){return(t,e,n)=>{var{container:t,view:r,options:i}=t,{x:a,y:o}=YS(t).getBBox(),s=r["coordinate"];return uA(t,Object.assign({elements:GS,axes:aA,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:KS(r),state:QS(i,["active",["inactive",{opacity:.5}]]),coordinate:s,emitter:n},l))}}function fA(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=X3(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 dA(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=YS(n);let l=!1,c=!1,u=r;var{scale:i,coordinate:h}=r;return fA(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 lS(t,e,n,r,i,a)},filter:(r,i)=>X(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 pA(t){return dA(Object.assign(Object.assign({hideX:!0},t),{brushRegion:J3}))}function gA(t){return dA(Object.assign(Object.assign({hideY:!0},t),{brushRegion:eA}))}const yA="slider";function mA(t){return[t[0],t[t.length-1]]}function vA({channelDomain:C,className:L=yA,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=C0(a);const v=new Map,b=new Set;C=C||{x:s.getOptions().domain,y:l.getOptions().domain};for(const M of t){const k=M.attributes["orientation"],[O,E]=(w=k,x=void 0,x="vertical"===w?"y":"x",w="vertical"===w?"x":"y",m?[w,x]:[x,w]),S=""+N+Xe(O)+":filter",A="x"===O,_=s.getOptions()["ratio"],T=l.getOptions()["ratio"],P=t=>{var e,n;return t.data?(e=t.data["selection"],[e=mA(C.x),n=mA(C.y)]=e,A?[sS(s,e,_),sS(l,n,T)]:[sS(l,n,T),sS(s,e,_)]):(n=t.detail["value"],[function(t,e,n){var[t,r]=t;return sS(e,[oS(e,(n=n?t=>1-t:t=>t)(t),!0),oS(e,n(r),!1)])}(n,i[O],m&&"horizontal"===k),C[E]])};var x=ln(l=>X(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[O]=e,C[E]=s,[n,r,i,a=!1]=[u,{[O]:{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=A?e:s,s=A?s:e,c.emit(S,Object.assign(Object.assign({},l),{nativeEvent:t,data:{selection:[mA(o),mA(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 pl("valuechange",{data:n,nativeEvent:!1})),n=A?cS(t,s):cS(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 bA="g2-scrollbar";function xA(o={}){return(t,e,n)=>{var r,{view:i,container:a}=t;return a.getElementsByClassName(bA).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}),vA(Object.assign(Object.assign({},o),{channelDomain:r,className:bA,prefix:"scrollbar",hasState:!0,setValue:(t,e)=>t.setValue(e[0])}))(t,e,n)):()=>{}}}const wA={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 MA(t){return"text"===t.nodeName&&!!t.isOverflowing()}function kA(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"];MA(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 pc({className:"poptip",style:{innerHTML:(r="div",i=i,a=Object.assign(Object.assign({},wA),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"];MA(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 OA(n){return(t,...e)=>ot({},n(t,...e),t)}function EA(n){return(t,...e)=>ot({},t,n(t,...e))}function SA(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 AA=()=>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:SA(e,u),x:null!=n?n:o,y:null!=r?r:s,width:null!=i?i:l,height:null!=a?a:c})})},_A=(AA.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=SA(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}),TA=(_A.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:SA(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"})]}),PA=(TA.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:k,y:O,key:E,frame:S,labelTransform:A,parentKey:_,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:k,y:O,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:A,margin:d,marginLeft:p,marginBottom:g,marginTop:y,marginRight:m,parentKey:_,clip:T,style:P},!L&&{title:C}),{marks:[Object.assign(Object.assign(Object.assign({},t),{key:E+"-0",data:v}),L&&{title:C})]})]});PA.props={};class CA{constructor(t){this.$value=t}static of(t){return new CA(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}const LA=OA(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=e0(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"))}}}),NA=OA(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)?[Kp(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)}}}),jA=OA(()=>({animate:{enterType:"fadeIn"}})),RA=EA(()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}})),IA=EA(()=>({type:"cell"})),BA=EA(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}}]}}}),DA=EA((t,c=function(t){t=t.points;return Db(t)},w=function(a){return(t,e)=>{var{rowIndex:t,rowValuesLength:n,columnIndex:r,columnValuesLength:i}=t;return t!==n-1?FA(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?FA(r,e):(n=e.length?void 0:null,ot({title:0===t&&void 0,grid:n},r))}},k={})=>{const{data:e,encode:n,children:u,scale:r,x:O=0,y:E=0,shareData:h=!1,key:S}=t,A=e["value"],{x:_,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=_b(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{[_]:t,[T]:e}=t,t=void 0===_||t===n,e=void 0===T||e===r;return t&&e}).map(t=>A.filter(t)),v=h?v0(l,t=>t.length):void 0,b=n.map(([t,e])=>({columnField:_,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:_?5:void 0},y:{tickCount:T?5:void 0}},r=r?g:0===g.length?[]:A,l={color:{domain:P}},o={x:zA(o,w)(p,r),y:zA(a,M)(p,r)};return Object.assign(Object.assign({key:n+"-"+c,data:r,x:u+y+O,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),k)})})}}});function FA(t,e){return e.length?ot({title:!1,tick:null,label:null},t):ot({title:!1,tick:null,label:null,grid:null},t)}function zA(t,e){return"function"==typeof t?t:null===t||!1===t?()=>null:e(t)}const WA=()=>t=>{return[CA.of(t).call(IA).call(NA).call(jA).call(LA).call(RA).call(BA).call(DA).value()]},GA=(WA.props={},OA(t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),HA=EA(t=>{const{data:w,children:c,x:M=0,y:k=0,key:O}=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=_b(t);const s=t.map(({points:t})=>Db(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 FA(r,e)})(y,w),y:("function"==typeof(n=s)?n:null===n?()=>null:(t,e)=>{t=t.columnIndex;if(0!==t)return FA(n,e)})(y,w)};return Object.assign({data:w,parentKey:O,key:i+"-"+c,x:u+m+M,y:h+v+k,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)})})}}}),VA=EA(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 YA=()=>t=>{return[CA.of(t).call(IA).call(NA).call(HA).call(VA).call(jA).call(RA).call(GA).value()]},qA=OA(t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}})),$A=OA(t=>({coordinate:{type:"polar"}})),UA=t=>{var e=t["encode"],t=at(t,["encode"]),e=e["position"];return Object.assign(Object.assign({},t),{encode:{x:e}})};function XA(t){return t=>null}function KA(t){var t=t["points"],[t,e,n,r]=t,i=jb(t,r),t=Lb(t,r),r=Bb(t,Lb(e,n)),e=1/Math.sin(r/2),i=i/(1+e),a=i*Math.sqrt(2),[n,o]=n,t=Ib(t)+r/2,r=i*e;return[n+r*Math.sin(t)-a/2,o+r*Math.cos(t)-a/2,a,a]}const ZA=()=>t=>{return[CA.of(t).call(IA).call(UA).call(NA).call($A).call(BA).call(DA,KA,XA,XA,{frame:!1}).call(jA).call(RA).call(qA).value()]};const QA=()=>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 JA(t,e){if(null!==t)return{type:"column",value:t,field:e}}function t4(t,e){t=JA(t,e);return Object.assign(Object.assign({},t),{inferred:!0})}function e4(t,e){if(null!==t)return{type:"column",value:t,field:e,visual:!0}}function n4(t,e){var n=[];for(const r of t)n[r]=e;return n}function r4(t,e){var t=t[e];return t?({value:e,field:t=null}=t,[e,t]):[null,null]}function i4(t,...e){for(const i of e){if("string"!=typeof i)return[i,null];var[n,r]=r4(t,i);if(null!==n)return[n,r]}return[null,null]}function a4(t){return!(t instanceof Date)&&"object"==typeof t}QA.props={};const o4=()=>(t,e)=>{var n=e["encode"],n=n["y1"];return void 0!==n?[t,e]:[t,ot({},e,{encode:{y1:t4(n4(t,0))}})]};function s4(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=r4(r,t))?void 0:t[0]]}).filter(([,t])=>Ag(t));return Array.from(e0(e,e=>i.map(([,t])=>t[e]).join("-")).values())}function l4(t){var a,r;return Array.isArray(t)?(a=t,(i,t,e)=>(n,r)=>a.reduce((t,e)=>0!==t?t:Wp(i[n][e],i[r][e]),0)):"function"==typeof t?(r=t,(e,t,n)=>g4(t=>r(e[t]))):"series"===t?h4:"value"===t?f4:"sum"===t?d4:"maxIndex"===t?p4:()=>null}function c4(t,e){for(const n of t)n.sort(e)}function u4(t,e){return(null==e?void 0:e.domain)||Array.from(new Set(t))}function h4(t,e,n){return g4(t=>n[t])}function f4(t,e,n){return g4(t=>e[t])}function d4(t,n,e){t=_b(t),t=Array.from(e0(t,t=>e[+t]).entries());const r=new Map(t.map(([t,e])=>[t,e.reduce((t,e)=>t+ +n[e])]));return g4(t=>r.get(e[t]))}function p4(t,n,e){t=_b(t),t=Array.from(e0(t,t=>e[+t]).entries());const r=new Map(t.map(([t,e])=>[t,b0(e,t=>n[t])]));return g4(t=>r.get(e[t]))}function g4(n){return(t,e)=>Wp(n(t),n(e))}o4.props={};const y4=(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]=r4(r,"y"),[s,l]=r4(r,"y1"),[r]=j?i4(r,"series","color"):r4(r,"color"),c=s4(T,t,e),n=l4(P)(n,a,r),u=(n&&c4(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 A of m.reverse()){var w=f[A];n=u[A]=(h[A]=n)+w}let r=g;for(const _ of y){var M=f[_];0<M?r=u[_]=(h[_]=r)+M:u[_]=h[_]=r}}const k=new Set(d),O=new Set(p);r="y"===L?u:h,n="y"===N?u:h;return[t,ot({},e,{encode:{y0:t4(a,o),y:JA(r,o),y1:JA(n,l)},style:Object.assign({first:(t,e)=>k.has(e),last:(t,e)=>O.has(e)},i)})]}};function m4(t){t=t.type;return"string"==typeof t&&["stackY","dodgeX","groupX"].includes(t)}y4.props={};const v4=a=>(t,e,n)=>{var{encode:r,transform:i=[]}=e;return i.some(m4)||({x:i,y:r}=r,void 0===i)||void 0===r?[t,e]:(i=a["series"],r=i?["x","series"]:"x",y4({groupBy:r})(t,e,n))},b4=(v4.props={},(t={})=>{const{channel:s="x"}=t;return(t,e)=>{const n=e["encode"];var r=e["tooltip"];if(Lg(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=>r4(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}})]}}),x4=(b4.props={},()=>(t,e)=>{var n=e["encode"],n=n["x"];return void 0!==n?[t,e]:[t,ot({},e,{encode:{x:t4(n4(t,0))},scale:{x:{guide:null}}})]}),w4=(x4.props={},()=>(t,e)=>{var n=e["encode"],n=n["y"];return void 0!==n?[t,e]:[t,ot({},e,{encode:{y:t4(n4(t,0))},scale:{y:{guide:null}}})]}),M4=(w4.props={},()=>(t,e)=>{var n=e["encode"],n=n["size"];return void 0!==n?[t,e]:[t,ot({},e,{encode:{size:e4(n4(t,3))}})]}),k4=(M4.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:JA(r)}})]}),O4=(k4.props={},()=>(t,e)=>{var n=e["encode"],{series:r,color:i}=n;return void 0!==r||void 0===i?[t,e]:([r,i]=r4(n,"color"),[t,ot({},e,{encode:{series:JA(r,i)}})])}),E4=(O4.props={},()=>(t,e)=>{var n=e["data"];return!Array.isArray(n)||n.some(a4)?[t,e]:[t,ot({},e,{encode:{y:JA(n)}})]}),S4=(E4.props={},()=>(t,e)=>{var n=e["data"];return!Array.isArray(n)||n.some(a4)?[t,e]:[t,ot({},e,{encode:{x:JA(n)}})]}),A4=(S4.props={},()=>(t,e)=>{var n=e["encode"],r=n["y1"];return r?[t,e]:([r]=r4(n,"y"),[t,ot({},e,{encode:{y1:JA([...r])}})])}),_4=(A4.props={},()=>(t,e)=>{var n=e["encode"],r=n["x1"];return r?[t,e]:([r]=r4(n,"x"),[t,ot({},e,{encode:{x1:JA([...r])}})])}),T4=(_4.props={},t=>{const i=t["channel"];return(t,e)=>{const{encode:a,tooltip:n}=e;var r;return Lg(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}})])}}),P4=(T4.props={},()=>(t,e)=>[t,ot({scale:{x:{padding:0},y:{padding:0}}},e)]),C4=(P4.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:JA([i||0]),y:JA([a||0])},scale:{x:{type:"identity",independent:!0,guide:null},y:{type:"identity",independent:!0,guide:null}},style:n})]}),L4=(C4.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])))})]}),N4=(L4.props={},()=>(t,e)=>{var n,r=e["data"];return!Array.isArray(r)||r.some(a4)?[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:JA(n),y:JA(r)}})])}),j4=(N4.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:e4(n4(t,void 0))}})]}),R4=(j4.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]=r4(r,"y"),[r]=i4(r,"series","color"),o=u4(r,i),i=s4(c,t,e),n=l4(h)(n,a,r),s=(n&&c4(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:JA(s)}})]}}),I4=(R4.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,r4(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(e0(n,t=>h[t]).values());a.push(...o)}i=a}if(y){const[f]=r4(e,y);f&&i.sort((t,e)=>g(t,f)-g(e,f)),m&&i.reverse()}r=(v||3e3)/i.length;const[s]=v?[n4(n,r)]:i4(e,"enterDuration",n4(n,r));var[l]=i4(e,"enterDelay",n4(n,0)),c=new Array(n.length);for(let t=0,e=0;t<i.length;t++){const n=i[t];var u=v0(n,t=>+s[t]);for(const d of n)c[d]=+l[d]+e;e+=u}return[n,ot({},t,{encode:{enterDuration:e4(s),enterDelay:e4(c)}})]}});I4.props={};const B4=(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,r4(n,t)[0]]),[,o]=a.find(([t])=>"y"===t),s=a.map(([t])=>[t,new Array(e.length)]),i=s4(p,e,t),l="function"==typeof(f=g)?f:{min:(t,e)=>x0(t,t=>e[+t]),max:(t,e)=>v0(t,t=>e[+t]),first:(t,e)=>e[t[0]],last:(t,e)=>e[t[t.length-1]],mean:(t,e)=>S0(t,t=>e[+t]),median:(t,e)=>A0(t,t=>e[+t]),sum:(t,e)=>P0(t,t=>e[+t]),deviation:(t,e)=>Xp(t,t=>e[+t])}[f]||v0;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=Lg(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,JA(e,r4(n,t)[1])]))},!f&&n.y0&&{tooltip:{items:[{channel:"y0"}]}}))]}};function D4(t,e,n){return null===t?[-.5,.5]:(t=u4(t,e),[-(e=new Hv({domain:t,range:[0,1],padding:n}).getBandWidth())/2,e/2])}function F4(t,e,n){return e*(1-t)+n*t}B4.props={};const z4=(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]=r4(n,"x"),[n]=r4(n,"y");const o=D4(a,r,l),s=D4(n,i,c);a=t.map(()=>F4(u(),...s)),r=t.map(()=>F4(u(),...o));return[t,ot({scale:{x:{padding:.5},y:{padding:.5}}},e,{encode:{dy:JA(a),dx:JA(r)}})]}},W4=(z4.props={},(t={})=>{const{padding:a=0,random:o=Math.random}=t;return(t,e)=>{var{encode:n,scale:r}=e,r=r["x"],[n]=r4(n,"x");const i=D4(n,r,a);n=t.map(()=>F4(o(),...i));return[t,ot({scale:{x:{padding:.5}}},e,{encode:{dx:JA(n)}})]}}),G4=(W4.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,r4(n,t)[0]]);var a=i.map(([t])=>[t,new Array(e.length)]),o=s4(g,e,t),s=new Array(o.length);for(let t=0;t<o.length;t++){const e=o[t];var[l,c]=Kp(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,JA(e,r4(n,t)[1])]))})]}}),H4=(G4.props={},(t={})=>{const{groupBy:u="x",series:h=!0}=t;return(t,e)=>{var n=e["encode"];const[r]=r4(n,"y");var[,i]=r4(n,"y1"),n=(h?i4(n,"series","color"):r4(n,"color"),s4(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:JA(a,i)}})]}});function V4(t,e){return[t[0]]}function Y4(t,e){return[t[t.length-1]]}function q4(t,e){return[t[b0(t,t=>e[t])]]}function $4(t,e){return[t[w0(t,t=>e[t])]]}H4.props={};const U4=(t={})=>{const{groupBy:a="series",channel:o,selector:s}=t;return(t,e)=>{var n=e["encode"],t=s4(a,t,e);const[r]=r4(n,o),i="function"==typeof(n=s)?n:{first:V4,last:Y4,max:q4,min:$4}[n]||V4;return[t.flatMap(t=>i(t,r)),e]}},X4=(U4.props={},(t={})=>{var e=t["selector"],t=at(t,["selector"]);return U4(Object.assign({channel:"x",selector:e},t))}),K4=(X4.props={},(t={})=>{var e=t["selector"],t=at(t,["selector"]);return U4(Object.assign({channel:"y",selector:e},t))});function Z4(e){return t=>null===t?e:e+" of "+t}function Q4(){return[(t,e)=>S0(t,t=>+e[t]),Z4("mean")]}function J4(){return[(t,e)=>A0(t,t=>+e[t]),Z4("median")]}function t_(){return[(t,e)=>v0(t,t=>+e[t]),Z4("max")]}function e_(){return[(t,e)=>x0(t,t=>+e[t]),Z4("min")]}function n_(){return[(t,e)=>t.length,Z4("count")]}function r_(){return[(t,e)=>P0(t,t=>+e[t]),Z4("sum")]}function i_(){return[(t,e)=>e[t[0]],Z4("first")]}function a_(){return[(t,e)=>e[t[t.length-1]],Z4("last")]}K4.props={};const o_=(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:Q4,max:t_,count:n_,first:i_,last:a_,sum:r_,min:e_,median:J4}[t];if(e)return e();throw new Error(`Unknown reducer: ${t}.`)}(e),[i,a]=r4(l,t);e=e;var e=(o=a)||((e=e["from"])?([,e]=r4(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=JA(t,o),Object.assign(Object.assign({},t),{constant:!1}))),{aggregate:!0})]}),n=Object.keys(l).map(t=>{const[e,n]=r4(l,t);return[t,JA(c.map(t=>e[t[0]]),n)]}),r=c.map(t=>s[t[0]]);return[_b(c),ot({},e,{data:r,encode:Object.fromEntries([...n,...t])})]}},s_=(o_.props={},(t={})=>{const{channels:n=["x","y"]}=t,e=at(t,["channels"]);return o_(Object.assign(Object.assign({},e),{groupBy:(t,e)=>s4(n,t,e)}))}),l_=(s_.props={},(t={})=>s_(Object.assign(Object.assign({},t),{channels:["x","color","series"]}))),c_=(l_.props={},(t={})=>s_(Object.assign(Object.assign({},t),{channels:["y","color","series"]}))),u_=(c_.props={},(t={})=>s_(Object.assign(Object.assign({},t),{channels:["color"]})));function h_(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]=r4(o,a);var c,n=function(t,e,n){const{by:r=t,reducer:i="max"}=e,[a]=r4(n,r);if("function"==typeof i)return t=>i(t,a);if("max"===i)return t=>v0(t,t=>+a[t]);if("min"===i)return t=>x0(t,t=>+a[t]);if("sum"===i)return t=>P0(t,t=>+a[t]);if("median"===i)return t=>A0(t,t=>+a[t]);if("mean"===i)return t=>S0(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?o0(r0(s,c,o),([t,e],[n,r])=>Wp(e,r)||Wp(t,n)):o0(e0(s,o),([t,e],[n,r])=>c(e,r)||Wp(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}}})]}u_.props={};const f_=(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 h_(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]=r4(i,r);return i=o0(t,t=>a[t]),n&&i.reverse(),[i,e]}}},d_=(f_.props={},(t={})=>f_(Object.assign(Object.assign({},t),{channel:"x"}))),p_=(d_.props={},(t={})=>f_(Object.assign(Object.assign({},t),{channel:"color"}))),g_=(p_.props={},(t={})=>f_(Object.assign(Object.assign({},t),{channel:"y"})));g_.props={};const y_=(t={})=>{const{field:o,channel:s="y",reducer:l="sum"}=t;return(t,e)=>{var{data:n,encode:r}=e;const[i]=r4(r,"x");var a,n=o?(n=n,"string"==typeof(a=o)?n.map(t=>t[a]):n.map(a)):r4(r,s)[0],r=i0(t,function(e,n){if("function"==typeof e)return t=>e(t,n);if("sum"===e)return t=>P0(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 m_(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]=Db(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})`})}y_.props={};const v_=()=>(t,e)=>[t,ot({},e,{modifier:m_,axis:!1})],b_=(v_.props={},"thresholds");function x_(t){var e,[n,r]=Kp(t);return Math.min(200,(n=n,r=r,e=Up(t=t),t=Xp(t),e&&t?Math.ceil((r-n)*Math.cbrt(e)/(3.49*t)):1))}const w_=(t={})=>{const{groupChannels:s=["color"],binChannels:l=["x","y"]}=t,c=at(t,["groupChannels","binChannels"]),u={};return o_(Object.assign(Object.assign(Object.assign({},Object.fromEntries(Object.entries(c).filter(([t])=>!t.startsWith(b_)))),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]=r4(n,t);return t}),a=st(c,b_),o=t.filter(e=>i.every(t=>Ag(t[e]))),r=[...s.map(t=>{var[t]=r4(n,t);return t}).filter(Ag).map(e=>t=>e[t]),...l.map((t,e)=>{const n=i[e];e=a[t]||x_(n),e=m0().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(e0(o,e=>r.map(t=>t(e)).join("-")).values())}}))},M_=(w_.props={},(t={})=>{var e=t["thresholds"];return w_(Object.assign(Object.assign({},t),{thresholdsX:e,groupChannels:["color"],binChannels:["x"]}))});function k_(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 O_(t){if("function"==typeof t)return t;if("lttb"===t)return k_;var e={first:t=>[t[0]],last:t=>[t[t.length-1]],min:(t,e,n)=>[t[w0(t,t=>n[t])]],max:(t,e,n)=>[t[b0(t,t=>n[t])]],median:(t,e,n)=>{return[t[E0(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))}}M_.props={};const E_=(t={})=>{const{strategy:e="median",thresholds:a=2e3,groupBy:o=["series","color"]}=t,s=O_(e);return(t,e)=>{var n=e["encode"],t=s4(o,t,e);const[r]=r4(n,"x"),[i]=r4(n,"y");return[t.flatMap(t=>s(t,r,i,a)),e]}},S_=(E_.props={},(s={})=>(t,e)=>{const{encode:i,data:n}=e,r=Object.entries(s).map(([t,e])=>{const[n]=r4(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(Ag);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 A_(t){var{min:t,max:e}=t;return[[t[0],t[1]],[e[0],e[1]]]}function __(t,e){var[t,n]=t,[e,r]=e;return t>=e[0]&&t<=r[0]&&n>=e[1]&&n<=r[1]}S_.props={};const T_=t=>{const n=t["priority"];return t=>{const e=[];return n&&t.sort(n),t.forEach(t=>{WS(t);const i=t.getLocalBounds();e.some(t=>{var e=A_(i),t=A_(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]})?zS(t):e.push(t)}),t}};function P_(){const n=new Map;return[t=>n.get(t),(t,e)=>n.set(t,e)]}const C_=t=>{const{maxIterations:M=10,maxError:k=.1,padding:O=1}=t;return i=>{var e=i.length;if(!(e<=1)){const[g,y]=P_(),[m,v]=P_();var a,o,s,l,[c,t]=P_(),[u,n]=P_();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)=>Wp(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<O&&(d=(O-d)/2,r=Math.max(r,d),v(f,g-d),v(e,p+d))}}if(r<k)break}for(const w of i)w.style.y+=m(w)-g(w)}return i}};function L_(t){t/=255;return t<=.03928?t/12.92:Math.pow((.055+t)/1.055,2.4)}function N_(t,e,n){return.2126*L_(t)+.7152*L_(e)+.0722*L_(n)}function j_(t,e){var{r:t,g:n,b:r}=t,{r:e,g:i,b:a}=e,t=N_(t,n,r),n=N_(e,i,a);return(Math.max(t,n)+.05)/(Math.min(t,n)+.05)}function R_(e,t){return t[b0(t,t=>{return j_(e,"object"==typeof(t=t)?t:ma(t))})]}const I_=t=>{const{threshold:n=4.5,palette:r=["#000","#fff"]}=t;return t=>(t.forEach(t=>{var e=t.attr("dependentElement").parsedStyle.fill;j_(t.parsedStyle.fill,e)<n&&t.attr("fill",R_(e,r))}),t)},B_=()=>t=>(t.forEach(t=>{WS(t);var e=t.attr("bounds");!function(t,e){var[t,n]=t;return!(__(t,e)&&__(n,e))}(A_(t.getLocalBounds()),e)||zS(t)}),t);var P=1e-6,D_=1e-12,F_=Math.PI,z_=F_/2,W_=F_/4,G_=2*F_,H_=180/F_,V_=F_/180,Y_=Math.abs,q_=Math.atan,$_=Math.atan2,T=Math.cos,U_=Math.ceil,X_=Math.exp,K_=Math.log,Z_=Math.pow,C=Math.sin,Q_=Math.sign||function(t){return 0<t?1:t<0?-1:0},J_=Math.sqrt,tT=Math.tan;function eT(t){return 1<t?0:t<-1?F_:Math.acos(t)}function nT(t){return 1<t?z_:t<-1?-z_:Math.asin(t)}function rT(){}function iT(t,e){t&&oT.hasOwnProperty(t.type)&&oT[t.type](t,e)}var aT={Feature:function(t,e){iT(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)iT(n[r].geometry,e)}},oT={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){sT(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)sT(n[r],e,0)},Polygon:function(t,e){lT(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)lT(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)iT(n[r],e)}};function sT(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 lT(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)sT(t[n],e,1);e.polygonEnd()}function cT(t,e){t&&aT.hasOwnProperty(t.type)?aT[t.type](t,e):iT(t,e)}function uT(t){return[$_(t[1],t[0]),nT(t[2])]}function hT(t){var e=t[0],t=t[1],n=T(t);return[n*T(e),n*C(e),C(t)]}function fT(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function dT(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 pT(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function gT(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function yT(t){var e=J_(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function mT(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 vT(t,e){return Y_(t)>F_&&(t-=Math.round(t/G_)*G_),[t,e]}function bT(t,e,n){return(t%=G_)?e||n?mT(wT(t),MT(e,n)):wT(t):e||n?MT(e,n):vT}function xT(n){return function(t,e){return Y_(t+=n)>F_&&(t-=Math.round(t/G_)*G_),[t,e]}}function wT(t){var e=xT(t);return e.invert=xT(-t),e}function MT(t,e){var i=T(t),a=C(t),o=T(e),s=C(e);function n(t,e){var n=T(e),r=T(t)*n,t=C(t)*n,n=C(e),e=n*i+r*a;return[$_(t*o-e*s,r*i-n*a),nT(e*o+t*s)]}return n.invert=function(t,e){var n=T(e),r=T(t)*n,t=C(t)*n,n=C(e),e=n*o-t*s;return[$_(t*o+n*s,r*i+e*a),nT(e*i-r*a)]},n}function kT(t,e){(e=hT(e))[0]-=t,yT(e);t=eT(-e[1]);return((-e[2]<0?-t:t)+G_-P)%G_}function OT(){var r,e=[];return{point:function(t,e,n){r.push([t,e,n])},lineStart:function(){e.push(r=[])},lineEnd:rT,rejoin:function(){1<e.length&&e.push(e.pop().concat(e.shift()))},result:function(){var t=e;return e=[],r=null,t}}}function ET(t,e){return Y_(t[0]-e[0])<P&&Y_(t[1]-e[1])<P}function ST(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 AT(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(ET(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 ST(r,t,null,!0)),l.push(n.o=new ST(r,null,n,!1)),s.push(n=new ST(i,t,null,!1)),l.push(n.o=new ST(i,null,n,!0))}}),s.length){for(l.sort(e),_T(s),_T(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 _T(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 TT(t){return Y_(t[0])<=F_?t[0]:Q_(t[0])*((Y_(t[0])+F_)%G_-F_)}function PT(y,m,v,b){return function(s){var l,c,u,n=m(s),h=OT(),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=_0(c);var t=function(t,e){var n=TT(e),r=e[1],e=C(r),i=[C(n),-T(n),0],a=0,o=0,s=new Zp;1===e?r=z_+P:-1===e&&(r=-z_-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=TT(f),p=f[1]/2+W_,g=C(p),y=T(p),m=0;m<h;++m,d=b,g=w,y=x,f=v){var v=u[m],b=TT(v),x=v[1]/2+W_,w=C(x),x=T(x),M=b-d,k=0<=M?1:-1,O=k*M,E=F_<O,S=g*w;s.add($_(S*k*C(O),y*x+S*T(O))),a+=E?M+k*G_:M,E^n<=d^n<=b&&(yT(S=dT(hT(f),hT(v))),yT(O=dT(i,S)),(k=(E^0<=M?-1:1)*nT(O[2]))<r||r===k&&(S[0]||S[1]))&&(o+=E^0<=M?1:-1)}return(a<-P||a<P&&s<-D_)^1&o}(l,b);c.length?(d||(s.polygonStart(),d=!0),AT(c,LT,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(CT))}return e}}function CT(t){return 1<t.length}function LT(t,e){return((t=t.x)[0]<0?t[1]-z_-P:z_-t[1])-((e=e.x)[0]<0?e[1]-z_-P:z_-e[1])}vT.invert=vT;var NT=PT(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?F_:-F_,l=Y_(t-h);Y_(l-F_)<P?(c.point(h,f=0<(f+e)/2?z_:-z_),c.point(d,f),c.lineEnd(),c.lineStart(),c.point(s,f),c.point(t,f),u=0):d!==s&&F_<=l&&(Y_(h-d)<P&&(h-=d*P),Y_(t-s)<P&&(t-=s*P),l=f,i=e,o=C((n=h)-(r=t)),f=Y_(o)>P?q_((C(l)*(a=T(i))*C(r)-C(i)*(r=T(l))*C(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*z_,r.point(-F_,i),r.point(0,i),r.point(F_,i),r.point(F_,0),r.point(F_,-i),r.point(0,-i),r.point(-F_,-i),r.point(-F_,0),r.point(-F_,i)):Y_(t[0]-e[0])>P?(t=t[0]<e[0]?F_:-F_,i=n*t/2,r.point(-t,i),r.point(0,i),r.point(t,i)):r.point(e[0],e[1])},[-F_,-z_]);function jT(d){var g=T(d),p=6*V_,h=0<g,f=Y_(g)>P;function y(t,e){return T(t)*T(e)>g}function m(t,e,n){var r,i,a,o,s,l,c,u=[1,0,0],h=dT(hT(t),hT(e)),f=fT(h,h),d=h[0],p=f-d*d;return p?(r=dT(u,h),pT(u=gT(u,g*f/p),gT(h,-g*d/p)),(p=(h=fT(u,f=r))*h-(d=fT(f,f))*(fT(u,u)-1))<0?void 0:(pT(p=gT(f,(-h-(r=J_(p)))/d),u),p=uT(p),n?(i=t[0],a=e[0],o=t[1],e=e[1],a<i&&(c=i,i=a,a=c),!(l=Y_((s=a-i)-F_)<P)&&e<o&&(c=o,o=e,e=c),(l||s<P?l?0<o+e^p[1]<(Y_(p[0]-i)<P?o:e):o<=p[1]&&p[1]<=e:F_<s^(i<=p[0]&&p[0]<=a))?(pT(c=gT(f,(-h+r)/d),u),[p,uT(c)]):void 0):p)):!n&&t}function v(t,e){var n=h?d:F_-d,r=0;return t<-n?r|=1:n<t&&(r|=2),e<-n?r|=4:n<e&&(r|=8),r}return PT(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?F_:-F_),e):0;!o&&(c=l=i)&&a.lineStart(),i===l||(n=m(o,r))&&!ET(o,n)&&!ET(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&&ET(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=T(r),c=C(r),u=o*a;null==n?(n=r+o*G_,s=r-u/2):(n=kT(l,n),s=kT(l,s),(0<o?n<s:s<n)&&(n+=o*G_));for(var h,f=n;0<o?s<f:f<s;f-=u)h=uT([l,-c*T(f),-c*C(f)]),i.point(h[0],h[1])}},h?[0,-d]:[-F_,d-F_])}var RT=1e9,IT=-RT;function BT(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 Y_(t[0]-m)<P?0<e?0:3:Y_(t[0]-b)<P?0<e?2:1:Y_(t[1]-v)<P?0<e?1:0:0<e?3:2}function k(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=OT(),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=_0(i)).length;(e||n)&&(r.polygonStart(),e&&(r.lineStart(),M(null,null,1,r),r.lineEnd()),n&&AT(i,k,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(IT,Math.min(RT,c)),u=Math.max(IT,Math.min(RT,u))],r=[t=Math.max(IT,Math.min(RT,t)),e=Math.max(IT,Math.min(RT,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 DT(t,e,n){var r=T0(t,e-P,n).concat(e);return function(e){return r.map(function(t){return[e,t]})}}function FT(t,e,n){var r=T0(t,e-P,n).concat(e);return function(e){return r.map(function(t){return[t,e]})}}function zT(){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=DT(s,o,90),h=FT(r,n,v),f=DT(c,l,90),d=FT(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 T0(U_(a/y)*y,i,y).map(f).concat(T0(U_(c/m)*m,l,m).map(d)).concat(T0(U_(r/p)*p,n,p).filter(function(t){return Y_(t%y)>P}).map(u)).concat(T0(U_(s/g)*g,o,g).filter(function(t){return Y_(t%m)>P}).map(h))}var n,r,i,a,o,s,l,c,u,h,f,d,p,g,y,m,v}var WT,GT,HT,VT,YT=t=>t,qT=new Zp,$T=new Zp,UT={point:rT,lineStart:rT,lineEnd:rT,polygonStart:function(){UT.lineStart=XT,UT.lineEnd=QT},polygonEnd:function(){UT.lineStart=UT.lineEnd=UT.point=rT,qT.add(Y_($T)),$T=new Zp},result:function(){var t=qT/2;return qT=new Zp,t}};function XT(){UT.point=KT}function KT(t,e){UT.point=ZT,WT=HT=t,GT=VT=e}function ZT(t,e){$T.add(VT*t-HT*e),HT=t,VT=e}function QT(){ZT(WT,GT)}var JT=UT,t6=1/0,e6=t6,n6=-t6,r6=n6;var i6,a6,o6,s6,l6={point:function(t,e){t<t6&&(t6=t);n6<t&&(n6=t);e<e6&&(e6=e);r6<e&&(r6=e)},lineStart:rT,lineEnd:rT,polygonStart:rT,polygonEnd:rT,result:function(){var t=[[t6,e6],[n6,r6]];return n6=r6=-(e6=t6=1/0),t}},c6=0,u6=0,h6=0,f6=0,d6=0,p6=0,g6=0,y6=0,m6=0,v6={point:b6,lineStart:x6,lineEnd:k6,polygonStart:function(){v6.lineStart=O6,v6.lineEnd=E6},polygonEnd:function(){v6.point=b6,v6.lineStart=x6,v6.lineEnd=k6},result:function(){var t=m6?[g6/m6,y6/m6]:p6?[f6/p6,d6/p6]:h6?[c6/h6,u6/h6]:[NaN,NaN];return c6=u6=h6=f6=d6=p6=g6=y6=m6=0,t}};function b6(t,e){c6+=t,u6+=e,++h6}function x6(){v6.point=w6}function w6(t,e){v6.point=M6,b6(o6=t,s6=e)}function M6(t,e){var n=t-o6,r=e-s6,n=J_(n*n+r*r);f6+=n*(o6+t)/2,d6+=n*(s6+e)/2,p6+=n,b6(o6=t,s6=e)}function k6(){v6.point=b6}function O6(){v6.point=S6}function E6(){A6(i6,a6)}function S6(t,e){v6.point=A6,b6(i6=o6=t,a6=s6=e)}function A6(t,e){var n=t-o6,r=e-s6,n=J_(n*n+r*r);f6+=n*(o6+t)/2,d6+=n*(s6+e)/2,p6+=n,g6+=(n=s6*t-o6*e)*(o6+t),y6+=n*(s6+e),m6+=3*n,b6(o6=t,s6=e)}var _6=v6;function T6(t){this._context=t}T6.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,G_)}},result:rT};var P6,C6,L6,N6,j6,R6=new Zp,I6={point:rT,lineStart:function(){I6.point=B6},lineEnd:function(){P6&&D6(C6,L6),I6.point=rT},polygonStart:function(){P6=!0},polygonEnd:function(){P6=null},result:function(){var t=+R6;return R6=new Zp,t}};function B6(t,e){I6.point=D6,C6=N6=t,L6=j6=e}function D6(t,e){N6-=t,j6-=e,R6.add(J_(N6*N6+j6*j6)),N6=t,j6=e}var F6=I6;let z6,W6,G6,H6;class V6{constructor(t){this._append=null==t?Y6:function(t){var e=Math.floor(t);if(!(0<=e))throw new RangeError("invalid digits: "+t);if(15<e)return Y6;if(e!==z6){const r=10**e;z6=e,W6=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 W6}(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===G6&&this._append===W6||(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`,G6=n,W6=this._append,H6=this._,this._=r),this._+=H6}}result(){var t=this._;return this._="",t.length?t:null}}function Y6(t){let e=1;this._+=t[0];for(var n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function q6(e,n){let r=3,i=4.5,a,o;function s(t){return t&&("function"==typeof i&&o.pointRadius(+i.apply(this,arguments)),cT(t,a(o))),o.result()}return s.area=function(t){return cT(t,a(JT)),JT.result()},s.measure=function(t){return cT(t,a(F6)),F6.result()},s.bounds=function(t){return cT(t,a(l6)),l6.result()},s.centroid=function(t){return cT(t,a(_6)),_6.result()},s.projection=function(t){return arguments.length?(a=null==t?(e=null,YT):(e=t).stream,s):e},s.context=function(t){return arguments.length?(o=null==t?(n=null,new V6(r)):new T6(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 V6(r)),s},s.projection(e).digits(r).context(n)}function $6(r){return function(t){var e,n=new U6;for(e in r)n[e]=r[e];return n.stream=t,n}}function U6(){}function X6(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),cT(n,t.stream(l6)),e(l6.result()),null!=r&&t.clipExtent(r),t}function K6(i,a,t){return X6(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 Z6(t,e,n){return K6(t,[[0,0],e],n)}function Q6(r,i,t){return X6(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 J6(i,a,t){return X6(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)}U6.prototype={constructor:U6,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 tP=16,eP=T(30*V_);function nP(t,e){return+e?(A=t,_=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=A(t,e),r.point(t[0],t[1])}function e(){u=NaN,g.point=y,r.lineStart()}function y(t,e){var n=hT([t,e]),e=A(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],tP,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,tP,r),g.lineEnd=m,m()}return g}):(n=t,$6({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,k,O=o-t,E=s-e,S=O*O+E*E;4*_<S&&f--&&(y=a+h,x=nT(y/=m=J_((p=r+c)*p+(g=i+u)*g+y*y)),v=Y_(Y_(y)-1)<P||Y_(n-l)<P?(n+l)/2:$_(g,p),b=(x=A(v,x))[0],x=x[1],_<(k=E*(w=b-t)-O*(M=x-e))*k/S||.3<Y_((O*w+E*M)/S-.5)||r*c+i*u+a*h<eP)&&(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 rP=$6({point:function(t,e){this.stream.point(t*V_,e*V_)}});function iP(t,n,r,i,a,e){var o,s,l,c,u,h,f,d,p,g,y,m;return e?(h=T(e),e=C(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 aP(t){return oP(function(){return t})()}function oP(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,k=NT,O=null,E=YT,S=.5;function A(t){return l(t[0]*V_,t[1]*V_)}function _(t){return(t=l.invert(t[0],t[1]))&&[t[0]*H_,t[1]*H_]}function T(){var t=iP(h,0,0,x,w,b).apply(null,e(p,g)),t=iP(h,f-t[0],d-t[1],x,w,b);return r=bT(y,m,v),s=mT(e,t),l=mT(r,s),o=nP(s,S),P()}function P(){return c=u=null,A}return A.stream=function(t){return c&&u===t?c:c=rP((n=r,$6({point:function(t,e){t=n(t,e);return this.stream.point(t[0],t[1])}})(k(o(E(u=t))))));var n},A.preclip=function(t){return arguments.length?(k=t,M=void 0,P()):k},A.postclip=function(t){return arguments.length?(E=t,O=n=i=a=null,P()):E},A.clipAngle=function(t){return arguments.length?(k=+t?jT(M=t*V_):(M=null,NT),P()):M*H_},A.clipExtent=function(t){return arguments.length?(E=null==t?(O=n=i=a=null,YT):BT(O=+t[0][0],n=+t[0][1],i=+t[1][0],a=+t[1][1]),P()):null==O?null:[[O,n],[i,a]]},A.scale=function(t){return arguments.length?(h=+t,T()):h},A.translate=function(t){return arguments.length?(f=+t[0],d=+t[1],T()):[f,d]},A.center=function(t){return arguments.length?(p=t[0]%360*V_,g=t[1]%360*V_,T()):[p*H_,g*H_]},A.rotate=function(t){return arguments.length?(y=t[0]%360*V_,m=t[1]%360*V_,v=2<t.length?t[2]%360*V_:0,T()):[y*H_,m*H_,v*H_]},A.angle=function(t){return arguments.length?(b=t%360*V_,T()):b*H_},A.reflectX=function(t){return arguments.length?(x=t?-1:1,T()):x<0},A.reflectY=function(t){return arguments.length?(w=t?-1:1,T()):w<0},A.precision=function(t){return arguments.length?(o=nP(s,S=t*t),P()):J_(S)},A.fitExtent=function(t,e){return K6(A,t,e)},A.fitSize=function(t,e){return Z6(A,t,e)},A.fitWidth=function(t,e){return Q6(A,t,e)},A.fitHeight=function(t,e){return J6(A,t,e)},function(){return e=t.apply(this,arguments),A.invert=e.invert&&_,T()}}function sP(t){var e=0,n=F_/3,r=oP(t),t=r(e,n);return t.parallels=function(t){return arguments.length?r(e=t[0]*V_,n=t[1]*V_):[e*H_,n*H_]},t}function lP(t,e){var n,r,i,a=C(t),o=(a+C(e))/2;return Y_(o)<P?(n=T(t),s.invert=function(t,e){return[t/n,nT(e*n)]},s):(i=J_(r=1+a*(2*o-a))/o,l.invert=function(t,e){var e=i-e,n=$_(t,Y_(e))*Q_(e);return e*o<0&&(n-=F_*Q_(t)*Q_(e)),[n/o,nT((r-(t*t+e*e)*o*o)/(2*o))]},l);function s(t,e){return[t*n,C(e)/n]}function l(t,e){e=J_(r-2*o*C(e))/o;return[e*C(t*=o),i-e*T(t)]}}function cP(){return sP(lP).scale(155.424).center([0,33.6442])}function uP(){return cP().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function hP(i){return function(t,e){var n=T(t),r=T(e),n=i(n*r);return n===1/0?[2,0]:[n*r*C(t),n*C(e)]}}function fP(a){return function(t,e){var n=J_(t*t+e*e),r=a(n),i=C(r),r=T(r);return[$_(t*i,n*r),nT(n&&e*i/n)]}}var dP=hP(function(t){return J_(2/(1+t))});dP.invert=fP(function(t){return 2*nT(t/2)});var pP=hP(function(t){return(t=eT(t))&&t/C(t)});function gP(t,e){return[t,K_(tT((z_+e)/2))]}function yP(r){var i,a,o,s=aP(r),e=s.center,l=s.scale,n=s.translate,c=s.clipExtent,u=null;function h(){var e,t=F_*l(),n=s((e=bT((e=s.rotate())[0]*V_,e[1]*V_,2<e.length?e[2]*V_:0),function(t){return(t=e.invert(t[0]*V_,t[1]*V_))[0]*=H_,t[1]*=H_,t}([0,0])));return c(null==u?[[n[0]-t,n[1]-t],[n[0]+t,n[1]+t]]:r===gP?[[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 mP(t){return tT((z_+t)/2)}function vP(t,e){var n=T(t),i=t===e?C(t):K_(n/T(e))/K_(mP(e)/mP(t)),a=n*Z_(mP(t),i)/i;return i?(r.invert=function(t,e){var e=a-e,n=Q_(i)*J_(t*t+e*e),r=$_(t,Y_(e))*Q_(e);return e*i<0&&(r-=F_*Q_(t)*Q_(e)),[r/i,2*q_(Z_(a/n,1/i))-z_]},r):gP;function r(t,e){0<a?e<-z_+P&&(e=-z_+P):z_-P<e&&(e=z_-P);e=a/Z_(mP(e),i);return[e*C(i*t),a-e*T(i*t)]}}function bP(t,e){return[t,e]}function xP(t,e){var n=T(t),r=t===e?C(t):(n-T(e))/(e-t),i=n/r+t;return Y_(r)<P?bP:(a.invert=function(t,e){var e=i-e,n=$_(t,Y_(e))*Q_(e);return e*r<0&&(n-=F_*Q_(t)*Q_(e)),[n/r,i-Q_(r)*J_(t*t+e*e)]},a);function a(t,e){e=i-e,t*=r;return[e*C(t),i-e*T(t)]}}pP.invert=fP(function(t){return t}),gP.invert=function(t,e){return[t,2*q_(X_(e))-z_]},bP.invert=bP;var wP=1.340264,MP=-.081106,kP=893e-6,OP=.003796,EP=J_(3)/2;function SP(t,e){var e=nT(EP*C(e)),n=e*e,r=n*n*n;return[t*T(e)/(EP*(wP+3*MP*n+r*(7*kP+9*OP*n))),e*(wP+MP*n+r*(kP+OP*n))]}function AP(t,e){var n=T(e),r=T(t)*n;return[n*C(t)/r,C(e)/r]}function _P(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 TP(t,e){return[T(e)*C(t),C(e)]}function PP(t,e){var n=T(e),r=1+T(t)*n;return[n*C(t)/r,C(e)/r]}function CP(t,e){return[K_(tT((z_+e)/2)),-t]}SP.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*(wP+MP*i+a*(kP+OP*i))-e)/(wP+3*MP*i+a*(7*kP+9*OP*i)))*r)*i*i,!(Y_(n)<D_));++o);return[EP*t*(wP+3*MP*i+a*(7*kP+9*OP*i))/T(r),nT(C(r)/EP)]},AP.invert=fP(q_),_P.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))),Y_(a)>P&&0<--r);return[t/(.8707+(i=n*n)*(i*(i*i*i*(.003971-.001529*i)-.013791)-.131979)),n]},TP.invert=fP(nT),PP.invert=fP(function(t){return 2*q_(t)}),CP.invert=function(t,e){return[-e,2*q_(X_(t))-z_]};var LP=Object.freeze({__proto__:null,geoAlbersUsa:function(){var e,n,i,a,o,r,s=uP(),l=cP().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=cP().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 K6(h,t,e)},h.fitSize=function(t,e){return Z6(h,t,e)},h.fitWidth=function(t,e){return Q6(h,t,e)},h.fitHeight=function(t,e){return J6(h,t,e)},h.scale(1070)},geoAlbers:uP,geoAzimuthalEqualArea:function(){return aP(dP).scale(124.75).clipAngle(179.999)},geoAzimuthalEqualAreaRaw:dP,geoAzimuthalEquidistant:function(){return aP(pP).scale(79.4188).clipAngle(179.999)},geoAzimuthalEquidistantRaw:pP,geoConicConformal:function(){return sP(vP).scale(109.5).parallels([30,30])},geoConicConformalRaw:vP,geoConicEqualArea:cP,geoConicEqualAreaRaw:lP,geoConicEquidistant:function(){return sP(xP).scale(131.154).center([0,13.9389])},geoConicEquidistantRaw:xP,geoEqualEarth:function(){return aP(SP).scale(177.158)},geoEqualEarthRaw:SP,geoEquirectangular:function(){return aP(bP).scale(152.63)},geoEquirectangularRaw:bP,geoGnomonic:function(){return aP(AP).scale(144.049).clipAngle(60)},geoGnomonicRaw:AP,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=$6({point:function(t,e){t=x([t,e]);this.stream.point(t[0],t[1])}}),v=YT;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,YT):BT(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=C(d=t%360*V_),r=T(d),b()):d*H_},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 K6(x,t,e)},x.fitSize=function(t,e){return Z6(x,t,e)},x.fitWidth=function(t,e){return Q6(x,t,e)},x.fitHeight=function(t,e){return J6(x,t,e)},x},geoProjection:aP,geoProjectionMutator:oP,geoMercator:function(){return yP(gP).scale(961/G_)},geoMercatorRaw:gP,geoNaturalEarth1:function(){return aP(_P).scale(175.295)},geoNaturalEarth1Raw:_P,geoOrthographic:function(){return aP(TP).scale(249.5).clipAngle(90+P)},geoOrthographicRaw:TP,geoStereographic:function(){return aP(PP).scale(250).clipAngle(142)},geoStereographicRaw:PP,geoTransverseMercator:function(){var t=yP(CP),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:CP});function NP(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 jP(t,e,n,r){var i,a,o,s,l,c,{outline:e=(e=e.filter(IP),e.find(t=>t.sphere)?{type:"Sphere"}:NP(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]]=q6(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 RP(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:[zT()]}}):"sphere"===e?Object.assign(Object.assign({},t),{sphere:!0,data:{value:[{type:"Sphere"}]}}):t)}function IP(t){return"geoPath"===t.type}jl=()=>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"+Xe(t);if(e=LP[e])return e;throw new Error("Unknown coordinate: "+t)}(r),p=e.map(RP);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=(jP(i,p,l,f),i),l=f;for([o,s]of Object.entries(l))null!=(a=c[o])&&a.call(c,s);g=q6(i);const u=new eb({domain:[t,t+n]}),h=new eb({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 IP(t)?({style:n,tooltip:r={}}=e=t,Object.assign(Object.assign({},e),{type:"path",tooltip:jg(r,{title:"id",items:[{channel:"color"}]}),style:Object.assign(Object.assign({},n),{d:t=>g(t)||[]})})):t})})]},jl.props={},Gs=()=>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}]})]};Gs.props={};const BP={"composition.geoView":jl,"composition.geoPath":Gs};function DP(){return Object.assign({"data.fetch":vy,"data.inline":Ey,"data.sortBy":Oy,"data.sort":wy,"data.filter":xy,"data.pick":My,"data.rename":ky,"data.fold":by,"data.slice":tm,"data.custom":Sy,"data.map":Ay,"data.cluster":J1,"data.tree":ty,"data.sankey":wg,"data.arc":Cy,"data.wordCloud":Zy,"data.join":Jy,"data.kde":sm,"data.venn":Am,"transform.maybeZeroY1":o4,"transform.maybeZeroX":x4,"transform.maybeStackY":v4,"transform.maybeTitle":b4,"transform.maybeSeries":O4,"transform.maybeZeroPadding":P4,"transform.stackY":y4,"transform.binX":M_,"transform.bin":w_,"transform.dodgeX":R4,"transform.jitter":z4,"transform.jitterX":W4,"transform.symmetryY":G4,"transform.diffY":H4,"transform.stackEnter":I4,"transform.normalizeY":B4,"transform.select":U4,"transform.selectX":X4,"transform.selectY":K4,"transform.groupX":l_,"transform.groupY":c_,"transform.groupColor":u_,"transform.group":s_,"transform.maybeSize":M4,"transform.maybeZeroY":w4,"transform.maybeKey":k4,"transform.sortX":d_,"transform.sortY":g_,"transform.sortColor":p_,"transform.flexX":y_,"transform.maybeTupleY":E4,"transform.maybeTupleX":S4,"transform.maybeIdentityY":A4,"transform.maybeIdentityX":_4,"transform.maybeTuple":N4,"transform.maybeVisualPosition":C4,"transform.maybeFunctionAttribute":L4,"transform.maybeGradient":j4,"transform.maybeTooltip":T4,"transform.pack":v_,"transform.sample":E_,"transform.filter":S_,"coordinate.cartesian":hd,"coordinate.polar":dd,"coordinate.helix":pd,"coordinate.transpose":gd,"coordinate.theta":yd,"coordinate.parallel":bd,"coordinate.fisheye":xd,"coordinate.radial":vd,"coordinate.radar":wd,"encode.constant":Md,"encode.field":Od,"encode.transform":kd,"encode.column":Ed,"mark.interval":Fp,"mark.rect":zp,"mark.line":G0,"mark.point":H0,"mark.text":V0,"mark.cell":Y0,"mark.area":q0,"mark.link":$0,"mark.image":U0,"mark.polygon":X0,"mark.box":K0,"mark.vector":Z0,"mark.lineX":J0,"mark.lineY":Q0,"mark.connector":tg,"mark.range":rg,"mark.rangeX":ig,"mark.rangeY":ag,"mark.sankey":Wg,"mark.path":Gg,"mark.treemap":qg,"mark.pack":Xg,"mark.boxplot":i1,"mark.shape":a1,"mark.forceGraph":Z1,"mark.gauge":Zb,"mark.tree":ay,"mark.wordCloud":_m,"mark.density":Qb,"mark.heatmap":Jb,"palette.category10":t2,"palette.category20":e2,"scale.linear":r2,"scale.ordinal":i2,"scale.band":n2,"scale.identity":a2,"scale.point":o2,"scale.time":s2,"scale.log":l2,"scale.pow":c2,"scale.sqrt":d2,"scale.threshold":u2,"scale.quantile":h2,"scale.quantize":f2,"scale.sequential":p2,"scale.constant":g2,"shape.interval.rect":bx,"shape.interval.hollow":xx,"shape.interval.funnel":wx,"shape.interval.pyramid":kx,"shape.rect.rect":bx,"shape.rect.hollow":xx,"shape.cell.cell":bx,"shape.cell.hollow":xx,"shape.line.line":Ax,"shape.line.hv":Tx,"shape.line.vh":Px,"shape.line.hvh":Cx,"shape.line.trail":Lx,"shape.line.smooth":_x,"shape.point.bowtie":Rx,"shape.point.cross":Ix,"shape.point.diamond":Bx,"shape.point.hexagon":Dx,"shape.point.hollowBowtie":Fx,"shape.point.hollowDiamond":zx,"shape.point.hollowHexagon":Wx,"shape.point.hollow":Gx,"shape.point.hollowSquare":Hx,"shape.point.hollowTriangle":Vx,"shape.point.hollowTriangleDown":Yx,"shape.point.hyphen":qx,"shape.point.line":$x,"shape.point.plus":Ux,"shape.point.point":Xx,"shape.point.square":Kx,"shape.point.tick":Zx,"shape.point.triangle":Qx,"shape.point.triangleDown":Jx,"shape.text.text":pE,"shape.area.area":bE,"shape.area.smooth":xE,"shape.area.hvh":wE,"shape.area.vh":ME,"shape.area.hv":kE,"shape.link.smooth":EE,"shape.link.vhv":SE,"shape.link.arc":AE,"shape.link.link":OE,"shape.image.image":_E,"shape.polygon.polygon":TE,"shape.polygon.ribbon":PE,"shape.box.box":CE,"shape.box.violin":LE,"shape.vector.vector":tw,"shape.label.label":KE,"shape.text.badge":yE,"shape.lineX.line":NE,"shape.lineY.line":NE,"shape.shape.shape":o5,"shape.connector.connector":IE,"shape.range.range":bx,"shape.rangeX.range":bx,"shape.rangeY.range":bx,"shape.path.path":QE,"shape.path.hollow":JE,"shape.density.density":t5,"shape.heatmap.heatmap":a5,"theme.classic":l5,"theme.classicDark":u5,"theme.academy":f5,"component.axisX":W5,"component.axisY":G5,"component.axisRadar":H5,"component.axisLinear":F5,"component.axisArc":z5,"component.legendCategory":$5,"component.legendContinuous":Q5,"component.legendContinuousBlock":J5,"component.legendContinuousBlockSize":eS,"component.legendContinuousSize":tS,"component.legends":yS,"component.title":iS,"component.sliderX":hS,"component.sliderY":fS,"component.scrollbarX":pS,"component.scrollbarY":gS,"animation.scaleInX":mS,"animation.scaleOutX":vS,"animation.scaleInY":bS,"animation.scaleOutY":xS,"animation.waveIn":LS,"animation.fadeIn":wS,"animation.fadeOut":MS,"animation.zoomIn":NS,"animation.zoomOut":jS,"animation.pathIn":RS,"animation.morphing":CS,"animation.growInX":IS,"animation.growInY":BS,"interaction.elementHighlight":o3,"interaction.elementHighlightByX":s3,"interaction.elementHighlightByColor":l3,"interaction.elementSelect":u3,"interaction.elementSelectByX":h3,"interaction.elementSelectByColor":f3,"interaction.fisheye":p3,"interaction.chartIndex":d3,"interaction.tooltip":j3,"interaction.legendFilter":Y3,"interaction.legendHighlight":q3,"interaction.brushHighlight":Q3,"interaction.brushXHighlight":tA,"interaction.brushYHighlight":nA,"interaction.brushAxisHighlight":hA,"interaction.brushFilter":dA,"interaction.brushXFilter":pA,"interaction.brushYFilter":gA,"interaction.sliderFilter":vA,"interaction.scrollbarFilter":xA,"interaction.poptip":kA,"interaction.event":v3,"composition.spaceLayer":AA,"composition.spaceFlex":_A,"composition.mark":PA,"composition.view":TA,"composition.facetRect":WA,"composition.repeatMatrix":YA,"composition.facetCircle":ZA,"composition.timingKeyframe":QA,"labelTransform.overlapHide":T_,"labelTransform.overlapDodgeY":C_,"labelTransform.overflowHide":B_,"labelTransform.contrastReverse":I_},BP)}const FP=[["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 zP(t,e,n){for(;t<e;)t+=2*Math.PI;for(;n<t;)t-=2*Math.PI;return t}function WP(t,e,n,r,i){var a=t[0],t=t[1],o=U();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 GP(t,e,n,r,i){var a=new eb({range:[e,e+r]}),o=new eb({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 HP(t,e,n,r,i){return(0,t[0])(e,n,r,i)}function VP(t,e,n,r,i){return t[0]}function YP(t,e,n,r,i){var a=t[0],o=t[1],s=t[2],t=t[3],l=new eb({range:[s,t]}),c=new eb({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=zP(Math.atan2(t,e),a,o);return[c.invert(t),l.invert(n)]}}}function qP(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 $P(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return JP.apply(void 0,t8([[-1,-1]],e,!1))}function UP(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return JP.apply(void 0,t8([[-1,1]],e,!1))}function XP(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return JP.apply(void 0,t8([[1,-1]],e,!1))}function KP(t,e,n,r,i){var a,t=t[0],o=U();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 ZP(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 eb({range:[s,s+.99*l]}),h=new eb({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=zP(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 QP(t,e,n,r,i){var s=t[0],l=t[1],a=t[2],t=t[3],c=new eb({range:[a,t]});return{transform:function(t){for(var e=[],n=t.length,r=new nb({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 JP=function(t,e,n,r,i){var a=t[0],t=t[1],o=U();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},t8=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 e8(t){return 1/Math.tan(t)}function n8(t,e,n,r,i){var a=e8(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 r8(t,e,n,r,i){var a=e8(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 i8(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 a8(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 o8(t,e,n){return n?new eb({range:[0,1],domain:[0,e]}).map(t):t}function s8(t,e,n,r,i){var a=t[0],o=t[1],t=t[2],s=o8(a,r,void 0!==t&&t);return{transform:function(t){var e=t[0],t=t[1];return[i8(e,s,o,0,1),t]},untransform:function(t){var e=t[0],t=t[1];return[a8(e,s,o,0,1),t]}}}function l8(t,e,n,r,i){var a=t[0],o=t[1],t=t[2],s=o8(a,i,void 0!==t&&t);return{transform:function(t){return[t[0],i8(t[1],s,o,0,1)]},untransform:function(t){return[t[0],a8(t[1],s,o,0,1)]}}}function c8(t,e,n,r,i){var a=t[0],o=t[1],s=t[2],l=t[3],t=t[4],c=o8(a,r,t=void 0!==t&&t),u=o8(o,i,t);return{transform:function(t){var e=t[0],t=t[1];return[i8(e,c,s,0,1),i8(t,u,l,0,1)]},untransform:function(t){var e=t[0],t=t[1];return[a8(e,c,s,0,1),a8(t,u,l,0,1)]}}}function u8(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 eb({range:[0,r]}),u=new eb({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=i8(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=a8(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 h8=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))},f8=(d8.prototype.update=function(t){this.options=iv({},this.options,t),this.recoordinate()},d8.prototype.clone=function(){return new d8(this.options)},d8.prototype.getOptions=function(){return this.options},d8.prototype.clear=function(){this.update({transformations:[]})},d8.prototype.getSize=function(){var t=this.options;return[t.width,t.height]},d8.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y;return[(2*e+t.width)/2,(2*n+t.height)/2]},d8.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:h8(h8([],n,!0),[h8([],t,!0)],!1)}),this},d8.prototype.map=function(t){return this.output(t)},d8.prototype.invert=function(t){return this.input(t)},d8.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},d8.prototype.compose=function(t){for(var e=(t=void 0===t?!1:t)?h8([],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(h8([],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)||av,"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):av}.apply(void 0,a)},d8.prototype.createMatrixTransform=function(t,e){var n,r,i,a,o,s,l,c,u,h,f,d,p=U();return e&&t.reverse(),t.forEach(function(t){return K(p,p,t)}),e&&(e=t=p,(d=new $(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 Gt(t,t,p),[t[0],t[1]]}},d8);function d8(t){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:GP,translate:WP,custom:HP,matrix:VP,polar:YP,transpose:qP,scale:JP,"shear.x":n8,"shear.y":r8,reflect:$P,"reflect.x":UP,"reflect.y":XP,rotate:KP,helix:ZP,parallel:QP,fisheye:c8,"fisheye.x":s8,"fisheye.y":l8,"fisheye.circular":u8},this.update(t)}function p8(e,n){const r=t=>{return"string"!=typeof t?t:n[t=e+"."+t]||Eg("Unknown Component: "+t)};return[(t,e)=>{var n=t["type"],t=at(t,["type"]);return r(n)(t,e)},r]}function g8(t){var{canvas:t,group:e}=t;return e?e.ownerDocument:t.document}function y8(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]=p8("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 m8(t,e){return t.filter(t=>t.type===e)}function v8(t){return 0<m8(t,"polar").length}function b8(t){return m8(t,"transpose").length%2==1}function x8(t){return 0<m8(t,"theta").length}function w8(t){return 0<m8(t,"radial").length}function f(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}a=f("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),tl=f("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),Vs=f("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),Ro=f("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),Ko=f("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),nl=f("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),Uo=f("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),ii=f("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),No=f("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),So=f("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function M8(t,e,n){(t.prototype=e.prototype=n).constructor=t}function k8(t,e){var n,r=Object.create(t.prototype);for(n in e)r[n]=e[n];return r}function O8(){}var E8=1/.7,s="\\s*([+-]?\\d+)\\s*",Us="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",cu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",S8=/^#([0-9a-f]{3,8})$/,A8=new RegExp(`^rgb\\(${s},${s},${s}\\)$`),_8=new RegExp(`^rgb\\(${cu},${cu},${cu}\\)$`),T8=new RegExp(`^rgba\\(${s},${s},${s},${Us}\\)$`),P8=new RegExp(`^rgba\\(${cu},${cu},${cu},${Us}\\)$`),C8=new RegExp(`^hsl\\(${Us},${cu},${cu}\\)$`),L8=new RegExp(`^hsla\\(${Us},${cu},${cu},${Us}\\)$`),N8={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 j8(){return this.rgb().formatHex()}function R8(){return this.rgb().formatRgb()}function I8(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=S8.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?B8(e):3===n?new W8(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?D8(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?D8(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=A8.exec(t))?new W8(e[1],e[2],e[3],1):(e=_8.exec(t))?new W8(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=T8.exec(t))?D8(e[1],e[2],e[3],e[4]):(e=P8.exec(t))?D8(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=C8.exec(t))?$8(e[1],e[2]/100,e[3]/100,1):(e=L8.exec(t))?$8(e[1],e[2]/100,e[3]/100,e[4]):N8.hasOwnProperty(t)?B8(N8[t]):"transparent"===t?new W8(NaN,NaN,NaN,0):null}function B8(t){return new W8(t>>16&255,t>>8&255,255&t,1)}function D8(t,e,n,r){return new W8(t=r<=0?e=n=NaN:t,e,n,r)}function F8(t){return(t=t instanceof O8?t:I8(t))?new W8((t=t.rgb()).r,t.g,t.b,t.opacity):new W8}function z8(t,e,n,r){return 1===arguments.length?F8(t):new W8(t,e,n,null==r?1:r)}function W8(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function G8(){return"#"+q8(this.r)+q8(this.g)+q8(this.b)}function H8(){var t=V8(this.opacity);return(1===t?"rgb(":"rgba(")+Y8(this.r)+`, ${Y8(this.g)}, `+Y8(this.b)+(1===t?")":`, ${t})`)}function V8(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Y8(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function q8(t){return((t=Y8(t))<16?"0":"")+t.toString(16)}function $8(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||1<=n?t=e=NaN:e<=0&&(t=NaN),new X8(t,e,n,r)}function U8(t){var e,n,r,i,a,o,s,l;return t instanceof X8?new X8(t.h,t.s,t.l,t.opacity):(t=t instanceof O8?t:I8(t))?t instanceof X8?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 X8(o,s,l,t.opacity)):new X8}function X8(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function K8(t){return(t=(t||0)%360)<0?t+360:t}function Z8(t){return Math.max(0,Math.min(1,t||0))}function Q8(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}M8(O8,I8,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:j8,formatHex:j8,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return U8(this).formatHsl()},formatRgb:R8,toString:R8}),M8(W8,z8,k8(O8,{brighter(t){return t=null==t?E8:Math.pow(E8,t),new W8(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new W8(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new W8(Y8(this.r),Y8(this.g),Y8(this.b),V8(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:G8,formatHex:G8,formatHex8:function(){return"#"+q8(this.r)+q8(this.g)+q8(this.b)+q8(255*(isNaN(this.opacity)?1:this.opacity))},formatRgb:H8,toString:H8})),M8(X8,function(t,e,n,r){return 1===arguments.length?U8(t):new X8(t,e,n,null==r?1:r)},k8(O8,{brighter(t){return t=null==t?E8:Math.pow(E8,t),new X8(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new X8(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 W8(Q8(240<=t?t-240:120+t,n,e),Q8(t,n,e),Q8(t<120?240+t:t-120,n,e),this.opacity)},clamp(){return new X8(K8(this.h),Z8(this.s),Z8(this.l),V8(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=V8(this.opacity);return(1===t?"hsl(":"hsla(")+K8(this.h)+`, ${100*Z8(this.s)}%, ${100*Z8(this.l)}%`+(1===t?")":`, ${t})`)}}));const J8=Math.PI/180,tC=180/Math.PI;var eC=1.78277,nC=-.29227,rC=-.90649,iC=1.97294,aC=iC*rC,oC=iC*eC,sC=eC*nC- -.14861*rC;function lC(t,e,n,r){return 1===arguments.length?(i=t)instanceof cC?new cC(i.h,i.s,i.l,i.opacity):(a=(i=i instanceof W8?i:F8(i)).r/255,o=i.g/255,l=i.b/255,l=(iC*(o-(a=(sC*l+aC*a-oC*o)/(sC+aC-oC)))-nC*(o=l-a))/rC,new cC((l=(s=Math.sqrt(l*l+o*o)/(iC*a*(1-a)))?Math.atan2(l,o)*tC-120:NaN)<0?l+360:l,s,a,i.opacity)):new cC(t,e,n,null==r?1:r);var i,a,o,s,l}function cC(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}M8(cC,lC,k8(O8,{brighter(t){return t=null==t?E8:Math.pow(E8,t),new cC(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new cC(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*J8,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),t=Math.sin(t);return new W8(255*(e+n*(-.14861*r+eC*t)),255*(e+n*(nC*r+rC*t)),255*(e+iC*r*n),this.opacity)}}));var uC=t=>()=>t;function hC(e,n){return function(t){return e+t*n}}function fC(a){return 1==(a=+a)?dC: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)}):uC(isNaN(t)?e:t);var n,r,i}}function dC(t,e){var n=e-t;return n?hC(t,n):uC(isNaN(t)?e:t)}!function t(e){var o=fC(e);function n(e,t){var n=o((e=z8(e)).r,(t=z8(t)).r),r=o(e.g,t.g),i=o(e.b,t.b),a=dC(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);pC=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 pC,gC=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=z8(t[o]),r[o]=e.r||0,i[o]=e.g||0,a[o]=e.b||0;return r=pC(r),i=pC(i),a=pC(a),e.opacity=1,function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e+""}};function yC(s){return function t(o){function e(e,t){var n=s((e=lC(e)).h,(t=lC(t)).h),r=dC(e.s,t.s),i=dC(e.l,t.l),a=dC(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)}yC(function(t,e){var n=e-t;return n?hC(t,180<n||n<-180?n-360*Math.round(n/360):n):uC(isNaN(t)?e:t)});var Vo=yC(dC),n=t=>gC(t[t.length-1]),es=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(f),as=n(es),qo=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(f),Qs=n(qo),zo=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(f),Ks=n(zo),r=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(f),Qo=n(r),al=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(f),_o=n(al),fn=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(f),Co=n(fn),rs=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(f),Es=n(rs),zs=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(f),Go=n(zs),qs=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(f),Fs=n(qs),Al=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(f),Ml=n(Al),Fl=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(f),jl=n(Fl),Gs=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(f),s=n(Gs),cu=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(f),Us=n(cu),mC=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(f),vC=n(mC),bC=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(f),xC=n(bC),wC=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(f),MC=n(wC),kC=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(f),OC=n(kC),EC=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(f),SC=n(EC),AC=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(f),_C=n(AC),TC=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(f),PC=n(TC),CC=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(f),LC=n(CC),NC=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(f),jC=n(NC),RC=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(f),IC=n(RC),BC=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(f),DC=n(BC),FC=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(f),zC=n(FC),WC=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(f),GC=n(WC),HC=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(f),n=n(HC);var VC=Vo(lC(300,.5,0),lC(-240,.5,1)),YC=Vo(lC(-100,.75,.35),lC(80,1.5,.8)),Vo=Vo(lC(260,.75,.35),lC(80,1.5,.8)),qC=lC();var $C=z8(),UC=Math.PI/3,XC=2*Math.PI/3;function KC(e){var n=e.length;return function(t){return e[Math.max(0,Math.min(n-1,Math.floor(t*n)))]}}var ZC=KC(f("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),QC=KC(f("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),JC=KC(f("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),tL=KC(f("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),eL=Object.freeze({__proto__:null,schemeCategory10:a,schemeAccent:tl,schemeDark2:Vs,schemePaired:Ro,schemePastel1:Ko,schemePastel2:nl,schemeSet1:Uo,schemeSet2:ii,schemeSet3:No,schemeTableau10:So,interpolateBrBG:as,schemeBrBG:es,interpolatePRGn:Qs,schemePRGn:qo,interpolatePiYG:Ks,schemePiYG:zo,interpolatePuOr:Qo,schemePuOr:r,interpolateRdBu:_o,schemeRdBu:al,interpolateRdGy:Co,schemeRdGy:fn,interpolateRdYlBu:Es,schemeRdYlBu:rs,interpolateRdYlGn:Go,schemeRdYlGn:zs,interpolateSpectral:Fs,schemeSpectral:qs,interpolateBuGn:Ml,schemeBuGn:Al,interpolateBuPu:jl,schemeBuPu:Fl,interpolateGnBu:s,schemeGnBu:Gs,interpolateOrRd:Us,schemeOrRd:cu,interpolatePuBuGn:vC,schemePuBuGn:mC,interpolatePuBu:xC,schemePuBu:bC,interpolatePuRd:MC,schemePuRd:wC,interpolateRdPu:OC,schemeRdPu:kC,interpolateYlGnBu:SC,schemeYlGnBu:EC,interpolateYlGn:_C,schemeYlGn:AC,interpolateYlOrBr:PC,schemeYlOrBr:TC,interpolateYlOrRd:LC,schemeYlOrRd:CC,interpolateBlues:jC,schemeBlues:NC,interpolateGreens:IC,schemeGreens:RC,interpolateGreys:DC,schemeGreys:BC,interpolatePurples:zC,schemePurples:FC,interpolateReds:GC,schemeReds:WC,interpolateOranges:n,schemeOranges:HC,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:VC,interpolateRainbow:function(t){(t<0||1<t)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return qC.h=360*t-100,qC.s=1.5-1.5*e,qC.l=.8-.9*e,qC+""},interpolateWarm:YC,interpolateCool:Vo,interpolateSinebow:function(t){var e;return t=(.5-t)*Math.PI,$C.r=255*(e=Math.sin(t))*e,$C.g=255*(e=Math.sin(t+UC))*e,$C.b=255*(e=Math.sin(t+XC))*e,$C+""},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:ZC,interpolateMagma:QC,interpolateInferno:JC,interpolatePlasma:tL});function nL(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 yL(t,Cg)}(e)?"identity":"string"==typeof i?"linear":2<(r||i||[]).length?uL(t):void 0===r?pL(e)?uL(t):gL(e)?"time":hL(t,i):pL([r])?uL(t):gL(e)?"time":hL(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(sL({type:t}))return function(t,e,n){const r=t.map(Number),i=new eb({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 lL({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 fL(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)Ag(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 dL(e);case"quantile":return function(t){return dL(t).sort()}(e);case"sequential":return fL(function(t){let e=1/0,n=-1/0;for(const r of t)for(const i of r)Ag(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=Cv,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:x8(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=Xe(e),i=eL["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=cL(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],Tb(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 cL(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 rL(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:rn(l,n)}),r.push(s))}return r}function iL(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=v0(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 aL(t,e){var[e]=p8("scale",e),n=t["relations"],[n]=function(o){if(!o||!Array.isArray(o))return[Mg,Mg];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 oL(t,n){var t=t.filter(({name:t,facet:e=!0})=>e&&t===n),e=t.flatMap(t=>t.domain),r=t.every(sL)?Kp(e):t.every(lL)?Array.from(new Set(e)):null;if(null!==r)for(const i of t)i.domain=r}function sL(t){t=t.type;return"string"==typeof t&&["linear","log","pow","time"].includes(t)}function lL(t){t=t.type;return"string"==typeof t&&["band","point","ordinal"].includes(t)}function cL(t,e,n,r,i){var[i]=p8("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=Xe(t),i=eL["scheme"+e],a=eL["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 uL(t){return(t=t).startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")?"point":"ordinal"}function hL(t,e){return"color"!==t||e?"linear":"sequential"}function fL(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 dL(t){return Array.from(new Set(t.flat()))}function pL(t){return yL(t,t=>{t=typeof t;return"string"==t||"boolean"==t})}function gL(t){return yL(t,t=>t instanceof Date)}function yL(t,e){for(const n of t)if(n.some(e))return!0;return!1}const mL={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},vL={threshold:"threshold",quantize:"quantize",quantile:"quantile"},bL={ordinal:"ordinal",band:"band",point:"point"},xL={constant:"constant"};function wL(t,e,n){const{coordinates:b=[],title:r}=e,[,x]=p8("component",n),w=t.filter(({guide:t})=>null!==t),M=[];var i,e=function(t,e,n){const[,o]=p8("component",n),s=t["coordinates"];function i(t,e,n,r){[e,t,i=[]]=[e,t,s];var i,a,e="x"===e?b8(i)?t+"Y":t+"X":"y"===e?b8(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=n0(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(...Cb(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 mL?"continuous":t in bL?"discrete":t in vL?"distribution":t in xL?"constant":null}(t)])}));for([e,n]of FP)for(const{option:i,combination:a}of r)if(n.some(t=>on(s(t),s(i))))return[e,a];return null}).filter(Ag);return l}(t),...function(t,n){return t.map(t=>{var e=t["name"];if(!(0<m8(n,"helix").length||x8(n))&&(!b8(n)||!v8(n)&&!w8(n))){if(e.startsWith("x"))return v8(n)?["axisArc",[t]]:w8(n)?["axisLinear",[t]]:[b8(n)?"axisY":"axisX",[t]];if(e.startsWith("y"))return v8(n)?["axisLinear",[t]]:w8(n)?["axisArc",[t]]:[b8(n)?"axisX":"axisY",[t]];if(e.startsWith("position")){if(0<m8(n,"radar").length)return["axisRadar",[t]];if(!v8(n))return["axisY",[t]]}}return null}).filter(Ag)}(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]=OL(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=EL(n),n===r.slice(-1)[0].name||null===a?[null,null]:([o,s]=OL(i),["center",(s-o)/(r.length-1)*a+o])}{var s;if("axisY"===t&&function(t){return 0<m8(t,"parallel").length}(i))return null===(s=EL(n))?e:b8(i)?0===s?["top",null]:["center","horizontal"]:0===s?e:["center","vertical"]}if("axisLinear"===t)return[r]=OL(i),["center",r];if("axisArc"===t)return"inner"===e[0]?["inner",null]:["outer",null];if(v8(i))return["center",null];if(w8(i))return["center",null];if("axisX"===t&&function(t){return 0<m8(t,"reflect").length}(i)||"axisX"===t&&function(t){return 0<m8(t,"reflectY").length}(i))return["top",null];return e}(t,e,i,a,o);if("string"==typeof t&&t.startsWith("legend")&&v8(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 ML(t,e,n,r,i){var[a]=p8("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 kL(t,o){const r=["left","right","bottom","top"];return n0(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=P0(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=v0(t,t=>t.size),n=v0(t,t=>t.order),i=v0(t,t=>t.crossPadding);return{type:"group",size:r,order:n,position:t[0].position,children:t,crossPadding:i}})}function OL(t){var e,n=m8(t,"polar");return n.length?(n=n[n.length-1],{startAngle:n,endAngle:e}=fd(n),[n,e]):(n=m8(t,"radial")).length?(e=n[n.length-1],{startAngle:t,endAngle:n}=md(e),[t,n]):[-Math.PI/2,Math.PI/2*3]}function EL(t){t=/position(\d*)/g.exec(t);return t?+t[1]:null}function SL(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")?TL:s.startsWith("group")?AL:s.startsWith("legendContinuous")?PL:"legendCategory"===s?CL:s.startsWith("slider")?_L:()=>{})(t,e,n,r,i,a)}}function AL(t,e,n,r,i,a){var o=t["children"];const s=v0(o,t=>t.crossPadding),l=(o.forEach(t=>t.crossPadding=s),o.forEach(t=>SL(t,e,n,r,i,a)),v0(o,t=>t.size));t.size=l,o.forEach(t=>t.size=l)}function _L(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 TL(t,e,n,r,i,a){t.transform=t.transform||[{type:"hide"}];var o="left"===r||"right"===r;const s=RL(t,r,i);var{tickLength:r=0,labelSpacing:i=0,titleSpacing:l=0}=s,c=at(s,["tickLength","labelSpacing","titleSpacing"]),a=LL(t,a),u=NL(t,a,c);if(u){var h=v0(u,t=>t.width),f=v0(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=P0(e,t=>t.width);if(n<a)return 1;const o=t.clone(),s=(o.update({range:[0,n]}),IL(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=jL(t,c);a&&(t.size+=o?l+a.width:l+a.height)}function PL(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,LL(t,a)),l=NL(t,c,i);if(l){const u=r?"width":"height";a=v0(l,t=>t[u]);t.size+=a+o}var c=jL(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 CL(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=jL(o,f);t=LL(o,r);const m=NL(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=v0(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:k}of m){k=b(k,h);e+k>g?(n=Math.max(n,e),e=k,t++):e+=k}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 LL(t,e){var[e]=p8("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 NL(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=IL(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?w5(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 BL(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 jL(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"),BL(Array.isArray(t)?t.join(","):t,Object.assign(Object.assign({},n),{transform:e||"vertical"===r?"rotate(-90)":""})))}function RL(t,e,n){var{axis:n,["axis"+Og(e)]:e}=n;return ot({},n,e,t.style)}function IL(t,e){t=t.getTicks?t.getTicks():t.getOptions().domain;return e?t.filter(e):t}function BL(t,e){t=(t=t)instanceof Jl?t:new Rc({style:{text:""+t}}),t.attr(Object.assign(Object.assign({},e),{visibility:"none"})),e=t.getBBox();return e}function DL(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(!v8(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 RL(t,"axisArc"===t.type?"arc":"linear",n)}),o=v0(a,t=>{return null!=(t=t.labelSpacing)?t:0}),s=i.flatMap((t,e)=>{e=a[e];return NL(t,LL(t,r),e)}).filter(Ag),l=v0(s,t=>t.height)+o,c=i.flatMap((t,e)=>{return jL(t,a[e])}).filter(t=>null!==t),u=0===c.length?0:v0(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}=FL(t,i-M-w,[M,w],["left","right"],o,e,n),k=r-d-f,[v,b]=x(k,v,b,M,w),M=k-v-b,{paddingTop:w,paddingBottom:k}=FL(t,M,[v,b],["bottom","top"],o,e,n),t=i-p-g,[e,n]=x(t,m,y,k,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 FL(t,n,r,e,i,a,o){var s=e0(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"+Og(BE(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=v0(e.children,t=>t.size)):e.size=e.defaultSize:(SL(t,n,r,p,a,o),y(t)))};"number"==typeof g?t.forEach(y):0===t.length?u[h]=30:((f=kL(t,n)).forEach(d),d=f.reduce((t,{size:e})=>t+e,0),u[h]=d)}return u}function zL(t,I,e){var B=e0(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,Wp],right:[H-n,r,n,a,"horizontal",!1,Wp],bottom:[t,c-i,o,i,"vertical",!1,Wp],left:[0,r,t,a,"horizontal",!0,Wp],"top-left":[t,0,o,r,"vertical",!0,Wp],"top-right":[t,0,o,r,"vertical",!0,Wp],"bottom-left":[t,c-i,o,i,"vertical",!1,Wp],"bottom-right":[t,c-i,o,i,"vertical",!1,Wp],center:e,inner:e,outer:e};for(const[j,t]of B.entries()){var u=V[j],[h,Y]=Pb(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]=Pb(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 R0(t)&&L0(t)}(m)){if(L0(m)){f=void 0;g=void 0;x=void 0;w=void 0;M=void 0;k=void 0;f=h;g=v;var[x,w,M,k]=g;for(const it of f)it.bbox={x:x,y:w,width:M,height:k}}else if(R0(m)){g=void 0;f=void 0;O=void 0;E=void 0;g=h;f=m;var O=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,O):"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,O)}}else{S=void 0;E=void 0;A=void 0;_=void 0;q=void 0;$=void 0;var S=h;E=v;var[A,_,q,$]=E;for(const R of S)R.bbox={x:A,y:_,width:q,height:$},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;X=void 0;O=void 0;P=void 0;C=void 0;K=void 0;Z=void 0;var T=h;g=m;f=v;var[U,X,,f]=f,[O,P]=g.getCenter(),[g]=D0(g),f=f/2,C=g*f,K=O-C,Z=P-C;for(let t=0;t<T.length;t++)T[t].bbox={x:U+K,y:X+Z,width:2*C,height:2*C}}else if("outer"===b){m=void 0;g=void 0;Q=void 0;J=void 0;tt=void 0;et=void 0;m=h;g=v;var[Q,J,tt,et]=g;for(const at of m)at.bbox={x:Q,y:J,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]=D0(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 A of t){const{bbox:_,children:T}=A;var w=_[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"),k=T.map((t,e)=>{var{length:t=P,padding:n=0}=t;return t+(e===T.length-1?0:n)}),O=P0(k),w=w-O,O="flex-start"===M?0:"center"===M?w/2:w;for(let t=0,e=_[h]+O;t<T.length;t++){var E=T[t],{padding:S=0}=E,S=t===T.length-1?0:S;E.bbox={[d]:_[d],[c]:_[c],[h]:e,[g]:k[t]-S},ot(E,{layout:{justifyContent:M}}),e+=k[t]}}}(t,u)}}function WL(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 GL(t,i,a){return X(this,void 0,void 0,function*(){var t=a["library"],e=i["data"],[t]=p8("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=>X(this,void 0,void 0,function*(){var t=yield n(e);return r(t)}),Mg)}([at(n,["transform"]),...r].map(t))(e);return[Array.isArray(n)?_b(n):[],Object.assign(Object.assign({},i),{data:n})]})}function HL(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 VL(t,e,n){const{encode:r,data:i}=e;var a;return r?(a=Ab(r,t=>{var e,n;return function(t){if("object"!=typeof t||t instanceof Date||null===t)return;t=t.type;return Ag(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 YL(t,e,n){var r=e["encode"];return r?(r=Ab(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 qL(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];n=n.library;const a=function(t){const[n]=p8("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=Ab(r,t=>a(i,t));return[t,Object.assign(Object.assign({},e),{encode:n})]}function $L(t,e,n){var{tooltip:r={}}=e;return Lg(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:Cg(r)&&Rg(r)?[t,Object.assign(Object.assign({},e),{tooltip:r})]:[t,Object.assign(Object.assign({},e),{tooltip:{items:[r]}})]}function UL(g,t,e){const{data:y,encode:m,tooltip:n={}}=t;var r,i,a,o;return Lg(n)?[g,t]:(r=e=>{if(!e)return e;if("string"==typeof e)return g.map(t=>({name:e,value:y[t][e]}));if(Cg(e)){var{field:t,channel:n,color:r,name:i=t,valueFormatter:a=t=>t}=e,o="string"==typeof a?w5(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);Cg(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 XL(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 KL(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 ZL(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 QL(l,c,u){return X(this,void 0,void 0,function*(){var[t,e]=yield function(s,l,c){return X(this,void 0,void 0,function*(){var t=c["library"],[t]=p8("transform",t),{preInference:e=[],postInference:n=[]}=l,{transform:r=[]}=s,e=[WL,GL,HL,VL,YL,qL,XL,ZL,KL,$L,...e.map(t),...r.map(t),...n.map(t),UL];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=i0(Object.entries(n).filter(([,t])=>Ag(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 JL(H,V,Y,q){var $,U;return X(this,void 0,void 0,function*(){const[n]=p8("composition",Y);var[t]=p8("interaction",Y);const I=new Set(Object.keys(Y).map(t=>{return null==(t=/mark\.(.*)/.exec(t))?void 0:t[1]}).filter(Ag)),r=new Set(Object.keys(Y).map(t=>{return null==(t=/component\.(.*)/.exec(t))?void 0:t[1]}).filter(Ag)),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?rN(f,h,Y):yield eN(h,Y),p=(s.set(f,h),o.push(f),d.flatMap(e).map(t=>y8(t,Y)));if(c.push(...p),p.every(a)){var g=yield Promise.all(p.map(t=>nN(t,Y)));oL(f=(f=g).flatMap(t=>Array.from(t.values())).flatMap(t=>t.channels.map(t=>t.scale)),"x"),oL(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 hN(h,Y),f=e(d);Array.isArray(f)?c.push(...f):"function"==typeof f&&u.push(f())}}q.emitter.emit(g3.BEFORE_PAINT);const y=new Map,m=new Map,v=[];V.selectAll(gN(bh)).data(o,t=>t.key).join(t=>t.append("g").attr("className",bh).attr("id",t=>t.key).call(tN).each(function(t){iN(t,lt(this),v,Y,q),y.set(t,this)}),t=>t.call(tN).each(function(t){iN(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=>X(this,void 0,void 0,function*(){var t,[e,n]=yield eN(h,d),r=(iN(e,f,[],d,p),f),i=h,a=e,o=p,[s]=p8("interaction",s=d),l=(l=r.node()).nameInteraction,c=uN(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)JL(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 uN(H)){var[M,k]=C;k&&(k=t(Object.assign({type:M},k))(P,x,q.emitter),w.set(M,{destroy:k}))}}var O=b(m);for(const L of O){const{options:H,container:N}=L;var E=N.nameInteraction;for(const j of uN(H)){var[S,A]=j,_=E.get(S);_&&null!=($=_.destroy)&&$.call(_),A&&(_=t(Object.assign({type:S},A))(L,O,q.emitter),E.set(S,{destroy:_}))}}const{width:z,height:W}=H;var T=[];for(const R of u){var G=new Promise(e=>X(this,void 0,void 0,function*(){for(const t of R)yield JL(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(g3.AFTER_PAINT);b=v.filter(Ag).map(lN).map(t=>t.finished);return Promise.all([...b,...T])})}function tN(t){t.style("transform",t=>`translate(${t.layout.x}, ${t.layout.y})`)}function eN(e,n){return X(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 X(this,void 0,void 0,function*(){var[t,e]=p8("mark",g),n=new Set(Object.keys(g).map(t=>{return null==(t=/component\.(.*)/.exec(t))?void 0:t[1]}).filter(Ag));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 hN(u,g);const{type:f=Eg("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,y8(t,n));return rN(yield nN(t,n),t,n)})}function nN(g,y){return X(this,void 0,void 0,function*(){var[t]=p8("theme",y),[,e]=p8("mark",y),{theme:n,marks:r,coordinates:i=[]}=g,a=t(cN(n)),o=new Map;for(const f of r){var s,l=f["type"],{props:l={}}=e(l),l=yield QL(f,l,y);l&&([l,s]=l,o.set(l,s))}for(const d of e0(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(Ag)));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({},nL(h,c,g,i,a,y)),{key:u});d.forEach(t=>t.scale=p)}return o})}function rN(t,e,n){var[r]=p8("mark",n),[i]=p8("theme",n),[a]=p8("labelTransform",n);const{key:o,frame:s=!1,theme:I,clip:B,style:l={},labelTransform:D=[]}=e;var i=i(cN(I)),c=Array.from(t.values());const u=rL(c,e);var c=wL(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=DL(c,e,i,n),f=function(t,e,n){var[n]=p8("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 f8(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=(zL(kL(c),f,h),{});for(const x of c){var{scales:F=[]}=x;const u=[];for(const w of F){var z=w["name"],p=aL(w,n);u.push(p),iL(d,{[z]:p})}x.scaleInstances=u}var g,y,m=[];for([g,y]of t.entries()){const{children:M,dataDomain:k,modifier:O,key:E}=g,{index:S,channels:A,tooltip:_}=y;var v=Ab(Object.fromEntries(A.map(({name:t,scale:e})=>[t,e])),t=>aL(t,n));iL(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}(A,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])=>Ag(t)&&Ag(e))&&(r.push(a),i.push(o))}return[r,i]}(r(g)(S,v,T,f));var b=k||P.length;const N=O?O(C,b,h):[],j=t=>{var e;return null==(e=null==(e=_.title)?void 0:e[t])?void 0:e.value},R=e=>_.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},_&&{title:j(t),items:R(t)});for(const[r,i]of Object.entries(T))n[r]=i[t],L&&(n["series"+Xe(r)]=L[e].map(t=>i[t]));return L&&(n.seriesIndex=L[e]),L&&_&&(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:kg(D.map(a))},m]}function iN(tt,et,nt,rt,it){X(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=>_g(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(gN(kh)).data(u.filter(t=>Ag(h[t])),t=>l[t]).join(t=>t.append("rect").attr("className",kh).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:k=g,exitType:O=d}=E;void 0!==y&&!y||(e=Math.max(e,m+v),n=Math.min(n,v)),void 0!==O&&!O||(e=Math.max(e,M+k),n=Math.min(n,k)),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 n0(t,t=>t.type+"-"+t.position))c.forEach((t,e)=>t.index=e);var x,w,M,u=et.selectAll(gN(wh)).data(t,t=>`${t.type}-${t.position}-`+t.index).join(t=>t.append("g").style("zIndex",({zIndex:t})=>t||-1).attr("className",wh).append(t=>ML(ot({animate:b,scale:s},t),i,n,rt,r)),t=>t.transition(function(t){var{preserve:e=!1}=t;if(!e)return e=ML(ot({animate:b,scale:s},t),i,n,rt,r)["attributes"],[t]=this.childNodes,t.update(e)})).transitions();nt.push(...u.flat().filter(Ag));const k=et.selectAll(gN(xh)).data([e],()=>a).join(t=>t.append("rect").style("zIndex",0).style("fill","transparent").attr("className",xh).call(fN).call(pN,Array.from(r.keys())).call(yN,o),t=>t.call(pN,Array.from(r.keys())).call(t=>{if(!v)return fN(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(yN,o)).transitions();nt.push(...k.flat());for([x,w]of r.entries()){var W=w["data"];const{key:a,class:q,type:_}=x;var O=et.select("#"+a);const T=function(s,t,e,n,r){const[l]=p8("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:g8(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=Ab(p,t=>aN(t,a,o,c)),i=Object.assign(Object.assign({},r),{type:dN(s,e)});return l(i,g)(n,t,oN(f,d,e,u),h)}}(x,w,tt,rt,it),$=(E=x,M=w,sN("enter",E,M,tt,rt)),P=(E=x,M=w,sN("update",E,M,tt,rt)),U=(E=x,M=w,sN("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,O,q,"element");const k=O.selectAll(gN(vh)).selectFacetAll(E).data(W,t=>t.key,t=>t.groupKey).join(t=>t.append(T).attr("className",vh).attr("markType",_).transition(function(t){return $(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?Sg(this,o):(this.parentNode.replaceChild(o,this),o.className=vh,o.markType=_)),s}).attr("markType",_).attr("className",vh)}),t=>t.each(function(){this.__removed__=!0}).transition(function(t){return U(t,[this])}).remove(),t=>t.append(T).attr("className",vh).attr("markType",_).transition(function(t){var e=this["__fromElements__"],t=P(t,e,[this]);return new $b(e,null,this.parentNode).transition(t).remove(),t}),t=>t.transition(function(t){var e=new $b([],this.__toData__,this.parentNode).append(T).attr("className",vh).attr("markType",_).nodes();return P(t,[this],e)}).remove()).transitions();nt.push(...k.flat())}{var S=tt,G=et,H=rt,V=it,A,Y;const[X]=p8("labelTransform",H),{markState:K,labelTransform:C}=S,Z=G.select(gN(mh)).node(),L=new Map,N=new Map,Q=Array.from(K.entries()).flatMap(([t,e])=>{var{labels:n=[],key:r}=t;const i=function(t,e,n,r,i){const[s]=p8("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:g8(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=Ab(Object.assign(Object.assign({},t),a),t=>aN(t,r,e,l)),{shape:a=c,text:o}=t,t=at(t,["shape","text"]),i="string"==typeof i?w5(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,oN(h,"label",a,"label"),u)}}(t,e,S,H,V),a=G.select("#"+r).selectAll(gN(vh)).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(gN(Mh)).data(Q,t=>t.key).join(t=>t.append(t=>L.get(t)(t)).attr("className",Mh),t=>t.each(function(t){Sg(this,L.get(t)(t))}),t=>t.remove()).nodes(),J=e0(j,t=>N.get(t.__data__)),R=S["coordinate"];for([A,Y]of J){var{transform:A=[]}=A;kg(A.map(X))(Y,R)}C&&C(j,R)}})}function aN(t,e,n,r){return"function"==typeof t?t(e,n,r):"string"==typeof t&&void 0!==e[t]?e[t]:t}function oN(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 sN(o,t,e,n,r){var[,i]=p8("shape",r);const[s]=p8("animation",r);var r=e["defaultShape"],{theme:e,coordinate:n}=n,a=`default${Xe(o)}Animation`;const{[a]:l}=i(dN(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 lN(t){return t.finished.then(()=>{t.cancel()}),t}function cN(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 uN(t){var{interaction:t={}}=t;return Object.entries(ot({event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},t))}function hN(r,i){return X(this,void 0,void 0,function*(){var t={library:i},e=r["data"],n=at(r,["data"]);return null==e?r:([,{data:e}]=yield GL(0,{data:e},t),Object.assign({data:e},n))})}function fN(t){t.style("x",t=>t.paddingLeft).style("y",t=>t.paddingTop).style("width",t=>t.innerWidth).style("height",t=>t.innerHeight)}function dN(t,e){t=t.type;return"string"==typeof e?t+"."+e:e}function pN(t,e){const n=t=>void 0!==t.class?""+t.class:"";0===t.nodes().length||(t.selectAll(gN(yh)).data(e,t=>t.key).join(t=>t.append("g").attr("className",yh).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(gN(mh)).node())||t.append("g").attr("className",mh).style("zIndex",0)}function gN(...t){return t.map(t=>"."+t).join("")}function yN(t,i){t.node()&&t.style("clipPath",t=>{var e,n,r;return i?({paddingTop:t,paddingLeft:e,innerWidth:n,innerHeight:r}=t,new Lc({style:{x:e,y:t,width:n,height:r}})):null})}function mN(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 vN(t,e={},n=()=>{},r=t=>{throw t}){const{width:i=640,height:a=480,theme:o}=t,s=(o||Eg('ChartOptions.theme is required, such as `const chart = new Chart({ theme: "classic"})`.'),mN(t)),{canvas:l=(t=i,h=a,f=new nd,f.registerPlugin(new sd),new ou({width:t,height:h,container:document.createElement("div"),renderer:f})),library:c=DP(),emitter:u=new cd}=e;var h,f;e.canvas=l,e.library=c,e.emitter=u,l.resize(i,a),u.emit(g3.BEFORE_RENDER);const d=lt(l.document.documentElement);return l.ready.then(()=>JL(Object.assign(Object.assign({},s),{width:i,height:a}),d,c,e)).then(()=>{l.requestAnimationFrame(()=>{u.emit(g3.AFTER_RENDER),null!=n&&n()})}).catch(t=>{null!=r&&r(t)}),"string"==typeof(t=l.getConfig().container)?document.getElementById(t):t}function bN(t,e={},n=!1){var r,{canvas:e,emitter:i}=e;e&&(null!=(r=(r=e).getRoot().querySelectorAll("."+bh))&&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 xN(t,{name:e,key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function wN(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 MN(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 y(r){return t=>{for(const n of r){var e=n["type"];"value"===e?xN(t,n):"array"===e?wN(t,n):"object"===e?MN(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}):Cg(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 kN(t){return Object.entries(t).map(([t,e])=>({type:"node",name:t,ctor:e}))}function ON(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 EN{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 ON(this,t=>{e===t.attr("key")&&(n=t)}),n}getNodesByType(e){const n=[];return ON(this,t=>{e===t.type&&n.push(t)}),n}getNodeByType(e){let n=null;return ON(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 SN extends EN{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)}}a=[{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"}],tl=[{name:"scale",type:"object"},{name:"transform",type:"array"},{name:"style",type:"object"},{name:"state",type:"object"}],Vs=tl;let AN=class extends SN{constructor(){super({})}},_N=(AN=e([y(a)],AN),class extends SN{constructor(){super({},"interval")}}),TN=(_N=e([y(a)],_N),class extends SN{constructor(){super({},"rect")}}),PN=(TN=e([y(a)],TN),class extends SN{constructor(){super({},"point")}}),CN=(PN=e([y(a)],PN),class extends SN{constructor(){super({},"area")}}),LN=(CN=e([y(a)],CN),class extends SN{constructor(){super({},"line")}}),NN=(LN=e([y(a)],LN),class extends SN{constructor(){super({},"cell")}}),jN=(NN=e([y(a)],NN),class extends SN{constructor(){super({},"vector")}}),RN=(jN=e([y(a)],jN),class extends SN{constructor(){super({},"link")}}),IN=(RN=e([y(a)],RN),class extends SN{constructor(){super({},"polygon")}});IN=e([y(a)],IN);Ro=e([y(a)],class extends SN{constructor(){super({},"image")}});let BN=class extends SN{constructor(){super({},"text")}},DN=(BN=e([y(a)],BN),class extends SN{constructor(){super({},"box")}}),FN=(DN=e([y(a)],DN),class extends SN{constructor(){super({},"lineX")}}),zN=(FN=e([y(a)],FN),class extends SN{constructor(){super({},"lineY")}}),WN=(zN=e([y(a)],zN),class extends SN{constructor(){super({},"range")}}),GN=(WN=e([y(a)],WN),class extends SN{constructor(){super({},"rangeX")}}),HN=(GN=e([y(a)],GN),class extends SN{constructor(){super({},"rangeY")}}),VN=(HN=e([y(a)],HN),class extends SN{constructor(){super({},"connector")}}),YN=(VN=e([y(a)],VN),class extends SN{constructor(){super({},"shape")}}),qN=(YN=e([y(a)],YN),class extends SN{constructor(){super({},"sankey")}}),$N=(qN=e([y([...a,{name:"layout",type:"value"}])],qN),class extends SN{constructor(){super({},"treemap")}}),UN=($N=e([y([...a,{name:"layout",type:"value"}])],$N),class extends SN{constructor(){super({},"boxplot")}}),XN=(UN=e([y(a)],UN),class extends SN{constructor(){super({},"density")}}),KN=(XN=e([y(a)],XN),class extends SN{constructor(){super({},"heatmap")}}),ZN=(KN=e([y(a)],KN),class extends SN{constructor(){super({},"path")}}),QN=(ZN=e([y(a)],ZN),class extends SN{constructor(){super({},"pack")}}),JN=(QN=e([y([...a,{name:"layout",type:"value"}])],QN),class extends SN{constructor(){super({},"forceGraph")}}),t7=(JN=e([y([...a,{name:"layout",type:"value"}])],JN),class extends SN{constructor(){super({},"tree")}}),e7=(t7=e([y([...a,{name:"layout",type:"value"}])],t7),class extends SN{constructor(){super({},"wordCloud")}}),n7=(e7=e([y([...a,{name:"layout",type:"object"}])],e7),class extends SN{constructor(){super({},"gauge")}}),r7=(n7=e([y(a)],n7),class extends SN{constructor(){super({},"axisX")}}),i7=(r7=e([y(tl)],r7),class extends SN{constructor(){super({},"axisY")}}),a7=(i7=e([y(tl)],i7),class extends SN{constructor(){super({},"legends")}});a7=e([y(Vs)],a7);const o7={mark:AN,interval:_N,rect:TN,point:PN,area:CN,line:LN,cell:NN,vector:jN,link:RN,polygon:IN,image:Ro,text:BN,box:DN,lineX:FN,lineY:zN,range:WN,rangeX:GN,rangeY:HN,connector:VN,sankey:qN,treemap:$N,boxplot:UN,density:XN,heatmap:KN,path:ZN,shape:YN,pack:QN,forceGraph:JN,tree:t7,wordCloud:e7,gauge:n7,axisX:r7,axisY:i7,legends:a7};class s7 extends EN{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()&&WS(t)}hide(){var t=this.getGroup();t&&t.isVisible()&&zS(t)}}let l7=class extends s7{constructor(t={},e="view"){super(t,e)}},c7=(l7=e([y([{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"},...kN(o7)])],l7),class extends s7{constructor(){super({},"spaceLayer")}}),u7=(c7=e([y([{type:"value",name:"data"},...kN(o7)])],c7),class extends s7{constructor(){super({},"spaceFlex")}}),h7=(u7=e([y([{type:"value",name:"data"},...kN(o7)])],u7),class extends s7{constructor(){super({},"facetRect")}}),f7=(h7=e([y([{type:"value",name:"data"},{type:"array",name:"transform"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"legend"},{type:"object",name:"axis"},...kN(o7)])],h7),class extends s7{constructor(){super({},"facetCircle")}}),d7=(f7=e([y([{type:"value",name:"data"},{type:"array",name:"transform"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"legend"},{type:"object",name:"axis"},...kN(o7)])],f7),class extends s7{constructor(){super({},"repeatMatrix")}}),p7=(d7=e([y([{type:"value",name:"data"},{type:"array",name:"transform"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"encode"},{type:"object",name:"legend"},...kN(o7)])],d7),class extends s7{constructor(){super({},"timingKeyframe")}}),g7=(p7=e([y([...kN(o7)])],p7),class extends s7{constructor(){super({},"geoView")}}),y7=(g7=e([y([{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"},...kN(o7)])],g7),class extends s7{constructor(){super({},"geoPath")}});y7=e([y([{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"},...kN(o7)])],y7);const m7={view:l7,spaceLayer:c7,spaceFlex:u7,facetRect:h7,facetCircle:f7,repeatMatrix:d7,timingKeyframe:p7,geoView:g7,geoPath:y7};for(const _7 of Object.values(m7))y(kN(m7))(_7);const v7=DP();const b7=t=>t?parseInt(t):0;const x7=["width","height","padding","paddingLeft","paddingRight","paddingBottom","paddingTop","inset","insetLeft","insetRight","insetTop","insetBottom","margin","marginLeft","marginRight","marginTop","marginBottom","autoFit","theme","title"];function w7(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function M7(t,e){var n,r=t["autoFit"];return r?(r=e,e=getComputedStyle(r),n=r.clientWidth||b7(e.width),r=r.clientHeight||b7(e.height),{width:n-(b7(e.paddingLeft)+b7(e.paddingRight)),height:r-(b7(e.paddingTop)+b7(e.paddingBottom))}):({width:n=640,height:r=480}=t,{width:n,height:r})}function k7(t){var t=function(t){if(null!==t.type)return t;var e=t.children[t.children.length-1];for(const n of x7)e.attr(n,t.attr(n));return e}(t),e=[t],n=new Map;for(n.set(t,w7(t));e.length;){const t=e.pop();var r=n.get(t),{children:i=[]}=t;for(const s of i){var a=w7(s),{children:o=[]}=r;o.push(a),e.push(s),n.set(s,a),r.children=o}}return n.get(t)}function O7(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(o7)).has(t))return e;var r={type:"view"},i=Object.assign({},e);for(const a of x7)void 0!==i[a]&&(r[a]=i[a],delete i[a]);return Object.assign(Object.assign({},r),{children:[i]})}function E7(t){var e=t["type"],t=at(t,["type","children"]),n=new(function(t){if("function"==typeof t)return o7.mark;var e=Object.assign(Object.assign({},o7),m7)[t];if(e)return e;throw new Error(`Unknown mark: ${t}.`)}(e));return n.value=t,n.type=e,n}function S7(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];Be(a)&&Be(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 A7(t,e,n){for(var r=[[null,t,O7(t,e,n)]];r.length;){var[i,a,o]=r.shift();if(a)if(o){S7(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=E7(m),y=(Array.isArray(f.children)&&f.push(g),m)["children"];if(Array.isArray(y))for(const v of y)p.push([g,v])}}}}nl=[{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"},...kN(o7),...(Ko=m7,Object.entries(Ko).map(([t,e])=>({type:"container",name:t,ctor:e})))];E.Chart=class extends l7{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=Je(()=>{this.forceFit()},300),this._renderer=r||new nd,this._plugins=i||[],this._container=void 0===(t=e)?document.createElement("div"):"string"==typeof t?document.getElementById(t):t,this._emitter=new cd,this._context={library:v7,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)=>vN(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?k7(this):(e=t["type"],e&&(this._previousDefinedType=e),A7(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(g3.BEFORE_CLEAR),this._reset(),bN(0,this._context,!1),this.emit(g3.AFTER_CLEAR)}destroy(){var t,e;this.options();this.emit(g3.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),bN(0,this._context,!0),t=this._container,(e=t.parentNode)&&e.removeChild(t),this.emit(g3.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;var{width:t,height:e}=M7(this.options(),this._container);if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(g3.BEFORE_CHANGE_SIZE);t=this.render();return t.then(()=>{this.emit(g3.AFTER_CHANGE_SIZE)}),t}changeSize(t,e){if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(g3.BEFORE_CHANGE_SIZE),this.width(t),this.height(e);t=this.render();return t.then(()=>{this.emit(g3.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}=M7(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}=M7(this.options(),this._container);this._plugins.push(new sd),this._plugins.forEach(t=>this._renderer.registerPlugin(t)),this._context.canvas=new ou({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))}},E.Chart=e([y(nl)],E.Chart),_.enableCSSParsing=!1,E.AREA_CLASS_NAME=kh,E.COMPONENT_CLASS_NAME=wh,E.ChartEvent=g3,E.CompositionNode=s7,E.ELEMENT_CLASS_NAME=vh,E.LABEL_CLASS_NAME=Mh,E.LABEL_LAYER_CLASS_NAME=mh,E.MAIN_LAYER_CLASS_NAME=yh,E.MarkNode=SN,E.PLOT_CLASS_NAME=xh,E.VIEW_CLASS_NAME=bh,E.createLibrary=DP,E.register=function(t,e){Object.assign(v7,{[t]:e})},E.render=vN,E.renderToMountedElement=function(t,e={},n=()=>{},r=t=>{throw t}){var{width:i=640,height:a=480}=t,t=mN(t);const{library:o=DP(),group:s=new hc,emitter:l=new cd}=e;null!==s&&void 0!==s&&s.parentElement||Eg("renderToMountedElement can't render chart to unmounted group.");var c=lt(s);return e.group=s,e.library=o,(e.emitter=l).emit(g3.BEFORE_RENDER),JL(Object.assign(Object.assign({},t),{width:i,height:a}),c,o,e).then(()=>{s.ownerDocument.defaultView.requestAnimationFrame(()=>{l.emit(g3.AFTER_RENDER),null!=n&&n()})}).catch(t=>{null!=r&&r(t)}),s},Object.defineProperty(E,"__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"}},A=t=>T(t)||_(t),_=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]=KS(l,t);y&&A(e)?A(e)&&(g=[t,n]):(k(t,n),v=!0)},C=t=>{var e,n,r,i,a,o,s=t["target"],t=KS(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=KS(l,t),[e,n,r,i]=E(d,p),v=!1,o(e,n,r,i,t))},N=t=>{t=t.target;y&&!A(t)&&O()},j=t=>{t=t.target;y&&A(t)&&!v?T(t)?o3(l,"move"):_(t)&&o3(l,S[t.id].cursor):o3(l,"crosshair")},R=()=>{o3(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||k(t,e),d=[t,e],p=[n,r],E([t,e],[n,r],i)},remove(t=!0){y&&O(t)},destroy(){y&&O(!1),o3(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 J3(e,t,n){return t.filter(t=>{return t!==e&&({interaction:t={}}=t.options,Object.values(t).find(t=>t.brushKey===n))})}function tA(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=n3(y,a),n=st(e,"mask");const{setState:b,removeState:x}=t3(p,i),w=new Map,{width:M,height:k,x:O=0,y:E=0}=f(t);a=s||[0,0,M,k];const S=()=>{for(const t of[...y,...v])x(t,"active","inactive")},A=(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")},_=()=>{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 Lc({style:{x:t+O,y:e+E,width:n-t,height:r-e}}),b(o,"inactive"),b(a,"active")}},P=Q3(t,Object.assign(Object.assign({},n),{extent:a,brushRegion:o,reverse:l,selectedHandles:r,brushended:t=>{var e=h?_:S;t&&g.emit("brush:remove",{nativeEvent:!0}),e()},brushed:(t,e,n,r,i)=>{var a=hS(t,e,n,r,c,u);i&&g.emit("brush:highlight",{nativeEvent:!0,data:{selection:a}}),(h?T:A)(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=fS(t,e),e=fS(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 eA(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=US(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],tA(s.parentNode.parentNode,Object.assign(Object.assign({elements:()=>qS(t,e),datum:JS($S(t,e).map(t=>t.view)),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:[r,i,a,o],state:e3($S(t,e).map(t=>t.options),h),emitter:n,scale:f,coordinate:d,selectedHandles:void 0},u),m));const p=tA(s,Object.assign(Object.assign({elements:YS,key:t=>t.__data__.key,siblings:()=>{return J3(t,e,y).map(t=>US(t.container))},datum:JS([l,...J3(t,e,y).map(t=>t.view)]),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0,state:e3([c,...J3(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 nA(t,e,n,r,i){var[,i,,a]=i;return[t,i,n,a]}function rA(t){return eA(Object.assign(Object.assign({},t),{brushRegion:nA,selectedHandles:["handle-e","handle-w"]}))}function iA(t,e,n,r,i){var[i,,a]=i;return[i,e,a,r]}function aA(t){return eA(Object.assign(Object.assign({},t),{brushRegion:iA,selectedHandles:["handle-n","handle-s"]}))}const oA="axis",sA="axis-hot-area";function lA(t){return t.getElementsByClassName(oA)}function cA(t){return t.getElementsByClassName("axis-line")[0]}function uA(t){return t.getElementsByClassName("axis-main-group")[0].getLocalBounds()}function hA(t,e){var{cross:n,offsetX:i}=e,e=at(e,["cross","offsetX","offsetY"]),r=uA(t),[t]=cA(t).getLocalBounds().min;const[a,o]=r.min,[s,l]=r.max;r=2*(s-a);return{brushRegion:iA,hotZone:new Lc({className:sA,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 fA(t,e){var{offsetY:i,cross:n=!1}=e,e=at(e,["offsetY","offsetX","cross"]),r=uA(t),[,t]=cA(t).getLocalBounds().min;const[a,o]=r.min,[s,l]=r.max;r=l-o;return{brushRegion:nA,hotZone:new Lc({className:sA,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 dA(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}=t3(u,n3(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))}},k=(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(uS(n,i))})(n,t)),e&&h.emit("brushAxis:highlight",{nativeEvent:!0,data:{selection:(()=>{if(!O)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})()}})}),O=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)?fA:hA)(P,{offsetY:o,offsetX:l,cross:O,zIndex:999,fill:"transparent"});P.parentNode.appendChild(C);var S=Q3(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 k(a,t)},brushed(t,e,n,r,i){m.set(P,N(t,e,n,r)),k(a,i)}}));E.push(S)}const A=(t={})=>{t=t.nativeEvent;t||E.forEach(t=>t.remove(!1))},_=(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=_(t,e,n),e=_(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",A),h.on("brushAxis:highlight",T),()=>{E.forEach(t=>t.destroy()),h.off("brushAxis:remove",A),h.off("brushAxis:highlight",T)}}function pA(l){return(t,e,n)=>{var{container:t,view:r,options:i}=t,{x:a,y:o}=US(t).getBBox(),s=r["coordinate"];return dA(t,Object.assign({elements:YS,axes:lA,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:JS(r),state:e3(i,["active",["inactive",{opacity:.5}]]),coordinate:s,emitter:n},l))}}function gA(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=Q3(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 yA(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=US(n);let l=!1,c=!1,u=r;var{scale:i,coordinate:h}=r;return gA(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 hS(t,e,n,r,i,a)},filter:(r,i)=>X(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 mA(t){return yA(Object.assign(Object.assign({hideX:!0},t),{brushRegion:nA}))}function vA(t){return yA(Object.assign(Object.assign({hideY:!0},t),{brushRegion:iA}))}const bA="slider";function xA(t){return[t[0],t[t.length-1]]}function wA({channelDomain:C,className:L=bA,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=C0(a);const v=new Map,b=new Set;C=C||{x:s.getOptions().domain,y:l.getOptions().domain};for(const M of t){const k=M.attributes["orientation"],[O,E]=(w=k,x=void 0,x="vertical"===w?"y":"x",w="vertical"===w?"x":"y",m?[w,x]:[x,w]),S=""+N+Xe(O)+":filter",A="x"===O,_=s.getOptions()["ratio"],T=l.getOptions()["ratio"],P=t=>{var e,n;return t.data?(e=t.data["selection"],[e=xA(C.x),n=xA(C.y)]=e,A?[uS(s,e,_),uS(l,n,T)]:[uS(l,n,T),uS(s,e,_)]):(n=t.detail["value"],[function(t,e,n){var[t,r]=t;return uS(e,[cS(e,(n=n?t=>1-t:t=>t)(t),!0),cS(e,n(r),!1)])}(n,i[O],m&&"horizontal"===k),C[E]])};var x=ln(l=>X(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[O]=e,C[E]=s,[n,r,i,a=!1]=[u,{[O]:{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=A?e:s,s=A?s:e,c.emit(S,Object.assign(Object.assign({},l),{nativeEvent:t,data:{selection:[xA(o),xA(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 pl("valuechange",{data:n,nativeEvent:!1})),n=A?fS(t,s):fS(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 MA="g2-scrollbar";function kA(o={}){return(t,e,n)=>{var r,{view:i,container:a}=t;return a.getElementsByClassName(MA).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}),wA(Object.assign(Object.assign({},o),{channelDomain:r,className:MA,prefix:"scrollbar",hasState:!0,setValue:(t,e)=>t.setValue(e[0])}))(t,e,n)):()=>{}}}const OA={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 EA(t){return"text"===t.nodeName&&!!t.isOverflowing()}function SA(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"];EA(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 pc({className:"poptip",style:{innerHTML:(r="div",i=i,a=Object.assign(Object.assign({},OA),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"];EA(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 AA(n){return(t,...e)=>ot({},n(t,...e),t)}function _A(n){return(t,...e)=>ot({},t,n(t,...e))}function TA(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 PA=()=>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:TA(e,u),x:null!=n?n:o,y:null!=r?r:s,width:null!=i?i:l,height:null!=a?a:c})})},CA=(PA.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=TA(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}),LA=(CA.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:TA(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"})]}),NA=(LA.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:k,y:O,key:E,frame:S,labelTransform:A,parentKey:_,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:k,y:O,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:A,margin:d,marginLeft:p,marginBottom:g,marginTop:y,marginRight:m,parentKey:_,clip:T,style:P},!L&&{title:C}),{marks:[Object.assign(Object.assign(Object.assign({},t),{key:E+"-0",data:v}),L&&{title:C})]})]});NA.props={};class jA{constructor(t){this.$value=t}static of(t){return new jA(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}const RA=AA(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=e0(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"))}}}),IA=AA(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)?[Kp(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)}}}),BA=AA(()=>({animate:{enterType:"fadeIn"}})),DA=_A(()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}})),FA=_A(()=>({type:"cell"})),zA=_A(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}}]}}}),WA=_A((t,c=function(t){t=t.points;return Db(t)},w=function(a){return(t,e)=>{var{rowIndex:t,rowValuesLength:n,columnIndex:r,columnValuesLength:i}=t;return t!==n-1?GA(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?GA(r,e):(n=e.length?void 0:null,ot({title:0===t&&void 0,grid:n},r))}},k={})=>{const{data:e,encode:n,children:u,scale:r,x:O=0,y:E=0,shareData:h=!1,key:S}=t,A=e["value"],{x:_,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=_b(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{[_]:t,[T]:e}=t,t=void 0===_||t===n,e=void 0===T||e===r;return t&&e}).map(t=>A.filter(t)),v=h?v0(l,t=>t.length):void 0,b=n.map(([t,e])=>({columnField:_,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:_?5:void 0},y:{tickCount:T?5:void 0}},r=r?g:0===g.length?[]:A,l={color:{domain:P}},o={x:HA(o,w)(p,r),y:HA(a,M)(p,r)};return Object.assign(Object.assign({key:n+"-"+c,data:r,x:u+y+O,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),k)})})}}});function GA(t,e){return e.length?ot({title:!1,tick:null,label:null},t):ot({title:!1,tick:null,label:null,grid:null},t)}function HA(t,e){return"function"==typeof t?t:null===t||!1===t?()=>null:e(t)}const VA=()=>t=>{return[jA.of(t).call(FA).call(IA).call(BA).call(RA).call(DA).call(zA).call(WA).value()]},YA=(VA.props={},AA(t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),qA=_A(t=>{const{data:w,children:c,x:M=0,y:k=0,key:O}=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=_b(t);const s=t.map(({points:t})=>Db(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 GA(r,e)})(y,w),y:("function"==typeof(n=s)?n:null===n?()=>null:(t,e)=>{t=t.columnIndex;if(0!==t)return GA(n,e)})(y,w)};return Object.assign({data:w,parentKey:O,key:i+"-"+c,x:u+m+M,y:h+v+k,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)})})}}}),$A=_A(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 UA=()=>t=>{return[jA.of(t).call(FA).call(IA).call(qA).call($A).call(BA).call(DA).call(YA).value()]},XA=AA(t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}})),KA=AA(t=>({coordinate:{type:"polar"}})),ZA=t=>{var e=t["encode"],t=at(t,["encode"]),e=e["position"];return Object.assign(Object.assign({},t),{encode:{x:e}})};function QA(t){return t=>null}function JA(t){var t=t["points"],[t,e,n,r]=t,i=jb(t,r),t=Lb(t,r),r=Bb(t,Lb(e,n)),e=1/Math.sin(r/2),i=i/(1+e),a=i*Math.sqrt(2),[n,o]=n,t=Ib(t)+r/2,r=i*e;return[n+r*Math.sin(t)-a/2,o+r*Math.cos(t)-a/2,a,a]}const t4=()=>t=>{return[jA.of(t).call(FA).call(ZA).call(IA).call(KA).call(zA).call(WA,JA,QA,QA,{frame:!1}).call(BA).call(DA).call(XA).value()]};const e4=()=>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 n4(t,e){if(null!==t)return{type:"column",value:t,field:e}}function r4(t,e){t=n4(t,e);return Object.assign(Object.assign({},t),{inferred:!0})}function i4(t,e){if(null!==t)return{type:"column",value:t,field:e,visual:!0}}function a4(t,e){var n=[];for(const r of t)n[r]=e;return n}function o4(t,e){var t=t[e];return t?({value:e,field:t=null}=t,[e,t]):[null,null]}function s4(t,...e){for(const i of e){if("string"!=typeof i)return[i,null];var[n,r]=o4(t,i);if(null!==n)return[n,r]}return[null,null]}function l4(t){return!(t instanceof Date)&&"object"==typeof t}e4.props={};const c4=()=>(t,e)=>{var n=e["encode"],n=n["y1"];return void 0!==n?[t,e]:[t,ot({},e,{encode:{y1:r4(a4(t,0))}})]};function u4(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=o4(r,t))?void 0:t[0]]}).filter(([,t])=>Ag(t));return Array.from(e0(e,e=>i.map(([,t])=>t[e]).join("-")).values())}function h4(t){var a,r;return Array.isArray(t)?(a=t,(i,t,e)=>(n,r)=>a.reduce((t,e)=>0!==t?t:Wp(i[n][e],i[r][e]),0)):"function"==typeof t?(r=t,(e,t,n)=>v4(t=>r(e[t]))):"series"===t?p4:"value"===t?g4:"sum"===t?y4:"maxIndex"===t?m4:()=>null}function f4(t,e){for(const n of t)n.sort(e)}function d4(t,e){return(null==e?void 0:e.domain)||Array.from(new Set(t))}function p4(t,e,n){return v4(t=>n[t])}function g4(t,e,n){return v4(t=>e[t])}function y4(t,n,e){t=_b(t),t=Array.from(e0(t,t=>e[+t]).entries());const r=new Map(t.map(([t,e])=>[t,e.reduce((t,e)=>t+ +n[e])]));return v4(t=>r.get(e[t]))}function m4(t,n,e){t=_b(t),t=Array.from(e0(t,t=>e[+t]).entries());const r=new Map(t.map(([t,e])=>[t,b0(e,t=>n[t])]));return v4(t=>r.get(e[t]))}function v4(n){return(t,e)=>Wp(n(t),n(e))}c4.props={};const b4=(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]=o4(r,"y"),[s,l]=o4(r,"y1"),[r]=j?s4(r,"series","color"):o4(r,"color"),c=u4(T,t,e),n=h4(P)(n,a,r),u=(n&&f4(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 A of m.reverse()){var w=f[A];n=u[A]=(h[A]=n)+w}let r=g;for(const _ of y){var M=f[_];0<M?r=u[_]=(h[_]=r)+M:u[_]=h[_]=r}}const k=new Set(d),O=new Set(p);r="y"===L?u:h,n="y"===N?u:h;return[t,ot({},e,{encode:{y0:r4(a,o),y:n4(r,o),y1:n4(n,l)},style:Object.assign({first:(t,e)=>k.has(e),last:(t,e)=>O.has(e)},i)})]}};function x4(t){t=t.type;return"string"==typeof t&&["stackY","dodgeX","groupX"].includes(t)}b4.props={};const w4=a=>(t,e,n)=>{var{encode:r,transform:i=[]}=e;return i.some(x4)||({x:i,y:r}=r,void 0===i)||void 0===r?[t,e]:(i=a["series"],r=i?["x","series"]:"x",b4({groupBy:r})(t,e,n))},M4=(w4.props={},(t={})=>{const{channel:s="x"}=t;return(t,e)=>{const n=e["encode"];var r=e["tooltip"];if(Lg(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=>o4(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}})]}}),k4=(M4.props={},()=>(t,e)=>{var n=e["encode"],n=n["x"];return void 0!==n?[t,e]:[t,ot({},e,{encode:{x:r4(a4(t,0))},scale:{x:{guide:null}}})]}),O4=(k4.props={},()=>(t,e)=>{var n=e["encode"],n=n["y"];return void 0!==n?[t,e]:[t,ot({},e,{encode:{y:r4(a4(t,0))},scale:{y:{guide:null}}})]}),E4=(O4.props={},()=>(t,e)=>{var n=e["encode"],n=n["size"];return void 0!==n?[t,e]:[t,ot({},e,{encode:{size:i4(a4(t,3))}})]}),S4=(E4.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:n4(r)}})]}),A4=(S4.props={},()=>(t,e)=>{var n=e["encode"],{series:r,color:i}=n;return void 0!==r||void 0===i?[t,e]:([r,i]=o4(n,"color"),[t,ot({},e,{encode:{series:n4(r,i)}})])}),_4=(A4.props={},()=>(t,e)=>{var n=e["data"];return!Array.isArray(n)||n.some(l4)?[t,e]:[t,ot({},e,{encode:{y:n4(n)}})]}),T4=(_4.props={},()=>(t,e)=>{var n=e["data"];return!Array.isArray(n)||n.some(l4)?[t,e]:[t,ot({},e,{encode:{x:n4(n)}})]}),P4=(T4.props={},()=>(t,e)=>{var n=e["encode"],r=n["y1"];return r?[t,e]:([r]=o4(n,"y"),[t,ot({},e,{encode:{y1:n4([...r])}})])}),C4=(P4.props={},()=>(t,e)=>{var n=e["encode"],r=n["x1"];return r?[t,e]:([r]=o4(n,"x"),[t,ot({},e,{encode:{x1:n4([...r])}})])}),L4=(C4.props={},t=>{const i=t["channel"];return(t,e)=>{const{encode:a,tooltip:n}=e;var r;return Lg(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}})])}}),N4=(L4.props={},()=>(t,e)=>[t,ot({scale:{x:{padding:0},y:{padding:0}}},e)]),j4=(N4.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:n4([i||0]),y:n4([a||0])},scale:{x:{type:"identity",independent:!0,guide:null},y:{type:"identity",independent:!0,guide:null}},style:n})]}),R4=(j4.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])))})]}),I4=(R4.props={},()=>(t,e)=>{var n,r=e["data"];return!Array.isArray(r)||r.some(l4)?[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:n4(n),y:n4(r)}})])}),B4=(I4.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:i4(a4(t,void 0))}})]}),D4=(B4.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]=o4(r,"y"),[r]=s4(r,"series","color"),o=d4(r,i),i=u4(c,t,e),n=h4(h)(n,a,r),s=(n&&f4(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:n4(s)}})]}}),F4=(D4.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,o4(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(e0(n,t=>h[t]).values());a.push(...o)}i=a}if(y){const[f]=o4(e,y);f&&i.sort((t,e)=>g(t,f)-g(e,f)),m&&i.reverse()}r=(v||3e3)/i.length;const[s]=v?[a4(n,r)]:s4(e,"enterDuration",a4(n,r));var[l]=s4(e,"enterDelay",a4(n,0)),c=new Array(n.length);for(let t=0,e=0;t<i.length;t++){const n=i[t];var u=v0(n,t=>+s[t]);for(const d of n)c[d]=+l[d]+e;e+=u}return[n,ot({},t,{encode:{enterDuration:i4(s),enterDelay:i4(c)}})]}});F4.props={};const z4=(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,o4(n,t)[0]]),[,o]=a.find(([t])=>"y"===t),s=a.map(([t])=>[t,new Array(e.length)]),i=u4(p,e,t),l="function"==typeof(f=g)?f:{min:(t,e)=>x0(t,t=>e[+t]),max:(t,e)=>v0(t,t=>e[+t]),first:(t,e)=>e[t[0]],last:(t,e)=>e[t[t.length-1]],mean:(t,e)=>S0(t,t=>e[+t]),median:(t,e)=>A0(t,t=>e[+t]),sum:(t,e)=>P0(t,t=>e[+t]),deviation:(t,e)=>Xp(t,t=>e[+t])}[f]||v0;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=Lg(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,n4(e,o4(n,t)[1])]))},!f&&n.y0&&{tooltip:{items:[{channel:"y0"}]}}))]}};function W4(t,e,n){return null===t?[-.5,.5]:(t=d4(t,e),[-(e=new Hv({domain:t,range:[0,1],padding:n}).getBandWidth())/2,e/2])}function G4(t,e,n){return e*(1-t)+n*t}z4.props={};const H4=(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]=o4(n,"x"),[n]=o4(n,"y");const o=W4(a,r,l),s=W4(n,i,c);a=t.map(()=>G4(u(),...s)),r=t.map(()=>G4(u(),...o));return[t,ot({scale:{x:{padding:.5},y:{padding:.5}}},e,{encode:{dy:n4(a),dx:n4(r)}})]}},V4=(H4.props={},(t={})=>{const{padding:a=0,random:o=Math.random}=t;return(t,e)=>{var{encode:n,scale:r}=e,r=r["x"],[n]=o4(n,"x");const i=W4(n,r,a);n=t.map(()=>G4(o(),...i));return[t,ot({scale:{x:{padding:.5}}},e,{encode:{dx:n4(n)}})]}}),Y4=(V4.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,o4(n,t)[0]]);var a=i.map(([t])=>[t,new Array(e.length)]),o=u4(g,e,t),s=new Array(o.length);for(let t=0;t<o.length;t++){const e=o[t];var[l,c]=Kp(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,n4(e,o4(n,t)[1])]))})]}}),q4=(Y4.props={},(t={})=>{const{groupBy:u="x",series:h=!0}=t;return(t,e)=>{var n=e["encode"];const[r]=o4(n,"y");var[,i]=o4(n,"y1"),n=(h?s4(n,"series","color"):o4(n,"color"),u4(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:n4(a,i)}})]}});function $4(t,e){return[t[0]]}function U4(t,e){return[t[t.length-1]]}function X4(t,e){return[t[b0(t,t=>e[t])]]}function K4(t,e){return[t[w0(t,t=>e[t])]]}q4.props={};const Z4=(t={})=>{const{groupBy:a="series",channel:o,selector:s}=t;return(t,e)=>{var n=e["encode"],t=u4(a,t,e);const[r]=o4(n,o),i="function"==typeof(n=s)?n:{first:$4,last:U4,max:X4,min:K4}[n]||$4;return[t.flatMap(t=>i(t,r)),e]}},Q4=(Z4.props={},(t={})=>{var e=t["selector"],t=at(t,["selector"]);return Z4(Object.assign({channel:"x",selector:e},t))}),J4=(Q4.props={},(t={})=>{var e=t["selector"],t=at(t,["selector"]);return Z4(Object.assign({channel:"y",selector:e},t))});function t_(e){return t=>null===t?e:e+" of "+t}function e_(){return[(t,e)=>S0(t,t=>+e[t]),t_("mean")]}function n_(){return[(t,e)=>A0(t,t=>+e[t]),t_("median")]}function r_(){return[(t,e)=>v0(t,t=>+e[t]),t_("max")]}function i_(){return[(t,e)=>x0(t,t=>+e[t]),t_("min")]}function a_(){return[(t,e)=>t.length,t_("count")]}function o_(){return[(t,e)=>P0(t,t=>+e[t]),t_("sum")]}function s_(){return[(t,e)=>e[t[0]],t_("first")]}function l_(){return[(t,e)=>e[t[t.length-1]],t_("last")]}J4.props={};const c_=(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:e_,max:r_,count:a_,first:s_,last:l_,sum:o_,min:i_,median:n_}[t];if(e)return e();throw new Error(`Unknown reducer: ${t}.`)}(e),[i,a]=o4(l,t);e=e;var e=(o=a)||((e=e["from"])?([,e]=o4(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=n4(t,o),Object.assign(Object.assign({},t),{constant:!1}))),{aggregate:!0})]}),n=Object.keys(l).map(t=>{const[e,n]=o4(l,t);return[t,n4(c.map(t=>e[t[0]]),n)]}),r=c.map(t=>s[t[0]]);return[_b(c),ot({},e,{data:r,encode:Object.fromEntries([...n,...t])})]}},u_=(c_.props={},(t={})=>{const{channels:n=["x","y"]}=t,e=at(t,["channels"]);return c_(Object.assign(Object.assign({},e),{groupBy:(t,e)=>u4(n,t,e)}))}),h_=(u_.props={},(t={})=>u_(Object.assign(Object.assign({},t),{channels:["x","color","series"]}))),f_=(h_.props={},(t={})=>u_(Object.assign(Object.assign({},t),{channels:["y","color","series"]}))),d_=(f_.props={},(t={})=>u_(Object.assign(Object.assign({},t),{channels:["color"]})));function p_(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]=o4(o,a);var c,n=function(t,e,n){const{by:r=t,reducer:i="max"}=e,[a]=o4(n,r);if("function"==typeof i)return t=>i(t,a);if("max"===i)return t=>v0(t,t=>+a[t]);if("min"===i)return t=>x0(t,t=>+a[t]);if("sum"===i)return t=>P0(t,t=>+a[t]);if("median"===i)return t=>A0(t,t=>+a[t]);if("mean"===i)return t=>S0(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?o0(r0(s,c,o),([t,e],[n,r])=>Wp(e,r)||Wp(t,n)):o0(e0(s,o),([t,e],[n,r])=>c(e,r)||Wp(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}}})]}d_.props={};const g_=(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 p_(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]=o4(i,r);return i=o0(t,t=>a[t]),n&&i.reverse(),[i,e]}}},y_=(g_.props={},(t={})=>g_(Object.assign(Object.assign({},t),{channel:"x"}))),m_=(y_.props={},(t={})=>g_(Object.assign(Object.assign({},t),{channel:"color"}))),v_=(m_.props={},(t={})=>g_(Object.assign(Object.assign({},t),{channel:"y"})));v_.props={};const b_=(t={})=>{const{field:o,channel:s="y",reducer:l="sum"}=t;return(t,e)=>{var{data:n,encode:r}=e;const[i]=o4(r,"x");var a,n=o?(n=n,"string"==typeof(a=o)?n.map(t=>t[a]):n.map(a)):o4(r,s)[0],r=i0(t,function(e,n){if("function"==typeof e)return t=>e(t,n);if("sum"===e)return t=>P0(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 x_(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]=Db(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})`})}b_.props={};const w_=()=>(t,e)=>[t,ot({},e,{modifier:x_,axis:!1})],M_=(w_.props={},"thresholds");function k_(t){var e,[n,r]=Kp(t);return Math.min(200,(n=n,r=r,e=Up(t=t),t=Xp(t),e&&t?Math.ceil((r-n)*Math.cbrt(e)/(3.49*t)):1))}const O_=(t={})=>{const{groupChannels:s=["color"],binChannels:l=["x","y"]}=t,c=at(t,["groupChannels","binChannels"]),u={};return c_(Object.assign(Object.assign(Object.assign({},Object.fromEntries(Object.entries(c).filter(([t])=>!t.startsWith(M_)))),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]=o4(n,t);return t}),a=st(c,M_),o=t.filter(e=>i.every(t=>Ag(t[e]))),r=[...s.map(t=>{var[t]=o4(n,t);return t}).filter(Ag).map(e=>t=>e[t]),...l.map((t,e)=>{const n=i[e];e=a[t]||k_(n),e=m0().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(e0(o,e=>r.map(t=>t(e)).join("-")).values())}}))},E_=(O_.props={},(t={})=>{var e=t["thresholds"];return O_(Object.assign(Object.assign({},t),{thresholdsX:e,groupChannels:["color"],binChannels:["x"]}))});function S_(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 A_(t){if("function"==typeof t)return t;if("lttb"===t)return S_;var e={first:t=>[t[0]],last:t=>[t[t.length-1]],min:(t,e,n)=>[t[w0(t,t=>n[t])]],max:(t,e,n)=>[t[b0(t,t=>n[t])]],median:(t,e,n)=>{return[t[E0(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))}}E_.props={};const __=(t={})=>{const{strategy:e="median",thresholds:a=2e3,groupBy:o=["series","color"]}=t,s=A_(e);return(t,e)=>{var n=e["encode"],t=u4(o,t,e);const[r]=o4(n,"x"),[i]=o4(n,"y");return[t.flatMap(t=>s(t,r,i,a)),e]}},T_=(__.props={},(s={})=>(t,e)=>{const{encode:i,data:n}=e,r=Object.entries(s).map(([t,e])=>{const[n]=o4(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(Ag);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 P_(t){var{min:t,max:e}=t;return[[t[0],t[1]],[e[0],e[1]]]}function C_(t,e){var[t,n]=t,[e,r]=e;return t>=e[0]&&t<=r[0]&&n>=e[1]&&n<=r[1]}T_.props={};const L_=t=>{const n=t["priority"];return t=>{const e=[];return n&&t.sort(n),t.forEach(t=>{VS(t);const i=t.getLocalBounds();e.some(t=>{var e=P_(i),t=P_(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]})?HS(t):e.push(t)}),t}};function N_(){const n=new Map;return[t=>n.get(t),(t,e)=>n.set(t,e)]}const j_=t=>{const{maxIterations:M=10,maxError:k=.1,padding:O=1}=t;return i=>{var e=i.length;if(!(e<=1)){const[g,y]=N_(),[m,v]=N_();var a,o,s,l,[c,t]=N_(),[u,n]=N_();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)=>Wp(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<O&&(d=(O-d)/2,r=Math.max(r,d),v(f,g-d),v(e,p+d))}}if(r<k)break}for(const w of i)w.style.y+=m(w)-g(w)}return i}};function R_(t){t/=255;return t<=.03928?t/12.92:Math.pow((.055+t)/1.055,2.4)}function I_(t,e,n){return.2126*R_(t)+.7152*R_(e)+.0722*R_(n)}function B_(t,e){var{r:t,g:n,b:r}=t,{r:e,g:i,b:a}=e,t=I_(t,n,r),n=I_(e,i,a);return(Math.max(t,n)+.05)/(Math.min(t,n)+.05)}function D_(e,t){return t[b0(t,t=>{return B_(e,"object"==typeof(t=t)?t:ma(t))})]}const F_=t=>{const{threshold:n=4.5,palette:r=["#000","#fff"]}=t;return t=>(t.forEach(t=>{var e=t.attr("dependentElement").parsedStyle.fill;B_(t.parsedStyle.fill,e)<n&&t.attr("fill",D_(e,r))}),t)},z_=()=>t=>(t.forEach(t=>{VS(t);var e=t.attr("bounds");!function(t,e){var[t,n]=t;return!(C_(t,e)&&C_(n,e))}(P_(t.getLocalBounds()),e)||HS(t)}),t);var P=1e-6,W_=1e-12,G_=Math.PI,H_=G_/2,V_=G_/4,Y_=2*G_,q_=180/G_,$_=G_/180,U_=Math.abs,X_=Math.atan,K_=Math.atan2,T=Math.cos,Z_=Math.ceil,Q_=Math.exp,J_=Math.log,tT=Math.pow,C=Math.sin,eT=Math.sign||function(t){return 0<t?1:t<0?-1:0},nT=Math.sqrt,rT=Math.tan;function iT(t){return 1<t?0:t<-1?G_:Math.acos(t)}function aT(t){return 1<t?H_:t<-1?-H_:Math.asin(t)}function oT(){}function sT(t,e){t&&cT.hasOwnProperty(t.type)&&cT[t.type](t,e)}var lT={Feature:function(t,e){sT(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)sT(n[r].geometry,e)}},cT={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){uT(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)uT(n[r],e,0)},Polygon:function(t,e){hT(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)hT(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)sT(n[r],e)}};function uT(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 hT(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)uT(t[n],e,1);e.polygonEnd()}function fT(t,e){t&&lT.hasOwnProperty(t.type)?lT[t.type](t,e):sT(t,e)}function dT(t){return[K_(t[1],t[0]),aT(t[2])]}function pT(t){var e=t[0],t=t[1],n=T(t);return[n*T(e),n*C(e),C(t)]}function gT(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function yT(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 mT(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function vT(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function bT(t){var e=nT(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function xT(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 wT(t,e){return U_(t)>G_&&(t-=Math.round(t/Y_)*Y_),[t,e]}function MT(t,e,n){return(t%=Y_)?e||n?xT(OT(t),ET(e,n)):OT(t):e||n?ET(e,n):wT}function kT(n){return function(t,e){return U_(t+=n)>G_&&(t-=Math.round(t/Y_)*Y_),[t,e]}}function OT(t){var e=kT(t);return e.invert=kT(-t),e}function ET(t,e){var i=T(t),a=C(t),o=T(e),s=C(e);function n(t,e){var n=T(e),r=T(t)*n,t=C(t)*n,n=C(e),e=n*i+r*a;return[K_(t*o-e*s,r*i-n*a),aT(e*o+t*s)]}return n.invert=function(t,e){var n=T(e),r=T(t)*n,t=C(t)*n,n=C(e),e=n*o-t*s;return[K_(t*o+n*s,r*i+e*a),aT(e*i-r*a)]},n}function ST(t,e){(e=pT(e))[0]-=t,bT(e);t=iT(-e[1]);return((-e[2]<0?-t:t)+Y_-P)%Y_}function AT(){var r,e=[];return{point:function(t,e,n){r.push([t,e,n])},lineStart:function(){e.push(r=[])},lineEnd:oT,rejoin:function(){1<e.length&&e.push(e.pop().concat(e.shift()))},result:function(){var t=e;return e=[],r=null,t}}}function _T(t,e){return U_(t[0]-e[0])<P&&U_(t[1]-e[1])<P}function TT(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 PT(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(_T(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 TT(r,t,null,!0)),l.push(n.o=new TT(r,null,n,!1)),s.push(n=new TT(i,t,null,!1)),l.push(n.o=new TT(i,null,n,!0))}}),s.length){for(l.sort(e),CT(s),CT(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 CT(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 LT(t){return U_(t[0])<=G_?t[0]:eT(t[0])*((U_(t[0])+G_)%Y_-G_)}function NT(y,m,v,b){return function(s){var l,c,u,n=m(s),h=AT(),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=_0(c);var t=function(t,e){var n=LT(e),r=e[1],e=C(r),i=[C(n),-T(n),0],a=0,o=0,s=new Zp;1===e?r=H_+P:-1===e&&(r=-H_-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=LT(f),p=f[1]/2+V_,g=C(p),y=T(p),m=0;m<h;++m,d=b,g=w,y=x,f=v){var v=u[m],b=LT(v),x=v[1]/2+V_,w=C(x),x=T(x),M=b-d,k=0<=M?1:-1,O=k*M,E=G_<O,S=g*w;s.add(K_(S*k*C(O),y*x+S*T(O))),a+=E?M+k*Y_:M,E^n<=d^n<=b&&(bT(S=yT(pT(f),pT(v))),bT(O=yT(i,S)),(k=(E^0<=M?-1:1)*aT(O[2]))<r||r===k&&(S[0]||S[1]))&&(o+=E^0<=M?1:-1)}return(a<-P||a<P&&s<-W_)^1&o}(l,b);c.length?(d||(s.polygonStart(),d=!0),PT(c,RT,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(jT))}return e}}function jT(t){return 1<t.length}function RT(t,e){return((t=t.x)[0]<0?t[1]-H_-P:H_-t[1])-((e=e.x)[0]<0?e[1]-H_-P:H_-e[1])}wT.invert=wT;var IT=NT(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?G_:-G_,l=U_(t-h);U_(l-G_)<P?(c.point(h,f=0<(f+e)/2?H_:-H_),c.point(d,f),c.lineEnd(),c.lineStart(),c.point(s,f),c.point(t,f),u=0):d!==s&&G_<=l&&(U_(h-d)<P&&(h-=d*P),U_(t-s)<P&&(t-=s*P),l=f,i=e,o=C((n=h)-(r=t)),f=U_(o)>P?X_((C(l)*(a=T(i))*C(r)-C(i)*(r=T(l))*C(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*H_,r.point(-G_,i),r.point(0,i),r.point(G_,i),r.point(G_,0),r.point(G_,-i),r.point(0,-i),r.point(-G_,-i),r.point(-G_,0),r.point(-G_,i)):U_(t[0]-e[0])>P?(t=t[0]<e[0]?G_:-G_,i=n*t/2,r.point(-t,i),r.point(0,i),r.point(t,i)):r.point(e[0],e[1])},[-G_,-H_]);function BT(d){var g=T(d),p=6*$_,h=0<g,f=U_(g)>P;function y(t,e){return T(t)*T(e)>g}function m(t,e,n){var r,i,a,o,s,l,c,u=[1,0,0],h=yT(pT(t),pT(e)),f=gT(h,h),d=h[0],p=f-d*d;return p?(r=yT(u,h),mT(u=vT(u,g*f/p),vT(h,-g*d/p)),(p=(h=gT(u,f=r))*h-(d=gT(f,f))*(gT(u,u)-1))<0?void 0:(mT(p=vT(f,(-h-(r=nT(p)))/d),u),p=dT(p),n?(i=t[0],a=e[0],o=t[1],e=e[1],a<i&&(c=i,i=a,a=c),!(l=U_((s=a-i)-G_)<P)&&e<o&&(c=o,o=e,e=c),(l||s<P?l?0<o+e^p[1]<(U_(p[0]-i)<P?o:e):o<=p[1]&&p[1]<=e:G_<s^(i<=p[0]&&p[0]<=a))?(mT(c=vT(f,(-h+r)/d),u),[p,dT(c)]):void 0):p)):!n&&t}function v(t,e){var n=h?d:G_-d,r=0;return t<-n?r|=1:n<t&&(r|=2),e<-n?r|=4:n<e&&(r|=8),r}return NT(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?G_:-G_),e):0;!o&&(c=l=i)&&a.lineStart(),i===l||(n=m(o,r))&&!_T(o,n)&&!_T(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&&_T(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=T(r),c=C(r),u=o*a;null==n?(n=r+o*Y_,s=r-u/2):(n=ST(l,n),s=ST(l,s),(0<o?n<s:s<n)&&(n+=o*Y_));for(var h,f=n;0<o?s<f:f<s;f-=u)h=dT([l,-c*T(f),-c*C(f)]),i.point(h[0],h[1])}},h?[0,-d]:[-G_,d-G_])}var DT=1e9,FT=-DT;function zT(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 U_(t[0]-m)<P?0<e?0:3:U_(t[0]-b)<P?0<e?2:1:U_(t[1]-v)<P?0<e?1:0:0<e?3:2}function k(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=AT(),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=_0(i)).length;(e||n)&&(r.polygonStart(),e&&(r.lineStart(),M(null,null,1,r),r.lineEnd()),n&&PT(i,k,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(FT,Math.min(DT,c)),u=Math.max(FT,Math.min(DT,u))],r=[t=Math.max(FT,Math.min(DT,t)),e=Math.max(FT,Math.min(DT,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 WT(t,e,n){var r=T0(t,e-P,n).concat(e);return function(e){return r.map(function(t){return[e,t]})}}function GT(t,e,n){var r=T0(t,e-P,n).concat(e);return function(e){return r.map(function(t){return[t,e]})}}function HT(){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=WT(s,o,90),h=GT(r,n,v),f=WT(c,l,90),d=GT(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 T0(Z_(a/y)*y,i,y).map(f).concat(T0(Z_(c/m)*m,l,m).map(d)).concat(T0(Z_(r/p)*p,n,p).filter(function(t){return U_(t%y)>P}).map(u)).concat(T0(Z_(s/g)*g,o,g).filter(function(t){return U_(t%m)>P}).map(h))}var n,r,i,a,o,s,l,c,u,h,f,d,p,g,y,m,v}var VT,YT,qT,$T,UT=t=>t,XT=new Zp,KT=new Zp,ZT={point:oT,lineStart:oT,lineEnd:oT,polygonStart:function(){ZT.lineStart=QT,ZT.lineEnd=e6},polygonEnd:function(){ZT.lineStart=ZT.lineEnd=ZT.point=oT,XT.add(U_(KT)),KT=new Zp},result:function(){var t=XT/2;return XT=new Zp,t}};function QT(){ZT.point=JT}function JT(t,e){ZT.point=t6,VT=qT=t,YT=$T=e}function t6(t,e){KT.add($T*t-qT*e),qT=t,$T=e}function e6(){t6(VT,YT)}var n6=ZT,r6=1/0,i6=r6,a6=-r6,o6=a6;var s6,l6,c6,u6,h6={point:function(t,e){t<r6&&(r6=t);a6<t&&(a6=t);e<i6&&(i6=e);o6<e&&(o6=e)},lineStart:oT,lineEnd:oT,polygonStart:oT,polygonEnd:oT,result:function(){var t=[[r6,i6],[a6,o6]];return a6=o6=-(i6=r6=1/0),t}},f6=0,d6=0,p6=0,g6=0,y6=0,m6=0,v6=0,b6=0,x6=0,w6={point:M6,lineStart:k6,lineEnd:S6,polygonStart:function(){w6.lineStart=A6,w6.lineEnd=_6},polygonEnd:function(){w6.point=M6,w6.lineStart=k6,w6.lineEnd=S6},result:function(){var t=x6?[v6/x6,b6/x6]:m6?[g6/m6,y6/m6]:p6?[f6/p6,d6/p6]:[NaN,NaN];return f6=d6=p6=g6=y6=m6=v6=b6=x6=0,t}};function M6(t,e){f6+=t,d6+=e,++p6}function k6(){w6.point=O6}function O6(t,e){w6.point=E6,M6(c6=t,u6=e)}function E6(t,e){var n=t-c6,r=e-u6,n=nT(n*n+r*r);g6+=n*(c6+t)/2,y6+=n*(u6+e)/2,m6+=n,M6(c6=t,u6=e)}function S6(){w6.point=M6}function A6(){w6.point=T6}function _6(){P6(s6,l6)}function T6(t,e){w6.point=P6,M6(s6=c6=t,l6=u6=e)}function P6(t,e){var n=t-c6,r=e-u6,n=nT(n*n+r*r);g6+=n*(c6+t)/2,y6+=n*(u6+e)/2,m6+=n,v6+=(n=u6*t-c6*e)*(c6+t),b6+=n*(u6+e),x6+=3*n,M6(c6=t,u6=e)}var C6=w6;function L6(t){this._context=t}L6.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,Y_)}},result:oT};var N6,j6,R6,I6,B6,D6=new Zp,F6={point:oT,lineStart:function(){F6.point=z6},lineEnd:function(){N6&&W6(j6,R6),F6.point=oT},polygonStart:function(){N6=!0},polygonEnd:function(){N6=null},result:function(){var t=+D6;return D6=new Zp,t}};function z6(t,e){F6.point=W6,j6=I6=t,R6=B6=e}function W6(t,e){I6-=t,B6-=e,D6.add(nT(I6*I6+B6*B6)),I6=t,B6=e}var G6=F6;let H6,V6,Y6,q6;class $6{constructor(t){this._append=null==t?U6:function(t){var e=Math.floor(t);if(!(0<=e))throw new RangeError("invalid digits: "+t);if(15<e)return U6;if(e!==H6){const r=10**e;H6=e,V6=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 V6}(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===Y6&&this._append===V6||(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`,Y6=n,V6=this._append,q6=this._,this._=r),this._+=q6}}result(){var t=this._;return this._="",t.length?t:null}}function U6(t){let e=1;this._+=t[0];for(var n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function X6(e,n){let r=3,i=4.5,a,o;function s(t){return t&&("function"==typeof i&&o.pointRadius(+i.apply(this,arguments)),fT(t,a(o))),o.result()}return s.area=function(t){return fT(t,a(n6)),n6.result()},s.measure=function(t){return fT(t,a(G6)),G6.result()},s.bounds=function(t){return fT(t,a(h6)),h6.result()},s.centroid=function(t){return fT(t,a(C6)),C6.result()},s.projection=function(t){return arguments.length?(a=null==t?(e=null,UT):(e=t).stream,s):e},s.context=function(t){return arguments.length?(o=null==t?(n=null,new $6(r)):new L6(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 $6(r)),s},s.projection(e).digits(r).context(n)}function K6(r){return function(t){var e,n=new Z6;for(e in r)n[e]=r[e];return n.stream=t,n}}function Z6(){}function Q6(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),fT(n,t.stream(h6)),e(h6.result()),null!=r&&t.clipExtent(r),t}function J6(i,a,t){return Q6(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 tP(t,e,n){return J6(t,[[0,0],e],n)}function eP(r,i,t){return Q6(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 nP(i,a,t){return Q6(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)}Z6.prototype={constructor:Z6,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 rP=16,iP=T(30*$_);function aP(t,e){return+e?(A=t,_=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=A(t,e),r.point(t[0],t[1])}function e(){u=NaN,g.point=y,r.lineStart()}function y(t,e){var n=pT([t,e]),e=A(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],rP,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,rP,r),g.lineEnd=m,m()}return g}):(n=t,K6({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,k,O=o-t,E=s-e,S=O*O+E*E;4*_<S&&f--&&(y=a+h,x=aT(y/=m=nT((p=r+c)*p+(g=i+u)*g+y*y)),v=U_(U_(y)-1)<P||U_(n-l)<P?(n+l)/2:K_(g,p),b=(x=A(v,x))[0],x=x[1],_<(k=E*(w=b-t)-O*(M=x-e))*k/S||.3<U_((O*w+E*M)/S-.5)||r*c+i*u+a*h<iP)&&(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 oP=K6({point:function(t,e){this.stream.point(t*$_,e*$_)}});function sP(t,n,r,i,a,e){var o,s,l,c,u,h,f,d,p,g,y,m;return e?(h=T(e),e=C(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 lP(t){return cP(function(){return t})()}function cP(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,k=IT,O=null,E=UT,S=.5;function A(t){return l(t[0]*$_,t[1]*$_)}function _(t){return(t=l.invert(t[0],t[1]))&&[t[0]*q_,t[1]*q_]}function T(){var t=sP(h,0,0,x,w,b).apply(null,e(p,g)),t=sP(h,f-t[0],d-t[1],x,w,b);return r=MT(y,m,v),s=xT(e,t),l=xT(r,s),o=aP(s,S),P()}function P(){return c=u=null,A}return A.stream=function(t){return c&&u===t?c:c=oP((n=r,K6({point:function(t,e){t=n(t,e);return this.stream.point(t[0],t[1])}})(k(o(E(u=t))))));var n},A.preclip=function(t){return arguments.length?(k=t,M=void 0,P()):k},A.postclip=function(t){return arguments.length?(E=t,O=n=i=a=null,P()):E},A.clipAngle=function(t){return arguments.length?(k=+t?BT(M=t*$_):(M=null,IT),P()):M*q_},A.clipExtent=function(t){return arguments.length?(E=null==t?(O=n=i=a=null,UT):zT(O=+t[0][0],n=+t[0][1],i=+t[1][0],a=+t[1][1]),P()):null==O?null:[[O,n],[i,a]]},A.scale=function(t){return arguments.length?(h=+t,T()):h},A.translate=function(t){return arguments.length?(f=+t[0],d=+t[1],T()):[f,d]},A.center=function(t){return arguments.length?(p=t[0]%360*$_,g=t[1]%360*$_,T()):[p*q_,g*q_]},A.rotate=function(t){return arguments.length?(y=t[0]%360*$_,m=t[1]%360*$_,v=2<t.length?t[2]%360*$_:0,T()):[y*q_,m*q_,v*q_]},A.angle=function(t){return arguments.length?(b=t%360*$_,T()):b*q_},A.reflectX=function(t){return arguments.length?(x=t?-1:1,T()):x<0},A.reflectY=function(t){return arguments.length?(w=t?-1:1,T()):w<0},A.precision=function(t){return arguments.length?(o=aP(s,S=t*t),P()):nT(S)},A.fitExtent=function(t,e){return J6(A,t,e)},A.fitSize=function(t,e){return tP(A,t,e)},A.fitWidth=function(t,e){return eP(A,t,e)},A.fitHeight=function(t,e){return nP(A,t,e)},function(){return e=t.apply(this,arguments),A.invert=e.invert&&_,T()}}function uP(t){var e=0,n=G_/3,r=cP(t),t=r(e,n);return t.parallels=function(t){return arguments.length?r(e=t[0]*$_,n=t[1]*$_):[e*q_,n*q_]},t}function hP(t,e){var n,r,i,a=C(t),o=(a+C(e))/2;return U_(o)<P?(n=T(t),s.invert=function(t,e){return[t/n,aT(e*n)]},s):(i=nT(r=1+a*(2*o-a))/o,l.invert=function(t,e){var e=i-e,n=K_(t,U_(e))*eT(e);return e*o<0&&(n-=G_*eT(t)*eT(e)),[n/o,aT((r-(t*t+e*e)*o*o)/(2*o))]},l);function s(t,e){return[t*n,C(e)/n]}function l(t,e){e=nT(r-2*o*C(e))/o;return[e*C(t*=o),i-e*T(t)]}}function fP(){return uP(hP).scale(155.424).center([0,33.6442])}function dP(){return fP().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function pP(i){return function(t,e){var n=T(t),r=T(e),n=i(n*r);return n===1/0?[2,0]:[n*r*C(t),n*C(e)]}}function gP(a){return function(t,e){var n=nT(t*t+e*e),r=a(n),i=C(r),r=T(r);return[K_(t*i,n*r),aT(n&&e*i/n)]}}var yP=pP(function(t){return nT(2/(1+t))});yP.invert=gP(function(t){return 2*aT(t/2)});var mP=pP(function(t){return(t=iT(t))&&t/C(t)});function vP(t,e){return[t,J_(rT((H_+e)/2))]}function bP(r){var i,a,o,s=lP(r),e=s.center,l=s.scale,n=s.translate,c=s.clipExtent,u=null;function h(){var e,t=G_*l(),n=s((e=MT((e=s.rotate())[0]*$_,e[1]*$_,2<e.length?e[2]*$_:0),function(t){return(t=e.invert(t[0]*$_,t[1]*$_))[0]*=q_,t[1]*=q_,t}([0,0])));return c(null==u?[[n[0]-t,n[1]-t],[n[0]+t,n[1]+t]]:r===vP?[[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 xP(t){return rT((H_+t)/2)}function wP(t,e){var n=T(t),i=t===e?C(t):J_(n/T(e))/J_(xP(e)/xP(t)),a=n*tT(xP(t),i)/i;return i?(r.invert=function(t,e){var e=a-e,n=eT(i)*nT(t*t+e*e),r=K_(t,U_(e))*eT(e);return e*i<0&&(r-=G_*eT(t)*eT(e)),[r/i,2*X_(tT(a/n,1/i))-H_]},r):vP;function r(t,e){0<a?e<-H_+P&&(e=-H_+P):H_-P<e&&(e=H_-P);e=a/tT(xP(e),i);return[e*C(i*t),a-e*T(i*t)]}}function MP(t,e){return[t,e]}function kP(t,e){var n=T(t),r=t===e?C(t):(n-T(e))/(e-t),i=n/r+t;return U_(r)<P?MP:(a.invert=function(t,e){var e=i-e,n=K_(t,U_(e))*eT(e);return e*r<0&&(n-=G_*eT(t)*eT(e)),[n/r,i-eT(r)*nT(t*t+e*e)]},a);function a(t,e){e=i-e,t*=r;return[e*C(t),i-e*T(t)]}}mP.invert=gP(function(t){return t}),vP.invert=function(t,e){return[t,2*X_(Q_(e))-H_]},MP.invert=MP;var OP=1.340264,EP=-.081106,SP=893e-6,AP=.003796,_P=nT(3)/2;function TP(t,e){var e=aT(_P*C(e)),n=e*e,r=n*n*n;return[t*T(e)/(_P*(OP+3*EP*n+r*(7*SP+9*AP*n))),e*(OP+EP*n+r*(SP+AP*n))]}function PP(t,e){var n=T(e),r=T(t)*n;return[n*C(t)/r,C(e)/r]}function CP(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 LP(t,e){return[T(e)*C(t),C(e)]}function NP(t,e){var n=T(e),r=1+T(t)*n;return[n*C(t)/r,C(e)/r]}function jP(t,e){return[J_(rT((H_+e)/2)),-t]}TP.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*(OP+EP*i+a*(SP+AP*i))-e)/(OP+3*EP*i+a*(7*SP+9*AP*i)))*r)*i*i,!(U_(n)<W_));++o);return[_P*t*(OP+3*EP*i+a*(7*SP+9*AP*i))/T(r),aT(C(r)/_P)]},PP.invert=gP(X_),CP.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))),U_(a)>P&&0<--r);return[t/(.8707+(i=n*n)*(i*(i*i*i*(.003971-.001529*i)-.013791)-.131979)),n]},LP.invert=gP(aT),NP.invert=gP(function(t){return 2*X_(t)}),jP.invert=function(t,e){return[-e,2*X_(Q_(t))-H_]};var RP=Object.freeze({__proto__:null,geoAlbersUsa:function(){var e,n,i,a,o,r,s=dP(),l=fP().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=fP().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 J6(h,t,e)},h.fitSize=function(t,e){return tP(h,t,e)},h.fitWidth=function(t,e){return eP(h,t,e)},h.fitHeight=function(t,e){return nP(h,t,e)},h.scale(1070)},geoAlbers:dP,geoAzimuthalEqualArea:function(){return lP(yP).scale(124.75).clipAngle(179.999)},geoAzimuthalEqualAreaRaw:yP,geoAzimuthalEquidistant:function(){return lP(mP).scale(79.4188).clipAngle(179.999)},geoAzimuthalEquidistantRaw:mP,geoConicConformal:function(){return uP(wP).scale(109.5).parallels([30,30])},geoConicConformalRaw:wP,geoConicEqualArea:fP,geoConicEqualAreaRaw:hP,geoConicEquidistant:function(){return uP(kP).scale(131.154).center([0,13.9389])},geoConicEquidistantRaw:kP,geoEqualEarth:function(){return lP(TP).scale(177.158)},geoEqualEarthRaw:TP,geoEquirectangular:function(){return lP(MP).scale(152.63)},geoEquirectangularRaw:MP,geoGnomonic:function(){return lP(PP).scale(144.049).clipAngle(60)},geoGnomonicRaw:PP,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=K6({point:function(t,e){t=x([t,e]);this.stream.point(t[0],t[1])}}),v=UT;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,UT):zT(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=C(d=t%360*$_),r=T(d),b()):d*q_},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 J6(x,t,e)},x.fitSize=function(t,e){return tP(x,t,e)},x.fitWidth=function(t,e){return eP(x,t,e)},x.fitHeight=function(t,e){return nP(x,t,e)},x},geoProjection:lP,geoProjectionMutator:cP,geoMercator:function(){return bP(vP).scale(961/Y_)},geoMercatorRaw:vP,geoNaturalEarth1:function(){return lP(CP).scale(175.295)},geoNaturalEarth1Raw:CP,geoOrthographic:function(){return lP(LP).scale(249.5).clipAngle(90+P)},geoOrthographicRaw:LP,geoStereographic:function(){return lP(NP).scale(250).clipAngle(142)},geoStereographicRaw:NP,geoTransverseMercator:function(){var t=bP(jP),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:jP});function IP(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 BP(t,e,n,r){var i,a,o,s,l,c,{outline:e=(e=e.filter(FP),e.find(t=>t.sphere)?{type:"Sphere"}:IP(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]]=X6(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 DP(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:[HT()]}}):"sphere"===e?Object.assign(Object.assign({},t),{sphere:!0,data:{value:[{type:"Sphere"}]}}):t)}function FP(t){return"geoPath"===t.type}Fl=()=>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"+Xe(t);if(e=RP[e])return e;throw new Error("Unknown coordinate: "+t)}(r),p=e.map(DP);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=(BP(i,p,l,f),i),l=f;for([o,s]of Object.entries(l))null!=(a=c[o])&&a.call(c,s);g=X6(i);const u=new eb({domain:[t,t+n]}),h=new eb({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 FP(t)?({style:n,tooltip:r={}}=e=t,Object.assign(Object.assign({},e),{type:"path",tooltip:jg(r,{title:"id",items:[{channel:"color"}]}),style:Object.assign(Object.assign({},n),{d:t=>g(t)||[]})})):t})})]},Fl.props={},jl=()=>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}]})]};jl.props={};const zP={"composition.geoView":Fl,"composition.geoPath":jl};function WP(){return Object.assign({"data.fetch":vy,"data.inline":Ey,"data.sortBy":Oy,"data.sort":wy,"data.filter":xy,"data.pick":My,"data.rename":ky,"data.fold":by,"data.slice":tm,"data.custom":Sy,"data.map":Ay,"data.cluster":J1,"data.tree":ty,"data.sankey":wg,"data.arc":Cy,"data.wordCloud":Zy,"data.join":Jy,"data.kde":sm,"data.venn":Am,"transform.maybeZeroY1":c4,"transform.maybeZeroX":k4,"transform.maybeStackY":w4,"transform.maybeTitle":M4,"transform.maybeSeries":A4,"transform.maybeZeroPadding":N4,"transform.stackY":b4,"transform.binX":E_,"transform.bin":O_,"transform.dodgeX":D4,"transform.jitter":H4,"transform.jitterX":V4,"transform.symmetryY":Y4,"transform.diffY":q4,"transform.stackEnter":F4,"transform.normalizeY":z4,"transform.select":Z4,"transform.selectX":Q4,"transform.selectY":J4,"transform.groupX":h_,"transform.groupY":f_,"transform.groupColor":d_,"transform.group":u_,"transform.maybeSize":E4,"transform.maybeZeroY":O4,"transform.maybeKey":S4,"transform.sortX":y_,"transform.sortY":v_,"transform.sortColor":m_,"transform.flexX":b_,"transform.maybeTupleY":_4,"transform.maybeTupleX":T4,"transform.maybeIdentityY":P4,"transform.maybeIdentityX":C4,"transform.maybeTuple":I4,"transform.maybeVisualPosition":j4,"transform.maybeFunctionAttribute":R4,"transform.maybeGradient":B4,"transform.maybeTooltip":L4,"transform.pack":w_,"transform.sample":__,"transform.filter":T_,"coordinate.cartesian":hd,"coordinate.polar":dd,"coordinate.helix":pd,"coordinate.transpose":gd,"coordinate.theta":yd,"coordinate.parallel":bd,"coordinate.fisheye":xd,"coordinate.radial":vd,"coordinate.radar":wd,"encode.constant":Md,"encode.field":Od,"encode.transform":kd,"encode.column":Ed,"mark.interval":Fp,"mark.rect":zp,"mark.line":G0,"mark.point":H0,"mark.text":V0,"mark.cell":Y0,"mark.area":q0,"mark.link":$0,"mark.image":U0,"mark.polygon":X0,"mark.box":K0,"mark.vector":Z0,"mark.lineX":J0,"mark.lineY":Q0,"mark.connector":tg,"mark.range":rg,"mark.rangeX":ig,"mark.rangeY":ag,"mark.sankey":Wg,"mark.path":Gg,"mark.treemap":qg,"mark.pack":Xg,"mark.boxplot":i1,"mark.shape":a1,"mark.forceGraph":Z1,"mark.gauge":Zb,"mark.tree":ay,"mark.wordCloud":_m,"mark.density":Qb,"mark.heatmap":Jb,"palette.category10":t2,"palette.category20":e2,"scale.linear":r2,"scale.ordinal":i2,"scale.band":n2,"scale.identity":a2,"scale.point":o2,"scale.time":s2,"scale.log":l2,"scale.pow":c2,"scale.sqrt":d2,"scale.threshold":u2,"scale.quantile":h2,"scale.quantize":f2,"scale.sequential":p2,"scale.constant":g2,"shape.interval.rect":bx,"shape.interval.hollow":xx,"shape.interval.funnel":wx,"shape.interval.pyramid":kx,"shape.rect.rect":bx,"shape.rect.hollow":xx,"shape.cell.cell":bx,"shape.cell.hollow":xx,"shape.line.line":Ax,"shape.line.hv":Tx,"shape.line.vh":Px,"shape.line.hvh":Cx,"shape.line.trail":Lx,"shape.line.smooth":_x,"shape.point.bowtie":Rx,"shape.point.cross":Ix,"shape.point.diamond":Bx,"shape.point.hexagon":Dx,"shape.point.hollowBowtie":Fx,"shape.point.hollowDiamond":zx,"shape.point.hollowHexagon":Wx,"shape.point.hollow":Gx,"shape.point.hollowSquare":Hx,"shape.point.hollowTriangle":Vx,"shape.point.hollowTriangleDown":Yx,"shape.point.hyphen":qx,"shape.point.line":$x,"shape.point.plus":Ux,"shape.point.point":Xx,"shape.point.square":Kx,"shape.point.tick":Zx,"shape.point.triangle":Qx,"shape.point.triangleDown":Jx,"shape.text.text":pE,"shape.area.area":bE,"shape.area.smooth":xE,"shape.area.hvh":wE,"shape.area.vh":ME,"shape.area.hv":kE,"shape.link.smooth":EE,"shape.link.vhv":SE,"shape.link.arc":AE,"shape.link.link":OE,"shape.image.image":_E,"shape.polygon.polygon":TE,"shape.polygon.ribbon":PE,"shape.box.box":CE,"shape.box.violin":LE,"shape.vector.vector":tw,"shape.label.label":ZE,"shape.text.badge":yE,"shape.lineX.line":NE,"shape.lineY.line":NE,"shape.shape.shape":s5,"shape.connector.connector":IE,"shape.range.range":bx,"shape.rangeX.range":bx,"shape.rangeY.range":bx,"shape.path.path":JE,"shape.path.hollow":t5,"shape.density.density":e5,"shape.heatmap.heatmap":o5,"theme.classic":u5,"theme.classicDark":d5,"theme.academy":y5,"component.axisX":Y5,"component.axisY":q5,"component.axisRadar":$5,"component.axisLinear":H5,"component.axisArc":V5,"component.legendCategory":K5,"component.legendContinuous":eS,"component.legendContinuousBlock":nS,"component.legendContinuousBlockSize":iS,"component.legendContinuousSize":rS,"component.legends":bS,"component.title":sS,"component.sliderX":pS,"component.sliderY":gS,"component.scrollbarX":mS,"component.scrollbarY":vS,"animation.scaleInX":xS,"animation.scaleOutX":wS,"animation.scaleInY":MS,"animation.scaleOutY":kS,"animation.waveIn":RS,"animation.fadeIn":OS,"animation.fadeOut":ES,"animation.zoomIn":IS,"animation.zoomOut":BS,"animation.pathIn":DS,"animation.morphing":jS,"animation.growInX":FS,"animation.growInY":zS,"interaction.elementHighlight":c3,"interaction.elementHighlightByX":u3,"interaction.elementHighlightByColor":h3,"interaction.elementSelect":d3,"interaction.elementSelectByX":p3,"interaction.elementSelectByColor":g3,"interaction.fisheye":m3,"interaction.chartIndex":y3,"interaction.tooltip":B3,"interaction.legendFilter":U3,"interaction.legendHighlight":X3,"interaction.brushHighlight":eA,"interaction.brushXHighlight":rA,"interaction.brushYHighlight":aA,"interaction.brushAxisHighlight":pA,"interaction.brushFilter":yA,"interaction.brushXFilter":mA,"interaction.brushYFilter":vA,"interaction.sliderFilter":wA,"interaction.scrollbarFilter":kA,"interaction.poptip":SA,"interaction.event":w3,"composition.spaceLayer":PA,"composition.spaceFlex":CA,"composition.mark":NA,"composition.view":LA,"composition.facetRect":VA,"composition.repeatMatrix":UA,"composition.facetCircle":t4,"composition.timingKeyframe":e4,"labelTransform.overlapHide":L_,"labelTransform.overlapDodgeY":j_,"labelTransform.overflowHide":z_,"labelTransform.contrastReverse":F_},zP)}const GP=[["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 HP(t,e,n){for(;t<e;)t+=2*Math.PI;for(;n<t;)t-=2*Math.PI;return t}function VP(t,e,n,r,i){var a=t[0],t=t[1],o=U();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 YP(t,e,n,r,i){var a=new eb({range:[e,e+r]}),o=new eb({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 qP(t,e,n,r,i){return(0,t[0])(e,n,r,i)}function $P(t,e,n,r,i){return t[0]}function UP(t,e,n,r,i){var a=t[0],o=t[1],s=t[2],t=t[3],l=new eb({range:[s,t]}),c=new eb({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=HP(Math.atan2(t,e),a,o);return[c.invert(t),l.invert(n)]}}}function XP(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 KP(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return n8.apply(void 0,r8([[-1,-1]],e,!1))}function ZP(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return n8.apply(void 0,r8([[-1,1]],e,!1))}function QP(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return n8.apply(void 0,r8([[1,-1]],e,!1))}function JP(t,e,n,r,i){var a,t=t[0],o=U();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 t8(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 eb({range:[s,s+.99*l]}),h=new eb({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=HP(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 e8(t,e,n,r,i){var s=t[0],l=t[1],a=t[2],t=t[3],c=new eb({range:[a,t]});return{transform:function(t){for(var e=[],n=t.length,r=new nb({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 n8=function(t,e,n,r,i){var a=t[0],t=t[1],o=U();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},r8=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 i8(t){return 1/Math.tan(t)}function a8(t,e,n,r,i){var a=i8(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 o8(t,e,n,r,i){var a=i8(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 s8(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 l8(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 c8(t,e,n){return n?new eb({range:[0,1],domain:[0,e]}).map(t):t}function u8(t,e,n,r,i){var a=t[0],o=t[1],t=t[2],s=c8(a,r,void 0!==t&&t);return{transform:function(t){var e=t[0],t=t[1];return[s8(e,s,o,0,1),t]},untransform:function(t){var e=t[0],t=t[1];return[l8(e,s,o,0,1),t]}}}function h8(t,e,n,r,i){var a=t[0],o=t[1],t=t[2],s=c8(a,i,void 0!==t&&t);return{transform:function(t){return[t[0],s8(t[1],s,o,0,1)]},untransform:function(t){return[t[0],l8(t[1],s,o,0,1)]}}}function f8(t,e,n,r,i){var a=t[0],o=t[1],s=t[2],l=t[3],t=t[4],c=c8(a,r,t=void 0!==t&&t),u=c8(o,i,t);return{transform:function(t){var e=t[0],t=t[1];return[s8(e,c,s,0,1),s8(t,u,l,0,1)]},untransform:function(t){var e=t[0],t=t[1];return[l8(e,c,s,0,1),l8(t,u,l,0,1)]}}}function d8(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 eb({range:[0,r]}),u=new eb({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=s8(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=l8(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 p8=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))},g8=(y8.prototype.update=function(t){this.options=iv({},this.options,t),this.recoordinate()},y8.prototype.clone=function(){return new y8(this.options)},y8.prototype.getOptions=function(){return this.options},y8.prototype.clear=function(){this.update({transformations:[]})},y8.prototype.getSize=function(){var t=this.options;return[t.width,t.height]},y8.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y;return[(2*e+t.width)/2,(2*n+t.height)/2]},y8.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:p8(p8([],n,!0),[p8([],t,!0)],!1)}),this},y8.prototype.map=function(t){return this.output(t)},y8.prototype.invert=function(t){return this.input(t)},y8.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},y8.prototype.compose=function(t){for(var e=(t=void 0===t?!1:t)?p8([],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(p8([],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)||av,"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):av}.apply(void 0,a)},y8.prototype.createMatrixTransform=function(t,e){var n,r,i,a,o,s,l,c,u,h,f,d,p=U();return e&&t.reverse(),t.forEach(function(t){return K(p,p,t)}),e&&(e=t=p,(d=new $(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 Gt(t,t,p),[t[0],t[1]]}},y8);function y8(t){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:YP,translate:VP,custom:qP,matrix:$P,polar:UP,transpose:XP,scale:n8,"shear.x":a8,"shear.y":o8,reflect:KP,"reflect.x":ZP,"reflect.y":QP,rotate:JP,helix:t8,parallel:e8,fisheye:f8,"fisheye.x":u8,"fisheye.y":h8,"fisheye.circular":d8},this.update(t)}function m8(e,n){const r=t=>{return"string"!=typeof t?t:n[t=e+"."+t]||Eg("Unknown Component: "+t)};return[(t,e)=>{var n=t["type"],t=at(t,["type"]);return r(n)(t,e)},r]}function v8(t){var{canvas:t,group:e}=t;return e?e.ownerDocument:t.document}function b8(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]=m8("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 x8(t,e){return t.filter(t=>t.type===e)}function w8(t){return 0<x8(t,"polar").length}function M8(t){return x8(t,"transpose").length%2==1}function k8(t){return 0<x8(t,"theta").length}function O8(t){return 0<x8(t,"radial").length}function f(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}Gs=f("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),a=f("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),tl=f("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),s=f("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),Qs=f("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),Uo=f("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),cu=f("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),qo=f("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),n=f("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),Vs=f("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function E8(t,e,n){(t.prototype=e.prototype=n).constructor=t}function S8(t,e){var n,r=Object.create(t.prototype);for(n in e)r[n]=e[n];return r}function A8(){}var _8=1/.7,nl="\\s*([+-]?\\d+)\\s*",ii="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ks="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",T8=/^#([0-9a-f]{3,8})$/,P8=new RegExp(`^rgb\\(${nl},${nl},${nl}\\)$`),C8=new RegExp(`^rgb\\(${Ks},${Ks},${Ks}\\)$`),L8=new RegExp(`^rgba\\(${nl},${nl},${nl},${ii}\\)$`),N8=new RegExp(`^rgba\\(${Ks},${Ks},${Ks},${ii}\\)$`),j8=new RegExp(`^hsl\\(${ii},${Ks},${Ks}\\)$`),R8=new RegExp(`^hsla\\(${ii},${Ks},${Ks},${ii}\\)$`),I8={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 B8(){return this.rgb().formatHex()}function D8(){return this.rgb().formatRgb()}function F8(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=T8.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?z8(e):3===n?new V8(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?W8(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?W8(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=P8.exec(t))?new V8(e[1],e[2],e[3],1):(e=C8.exec(t))?new V8(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=L8.exec(t))?W8(e[1],e[2],e[3],e[4]):(e=N8.exec(t))?W8(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=j8.exec(t))?K8(e[1],e[2]/100,e[3]/100,1):(e=R8.exec(t))?K8(e[1],e[2]/100,e[3]/100,e[4]):I8.hasOwnProperty(t)?z8(I8[t]):"transparent"===t?new V8(NaN,NaN,NaN,0):null}function z8(t){return new V8(t>>16&255,t>>8&255,255&t,1)}function W8(t,e,n,r){return new V8(t=r<=0?e=n=NaN:t,e,n,r)}function G8(t){return(t=t instanceof A8?t:F8(t))?new V8((t=t.rgb()).r,t.g,t.b,t.opacity):new V8}function H8(t,e,n,r){return 1===arguments.length?G8(t):new V8(t,e,n,null==r?1:r)}function V8(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Y8(){return"#"+X8(this.r)+X8(this.g)+X8(this.b)}function q8(){var t=$8(this.opacity);return(1===t?"rgb(":"rgba(")+U8(this.r)+`, ${U8(this.g)}, `+U8(this.b)+(1===t?")":`, ${t})`)}function $8(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function U8(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function X8(t){return((t=U8(t))<16?"0":"")+t.toString(16)}function K8(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||1<=n?t=e=NaN:e<=0&&(t=NaN),new Q8(t,e,n,r)}function Z8(t){var e,n,r,i,a,o,s,l;return t instanceof Q8?new Q8(t.h,t.s,t.l,t.opacity):(t=t instanceof A8?t:F8(t))?t instanceof Q8?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 Q8(o,s,l,t.opacity)):new Q8}function Q8(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function J8(t){return(t=(t||0)%360)<0?t+360:t}function tC(t){return Math.max(0,Math.min(1,t||0))}function eC(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}E8(A8,F8,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:B8,formatHex:B8,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Z8(this).formatHsl()},formatRgb:D8,toString:D8}),E8(V8,H8,S8(A8,{brighter(t){return t=null==t?_8:Math.pow(_8,t),new V8(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new V8(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new V8(U8(this.r),U8(this.g),U8(this.b),$8(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:Y8,formatHex:Y8,formatHex8:function(){return"#"+X8(this.r)+X8(this.g)+X8(this.b)+X8(255*(isNaN(this.opacity)?1:this.opacity))},formatRgb:q8,toString:q8})),E8(Q8,function(t,e,n,r){return 1===arguments.length?Z8(t):new Q8(t,e,n,null==r?1:r)},S8(A8,{brighter(t){return t=null==t?_8:Math.pow(_8,t),new Q8(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new Q8(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 V8(eC(240<=t?t-240:120+t,n,e),eC(t,n,e),eC(t<120?240+t:t-120,n,e),this.opacity)},clamp(){return new Q8(J8(this.h),tC(this.s),tC(this.l),$8(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=$8(this.opacity);return(1===t?"hsl(":"hsla(")+J8(this.h)+`, ${100*tC(this.s)}%, ${100*tC(this.l)}%`+(1===t?")":`, ${t})`)}}));const nC=Math.PI/180,rC=180/Math.PI;var iC=1.78277,aC=-.29227,oC=-.90649,sC=1.97294,lC=sC*oC,cC=sC*iC,uC=iC*aC- -.14861*oC;function hC(t,e,n,r){return 1===arguments.length?(i=t)instanceof fC?new fC(i.h,i.s,i.l,i.opacity):(a=(i=i instanceof V8?i:G8(i)).r/255,o=i.g/255,l=i.b/255,l=(sC*(o-(a=(uC*l+lC*a-cC*o)/(uC+lC-cC)))-aC*(o=l-a))/oC,new fC((l=(s=Math.sqrt(l*l+o*o)/(sC*a*(1-a)))?Math.atan2(l,o)*rC-120:NaN)<0?l+360:l,s,a,i.opacity)):new fC(t,e,n,null==r?1:r);var i,a,o,s,l}function fC(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}E8(fC,hC,S8(A8,{brighter(t){return t=null==t?_8:Math.pow(_8,t),new fC(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new fC(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*nC,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),t=Math.sin(t);return new V8(255*(e+n*(-.14861*r+iC*t)),255*(e+n*(aC*r+oC*t)),255*(e+sC*r*n),this.opacity)}}));var dC=t=>()=>t;function pC(e,n){return function(t){return e+t*n}}function gC(a){return 1==(a=+a)?yC: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)}):dC(isNaN(t)?e:t);var n,r,i}}function yC(t,e){var n=e-t;return n?pC(t,n):dC(isNaN(t)?e:t)}!function t(e){var o=gC(e);function n(e,t){var n=o((e=H8(e)).r,(t=H8(t)).r),r=o(e.g,t.g),i=o(e.b,t.b),a=yC(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);mC=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 mC,vC=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=H8(t[o]),r[o]=e.r||0,i[o]=e.g||0,a[o]=e.b||0;return r=mC(r),i=mC(i),a=mC(a),e.opacity=1,function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e+""}};function bC(s){return function t(o){function e(e,t){var n=s((e=hC(e)).h,(t=hC(t)).h),r=yC(e.s,t.s),i=yC(e.l,t.l),a=yC(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)}bC(function(t,e){var n=e-t;return n?pC(t,180<n||n<-180?n-360*Math.round(n/360):n):dC(isNaN(t)?e:t)});var r=bC(yC),Co=t=>vC(t[t.length-1]),fn=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(f),Qo=Co(fn),rs=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(f),zo=Co(rs),No=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(f),_o=Co(No),S=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(f),al=Co(S),Ko=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(f),Us=Co(Ko),Ro=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(f),Vo=Co(Ro),So=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(f),es=Co(So),as=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(f),Fs=Co(as),zs=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(f),Go=Co(zs),Es=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(f),Ml=Co(Es),qs=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(f),Al=Co(qs),Fl=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(f),jl=Co(Fl),nl=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(f),Ks=Co(nl),ii=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(f),xC=Co(ii),wC=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(f),MC=Co(wC),kC=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(f),OC=Co(kC),EC=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(f),SC=Co(EC),AC=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(f),_C=Co(AC),TC=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(f),PC=Co(TC),CC=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(f),LC=Co(CC),NC=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(f),jC=Co(NC),RC=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(f),IC=Co(RC),BC=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(f),DC=Co(BC),FC=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(f),zC=Co(FC),WC=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(f),GC=Co(WC),HC=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(f),VC=Co(HC),YC=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(f),Co=Co(YC);var qC=r(hC(300,.5,0),hC(-240,.5,1)),$C=r(hC(-100,.75,.35),hC(80,1.5,.8)),r=r(hC(260,.75,.35),hC(80,1.5,.8)),UC=hC();var XC=H8(),KC=Math.PI/3,ZC=2*Math.PI/3;function QC(e){var n=e.length;return function(t){return e[Math.max(0,Math.min(n-1,Math.floor(t*n)))]}}var JC=QC(f("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),tL=QC(f("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),eL=QC(f("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),nL=QC(f("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),rL=Object.freeze({__proto__:null,schemeCategory10:Gs,schemeAccent:a,schemeDark2:tl,schemePaired:s,schemePastel1:Qs,schemePastel2:Uo,schemeSet1:cu,schemeSet2:qo,schemeSet3:n,schemeTableau10:Vs,interpolateBrBG:Qo,schemeBrBG:fn,interpolatePRGn:zo,schemePRGn:rs,interpolatePiYG:_o,schemePiYG:No,interpolatePuOr:al,schemePuOr:S,interpolateRdBu:Us,schemeRdBu:Ko,interpolateRdGy:Vo,schemeRdGy:Ro,interpolateRdYlBu:es,schemeRdYlBu:So,interpolateRdYlGn:Fs,schemeRdYlGn:as,interpolateSpectral:Go,schemeSpectral:zs,interpolateBuGn:Ml,schemeBuGn:Es,interpolateBuPu:Al,schemeBuPu:qs,interpolateGnBu:jl,schemeGnBu:Fl,interpolateOrRd:Ks,schemeOrRd:nl,interpolatePuBuGn:xC,schemePuBuGn:ii,interpolatePuBu:MC,schemePuBu:wC,interpolatePuRd:OC,schemePuRd:kC,interpolateRdPu:SC,schemeRdPu:EC,interpolateYlGnBu:_C,schemeYlGnBu:AC,interpolateYlGn:PC,schemeYlGn:TC,interpolateYlOrBr:LC,schemeYlOrBr:CC,interpolateYlOrRd:jC,schemeYlOrRd:NC,interpolateBlues:IC,schemeBlues:RC,interpolateGreens:DC,schemeGreens:BC,interpolateGreys:zC,schemeGreys:FC,interpolatePurples:GC,schemePurples:WC,interpolateReds:VC,schemeReds:HC,interpolateOranges:Co,schemeOranges:YC,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:qC,interpolateRainbow:function(t){(t<0||1<t)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return UC.h=360*t-100,UC.s=1.5-1.5*e,UC.l=.8-.9*e,UC+""},interpolateWarm:$C,interpolateCool:r,interpolateSinebow:function(t){var e;return t=(.5-t)*Math.PI,XC.r=255*(e=Math.sin(t))*e,XC.g=255*(e=Math.sin(t+KC))*e,XC.b=255*(e=Math.sin(t+ZC))*e,XC+""},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:JC,interpolateMagma:tL,interpolateInferno:eL,interpolatePlasma:nL});function iL(t,e,n,r,i,a){var o,s,{guide:l={}}=n,c=function(t,e,n){var{type:n,domain:r,range:i,quantitative:a,ordinal:o}=n;return void 0!==n?n:function(t){return vL(t,Cg)}(e)?"identity":"string"==typeof i?"linear":2<(r||i||[]).length?fL(t,o):void 0===r?yL(e)?fL(t,o):mL(e)?"time":dL(t,i,a):yL([r])?fL(t,o):mL(e)?"time":dL(t,i,a)}(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(cL({type:t}))return function(t,e,n){const r=t.map(Number),i=new eb({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 uL({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 pL(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)Ag(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 gL(e);case"quantile":return function(t){return gL(t).sort()}(e);case"sequential":return pL(function(t){let e=1/0,n=-1/0;for(const r of t)for(const i of r)Ag(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=Cv,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||"size"===e?0:"band"===t?k8(n)?0:.1:"point"===t?.5:0}(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=Xe(e),i=rL["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=hL(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],Tb(e)]:"opacity"!==t&&"size"===t?[1,10]:[0,1]}(e,u);return[l||u,c||h];case"band":case"point":return[l||("size"===e?5:0),c||("size"===e?10:1)];case"ordinal":return hL(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 aL(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:rn(l,n)}),r.push(s))}return r}function oL(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=v0(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 sL(t,e){var[e]=m8("scale",e),n=t["relations"],[n]=function(o){if(!o||!Array.isArray(o))return[Mg,Mg];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 lL(t,n){var t=t.filter(({name:t,facet:e=!0})=>e&&t===n),e=t.flatMap(t=>t.domain),r=t.every(cL)?Kp(e):t.every(uL)?Array.from(new Set(e)):null;if(null!==r)for(const i of t)i.domain=r}function cL(t){t=t.type;return"string"==typeof t&&["linear","log","pow","time"].includes(t)}function uL(t){t=t.type;return"string"==typeof t&&["band","point","ordinal"].includes(t)}function hL(t,e,n,r,i){var[i]=m8("palette",i),{category10:r,category20: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=Xe(t),i=rL["scheme"+e],a=rL["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 fL(t,e){return e||((e=t).startsWith("x")||e.startsWith("y")||e.startsWith("position")||e.startsWith("size")?"point":"ordinal")}function dL(t,e,n){return n||("color"!==t||e?"linear":"sequential")}function pL(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 gL(t){return Array.from(new Set(t.flat()))}function yL(t){return vL(t,t=>{t=typeof t;return"string"==t||"boolean"==t})}function mL(t){return vL(t,t=>t instanceof Date)}function vL(t,e){for(const n of t)if(n.some(e))return!0;return!1}const bL={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},xL={threshold:"threshold",quantize:"quantize",quantile:"quantile"},wL={ordinal:"ordinal",band:"band",point:"point"},ML={constant:"constant"};function kL(t,e,n){const{coordinates:b=[],title:r}=e,[,x]=m8("component",n),w=t.filter(({guide:t})=>null!==t),M=[];var i,e=function(t,e,n){const[,o]=m8("component",n),s=t["coordinates"];function i(t,e,n,r){[e,t,i=[]]=[e,t,s];var i,a,e="x"===e?M8(i)?t+"Y":t+"X":"y"===e?M8(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=n0(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 l=t=>t.sort(([t],[e])=>t.localeCompare(e)),s=Array.from(o).map(([,t])=>{var e,n,r,i,a=function(e){if(1===e.length)return[e];var n=[];for(let t=1;t<=e.length;t++)n.push(...Cb(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 bL?"continuous":t in wL?"discrete":t in xL?"distribution":t in ML?"constant":null}(t)])}));for({option:e,combination:n}of a)if(!e.every(t=>"constant"===t[1])&&e.every(t=>"discrete"===t[1]||"constant"===t[1]))return["legendCategory",n];for([r,i]of GP)for(const{option:o,combination:s}of a)if(i.some(t=>on(l(t),l(o))))return[r,s];return null}).filter(Ag);return s}(t),...function(t,n){return t.map(t=>{var e=t["name"];if(!(0<x8(n,"helix").length||k8(n))&&(!M8(n)||!w8(n)&&!O8(n))){if(e.startsWith("x"))return w8(n)?["axisArc",[t]]:O8(n)?["axisLinear",[t]]:[M8(n)?"axisY":"axisX",[t]];if(e.startsWith("y"))return w8(n)?["axisLinear",[t]]:O8(n)?["axisArc",[t]]:[M8(n)?"axisX":"axisY",[t]];if(e.startsWith("position")){if(0<x8(n,"radar").length)return["axisRadar",[t]];if(!w8(n))return["axisY",[t]]}}return null}).filter(Ag)}(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]=SL(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=AL(n),n===r.slice(-1)[0].name||null===a?[null,null]:([o,s]=SL(i),["center",(s-o)/(r.length-1)*a+o])}{var s;if("axisY"===t&&function(t){return 0<x8(t,"parallel").length}(i))return null===(s=AL(n))?e:M8(i)?0===s?["top",null]:["center","horizontal"]:0===s?e:["center","vertical"]}if("axisLinear"===t)return[r]=SL(i),["center",r];if("axisArc"===t)return"inner"===e[0]?["inner",null]:["outer",null];if(w8(i))return["center",null];if(O8(i))return["center",null];if("axisX"===t&&function(t){return 0<x8(t,"reflect").length}(i)||"axisX"===t&&function(t){return 0<x8(t,"reflectY").length}(i))return["top",null];return e}(t,e,i,a,o);if("string"==typeof t&&t.startsWith("legend")&&w8(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 OL(t,e,n,r,i){var[a]=m8("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 EL(t,o){const r=["left","right","bottom","top"];return n0(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=P0(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=v0(t,t=>t.size),n=v0(t,t=>t.order),i=v0(t,t=>t.crossPadding);return{type:"group",size:r,order:n,position:t[0].position,children:t,crossPadding:i}})}function SL(t){var e,n=x8(t,"polar");return n.length?(n=n[n.length-1],{startAngle:n,endAngle:e}=fd(n),[n,e]):(n=x8(t,"radial")).length?(e=n[n.length-1],{startAngle:t,endAngle:n}=md(e),[t,n]):[-Math.PI/2,Math.PI/2*3]}function AL(t){t=/position(\d*)/g.exec(t);return t?+t[1]:null}function _L(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")?LL:s.startsWith("group")?TL:s.startsWith("legendContinuous")?NL:"legendCategory"===s?jL:s.startsWith("slider")?CL:"title"===s?PL:()=>{})(t,e,n,r,i,a)}}function TL(t,e,n,r,i,a){var o=t["children"];const s=v0(o,t=>t.crossPadding),l=(o.forEach(t=>t.crossPadding=s),o.forEach(t=>_L(t,e,n,r,i,a)),v0(o,t=>t.size));t.size=l,o.forEach(t=>t.size=l)}function PL(t,e,n,r,i,a){var i=ot({},i.title,t),{title:o,subtitle:s,spacing:l=0}=i,i=at(i,["title","subtitle","spacing"]);o&&(o=zL(o,st(i,"title")),t.size=o.height),s&&(o=zL(s,st(i,"subtitle")),t.size+=l+o.height)}function CL(t,e,n,r,i,a){i=i.slider;var{trackSize:i,handleIconSize:o}=ot({},i,t),i=Math.max(i,2.4*o);t.size=i}function LL(t,e,n,r,i,a){t.transform=t.transform||[{type:"hide"}];var o,s,l,c="left"===r||"right"===r,r=DL(t,r,i),{tickLength:i=0,labelSpacing:u=0,titleSpacing:h=0}=r,r=at(r,["tickLength","labelSpacing","titleSpacing"]),a=RL(t,a),f=IL(r,a),i=i+u,a=(f?(u=v0(f,t=>t.width),o=v0(f,t=>t.height),c?t.size=u+i:({tickFilter:s,labelTransform:l}=t,!function(t,e,n,r,i){var a=P0(e,t=>t.width);if(n<a)return 1;const o=t.clone(),s=(o.update({range:[0,n]}),FL(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,f,e,n,s)||l?t.size=o+i:(t.labelTransform="rotate(90)",t.size=u+i))):t.size=i,BL(r));a&&(t.size+=c?h+a.width:h+a.height)}function NL(t,e,n,r,i,a){i=i.legendContinuous;var i=ot({},i,t),{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,RL(t,a)),l=IL(i,c);if(l){const u=r?"width":"height";a=v0(l,t=>t[u]);t.size+=a+o}var c=BL(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 jL(o,s,t,e,n,r){n=n.legendCategory;const i=ot({},n,o),{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?s:p;n="left"===e||"right"===e;const y=BL(f),m=IL(f,RL(o,r),"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)e=Math.ceil(m.length/d),r=v0(m,t=>b(t.width))*d,o.size=v*e,o.length=Math.min(r,g);else{let t=1,e=0,n=-1/0;for(var{width:k}of m){k=b(k,h);e+k>g?(n=Math.max(n,e),e=k,t++):e+=k}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 RL(t,e){var[e]=m8("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 IL(t,e,n="label"){var{labelFormatter:r,tickFilter:i,label:a=!0}=t,o=at(t,["labelFormatter","tickFilter","label"]);if(!a)return null;const s=function(t,e,n){n=FL(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?E5(e):e:t.getFormatter?t.getFormatter():t=>""+t;return n.map(e)}(e,r,i),l=st(o,n),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 zL(t,c[e])});return c.some(t=>t.transform)||(a=s.map((t,e)=>e),t.indexBBox=new Map(a.map(t=>[t,[s[t],u[t]]]))),u}function BL(t){var e,n,r=t["title"],t=at(t,["title"]);return!1===(e=r)||null===e||void 0===r||({direction:t,transform:n}=e=st(t,"title"),"string"!=typeof(r=Array.isArray(r)?r.join(","):r))?null:zL(r,Object.assign(Object.assign({},e),{transform:n||("vertical"===t?"rotate(-90)":"")}))}function DL(t,e,n){var r=t["title"],[r,i]=Array.isArray(r)?[r,void 0]:[void 0,r],{axis:n,["axis"+Og(e)]:e}=n;return ot({title:r},n,e,Object.assign(Object.assign({},t),{title:i}))}function FL(t,e){t=t.getTicks?t.getTicks():t.getOptions().domain;return e?t.filter(e):t}function zL(t,e){t=(t=t)instanceof Jl?t:new Rc({style:{text:""+t}}),t.attr(Object.assign(Object.assign({},e),{visibility:"none"})),e=t.getBBox();return e}function WL(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(!w8(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 DL(t,"axisArc"===t.type?"arc":"linear",n)}),o=v0(a,t=>{return null!=(t=t.labelSpacing)?t:0}),s=i.flatMap((t,e)=>{return IL(a[e],RL(t,r))}).filter(Ag),l=v0(s,t=>t.height)+o,c=i.flatMap((t,e)=>{return BL(a[e])}).filter(t=>null!==t),u=0===c.length?0:v0(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}=GL(t,i-M-w,[M,w],["left","right"],o,e,n),k=r-d-f,[v,b]=x(k,v,b,M,w),M=k-v-b,{paddingTop:w,paddingBottom:k}=GL(t,M,[v,b],["bottom","top"],o,e,n),t=i-p-g,[e,n]=x(t,m,y,k,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 GL(t,n,r,e,i,a,o){var s=e0(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"+Og(BE(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=v0(e.children,t=>t.size)):e.size=e.defaultSize:(_L(t,n,r,p,a,o),y(t)))};"number"==typeof g?t.forEach(y):0===t.length?u[h]=30:((f=EL(t,n)).forEach(d),d=f.reduce((t,{size:e})=>t+e,0),u[h]=d)}return u}function HL(t,I,e){var B=e0(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,Wp],right:[H-n,r,n,a,"horizontal",!1,Wp],bottom:[t,c-i,o,i,"vertical",!1,Wp],left:[0,r,t,a,"horizontal",!0,Wp],"top-left":[t,0,o,r,"vertical",!0,Wp],"top-right":[t,0,o,r,"vertical",!0,Wp],"bottom-left":[t,c-i,o,i,"vertical",!1,Wp],"bottom-right":[t,c-i,o,i,"vertical",!1,Wp],center:e,inner:e,outer:e};for(const[j,t]of B.entries()){var u=V[j],[h,Y]=Pb(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]=Pb(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 R0(t)&&L0(t)}(m)){if(L0(m)){f=void 0;g=void 0;x=void 0;w=void 0;M=void 0;k=void 0;f=h;g=v;var[x,w,M,k]=g;for(const it of f)it.bbox={x:x,y:w,width:M,height:k}}else if(R0(m)){g=void 0;f=void 0;O=void 0;E=void 0;g=h;f=m;var O=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,O):"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,O)}}else{S=void 0;E=void 0;A=void 0;_=void 0;q=void 0;$=void 0;var S=h;E=v;var[A,_,q,$]=E;for(const R of S)R.bbox={x:A,y:_,width:q,height:$},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;X=void 0;O=void 0;P=void 0;C=void 0;K=void 0;Z=void 0;var T=h;g=m;f=v;var[U,X,,f]=f,[O,P]=g.getCenter(),[g]=D0(g),f=f/2,C=g*f,K=O-C,Z=P-C;for(let t=0;t<T.length;t++)T[t].bbox={x:U+K,y:X+Z,width:2*C,height:2*C}}else if("outer"===b){m=void 0;g=void 0;Q=void 0;J=void 0;tt=void 0;et=void 0;m=h;g=v;var[Q,J,tt,et]=g;for(const at of m)at.bbox={x:Q,y:J,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]=D0(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 A of t){const{bbox:_,children:T}=A;var w=_[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"),k=T.map((t,e)=>{var{length:t=P,padding:n=0}=t;return t+(e===T.length-1?0:n)}),O=P0(k),w=w-O,O="flex-start"===M?0:"center"===M?w/2:w;for(let t=0,e=_[h]+O;t<T.length;t++){var E=T[t],{padding:S=0}=E,S=t===T.length-1?0:S;E.bbox={[d]:_[d],[c]:_[c],[h]:e,[g]:k[t]-S},ot(E,{layout:{justifyContent:M}}),e+=k[t]}}}(t,u)}}function VL(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 YL(t,i,a){return X(this,void 0,void 0,function*(){var t=a["library"],e=i["data"],[t]=m8("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=>X(this,void 0,void 0,function*(){var t=yield n(e);return r(t)}),Mg)}([at(n,["transform"]),...r].map(t))(e);return[Array.isArray(n)?_b(n):[],Object.assign(Object.assign({},i),{data:n})]})}function qL(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 $L(t,e,n){const{encode:r,data:i}=e;var a;return r?(a=Ab(r,t=>{var e,n;return function(t){if("object"!=typeof t||t instanceof Date||null===t)return;t=t.type;return Ag(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 UL(t,e,n){var r=e["encode"];return r?(r=Ab(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 XL(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];n=n.library;const a=function(t){const[n]=m8("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=Ab(r,t=>a(i,t));return[t,Object.assign(Object.assign({},e),{encode:n})]}function KL(t,e,n){var{tooltip:r={}}=e;return Lg(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:Cg(r)&&Rg(r)?[t,Object.assign(Object.assign({},e),{tooltip:r})]:[t,Object.assign(Object.assign({},e),{tooltip:{items:[r]}})]}function ZL(g,t,e){const{data:y,encode:m,tooltip:n={}}=t;var r,i,a,o;return Lg(n)?[g,t]:(r=e=>{if(!e)return e;if("string"==typeof e)return g.map(t=>({name:e,value:y[t][e]}));if(Cg(e)){var{field:t,channel:n,color:r,name:i=t,valueFormatter:a=t=>t}=e,o="string"==typeof a?E5(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);Cg(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 QL(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 JL(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 tN(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 eN(l,c,u){return X(this,void 0,void 0,function*(){var[t,e]=yield function(s,l,c){return X(this,void 0,void 0,function*(){var t=c["library"],[t]=m8("transform",t),{preInference:e=[],postInference:n=[]}=l,{transform:r=[]}=s,e=[VL,YL,qL,$L,UL,XL,QL,tN,JL,KL,...e.map(t),...r.map(t),...n.map(t),ZL];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:p,data:r,tooltip:i}=e;if(!1===Array.isArray(r))return null;const a=c["channels"],o=i0(Object.entries(n).filter(([,t])=>Ag(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,quantitative:f,ordinal:d}=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=p[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(Object.assign({type:i,range:l},r),{quantitative:f,ordinal:d})}})});return[e,Object.assign(Object.assign({},c),{index:t,channels:s,tooltip:i})]})}function nN(H,V,Y,q){var $,U;return X(this,void 0,void 0,function*(){const[n]=m8("composition",Y);var[t]=m8("interaction",Y);const I=new Set(Object.keys(Y).map(t=>{return null==(t=/mark\.(.*)/.exec(t))?void 0:t[1]}).filter(Ag)),r=new Set(Object.keys(Y).map(t=>{return null==(t=/component\.(.*)/.exec(t))?void 0:t[1]}).filter(Ag)),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?oN(f,h,Y):yield iN(h,Y),p=(s.set(f,h),o.push(f),d.flatMap(e).map(t=>b8(t,Y)));if(c.push(...p),p.every(a)){var g=yield Promise.all(p.map(t=>aN(t,Y)));lL(f=(f=g).flatMap(t=>Array.from(t.values())).flatMap(t=>t.channels.map(t=>t.scale)),"x"),lL(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 pN(h,Y),f=e(d);Array.isArray(f)?c.push(...f):"function"==typeof f&&u.push(f())}}q.emitter.emit(v3.BEFORE_PAINT);const y=new Map,m=new Map,v=[];V.selectAll(vN(bh)).data(o,t=>t.key).join(t=>t.append("g").attr("className",bh).attr("id",t=>t.key).call(rN).each(function(t){sN(t,lt(this),v,Y,q),y.set(t,this)}),t=>t.call(rN).each(function(t){sN(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=>X(this,void 0,void 0,function*(){var t,[e,n]=yield iN(h,d),r=(sN(e,f,[],d,p),f),i=h,a=e,o=p,[s]=m8("interaction",s=d),l=(l=r.node()).nameInteraction,c=dN(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)nN(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 dN(H)){var[M,k]=C;k&&(k=t(Object.assign({type:M},k))(P,x,q.emitter),w.set(M,{destroy:k}))}}var O=b(m);for(const L of O){const{options:H,container:N}=L;var E=N.nameInteraction;for(const j of dN(H)){var[S,A]=j,_=E.get(S);_&&null!=($=_.destroy)&&$.call(_),A&&(_=t(Object.assign({type:S},A))(L,O,q.emitter),E.set(S,{destroy:_}))}}const{width:z,height:W}=H;var T=[];for(const R of u){var G=new Promise(e=>X(this,void 0,void 0,function*(){for(const t of R)yield nN(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(v3.AFTER_PAINT);b=v.filter(Ag).map(hN).map(t=>t.finished);return Promise.all([...b,...T])})}function rN(t){t.style("transform",t=>`translate(${t.layout.x}, ${t.layout.y})`)}function iN(e,n){return X(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 X(this,void 0,void 0,function*(){var[t,e]=m8("mark",g),n=new Set(Object.keys(g).map(t=>{return null==(t=/component\.(.*)/.exec(t))?void 0:t[1]}).filter(Ag));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 pN(u,g);const{type:f=Eg("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,b8(t,n));return oN(yield aN(t,n),t,n)})}function aN(g,y){return X(this,void 0,void 0,function*(){var[t]=m8("theme",y),[,e]=m8("mark",y),{theme:n,marks:r,coordinates:i=[]}=g,a=t(fN(n)),o=new Map;for(const f of r){var s,l=f["type"],{props:l={}}=e(l),l=yield eN(f,l,y);l&&([l,s]=l,o.set(l,s))}for(const d of e0(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(Ag)));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({},iL(h,c,g,i,a,y)),{key:u});d.forEach(t=>t.scale=p)}return o})}function oN(t,e,n){var[r]=m8("mark",n),[i]=m8("theme",n),[a]=m8("labelTransform",n);const{key:o,frame:s=!1,theme:I,clip:B,style:l={},labelTransform:D=[]}=e;var i=i(fN(I)),c=Array.from(t.values());const u=aL(c,e);var c=kL(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).map(t=>{t=ot(t,t.style);return delete t.style,t}),h=WL(c,e,i,n),f=function(t,e,n){var[n]=m8("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 g8(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=(HL(EL(c),f,h),{});for(const x of c){var{scales:F=[]}=x;const u=[];for(const w of F){var z=w["name"],p=sL(w,n);u.push(p),oL(d,{[z]:p})}x.scaleInstances=u}var g,y,m=[];for([g,y]of t.entries()){const{children:M,dataDomain:k,modifier:O,key:E}=g,{index:S,channels:A,tooltip:_}=y;var v=Ab(Object.fromEntries(A.map(({name:t,scale:e})=>[t,e])),t=>sL(t,n));oL(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}(A,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])=>Ag(t)&&Ag(e))&&(r.push(a),i.push(o))}return[r,i]}(r(g)(S,v,T,f));var b=k||P.length;const N=O?O(C,b,h):[],j=t=>{var e;return null==(e=null==(e=_.title)?void 0:e[t])?void 0:e.value},R=e=>_.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},_&&{title:j(t),items:R(t)});for(const[r,i]of Object.entries(T))n[r]=i[t],L&&(n["series"+Xe(r)]=L[e].map(t=>i[t]));return L&&(n.seriesIndex=L[e]),L&&_&&(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:kg(D.map(a))},m]}function sN(tt,et,nt,rt,it){X(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=>_g(Object.assign({},n.view,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(vN(kh)).data(u.filter(t=>Ag(h[t])),t=>l[t]).join(t=>t.append("rect").attr("className",kh).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:k=g,exitType:O=d}=E;void 0!==y&&!y||(e=Math.max(e,m+v),n=Math.min(n,v)),void 0!==O&&!O||(e=Math.max(e,M+k),n=Math.min(n,k)),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 n0(t,t=>t.type+"-"+t.position))c.forEach((t,e)=>t.index=e);var x,w,M,u=et.selectAll(vN(wh)).data(t,t=>`${t.type}-${t.position}-`+t.index).join(t=>t.append("g").style("zIndex",({zIndex:t})=>t||-1).attr("className",wh).append(t=>OL(ot({animate:b,scale:s},t),i,n,rt,r)),t=>t.transition(function(t){var{preserve:e=!1}=t;if(!e)return e=OL(ot({animate:b,scale:s},t),i,n,rt,r)["attributes"],[t]=this.childNodes,t.update(e)})).transitions();nt.push(...u.flat().filter(Ag));const k=et.selectAll(vN(xh)).data([e],()=>a).join(t=>t.append("rect").style("zIndex",0).style("fill","transparent").attr("className",xh).call(gN).call(mN,Array.from(r.keys())).call(bN,o),t=>t.call(mN,Array.from(r.keys())).call(t=>{if(!v)return gN(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(bN,o)).transitions();nt.push(...k.flat());for([x,w]of r.entries()){var W=w["data"];const{key:a,class:q,type:_}=x;var O=et.select("#"+a);const T=function(s,t,e,n,r){const[l]=m8("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:v8(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=Ab(p,t=>lN(t,a,o,c)),i=Object.assign(Object.assign({},r),{type:yN(s,e)});return l(i,g)(n,t,cN(f,d,e,u),h)}}(x,w,tt,rt,it),$=(E=x,M=w,uN("enter",E,M,tt,rt)),P=(E=x,M=w,uN("update",E,M,tt,rt)),U=(E=x,M=w,uN("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,O,q,"element");const k=O.selectAll(vN(vh)).selectFacetAll(E).data(W,t=>t.key,t=>t.groupKey).join(t=>t.append(T).attr("className",vh).attr("markType",_).transition(function(t){return $(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?Sg(this,o):(this.parentNode.replaceChild(o,this),o.className=vh,o.markType=_)),s}).attr("markType",_).attr("className",vh)}),t=>t.each(function(){this.__removed__=!0}).transition(function(t){return U(t,[this])}).remove(),t=>t.append(T).attr("className",vh).attr("markType",_).transition(function(t){var e=this["__fromElements__"],t=P(t,e,[this]);return new $b(e,null,this.parentNode).transition(t).remove(),t}),t=>t.transition(function(t){var e=new $b([],this.__toData__,this.parentNode).append(T).attr("className",vh).attr("markType",_).nodes();return P(t,[this],e)}).remove()).transitions();nt.push(...k.flat())}{var S=tt,G=et,H=rt,V=it,A,Y;const[X]=m8("labelTransform",H),{markState:K,labelTransform:C}=S,Z=G.select(vN(mh)).node(),L=new Map,N=new Map,Q=Array.from(K.entries()).flatMap(([t,e])=>{var{labels:n=[],key:r}=t;const i=function(t,e,n,r,i){const[s]=m8("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:v8(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=Ab(Object.assign(Object.assign({},t),a),t=>lN(t,r,e,l)),{shape:a=c,text:o}=t,t=at(t,["shape","text"]),i="string"==typeof i?E5(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,cN(h,"label",a,"label"),u)}}(t,e,S,H,V),a=G.select("#"+r).selectAll(vN(vh)).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(vN(Mh)).data(Q,t=>t.key).join(t=>t.append(t=>L.get(t)(t)).attr("className",Mh),t=>t.each(function(t){Sg(this,L.get(t)(t))}),t=>t.remove()).nodes(),J=e0(j,t=>N.get(t.__data__)),R=S["coordinate"];for([A,Y]of J){var{transform:A=[]}=A;kg(A.map(X))(Y,R)}C&&C(j,R)}})}function lN(t,e,n,r){return"function"==typeof t?t(e,n,r):"string"==typeof t&&void 0!==e[t]?e[t]:t}function cN(t,e,n,r){var i;if("string"==typeof e)return i=t["color"],e=(t=t[e]||{})[n]||t[r],Object.assign({color:i},e)}function uN(o,t,e,n,r){var[,i]=m8("shape",r);const[s]=m8("animation",r);var r=e["defaultShape"],{theme:e,coordinate:n}=n,a=`default${Xe(o)}Animation`;const{[a]:l}=i(yN(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 hN(t){return t.finished.then(()=>{t.cancel()}),t}function fN(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 dN(t){var{interaction:t={}}=t;return Object.entries(ot({event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},t))}function pN(r,i){return X(this,void 0,void 0,function*(){var t={library:i},e=r["data"],n=at(r,["data"]);return null==e?r:([,{data:e}]=yield YL(0,{data:e},t),Object.assign({data:e},n))})}function gN(t){t.style("x",t=>t.paddingLeft).style("y",t=>t.paddingTop).style("width",t=>t.innerWidth).style("height",t=>t.innerHeight)}function yN(t,e){t=t.type;return"string"==typeof e?t+"."+e:e}function mN(t,e){const n=t=>void 0!==t.class?""+t.class:"";0===t.nodes().length||(t.selectAll(vN(yh)).data(e,t=>t.key).join(t=>t.append("g").attr("className",yh).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(vN(mh)).node())||t.append("g").attr("className",mh).style("zIndex",0)}function vN(...t){return t.map(t=>"."+t).join("")}function bN(t,i){t.node()&&t.style("clipPath",t=>{var e,n,r;return i?({paddingTop:t,paddingLeft:e,innerWidth:n,innerHeight:r}=t,new Lc({style:{x:e,y:t,width:n,height:r}})):null})}function xN(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 wN(t,e={},n=()=>{},r=t=>{throw t}){const{width:i=640,height:a=480,theme:o}=t,s=(o||Eg('ChartOptions.theme is required, such as `const chart = new Chart({ theme: "classic"})`.'),xN(t)),{canvas:l=(t=i,h=a,f=new nd,f.registerPlugin(new sd),new ou({width:t,height:h,container:document.createElement("div"),renderer:f})),library:c=WP(),emitter:u=new cd}=e;var h,f;e.canvas=l,e.library=c,e.emitter=u,l.resize(i,a),u.emit(v3.BEFORE_RENDER);const d=lt(l.document.documentElement);return l.ready.then(()=>nN(Object.assign(Object.assign({},s),{width:i,height:a}),d,c,e)).then(()=>{l.requestAnimationFrame(()=>{u.emit(v3.AFTER_RENDER),null!=n&&n()})}).catch(t=>{null!=r&&r(t)}),"string"==typeof(t=l.getConfig().container)?document.getElementById(t):t}function MN(t,e={},n=!1){var r,{canvas:e,emitter:i}=e;e&&(null!=(r=(r=e).getRoot().querySelectorAll("."+bh))&&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 kN(t,{name:e,key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function ON(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 EN(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 y(r){return t=>{for(const n of r){var e=n["type"];"value"===e?kN(t,n):"array"===e?ON(t,n):"object"===e?EN(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}):Cg(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 SN(t){return Object.entries(t).map(([t,e])=>({type:"node",name:t,ctor:e}))}function AN(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 _N{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 AN(this,t=>{e===t.attr("key")&&(n=t)}),n}getNodesByType(e){const n=[];return AN(this,t=>{e===t.type&&n.push(t)}),n}getNodeByType(e){let n=null;return AN(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 TN extends _N{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)}}Gs=[{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"}],tl=a;let PN=class extends TN{constructor(){super({})}},CN=(PN=e([y(Gs)],PN),class extends TN{constructor(){super({},"interval")}}),LN=(CN=e([y(Gs)],CN),class extends TN{constructor(){super({},"rect")}}),NN=(LN=e([y(Gs)],LN),class extends TN{constructor(){super({},"point")}}),jN=(NN=e([y(Gs)],NN),class extends TN{constructor(){super({},"area")}}),RN=(jN=e([y(Gs)],jN),class extends TN{constructor(){super({},"line")}}),IN=(RN=e([y(Gs)],RN),class extends TN{constructor(){super({},"cell")}}),BN=(IN=e([y(Gs)],IN),class extends TN{constructor(){super({},"vector")}}),DN=(BN=e([y(Gs)],BN),class extends TN{constructor(){super({},"link")}}),FN=(DN=e([y(Gs)],DN),class extends TN{constructor(){super({},"polygon")}});FN=e([y(Gs)],FN);s=e([y(Gs)],class extends TN{constructor(){super({},"image")}});let zN=class extends TN{constructor(){super({},"text")}},WN=(zN=e([y(Gs)],zN),class extends TN{constructor(){super({},"box")}}),GN=(WN=e([y(Gs)],WN),class extends TN{constructor(){super({},"lineX")}}),HN=(GN=e([y(Gs)],GN),class extends TN{constructor(){super({},"lineY")}}),VN=(HN=e([y(Gs)],HN),class extends TN{constructor(){super({},"range")}}),YN=(VN=e([y(Gs)],VN),class extends TN{constructor(){super({},"rangeX")}}),qN=(YN=e([y(Gs)],YN),class extends TN{constructor(){super({},"rangeY")}}),$N=(qN=e([y(Gs)],qN),class extends TN{constructor(){super({},"connector")}}),UN=($N=e([y(Gs)],$N),class extends TN{constructor(){super({},"shape")}}),XN=(UN=e([y(Gs)],UN),class extends TN{constructor(){super({},"sankey")}}),KN=(XN=e([y([...Gs,{name:"layout",type:"value"}])],XN),class extends TN{constructor(){super({},"treemap")}}),ZN=(KN=e([y([...Gs,{name:"layout",type:"value"}])],KN),class extends TN{constructor(){super({},"boxplot")}}),QN=(ZN=e([y(Gs)],ZN),class extends TN{constructor(){super({},"density")}}),JN=(QN=e([y(Gs)],QN),class extends TN{constructor(){super({},"heatmap")}}),t7=(JN=e([y(Gs)],JN),class extends TN{constructor(){super({},"path")}}),e7=(t7=e([y(Gs)],t7),class extends TN{constructor(){super({},"pack")}}),n7=(e7=e([y([...Gs,{name:"layout",type:"value"}])],e7),class extends TN{constructor(){super({},"forceGraph")}}),r7=(n7=e([y([...Gs,{name:"layout",type:"value"}])],n7),class extends TN{constructor(){super({},"tree")}}),i7=(r7=e([y([...Gs,{name:"layout",type:"value"}])],r7),class extends TN{constructor(){super({},"wordCloud")}}),a7=(i7=e([y([...Gs,{name:"layout",type:"object"}])],i7),class extends TN{constructor(){super({},"gauge")}}),o7=(a7=e([y(Gs)],a7),class extends TN{constructor(){super({},"axisX")}}),s7=(o7=e([y(a)],o7),class extends TN{constructor(){super({},"axisY")}}),l7=(s7=e([y(a)],s7),class extends TN{constructor(){super({},"legends")}});l7=e([y(tl)],l7);const c7={mark:PN,interval:CN,rect:LN,point:NN,area:jN,line:RN,cell:IN,vector:BN,link:DN,polygon:FN,image:s,text:zN,box:WN,lineX:GN,lineY:HN,range:VN,rangeX:YN,rangeY:qN,connector:$N,sankey:XN,treemap:KN,boxplot:ZN,density:QN,heatmap:JN,path:t7,shape:UN,pack:e7,forceGraph:n7,tree:r7,wordCloud:i7,gauge:a7,axisX:o7,axisY:s7,legends:l7};class u7 extends _N{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()&&VS(t)}hide(){var t=this.getGroup();t&&t.isVisible()&&HS(t)}}let h7=class extends u7{constructor(t={},e="view"){super(t,e)}},f7=(h7=e([y([{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"},...SN(c7)])],h7),class extends u7{constructor(){super({},"spaceLayer")}}),d7=(f7=e([y([{type:"value",name:"data"},...SN(c7)])],f7),class extends u7{constructor(){super({},"spaceFlex")}}),p7=(d7=e([y([{type:"value",name:"data"},...SN(c7)])],d7),class extends u7{constructor(){super({},"facetRect")}}),g7=(p7=e([y([{type:"value",name:"data"},{type:"array",name:"transform"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"legend"},{type:"object",name:"axis"},...SN(c7)])],p7),class extends u7{constructor(){super({},"facetCircle")}}),y7=(g7=e([y([{type:"value",name:"data"},{type:"array",name:"transform"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"legend"},{type:"object",name:"axis"},...SN(c7)])],g7),class extends u7{constructor(){super({},"repeatMatrix")}}),m7=(y7=e([y([{type:"value",name:"data"},{type:"array",name:"transform"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"encode"},{type:"object",name:"legend"},...SN(c7)])],y7),class extends u7{constructor(){super({},"timingKeyframe")}}),v7=(m7=e([y([...SN(c7)])],m7),class extends u7{constructor(){super({},"geoView")}}),b7=(v7=e([y([{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"},...SN(c7)])],v7),class extends u7{constructor(){super({},"geoPath")}});b7=e([y([{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"},...SN(c7)])],b7);const x7={view:h7,spaceLayer:f7,spaceFlex:d7,facetRect:p7,facetCircle:g7,repeatMatrix:y7,timingKeyframe:m7,geoView:v7,geoPath:b7};for(const C7 of Object.values(x7))y(SN(x7))(C7);const w7=WP();const M7=t=>t?parseInt(t):0;const k7=["width","height","padding","paddingLeft","paddingRight","paddingBottom","paddingTop","inset","insetLeft","insetRight","insetTop","insetBottom","margin","marginLeft","marginRight","marginTop","marginBottom","autoFit","theme","title"];function O7(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function E7(t,e){var n,r=t["autoFit"];return r?(r=e,e=getComputedStyle(r),n=r.clientWidth||M7(e.width),r=r.clientHeight||M7(e.height),{width:n-(M7(e.paddingLeft)+M7(e.paddingRight)),height:r-(M7(e.paddingTop)+M7(e.paddingBottom))}):({width:n=640,height:r=480}=t,{width:n,height:r})}function S7(t){var t=function(t){if(null!==t.type)return t;var e=t.children[t.children.length-1];for(const n of k7)e.attr(n,t.attr(n));return e}(t),e=[t],n=new Map;for(n.set(t,O7(t));e.length;){const t=e.pop();var r=n.get(t),{children:i=[]}=t;for(const s of i){var a=O7(s),{children:o=[]}=r;o.push(a),e.push(s),n.set(s,a),r.children=o}}return n.get(t)}function A7(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(c7)).has(t))return e;var r={type:"view"},i=Object.assign({},e);for(const a of k7)void 0!==i[a]&&(r[a]=i[a],delete i[a]);return Object.assign(Object.assign({},r),{children:[i]})}function _7(t){var e=t["type"],t=at(t,["type","children"]),n=new(function(t){if("function"==typeof t)return c7.mark;var e=Object.assign(Object.assign({},c7),x7)[t];if(e)return e;throw new Error(`Unknown mark: ${t}.`)}(e));return n.value=t,n.type=e,n}function T7(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];Be(a)&&Be(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 P7(t,e,n){for(var r=[[null,t,A7(t,e,n)]];r.length;){var[i,a,o]=r.shift();if(a)if(o){T7(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=_7(m),y=(Array.isArray(f.children)&&f.push(g),m)["children"];if(Array.isArray(y))for(const v of y)p.push([g,v])}}}}Uo=[{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"},...SN(c7),...(Qs=x7,Object.entries(Qs).map(([t,e])=>({type:"container",name:t,ctor:e})))];E.Chart=class extends h7{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=Je(()=>{this.forceFit()},300),this._renderer=r||new nd,this._plugins=i||[],this._container=void 0===(t=e)?document.createElement("div"):"string"==typeof t?document.getElementById(t):t,this._emitter=new cd,this._context={library:w7,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)=>wN(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?S7(this):(e=t["type"],e&&(this._previousDefinedType=e),P7(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(v3.BEFORE_CLEAR),this._reset(),MN(0,this._context,!1),this.emit(v3.AFTER_CLEAR)}destroy(){var t,e;this.options();this.emit(v3.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),MN(0,this._context,!0),t=this._container,(e=t.parentNode)&&e.removeChild(t),this.emit(v3.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;var{width:t,height:e}=E7(this.options(),this._container);if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(v3.BEFORE_CHANGE_SIZE);t=this.render();return t.then(()=>{this.emit(v3.AFTER_CHANGE_SIZE)}),t}changeSize(t,e){if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(v3.BEFORE_CHANGE_SIZE),this.width(t),this.height(e);t=this.render();return t.then(()=>{this.emit(v3.AFTER_CHANGE_SIZE)}),t}_reset(){const e=["theme","type","width","height","autoFit"];this.type="view",this.value=Object.fromEntries(Object.entries(this.value).filter(([t])=>t.startsWith("margin")||t.startsWith("padding")||t.startsWith("inset")||e.includes(t))),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}=E7(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}=E7(this.options(),this._container);this._plugins.push(new sd),this._plugins.forEach(t=>this._renderer.registerPlugin(t)),this._context.canvas=new ou({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))}},E.Chart=e([y(Uo)],E.Chart),_.enableCSSParsing=!1,E.AREA_CLASS_NAME=kh,E.COMPONENT_CLASS_NAME=wh,E.ChartEvent=v3,E.CompositionNode=u7,E.ELEMENT_CLASS_NAME=vh,E.LABEL_CLASS_NAME=Mh,E.LABEL_LAYER_CLASS_NAME=mh,E.MAIN_LAYER_CLASS_NAME=yh,E.MarkNode=TN,E.PLOT_CLASS_NAME=xh,E.VIEW_CLASS_NAME=bh,E.createLibrary=WP,E.register=function(t,e){Object.assign(w7,{[t]:e})},E.render=wN,E.renderToMountedElement=function(t,e={},n=()=>{},r=t=>{throw t}){var{width:i=640,height:a=480}=t,t=xN(t);const{library:o=WP(),group:s=new hc,emitter:l=new cd}=e;null!==s&&void 0!==s&&s.parentElement||Eg("renderToMountedElement can't render chart to unmounted group.");var c=lt(s);return e.group=s,e.library=o,(e.emitter=l).emit(v3.BEFORE_RENDER),nN(Object.assign(Object.assign({},t),{width:i,height:a}),c,o,e).then(()=>{s.ownerDocument.defaultView.requestAnimationFrame(()=>{l.emit(v3.AFTER_RENDER),null!=n&&n()})}).catch(t=>{null!=r&&r(t)}),s},Object.defineProperty(E,"__esModule",{value:!0})});