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).F2={})}(this,(function(t){"use strict";var e=function(t,n){return e=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])},e(t,n)};function n(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+n+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r=function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;r>n;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},r.apply(this,arguments)};function i(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&0>e.indexOf(r)&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);r.length>i;i++)0>e.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function o(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))}function a(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&i[3]>s[1])){a.label=s[1];break}if(6===s[0]&&i[1]>a.label){a.label=i[1],i=s;break}if(i&&i[2]>a.label){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}function s(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function l(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;o>i;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var c=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},h=function(t){return"function"==typeof t},p=function(t){return null==t},f={}.toString,d=function(t,e){return f.call(t)==="[object "+e+"]"},y=function(t){return Array.isArray?Array.isArray(t):d(t,"Array")},v=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e};function g(t,e){if(t)if(y(t))for(var n=0,r=t.length;r>n&&!1!==e(t[n],n);n++);else if(v(t))for(var i in t)if(t.hasOwnProperty(i)&&!1===e(t[i],i))break}var m=Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];return g(t,(function(n,r){h(t)&&"prototype"===r||e.push(r)})),e};var x=function(t){return"object"==typeof t&&null!==t},b=function(t){if(!x(t)||!d(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};function M(t,e){if(!y(t))return null;var n;if(h(e)&&(n=e),b(e)&&(n=function(t){return function(t,e){var n=m(e),r=n.length;if(p(t))return!r;for(var i=0;r>i;i+=1){var o=n[i];if(e[o]!==t[o]||!(o in t))return!1}return!0}(t,e)}),n)for(var r=0;t.length>r;r+=1)if(n(t[r]))return t[r];return null}var w=function(t){if(!y(t))return[];for(var e=[],n=0;t.length>n;n++)e=e.concat(t[n]);return e},E=function(t){if(y(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},k=function(t){if(y(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},S=function(t){var e=t.filter((function(t){return!isNaN(t)}));if(!e.length)return{min:0,max:0};if(y(t[0])){for(var n=[],r=0;t.length>r;r++)n=n.concat(t[r]);e=n}var i=E(e);return{min:k(e),max:i}},P=function(t){return d(t,"String")},T=function(t,e){for(var n=[],r={},i=0;t.length>i;i++){var o=t[i][e];if(!p(o)){y(o)||(o=[o]);for(var a=0;o.length>a;a++){var s=o[a];r[s]||(n.push(s),r[s]=!0)}}}return n};function N(t){if(c(t))return t[0]}function C(t){if(c(t)){return t[t.length-1]}}var A=Object.prototype.hasOwnProperty;function O(t,e){if(!e||!y(t))return{};for(var n,r={},i=h(e)?e:function(t){return t[e]},o=0;t.length>o;o++){var a=t[o];n=i(a),A.call(r,n)?r[n].push(a):r[n]=[a]}return r}function R(t,e){if(!e)return{0:t};if(!h(e)){var n=y(e)?e:e.replace(/\s+/g,"").split("*");e=function(t){for(var e="_",r=0,i=n.length;i>r;r++)e+=t[n[r]]&&""+t[n[r]];return e}}return O(t,e)}var L=function(t,e,n){return e>t?e:t>n?n:t},_=function(t){return d(t,"Number")},I=1e-5;function D(t,e,n){return void 0===n&&(n=I),n>Math.abs(t-e)}var F=function(t,e){return(t%e+e)%e},B=function(t){var e=function(t){return p(t)?"":""+t}(t);return e.charAt(0).toUpperCase()+e.substring(1)},j={}.toString,G=function(t){return d(t,"Boolean")},Y=function(t){return d(t,"Date")},V=Object.prototype,W=function(t){return void 0===t};function X(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}function z(t,e,n,r){return e&&X(t,e),n&&X(t,n),r&&X(t,r),t}var U=function(t){if("object"!=typeof t||null===t)return t;var e;if(y(t)){e=[];for(var n=0,r=t.length;r>n;n++)e[n]="object"==typeof t[n]&&null!=t[n]?U(t[n]):t[n]}else for(var i in e={},t)e[i]="object"==typeof t[i]&&null!=t[i]?U(t[i]):t[i];return e};function H(t,e){if(Object.hasOwn)return Object.hasOwn(t,e);if(null==t)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(t),e)}function q(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(H(e,i)){var o=e[i];null!==o&&b(o)?(b(t[i])||(t[i]={}),r>n?q(t[i],o,n+1,r):t[i]=e[i]):y(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}var Z=function(t){for(var e=[],n=1;arguments.length>n;n++)e[n-1]=arguments[n];for(var r=0;e.length>r;r+=1)q(t,e[r]);return t},K=Object.prototype.hasOwnProperty;function $(t){if(p(t))return!0;if(c(t))return!t.length;var e=function(t){return j.call(t).replace(/^\[object /,"").replace(/]$/,"")}(t);if("Map"===e||"Set"===e)return!t.size;if(function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||V)}(t))return!Object.keys(t).length;for(var n in t)if(K.call(t,n))return!1;return!0}var J=function(t,e){if(t===e)return!0;if(!t||!e)return!1;if(P(t)||P(e))return!1;if(c(t)||c(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;t.length>r&&(n=J(t[r],e[r]));r++);return n}if(x(t)||x(e)){var i=Object.keys(t);if(i.length!==Object.keys(e).length)return!1;for(n=!0,r=0;i.length>r&&(n=J(t[i[r]],e[i[r]]));r++);return n}return!1},Q=function(t,e){if(!c(t))return t;for(var n=[],r=0;t.length>r;r++){n.push(e(t[r],r))}return n},tt=function(t){return t},et=function(t,e,n){for(var r=0,i=P(e)?e.split("."):e;t&&i.length>r;)t=t[i[r++]];return void 0===t||i.length>r?n:t},nt=Object.prototype.hasOwnProperty,rt=function(t,e){if(null===t||!b(t))return{};var n={};return g(e,(function(e){nt.call(t,e)&&(n[e]=t[e])})),n},it=function(t,e){return function(t,e,n){if(!y(t)&&!b(t))return t;var r=n;return g(t,(function(t,n){r=e(r,t,n)})),r}(t,(function(t,n,r){return e.includes(r)||(t[r]=n),t}),{})},ot=function(){function t(){this.map={}}return t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var n=this.map[t];return void 0===n?e:n},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length},t}(),at=1e-6,st="undefined"!=typeof Float32Array?Float32Array:Array;function ut(){var t=new st(9);return st!=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}function lt(){var t=new st(16);return st!=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 ct(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 ht(t,e,n,r,i,o,a,s,u,l,c,h,p,f,d,y,v){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=l,t[9]=c,t[10]=h,t[11]=p,t[12]=f,t[13]=d,t[14]=y,t[15]=v,t}function pt(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 ft(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=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]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else 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];return t}function dt(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=e[9],p=e[10],f=e[11],d=e[12],y=e[13],v=e[14],g=e[15],m=n*s-r*a,x=n*u-i*a,b=n*l-o*a,M=r*u-i*s,w=r*l-o*s,E=i*l-o*u,k=c*y-h*d,S=c*v-p*d,P=c*g-f*d,T=h*v-p*y,N=h*g-f*y,C=p*g-f*v,A=m*C-x*N+b*T+M*P-w*S+E*k;return A?(t[0]=(s*C-u*N+l*T)*(A=1/A),t[1]=(i*N-r*C-o*T)*A,t[2]=(y*E-v*w+g*M)*A,t[3]=(p*w-h*E-f*M)*A,t[4]=(u*P-a*C-l*S)*A,t[5]=(n*C-i*P+o*S)*A,t[6]=(v*b-d*E-g*x)*A,t[7]=(c*E-p*b+f*x)*A,t[8]=(a*N-s*P+l*k)*A,t[9]=(r*P-n*N-o*k)*A,t[10]=(d*w-y*b+g*m)*A,t[11]=(h*b-c*w-f*m)*A,t[12]=(s*S-a*T-u*k)*A,t[13]=(n*T-r*S+i*k)*A,t[14]=(y*x-d*M-v*m)*A,t[15]=(c*M-h*x+p*m)*A,t):null}function yt(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],l=t[8],c=t[9],h=t[10],p=t[11],f=t[12],d=t[13],y=t[14],v=t[15];return(e*a-n*o)*(h*v-p*y)-(e*s-r*o)*(c*v-p*d)+(e*u-i*o)*(c*y-h*d)+(n*s-r*a)*(l*v-p*f)-(n*u-i*a)*(l*y-h*f)+(r*u-i*s)*(l*d-c*f)}function vt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],p=e[9],f=e[10],d=e[11],y=e[12],v=e[13],g=e[14],m=e[15],x=n[0],b=n[1],M=n[2],w=n[3];return t[0]=x*r+b*s+M*h+w*y,t[1]=x*i+b*u+M*p+w*v,t[2]=x*o+b*l+M*f+w*g,t[3]=x*a+b*c+M*d+w*m,t[4]=(x=n[4])*r+(b=n[5])*s+(M=n[6])*h+(w=n[7])*y,t[5]=x*i+b*u+M*p+w*v,t[6]=x*o+b*l+M*f+w*g,t[7]=x*a+b*c+M*d+w*m,t[8]=(x=n[8])*r+(b=n[9])*s+(M=n[10])*h+(w=n[11])*y,t[9]=x*i+b*u+M*p+w*v,t[10]=x*o+b*l+M*f+w*g,t[11]=x*a+b*c+M*d+w*m,t[12]=(x=n[12])*r+(b=n[13])*s+(M=n[14])*h+(w=n[15])*y,t[13]=x*i+b*u+M*p+w*v,t[14]=x*o+b*l+M*f+w*g,t[15]=x*a+b*c+M*d+w*m,t}function gt(t,e,n){var r,i,o,a,s,u,l,c,h,p,f,d,y=n[0],v=n[1],g=n[2];return e===t?(t[12]=e[0]*y+e[4]*v+e[8]*g+e[12],t[13]=e[1]*y+e[5]*v+e[9]*g+e[13],t[14]=e[2]*y+e[6]*v+e[10]*g+e[14],t[15]=e[3]*y+e[7]*v+e[11]*g+e[15]):(i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],p=e[9],f=e[10],d=e[11],t[0]=r=e[0],t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=l,t[7]=c,t[8]=h,t[9]=p,t[10]=f,t[11]=d,t[12]=r*y+s*v+h*g+e[12],t[13]=i*y+u*v+p*g+e[13],t[14]=o*y+l*v+f*g+e[14],t[15]=a*y+c*v+d*g+e[15]),t}function mt(t,e,n){var r=n[0],i=n[1],o=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]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function xt(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],u=e[7],l=e[8],c=e[9],h=e[10],p=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]=o*i+l*r,t[5]=a*i+c*r,t[6]=s*i+h*r,t[7]=u*i+p*r,t[8]=l*i-o*r,t[9]=c*i-a*r,t[10]=h*i-s*r,t[11]=p*i-u*r,t}function bt(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],l=e[8],c=e[9],h=e[10],p=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]=o*i-l*r,t[1]=a*i-c*r,t[2]=s*i-h*r,t[3]=u*i-p*r,t[8]=o*r+l*i,t[9]=a*r+c*i,t[10]=s*r+h*i,t[11]=u*r+p*i,t}function Mt(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function wt(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 Et(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=r+r,u=i+i,l=o+o,c=r*s,h=r*u,p=r*l,f=i*u,d=i*l,y=o*l,v=a*s,g=a*u,m=a*l;return t[0]=1-(f+y),t[1]=h+m,t[2]=p-g,t[3]=0,t[4]=h-m,t[5]=1-(c+y),t[6]=d+v,t[7]=0,t[8]=p+g,t[9]=d-v,t[10]=1-(c+f),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function kt(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function St(t,e){var n=e[4],r=e[5],i=e[6],o=e[8],a=e[9],s=e[10];return t[0]=Math.hypot(e[0],e[1],e[2]),t[1]=Math.hypot(n,r,i),t[2]=Math.hypot(o,a,s),t}function Pt(t,e){var n=new st(3);St(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,s=e[1]*i,u=e[2]*o,l=e[4]*r,c=e[5]*i,h=e[6]*o,p=e[8]*r,f=e[9]*i,d=e[10]*o,y=a+c+d,v=0;return y>0?(t[3]=.25*(v=2*Math.sqrt(y+1)),t[0]=(h-f)/v,t[1]=(p-u)/v,t[2]=(s-l)/v):a>c&&a>d?(t[3]=(h-f)/(v=2*Math.sqrt(1+a-c-d)),t[0]=.25*v,t[1]=(s+l)/v,t[2]=(p+u)/v):c>d?(t[3]=(p-u)/(v=2*Math.sqrt(1+c-a-d)),t[0]=(s+l)/v,t[1]=.25*v,t[2]=(h+f)/v):(t[3]=(s-l)/(v=2*Math.sqrt(1+d-a-c)),t[0]=(p+u)/v,t[1]=(h+f)/v,t[2]=.25*v),t}function Tt(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],u=e[3],l=o+o,c=a+a,h=s+s,p=o*l,f=o*c,d=o*h,y=a*c,v=a*h,g=s*h,m=u*l,x=u*c,b=u*h,M=r[0],w=r[1],E=r[2],k=i[0],S=i[1],P=i[2],T=(1-(y+g))*M,N=(f+b)*M,C=(d-x)*M,A=(f-b)*w,O=(1-(p+g))*w,R=(v+m)*w,L=(d+x)*E,_=(v-m)*E,I=(1-(p+y))*E;return t[0]=T,t[1]=N,t[2]=C,t[3]=0,t[4]=A,t[5]=O,t[6]=R,t[7]=0,t[8]=L,t[9]=_,t[10]=I,t[11]=0,t[12]=n[0]+k-(T*k+A*S+L*P),t[13]=n[1]+S-(N*k+O*S+_*P),t[14]=n[2]+P-(C*k+R*S+I*P),t[15]=1,t}function Nt(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,l=n*a,c=r*a,h=r*s,p=i*a,f=i*s,d=i*u,y=o*a,v=o*s,g=o*u;return t[0]=1-h-d,t[1]=c+g,t[2]=p-v,t[3]=0,t[4]=c-g,t[5]=1-l-d,t[6]=f+y,t[7]=0,t[8]=p+v,t[9]=f-y,t[10]=1-l-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ct(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,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)*(o=1/(r-i)),t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t}function At(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=(a+o)*l,t[15]=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 Ot=At;function Rt(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=o*l,t[15]=1,t}function Lt(t,e,n,r){var i,o,a,s,u,l,c,h,p,f,d=e[0],y=e[1],v=e[2],g=r[0],m=r[1],x=r[2],b=n[0],M=n[1],w=n[2];return at>Math.abs(d-b)&&at>Math.abs(y-M)&&at>Math.abs(v-w)?pt(t):(f=1/Math.hypot(c=d-b,h=y-M,p=v-w),(f=Math.hypot(i=m*(p*=f)-x*(h*=f),o=x*(c*=f)-g*p,a=g*h-m*c))?(i*=f=1/f,o*=f,a*=f):(i=0,o=0,a=0),(f=Math.hypot(s=h*a-p*o,u=p*i-c*a,l=c*o-h*i))?(s*=f=1/f,u*=f,l*=f):(s=0,u=0,l=0),t[0]=i,t[1]=s,t[2]=c,t[3]=0,t[4]=o,t[5]=u,t[6]=h,t[7]=0,t[8]=a,t[9]=l,t[10]=p,t[11]=0,t[12]=-(i*d+o*y+a*v),t[13]=-(s*d+u*y+l*v),t[14]=-(c*d+h*y+p*v),t[15]=1,t)}function _t(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 It=Object.freeze({__proto__:null,create:lt,clone:function(t){var e=new st(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},copy:ct,fromValues:function(t,e,n,r,i,o,a,s,u,l,c,h,p,f,d,y){var v=new st(16);return v[0]=t,v[1]=e,v[2]=n,v[3]=r,v[4]=i,v[5]=o,v[6]=a,v[7]=s,v[8]=u,v[9]=l,v[10]=c,v[11]=h,v[12]=p,v[13]=f,v[14]=d,v[15]=y,v},set:ht,identity:pt,transpose:ft,invert:dt,adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=e[9],p=e[10],f=e[11],d=e[12],y=e[13],v=e[14],g=e[15];return t[0]=s*(p*g-f*v)-h*(u*g-l*v)+y*(u*f-l*p),t[1]=-(r*(p*g-f*v)-h*(i*g-o*v)+y*(i*f-o*p)),t[2]=r*(u*g-l*v)-s*(i*g-o*v)+y*(i*l-o*u),t[3]=-(r*(u*f-l*p)-s*(i*f-o*p)+h*(i*l-o*u)),t[4]=-(a*(p*g-f*v)-c*(u*g-l*v)+d*(u*f-l*p)),t[5]=n*(p*g-f*v)-c*(i*g-o*v)+d*(i*f-o*p),t[6]=-(n*(u*g-l*v)-a*(i*g-o*v)+d*(i*l-o*u)),t[7]=n*(u*f-l*p)-a*(i*f-o*p)+c*(i*l-o*u),t[8]=a*(h*g-f*y)-c*(s*g-l*y)+d*(s*f-l*h),t[9]=-(n*(h*g-f*y)-c*(r*g-o*y)+d*(r*f-o*h)),t[10]=n*(s*g-l*y)-a*(r*g-o*y)+d*(r*l-o*s),t[11]=-(n*(s*f-l*h)-a*(r*f-o*h)+c*(r*l-o*s)),t[12]=-(a*(h*v-p*y)-c*(s*v-u*y)+d*(s*p-u*h)),t[13]=n*(h*v-p*y)-c*(r*v-i*y)+d*(r*p-i*h),t[14]=-(n*(s*v-u*y)-a*(r*v-i*y)+d*(r*u-i*s)),t[15]=n*(s*p-u*h)-a*(r*p-i*h)+c*(r*u-i*s),t},determinant:yt,multiply:vt,translate:gt,scale:mt,rotate:function(t,e,n,r){var i,o,a,s,u,l,c,h,p,f,d,y,v,g,m,x,b,M,w,E,k,S,P,T,N=r[0],C=r[1],A=r[2],O=Math.hypot(N,C,A);return at>O?null:(N*=O=1/O,C*=O,A*=O,i=Math.sin(n),u=e[1],l=e[2],c=e[3],p=e[5],f=e[6],d=e[7],v=e[9],g=e[10],m=e[11],w=N*C*(a=1-(o=Math.cos(n)))-A*i,E=C*C*a+o,k=A*C*a+N*i,S=N*A*a+C*i,P=C*A*a-N*i,T=A*A*a+o,t[0]=(s=e[0])*(x=N*N*a+o)+(h=e[4])*(b=C*N*a+A*i)+(y=e[8])*(M=A*N*a-C*i),t[1]=u*x+p*b+v*M,t[2]=l*x+f*b+g*M,t[3]=c*x+d*b+m*M,t[4]=s*w+h*E+y*k,t[5]=u*w+p*E+v*k,t[6]=l*w+f*E+g*k,t[7]=c*w+d*E+m*k,t[8]=s*S+h*P+y*T,t[9]=u*S+p*P+v*T,t[10]=l*S+f*P+g*T,t[11]=c*S+d*P+m*T,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:xt,rotateY:bt,rotateZ:function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],l=e[4],c=e[5],h=e[6],p=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]=o*i+l*r,t[1]=a*i+c*r,t[2]=s*i+h*r,t[3]=u*i+p*r,t[4]=l*i-o*r,t[5]=c*i-a*r,t[6]=h*i-s*r,t[7]=p*i-u*r,t},fromTranslation:Mt,fromScaling:wt,fromRotation:function(t,e,n){var r,i,o,a=n[0],s=n[1],u=n[2],l=Math.hypot(a,s,u);return at>l?null:(a*=l=1/l,s*=l,u*=l,r=Math.sin(e),t[0]=a*a*(o=1-(i=Math.cos(e)))+i,t[1]=s*a*o+u*r,t[2]=u*a*o-s*r,t[3]=0,t[4]=a*s*o-u*r,t[5]=s*s*o+i,t[6]=u*s*o+a*r,t[7]=0,t[8]=a*u*o+s*r,t[9]=s*u*o-a*r,t[10]=u*u*o+i,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),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,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),r=Math.cos(e);return t[0]=r,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]=r,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),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,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:Et,fromQuat2:function(t,e){var n=new st(3),r=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=r*r+i*i+o*o+a*a;return h>0?(n[0]=2*(s*a+c*r+u*o-l*i)/h,n[1]=2*(u*a+c*i+l*r-s*o)/h,n[2]=2*(l*a+c*o+s*i-u*r)/h):(n[0]=2*(s*a+c*r+u*o-l*i),n[1]=2*(u*a+c*i+l*r-s*o),n[2]=2*(l*a+c*o+s*i-u*r)),Et(t,e,n),t},getTranslation:kt,getScaling:St,getRotation:Pt,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],u=i+i,l=o+o,c=a+a,h=i*u,p=i*l,f=i*c,d=o*l,y=o*c,v=a*c,g=s*u,m=s*l,x=s*c,b=r[0],M=r[1],w=r[2];return t[0]=(1-(d+v))*b,t[1]=(p+x)*b,t[2]=(f-m)*b,t[3]=0,t[4]=(p-x)*M,t[5]=(1-(h+v))*M,t[6]=(y+g)*M,t[7]=0,t[8]=(f+m)*w,t[9]=(y-g)*w,t[10]=(1-(h+d))*w,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:Tt,fromQuat:Nt,frustum:function(t,e,n,r,i,o,a){var s=1/(n-e),u=1/(i-r),l=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*u,t[10]=(a+o)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*l,t[15]=0,t},perspectiveNO:Ct,perspective:Ct,perspectiveZO:function(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,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*(o=1/(r-i)),t[14]=i*r*o):(t[10]=-1,t[14]=-r),t},perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+s),l=2/(i+o);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(a-s)*u*.5,t[9]=(i-o)*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:At,ortho:Ot,orthoZO:Rt,lookAt:Lt,targetTo:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=r[0],u=r[1],l=r[2],c=i-n[0],h=o-n[1],p=a-n[2],f=c*c+h*h+p*p;f>0&&(c*=f=1/Math.sqrt(f),h*=f,p*=f);var d=u*p-l*h,y=l*c-s*p,v=s*h-u*c;return(f=d*d+y*y+v*v)>0&&(d*=f=1/Math.sqrt(f),y*=f,v*=f),t[0]=d,t[1]=y,t[2]=v,t[3]=0,t[4]=h*v-p*y,t[5]=p*d-c*v,t[6]=c*y-h*d,t[7]=0,t[8]=c,t[9]=h,t[10]=p,t[11]=0,t[12]=i,t[13]=o,t[14]=a,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:_t,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],o=t[3],a=t[4],s=t[5],u=t[6],l=t[7],c=t[8],h=t[9],p=t[10],f=t[11],d=t[12],y=t[13],v=t[14],g=t[15],m=e[0],x=e[1],b=e[2],M=e[3],w=e[4],E=e[5],k=e[6],S=e[7],P=e[8],T=e[9],N=e[10],C=e[11],A=e[12],O=e[13],R=e[14],L=e[15];return!(Math.abs(n-m)>at*Math.max(1,Math.abs(n),Math.abs(m))||Math.abs(r-x)>at*Math.max(1,Math.abs(r),Math.abs(x))||Math.abs(i-b)>at*Math.max(1,Math.abs(i),Math.abs(b))||Math.abs(o-M)>at*Math.max(1,Math.abs(o),Math.abs(M))||Math.abs(a-w)>at*Math.max(1,Math.abs(a),Math.abs(w))||Math.abs(s-E)>at*Math.max(1,Math.abs(s),Math.abs(E))||Math.abs(u-k)>at*Math.max(1,Math.abs(u),Math.abs(k))||Math.abs(l-S)>at*Math.max(1,Math.abs(l),Math.abs(S))||Math.abs(c-P)>at*Math.max(1,Math.abs(c),Math.abs(P))||Math.abs(h-T)>at*Math.max(1,Math.abs(h),Math.abs(T))||Math.abs(p-N)>at*Math.max(1,Math.abs(p),Math.abs(N))||Math.abs(f-C)>at*Math.max(1,Math.abs(f),Math.abs(C))||Math.abs(d-A)>at*Math.max(1,Math.abs(d),Math.abs(A))||Math.abs(y-O)>at*Math.max(1,Math.abs(y),Math.abs(O))||Math.abs(v-R)>at*Math.max(1,Math.abs(v),Math.abs(R))||Math.abs(g-L)>at*Math.max(1,Math.abs(g),Math.abs(L)))},mul:vt,sub:_t});function Dt(){var t=new st(3);return st!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Ft(t){return Math.hypot(t[0],t[1],t[2])}function Bt(t,e,n){var r=new st(3);return r[0]=t,r[1]=e,r[2]=n,r}function jt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Gt(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function Yt(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function Vt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function Wt(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function Xt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function zt(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=i*u-o*s,t[1]=o*a-r*u,t[2]=r*s-i*a,t}function Ut(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/(a=a||1),t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function Ht(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2];return at*Math.max(1,Math.abs(n),Math.abs(o))>=Math.abs(n-o)&&at*Math.max(1,Math.abs(r),Math.abs(a))>=Math.abs(r-a)&&at*Math.max(1,Math.abs(i),Math.abs(s))>=Math.abs(i-s)}var qt,Zt=Ft;qt=Dt();function Kt(){var t=new st(4);return st!=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],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}!function(){var t=Kt()}();function Jt(){var t=new st(4);return st!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Qt(t,e,n){var r=Math.sin(n*=.5);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function te(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],u=n[1],l=n[2],c=n[3];return t[0]=r*c+a*s+i*l-o*u,t[1]=i*c+a*u+o*s-r*l,t[2]=o*c+a*l+r*u-i*s,t[3]=a*c-r*s-i*u-o*l,t}function ee(t,e,n,r){var i,o,a,s,u,l=e[0],c=e[1],h=e[2],p=e[3],f=n[0],d=n[1],y=n[2],v=n[3];return 0>(o=l*f+c*d+h*y+p*v)&&(o=-o,f=-f,d=-d,y=-y,v=-v),1-o>at?(a=Math.sin(i=Math.acos(o)),s=Math.sin((1-r)*i)/a,u=Math.sin(r*i)/a):(s=1-r,u=r),t[0]=s*l+u*f,t[1]=s*c+u*d,t[2]=s*h+u*y,t[3]=s*p+u*v,t}function ne(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,t}function re(t,e,n,r){var i=.5*Math.PI/180;n*=i,r*=i;var o=Math.sin(e*=i),a=Math.cos(e),s=Math.sin(n),u=Math.cos(n),l=Math.sin(r),c=Math.cos(r);return t[0]=o*u*c-a*s*l,t[1]=a*s*c+o*u*l,t[2]=a*u*l-o*s*c,t[3]=a*u*c+o*s*l,t}var ie,oe,ae,se,ue,le,ce=function(t,e,n,r){var i=new st(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},he=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},pe=te,fe=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t};ie=Dt(),oe=Bt(1,0,0),ae=Bt(0,1,0),se=Jt(),ue=Jt(),le=ut();function de(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function ye(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}function ve(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}function ge(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function me(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1])}function xe(t){return Math.hypot(t[0],t[1])}var be=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t};!function(){var t,e=(t=new st(2),st!=Float32Array&&(t[0]=0,t[1]=0),t)}();function Me(t,e){return void 0===e&&(e="off"),function(t,e){if("off"===e)return[].concat(t);var n="number"!=typeof e||1>e?1:Math.pow(10,e);return t.map((function(t){var r=t.slice(1).map(Number).map((function(t){return e?Math.round(t*n)/n:Math.round(t)}));return[t[0]].concat(r)}))}(t,e).map((function(t){return t[0]+t.slice(1).join(" ")})).join("")}var we={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function Ee(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],i=n;r.length;)e[n]="A",t.splice(i+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var ke={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Se(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return ke[e]===t.length-1&&"achlmqstvz".includes(e)}))}function Pe(t){return Se(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function Te(t){return Pe(t)&&t.every((function(t){return"ACLMQZ".includes(t[0])}))}function Ne(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=ke[n]&&("m"===n&&r.length>2?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,ke[n]))),ke[n]););}function Ce(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'+n[e]+'", expecting 0 or 1 at index '+e)}function Ae(t){return t>=48&&57>=t||43===t||45===t||46===t}function Oe(t){return t>=48&&57>=t}function Re(t){var e,n=t.max,r=t.pathValue,i=t.index,o=i,a=!1,s=!1,u=!1,l=!1;if(n>o)if(43!==(e=r.charCodeAt(o))&&45!==e||(e=r.charCodeAt(o+=1)),Oe(e)||46===e){if(46!==e){if(a=48===e,e=r.charCodeAt(o+=1),a&&n>o&&e&&Oe(e))return void(t.err="[path-util]: Invalid path value at index "+i+', "'+r[i]+'" illegal number');for(;n>o&&Oe(r.charCodeAt(o));)o+=1,s=!0;e=r.charCodeAt(o)}if(46===e){for(l=!0,o+=1;Oe(r.charCodeAt(o));)o+=1,u=!0;e=r.charCodeAt(o)}if(101===e||69===e){if(l&&!s&&!u)return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid float exponent');if(43!==(e=r.charCodeAt(o+=1))&&45!==e||(o+=1),o>=n||!Oe(r.charCodeAt(o)))return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid integer exponent');for(;n>o&&Oe(r.charCodeAt(o));)o+=1}t.index=o,t.param=+t.pathValue.slice(i,o)}else t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" is not a number';else t.err="[path-util]: Invalid path value at index "+o+', "pathValue" is missing param'}function Le(t){for(var e,n=t.pathValue,r=t.max;r>t.index&&(10===(e=n.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function _e(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),o=ke[n[r].toLowerCase()];if(t.segmentStart=r,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!0;default:return!1}}(i))if(t.index+=1,Le(t),t.data=[],o){for(;;){for(var a=o;a>0;a-=1){if(97!=(32|i)||3!==a&&4!==a?Re(t):Ce(t),t.err.length)return;t.data.push(t.param),Le(t),e>t.index&&44===n.charCodeAt(t.index)&&(t.index+=1,Le(t))}if(t.index>=t.max)break;if(!Ae(n.charCodeAt(t.index)))break}Ne(t)}else Ne(t);else t.err='[path-util]: Invalid path value "'+n[r]+'" is not a path command'}var Ie=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 De(t){if(Pe(t))return[].concat(t);var e=function(t){if(Se(t))return[].concat(t);var e=new Ie(t);for(Le(e);e.max>e.index&&!e.err.length;)_e(e);return e.err?e.err:e.segments}(t),n=0,r=0,i=0,o=0;return e.map((function(t){var e,a=t.slice(1).map(Number),s=t[0],u=s.toUpperCase();if("M"===s)return i=n=a[0],o=r=a[1],["M",n,r];if(s!==u)switch(u){case"A":e=[u,a[0],a[1],a[2],a[3],a[4],a[5]+n,a[6]+r];break;case"V":e=[u,a[0]+r];break;case"H":e=[u,a[0]+n];break;default:var l=a.map((function(t,e){return t+(e%2?r:n)}));e=[u].concat(l)}else e=[u].concat(a);var c=e.length;switch(u){case"Z":n=i,r=o;break;case"H":n=e[1];break;case"V":r=e[1];break;default:n=e[c-2],r=e[c-1],"M"===u&&(i=n,o=r)}return e}))}function Fe(t,e){var n=t[0],r=e.x1,i=e.y1,o=e.x2,a=e.y2,s=t.slice(1).map(Number),u=t;if("TQ".includes(n)||(e.qx=null,e.qy=null),"H"===n)u=["L",t[1],i];else if("V"===n)u=["L",r,t[1]];else if("S"===n){var l=2*r-o,c=2*i-a;e.x1=l,e.y1=c,u=["C",l,c].concat(s)}else if("T"===n){var h=2*r-e.qx,p=2*i-e.qy;e.qx=h,e.qy=p,u=["Q",h,p].concat(s)}else if("Q"===n){var f=s[1];e.qx=s[0],e.qy=f}return u}function Be(t){if(Te(t))return[].concat(t);for(var e=De(t),n=r({},we),i=0;e.length>i;i+=1){e[i]=Fe(e[i],n);var o=e[i],a=o.length;n.x1=+o[a-2],n.y1=+o[a-1],n.x2=+o[a-4]||n.x1,n.y2=+o[a-3]||n.y1}return e}function je(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function Ge(t,e,n,r,i,o,a,s,u,l){var c,h,p,f,d,y=t,v=e,g=n,m=r,x=s,b=u,M=120*Math.PI/180,w=Math.PI/180*(+i||0),E=[];if(l)h=l[0],p=l[1],f=l[2],d=l[3];else{v=(c=je(y,v,-w)).y;var k=((y=c.x)-(x=(c=je(x,b,-w)).x))/2,S=(v-(b=c.y))/2,P=k*k/(g*g)+S*S/(m*m);P>1&&(g*=P=Math.sqrt(P),m*=P);var T=g*g,N=m*m,C=(o===a?-1:1)*Math.sqrt(Math.abs((T*N-T*S*S-N*k*k)/(T*S*S+N*k*k)));f=C*g*S/m+(y+x)/2,h=Math.asin(((v-(d=C*-m*k/g+(v+b)/2))/m*1e9>>0)/1e9),p=Math.asin(((b-d)/m*1e9>>0)/1e9),0>(h=f>y?Math.PI-h:h)&&(h=2*Math.PI+h),0>(p=f>x?Math.PI-p:p)&&(p=2*Math.PI+p),a&&h>p&&(h-=2*Math.PI),!a&&p>h&&(p-=2*Math.PI)}var A=p-h;if(Math.abs(A)>M){var O=p,R=x,L=b;E=Ge(x=f+g*Math.cos(p=h+M*(a&&p>h?1:-1)),b=d+m*Math.sin(p),g,m,i,0,a,R,L,[p,O,f,d])}A=p-h;var _=Math.cos(h),I=Math.sin(h),D=Math.cos(p),F=Math.sin(p),B=Math.tan(A/4),j=4/3*g*B,G=4/3*m*B,Y=[y,v],V=[y+j*I,v-G*_],W=[x+j*F,b-G*D],X=[x,b];if(V[0]=2*Y[0]-V[0],V[1]=2*Y[1]-V[1],l)return V.concat(W,X,E);for(var z=[],U=0,H=(E=V.concat(W,X,E)).length;H>U;U+=1)z[U]=U%2?je(E[U-1],E[U],w).y:je(E[U],E[U+1],w).x;return z}function Ye(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}var Ve=function(t,e,n,r){return l(l([],Ye([t,e],[n,r],.5),!0),[n,r,n,r],!1)};function We(t,e){var n,r,i,o,a,s,u,l=t[0],c=t.slice(1).map(Number),h=c[0],p=c[1],f=e.x1,d=e.y1,y=e.x,v=e.y;switch("TQ".includes(l)||(e.qx=null,e.qy=null),l){case"M":return e.x=h,e.y=p,t;case"A":return n=[f,d].concat(c),["C"].concat(Ge(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9]));case"Q":return e.qx=h,e.qy=p,n=[f,d].concat(c),["C"].concat([(s=1/3)*n[0]+(u=2/3)*(r=n[2]),s*n[1]+u*(i=n[3]),s*(o=n[4])+u*r,s*(a=n[5])+u*i,o,a]);case"L":return["C"].concat(Ve(f,d,h,p));case"Z":return f===y&&d===v?["C",f,d,y,v,y,v]:["C"].concat(Ve(f,d,y,v))}return t}function Xe(t,e){if(void 0===e&&(e=!1),function(t){return Te(t)&&t.every((function(t){return"MC".includes(t[0])}))}(t)){var n=[].concat(t);return e?[n,[]]:n}for(var i,o,a=Be(t),s=r({},we),u=[],l="",c=a.length,h=[],p=0;c>p;p+=1){a[p]&&(l=a[p][0]),u[p]=l;var f=We(a[p],s);a[p]=f,Ee(a,u,p),c=a.length,"Z"===l&&h.push(p),s.x1=+(i=a[p])[(o=i.length)-2],s.y1=+i[o-1],s.x2=+i[o-4]||s.x1,s.y2=+i[o-3]||s.y1}return e?[a,h]:a}function ze(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function Ue(t,e,n,r,i){var o=ze([t,e],[n,r]),a={x:0,y:0};if("number"==typeof i)if(0<i)if(i<o){var s=Ye([t,e],[n,r],i/o);a={x:s[0],y:s[1]}}else a={x:n,y:r};else a={x:t,y:e};return{length:o,point:a,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function He(t,e){var n=t.x,r=t.y,i=e.x,o=e.y;return(0>n*o-r*i?-1:1)*Math.acos((n*i+r*o)/Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(o,2))))}function qe(t,e,n,r,i,o,a,s,u,l){var c=Math.abs,h=Math.sin,p=Math.cos,f=Math.sqrt,d=Math.PI,y=c(n),v=c(r),g=(i%360+360)%360*(d/180);if(t===s&&e===u)return{x:t,y:e};if(0===y||0===v)return Ue(t,e,s,u,l).point;var m=(t-s)/2,x=(e-u)/2,b={x:p(g)*m+h(g)*x,y:-h(g)*m+p(g)*x},M=Math.pow(b.x,2)/Math.pow(y,2)+Math.pow(b.y,2)/Math.pow(v,2);M>1&&(y*=f(M),v*=f(M));var w=(Math.pow(y,2)*Math.pow(v,2)-Math.pow(y,2)*Math.pow(b.y,2)-Math.pow(v,2)*Math.pow(b.x,2))/(Math.pow(y,2)*Math.pow(b.y,2)+Math.pow(v,2)*Math.pow(b.x,2)),E=(o!==a?1:-1)*f(w=0>w?0:w),k=E*(y*b.y/v),S=E*(-v*b.x/y),P=p(g)*k-h(g)*S+(t+s)/2,T=h(g)*k+p(g)*S+(e+u)/2,N={x:(b.x-k)/y,y:(b.y-S)/v},C=He({x:1,y:0},N),A=He(N,{x:(-b.x-k)/y,y:(-b.y-S)/v});!a&&A>0?A-=2*d:a&&0>A&&(A+=2*d);var O=C+(A%=2*d)*l,R=y*p(O),L=v*h(O);return{x:p(g)*R-h(g)*L+P,y:h(g)*R+p(g)*L+T}}function Ze(t,e,n,r,i,o,a,s,u,l,c){var h,p=c.bbox,f=void 0===p||p,d=c.length,y=void 0===d||d,v=c.sampleSize,g=void 0===v?30:v,m="number"==typeof l,x=t,b=e,M=0,w=[x,b,M],E=[x,b],k={x:0,y:0},S=[{x:x,y:b}];m&&0>=l&&(k={x:x,y:b});for(var P=0;g>=P;P+=1){if(x=(h=qe(t,e,n,r,i,o,a,s,u,P/g)).x,b=h.y,f&&S.push({x:x,y:b}),y&&(M+=ze(E,[x,b])),E=[x,b],m&&M>=l&&l>w[2]){var T=(M-l)/(M-w[2]);k={x:E[0]*(1-T)+w[0]*T,y:E[1]*(1-T)+w[1]*T}}w=[x,b,M]}return m&&l>=M&&(k={x:s,y:u}),{length:M,point:k,min:{x:Math.min.apply(null,S.map((function(t){return t.x}))),y:Math.min.apply(null,S.map((function(t){return t.y})))},max:{x:Math.max.apply(null,S.map((function(t){return t.x}))),y:Math.max.apply(null,S.map((function(t){return t.y})))}}}function Ke(t,e,n,r,i,o,a,s,u){var l=1-u;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*u*n+3*l*Math.pow(u,2)*i+Math.pow(u,3)*a,y:Math.pow(l,3)*e+3*Math.pow(l,2)*u*r+3*l*Math.pow(u,2)*o+Math.pow(u,3)*s}}function $e(t,e,n,r,i,o,a,s,u,l){var c,h=l.bbox,p=void 0===h||h,f=l.length,d=void 0===f||f,y=l.sampleSize,v=void 0===y?10:y,g="number"==typeof u,m=t,x=e,b=0,M=[m,x,b],w=[m,x],E={x:0,y:0},k=[{x:m,y:x}];g&&0>=u&&(E={x:m,y:x});for(var S=0;v>=S;S+=1){if(m=(c=Ke(t,e,n,r,i,o,a,s,S/v)).x,x=c.y,p&&k.push({x:m,y:x}),d&&(b+=ze(w,[m,x])),w=[m,x],g&&b>=u&&u>M[2]){var P=(b-u)/(b-M[2]);E={x:w[0]*(1-P)+M[0]*P,y:w[1]*(1-P)+M[1]*P}}M=[m,x,b]}return g&&u>=b&&(E={x:a,y:s}),{length:b,point:E,min:{x:Math.min.apply(null,k.map((function(t){return t.x}))),y:Math.min.apply(null,k.map((function(t){return t.y})))},max:{x:Math.max.apply(null,k.map((function(t){return t.x}))),y:Math.max.apply(null,k.map((function(t){return t.y})))}}}function Je(t,e,n,r,i,o,a){var s=1-a;return{x:Math.pow(s,2)*t+2*s*a*n+Math.pow(a,2)*i,y:Math.pow(s,2)*e+2*s*a*r+Math.pow(a,2)*o}}function Qe(t,e,n,r,i,o,a,s){var u,l=s.bbox,c=void 0===l||l,h=s.length,p=void 0===h||h,f=s.sampleSize,d=void 0===f?10:f,y="number"==typeof a,v=t,g=e,m=0,x=[v,g,m],b=[v,g],M={x:0,y:0},w=[{x:v,y:g}];y&&0>=a&&(M={x:v,y:g});for(var E=0;d>=E;E+=1){if(v=(u=Je(t,e,n,r,i,o,E/d)).x,g=u.y,c&&w.push({x:v,y:g}),p&&(m+=ze(b,[v,g])),b=[v,g],y&&m>=a&&a>x[2]){var k=(m-a)/(m-x[2]);M={x:b[0]*(1-k)+x[0]*k,y:b[1]*(1-k)+x[1]*k}}x=[v,g,m]}return y&&a>=m&&(M={x:i,y:o}),{length:m,point:M,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 tn(t,e,n){for(var r,i,o,a,s,u,l,c,h,p=Be(t),f="number"==typeof e,d=[],y=0,v=0,g=0,m=0,x=[],b=[],M=0,w={x:0,y:0},E=w,k=w,S=w,P=0,T=0,N=p.length;N>T;T+=1)d=(l="M"===(c=(h=p[T])[0]))?d:[y,v].concat(h.slice(1)),l?(E=w={x:g=h[1],y:m=h[2]},M=0,f&&.001>e&&(S=w)):"L"===c?(M=(r=Ue(d[0],d[1],d[2],d[3],(e||0)-P)).length,w=r.min,E=r.max,k=r.point):"A"===c?(M=(i=Ze(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],(e||0)-P,n||{})).length,w=i.min,E=i.max,k=i.point):"C"===c?(M=(o=$e(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],(e||0)-P,n||{})).length,w=o.min,E=o.max,k=o.point):"Q"===c?(M=(a=Qe(d[0],d[1],d[2],d[3],d[4],d[5],(e||0)-P,n||{})).length,w=a.min,E=a.max,k=a.point):"Z"===c&&(M=(s=Ue((d=[y,v,g,m])[0],d[1],d[2],d[3],(e||0)-P)).length,w=s.min,E=s.max,k=s.point),f&&e>P&&P+M>=e&&(S=k),b.push(E),x.push(w),P+=M,y=(u="Z"!==c?h.slice(-2):[g,m])[0],v=u[1];return f&&e>=P&&(S={x:y,y:v}),{length:P,point:S,min:{x:Math.min.apply(null,x.map((function(t){return t.x}))),y:Math.min.apply(null,x.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 en(t,e){return tn(t,void 0,r(r({},e),{bbox:!1,length:!0})).length}function nn(t){return function(t){var e=0,n=0,r=0;return Xe(t).map((function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var o,a,s,u,l,c,h,p,f=t.slice(1);return r=3*(((p=f[5])-(a=n))*((s=f[0])+(l=f[2]))-((h=f[4])-(o=e))*((u=f[1])+(c=f[3]))+u*(o-l)-s*(a-c)+p*(l+o/3)-h*(c+a/3))/20,i=t.slice(-2),e=i[0],n=i[1],r})).reduce((function(t,e){return t+e}),0)}(t)>=0}function rn(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?$e(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),a=Ye(n,r,e),s=Ye(r,i,e),u=Ye(i,o,e),l=Ye(a,s,e),c=Ye(s,u,e),h=Ye(l,c,e);return[["C"].concat(a,l,h),["C"].concat(c,u,o)]}(r):[t,t]:[t],l:i}}))}function on(t,e,n){var r=rn(t),i=rn(e),o=r.length,a=i.length,s=r.filter((function(t){return t.l})).length,u=i.filter((function(t){return t.l})).length,l=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,c=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/u||0,h=n||Math.max(o,a),p=[l,c],f=[h-o,h-a],d=0,y=[r,i].map((function(t,e){return t.l===h?t.map((function(t){return t.s})):t.map((function(t,n){return f[e]-=(d=n&&f[e]&&t.l>=p[e])?1:0,d?t.ss:[t.s]})).flat()}));return y[0].length===y[1].length?y:on(y[0],y[1],h)}var an=function(){function t(t,e,n){this.isMounted=!1,this.destroyed=!1,this.props=t,this.state={},this.context=e,this.updater=n}return t.prototype.willMount=function(){},t.prototype.didMount=function(){},t.prototype.shouldUpdate=function(t){return!0},t.prototype.willReceiveProps=function(t,e){},t.prototype.willUpdate=function(){},t.prototype.didUpdate=function(){},t.prototype.render=function(){return null},t.prototype.willUnmount=function(){},t.prototype.didUnmount=function(){},t.prototype.setState=function(t,e){this.destroyed||this.updater.enqueueSetState(this,t,e)},t.prototype.forceUpdate=function(t){this.destroyed||this.updater.enqueueForceUpdate(this,{},t)},t.prototype.setAnimate=function(t){this.animate=t,this._vNode.animate=t},t.prototype.destroy=function(){this.destroyed=!0,this.animator=null},t}();function sn(t,e,n){return t&&e&&(y(t)||y(e))?function(t,e,n){for(var r={},i=t.length,o=e.length,a=0,s=o;s>a;a++)(l=e[a])&&!p(l.key)&&(r[c=l.key]=l);var u=[];for(a=0,s=i;s>a;a++){var l;if(l=t[a]){var c=l.key,h=void 0;p(l.key)?h=e[a]:(h=r[c])&&delete r[c],h?(null==h?void 0:h.__processed)?u.push(sn(l,null,n)):(h.__processed=!0,u.push(sn(l,h,n))):u.push(sn(l,null,n))}}for(a=0,s=o;s>a;a++)(h=e[a])&&((null==h?void 0:h.__processed)?delete h.__processed:u.push(sn(null,h,n)));return u}(y(t)?t:[t],y(e)?e:[e],n):n(t,e)}an.prototype.isF2Component=!0;var un={cloneElement:function(t,e){return t?r(r({},t),{props:r(r({},t.props),e)}):t},map:function t(e,n){return e&&y(e)?e.map((function(e){return t(e,n)})):n(e)},toArray:function t(e){if(!e)return e;if(!y(e))return[e];for(var n=[],r=0,i=e.length;i>r;r++){var o=e[r];y(o)?n=n.concat(t(o)):n.push(o)}return n},compare:sn};function ln(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function cn(t,e,n){return t(n={path:e,exports:{},require:function(t,e){return function(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},n.exports),n.exports}var hn=cn((function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||t,a),u=n?n+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},s.prototype.listeners=function(t){var e=this._events[n?n+t:t];if(!e)return[];if(e.fn)return[e.fn];for(var r=0,i=e.length,o=Array(i);i>r;r++)o[r]=e[r].fn;return o},s.prototype.listenerCount=function(t){var e=this._events[n?n+t:t];return e?e.fn?1:e.length:0},s.prototype.emit=function(t,e,r,i,o,a){var s=n?n+t:t;if(!this._events[s])return!1;var u,l,c=this._events[s],h=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,r),!0;case 4:return c.fn.call(c.context,e,r,i),!0;case 5:return c.fn.call(c.context,e,r,i,o),!0;case 6:return c.fn.call(c.context,e,r,i,o,a),!0}for(l=1,u=Array(h-1);h>l;l++)u[l-1]=arguments[l];c.fn.apply(c.context,u)}else{var p,f=c.length;for(l=0;f>l;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),h){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,e);break;case 3:c[l].fn.call(c[l].context,e,r);break;case 4:c[l].fn.call(c[l].context,e,r,i);break;default:if(!u)for(p=1,u=Array(h-1);h>p;p++)u[p-1]=arguments[p];c[l].fn.apply(c[l].context,u)}}return!0},s.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,r,i){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var u=0,l=[],c=s.length;c>u;u++)(s[u].fn!==e||i&&!s[u].once||r&&s[u].context!==r)&&l.push(s[u]);l.length?this._events[o]=1===l.length?l[0]:l:a(this,o)}return this},s.prototype.removeAllListeners=function(t){var e;return t?this._events[e=n?n+t:t]&&a(this,e):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s}));function pn(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function fn(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function dn(){}var yn=.7,vn=1/yn,gn="\\s*([+-]?\\d+)\\s*",mn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",xn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",bn=/^#([0-9a-f]{3,8})$/,Mn=RegExp("^rgb\\("+[gn,gn,gn]+"\\)$"),wn=RegExp("^rgb\\("+[xn,xn,xn]+"\\)$"),En=RegExp("^rgba\\("+[gn,gn,gn,mn]+"\\)$"),kn=RegExp("^rgba\\("+[xn,xn,xn,mn]+"\\)$"),Sn=RegExp("^hsl\\("+[mn,xn,xn]+"\\)$"),Pn=RegExp("^hsla\\("+[mn,xn,xn,mn]+"\\)$"),Tn={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 Nn(){return this.rgb().formatHex()}function Cn(){return this.rgb().formatRgb()}function An(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=bn.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?On(e):3===n?new Ln(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Rn(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Rn(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Mn.exec(t))?new Ln(e[1],e[2],e[3],1):(e=wn.exec(t))?new Ln(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=En.exec(t))?Rn(e[1],e[2],e[3],e[4]):(e=kn.exec(t))?Rn(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Sn.exec(t))?Fn(e[1],e[2]/100,e[3]/100,1):(e=Pn.exec(t))?Fn(e[1],e[2]/100,e[3]/100,e[4]):Tn.hasOwnProperty(t)?On(Tn[t]):"transparent"===t?new Ln(NaN,NaN,NaN,0):null}function On(t){return new Ln(t>>16&255,t>>8&255,255&t,1)}function Rn(t,e,n,r){return r>0||(t=e=n=NaN),new Ln(t,e,n,r)}function Ln(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function _n(){return"#"+Dn(this.r)+Dn(this.g)+Dn(this.b)}function In(){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 Dn(t){return(16>(t=Math.max(0,Math.min(255,Math.round(t)||0)))?"0":"")+t.toString(16)}function Fn(t,e,n,r){return r>0?n>0&&1>n?e>0||(t=NaN):t=e=NaN:t=e=n=NaN,new jn(t,e,n,r)}function Bn(t){if(t instanceof jn)return new jn(t.h,t.s,t.l,t.opacity);if(t instanceof dn||(t=An(t)),!t)return new jn;if(t instanceof jn)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(r>n):n===o?(r-e)/s+2:(e-n)/s+4,s/=.5>u?o+i:2-o-i,a*=60):s=u>0&&1>u?0:a,new jn(a,s,u,t.opacity)}function jn(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Gn(t,e,n){return 255*(60>t?e+(n-e)*t/60:180>t?n:240>t?e+(n-e)*(240-t)/60:e)}function Yn(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function Vn(t,e){var n=Math.min.apply(Math,l([],u(t),!1)),r=Math.min.apply(Math,l([],u(e),!1));return{x:n,y:r,width:Math.max.apply(Math,l([],u(t),!1))-n,height:Math.max.apply(Math,l([],u(e),!1))-r}}function Wn(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function Xn(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}function zn(t,e,n,r,i,o,a){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),u=1/0,l=-1/0,c=[o,a],h=2*-Math.PI;2*Math.PI>=h;h+=Math.PI){var p=s+h;a>o?p>o&&a>p&&c.push(p):p>a&&o>p&&c.push(p)}for(h=0;c.length>h;h++){var f=Wn(t,0,n,r,i,c[h]);u>f&&(u=f),f>l&&(l=f)}var d=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),y=1/0,v=-1/0,g=[o,a];for(h=2*-Math.PI;2*Math.PI>=h;h+=Math.PI){var m=d+h;a>o?m>o&&a>m&&g.push(m):m>a&&o>m&&g.push(m)}for(h=0;g.length>h;h++){var x=Xn(0,e,n,r,i,g[h]);y>x&&(y=x),x>v&&(v=x)}return{x:u,y:y,width:l-u,height:v-y}}pn(dn,An,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Nn,formatHex:Nn,formatHsl:function(){return Bn(this).formatHsl()},formatRgb:Cn,toString:Cn}),pn(Ln,(function(t,e,n,r){return 1===arguments.length?((i=t)instanceof dn||(i=An(i)),i?new Ln((i=i.rgb()).r,i.g,i.b,i.opacity):new Ln):new Ln(t,e,n,null==r?1:r);var i}),fn(dn,{brighter:function(t){return new Ln(this.r*(t=null==t?vn:Math.pow(vn,t)),this.g*t,this.b*t,this.opacity)},darker:function(t){return new Ln(this.r*(t=null==t?yn:Math.pow(yn,t)),this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return this.r>=-.5&&255.5>this.r&&this.g>=-.5&&255.5>this.g&&this.b>=-.5&&255.5>this.b&&this.opacity>=0&&1>=this.opacity},hex:_n,formatHex:_n,formatRgb:In,toString:In})),pn(jn,(function(t,e,n,r){return 1===arguments.length?Bn(t):new jn(t,e,n,null==r?1:r)}),fn(dn,{brighter:function(t){return new jn(this.h,this.s,this.l*(t=null==t?vn:Math.pow(vn,t)),this.opacity)},darker:function(t){return new jn(this.h,this.s,this.l*(t=null==t?yn:Math.pow(yn,t)),this.opacity)},rgb:function(){var t=this.h%360+360*(0>this.h),e=this.l,n=e+(.5>e?e:1-e)*(isNaN(t)||isNaN(this.s)?0:this.s),r=2*e-n;return new Ln(Gn(240>t?t+120:t-240,r,n),Gn(t,r,n),Gn(120>t?t+240:t-120,r,n),this.opacity)},displayable:function(){return(this.s>=0&&1>=this.s||isNaN(this.s))&&this.l>=0&&1>=this.l&&this.opacity>=0&&1>=this.opacity},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+")")}}));var Un=1e-4;function Hn(t,e,n,r,i,o){var a=-1,s=1/0,c=[n,r],h=20;o&&o>200&&(h=o/10);for(var p=1/h,f=p/10,d=0;h>=d;d++){var y=d*p,v=[i.apply(void 0,l([],u(t.concat([y])),!1)),i.apply(void 0,l([],u(e.concat([y])),!1))];s>(b=Yn(c[0],c[1],v[0],v[1]))&&(a=y,s=b)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var g=t.length;return{x:t[g-1],y:e[g-1]}}s=1/0;for(d=0;32>d&&Un<=f;d++){var m=a-f,x=a+f,b=(v=[i.apply(void 0,l([],u(t.concat([m])),!1)),i.apply(void 0,l([],u(e.concat([m])),!1))],Yn(c[0],c[1],v[0],v[1]));if(m>=0&&s>b)a=m,s=b;else{var M=[i.apply(void 0,l([],u(t.concat([x])),!1)),i.apply(void 0,l([],u(e.concat([x])),!1))],w=Yn(c[0],c[1],M[0],M[1]);1>=x&&s>w?(a=x,s=w):f*=.5}}return{x:i.apply(void 0,l([],u(t.concat([a])),!1)),y:i.apply(void 0,l([],u(e.concat([a])),!1))}}function qn(t,e,n,r){return Yn(t,e,n,r)}function Zn(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function Kn(t,e,n,r,i,o){var a=[n-t,r-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var s=[-a[1],a[0]];return function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i}(s,s),Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}([i-t,o-e],s))}function $n(t,e,n,r,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*n*i*i*o+r*i*i*i}function Jn(t,e,n,r){var i,o,a,s=-3*t+9*e-9*n+3*r,u=6*t-12*e+6*n,l=3*e-3*t,c=[];if(D(s,0))D(u,0)||0>(i=-l/u)||i>1||c.push(i);else{var h=u*u-4*s*l;D(h,0)?c.push(-u/(2*s)):h>0&&(o=(-u-(a=Math.sqrt(h)))/(2*s),0>(i=(-u+a)/(2*s))||i>1||c.push(i),0>o||o>1||c.push(o))}return c}function Qn(t,e,n,r,i,o,a,s){for(var u=[t,a],l=[e,s],c=Jn(t,n,i,a),h=Jn(e,r,o,s),p=0;c.length>p;p++)u.push($n(t,n,i,a,c[p]));for(p=0;h.length>p;p++)l.push($n(e,r,o,s,h[p]));return Vn(u,l)}function tr(t,e,n,r,i,o,a,s,u,l,c){var h=function(t,e,n,r,i,o,a,s,u,l,c){return Hn([t,n,i,a],[e,r,o,s],u,l,$n,c)}(t,e,n,r,i,o,a,s,u,l,c);return Yn(h.x,h.y,u,l)}function er(t){return function(t){if(2>t.length)return 0;for(var e=0,n=0;t.length-1>n;n++){var r=t[n],i=t[n+1];e+=Yn(r[0],r[1],i[0],i[1])}return e}(t)}function nr(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function rr(t,e,n){var r=t+n-2*e;if(D(r,0))return[.5];var i=(t-e)/r;return i>1||0>i?[]:[i]}function ir(t,e,n,r,i,o){var a=rr(t,n,i)[0],s=rr(e,r,o)[0],u=[t,i],l=[e,o];return void 0!==a&&u.push(nr(t,n,i,a)),void 0!==s&&l.push(nr(e,r,o,s)),Vn(u,l)}function or(t,e,n,r,i,o,a,s){var u=function(t,e,n,r,i,o,a,s){return Hn([t,n,i],[e,r,o],a,s,nr)}(t,e,n,r,i,o,a,s);return Yn(u.x,u.y,a,s)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var ar={exports:{}};!function(t,e){t.exports=function(){function t(t,n,i,o,a){e(t,n,i||0,o||t.length-1,a||r)}function e(t,r,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=r-i+1,l=Math.log(s),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(s-c)/s)*(0>u-s/2?-1:1);e(t,r,Math.max(i,Math.floor(r-u*c/s+h)),Math.min(o,Math.floor(r+(s-u)*c/s+h)),a)}var p=t[r],f=i,d=o;for(n(t,i,r),a(t[o],p)>0&&n(t,i,o);d>f;){for(n(t,f,d),f++,d--;0>a(t[f],p);)f++;for(;a(t[d],p)>0;)d--}0===a(t[i],p)?n(t,i,d):n(t,++d,o),d>r||(i=d+1),r>d||(o=d-1)}}function n(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function r(t,e){return e>t?-1:t>e?1:0}var i=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(t,e,n){if(!n)return e.indexOf(t);for(var r=0;e.length>r;r++)if(n(t,e[r]))return r;return-1}function a(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,r,i){i||(i=g(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=e;n>o;o++){var a=t.children[o];u(i,t.leaf?r(a):a)}return i}function u(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function c(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function p(t){return t.maxX-t.minX+(t.maxY-t.minY)}function f(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function d(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function y(t,e){return!(t.minX>e.minX||t.minY>e.minY||e.maxX>t.maxX||e.maxY>t.maxY)}function v(t,e){return!(e.minX>t.maxX||e.minY>t.maxY||t.minX>e.maxX||t.minY>e.maxY)}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function m(e,n,r,i,o){for(var a=[n,r];a.length;)if((r=a.pop())-(n=a.pop())>i){var s=n+Math.ceil((r-n)/i/2)*i;t(e,s,n,r,o),a.push(n,s,s,r)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,n=[];if(!v(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;e.children.length>o;o++){var a=e.children[o],s=e.leaf?r(a):a;v(t,s)&&(e.leaf?n.push(a):y(t,s)?this._all(a,n):i.push(a))}e=i.pop()}return n},i.prototype.collides=function(t){var e=this.data;if(!v(t,e))return!1;for(var n=[];e;){for(var r=0;e.children.length>r;r++){var i=e.children[r],o=e.leaf?this.toBBox(i):i;if(v(t,o)){if(e.leaf||y(t,o))return!0;n.push(i)}}e=n.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(this._minEntries>t.length){for(var e=0;t.length>e;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(n.height>this.data.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=g([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,r,i,a=this.data,s=this.toBBox(t),u=[],l=[];a||u.length;){if(a||(a=u.pop(),r=u[u.length-1],n=l.pop(),i=!0),a.leaf){var c=o(t,a.children,e);if(-1!==c)return a.children.splice(c,1),u.push(a),this._condense(u),this}i||a.leaf||!y(a,s)?r?(n++,a=r.children[n],i=!1):a=null:(u.push(a),l.push(n),n=0,r=a,a=a.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},i.prototype._build=function(t,e,n,r){var i,o=n-e+1,s=this._maxEntries;if(s>=o)return a(i=g(t.slice(e,n+1)),this.toBBox),i;r||(s=Math.ceil(o/Math.pow(s,(r=Math.ceil(Math.log(o)/Math.log(s)))-1))),(i=g([])).leaf=!1,i.height=r;var u=Math.ceil(o/s),l=u*Math.ceil(Math.sqrt(s));m(t,e,n,l,this.compareMinX);for(var c=e;n>=c;c+=l){var h=Math.min(c+l-1,n);m(t,c,h,u,this.compareMinY);for(var p=c;h>=p;p+=u)i.children.push(this._build(t,p,Math.min(p+u-1,h),r-1))}return a(i,this.toBBox),i},i.prototype._chooseSubtree=function(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){for(var i=1/0,o=1/0,a=void 0,s=0;e.children.length>s;s++){var u=e.children[s],l=h(u),c=f(t,u)-l;o>c?(o=c,i=i>l?l:i,a=u):c===o&&i>l&&(i=l,a=u)}e=a||e.children[0]}return e},i.prototype._insert=function(t,e,n){var r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),u(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)},i.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=g(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,a(n,this.toBBox),a(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},i.prototype._splitRoot=function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,n){for(var r,i=1/0,o=1/0,a=e;n-e>=a;a++){var u=s(t,0,a,this.toBBox),l=s(t,a,n,this.toBBox),c=d(u,l),p=h(u)+h(l);i>c?(i=c,r=a,o=o>p?p:o):c===i&&o>p&&(o=p,r=a)}return r||n-e},i.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:l,i=t.leaf?this.compareMinY:c,o=this._allDistMargin(t,e,n,r);this._allDistMargin(t,e,n,i)>o&&t.children.sort(r)},i.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,o=s(t,0,e,i),a=s(t,n-e,n,i),l=p(o)+p(a),c=e;n-e>c;c++){var h=t.children[c];u(o,t.leaf?i(h):h),l+=p(o)}for(var f=n-e-1;f>=e;f--){var d=t.children[f];u(a,t.leaf?i(d):d),l+=p(a)}return l},i.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)u(e[r],t)},i.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():a(t[e],this.toBBox)},i}()}(ar);var sr,ur,lr=ar.exports;!function(t){t.GROUP="g",t.CIRCLE="circle",t.ELLIPSE="ellipse",t.IMAGE="image",t.RECT="rect",t.LINE="line",t.POLYLINE="polyline",t.POLYGON="polygon",t.TEXT="text",t.PATH="path",t.HTML="html",t.MESH="mesh"}(sr||(sr={})),function(t){t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE"}(ur||(ur={}));var cr=function(){function t(){this.plugins=[]}return t.prototype.addRenderingPlugin=function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)},t.prototype.removeAllRenderingPlugins=function(){var t=this;this.plugins.forEach((function(e){var n=t.context.renderingPlugins.indexOf(e);0>n||t.context.renderingPlugins.splice(n,1)}))},t}(),hr=function(){function t(t){this.clipSpaceNearZ=ur.NEGATIVE_ONE,this.plugins=[],this.config=r({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1},t)}return t.prototype.registerPlugin=function(t){-1===this.plugins.findIndex((function(e){return e===t}))&&this.plugins.push(t)},t.prototype.unregisterPlugin=function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)},t.prototype.getPlugins=function(){return this.plugins},t.prototype.getPlugin=function(t){return this.plugins.find((function(e){return e.name===t}))},t.prototype.getConfig=function(){return this.config},t.prototype.setConfig=function(t){Object.assign(this.config,t)},t}();function pr(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function fr(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function dr(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function yr(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function vr(t){return void 0===t?0:t>360||-360>t?t%360:t}function gr(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Array.isArray(t)&&3===t.length?(r=t,(i=new st(3))[0]=r[0],i[1]=r[1],i[2]=r[2],i):_(t)?Bt(t,e,n):Bt(t[0],t[1]||e,t[2]||n);var r,i}function mr(t){return t*(Math.PI/180)}function xr(t){return t*(180/Math.PI)}function br(t,e){return 16===e.length?function(t,e){var n,r,i=.5*Math.PI,o=u(St(Dt(),e),3),a=o[0],s=o[1],l=o[2],c=Math.asin(-e[2]/a);return i>c?c>-i?(n=Math.atan2(e[6]/s,e[10]/l),r=Math.atan2(e[1]/a,e[0]/a)):(r=0,n=-Math.atan2(e[4]/s,e[5]/s)):(r=0,n=Math.atan2(e[4]/s,e[5]/s)),t[0]=n,t[1]=c,t[2]=r,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=r*r,s=i*i,u=o*o,l=n*n+a+s+u,c=n*o-r*i;return c>.499995*l?(t[0]=Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):-.499995*l>c?(t[0]=-Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-o*r)),t[1]=Math.atan2(2*(n*o+r*i),1-2*(s+u)),t[2]=Math.atan2(2*(n*r+i*o),1-2*(a+s))),t}(t,e)}function Mr(t,e,n,r,i){var o,a,s,u,l,c,h,p,f,d,y=Math.cos(t),v=Math.sin(t);return o=r*y,a=i*v,s=0,u=-r*v,l=i*y,c=0,h=e,p=n,f=1,(d=new st(9))[0]=o,d[1]=a,d[2]=s,d[3]=u,d[4]=l,d[5]=c,d[6]=h,d[7]=p,d[8]=f,d}function wr(t){var e=t[0],n=t[1],r=t[3],i=t[4],o=Math.sqrt(e*e+n*n),a=Math.sqrt(r*r+i*i);0>e*i-n*r&&(i>e?o=-o:a=-a),o&&(e*=1/o,n*=1/o),a&&(r*=1/a,i*=1/a);var s=xr(Math.atan2(n,e));return[t[6],t[7],o,a,s]}var Er=lt(),kr=lt(),Sr=Kt(),Pr=[Dt(),Dt(),Dt()],Tr=Dt();function Nr(t,e,n,r,i){t[0]=e[0]*r+n[0]*i,t[1]=e[1]*r+n[1]*i,t[2]=e[2]*r+n[2]*i}var Cr,Ar=function(){function t(){this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return t.isEmpty=function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]},t.prototype.update=function(t,e){pr(this.center,t),pr(this.halfExtents,e),fr(this.min,this.center,this.halfExtents),dr(this.max,this.center,this.halfExtents)},t.prototype.setMinMax=function(t,e){dr(this.center,e,t),yr(this.center,this.center,.5),fr(this.halfExtents,e,t),yr(this.halfExtents,this.halfExtents,.5),pr(this.min,t),pr(this.max,e)},t.prototype.getMin=function(){return this.min},t.prototype.getMax=function(){return this.max},t.prototype.add=function(e){if(!t.isEmpty(e))if(t.isEmpty(this))this.setMinMax(e.getMin(),e.getMax());else{var n=this.center,r=n[0],i=n[1],o=n[2],a=this.halfExtents,s=a[0],u=a[1],l=a[2],c=r-s,h=r+s,p=i-u,f=i+u,d=o-l,y=o+l,v=e.center,g=v[0],m=v[1],x=v[2],b=e.halfExtents,M=b[0],w=b[1],E=b[2],k=g-M,S=g+M,P=m-w,T=m+w,N=x-E,C=x+E;c>k&&(c=k),S>h&&(h=S),p>P&&(p=P),T>f&&(f=T),d>N&&(d=N),C>y&&(y=C),n[0]=.5*(c+h),n[1]=.5*(p+f),n[2]=.5*(d+y),a[0]=.5*(h-c),a[1]=.5*(f-p),a[2]=.5*(y-d),this.min[0]=c,this.min[1]=p,this.min[2]=d,this.max[0]=h,this.max[1]=f,this.max[2]=y}},t.prototype.setFromTransformedAABB=function(t,e){var n=this.center,r=this.halfExtents,i=t.center,o=t.halfExtents,a=e[0],s=e[4],u=e[8],l=e[1],c=e[5],h=e[9],p=e[2],f=e[6],d=e[10],y=Math.abs(a),v=Math.abs(s),g=Math.abs(u),m=Math.abs(l),x=Math.abs(c),b=Math.abs(h),M=Math.abs(p),w=Math.abs(f),E=Math.abs(d);n[0]=e[12]+a*i[0]+s*i[1]+u*i[2],n[1]=e[13]+l*i[0]+c*i[1]+h*i[2],n[2]=e[14]+p*i[0]+f*i[1]+d*i[2],r[0]=y*o[0]+v*o[1]+g*o[2],r[1]=m*o[0]+x*o[1]+b*o[2],r[2]=M*o[0]+w*o[1]+E*o[2],fr(this.min,n,r),dr(this.max,n,r)},t.prototype.intersects=function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return!(n[0]>r[0]||i[0]>e[0]||n[1]>r[1]||i[1]>e[1]||n[2]>r[2]||i[2]>e[2])},t.prototype.intersection=function(e){if(!this.intersects(e))return null;var n,r,i,o=new t,a=(n=[0,0,0],r=this.getMin(),i=e.getMin(),n[0]=Math.max(r[0],i[0]),n[1]=Math.max(r[1],i[1]),n[2]=Math.max(r[2],i[2]),n),s=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t}([0,0,0],this.getMax(),e.getMax());return o.setMinMax(a,s),o},t.prototype.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?pr([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]]},t.prototype.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?pr([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]]},t}(),Or=function(){function t(t,e){this.distance=t||0,this.normal=e||Bt(0,1,0),this.updatePNVertexFlag()}return t.prototype.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)},t.prototype.distanceToPoint=function(t){return Xt(t,this.normal)-this.distance},t.prototype.normalize=function(){var t,e,n,r=1/Zt(this.normal);(t=this.normal)[0]=(e=this.normal)[0]*(n=r),t[1]=e[1]*n,t[2]=e[2]*n,this.distance*=r},t.prototype.intersectsLine=function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),o=i>=0&&1>=i;return o&&n&&function(t,e,n,r){var i=e[0],o=e[1],a=e[2];t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a)}(n,t,e,i),o},t}();!function(t){t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE"}(Cr||(Cr={}));var Rr,Lr,_r,Ir=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;6>e;e++)this.planes.push(new Or)}return t.prototype.extractFromVPMatrix=function(t){var e=u(t,16),n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],h=e[8],p=e[9],f=e[10],d=e[11],y=e[12],v=e[13],g=e[14],m=e[15];Gt(this.planes[0].normal,o-n,c-a,d-h),this.planes[0].distance=m-y,Gt(this.planes[1].normal,o+n,c+a,d+h),this.planes[1].distance=m+y,Gt(this.planes[2].normal,o+r,c+s,d+p),this.planes[2].distance=m+v,Gt(this.planes[3].normal,o-r,c-s,d-p),this.planes[3].distance=m-v,Gt(this.planes[4].normal,o-i,c-l,d-f),this.planes[4].distance=m-g,Gt(this.planes[5].normal,o+i,c+l,d+f),this.planes[5].distance=m+g,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))},t}(),Dr=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y},t}(),Fr=function(){function t(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}return t.prototype.toJSON=function(){},t}(),Br="Method not implemented.",jr="Use document.documentElement instead.";!function(t){t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING"}(Rr||(Rr={})),function(t){t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC"}(Lr||(Lr={})),function(t){t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE"}(_r||(_r={}));var Gr,Yr,Vr,Wr,Xr,zr="updated",Ur=2e-4,Hr=function(){function t(){this.clipSpaceNearZ=ur.NEGATIVE_ONE,this.eventEmitter=new hn,this.matrix=lt(),this.right=Bt(1,0,0),this.up=Bt(0,1,0),this.forward=Bt(0,0,1),this.position=Bt(0,0,1),this.focalPoint=Bt(0,0,0),this.distanceVector=Bt(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=lt(),this.projectionMatrixInverse=lt(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=Rr.EXPLORING,this.trackingMode=Lr.DEFAULT,this.projectionMode=_r.PERSPECTIVE,this.frustum=new Ir,this.orthoMatrix=lt()}return t.prototype.isOrtho=function(){return this.projectionMode===_r.ORTHOGRAPHIC},t.prototype.getProjectionMode=function(){return this.projectionMode},t.prototype.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},t.prototype.getPerspectiveInverse=function(){return this.projectionMatrixInverse},t.prototype.getFrustum=function(){return this.frustum},t.prototype.getPosition=function(){return this.position},t.prototype.getFocalPoint=function(){return this.focalPoint},t.prototype.getDollyingStep=function(){return this.dollyingStep},t.prototype.getNear=function(){return this.near},t.prototype.getFar=function(){return this.far},t.prototype.getZoom=function(){return this.zoom},t.prototype.getOrthoMatrix=function(){return this.orthoMatrix},t.prototype.getView=function(){return this.view},t.prototype.setEnableUpdate=function(t){this.enableUpdate=t},t.prototype.setType=function(t,e){return this.type=t,this.setWorldRotation(this.type===Rr.EXPLORING),this._getAngles(),this.type===Rr.TRACKING&&void 0!==e&&this.setTrackingMode(e),this},t.prototype.setProjectionMode=function(t){return this.projectionMode=t,this},t.prototype.setTrackingMode=function(t){if(this.type!==Rr.TRACKING)throw Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this},t.prototype.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},t.prototype.getViewTransform=function(){return dt(lt(),this.matrix)},t.prototype.getWorldTransform=function(){return this.matrix},t.prototype.jitterProjectionMatrix=function(t,e){var n=Mt(lt(),[t,e,0]);this.jitteredProjectionMatrix=vt(lt(),n,this.projectionMatrix)},t.prototype.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},t.prototype.setMatrix=function(t){return this.matrix=t,this._update(),this},t.prototype.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},t.prototype.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},t.prototype.setNear=function(t){return this.projectionMode===_r.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this},t.prototype.setFar=function(t){return this.projectionMode===_r.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this},t.prototype.setViewOffset=function(t,e,n,r,i,o){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=o,this.projectionMode===_r.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},t.prototype.clearViewOffset=function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===_r.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},t.prototype.setZoom=function(t){return this.zoom=t,this.projectionMode===_r.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===_r.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},t.prototype.setZoomByViewportPoint=function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),r=n.x,i=n.y,o=this.roll;this.rotate(0,0,-o),this.setPosition(r,i),this.setFocalPoint(r,i),this.setZoom(t),this.rotate(0,0,o);var a=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),s=Bt(a.x-r,a.y-i,0),u=Xt(s,this.right)/Ft(this.right),l=Xt(s,this.up)/Ft(this.up);return this.pan(-u,-l),this},t.prototype.setPerspective=function(t,e,n,r){var i;this.projectionMode=_r.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var o=this.near*Math.tan(mr(.5*this.fov))/this.zoom,a=2*o,s=this.aspect*a,u=-.5*s;if(null===(i=this.view)||void 0===i?void 0:i.enabled){var l=this.view.fullWidth,c=this.view.fullHeight;u+=this.view.offsetX*s/l,o-=this.view.offsetY*a/c,s*=this.view.width/l,a*=this.view.height/c}return function(t,e,n,r,i,o,a,s){void 0===s&&(s=!1);var u,l,c=2*o/(r-i),h=(n+e)/(n-e),p=(r+i)/(r-i);s?(u=-a/(a-o),l=-a*o/(a-o)):(u=-(a+o)/(a-o),l=-2*a*o/(a-o)),t[0]=2*o/(n-e),t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=h,t[9]=p,t[10]=u,t[11]=-1,t[12]=0,t[13]=0,t[14]=l,t[15]=0}(this.projectionMatrix,u,u+s,o,o-a,t,this.far,this.clipSpaceNearZ===ur.ZERO),mt(this.projectionMatrix,this.projectionMatrix,Bt(1,-1,1)),dt(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},t.prototype.setOrthographic=function(t,e,n,r,i,o){var a;this.projectionMode=_r.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,this.far=o;var s=(this.rright-this.left)/(2*this.zoom),u=(this.top-this.bottom)/(2*this.zoom),l=(this.rright+this.left)/2,c=(this.top+this.bottom)/2,h=l-s,p=l+s,f=c+u,d=c-u;if(null===(a=this.view)||void 0===a?void 0:a.enabled){var y=(this.rright-this.left)/this.view.fullWidth/this.zoom,v=(this.top-this.bottom)/this.view.fullHeight/this.zoom;p=(h+=y*this.view.offsetX)+y*this.view.width,d=(f-=v*this.view.offsetY)-v*this.view.height}return this.clipSpaceNearZ===ur.NEGATIVE_ONE?Ot(this.projectionMatrix,h,p,d,f,i,o):Rt(this.projectionMatrix,h,p,d,f,i,o),mt(this.projectionMatrix,this.projectionMatrix,Bt(1,-1,1)),dt(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},t.prototype.setPosition=function(t,e,n){void 0===e&&(e=this.position[1]),void 0===n&&(n=this.position[2]);var r=gr(t,e,n);return this._setPosition(r),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},t.prototype.setFocalPoint=function(t,e,n){void 0===e&&(e=this.focalPoint[1]),void 0===n&&(n=this.focalPoint[2]);var r=Bt(0,1,0);if(this.focalPoint=gr(t,e,n),this.trackingMode===Lr.CINEMATIC){var i=Vt(Dt(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var o=Ft(i),a=xr(Math.asin(e/o)),s=90+xr(Math.atan2(n,t)),u=lt();bt(u,u,mr(s)),xt(u,u,mr(a)),r=Ut(Dt(),[0,1,0],u)}return dt(this.matrix,Lt(lt(),this.position,this.focalPoint,r)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},t.prototype.getDistance=function(){return this.distance},t.prototype.getDistanceVector=function(){return this.distanceVector},t.prototype.setDistance=function(t){if(this.distance===t||0>t)return this;this.distance=t,Ur>this.distance&&(this.distance=Ur),this.dollyingStep=this.distance/100;var e=Dt(),n=this.forward,r=this.focalPoint;return e[0]=(t=this.distance)*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this.triggerUpdate(),this},t.prototype.setMaxDistance=function(t){return this.maxDistance=t,this},t.prototype.setMinDistance=function(t){return this.minDistance=t,this},t.prototype.setAzimuth=function(t){return this.azimuth=vr(t),this.computeMatrix(),this._getAxes(),this.type===Rr.ORBITING||this.type===Rr.EXPLORING?this._getPosition():this.type===Rr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getAzimuth=function(){return this.azimuth},t.prototype.setElevation=function(t){return this.elevation=vr(t),this.computeMatrix(),this._getAxes(),this.type===Rr.ORBITING||this.type===Rr.EXPLORING?this._getPosition():this.type===Rr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getElevation=function(){return this.elevation},t.prototype.setRoll=function(t){return this.roll=vr(t),this.computeMatrix(),this._getAxes(),this.type===Rr.ORBITING||this.type===Rr.EXPLORING?this._getPosition():this.type===Rr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getRoll=function(){return this.roll},t.prototype._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},t.prototype.computeMatrix=function(){var t=Qt(Jt(),[0,0,1],mr(this.roll));pt(this.matrix);var e=Qt(Jt(),[1,0,0],mr((this.rotateWorld&&this.type!==Rr.TRACKING||this.type===Rr.TRACKING?1:-1)*this.elevation)),n=Qt(Jt(),[0,1,0],mr((this.rotateWorld&&this.type!==Rr.TRACKING||this.type===Rr.TRACKING?1:-1)*this.azimuth)),r=te(Jt(),n,e);r=te(Jt(),r,t);var i=Nt(lt(),r);this.type===Rr.ORBITING||this.type===Rr.EXPLORING?(gt(this.matrix,this.matrix,this.focalPoint),vt(this.matrix,this.matrix,i),gt(this.matrix,this.matrix,[0,0,this.distance])):this.type===Rr.TRACKING&&(gt(this.matrix,this.matrix,this.position),vt(this.matrix,this.matrix,i))},t.prototype._setPosition=function(t,e,n){this.position=gr(t,e,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1,this._getOrthoMatrix()},t.prototype._getAxes=function(){jt(this.right,gr($t(Kt(),[1,0,0,0],this.matrix))),jt(this.up,gr($t(Kt(),[0,1,0,0],this.matrix))),jt(this.forward,gr($t(Kt(),[0,0,1,0],this.matrix))),Wt(this.right,this.right),Wt(this.up,this.up),Wt(this.forward,this.forward)},t.prototype._getAngles=function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=Ft(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===Rr.TRACKING||this.rotateWorld?(this.elevation=xr(Math.asin(e/r)),this.azimuth=xr(Math.atan2(-t,-n))):(this.elevation=-xr(Math.asin(e/r)),this.azimuth=-xr(Math.atan2(-t,-n)))},t.prototype._getPosition=function(){jt(this.position,gr($t(Kt(),[0,0,0,1],this.matrix))),this._getDistance()},t.prototype._getFocalPoint=function(){var t,e;!function(t,e,n){var r=e[0],i=e[1],o=e[2];t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8]}(this.distanceVector,[0,0,-this.distance],(t=ut(),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)),Yt(this.focalPoint,this.position,this.distanceVector),this._getDistance()},t.prototype._getDistance=function(){this.distanceVector=Vt(Dt(),this.focalPoint,this.position),this.distance=Ft(this.distanceVector),this.dollyingStep=this.distance/100},t.prototype._getOrthoMatrix=function(){if(this.projectionMode===_r.ORTHOGRAPHIC){var t=this.position,e=Qt(Jt(),[0,0,1],-this.roll*Math.PI/180);Tt(this.orthoMatrix,e,Bt((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),Bt(this.zoom,this.zoom,1),t)}},t.prototype.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),e=vt(lt(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(zr)}},t.prototype.rotate=function(t,e,n){throw Error(Br)},t.prototype.pan=function(t,e){throw Error(Br)},t.prototype.dolly=function(t){throw Error(Br)},t.prototype.createLandmark=function(t,e){throw Error(Br)},t.prototype.gotoLandmark=function(t,e){throw Error(Br)},t.prototype.cancelLandmarkAnimation=function(){throw Error(Br)},t}();function qr(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;arguments.length>i;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=t.apply(this,r);return n.cache=a.set(o,s)||a,s};return n.cache=new(qr.Cache||Map),n}qr.Cache=Map,function(t){t[t.kUnknown=0]="kUnknown",t[t.kNumber=1]="kNumber",t[t.kPercentage=2]="kPercentage",t[t.kEms=3]="kEms",t[t.kPixels=4]="kPixels",t[t.kRems=5]="kRems",t[t.kDegrees=6]="kDegrees",t[t.kRadians=7]="kRadians",t[t.kGradians=8]="kGradians",t[t.kTurns=9]="kTurns",t[t.kMilliseconds=10]="kMilliseconds",t[t.kSeconds=11]="kSeconds",t[t.kInteger=12]="kInteger"}(Gr||(Gr={})),function(t){t[t.kUNumber=0]="kUNumber",t[t.kUPercent=1]="kUPercent",t[t.kULength=2]="kULength",t[t.kUAngle=3]="kUAngle",t[t.kUTime=4]="kUTime",t[t.kUOther=5]="kUOther"}(Yr||(Yr={})),function(t){t[t.kAll=0]="kAll",t[t.kNonNegative=1]="kNonNegative",t[t.kInteger=2]="kInteger",t[t.kNonNegativeInteger=3]="kNonNegativeInteger",t[t.kPositiveInteger=4]="kPositiveInteger"}(Vr||(Vr={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(Wr||(Wr={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(Xr||(Xr={}));var Zr,Kr=[{name:"em",unit_type:Gr.kEms},{name:"px",unit_type:Gr.kPixels},{name:"deg",unit_type:Gr.kDegrees},{name:"rad",unit_type:Gr.kRadians},{name:"grad",unit_type:Gr.kGradians},{name:"ms",unit_type:Gr.kMilliseconds},{name:"s",unit_type:Gr.kSeconds},{name:"rem",unit_type:Gr.kRems},{name:"turn",unit_type:Gr.kTurns}];!function(t){t[t.kUnknownType=0]="kUnknownType",t[t.kUnparsedType=1]="kUnparsedType",t[t.kKeywordType=2]="kKeywordType",t[t.kUnitType=3]="kUnitType",t[t.kSumType=4]="kSumType",t[t.kProductType=5]="kProductType",t[t.kNegateType=6]="kNegateType",t[t.kInvertType=7]="kInvertType",t[t.kMinType=8]="kMinType",t[t.kMaxType=9]="kMaxType",t[t.kClampType=10]="kClampType",t[t.kTransformType=11]="kTransformType",t[t.kPositionType=12]="kPositionType",t[t.kURLImageType=13]="kURLImageType",t[t.kColorType=14]="kColorType",t[t.kUnsupportedColorType=15]="kUnsupportedColorType"}(Zr||(Zr={}));var $r,Jr=function(t){return t?"number"===t?Gr.kNumber:"percent"===t||"%"===t?Gr.kPercentage:function(t){return Kr.find((function(e){return e.name===t})).unit_type}(t):Gr.kUnknown},Qr=function(t){var e=1;switch(t){case Gr.kPixels:case Gr.kDegrees:case Gr.kSeconds:break;case Gr.kMilliseconds:e=.001;break;case Gr.kRadians:e=180/Math.PI;break;case Gr.kGradians:e=.9;break;case Gr.kTurns:e=360}return e},ti=function(t){switch(t){case Gr.kNumber:case Gr.kInteger:return"";case Gr.kPercentage:return"%";case Gr.kEms:return"em";case Gr.kRems:return"rem";case Gr.kPixels:return"px";case Gr.kDegrees:return"deg";case Gr.kRadians:return"rad";case Gr.kGradians:return"grad";case Gr.kMilliseconds:return"ms";case Gr.kSeconds:return"s";case Gr.kTurns:return"turn"}return""},ei=function(){function t(){}return t.isAngle=function(t){return t===Gr.kDegrees||t===Gr.kRadians||t===Gr.kGradians||t===Gr.kTurns},t.isLength=function(t){return t>=Gr.kEms&&Gr.kDegrees>t},t.isRelativeUnit=function(t){return t===Gr.kPercentage||t===Gr.kEms||t===Gr.kRems},t.isTime=function(t){return t===Gr.kSeconds||t===Gr.kMilliseconds},t.prototype.toString=function(){return this.buildCSSText(Wr.kNo,Xr.kNo,"")},t.prototype.isNumericValue=function(){return this.getType()>=Zr.kUnitType&&this.getType()<=Zr.kClampType},t}(),ni=function(t){function e(e){var n=t.call(this)||this;return n.colorSpace=e,n}return n(e,t),e.prototype.getType=function(){return Zr.kColorType},e.prototype.to=function(t){return this},e}(ei);!function(t){t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient"}($r||($r={}));var ri=function(t){function e(e,n){var r=t.call(this)||this;return r.type=e,r.value=n,r}return n(e,t),e.prototype.clone=function(){return new e(this.type,this.value)},e.prototype.buildCSSText=function(t,e,n){return n},e.prototype.getType=function(){return Zr.kColorType},e}(ei),ii=function(t){function e(e){var n=t.call(this)||this;return n.value=e,n}return n(e,t),e.prototype.clone=function(){return new e(this.value)},e.prototype.getType=function(){return Zr.kKeywordType},e.prototype.buildCSSText=function(t,e,n){return n+this.value},e}(ei),oi=qr((function(t){return void 0===t&&(t=""),t.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))})),ai=function(t){return t.split("").map((function(t,e){return t.toUpperCase()===t?"".concat(0!==e?"-":"").concat(t.toLowerCase()):t})).join("")};function si(t){return"function"==typeof t}var ui=function(t){return Object.fromEntries(Object.entries(t).filter((function(t){return void 0!==u(t,2)[1]})))},li={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},ci=qr((function(t){var e=oi(t),n=li[e];return e=(null==n?void 0:n.alias)||e})),hi=function(t,e){void 0===e&&(e="");var n="";return Number.isFinite(t)?(!function(t){if(!t)throw Error()}(Number.isNaN(t)),n="NaN"):n=t>0?"infinity":"-infinity",n+e},pi=function(t){return function(t){switch(t){case Yr.kUNumber:return Gr.kNumber;case Yr.kULength:return Gr.kPixels;case Yr.kUPercent:return Gr.kPercentage;case Yr.kUTime:return Gr.kSeconds;case Yr.kUAngle:return Gr.kDegrees;default:return Gr.kUnknown}}(function(t){switch(t){case Gr.kNumber:case Gr.kInteger:return Yr.kUNumber;case Gr.kPercentage:return Yr.kUPercent;case Gr.kPixels:return Yr.kULength;case Gr.kMilliseconds:case Gr.kSeconds:return Yr.kUTime;case Gr.kDegrees:case Gr.kRadians:case Gr.kGradians:case Gr.kTurns:return Yr.kUAngle;default:return Yr.kUOther}}(t))},fi=function(t){function e(e,n){void 0===n&&(n=Gr.kNumber);var r,i=t.call(this)||this;return r="string"==typeof n?Jr(n):n,i.unit=r,i.value=e,i}return n(e,t),e.prototype.clone=function(){return new e(this.value,this.unit)},e.prototype.equals=function(t){return this.value===t.value&&this.unit===t.unit},e.prototype.getType=function(){return Zr.kUnitType},e.prototype.convertTo=function(t){if(this.unit===t)return new e(this.value,this.unit);var n=pi(this.unit);if(n!==pi(t)||n===Gr.kUnknown)return null;var r=Qr(this.unit)/Qr(t);return new e(this.value*r,t)},e.prototype.buildCSSText=function(t,e,n){var r;switch(this.unit){case Gr.kUnknown:break;case Gr.kInteger:r=Number(this.value).toFixed(0);break;case Gr.kNumber:case Gr.kPercentage:case Gr.kEms:case Gr.kRems:case Gr.kPixels:case Gr.kDegrees:case Gr.kRadians:case Gr.kGradians:case Gr.kMilliseconds:case Gr.kSeconds:case Gr.kTurns:var i=this.value,o=ti(this.unit);if(-999999>i||i>999999){var a=ti(this.unit);r=!Number.isFinite(i)||Number.isNaN(i)?hi(i,a):i+(a||"")}else r="".concat(i).concat(o)}return n+=r},e}(ei),di=new fi(0,"px");new fi(1,"px");var yi,vi,gi=new fi(0,"deg"),mi=function(t){function e(e,n,r,i,o){void 0===i&&(i=1),void 0===o&&(o=!1);var a=t.call(this,"rgb")||this;return a.r=e,a.g=n,a.b=r,a.alpha=i,a.isNone=o,a}return n(e,t),e.prototype.clone=function(){return new e(this.r,this.g,this.b,this.alpha)},e.prototype.buildCSSText=function(t,e,n){return n+"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")},e}(ni),xi=new ii("unset"),bi=new ii("initial"),Mi=new ii("inherit"),wi={"":xi,unset:xi,initial:bi,inherit:Mi},Ei=function(t){return wi[t]||(wi[t]=new ii(t)),wi[t]},ki=new mi(0,0,0,0,!0),Si=new mi(0,0,0,0),Pi=qr((function(t,e,n,r){return new mi(t,e,n,r)}),(function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")})),Ti=function(t,e){return void 0===e&&(e=Gr.kNumber),new fi(t,e)},Ni=new fi(50,"%");!function(t){t[t.Standard=0]="Standard"}(yi||(yi={})),function(t){t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED"}(vi||(vi={}));var Ci,Ai={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Fr(0,0,0,0)};function Oi(t){var e=t.type,n=t.value;return"hex"===e?"#".concat(n):"literal"===e?n:"rgb"===e?"rgb(".concat(n.join(","),")"):"rgba(".concat(n.join(","),")")}!function(t){t.COORDINATE="<coordinate>",t.COLOR="<color>",t.PAINT="<paint>",t.NUMBER="<number>",t.ANGLE="<angle>",t.OPACITY_VALUE="<opacity-value>",t.SHADOW_BLUR="<shadow-blur>",t.LENGTH="<length>",t.PERCENTAGE="<percentage>",t.LENGTH_PERCENTAGE="<length> | <percentage>",t.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",t.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",t.LIST_OF_POINTS="<list-of-points>",t.PATH="<path>",t.FILTER="<filter>",t.Z_INDEX="<z-index>",t.OFFSET_DISTANCE="<offset-distance>",t.DEFINED_PATH="<defined-path>",t.MARKER="<marker>",t.TRANSFORM="<transform>",t.TRANSFORM_ORIGIN="<transform-origin>",t.TEXT="<text>",t.TEXT_TRANSFORM="<text-transform>"}(Ci||(Ci={}));var Ri=function(){var t={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]+\.?))/},e="";function n(t){throw Error(e+": "+t)}function r(){var t=f(i);return e.length>0&&n("Invalid input not EOF"),t}function i(){return o("linear-gradient",t.linearGradient,s)||o("repeating-linear-gradient",t.repeatingLinearGradient,s)||o("radial-gradient",t.radialGradient,u)||o("repeating-radial-gradient",t.repeatingRadialGradient,u)||o("conic-gradient",t.conicGradient,u)}function o(e,r,i){return a(r,(function(r){var o=i();return o&&(x(t.comma)||n("Missing comma before color stops")),{type:e,orientation:o,colorStops:f(d)}}))}function a(e,r){var i=x(e);if(i){x(t.startCall)||n("Missing (");var o=r(i);return x(t.endCall)||n("Missing )"),o}}function s(){return m("directional",t.sideOrCorner,1)||m("angular",t.angleValue,1)}function u(){var n,r,i=l();return i&&((n=[]).push(i),r=e,x(t.comma)&&((i=l())?n.push(i):e=r)),n}function l(){var t=function(){var t=m("shape",/^(circle)/i,0);t&&(t.style=g()||c());return t}()||function(){var t=m("shape",/^(ellipse)/i,0);t&&(t.style=v()||c());return t}();if(t)t.at=h();else{var e=c();if(e){t=e;var n=h();n&&(t.at=n)}else{var r=p();r&&(t={type:"default-radial",at:r})}}return t}function c(){return m("extent-keyword",t.extentKeywords,1)}function h(){if(m("position",/^at/,0)){var t=p();return t||n("Missing positioning value"),t}}function p(){var t={x:v(),y:v()};if(t.x||t.y)return{type:"position",value:t}}function f(e){var r=e(),i=[];if(r)for(i.push(r);x(t.comma);)(r=e())?i.push(r):n("One extra comma");return i}function d(){var e=m("hex",t.hexColor,1)||a(t.rgbaColor,(function(){return{type:"rgba",value:f(y)}}))||a(t.rgbColor,(function(){return{type:"rgb",value:f(y)}}))||m("literal",t.literalColor,0);return e||n("Expected color definition"),e.length=v(),e}function y(){return x(t.number)[1]}function v(){return m("%",t.percentageValue,1)||m("position-keyword",t.positionKeywords,1)||g()}function g(){return m("px",t.pixelValue,1)||m("em",t.emValue,1)}function m(t,e,n){var r=x(e);if(r)return{type:t,value:r[n]}}function x(t){var n=/^[\n\r\t\s]+/.exec(e);n&&b(n[0].length);var r=t.exec(e);return r&&b(r[0].length),r}function b(t){e=e.substring(t)}return function(t){return e=t,r()}}();var Li=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,_i=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Ii=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Di=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var Fi={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},Bi=qr((function(t){return Ti("angular"===t.type?Number(t.value):Fi[t.value]||0,"deg")})),ji=qr((function(t){var e=50,n=50,r="%",i="%";if("position"===(null==t?void 0:t.type)){var o=t.value,a=o.x,s=o.y;"position-keyword"===(null==a?void 0:a.type)&&("left"===a.value?e=0:"center"===a.value?e=50:"right"===a.value?e=100:"top"===a.value?n=0:"bottom"===a.value&&(n=100)),"position-keyword"===(null==s?void 0:s.type)&&("left"===s.value?e=0:"center"===s.value?n=50:"right"===s.value?e=100:"top"===s.value?n=0:"bottom"===s.value&&(n=100)),"px"!==(null==a?void 0:a.type)&&"%"!==(null==a?void 0:a.type)&&"em"!==(null==a?void 0:a.type)||(r=null==a?void 0:a.type,e=Number(a.value)),"px"!==(null==s?void 0:s.type)&&"%"!==(null==s?void 0:s.type)&&"em"!==(null==s?void 0:s.type)||(i=null==s?void 0:s.type,n=Number(s.value))}return{cx:Ti(e,r),cy:Ti(n,i)}})),Gi=qr((function(t){var e;if(t.indexOf("linear")>-1||t.indexOf("radial")>-1)return Ri(t).map((function(t){var e=t.type,n=t.orientation,r=t.colorStops;!function(t){var e,n,r,i=t.length;t[i-1].length=null!==(e=t[i-1].length)&&void 0!==e?e:{type:"%",value:"100"},i>1&&(t[0].length=null!==(n=t[0].length)&&void 0!==n?n:{type:"%",value:"0"});for(var o=0,a=Number(t[0].length.value),s=1;i>s;s++){var u=null===(r=t[s].length)||void 0===r?void 0:r.value;if(!p(u)&&!p(a)){for(var l=1;s-o>l;l++)t[o+l].length={type:"%",value:"".concat(a+(Number(u)-a)*l/(s-o))};o=s,a=Number(u)}}}(r);var i=r.map((function(t){return{offset:Ti(Number(t.length.value),"%"),color:Oi(t)}}));if("linear-gradient"===e)return new ri($r.LinearGradient,{angle:n?Bi(n):gi,steps:i});if("radial-gradient"===e&&(n||(n=[{type:"shape",value:"circle"}]),"shape"===n[0].type&&"circle"===n[0].value)){var o=ji(n[0].at),a=o.cx,s=o.cy,u=void 0;if(n[0].style){var l=n[0].style,c=l.type,h=l.value;u="extent-keyword"===c?Ei(h):Ti(h,c)}return new ri($r.RadialGradient,{cx:a,cy:s,size:u,steps:i})}}));var n=t[0];if("("===t[1]||"("===t[2])if("l"===n){var r=Li.exec(t);if(r){var i=(null===(e=r[2].match(Di))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return[new ri($r.LinearGradient,{angle:Ti(parseFloat(r[1]),"deg"),steps:i.map((function(t){var e=u(t,2),n=e[1];return{offset:Ti(100*Number(e[0]),"%"),color:n}}))})]}}else if("r"===n){var o=function(t){var e,n=_i.exec(t);if(n){var r=(null===(e=n[4].match(Di))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return{cx:Ti(50,"%"),cy:Ti(50,"%"),steps:r.map((function(t){var e=u(t,2),n=e[1];return{offset:Ti(100*Number(e[0]),"%"),color:n}}))}}return null}(t);if(o){if(!P(o))return[new ri($r.RadialGradient,o)];t=o}}else if("p"===n)return function(t){var e=Ii.exec(t);if(e){var n=e[1],r=e[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;default:n="no-repeat"}return{image:r,repetition:n}}return null}(t)}));function Yi(t){return t&&!!t.image}function Vi(t){return t&&!p(t.r)&&!p(t.g)&&!p(t.b)}var Wi=qr((function(t){if(Yi(t))return r({repetition:"repeat"},t);if(p(t)&&(t=""),"transparent"===t)return Si;"currentColor"===t&&(t="black");var e=Gi(t);if(e)return e;var n=An(t),i=[0,0,0,0];return null!==n&&(i[0]=n.r||0,i[1]=n.g||0,i[2]=n.b||0,i[3]=n.opacity),Pi.apply(void 0,l([],u(i),!1))}));function Xi(t,e){if(Vi(t)&&Vi(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;3>n;n++)e[n]=Math.round(L(e[n],0,255));return e[3]=L(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function zi(t,e){if(p(e))return Ti(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return Ti(Number(e),"px");if("deg".search(t)>=0)return Ti(Number(e),"deg")}var n=[];e=e.replace(t,(function(t){return n.push(t),"U"+t}));var r="U("+t.source+")";return n.map((function(t){return Ti(Number(e.replace(RegExp("U"+t,"g"),"").replace(RegExp(r,"g"),"*0")),t)}))[0]}var Ui=qr((function(t){return zi(/px/g,t)}));qr((function(t){return zi(RegExp("%","g"),t)}));var Hi=function(t){return _(t)||isFinite(Number(t))?Ti(Number(t)||0,"px"):zi(RegExp("px|%|em|rem","g"),t)},qi=qr((function(t){return zi(/deg|rad|grad|turn/g,t)}));function Zi(t,e,n,r,i){void 0===i&&(i=0);var o="",a=t.value||0,s=e.value||0,u=pi(t.unit),l=t.convertTo(u),c=e.convertTo(u);return l&&c?(a=l.value,s=c.value,o=ti(t.unit)):(fi.isLength(t.unit)||fi.isLength(e.unit))&&(a=Qi(t,i,n),s=Qi(e,i,n),o="px"),[a,s,function(t){return r&&(t=Math.max(t,0)),t+o}]}function Ki(t){var e=0;return t.unit===Gr.kDegrees?e=t.value:t.unit===Gr.kRadians?e=xr(Number(t.value)):t.unit===Gr.kTurns&&(e=360*Number(t.value)),e}function $i(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):P(t)?n=t.split(" ").map((function(t){return Number(t)})):_(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 Ji(t){return P(t)?t.split(" ").map((function(t){return Hi(t)})):t.map((function(t){return Hi(""+t)}))}function Qi(t,e,n){if(0===t.value)return 0;if(t.unit===Gr.kPixels)return Number(t.value);if(t.unit===Gr.kPercentage&&n){var r=n.nodeName===sr.GROUP?n.getLocalBounds():n.geometry.contentBounds;return t.value/100*r.halfExtents[e]*2}return 0}var to=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function eo(t){if(void 0===t&&(t=""),"none"===(t=t.toLowerCase().trim()))return[];for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];if(i=e.index+e[0].length,to.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return zi(/deg|rad|grad|turn|px|%/g,t)||Wi(t)}))}),n.lastIndex===t.length)return r}return[]}function no(t){return""+t}var ro=qr((function(t){return Ti("number"==typeof t?t:/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Number(t):0)}));function io(t,e){return[t,e,no]}function oo(t,e){return function(n,r){return[n,r,function(n){return no(L(n,t,e))}]}}function ao(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function so(t){return 0===t.parsedStyle.path.totalLength&&(t.parsedStyle.path.totalLength=en(t.parsedStyle.path.absolutePath)),t.parsedStyle.path.totalLength}function uo(t,e){return t[0]===e[0]&&t[1]===e[1]}function lo(t,e){var n=t.prePoint,r=t.currentPoint,i=t.nextPoint,o=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),a=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.acos((o+a-(Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2)))/(2*Math.sqrt(o)*Math.sqrt(a)));if(!s||0===Math.sin(s)||D(s,0))return{xExtra:0,yExtra:0};var u=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),l=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));return l=l>Math.PI/2?Math.PI-l:l,{xExtra:Math.cos(s/2-(u=u>Math.PI/2?Math.PI-u:u))*(e/2*(1/Math.sin(s/2)))-e/2||0,yExtra:Math.cos(l-s/2)*(e/2*(1/Math.sin(s/2)))-e/2||0}}function co(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}qr((function(t){return P(t)?t.split(" ").map(ro):t.map(ro)}));var ho=function(t,e){return(0>t.x*e.y-t.y*e.x?-1:1)*Math.acos((t.x*e.x+t.y*e.y)/Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2))))},po=function(t,e,n,r,i,o,a,s){e=Math.abs(e),n=Math.abs(n);var u=mr(r=F(r,360));if(t.x===a.x&&t.y===a.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===e||0===n)return{x:0,y:0,ellipticalArcAngle:0};var l=(t.x-a.x)/2,c=(t.y-a.y)/2,h={x:Math.cos(u)*l+Math.sin(u)*c,y:-Math.sin(u)*l+Math.cos(u)*c},p=Math.pow(h.x,2)/Math.pow(e,2)+Math.pow(h.y,2)/Math.pow(n,2);p>1&&(e*=Math.sqrt(p),n*=Math.sqrt(p));var f=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(h.y,2)-Math.pow(n,2)*Math.pow(h.x,2))/(Math.pow(e,2)*Math.pow(h.y,2)+Math.pow(n,2)*Math.pow(h.x,2)),d=(i!==o?1:-1)*Math.sqrt(f=0>f?0:f),y=d*(e*h.y/n),v=d*(-n*h.x/e),g={x:Math.cos(u)*y-Math.sin(u)*v+(t.x+a.x)/2,y:Math.sin(u)*y+Math.cos(u)*v+(t.y+a.y)/2},m={x:(h.x-y)/e,y:(h.y-v)/n},x=ho({x:1,y:0},m),b=ho(m,{x:(-h.x-y)/e,y:(-h.y-v)/n});!o&&b>0?b-=2*Math.PI:o&&0>b&&(b+=2*Math.PI);var M=x+(b%=2*Math.PI)*s,w=e*Math.cos(M),E=n*Math.sin(M);return{x:Math.cos(u)*w-Math.sin(u)*E+g.x,y:Math.sin(u)*w+Math.cos(u)*E+g.y,ellipticalArcStartAngle:x,ellipticalArcEndAngle:x+b,ellipticalArcAngle:M,ellipticalArcCenter:g,resultantRx:e,resultantRy:n}};function fo(t,e,n){void 0===n&&(n=!0);var r=t.arcParams,i=r.rx,o=void 0===i?0:i,a=r.ry,s=void 0===a?0:a,u=r.xRotation,l=r.arcFlag,c=r.sweepFlag,h=po({x:t.prePoint[0],y:t.prePoint[1]},o,s,u,!!l,!!c,{x:t.currentPoint[0],y:t.currentPoint[1]},e),p=po({x:t.prePoint[0],y:t.prePoint[1]},o,s,u,!!l,!!c,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),f=p.x-h.x,d=p.y-h.y,y=Math.sqrt(f*f+d*d);return{x:-f/y,y:-d/y}}function yo(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function vo(t,e){return yo(t)*yo(e)?(t[0]*e[0]+t[1]*e[1])/(yo(t)*yo(e)):1}function go(t,e){return(t[1]*e[0]>t[0]*e[1]?-1:1)*Math.acos(vo(t,e))}function mo(t,e){var n=e[1],r=e[2],i=F(mr(e[3]),2*Math.PI),o=e[4],a=e[5],s=t[0],u=t[1],l=e[6],c=e[7],h=Math.cos(i)*(s-l)/2+Math.sin(i)*(u-c)/2,p=-1*Math.sin(i)*(s-l)/2+Math.cos(i)*(u-c)/2,f=h*h/(n*n)+p*p/(r*r);f>1&&(n*=Math.sqrt(f),r*=Math.sqrt(f));var d=n*n*(p*p)+r*r*(h*h),y=d?Math.sqrt((n*n*(r*r)-d)/d):1;o===a&&(y*=-1),isNaN(y)&&(y=0);var v=r?y*n*p/r:0,g=n?y*-r*h/n:0,m=(s+l)/2+Math.cos(i)*v-Math.sin(i)*g,x=(u+c)/2+Math.sin(i)*v+Math.cos(i)*g,b=[(h-v)/n,(p-g)/r],M=[(-1*h-v)/n,(-1*p-g)/r],w=go([1,0],b),E=go(b,M);return vo(b,M)>-1||(E=Math.PI),1>vo(b,M)||(E=0),0===a&&E>0&&(E-=2*Math.PI),1===a&&0>E&&(E+=2*Math.PI),{cx:m,cy:x,rx:uo(t,[l,c])?0:n,ry:uo(t,[l,c])?0:r,startAngle:w,endAngle:w+E,xRotation:i,arcFlag:o,sweepFlag:a}}function xo(t,e,n,r){var i=.5522847498307936,o=t*i,a=e*i,s=n-t,u=n+t,l=r-e,c=r+e;return[["M",s,r],["C",s,r-a,n-o,l,n,l],["C",n+o,l,u,r-a,u,r],["C",u,r+a,n+o,c,n,c],["C",n-o,c,s,r+a,s,r],["Z"]]}function bo(t,e){void 0===e&&(e=t.getLocalTransform());var n=[];switch(t.nodeName){case sr.LINE:var r=t.parsedStyle,i=r.x1,o=r.y1,a=r.x2,s=r.y2;n=function(t,e,n,r){return[["M",t,e],["L",n,r]]}(void 0===i?0:i,void 0===o?0:o,void 0===a?0:a,void 0===s?0:s);break;case sr.CIRCLE:var c=t.parsedStyle,h=c.r,p=void 0===h?0:h,f=c.cx,d=c.cy;n=xo(p,p,void 0===f?0:f,void 0===d?0:d);break;case sr.ELLIPSE:var y=t.parsedStyle,v=y.rx,g=y.ry,m=y.cx,x=y.cy;n=xo(void 0===v?0:v,void 0===g?0:g,void 0===m?0:m,void 0===x?0:x);break;case sr.POLYLINE:case sr.POLYGON:n=function(t,e){var n=t.map((function(t,e){return[0===e?"M":"L",t[0],t[1]]}));return e&&n.push(["Z"]),n}(t.parsedStyle.points.points,t.nodeName===sr.POLYGON);break;case sr.RECT:var b=t.parsedStyle,M=b.width,w=void 0===M?0:M,E=b.height,k=void 0===E?0:E,S=b.x,P=void 0===S?0:S,T=b.y,N=void 0===T?0:T,C=b.radius,A=C&&C.some((function(t){return 0!==t}));n=function(t,e,n,r,i){if(i){var o=u(i,4),a=o[0],s=o[1],l=o[2],c=o[3],h=t>0?1:-1,p=e>0?1:-1,f=h+p!==0?1:0;return[["M",h*a+n,r],["L",t-h*s+n,r],s?["A",s,s,0,0,f,t+n,p*s+r]:null,["L",t+n,e-p*l+r],l?["A",l,l,0,0,f,t+n-h*l,e+r]:null,["L",n+h*c,e+r],c?["A",c,c,0,0,f,n,e+r-p*c]:null,["L",n,p*a+r],a?["A",a,a,0,0,f,h*a+n,r]:null,["Z"]].filter((function(t){return t}))}return[["M",n,r],["L",n+t,r],["L",n+t,r+e],["L",n,r+e],["Z"]]}(w,k,P,N,A&&C.map((function(t){return L(t,0,Math.min(Math.abs(w)/2,Math.abs(k)/2))})));break;case sr.PATH:n=l([],u(t.parsedStyle.path.absolutePath),!1)}if(n.length)return function(t,e,n){var r=e.parsedStyle,i=r.defX,o=void 0===i?0:i,a=r.defY,s=void 0===a?0:a;return t.reduce((function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=Bt(e[1]-o,e[2]-s,0);n&&Ut(i,i,n),r="".concat(e[0]).concat(i[0],",").concat(i[1])}else if("Z"===e[0])r=e[0];else if("C"===e[0]){var a=Bt(e[1]-o,e[2]-s,0),u=Bt(e[3]-o,e[4]-s,0),l=Bt(e[5]-o,e[6]-s,0);n&&(Ut(a,a,n),Ut(u,u,n),Ut(l,l,n)),r="".concat(e[0]).concat(a[0],",").concat(a[1],",").concat(u[0],",").concat(u[1],",").concat(l[0],",").concat(l[1])}else if("A"===e[0]){var c=Bt(e[6]-o,e[7]-s,0);n&&Ut(c,c,n),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(c[0],",").concat(c[1])}else"Q"===e[0]&&(a=Bt(e[1]-o,e[2]-s,0),u=Bt(e[3]-o,e[4]-s,0),n&&(Ut(a,a,n),Ut(u,u,n)),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}"));return t+r}),"")}(n,t,e)}var Mo=function(t){if(""===t||Array.isArray(t)&&0===t.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var e;try{e=Be(t)}catch(n){e=Be(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}!function(t){for(var e=0;t.length>e;e++){var n=t[e-1],r=t[e];if("M"===r[0]&&n){var i=n[0],o=void 0;"L"===i||"M"===i?o=[n[1],n[2]]:"C"!==i&&"A"!==i&&"Q"!==i||(o=[n[n.length-2],n[n.length-1]]),o&&uo([r[1],r[2]],o)&&(t.splice(e,1),e--)}}}(e);var n=function(t){for(var e=!1,n=t.length,r=0;n>r;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e}(e),r=function(t){for(var e=[],n=[],r=[],i=0;t.length>i;i++){var o=t[i],a=o[0];"M"===a?(r.length&&(n.push(r),r=[]),r.push([o[1],o[2]])):"Z"===a?r.length&&(e.push(r),r=[]):r.push([o[1],o[2]])}return r.length>0&&n.push(r),{polygons:e,polylines:n}}(e),i=r.polygons,o=r.polylines,a=function(t){for(var e=[],n=null,r=null,i=null,o=0,a=t.length,s=0;a>s;s++){var u=t[s];r=t[s+1];var l=u[0],c={command:l,prePoint:n,params:u,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(l){case"M":i=[u[1],u[2]],o=s;break;case"A":var h=mo(n,u);c.arcParams=h}if("Z"===l)n=i,r=t[o+1];else{var p=u.length;n=[u[p-2],u[p-1]]}r&&"Z"===r[0]&&(r=t[o],e[o]&&(e[o].prePoint=n)),c.currentPoint=n,e[o]&&uo(n,e[o].currentPoint)&&(e[o].prePoint=c.prePoint),c.nextPoint=r?[r[r.length-2],r[r.length-1]]:null;var f=c.prePoint;if(["L","H","V"].includes(l))c.startTangent=[f[0]-n[0],f[1]-n[1]],c.endTangent=[n[0]-f[0],n[1]-f[1]];else if("Q"===l)c.startTangent=[f[0]-(d=[u[1],u[2]])[0],f[1]-d[1]],c.endTangent=[n[0]-d[0],n[1]-d[1]];else if("T"===l){var d=co((v=e[s-1]).currentPoint,f);"Q"===v.command?(c.command="Q",c.startTangent=[f[0]-d[0],f[1]-d[1]],c.endTangent=[n[0]-d[0],n[1]-d[1]]):(c.command="TL",c.startTangent=[f[0]-n[0],f[1]-n[1]],c.endTangent=[n[0]-f[0],n[1]-f[1]])}else if("C"===l){var y=[u[3],u[4]];c.startTangent=[f[0]-(g=[u[1],u[2]])[0],f[1]-g[1]],c.endTangent=[n[0]-y[0],n[1]-y[1]],0===c.startTangent[0]&&0===c.startTangent[1]&&(c.startTangent=[g[0]-y[0],g[1]-y[1]]),0===c.endTangent[0]&&0===c.endTangent[1]&&(c.endTangent=[y[0]-g[0],y[1]-g[1]])}else if("S"===l){var v,g=co((v=e[s-1]).currentPoint,f);y=[u[1],u[2]],"C"===v.command?(c.command="C",c.startTangent=[f[0]-g[0],f[1]-g[1]],c.endTangent=[n[0]-y[0],n[1]-y[1]]):(c.command="SQ",c.startTangent=[f[0]-y[0],f[1]-y[1]],c.endTangent=[n[0]-y[0],n[1]-y[1]])}else if("A"===l){var m=fo(c,0),x=m.x,b=m.y,M=fo(c,1,!1),w=M.x,E=M.y;c.startTangent=[x,b],c.endTangent=[w,E]}e.push(c)}return e}(e),s=function(t,e){for(var n=[],r=[],i=[],o=0;t.length>o;o++){var a=(y=t[o]).currentPoint,s=y.params,u=y.prePoint,l=void 0;switch(y.command){case"Q":l=ir(u[0],u[1],s[1],s[2],s[3],s[4]);break;case"C":l=Qn(u[0],u[1],s[1],s[2],s[3],s[4],s[5],s[6]);break;case"A":var c=y.arcParams;l=zn(c.cx,c.cy,c.rx,c.ry,c.xRotation,c.startAngle,c.endAngle);break;default:n.push(a[0]),r.push(a[1])}l&&(y.box=l,n.push(l.x,l.x+l.width),r.push(l.y,l.y+l.height)),e&&("L"===y.command||"M"===y.command)&&y.prePoint&&y.nextPoint&&i.push(y)}n=n.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0})),r=r.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}));var h=k(n),p=k(r),f=E(n),d=E(r);if(0===i.length)return{x:h,y:p,width:f-h,height:d-p};for(o=0;i.length>o;o++){var y;(a=(y=i[o]).currentPoint)[0]===h?h-=lo(y,e).xExtra:a[0]===f&&(f+=lo(y,e).xExtra),a[1]===p?p-=lo(y,e).yExtra:a[1]===d&&(d+=lo(y,e).yExtra)}return{x:h,y:p,width:f-h,height:d-p}}(a,0),u=s.x,l=s.y,c=s.width,h=s.height;return{absolutePath:e,hasArc:n,segments:a,polygons:i,polylines:o,totalLength:0,rect:{x:Number.isFinite(u)?u:0,y:Number.isFinite(l)?l:0,width:Number.isFinite(c)?c:0,height:Number.isFinite(h)?h:0}}},wo=qr(Mo);function Eo(t){return P(t)?wo(t):Mo(t)}function ko(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=Xe(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=Xe(e.absolutePath,!1),e.curve=i);var o=[r,i];r.length!==i.length&&(o=on(r,i));var a,s,u,l,c,h,p,f,d=nn(o[0])!==nn(o[1])?(s=(a=o[0]).slice(1).map((function(t,e,n){return e?n[e-1].slice(-2).concat(t.slice(1)):a[0].slice(1).concat(t.slice(1))})).map((function(t){return t.map((function(e,n){return t[t.length-n-2*(1-n%2)]}))})).reverse(),[["M"].concat(s[0].slice(0,2))].concat(s.map((function(t){return["C"].concat(t.slice(2))})))):o[0].map((function(t){return Array.isArray(t)?[].concat(t):t}));return[d,(u=o[1],l=d,c=u.length-1,h=[],p=0,f=function(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,o){var a=i+o;return 0===o||t[a]&&"M"===t[a][0]?["M"].concat(t[a].slice(-2)):(e>a||(a-=n),t[a])}))}))}(u),f.forEach((function(t,e){u.slice(1).forEach((function(t,n){p+=ze(u[(e+n)%c].slice(-2),l[n%c].slice(-2))})),h[e]=p,p=0})),f[h.indexOf(Math.min.apply(null,h))]),function(t){return t}]}function So(t,e){var n;n=P(t)?t.split(" ").map((function(t){var e=u(t.split(","),2),n=e[1];return[Number(e[0]),Number(n)]})):t;var r,i,o=[],a=0,s=er(n);n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=a/s,i=qn(t[0],t[1],n[e+1][0],n[e+1][1]),r[1]=(a+=i)/s,o.push(r))}));var c=Math.min.apply(Math,l([],u(n.map((function(t){return t[0]}))),!1)),h=Math.min.apply(Math,l([],u(n.map((function(t){return t[1]}))),!1));return e&&(e.parsedStyle.defX=c,e.parsedStyle.defY=h),{points:n,totalLength:s,segments:o}}function Po(t,e){return[t.points,e.points,function(t){return t}]}var To=null;function No(t){return function(e){var n=0;return t.map((function(t){return t===To?e[n++]:t}))}}function Co(t){return t}var Ao={matrix:["NNNNNN",[To,To,0,0,To,To,0,0,0,0,1,0,To,To,0,1],Co],matrix3d:["NNNNNNNNNNNNNNNN",Co],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",No([To,To,new fi(1)]),Co],scalex:["N",No([To,new fi(1),new fi(1)]),No([To,new fi(1)])],scaley:["N",No([new fi(1),To,new fi(1)]),No([new fi(1),To])],scalez:["N",No([new fi(1),new fi(1),To])],scale3d:["NNN",Co],skew:["Aa",null,Co],skewx:["A",null,No([To,gi])],skewy:["A",null,No([gi,To])],translate:["Tt",No([To,To,di]),Co],translatex:["T",No([To,di,di]),No([To,di])],translatey:["T",No([di,To,di]),No([di,To])],translatez:["L",No([di,di,To])],translate3d:["TTL",Co]};function Oo(t){if("none"===(t=(t||"none").toLowerCase().trim()))return[];for(var e,n=/\s*(\w+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];i=e.index+e[0].length;var o=e[1],a=Ao[o];if(!a)return[];var s=e[2].split(","),u=a[0];if(s.length>u.length)return[];for(var l=[],c=0;u.length>c;c++){var h=s[c],p=u[c],f=void 0;if(void 0===(f=h?{A:function(t){return"0"===t.trim()?gi:qi(t)},N:ro,T:Hi,L:Ui}[p.toUpperCase()](h):{a:gi,n:l[0],t:di}[p]))return[];l.push(f)}if(r.push({t:o,d:l}),n.lastIndex===t.length)return r}return[]}function Ro(t){var e,n,r,i;switch(t.t){case"rotatex":return i=mr(Ki(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=mr(Ki(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=mr(Ki(t.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":e=t.d[0].value,n=t.d[1].value,r=t.d[2].value,i=mr(Ki(t.d[3]));var o=e*e+n*n+r*r;if(0===o)e=1,n=0,r=0;else if(1!==o){var a=Math.sqrt(o);e/=a,n/=a,r/=a}var s=Math.sin(i/2),u=s*Math.cos(i/2),l=s*s;return[1-2*(n*n+r*r)*l,2*(e*n*l+r*u),2*(e*r*l-n*u),0,2*(e*n*l-r*u),1-2*(e*e+r*r)*l,2*(n*r*l+e*u),0,2*(e*r*l+n*u),2*(n*r*l-e*u),1-2*(e*e+n*n)*l,0,0,0,0,1];case"scale":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scalex":return[t.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaley":return[1,0,0,0,0,t.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scalez":return[1,0,0,0,0,1,0,0,0,0,t.d[0].value,0,0,0,0,1];case"scale3d":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,t.d[2].value,0,0,0,0,1];case"skew":var c=mr(Ki(t.d[0])),h=mr(Ki(t.d[1]));return[1,Math.tan(h),0,0,Math.tan(c),1,0,0,0,0,1,0,0,0,0,1];case"skewx":return i=mr(Ki(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=mr(Ki(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=Qi(t.d[0],0,null)||0,n=Qi(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Qi(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=Qi(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=Qi(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Qi(t.d[0],0,null)||0,n=Qi(t.d[1],0,null)||0,r=Qi(t.d[2],0,null)||0,1];case"perspective":var p=Qi(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,p?-1/p: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 Lo(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 _o(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],o=[0,0,0,1];return function(t,e,n,r,i,o){if(!function(t,e){var n=e[15];if(0===n)return!1;for(var r=1/n,i=0;16>i;i++)t[i]=e[i]*r;return!0}(Er,t))return!1;if(ct(kr,Er),kr[3]=0,kr[7]=0,kr[11]=0,kr[15]=1,1e-8>Math.abs(yt(kr)))return!1;var a,s,u=Er[3],l=Er[7],c=Er[11],h=Er[12],p=Er[13],f=Er[14],d=Er[15];if(0!==u||0!==l||0!==c){if(Sr[0]=u,Sr[1]=l,Sr[2]=c,Sr[3]=d,!dt(kr,kr))return!1;ft(kr,kr),$t(i,Sr,kr)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=h,e[1]=p,e[2]=f,(a=Pr)[0][0]=(s=Er)[0],a[0][1]=s[1],a[0][2]=s[2],a[1][0]=s[4],a[1][1]=s[5],a[1][2]=s[6],a[2][0]=s[8],a[2][1]=s[9],a[2][2]=s[10],n[0]=Ft(Pr[0]),Wt(Pr[0],Pr[0]),r[0]=Xt(Pr[0],Pr[1]),Nr(Pr[1],Pr[1],Pr[0],1,-r[0]),n[1]=Ft(Pr[1]),Wt(Pr[1],Pr[1]),r[0]/=n[1],r[1]=Xt(Pr[0],Pr[2]),Nr(Pr[2],Pr[2],Pr[0],1,-r[1]),r[2]=Xt(Pr[1],Pr[2]),Nr(Pr[2],Pr[2],Pr[1],1,-r[2]),n[2]=Ft(Pr[2]),Wt(Pr[2],Pr[2]),r[1]/=n[2],r[2]/=n[2],zt(Tr,Pr[1],Pr[2]),0>Xt(Pr[0],Tr))for(var y=0;3>y;y++)n[y]*=-1,Pr[y][0]*=-1,Pr[y][1]*=-1,Pr[y][2]*=-1;o[0]=.5*Math.sqrt(Math.max(1+Pr[0][0]-Pr[1][1]-Pr[2][2],0)),o[1]=.5*Math.sqrt(Math.max(1-Pr[0][0]+Pr[1][1]-Pr[2][2],0)),o[2]=.5*Math.sqrt(Math.max(1-Pr[0][0]-Pr[1][1]+Pr[2][2],0)),o[3]=.5*Math.sqrt(Math.max(1+Pr[0][0]+Pr[1][1]+Pr[2][2],0)),Pr[2][1]>Pr[1][2]&&(o[0]=-o[0]),Pr[0][2]>Pr[2][0]&&(o[1]=-o[1]),Pr[1][0]>Pr[0][1]&&(o[2]=-o[2])}(function(t){return 0===t.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(Ro).reduce(Lo)}(t),e,n,r,i,o),[[e,n,r,o,i]]}var Io=function(){function t(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],r=0;4>r;r++)for(var i=0;4>i;i++)for(var o=0;4>o;o++)n[r][i]+=e[r][o]*t[o][i];return n}return function(e,n,r,i,o){for(var a=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;4>s;s++)a[s][3]=o[s];for(s=0;3>s;s++)for(var u=0;3>u;u++)a[3][s]+=e[u]*a[u][s];var l=i[0],c=i[1],h=i[2],p=i[3],f=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];f[0][0]=1-2*(c*c+h*h),f[0][1]=2*(l*c-h*p),f[0][2]=2*(l*h+c*p),f[1][0]=2*(l*c+h*p),f[1][1]=1-2*(l*l+h*h),f[1][2]=2*(c*h-l*p),f[2][0]=2*(l*h-c*p),f[2][1]=2*(c*h+l*p),f[2][2]=1-2*(l*l+c*c),a=t(a,f);var d,y=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];for(r[2]&&(y[2][1]=r[2],a=t(a,y)),r[1]&&(y[2][1]=0,y[2][0]=r[0],a=t(a,y)),r[0]&&(y[2][0]=0,y[1][0]=r[0],a=t(a,y)),s=0;3>s;s++)for(u=0;3>u;u++)a[s][u]*=n[s];return 0==(d=a)[0][2]&&0==d[0][3]&&0==d[1][2]&&0==d[1][3]&&0==d[2][0]&&0==d[2][1]&&1==d[2][2]&&0==d[2][3]&&0==d[3][2]&&1==d[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 Do(t){return t.toFixed(6).replace(".000000","")}function Fo(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=_o(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=_o(e)),null===n[0]||null===r[0]?[[!1],[!0],function(n){return n?e[0].d:t[0].d}]:(n[0].push(0),r[0].push(1),[n,r,function(t){var e=function(t,e,n){var r=function(t,e){for(var n=0,r=0;t.length>r;r++)n+=t[r]*e[r];return n}(t,e);r=L(r,-1,1);var i=[];if(1===r)i=t;else for(var o=Math.acos(r),a=1*Math.sin(n*o)/Math.sqrt(1-r*r),s=0;4>s;s++)i.push(t[s]*(Math.cos(n*o)-r*a)+e[s]*a);return i}(n[0][3],r[0][3],t[5]);return Io(t[0],t[1],t[2],e,t[4]).map(Do).join(",")}])}function Bo(t){return t.replace(/[xy]/,"")}function jo(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function Go(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(n){var r=t[n],i=r.t,o=r.d,a="scale"===i.substring(0,5)?1:0;e.push({t:i,d:o.map((function(t){return"number"==typeof t?Ti(a):Ti(a,t.unit)}))})},o=0;t.length>o;o++)i(o)}var a,s,u=[],l=[],c=[];if(t.length!==e.length)u=[(m=Fo(t,e))[0]],l=[m[1]],c=[["matrix",[m[2]]]];else for(o=0;t.length>o;o++){var h=t[o].t,p=e[o].t,f=t[o].d,d=e[o].d,y=Ao[h],v=Ao[p],g=void 0;if(s=p,"perspective"===(a=h)&&"perspective"===s||!("matrix"!==a&&"matrix3d"!==a||"matrix"!==s&&"matrix3d"!==s)){var m=Fo([t[o]],[e[o]]);u.push(m[0]),l.push(m[1]),c.push(["matrix",[m[2]]])}else{if(h===p)g=h;else if(y[2]&&v[2]&&Bo(h)===Bo(p))g=Bo(h),f=y[2](f),d=v[2](d);else{if(!y[1]||!v[1]||jo(h)!==jo(p)){u=[(m=Fo(t,e))[0]],l=[m[1]],c=[["matrix",[m[2]]]];break}g=jo(h),f=y[1](f),d=v[1](d)}for(var x=[],b=[],M=[],w=0;f.length>w;w++){m=Zi(f[w],d[w],n,!1,w);x[w]=m[0],b[w]=m[1],M.push(m[2])}u.push(x),l.push(b),c.push([g,M])}}if(r){var E=u;u=l,l=E}return[u,l,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return c[e][1][n](t)})).join(",");return"matrix"===c[e][0]&&16===n.split(",").length&&(c[e][0]="matrix3d"),"matrix3d"===c[e][0]&&6===n.split(",").length&&(c[e][0]="matrix"),c[e][0]+"("+n+")"})).join(" ")}]}var Yo=qr((function(t){if(P(t)){if("text-anchor"===t)return[Ti(0,"px"),Ti(0,"px")];var e=t.split(" ");return 1===e.length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[Hi(Vo(e[0])),Hi(Vo(e[1]))]}return[Ti(t[0]||0,"px"),Ti(t[1]||0,"px")]}));function Vo(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var Wo=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:Ci.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:Ci.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:Ci.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:Ci.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:Ci.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:Ci.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:Ci.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:Ci.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:Ci.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:Ci.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:Ci.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:Ci.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:Ci.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:Ci.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:Ci.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:Ci.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:Ci.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:Ci.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:Ci.FILTER},{n:"clipPath",syntax:Ci.DEFINED_PATH},{n:"textPath",syntax:Ci.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:Ci.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:Ci.TRANSFORM},{n:"transformOrigin",p:100,d:function(t){return t===sr.CIRCLE||t===sr.ELLIPSE?"center":t===sr.TEXT?"text-anchor":"left top"},l:!0,syntax:Ci.TRANSFORM_ORIGIN},{n:"anchor",p:99,d:function(t){return t===sr.CIRCLE||t===sr.ELLIPSE?"0.5 0.5":"0 0"},l:!0,syntax:Ci.LENGTH_PERCENTAGE_12},{n:"cx",int:!0,d:"0",syntax:Ci.COORDINATE},{n:"cy",int:!0,d:"0",syntax:Ci.COORDINATE},{n:"cz",int:!0,d:"0",syntax:Ci.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:Ci.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:Ci.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:Ci.LENGTH_PERCENTAGE},{n:"x",int:!0,d:"0",syntax:Ci.COORDINATE},{n:"y",int:!0,d:"0",syntax:Ci.COORDINATE},{n:"z",int:!0,d:"0",syntax:Ci.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Ci.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Ci.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:Ci.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:Ci.COORDINATE},{n:"y1",int:!0,l:!0,syntax:Ci.COORDINATE},{n:"z1",int:!0,l:!0,syntax:Ci.COORDINATE},{n:"x2",int:!0,l:!0,syntax:Ci.COORDINATE},{n:"y2",int:!0,l:!0,syntax:Ci.COORDINATE},{n:"z2",int:!0,l:!0,syntax:Ci.COORDINATE},{n:"path",int:!0,l:!0,d:"",a:["d"],syntax:Ci.PATH,p:50},{n:"points",int:!0,l:!0,syntax:Ci.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:Ci.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:Ci.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:Ci.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:Ci.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:Ci.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:Ci.NUMBER,d:function(t){return t===sr.PATH||t===sr.POLYGON||t===sr.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:Ci.MARKER},{n:"markerEnd",syntax:Ci.MARKER},{n:"markerMid",syntax:Ci.MARKER},{n:"markerStartOffset",syntax:Ci.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:Ci.LENGTH,l:!0,int:!0,d:"0"}],Xo=Wo.filter((function(t){return!!t.l})).map((function(t){return t.n})),zo={},Uo=new WeakMap,Ho=function(){function t(t){var e=this;this.runtime=t,Wo.forEach((function(t){e.registerMetadata(t)}))}return t.prototype.registerMetadata=function(t){l([t.n],u(t.a||[]),!1).forEach((function(e){zo[e]=t}))},t.prototype.unregisterMetadata=function(t){delete zo[t]},t.prototype.getPropertySyntax=function(t){return this.runtime.CSSPropertySyntaxFactory[t]},t.prototype.processProperties=function(t,e,n){var i=this;if(void 0===n&&(n={skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[]}),!this.runtime.enableCSSParsing){Object.assign(t.attributes,e);var o=Object.keys(e),a=t.parsedStyle.clipPath,s=t.parsedStyle.offsetPath;t.parsedStyle=Object.assign(t.parsedStyle,e);var u=!!n.forceUpdateGeometry;if(!u)for(var l=0;Xo.length>l;l++)if(Xo[l]in e){u=!0;break}return e.fill&&(t.parsedStyle.fill=Wi(e.fill)),e.stroke&&(t.parsedStyle.stroke=Wi(e.stroke)),e.shadowColor&&(t.parsedStyle.shadowColor=Wi(e.shadowColor)),e.filter&&(t.parsedStyle.filter=eo(e.filter)),p(e.radius)||(t.parsedStyle.radius=$i(e.radius,4)),p(e.lineDash)||(t.parsedStyle.lineDash=$i(e.lineDash,2)),e.points&&(t.parsedStyle.points=So(e.points,t)),""===e.path&&(t.parsedStyle.path=r({},Ai)),e.path&&(t.parsedStyle.path=Eo(e.path),t.parsedStyle.defX=t.parsedStyle.path.rect.x,t.parsedStyle.defY=t.parsedStyle.path.rect.y),e.textTransform&&this.runtime.CSSPropertySyntaxFactory["<text-transform>"].calculator(null,null,{value:e.textTransform},t,null),e.clipPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("clipPath",a,e.clipPath,t,this.runtime),e.offsetPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("offsetPath",s,e.offsetPath,t,this.runtime),e.anchor&&(t.parsedStyle.anchor=$i(e.anchor,2)),e.transform&&(t.parsedStyle.transform=Oo(e.transform)),e.transformOrigin&&(t.parsedStyle.transformOrigin=Yo(e.transformOrigin)),e.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,e.markerStart,e.markerStart,null,null)),e.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,e.markerEnd,e.markerEnd,null,null)),e.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator("",e.markerMid,e.markerMid,null,null)),(t.nodeName!==sr.CIRCLE&&t.nodeName!==sr.ELLIPSE||p(e.cx)&&p(e.cy))&&(t.nodeName!==sr.RECT&&t.nodeName!==sr.IMAGE&&t.nodeName!==sr.GROUP&&t.nodeName!==sr.HTML&&t.nodeName!==sr.TEXT&&t.nodeName!==sr.MESH||p(e.x)&&p(e.y)&&p(e.z))&&(t.nodeName!==sr.LINE||p(e.x1)&&p(e.y1)&&p(e.z1)&&p(e.x2)&&p(e.y2)&&p(e.z2))||this.runtime.CSSPropertySyntaxFactory["<coordinate>"].postProcessor(t,o),p(e.zIndex)||this.runtime.CSSPropertySyntaxFactory["<z-index>"].postProcessor(t,o),e.path&&this.runtime.CSSPropertySyntaxFactory["<path>"].postProcessor(t,o),e.points&&this.runtime.CSSPropertySyntaxFactory["<list-of-points>"].postProcessor(t,o),p(e.offsetDistance)||this.runtime.CSSPropertySyntaxFactory["<offset-distance>"].postProcessor(t,o),e.transform&&this.runtime.CSSPropertySyntaxFactory["<transform>"].postProcessor(t,o),void(u&&this.updateGeometry(t))}var c=n.skipUpdateAttribute,h=n.skipParse,f=n.usedAttributes,d=n.forceUpdateGeometry,y=Object.keys(e);y.forEach((function(n){var r;c||(t.attributes[n]=e[n]),!d&&(null===(r=zo[n])||void 0===r?void 0:r.l)&&(d=!0)})),h||y.forEach((function(e){t.computedStyle[e]=i.parseProperty(e,t.attributes[e],t)})),(null==f?void 0:f.length)&&(y=Array.from(new Set(y.concat(f)))),y.forEach((function(e){e in t.computedStyle&&(t.parsedStyle[e]=i.computeProperty(e,t.computedStyle[e],t))})),d&&this.updateGeometry(t),y.forEach((function(e){e in t.parsedStyle&&i.postProcessProperty(e,t,y)})),this.runtime.enableCSSParsing&&t.children.length&&y.forEach((function(e){e in t.parsedStyle&&i.isPropertyInheritable(e)&&t.children.forEach((function(t){t.internalSetAttribute(e,null,{skipUpdateAttribute:!0,skipParse:!0})}))}))},t.prototype.parseProperty=function(t,e,n){var r=zo[t],i=e;if((""===e||p(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)i=Ei(e);else if(r){var o=r.k,a=r.syntax,s=a&&this.getPropertySyntax(a);o&&o.indexOf(e)>-1?i=Ei(e):s&&s.parser&&(i=s.parser(e,n))}return i},t.prototype.computeProperty=function(t,e,n){var r=zo[t],i=e;if(r){var o=r.syntax,a=r.d;if(e instanceof ii){var s=e.value;if("unset"===s&&(s=r.inh&&!("g-root"===n.id)?"inherit":"initial"),"initial"===s)p(a)||(e=this.parseProperty(t,si(a)?a(n.nodeName):a,n));else if("inherit"===s){var u=this.tryToResolveProperty(n,t,{inherited:!0});return p(u)?void this.addUnresolveProperty(n,t):u}}var l=o&&this.getPropertySyntax(o);if(l&&l.calculator)i=l.calculator(t,n.parsedStyle[t],e,n,this.runtime);else i=e instanceof ii?e.value:e}return i},t.prototype.postProcessProperty=function(t,e,n){var r=zo[t];if(r&&r.syntax){var i=r.syntax&&this.getPropertySyntax(r.syntax);i&&i.postProcessor&&i.postProcessor(e,n)}},t.prototype.addUnresolveProperty=function(t,e){var n=Uo.get(t);n||(Uo.set(t,[]),n=Uo.get(t)),-1===n.indexOf(e)&&n.push(e)},t.prototype.tryToResolveProperty=function(t,e,n){if(void 0===n&&(n={}),n.inherited&&t.parentElement&&function(t,e){var n=Uo.get(t);return!n||0===n.length||n.includes(e)}(t.parentElement,e)){var r=t.parentElement.parsedStyle[e];if("unset"===r||"initial"===r||"inherit"===r)return;return r}},t.prototype.recalc=function(t){var e=Uo.get(t);if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),Uo.delete(t)}},t.prototype.updateGeometry=function(t){var e=t.nodeName,n=this.runtime.geometryUpdaterFactory[e];if(n){var r=t.geometry;r.contentBounds||(r.contentBounds=new Ar),r.renderBounds||(r.renderBounds=new Ar);var i=t.parsedStyle,o=n.update(i,t),a=o.width,s=o.height,u=o.depth,l=void 0===u?0:u,c=o.offsetX,h=void 0===c?0:c,p=o.offsetY,f=void 0===p?0:p,d=o.offsetZ,y=void 0===d?0:d,v=[Math.abs(a)/2,Math.abs(s)/2,l/2],g=i.stroke,m=i.lineWidth,x=i.increasedLineWidthForHitTesting,b=i.shadowType,M=i.shadowColor,w=i.filter,E=void 0===w?[]:w,k=i.transformOrigin,S=i.anchor;e===sr.TEXT?delete i.anchor:e===sr.MESH&&(i.anchor[2]=.5);var P=[(1-2*(S&&S[0]||0))*a/2+h,(1-2*(S&&S[1]||0))*s/2+f,(1-2*(S&&S[2]||0))*v[2]+y];if(r.contentBounds.update(P,v),g&&!g.isNone){var T=((m||0)+(x||0))*(e===sr.POLYLINE||e===sr.POLYGON||e===sr.PATH?Math.SQRT2:.5);v[0]+=T,v[1]+=T}if(r.renderBounds.update(P,v),M&&b&&"inner"!==b){var N=r.renderBounds,C=N.min,A=N.max,O=i.shadowBlur||0,R=i.shadowOffsetX||0,L=i.shadowOffsetY||0,_=A[0]+O+R,I=C[1]-O+L,D=A[1]+O+L;C[0]=Math.min(C[0],C[0]-O+R),A[0]=Math.max(A[0],_),C[1]=Math.min(C[1],I),A[1]=Math.max(A[1],D),r.renderBounds.setMinMax(C,A)}E.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var i=n[0].value;r.renderBounds.update(r.renderBounds.center,dr(r.renderBounds.halfExtents,r.renderBounds.halfExtents,[i,i,0]))}else if("drop-shadow"===e){var o=n[0].value,a=n[1].value,s=n[2].value,u=r.renderBounds,l=u.min,c=u.max,h=c[0]+s+o,p=l[1]-s+a,f=c[1]+s+a;l[0]=Math.min(l[0],l[0]-s+o),c[0]=Math.max(c[0],h),l[1]=Math.min(l[1],p),c[1]=Math.max(c[1],f),r.renderBounds.setMinMax(l,c)}})),S=i.anchor;var F=0>a,B=0>s,j=(F?-1:1)*(k?Qi(k[0],0,t):0),G=(B?-1:1)*(k?Qi(k[1],1,t):0);t.setOrigin(j-=(F?-1:1)*(S&&S[0]||0)*r.contentBounds.halfExtents[0]*2,G-=(B?-1:1)*(S&&S[1]||0)*r.contentBounds.halfExtents[1]*2),this.runtime.sceneGraphService.dirtifyToRoot(t)}},t.prototype.isPropertyInheritable=function(t){var e=zo[t];return!!e&&e.inh},t}(),qo=function(){function t(){this.parser=qi,this.parserWithCSSDisabled=null,this.mixer=io}return t.prototype.calculator=function(t,e,n,r){return Ki(n)},t}(),Zo=function(){function t(){}return t.prototype.calculator=function(t,e,n,r,i){return n instanceof ii&&(n=null),i.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach((function(t){0===t.childNodes.length&&i.sceneGraphService.dirtifyToRoot(t)})),n},t}(),Ko=function(){function t(){this.parser=Wi,this.parserWithCSSDisabled=Wi,this.mixer=Xi}return t.prototype.calculator=function(t,e,n,r){return n instanceof ii?"none"===n.value?ki:Si:n},t}(),$o=function(){function t(){this.parser=eo}return t.prototype.calculator=function(t,e,n){return n instanceof ii?[]:n},t}();function Jo(t){var e=t.parsedStyle.fontSize;return p(e)?null:e}var Qo=function(){function t(){this.parser=Hi,this.parserWithCSSDisabled=null,this.mixer=io}return t.prototype.calculator=function(t,e,n,r,i){var o;if(_(n))return n;if(!fi.isRelativeUnit(n.unit))return n.value;var a=i.styleValueRegistry;if(n.unit===Gr.kPercentage)return 0;if(n.unit===Gr.kEms){if(r.parentNode){if(s=Jo(r.parentNode))return s*=n.value;a.addUnresolveProperty(r,t)}else a.addUnresolveProperty(r,t);return 0}if(n.unit===Gr.kRems){if(null===(o=null==r?void 0:r.ownerDocument)||void 0===o?void 0:o.documentElement){var s;if(s=Jo(r.ownerDocument.documentElement))return s*=n.value;a.addUnresolveProperty(r,t)}else a.addUnresolveProperty(r,t);return 0}},t}(),ta=function(){function t(){this.mixer=ao}return t.prototype.parser=function(t){var e=Ji(_(t)?[t]:t);return 1===e.length?[e[0],e[0]]:[e[0],e[1]]},t.prototype.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),ea=function(){function t(){this.mixer=ao}return t.prototype.parser=function(t){var e=Ji(_(t)?[t]:t);return 1===e.length?[e[0],e[0],e[0],e[0]]:2===e.length?[e[0],e[1],e[0],e[1]]:3===e.length?[e[0],e[1],e[2],e[1]]:[e[0],e[1],e[2],e[3]]},t.prototype.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),na=lt();function ra(t,e){var n=e.parsedStyle.defX||0,r=e.parsedStyle.defY||0;return e.resetLocalTransform(),e.setLocalPosition(n,r),t.forEach((function(t){var i=t.t,o=t.d;if("scale"===i){var a=(null==o?void 0:o.map((function(t){return t.value})))||[1,1];e.scaleLocal(a[0],a[1],1)}else if("scalex"===i){a=(null==o?void 0:o.map((function(t){return t.value})))||[1];e.scaleLocal(a[0],1,1)}else if("scaley"===i){a=(null==o?void 0:o.map((function(t){return t.value})))||[1];e.scaleLocal(1,a[0],1)}else if("scalez"===i){a=(null==o?void 0:o.map((function(t){return t.value})))||[1];e.scaleLocal(1,1,a[0])}else if("scale3d"===i){a=(null==o?void 0:o.map((function(t){return t.value})))||[1,1,1];e.scaleLocal(a[0],a[1],a[2])}else if("translate"===i){e.translateLocal((s=o||[di,di])[0].value,s[1].value,0)}else if("translatex"===i){e.translateLocal((s=o||[di])[0].value,0,0)}else if("translatey"===i){e.translateLocal(0,(s=o||[di])[0].value,0)}else if("translatez"===i){e.translateLocal(0,0,(s=o||[di])[0].value)}else if("translate3d"===i){var s;e.translateLocal((s=o||[di,di,di])[0].value,s[1].value,s[2].value)}else if("rotate"===i){e.rotateLocal(0,0,Ki((o||[gi])[0]))}else if("rotatex"===i){e.rotateLocal(Ki((o||[gi])[0]),0,0)}else if("rotatey"===i){e.rotateLocal(0,Ki((o||[gi])[0]),0)}else if("rotatez"===i){e.rotateLocal(0,0,Ki((o||[gi])[0]))}else if("rotate3d"===i);else if("skew"===i){var c=(null==o?void 0:o.map((function(t){return t.value})))||[0,0];e.setLocalSkew(mr(c[0]),mr(c[1]))}else if("skewx"===i){c=(null==o?void 0:o.map((function(t){return t.value})))||[0];e.setLocalSkew(mr(c[0]),e.getLocalSkew()[1])}else if("skewy"===i){c=(null==o?void 0:o.map((function(t){return t.value})))||[0];e.setLocalSkew(e.getLocalSkew()[0],mr(c[0]))}else if("matrix"===i){var h=u(o.map((function(t){return t.value})),6);e.setLocalTransform(ht(na,h[0],h[1],0,0,h[2],h[3],0,0,0,0,1,0,h[4]+n,h[5]+r,0,1))}else"matrix3d"===i&&(ht.apply(It,l([na],u(o.map((function(t){return t.value}))),!1)),na[12]+=n,na[13]+=r,e.setLocalTransform(na))})),e.getLocalTransform()}var ia=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.postProcessor=function(t,e){var n,r,i;switch(t.nodeName){case sr.CIRCLE:case sr.ELLIPSE:var o=t.parsedStyle,a=o.cx,s=o.cy,l=o.cz;p(a)||(n=a),p(s)||(r=s),p(l)||(i=l);break;case sr.LINE:var c=t.parsedStyle,h=c.y1,f=c.y2;n=Math.min(c.x1,c.x2),r=Math.min(h,f),i=0;break;case sr.RECT:case sr.IMAGE:case sr.GROUP:case sr.HTML:case sr.TEXT:case sr.MESH:p(t.parsedStyle.x)||(n=t.parsedStyle.x),p(t.parsedStyle.y)||(r=t.parsedStyle.y),p(t.parsedStyle.z)||(i=t.parsedStyle.z)}if(t.nodeName!==sr.PATH&&t.nodeName!==sr.POLYLINE&&t.nodeName!==sr.POLYGON&&(t.parsedStyle.defX=n||0,t.parsedStyle.defY=r||0),(!p(n)||!p(r)||!p(i))&&-1===e.indexOf("transform")){var d=t.parsedStyle.transform;if(d&&d.length)ra(d,t);else{var y=u(t.getLocalPosition(),3),v=y[0],g=y[1],m=y[2];t.setLocalPosition(p(n)?v:n,p(r)?g:r,p(i)?m:i)}}},e}(Qo),oa=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){n instanceof ii&&(n=null);var i=null==n?void 0:n.cloneNode(!0);return i&&(i.style.isMarker=!0),i},t}(),aa=function(){function t(){this.mixer=io,this.parser=ro,this.parserWithCSSDisabled=null}return t.prototype.calculator=function(t,e,n){return n.value},t}(),sa=function(){function t(){this.parser=ro,this.parserWithCSSDisabled=null,this.mixer=oo(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t.prototype.postProcessor=function(t){var e=t.parsedStyle,n=e.offsetPath;if(n){var r=n.nodeName;if(r===sr.LINE||r===sr.PATH||r===sr.POLYLINE){var i=n.getPoint(e.offsetDistance);i&&(t.parsedStyle.defX=i.x,t.parsedStyle.defY=i.y,t.setLocalPosition(i.x,i.y))}}},t}(),ua=function(){function t(){this.parser=ro,this.parserWithCSSDisabled=null,this.mixer=oo(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t}(),la=function(){function t(){this.parser=Eo,this.parserWithCSSDisabled=Eo,this.mixer=ko}return t.prototype.calculator=function(t,e,n){return n instanceof ii&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Fr(0,0,0,0)}:n},t.prototype.postProcessor=function(t,e){if(t.parsedStyle.defX=t.parsedStyle.path.rect.x,t.parsedStyle.defY=t.parsedStyle.path.rect.y,t.nodeName===sr.PATH&&-1===e.indexOf("transform")){var n=t.parsedStyle,r=n.defX,i=n.defY;t.setLocalPosition(void 0===r?0:r,void 0===i?0:i)}},t}(),ca=function(){function t(){this.parser=So,this.mixer=Po}return t.prototype.postProcessor=function(t,e){if((t.nodeName===sr.POLYGON||t.nodeName===sr.POLYLINE)&&-1===e.indexOf("transform")){var n=t.parsedStyle;t.setLocalPosition(n.defX,n.defY)}},t}(),ha=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.mixer=oo(0,1/0),e}return n(e,t),e}(Qo),pa=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){return n instanceof ii?"unset"===n.value?"":n.value:"".concat(n)},t.prototype.postProcessor=function(t){t.nodeValue="".concat(t.parsedStyle.text)||""},t}(),fa=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){var i=r.getAttribute("text");if(i){var o=i;"capitalize"===n.value?o=i.charAt(0).toUpperCase()+i.slice(1):"lowercase"===n.value?o=i.toLowerCase():"uppercase"===n.value&&(o=i.toUpperCase()),r.parsedStyle.text=o}return n.value},t}(),da={},ya=0;var va="undefined"!=typeof window&&void 0!==window.document;function ga(t){return!!t.getAttribute}function ma(t,e){var n=Number(t.parsedStyle.zIndex),r=Number(e.parsedStyle.zIndex);if(n===r){var i=t.parentNode;if(i){var o=i.childNodes||[];return o.indexOf(t)-o.indexOf(e)}}return n-r}function xa(t){var e,n=t;do{if(null===(e=n.parsedStyle)||void 0===e?void 0:e.clipPath)return n;n=n.parentElement}while(null!==n);return null}function ba(t,e){if(va)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var Ma={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},wa="object"==typeof performance&&performance.now?performance:Date;function Ea(t,e,n){var r=!1,i=!1;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=!!e&&!e.isNone,i=!!n&&!n.isNone):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(r=!0,i=!0),[r,i]}var ka=1,Sa="object"==typeof self&&self.self==self?self:"object"==typeof global&&global.global==global?global:{},Pa=Date.now(),Ta={},Na=Date.now(),Ca=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var e=Date.now(),n=e-Na,r=n>16?0:16-n,i=ka++;return Ta[i]=t,Object.keys(Ta).length>1||setTimeout((function(){Na=e;var t=Ta;Ta={},Object.keys(t).forEach((function(e){return t[e](Sa.performance&&"function"==typeof Sa.performance.now?Sa.performance.now():Date.now()-Pa)}))}),r),i},Aa=function(t){delete Ta[t]},Oa=function(t){return"string"!=typeof t?Ca:""===t?Sa.requestAnimationFrame:Sa[t+"RequestAnimationFrame"]},Ra=function(t,e){for(var n=0;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}}(["","webkit","moz","ms","o"],(function(t){return!!Oa(t)})),La=Oa(Ra),_a=function(t){return"string"!=typeof t?Aa:""===t?Sa.cancelAnimationFrame:Sa[t+"CancelAnimationFrame"]||Sa[t+"CancelRequestAnimationFrame"]}(Ra);Sa.requestAnimationFrame=La,Sa.cancelAnimationFrame=_a;var Ia=function(){function t(){this.callbacks=[]}return t.prototype.getCallbacksNum=function(){return this.callbacks.length},t.prototype.tapPromise=function(t,e){this.callbacks.push(e)},t.prototype.promise=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return Promise.all(this.callbacks.map((function(e){return e.apply(void 0,l([],u(t),!1))})))},t}(),Da=function(){function t(){this.callbacks=[]}return t.prototype.tapPromise=function(t,e){this.callbacks.push(e)},t.prototype.promise=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return o(this,void 0,void 0,(function(){var e,n,r;return a(this,(function(i){switch(i.label){case 0:return this.callbacks.length?[4,(r=this.callbacks)[0].apply(r,l([],u(t),!1))]:[3,6];case 1:e=i.sent(),n=0,i.label=2;case 2:return this.callbacks.length-1>n?[4,(0,this.callbacks[n])(e)]:[3,5];case 3:e=i.sent(),i.label=4;case 4:return n++,[3,2];case 5:return[2,e];case 6:return[2,null]}}))}))},t}(),Fa=function(){function t(){this.callbacks=[]}return t.prototype.tap=function(t,e){this.callbacks.push(e)},t.prototype.call=function(){var t=arguments;this.callbacks.forEach((function(e){e.apply(void 0,t)}))},t}(),Ba=function(){function t(){this.callbacks=[]}return t.prototype.tap=function(t,e){this.callbacks.push(e)},t.prototype.call=function(){if(this.callbacks.length){for(var t=this.callbacks[0].apply(void 0,arguments),e=0;this.callbacks.length-1>e;e++){t=(0,this.callbacks[e])(t)}return t}return null},t}(),ja=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Ga=/([\"\'])[^\'\"]+\1/;var Ya=function(){function t(){this.parser=Oo,this.parserWithCSSDisabled=Oo,this.mixer=Go}return t.prototype.calculator=function(t,e,n,r){return n instanceof ii?[]:n},t.prototype.postProcessor=function(t){ra(t.parsedStyle.transform,t)},t}(),Va=function(){this.parser=Yo},Wa=function(){function t(){this.parser=ro}return t.prototype.calculator=function(t,e,n,r){return n.value},t.prototype.postProcessor=function(t){if(t.parentNode){var e=t.parentNode,n=e.renderable,r=e.sortable;n&&(n.dirty=!0),r&&(r.dirty=!0,r.dirtyReason=vi.Z_INDEX_CHANGED)}},t}(),Xa=function(){function t(){}return t.prototype.update=function(t,e){var n=t.r;return{width:2*n,height:2*n}},t}(),za=function(){function t(){}return t.prototype.update=function(t,e){return{width:2*t.rx,height:2*t.ry}},t}(),Ua=function(){function t(){}return t.prototype.update=function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,o=Math.min(e,r),a=Math.max(e,r),s=Math.min(n,i);return{width:a-o,height:Math.max(n,i)-s}},t}(),Ha=function(){function t(){}return t.prototype.update=function(t){var e=t.path.rect;return{width:e.width,height:e.height}},t}(),qa=function(){function t(){}return t.prototype.update=function(t){if(t.points&&y(t.points.points)){var e=t.points.points,n=Math.min.apply(Math,l([],u(e.map((function(t){return t[0]}))),!1)),r=Math.max.apply(Math,l([],u(e.map((function(t){return t[0]}))),!1)),i=Math.min.apply(Math,l([],u(e.map((function(t){return t[1]}))),!1));return{width:r-n,height:Math.max.apply(Math,l([],u(e.map((function(t){return t[1]}))),!1))-i}}return{width:0,height:0}},t}(),Za=function(){function t(){}return t.prototype.update=function(t,e){var n=t.img,r=t.width,i=t.height,o=void 0===r?0:r,a=void 0===i?0:i;return n&&!P(n)&&(o||(t.width=o=n.width),a||(t.height=a=n.height)),{width:o,height:a}},t}(),Ka=function(){function t(t){this.globalRuntime=t}return t.prototype.isReadyToMeasure=function(t,e){return t.text&&t.fontSize&&t.fontStyle&&t.fontWeight&&t.fontVariant&&t.textAlign&&t.textBaseline&&!p(t.lineWidth)},t.prototype.update=function(t,e){var n,r,i=t.text,o=t.textAlign,a=t.lineWidth,s=t.textBaseline,u=t.dx,l=t.dy;if(!this.isReadyToMeasure(t,e))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{width:0,height:0,x:0,y:0,offsetX:0,offsetY:0};var c=((null===(r=null===(n=null==e?void 0:e.ownerDocument)||void 0===n?void 0:n.defaultView)||void 0===r?void 0:r.getConfig())||{}).offscreenCanvas,h=this.globalRuntime.textService.measureText(i,t,c);t.metrics=h;var p=[h.width/2,h.height/2,0],f=[0,1],d=0;"center"===o||"middle"===o?(d=a/2,f=[.5,1]):"right"!==o&&"end"!==o||(d=a,f=[1,1]);var y=0;return"middle"===s?y=p[1]:"top"===s||"hanging"===s?y=2*p[1]:"alphabetic"===s?y=this.globalRuntime.enableCSSParsing?h.lineHeight-h.fontProperties.ascent:0:"bottom"!==s&&"ideographic"!==s||(y=0),u&&(d+=u),l&&(y+=l),t.anchor=[f[0],f[1],0],{width:2*p[0],height:2*p[1],offsetX:d,offsetY:y}},t}();var $a,Ja=function(){function t(e){this.eventPhase=t.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Dr,this.page=new Dr,this.canvas=new Dr,this.viewport=new Dr,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}return Object.defineProperty(t.prototype,"name",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layerX",{get:function(){return this.layer.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layerY",{get:function(){return this.layer.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageX",{get:function(){return this.page.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageY",{get:function(){return this.page.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasX",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasY",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportX",{get:function(){return this.viewport.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportY",{get:function(){return this.viewport.y},enumerable:!1,configurable:!0}),t.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(t.prototype,"propagationPath",{get:function(){return this.composedPath()},enumerable:!1,configurable:!0}),t.prototype.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},t.prototype.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t.prototype.initEvent=function(){},t.prototype.initUIEvent=function(){},t.prototype.clone=function(){throw Error(Br)},t}(),Qa=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.client=new Dr,e.movement=new Dr,e.offset=new Dr,e.global=new Dr,e.screen=new Dr,e}return n(e,t),Object.defineProperty(e.prototype,"clientX",{get:function(){return this.client.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clientY",{get:function(){return this.client.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"movementX",{get:function(){return this.movement.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"movementY",{get:function(){return this.movement.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsetX",{get:function(){return this.offset.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsetY",{get:function(){return this.offset.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalX",{get:function(){return this.global.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalY",{get:function(){return this.global.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"screenX",{get:function(){return this.screen.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"screenY",{get:function(){return this.screen.y},enumerable:!1,configurable:!0}),e.prototype.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},e.prototype.initMouseEvent=function(){throw Error(Br)},e}(Ja),ts=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.width=0,e.height=0,e.isPrimary=!1,e}return n(e,t),e.prototype.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},e.prototype.getPredictedEvents=function(){throw Error("getPredictedEvents is not supported!")},e.prototype.clone=function(){return this.manager.clonePointerEvent(this)},e}(Qa),es=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},e}(Qa),ns=function(t){function e(e,n){var r=t.call(this,null)||this;return r.type=e,r.detail=n,Object.assign(r,n),r}return n(e,t),e}(Ja),rs=function(){function t(){this.emitter=new hn}return t.prototype.on=function(t,e,n){return this.addEventListener(t,e,n),this},t.prototype.addEventListener=function(t,e,n){var r=G(n)&&n||v(n)&&n.capture,i=v(n)&&n.once,o=si(e)?void 0:e,a=!1,s="";if(t.indexOf(":")>-1){var c=u(t.split(":"),2);t=c[1],s=c[0],a=!0}if(t=r?"".concat(t,"capture"):t,e=si(e)?e:e.handleEvent,a){var h=e;e=function(){for(var t,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];(null===(t=e[0].target)||void 0===t?void 0:t.name)===s&&h.apply(void 0,l([],u(e),!1))}}return i?this.emitter.once(t,e,o):this.emitter.on(t,e,o),this},t.prototype.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},t.prototype.removeAllEventListeners=function(){this.emitter.removeAllListeners()},t.prototype.removeEventListener=function(t,e,n){var r=G(n)&&n||v(n)&&n.capture,i=si(e)?void 0:e;return t=r?"".concat(t,"capture"):t,e=si(e)?e:null==e?void 0:e.handleEvent,this.emitter.off(t,e,i),this},t.prototype.emit=function(t,e){this.dispatchEvent(new ns(t,e))},t.prototype.dispatchEvent=function(t,e){var n,r,i;if(void 0===e&&(e=!1),!t.type)throw Error("DisplayObject cannot propagate events outside of the Federated Events API");if(i=this.document?this:this.defaultView?this.defaultView:null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView){if(t.manager=i.getEventService()||null,!t.manager)return!1;t.defaultPrevented=!1,t.path=[],e||(t.target=this),null===(r=t.manager)||void 0===r||r.dispatchEvent(t,t.type,e)}return!t.defaultPrevented},t}(),is=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.shadow=!1,e.ownerDocument=null,e.isConnected=!1,e.baseURI="",e.childNodes=[],e.nodeType=0,e.nodeName="",e.nodeValue=null,e.parentNode=null,e}return n(e,t),e.isNode=function(t){return!!t.childNodes},Object.defineProperty(e.prototype,"textContent",{get:function(){var t,e,n="";this.nodeName===sr.TEXT&&(n+=this.style.text);try{for(var r=s(this.childNodes),i=r.next();!i.done;i=r.next()){var o=i.value;n+=o.nodeName===sr.TEXT?o.nodeValue:o.textContent}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return n},set:function(t){var e=this;this.childNodes.slice().forEach((function(t){e.removeChild(t)})),this.nodeName===sr.TEXT&&(this.style.text="".concat(t))},enumerable:!1,configurable:!0}),e.prototype.getRootNode=function(t){return void 0===t&&(t={}),this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this},e.prototype.hasChildNodes=function(){return this.childNodes.length>0},e.prototype.isDefaultNamespace=function(t){throw Error(Br)},e.prototype.lookupNamespaceURI=function(t){throw Error(Br)},e.prototype.lookupPrefix=function(t){throw Error(Br)},e.prototype.normalize=function(){throw Error(Br)},e.prototype.isEqualNode=function(t){return this===t},e.prototype.isSameNode=function(t){return this.isEqualNode(t)},Object.defineProperty(e.prototype,"parent",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentElement",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstChild",{get:function(){return this.childNodes.length>0?this.childNodes[0]:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastChild",{get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null},enumerable:!1,configurable:!0}),e.prototype.compareDocumentPosition=function(t){var n;if(t===this)return 0;for(var r=t,i=this,o=[r],a=[i];null!==(n=r.parentNode)&&void 0!==n?n:i.parentNode;)r=r.parentNode?(o.push(r.parentNode),r.parentNode):r,i=i.parentNode?(a.push(i.parentNode),i.parentNode):i;if(r!==i)return e.DOCUMENT_POSITION_DISCONNECTED|e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|e.DOCUMENT_POSITION_PRECEDING;var s=o.length>a.length?o:a,u=s===o?a:o;if(s[s.length-u.length]===u[0])return s===o?e.DOCUMENT_POSITION_CONTAINED_BY|e.DOCUMENT_POSITION_FOLLOWING:e.DOCUMENT_POSITION_CONTAINS|e.DOCUMENT_POSITION_PRECEDING;for(var l=s.length-u.length,c=u.length-1;c>=0;c--){var h=u[c],p=s[l+c];if(p!==h){var f=h.parentNode.childNodes;return f.indexOf(h)<f.indexOf(p)?u===o?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING:s===o?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING}}return e.DOCUMENT_POSITION_FOLLOWING},e.prototype.contain=function(t){return this.contains(t)},e.prototype.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},e.prototype.getAncestor=function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e},e.prototype.forEach=function(t,e){void 0===e&&(e=!1),t(this)||(e?this.childNodes.slice():this.childNodes).forEach((function(e){e.forEach(t)}))},e.DOCUMENT_POSITION_DISCONNECTED=1,e.DOCUMENT_POSITION_PRECEDING=2,e.DOCUMENT_POSITION_FOLLOWING=4,e.DOCUMENT_POSITION_CONTAINS=8,e.DOCUMENT_POSITION_CONTAINED_BY=16,e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32,e}(rs),os=function(){function t(t,e){var n=this;this.globalRuntime=t,this.context=e,this.emitter=new hn,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=lt(),this.tmpVec3=Dt(),this.onPointerDown=function(t){var e=n.createPointerEvent(t);if(n.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)n.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){n.dispatchEvent(e,2===e.button?"rightdown":"mousedown")}n.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),n.freeEvent(e)},this.onPointerUp=function(t){var e,r=wa.now(),i=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);if(n.dispatchEvent(i,"pointerup"),"touch"===i.pointerType)n.dispatchEvent(i,"touchend");else if("mouse"===i.pointerType||"pen"===i.pointerType){n.dispatchEvent(i,2===i.button?"rightup":"mouseup")}var o=n.trackingData(t.pointerId),a=n.findMountedTarget(o.pressTargetsByButton[t.button]),s=a;if(a&&!i.composedPath().includes(a)){for(var u=a;u&&!i.composedPath().includes(u);){if(i.currentTarget=u,n.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType)n.notifyTarget(i,"touchendoutside");else if("mouse"===i.pointerType||"pen"===i.pointerType){n.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside")}is.isNode(u)&&(u=u.parentNode)}delete o.pressTargetsByButton[t.button],s=u}if(s){var l=n.clonePointerEvent(i,"click");l.target=s,l.path=[],o.clicksByButton[t.button]||(o.clicksByButton[t.button]={clickCount:0,target:l.target,timeStamp:r});var c=o.clicksByButton[t.button];c.target===l.target&&200>r-c.timeStamp?++c.clickCount:c.clickCount=1,c.target=l.target,c.timeStamp=r,l.detail=c.clickCount,(null===(e=i.detail)||void 0===e?void 0:e.preventClick)||(n.context.config.useNativeClickEvent||"mouse"!==l.pointerType&&"touch"!==l.pointerType||n.dispatchEvent(l,"click"),n.dispatchEvent(l,"pointertap")),n.freeEvent(l)}n.freeEvent(i)},this.onPointerMove=function(t){var e=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0),r="mouse"===e.pointerType||"pen"===e.pointerType,i=n.trackingData(t.pointerId),o=n.findMountedTarget(i.overTargets);if(i.overTargets&&o!==e.target){var a=n.createPointerEvent(t,"mousemove"===t.type?"mouseout":"pointerout",o||void 0);if(n.dispatchEvent(a,"pointerout"),r&&n.dispatchEvent(a,"mouseout"),!e.composedPath().includes(o)){var s=n.createPointerEvent(t,"pointerleave",o||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&!e.composedPath().includes(s.target);)s.currentTarget=s.target,n.notifyTarget(s),r&&n.notifyTarget(s,"mouseleave"),is.isNode(s.target)&&(s.target=s.target.parentNode);n.freeEvent(s)}n.freeEvent(a)}if(o!==e.target){var u=n.clonePointerEvent(e,"mousemove"===t.type?"mouseover":"pointerover");n.dispatchEvent(u,"pointerover"),r&&n.dispatchEvent(u,"mouseover");for(var l=o&&is.isNode(o)&&o.parentNode;l&&l!==(is.isNode(n.rootTarget)&&n.rootTarget.parentNode)&&l!==e.target;)l=l.parentNode;if(!l||l===(is.isNode(n.rootTarget)&&n.rootTarget.parentNode)){var c=n.clonePointerEvent(e,"pointerenter");for(c.eventPhase=c.AT_TARGET;c.target&&c.target!==o&&c.target!==(is.isNode(n.rootTarget)&&n.rootTarget.parentNode);)c.currentTarget=c.target,n.notifyTarget(c),r&&n.notifyTarget(c,"mouseenter"),is.isNode(c.target)&&(c.target=c.target.parentNode);n.freeEvent(c)}n.freeEvent(u)}n.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&n.dispatchEvent(e,"touchmove"),r&&(n.dispatchEvent(e,"mousemove"),n.cursor=n.getCursor(e.target)),i.overTargets=e.composedPath(),n.freeEvent(e)},this.onPointerOut=function(t){var e=n.trackingData(t.pointerId);if(e.overTargets){var r="mouse"===t.pointerType||"pen"===t.pointerType,i=n.findMountedTarget(e.overTargets),o=n.createPointerEvent(t,"pointerout",i||void 0);n.dispatchEvent(o),r&&n.dispatchEvent(o,"mouseout");var a=n.createPointerEvent(t,"pointerleave",i||void 0);for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(is.isNode(n.rootTarget)&&n.rootTarget.parentNode);)a.currentTarget=a.target,n.notifyTarget(a),r&&n.notifyTarget(a,"mouseleave"),is.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=null,n.freeEvent(o),n.freeEvent(a)}n.cursor=null},this.onPointerOver=function(t){var e=n.trackingData(t.pointerId),r=n.createPointerEvent(t),i="mouse"===r.pointerType||"pen"===r.pointerType;n.dispatchEvent(r,"pointerover"),i&&n.dispatchEvent(r,"mouseover"),"mouse"===r.pointerType&&(n.cursor=n.getCursor(r.target));var o=n.clonePointerEvent(r,"pointerenter");for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==(is.isNode(n.rootTarget)&&n.rootTarget.parentNode);)o.currentTarget=o.target,n.notifyTarget(o),i&&n.notifyTarget(o,"mouseenter"),is.isNode(o.target)&&(o.target=o.target.parentNode);e.overTargets=r.composedPath(),n.freeEvent(r),n.freeEvent(o)},this.onPointerUpOutside=function(t){var e=n.trackingData(t.pointerId),r=n.findMountedTarget(e.pressTargetsByButton[t.button]),i=n.createPointerEvent(t);if(r){for(var o=r;o;)i.currentTarget=o,n.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType||"mouse"!==i.pointerType&&"pen"!==i.pointerType||n.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),is.isNode(o)&&(o=o.parentNode);delete e.pressTargetsByButton[t.button]}n.freeEvent(i)},this.onWheel=function(t){var e=n.createWheelEvent(t);n.dispatchEvent(e),n.freeEvent(e)},this.onClick=function(t){if(n.context.config.useNativeClickEvent){var e=n.createPointerEvent(t);n.dispatchEvent(e),n.freeEvent(e)}},this.onPointerCancel=function(t){var e=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);n.dispatchEvent(e),n.freeEvent(e)}}return t.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)},t.prototype.destroy=function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()},t.prototype.client2Viewport=function(t){var e=this.context.contextService.getBoundingClientRect();return new Dr(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))},t.prototype.viewport2Client=function(t){var e=this.context.contextService.getBoundingClientRect();return new Dr(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))},t.prototype.viewport2Canvas=function(t){var e=t.x,n=t.y,r=this.rootTarget.defaultView.getCamera(),i=this.context.config,o=i.width,a=i.height,s=r.getPerspectiveInverse(),u=r.getWorldTransform(),l=vt(this.tmpMatrix,u,s),c=Gt(this.tmpVec3,e/o*2-1,2*(1-n/a)-1,0);return Ut(c,c,l),new Dr(c[0],c[1])},t.prototype.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=vt(this.tmpMatrix,n,r),o=Gt(this.tmpVec3,t.x,t.y,0);Ut(this.tmpVec3,this.tmpVec3,i);var a=this.context.config;return new Dr((o[0]+1)/2*a.width,(1-(o[1]+1)/2)*a.height)},t.prototype.setPickHandler=function(t){this.pickHandler=t},t.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}))},t.prototype.mapEvent=function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,r=e.length;r>n;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for ".concat(t.type))}},t.prototype.dispatchEvent=function(t,e,n){n?(t.eventPhase=t.AT_TARGET,t.currentTarget=this.rootTarget.defaultView||null,this.notifyListeners(t,e)):(t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e));this.emitter.emit(e||t.type,t)},t.prototype.propagate=function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;r>=1;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var i=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(r=i+1;n.length>r;r++)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}},t.prototype.propagationPath=function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)return e.unshift(n.document),e;for(var r=0;2048>r&&t!==this.rootTarget;r++)is.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e},t.prototype.hitTest=function(t){var e=t.viewportX,n=t.viewportY,r=this.context.config;return 0>e||0>n||e>r.width||n>r.height?null:!r.disableHitTesting&&this.pickHandler(t)||this.rootTarget||null},t.prototype.isNativeEventFromCanvas=function(t){var e,n=this.context.contextService.getDomElement(),r=null===(e=t.nativeEvent)||void 0===e?void 0:e.target;if(r){if(r===n)return!0;if(n&&n.contains)return n.contains(r)}return!!t.nativeEvent.composedPath&&t.nativeEvent.composedPath().indexOf(n)>-1},t.prototype.getExistedHTML=function(t){var e,n;if(t.nativeEvent.composedPath)try{for(var r=s(t.nativeEvent.composedPath()),i=r.next();!i.done;i=r.next()){var o=this.globalRuntime.nativeHTMLMap.get(i.value);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},t.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})},t.prototype.createPointerEvent=function(t,e,n,r){var i=this.allocateEvent(ts);this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t;var o=this.getExistedHTML(i);return i.target=null!=n?n:o||this.isNativeEventFromCanvas(i)&&this.pickTarget(i)||r,"string"==typeof e&&(i.type=e),i},t.prototype.createWheelEvent=function(t){var e=this.allocateEvent(es);this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t;var n=this.getExistedHTML(e);return e.target=n||this.isNativeEventFromCanvas(e)&&this.pickTarget(e),e},t.prototype.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},t.prototype.cloneWheelEvent=function(t){var e=this.allocateEvent(es);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},t.prototype.clonePointerEvent=function(t,e){var n=this.allocateEvent(ts);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},t.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},t.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)},t.prototype.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},t.prototype.copyData=function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=wa.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)},t.prototype.allocateEvent=function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e},t.prototype.freeEvent=function(t){if(t.manager!==this)throw 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)},t.prototype.notifyTarget=function(t,e){e=null!=e?e:t.type,this.notifyListeners(t,t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(e,"capture"):e),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)},t.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;r.length>i&&!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)},t.prototype.findMountedTarget=function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;n>=0;n--){var r=t[n];if(!(r===this.rootTarget||is.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},t.prototype.getCursor=function(t){for(var e=t;e;){var n=ga(e)&&e.getAttribute("cursor");if(n)return n;e=is.isNode(e)&&e.parentNode}},t}(),as=function(){function t(){}return t.prototype.getOrCreateCanvas=function(t,e){if(this.canvas)return this.canvas;if(t||Es.offscreenCanvas)this.canvas=t||Es.offscreenCanvas,this.context=this.canvas.getContext("2d",r({willReadFrequently:!0},e));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",r({willReadFrequently:!0},e)),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",r({willReadFrequently:!0},e))}return this.canvas.width=10,this.canvas.height=10,this.canvas},t.prototype.getOrCreateContext=function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context},t}();!function(t){t[t.CAMERA_CHANGED=0]="CAMERA_CHANGED",t[t.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",t[t.NONE=2]="NONE"}($a||($a={}));var ss,us=function(){function t(t,e){this.globalRuntime=t,this.context=e,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new Fa,initAsync:new Ia,dirtycheck:new Ba,cull:new Ba,beginFrame:new Fa,beforeRender:new Fa,render:new Fa,afterRender:new Fa,endFrame:new Fa,destroy:new Fa,pick:new Da,pickSync:new Ba,pointerDown:new Fa,pointerUp:new Fa,pointerMove:new Fa,pointerOut:new Fa,pointerOver:new Fa,pointerWheel:new Fa,pointerCancel:new Fa,click:new Fa}}return t.prototype.init=function(t){var e=this,n=r(r({},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()}))},t.prototype.getStats=function(){return this.stats},t.prototype.disableDirtyRectangleRendering=function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has($a.CAMERA_CHANGED)},t.prototype.render=function(t,e){var n=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var r=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(r.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),r.renderReasons.size&&this.inited){r.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var i=1===r.renderReasons.size&&r.renderReasons.has($a.CAMERA_CHANGED),o=!t.disableRenderHooks||!(t.disableRenderHooks&&i);o&&this.renderDisplayObject(r.root,t,r),this.hooks.beginFrame.call(),o&&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()}},t.prototype.renderDisplayObject=function(t,e,n){var r=this,i=e.renderer.getConfig(),o=i.enableDirtyCheck,a=i.enableCulling;this.globalRuntime.enableCSSParsing&&this.globalRuntime.styleValueRegistry.recalc(t);var s=o?t.renderable.dirty||n.dirtyRectangleRenderingDisabled?t:null:t;if(s){var u=a?this.hooks.cull.call(s,this.context.camera):s;u&&(this.stats.rendered++,n.renderListCurrentFrame.push(u))}t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var l=t.sortable;l.dirty&&(this.sort(t,l),l.dirty=!1,l.dirtyChildren=[],l.dirtyReason=void 0),(l.sorted||t.childNodes).forEach((function(t){r.renderDisplayObject(t,e,n)}))},t.prototype.sort=function(t,e){e.sorted&&e.dirtyReason!==vi.Z_INDEX_CHANGED?e.dirtyChildren.forEach((function(n){if(-1===t.childNodes.indexOf(n)){var r=e.sorted.indexOf(n);0>r||e.sorted.splice(r,1)}else if(0===e.sorted.length)e.sorted.push(n);else{var i=function(t,e){for(var n=0,r=t.length;r>n;){var i=n+r>>>1;0>ma(t[i],e)?n=i+1:r=i}return n}(e.sorted,n);e.sorted.splice(i,0,n)}})):e.sorted=t.childNodes.slice().sort(ma)},t.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},t.prototype.dirtify=function(){this.context.renderingContext.renderReasons.add($a.DISPLAY_OBJECT_CHANGED)},t}(),ls=/\[\s*(.*)=(.*)\s*\]/,cs=function(){function t(){}return t.prototype.selectOne=function(t,e){var n=this;if(t.startsWith("."))return e.find((function(e){return((null==e?void 0:e.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.find((function(e){return e.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.find((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):null}return e.find((function(n){return e!==n&&n.nodeName===t}))},t.prototype.selectAll=function(t,e){var n=this;if(t.startsWith("."))return e.findAll((function(r){return e!==r&&((null==r?void 0:r.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.findAll((function(r){return e!==r&&r.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.findAll((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):[]}return e.findAll((function(n){return e!==n&&n.nodeName===t}))},t.prototype.is=function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var n=this.getAttribute(t),r=n.name,i=n.value;return"name"===r?e.name===i:this.attributeToString(e,r)===i}return e.nodeName===t},t.prototype.getIdOrClassname=function(t){return t.substring(1)},t.prototype.getAttribute=function(t){var e=t.match(ls),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}},t.prototype.attributeToString=function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return p(n)?"":n.toString?""+n:""},t}(),hs=function(t){function e(e,n,r,i,o,a,s,u){var l=t.call(this,null)||this;return l.relatedNode=n,l.prevValue=r,l.newValue=i,l.attrName=o,l.attrChange=a,l.prevParsedValue=s,l.newParsedValue=u,l.type=e,l}return n(e,t),e.ADDITION=2,e.MODIFICATION=1,e.REMOVAL=3,e}(Ja);function ps(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}!function(t){t.REPARENT="reparent",t.DESTROY="destroy",t.ATTR_MODIFIED="DOMAttrModified",t.INSERTED="DOMNodeInserted",t.REMOVED="removed",t.MOUNTED="DOMNodeInsertedIntoDocument",t.UNMOUNTED="DOMNodeRemovedFromDocument",t.BOUNDS_CHANGED="bounds-changed",t.CULLED="culled"}(ss||(ss={}));var fs,ds,ys,vs=new hs(ss.REPARENT,null,"","","",0,"",""),gs=function(){function t(t){var e,n,r,i,o,a,s,u,l=this;this.runtime=t,this.pendingEvents=[],this.boundsChangedEvent=new ns(ss.BOUNDS_CHANGED),this.rotate=(e=Jt(),function(t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof n&&(n=Bt(n,r,i));var o=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var a=Jt();re(a,n[0],n[1],n[2]);var s=l.getRotation(t),u=l.getRotation(t.parentNode);he(e,u),ne(e,e),te(a,e,a),te(o.localRotation,a,s),fe(o.localRotation,o.localRotation),l.dirtifyLocal(t,o)}else l.rotateLocal(t,n)}),this.rotateLocal=(n=Jt(),function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof e&&(e=Bt(e,r,i));var o=t.transformable;re(n,e[0],e[1],e[2]),pe(o.localRotation,o.localRotation,n),l.dirtifyLocal(t,o)}),this.setEulerAngles=(r=Jt(),function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=0),"number"==typeof e&&(e=Bt(e,n,i));var o=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){re(o.localRotation,e[0],e[1],e[2]);var a=l.getRotation(t.parentNode);he(r,ne(Jt(),a)),pe(o.localRotation,o.localRotation,r),l.dirtifyLocal(t,o)}else l.setLocalEulerAngles(t,e)}),this.translateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Bt(e,n,r));var i=t.transformable;Ht(e,Dt())||(function(t,e,n){var r=n[0],i=n[1],o=n[2],a=e[0],s=e[1],u=e[2],l=i*u-o*s,c=o*a-r*u,h=r*s-i*a,p=i*h-o*c,f=o*l-r*h,d=r*c-i*l,y=2*n[3];c*=y,h*=y,f*=2,d*=2,t[0]=a+(l*=y)+(p*=2),t[1]=s+c+f,t[2]=u+h+d}(e,e,i.localRotation),Yt(i.localPosition,i.localPosition,e),l.dirtifyLocal(t,i))},this.setPosition=(i=lt(),o=Dt(),function(t,e){var n=t.transformable;o[0]=e[0],o[1]=e[1],o[2]=e[2]||0,Ht(l.getPosition(t),o)||(jt(n.position,o),null!==t.parentNode&&t.parentNode.transformable?(ct(i,t.parentNode.transformable.worldTransform),dt(i,i),Ut(n.localPosition,o,i)):jt(n.localPosition,o),l.dirtifyLocal(t,n))}),this.setLocalPosition=function(){var t=Dt();return function(e,n){var r=e.transformable;t[0]=n[0],t[1]=n[1],t[2]=n[2]||0,Ht(r.localPosition,t)||(jt(r.localPosition,t),l.dirtifyLocal(e,r))}}(),this.translate=(a=Dt(),s=Dt(),u=Dt(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Gt(s,e,n,r)),Ht(e,a)||(Yt(u,l.getPosition(t),e),l.setPosition(t,u))}),this.setRotation=function(){var t=Jt();return function(e,n,r,i,o){var a=e.transformable;if("number"==typeof n&&(n=ce(n,r,i,o)),null!==e.parentNode&&e.parentNode.transformable){var s=l.getRotation(e.parentNode);he(t,s),ne(t,t),te(a.localRotation,t,n),fe(a.localRotation,a.localRotation),l.dirtifyLocal(e,a)}else l.setLocalRotation(e,n)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=function(){var t=lt(),e=Dt(),n=ce(0,0,0,1);return function(r){if(0!==r.localSkew[0]||0!==r.localSkew[1]){if(Tt(r.localTransform,r.localRotation,r.localPosition,Bt(1,1,1),r.origin),0!==r.localSkew[0]||0!==r.localSkew[1]){var i=pt(t);i[4]=Math.tan(r.localSkew[0]),i[1]=Math.tan(r.localSkew[1]),vt(r.localTransform,r.localTransform,i)}var o=Tt(t,n,e,r.localScale,r.origin);vt(r.localTransform,r.localTransform,o)}else Tt(r.localTransform,r.localRotation,r.localPosition,r.localScale,r.origin)}}()}return t.prototype.matches=function(t,e){return this.runtime.sceneGraphSelector.is(t,e)},t.prototype.querySelector=function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)},t.prototype.querySelectorAll=function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)},t.prototype.attach=function(t,e,n){var r,i,o=!1;t.parentNode&&(o=t.parentNode!==e,this.detach(t)),t.parentNode=e,p(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t);var a=e.sortable;((null===(r=null==a?void 0:a.sorted)||void 0===r?void 0:r.length)||(null===(i=t.style)||void 0===i?void 0:i.zIndex))&&(-1===a.dirtyChildren.indexOf(t)&&a.dirtyChildren.push(t),a.dirty=!0,a.dirtyReason=vi.ADDED);var s=t.transformable;s&&this.dirtifyWorld(t,s),s.frozen&&this.unfreezeParentToRoot(t),o&&t.dispatchEvent(vs)},t.prototype.detach=function(t){var e,n;if(t.parentNode){var r=t.transformable,i=t.parentNode.sortable;((null===(e=null==i?void 0:i.sorted)||void 0===e?void 0:e.length)||(null===(n=t.style)||void 0===n?void 0:n.zIndex))&&(-1===i.dirtyChildren.indexOf(t)&&i.dirtyChildren.push(t),i.dirty=!0,i.dirtyReason=vi.REMOVED);var o=t.parentNode.childNodes.indexOf(t);o>-1&&t.parentNode.childNodes.splice(o,1),r&&this.dirtifyWorld(t,r),t.parentNode=null}},t.prototype.getOrigin=function(t){return t.transformable.origin},t.prototype.setOrigin=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=[e,n,r]);var i=t.transformable;if(e[0]!==i.origin[0]||e[1]!==i.origin[1]||e[2]!==i.origin[2]){var o=i.origin;o[0]=e[0],o[1]=e[1],o[2]=e[2]||0,this.dirtifyLocal(t,i)}},t.prototype.setLocalEulerAngles=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Bt(e,n,r));var i=t.transformable;re(i.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,i)},t.prototype.scaleLocal=function(t,e){var n,r,i,o=t.transformable;n=o.localScale,r=o.localScale,i=Bt(e[0],e[1],e[2]||1),n[0]=r[0]*i[0],n[1]=r[1]*i[1],n[2]=r[2]*i[2],this.dirtifyLocal(t,o)},t.prototype.setLocalScale=function(t,e){var n=t.transformable,r=Bt(e[0],e[1],e[2]||n.localScale[2]);Ht(r,n.localScale)||(jt(n.localScale,r),this.dirtifyLocal(t,n))},t.prototype.setLocalRotation=function(t,e,n,r,i){"number"==typeof e&&(e=ce(e,n,r,i));var o=t.transformable;he(o.localRotation,e),this.dirtifyLocal(t,o)},t.prototype.setLocalSkew=function(t,e,n){"number"==typeof e&&(e=function(t,e){var n=new st(2);return n[0]=t,n[1]=e,n}(e,n));var r,i,o=t.transformable;(r=o.localSkew)[0]=(i=e)[0],r[1]=i[1],this.dirtifyLocal(t,o)},t.prototype.dirtifyLocal=function(t,e){e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))},t.prototype.dirtifyWorld=function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)},t.prototype.triggerPendingEvents=function(){var t=this,e=new Set,n=function(n,r){n.isConnected&&!e.has(n.entity)&&(t.boundsChangedEvent.detail=r,t.boundsChangedEvent.target=n,n.isMutationObserved?n.dispatchEvent(t.boundsChangedEvent):n.ownerDocument.defaultView.dispatchEvent(t.boundsChangedEvent,!0),e.add(n.entity))};this.pendingEvents.forEach((function(t){var e=u(t,2),r=e[0],i=e[1];i.affectChildren?r.forEach((function(t){n(t,i)})):n(r,i)})),this.clearPendingEvents(),e.clear()},t.prototype.clearPendingEvents=function(){this.pendingEvents=[]},t.prototype.dirtifyToRoot=function(t,e){void 0===e&&(e=!1);var n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)ps(n),n=n.parentNode;e&&t.forEach((function(t){ps(t)})),this.informDependentDisplayObjects(t),this.pendingEvents.push([t,{affectChildren:e}])},t.prototype.updateDisplayObjectDependency=function(t,e,n,r){if(e&&e!==n){var i=this.displayObjectDependencyMap.get(e);if(i&&i[t]){var o=i[t].indexOf(r);i[t].splice(o,1)}}if(n){var a=this.displayObjectDependencyMap.get(n);a||(this.displayObjectDependencyMap.set(n,{}),a=this.displayObjectDependencyMap.get(n)),a[t]||(a[t]=[]),a[t].push(r)}},t.prototype.informDependentDisplayObjects=function(t){var e=this,n=this.displayObjectDependencyMap.get(t);n&&Object.keys(n).forEach((function(t){n[t].forEach((function(n){e.dirtifyToRoot(n,!0),n.dispatchEvent(new hs(ss.ATTR_MODIFIED,n,e,e,t,hs.MODIFICATION,e,e)),n.isCustomElement&&n.isConnected&&n.attributeChangedCallback&&n.attributeChangedCallback(t,e,e)}))}))},t.prototype.getPosition=function(t){var e=t.transformable;return kt(e.position,this.getWorldTransform(t,e))},t.prototype.getRotation=function(t){var e=t.transformable;return Pt(e.rotation,this.getWorldTransform(t,e))},t.prototype.getScale=function(t){var e=t.transformable;return St(e.scaling,this.getWorldTransform(t,e))},t.prototype.getWorldTransform=function(t,e){return void 0===e&&(e=t.transformable),e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform},t.prototype.getLocalPosition=function(t){return t.transformable.localPosition},t.prototype.getLocalRotation=function(t){return t.transformable.localRotation},t.prototype.getLocalScale=function(t){return t.transformable.localScale},t.prototype.getLocalSkew=function(t){return t.transformable.localSkew},t.prototype.getLocalTransform=function(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform},t.prototype.setLocalTransform=function(t,e){var n=kt(Dt(),e),r=Pt(Jt(),e),i=St(Dt(),e);this.setLocalScale(t,i),this.setLocalPosition(t,n),this.setLocalRotation(t,r)},t.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])},t.prototype.getTransformedGeometryBounds=function(t,e,n){void 0===e&&(e=!1);var r=this.getGeometryBounds(t,e);if(Ar.isEmpty(r))return null;var i=n||new Ar;return i.setFromTransformedAABB(r,this.getWorldTransform(t)),i},t.prototype.getGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=t.geometry;return(e?n.renderBounds:n.contentBounds||null)||new Ar},t.prototype.getBounds=function(t,e){var n=this;void 0===e&&(e=!1);var r=t.renderable;if(!r.boundsDirty&&!e&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&e&&r.renderBounds)return r.renderBounds;var i=e?r.renderBounds:r.bounds,o=this.getTransformedGeometryBounds(t,e,i);if(t.childNodes.forEach((function(t){var r=n.getBounds(t,e);r&&(o?o.add(r):(o=i||new Ar).update(r.center,r.halfExtents))})),e){var a=xa(t);if(a){var s=a.parsedStyle.clipPath.getBounds(e);o?s&&(o=s.intersection(o)):o=s}}return o||(o=new Ar),o&&(e?r.renderBounds=o:r.bounds=o),e?r.renderBoundsDirty=!1:r.boundsDirty=!1,o},t.prototype.getLocalBounds=function(t){if(t.parentNode){var e=lt();t.parentNode.transformable&&(e=dt(lt(),this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!Ar.isEmpty(n)){var r=new Ar;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)},t.prototype.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t);Ar.isEmpty(i)||(r=new Ar).setFromTransformedAABB(i,this.getWorldTransform(t));var o=null===(n=null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)||void 0===n?void 0:n.getContextService().getBoundingClientRect();if(r){var a=u(r.getMin(),2),s=a[0],l=a[1],c=u(r.getMax(),2);return new Fr(s+((null==o?void 0:o.left)||0),l+((null==o?void 0:o.top)||0),c[0]-s,c[1]-l)}return new Fr((null==o?void 0:o.left)||0,(null==o?void 0:o.top)||0,0,0)},t.prototype.dirtifyWorldInternal=function(t,e){var n=this;if(!e.dirtyFlag){e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach((function(t){var e=t.transformable;e.dirtyFlag||n.dirtifyWorldInternal(t,e)}));var r=t.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0)}},t.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;n.length>r;r++)this.syncHierarchy(n[r])}},t.prototype.sync=function(t,e){if(e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.dirtyFlag){var n=t.parentNode,r=n&&n.transformable;null!==n&&r?vt(e.worldTransform,r.worldTransform,e.localTransform):ct(e.worldTransform,e.localTransform),e.dirtyFlag=!1}},t.prototype.unfreezeParentToRoot=function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}},t}(),ms={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]},xs=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,bs=RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),Ms=RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),ws=function(){function t(t){var e=this;this.runtime=t,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,n){return!e.isBreakingSpace(n)&&!(!t||!Ms.exec(n)&&!bs.exec(t))},this.trimByKinsokuShorui=function(t){var e=l([],u(t),!1),n=e[e.length-2];if(!n)return t;var r=n[n.length-1];return e[e.length-2]=n.slice(0,-1),e[e.length-1]=r+e[e.length-1],e}}return t.prototype.measureFont=function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(e),i=this.runtime.offscreenCanvasCreator.getOrCreateContext(e,{willReadFrequently:!0});i.font=t;var o=ms.MetricsString+ms.BaselineSymbol,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText(ms.BaselineSymbol).width),u=ms.HeightMultiplier*s;s=s*ms.BaselineMultiplier|0,r.width=a,r.height=u,i.fillStyle="#f00",i.fillRect(0,0,a,u),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(o,0,s);var l=i.getImageData(0,0,a||1,u||1).data,c=l.length,h=4*a,p=0,f=0,d=!1;for(p=0;s>p;++p){for(var y=0;h>y;y+=4)if(255!==l[f+y]){d=!0;break}if(d)break;f+=h}for(n.ascent=s-p,f=c-h,d=!1,p=u;p>s;--p){for(y=0;h>y;y+=4)if(255!==l[f+y]){d=!0;break}if(d)break;f-=h}return n.descent=p-s,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n,n},t.prototype.measureText=function(t,e,n){var r=e.fontSize,i=e.wordWrap,o=e.lineHeight,a=e.lineWidth,s=e.textBaseline,u=e.textAlign,l=e.letterSpacing,c=e.textPath,h=e.leading,p=void 0===h?0:h,f=function(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,o=t.fontWeight,a=_(e)&&"".concat(e,"px")||"16px",s=n.split(","),u=s.length-1;u>=0;u--){var l=s[u].trim();!Ga.test(l)&&0>ja.indexOf(l)&&(l='"'.concat(l,'"')),s[u]=l}return"".concat(r," ").concat(i," ").concat(o," ").concat(a," ").concat(s.join(","))}(e),d=this.measureFont(f,n);0===d.fontSize&&(d.fontSize=r,d.ascent=r);var y=this.runtime.offscreenCanvasCreator.getOrCreateContext(n);y.font=f,e.isOverflowing=!1;var v=(i?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),g=Array(v.length),m=0;if(!c){for(E=0;v.length>E;E++){var x=y.measureText(v[E]).width+(v[E].length-1)*l;g[E]=x,m=Math.max(m,x)}k=m+a;var b=o||d.fontSize+a,M=Math.max(b,d.fontSize+a)+(v.length-1)*(b+p),w=0;return"middle"===s?w=-M/2:"bottom"===s||"alphabetic"===s||"ideographic"===s?w=-M:"top"!==s&&"hanging"!==s||(w=0),{font:f,width:k,height:M,lines:v,lineWidths:g,lineHeight:b+=p,maxLineWidth:m,fontProperties:d,lineMetrics:g.map((function(t,e){var n=0;return"center"===u||"middle"===u?n-=t/2:"right"!==u&&"end"!==u||(n-=t),new Fr(n-a/2,w+e*b,t+a,b)}))}}c.getTotalLength();for(var E=0;v.length>E;E++)var k=y.measureText(v[E]).width+(v[E].length-1)*l},t.prototype.setGraphemeOnPath=function(){},t.prototype.wordWrap=function(t,e,n){var r=this,i=e.wordWrapWidth,o=void 0===i?0:i,a=e.letterSpacing,s=e.maxLines,u=void 0===s?1/0:s,l=e.textOverflow,c=this.runtime.offscreenCanvasCreator.getOrCreateContext(n),h=o+a,p="";"ellipsis"===l?p="...":l&&"clip"!==l&&(p=l);for(var f=[],d=0,y=0,v={},g=function(t){return r.getFromCache(t,a,v,c)},m=Array.from(p).reduce((function(t,e){return t+g(e)}),0),x=Array.from(t),b=0;x.length>b;b++){var M=x[b],w=t[b-1],E=t[b+1],k=g(M);if(this.isNewline(M)){if(++d>=u){e.isOverflowing=!0;break}y=0,f[d]=""}else{if(y>0&&y+k>h){if(d+1>=u){if(e.isOverflowing=!0,m>0&&h>=m){for(var S=f[d].length,P=0,T=S,N=0;S>N;N++){var C=g(f[d][N]);if(P+C+m>h){T=N;break}P+=C}f[d]=(f[d]||"").slice(0,T)+p}break}if(y=0,f[++d]="",this.isBreakingSpace(M))continue;this.canBreakInLastChar(M)||(f=this.trimToBreakable(f),y=this.sumTextWidthByCache(f[d]||"",v)),this.shouldBreakByKinsokuShorui(M,E)&&(f=this.trimByKinsokuShorui(f),y+=g(w||""))}y+=k,f[d]=(f[d]||"")+M}}return f.join("\n")},t.prototype.isBreakingSpace=function(t){return"string"==typeof t&&ms.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},t.prototype.isNewline=function(t){return"string"==typeof t&&ms.Newlines.indexOf(t.charCodeAt(0))>=0},t.prototype.trimToBreakable=function(t){var e=l([],u(t),!1),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),o=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(r+1,n.length),e[e.length-2]=n.slice(0,o),e},t.prototype.canBreakInLastChar=function(t){return!t||!xs.test(t)},t.prototype.sumTextWidthByCache=function(t,e){return t.split("").reduce((function(t,n){if(!e[n])throw Error("cannot count the word without cache");return t+e[n]}),0)},t.prototype.findBreakableIndex=function(t){for(var e=t.length-1;e>=0;e--)if(!xs.test(t[e]))return e;return-1},t.prototype.getFromCache=function(t,e,n,r){var i=n[t];if("number"!=typeof i){var o=t.length*e;i=r.measureText(t).width+o,n[t]=i}return i},t}(),Es={},ks=(ds=new Za,ys=new qa,(fs={})[sr.CIRCLE]=new Xa,fs[sr.ELLIPSE]=new za,fs[sr.RECT]=ds,fs[sr.IMAGE]=ds,fs[sr.GROUP]=ds,fs[sr.LINE]=new Ua,fs[sr.TEXT]=new Ka(Es),fs[sr.POLYLINE]=ys,fs[sr.POLYGON]=ys,fs[sr.PATH]=new Ha,fs[sr.HTML]=null,fs[sr.MESH]=null,fs),Ss=function(){var t,e=new Ko,n=new Qo;return(t={})[Ci.PERCENTAGE]=null,t[Ci.NUMBER]=new aa,t[Ci.ANGLE]=new qo,t[Ci.DEFINED_PATH]=new Zo,t[Ci.PAINT]=e,t[Ci.COLOR]=e,t[Ci.FILTER]=new $o,t[Ci.LENGTH]=n,t[Ci.LENGTH_PERCENTAGE]=n,t[Ci.LENGTH_PERCENTAGE_12]=new ta,t[Ci.LENGTH_PERCENTAGE_14]=new ea,t[Ci.COORDINATE]=new ia,t[Ci.OFFSET_DISTANCE]=new sa,t[Ci.OPACITY_VALUE]=new ua,t[Ci.PATH]=new la,t[Ci.LIST_OF_POINTS]=new ca,t[Ci.SHADOW_BLUR]=new ha,t[Ci.TEXT]=new pa,t[Ci.TEXT_TRANSFORM]=new fa,t[Ci.TRANSFORM]=new Ya,t[Ci.TRANSFORM_ORIGIN]=new Va,t[Ci.Z_INDEX]=new Wa,t[Ci.MARKER]=new oa,t}();Es.CameraContribution=Hr,Es.AnimationTimeline=null,Es.EasingFunction=null,Es.offscreenCanvasCreator=new as,Es.nativeHTMLMap=new WeakMap,Es.sceneGraphSelector=new cs,Es.sceneGraphService=new gs(Es),Es.textService=new ws(Es),Es.geometryUpdaterFactory=ks,Es.CSSPropertySyntaxFactory=Ss,Es.styleValueRegistry=new Ho(Es),Es.layoutRegistry=null,Es.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},Es.enableCSSParsing=!0,Es.enableDataset=!1,Es.enableStyleSyntax=!0;var Ps=0,Ts=new hs(ss.INSERTED,null,"","","",0,"",""),Ns=new hs(ss.REMOVED,null,"","","",0,"",""),Cs=new ns(ss.DESTROY),As=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.entity=Ps++,e.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},e.cullable={strategy:yi.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},e.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]},e.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},e.geometry={contentBounds:void 0,renderBounds:void 0},e.rBushNode={aabb:void 0},e.namespaceURI="g",e.scrollLeft=0,e.scrollTop=0,e.clientTop=0,e.clientLeft=0,e.destroyed=!1,e.style={},e.computedStyle=Es.enableCSSParsing?{anchor:xi,opacity:xi,fillOpacity:xi,strokeOpacity:xi,fill:xi,stroke:xi,transform:xi,transformOrigin:xi,visibility:xi,pointerEvents:xi,lineWidth:xi,lineCap:xi,lineJoin:xi,increasedLineWidthForHitTesting:xi,fontSize:xi,fontFamily:xi,fontStyle:xi,fontWeight:xi,fontVariant:xi,textAlign:xi,textBaseline:xi,textTransform:xi,zIndex:xi,filter:xi,shadowType:xi}:null,e.parsedStyle={},e.attributes={},e}return n(e,t),Object.defineProperty(e.prototype,"className",{get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"classList",{get:function(){return this.className.split(" ").filter((function(t){return""!==t}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tagName",{get:function(){return this.nodeName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentElement",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(t){throw Error(Br)},e.prototype.appendChild=function(t,e){var n;if(t.destroyed)throw Error("Cannot append a destroyed element.");return Es.sceneGraphService.attach(t,this,e),(null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView)&&this.ownerDocument.defaultView.mountChildren(t),Ts.relatedNode=this,t.dispatchEvent(Ts),t},e.prototype.insertBefore=function(t,e){if(e){t.parentElement&&t.parentElement.removeChild(t);var n=this.childNodes.indexOf(e);-1===n?this.appendChild(t):this.appendChild(t,n)}else this.appendChild(t);return t},e.prototype.replaceChild=function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e},e.prototype.removeChild=function(t){var e;return Ns.relatedNode=this,t.dispatchEvent(Ns),(null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)&&t.ownerDocument.defaultView.unmountChildren(t),Es.sceneGraphService.detach(t),t},e.prototype.removeChildren=function(){for(var t=this.childNodes.length-1;t>=0;t--){this.removeChild(this.childNodes[t])}},e.prototype.destroyChildren=function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length&&e.destroyChildren(),e.destroy()}},e.prototype.matches=function(t){return Es.sceneGraphService.matches(t,this)},e.prototype.getElementById=function(t){return Es.sceneGraphService.querySelector("#".concat(t),this)},e.prototype.getElementsByName=function(t){return Es.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)},e.prototype.getElementsByClassName=function(t){return Es.sceneGraphService.querySelectorAll(".".concat(t),this)},e.prototype.getElementsByTagName=function(t){return Es.sceneGraphService.querySelectorAll(t,this)},e.prototype.querySelector=function(t){return Es.sceneGraphService.querySelector(t,this)},e.prototype.querySelectorAll=function(t){return Es.sceneGraphService.querySelectorAll(t,this)},e.prototype.closest=function(t){var e=this;do{if(Es.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null},e.prototype.find=function(t){var e=this,n=null;return this.forEach((function(r){return!(r===e||!t(r))&&(n=r,!0)})),n},e.prototype.findAll=function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n},e.prototype.after=function(){for(var t=this,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];if(this.parentNode){var r=this.parentNode.childNodes.indexOf(this);e.forEach((function(e,n){var i;return null===(i=t.parentNode)||void 0===i?void 0:i.appendChild(e,r+n+1)}))}},e.prototype.before=function(){for(var t,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];if(this.parentNode){var r=this.parentNode.childNodes.indexOf(this),i=u(e),o=i[0],a=i.slice(1);this.parentNode.appendChild(o,r),(t=o).after.apply(t,l([],u(a),!1))}},e.prototype.replaceWith=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];this.after.apply(this,l([],u(t),!1)),this.remove()},e.prototype.append=function(){for(var t=this,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];e.forEach((function(e){return t.appendChild(e)}))},e.prototype.prepend=function(){for(var t=this,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];e.forEach((function(e,n){return t.appendChild(e,n)}))},e.prototype.replaceChildren=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,l([],u(t),!1))},e.prototype.remove=function(){return this.parentNode?this.parentNode.removeChild(this):this},e.prototype.destroy=function(){this.dispatchEvent(Cs),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},e.prototype.getGeometryBounds=function(){return Es.sceneGraphService.getGeometryBounds(this)},e.prototype.getRenderBounds=function(){return Es.sceneGraphService.getBounds(this,!0)},e.prototype.getBounds=function(){return Es.sceneGraphService.getBounds(this)},e.prototype.getLocalBounds=function(){return Es.sceneGraphService.getLocalBounds(this)},e.prototype.getBoundingClientRect=function(){return Es.sceneGraphService.getBoundingClientRect(this)},e.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},e.prototype.computedStyleMap=function(){return new Map(Object.entries(this.computedStyle))},e.prototype.getAttributeNames=function(){return Object.keys(this.attributes)},e.prototype.getAttribute=function(t){if(function(t){return"symbol"==typeof t}(t))return Es.enableCSSParsing?null:void 0;var e=this.attributes[t];if(void 0===e){var n=ci(t);return e=this.attributes[n],Es.enableCSSParsing&&p(e)?null:e}return e},e.prototype.hasAttribute=function(t){return this.getAttributeNames().includes(t)},e.prototype.hasAttributes=function(){return!!this.getAttributeNames().length},e.prototype.removeAttribute=function(t){this.setAttribute(t,null),delete this.attributes[t]},e.prototype.setAttribute=function(t,e,n){this.attributes[t]=e},e.prototype.getAttributeNS=function(t,e){throw Error(Br)},e.prototype.getAttributeNode=function(t){throw Error(Br)},e.prototype.getAttributeNodeNS=function(t,e){throw Error(Br)},e.prototype.hasAttributeNS=function(t,e){throw Error(Br)},e.prototype.removeAttributeNS=function(t,e){throw Error(Br)},e.prototype.removeAttributeNode=function(t){throw Error(Br)},e.prototype.setAttributeNS=function(t,e,n){throw Error(Br)},e.prototype.setAttributeNode=function(t){throw Error(Br)},e.prototype.setAttributeNodeNS=function(t){throw Error(Br)},e.prototype.toggleAttribute=function(t,e){throw Error(Br)},e}(is);function Os(t){return!!(null==t?void 0:t.nodeName)}var Rs,Ls=new hs(ss.ATTR_MODIFIED,null,null,null,null,hs.MODIFICATION,null,null),_s={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:""},Is={anchor:[0,0],fill:ki,stroke:ki,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},Ds=r(r({},Is),{opacity:1,fillOpacity:1,strokeOpacity:1,visibility:"visible",pointerEvents:"auto",lineWidth:1,lineCap:"butt",lineJoin:"miter",increasedLineWidthForHitTesting:0,fillRule:"nonzero"}),Fs=l(l([],u(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"]),!1),["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"],!1),Bs="data-",js=function(t){function e(e){var n,r=t.call(this)||this;r.isCustomElement=!1,r.isMutationObserved=!1,r.activeAnimations=[],r.getClip=function(){return this.style.clipPath||null},r.config=e,r.config.interactive=null!==(n=r.config.capture)&&void 0!==n?n: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||sr.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,Es.enableCSSParsing?Is:Ds,r.config.initialParsedStyle),Es.enableCSSParsing&&Object.assign(r.attributes,_s),r.initAttributes(r.config.style);var i=Es.globalThis.Proxy?Es.globalThis.Proxy:function(){};return Es.enableDataset&&(r.dataset=new i({},{get:function(t,e){var n="".concat(Bs).concat(ai(e));return void 0!==t[n]?t[n]:r.getAttribute(n)},set:function(t,e,n){return r.setAttribute("".concat(Bs).concat(ai(e)),n),!0}})),Es.enableStyleSyntax&&(r.style=new i({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}return n(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.getAnimations().forEach((function(t){t.cancel()}))},e.prototype.cloneNode=function(t,e){var n=r({},this.attributes);for(var i in n){var o=n[i];Os(o)&&"clipPath"!==i&&"offsetPath"!==i&&"textPath"!==i&&(n[i]=o.cloneNode(t)),e&&(n[i]=e(i,o))}var a=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:n});return a.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((function(e){if(!e.style.isMarker){var n=e.cloneNode(t);a.appendChild(n)}})),a},e.prototype.initAttributes=function(t){void 0===t&&(t={});var e=this.renderable,n={forceUpdateGeometry:!0};Es.enableCSSParsing&&(n.usedAttributes=Fs);var r={};for(var i in t){r[ci(i)]=t[i]}Es.styleValueRegistry.processProperties(this,r,n),e.dirty=!0},e.prototype.setAttribute=function(e,n,r){void 0===r&&(r=!1);var i=ci(e);W(n)||(r||n!==this.attributes[i])&&(this.internalSetAttribute(i,n),t.prototype.setAttribute.call(this,i,n))},e.prototype.internalSetAttribute=function(t,e,n){var r;void 0===n&&(n={});var i=this.renderable,o=this.attributes[t],a=this.parsedStyle[t];Es.styleValueRegistry.processProperties(this,((r={})[t]=e,r),n),i.dirty=!0;var s=this.parsedStyle[t];this.isConnected&&(Ls.relatedNode=this,Ls.prevValue=o,Ls.newValue=e,Ls.attrName=t,Ls.prevParsedValue=a,Ls.newParsedValue=s,this.isMutationObserved?this.dispatchEvent(Ls):(Ls.target=this,this.ownerDocument.defaultView.dispatchEvent(Ls,!0))),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(t,o,e,a,s)},e.prototype.getBBox=function(){var t=this.getBounds(),e=u(t.getMin(),2),n=e[0],r=e[1],i=u(t.getMax(),2);return new Fr(n,r,i[0]-n,i[1]-r)},e.prototype.setOrigin=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Es.sceneGraphService.setOrigin(this,gr(t,e,n)),this},e.prototype.getOrigin=function(){return Es.sceneGraphService.getOrigin(this)},e.prototype.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Es.sceneGraphService.setPosition(this,gr(t,e,n)),this},e.prototype.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Es.sceneGraphService.setLocalPosition(this,gr(t,e,n)),this},e.prototype.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Es.sceneGraphService.translate(this,gr(t,e,n)),this},e.prototype.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Es.sceneGraphService.translateLocal(this,gr(t,e,n)),this},e.prototype.getPosition=function(){return Es.sceneGraphService.getPosition(this)},e.prototype.getLocalPosition=function(){return Es.sceneGraphService.getLocalPosition(this)},e.prototype.scale=function(t,e,n){return this.scaleLocal(t,e,n)},e.prototype.scaleLocal=function(t,e,n){return"number"==typeof t&&(t=gr(t,e=e||t,n=n||t)),Es.sceneGraphService.scaleLocal(this,t),this},e.prototype.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=gr(t,e=e||t,n=n||t)),Es.sceneGraphService.setLocalScale(this,t),this},e.prototype.getLocalScale=function(){return Es.sceneGraphService.getLocalScale(this)},e.prototype.getScale=function(){return Es.sceneGraphService.getScale(this)},e.prototype.getEulerAngles=function(){return xr(u(br(Dt(),Es.sceneGraphService.getWorldTransform(this)),3)[2])},e.prototype.getLocalEulerAngles=function(){return xr(u(br(Dt(),Es.sceneGraphService.getLocalRotation(this)),3)[2])},e.prototype.setEulerAngles=function(t){return Es.sceneGraphService.setEulerAngles(this,0,0,t),this},e.prototype.setLocalEulerAngles=function(t){return Es.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},e.prototype.rotateLocal=function(t,e,n){return p(e)&&p(n)?Es.sceneGraphService.rotateLocal(this,0,0,t):Es.sceneGraphService.rotateLocal(this,t,e,n),this},e.prototype.rotate=function(t,e,n){return p(e)&&p(n)?Es.sceneGraphService.rotate(this,0,0,t):Es.sceneGraphService.rotate(this,t,e,n),this},e.prototype.setRotation=function(t,e,n,r){return Es.sceneGraphService.setRotation(this,t,e,n,r),this},e.prototype.setLocalRotation=function(t,e,n,r){return Es.sceneGraphService.setLocalRotation(this,t,e,n,r),this},e.prototype.setLocalSkew=function(t,e){return Es.sceneGraphService.setLocalSkew(this,t,e),this},e.prototype.getRotation=function(){return Es.sceneGraphService.getRotation(this)},e.prototype.getLocalRotation=function(){return Es.sceneGraphService.getLocalRotation(this)},e.prototype.getLocalSkew=function(){return Es.sceneGraphService.getLocalSkew(this)},e.prototype.getLocalTransform=function(){return Es.sceneGraphService.getLocalTransform(this)},e.prototype.getWorldTransform=function(){return Es.sceneGraphService.getWorldTransform(this)},e.prototype.setLocalTransform=function(t){return Es.sceneGraphService.setLocalTransform(this,t),this},e.prototype.resetLocalTransform=function(){Es.sceneGraphService.resetLocalTransform(this)},e.prototype.getAnimations=function(){return this.activeAnimations},e.prototype.animate=function(t,e){var n,r=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;return r?r.play(this,t,e):null},e.prototype.isVisible=function(){var t;return"visible"===(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)},Object.defineProperty(e.prototype,"interactive",{get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"},enumerable:!1,configurable:!0}),e.prototype.isInteractive=function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)},e.prototype.isCulled=function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)},e.prototype.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,l([],u(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))),!1))+1),this},e.prototype.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,l([],u(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))),!1))-1),this},e.prototype.getConfig=function(){return this.config},e.prototype.attr=function(){for(var t=this,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];var r=u(e,2),i=r[0],o=r[1];return i?v(i)?(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),this):2===e.length?(this.setAttribute(i,o),this):this.attributes[i]:this.attributes},e.prototype.getMatrix=function(t){var e=t||this.getWorldTransform(),n=u(kt(Dt(),e),2),r=n[0],i=n[1],o=u(St(Dt(),e),2),a=o[0],s=o[1],l=Pt(Jt(),e),c=u(br(Dt(),l),3);return Mr(c[0]||c[2],r,i,a,s)},e.prototype.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},e.prototype.setMatrix=function(t){var e=u(wr(t),5),n=e[0],r=e[1],i=e[2],o=e[3];this.setEulerAngles(e[4]).setPosition(n,r).setLocalScale(i,o)},e.prototype.setLocalMatrix=function(t){var e=u(wr(t),5),n=e[0],r=e[1],i=e[2],o=e[3];this.setLocalEulerAngles(e[4]).setLocalPosition(n,r).setLocalScale(i,o)},e.prototype.show=function(){Es.enableCSSParsing?this.style.visibility="visible":this.forEach((function(t){t.style.visibility="visible"}))},e.prototype.hide=function(){Es.enableCSSParsing?this.style.visibility="hidden":this.forEach((function(t){t.style.visibility="hidden"}))},e.prototype.getCount=function(){return this.childElementCount},e.prototype.getParent=function(){return this.parentElement},e.prototype.getChildren=function(){return this.children},e.prototype.getFirst=function(){return this.firstElementChild},e.prototype.getLast=function(){return this.lastElementChild},e.prototype.getChildByIndex=function(t){return this.children[t]||null},e.prototype.add=function(t,e){return this.appendChild(t,e)},e.prototype.setClip=function(t){this.style.clipPath=t},e.prototype.set=function(t,e){this.config[t]=e},e.prototype.get=function(t){return this.config[t]},e.prototype.moveTo=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},e.prototype.move=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},e.prototype.setZIndex=function(t){return this.style.zIndex=t,this},e}(As),Gs=function(t){Es.styleValueRegistry.registerMetadata({n:t.name,inh:t.inherits,int:t.interpolable,d:t.initialValue,syntax:t.syntax})},Ys=function(t){function e(e){void 0===e&&(e={});var n=e.style,o=i(e,["style"]);return t.call(this,r({type:sr.CIRCLE,style:r(Es.enableCSSParsing?{cx:"",cy:"",r:""}:{},n),initialParsedStyle:{anchor:[.5,.5],transformOrigin:Es.enableCSSParsing?null:[Ni,Ni]}},o))||this}return n(e,t),e}(js),Vs=(function(t){function e(e){var n=this;void 0===e&&(e={});var o=e.style,a=i(e,["style"]);return(n=t.call(this,r({style:r(Es.enableCSSParsing?{x:"",y:""}:{},o)},a))||this).isCustomElement=!0,n}n(e,t)}(js),function(t){function e(e){void 0===e&&(e={});var n=e.style,o=i(e,["style"]);return t.call(this,r({type:sr.ELLIPSE,style:r(Es.enableCSSParsing?{cx:"",cy:"",rx:"",ry:""}:{},n),initialParsedStyle:{anchor:[.5,.5],transformOrigin:Es.enableCSSParsing?null:[Ni,Ni]}},o))||this}return n(e,t),e}(js)),Ws=function(t){function e(e){void 0===e&&(e={});var n=e.style,o=i(e,["style"]);return t.call(this,r({type:sr.GROUP,style:r(Es.enableCSSParsing?{x:"",y:"",width:"",height:""}:{},n)},o))||this}return n(e,t),e}(js),Xs=function(t){function e(e){var n=this;void 0===e&&(e={});var o=e.style,a=i(e,["style"]);return(n=t.call(this,r({type:sr.HTML,style:r(Es.enableCSSParsing?{x:"",y:"",width:"auto",height:"auto",innerHTML:""}:{},o)},a))||this).cullable.enable=!1,n}return n(e,t),e.prototype.getDomElement=function(){return this.parsedStyle.$el},e.prototype.getBoundingClientRect=function(){if(this.parsedStyle.$el)return this.parsedStyle.$el.getBoundingClientRect();var t=this.parsedStyle;return new Fr(t.x,t.y,t.width,t.height)},e.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},e.prototype.getBounds=function(){var t,e,n=this.getBoundingClientRect(),r=null===(e=null===(t=this.ownerDocument)||void 0===t?void 0:t.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect(),i=new Ar,o=n.left-((null==r?void 0:r.left)||0),a=n.top-((null==r?void 0:r.top)||0);return i.setMinMax([o,a,0],[o+n.width,a+n.height,0]),i},e.prototype.getLocalBounds=function(){if(this.parentNode){var t=dt(lt(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!Ar.isEmpty(e)){var n=new Ar;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},e}(js),zs=function(t){function e(e){void 0===e&&(e={});var n=e.style,o=i(e,["style"]);return t.call(this,r({type:sr.IMAGE,style:r(Es.enableCSSParsing?{x:"",y:"",img:"",width:"",height:""}:{},n)},o))||this}return n(e,t),e}(js),Us=function(t){function e(e){var n=this;void 0===e&&(e={});var o=e.style,a=i(e,["style"]);(n=t.call(this,r({type:sr.LINE,style:r({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},o)},a))||this).markerStartAngle=0,n.markerEndAngle=0;var s=n.parsedStyle,u=s.markerStart,l=s.markerEnd;return u&&Os(u)&&(n.markerStartAngle=u.getLocalEulerAngles(),n.appendChild(u)),l&&Os(l)&&(n.markerEndAngle=l.getLocalEulerAngles(),n.appendChild(l)),n.transformMarker(!0),n.transformMarker(!1),n}return n(e,t),e.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&&Os(r)&&(this.markerStartAngle=0,r.remove()),i&&Os(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&Os(r)&&(this.markerEndAngle=0,r.remove()),i&&Os(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))},e.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=e.x1,o=e.x2,a=e.y1,s=e.y2,u=e.defX,l=e.defY,c=t?e.markerStart:e.markerEnd;if(c&&Os(c)){var h,p,f,d,y,v,g;t?(d=i-u,y=a-l,p=o-i,f=s-a,v=n||0,g=this.markerStartAngle):(d=o-u,y=s-l,p=i-o,f=a-s,v=r||0,g=this.markerEndAngle),c.setLocalEulerAngles(180*(h=Math.atan2(f,p))/Math.PI+g),c.setLocalPosition(d+Math.cos(h)*v,y+Math.sin(h)*v)}},e.prototype.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,o=Zn(n.x1,n.y1,n.x2,n.y2,t),a=o.x,s=o.y,u=Ut(Dt(),Bt(a-r,s-i,0),e?this.getWorldTransform():this.getLocalTransform());return new Dr(u[0],u[1])},e.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},e.prototype.getTotalLength=function(){var t=this.parsedStyle;return qn(t.x1,t.y1,t.x2,t.y2)},e}(js),Hs=function(t){function e(e){var n=this;void 0===e&&(e={});var o=e.style,a=i(e,["style"]);(n=t.call(this,r({type:sr.PATH,style:r(Es.enableCSSParsing?{path:"",miterLimit:""}:{},o),initialParsedStyle:Es.enableCSSParsing?null:{miterLimit:4,path:r({},Ai)}},a))||this).markerStartAngle=0,n.markerEndAngle=0,n.markerMidList=[];var s=n.parsedStyle,u=s.markerStart,l=s.markerEnd,c=s.markerMid;return u&&Os(u)&&(n.markerStartAngle=u.getLocalEulerAngles(),n.appendChild(u)),c&&Os(c)&&n.placeMarkerMid(c),l&&Os(l)&&(n.markerEndAngle=l.getLocalEulerAngles(),n.appendChild(l)),n.transformMarker(!0),n.transformMarker(!1),n}return n(e,t),e.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&&Os(r)&&(this.markerStartAngle=0,r.remove()),i&&Os(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Os(r)&&(this.markerEndAngle=0,r.remove()),i&&Os(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},e.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=e.defX,o=e.defY,a=t?e.markerStart:e.markerEnd;if(a&&Os(a)){var s,l,c,h,p,f,d;if(t){var y=u(this.getStartTangent(),2);h=(g=y[1])[0]-i,p=g[1]-o,l=(v=y[0])[0]-g[0],c=v[1]-g[1],f=n||0,d=this.markerStartAngle}else{var v,g,m=u(this.getEndTangent(),2);h=(g=m[1])[0]-i,p=g[1]-o,l=(v=m[0])[0]-g[0],c=v[1]-g[1],f=r||0,d=this.markerEndAngle}a.setLocalEulerAngles(180*(s=Math.atan2(c,l))/Math.PI+d),a.setLocalPosition(h+Math.cos(s)*f,p+Math.sin(s)*f)}},e.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&&Os(t))for(var o=1;n.length-1>o;o++){var a=u(n[o].currentPoint,2),s=a[0],l=a[1],c=1===o?t:t.cloneNode(!0);this.markerMidList.push(c),this.appendChild(c),c.setLocalPosition(s-r,l-i)}},e.prototype.getTotalLength=function(){return so(this)},e.prototype.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,i=n.defX,o=n.defY,a=function(t,e,n){return tn(t,e,r(r({},n),{bbox:!1,length:!0})).point}(n.path.absolutePath,t),s=a.x,u=a.y,l=Ut(Dt(),Bt(s-i,u-o,0),e?this.getWorldTransform():this.getLocalTransform());return new Dr(l[0],l[1])},e.prototype.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*so(this),e)},e.prototype.getStartTangent=function(){var t=this.parsedStyle.path.segments,e=[];if(t.length>1){var n=t[0].currentPoint,r=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([n[0]-i[0],n[1]-i[1]]),e.push([n[0],n[1]])):(e.push([r[0],r[1]]),e.push([n[0],n[1]]))}return e},e.prototype.getEndTangent=function(){var t=this.parsedStyle.path.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,o=t[e-1].endTangent;n=[],o?(n.push([i[0]-o[0],i[1]-o[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n},e}(js),qs=function(t){function e(e){var n=this;void 0===e&&(e={});var o=e.style,a=i(e,["style"]);(n=t.call(this,r({type:sr.POLYGON,style:r(Es.enableCSSParsing?{points:"",miterLimit:"",isClosed:!0}:{},o),initialParsedStyle:Es.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},a))||this).markerStartAngle=0,n.markerEndAngle=0,n.markerMidList=[];var s=n.parsedStyle,u=s.markerStart,l=s.markerEnd,c=s.markerMid;return u&&Os(u)&&(n.markerStartAngle=u.getLocalEulerAngles(),n.appendChild(u)),c&&Os(c)&&n.placeMarkerMid(c),l&&Os(l)&&(n.markerEndAngle=l.getLocalEulerAngles(),n.appendChild(l)),n.transformMarker(!0),n.transformMarker(!1),n}return n(e,t),e.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&&Os(r)&&(this.markerStartAngle=0,r.remove()),i&&Os(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Os(r)&&(this.markerEndAngle=0,r.remove()),i&&Os(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},e.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=e.defX,o=e.defY,a=(e.points||{}).points,s=t?e.markerStart:e.markerEnd;if(s&&Os(s)&&a){var u,l,c,h,p,f,d;if(h=a[0][0]-i,p=a[0][1]-o,t)l=a[1][0]-a[0][0],c=a[1][1]-a[0][1],f=n||0,d=this.markerStartAngle;else{var y=a.length;this.parsedStyle.isClosed?(l=a[y-1][0]-a[0][0],c=a[y-1][1]-a[0][1]):(h=a[y-1][0]-i,p=a[y-1][1]-o,l=a[y-2][0]-a[y-1][0],c=a[y-2][1]-a[y-1][1]),f=r||0,d=this.markerEndAngle}s.setLocalEulerAngles(180*(u=Math.atan2(c,l))/Math.PI+d),s.setLocalPosition(h+Math.cos(u)*f,p+Math.sin(u)*f)}},e.prototype.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.defX,r=e.defY,i=(e.points||{}).points;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&Os(t)&&i)for(var o=1;(this.parsedStyle.isClosed?i.length:i.length-1)>o;o++){var a=i[o][0]-n,s=i[o][1]-r,u=1===o?t:t.cloneNode(!0);this.markerMidList.push(u),this.appendChild(u),u.setLocalPosition(a,s)}},e}(js),Zs=function(t){function e(e){void 0===e&&(e={});var n=e.style,o=i(e,["style"]);return t.call(this,r({type:sr.POLYLINE,style:r(Es.enableCSSParsing?{points:"",miterLimit:"",isClosed:!1}:{},n),initialParsedStyle:Es.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},o))||this}return n(e,t),e.prototype.getTotalLength=function(){return this.parsedStyle.points.totalLength},e.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},e.prototype.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,o=n.points,a=o.points,s=0,u=0;o.segments.forEach((function(e,n){e[0]>t||t>e[1]||(s=(t-e[0])/(e[1]-e[0]),u=n)}));var l=Zn(a[u][0],a[u][1],a[u+1][0],a[u+1][1],s),c=l.x,h=l.y,p=Ut(Dt(),Bt(c-r,h-i,0),e?this.getWorldTransform():this.getLocalTransform());return new Dr(p[0],p[1])},e.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},e.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},e}(qs),Ks=function(t){function e(e){void 0===e&&(e={});var n=e.style,o=i(e,["style"]);return t.call(this,r({type:sr.RECT,style:r(Es.enableCSSParsing?{x:"",y:"",width:"",height:"",radius:""}:{},n)},o))||this}return n(e,t),e}(js),$s=function(t){function e(e){void 0===e&&(e={});var n=e.style,o=i(e,["style"]);return t.call(this,r({type:sr.TEXT,style:r(Es.enableCSSParsing?{x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""}:{fill:"black"},n),initialParsedStyle:Es.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}},o))||this}return n(e,t),e.prototype.getComputedTextLength=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0},e.prototype.getLineBoundingRects=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]},e.prototype.isOverflowing=function(){return!!this.parsedStyle.isOverflowing},e}(js),Js=function(){function t(){this.registry={},this.define(sr.CIRCLE,Ys),this.define(sr.ELLIPSE,Vs),this.define(sr.RECT,Ks),this.define(sr.IMAGE,zs),this.define(sr.LINE,Us),this.define(sr.GROUP,Ws),this.define(sr.PATH,Hs),this.define(sr.POLYGON,qs),this.define(sr.POLYLINE,Zs),this.define(sr.TEXT,$s),this.define(sr.HTML,Xs)}return t.prototype.define=function(t,e){this.registry[t]=e},t.prototype.get=function(t){return this.registry[t]},t}(),Qs=function(t){function e(){var e=t.call(this)||this;e.defaultView=null,e.ownerDocument=null,e.nodeName="document";try{e.timeline=new Es.AnimationTimeline(e)}catch(t){}var n={};return Wo.forEach((function(t){var e=t.d;t.inh&&e&&(n[t.n]=si(e)?e(sr.GROUP):e)})),e.documentElement=new Ws({id:"g-root",style:n}),e.documentElement.ownerDocument=e,e.documentElement.parentNode=e,e.childNodes=[e.documentElement],e}return n(e,t),Object.defineProperty(e.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),e.prototype.createElement=function(t,e){if("svg"===t)return this.documentElement;var n=this.defaultView.customElements.get(t);n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?$s:Ws);var r=new n(e);return r.ownerDocument=this,r},e.prototype.createElementNS=function(t,e,n){return this.createElement(e,n)},e.prototype.cloneNode=function(t){throw Error(Br)},e.prototype.destroy=function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}},e.prototype.elementsFromBBox=function(t,e,n,r){var i=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),o=[];return i.forEach((function(t){var e=t.displayObject,n=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(e.parsedStyle.pointerEvents);(!n||n&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&o.push(e)})),o.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),o},e.prototype.elementFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig();if(0>r||0>i||r>o.width||i>o.height)return null;var a=this.defaultView.viewport2Client({x:r,y:i}),s=a.x,u=a.y,l=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return l&&l[0]||this.documentElement},e.prototype.elementFromPoint=function(t,e){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,c,h,p;return a(this,(function(a){switch(a.label){case 0:return n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),s=o.width,u=o.height,0>r||0>i||r>s||i>u?[2,null]:(l=this.defaultView.viewport2Client({x:r,y:i}),c=l.x,h=l.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:c,clientY:h},picked:[]})]);case 1:return[2,(p=a.sent().picked)&&p[0]||this.documentElement]}}))}))},e.prototype.elementsFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig();if(0>r||0>i||r>o.width||i>o.height)return[];var a=this.defaultView.viewport2Client({x:r,y:i}),s=a.x,u=a.y,l=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return l[l.length-1]!==this.documentElement&&l.push(this.documentElement),l},e.prototype.elementsFromPoint=function(t,e){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,c,h,p;return a(this,(function(a){switch(a.label){case 0:return n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),s=o.width,u=o.height,0>r||0>i||r>s||i>u?[2,[]]:(l=this.defaultView.viewport2Client({x:r,y:i}),c=l.x,h=l.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:c,clientY:h},picked:[]})]);case 1:return(p=a.sent().picked)[p.length-1]!==this.documentElement&&p.push(this.documentElement),[2,p]}}))}))},e.prototype.appendChild=function(t,e){throw Error(jr)},e.prototype.insertBefore=function(t,e){throw Error(jr)},e.prototype.removeChild=function(t,e){throw Error(jr)},e.prototype.replaceChild=function(t,e,n){throw Error(jr)},e.prototype.append=function(){throw Error(jr)},e.prototype.prepend=function(){throw Error(jr)},e.prototype.getElementById=function(t){return this.documentElement.getElementById(t)},e.prototype.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},e.prototype.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},e.prototype.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},e.prototype.querySelector=function(t){return this.documentElement.querySelector(t)},e.prototype.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},e.prototype.find=function(t){return this.documentElement.find(t)},e.prototype.findAll=function(t){return this.documentElement.findAll(t)},e}(is),tu=function(){function t(t){this.strategies=t}return t.prototype.apply=function(e){var n=e.camera,r=e.renderingService,i=e.renderingContext,o=this.strategies;r.hooks.cull.tap(t.tag,(function(t){if(t){var e=t.cullable;return e.visible=0===o.length?i.unculledEntities.indexOf(t.entity)>-1:o.every((function(e){return e.isVisible(n,t)})),!t.isCulled()&&t.isVisible()?t:(t.dispatchEvent(new ns(ss.CULLED)),null)}return t})),r.hooks.afterRender.tap(t.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},t.tag="Culling",t}(),eu=function(){function t(){var t=this;this.autoPreventDefault=!1,this.rootPointerEvent=new ts(null),this.rootWheelEvent=new es(null),this.onPointerMove=function(e){var n,r,i,o,a=null===(o=null===(i=t.context.renderingContext.root)||void 0===i?void 0:i.ownerDocument)||void 0===o?void 0:o.defaultView;if(!a.supportsTouchEvents||"touch"!==e.pointerType){var u=t.normalizeToPointerEvent(e,a);try{for(var l=s(u),c=l.next();!c.done;c=l.next()){var h=t.bootstrapEvent(t.rootPointerEvent,c.value,a,e);t.context.eventService.mapEvent(h)}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}t.setCursor(t.context.eventService.cursor)}},this.onClick=function(e){var n,r,i,o,a=null===(o=null===(i=t.context.renderingContext.root)||void 0===i?void 0:i.ownerDocument)||void 0===o?void 0:o.defaultView,u=t.normalizeToPointerEvent(e,a);try{for(var l=s(u),c=l.next();!c.done;c=l.next()){var h=t.bootstrapEvent(t.rootPointerEvent,c.value,a,e);t.context.eventService.mapEvent(h)}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}t.setCursor(t.context.eventService.cursor)}}return t.prototype.apply=function(e){var n=this;this.context=e;var r=e.renderingService,i=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler((function(t){return n.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null})),r.hooks.pointerWheel.tap(t.tag,(function(t){var e=n.normalizeWheelEvent(t);n.context.eventService.mapEvent(e)})),r.hooks.pointerDown.tap(t.tag,(function(t){var e,r;if(!i.supportsTouchEvents||"touch"!==t.pointerType){var o=n.normalizeToPointerEvent(t,i);if(n.autoPreventDefault&&o[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();try{for(var a=s(o),u=a.next();!u.done;u=a.next()){var l=n.bootstrapEvent(n.rootPointerEvent,u.value,i,t);n.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerUp.tap(t.tag,(function(t){var e,r;if(!i.supportsTouchEvents||"touch"!==t.pointerType){var o=n.context.contextService.getDomElement(),a="outside";try{a=o&&t.target&&t.target!==o&&o.contains&&!o.contains(t.target)?"outside":""}catch(t){}var u=n.normalizeToPointerEvent(t,i);try{for(var l=s(u),c=l.next();!c.done;c=l.next()){var h=n.bootstrapEvent(n.rootPointerEvent,c.value,i,t);h.type+=a,n.context.eventService.mapEvent(h)}}catch(t){e={error:t}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(e)throw e.error}}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerMove.tap(t.tag,this.onPointerMove),r.hooks.pointerOver.tap(t.tag,this.onPointerMove),r.hooks.pointerOut.tap(t.tag,this.onPointerMove),r.hooks.click.tap(t.tag,this.onClick),r.hooks.pointerCancel.tap(t.tag,(function(t){var e,r,o=n.normalizeToPointerEvent(t,i);try{for(var a=s(o),u=a.next();!u.done;u=a.next()){var l=n.bootstrapEvent(n.rootPointerEvent,u.value,i,t);n.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}n.setCursor(n.context.eventService.cursor)}))},t.prototype.getViewportXY=function(t){var e,n,r=t.offsetX,i=t.offsetY,o=t.clientX,a=t.clientY;if(!this.context.config.supportsCSSTransform||p(r)||p(i)){var s=this.context.eventService.client2Viewport(new Dr(o,a));e=s.x,n=s.y}else e=r,n=i;return{x:e,y:n}},t.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 i=this.getViewportXY(e),o=i.y;t.viewport.x=i.x,t.viewport.y=o;var a=this.context.eventService.viewport2Canvas(t.viewport),s=a.y;return t.canvas.x=a.x,t.canvas.y=s,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=Ma[t.type]||t.type),t},t.prototype.normalizeWheelEvent=function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.getViewportXY(t),r=n.y;e.viewport.x=n.x,e.viewport.y=r;var i=this.context.eventService.viewport2Canvas(e.viewport),o=i.y;return e.canvas.x=i.x,e.canvas.y=o,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e},t.prototype.transferMouseData=function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=wa.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},t.prototype.setCursor=function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")},t.prototype.normalizeToPointerEvent=function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;t.changedTouches.length>r;r++){var i=t.changedTouches[r];W(i.button)&&(i.button=0),W(i.buttons)&&(i.buttons=1),W(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),W(i.width)&&(i.width=i.radiusX||1),W(i.height)&&(i.height=i.radiusY||1),W(i.tiltX)&&(i.tiltX=0),W(i.tiltY)&&(i.tiltY=0),W(i.pointerType)&&(i.pointerType="touch"),W(i.pointerId)&&(i.pointerId=i.identifier||0),W(i.pressure)&&(i.pressure=i.force||.5),W(i.twist)&&(i.twist=0),W(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var o=t;W(o.isPrimary)&&(o.isPrimary=!0),W(o.width)&&(o.width=1),W(o.height)&&(o.height=1),W(o.tiltX)&&(o.tiltX=0),W(o.tiltY)&&(o.tiltY=0),W(o.pointerType)&&(o.pointerType="mouse"),W(o.pointerId)&&(o.pointerId=1),W(o.pressure)&&(o.pressure=.5),W(o.twist)&&(o.twist=0),W(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n},t.tag="Event",t}(),nu=[sr.CIRCLE,sr.ELLIPSE,sr.IMAGE,sr.RECT,sr.LINE,sr.POLYLINE,sr.POLYGON,sr.TEXT,sr.PATH,sr.HTML],ru=function(){function t(){}return t.prototype.isVisible=function(t,e){var n,r,i=e.cullable;if(!i.enable)return!0;var o=e.getRenderBounds();if(Ar.isEmpty(o))return!1;var a=t.getFrustum(),s=null===(r=null===(n=e.parentNode)||void 0===n?void 0:n.cullable)||void 0===r?void 0:r.visibilityPlaneMask;return i.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,o,s||Cr.INDETERMINATE,a.planes),i.visible=i.visibilityPlaneMask!==Cr.OUTSIDE,i.visible},t.prototype.computeVisibilityWithPlaneMask=function(t,e,n,r){if(n===Cr.OUTSIDE||n===Cr.INSIDE)return n;for(var i=Cr.INSIDE,o=nu.indexOf(t.nodeName)>-1,a=0,s=r.length;s>a;++a){var u=1<<a;if(0!=(n&u)&&(!o||4!==a&&5!==a)){var l=r[a],c=l.normal,h=l.distance;if(0>Xt(c,e.getPositiveFarPoint(r[a]))+h)return Cr.OUTSIDE;0>Xt(c,e.getNegativeFarPoint(r[a]))+h&&(i|=u)}}return i},t}(),iu=function(){function t(){this.toSync=new Set}return t.prototype.apply=function(e){var n=this,r=e.renderingService,i=e.renderingContext.root.ownerDocument.defaultView;this.rBush=e.rBushRoot;var o=function(t){t.target.renderable.dirty=!0,r.dirtify()},a=function(t){var e=t.target;t.detail.affectChildren&&e.forEach((function(t){n.toSync.add(t)}));for(var i=e;i;)i.renderable&&n.toSync.add(i),i=i.parentElement;r.dirtify()},s=function(t){var e=t.target;Es.enableCSSParsing&&Es.styleValueRegistry.recalc(e),Es.sceneGraphService.dirtifyToRoot(e),r.dirtify()},u=function(t){var e=t.target,i=e.rBushNode;i.aabb&&n.rBush.remove(i.aabb),n.toSync.delete(e),Es.sceneGraphService.dirtifyToRoot(e),r.dirtify()};r.hooks.init.tap(t.tag,(function(){i.addEventListener(ss.MOUNTED,s),i.addEventListener(ss.UNMOUNTED,u),i.addEventListener(ss.ATTR_MODIFIED,o),i.addEventListener(ss.BOUNDS_CHANGED,a)})),r.hooks.destroy.tap(t.tag,(function(){i.removeEventListener(ss.MOUNTED,s),i.removeEventListener(ss.UNMOUNTED,u),i.removeEventListener(ss.ATTR_MODIFIED,o),i.removeEventListener(ss.BOUNDS_CHANGED,a),n.toSync.clear()})),r.hooks.endFrame.tap(t.tag,(function(){n.syncRTree()}))},t.prototype.syncRTree=function(){var t=this,e=[];Array.from(this.toSync).filter((function(t){return t.isConnected})).forEach((function(n){var r=n.rBushNode;r&&r.aabb&&t.rBush.remove(r.aabb);var i=n.getRenderBounds();if(i){var o=u(i.getMin(),2),a=o[0],s=o[1],l=u(i.getMax(),2),c=l[0],h=l[1];r.aabb||(r.aabb={}),r.aabb.displayObject=n,r.aabb.minX=a,r.aabb.minY=s,r.aabb.maxX=c,r.aabb.maxY=h}r.aabb&&(isNaN(r.aabb.maxX)||isNaN(r.aabb.maxX)||isNaN(r.aabb.minX)||isNaN(r.aabb.minY)||e.push(r.aabb))})),this.rBush.load(e),e.length=0,this.toSync.clear()},t.tag="Prepare",t}();!function(t){t.READY="ready",t.BEFORE_RENDER="beforerender",t.RERENDER="rerender",t.AFTER_RENDER="afterrender",t.BEFORE_DESTROY="beforedestroy",t.AFTER_DESTROY="afterdestroy",t.RESIZE="resize",t.DIRTY_RECTANGLE="dirtyrectangle",t.RENDERER_CHANGED="rendererchanged"}(Rs||(Rs={}));var ou=new ns(ss.MOUNTED),au=new ns(ss.UNMOUNTED),su=new ns(Rs.BEFORE_RENDER),uu=new ns(Rs.RERENDER),lu=new ns(Rs.AFTER_RENDER),cu=function(t){function e(e){var n=t.call(this)||this;n.Element=js,n.inited=!1,n.context={},n.document=new Qs,n.document.defaultView=n,n.customElements=new Js;var r=e.container,i=e.canvas,o=e.offscreenCanvas,a=e.width,s=e.height,u=e.devicePixelRatio,l=e.renderer,c=e.background,h=e.cursor,p=e.document,f=e.requestAnimationFrame,d=e.cancelAnimationFrame,y=e.createImage,v=e.supportsPointerEvents,g=e.supportsTouchEvents,m=e.supportsCSSTransform,x=e.useNativeClickEvent,b=e.alwaysTriggerPointerEventOnCanvas,M=e.isTouchEvent,w=e.isMouseEvent;e.supportsMutipleCanvasesInOneContainer||function(t,e){if(t){var n="string"==typeof t?t:t.id||ya++;da[n]&&da[n].destroy(),da[n]=e}}(r,n);var E=a,k=s,S=u;return i&&(S=1>(S=u||va&&window.devicePixelRatio||1)?1:Math.ceil(S),E=a||function(t){var e=ba(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/S,k=s||function(t){var e=ba(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/S),o&&(Es.offscreenCanvas=o),n.devicePixelRatio=S,n.requestAnimationFrame=null!=f?f:La.bind(Es.globalThis),n.cancelAnimationFrame=null!=d?d:_a.bind(Es.globalThis),n.supportsTouchEvents=null!=g?g:"ontouchstart"in Es.globalThis,n.supportsPointerEvents=null!=v?v:!!Es.globalThis.PointerEvent,n.isTouchEvent=null!=M?M:function(t){return n.supportsTouchEvents&&t instanceof Es.globalThis.TouchEvent},n.isMouseEvent=null!=w?w:function(t){return!Es.globalThis.MouseEvent||t instanceof Es.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof Es.globalThis.PointerEvent))},n.initRenderingContext({container:r,canvas:i,width:E,height:k,renderer:l,offscreenCanvas:o,devicePixelRatio:S,cursor:h||"default",background:c||"transparent",createImage:y,document:p,supportsCSSTransform:m,useNativeClickEvent:x,alwaysTriggerPointerEventOnCanvas:b}),n.initDefaultCamera(E,k,l.clipSpaceNearZ),n.initRenderer(l,!0),n}return n(e,t),e.prototype.initRenderingContext=function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},e.prototype.initDefaultCamera=function(t,e,n){var r=this,i=new Es.CameraContribution;i.clipSpaceNearZ=n,i.setType(Rr.EXPLORING,Lr.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(zr,(function(){r.context.renderingContext.renderReasons.add($a.CAMERA_CHANGED)})),this.context.camera=i},e.prototype.getConfig=function(){return this.context.config},e.prototype.getRoot=function(){return this.document.documentElement},e.prototype.getCamera=function(){return this.context.camera},e.prototype.getContextService=function(){return this.context.contextService},e.prototype.getEventService=function(){return this.context.eventService},e.prototype.getRenderingService=function(){return this.context.renderingService},e.prototype.getRenderingContext=function(){return this.context.renderingContext},e.prototype.getStats=function(){return this.getRenderingService().getStats()},Object.defineProperty(e.prototype,"ready",{get:function(){var t=this;return this.readyPromise||(this.readyPromise=new Promise((function(e){t.resolveReadyPromise=function(){e(t)}})),this.inited&&this.resolveReadyPromise()),this.readyPromise},enumerable:!1,configurable:!0}),e.prototype.destroy=function(t,e){(void 0===t&&(t=!0),void 0===e&&(e=!1),e||this.dispatchEvent(new ns(Rs.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 ns(Rs.AFTER_DESTROY))},e.prototype.changeSize=function(t,e){this.resize(t,e)},e.prototype.resize=function(t,e){var n=this.context.config;n.width=t,n.height=e,this.getContextService().resize(t,e);var r=this.context.camera,i=r.getProjectionMode();r.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),i===_r.ORTHOGRAPHIC?r.setOrthographic(t/-2,t/2,e/2,e/-2,r.getNear(),r.getFar()):r.setAspect(t/e),this.dispatchEvent(new ns(Rs.RESIZE,{width:t,height:e}))},e.prototype.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},e.prototype.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},e.prototype.removeChild=function(t){return this.document.documentElement.removeChild(t)},e.prototype.removeChildren=function(){this.document.documentElement.removeChildren()},e.prototype.destroyChildren=function(){this.document.documentElement.destroyChildren()},e.prototype.render=function(){var t=this;this.dispatchEvent(su),this.getRenderingService().render(this.getConfig(),(function(){t.dispatchEvent(uu)})),this.dispatchEvent(lu)},e.prototype.run=function(){var t=this,e=function(){t.render(),t.frameId=t.requestAnimationFrame(e)};e()},e.prototype.initRenderer=function(t,e){var n=this;if(void 0===e&&(e=!1),!t)throw Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new lr,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new eu,new iu,new tu([new ru])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(r(r({},Es),this.context)),this.context.renderingService=new us(Es,this.context),this.context.eventService=new os(Es,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)}))},e.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 ns(Rs.READY))})):r.dispatchEvent(new ns(Rs.READY)),r.readyPromise&&r.resolveReadyPromise()):r.dispatchEvent(new ns(Rs.RENDERER_CHANGED)),e||r.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),r.mountChildren(r.getRoot()),t.getConfig().enableAutoRendering&&r.run()}))},e.prototype.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init(Es)}))},e.prototype.setRenderer=function(t){var e=this.getConfig();if(e.renderer!==t){var n=e.renderer;e.renderer=t,this.destroy(!1,!0),l([],u(null==n?void 0:n.getPlugins()),!1).reverse().forEach((function(t){t.destroy(Es)})),this.initRenderer(t)}},e.prototype.setCursor=function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)},e.prototype.unmountChildren=function(t){var e=this;t.childNodes.forEach((function(t){e.unmountChildren(t)})),this.inited&&(t.isMutationObserved?t.dispatchEvent(au):(au.target=t,this.dispatchEvent(au,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()},e.prototype.mountChildren=function(t){var e=this;this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,t.isMutationObserved?t.dispatchEvent(ou):(ou.target=t,this.dispatchEvent(ou,!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()},e.prototype.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},e.prototype.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},e.prototype.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},e.prototype.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},e.prototype.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},e.prototype.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},e}(rs),hu=function(t,e,n,r){return{x:t+n*Math.cos(r),y:e+n*Math.sin(r)}};var pu=function(t){function e(e){var n=t.call(this,e)||this;return n.updatePath(),n}return n(e,t),e.prototype.setAttribute=function(e,n,r){t.prototype.setAttribute.call(this,e,n,r),["cx","cy","startAngle","endAngle","r","anticlockwise"].indexOf(e)>-1&&this.updatePath()},e.prototype.updatePath=function(){var e=this.parsedStyle,n=e.cx,r=void 0===n?0:n,i=e.cy,o=void 0===i?0:i,a=e.startAngle,s=e.endAngle,u=e.r,l=e.anticlockwise;if(p(a)||p(s)||a===s||p(u)||u<=0)t.prototype.setAttribute.call(this,"path","");else{var c=this.createPath(r,o,mr(a),mr(s),u,l);t.prototype.setAttribute.call(this,"path",c)}},e.prototype.createPath=function(t,e,n,r,i,o){var a=hu(t,e,i,n),s=hu(t,e,i,r),u=Math.abs(r-n);if(u>=2*Math.PI||D(u,2*Math.PI)){var l=hu(t,e,i,n+Math.PI);return[["M",a.x,a.y],["A",i,i,0,1,o?0:1,l.x,l.y],["A",i,i,0,1,o?0:1,a.x,a.y],["Z"]]}var c=function(t,e,n){return n?t>e?e-t>-Math.PI?0:1:e-t>Math.PI?0:1:t>e?e-t>-Math.PI?1:0:e-t>Math.PI?1:0}(n,r,o);return[["M",a.x,a.y],["A",i,i,0,c,o?0:1,s.x,s.y]]},e}(Hs),fu={circle:function(t,e,n){return[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e]]},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"]]},arrow:function(t,e,n){return[["M",t-n,e+2*n/Math.sqrt(3)],["L",t+n,e+2*n/Math.sqrt(3)],["L",t,e-2*n/Math.sqrt(3)],["Z"]]}},du=function(t){function e(e){var n=t.call(this,e)||this;return n.updatePath(),n}return n(e,t),e.prototype.setAttribute=function(e,n,r){t.prototype.setAttribute.call(this,e,n,r),["x","y","symbol","radius"].indexOf(e)>-1&&this.updatePath()},e.prototype.updatePath=function(){var e=this.parsedStyle,n=e.x,r=e.y,i=this.attributes,o=i.symbol;if(o){var a=fu[o];if(a){var s=a(void 0===n?0:n,void 0===r?0:r,i.radius);t.prototype.setAttribute.call(this,"path",s)}}},e}(Hs),yu=Math.PI,vu=2*yu,gu=Math.sin,mu=Math.cos,xu=Math.acos,bu=Math.atan2,Mu=Math.sqrt,wu=Math.max,Eu=Math.min,ku=1e-4;function Su(t,e,n,r,i,o,a){var s=t-n,u=e-r,l=(a?o:-o)/Mu(s*s+u*u),c=l*u,h=-l*s,p=t+c,f=e+h,d=n+c,y=r+h,v=(p+d)/2,g=(f+y)/2,m=d-p,x=y-f,b=m*m+x*x,M=i-o,w=p*y-d*f,E=(0>x?-1:1)*Mu(wu(0,M*M*b-w*w)),k=(w*x-m*E)/b,S=(-w*m-x*E)/b,P=(w*x+m*E)/b,T=(-w*m+x*E)/b,N=k-v,C=S-g,A=P-v,O=T-g;return N*N+C*C>A*A+O*O&&(k=P,S=T),{cx:k,cy:S,x0:-c,y0:-h,x1:k*(i/M-1),y1:S*(i/M-1)}}function Pu(t,e,n){if(void 0===n&&(n=!0),!n){var r=e;e=t,t=r}return Math.abs((e=0>e-t?e+vu:e)-t)%vu>yu?1:0}var Tu=function(t){function e(e){var n=t.call(this,e)||this;return n.updatePath(),n}return n(e,t),e.prototype.setAttribute=function(e,n,r){t.prototype.setAttribute.call(this,e,n,r),["startAngle","endAngle","r","r0","radius","cx","cy"].indexOf(e)>-1&&this.updatePath()},e.prototype.updatePath=function(){var e=this.parsedStyle,n=e.cx,r=e.cy,i=e.startAngle,o=e.endAngle,a=e.r,s=e.r0,u=e.radius,l=e.anticlockwise,c=void 0!==l&&l;if(p(i)||p(o)||i===o||p(a)||a<=0)t.prototype.setAttribute.call(this,"path","");else{var h=this.createPath(n,r,mr(i),mr(o),a,s||0,u||[0,0,0,0],c);t.prototype.setAttribute.call(this,"path",h)}},e.prototype.createPath=function(t,e,n,r,i,o,a,s){var u=hu(t,e,i,n),l=hu(t,e,i,r),c=hu(t,e,o,n),h=hu(t,e,o,r),p=!s,f=p?r-n:n-r;if(Math.abs(f)>=vu||D(Math.abs(f),vu)){var d=hu(t,e,i,n+Math.PI),y=hu(t,e,o,n+Math.PI),v=[["M",u.x,u.y],["A",i,i,0,1,p?1:0,d.x,d.y],["A",i,i,0,1,p?1:0,l.x,l.y]];return o>0&&(v.push(["M",c.x,c.y]),v.push(["A",o,o,0,1,p?0:1,y.x,y.y]),v.push(["A",o,o,0,1,p?0:1,h.x,h.y])),v.push(["M",u.x,u.y]),v.push(["Z"]),v}var g=i*mu(n),m=i*gu(n),x=o*mu(r),b=o*gu(r),M=i*mu(r),w=i*gu(r),E=o*mu(n),k=o*gu(n),S=a[0],P=a[1],T=a[2],N=a[3],C=(i-o)/2,A=Eu(C,S),O=Eu(C,P),R=Eu(C,T),L=Eu(C,N),_=wu(A,O),I=wu(R,L),F=_,B=I;if((_>ku||I>ku)&&yu>f){var j=function(t,e,n,r,i,o,a,s){var u=n-t,l=r-e,c=a-i,h=s-o,p=h*u-c*l;if(p*p>=ku)return[t+(p=(c*(e-o)-h*(t-i))/p)*u,e+p*l]}(g,m,E,k,M,w,x,b);if(j){var G=g-j[0],Y=m-j[1],V=M-j[0],W=w-j[1],X=1/gu(xu((G*V+Y*W)/(Mu(G*G+Y*Y)*Mu(V*V+W*W)))/2),z=Mu(j[0]*j[0]+j[1]*j[1]);F=Eu(_,(i-z)/(X+1)),B=Eu(I,(o-z)/(X-1))}}var U=Pu(n,r,p),H=[];if(F>ku){var q=Eu(S,F),Z=Eu(P,F),K=Su(E,k,g,m,i,q,p),$=Su(M,w,x,b,i,Z,p);if(H.push(["M",t+K.cx+K.x0,e+K.cy+K.y0]),_>F&&q===Z){var J=bu(K.cy+K.y0,K.cx+K.x0),Q=bu($.cy+$.y0,$.cx+$.x0);H.push(["A",F,F,0,Pu(J,Q,!p),p?1:0,t+$.cx+$.x0,e+$.cy+$.y0])}else{if(q>0){J=bu(K.y0,K.x0),Q=bu(K.y1,K.x1);var tt=hu(t,e,i,Q);H.push(["A",q,q,0,Pu(J,Q,p),p?1:0,tt.x,tt.y])}var et=bu(K.cy+K.y1,K.cx+K.x1),nt=bu($.cy+$.y1,$.cx+$.x1),rt=hu(t,e,i,nt);if(H.push(["A",i,i,1,Pu(et,nt,p),p?1:0,rt.x,rt.y]),Z>0){var it=bu($.y1,$.x1),ot=bu($.y0,$.x0);H.push(["A",Z,Z,0,Pu(it,ot,p),p?1:0,t+$.cx+$.x0,e+$.cy+$.y0])}}}else H.push(["M",u.x,u.y]),H.push(["A",i,i,0,U,p?1:0,l.x,l.y]);if(ku>o)H.push(["L",h.x,h.y]);else if(B>ku){q=Eu(N,B),K=Su(0,0,x,b,o,-(Z=Eu(T,B)),p),$=Su(E,k,0,0,o,-q,p);if(H.push(["L",t+K.cx+K.x0,e+K.cy+K.y0]),I>B&&q===Z){var at=bu(K.y0,K.x0),st=bu($.y0,$.x0);H.push(["A",B,B,0,Pu(at,st),1,t+$.cx+$.x0,e+$.cy+$.y0])}else{if(Z>0){at=bu(K.y0,K.x0),st=bu(K.y1,K.x1);H.push(["A",Z,Z,0,Pu(at,st,p),p?1:0,t+K.cx+K.x1,e+K.cy+K.y1])}var ut=bu(K.cy+K.y1,K.cx+K.x1),lt=bu($.cy+$.y1,$.cx+$.x1),ct=hu(t,e,o,lt);if(H.push(["A",o,o,0,Pu(lt,ut,p),p?0:1,ct.x,ct.y]),q>0){var ht=bu($.y1,$.x1),pt=bu($.y0,$.x0);H.push(["A",q,q,0,Pu(ht,pt,p),p?1:0,t+$.cx+$.x0,e+$.cy+$.y0])}}}else H.push(["L",h.x,h.y]),H.push(["A",o,o,0,U,p?0:1,c.x,c.y]);return H.push(["Z"]),H},e}(Hs);function Nu(t){return[t.x,t.y]}function Cu(t,e,n){for(var r,i,o,a=!!e,s=function(t,e,n,r){var i,o,a,s,u,l,c,h,p=[],f=!!r;if(f){for(a=[1/0,1/0],s=[-1/0,-1/0],h=0,c=t.length;c>h;h++)ye(a,a,u=Nu(t[h])),ve(s,s,u);ye(a,a,r[0]),ve(s,s,r[1])}for(h=0,l=t.length;l>h;h++){if(u=Nu(t[h]),n)i=Nu(t[h?h-1:l-1]),o=Nu(t[(h+1)%l]);else{if(0===h||h===l-1){p.push([u[0],u[1]]);continue}i=Nu(t[h-1]),o=Nu(t[h+1])}var d=be([],o,i);ge(d,d,e);var y=me(u,i),v=me(u,o),g=y+v;0!==g&&(y/=g,v/=g);var m=ge([],d,-y),x=ge([],d,v),b=de([],u,m),M=de([],u,x);f&&(ve(b,b,a),ye(b,b,s),ve(M,M,a),ye(M,M,s)),p.push([b[0],b[1]]),p.push([M[0],M[1]])}return n&&p.push(p.shift()),p}(t,.4,a,n),u=t.length,l=[],c=0;u-1>c;c++)l.push(["C",(r=s[2*c])[0],r[1],(i=s[2*c+1])[0],i[1],(o=t[c+1]).x,o.y]);return a&&l.push(["C",(r=s[u])[0],r[1],(i=s[u+1])[0],i[1],(o=t[0]).x,o.y]),l}var Au=Object.freeze({__proto__:null,smooth:Cu}),Ou=function(t){function e(e){var n=t.call(this,e)||this;return n.updatePath(),n}return n(e,t),e.prototype.setAttribute=function(e,n,r){t.prototype.setAttribute.call(this,e,n,r),["smooth","points"].indexOf(e)>-1&&this.updatePath()},e.prototype.updatePath=function(){var e=this.parsedStyle,n=e.points.points,r=[["M",n[0][0],n[0][1]]];if(e.smooth)for(var i=Cu(n.map((function(t){return{x:t[0],y:t[1]}})),!1,[[0,0],[1,1]]),o=0,a=i.length;a>o;o++){var s=i[o];r.push(["C",s[1],s[2],s[3],s[4],s[5],s[6]])}else{var u;o=void 0;for(o=1,u=n.length-1;u>o;o++)r.push(["L",n[o][0],n[o][1]]);r.push(["L",n[u][0],n[u][1]])}t.prototype.setAttribute.call(this,"path",r)},e.tag="smooth-polyline",e}(Hs),Ru=function(){function t(t){this.el=t}return t.prototype.on=function(t,e){t&&this.el.addEventListener(t,e)},t.prototype.off=function(t,e){t&&this.el.removeEventListener(t,e)},t}(),Lu={},_u=function(t,e){Lu[t]=e},Iu=function(t){return Lu[t]},Du=[["click","onClick"],["touchstart","onTouchStart"],["touchmove","onTouchMove"],["touchend","onTouchEnd"],["touchendoutside","onTouchEndOutside"],["dragenter","onDragEnter"],["dragleave","onDragLeave"],["dragover","onDragOver"],["drop","onDrop"],["dragstart","onDragStart"],["drag","onDrag"],["dragend","onDragEnd"],["panstart","onPanStart"],["pan","onPan"],["panend","onPanEnd"],["pressstart","onPressStart"],["press","onPress"],["pressend","onPressEnd"],["swipe","onSwipe"],["pinchstart","onPinchStart"],["pinch","onPinch"],["pinchend","onPinchEnd"]];function Fu(t,e){if(!t)return null;var n=Iu(t);if(!n)return null;var r=new n(e);return r.gesture=function(t,e){var n=new Ru(t);return Du.forEach((function(t){var r=t[1];e[r]&&n.on(t[0],e[r])})),n}(r,e),r}function Bu(t){return Bu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bu(t)}function ju(t){return Object.prototype.toString.call(t)}function Gu(t){return Object.keys(t)}function Yu(t,e){if(t===e)return!0;if(Bu(t)!==Bu(e))return!1;if(null==t||null==e)return!1;if(Number.isNaN(t)&&Number.isNaN(e))return!0;if(ju(t)!==ju(e))return!1;if(h(t))return!1;if("object"!==Bu(t))return!1;if(y(t)){if(t.length!==e.length)return!1;for(var n=t.length-1;n>=0;n--)if(!Yu(t[n],e[n]))return!1;return!0}if(!b(t))return!1;var r=Gu(t),i=Gu(e);if(r.length!==i.length)return!1;r.sort(),i.sort();for(n=r.length-1;n>=0;n--)if(r[n]!=i[n])return!1;for(n=r.length-1;n>=0;n--){var o=r[n];if(!Yu(t[o],e[o]))return!1}return!0}[["group",Ks],["text",$s],["circle",Ys],["path",Hs],["ellipse",Vs],["rect",Ks],["image",zs],["line",Us],["polyline",Ou],["polygon",qs],["arc",pu],["marker",du],["sector",Tu]].map((function(t){_u(t[0],t[1])})),[{name:"r0",inherits:!1,interpolable:!0,syntax:Ci.LENGTH_PERCENTAGE},{name:"startAngle",inherits:!1,interpolable:!0,syntax:Ci.ANGLE},{name:"endAngle",inherits:!1,interpolable:!0,syntax:Ci.ANGLE}].forEach((function(t){Gs(t)}));var Vu=0,Wu=1,Xu=2;function zu(t){return P(t)?Xu:t.prototype&&t.prototype.isF2Component?Wu:Vu}function Uu(t){var e;return t.tag===Xu?t:(un.map(t.children,(function(t){e||(e=Uu(t))})),e)}var Hu=cn((function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||t,a),u=n?n+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},s.prototype.listeners=function(t){var e=this._events[n?n+t:t];if(!e)return[];if(e.fn)return[e.fn];for(var r=0,i=e.length,o=Array(i);i>r;r++)o[r]=e[r].fn;return o},s.prototype.listenerCount=function(t){var e=this._events[n?n+t:t];return e?e.fn?1:e.length:0},s.prototype.emit=function(t,e,r,i,o,a){var s=n?n+t:t;if(!this._events[s])return!1;var u,l,c=this._events[s],h=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,r),!0;case 4:return c.fn.call(c.context,e,r,i),!0;case 5:return c.fn.call(c.context,e,r,i,o),!0;case 6:return c.fn.call(c.context,e,r,i,o,a),!0}for(l=1,u=Array(h-1);h>l;l++)u[l-1]=arguments[l];c.fn.apply(c.context,u)}else{var p,f=c.length;for(l=0;f>l;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),h){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,e);break;case 3:c[l].fn.call(c[l].context,e,r);break;case 4:c[l].fn.call(c[l].context,e,r,i);break;default:if(!u)for(p=1,u=Array(h-1);h>p;p++)u[p-1]=arguments[p];c[l].fn.apply(c[l].context,u)}}return!0},s.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,r,i){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var u=0,l=[],c=s.length;c>u;u++)(s[u].fn!==e||i&&!s[u].once||r&&s[u].context!==r)&&l.push(s[u]);l.length?this._events[o]=1===l.length?l[0]:l:a(this,o)}return this},s.prototype.removeAllListeners=function(t){var e;return t?this._events[e=n?n+t:t]&&a(this,e):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s}));function qu(t,e){e&&Object.keys(e).forEach((function(n){if("clip"===n||"offset"===n){var r=e[n];if(Os(null==r?void 0:r.current))return void t.setAttribute("".concat(n,"Path"),r.current);var i=h(r)?r(e):r;if(i){var o=Fu(i.type,{style:i.style});t.setAttribute("".concat(n,"Path"),o)}}else t.setAttribute(n,e[n])}))}var Zu=function(t){function e(e){var n=t.call(this)||this;return n.timeline=e,n}return n(e,t),e.prototype.animate=function(t,e,n,r){this.shape=t,this.start=e,this.end=n,this.effect=r},e.prototype.run=function(){var t=this,e=t.vNode,n=t.shape,i=t.start,o=t.end,a=t.effect,s=t.children,u=[];if(a){var l=a.property,c=void 0===l?[]:l,p=a.easing,f=a.duration,d=a.delay,y=a.iterations,v=a.clip,g=a.direction,m=void 0===g?"normal":g,x=a.onFrame,b=void 0===x?function(){}:x,M=a.onEnd,w=void 0===M?function(){}:M;if(c.length&&f>0){var E=r(r({},it(i,c)),it(o,c));qu(n,E);var k=c.reduce((function(t,e){return t[e]=i[e],t}),{}),S=rt(o,c),P=n.animate([k,S],{fill:"both",easing:p,duration:f,delay:d,iterations:y,direction:m});P?(P.onframe=b,P.onfinish=w,y!==1/0&&u.push(P)):qu(n,o)}else qu(n,o);if(v){var T=h(v)?v(o):v;if(T){var N=T.type,C=T.style,A=T.property,O=void 0===A?[]:A,R=T.easing,L=T.duration,_=T.delay,I=T.iterations,D=T.start,F=T.end,B=T.direction;if(O.length&&(L||f)>0){var j=r(r({},C),D),G=r(r({},C),F),Y=O.reduce((function(t,e){return t[e]=j[e],t}),{}),V=rt(G,O),W=Fu(N,{style:j});n.setAttribute("clipPath",W),n.ownerDocument.documentElement.appendChild(W);var X=W.animate([Y,V],{fill:"both",easing:R||p,duration:L||f,delay:_||d,iterations:I||y,direction:B||m});if(X)X.finished.then((function(){n.setAttribute("clipPath",null),W.destroy()})),(I||y)!==1/0&&u.push(X);else n.setAttribute("clipPath",null),W.destroy()}}}}if(s&&s.length&&s.forEach((function(t){if(t){var e=t.run();e&&u.push.apply(u,e)}})),this.animations=u,this.timeline&&this.timeline.push(u),e){var z=e.component;e&&e.component&&z.animationWillPlay&&z.animationWillPlay()}return this.endEmit(u),u},e.prototype.play=function(){var t=this.animations;t&&t.length&&t.forEach((function(t){t.play()}))},e.prototype.pause=function(){var t=this.animations;t&&t.length&&t.forEach((function(t){t.pause()}))},e.prototype.goTo=function(t){var e=this.animations;e&&e.length&&e.forEach((function(e){e.currentTime=t}))},e.prototype.finish=function(){var t=this.animations;t&&t.length&&t.forEach((function(t){t.finish()}))},e.prototype.endEmit=function(t){var e=this;if(!t.length)return this.emit("end"),null;Promise.all(t.map((function(t){return t.finished}))).then((function(){e.emit("end")}))},e.prototype.reset=function(t){this.shape=t,this.start=null,this.end=null,this.effect=null,this.children=null},e}(Hu);function Ku(t){var e=[];return un.map(t,(function(t){if(t){var n=t.children;t.tag===Xu&&"group"!==t.type&&e.push(t),n&&e.push.apply(e,Ku(n))}})),e}function $u(t,e,n){var i=e.props,o=e.shape,a=e.style,s=e.context,u=t.shape,l=t.style,c=t.animator;u.destroy();var h=i.animation,p=h?h.update:null;if(!1===i.animate||!p)return n;n=n||new Zu(s.timeline);var f=p.start,d=p.end,y=p.property,v=void 0===y?[]:y,g=o.parsedStyle,m=u.parsedStyle,x=bo(u),b=bo(o),M=r(r(r({},l),f),{path:x}),w=r(r(r({},a),d),{path:b}),E=Fu("path",{style:r(r({},M),{path:""})}),k=v.filter((function(t){return g.hasOwnProperty(t)&&m.hasOwnProperty(t)})).concat("path");n.animate(E,M,w,r(r({},p),{property:k}));var S=(null==e?void 0:e.context).timeline;return S&&S.delete(c),n.once("end",(function(){o.destroyed||(qu(o,w),E.replaceWith(o))})),n}function Ju(t,e){var n=t.tag,i=t.type,o=t.style,a=t.children,s=t.props,u=t.shape,l=t.animator,c=t.animate,h=e.tag,p=e.type,f=e.style,d=e.children,y=e.shape;l.reset(u),l.children=el(t,a,d);var v=s.animation,g=v?v.update:null;if(i===p){var m=f?Object.keys(f).reduce((function(t,e){return t[e]="",t}),{}):null,x=r(r({},m),o);if(n!==Xu)return qu(u,x),l;if(J(o,f))return l;if(!1===c||!g)return qu(u,x),l;var b=g.start,M=g.end,w=r(r({},f),b),E=r(r({},x),M);return l.animate(u,w,E,g),l}return n!==Xu||h!==Xu?(y.destroy(),l):"group"===i?Ku(t.children).map((function(t){return $u(e,t)})):"group"===p?Ku(e.children).map((function(e){return $u(e,t)})):!1!==c&&g?$u(e,t,l):(qu(u,o),l)}function Qu(t){return un.map(t,(function(t){if(!t)return null;var e=t.tag,n=t.shape,i=t.children,o=t.animate,a=t.style,s=t.props,u=t.animator,l=t.context.timeline;if(n.destroyed)return null;u.reset(n);var c=i?un.toArray(i).map((function(t){return Qu(t)})).filter(Boolean):null;if(!1===o)return n.destroy(),u;var h=s.animation,p=h?h.leave:null;if(!(c&&c.length||p))return n.destroy(),u;if(u.children=c,p&&e===Xu){var f=p.start,d=p.end,y=void 0===d?{}:d,v=r(r({},a),f);u.animate(n,v,y,p),l&&l.delete(u.animations)}return u.once("end",(function(){n.destroy()})),u}))}function tl(t,e){if(!t&&!e)return null;if(!t&&e)return Qu(e);var n=t.transform;if(n){var i=Uu(t);t.transform=null,i.transform=n}return t.transform?e?[Ju(t,t.transform),Qu(e)]:Ju(t,t.transform):t&&!e?un.map(t,(function(t){if(t){var e=t.tag,n=t.shape,i=t.style,o=t.children,a=t.animate,s=t.props,u=t.animator;if(u.reset(n),u.children=o?el(t,o,null):null,!1===a||e!==Xu)return qu(n,i),u;var l=s.animation,c=l?l.appear:null;if(!c)return qu(n,i),u;var h=c.start,p=void 0===h?{}:h,f=c.end,d=r(r({},i),f);return u.animate(n,p,d,c),u}})):Ju(t,e)}function el(t,e,n){if(!e&&!n)return[];var r,i=t.shape,o=[];return un.compare(e,n,(function(t,e){var n=tl(t,e);un.map(n,(function(t){if(t){o.push(t);var e,n=t.shape;if(n&&!n.destroyed)(e=r?r.nextSibling:i.firstChild)!==n&&function(t,e,n){n?t.insertBefore(e,n):t.appendChild(e)}(i,n,e),r=n}}))})),o}var nl,rl=function(t){return{x:t.left,y:t.top,width:t.width,height:t.height}},il={rect:rl,line:function(t){var e=t.left,n=t.top;return{x1:e,y1:n,x2:e+t.width,y2:n+t.height}},text:function(t){return{x:t.left,y:t.top+t.height/2,textBaseline:"middle"}},circle:function(t){var e=t.width/2;return{cx:t.left+e,cy:t.top+e,r:e}},marker:function(t){var e=t.width/2;return{x:t.left+e,y:t.top,radius:e}},group:rl},ol=function(t,e){return e?(il[t]||rl)(e):null},al="inherit",sl="ltr",ul="rtl",ll="row",cl="row-reverse",hl="column",pl="column-reverse",fl="flex-start",dl="center",yl="flex-end",vl="space-between",gl="space-around",ml="flex-start",xl="center",bl="flex-end",Ml="stretch",wl="relative",El="absolute",kl={row:"left","row-reverse":"right",column:"top","column-reverse":"bottom"},Sl={row:"right","row-reverse":"left",column:"bottom","column-reverse":"top"},Pl={row:"left","row-reverse":"right",column:"top","column-reverse":"bottom"},Tl={row:"width","row-reverse":"width",column:"height","column-reverse":"height"};function Nl(t){return t.layout&&!t.isDirty||(t.layout={width:void 0,height:void 0,top:0,left:0,right:0,bottom:0}),t.style||(t.style={}),t.children||(t.children=[]),t.children.forEach(Nl),t}function Cl(t){return void 0===t}function Al(t){return t===ll||t===cl}function Ol(t,e){if(void 0!==t.style.marginStart&&Al(e))return t.style.marginStart;var n=null;switch(e){case"row":n=t.style.marginLeft;break;case"row-reverse":n=t.style.marginRight;break;case"column":n=t.style.marginTop;break;case"column-reverse":n=t.style.marginBottom}return void 0!==n?n:void 0!==t.style.margin?t.style.margin:0}function Rl(t,e){if(void 0!==t.style.marginEnd&&Al(e))return t.style.marginEnd;var n=null;switch(e){case"row":n=t.style.marginRight;break;case"row-reverse":n=t.style.marginLeft;break;case"column":n=t.style.marginBottom;break;case"column-reverse":n=t.style.marginTop}return null!=n?n:void 0!==t.style.margin?t.style.margin:0}function Ll(t,e){if(void 0!==t.style.borderStartWidth&&t.style.borderStartWidth>=0&&Al(e))return t.style.borderStartWidth;var n=null;switch(e){case"row":n=t.style.borderLeftWidth;break;case"row-reverse":n=t.style.borderRightWidth;break;case"column":n=t.style.borderTopWidth;break;case"column-reverse":n=t.style.borderBottomWidth}return null==n||0>n?void 0===t.style.borderWidth||0>t.style.borderWidth?0:t.style.borderWidth:n}function _l(t,e){if(void 0!==t.style.borderEndWidth&&t.style.borderEndWidth>=0&&Al(e))return t.style.borderEndWidth;var n=null;switch(e){case"row":n=t.style.borderRightWidth;break;case"row-reverse":n=t.style.borderLeftWidth;break;case"column":n=t.style.borderBottomWidth;break;case"column-reverse":n=t.style.borderTopWidth}return null==n||0>n?void 0===t.style.borderWidth||0>t.style.borderWidth?0:t.style.borderWidth:n}function Il(t,e){return function(t,e){if(void 0!==t.style.paddingStart&&t.style.paddingStart>=0&&Al(e))return t.style.paddingStart;var n=null;switch(e){case"row":n=t.style.paddingLeft;break;case"row-reverse":n=t.style.paddingRight;break;case"column":n=t.style.paddingTop;break;case"column-reverse":n=t.style.paddingBottom}return null==n||0>n?void 0===t.style.padding||0>t.style.padding?0:t.style.padding:n}(t,e)+Ll(t,e)}function Dl(t,e){return function(t,e){if(void 0!==t.style.paddingEnd&&t.style.paddingEnd>=0&&Al(e))return t.style.paddingEnd;var n=null;switch(e){case"row":n=t.style.paddingRight;break;case"row-reverse":n=t.style.paddingLeft;break;case"column":n=t.style.paddingBottom;break;case"column-reverse":n=t.style.paddingTop}return null==n||0>n?void 0===t.style.padding||0>t.style.padding?0:t.style.padding:n}(t,e)+_l(t,e)}function Fl(t,e){return Ll(t,e)+_l(t,e)}function Bl(t,e){return Ol(t,e)+Rl(t,e)}function jl(t,e){return Il(t,e)+Dl(t,e)}function Gl(t,e){return e.style.alignSelf?e.style.alignSelf:t.style.alignItems?t.style.alignItems:"stretch"}function Yl(t,e){if(e===ul){if(t===ll)return cl;if(t===cl)return ll}return t}function Vl(t,e){return function(t){return t===hl||t===pl}(t)?Yl(ll,e):hl}function Wl(t){return t.style.position?t.style.position:"relative"}function Xl(t){return Wl(t)===wl&&t.style.flex>0}function zl(t,e){return t.layout[Tl[e]]+Bl(t,e)}function Ul(t,e){return void 0!==t.style[Tl[e]]&&t.style[Tl[e]]>=0}function Hl(t,e){return void 0!==t.style[e]}function ql(t,e){return void 0!==t.style[e]?t.style[e]:0}function Zl(t,e,n){var r={row:t.style.minWidth,"row-reverse":t.style.minWidth,column:t.style.minHeight,"column-reverse":t.style.minHeight}[e],i={row:t.style.maxWidth,"row-reverse":t.style.maxWidth,column:t.style.maxHeight,"column-reverse":t.style.maxHeight}[e],o=n;return void 0!==i&&i>=0&&o>i&&(o=i),void 0!==r&&r>=0&&r>o&&(o=r),o}function Kl(t,e){return t>e?t:e}function $l(t,e){void 0===t.layout[Tl[e]]&&Ul(t,e)&&(t.layout[Tl[e]]=Kl(Zl(t,e,t.style[Tl[e]]),jl(t,e)))}function Jl(t,e,n){e.layout[Sl[n]]=t.layout[Tl[n]]-e.layout[Tl[n]]-e.layout[Pl[n]]}function Ql(t,e){return void 0!==t.style[kl[e]]?ql(t,kl[e]):-ql(t,Sl[e])}function tc(t,e,n){var r=function(t,e){var n;return(n=t.style.direction?t.style.direction:al)===al&&(n=void 0===e?sl:e),n}(t,n),i=Yl(function(t){return t.style.flexDirection?t.style.flexDirection:hl}(t),r),o=Vl(i,r),a=Yl(ll,r);$l(t,i),$l(t,o),t.layout.direction=r,t.layout[kl[i]]+=Ol(t,i)+Ql(t,i),t.layout[Sl[i]]+=Rl(t,i)+Ql(t,i),t.layout[kl[o]]+=Ol(t,o)+Ql(t,o),t.layout[Sl[o]]+=Rl(t,o)+Ql(t,o);var s=t.children.length,u=jl(t,a);if(function(t){return void 0!==t.style.measure}(t)){var l=!Cl(t.layout[Tl[a]]),c=nl;c=Ul(t,a)?t.style.width:l?t.layout[Tl[a]]:e-Bl(t,a),c-=u;var h=!Ul(t,a)&&!l,p=!Ul(t,hl)&&Cl(t.layout[Tl[hl]]);if(h||p){var f=t.style.measure(c);h&&(t.layout.width=f.width+u),p&&(t.layout.height=f.height+jl(t,hl))}if(0===s)return}var d,y,v,g,m=function(t){return"wrap"===t.style.flexWrap}(t),x=function(t){return t.style.justifyContent?t.style.justifyContent:"flex-start"}(t),b=Il(t,i),M=Il(t,o),w=jl(t,i),E=jl(t,o),k=!Cl(t.layout[Tl[i]]),S=!Cl(t.layout[Tl[o]]),P=Al(i),T=null,N=null,C=nl;k&&(C=t.layout[Tl[i]]-w);for(var A=0,O=0,R=0,L=0,_=0,I=0;s>O;){var D,F=0,B=0,j=0,G=0,Y=k&&x===fl||!k&&x!==dl,V=Y?s:A,W=!0,X=s,z=null,U=null,H=b,q=0;for(d=A;s>d;++d){if((v=t.children[d]).lineIndex=I,v.nextAbsoluteChild=null,v.nextFlexChild=null,(rt=Gl(t,v))===Ml&&Wl(v)===wl&&S&&!Ul(v,o))v.layout[Tl[o]]=Kl(Zl(v,o,t.layout[Tl[o]]-E-Bl(v,o)),jl(v,o));else if(Wl(v)===El)for(null===T&&(T=v),null!==N&&(N.nextAbsoluteChild=v),N=v,y=0;2>y;y++)!Cl(t.layout[Tl[g=0!==y?ll:hl]])&&!Ul(v,g)&&Hl(v,kl[g])&&Hl(v,Sl[g])&&(v.layout[Tl[g]]=Kl(Zl(v,g,t.layout[Tl[g]]-jl(t,g)-Bl(v,g)-ql(v,kl[g])-ql(v,Sl[g])),jl(v,g)));var Z=0;if(k&&Xl(v)?(B++,j+=v.style.flex,null===z&&(z=v),null!==U&&(U.nextFlexChild=v),U=v,Z=jl(v,i)+Bl(v,i)):(D=nl,P||(D=Ul(t,a)?t.layout[Tl[a]]-u:e-Bl(t,a)-u),0===R&&nc(v,D,r),Wl(v)===wl&&(G++,Z=zl(v,i))),m&&k&&F+Z>C&&d!==A){G--,R=1;break}Y&&(Wl(v)!==wl||Xl(v))&&(Y=!1,V=d),W&&(Wl(v)!==wl||rt!==Ml&&rt!==ml||Cl(v.layout[Tl[o]]))&&(W=!1,X=d),Y&&(v.layout[Pl[i]]+=H,k&&Jl(t,v,i),H+=zl(v,i),q=Kl(q,Zl(v,o,zl(v,o)))),W&&(v.layout[Pl[o]]+=L+M,S&&Jl(t,v,o)),R=0,F+=Z,O=d+1}var K=0,$=0,J=0;if(J=k?C-F:Kl(F,0)-F,0!==B){var Q,tt,et=J/j;for(U=z;null!==U;)(Q=et*U.style.flex+jl(U,i))!==(tt=Zl(U,i,Q))&&(J-=tt,j-=U.style.flex),U=U.nextFlexChild;for(0>(et=J/j)&&(et=0),U=z;null!==U;)U.layout[Tl[i]]=Zl(U,i,et*U.style.flex+jl(U,i)),D=nl,Ul(t,a)?D=t.layout[Tl[a]]-u:P||(D=e-Bl(t,a)-u),nc(U,D,r),v=U,U=U.nextFlexChild,v.nextFlexChild=null}else x!==fl&&(x===dl?K=J/2:x===yl?K=J:x===vl?(J=Kl(J,0),$=B+G-1!=0?J/(B+G-1):0):x===gl&&(K=($=J/(B+G))/2));for(H+=K,d=V;O>d;++d)Wl(v=t.children[d])===El&&Hl(v,kl[i])?v.layout[Pl[i]]=ql(v,kl[i])+Ll(t,i)+Ol(v,i):(v.layout[Pl[i]]+=H,k&&Jl(t,v,i),Wl(v)===wl&&(H+=$+zl(v,i),q=Kl(q,Zl(v,o,zl(v,o)))));var nt=t.layout[Tl[o]];for(S||(nt=Kl(Zl(t,o,q+E),E)),d=X;O>d;++d)if(Wl(v=t.children[d])===El&&Hl(v,kl[o]))v.layout[Pl[o]]=ql(v,kl[o])+Ll(t,o)+Ol(v,o);else{var rt,it=M;if(Wl(v)===wl)if((rt=Gl(t,v))===Ml)Cl(v.layout[Tl[o]])&&(v.layout[Tl[o]]=Kl(Zl(v,o,nt-E-Bl(v,o)),jl(v,o)));else if(rt!==ml){var ot=nt-E-zl(v,o);it+=rt===xl?ot/2:ot}v.layout[Pl[o]]+=L+it,S&&Jl(t,v,o)}L+=q,_=Kl(_,H),I+=1,A=O}if(I>1&&S){var at=t.layout[Tl[o]]-E,st=at-L,ut=0,lt=M,ct=function(t){return t.style.alignContent?t.style.alignContent:"flex-start"}(t);ct===bl?lt+=st:ct===xl?lt+=st/2:ct===Ml&&at>L&&(ut=st/I);var ht=0;for(d=0;I>d;++d){var pt=ht,ft=0;for(y=pt;s>y;++y)if(Wl(v=t.children[y])===wl){if(v.lineIndex!==d)break;Cl(v.layout[Tl[o]])||(ft=Kl(ft,v.layout[Tl[o]]+Bl(v,o)))}for(ht=y,ft+=ut,y=pt;ht>y;++y)if(Wl(v=t.children[y])===wl){var dt=Gl(t,v);if(dt===ml)v.layout[Pl[o]]=lt+Ol(v,o);else if(dt===bl)v.layout[Pl[o]]=lt+ft-Rl(v,o)-v.layout[Tl[o]];else if(dt===xl){v.layout[Pl[o]]=lt+(ft-v.layout[Tl[o]])/2}else dt===Ml&&(v.layout[Pl[o]]=lt+Ol(v,o))}lt+=ft}}var yt=!1,vt=!1;if(k||(t.layout[Tl[i]]=Kl(Zl(t,i,_+Dl(t,i)),w),i!==cl&&i!==pl||(yt=!0)),S||(t.layout[Tl[o]]=Kl(Zl(t,o,L+E),E),o!==cl&&o!==pl||(vt=!0)),yt||vt)for(d=0;s>d;++d)v=t.children[d],yt&&Jl(t,v,i),vt&&Jl(t,v,o);for(N=T;null!==N;){for(y=0;2>y;y++)!Cl(t.layout[Tl[g=0!==y?ll:hl]])&&!Ul(N,g)&&Hl(N,kl[g])&&Hl(N,Sl[g])&&(N.layout[Tl[g]]=Kl(Zl(N,g,t.layout[Tl[g]]-Fl(t,g)-Bl(N,g)-ql(N,kl[g])-ql(N,Sl[g])),jl(N,g))),Hl(N,Sl[g])&&!Hl(N,kl[g])&&(N.layout[kl[g]]=t.layout[Tl[g]]-N.layout[Tl[g]]-ql(N,Sl[g]));v=N,N=N.nextAbsoluteChild,v.nextAbsoluteChild=null}}function ec(t){var e=t.margin,n=t.layout;Object.keys(e).forEach((function(t){var r,i=Number((r=e[t]).substr(0,r.length-1))/100;"marginLeft"!==t&&"marginRight"!==t||!n.width?"marginTop"!==t&&"marginBottom"!==t||!n.height||(n.top+=n.height*i):n.left+=n.width*i}))}function nc(t,e,n){t.shouldUpdate=!0,function(t){var e=t.style,n={};["marginTop","marginRight","marginBottom","marginLeft"].forEach((function(t){var r=e[t];r&&/^-?\d+%$/.test(r)&&(n[t]=r,e[t]=0)})),t.margin=n}(t);var r=t.style.direction||sl;!t.isDirty&&t.lastLayout&&t.lastLayout.requestedHeight===t.layout.height&&t.lastLayout.requestedWidth===t.layout.width&&t.lastLayout.parentMaxWidth===e&&t.lastLayout.direction===r?(t.layout.width=t.lastLayout.width,t.layout.height=t.lastLayout.height,t.layout.top=t.lastLayout.top,t.layout.left=t.lastLayout.left):(t.lastLayout||(t.lastLayout={}),t.lastLayout.requestedWidth=t.layout.width,t.lastLayout.requestedHeight=t.layout.height,t.lastLayout.parentMaxWidth=e,t.lastLayout.direction=r,t.children.forEach((function(t){t.layout.width=void 0,t.layout.height=void 0,t.layout.top=0,t.layout.left=0})),tc(t,e,n),t.lastLayout.width=t.layout.width,t.lastLayout.height=t.layout.height,t.lastLayout.top=t.layout.top,t.lastLayout.left=t.layout.left),ec(t)}function rc(t){return t?(Nl(t),nc(t,null,null),t):t}function ic(t,e){return function(){var n=t.text,r=t.width,i=t.height,o=r,a=i;if(!_(r)||!_(i)){var s=e(n,t),u=s.width,l=s.height;_(r)||(o=u),_(i)||(a=l)}return{width:o,height:a}}}var oc=function(){function t(e){var n=e.className,r=e.children,i=e.layout,o=r&&r.length?r.map((function(e){return new t(e)})):void 0,a=i||function(t){if(t){var e=0,n=0,r=0,i=0,o=0,a=0;return t.forEach((function(t){var s=t.layout;s&&(e=Math.min(e,s.left),n=Math.min(n,s.top),r=Math.min(r,s.left+s.width),i=Math.min(i,s.top+s.height),o=Math.max(o,s.width),a=Math.max(a,s.height))})),{left:e,top:n,right:r,bottom:i,width:o,height:a}}}(o);this.children=o,this.layout=a,this.className=n}return t.prototype.getElementsByClassName=function(t){var e=[],n=this.children;return this.className===t&&e.push(this),n&&n.forEach((function(n){e.push.apply(e,n.getElementsByClassName(t))})),e},t}();function ac(t,e){if(!t)return t;var n=[];if(!y(t))return(o=e(t))?(y(o)?n=n.concat(o):n.push(o),n):n;for(var r=0;t.length>r;r++){var i=t[r];if(y(i))n=n.concat(ac(i,e));else if(i){var o;if(!(o=e(i)))continue;y(o)?n=n.concat(o):n.push(o)}}return n}function sc(t,e,n){if(!t)return t;var i=e.px2hd,o=e.measureText,a=t.type,s=t.props;if(zu(a)===Vu)return sc(a(t.props,e,n),e,n);var u=s.className,l=s.style,c=s.attrs,h=s.children,p=i(r(r({},void 0===l?{}:l),c));return"text"===a&&(p.measure=ic(p,o)),{type:a,className:u,children:(h?un.toArray(h).map((function(t){return sc(t,e,n)})):[]).filter(Boolean),style:p}}function uc(t,e){var n=sc(e,t.context,t.updater);return rc(n),new oc(n)}function lc(t,e){var n=t.tag;return ac(e,(function(t){var e=t.tag;return n!==Xu&&e===Xu&&"flex"!==t.style.display?null:e!==Xu?lc(t,t.children):cc(t)}))}function cc(t){var e=t.tag,n=t.type,r=t.style,i=t.context.measureText,o=lc(t,t.children);return"text"===n&&(r.measure=ic(r,i)),{tag:e,type:n,style:r,children:o,vNode:t}}function hc(t){var e=t.style,n=t.vNode,i=t.children,o=t.layout,a=ol(t.type,o);if(e.measure&&delete e.measure,n.layout=o,n.style=r(r({},a),e),i&&i.length)for(var s=0,u=i.length;u>s;s++){hc(i[s])}}function pc(t){var e=t.layout;un.map(t.children,(function(t){if(t){var n=t.style;t.tag!==Xu&&e&&!t.layout&&(t.layout=e,t.style=r({width:e.width,height:e.height},n)),pc(t)}}))}function fc(t,e,n){var i=e.style,o=e.attrs,a=e.zIndex;return t===Xu?n.px2hd(r(r({},void 0===i?{}:i),o)):_(a)?{zIndex:a}:{}}function dc(t,e){return t.contextInjecter?r({},e):e}function yc(t,e){var n=t.contextType;if(!n)return e;var r=n._currentValue;return r||e}function vc(t,e){var n=t.canvas,o=t.context,a=t.updater,s=t.animate,u=e.ref,l=e.type,c=e.props,h=c.animate,p=c.transformFrom,f=i(c,["animate","transformFrom"]),d=zu(l),y=dc(l,o),v=new Zu(y.timeline),g=fc(d,f,y);if(v.vNode=e,e.parent=t,e.tag=d,e.style=g,e.context=y,e.updater=a,e.canvas=n,e.animate=G(h)?h:s,e.animator=v,d===Xu){var m=Fu(l,r(r({},f),{style:g}));u&&(u.current=m),m._vNode=e,e.shape=m}else{var x=yc(l,y),b=void 0;d===Wu?b=new l(f,x,a):(b=new an(f,x,a)).render=function(){return l(this.props,x,a)};var M=new Ws;b.container=M,u&&(u.current=b),b.context=x,b.updater=a,b.animator=v,b._vNode=e,e.shape=M,e.component=b}p&&p.current&&(e.transform=Uu(p.current._vNode),e.transform&&(e.transform.parent.children=null));return e}function gc(t,e,n){var r=t.canvas,i=t.context,o=t.updater,a=t.animate,s=n.tag,u=n.animator,l=n.component,c=n.shape,h=n.children,p=n.props,f=e.type,d=e.props,y=d.animate;return u.vNode=e,e.parent=t,e.tag=s,e.canvas=r,e.context=dc(f,i),e.updater=o,e.component=l,e.shape=function(t,e,n){var r=t.gesture;return r&&(Du.forEach((function(t){var e=t[1];n[e]&&r.off(t[0],n[e])})),Du.forEach((function(t){var n=t[1];e[n]&&r.on(t[0],e[n])}))),t}(c,d,p),e.parent=t,e.children=h,e.animate=G(y)?y:a,e.animator=u,e.style=fc(s,d,i),l?l._vNode=e:c._vNode=e,e}function mc(t){un.map(t,(function(t){if(t){var e=t.component,n=t.children;e?(e.willUnmount(),mc(n),e.didUnmount(),e.destroy()):mc(n)}}))}function xc(t,e,n){return e||n?!e&&n?(mc(n),null):e&&!n?function(t,e){return un.map(e,(function(e){return e?vc(t,e):e}))}(t,e):function(t,e,n){var r=e.props,i=n.props;if(e.type===n.type){var o=gc(t,e,n);return Yu(r,i)&&t.context===n.context?null:o}var a=vc(t,e);return mc(n),a}(t,e,n):null}function bc(t,e,n){var r,i=t.component,o=(r=e)?un.map(r,(function(t){return t?rt(t,["key","ref","type","props"]):t})):r;t.children=o,i&&(i.children=o);var a=[];return un.compare(o,n,(function(e,n){var r=xc(t,e,n);un.map(r,(function(t){if(t){var e=[];e=t.tag===Xu?bc(t,t.props.children,t.children):[t],a=a.concat(e)}}))})),a}function Mc(t,e,n){var r=bc(t,e,n),i=cc(t);rc(i),hc(i),pc(t);var o=t.children;return r.length?(function(t){if(t&&t.length){var e=t.filter((function(t){var e=t.type,n=t.component,r=t.props,i=t.context;if(n.layout=t.layout,!n.isMounted)return!0;if(!1===n.shouldUpdate(r))return!1;var o=yc(e,i);return n.willReceiveProps(r,o),n.props=r,n.context=i,!0}));e.length&&(e.forEach((function(t){var e=t.component;e.isMounted?e.willUpdate():e.willMount()})),e.forEach((function(t){var e=t.component,n=t.children;Mc(t,t.canvas.toRawChildren(e.render()),n),e.isMounted?e.didUpdate():(e.didMount(),e.isMounted=!0)})))}}(r),o):o}function wc(t,e){var n=e.r;t.arc(n,n,n,0,2*Math.PI,!1)}function Ec(t,e){var n=e.rx,r=e.ry;if(t.ellipse)t.ellipse(n,r,n,r,0,0,2*Math.PI,!1);else{var i=n>r?n:r,o=n>r?1:n/r,a=n>r?r/n:1;t.save(),t.scale(o,a),t.arc(i,i,i,0,2*Math.PI)}}function kc(t,e){var n=e.x1,r=e.y1,i=e.x2,o=e.y2,a=e.defX,s=void 0===a?0:a,u=e.defY,l=void 0===u?0:u,c=e.markerStart,h=e.markerEnd,p=e.markerStartOffset,f=e.markerEndOffset,d=0,y=0,v=0,g=0,m=0;c&&Os(c)&&p&&(d=Math.cos(m=Math.atan2(o-r,i-n))*(p||0),y=Math.sin(m)*(p||0)),h&&Os(h)&&f&&(v=Math.cos(m=Math.atan2(r-o,n-i))*(f||0),g=Math.sin(m)*(f||0)),t.moveTo(n-s+d,r-l+y),t.lineTo(i-s+v,o-l+g)}function Sc(t,e){var n=e.defX,r=void 0===n?0:n,i=e.defY,o=void 0===i?0:i,a=e.markerStart,s=e.markerEnd,l=e.markerStartOffset,c=e.markerEndOffset,h=e.path,p=h.absolutePath,f=h.segments,d=0,y=0,v=0,g=0,m=0;if(a&&Os(a)&&l){var x=u(a.parentNode.getStartTangent(),2);d=Math.cos(m=Math.atan2((b=x[0])[1]-(M=x[1])[1],b[0]-M[0]))*(l||0),y=Math.sin(m)*(l||0)}if(s&&Os(s)&&c){var b,M,w=u(s.parentNode.getEndTangent(),2);v=Math.cos(m=Math.atan2((b=w[0])[1]-(M=w[1])[1],b[0]-M[0]))*(c||0),g=Math.sin(m)*(c||0)}for(var E=0;p.length>E;E++){var k=p[E],S=p[E+1],P=0===E&&(0!==d||0!==y),T=(E===p.length-1||S&&("M"===S[0]||"Z"===S[0]))&&0!==v&&0!==g;switch(k[0]){case"M":P?(t.moveTo(k[1]-r+d,k[2]-o+y),t.lineTo(k[1]-r,k[2]-o)):t.moveTo(k[1]-r,k[2]-o);break;case"L":T?t.lineTo(k[1]-r+v,k[2]-o+g):t.lineTo(k[1]-r,k[2]-o);break;case"Q":t.quadraticCurveTo(k[1]-r,k[2]-o,k[3]-r,k[4]-o),T&&t.lineTo(k[3]-r+v,k[4]-o+g);break;case"C":t.bezierCurveTo(k[1]-r,k[2]-o,k[3]-r,k[4]-o,k[5]-r,k[6]-o),T&&t.lineTo(k[5]-r+v,k[6]-o+g);break;case"A":var N=f[E].arcParams,C=N.cx,A=N.cy,O=N.rx,R=N.ry,L=N.startAngle,_=N.endAngle,I=N.xRotation,D=N.sweepFlag;if(t.ellipse)t.ellipse(C-r,A-o,O,R,I,L,_,!!(1-D));else{var F=O>R?O:R,B=O>R?1:O/R,j=O>R?R/O:1;t.translate(C-r,A-o),t.rotate(I),t.scale(B,j),t.arc(0,0,F,L,_,!!(1-D)),t.scale(1/B,1/j),t.rotate(-I),t.translate(-(C-r),-(A-o))}T&&t.lineTo(k[6]-r+v,k[7]-o+g);break;case"Z":t.closePath()}}}function Pc(t,e){var n=e.defX,r=void 0===n?0:n,i=e.defY,o=void 0===i?0:i,a=e.markerStart,s=e.markerEnd,u=e.markerStartOffset,l=e.markerEndOffset,c=e.points.points,h=c.length,p=c[0][0]-r,f=c[0][1]-o,d=c[h-1][0]-r,y=c[h-1][1]-o,v=0,g=0,m=0,x=0,b=0;a&&Os(a)&&u&&(v=Math.cos(b=Math.atan2(c[1][1]-c[0][1],c[1][0]-c[0][0]))*(u||0),g=Math.sin(b)*(u||0)),s&&Os(s)&&l&&(m=Math.cos(b=Math.atan2(c[h-1][1]-c[0][1],c[h-1][0]-c[0][0]))*(l||0),x=Math.sin(b)*(l||0)),t.moveTo(p+(v||m),f+(g||x));for(var M=1;h-1>M;M++){var w=c[M];t.lineTo(w[0]-r,w[1]-o)}t.lineTo(d,y)}function Tc(t,e){var n=e.defX,r=void 0===n?0:n,i=e.defY,o=void 0===i?0:i,a=e.markerStart,s=e.markerEnd,u=e.markerStartOffset,l=e.markerEndOffset,c=e.points.points,h=c.length,p=c[0][0]-r,f=c[0][1]-o,d=c[h-1][0]-r,y=c[h-1][1]-o,v=0,g=0,m=0,x=0,b=0;a&&Os(a)&&u&&(v=Math.cos(b=Math.atan2(c[1][1]-c[0][1],c[1][0]-c[0][0]))*(u||0),g=Math.sin(b)*(u||0)),s&&Os(s)&&l&&(m=Math.cos(b=Math.atan2(c[h-2][1]-c[h-1][1],c[h-2][0]-c[h-1][0]))*(l||0),x=Math.sin(b)*(l||0)),t.moveTo(p+v,f+g);for(var M=1;h-1>M;M++){var w=c[M];t.lineTo(w[0]-r,w[1]-o)}t.lineTo(d+m,y+x)}function Nc(t,e){var n=e.radius,r=e.width,i=e.height,o=r,a=i;if(n&&n.some((function(t){return 0!==t}))){var s=r>0?1:-1,l=i>0?1:-1,c=s+l===0,h=u(n.map((function(t){return L(t,0,Math.min(Math.abs(o)/2,Math.abs(a)/2))})),4),p=h[0],f=h[1],d=h[2],y=h[3];t.moveTo(s*p,0),t.lineTo(o-s*f,0),0!==f&&t.arc(o-s*f,l*f,f,-l*Math.PI/2,s>0?0:Math.PI,c),t.lineTo(o,a-l*d),0!==d&&t.arc(o-s*d,a-l*d,d,s>0?0:Math.PI,l>0?Math.PI/2:1.5*Math.PI,c),t.lineTo(s*y,a),0!==y&&t.arc(s*y,a-l*y,y,l>0?Math.PI/2:-Math.PI/2,s>0?Math.PI:0,c),t.lineTo(0,l*p),0!==p&&t.arc(s*p,l*p,p,s>0?Math.PI:0,l>0?1.5*Math.PI:Math.PI/2,c)}else t.rect(0,0,o,a)}var Cc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="canvas-path-generator",e}return n(e,t),e.prototype.init=function(){var t,e=((t={})[sr.CIRCLE]=wc,t[sr.ELLIPSE]=Ec,t[sr.RECT]=Nc,t[sr.LINE]=kc,t[sr.POLYLINE]=Tc,t[sr.POLYGON]=Pc,t[sr.PATH]=Sc,t[sr.TEXT]=void 0,t[sr.GROUP]=void 0,t[sr.IMAGE]=void 0,t[sr.HTML]=void 0,t[sr.MESH]=void 0,t);this.context.pathGeneratorFactory=e},e.prototype.destroy=function(){delete this.context.pathGeneratorFactory},e}(cr),Ac=Dt(),Oc=Dt(),Rc=Dt(),Lc=lt(),_c=function(){function t(){var t=this;this.isHit=function(e,n,r,i){var o=t.context.pointInPathPickerFactory[e.nodeName];if(o){var a=dt(Lc,r),s=Ut(Oc,Gt(Rc,n[0],n[1],0),a),u=e.getGeometryBounds().halfExtents,l=e.parsedStyle.anchor;if(s[0]+=(l&&l[0]||0)*u[0]*2,s[1]+=(l&&l[1]||0)*u[1]*2,o(e,new Dr(s[0],s[1]),i,t.isPointInPath,t.context,t.runtime))return!0}return!1},this.isPointInPath=function(e,n){var r=t.runtime.offscreenCanvasCreator.getOrCreateContext(t.context.config.offscreenCanvas),i=t.context.pathGeneratorFactory[e.nodeName];return i&&(r.beginPath(),i(r,e.parsedStyle),r.closePath()),r.isPointInPath(n.x,n.y)}}return t.prototype.apply=function(e,n){var r,i=this,s=e.renderingService,u=e.renderingContext;this.context=e,this.runtime=n;var l=null===(r=u.root)||void 0===r?void 0:r.ownerDocument;s.hooks.pick.tapPromise(t.tag,(function(t){return o(i,void 0,void 0,(function(){return a(this,(function(e){return[2,this.pick(l,t)]}))}))})),s.hooks.pickSync.tap(t.tag,(function(t){return i.pick(l,t)}))},t.prototype.pick=function(t,e){var n,r,i=e.topmost,o=e.position,a=Gt(Ac,o.x,o.y,0),u=t.elementsFromBBox(a[0],a[1],a[0],a[1]),l=[];try{for(var c=s(u),h=c.next();!h.done;h=c.next()){var p=h.value,f=p.getWorldTransform();if(this.isHit(p,a,f,!1)){var d=xa(p);if(d){var y=d.parsedStyle.clipPath;if(this.isHit(y,a,y.getWorldTransform(),!0)){if(i)return e.picked=[p],e;l.push(p)}}else{if(i)return e.picked=[p],e;l.push(p)}}}}catch(t){n={error:t}}finally{try{h&&!h.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return e.picked=l,e},t.tag="CanvasPicker",t}();function Ic(t,e,n){var r=t.parsedStyle,i=r.r,o=r.fill,a=r.stroke,s=r.pointerEvents,l=((r.lineWidth||0)+(r.increasedLineWidthForHitTesting||0))/2,c=Yn(i,i,e.x,e.y),h=u(Ea(s,o,a),2),p=h[0],f=h[1];return p&&f||n?i+l>=c:p?i>=c:!!f&&(c>=i-l&&i+l>=c)}function Dc(t,e,n,r){return t/(n*n)+e/(r*r)}function Fc(t,e,n){var r=t.parsedStyle,i=r.rx,o=r.ry,a=r.lineWidth,s=r.increasedLineWidthForHitTesting,l=e.x,c=e.y,h=u(Ea(r.pointerEvents,r.fill,r.stroke),2),p=h[0],f=h[1],d=((a||0)+(s||0))/2,y=(l-i)*(l-i),v=(c-o)*(c-o);return p&&f||n?1>=Dc(y,v,i+d,o+d):p?1>=Dc(y,v,i,o):!!f&&(Dc(y,v,i-d,o-d)>=1&&1>=Dc(y,v,i+d,o+d))}function Bc(t,e,n,r,i,o){return!(t>i||i>t+n||e>o||o>e+r)}function jc(t,e,n,r,i,o,a,s){var u=(Math.atan2(s-e,a-t)+2*Math.PI)%(2*Math.PI),l={x:t+n*Math.cos(u),y:e+n*Math.sin(u)};return Yn(l.x,l.y,a,s)<=o/2}function Gc(t,e,n,r,i,o,a){var s=i/2;return!(Math.min(t,n)-s>o||o>Math.max(t,n)+s||Math.min(e,r)-s>a||a>Math.max(e,r)+s)&&Kn(t,e,n,r,o,a)<=i/2}function Yc(t,e,n,r,i){var o=t.length;if(2>o)return!1;for(var a=0;o-1>a;a++){if(Gc(t[a][0],t[a][1],t[a+1][0],t[a+1][1],e,n,r))return!0}if(i){var s=t[0],u=t[o-1];if(Gc(s[0],s[1],u[0],u[1],e,n,r))return!0}return!1}var Vc=1e-6;function Wc(t){return Vc>Math.abs(t)?0:0>t?-1:1}function Xc(t,e,n){return!((n[0]-t[0])*(e[1]-t[1])!=(e[0]-t[0])*(n[1]-t[1])||Math.min(t[0],e[0])>n[0]||n[0]>Math.max(t[0],e[0])||Math.min(t[1],e[1])>n[1]||n[1]>Math.max(t[1],e[1]))}function zc(t,e,n){var r=!1,i=t.length;if(2>=i)return!1;for(var o=0;i>o;o++){var a=t[o],s=t[(o+1)%i];if(Xc(a,s,[e,n]))return!0;Wc(a[1]-n)>0!=Wc(s[1]-n)>0&&0>Wc(e-(n-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])&&(r=!r)}return r}function Uc(t,e,n){for(var r=!1,i=0;t.length>i;i++){if(r=zc(t[i],e,n))break}return r}function Hc(t,e,n){var r=t.parsedStyle,i=r.x1,o=r.y1,a=r.x2,s=r.y2,l=r.lineWidth,c=r.increasedLineWidthForHitTesting,h=r.defX,p=void 0===h?0:h,f=r.defY,d=void 0===f?0:f;return!(!u(Ea(r.pointerEvents,r.fill,r.stroke),2)[1]&&!n||!l)&&Gc(i,o,a,s,(l||0)+(c||0),e.x+p,e.y+d)}function qc(t,e,n,r,i,o){var a=t.parsedStyle,s=a.lineWidth,l=a.increasedLineWidthForHitTesting,c=a.defX,h=void 0===c?0:c,p=a.defY,f=void 0===p?0:p,d=a.path,y=d.segments,v=d.hasArc,g=d.polylines,m=d.polygons,x=u(Ea(a.pointerEvents,(null==m?void 0:m.length)&&a.fill,a.stroke),2),b=x[0],M=x[1],w=so(t),E=!1;return b||n?E=v?r(t,e):Uc(m,e.x+h,e.y+f)||Uc(g,e.x+h,e.y+f):((M||n)&&(E=function(t,e,n,r,i){for(var o=!1,a=e/2,s=0;t.length>s;s++){var u=t[s],l=u.currentPoint,c=u.params,h=u.prePoint,p=u.box;if(!p||Bc(p.x-a,p.y-a,p.width+e,p.height+e,n,r))switch(u.command){case"L":case"Z":if(o=Gc(h[0],h[1],l[0],l[1],e,n,r))return!0;break;case"Q":if(o=e/2>=or(h[0],h[1],c[1],c[2],c[3],c[4],n,r))return!0;break;case"C":if(o=e/2>=tr(h[0],h[1],c[1],c[2],c[3],c[4],c[5],c[6],n,r,i))return!0;break;case"A":u.cubicParams||(u.cubicParams=Ge(h[0],h[1],c[1],c[2],c[3],c[4],c[5],c[6],c[7],void 0));for(var f=u.cubicParams,d=h,y=0;f.length>y;y+=6){var v=tr(d[0],d[1],f[y],f[y+1],f[y+2],f[y+3],f[y+4],f[y+5],n,r,i);if(d=[f[y+4],f[y+5]],o=e/2>=v)return!0}}}return o}(y,(s||0)+(l||0),e.x+h,e.y+f,w)),E)}function Zc(t,e,n){var r=t.parsedStyle,i=r.lineWidth,o=r.increasedLineWidthForHitTesting,a=r.points,s=r.defX,l=void 0===s?0:s,c=r.defY,h=void 0===c?0:c,p=u(Ea(r.pointerEvents,r.fill,r.stroke),2),f=p[0],d=!1;return(p[1]||n)&&(d=Yc(a.points,(i||0)+(o||0),e.x+l,e.y+h,!0)),d||!f&&!n||(d=zc(a.points,e.x+l,e.y+h)),d}function Kc(t,e,n){var r=t.parsedStyle,i=r.lineWidth,o=r.increasedLineWidthForHitTesting,a=r.points,s=r.defX,l=void 0===s?0:s,c=r.defY,h=void 0===c?0:c;return!(!u(Ea(r.pointerEvents,r.fill,r.stroke),2)[1]&&!n||!i)&&Yc(a.points,(i||0)+(o||0),e.x+l,e.y+h,!1)}function $c(t,e,n,r,i){var o=t.parsedStyle,a=o.radius,s=o.lineWidth,l=o.increasedLineWidthForHitTesting,c=o.width,h=o.height,p=u(Ea(o.pointerEvents,o.fill,o.stroke),2),f=p[0],d=p[1],y=(s||0)+(l||0);if(a&&a.some((function(t){return 0!==t}))){var v=!1;return(d||n)&&(v=function(t,e,n,r,i,o,a,s){var l=u(i,4),c=l[0],h=l[1],p=l[2],f=l[3];return Gc(t+c,e,t+n-h,e,o,a,s)||Gc(t+n,e+h,t+n,e+r-p,o,a,s)||Gc(t+n-p,e+r,t+f,e+r,o,a,s)||Gc(t,e+r-f,t,e+c,o,a,s)||jc(t+n-h,e+h,h,0,0,o,a,s)||jc(t+n-p,e+r-p,p,0,0,o,a,s)||jc(t+f,e+r-f,f,0,0,o,a,s)||jc(t+c,e+c,c,0,0,o,a,s)}(0,0,c,h,a.map((function(t){return L(t,0,Math.min(Math.abs(c)/2,Math.abs(h)/2))})),y,e.x,e.y)),v||!f&&!n||(v=r(t,e)),v}var g=y/2;return f&&d||n?Bc(0-g,0-g,c+g,h+g,e.x,e.y):f?Bc(0,0,c,h,e.x,e.y):!!d&&function(t,e,n,r,i,o,a){var s=i/2;return Bc(t-s,e-s,n,i,o,a)||Bc(t+n-s,e-s,i,r,o,a)||Bc(t+s,e+r-s,n,i,o,a)||Bc(t-s,e+s,i,r,o,a)}(0,0,c,h,y,e.x,e.y)}function Jc(t,e,n,r,i,o){var a=t.parsedStyle,s=a.width,u=a.height;if("non-transparent-pixel"===a.pointerEvents){var l=i.config.offscreenCanvas,c=o.offscreenCanvasCreator.getOrCreateCanvas(l),h=o.offscreenCanvasCreator.getOrCreateContext(l,{willReadFrequently:!0});return c.width=s,c.height=u,i.defaultStyleRendererFactory[sr.IMAGE].render(h,t.parsedStyle,t,void 0,void 0,void 0),h.getImageData(e.x,e.y,1,1).data.every((function(t){return 0!==t}))}return!0}var Qc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="canvas-picker",e}return n(e,t),e.prototype.init=function(){var t,e=((t={})[sr.CIRCLE]=Ic,t[sr.ELLIPSE]=Fc,t[sr.RECT]=$c,t[sr.LINE]=Hc,t[sr.POLYLINE]=Kc,t[sr.POLYGON]=Zc,t[sr.PATH]=qc,t[sr.TEXT]=function(){return!0},t[sr.GROUP]=null,t[sr.IMAGE]=Jc,t[sr.HTML]=null,t[sr.MESH]=null,t);this.context.pointInPathPickerFactory=e,this.addRenderingPlugin(new _c)},e.prototype.destroy=function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()},e}(cr),th=function(){function t(t){this.canvasRendererPluginOptions=t,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.vpMatrix=lt(),this.dprMatrix=lt(),this.tmpMat4=lt(),this.vec3a=Dt(),this.vec3b=Dt(),this.vec3c=Dt(),this.vec3d=Dt()}return t.prototype.apply=function(e,n){var r=this;this.context=e;var i=e.config,o=e.camera,a=e.renderingService,s=e.renderingContext,c=e.pathGeneratorFactory;this.rBush=e.rBushRoot,this.pathGeneratorFactory=c;var h=e.contextService,p=s.root.ownerDocument.defaultView,f=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)},d=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)};a.hooks.init.tap(t.tag,(function(){p.addEventListener(ss.UNMOUNTED,f),p.addEventListener(ss.CULLED,d);var t=h.getDPR(),e=i.width,n=i.height,o=h.getContext();r.clearRect(o,0,0,e*t,n*t,i.background)})),a.hooks.destroy.tap(t.tag,(function(){p.removeEventListener(ss.UNMOUNTED,f),p.removeEventListener(ss.CULLED,d),r.renderQueue=[],r.removedRBushNodeAABBs=[],r.restoreStack=[]})),a.hooks.beginFrame.tap(t.tag,(function(){var t=h.getContext(),e=h.getDPR(),n=i.width,o=i.height,s=r.canvasRendererPluginOptions,u=s.dirtyObjectNumThreshold,l=s.dirtyObjectRatioThreshold,c=a.getStats(),p=c.rendered,f=p/c.total;r.clearFullScreen=a.disableDirtyRectangleRendering()||p>u&&f>l,t&&(t.resetTransform?t.resetTransform():t.setTransform(1,0,0,1,0,0),r.clearFullScreen&&r.clearRect(t,0,0,n*e,o*e,i.background))}));var y=function(t,e){t.isVisible()&&!t.isCulled()&&(r.renderDisplayObject(t,e,r.context,r.restoreStack,n),r.saveDirtyAABB(t)),(t.sortable.sorted||t.childNodes).forEach((function(t){y(t,e)}))};a.hooks.endFrame.tap(t.tag,(function(){var t=h.getContext(),e=h.getDPR();if(wt(r.dprMatrix,[e,e,1]),vt(r.vpMatrix,r.dprMatrix,o.getOrthoMatrix()),r.clearFullScreen)y(s.root,t);else{var a=r.safeMergeAABB.apply(r,l([r.mergeDirtyAABBs(r.renderQueue)],u(r.removedRBushNodeAABBs.map((function(t){var e=t.minX,n=t.minY,r=t.maxX,i=t.maxY,o=new Ar;return o.setMinMax([e,n,0],[r,i,0]),o}))),!1));if(r.removedRBushNodeAABBs=[],Ar.isEmpty(a))return void(r.renderQueue=[]);var c=r.convertAABB2Rect(a),f=c.x,d=c.y,v=c.width,g=c.height,m=Ut(r.vec3a,[f,d,0],r.vpMatrix),x=Ut(r.vec3b,[f+v,d,0],r.vpMatrix),b=Ut(r.vec3c,[f,d+g,0],r.vpMatrix),M=Ut(r.vec3d,[f+v,d+g,0],r.vpMatrix),w=Math.min(m[0],x[0],M[0],b[0]),E=Math.min(m[1],x[1],M[1],b[1]),k=Math.max(m[0],x[0],M[0],b[0]),S=Math.max(m[1],x[1],M[1],b[1]),P=Math.floor(w),T=Math.floor(E),N=Math.ceil(k-w),C=Math.ceil(S-E);t.save(),r.clearRect(t,P,T,N,C,i.background),t.beginPath(),t.rect(P,T,N,C),t.clip(),t.setTransform(r.vpMatrix[0],r.vpMatrix[1],r.vpMatrix[4],r.vpMatrix[5],r.vpMatrix[12],r.vpMatrix[13]),i.renderer.getConfig().enableDirtyRectangleRenderingDebug&&p.dispatchEvent(new ns(Rs.DIRTY_RECTANGLE,{dirtyRect:{x:P,y:T,width:N,height:C}})),r.searchDirtyObjects(a).sort((function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder})).forEach((function(e){e&&e.isVisible()&&!e.isCulled()&&r.renderDisplayObject(e,t,r.context,r.restoreStack,n)})),t.restore(),r.renderQueue.forEach((function(t){r.saveDirtyAABB(t)})),r.renderQueue=[]}r.restoreStack.forEach((function(){t.restore()})),r.restoreStack=[]})),a.hooks.render.tap(t.tag,(function(t){r.clearFullScreen||r.renderQueue.push(t)}))},t.prototype.clearRect=function(t,e,n,r,i,o){t.clearRect(e,n,r,i),o&&(t.fillStyle=o,t.fillRect(e,n,r,i))},t.prototype.renderDisplayObject=function(t,e,n,r,i){var o=t.nodeName,a=r[r.length-1];!a||t.compareDocumentPosition(a)&is.DOCUMENT_POSITION_CONTAINS||(e.restore(),r.pop());var s=this.context.styleRendererFactory[o],u=this.pathGeneratorFactory[o],l=t.parsedStyle.clipPath;if(l){this.applyWorldTransform(e,l);var c=this.pathGeneratorFactory[l.nodeName];c&&(e.save(),r.push(t),e.beginPath(),c(e,l.parsedStyle),e.closePath(),e.clip())}s&&(this.applyWorldTransform(e,t),e.save(),this.applyAttributesToContext(e,t)),u&&(e.beginPath(),u(e,t.parsedStyle),t.nodeName!==sr.LINE&&t.nodeName!==sr.PATH&&t.nodeName!==sr.POLYLINE&&e.closePath()),s&&(s.render(e,t.parsedStyle,t,n,this,i),e.restore()),t.renderable.dirty=!1},t.prototype.convertAABB2Rect=function(t){var e=t.getMin(),n=t.getMax(),r=Math.floor(e[0]),i=Math.floor(e[1]);return{x:r,y:i,width:Math.ceil(n[0])-r,height:Math.ceil(n[1])-i}},t.prototype.mergeDirtyAABBs=function(t){var e=new Ar;return t.forEach((function(t){var n=t.getRenderBounds();e.add(n);var r=t.renderable.dirtyRenderBounds;r&&e.add(r)})),e},t.prototype.searchDirtyObjects=function(t){var e=u(t.getMin(),2),n=e[0],r=e[1],i=u(t.getMax(),2);return this.rBush.search({minX:n,minY:r,maxX:i[0],maxY:i[1]}).map((function(t){return t.displayObject}))},t.prototype.saveDirtyAABB=function(t){var e=t.renderable;e.dirtyRenderBounds||(e.dirtyRenderBounds=new Ar);var n=t.getRenderBounds();n&&e.dirtyRenderBounds.update(n.center,n.halfExtents)},t.prototype.applyAttributesToContext=function(t,e){var n=e.parsedStyle,r=n.stroke,i=n.fill,o=n.opacity,a=n.lineDash,s=n.lineDashOffset;a&&t.setLineDash(a),p(s)||(t.lineDashOffset=s),p(o)||(t.globalAlpha*=o),p(r)||Array.isArray(r)||r.isNone||(t.strokeStyle=e.attributes.stroke),p(i)||Array.isArray(i)||i.isNone||(t.fillStyle=e.attributes.fill)},t.prototype.applyWorldTransform=function(t,e,n){var r=0,i=0,o=(e.parsedStyle||{}).anchor,a=o&&o[0]||0,s=o&&o[1]||0;if(0!==a||0!==s){var u=e.geometry.contentBounds;r=-a*(u&&2*u.halfExtents[0]||0),i=-s*(u&&2*u.halfExtents[1]||0)}n?(ct(this.tmpMat4,e.getLocalTransform()),this.vec3a[0]=r,this.vec3a[1]=i,this.vec3a[2]=0,gt(this.tmpMat4,this.tmpMat4,this.vec3a),vt(this.tmpMat4,n,this.tmpMat4),vt(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(ct(this.tmpMat4,e.getWorldTransform()),this.vec3a[0]=r,this.vec3a[1]=i,this.vec3a[2]=0,gt(this.tmpMat4,this.tmpMat4,this.vec3a),vt(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])},t.prototype.safeMergeAABB=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];var n=new Ar;return t.forEach((function(t){n.add(t)})),n},t.tag="CanvasRenderer",t}(),eh=function(){function t(t){this.imagePool=t}return t.prototype.render=function(t,e,n,r,i,o){var a=e.fill,s=e.fillRule,u=e.opacity,l=e.fillOpacity,c=e.stroke,h=e.strokeOpacity,f=e.lineWidth,d=e.lineCap,y=e.lineJoin,v=e.shadowType,g=e.shadowColor,m=e.shadowBlur,x=e.filter,b=e.miterLimit,M=!p(a)&&!a.isNone,w=!p(c)&&!c.isNone&&f>0,E=0===a.alpha,k=!(!x||!x.length),S=!p(g)&&m>0,P=n.nodeName,T="inner"===v,N=w&&S&&(P===sr.PATH||P===sr.LINE||P===sr.POLYLINE||E||T);M&&(t.globalAlpha=u*l,N||nh(n,t,S),this.fill(t,n,a,s,r,i,o),N||this.clearShadowAndFilter(t,k,S)),w&&(t.globalAlpha=u*h,t.lineWidth=f,p(b)||(t.miterLimit=b),p(d)||(t.lineCap=d),p(y)||(t.lineJoin=y),N&&(T&&(t.globalCompositeOperation="source-atop"),nh(n,t,!0),T&&(this.stroke(t,n,c,r,i,o),t.globalCompositeOperation="source-over",this.clearShadowAndFilter(t,k,!0))),this.stroke(t,n,c,r,i,o))},t.prototype.clearShadowAndFilter=function(t,e,n){if(n&&(t.shadowColor="transparent",t.shadowBlur=0),e){var r=t.filter;!p(r)&&r.indexOf("drop-shadow")>-1&&(t.filter=r.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}},t.prototype.fill=function(t,e,n,r,i,o,a){var s=this;Array.isArray(n)?n.forEach((function(n){t.fillStyle=s.getColor(n,e,t),r?t.fill(r):t.fill()})):(Yi(n)&&(t.fillStyle=this.getPattern(n,e,t,i,o,a)),r?t.fill(r):t.fill())},t.prototype.stroke=function(t,e,n,r,i,o){var a=this;Array.isArray(n)?n.forEach((function(n){t.strokeStyle=a.getColor(n,e,t),t.stroke()})):(Yi(n)&&(t.strokeStyle=this.getPattern(n,e,t,r,i,o)),t.stroke())},t.prototype.getPattern=function(t,e,n,r,i,o){var a,s;if("rect"===t.image.nodeName){var u=t.image.parsedStyle,l=u.width,c=u.height;s=r.contextService.getDPR();var h=r.config.offscreenCanvas;(a=o.offscreenCanvasCreator.getOrCreateCanvas(h)).width=l*s,a.height=c*s;var p=o.offscreenCanvasCreator.getOrCreateContext(h),f=[];t.image.forEach((function(t){i.renderDisplayObject(t,p,r,f,o)})),f.forEach((function(){p.restore()}))}return this.imagePool.getOrCreatePatternSync(t,n,a,s,(function(){e.renderable.dirty=!0,r.renderingService.dirtify()}))},t.prototype.getColor=function(t,e,n){var i;if(t.type===$r.LinearGradient||t.type===$r.RadialGradient){var o=e.getGeometryBounds(),a=o&&2*o.halfExtents[0]||1,s=o&&2*o.halfExtents[1]||1;i=this.imagePool.getOrCreateGradient(r(r({type:t.type},t.value),{width:a,height:s}),n)}return i},t}();function nh(t,e,n){var r=t.parsedStyle,i=r.filter,o=r.shadowColor,a=r.shadowBlur,s=r.shadowOffsetX,u=r.shadowOffsetY;i&&i.length&&(e.filter=t.style.filter),n&&(e.shadowColor=""+o,e.shadowBlur=a||0,e.shadowOffsetX=s||0,e.shadowOffsetY=u||0)}var rh=function(){function t(t){this.imagePool=t}return t.prototype.render=function(t,e,n){var r,i=e.img,o=e.shadowColor,a=e.shadowBlur,s=e.width,u=e.height;if(P(i)?r=this.imagePool.getImageSync(i):(s||(s=i.width),u||(u=i.height),r=i),r){nh(n,t,!p(o)&&a>0);try{t.drawImage(r,0,0,s,u)}catch(t){}}},t}(),ih=function(){function t(){}return t.prototype.render=function(t,e,n,r,i,o){var a=e.lineWidth,s=e.textAlign,u=e.textBaseline,l=e.lineJoin,c=e.miterLimit,h=e.letterSpacing,f=e.stroke,d=e.fill,y=e.fillOpacity,v=e.strokeOpacity,g=e.opacity,m=e.metrics,x=e.dx,b=e.dy,M=e.shadowColor,w=e.shadowBlur,E=m.lines,k=m.height,S=m.lineHeight,P=m.lineMetrics;t.font=m.font,t.lineWidth=a,t.textAlign="middle"===s?"center":s;var T=u;o.enableCSSParsing||"alphabetic"!==T||(T="bottom"),t.lineJoin=l,p(c)||(t.miterLimit=c);var N=0;"middle"===u?N=-k/2-S/2:"bottom"===u||"alphabetic"===u||"ideographic"===u?N=-k:"top"!==u&&"hanging"!==u||(N=-S);var C=x||0;N+=b||0,1===E.length&&("bottom"===T?(T="middle",N-=.5*k):"top"===T&&(T="middle",N+=.5*k)),t.textBaseline=T,nh(n,t,!p(M)&&w>0);for(var A=0;E.length>A;A++){var O=a/2+C;N+=S,p(f)||f.isNone||!a||this.drawLetterSpacing(t,E[A],P[A],s,O,N,h,y,v,g,!0),p(d)||this.drawLetterSpacing(t,E[A],P[A],s,O,N,h,y,v,g)}},t.prototype.drawLetterSpacing=function(t,e,n,r,i,o,a,s,u,l,c){if(void 0===c&&(c=!1),0!==a){var h=t.textAlign;t.textAlign="left";var p=i;"center"===r||"middle"===r?p=i-n.width/2:"right"!==r&&"end"!==r||(p=i-n.width);for(var f=Array.from(e),d=t.measureText(e).width,y=0,v=0;f.length>v;++v){var g=f[v];c?this.strokeText(t,g,p,o,u):this.fillText(t,g,p,o,s,l),p+=d-(y=t.measureText(e.substring(v+1)).width)+a,d=y}t.textAlign=h}else c?this.strokeText(t,e,i,o,u):this.fillText(t,e,i,o,s,l)},t.prototype.fillText=function(t,e,n,r,i,o){var a,s=!p(i)&&1!==i;s&&(a=t.globalAlpha,t.globalAlpha=i*o),t.fillText(e,n,r),s&&(t.globalAlpha=a)},t.prototype.strokeText=function(t,e,n,r,i){var o,a=!p(i)&&1!==i;a&&(o=t.globalAlpha,t.globalAlpha=i),t.strokeText(e,n,r),a&&(t.globalAlpha=o)},t}(),oh=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}n(e,t)}(eh),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}n(e,t)}(eh),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}n(e,t)}(eh),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}n(e,t)}(eh),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}n(e,t)}(eh),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}n(e,t)}(eh),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}n(e,t)}(eh),function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;return n.options=e,n.name="canvas-renderer",n}return n(e,t),e.prototype.init=function(){var t,e=r({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),n=this.context.imagePool,i=new eh(n),o=((t={})[sr.CIRCLE]=i,t[sr.ELLIPSE]=i,t[sr.RECT]=i,t[sr.IMAGE]=new rh(n),t[sr.TEXT]=new ih,t[sr.LINE]=i,t[sr.POLYLINE]=i,t[sr.POLYGON]=i,t[sr.PATH]=i,t[sr.GROUP]=void 0,t[sr.HTML]=void 0,t[sr.MESH]=void 0,t);this.context.defaultStyleRendererFactory=o,this.context.styleRendererFactory=o,this.addRenderingPlugin(new th(e))},e.prototype.destroy=function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory},e}(cr)),ah=function(){function t(t){this.dragndropPluginOptions=t}return t.prototype.apply=function(e){var n=this,r=e.renderingService,i=e.renderingContext.root.ownerDocument,s=i.defaultView,u=function(t){var e=t.target,r=e===i,u=r&&n.dragndropPluginOptions.isDocumentDraggable?i:e.closest&&e.closest("[draggable=true]");if(u){var l=!1,c=t.timeStamp,h=[t.clientX,t.clientY],p=null,f=[t.clientX,t.clientY],d=function(t){return o(n,void 0,void 0,(function(){var n,o,s,d,y,v;return a(this,(function(a){switch(a.label){case 0:if(!l){if(n=t.timeStamp-c,o=ze([t.clientX,t.clientY],h),this.dragndropPluginOptions.dragstartTimeThreshold>=n||this.dragndropPluginOptions.dragstartDistanceThreshold>=o)return[2];t.type="dragstart",u.dispatchEvent(t),l=!0}return t.type="drag",t.dx=t.clientX-f[0],t.dy=t.clientY-f[1],u.dispatchEvent(t),f=[t.clientX,t.clientY],r?[3,2]:(s="pointer"===this.dragndropPluginOptions.overlap?[t.canvasX,t.canvasY]:e.getBounds().center,[4,i.elementsFromPoint(s[0],s[1])]);case 1:d=a.sent(),y=d[d.indexOf(e)+1],v=(null==y?void 0:y.closest("[droppable=true]"))||(this.dragndropPluginOptions.isDocumentDroppable?i:null),p!==v&&(p&&(t.type="dragleave",t.target=p,p.dispatchEvent(t)),v&&(t.type="dragenter",t.target=v,v.dispatchEvent(t)),(p=v)&&(t.type="dragover",t.target=p,p.dispatchEvent(t))),a.label=2;case 2:return[2]}}))}))};s.addEventListener("pointermove",d);var y=function(t){if(l){t.detail={preventClick:!0};var e=t.clone();p&&(e.type="drop",e.target=p,p.dispatchEvent(e)),e.type="dragend",u.dispatchEvent(e),l=!1}s.removeEventListener("pointermove",d)};e.addEventListener("pointerup",y,{once:!0}),e.addEventListener("pointerupoutside",y,{once:!0})}};r.hooks.init.tap(t.tag,(function(){s.addEventListener("pointerdown",u)})),r.hooks.destroy.tap(t.tag,(function(){s.removeEventListener("pointerdown",u)}))},t.tag="Dragndrop",t}(),sh=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;return n.options=e,n.name="dragndrop",n}return n(e,t),e.prototype.init=function(){this.addRenderingPlugin(new ah(r({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e.prototype.setOptions=function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)},e}(cr),uh=function(){function t(t){this.canvasConfig=t,this.imageCache={},this.gradientCache={},this.patternCache={}}return t.prototype.getImageSync=function(t,e){return this.imageCache[t]?e&&e(this.imageCache[t]):this.getOrCreateImage(t).then((function(t){e&&e(t)})),this.imageCache[t]},t.prototype.getOrCreateImage=function(t){var e=this;if(this.imageCache[t])return Promise.resolve(this.imageCache[t]);var n=this.canvasConfig.createImage;return new Promise((function(r,i){var o;n?o=n(t):va&&(o=new window.Image),o&&(o.onload=function(){e.imageCache[t]=o,r(o)},o.onerror=function(t){i(t)},o.crossOrigin="Anonymous",o.src=t)}))},t.prototype.getOrCreatePatternSync=function(t,e,n,r,i){var o=this.generatePatternKey(t);if(o&&this.patternCache[o])return this.patternCache[o];var a,s=t.image,u=t.repetition,l=t.transform,c=!1;P(s)?a=this.getImageSync(s,i):n?(a=n,c=!0):a=s;var h=a&&e.createPattern(a,u);if(h){var p=void 0;p=l?ra(Oo(l),new js({})):pt(lt()),c&&mt(p,p,[1/r,1/r,1]),h.setTransform({a:p[0],b:p[1],c:p[4],d:p[5],e:p[12],f:p[13]})}return o&&h&&(this.patternCache[o]=h),h},t.prototype.getOrCreateGradient=function(t,e){var n=this.generateGradientKey(t),r=t.type,i=t.steps,o=t.width,a=t.height,s=t.cx,u=t.cy,l=t.size;if(this.gradientCache[n])return this.gradientCache[n];var c=null;if(r===$r.LinearGradient){var h=function(t,e,n){var r=mr(n.value),i=0+t/2,o=0+e/2,a=Math.abs(t*Math.cos(r))+Math.abs(e*Math.sin(r));return{x1:i-Math.cos(r)*a/2,y1:o-Math.sin(r)*a/2,x2:i+Math.cos(r)*a/2,y2:o+Math.sin(r)*a/2}}(o,a,t.angle);c=e.createLinearGradient(h.x1,h.y1,h.x2,h.y2)}else if(r===$r.RadialGradient){var p=function(t,e,n,r,i){var o=n.value,a=r.value;n.unit===Gr.kPercentage&&(o=n.value/100*t),r.unit===Gr.kPercentage&&(a=r.value/100*e);var s=Math.max(ze([0,0],[o,a]),ze([0,e],[o,a]),ze([t,e],[o,a]),ze([t,0],[o,a]));return i&&(i instanceof fi?s=i.value:i instanceof ii&&("closest-side"===i.value?s=Math.min(o,t-o,a,e-a):"farthest-side"===i.value?s=Math.max(o,t-o,a,e-a):"closest-corner"===i.value&&(s=Math.min(ze([0,0],[o,a]),ze([0,e],[o,a]),ze([t,e],[o,a]),ze([t,0],[o,a]))))),{x:o,y:a,r:s}}(o,a,s,u,l),f=p.x,d=p.y;c=e.createRadialGradient(f,d,0,f,d,p.r)}return c&&(i.forEach((function(t){var e=t.offset;e.unit===Gr.kPercentage&&(null==c||c.addColorStop(e.value/100,""+t.color))})),this.gradientCache[n]=c),this.gradientCache[n]},t.prototype.generateGradientKey=function(t){var e=t.width,n=t.height,r=t.steps,i=t.angle,o=t.cx,a=t.cy,s=t.size;return"gradient-".concat(t.type,"-").concat((null==i?void 0:""+i)||0,"-").concat((null==o?void 0:""+o)||0,"-").concat((null==a?void 0:""+a)||0,"-").concat((null==s?void 0:""+s)||0,"-").concat(e,"-").concat(n,"-").concat(r.map((function(t){var e=t.color;return"".concat(t.offset).concat(e)})).join("-"))},t.prototype.generatePatternKey=function(t){var e=t.image,n=t.repetition;return P(e)?"pattern-".concat(e,"-").concat(n):"rect"===e.nodeName?"pattern-".concat(e.entity,"-").concat(n):void 0},t}(),lh=function(){function t(){}return t.prototype.apply=function(e){var n=e.renderingService,r=e.imagePool,i=e.renderingContext.root.ownerDocument.defaultView,o=function(t,e,n){var r=t.parsedStyle,i=r.width,o=r.height;i&&!o?t.setAttribute("height",n/e*i):!i&&o&&t.setAttribute("width",e/n*o)},a=function(t){var e=t.target,i=e.attributes;if(e.nodeName===sr.IMAGE){var a=i.img,s=i.keepAspectRatio;P(a)&&r.getImageSync(a,(function(t){s&&o(e,t.width,t.height),e.renderable.dirty=!0,n.dirtify()}))}},s=function(t){var e=t.target,i=t.newValue;e.nodeName===sr.IMAGE&&"img"===t.attrName&&P(i)&&r.getOrCreateImage(i).then((function(t){e.attributes.keepAspectRatio&&o(e,t.width,t.height),e.renderable.dirty=!0,n.dirtify()}))};n.hooks.init.tap(t.tag,(function(){i.addEventListener(ss.MOUNTED,a),i.addEventListener(ss.ATTR_MODIFIED,s)})),n.hooks.destroy.tap(t.tag,(function(){i.removeEventListener(ss.MOUNTED,a),i.removeEventListener(ss.ATTR_MODIFIED,s)}))},t.tag="LoadImage",t}(),ch=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="image-loader",e}return n(e,t),e.prototype.init=function(){this.context.imagePool=new uh(this.context.config),this.addRenderingPlugin(new lh)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(cr),hh=function(){function t(){}return t.prototype.apply=function(e){var n=e.renderingService,r=e.config,i=e.contextService.getDomElement(),o=function(t){n.hooks.pointerDown.call(t)},a=function(t){n.hooks.pointerUp.call(t)},s=function(t){n.hooks.pointerMove.call(t)},u=function(t){n.hooks.pointerOver.call(t)},l=function(t){n.hooks.pointerOut.call(t)},c=function(t){n.hooks.click.call(t)},h=function(t){n.hooks.pointerCancel.call(t)};n.hooks.init.tap(t.tag,(function(){i.addEventListener("touchstart",o,!0),i.addEventListener("touchend",a,!0),i.addEventListener("touchmove",s,!0),i.addEventListener("touchcancel",h,!0),i.addEventListener("mouseout",l,!0),i.addEventListener("mouseover",u,!0),r.useNativeClickEvent&&i.addEventListener("click",c,!0)})),n.hooks.destroy.tap(t.tag,(function(){i.removeEventListener("touchstart",o,!0),i.removeEventListener("touchend",a,!0),i.removeEventListener("touchmove",s,!0),i.removeEventListener("touchcancel",h,!0),i.removeEventListener("mouseout",l,!0),i.removeEventListener("mouseover",u,!0),r.useNativeClickEvent&&i.removeEventListener("click",c,!0)}))},t.tag="MobileInteraction",t}(),ph=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="mobile-interaction",e}return n(e,t),e.prototype.init=function(){this.addRenderingPlugin(new hh)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(cr),fh="object"==typeof performance&&performance.now?performance:Date,dh=function(t,e){var n=e.x-t.x,r=e.y-t.y;return Math.abs(n)>Math.abs(r)?n>0?"right":"left":r>0?"down":"up"},yh=function(t,e){var n=Math.abs(e.x-t.x),r=Math.abs(e.y-t.y);return Math.sqrt(n*n+r*r)},vh=function(){function t(t){var e=this;this.options=t,this.evCache=[],this.startPoints=[],this.processEvent={},this.throttleTimer=0,this.emitThrottles=[],this._start=function(t,n){var r;e.reset(),e.startTime=fh.now();var i=e.evCache,o=e.startPoints;if(t){var a=t.pointerId,s=t.x,c=t.y,h=i.findIndex((function(t){return a===t.pointerId}));-1!==h&&i.splice(h,1),i.push({pointerId:a,x:s,y:c,ev:t});for(var p=l([],u((null===(r=t.nativeEvent)||void 0===r?void 0:r.touches)||[]),!1),f=function(t){if(p.find((function(e){return i[t].pointerId===e.identifier})))return"continue";i.splice(t,1)},d=i.length-1;d>-1;d--)f(d)}o.length=i.length;for(d=0;i.length>d;d++){var y=i[d];o[d]={x:s=y.x,y:c=y.y}}if(1!==o.length){var v,g;e.startDistance=yh(o[0],o[1]),e.center={x:(v=o[0]).x+((g=o[1]).x-v.x)/2,y:v.y+(g.y-v.y)/2}}else{var m=i[0].ev;e.pressTimeout=setTimeout((function(){var t="press",r="none";m.direction=r,m.deltaX=0,m.deltaY=0,m.points=o,e.emitStart(t,m,n),m.type=t,n.dispatchEvent(m),e.eventType=t,e.direction=r,e.movingTarget=n}),250)}},this._move=function(t,n){e.clearPressTimeout();var r=e.startPoints,i=e.evCache;if(r.length){for(var o=t.x,a=t.y,s=t.pointerId,u=0,l=i.length;l>u;u++)if(s===i[u].pointerId){i[u]={pointerId:s,x:o,y:a,ev:t};break}var c={x:o,y:a},h=i.map((function(t){return{x:t.x,y:t.y}})),p=fh.now();if(e.prevMoveTime=e.lastMoveTime,e.prevMovePoint=e.lastMovePoint,e.lastMoveTime=p,e.lastMovePoint=c,1===r.length){var f=r[0],d=o-f.x,y=a-f.y,v=e.direction||dh(f,c);e.direction=v;var g=e.getEventType(c,n,t);return t.direction=v,t.deltaX=d,t.deltaY=y,t.points=h,e.emitStart(g,t,n),t.type=g,void e.refreshAndGetTarget(n).dispatchEvent(t)}var m=e.startDistance,x=yh(h[0],h[1]);t.zoom=x/m,t.center=e.center,t.points=h,e.emitStart("pinch",t,n),e._throttleEmit("pinch",t,n)}},this._end=function(t,n){var r=e.evCache,i=e.startPoints,o=r.map((function(t){return{x:t.x,y:t.y}}));if(t.points=o,e.emitEnd(t,e.refreshAndGetTarget(n)),1===r.length){var a=fh.now(),s=e.lastMoveTime;if(100>a-s){var u=s-(e.prevMoveTime||e.startTime);if(u>0){var l=e.prevMovePoint||i[0],c=e.lastMovePoint||i[0],h=yh(l,c)/u;h>.3&&(t.velocity=h,t.direction=dh(l,c),t.type="swipe",n.dispatchEvent(t))}}}for(var p=0,f=r.length;f>p;p++)if(r[p].pointerId===t.pointerId){r.splice(p,1),i.splice(p,1);break}e.reset(),r.length>0&&e._start(void 0,n)},this._cancel=function(t,n){var r=e.evCache.map((function(t){return{x:t.x,y:t.y}}));t.points=r,e.emitEnd(t,e.refreshAndGetTarget(n)),e.evCache=[],e.reset()}}return t.prototype.apply=function(e){var n=this,r=e.renderingService,i=e.renderingContext.root.ownerDocument,o=i.defaultView;this.canvas=o;var a=function(t){return t===i&&n.options.isDocumentGestureEnabled?i:t},s=function(t){var e=a(t.target);e&&n._move(t,e)},u=function(t){var e=a(t.target);e&&n._start(t,e)},l=function(t){var e=a(t.target);e&&n._end(t,e)},c=function(t){var e=a(t.target);e&&n._cancel(t,e)},h=function(t){var e=a(t.target);e&&n._end(t,e)};r.hooks.init.tap(t.tag,(function(){o.addEventListener("pointermove",s),o.addEventListener("pointerdown",u),o.addEventListener("pointerup",l),o.addEventListener("pointercancel",c),o.addEventListener("pointerupoutside",h)})),r.hooks.destroy.tap(t.tag,(function(){o.removeEventListener("pointermove",s),o.removeEventListener("pointerdown",u),o.removeEventListener("pointerup",l),o.removeEventListener("pointercancel",c),o.removeEventListener("pointerupoutside",h)}))},t.prototype.getEventType=function(t,e,n){var r,i=this,o=i.eventType,a=i.startTime,s=i.startPoints;if(o)return o;(this.movingTarget=e,this.isPanListenerInPath=n.path.some((function(t){var e,n;return!!(null===(n=null===(e=t.emitter)||void 0===e?void 0:e.eventNames())||void 0===n?void 0:n.includes("pan"))})),this.isPanListenerInPath)?r=fh.now()-a>250&&10>yh(s[0],t)?"press":"pan":r="press";return this.eventType=r,r},t.prototype.enable=function(t){this.processEvent[t]=!0},t.prototype.isProcess=function(t){return this.processEvent[t]},t.prototype.emitStart=function(t,e,n){this.isProcess(t)||(this.enable(t),e.type="".concat(t,"start"),n.dispatchEvent(e))},t.prototype._throttleEmit=function(t,e,n){var r=this;this.pushEvent(t,e);var i=this,o=i.emitThrottles,a=i.processEvent;i.throttleTimer||(this.throttleTimer=this.canvas.requestAnimationFrame((function(){for(var t=0,e=o.length;e>t;t++){var i=o[t],s=i.type,u=i.ev;a[s]&&(u.type=s,n.dispatchEvent(u))}r.throttleTimer=0,r.emitThrottles.length=0})))},t.prototype.emitEnd=function(t,e){var n=this.processEvent;Object.keys(n).forEach((function(r){t.type="".concat(r,"end"),e.dispatchEvent(t),delete n[r]}))},t.prototype.pushEvent=function(t,e){for(var n=this.emitThrottles,r={type:t,ev:e},i=0,o=n.length;o>i;i++)if(n[i].type===t)return void n.splice(i,1,r);n.push(r)},t.prototype.clearPressTimeout=function(){this.pressTimeout&&(clearTimeout(this.pressTimeout),this.pressTimeout=null)},t.prototype.refreshAndGetTarget=function(t){return this.movingTarget?(this.movingTarget&&!this.movingTarget.isConnected&&(this.movingTarget=t),this.movingTarget):t},t.prototype.reset=function(){this.clearPressTimeout(),this.startTime=0,this.startDistance=0,this.direction=null,this.eventType=null,this.prevMoveTime=0,this.prevMovePoint=null,this.lastMoveTime=0,this.lastMovePoint=null,this.movingTarget=null,this.isPanListenerInPath=null},t.tag="Gesture",t}(),gh=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;return n.options=e,n.name="gesture",n}return n(e,t),e.prototype.init=function(){this.addRenderingPlugin(new vh(r({isDocumentGestureEnabled:!1},this.options)))},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(cr);var mh=function(){function t(t){this.canvasConfig=t.config}return t.prototype.init=function(){return o(this,void 0,void 0,(function(){var t,e,n;return a(this,(function(r){return e=(t=this.canvasConfig).devicePixelRatio,this.$canvas=t.canvas,this.context=this.$canvas.getContext("2d"),this.dpr=n=1>(n=e||1)?1:Math.ceil(n),this.resize(this.canvasConfig.width,this.canvasConfig.height),[2]}))}))},t.prototype.getContext=function(){return this.context},t.prototype.getDomElement=function(){return this.$canvas},t.prototype.getDPR=function(){return this.dpr},t.prototype.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},t.prototype.destroy=function(){this.context=null,this.$canvas=null},t.prototype.resize=function(t,e){var n,r=this.canvasConfig.devicePixelRatio,i=this.$canvas;i.style&&(i.style.width=t+"px",i.style.height=e+"px"),(n=i)&&"object"==typeof n&&(1===n.nodeType&&n.nodeName||n.isCanvasElement)&&(i.width=t*r,i.height=e*r,1!==r&&this.context.scale(r,r))},t.prototype.applyCursorStyle=function(t){},t.prototype.toDataURL=function(t){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,this.context.canvas.toDataURL(t.type,t.encoderOptions)]}))}))},t}(),xh=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="mobile-canvas-context-register",e}return n(e,t),e.prototype.init=function(){this.context.ContextService=mh},e.prototype.destroy=function(){delete this.context.ContextService},e}(cr),bh=function(t){function e(e){var n=t.call(this,e)||this;return n.registerPlugin(new xh),n.registerPlugin(new ch),n.registerPlugin(new Cc),n.registerPlugin(new oh),n.registerPlugin(new ph),n.registerPlugin(new Qc),n.registerPlugin(new sh({isDocumentDraggable:!!p(null==e?void 0:e.isDocumentDraggable)||e.isDocumentDraggable,isDocumentDroppable:!!p(null==e?void 0:e.isDocumentDroppable)||e.isDocumentDroppable,dragstartDistanceThreshold:p(null==e?void 0:e.dragstartDistanceThreshold)?10:e.dragstartDistanceThreshold,dragstartTimeThreshold:p(null==e?void 0:e.dragstartTimeThreshold)?50:e.dragstartTimeThreshold})),n.registerPlugin(new gh({isDocumentGestureEnabled:!0})),n}return n(e,t),e}(hr);function Mh(t,e){for(var n=[],r=2;arguments.length>r;r++)n[r-2]=arguments[r];var o=e||{},a=o.key,s=o.ref,u=i(o,["key","ref"]);return n.length&&(u.children=1===n.length?n[0]:n),{key:a,ref:s,type:t,props:u}}var wh=function(){function t(t){this.isCanvasElement=!0,this.emitter=new hn,this.context=t;var e=t.canvas||{};this.width=e.width||0,this.height=e.height||0}return t.prototype.getContext=function(t,e){return this.context},t.prototype.getBoundingClientRect=function(){var t=this.width,e=this.height;return{top:0,right:t,bottom:e,left:0,width:t,height:e,x:0,y:0}},t.prototype.addEventListener=function(t,e,n){this.emitter.on(t,e)},t.prototype.removeEventListener=function(t,e,n){this.emitter.off(t,e)},t.prototype.dispatchEvent=function(t){return this.emitter.emit(t.type,t),!0},t}();function Eh(t){return t?function(t){if(!t)return!1;if(1!==t.nodeType||!t.nodeName||"canvas"!==t.nodeName.toLowerCase())return!1;var e=!1;try{t.addEventListener("eventTest",(function(){e=!0})),t.dispatchEvent(new Event("eventTest"))}catch(t){e=!1}return e}(t.canvas)?t.canvas:new wh(t):null}var kh,Sh={fontSize:"24px",fontFamily:'"Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif',pixelRatio:1,padding:[0,0,0,0]},Ph={fillStyle:"String",font:"String",globalAlpha:"Number",lineCap:"String",lineWidth:["Number","String"],lineJoin:"String",miterLimit:"Number",shadowBlur:"Number",shadowColor:"String",shadowOffsetX:"Number",shadowOffsetY:"Number",strokeStyle:"String",textAlign:"String",textBaseline:"String",lineDash:["Array","Number"],shadow:"String",matrix:"Array",stroke:"String",fill:["String","Object"],opacity:"Number",fillOpacity:"Number",strokeOpacity:"Number"},Th={group:r({},Ph),text:r(r({},Ph),{x:"Number",y:"Number",text:"String",width:"Number",height:"Number",fontSize:["Number","String"],fontFamily:"String",fontStyle:"String",fontWeight:["Number","String"],fontVariant:"String"}),circle:r(r({},Ph),{cx:"Number",cy:"Number",r:"Number"}),path:r({},Ph),ellipse:r(r({},Ph),{cy:"Number",cx:"Number",ry:"Number",rx:"Number"}),rect:r(r({},Ph),{width:"Number",height:"Number",x:"Number",y:"Number",radius:["Array","Number"]}),image:r(r({},Ph),{width:"Number",height:"Number",x:"Number",y:"Number",img:"String",src:"String"}),line:r(r({},Ph),{x1:"Number",x2:"Number",y1:"Number",y2:"Number"}),polyline:r(r({},Ph),{points:"Array",smooth:"Boolean"}),polygon:r(r({},Ph),{points:"Array"}),arc:r(r({},Ph),{x:"Number",y:"Number",r:"Number",startAngle:["Number","String"],endAngle:["Number","String"],anticlockwise:"Boolean"}),marker:r(r({},Ph),{x:"Number",y:"Number",radius:"Number",symbol:"String"}),sector:r(r({},Ph),{x:"Number",y:"Number",startAngle:["Number","String"],endAngle:["Number","String"],r:"Number",r0:"Number",anticlockwise:"Boolean"})};try{kh=parseInt(document.documentElement.style.fontSize,10)||50}catch(ku){kh=50}var Nh=kh/100;function Ch(t){if(_(t))return[t,t,t,t];var e=t[0],n=_(t[1])?t[1]:t[0];return[e,n,_(t[2])?t[2]:e,_(t[3])?t[3]:n]}function Ah(t){return function e(n){if(P(n)&&/^-?\d+(\.\d+)?px$/.test(n)){var r=n.substr(0,n.length-2);return t(Number(r))}if(y(n))return n.map((function(t){return e(t)}));if(b(n)){var i={};for(var o in n)if(n.hasOwnProperty(o)){var a=e(n[o]);if(!a){i[o]=a;continue}if("padding"===o||"margin"===o){var s=Ch(a);i[o]=s,i["".concat(o,"Top")]=s[0],i["".concat(o,"Right")]=s[1],i["".concat(o,"Bottom")]=s[2],i["".concat(o,"Left")]=s[3];continue}i[o]=a}return i}return n}}var Oh=Ah((function(t){return t?Number((t*Nh).toFixed(1)):0})),Rh=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.currentTime=r,o.timelineTime=i,o.target=n,o.type="finish",o.bubbles=!1,o.currentTarget=n,o.defaultPrevented=!1,o.eventPhase=o.AT_TARGET,o.timeStamp=Date.now(),o.currentTime=r,o.timelineTime=i,o}return n(e,t),e}(Ja),Lh=0,_h=function(){function t(t,e){var n;this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=t,t.animation=this,this.timeline=e,this.id="".concat(Lh++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null===(n=this.effect)||void 0===n?void 0:n.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}return Object.defineProperty(t.prototype,"pending",{get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playState",{get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ready",{get:function(){var t=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise((function(e,n){t.resolveReadyPromise=function(){e(t)},t.rejectReadyPromise=function(){n(Error())}})),this.pending||this.resolveReadyPromise()),this.readyPromise},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"finished",{get:function(){var t=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise((function(e,n){t.resolveFinishedPromise=function(){e(t)},t.rejectFinishedPromise=function(){n(Error())}})),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentTime",{get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){var e;isNaN(t=Number(t))||(this.timeline.restart(),this._paused||null===this._startTime||(this._startTime=Number(null===(e=this.timeline)||void 0===e?void 0:e.currentTime)-t/this.playbackRate),this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this)))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"startTime",{get:function(){return this._startTime},set:function(t){if(null!==t){if(this.updatePromises(),isNaN(t=Number(t)))return;if(this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playbackRate",{get:function(){return this._playbackRate},set:function(t){if(t!==this._playbackRate){this.updatePromises();var e=this.currentTime;this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==e&&(this.currentTime=e),this.updatePromises()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_isFinished",{get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||0>this._playbackRate&&0>=Number(this._currentTime))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"totalDuration",{get:function(){return this._totalDuration},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_needsTick",{get:function(){return this.pending||"running"===this.playState||!this._finishedFlag},enumerable:!1,configurable:!0}),t.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},t.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()},t.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()},t.prototype.finish=function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())},t.prototype.cancel=function(){var t=this;if(this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises(),this.oncancel)){var e=new Rh(null,this,this.currentTime,null);setTimeout((function(){t.oncancel(e)}))}},t.prototype.reverse=function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()},t.prototype.updatePlaybackRate=function(t){this.playbackRate=t},t.prototype.targetAnimations=function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()},t.prototype.markTarget=function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)},t.prototype.unmarkTarget=function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)},t.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))},t.prototype.rewind=function(){if(this.playbackRate<0){if(this._totalDuration>=1/0)throw Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this._totalDuration}else this.currentTime=0},t.prototype.persist=function(){throw Error(Br)},t.prototype.addEventListener=function(t,e,n){throw Error(Br)},t.prototype.removeEventListener=function(t,e,n){throw Error(Br)},t.prototype.dispatchEvent=function(t){throw Error(Br)},t.prototype.commitStyles=function(){throw Error(Br)},t.prototype.ensureAlive=function(){var t,e;this._inEffect=0>this.playbackRate&&0===this.currentTime?!!(null===(t=this.effect)||void 0===t?void 0:t.update(-1)):!!(null===(e=this.effect)||void 0===e?void 0:e.update(this.currentTime)),this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))},t.prototype.tickCurrentTime=function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())},t.prototype.fireEvents=function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new Rh(null,this,this.currentTime,t);setTimeout((function(){e.onfinish&&e.onfinish(n)}))}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var r=new Rh(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}},t}(),Ih=.1,Dh="function"==typeof Float32Array,Fh=function(t,e){return 1-3*e+3*t},Bh=function(t,e){return 3*e-6*t},jh=function(t){return 3*t},Gh=function(t,e,n){return((Fh(e,n)*t+Bh(e,n))*t+jh(e))*t},Yh=function(t,e,n){return 3*Fh(e,n)*t*t+2*Bh(e,n)*t+jh(e)},Vh=function(t,e,n,r){if(0>t||t>1||0>n||n>1)throw Error("bezier x values must be in [0, 1] range");if(t===e&&n===r)return function(t){return t};for(var i=Dh?new Float32Array(11):[,,,,,,,,,,,],o=0;11>o;++o)i[o]=Gh(o*Ih,t,n);var a=function(e){for(var r=0,o=1;10!==o&&e>=i[o];++o)r+=Ih;--o;var a=r+(e-i[o])/(i[o+1]-i[o])*Ih,s=Yh(a,t,n);return.001>s?0===s?a:function(t,e,n,r,i){var o,a,s=0;do{(o=Gh(a=e+(n-e)/2,r,i)-t)>0?n=a:e=a}while(Math.abs(o)>1e-7&&10>++s);return a}(e,r,r+Ih,t,n):function(t,e,n,r){for(var i=0;4>i;++i){var o=Yh(e,n,r);if(0===o)return e;e-=(Gh(e,n,r)-t)/o}return e}(e,a,t,n)};return function(t){return 0===t||1===t?t:Gh(a(t),e,r)}},Wh=function(t){return Math.pow(t,2)},Xh=function(t){return Math.pow(t,3)},zh=function(t){return Math.pow(t,4)},Uh=function(t){return Math.pow(t,5)},Hh=function(t){return Math.pow(t,6)},qh=function(t){return 1-Math.cos(t*Math.PI/2)},Zh=function(t){return 1-Math.sqrt(1-t*t)},Kh=function(t){return t*t*(3*t-2)},$h=function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)},Jh=function(t,e){void 0===e&&(e=[]);var n=u(e,2),r=n[0],i=n[1],o=void 0===i?.5:i,a=L(Number(void 0===r?1:r),1,10),s=L(Number(o),.1,2);return 0===t||1===t?t:-a*Math.pow(2,10*(t-1))*Math.sin(2*Math.PI*(t-1-s/(2*Math.PI)*Math.asin(1/a))/s)},Qh=function(t,e,n){void 0===e&&(e=[]);var r=u(e,4),i=r[0],o=void 0===i?1:i,a=r[1],s=void 0===a?100:a,l=r[2],c=void 0===l?10:l,h=r[3],p=void 0===h?0:h;o=L(o,.1,1e3),s=L(s,.1,1e3),c=L(c,.1,1e3),p=L(p,.1,1e3);var f=Math.sqrt(s/o),d=c/(2*Math.sqrt(s*o)),y=1>d?f*Math.sqrt(1-d*d):0,v=1>d?(d*f-p)/y:-p+f,g=n?n*t/1e3:t;return g=1>d?Math.exp(-g*d*f)*(1*Math.cos(y*g)+v*Math.sin(y*g)):(1+v*g)*Math.exp(-g*f),0===t||1===t?t:1-g},tp=function(t,e){void 0===e&&(e=[]);var n=u(e,2),r=n[0],i=void 0===r?10:r;return("start"==n[1]?Math.ceil:Math.floor)(L(t,0,1)*i)/i},ep=function(t,e){void 0===e&&(e=[]);var n=u(e,4);return Vh(n[0],n[1],n[2],n[3])(t)},np=Vh(.42,0,1,1),rp=function(t){return function(e,n,r){return void 0===n&&(n=[]),1-t(1-e,n,r)}},ip=function(t){return function(e,n,r){return void 0===n&&(n=[]),.5>e?t(2*e,n,r)/2:1-t(-2*e+2,n,r)/2}},op=function(t){return function(e,n,r){return void 0===n&&(n=[]),.5>e?(1-t(1-2*e,n,r))/2:(t(2*e-1,n,r)+1)/2}},ap={steps:tp,"step-start":function(t){return tp(t,[1,"start"])},"step-end":function(t){return tp(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":ep,ease:function(t){return ep(t,[.25,.1,.25,1])},in:np,out:rp(np),"in-out":ip(np),"out-in":op(np),"in-quad":Wh,"out-quad":rp(Wh),"in-out-quad":ip(Wh),"out-in-quad":op(Wh),"in-cubic":Xh,"out-cubic":rp(Xh),"in-out-cubic":ip(Xh),"out-in-cubic":op(Xh),"in-quart":zh,"out-quart":rp(zh),"in-out-quart":ip(zh),"out-in-quart":op(zh),"in-quint":Uh,"out-quint":rp(Uh),"in-out-quint":ip(Uh),"out-in-quint":op(Uh),"in-expo":Hh,"out-expo":rp(Hh),"in-out-expo":ip(Hh),"out-in-expo":op(Hh),"in-sine":qh,"out-sine":rp(qh),"in-out-sine":ip(qh),"out-in-sine":op(qh),"in-circ":Zh,"out-circ":rp(Zh),"in-out-circ":ip(Zh),"out-in-circ":op(Zh),"in-back":Kh,"out-back":rp(Kh),"in-out-back":ip(Kh),"out-in-back":op(Kh),"in-bounce":$h,"out-bounce":rp($h),"in-out-bounce":ip($h),"out-in-bounce":op($h),"in-elastic":Jh,"out-elastic":rp(Jh),"in-out-elastic":ip(Jh),"out-in-elastic":op(Jh),spring:Qh,"spring-in":Qh,"spring-out":rp(Qh),"spring-in-out":ip(Qh),"spring-out-in":op(Qh)},sp=function(t){return ap[function(t){return function(t){return"-"===(t=t.replace(/([A-Z])/g,(function(t){return"-".concat(t.toLowerCase())}))).charAt(0)?t.substring(1):t}(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()}(t)]||ap.linear},up=function(t){return t},lp=1,cp=.5,hp=0;function pp(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var fp="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",dp=RegExp("cubic-bezier\\("+fp+","+fp+","+fp+","+fp+"\\)"),yp=/steps\(\s*(\d+)\s*\)/,vp=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function gp(t){var e=dp.exec(t);if(e)return Vh.apply(void 0,l([],u(e.slice(1).map(Number)),!1));var n=yp.exec(t);if(n)return pp(Number(n[1]),hp);var r=vp.exec(t);return r?pp(Number(r[1]),{start:lp,middle:cp,end:hp}[r[2]]):sp(t)}function mp(t){return Math.abs(function(t){var e;if(0===t.duration||0===t.iterations)return 0;return("auto"===t.duration?0:Number(t.duration))*(null!==(e=t.iterations)&&void 0!==e?e:1)}(t)/(t.playbackRate||1))}var xp=0,bp=1,Mp=2,wp=3;function Ep(t,e,n){var r=function(t,e,n){if(null===e)return xp;var r=n.endTime;return Math.min(n.delay,r)>e?bp:Math.min(n.delay+t+n.endDelay,r)>e?wp:Mp}(t,e,n),i=function(t,e,n,r,i){switch(r){case bp:return"backwards"===e||"both"===e?0:null;case wp:return n-i;case Mp:return"forwards"===e||"both"===e?t:null;case xp:return null}}(t,n.fill,e,r,n.delay);if(null===i)return null;var o="auto"===n.duration?0:n.duration,a=function(t,e,n,r,i){var o=i;return 0===t?e!==bp&&(o+=n):o+=r/t,o}(o,r,n.iterations,i,n.iterationStart),s=function(t,e,n,r,i,o){var a=t===1/0?e%1:t%1;return 0!==a||n!==Mp||0===r||0===i&&0!==o||(a=1),a}(a,n.iterationStart,r,n.iterations,i,o),u=function(t,e,n,r){return t===Mp&&e===1/0?1/0:1===n?Math.floor(r)-1:Math.floor(r)}(r,n.iterations,s,a),l=function(t,e,n){var r=t;if("normal"!==t&&"reverse"!==t){var i=e;"alternate-reverse"===t&&(i+=1),r="normal",i!==1/0&&i%2!=0&&(r="reverse")}return"normal"===r?n:1-n}(n.direction,u,s);return n.currentIteration=u,n.progress=l,n.easingFunction(l)}function kp(t,e,n){var r=function(t,e){for(var n={},r=0;t.length>r;r++)for(var i in t[r])if(Sp(i)){var o={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:gp(t[r].easing)||e.easingFunction,value:t[r][i]};n[i]=n[i]||[],n[i].push(o)}return n}(t,e),i=function(t,e){var n=[];for(var r in t)for(var i=t[r],o=0;i.length-1>o;o++){var a=o,s=o+1,u=i[a].computedOffset,l=i[s].computedOffset,c=u,h=l;0===o&&(c=-1/0,0===l&&(s=a)),o===i.length-2&&(h=1/0,1===u&&(a=s)),n.push({applyFrom:c,applyTo:h,startOffset:i[a].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[a].easingFunction,property:r,interpolation:Tp(r,i[a].value,i[s].value,e)})}return n.sort((function(t,e){return t.startOffset-e.startOffset})),n}(r,n);return function(t,e){if(null!==e)i.filter((function(t){return e>=t.applyFrom&&t.applyTo>e})).forEach((function(n){var r=n.endOffset-n.startOffset,i=0===r?0:n.easingFunction((e-n.startOffset)/r);t.setAttribute(n.property,n.interpolation(i))}));else for(var n in r)Sp(n)&&t.setAttribute(n,null)}}function Sp(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var Pp=function(t,e,n){return function(r){var i=Np(t,e,r);return!Es.enableCSSParsing&&_(i)?i:n(i)}};function Tp(t,e,n,r){var i=zo[t];if(i&&i.syntax&&i.int){var o=Es.styleValueRegistry.getPropertySyntax(i.syntax);if(o){var a=void 0,s=void 0;if(Es.enableCSSParsing){var c=Es.styleValueRegistry.parseProperty(t,e,r),h=Es.styleValueRegistry.parseProperty(t,n,r);a=Es.styleValueRegistry.computeProperty(t,c,r),s=Es.styleValueRegistry.computeProperty(t,h,r)}else{var p=o.parserWithCSSDisabled;a=p?p(e,r):e,s=p?p(n,r):n}var f=o.mixer(a,s,r);if(f){var d=Pp.apply(void 0,l([],u(f),!1));return function(t){return 0===t?e:1===t?n:d(t)}}}}return Pp(!1,!0,(function(t){return t?n:e}))}function Np(t,e,n){if("number"==typeof t&&"number"==typeof e)return t*(1-n)+e*n;if("boolean"==typeof t&&"boolean"==typeof e||"string"==typeof t&&"string"==typeof e)return.5>n?t:e;if(Array.isArray(t)&&Array.isArray(e)){for(var r=t.length,i=e.length,o=Math.max(r,i),a=[],s=0;o>s;s++)a.push(Np(t[r>s?s:r-1],e[i>s?s:i-1],n));return a}throw Error("Mismatched interpolation arguments "+t+":"+e)}var Cp=function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=up,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null}return Object.defineProperty(t.prototype,"easing",{get:function(){return this._easing},set:function(t){this.easingFunction=gp(t),this._easing=t},enumerable:!1,configurable:!0}),t}();function Ap(t,e){if(null===t)return[];Array.isArray(t)||(t=function(t){var e=[];for(var n in t)if(!(n in["easing","offset","composite"])){var r=t[n];Array.isArray(r)||(r=[r]);for(var i=r.length,o=0;i>o;o++){if(!e[o]){var a={};"offset"in t&&(a.offset=Number(t.offset)),"easing"in t&&(a.easing=t.easing),"composite"in t&&(a.composite=t.composite),e[o]=a}null!=r[o]&&(e[o][n]=r[o])}}return e.sort((function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)})),e}(t));for(var n=t.map((function(t){var n={};for(var r in(null==e?void 0:e.composite)&&(n.composite="auto"),t){var i=t[r];if("offset"===r){if(null!==i){if(!isFinite(i=Number(i)))throw Error("Keyframe offsets must be numbers.");if(0>i||i>1)throw Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=i}}else if("composite"===r&&-1===["replace","add","accumulate","auto"].indexOf(i))throw Error("".concat(i," compositing is not supported"));n[r]=i}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==e?void 0:e.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n})),r=!0,i=-1/0,o=0;n.length>o;o++){var a=n[o].offset;if(p(a))r=!1;else{if(i>a)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=a}}return n=n.filter((function(t){return Number(t.offset)>=0&&1>=Number(t.offset)})),r||function(){var t,e,r=n.length;n[r-1].computedOffset=Number(null!==(t=n[r-1].offset)&&void 0!==t?t:1),r>1&&(n[0].computedOffset=Number(null!==(e=n[0].offset)&&void 0!==e?e:0));for(var i=0,o=Number(n[0].computedOffset),a=1;r>a;a++){var s=n[a].computedOffset;if(!p(s)&&!p(o)){for(var u=1;a-i>u;u++)n[i+u].computedOffset=o+(Number(s)-o)*u/(a-i);i=a,o=Number(s)}}}(),n}var Op="backwards|forwards|both|none".split("|"),Rp="reverse|alternate|alternate-reverse".split("|");function Lp(t,e){return function(t,e){var n=new Cp;return e&&(n.fill="both",n.duration="auto"),"number"!=typeof t||isNaN(t)?void 0!==t&&Object.keys(t).forEach((function(e){if(null!=t[e]&&"auto"!==t[e]){if(("number"==typeof n[e]||"duration"===e)&&("number"!=typeof t[e]||isNaN(t[e])))return;if("fill"===e&&-1===Op.indexOf(t[e]))return;if("direction"===e&&-1===Rp.indexOf(t[e]))return;n[e]=t[e]}})):n.duration=t,n}(t=function(t){"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t});return t}(null!=t?t:{duration:"auto"}),e)}var _p=function(){function t(t,e,n){var r=this;this.composite="replace",this.iterationComposite="replace",this.target=t,this.timing=Lp(n,!1),this.timing.effect=this,this.timing.activeDuration=mp(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=Ap(e,this.timing),this.interpolations=kp(this.normalizedKeyframes,this.timing,this.target);var i=Es.globalThis.Proxy;this.computedTiming=i?new i(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}return t.prototype.applyInterpolations=function(){this.interpolations(this.target,Number(this.timeFraction))},t.prototype.update=function(t){return null!==t&&(this.timeFraction=Ep(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},t.prototype.getKeyframes=function(){return this.normalizedKeyframes},t.prototype.setKeyframes=function(t){this.normalizedKeyframes=Ap(t)},t.prototype.getComputedTiming=function(){return this.computedTiming},t.prototype.getTiming=function(){return this.timing},t.prototype.updateTiming=function(t){var e=this;Object.keys(t||{}).forEach((function(n){e.timing[n]=t[n]}))},t}();function Ip(t,e){return Number(t.id)-Number(e.id)}var Dp=function(){function t(t){var e=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){e.currentTime=t,e.discardAnimations(),0===e.animations.length?e.timelineTicking=!1:e.requestAnimationFrame(e.webAnimationsNextTick)},this.processRafCallbacks=function(t){var n=e.rafCallbacks;e.rafCallbacks=[],Number(e.currentTime)>t&&(t=Number(e.currentTime)),e.animations.sort(Ip),e.animations=e.tick(t,!0,e.animations)[0],n.forEach((function(e){e[1](t)})),e.applyPendingEffects()}}return t.prototype.getAnimations=function(){return this.discardAnimations(),this.animations.slice()},t.prototype.isTicking=function(){return this.inTick},t.prototype.play=function(t,e,n){var r=new _p(t,e,n),i=new _h(r,this);return this.animations.push(i),this.restartWebAnimationsNextTick(),i.updatePromises(),i.play(),i.updatePromises(),i},t.prototype.applyDirtiedAnimation=function(t){var e=this;if(!this.inTick){t.markTarget();var n=t.targetAnimations();n.sort(Ip),this.tick(Number(this.currentTime),!1,n.slice())[1].forEach((function(t){var n=e.animations.indexOf(t);-1!==n&&e.animations.splice(n,1)})),this.applyPendingEffects()}},t.prototype.restart=function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame((function(){})),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame},t.prototype.destroy=function(){this.document.defaultView.cancelAnimationFrame(this.frameId)},t.prototype.applyPendingEffects=function(){this.pendingEffects.forEach((function(t){null==t||t.applyInterpolations()})),this.pendingEffects=[]},t.prototype.updateAnimationsPromises=function(){this.animationsWithPromises=this.animationsWithPromises.filter((function(t){return t.updatePromises()}))},t.prototype.discardAnimations=function(){this.updateAnimationsPromises(),this.animations=this.animations.filter((function(t){return"finished"!==t.playState&&"idle"!==t.playState}))},t.prototype.restartWebAnimationsNextTick=function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))},t.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},t.prototype.requestAnimationFrame=function(t){var e=this;return this.rAF((function(n){e.updateAnimationsPromises(),t(n),e.updateAnimationsPromises()}))},t.prototype.tick=function(t,e,n){var r,i,o=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var a=[],s=[],c=[],h=[];return n.forEach((function(n){n.tick(t,e),n._inEffect?(s.push(n.effect),n.markTarget()):(a.push(n.effect),n.unmarkTarget()),n._needsTick&&(o.ticking=!0);var r=n._inEffect||n._needsTick;n._inTimeline=r,r?c.push(n):h.push(n)})),(r=this.pendingEffects).push.apply(r,l([],u(a),!1)),(i=this.pendingEffects).push.apply(i,l([],u(s),!1)),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[c,h]},t}();function Fp(t,e,n){return function(r,i){var o=i||{},a=o.fontSize,s=o.fontFamily,u=void 0===s?n.fontFamily:s,l=o.fontWeight,c=void 0===l?n.fontWeight:l,h=o.fontVariant,f=void 0===h?n.fontVariant:h,d=o.fontStyle,v=void 0===d?n.fontStyle:d,g=o.textAlign,m=void 0===g?n.textAlign:g,x=o.textBaseline,b=void 0===x?n.textBaseline:x,M=o.lineWidth,w=void 0===M?1:M,E=function(t,e){if(!e)return e;var n={};return Object.keys(e).forEach((function(r){var i=e[r];if(!p(i)){var o=Th[t]&&Th[t][r];if(o){var a=Object.prototype.toString.call(i);if(y(o)){for(var s=0,u=o.length;u>s;s++)if(a==="[object ".concat(o[s],"]"))return void(n[r]=i)}else a==="[object ".concat(o,"]")&&(n[r]=i)}else n[r]=i}})),n}("text",{x:0,y:0,fontSize:e(void 0===a?n.fontSize:a),fontFamily:u,fontStyle:v,fontWeight:c,fontVariant:f,text:r,textAlign:m,textBaseline:b,lineWidth:w,visibility:"hidden"}),k=new $s({style:E});t.appendChild(k);var S=k.getBBox(),P=S.width,T=S.height;return k.remove(),{width:P,height:T}}}Es.EasingFunction=gp,Es.AnimationTimeline=Dp;var Bp=function(){function t(e){var n=e.context,i=e.renderer,o=void 0===i?new bh:i,a=e.width,s=e.height,u=e.theme,l=e.px2hd,c=e.pixelRatio,p=e.landscape,f=e.container,d=e.animate,y=void 0===d||d,v=e.createImage,g=e.requestAnimationFrame,m=e.cancelAnimationFrame,x=e.offscreenCanvas,b=e.isTouchEvent,M=e.isMouseEvent,w=e.useNativeClickEvent,E=void 0===w||w,k=h(l)?Ah(l):Oh,S=k(r(r({},Sh),u)),P=S.fontSize,T=S.fontFamily,N=c||S.pixelRatio,C=function(t){var e=[];function n(){for(var n,r=[],i=[];n=e.shift();){var o=n.state,a=n.component,s=n.callback;a.destroyed||(a.prevState||(a.prevState=Object.assign({},a.state)),Object.assign(a.state,"function"==typeof o?o(a.prevState,a.props):o),a.prevState=a.state,"function"==typeof s&&i.push({callback:s,component:a}),0>r.indexOf(a)&&r.push(a))}t.updateComponents(r),function(t){for(var e=0;t.length>e;e++){var n=t[e];n.callback.call(n.component)}}(i)}function r(t,r,i){0===e.length&&setTimeout(n,0),e.push({component:t,state:r,callback:i})}return{enqueueForceUpdate:r,enqueueSetState:r}}(this),A=Eh(n),O=new cu({container:f,canvas:A,devicePixelRatio:N,renderer:o,width:a,height:s,supportsTouchEvents:!0,supportsPointerEvents:!!Es.globalThis.PointerEvent,alwaysTriggerPointerEventOnCanvas:!0,createImage:v,requestAnimationFrame:g,cancelAnimationFrame:m,useNativeClickEvent:E,offscreenCanvas:x,isTouchEvent:b,isMouseEvent:M}),R=O.getRoot(),L=O.getConfig(),_=L.width,I=L.height;R.setAttribute("fontSize",P),R.setAttribute("fontFamily",T);var D=new Ru(R),F={ctx:n,root:this,canvas:O,px2hd:k,theme:S,gesture:D,measureText:Fp(R,k,S),timeline:null},B={key:void 0,tag:Wu,type:t,props:e,shape:R,animate:y,component:this,canvas:this,context:F,updater:C};this._ee=new Hu,this.props=e,this.context=F,this.updater=C,this.gesture=D,this.theme=S,this.canvas=O,this.container=R,this.el=A,this.vNode=B,this.landscape=p,this.updateLayout(r(r({},e),{width:_,height:I}))}return t.prototype.updateComponents=function(t){!function(t){t.length&&t.forEach((function(t){var e=t._vNode,n=t.children,r=t.animator;if(!1===t.shouldUpdate(t.props))return!1;t.willUpdate();var i=e.context,o=Mc(e,e.canvas.toRawChildren(t.render()),n);t.children=o,e.children=o;var a=el(e,o,n);a.length&&(r.children=a),r.run();var s=i.timeline;s&&s.play.animationWillPlay(),t.didUpdate()}))}(t)},t.prototype.update=function(t){return o(this,void 0,void 0,(function(){var e,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return r=(e=this).vNode,Yu(t,n=e.props)?[2]:(o=void 0===(i=n.animate)||i,this.props=t,r.props=t,r.animate=o,[4,this.render()]);case 1:return a.sent(),[2]}}))}))},t.prototype.render=function(){return o(this,void 0,void 0,(function(){var t,e;return a(this,(function(n){switch(n.label){case 0:return e=(t=this).vNode,[4,t.canvas.ready];case 1:return n.sent(),function(t){var e=t.children,n=el(t,Mc(t,t.props.children,e),e);n.length&&n.forEach((function(t){t.run()}))}(e),[2]}}))}))},t.prototype.emit=function(t,e){this._ee.emit(t,e)},t.prototype.on=function(t,e){this._ee.on(t,e)},t.prototype.off=function(t,e){this._ee.off(t,e)},t.prototype.getCanvasEl=function(){return this.el},t.prototype.resize=function(t,e){return o(this,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:return this.canvas.resize(t,e),this.updateLayout(r(r({},this.props),{width:t,height:e})),[4,this.render()];case 1:return n.sent(),[2]}}))}))},t.prototype.toDataURL=function(t,e){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){return n=this.canvas,[2,new Promise((function(r){n.addEventListener("rerender",(function(){n.getContextService().toDataURL({type:t,encoderOptions:e}).then(r)}),{once:!0})}))]}))}))},t.prototype.updateLayout=function(t){var e=this.context,n=function(t){var e=t.padding,n=e[0],r=e[3];return{left:t.left+r,top:t.top+n,width:t.width-r-e[1],height:t.height-n-e[2]}}((0,e.px2hd)(r({left:0,top:0,width:t.width,height:t.height,padding:e.theme.padding},t.style))),i=n.left,o=n.top;this.container.setAttribute("x",i),this.container.setAttribute("y",o),this.context=r(r({},this.context),{left:i,top:o,width:n.width,height:n.height}),this.vNode=r(r({},this.vNode),{style:n,context:this.context})},t.prototype.toRawChildren=function(t){return t},t.prototype.destroy=function(){var t=this,e=t.canvas,n=t.el;mc(t.children),n.width=0,n.height=0,this.props=null,this.context=null,this.updater=null,this.theme=null,this.canvas=null,this.container=null,this.el=null,this.vNode=null,e.ready.then((function(){e.destroy()}))},t}();function jp(){return{current:null}}var Gp=function(t){function e(e){var n=t.call(this,e)||this;n.next=function(){var t=n.state,e=n.props,r=t.index,i=t.count,o=e.autoPlay,a=e.loop?(r+1)%i:r+1;i>a&&(void 0===o||o)&&setTimeout((function(){n.setState({index:a})}),t.delay||0)};var r=e.delay,i=e.start,o=void 0===i?0:i,a=un.toArray(e.children).length;return n.state={delay:r,count:a,index:o},n}return n(e,t),e.prototype.didMount=function(){var t=this.props.autoPlay;(void 0===t||t)&&this.animator.on("end",this.next)},e.prototype.didUnmount=function(){this.animator.off("end",this.next)},e.prototype.render=function(){var t=this.state.index;return un.toArray(this.props.children)[t]},e}(an),Yp=function(){function t(t){this.frame=0,this.playState="play",this.animations=[],this.play=t}return t.prototype.setPlayState=function(t){this.playState=t;var e=this.play.animator;switch(t){case"play":e.play();break;case"pause":e.pause();break;case"finish":e.play(),e.finish()}},t.prototype.getPlayState=function(){return this.playState},t.prototype.goTo=function(t){t&&this.play.animator.goTo(t)},t.prototype.add=function(t){var e=this.frame;this.animations[e]?t.map((function(t){return t.cancel()})):this.animations[e]=t},t.prototype.getAnimation=function(){return this.animations[this.frame]},t.prototype.push=function(t){var e=this.frame;this.animations[e]&&(this.animations[0]=this.animations[e].concat(t))},t.prototype.pop=function(){this.animations[this.frame].pop()},t.prototype.delete=function(t){var e=this.frame;t&&this.animations[e]&&this.animations[e].filter((function(e){return e!==t}))},t.prototype.replace=function(t){var e=this,n=this.frame;if(this.animations[n]){var r=t.map((function(t){return e.animations[n].map((function(e){return t===e?t:e}))}));this.animations=r}},t}();function Vp(t,e){if(e)return un.map(e,(function(e){var n=e.key,i=t[n]?t[n].to:{},o=Vp(t,e.props.children);return un.cloneElement(e,r(r({},i),{children:o}))}))}var Wp=function(t){function e(e){var n=t.call(this,e)||this;n.next=function(){var t=n.state,e=t.index,r=n.props,i=r.onend,o=void 0===i?function(){}:i;t.count-1>e&&"play"===r.state?n.setState((function(){return{index:e+1}})):o()};var r=e.keyFrames,i=e.children;return n.playerFrames=(void 0===r?[]:r).reduce((function(t,e){var n=Vp(e,t[t.length-1]||i);return t.push(n),t}),[]),n.state={count:n.playerFrames.length,index:0},n}return n(e,t),e.prototype.setPlayState=function(){this.context.timeline.setPlayState(this.props.state)},e.prototype.willMount=function(){this.context.timeline=new Yp(this)},e.prototype.didMount=function(){var t=this.props.state;this.animator.on("end",this.next),"finish"===t&&this.setState((function(t){return{index:t.count-1}}))},e.prototype.willUpdate=function(){"finish"===this.props.state&&"finish"!==this.context.timeline.getPlayState()&&this.setState((function(t){return{index:t.count-1}}))},e.prototype.animationWillPlay=function(){var t=this.animator,e=this.context.timeline;e.add(t.animations),t.animations=e.getAnimation(),this.setPlayState()},e.prototype.render=function(){return this.playerFrames[this.state.index]},e}(an);function Xp(t){return{xMin:t.yMin,xMax:t.yMax,yMin:t.xMin,yMax:t.xMax}}function zp(t){var e,n,r,i,o=t.x,a=t.y,s=t.size,u=t.y0;return y(o)?(e=o[0],n=o[1]):(e=o-s/2,n=o+s/2),y(a)?(r=a[0],i=a[1]):(r=Math.min(u,a),i=Math.max(u,a)),{xMin:e,xMax:n,yMin:r,yMax:i}}var Up=function(){function t(t){this.left=0,this.top=0,this.width=0,this.height=0,this.transposed=!1,this.x=[0,1],this.y=[0,1],this.update(t)}return t.prototype.update=function(t){z(this,t);var e=this,n=e.left,r=e.top,i=e.width,o=e.height;return this.right=n+i,this.bottom=r+o,this.center={x:n+i/2,y:r+o/2},this},t.prototype.isCyclic=function(){return!1},t.prototype._zoomVal=function(t,e){return y(t)?t.map((function(t){return e(t)})):e(t)},t.prototype.convert=function(t){var e=this,n=e.transposed,r=e.x,i=e.y,o=n?"y":"x",a=n?"x":"y",s=t[o],u=t[a];return 0>s||s>1||0>u||u>1?{x:NaN,y:NaN}:{x:this._zoomVal(t[o],(function(t){return r[0]+(r[1]-r[0])*t})),y:this._zoomVal(t[a],(function(t){return i[0]+(i[1]-i[0])*t}))}},t.prototype.invert=function(t){var e,n=this,r=n.transposed,i=n.x,o=n.y,a=r?"x":"y";return(e={})[r?"y":"x"]=this._zoomVal(t.x,(function(t){return(t-i[0])/(i[1]-i[0])})),e[a]=this._zoomVal(t.y,(function(t){return(t-o[0])/(o[1]-o[0])})),e},t.prototype.convertPoint=function(t){return this.convert(t)},t.prototype.invertPoint=function(t){return this.invert(t)},t.prototype.convertRect=function(t){var e=this,n=e.x,r=e.y,i=e.transposed,o=n[0],a=n[1],s=r[0],u=r[1],l=zp(t),c=i?Xp(l):l,h=o+(a-o)*c.xMin,p=o+(a-o)*c.xMax,f=s+(u-s)*c.yMin,d=s+(u-s)*c.yMax;return{xMin:Math.min(h,p),xMax:Math.max(h,p),yMin:Math.min(f,d),yMax:Math.max(f,d)}},t.prototype.transformToRect=function(t){var e=t.x,n=t.y,r=t.size,i=this.convertPoint({x:0,y:t.y0}),o=this.transposed,a=zp({size:r,x:o?n:e,y:o?e:n,y0:o?i.x:i.y}),s=o?Xp(a):a;return{xMin:s.xMin,xMax:s.xMax,yMin:s.yMin,yMax:s.yMax}},t}(),Hp=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="rect",e}return n(e,t),e.prototype.update=function(e){t.prototype.update.call(this,e);var n=this,r=n.left,i=n.top,o=[i+n.height,i];return this.x=[r,r+n.width],this.y=o,this},e}(Up),qp=function(t,e,n){var r,i,o,a,s,u,l,c=(s=(i=e)[0],u=i[1],Math.acos(Math.min(Math.max((l=Math.sqrt((o=(r=t)[0])*o+(a=r[1])*a)*Math.sqrt(s*s+u*u))&&(o*s+a*u)/l,-1),1))),h=function(t,e){return t[0]*e[1]-e[0]*t[1]}(t,e)>=0;return n?h?2*Math.PI-c:c:h?c:2*Math.PI-c},Zp=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="polar",e.isPolar=!0,e}return n(e,t),e.prototype.update=function(e){t.prototype.update.call(this,e),this.option||(this.option=e);var n=this.option,r=n.radius,i=n.innerRadius,o=void 0===i?0:i,a=this,s=a.startAngle,u=void 0===s?-Math.PI/2:s,l=a.endAngle,c=void 0===l?3*Math.PI/2:l,h=(void 0===r?1:r)*(Math.min(a.width,a.height)/2),p=[o*h,h];return this.x=[u,c],this.y=p,this.startAngle=u,this.endAngle=c,this.radius=h,this.innnerRadius=o*h,this},e.prototype.isCyclic=function(){return 2*Math.PI<=this.endAngle-this.startAngle},e.prototype.convertPoint=function(t){var e=this,n=e.center,r=e.transposed,i=e.x,o=e.y,a=i[0],s=o[0],u=a+(i[1]-a)*t[r?"y":"x"],l=s+(o[1]-s)*t[r?"x":"y"];return{x:n.x+Math.cos(u)*l,y:n.y+Math.sin(u)*l}},e.prototype.invertPoint=function(t){var e,n,r,i,o,a,s,u,l,c,h,p=this,f=p.center,d=p.transposed,y=p.x,v=p.y,g=d?"y":"x",m=d?"x":"y",x=y[0],b=y[1],M=v[0],w=v[1],E=[1,0,0,1,0,0];e=E,i=(n=E)[0],o=n[1],a=n[2],s=n[3],u=n[4],l=n[5],c=Math.sin(r=x),e[0]=i*(h=Math.cos(r))+a*c,e[1]=o*h+s*c,e[2]=i*-c+a*h,e[3]=o*-c+s*h,e[4]=u,e[5]=l;var k=[1,0];!function(t,e,n){var r=e[0],i=e[1];t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5]}(k,k,E);var S,P=[t.x-f.x,t.y-f.y];if(0===(S=P)[0]&&0===S[1])return{x:0,y:0};var T=qp(k=[k[0],k[1]],P,x>b);.001>Math.abs(T-2*Math.PI)&&(T=0);var N=T/(b-x),C=(xe(P)-M)/(w-M),A={};return A[g]=N=b-x>0?N:-N,A[m]=C,A},e}(Up),Kp={rect:Hp,polar:Zp},$p=function(){function t(){}return t.prototype.getOption=function(t){if(P(t))return{type:Kp[t]||Hp};if(h(t))return{type:t};var e=(t||{}).type;return r(r({},t),{type:h(e)?e:Kp[e]||Hp})},t.prototype.create=function(t){var e=this.layout,n=this.getOption(t),i=new(0,n.type)(r(r({},n),e));return this.coord=i,i},t.prototype.updateLayout=function(t){var e=this.coord,n=t.padding||[0,0,0,0],r=n[0],i=n[3];this.layout={left:t.left+i,top:t.top+r,width:t.width-i-n[1],height:t.height-r-n[2]},e&&e.update(this.layout)},t.prototype.useLayout=function(t){var e=this.coord,n=t.width,r=t.height,i=e.left,o=e.top,a=e.width,s=e.height;switch(t.position){case"left":i+=n,a=Math.max(0,a-n);break;case"right":a=Math.max(0,a-n);break;case"top":o+=r,s=Math.max(0,s-r);break;case"bottom":s=Math.max(0,s-r)}e.update({left:i,top:o,width:a,height:s})},t.prototype.update=function(){},t.prototype.getCoord=function(){return this.coord},t}(),Jp={};function Qp(t){return Jp[t]}function tf(t,e){Jp[t]=e}var ef=function(){function t(t){this.type="base",this.isCategory=!1,this.isLinear=!1,this.isContinuous=!1,this.isIdentity=!1,this.values=[],this.range=[0,1],this.ticks=[],this.__cfg__=t,this.initCfg(),this.init()}return t.prototype.translate=function(t){return t},t.prototype.change=function(t){z(this.__cfg__,t),this.init()},t.prototype.clone=function(){return this.constructor(this.__cfg__)},t.prototype.getTicks=function(){var t=this;return Q(this.ticks,(function(e,n){return v(e)?e:{text:t.getText(e,n),tickValue:e,value:t.scale(e)}}))},t.prototype.getText=function(t,e){var n=this.formatter,r=n?n(t,e):t;return p(r)||!h(r.toString)?"":""+r},t.prototype.getConfig=function(t){return this.__cfg__[t]},t.prototype.init=function(){z(this,this.__cfg__),this.setDomain(),$(this.getConfig("ticks"))&&(this.ticks=this.calculateTicks())},t.prototype.initCfg=function(){},t.prototype.setDomain=function(){},t.prototype.calculateTicks=function(){var t=this.tickMethod,e=[];if(P(t)){var n=Qp(t);if(!n)throw Error("There is no method to to calculate ticks!");e=n(this)}else h(t)&&(e=t(this));return e},t.prototype.rangeMin=function(){return this.range[0]},t.prototype.rangeMax=function(){return this.range[1]},t.prototype.calcPercent=function(t,e,n){return _(t)?(t-e)/(n-e):NaN},t.prototype.calcValue=function(t,e,n){return e+t*(n-e)},t}(),nf=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="cat",e.isCategory=!0,e}return n(e,t),e.prototype.buildIndexMap=function(){if(!this.translateIndexMap){this.translateIndexMap=new Map;for(var t=0;this.values.length>t;t++)this.translateIndexMap.set(this.values[t],t)}},e.prototype.translate=function(t){this.buildIndexMap();var e=this.translateIndexMap.get(t);return void 0===e&&(e=_(t)?t:NaN),e},e.prototype.scale=function(t){var e=this.translate(t),n=this.calcPercent(e,this.min,this.max);return this.calcValue(n,this.rangeMin(),this.rangeMax())},e.prototype.invert=function(t){var e=this.max-this.min,n=this.calcPercent(t,this.rangeMin(),this.rangeMax()),r=Math.round(e*n)+this.min;return this.min>r||r>this.max?NaN:this.values[r]},e.prototype.getText=function(e){for(var n=[],r=1;arguments.length>r;r++)n[r-1]=arguments[r];var i=e;return _(e)&&!this.values.includes(e)&&(i=this.values[i]),t.prototype.getText.apply(this,l([i],n,!1))},e.prototype.initCfg=function(){this.tickMethod="cat"},e.prototype.setDomain=function(){if(p(this.getConfig("min"))&&(this.min=0),p(this.getConfig("max"))){var t=this.values.length;this.max=t>1?t-1:t}this.translateIndexMap&&(this.translateIndexMap=void 0)},e}(ef),rf=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,of=/\[([^]*?)\]/gm;function af(t,e){for(var n=[],r=0,i=t.length;i>r;r++)n.push(t[r].substr(0,e));return n}function sf(t){for(var e=[],n=1;arguments.length>n;n++)e[n-1]=arguments[n];for(var r=0,i=e;i.length>r;r++){var o=i[r];for(var a in o)t[a]=o[a]}return t}var uf=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],lf=["January","February","March","April","May","June","July","August","September","October","November","December"],cf=af(lf,3),hf=sf({},{dayNamesShort:af(uf,3),dayNames:uf,monthNamesShort:cf,monthNames:lf,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][t%10>3?0:(t-t%10!=10?1:0)*t%10]}}),pf=function(t,e){for(void 0===e&&(e=2),t+="";e>t.length;)t="0"+t;return t},ff={D:function(t){return t.getDate()+""},DD:function(t){return pf(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return t.getDay()+""},dd:function(t){return pf(t.getDay())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return t.getMonth()+1+""},MM:function(t){return pf(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 pf(t.getFullYear()+"",4).substr(2)},YYYY:function(t){return pf(t.getFullYear(),4)},h:function(t){return(t.getHours()%12||12)+""},hh:function(t){return pf(t.getHours()%12||12)},H:function(t){return t.getHours()+""},HH:function(t){return pf(t.getHours())},m:function(t){return t.getMinutes()+""},mm:function(t){return pf(t.getMinutes())},s:function(t){return t.getSeconds()+""},ss:function(t){return pf(t.getSeconds())},S:function(t){return Math.round(t.getMilliseconds()/100)+""},SS:function(t){return pf(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return pf(t.getMilliseconds(),3)},a:function(t,e){return 12>t.getHours()?e.amPm[0]:e.amPm[1]},A:function(t,e){return 12>t.getHours()?e.amPm[0].toUpperCase():e.amPm[1].toUpperCase()},ZZ:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+pf(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+pf(Math.floor(Math.abs(e)/60),2)+":"+pf(Math.abs(e)%60,2)}},df={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"};function yf(t,e){return function(t,e,n){if(void 0===e&&(e=df.default),void 0===n&&(n={}),"number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw Error("Invalid Date pass to format");var r=[];e=(e=df[e]||e).replace(of,(function(t,e){return r.push(e),"@@@"}));var i=sf(sf({},hf),n);return(e=e.replace(rf,(function(e){return ff[e](t,i)}))).replace(/@@@/g,(function(){return r.shift()}))}(t,e)}function vf(t){return P(t)&&(t=t.indexOf("T")>0?new Date(t).getTime():new Date(t.replace(/-/gi,"/")).getTime()),Y(t)&&(t=t.getTime()),t}var gf=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="timeCat",e}return n(e,t),e.prototype.translate=function(t){t=vf(t);var e=this.values.indexOf(t);return-1===e&&(e=_(t)&&this.values.length>t?t:NaN),e},e.prototype.getText=function(t,e){var n=this.translate(t);if(n>-1){var r=this.values[n],i=this.formatter;return r=i?i(r,e):yf(r,this.mask)}return t},e.prototype.initCfg=function(){this.tickMethod="time-cat",this.mask="YYYY-MM-DD",this.tickCount=7},e.prototype.setDomain=function(){var e=this.values;g(e,(function(t,n){e[n]=vf(t)})),e.sort((function(t,e){return t-e})),t.prototype.setDomain.call(this)},e}(nf),mf=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isContinuous=!0,e}return n(e,t),e.prototype.scale=function(t){if(p(t))return NaN;var e=this.rangeMin(),n=this.rangeMax();return this.max===this.min?e:e+this.getScalePercent(t)*(n-e)},e.prototype.init=function(){t.prototype.init.call(this);var e=this.ticks,n=N(e),r=C(e);this.min>n&&(this.min=n),r>this.max&&(this.max=r),p(this.minLimit)||(this.min=n),p(this.maxLimit)||(this.max=r)},e.prototype.setDomain=function(){var t=S(this.values),e=t.min,n=t.max;p(this.min)&&(this.min=e),p(this.max)&&(this.max=n),this.min>this.max&&(this.min=e,this.max=n)},e.prototype.calculateTicks=function(){var e=this,n=t.prototype.calculateTicks.call(this);return this.nice||(n=function(t,e){if(!c(t))return t;for(var n=[],r=0;t.length>r;r++){var i=t[r];e(i,r)&&n.push(i)}return n}(n,(function(t){return t>=e.min&&e.max>=t}))),n},e.prototype.getScalePercent=function(t){var e=this.min;return(t-e)/(this.max-e)},e.prototype.getInvertPercent=function(t){return(t-this.rangeMin())/(this.rangeMax()-this.rangeMin())},e}(ef),xf=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="linear",e.isLinear=!0,e}return n(e,t),e.prototype.invert=function(t){var e=this.getInvertPercent(t);return this.min+e*(this.max-this.min)},e.prototype.initCfg=function(){this.tickMethod="wilkinson-extended",this.nice=!1},e}(mf);function bf(t,e){var n=Math.E;return 0>e?-1*Math.pow(n,Math.log(-e)/t):Math.pow(n,Math.log(e)/t)}function Mf(t,e){return 1===t?1:Math.log(e)/Math.log(t)}var wf=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="log",e}return n(e,t),e.prototype.invert=function(t){var e,n=this.base,r=Mf(n,this.max),i=this.rangeMin(),o=this.rangeMax()-i,a=this.positiveMin;if(a){if(0===t)return 0;var s=1/(r-(e=Mf(n,a/n)))*o;if(s>t)return t/s*a}else e=Mf(n,this.min);return Math.pow(n,(t-i)/o*(r-e)+e)},e.prototype.initCfg=function(){this.tickMethod="log",this.base=10,this.tickCount=6,this.nice=!0},e.prototype.setDomain=function(){t.prototype.setDomain.call(this);var e=this.min;if(0>e)throw Error("When you use log scale, the minimum value must be greater than zero!");0===e&&(this.positiveMin=function(t,e,n){p(n)&&(n=Math.max.apply(null,t));var r=n;return g(t,(function(t){t>0&&r>t&&(r=t)})),r===n&&(r=n/e),r>1&&(r=1),r}(this.values,this.base,this.max))},e.prototype.getScalePercent=function(t){var e=this.max,n=this.min;if(e===n)return 0;if(0>=t)return 0;var r=this.base,i=this.positiveMin;return i&&(n=1*i/r),i>t?t/i/(Mf(r,e)-Mf(r,n)):(Mf(r,t)-Mf(r,n))/(Mf(r,e)-Mf(r,n))},e}(mf),Ef=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="pow",e}return n(e,t),e.prototype.invert=function(t){var e=this.getInvertPercent(t),n=this.exponent,r=bf(n,this.max),i=bf(n,this.min),o=e*(r-i)+i,a=0>o?-1:1;return Math.pow(o,n)*a},e.prototype.initCfg=function(){this.tickMethod="pow",this.exponent=2,this.tickCount=5,this.nice=!0},e.prototype.getScalePercent=function(t){var e=this.max,n=this.min;if(e===n)return 0;var r=this.exponent;return(bf(r,t)-bf(r,n))/(bf(r,e)-bf(r,n))},e}(mf),kf=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="time",e}return n(e,t),e.prototype.getText=function(t,e){var n=this.translate(t),r=this.formatter;return r?r(n,e):yf(n,this.mask)},e.prototype.scale=function(e){var n=e;return(P(n)||Y(n))&&(n=this.translate(n)),t.prototype.scale.call(this,n)},e.prototype.translate=function(t){return vf(t)},e.prototype.initCfg=function(){this.tickMethod="time-pretty",this.mask="YYYY-MM-DD",this.tickCount=7,this.nice=!1},e.prototype.setDomain=function(){var t=this.values,e=this.getConfig("min"),n=this.getConfig("max");if(p(e)&&_(e)||(this.min=this.translate(this.min)),p(n)&&_(n)||(this.max=this.translate(this.max)),t&&t.length){var r=[],i=1/0,o=i,a=0;g(t,(function(t){var e=vf(t);if(isNaN(e))throw new TypeError("Invalid Time: ".concat(t," in time scale!"));i>e?(o=i,i=e):o>e&&(o=e),e>a&&(a=e),r.push(e)})),t.length>1&&(this.minTickInterval=o-i),p(e)&&(this.min=i),p(n)&&(this.max=a)}},e}(xf),Sf=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="quantize",e}return n(e,t),e.prototype.invert=function(t){var e=this.ticks,n=e.length,r=this.getInvertPercent(t),i=Math.floor(r*(n-1));if(i>=n-1)return C(e);if(0>i)return N(e);var o=e[i],a=i/(n-1);return o+(r-a)/((i+1)/(n-1)-a)*(e[i+1]-o)},e.prototype.initCfg=function(){this.tickMethod="r-pretty",this.tickCount=5,this.nice=!0},e.prototype.calculateTicks=function(){var e=t.prototype.calculateTicks.call(this);return this.nice||(C(e)!==this.max&&e.push(this.max),N(e)!==this.min&&e.unshift(this.min)),e},e.prototype.getScalePercent=function(t){var e=this.ticks;if(t<N(e))return 0;if(t>C(e))return 1;var n=0;return g(e,(function(e,r){if(e>t)return!1;n=r})),n/(e.length-1)},e}(mf),Pf=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="quantile",e}return n(e,t),e.prototype.initCfg=function(){this.tickMethod="quantile",this.tickCount=5,this.nice=!0},e}(Sf),Tf={};function Nf(t){return Tf[t]}function Cf(t,e){if(Nf(t))throw Error("type '".concat(t,"' existed."));Tf[t]=e}var Af=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="identity",e.isIdentity=!0,e}return n(e,t),e.prototype.calculateTicks=function(){return this.values},e.prototype.scale=function(t){return this.values[0]!==t&&_(t)?t:this.range[0]},e.prototype.invert=function(t){var e=this.range;return e[0]>t||t>e[1]?NaN:this.values[0]},e}(ef),Of=function(t){var e=t.values,n=t.tickCount;if(!n)return e;if(1>=e.length)return e;for(var r=Math.floor(e.length/(n-1))||1,i=[],o=0;e.length>o;o+=r)i.push(e[o]);var a=e[e.length-1];return i[i.length-1]!==a&&(n>i.length?i.push(a):i[i.length-1]=a),i},Rf=[1,1.2,1.5,2,2.2,2.4,2.5,3,4,5,6,7.5,8,10],Lf=12;function _f(t){var e=1;if(0===(t=Math.abs(t)))return e;if(1>t){for(var n=0;1>t;)e/=10,t*=10,n++;return(""+e).length>Lf&&(e=parseFloat(e.toFixed(n))),e}for(;t>10;)e*=10,t/=10;return e}function If(t,e,n,r){for(var i=!1,o=Rf[t],a=t;Rf.length>a;a++)if(Df({interval:Rf[a],tickCount:e,max:r,min:n})){o=Rf[a],i=!0;break}return i?o:10*If(0,e,n/10,r/10)}function Df(t){var e=t.interval,n=t.tickCount;return t.max<=Math.floor(t.min/e)*e+(n-1)*e}function Ff(t){var e=""+t,n=e.indexOf("."),r=e.indexOf("e-"),i=0>r?e.substr(n+1).length:parseInt(e.substr(r+2),10);return i>20&&(i=20),i}function Bf(t,e){return parseFloat(t.toFixed(e))}Cf("cat",nf),Cf("category",nf),Cf("identity",Af),Cf("linear",xf),Cf("log",wf),Cf("pow",Ef),Cf("time",kf),Cf("timeCat",gf),Cf("quantize",Sf),Cf("quantile",Pf),tf("cat",Of),tf("time-cat",Of),tf("wilkinson-extended",(function(t){var e=t||{},n=e.tickCount,r=e.tickInterval,i=t||{},o=i.min,a=i.max;o=isNaN(o)?0:o,a=isNaN(a)?0:a;var s=n&&n>=2?n:5,u=r||function(t){var e=t.tickCount,n=t.min,r=t.max;if(n===r)return 1*_f(r);for(var i=(r-n)/(e-1),o=_f(i),a=i/o,s=r/o,u=n/o,l=0,c=0;Rf.length>c;c++){if(Rf[c]>=a){l=c;break}}var h=0>n&&r>0&&2===e?Rf[l]:If(l,e,u,s),p=Ff(h)+Ff(o);return Bf(h*o,p)}({tickCount:s,max:a,min:o}),l=Math.floor(o/u)*u;r&&(s=Math.max(s,Math.abs(Math.ceil((a-l)/r))+1));var c=0,h=Ff(u);if(0>o&&a>0&&2===s)return[Bf(l,h),Bf(Math.ceil(a/u)*u,h)];for(var p=[];s>c;)p.push(Bf(l+c*u,h)),c++;return p}));var jf=function(){function t(t){this.data=t,this.options={},this.scales={}}return t.prototype._getType=function(t){var e=t.type,n=t.values,r=t.field;return e||(_(r)||p(n[0])&&r?"identity":"number"==typeof n[0]?"linear":"cat")},t.prototype._getOption=function(t){var e=t.values,n=t.field,r=t.justifyContent,i=this._getType(t);if(t.type=i,"identity"===i)return t.field=""+n,t.values=[n],t;if("linear"===i){"boolean"!=typeof t.nice&&(t.nice=!0);var o=S(e),a=o.min,s=o.max;return p(t.min)&&(t.min=a),p(t.max)&&(t.max=s),t.values=e.sort((function(t,e){return t-e})),t}if("cat"===i||"timeCat"===i){if(t.range)return t;var u=e.length,l=[0,1];if(1===u)l=[.5,1];else if(r){l=[c=1/u*.5,1-c]}else{var c;l=[0,1-(c=1/u)]}t.range=l}return t},t.prototype.createScale=function(t){var e=t.type;return h(e)?new e(t):new(Nf(e))(t)},t.prototype.setScale=function(t,e){var n=this.options,r=this.scales;n[t]=z({},n[t],e),r[t]&&r[t].change(n[t])},t.prototype.create=function(t){this.update(t)},t.prototype.update=function(t){var e=this;t&&g(t,(function(t,n){e.setScale(n,t)}))},t.prototype.changeData=function(t){this.data=t,this.scales={}},t.prototype.getData=function(){return this.data},t.prototype.getScale=function(t){var e=this,n=e.scales,i=e.options,o=e.data,a=n[t];if(a){var s=this._getOption(r(r({},i[t]),{values:a.values}));return s.range&&(a.range=s.range),a}var u=i[t];if(!u)return null;var l=u.values?u.values:o?T(o,t):[],c=this._getOption(r(r({},u),{field:t,values:l})),h=this.createScale(c);return n[t]=h,h},t.prototype.getScales=function(){var t=this,e=this.scales;return g(this.options,(function(e,n){t.getScale(n)})),e},t.prototype.getOptions=function(){var t={};return g(this.scales,(function(e,n){t[n]=r({},e.__cfg__)})),t},t.prototype.adjustStartZero=function(t){var e=t.max,n=this.options[t.field];n&&n.min||(t.min>0?t.change({min:0}):0>e&&t.change({max:0}))},t.prototype.adjustPieScale=function(t){var e=this.options[t.field];if(e&&!p(e.nice))return null;t.change({nice:!1})},t.prototype.getZeroValue=function(t){var e=t.min,n=t.max;return t.scale(0>e?n>0?0:n:e)},t}(),Gf={chart:{padding:["30px","30px","30px","30px"]},colors:["#1890FF","#2FC25B","#FACC14","#223273","#8543E0","#13C2C2","#3436C7","#F04864"],shapes:{line:["line","dash","smooth"],point:["circle","hollowCircle","rect"],area:["area","smooth"],interval:["rect","pyramid","funnel"]},sizes:["4px","6px","8px","10px","12px"],shape:{line:{default:{lineWidth:"4px",lineJoin:"round",lineCap:"round"},smooth:{smooth:!0},dash:{lineDash:["8px","8px"]}},point:{default:{size:"6px"},hollowCircle:{lineWidth:"2px"}},area:{default:{fillOpacity:.1}},interval:{default:{}}},axis:{labelOffset:"15px",line:{stroke:"#E8E8E8",lineWidth:"1px"},symbol:{fill:"#E8E8E8",radius:"10px"},tickLine:{stroke:"#E8E8E8"},label:{fill:"#808080",fontSize:"20px"},grid:{stroke:"#E8E8E8",lineWidth:"1px",lineDash:["4px"]}},guide:{line:{style:{stroke:"#a3a3a3",lineWidth:1},offsetX:0,offsetY:0},text:{style:{fill:"#787878",textBaseline:"middle"},offsetX:0,offsetY:0},rect:{style:{fill:"#fafafa"}},arc:{style:{stroke:"#a3a3a3"}},html:{offsetX:0,offsetY:0,alignX:"center",alignY:"middle"},tag:{offsetX:0,offsetY:0,side:4,background:{padding:5,radius:2,fill:"#1890FF"},textStyle:{fontSize:12,fill:"#fff",textAlign:"center",textBaseline:"middle"}},point:{offsetX:0,offsetY:0,style:{fill:"#fff",r:3,lineWidth:2,stroke:"#1890ff"}}}},Yf=function(t){function e(e,n){var r=t.call(this,e)||this;r.componentsPosition=[];var i=n.theme;return n.theme=Z((0,n.px2hd)(Gf),i),r.scale=new jf(e.data),r.coord=new $p,r.coordRef={current:null},r.state={filters:{}},r}return n(e,t),e.prototype.getStyle=function(t){var e=this.context,n=this.layout,i=t.style;return(0,e.px2hd)(r(r({left:n.left,top:n.top,width:n.width,height:n.height},e.theme.chart),i))},e.prototype.willMount=function(){var t=this,e=t.props,n=t.coord,r=t.scale,i=e.scale,o=e.coord;this.resetCoordLayout(),r.create(i),n.create(o)},e.prototype.willReceiveProps=function(t,e){var n=this,r=n.scale,i=n.coord,o=n.props,a=t.data,s=t.scale,u=o.data,l=o.scale;if(!Yu(t.style,o.style)||e!==this.context){var c=this.getStyle(t);i.updateLayout(c)}a!==u&&r.changeData(a),Yu(s,l)||r.update(s)},e.prototype.willUpdate=function(){this.coord.create(this.props.coord)},e.prototype.on=function(t,e){var n=this.coordRef.current;n&&n.gesture&&n.gesture.on(t,e)},e.prototype.off=function(t,e){var n=this.coordRef.current;n&&n.gesture&&n.gesture.off(t,e)},e.prototype.layoutCoord=function(t){this.coord.useLayout(t)},e.prototype.resetCoordLayout=function(){var t=this.coord,e=this.getStyle(this.props);t.updateLayout(e)},e.prototype.updateCoordLayout=function(t){var e=this;y(t)?t.forEach((function(t){e.layoutCoord(t)})):this.layoutCoord(t)},e.prototype.updateCoordFor=function(t,e){var n=this;if(e){var r=this.componentsPosition,i={component:t,layout:e},o=function(t,e,n){void 0===n&&(n=0);for(var r=n;t.length>r;r++)if(e(t[r],r))return r;return-1}(r,(function(e){return e.component===t}));if(o>-1)return r.splice(o,1,i),this.resetCoordLayout(),this.removeComponentsPositionCache(),void r.forEach((function(t){n.updateCoordLayout(t.layout)}));r.push(i),this.updateCoordLayout(e)}},e.prototype.removeComponentsPositionCache=function(){var t;if(null===(t=this.componentsPosition)||void 0===t?void 0:t.length)for(var e=this.componentsPosition.length;e>-1;e--){var n=this.componentsPosition[e];n&&n.component&&n.component.destroyed&&this.componentsPosition.splice(e,1)}},e.prototype.getGeometrys=function(){var t=[];return un.toArray(this.children.children).forEach((function(e){if(!e)return!1;var n=e.component;n&&n.isGeometry&&t.push(n)})),t},e.prototype.getPosition=function(t){for(var e=this.getCoord(),n=this.getXScales()[0],r=n.field,i=this.getYScales(),o=i[0],a=o.field,s=0,u=i.length;u>s;s++){var l=i[s],c=l.field;if(t[c]){o=l,a=c;break}}var h=n.scale(t[r]),p=o.scale(t[a]);return e.convertPoint({x:h,y:p})},e.prototype.getSnapRecords=function(t,e){var n=this.getGeometrys();if(n.length)return n[0].getSnapRecords(t,e)},e.prototype.getRecords=function(t,e){var n=this.getGeometrys();if(n.length)return n[0].getRecords(t,e)},e.prototype.getLegendItems=function(t){var e=this.getGeometrys();if(e.length)return e[0].getLegendItems(t)},e.prototype.setScale=function(t,e){this.scale.setScale(t,e)},e.prototype.getScale=function(t){return this.scale.getScale(t)},e.prototype.getScales=function(){return this.scale.getScales()},e.prototype.getXScales=function(){return this.getGeometrys().map((function(t){return t.getXScale()}))},e.prototype.getYScales=function(){return this.getGeometrys().map((function(t){return t.getYScale()}))},e.prototype.getLayout=function(){return this.coord.layout},e.prototype.getCoord=function(){return this.coord.coord},e.prototype.filter=function(t,e){var n;this.setState({filters:r(r({},this.state.filters),(n={},n[t]=e,n))})},e.prototype._getRenderData=function(){var t=this.props.data,e=this.state.filters;if(!e||!Object.keys(e).length)return t;var n=t;return g(e,(function(t,e){t&&(n=n.filter((function(n){return t(n[e],n)})))})),n},e.prototype.render=function(){var t=this,e=this,n=e.props,r=e.scale,i=e.layout,o=n.children;if(!n.data)return null;var a=this._getRenderData(),s=this.getLayout(),u=this.getCoord(),l=r.getOptions();return Mh("group",{ref:this.coordRef,style:{width:i.width,height:i.height,fill:"transparent"}},un.map(o,(function(e){return un.cloneElement(e,{data:a,chart:t,layout:s,coord:u,scaleOptions:l})})))},e}(an);function Vf(t,e,n){if(t===e)return!0;for(var r=0,i=n.length;i>r;r++){var o=n[r];if(t[o]!==e[o])return!1}return!0}var Wf=function(t){function e(e,n){var r=t.call(this,e,n)||this,i=e.selection;return i?(r.state.selected=i.defaultSelected,r):r}return n(e,t),e.prototype.didMount=function(){var t=this,e=this.props,n=this.state,r=e.selection,i=e.chart;if(r){var o=r.triggerOn,a=void 0===o?"click":o;i.on(a,(function(e){var o=t.getSnapRecords("click"===a?{x:e.canvasX,y:e.canvasY}:e.points[0]),s=r.type,u=void 0===s?"single":s,l=r.cancelable,c=void 0===l||l;if(o&&o.length){var h=n.selected,p=o.map((function(t){return t.origin}));if(h&&h.length||t.setState({selected:p}),"single"===u){if(!c)return void t.setState({selected:p});var f=[];return o.forEach((function(e){t.isSelected(e)||f.push(e.origin)})),void t.setState({selected:f})}var d=i.getScales(),y=Object.keys(d),v={};h.forEach((function(t){var e=y.map((function(e){return t[e]})).join("-");v[e]=t})),o.forEach((function(t){var e=t.origin,n=y.map((function(t){return e[t]})).join("-");v[n]=v[n]?null:e}));var g=Object.keys(v).map((function(t){return v[t]})).filter(Boolean);t.setState({selected:g})}else c&&t.setState({selected:null})}))}},e.prototype.willReceiveProps=function(t){var e=t.selection,n=this.props.selection;if(e&&n){var r=e.defaultSelected;Yu(r,n.defaultSelected)||(this.state.selected=r)}},e.prototype.getSnapRecords=function(t){return null},e.prototype.isSelected=function(t){var e=this.state.selected;if(!e||!e.length)return!1;for(var n=this.props.chart.getScales(),r=Object.keys(n),i=0,o=e.length;o>i;i++){if(Vf(t.origin,e[i],r))return!0}return!1},e.prototype.getSelectionStyle=function(t){var e=this.state.selected;if(!e||!e.length)return null;var n=this.props.selection,r=n.selectedStyle,i=n.unSelectedStyle;return this.isSelected(t)?h(r)?r(t):r:h(i)?i(t):i},e}(an),Xf=function(){function t(t){var e=t.xField,n=t.yField,r=t.adjustNames,i=t.dimValuesMap;this.adjustNames=void 0===r?["x","y"]:r,this.xField=e,this.yField=n,this.dimValuesMap=i}return t.prototype.isAdjust=function(t){return this.adjustNames.indexOf(t)>=0},t.prototype.getAdjustRange=function(t,e,n){var r,i,o=this.yField,a=n.indexOf(e),s=n.length;return!o&&this.isAdjust("y")?(r=0,i=1):s>1?(r=n[0===a?0:a-1],i=n[a===s-1?s-1:a+1],0!==a?r+=(e-r)/2:r-=(i-e)/2,a!==s-1?i-=(i-e)/2:i+=(e-n[s-2])/2):(r=0===e?0:e-.5,i=0===e?1:e+.5),{pre:r,next:i}},t.prototype.adjustData=function(t,e){var n=this,r=this.getDimValues(e);g(t,(function(t,e){g(r,(function(r,i){n.adjustDim(i,r,t,e)}))}))},t.prototype.groupData=function(t,e){return g(t,(function(t){void 0===t[e]&&(t[e]=0)})),O(t,e)},t.prototype.adjustDim=function(t,e,n,r){},t.prototype.getDimValues=function(t){var e=this.xField,n=this.yField,r=z({},this.dimValuesMap),i=[];if(e&&this.isAdjust("x")&&i.push(e),n&&this.isAdjust("y")&&i.push(n),i.forEach((function(e){r&&r[e]||(r[e]=T(t,e).sort((function(t,e){return t-e})).filter((function(t){return!isNaN(t)})))})),!n&&this.isAdjust("y")){r.y=[0,1]}return r},t}(),zf=function(t){function e(e){var n=t.call(this,e)||this;n.cacheMap={},n.adjustDataArray=[],n.mergeData=[];var r=e.marginRatio,i=e.dodgeRatio,o=void 0===i?.5:i,a=e.dodgeBy,s=e.intervalPadding,u=e.dodgePadding,l=e.xDimensionLength,c=e.groupNum,h=e.defaultSize,p=e.maxColumnWidth,f=e.minColumnWidth,d=e.columnWidthRatio,y=e.customOffset;return n.marginRatio=void 0===r?.5:r,n.dodgeRatio=o,n.dodgeBy=a,n.intervalPadding=s,n.dodgePadding=u,n.xDimensionLegenth=l,n.groupNum=c,n.defaultSize=h,n.maxColumnWidth=p,n.minColumnWidth=f,n.columnWidthRatio=d,n.customOffset=y,n}return n(e,t),e.prototype.process=function(t){var e=U(t),n=w(e),r=this.dodgeBy,i=r?function(t,e){if(!e)return[t];var n=R(t,e),r=[];for(var i in n)r.push(n[i]);return r}(n,r):e;return this.cacheMap={},this.adjustDataArray=i,this.mergeData=n,this.adjustData(i,n),this.adjustDataArray=[],this.mergeData=[],e},e.prototype.adjustDim=function(t,e,n,r){var i=this,o=this.customOffset,a=this.getDistribution(t);return g(this.groupData(n,t),(function(n,s){var u;u=1===e.length?{pre:e[0]-1,next:e[0]+1}:i.getAdjustRange(t,parseFloat(s),e),g(n,(function(e){var n=a[e[t]],s=n.indexOf(r);if(p(o))e[t]=i.getDodgeOffset(u,s,n.length);else{var l=u.pre,c=u.next;e[t]=h(o)?o(e,u):(l+c)/2+o}}))})),[]},e.prototype.getDodgeOffset=function(t,e,n){var r,i=this,o=i.dodgeRatio,a=i.marginRatio,s=i.intervalPadding,u=i.dodgePadding,l=t.pre,c=t.next,h=c-l;if(p(s)||!p(u)||0>s)if(p(u)||!p(s)||u<0)if(p(s)||p(u)||0>s||0>u){var f=h*o/n,d=a*f;r=(l+c)/2+(.5*(h-n*f-(n-1)*d)+((e+1)*f+e*d)-.5*f-.5*h)}else{r=l+this.getIntervalAndDodgeOffset(n,e)}else{r=l+this.getDodgeOnlyOffset(n,e)}else r=l+this.getIntervalOnlyOffset(n,e);return r},e.prototype.getIntervalOnlyOffset=function(t,e){var n=this,r=n.defaultSize,i=n.xDimensionLegenth,o=n.groupNum,a=n.maxColumnWidth,s=n.minColumnWidth,u=n.columnWidthRatio,l=n.intervalPadding/i,c=(1-(o-1)*l)/o*n.dodgeRatio/(t-1),h=((1-l*(o-1))/o-c*(t-1))/t;(h=p(u)?h:1/o/t*u,p(a))||(h=Math.min(h,a/i));p(s)||(h=Math.max(h,s/i));return((.5+e)*(h=r?r/i:h)+e*(c=((1-(o-1)*l)/o-t*h)/(t-1))+.5*l)*o-l/2},e.prototype.getDodgeOnlyOffset=function(t,e){var n=this,r=n.defaultSize,i=n.xDimensionLegenth,o=n.groupNum,a=n.maxColumnWidth,s=n.minColumnWidth,u=n.columnWidthRatio,l=n.dodgePadding/i,c=1*n.marginRatio/(o-1),h=((1-c*(o-1))/o-l*(t-1))/t;(h=u?1/o/t*u:h,p(a))||(h=Math.min(h,a/i));p(s)||(h=Math.max(h,s/i));return((.5+e)*(h=r?r/i:h)+e*l+.5*(c=(1-(h*t+l*(t-1))*o)/(o-1)))*o-c/2},e.prototype.getIntervalAndDodgeOffset=function(t,e){var n=this,r=n.xDimensionLegenth,i=n.groupNum,o=n.intervalPadding/r,a=n.dodgePadding/r;return((.5+e)*(((1-o*(i-1))/i-a*(t-1))/t)+e*a+.5*o)*i-o/2},e.prototype.getDistribution=function(t){var e=this.cacheMap,n=e[t];return n||(n={},g(this.adjustDataArray,(function(e,r){var i=T(e,t);i.length||i.push(0),g(i,(function(t){n[t]||(n[t]=[]),n[t].push(r)}))})),e[t]=n),n},e}(Xf);var Uf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.process=function(t){var e=U(t),n=w(e);return this.adjustData(e,n),e},e.prototype.adjustDim=function(t,e,n){var r=this;return g(this.groupData(n,t),(function(n,i){return r.adjustGroup(n,t,parseFloat(i),e)}))},e.prototype.getAdjustOffset=function(t){var e=t.pre,n=t.next,r=.05*(n-e);return function(t,e){return(e-t)*Math.random()+t}(e+r,n-r)},e.prototype.adjustGroup=function(t,e,n,r){var i=this,o=this.getAdjustRange(e,n,r);return g(t,(function(t){t[e]=i.getAdjustOffset(o)})),t},e}(Xf),Hf=function(t){function e(e){var n=t.call(this,e)||this,r=e.adjustNames,i=e.height,o=void 0===i?NaN:i,a=e.size,s=void 0===a?10:a,u=e.reverseOrder,l=void 0!==u&&u;return n.adjustNames=void 0===r?["y"]:r,n.height=o,n.size=s,n.reverseOrder=l,n}return n(e,t),e.prototype.process=function(t){var e=this.reverseOrder,n=this.yField?this.processStack(t):this.processOneDimStack(t);return e?this.reverse(n):n},e.prototype.reverse=function(t){return t.slice(0).reverse()},e.prototype.processStack=function(t){var e=this,n=e.xField,i=e.yField,o=e.reverseOrder?this.reverse(t):t,a=new ot,s=new ot;return o.map((function(t){return t.map((function(t){var e,o=et(t,n,0),u=et(t,[i]),l=""+o;if(u=y(u)?u[1]:u,!p(u)){var c=0>u?s:a;c.has(l)||c.set(l,0);var h=c.get(l),f=u+h;return c.set(l,f),r(r({},t),((e={})[i]=[h,f],e))}return t}))}))},e.prototype.processOneDimStack=function(t){var e=this,n=this,i=n.xField,o=n.height,a=n.reverseOrder?this.reverse(t):t,s=new ot;return a.map((function(t){return t.map((function(t){var n,a=t[i],u=2*e.size/o;s.has(a)||s.set(a,u/2);var l=s.get(a);return s.set(a,l+u),r(r({},t),((n={}).y=l,n))}))}))},e}(Xf),qf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.process=function(t){var e=w(t),n=this.xField,i=this.yField,o=this.getXValuesMaxMap(e),a=Math.max.apply(Math,Object.keys(o).map((function(t){return o[t]})));return Q(t,(function(t){return Q(t,(function(t){var e,s,u=t[i],l=t[n];if(y(u)){var c=(a-o[l])/2;return r(r({},t),((e={})[i]=Q(u,(function(t){return c+t})),e))}var h=(a-u)/2;return r(r({},t),((s={})[i]=[h,u+h],s))}))}))},e.prototype.getXValuesMaxMap=function(t){var e=this,n=this.xField,r=this.yField,i=O(t,(function(t){return t[n]}));return function(t,e){void 0===e&&(e=tt);var n={};return v(t)&&!p(t)&&Object.keys(t).forEach((function(r){n[r]=e(t[r],r)})),n}(i,(function(t){return e.getDimMaxValue(t,r)}))},e.prototype.getDimMaxValue=function(t,e){var n=Q(t,(function(t){return et(t,e,[])})),r=w(n);return Math.max.apply(Math,r)},e}(Xf);function Zf(t){return P(t)&&(t=t.indexOf("T")>0?new Date(t).getTime():new Date(t.replace(/-/gi,"/")).getTime()),Y(t)&&(t=t.getTime()),t}var Kf=function(){function t(t){z(this,t);var e=this,n=e.field,r=e.data;if(!e.scale&&r){var i=T(r,n);this.scale=this.createScale({values:i,field:n})}}return t.prototype.createScale=function(t){return null},t.prototype._mapping=function(t){return t},t.prototype.update=function(t){z(this,t)},t.prototype.setRange=function(t){this.range=t},t.prototype.normalize=function(t){var e=this.scale;return y(t)?t.map((function(t){return e.scale(t)})):e.scale(t)},t.prototype.convert=function(t){return t},t.prototype.mapping=function(t,e){void 0===e&&(e=null);var n=h(this.callback)?this.callback(t,e):null;return p(n)?this._mapping(t):n},t}(),$f=cn((function(t){function e(n){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}));function Jf(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Qf(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function td(){}var ed=.7,nd=1/ed,rd="\\s*([+-]?\\d+)\\s*",id="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",od="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ad=/^#([0-9a-f]{3,8})$/,sd=RegExp("^rgb\\("+[rd,rd,rd]+"\\)$"),ud=RegExp("^rgb\\("+[od,od,od]+"\\)$"),ld=RegExp("^rgba\\("+[rd,rd,rd,id]+"\\)$"),cd=RegExp("^rgba\\("+[od,od,od,id]+"\\)$"),hd=RegExp("^hsl\\("+[id,od,od]+"\\)$"),pd=RegExp("^hsla\\("+[id,od,od,id]+"\\)$"),fd={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 dd(){return this.rgb().formatHex()}function yd(){return this.rgb().formatRgb()}function vd(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=ad.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?gd(e):3===n?new bd(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?md(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?md(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=sd.exec(t))?new bd(e[1],e[2],e[3],1):(e=ud.exec(t))?new bd(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=ld.exec(t))?md(e[1],e[2],e[3],e[4]):(e=cd.exec(t))?md(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=hd.exec(t))?kd(e[1],e[2]/100,e[3]/100,1):(e=pd.exec(t))?kd(e[1],e[2]/100,e[3]/100,e[4]):fd.hasOwnProperty(t)?gd(fd[t]):"transparent"===t?new bd(NaN,NaN,NaN,0):null}function gd(t){return new bd(t>>16&255,t>>8&255,255&t,1)}function md(t,e,n,r){return r>0||(t=e=n=NaN),new bd(t,e,n,r)}function xd(t,e,n,r){return 1===arguments.length?((i=t)instanceof td||(i=vd(i)),i?new bd((i=i.rgb()).r,i.g,i.b,i.opacity):new bd):new bd(t,e,n,null==r?1:r);var i}function bd(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Md(){return"#"+Ed(this.r)+Ed(this.g)+Ed(this.b)}function wd(){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 Ed(t){return(16>(t=Math.max(0,Math.min(255,Math.round(t)||0)))?"0":"")+t.toString(16)}function kd(t,e,n,r){return r>0?n>0&&1>n?e>0||(t=NaN):t=e=NaN:t=e=n=NaN,new Pd(t,e,n,r)}function Sd(t){if(t instanceof Pd)return new Pd(t.h,t.s,t.l,t.opacity);if(t instanceof td||(t=vd(t)),!t)return new Pd;if(t instanceof Pd)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(r>n):n===o?(r-e)/s+2:(e-n)/s+4,s/=.5>u?o+i:2-o-i,a*=60):s=u>0&&1>u?0:a,new Pd(a,s,u,t.opacity)}function Pd(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Td(t,e,n){return 255*(60>t?e+(n-e)*t/60:180>t?n:240>t?e+(n-e)*(240-t)/60:e)}Jf(td,vd,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:dd,formatHex:dd,formatHsl:function(){return Sd(this).formatHsl()},formatRgb:yd,toString:yd}),Jf(bd,xd,Qf(td,{brighter:function(t){return new bd(this.r*(t=null==t?nd:Math.pow(nd,t)),this.g*t,this.b*t,this.opacity)},darker:function(t){return new bd(this.r*(t=null==t?ed:Math.pow(ed,t)),this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return this.r>=-.5&&255.5>this.r&&this.g>=-.5&&255.5>this.g&&this.b>=-.5&&255.5>this.b&&this.opacity>=0&&1>=this.opacity},hex:Md,formatHex:Md,formatRgb:wd,toString:wd})),Jf(Pd,(function(t,e,n,r){return 1===arguments.length?Sd(t):new Pd(t,e,n,null==r?1:r)}),Qf(td,{brighter:function(t){return new Pd(this.h,this.s,this.l*(t=null==t?nd:Math.pow(nd,t)),this.opacity)},darker:function(t){return new Pd(this.h,this.s,this.l*(t=null==t?ed:Math.pow(ed,t)),this.opacity)},rgb:function(){var t=this.h%360+360*(0>this.h),e=this.l,n=e+(.5>e?e:1-e)*(isNaN(t)||isNaN(this.s)?0:this.s),r=2*e-n;return new bd(Td(240>t?t+120:t-240,r,n),Td(t,r,n),Td(120>t?t+240:t-120,r,n),this.opacity)},displayable:function(){return(this.s>=0&&1>=this.s||isNaN(this.s))&&this.l>=0&&1>=this.l&&this.opacity>=0&&1>=this.opacity},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+")")}}));var Nd=function(t){return function(){return t}};function Cd(t){return 1==(t=+t)?Ad:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):Nd(isNaN(e)?n:e)}}function Ad(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):Nd(isNaN(t)?e:t)}var Od=function t(e){var n=Cd(e);function r(t,e){var r=n((t=xd(t)).r,(e=xd(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=Ad(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);var Rd=function(t){function e(e){var n=t.call(this,e)||this;return n._updateInterpolate(),n}return n(e,t),e.prototype.createScale=function(t){return new xf(t)},e.prototype._updateInterpolate=function(){var t,e,n=this.range;this.interpolate=(t=n[0],_(e=n[1])?function(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}(t,e):Od(t,e))},e.prototype.update=function(e){t.prototype.update.call(this,e),this._updateInterpolate()},e.prototype._mapping=function(t){var e=this.scale,n=this.interpolate;return y(t)?t.map((function(t){return n(e.scale(t))})):n(e.scale(t))},e.prototype.normalize=function(t){var e=this.scale;return y(t)?t.map((function(t){return e.scale(t)})):e.scale(t)},e.prototype.convert=function(t){var e=this.range,n=e[0],r=e[1];return y(t)?t.map((function(t){return n+(r-n)*t})):n+(r-n)*t},e}(Kf),Ld=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.createScale=function(t){return new nf(t)},e.prototype._mapping=function(t){var e=this.scale,n=this.range;if("cat"===e.type)return n[e.translate(t)%n.length];var r=e.scale(t);return n[Math.round(r*(n.length-1))]},e}(Kf),_d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.createScale=function(t){return new Af(t)},e.prototype._mapping=function(){var t=this.range;return this.field||t&&t[0]},e}(Kf),Id=Object.freeze({__proto__:null,Attr:Kf,Linear:Rd,Category:Ld,Identity:_d}),Dd=_d,Fd=Rd,Bd=Ld,jd=["x","y","color","size","shape"],Gd=["color","size","shape"];function Yd(t,e){return new t.constructor(r(r({},t.__cfg__),e))}var Vd=function(){function t(t,e){this.scaleController=t,this.attrsRange=e,this.options={},this.attrs={}}return t.prototype.parseOption=function(t,e){return t?P(t)?{field:t,type:"category"}:_(t)&&"size"===e?{type:"identity",field:t}:y(t)?{field:t[0],range:t[1]}:t:{type:"identity"}},t.prototype.getAttrOptions=function(t,e){var n=this;if(!t.x||!t.y)throw Error("x, y are required !");var r={},i=this.attrsRange;jd.forEach((function(e){if(t[e]){var o=n.parseOption(t[e],e);o.range||(o.range=i[e]),r[e]=o}}));var o=r.x,a=r.y;return o.justifyContent=e,o.type=Fd,a.type=Fd,r},t.prototype.getDefaultAttrValues=function(){var t=this.attrsRange,e=t.shape;return{color:t.color[0],shape:e&&e[0]}},t.prototype.getGroupScales=function(){var t=this.attrs,e=[];return g(Gd,(function(n){var r=t[n];if(r){var i=r.scale;i&&i.isCategory&&-1===e.indexOf(i)&&e.push(i)}})),e},t.prototype.createAttr=function(t){var e=t.type,n=t.field,i=t.scale;if(p(n)||e===Dd)return new Dd(t);var o=this.scaleController.getScale(n),a=r(r({},t),{data:this.scaleController.getData(),scale:i?Yd(o,i):o});if(o&&"identity"===o.type)return new Dd(a);var s=o.isLinear?Fd:Bd;return h(e)&&(s=e),P(e)&&Id[B(e)]&&(s=Id[B(e)]),new s(a)},t.prototype.create=function(t){this.update(t)},t.prototype.update=function(t){var e=this,n=e.scaleController,r=e.options,i=e.attrs,o={};g(t,(function(t,e){Yu(t,r[e])&&(o[e]=i[e]);var a=t.field;a&&n.setScale(a,{justifyContent:t.justifyContent})})),this.options=t,this.attrs=o},t.prototype.getAttr=function(t){var e=this.attrs,n=e[t];if(n)return n;var r=this.options[t];if(!r)return null;var i=this.createAttr(r);return e[t]=i,i},t.prototype.getAttrs=function(){var t=this,e=this.attrs;return g(this.options,(function(e,n){t.getAttr(n)})),e},t.prototype.isGroupAttr=function(t){return-1!==Gd.indexOf(t)},t.prototype.getAttrsByLinear=function(){var t=this.attrs,e=[],n=[];return Object.keys(t).forEach((function(r){if("x"!==r&&"y"!==r){var i=t[r].scale;i&&"linear"===i.type?e.push(r):n.push(r)}else e.push(r)})),{linearAttrs:e,nonlinearAttrs:n}},t}(),Wd={Stack:Hf,Dodge:zf,Jitter:Uf,Symmetric:qf},Xd="origin",zd=function(t){function e(e,n){var r=t.call(this,e,n)||this;r.isGeometry=!0,r.justifyContent=!1,r.startOnZero=!1,r.connectNulls=!1,r.sortable=!1,z(r,r.getDefaultCfg());var i=e.chart,o=e.coord,a=r._getThemeAttrsRange();r.attrController=new Vd(i.scale,a);var s=r.attrController,u=r.justifyContent,l=s.getAttrOptions(e,!o.isCyclic()||u);return s.create(l),r}return n(e,t),e.prototype.getDefaultCfg=function(){return{}},e.prototype.willReceiveProps=function(e){var n=this,r=n.props,i=n.attrController,o=n.justifyContent,a=e.data,s=e.adjust,u=e.selection,l=r.data,c=r.adjust,h=r.selection,p=!e.coord.isCyclic()||o,f=i.getAttrOptions(r,p);i.attrsRange=this._getThemeAttrsRange();var d=i.getAttrOptions(e,p);Yu(d,f)||(i.update(d),this.dataRecords=null),a!==l&&(this.dataRecords=null),s!==c&&(this.dataRecords=null),Yu(u,h)||t.prototype.willReceiveProps.call(this,e)},e.prototype.willMount=function(){this._createAttrs(),this.dataRecords||this._processData()},e.prototype.willUpdate=function(){this._createAttrs(),this.dataRecords?this._readjustData(this.dataRecords):this._processData()},e.prototype.didMount=function(){this._initEvent(),t.prototype.didMount.call(this),this.attrController.attrsRange=this._getThemeAttrsRange()},e.prototype._initEvent=function(){var t=this,e=this.props,n=e.chart;["onPressStart","onPress","onPressEnd","onPan","onPanStart","onPanEnd"].forEach((function(r){e[r]&&n.on(r.substr(2).toLowerCase(),(function(n){n.geometry=t,e[r](n)}))}))},e.prototype._createAttrs=function(){var t=this.attrController;t.attrs={},this.attrs=t.getAttrs()},e.prototype._getThemeAttrsRange=function(){var t=this,e=t.props.coord,n=t.context.theme;return{x:e.x,y:e.y,color:n.colors,size:n.sizes,shape:n.shapes[t.geomType]}},e.prototype._createAdjust=function(){var t=this.attrs,e=this.props.adjust;if(!e)return null;var n="string"==typeof e?{type:e}:e,r=B(n.type),i=Wd[r];if(!i)throw Error("not support such adjust : "+e);"Dodge"===r&&(n.adjustNames=["x"]);var o=t.y;n.xField=t.x.field,n.yField=o.field;var a=new i(n);return this.adjust={type:n.type,adjust:a},this.adjust},e.prototype._adjustScales=function(){var t=this,e=t.attrs,n=t.props,r=n.chart,i=n.startOnZero,o=n.coord,a=n.adjust,s=o.isPolar,u=o.transposed,l=e.y,c=l.field;(void 0===i?t.startOnZero:i)&&r.scale.adjustStartZero(e.y.scale);s&&u&&("stack"===a||"stack"===(null==a?void 0:a.type))&&r.scale.adjustPieScale(e.y.scale);"stack"!==a&&"stack"!==(null==a?void 0:a.type)||this._updateStackRange(c,l.scale,this.dataArray)},e.prototype._groupData=function(t){var e=this.attrController.getGroupScales();if(!e.length)return[{children:t}];var n=[];e.forEach((function(t){n.push(t.field)}));var r=R(t,n),i=[];for(var o in r)i.push({key:o.replace(/^_/,""),children:r[o]});return i},e.prototype._saveOrigin=function(t){for(var e,n=t.length,i=Array(n),o=0;n>o;o++){var a=t[o];i[o]=r(r({},a),((e={})[Xd]=a,e))}return i},e.prototype._numberic=function(t){for(var e=this.attrs,n=[e.x.scale,e.y.scale],r=0,i=t.length;i>r;r++)for(var o=t[r],a=n.length,s=0;a>s;s++){var u=n[s];if(u.isCategory){var l=u.field,c=u.translate(o.origin[l]);o[l]=c}}},e.prototype._adjustData=function(t){var e=this.adjust,n=t.map((function(t){return t.children}));if(!e)return n;for(var r=this.attrs,i=[r.x.scale,r.y.scale],o=0,a=n.length;a>o;o++)for(var s=n[o],u=0,l=s.length;l>u;u++)for(var c=s[u],h=i.length,p=0;h>p;p++){var f=i[p].field;c[f]=c.origin[f]}if("dodge"===e.type)for(o=0,a=n.length;a>o;o++)this._numberic(n[o]);var d=e.adjust.process(n);return t.forEach((function(t,e){t.children=d[e]})),d},e.prototype._updateStackRange=function(t,e,n){for(var r=w(n),i=1/0,o=-1/0,a=0,s=r.length;s>a;a++){var u=r[a],l=Math.min.apply(null,u[t]),c=Math.max.apply(null,u[t]);i>l&&(i=l),c>o&&(o=c)}i===e.min&&o===e.max||e.change({min:i,max:o})},e.prototype._processData=function(){var t=this._saveOrigin(this.props.data),e=this._groupData(t);this._createAdjust();var n=this._adjustData(e);this.dataArray=n,this._adjustScales(),this.sortable&&this._sortData(e),this.dataRecords=e},e.prototype._readjustData=function(t){if(this.adjust){var e=this._adjustData(t);this.dataArray=e}},e.prototype._sortData=function(t){var e=this.getXScale(),n=e.field,r=e.type;"identity"!==r&&e.values.length>1&&g(t,(function(t){t.children.sort((function(t,i){if("timeCat"===r)return Zf(t[Xd][n])-Zf(i[Xd][n]);var o=e.translate(t[Xd][n]),a=e.translate(i[Xd][n]);return isNaN(o)?1:isNaN(a)?-1:o-a}))}))},e.prototype.getY0Value=function(){var t=this.props.chart,e=t.getScale(this.attrs.y.field);return t.scale.getZeroValue(e)},e.prototype._getShapeStyle=function(t,e){var n=this,o=n.context.theme.shape[n.geomType]||{},a=o[t],s=n.props.style,u=r(r({},o.default),a);if(!s||!v(s))return u;var l=s.field,c=i(s,["field"]),p=l?e[l]:e;return g(c,(function(t,e){if(h(t)){var n=t(p);if(!n)return;u[e]=n}else u[e]=t})),u},e.prototype._mapping=function(t){for(var e=this,n=e.attrs,i=e.attrController,o=e.props.coord,a=i.getAttrsByLinear(),s=a.linearAttrs,u=a.nonlinearAttrs,l=i.getDefaultAttrValues(),c=[],h=0,p=t.length;p>h;h++){var f=t[h],d=f.children,y=r({},l),v=d[0];if(0!==d.length){for(var g=0,m=u.length;m>g;g++){y[k=u[g]]=(S=n[k]).mapping(v[S.field],v.origin)}for(var x=[],b=0,M=d.length;M>b;b++){var w=d[b],E={};for(g=0;s.length>g;g++){var k,S,P=w[(S=n[k=s[g]]).field];i.isGroupAttr(k)?y[k]=S.mapping(P,w):E[k]=S.normalize(P)}var T=o.convertPoint({x:E.x,y:E.y}),N=T.x,C=T.y,A=y.shape,O=this._getShapeStyle(A,w.origin),R=this.isSelected(w);x.push(r(r(r({},w),y),{normalized:E,x:N,y:C,shapeName:A,shape:O,selected:R}))}c.push(r(r({},f),{children:x}))}else c.push(r({},f))}return c},e.prototype.mapping=function(){return this.records=this._mapping(this.dataRecords),this.records},e.prototype.getClip=function(){var t=this.props,e=t.coord;return t.viewClip?{type:"rect",style:{x:e.left,y:e.top,width:e.width,height:e.height}}:null},e.prototype.getAttr=function(t){return this.attrController.getAttr(t)},e.prototype.getXScale=function(){return this.getAttr("x").scale},e.prototype.getYScale=function(){return this.getAttr("y").scale},e.prototype._getXSnap=function(t){var e=this.getXScale();if(e.isCategory)return e.invert(t);var n=e.invert(t),r=e.values,i=r.length;if(1===i)return r[0];if((r[0]+r[1])/2>n)return r[0];if(n>=(r[i-2]+r[i-1])/2)return r[i-1];for(var o=1;i>o;o++)if(n>=(r[o-1]+r[o])/2&&(r[o+1]+r[o])/2>n)return r[o];return null},e.prototype._getYSnapRecords=function(t,e){var n=this.getYScale(),r=n.field,i=n.invert(t);return e.filter(n.isCategory?function(t){return t[Xd][r]===i}:function(t){var e=t[r];return i>=e[0]&&e[1]>=i})},e.prototype.flatRecords=function(){return this.records.reduce((function(t,e){return t.concat(e.children)}),[])},e.prototype.getSnapRecords=function(t,e){var n=this.props,i=n.coord,o=n.adjust,a=i.invertPoint(t),s=this.getXScale(),u=this.getYScale();if(e){var l=s.range,c=u.range;a.x=Math.min(Math.max(a.x,l[0]),l[1]),a.y=Math.min(Math.max(a.y,c[0]),c[1])}var h=this.flatRecords(),p=s.invert(a.x),f=u.invert(a.y),d=i.convertPoint(a),y={x:d.x,y:d.y,xValue:p,yValue:f,xText:s.getText(p),yText:u.getText(f)};if("stack"===o&&i.isPolar&&i.transposed&&(a.x>=0&&1>=a.x))return this._getYSnapRecords(a.y,h);var v=[],g=this._getXSnap(a.x);if(function(t){return null===t}(g))return v;for(var m=s.field,x=u.field,b=0,M=h.length;M>b;b++){var w=r(r({},h[b]),{xField:m,yField:x,coord:y}),E=w[Xd][m];("timeCat"===s.type&&Zf(E)===g||E===g)&&v.push(w)}return v},e.prototype.getRecords=function(t,e){void 0===e&&(e="xfield");for(var n=this.flatRecords(),i=this.getXScale(),o=this.getYScale(),a=i.field,s=o.field,u=t[a],l=[],c=0,h=n.length;h>c;c++){var p=r(r({},n[c]),{xField:a,yField:s});p[Xd]["xfield"===e?a:s]===u&&l.push(p)}return l},e.prototype.getLegendItems=function(){var t=this.records,e=this.attrController.getAttr("color");if(!e)return null;var n=e.scale,r=n.field;if(!n.isCategory)return null;var i=t?this.flatRecords():[],o=n.getTicks().map((function(t){var o=t.text,a=t.tickValue,s=M(i,(function(t){return!!t&&t.origin[r]===a})),u=s?s.color:e.mapping(a);return{field:n.field,color:u,name:o,tickValue:a}}));return o},e}(Wf),Ud=function(t){return function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return n(i,e),i.prototype.getDefaultCfg=function(){return{geomType:"line",sortable:!0}},i.prototype.splitPoints=function(t){for(var e=[],n=[],i=0,o=t.length;o>i;i++){var a=t[i],s=a.x,u=a.y;e.push(r(r({},a),{x:s,y:u[1]})),n.push(r(r({},a),{x:s,y:u[0]}))}return[e,n]},i.prototype.splitNulls=function(t,e){if(e){for(var n=[],r=0,i=t.length;i>r;r++){var o=(u=t[r]).y;if(!isNaN(u.x))if(y(o)){if(isNaN(o[0]))continue;n.push(u)}else isNaN(o)||n.push(u)}return n.length?[n]:[]}var a=[],s=[];for(r=0,i=t.length;i>r;r++){var u;o=(u=t[r]).y;if(!isNaN(u.x))if(y(o)){if(isNaN(o[0])){s.length&&(a.push(s),s=[]);continue}s.push(u)}else isNaN(o)?s.length&&(a.push(s),s=[]):s.push(u)}return s.length&&a.push(s),a},i.prototype.mapping=function(){var t=this,n=e.prototype.mapping.call(this),i=this,o=i.props,a=i.context,s=o.coord,u=o.connectNulls,c=void 0===u?i.connectNulls:u,p=o.sizeZoom;return n.map((function(e){var n,i=e.children,o=i[0]||{},u=o.size,f=o.color,d=o.shape,v=o.y,g=o.origin,m=s.isPolar?l(l([],i,!0),[i[0]],!1):i,x=null!==(n=h(p)?p(g):p)&&void 0!==n?n:1,b=t.splitNulls(m,c).map((function(e){var n=y(v)?t.splitPoints(e):[e,void 0],r=n[0],i=n[1];return{size:a.px2hd(u||d.lineWidth)*x,color:f,shape:d,points:[].concat(r),topPoints:r,bottomPoints:i}}));return r(r({},e),{children:b})}))},i.prototype.concatPoints=function(t,e){if(!e||!e.length)return t;var n=this.adjust;if(n&&"stack"===n.type)return t;var r=t.concat(e.reverse());return r.push(t[0]),r},i.prototype.render=function(){for(var e=this.props,n=e.coord,i=this.mapping(),o=this.getClip(),a=0,s=i.length;s>a;a++)for(var u=i[a].children,l=0,c=u.length;c>l;l++){var h=u[l];h.points=this.concatPoints(h.points,h.bottomPoints)}return Mh(t,r({},e,{coord:n,records:i,clip:o}))},i}(zd)};var Hd=function(t){var e=t.records,n=t.coord,i=t.animation,o=t.endView,a=t.clip,s=n.left,u=n.top,l=n.width,c=n.height,h=n.center,p=n.startAngle,f=n.endAngle,d=n.radius,y=n.isPolar?{easing:"quadraticOut",duration:450,clip:{type:"sector",property:["endAngle"],style:{cx:h.x,cy:h.y,startAngle:"".concat(p,"rad"),r:d},start:{endAngle:"".concat(p,"rad")},end:{endAngle:"".concat(f,"rad")}}}:{easing:"quadraticOut",duration:450,clip:{type:"rect",property:["width"],style:{x:s,y:u,height:c},start:{width:0},end:{width:l}}};return Mh("group",{style:{clip:a}},e.map((function(t){var e,n=t.key,a=t.children,s=function(t){for(var e=[],n=0;t.length>n;n++)e=e.concat(t[n].points);return e}(a),u={current:null};return Mh("group",{key:n},a.map((function(t){var e=t.color,o=t.size,a=t.shape,s=t.points.filter((function(t){return!isNaN(t.x)&&!isNaN(t.y)}));if(0!==s.length)return Mh("polyline",{key:n,ref:u,style:r(r({points:s.map((function(t){return[t.x,t.y]})),stroke:e},a),{lineWidth:o||a.lineWidth}),animation:Z({update:{easing:"linear",duration:450,property:["points"]},appear:y},i)})})),o?Mh("group",{style:{offset:u},animation:Z({appear:{easing:"quadraticOut",duration:450,property:["offsetDistance"],start:{offsetDistance:0},end:{offsetDistance:1}}},i)},Mh(o,{origin:null===(e=s[0])||void 0===e?void 0:e.origin})):null)})))},qd=Ud(Hd),Zd=function(t){return function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return n(i,e),i.prototype.getDefaultCfg=function(){return{geomType:"area",startOnZero:!0,sortable:!0}},i.prototype.getBaseY=function(){var t=this.getY0Value(),e=this.props,n=e.coord,r=e.startOnZero;return(void 0===r?this.startOnZero:r)?n.convertPoint({x:0,y:t}).y:n.y[0]},i.prototype.mapping=function(){for(var t=e.prototype.mapping.call(this),n=this.getBaseY(),r=0,i=t.length;i>r;r++)for(var o=t[r].children,a=0,s=o.length;s>a;a++){var u=o[a],l=u.points,c=u.bottomPoints;c&&c.length?(c.reverse(),u.points=l.concat(c)):(l.push({x:l[l.length-1].x,y:n}),l.push({x:l[0].x,y:n}))}return t},i.prototype.render=function(){var e=this.props,n=e.coord,i=this.mapping(),o=this.getClip(),a=this.getBaseY();return Mh(t,r({},e,{baseY:a,coord:n,records:i,clip:o}))},i}(Ud(t))},Kd=function(t){var e=t.coord,n=t.records,i=t.baseY,o=t.animation,a="smooth"===t.shape,s=e.left,u=e.top,l=e.width,c=e.height,h=e.center,p=e.startAngle,f=e.endAngle,d=e.radius,y=e.isPolar?{easing:"quadraticOut",duration:450,clip:{type:"sector",property:["endAngle"],style:{cx:h.x,cy:h.y,startAngle:"".concat(p,"rad"),r:d},start:{endAngle:"".concat(p,"rad")},end:{endAngle:"".concat(f,"rad")}}}:{easing:"quadraticOut",duration:450,clip:{type:"rect",property:["width"],style:{x:s,y:u,height:c},start:{width:0},end:{width:l}}};return Mh("group",null,n.map((function(t){return Mh("group",{key:t.key},t.children.map((function(t){var e=t.points,n=t.topPoints,s=t.bottomPoints,u=t.color,l=t.shape;if(a){return Mh("path",{style:r({path:function(){var t=[],e=[[0,0],[1,1]],r=Cu(n,!1,e);t.push(["M",n[0].x,n[0].y]);for(var o=0,a=r.length;a>o;o++){t.push(["C",(l=r[o])[1],l[2],l[3],l[4],l[5],l[6]])}if(s&&s.length){var u=Cu(s,!1,e);t.push(["L",s[0].x,s[0].y]);for(o=0,a=u.length;a>o;o++){var l;t.push(["C",(l=u[o])[1],l[2],l[3],l[4],l[5],l[6]])}}else t.push(["L",n[n.length-1].x,i]),t.push(["L",n[0].x,i]);return t}(),lineWidth:"2px",fill:u},l)})}return Mh("polygon",{style:r({points:e.map((function(t){return[t.x,t.y]})),lineWidth:"2px",fill:u},l),animation:Z({appear:y,update:{easing:"linear",duration:450,property:["points"]}},o)})})))})))},$d=Zd(Kd);function Jd(t,e){return{x:(e.x-t.x)/2+t.x,y:(e.y-t.y)/2+t.y}}var Qd={textBaseline:"middle",fill:"#808080"};function ty(t){var e,n,r,i,o=t.record,a=t.offsetX,s=t.offsetY,u=t.points,l=t.label,c=t.guide,p=o.origin,f=o.color;h(l)&&(n=z({x:(i=4===u.length?Jd(u[1],u[2]):Jd(u[0],u[1])).x+a,y:i.y+s},Qd,l(p,f)));h(c)&&(r=z({x:(i=Jd(4===u.length?Jd(u[0],u[1]):u[0],Jd(u[2],null!==(e=u[3])&&void 0!==e?e:u[1]))).x,y:i.y,textBaseline:"middle",textAlign:"center"},Qd,c(p,f)));return Mh("group",null,n&&Mh("text",{attrs:n}),r&&Mh("text",{attrs:r}))}var ey=Object.freeze({__proto__:null,pyramid:ty,funnel:ty}),ny=function(t){return function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return n(r,e),r.prototype.getDefaultCfg=function(){return{geomType:"interval",justifyContent:!0,startOnZero:!0}},r.prototype.getDefaultSize=function(){var t=this,e=t.props,n=t.adjust,r=e.coord,i=e.sizeRatio,o=t.attrs.x.scale.values;if(i)return 1/o.length*i;var a=1/o.length*(r.isPolar?r.transposed&&o.length>1?3/4:.999999:.5);return n&&"dodge"===n.type?a/t.records.length:a},r.prototype.mapping=function(){for(var t,n=e.prototype.mapping.call(this),r=this.props,i=r.coord,o=r.sizeZoom,a=this.getY0Value(),s=this.getDefaultSize(),u=0,l=n.length;l>u;u++)for(var c=n[u].children,f=0,d=c.length;d>f;f++){var y=c[f],v=y.normalized,g=y.size,m=y.origin;if(p(g)){var x=v.x,b=v.y,M=v.size,w=void 0===M?s:M,E=null!==(t=h(o)?o(m):o)&&void 0!==t?t:1;z(y,i.convertRect({x:x,y:b,y0:a,size:w*E}))}else{z(y,i.transformToRect({size:g,x:x=y.x,y:b=y.y,y0:a}))}z(y.shape,this.getSelectionStyle(y))}return n},r.prototype.getPointY0=function(){var t=this.props.coord,e=this.getY0Value(),n=t.convertPoint({y:e,x:0});return null==n?void 0:n.y},r.prototype.render=function(){var e=this.props,n=this.state,r=e.coord,i=e.shape,o=void 0===i?"rect":i,a=e.animation,s=e.showLabel,u=e.labelCfg,l=h(t)?t:t[o],c=ey[o],p=Z({label:null,offsetX:0,offsetY:0},u);if(!l)return null;var f=n.selected;return Mh(l,{coord:r,records:this.mapping(),selected:f,shape:o,animation:a,showLabel:s,labelCfg:p,LabelView:c,y0:this.getPointY0(),clip:this.getClip()})},r}(zd)},ry=function(t){var e=t.animation,n=t.y0,i=t.onClick;return Mh("group",{attrs:{clip:t.clip}},t.records.map((function(t){return Mh("group",{key:t.key},t.children.map((function(t){var o=t.key,a=t.xMin,s=t.xMax,u=t.yMin,l=t.yMax,c=t.color,h=t.shape;return isNaN(a)||isNaN(s)||isNaN(u)||isNaN(l)?null:Mh("rect",{key:o,attrs:r({x:a,y:u,width:s-a,height:l-u,fill:c},h),onClick:i,animation:Z({appear:{easing:"linear",duration:450,property:["y","height"],start:{y:n,height:0}},update:{easing:"linear",duration:450,property:["x","y","width","height"]}},e)})})))})))},iy=function(t){var e=t.coord,n=t.records,i=t.animation,o=t.onClick,a=e.center,s=e.startAngle,u=e.endAngle,l=e.radius;return Mh("group",{animation:{appear:r({easing:"quadraticOut",duration:450,clip:{type:"sector",property:["endAngle"],style:{cx:a.x,cy:a.y,startAngle:"".concat(s,"rad"),r:l},start:{endAngle:"".concat(s,"rad")},end:{endAngle:"".concat(u,"rad")}}},i&&i.appear)}},n.map((function(t){return Mh("group",{key:t.key},t.children.map((function(t){var e=t.xMax,n=t.yMin,s=t.yMax,u=t.shape;return Mh("sector",{key:t.key,attrs:r({cx:a.x,cy:a.y,fill:t.color,lineWidth:1,startAngle:"".concat(t.xMin,"rad"),endAngle:"".concat(e,"rad"),r0:n,r:s},u),onClick:o,animation:Z({update:{easing:"linear",duration:450,property:["x","y","startAngle","endAngle","r0","r"]}},i)})})))})))},oy=function(t){return Mh("rect"===t.coord.type?ry:iy,r({},t))};function ay(t){var e=t.xMin,n=t.xMax,r=t.yMin,i=t.yMax;return[{x:e,y:r},{x:n,y:r},{x:n,y:i},{x:e,y:i}]}var sy=function(t){var e=t.records,n=t.shape,i=t.showLabel,o=t.labelCfg,a=t.LabelView,s=!1;return Mh("group",null,e.map((function(t,u){var l=t.key,c=t.children,h=u===e.length-1,p=(h?t:e[u+1]).children,f=ay(p[0]),d=ay(p[p.length-1]);return s||(s=p[0].yMax>c[0].yMax),s&&(f.reverse(),d.reverse()),Mh("group",{key:l},c.map((function(t,e){var i=ay(t);return s&&i.reverse(),h?"pyramid"===n&&(i=[Jd(i[0],i[1]),i[2],i[3]]):(0===e&&(i[0]=f[3]),e===c.length-1&&(i[1]=d[2])),r(r({},t),{points:i})})).map((function(t){var e=t.points,n=t.color,s=t.shape;return Mh("group",null,Mh("polygon",{attrs:r({points:e.map((function(t){return[t.x,t.y]})),fill:n},s)}),i&&a?Mh(a,r({record:t,points:e},o)):null)})))})))},uy=ny(Object.freeze({__proto__:null,rect:oy,pyramid:sy,funnel:sy})),ly=function(t){return function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return n(i,e),i.prototype.getDefaultCfg=function(){return{geomType:"point"}},i.prototype.render=function(){var e=this.props,n=e.coord,i=this.mapping(),o=this.getClip();return Mh(t,r({},e,{coord:n,records:i,clip:o}))},i}(zd)},cy=function(t){var e=t.animation;return Mh("group",{attrs:{clip:t.clip}},t.records.map((function(t){var n=t.key;return Mh("group",{key:n},t.children.map((function(t){var i=t.x,o=t.y,a=t.size,s=t.color,u=t.shapeName,l=t.shape;if(isNaN(i)||isNaN(o))return null;if("rect"===u){var c=p(a)?l.size:a;return Mh("rect",{key:n,attrs:r(r({x:i-c,y:o-c,fill:s,stroke:s},l),{width:2*c,height:2*c}),animation:Z({appear:{easing:"linear",duration:450},update:{easing:"linear",duration:450,property:["x","y","width","height","fill"]}},e)})}return Mh("circle",{key:n,style:r(r({cx:i,cy:o,fill:"circle"===u?s:null,stroke:"hollowCircle"===u?s:null},l),{r:p(a)?l.size:a}),animation:Z({appear:{easing:"linear",duration:450},update:{easing:"linear",duration:450,property:["cx","cy","r","fill"]}},e)})})))})))},hy=ly(cy),py=function(t){return function(e){function i(t){var n=e.call(this,t)||this;n.axisStyle={};var r=t.chart,i=t.field,o=n.getScaleOption(t);return r.setScale(i,o),n}return n(i,e),i.prototype.willReceiveProps=function(t){var e=this.props,n=t.chart,r=t.field,i=this.getScaleOption(t);Yu(i,this.getScaleOption(e))||n.setScale(r,i)},i.prototype.willMount=function(){this.updateCoord()},i.prototype.willUpdate=function(){this.updateCoord()},i.prototype.getScaleOption=function(t){return{type:t.type,tickCount:t.tickCount,range:t.range,mask:t.mask,formatter:t.formatter,min:t.min,max:t.max,nice:t.nice,ticks:t.ticks}},i.prototype._getDimType=function(){var t=this.props,e=t.field,n=t.chart.getXScales().filter((function(t){return t.field===e}));return n.length>0?"x":"y"},i.prototype.getMaxBBox=function(t,e){var n=this.context.measureText,i=e.label,o=e.labelOffset,a=0,s=0;return t.forEach((function(t){if(i){var e=t.labelStyle,o=void 0===e?{}:e,u=n(o.text||t.text,r(r({},i),o));a=Math.max(a,u.width),s=Math.max(s,u.height)}})),a||s?{width:a+o,height:s+o}:{width:a,height:s}},i.prototype._getPosition=function(){var t=this.props,e=t.position,n=t.coord;if(e)return e;var r=this._getDimType();return n.transposed?"x"===r?"left":"bottom":"x"===r?"bottom":"left"},i.prototype.getTicks=function(){var t=this.props,e=t.chart.getScale(t.field).getTicks();return e=this._setTicksStyle(e),e=this._generateGridPoints(e)},i.prototype._generateGridPoints=function(t){var e=this.props,n=e.chart,r=e.coord;if(!r.isPolar)return t;if("y"!==this._getDimType())return t;var i=n.getXScales()[0].getTicks();return t.forEach((function(t){var e=i.map((function(e){return r.convertPoint({x:e.value,y:t.value})}));e.push(e[0]),t.gridPoints=e})),t},i.prototype._setTicksStyle=function(t){var e=this,n=this.context,r=n.px2hd,i=this.props.style,o=void 0===i?{}:i,a=n.theme.axis;return g(a,(function(t,n){if(null!==o[n]){var i=h(o[n])?void 0:o[n];e.axisStyle[n]=P(t)||_(t)?r(i)||t:y(i)?i.map((function(e){return r(Z(U(t),e))})):r(Z(U(t),i))}})),t.map((function(e,n){var i=o.label,s=o.grid,u=a.label,l=a.grid;return h(i)&&(e.labelStyle=r(z({},u,i(e.text,n,t)))),h(s)&&(e.gridStyle=r(z({},l,s(e.text,n,t.length)))),e}))},i.prototype.convertTicks=function(t){var e=this.props.coord,n=this._getDimType(),i="x"===n?"y":"x";return t.map((function(t){var o,a,s=e.convertPoint(((o={})[n]=t.value,o[i]=0,o)),u=e.convertPoint(((a={})[n]=t.value,a[i]=1,a));return r(r({},t),{points:[s,u]})}))},i.prototype.measureLayout=function(){var t=this.props,e=t.coord;if(!1===t.visible)return null;var n=this.getTicks(),r=this.getMaxBBox(n,this.axisStyle),i=e.isPolar,o=this._getDimType(),a=r.width,s=r.height;return i?"y"===o?null:["top","right","bottom","left"].map((function(t){return{position:t,width:a,height:s}})):{position:this._getPosition(),width:a,height:s}},i.prototype.updateCoord=function(){var t=this.props.chart,e=this.measureLayout();t.updateCoordFor(this,e)},i.prototype.render=function(){var e=this.props,n=this.axisStyle,i=e.coord;if(!1===e.visible)return null;var o=this.getTicks(),a=this._getPosition(),s=this._getDimType();return Mh(t,r({},e,{style:n,ticks:this.convertTicks(o),coord:i,position:a,dimType:s}))},i}(an)};function fy(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=xe([r,i]),a=o+n;return{x:t.x+r/o*a,y:t.y+i/o*a}}function dy(t,e){var n=[e.x-t.x,e.y-t.y];return{textAlign:n[0]>0?"left":0>n[0]?"right":"center",textBaseline:n[1]>0?"top":0>n[1]?"bottom":"middle"}}var yy=function(t){var e=t.line,n=t.center,i=t.ticks;if(!e)return null;if("line"!==t.gridType)return Mh("arc",{attrs:r({cx:n.x,cy:n.y,r:t.radius,startAngle:0,endAngle:360},e)});var o=i.map((function(t){var e=t.points;return e[e.length-1]}));return o.push(o[0]),Mh("polyline",{attrs:r({points:o.map((function(t){return[t.x,t.y]}))},e)})},vy=function(t){var e=t.style,n=t.grid,i=t.coord.center,o=e.grid,a=e.tickLine,s=e.line,u=e.labelOffset,l=e.label,c=t.ticks.filter((function(t){return!isNaN(t.value)})),h=c[0].points,p=h[h.length-1],f=xe([p.x-i.x,p.y-i.y]);return Mh("group",null,o?c.map((function(t){var e=t.points,n=t.gridStyle,a=e[e.length-1];return Mh("line",{attrs:r(r({x1:i.x,y1:i.y,x2:a.x,y2:a.y},o),n)})})):null,a&&a.length?c.map((function(t){var e=t.points,n=e[e.length-1],o=fy(i,n,a.length);return Mh("line",{attrs:r({x1:n.x,y1:n.y,x2:o.x,y2:o.y},a)})})):null,Mh(yy,{line:s,gridType:n,center:i,radius:f,ticks:c}),l?c.map((function(t){var e=t.points,n=t.text,o=t.labelStyle,a=e[e.length-1],s=fy(i,a,u);return Mh("text",{attrs:r(r(r({x:s.x,y:s.y,text:n},dy(i,a)),l),o)})})):null)},gy=function(t){var e=t.style,n=t.grid,i=t.coord.center,o=e.grid,a=e.tickLine,s=e.line,u=e.labelOffset,l=e.label,c=t.ticks.filter((function(t){return!isNaN(t.value)}));return Mh("group",null,o?c.map((function(t){var e=t.points,a=t.gridStyle,s=t.gridPoints,u=e[e.length-1];return"line"!==n?Mh("arc",{style:r(r({cx:i.x,cy:i.y,startAngle:0,endAngle:360,r:xe([u.x-i.x,u.y-i.y])},o),a)}):Mh("polyline",{attrs:r(r({points:s.map((function(t){return[t.x,t.y]}))},o),a)})})):null,a&&a.length?c.map((function(t){var e=t.points,n=e[e.length-1];return Mh("line",{attrs:r({x1:n.x,y1:n.y,x2:n.x-a.length,y2:n.y},a)})})):null,s?Mh("line",{attrs:r({x1:c[0].points[0].x,y1:c[0].points[0].y,x2:c[c.length-1].points[0].x,y2:c[c.length-1].points[0].y},s)}):null,l?c.map((function(t){var e=t.points,n=t.labelStyle,i=e[e.length-1];return Mh("text",{attrs:r(r({x:i.x-u,y:i.y,text:t.text,textAlign:"right",textBaseline:"middle"},l),n)})})):null)},my=function(t,e){var n=t.coord,o=t.style,a=e.px2hd,s=n.left,u=n.top,l=n.right,c=o.grid,h=o.tickLine,p=o.line,f=o.labelOffset,d=o.label,v=o.symbol,g=t.ticks.filter((function(t){return!isNaN(t.value)})),m=y(v)?v:[v],x=h||{},b=x.length,M=i(x,["length"]);return Mh("group",null,c?g.map((function(t){var e=t.points,n=t.gridStyle,i=e[0],o=e[e.length-1];return Mh("line",{key:"grid-".concat(t.tickValue),style:r(r({x1:i.x,y1:i.y,x2:o.x,y2:o.y},c),n)})})):null,h&&h.length?g.map((function(t){var e=t.points,n=e[e.length-1];return Mh("line",{key:"tickLine-".concat(t.tickValue),style:r({x1:n.x,y1:n.y,x2:n.x,y2:n.y-a(b)},M)})})):null,m[0]?Mh("marker",{style:r(r({x:l,y:u,transform:"rotate(90deg)",transformOrigin:"50% 50%"},m[0]),{symbol:m[0].type})}):null,p?Mh("line",{style:r({x1:s,y1:u,x2:l,y2:u},p)}):null,m[1]?Mh("marker",{style:r(r({x:s,y:u,transform:"rotate(-90deg)",transformOrigin:"50% 50%"},m[0]),{symbol:m[1].type})}):null,d?g.map((function(t,e){var n=t.points,i=t.text,o=t.labelStyle,a=n[n.length-1];return Mh("text",{key:"text-".concat(t.tickValue),style:r(r({x:a.x,y:a.y-f,textAlign:"center",textBaseline:"bottom",text:i},d),o)})})):null)},xy=function(t,e){var n=t.ticks,o=t.coord,a=t.style,s=t.animation,u=e.px2hd,l=o.left,c=o.right,h=o.bottom,p=a.grid,f=a.tickLine,d=a.line,v=a.labelOffset,g=a.label,m=a.symbol,x=n.filter((function(t){return!isNaN(t.value)})),b=y(m)?m:[m],M=f||{},w=M.length,E=i(M,["length"]);return Mh("group",null,p?x.map((function(t){var e=t.points,n=t.gridStyle,i=e[0],o=e[e.length-1];return Mh("line",{key:"grid-".concat(t.tickValue),style:r(r({x1:i.x,y1:i.y,x2:o.x,y2:o.y},p),n)})})):null,w?x.map((function(t){var e=t.points[0];return Mh("line",{key:"tickLine-".concat(t.tickValue),style:r({x1:e.x,y1:e.y,x2:e.x,y2:e.y+u(w)},E)})})):null,b[0]?Mh("marker",{style:r(r({x:c,y:h,transform:"rotate(90deg)",transformOrigin:"50% 50%"},b[0]),{symbol:b[0].type})}):null,d?Mh("line",{style:r({x1:l,y1:h,x2:c,y2:h},d)}):null,b[1]?Mh("marker",{style:r(r({x:l,y:h,transform:"rotate(-90deg)",transformOrigin:"50% 50%"},b[0]),{symbol:b[1].type})}):null,g?x.map((function(t,e){var i=t.tickValue,o=t.labelStyle,a=t.points[0],u=(o||g||{}).align,l=void 0===u?"center":u,c=r(r({x:a.x,y:a.y+v,textBaseline:"top",text:t.text},g),o);return c.textAlign="between"===l?0===e?"start":e===n.length-1?"end":"center":l,Mh("text",{key:"text-".concat(i),style:c,animation:s||{appear:{easing:"linear",duration:300,delay:0,property:["fillOpacity"],start:{fillOpacity:0},end:{fillOpacity:1}},update:{easing:"linear",duration:450,delay:0,property:["x","y"]},leave:{easing:"linear",duration:450,delay:0,property:["fillOpacity"],start:{fillOpacity:1},end:{fillOpacity:0}}}})})):null)},by=function(t,e){var n=t.coord,o=t.style,a=e.px2hd,s=n.top,u=n.right,l=n.bottom,c=o.grid,h=o.tickLine,p=o.line,f=o.labelOffset,d=o.label,v=o.symbol,g=t.ticks.filter((function(t){return!isNaN(t.value)})),m=y(v)?v:[v],x=h||{},b=x.length,M=i(x,["length"]);return Mh("group",null,c?g.map((function(t){var e=t.points,n=t.gridStyle,i=e[0],o=e[e.length-1];return Mh("line",{key:"grid-".concat(t.tickValue),style:r(r({x1:i.x,y1:i.y,x2:o.x,y2:o.y},c),n)})})):null,b?g.map((function(t){var e=t.points,n=e[e.length-1];return Mh("line",{key:"tickLine-".concat(t.tickValue),style:r({x1:n.x,y1:n.y,x2:n.x+a(b),y2:n.y},M)})})):null,m[0]?Mh("marker",{style:r(r({x:u,y:s},m[0]),{symbol:m[0].type})}):null,p?Mh("line",{style:r({x1:u,y1:s,x2:u,y2:l},p)}):null,m[1]?Mh("marker",{style:r(r({x:u,y:l,transform:"rotate(180deg)",transformOrigin:"50% 50%"},m[1]),{symbol:m[1].type})}):null,d?g.map((function(t,e){var n=t.points,i=t.text,o=t.labelStyle,a=n[n.length-1];return Mh("text",{key:"text-".concat(t.tickValue),style:r(r({x:a.x+f,y:a.y,textAlign:"left",textBaseline:"middle",text:i},d),o)})})):null)},My=function(t,e){var n=t.coord,o=t.style,a=t.animation,s=e.px2hd,u=n.left,l=n.top,c=n.bottom,h=o.grid,p=o.tickLine,f=o.line,d=o.labelOffset,v=o.label,g=o.symbol,m=t.ticks.filter((function(t){return!isNaN(t.value)})),x=y(g)?g:[g],b=p||{},M=b.length,w=i(b,["length"]);return Mh("group",null,h?m.map((function(t){var e=t.points,n=t.gridStyle,i=e[0],o=e[e.length-1];return Mh("line",{key:"grid-".concat(t.tickValue),style:r(r({x1:i.x,y1:i.y,x2:o.x,y2:o.y},h),n)})})):null,M?m.map((function(t){var e=t.points[0];return Mh("line",{key:"tickLine-".concat(t.tickValue),style:r({x1:e.x,y1:e.y,x2:e.x-s(M),y2:e.y},w)})})):null,x[0]?Mh("marker",{style:r(r({x:u,y:l},x[0]),{symbol:x[0].type})}):null,f?Mh("line",{style:r({x1:u,y1:l,x2:u,y2:c},f)}):null,x[1]?Mh("marker",{style:r(r({x:u,y:c,transform:"rotate(180deg)",transformOrigin:"50% 50%"},x[1]),{symbol:x[1].type})}):null,v?m.map((function(t,e){var n=t.text,i=t.labelStyle,o=t.points[0];return Mh("text",{key:"text-".concat(t.tickValue),style:r(r({x:o.x-d,y:o.y,textAlign:"right",textBaseline:"middle",text:n},v),i),animation:a||{appear:{easing:"linear",duration:300,delay:0,property:["fillOpacity"],start:{fillOpacity:0},end:{fillOpacity:1}},update:{easing:"linear",duration:450,delay:0,property:["x","y"]},leave:{easing:"linear",duration:450,delay:0,property:["fillOpacity"],start:{fillOpacity:1},end:{fillOpacity:0}}}})})):null)};var wy=function(t){if(function(t){return t.coord.isPolar}(t))return Mh("x"===t.dimType?vy:gy,r({},t));var e=t.position;return Mh("right"===e?by:"left"===e?My:"top"===e?my:xy,r({},t))},Ey=py(wy),ky=function(t){return function(e){function i(t){var n=e.call(this,t)||this;return n._onclick=function(t){var e,i=n.props,o=i.chart,a=i.clickable,s=i.onClick;if(void 0===a||a){var u=t.currentTarget;if(u){var l=u.config["data-item"];if(l){h(s)&&s(l);var c=l.field,p=l.tickValue,f=n.state.filtered,d=r(r({},f),((e={})[p]=!f[p],e));n.setState({filtered:d}),o.filter(c,(function(t){return!d[t]}))}}}},n.state={filtered:{},items:[]},n}return n(i,e),i.prototype.getOriginItems=function(){return this.props.chart.getLegendItems()},i.prototype.getItems=function(){var t,e=this.props,n=this.state.filtered,i=(null===(t=e.items)||void 0===t?void 0:t.length)?e.items:this.getOriginItems();return i?i.map((function(t){var e=t.tickValue;return r(r({},t),{filtered:n[e]})})):null},i.prototype.setItems=function(t){this.setState({items:t})},i.prototype.getMaxItemBox=function(t){var e=0,n=0;return(t.children||[]).forEach((function(t){var r=t.layout,i=r.height;e=Math.max(e,r.width),n=Math.max(n,i)})),{width:e,height:n}},i.prototype._init=function(){var t=this.props,e=this.context,n=t.layout,r=t.width,i=t.height,o=t.position,a=void 0===o?"top":o,s=this.getItems();if(s&&s.length){var u=n.left,l=n.top,c=n.width,h=n.height,p=e.px2hd(r)||c,f=uc(this,this.render()),d=this.getMaxItemBox(f),y=d.width,v=d.height,g=Math.max(1,Math.floor(p/y)),m=Math.ceil(s.length/g),x=p/g,b=v*m,M={left:u,top:l,width:p,height:void 0,flexDirection:"row",flexWrap:"wrap",alignItems:"center",justifyContent:"flex-start"};1===m&&(M.justifyContent="space-between"),"top"===a&&(M.height=i||b),"left"===a&&(M.flexDirection="column",M.justifyContent="center",M.width=y,M.height=i||h),"right"===a&&(M.flexDirection="column",M.alignItems="flex-start",M.justifyContent="center",M.width=y,M.height=i||h,M.left=u+(p-y)),"bottom"===a&&(M.top=l+(h-b),M.height=i||b),this.itemWidth=x,this.legendStyle=M}},i.prototype.updateCoord=function(){var t=this,e=t.props,n=t.legendStyle,r=e.position,i=void 0===r?"top":r,o=e.margin,a=e.chart,s=n.width,u=n.height,l=t.context.px2hd(void 0===o?"30px":o);a.updateCoordFor(this,{position:i,width:s+l,height:u+l})},i.prototype.willMount=function(){var t=this.getItems();t&&t.length&&(this._init(),this.updateCoord())},i.prototype.didMount=function(){},i.prototype.willUpdate=function(){var t=this.getItems();t&&t.length&&this.updateCoord()},i.prototype.render=function(){var e=this,n=e.props,i=e.itemWidth,o=e.legendStyle,a=this.getItems();return a&&a.length?Mh(t,r({},n,{items:a,itemWidth:i,style:r(r({},o),n.style),onClick:this._onclick})):null},i}(an)},Sy=function(t){var e=t.items,n=t.itemWidth,i=t.itemFormatter,o=t.marker,a=void 0===o?"circle":o,s=t.itemStyle,u=t.nameStyle,l=t.valueStyle,c=t.valuePrefix,p=t.onClick,f=function(t,e){return void 0===e&&(e=": "),"".concat(e).concat(t)};return Mh("group",{style:r({display:"flex"},t.style)},e.map((function(t){var e=t.color,o=t.name,d=t.value,y=t.filtered,v=t.tickValue,g=h(i)?i(d,v):d;return Mh("group",{className:"legend-item",style:r({width:n,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",padding:["6px","6px","6px",0]},s),"data-item":t,onClick:p},function(t){var e=t.type,n=t.color;return"square"===e?Mh("rect",{style:{width:"12px",height:"12px",marginRight:"10px"},attrs:{fill:n}}):"line"===e?Mh("line",{style:{width:"19px",marginRight:"10px"},attrs:{stroke:n,lineCap:"round",lineWidth:"4px"}}):Mh("circle",{style:{width:"12px",height:"12px",marginRight:"10px",fill:n}})}({color:y?"#bfbfbf":e,type:a}),Mh("text",{attrs:r({fill:y?"#bfbfbf":"#808080",text:o},u)}),g?Mh("text",{attrs:r({fill:"#808080",text:f(g,c)},l)}):null)})))},Py=ky(Sy),Ty=function(t){return function(e){function i(t){return e.call(this,t)||this}return n(i,e),i.prototype.getGuideBBox=function(){var t=uc(this,this.render()).layout;if(t)return t},i.prototype.parseReplaceStr=function(t,e){var n={min:0,max:1,median:.5};return p(n[t])?P(t)&&-1!=t.indexOf("%")&&!isNaN(Number(t.slice(0,-1)))?Number(t.slice(0,-1))/100:e.scale(t):n[t]},i.prototype.parsePoint=function(t){var e=this.props,n=e.chart,r=e.coord,i=n.getXScales()[0],o=n.getYScales()[0],a=this.parseReplaceStr(t[i.field],i),s=this.parseReplaceStr(t[o.field],o);return r.convertPoint({x:a,y:s})},i.prototype.convertPoints=function(t){var e=this;return t.map((function(t){return e.parsePoint(t)}))},i.prototype.getGuideTheme=function(){return this.context.theme.guide},i.prototype.render=function(){var e=this.props,n=this.context,i=e.coord,o=e.records,a=e.animation,s=e.chart,u=e.style,l=e.onClick,c=n.width,p=n.height,f=this.convertPoints(void 0===o?[]:o),d=this.getGuideTheme();return Mh("group",{onClick:function(t){l&&l(t)}},Mh(t,r({points:f,theme:d,coord:i},e,{canvasWidth:c,canvasHeight:p,style:h(u)?u(f,s):u,animation:h(a)?a(f,s):a})))},i}(an)},Ny={offsetX:0,offsetY:0,points:[],src:""},Cy={offsetX:0,offsetY:0,points:[],direct:"tl",side:"8px",autoAdjust:!0},Ay={container:{fill:"#1677FF",radius:"4px",padding:["4px","8px"]},text:{fontSize:"22px",fill:"#fff"},arrow:{fill:"#1677FF"}},Oy=function(t){var e=t.content,n=t.textStyle;return Mh("rect",{style:r({display:"flex",fill:Ay.container.fill,padding:Ay.container.padding,radius:Ay.container.radius},t.background)},Mh("text",{style:r({text:e,fontSize:Ay.text.fontSize,fill:Ay.text.fill},n)}))},Ry=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.render=function(){var t=this.props,e=this.context,n=(0,e.px2hd)(r(r({},Cy),t)),i=n.points,o=n.content,a=n.offsetY,s=n.direct,u=n.side,l=n.autoAdjust,c=n.canvasWidth,h=n.canvasHeight,p=n.background,f=n.textStyle,d=i[0]||{},y=d.x,v=d.y,g=e.px2hd(n.offsetX),m=e.px2hd(a),x=y+(g||0),b=v+(m||0),M=uc(this,Mh(Oy,{content:o,background:p,textStyle:f})).layout,w=M.width,E=M.height,k=l?function(t){var e=s,n=t.x,r=t.y,i=e[0],o=e[1];"t"===i&&0>r-u-E?i="b":"b"===i&&r+u+E>h&&(i="t");var a="c"===i?u:0;return"l"===o&&0>n-a-w?o="r":"r"===o&&n+a+w>c?o="l":"c"===o&&(w/2+n+a>c?o="l":0>n-w/2-a&&(o="r")),e=i+o}(i[0]):s,S=function(t){var e=[];return"tl"===t?(e=[{x:w,y:E-1},{x:w,y:E+u},{x:w-u,y:E-1}],x-=w||0,b=b-(E||0)-u):"cl"===t?(e=[{x:w,y:E/2-u},{x:w,y:E/2+u},{x:w+u,y:E/2}],x=x-(w||0)-u,b-=E/2||0):"bl"===t?(e=[{x:w,y:-u},{x:w,y:1},{x:w-u,y:1}],x-=w||0,b+=u):"bc"===t?(e=[{x:w/2,y:-u},{x:w/2-u,y:1},{x:w/2+u,y:1}],x-=w/2||0,b+=u):"br"===t?(e=[{x:0,y:-u},{x:0,y:1},{x:+u,y:1}],b+=u):"cr"===t?(e=[{x:-u,y:E/2},{x:0,y:E/2-u},{x:0,y:E/2+u}],x+=u,b-=E/2||0):"tr"===t?(e=[{x:0,y:E+u},{x:0,y:E-1},{x:u,y:E-1}],b=b-(E||0)-u):"tc"===t&&(e=[{x:w/2,y:E+u},{x:w/2-u,y:E-1},{x:w/2+u,y:E-1}],x-=w/2||0,b=b-E-u),e}(k);return Mh("group",{style:{x:x,y:b}},Mh(Oy,{content:o,background:p,textStyle:f}),Mh("polygon",{style:{points:S.map((function(t){return[t.x,t.y]})),fill:(null==p?void 0:p.fill)||Ay.arrow.fill}}))},e}(an),Ly=1e-4,_y=function(){function t(t,e,n,r){var i=this;this.width=t,this.height=e,this.elements=n,this.context=r,this.keyframeAnimationMap=new WeakMap,this.displayObjectElementMap=new WeakMap,this.animations=[],this.isPaused=!1,this.direction=1,this.displayObjects=n.map((function(t){return i.buildHierachy(t)}))}return t.prototype.generateTransform=function(t,e,n,r,i){var o="";return 0===t&&0===e||(o+="translate(".concat(t,", ").concat(e,")")),1===n&&1===r||(o+=" scale(".concat(0===n?Ly:n,", ").concat(0===r?Ly:r,")")),0!==i&&(o+=" rotate(".concat(i,"deg)")),o},t.prototype.buildHierachy=function(t){var e,n=this,r=t.type,i=t.name,o=t.anchorX,a=void 0===o?0:o,s=t.anchorY,c=void 0===s?0:s,h=t.rotation,p=t.scaleX,f=t.scaleY,d=t.x,y=t.y,v=t.children,g=t.shape,m=t.style,x=t.keyframeAnimation,b=this.generateTransform((void 0===d?0:d)-a,(void 0===y?0:y)-c,void 0===p?1:p,void 0===f?1:f,void 0===h?0:h);if(r===sr.GROUP)e=new Ws({style:{transformOrigin:"".concat(a,"px ").concat(c,"px"),transform:b}});else if(r===sr.ELLIPSE){var M=g.rx,w=g.ry;e=new Vs({style:{cx:k=g.cx,cy:S=g.cy,rx:M,ry:w,transformOrigin:"".concat(a-k+M,"px ").concat(c-S+w,"px"),transform:b}})}else if(r===sr.PATH){var E=this.generatePathFromShape(g);e=new Hs({style:{d:E,transformOrigin:"".concat(a,"px ").concat(c,"px"),transform:b}})}else if(r===sr.RECT){var k,S;e=new Ks({style:{x:k=g.x,y:S=g.y,width:P=g.width,height:T=g.height,anchor:[.5,.5],radius:g.r,transformOrigin:"".concat(a-k+P/2,"px ").concat(c-S+T/2,"px"),transform:b}})}else if(r===sr.IMAGE){var P,T;e=new zs({style:{x:0,y:0,width:P=g.width,height:T=g.height,src:g.src,transformOrigin:"".concat(a,"px ").concat(c,"px"),transform:b}})}if(i&&(e.name=i),m&&e.attr(m),x&&this.keyframeAnimationMap.set(e,x),v){var N=v.map((function(t){return n.buildHierachy(t)}));e.append.apply(e,l([],u(N),!1))}return this.displayObjectElementMap.set(e,t),e},t.prototype.getAnimations=function(){return this.animations},t.prototype.getDuration=function(t){return void 0===t&&(t=!1),(t?this.fps():1)*(this.context.endFrame-this.context.startFrame)*this.context.frameTime/1e3},t.prototype.fps=function(){return this.context.fps},t.prototype.isSameKeyframeOptions=function(t,e){return t.delay===e.delay&&t.duration===e.duration&&t.easing===e.easing},t.prototype.isSameKeyframes=function(t,e){return t.offset===e.offset&&t.easing===e.easing},t.prototype.generatePathFromShape=function(t){var e=t.close,n=t.v,r=t.in,i=t.out,o=[];o.push(["M",n[0][0],n[0][1]]);for(var a=1;n.length>a;a++)o.push(["C",i[a-1][0],i[a-1][1],r[a][0],r[a][1],n[a][0],n[a][1]]);return e&&(o.push(["C",i[n.length-1][0],i[n.length-1][1],r[0][0],r[0][1],n[0][0],n[0][1]]),o.push(["Z"])),o},t.prototype.render=function(t){var e=this,n=new Ws;if(n.append.apply(n,l([],u(this.displayObjects),!1)),t.document)t.appendChild(n);else{if(!Os(t))throw Error("[g-lottie-player]: We should render Lottie to a mounted DisplayObject or Canvas.");if(!t.isConnected)throw Error("[g-lottie-player]: Cannot render Lottie to an unmounted DisplayObject.");t.appendChild(n)}return this.displayObjects.forEach((function(t){t.forEach((function(t){var n,r=e.keyframeAnimationMap.get(t),o=e.displayObjectElementMap.get(t);if(o&&o.clipPath){var a=o.clipPath,s=a.shape,c=a.keyframeAnimation,h=new Hs;if(t.parentElement.appendChild(h),t.style.clipPath=h,s&&(h.style.d=e.generatePathFromShape(s)),c&&c.length){var f=c[0],d=f.delay,y=f.duration,v=f.easing,g=h.animate(f.keyframes.map((function(t){var n=t.easing;return{offset:t.offset,d:Me(e.generatePathFromShape(t.shape)),easing:n}})),{delay:d,duration:y,easing:v,iterations:e.context.iterations});e.animations.push(g)}}var m=o.visibilityStartOffset,x=o.visibilityEndOffset,b=o.visibilityFrame;if(!b||r&&r.length||(r=[{duration:e.context.frameTime*b,keyframes:[{offset:0,style:{opacity:1}},{offset:1,style:{opacity:1}}]}]),r&&r.length){var M=[];r.map((function(t){var n=t.delay,r=void 0===n?0:n,i=t.duration,o=t.easing,a=t.keyframes.map((function(t){return ui(t)})),s=ui({delay:r,duration:i,easing:o,iterations:e.context.iterations,fill:e.context.fill});M.push([a,s])}));for(var w=[M[0]],E=function(t){var n=u(M[t],2),r=n[0],o=n[1],a=w.find((function(t){var n=u(t,2);return n[0].length===r.length&&e.isSameKeyframeOptions(o,n[1])}));a?r.forEach((function(t){var n=a[0].find((function(n){return e.isSameKeyframes(t,n)}));if(n){var r=i(t,["offset","easing"]);Object.assign(n,r)}else a[0].push(t)})):w.push(M[t])},k=1;M.length>k;k++)E(k);(n=e.animations).push.apply(n,l([],u(w.map((function(n){var r=u(n,2),i=r[1],o=e.formatKeyframes(r[0],t);if(o.length){var a=t.animate(o,i);return p(m)||p(x)||(t.style.visibility="hidden",a.onframe=function(){var e=a.effect.getComputedTiming().progress;t.style.visibility=e>=m&&x>e?"visible":"hidden"}),e.context.autoplay||a.pause(),a}})).filter((function(t){return!!t}))),!1))}}))})),n},t.prototype.formatKeyframes=function(t,e){return t.forEach((function(t){t.transform=e.style.transform||"","scaleX"in t&&(t.transform=(t.transform||"")+" scaleX(".concat(0===t.scaleX?Ly:t.scaleX,")"),delete t.scaleX),"scaleY"in t&&(t.transform=(t.transform||"")+" scaleY(".concat(0===t.scaleY?Ly:t.scaleY,")"),delete t.scaleY),"rotation"in t&&(t.transform=(t.transform||"")+" rotate(".concat(t.rotation,"deg)"),delete t.rotation),"x"in t&&(t.transform=(t.transform||"")+" translateX(".concat(t.x,"px)"),delete t.x),"y"in t&&(t.transform=(t.transform||"")+" translateY(".concat(t.y,"px)"),delete t.y),"style"in t&&(Object.keys(t.style).forEach((function(e){t[e]=t.style[e]})),delete t.style)})),(t=t.filter((function(t){var e=t.offset,n=i(t,["ignore","easing","offset"]);return e>=0&&Object.keys(n).length>0}))).length&&1!==t[t.length-1].offset&&t.push(r(r({},t[t.length-1]),{offset:1})),t.sort((function(t,e){return t.offset-e.offset})),t.forEach((function(t){Object.keys(t).forEach((function(e){""===t[e]&&delete t[e]}))})),t},t.prototype.destroy=function(){this.displayObjects.forEach((function(t){t.destroy()}))},t.prototype.size=function(t){return{width:this.width,height:this.height}},t.prototype.version=function(){return this.context.version},t.prototype.play=function(){this.isPaused=!1,this.animations.forEach((function(t){t.play()}))},t.prototype.playSegments=function(t){var e=this,n=u(t,2),r=n[0],i=n[1];this.isPaused=!1,this.animations.forEach((function(t){t.currentTime=r/e.fps()*1e3;var n=t.onframe;t.onframe=function(r){n&&n(r),t.currentTime<i/e.fps()*1e3||(t.finish(),t.onframe=n||null)},t.play()}))},t.prototype.pause=function(){this.isPaused=!0,this.animations.forEach((function(t){t.pause()}))},t.prototype.togglePause=function(){this.isPaused?this.play():this.pause()},t.prototype.goTo=function(t,e){var n=this;void 0===e&&(e=!1),this.animations.forEach(e?function(e){e.currentTime=t/n.fps()*1e3}:function(e){e.currentTime=1e3*t})},t.prototype.stop=function(){this.animations.forEach((function(t){t.finish()}))},t.prototype.setSpeed=function(t){var e=this;this.animations.forEach((function(n){n.playbackRate=t*e.direction}))},t.prototype.setDirection=function(t){this.direction=t,this.animations.forEach((function(e){e.playbackRate*=t}))},t}();function Iy(t,e){var n,r,i,o,a,s,u=t.length;for(r=0;u>r;r+=1)if("ks"in(n=t[r])&&!n.completed){if(n.completed=!0,n.tt&&(t[r-1].td=n.tt),n.hasMask){var l=n.masksProperties;for(o=l.length,i=0;o>i;i+=1)if(l[i].pt.k.i)By(l[i].pt.k);else for(s=l[i].pt.k.length,a=0;s>a;a+=1)l[i].pt.k[a].s&&By(l[i].pt.k[a].s[0]),l[i].pt.k[a].e&&By(l[i].pt.k[a].e[0])}0===n.ty?(n.layers=Dy(n.refId,e),Iy(n.layers,e)):4===n.ty?Fy(n.shapes):5===n.ty&&fv(n)}}function Dy(t,e){var n=function(t,e){for(var n=0,r=e.length;r>n;){if(e[n].id===t)return e[n];n+=1}return null}(t,e);return n?n.layers.__used?JSON.parse(JSON.stringify(n.layers)):(n.layers.__used=!0,n.layers):null}function Fy(t){var e,n,r;for(e=t.length-1;e>=0;e-=1)if("sh"===t[e].ty)if(t[e].ks.k.i)By(t[e].ks.k);else for(r=t[e].ks.k.length,n=0;r>n;n+=1)t[e].ks.k[n].s&&By(t[e].ks.k[n].s[0]),t[e].ks.k[n].e&&By(t[e].ks.k[n].e[0]);else"gr"===t[e].ty&&Fy(t[e].it)}function By(t){var e,n=t.i.length;for(e=0;n>e;e+=1)t.i[e][0]+=t.v[e][0],t.i[e][1]+=t.v[e][1],t.o[e][0]+=t.v[e][0],t.o[e][1]+=t.v[e][1]}function jy(t,e){var n=e?e.split("."):[100,100,100];return t[0]>n[0]||t[0]>=n[0]&&(t[1]>n[1]||t[1]>=n[1]&&(t[2]>n[2]||t[2]>=n[2]&&null))}var Gy,Yy,Vy,Wy,Xy,zy,Uy,Hy,qy,Zy,Ky,$y,Jy,Qy,tv,ev,nv,rv,iv,ov,av,sv=function(){var t=[4,4,14];function e(t){var e,n,r=t.length;for(e=0;r>e;e+=1)5===t[e].ty&&((n=t[e]).t.d={k:[{s:n.t.d,t:0}]})}return function(n){if(jy(t,n.v)&&(e(n.layers),n.assets)){var r=void 0,i=n.assets.length;for(r=0;i>r;r+=1)n.assets[r].layers&&e(n.assets[r].layers)}}}(),uv=(Gy=[4,7,99],function(t){if(t.chars&&!jy(Gy,t.v)){var e=void 0,n=t.chars.length;for(e=0;n>e;e+=1){var r=t.chars[e];r.data&&r.data.shapes&&(Fy(r.data.shapes),r.data.ip=0,r.data.op=99999,r.data.st=0,r.data.sr=1,r.data.ks={p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0}},t.chars[e].t||(r.data.shapes.push({ty:"no"}),r.data.shapes[0].it.push({p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0},sk:{k:0,a:0},sa:{k:0,a:0},ty:"tr"})))}}}),lv=function(){var t=[5,7,15];function e(t){var e,n,r=t.length;for(e=0;r>e;e+=1)5===t[e].ty&&(n=void 0,"number"==typeof(n=t[e].t.p).a&&(n.a={a:0,k:n.a}),"number"==typeof n.p&&(n.p={a:0,k:n.p}),"number"==typeof n.r&&(n.r={a:0,k:n.r}))}return function(n){if(jy(t,n.v)&&(e(n.layers),n.assets)){var r=void 0,i=n.assets.length;for(r=0;i>r;r+=1)n.assets[r].layers&&e(n.assets[r].layers)}}}(),cv=function(){var t=[4,1,9];function e(t){var n,r,i,o=t.length;for(n=0;o>n;n+=1)if("gr"===t[n].ty)e(t[n].it);else if("fl"===t[n].ty||"st"===t[n].ty)if(t[n].c.k&&t[n].c.k[0].i)for(i=t[n].c.k.length,r=0;i>r;r+=1)t[n].c.k[r].s&&(t[n].c.k[r].s[0]/=255,t[n].c.k[r].s[1]/=255,t[n].c.k[r].s[2]/=255,t[n].c.k[r].s[3]/=255),t[n].c.k[r].e&&(t[n].c.k[r].e[0]/=255,t[n].c.k[r].e[1]/=255,t[n].c.k[r].e[2]/=255,t[n].c.k[r].e[3]/=255);else t[n].c.k[0]/=255,t[n].c.k[1]/=255,t[n].c.k[2]/=255,t[n].c.k[3]/=255}function n(t){var n,r=t.length;for(n=0;r>n;n+=1)4===t[n].ty&&e(t[n].shapes)}return function(e){if(jy(t,e.v)&&(n(e.layers),e.assets)){var r=void 0,i=e.assets.length;for(r=0;i>r;r+=1)e.assets[r].layers&&n(e.assets[r].layers)}}}(),hv=function(){var t=[4,4,18];function e(t){var n,r,i;for(n=t.length-1;n>=0;n-=1)if("sh"===t[n].ty)if(t[n].ks.k.i)t[n].ks.k.c=t[n].closed;else for(i=t[n].ks.k.length,r=0;i>r;r+=1)t[n].ks.k[r].s&&(t[n].ks.k[r].s[0].c=t[n].closed),t[n].ks.k[r].e&&(t[n].ks.k[r].e[0].c=t[n].closed);else"gr"===t[n].ty&&e(t[n].it)}function n(t){var n,r,i,o,a,s,u=t.length;for(r=0;u>r;r+=1){if((n=t[r]).hasMask){var l=n.masksProperties;for(o=l.length,i=0;o>i;i+=1)if(l[i].pt.k.i)l[i].pt.k.c=l[i].cl;else for(s=l[i].pt.k.length,a=0;s>a;a+=1)l[i].pt.k[a].s&&(l[i].pt.k[a].s[0].c=l[i].cl),l[i].pt.k[a].e&&(l[i].pt.k[a].e[0].c=l[i].cl)}4===n.ty&&e(n.shapes)}}return function(e){if(jy(t,e.v)&&(n(e.layers),e.assets)){var r=void 0,i=e.assets.length;for(r=0;i>r;r+=1)e.assets[r].layers&&n(e.assets[r].layers)}}}();function pv(t){t.__complete||(cv(t),sv(t),uv(t),lv(t),hv(t),Iy(t.layers,t.assets),function(t,e){if(t){var n=0,r=t.length;for(n=0;r>n;n+=1)1===t[n].t&&(t[n].data.layers=Dy(t[n].data.refId,e),Iy(t[n].data.layers,e))}}(t.chars,t.assets),t.__complete=!0)}function fv(t){}!function(t){t[t.Normal=0]="Normal",t[t.Multiply=1]="Multiply",t[t.Screen=2]="Screen",t[t.Overlay=3]="Overlay",t[t.Darken=4]="Darken",t[t.Lighten=5]="Lighten",t[t.ColorDodge=6]="ColorDodge",t[t.ColorBurn=7]="ColorBurn",t[t.HardLight=8]="HardLight",t[t.SoftLight=9]="SoftLight",t[t.Difference=10]="Difference",t[t.Exclusion=11]="Exclusion",t[t.Hue=12]="Hue",t[t.Saturation=13]="Saturation",t[t.Color=14]="Color",t[t.Luminosity=15]="Luminosity",t[t.Add=16]="Add",t[t.HardMix=17]="HardMix"}(Yy||(Yy={})),function(t){t[t.Normal=0]="Normal",t[t.Alpha=1]="Alpha",t[t.InvertedAlpha=2]="InvertedAlpha",t[t.Luma=3]="Luma",t[t.InvertedLuma=4]="InvertedLuma"}(Vy||(Vy={})),function(t){t[t.Off=0]="Off",t[t.On=1]="On"}(Wy||(Wy={})),function(t){t[t.Off=0]="Off",t[t.On=1]="On"}(Xy||(Xy={})),function(t){t[t.Number=0]="Number",t[t.Color=2]="Color",t[t.MultiDimensional=3]="MultiDimensional",t[t.Boolean=7]="Boolean"}(zy||(zy={})),function(t){t[t.Transform=5]="Transform",t[t.DropShadow=25]="DropShadow"}(Uy||(Uy={})),function(t){t.No="n",t.Add="a",t.Subtract="s",t.Intersect="i",t.Lighten="l",t.Darken="d",t.Difference="f"}(Hy||(Hy={})),function(t){t[t.precomp=0]="precomp",t[t.solid=1]="solid",t[t.image=2]="image",t[t.null=3]="null",t[t.shape=4]="shape",t[t.text=5]="text",t[t.audio=6]="audio",t[t.pholderVideo=7]="pholderVideo",t[t.imageSeq=8]="imageSeq",t[t.video=9]="video",t[t.pholderStill=10]="pholderStill",t[t.guide=11]="guide",t[t.adjustment=12]="adjustment",t[t.camera=13]="camera",t[t.light=14]="light",t[t.data=15]="data"}(qy||(qy={})),function(t){t[t.Left=0]="Left",t[t.Right=1]="Right",t[t.Center=2]="Center"}(Zy||(Zy={})),function(t){t[t.Top=0]="Top",t[t.Center=1]="Center",t[t.Bottom=2]="Bottom"}(Ky||(Ky={})),function(t){t[t.Characters=1]="Characters",t[t.CharactersExcludingSpaces=2]="CharactersExcludingSpaces",t[t.Words=3]="Words",t[t.Lines=4]="Lines"}($y||($y={})),function(t){t[t.Square=1]="Square",t[t.RampUp=2]="RampUp",t[t.RampDown=3]="RampDown",t[t.Triangle=4]="Triangle",t[t.Round=5]="Round",t[t.Smooth=6]="Smooth"}(Jy||(Jy={})),function(t){t[t.Percentage=1]="Percentage",t[t.Index=2]="Index"}(Qy||(Qy={})),function(t){t[t.Add=1]="Add",t[t.Subtract=2]="Subtract",t[t.Intersect=3]="Intersect",t[t.Min=4]="Min",t[t.Max=5]="Max",t[t.Difference=6]="Difference"}(tv||(tv={})),function(t){t.Rectangle="rc",t.Ellipse="el",t.PolyStar="sr",t.Path="sh",t.Fill="fl",t.Stroke="st",t.GradientFill="gf",t.GradientStroke="gs",t.NoStyle="no",t.Group="gr",t.Transform="tr",t.Repeater="rp",t.Trim="tm",t.RoundedCorners="rd",t.PuckerOrBloat="pb",t.Merge="mm",t.Twist="tw",t.OffsetPath="op",t.ZigZag="zz"}(ev||(ev={})),function(t){t[t.NonZero=1]="NonZero",t[t.EvenOdd=2]="EvenOdd"}(nv||(nv={})),function(t){t[t.Miter=1]="Miter",t[t.Round=2]="Round",t[t.Bevel=3]="Bevel"}(rv||(rv={})),function(t){t[t.Butt=1]="Butt",t[t.Round=2]="Round",t[t.Square=3]="Square"}(iv||(iv={})),function(t){t[t.Linear=1]="Linear",t[t.Radial=2]="Radial"}(ov||(ov={})),function(t){t[t.CssUrl=1]="CssUrl",t[t.ScriptUrl=2]="ScriptUrl",t[t.FontUrl=3]="FontUrl"}(av||(av={}));var dv=function(){this.frameTime=1e3/30,this.startFrame=0,this.autoplay=!1,this.fill="auto",this.iterations=0,this.assetsMap=new Map};function yv(t){return Array.isArray(t)&&"number"==typeof t[0]}function vv(t){return yv(null==t?void 0:t.k)}function gv(t){var e=null==t?void 0:t.k;return Array.isArray(e)&&void 0!==e[0].t&&yv(e[0].s)}function mv(t){var e=xv(t,3);return"rgba(".concat([Math.round(255*xv(t,0)),Math.round(255*xv(t,1)),Math.round(255*xv(t,2)),p(e)?1:e].join(","),")")}function xv(t,e){return null!=t?"number"==typeof t?t:t[e||0]:NaN}function bv(t,e,n){var r,i,o,a,s=[];if(s.push((null===(r=t.o)||void 0===r?void 0:r.x)&&(xv(t.o.x,n)||xv(t.o.x,0))||0,(null===(i=t.o)||void 0===i?void 0:i.y)&&(xv(t.o.y,n)||xv(t.o.y,0))||0,(null===(o=t.i)||void 0===o?void 0:o.x)&&(xv(t.i.x,n)||xv(t.i.x,0))||1,(null===(a=t.i)||void 0===a?void 0:a.y)&&(xv(t.i.y,n)||xv(t.i.y,0))||1),0!==s[0]||0!==s[1]||1!==s[2]||1!==s[3])return"cubic-bezier(".concat(s.join(","),")")}function Mv(t,e,n,r){for(var i,o=t.length,a=n.endFrame-n.startFrame,s={duration:0,delay:0,keyframes:[]},u=0;o>u;u++){var l=t[u],c=t[u+1],h=1===l.h,p={offset:(l.t+n.layerOffsetTime-n.startFrame)/a};h||(p.easing=bv(l,0,e));var f=l.s||(null==i?void 0:i.e);if(f&&r(p,f),p.offset>0&&0===u){var d={offset:0};f&&r(d,f),s.keyframes.push(d)}if(s.keyframes.push(p),h&&c){var y={offset:Math.max((c.t+n.layerOffsetTime-n.startFrame)/a,0)};r(y,f),s.keyframes.push(y)}i=l}return o&&(s.duration=n.frameTime*a),s}function wv(t,e,n,r,i,o){for(var a=function(a){var s=n[a],u=Mv(t,a,i,(function(t,n){var r=xv(n,a);o&&(r=o(r)),(e?t[e]={}:t)[s]=r}));if(t.some((function(t){return t.ti&&t.to}))){var l=[];t.forEach((function(t,e){u.keyframes[e].offsetPath=l,t.ti&&t.to&&(0===e&&l.push(["M",t.s[0],t.s[1]]),u.keyframes[e].segmentLength=en(l),l.push(["C",t.s[0]+t.to[0],t.s[1]+t.to[1],t.s[0]+t.ti[0],t.s[1]+t.ti[1],t.e[0],t.e[1]]))}));var c=en(l);u.keyframes.forEach((function(t){t.offsetDistance=p(t.segmentLength)?1:t.segmentLength/c,delete t.segmentLength}))}u.keyframes.length&&r.push(u)},s=0;n.length>s;s++)a(s)}function Ev(t,e,n,r,i){var o=Mv(t,0,i,(function(t,r){(e?t[e]={}:t)[n]=mv(r)}));o.keyframes.length&&r.push(o)}function kv(t,e,n,r,i,o,a){n&&(e[n]=e[n]||{});var s=n?e[n]:e;if(function(t){return"number"==typeof(null==t?void 0:t.k)}(t)){var u=t.k;s[r[0]]=a?a(u):u}else if(function(t){var e=null==t?void 0:t.k;return Array.isArray(e)&&void 0!==e[0].t&&"number"==typeof e[0].s}(t))wv(t.k,n,r,i,o,a);else if(vv(t))for(var l=0;r.length>l;l++){u=xv(t.k,l);s[r[l]]=a?a(u):u}else gv(t)&&wv(t.k,n,r,i,o,a)}function Sv(t,e,n,r,i,o){void 0===i&&(i=""),void 0===o&&(o={x:"x",y:"y",rotation:"rotation",scaleX:"scaleX",scaleY:"scaleY",anchorX:"anchorX",anchorY:"anchorY",skew:"skew",skewAxis:"skewAxis"}),t.p.s?(kv(t.p.x,e,i,[o.x],n,r),kv(t.p.y,e,i,[o.y],n,r)):kv(t.p,e,i,[o.x,o.y],n,r),kv(t.s,e,i,[o.scaleX,o.scaleY],n,r,(function(t){return t/100})),kv(t.r,e,i,[o.rotation],n,r),kv(t.a,e,i,[o.anchorX,o.anchorY],n,r),kv(t.sk,e,i,[o.skew],n,r),kv(t.sa,e,i,[o.skewAxis],n,r)}function Pv(t){return t.g&&t.s&&t.e}function Tv(t){return"".concat(t.map((function(t){var e=t.offset;return"".concat(t.color," ").concat(100*e,"%")})).join(", "))}function Nv(t){var e=function(t,e){for(var n=[],r=0;4*e>r;){var i=t[r++],o=Math.round(255*t[r++]),a=Math.round(255*t[r++]),s=Math.round(255*t[r++]);n.push({offset:i,color:"rgb(".concat(o,", ").concat(a,", ").concat(s,")")})}return n}(t.g.k.k,t.g.p);if(t.t===ov.Linear){var n=xr(Math.atan2(t.e.k[1]-t.s.k[1],t.e.k[0]-t.s.k[0]));return"linear-gradient(".concat(n,"deg, ").concat(Tv(e),")")}if(t.t===ov.Radial){var r=ze(t.e.k,t.s.k);return"radial-gradient(circle ".concat(r,"px at ").concat(t.s.k[0],"px ").concat(t.s.k[1],"px, ").concat(Tv(e),")")}return"#000"}function Cv(t,e,n){var r,i={type:sr.PATH,style:{fill:"none",stroke:"none"}};if((r=t.ks.k)&&r.i&&r.o&&r.v)i.shape={in:t.ks.k.i,out:t.ks.k.o,v:t.ks.k.v,close:t.ks.k.c};else if(Array.isArray(t.ks.k)){var o=Mv(t.ks.k,0,n,(function(t,e){t.shape={in:e[0].i,out:e[0].o,v:e[0].v,close:e[0].c}}));o.keyframes.length&&e.push(o)}return i}function Av(t,e){var n={type:sr.IMAGE,style:{},shape:{width:0,height:0,src:""}},r=e.assetsMap.get(t.refId);return r&&(n.shape.width=r.w,n.shape.height=r.h,n.shape.src=r.p),n}function Ov(t,e){function n(t,n){var r;switch(t.ty){case ev.Path:r=Cv(t,n,e);break;case ev.Ellipse:r=function(t,e,n){var r={type:sr.ELLIPSE,style:{fill:"none",stroke:"none"},shape:{}};return kv(t.p,r,"shape",["cx","cy"],e,n),kv(t.s,r,"shape",["rx","ry"],e,n,(function(t){return t/2})),r}(t,n,e);break;case ev.Rectangle:r=function(t,e,n){var r={type:sr.RECT,style:{fill:"none",stroke:"none"},shape:{}};return kv(t.p,r,"shape",["x","y"],e,n),kv(t.s,r,"shape",["width","height"],e,n),kv(t.r,r,"shape",["r"],e,n),r}(t,n,e)}return r}return{type:sr.GROUP,children:function t(i,o){var a=[],s={},c=[];return function(t,n){t.forEach((function(t){if(!t.hd)switch(t.ty){case ev.Repeater:kv(t.c,n.attrs,"shape",["repeat"],n.keyframeAnimations,e),Sv(t.tr,n.attrs,n.keyframeAnimations,e,"shape",{x:"repeatX",y:"repeatY",rotation:"repeatRot",scaleX:"repeatScaleX",scaleY:"repeatScaleY",anchorX:"repeatAnchorX",anchorY:"repeatAnchorY",skew:"repeatSkew",skewAxis:"repeatSkewAxis"});break;case ev.Trim:kv(t.s,n.attrs,"shape",["trimStart"],n.keyframeAnimations,e),kv(t.e,n.attrs,"shape",["trimEnd"],n.keyframeAnimations,e)}}))}(i=i.slice().reverse(),o),i.forEach((function(r){if(!r.hd){var i;switch(r.ty){case ev.Group:i={type:sr.GROUP,children:t(r.it,o)};break;case ev.Fill:case ev.GradientFill:!function(t,e,n,r){e.style=e.style||{},Pv(t)?e.style.fill=Nv(t):vv(t.c)?e.style.fill=mv(t.c.k):gv(t.c)&&Ev(t.c.k,"style","fill",n,r),e.style.fillRule=t.r===nv.EvenOdd?"evenodd":"nonzero",kv(t.o,e,"style",["fillOpacity"],n,r,(function(t){return t/100}))}(r,s,c,e);break;case ev.Stroke:case ev.GradientStroke:!function(t,e,n,r){switch(e.style=e.style||{},Pv(t)?e.style.stroke=Nv(t):vv(t.c)?e.style.stroke=mv(t.c.k):gv(t.c)&&Ev(t.c.k,"style","stroke",n,r),kv(t.o,e,"style",["strokeOpacity"],n,r,(function(t){return t/100})),kv(t.w,e,"style",["lineWidth"],n,r),t.lj){case rv.Bevel:e.style.lineJoin="bevel";break;case rv.Round:e.style.lineJoin="round";break;case rv.Miter:e.style.lineJoin="miter"}switch(t.lc){case iv.Butt:e.style.lineCap="butt";break;case iv.Round:e.style.lineCap="round";break;case iv.Square:e.style.lineCap="square"}var i=[],o=0;t.d&&(t.d.forEach((function(t){"o"!==t.n?i.push(t.v.k):o=t.v.k})),e.style.lineDash=i,e.style.lineDashOffset=o)}(r,s,c,e);break;case ev.Transform:Sv(r,s,c,e);break;default:i=n(r,c)}i&&(i.name=r.nm,a.push(i))}})),a.forEach((function(t,e){t=r(r(r({},t),ui(o.attrs)),s),(c.length||o.keyframeAnimations.length)&&(t.keyframeAnimation=l(l([],u(o.keyframeAnimations),!1),u(c),!1)),a[e]=t})),a}(t.shapes,{attrs:{},keyframeAnimations:[]})}}function Rv(t,e){var n;e(t),t.type===sr.GROUP&&(null===(n=t.children)||void 0===n||n.forEach((function(t){Rv(t,e)})))}function Lv(t,e,n){var r,i,o={},a=[];(null===(r=t.ks)||void 0===r?void 0:r.o)&&(kv(t.ks.o,o,"style",["opacity"],a,n,(function(t){return t/100})),((null===(i=o.style)||void 0===i?void 0:i.opacity)||a.length)&&Rv(e,(function(t){t.type!==sr.GROUP&&t.style&&(Object.assign(t.style,o.style),a.length&&(t.keyframeAnimation=(t.keyframeAnimation||[]).concat(a)))})))}function _v(t,e,n){var i=[];t=t.slice().reverse();var o=new Map,a=(null==n?void 0:n.st)||0;return null==t||t.forEach((function(t){var n,s,u,l=a+t.ip,c=a+t.op,h=a+t.st;switch(e.layerOffsetTime=a,t.ty){case qy.shape:u=Ov(t,e);break;case qy.null:u={type:sr.GROUP,children:[]};break;case qy.solid:u={type:sr.GROUP,children:[]},t.sc&&u.children.push(function(t){return{type:sr.RECT,shape:{x:0,y:0,width:t.sw,height:t.sh},style:{fill:t.sc}}}(t));break;case qy.precomp:u={type:sr.GROUP,children:_v((null===(n=e.assetsMap.get(t.refId))||void 0===n?void 0:n.layers)||[],e,{st:h})};break;case qy.text:break;case qy.image:u=u={type:sr.GROUP,children:[Av(t,e)]}}if(u){var p=[],f={name:t.nm};if(t.ks&&Sv(t.ks,f,p,e),Object.assign(u,f),null!=t.ind&&o.set(t.ind,u),u.extra={layerParent:t.parent},t.hasMask&&(null===(s=t.masksProperties)||void 0===s?void 0:s.length)){var d=[],y=Cv({ks:t.masksProperties[0].pt},d,e);u.clipPath=r({type:sr.PATH},y),d.length&&(u.clipPath.keyframeAnimation=d)}if(Lv(t,u,e),null!=l&&null!=c&&(l>e.startFrame||e.endFrame>c)){var v=e.endFrame-e.startFrame,g=(c-e.startFrame)/v;u.visibilityStartOffset=(l-e.startFrame)/v,u.visibilityEndOffset=g,u.visibilityFrame=v}p.length&&(u.keyframeAnimation=p),i.push(u)}})),i.filter((function(t){var e,n,r=o.get(null===(e=t.extra)||void 0===e?void 0:e.layerParent);return!r||(null===(n=r.children)||void 0===n||n.push(t),!1)}))}var Iv={loop:!0,autoplay:!1,fill:"both"};function Dv(t,e){var n=function(t,e){var n;pv(t);var i=r(r({},Iv),e),o=i.loop,a=i.autoplay,s=i.fill,u=new dv;u.fps=t.fr||30,u.frameTime=1e3/u.fps,u.startFrame=t.ip,u.endFrame=t.op,u.version=t.v,u.autoplay=!!a,u.fill=s,u.iterations=_(o)?o:o?1/0:1,null===(n=t.assets)||void 0===n||n.forEach((function(t){u.assetsMap.set(t.id,t)}));var l=_v(t.layers||[],u);return{width:t.w,height:t.h,elements:l,context:u}}(t,e);return new _y(n.width,n.height,n.elements,n.context)}var Fv=function(t){function e(e){var n=t.call(this,e)||this;return n.addLottie=function(){var t=n.props,e=t.data,r=t.options,i=t.play;e&&n.context.canvas.ready.then((function(){if(n.animation=n.animation?n.animation:Dv(e,r),n.animation.render(n.ref.current),n.size=n.animation.size(),n.updateSize(),i){var t=i.speed,o=void 0===t?1:t,a=i.start,s=void 0===a?0:a,u=i.end,l=void 0===u?n.animation.getDuration(!0):u;n.animation.setSpeed(o),n.animation.playSegments([s,l])}}))},n.updateSize=function(){var t=n.size,e=t.width,r=t.height,i=n.props.style;if(i){var o=i.width,a=void 0===o?e:o,s=i.height,u=void 0===s?r:s;n.ref.current.scale(a/e,u/r),n.size={width:a,height:u}}},n.ref={current:null},n}return n(e,t),e.prototype.didMount=function(){this.addLottie()},e.prototype.willUpdate=function(){this.addLottie()},e.prototype.render=function(){var t=this.props;return Mh("group",{ref:this.ref,style:t.style,animation:t.animation})},e}(an),Bv={offsetX:0,offsetY:0,points:[],data:"",animation:null,options:{loop:!0,autoplay:!0}},jv=Ty((function(t,e){var n=t.theme,i=Z(r({},(void 0===n?{}:n).text),t),o=i.style,a=i.offsetY,s=i.content,u=i.animation,l=i.points[0]||{},c=l.y,h=l.x+(e.px2hd(i.offsetX)||0),p=c+(e.px2hd(a)||0);return Mh("text",{attrs:r({text:"".concat(s),x:h,y:p},o),animation:Z({update:{easing:"linear",duration:450,property:["x","y"]}},u)})})),Gv=Ty((function(t,e){var n=Z(r({},t.theme.point),t),i=n.style,o=n.offsetY,a=n.animation,s=n.points[0]||{},u=s.x,l=s.y,c=e.px2hd(n.offsetX),h=e.px2hd(o);return Mh("group",null,Mh("circle",{style:r({cx:u+(c||0),cy:l+(h||0)},i),animation:a}))})),Yv=Ty((function(t,e){var n=t.theme,i=Z(r({},(void 0===n?{}:n).line),t),o=i.points,a=i.style,s=i.offsetY,u=i.animation,l=o[0]||{},c=l.x,h=l.y,p=o[1]||{},f=p.x,d=p.y,v=e.px2hd(i.offsetX),g=e.px2hd(s),m=c+(y(v)?v[0]||0:v||0),x=h+(y(g)?g[0]||0:g||0),b=f+(y(v)?v[1]||0:v||0),M=d+(y(g)?g[1]||0:g||0);return Mh("group",null,Mh("line",{style:r({x1:m,y1:x,x2:b,y2:M},a),animation:u}))})),Vv=Ty((function(t){var e=t.theme,n=Z(r({},(void 0===e?{}:e).line),t),i=n.points,o=n.style,a=n.animation,s=i[0]||{},u=i[1]||{},l=n.coord.center,c=Math.sqrt((s.x-l.x)*(s.x-l.x)+(s.y-l.y)*(s.y-l.y)),h=Math.atan2(s.y-l.y,s.x-l.x),p=Math.atan2(u.y-l.y,u.x-l.x);return Mh("group",null,Mh("arc",{style:r({cx:l.x,cy:l.y,r:c,startAngle:"".concat(h,"rad"),endAngle:"".concat(p,"rad")},o),animation:a}))})),Wv=Ty((function(t){var e=t.theme,n=Z(r({},(void 0===e?{}:e).rect),t),i=n.points,o=n.style,a=n.animation,s=i[0]||{},u=i[1]||{};return Mh("group",null,Mh("rect",{style:r({x:Math.min(s.x,u.x),y:Math.min(s.y,u.y),width:Math.abs(u.x-s.x),height:Math.abs(s.y-u.y)},o),animation:a}))})),Xv=Ty((function(t,e){var n=Z({},Ny,t),i=n.style,o=n.attrs,a=n.offsetX,s=n.offsetY,u=n.src,l=n.animation,c=n.points[0]||{},h=c.x,p=c.y,f=r(r({},o),i),d=f.height,y=f.width,v=void 0===y?0:y,g=e.px2hd((void 0===d?0:d)+"px"),m=e.px2hd(v+"px"),x=h+(e.px2hd(a)||0)-m/2,b=p+(e.px2hd(s)||0)-g/2;return Mh("group",null,Mh("image",{style:r(r(r({},o),i),{height:g,width:m,x:x,y:b,src:u}),animation:Z({update:{easing:"linear",duration:450,property:["x","y"]}},l)}))})),zv=Ty(Ry),Uv=Ty((function(t,e){var n=Z({},Bv,t),r=n.style,i=n.offsetY,o=n.lottieJson,a=n.animation,s=n.options,u=n.points[0]||{},l=u.x,c=u.y,h=r.height,p=void 0===h?0:h,f=r.width,d=void 0===f?0:f,y=e.px2hd(n.offsetX),v=e.px2hd(i);return Mh(Fv,{data:o,options:s,style:{x:l+(y||0)-d/2,y:c+(v||0)-p/2,width:d,height:p},animation:Z({update:{easing:"linear",duration:450,property:["x","y"]}},a)})})),Hv=Ty((function(){return null})),qv=function(t){return function(e){function i(t){var n=e.call(this,t)||this;return n._triggerOn=function(t){n.show({x:t.x,y:t.y},t)},n._triggerOff=function(){var t=n.props.alwaysShow;void 0!==t&&t||n.hide()},n.state={records:null},n}return n(i,e),i.prototype.updateCoord=function(){var t=this.props,e=t.padding;t.chart.updateCoordFor(this,{position:"top",width:0,height:this.context.px2hd(void 0===e?"10px":e)})},i.prototype.willMount=function(){this.updateCoord()},i.prototype.didMount=function(){this._initShow(),this._initEvent()},i.prototype._initEvent=function(){var t=this.props,e=t.chart,n=t.triggerOn,r=t.triggerOff,i=void 0===r?"pressend":r;e.on(void 0===n?"press":n,this._triggerOn),e.on(i,this._triggerOff)},i.prototype.willReceiveProps=function(t){var e=t.defaultItem,n=t.coord,r=this.props,i=r.coord;Yu(e,r.defaultItem)&&Yu(n,i)||this._showByData(e)},i.prototype._initShow=function(){this._showByData(this.props.defaultItem)},i.prototype._showByData=function(t){var e=this;if(t){var n=this.props.chart;setTimeout((function(){var r=n.getRecords(t,"xfield");e.showSnapRecords(r)}),0)}},i.prototype.show=function(t,e){var n=this.props.chart.getSnapRecords(t,!0);n&&n.length&&this.showSnapRecords(n)},i.prototype.showSnapRecords=function(t){var e=this.props,n=e.chart,i=e.onChange,o=n.getLegendItems(),a=t[0],s=a.yField,u=n.getScale(a.xField),l=n.getScale(s),c=t.map((function(t){var e=t.origin,n=t.xField,i=t.yField,a=y(e[i])?e[i].map((function(t){return l.getText(t)})):l.getText(e[i]),s=l.alias;if(!s&&(s=u.getText(e[n]),o&&o.length)){var c=M(o,(function(t){return e[t.field]===t.tickValue}));c&&c.name&&(s=c.name)}return r(r({},t),{name:s,value:"".concat(a)})}));y(c)&&c.length&&(this.setState({records:c}),h(i)&&i(c))},i.prototype.hide=function(){this.setState({records:null})},i.prototype.render=function(){var e=this.props;if(!1===e.visible)return null;var n=this.state.records;return n&&n.length&&Mh(t,r({},e,{records:n}))},i}(an)},Zv={showTitle:!1,showCrosshairs:!1,crosshairsType:"y",crosshairsStyle:{stroke:"rgba(0, 0, 0, 0.25)",lineWidth:"2px"},showTooltipMarker:!1,markerBackgroundStyle:{fill:"#CCD6EC",opacity:.3,padding:"6px"},tooltipMarkerStyle:{fill:"#fff",lineWidth:"3px"},background:{radius:"4px",fill:"rgba(0, 0, 0, 0.65)",padding:["6px","10px"]},titleStyle:{fontSize:"24px",fill:"#fff",textAlign:"start",textBaseline:"top"},nameStyle:{fontSize:"24px",fill:"rgba(255, 255, 255, 0.65)",textAlign:"start",textBaseline:"middle"},valueStyle:{fontSize:"24px",fill:"#fff",textAlign:"start",textBaseline:"middle"},joinString:": ",showItemMarker:!0,itemMarkerStyle:{width:"12px",radius:"6px",symbol:"circle",lineWidth:"2px",stroke:"#fff"},layout:"horizontal",snap:!1,xTipTextStyle:{fontSize:"24px",fill:"#fff"},yTipTextStyle:{fontSize:"24px",fill:"#fff"},xTipBackground:{radius:"4px",fill:"rgba(0, 0, 0, 0.65)",padding:["6px","10px"],marginLeft:"-50%",marginTop:"6px"},yTipBackground:{radius:"4px",fill:"rgba(0, 0, 0, 0.65)",padding:["6px","10px"],marginLeft:"-100%",marginTop:"-50%"}};function Kv(t,e){return void 0===t||"string"==typeof t&&-1!==t.indexOf(e)}var $v=function(t){var e=t.records,n=t.coord,i=t.context,o=t.markerBackgroundStyle,a=n.convertPoint({x:1,y:1}),s=i.px2hd(o.padding||"6px"),u=l(l([],e.map((function(t){return t.xMin})),!0),e.map((function(t){return t.xMax})),!0),c=l(l([],e.map((function(t){return t.yMin})),!0),e.map((function(t){return t.yMax})),!0);n.transposed?u.push(a.x):c.push(a.y);var h=Math.min.apply(null,u),p=Math.max.apply(null,u),f=Math.min.apply(null,c),d=Math.max.apply(null,c);return Mh("rect",{style:r({x:n.transposed?h:h-s,y:n.transposed?f-s:f,width:n.transposed?p-h:p-h+2*s,height:n.transposed?d-f+2*s:d-f},o)})},Jv=function(t){var e=t.coord,n=t.crosshairsType,i=t.crosshairsStyle,o=t.xPositionType,a=t.yPositionType,s=e.left,u=e.top,l=e.right,c=e.bottom,h=e.center,p=t.records[0],f=p.x,d=p.y,y=p.origin,v=p.xField,g=p.coord;if(e.isPolar){var m=M(t.chart.getScale(v).getTicks(),(function(t){return y[v]===t.tickValue})),x=e.convertPoint({x:m.value,y:1});return Mh("line",{style:r({x1:h.x,y1:h.y,x2:x.x,y2:x.y},i)})}return Mh("group",null,Kv(n,"x")?Mh("line",{style:r({x1:s,y1:"coord"===a?g.y:d,x2:l,y2:"coord"===a?g.y:d},i)}):null,Kv(n,"y")?Mh("line",{style:r({x1:"coord"===o?g.x:f,y1:u,x2:"coord"===o?g.x:f,y2:c},i)}):null)},Qv=function(t){var e=t.xTip,n=t.xPositionType,i=t.xTipTextStyle,o=t.records[0],a=o.coord,s=o.name;return Mh("rect",{style:r({display:"flex",left:"coord"===n?a.x:o.x,top:t.coord.bottom},t.xTipBackground)},Mh("text",{style:r(r({},i),{text:"coord"===n?a.xText:h(e)?e(s):s})}))},tg=function(t){var e=t.yTip,n=t.yPositionType,i=t.yTipTextStyle,o=t.records[0],a=o.coord,s=o.value;return Mh("rect",{style:r({display:"flex",left:t.coord.left,top:"coord"===n?a.y:o.y},t.yTipBackground)},Mh("text",{style:r(r({},i),{text:"coord"===n?a.yText:h(e)?e(s):s})}))},eg=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.render=function(){var t=this.props,e=t.records,n=t.background,i=t.showItemMarker,o=t.itemMarkerStyle,a=t.customText,s=t.nameStyle,u=t.valueStyle,l=t.joinString,c=t.arrowWidth,p=t.x,f=t.coord,d=function(t,f){return Mh("group",{style:{display:"flex"}},Mh("group",{style:r({display:"flex",flexDirection:"row",flexWrap:"wrap",padding:[0,0,0,"6px"],left:t,top:f},n)},e.map((function(t){var e=t.name,n=t.value;return Mh("group",{style:{display:"flex",flexDirection:"row",alignItems:"center",padding:[0,"6px",0,0]}},i?Mh("marker",{style:r(r({width:o.width,marginRight:"6px"},o),{fill:t.color})}):null,a&&h(a)?a(t):Mh("group",{style:{display:"flex",flexDirection:"row"}},Mh("text",{style:r(r({},s),{text:n?"".concat(e).concat(l):e})}),Mh("text",{style:r(r({},u),{text:n})})))}))),Mh("group",null,Mh("polygon",{style:{points:[[p-c,f],[p+c,f],[p,f+c]],fill:n.fill}})))},y=uc(this,d(0,0)).layout,v=f.left,g=f.right,m=y.width,x=p-m/2,b=f.top-y.height;return d(v>x?v:x>g-m?g-m:x,0>b?0:b)},e}(an),ng=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.render=function(){var t=this.props,e=this.context,n=t.records,i=t.coord,o=n[0],a=o.x,s=o.coord,u=t.chart,l=t.background,c=t.showTooltipMarker,h=void 0===c?Zv.showTooltipMarker:c,p=t.markerBackgroundStyle,f=void 0===p?Zv.markerBackgroundStyle:p,d=t.showItemMarker,y=void 0===d?Zv.showItemMarker:d,v=t.nameStyle,g=t.valueStyle,m=t.joinString,x=void 0===m?Zv.joinString:m,b=t.showCrosshairs,M=void 0===b?Zv.showCrosshairs:b,w=t.crosshairsStyle,E=t.crosshairsType,k=void 0===E?Zv.crosshairsType:E,S=t.snap,P=void 0===S?Zv.snap:S,T=t.tooltipMarkerStyle,N=void 0===T?Zv.tooltipMarkerStyle:T,C=t.showXTip,A=t.xPositionType,O=t.showYTip,R=t.yPositionType,L=t.xTip,_=t.yTip,I=t.xTipTextStyle,D=void 0===I?Zv.xTipTextStyle:I,F=t.yTipTextStyle,B=void 0===F?Zv.yTipTextStyle:F,j=t.xTipBackground,G=void 0===j?Zv.xTipBackground:j,Y=t.yTipBackground,V=void 0===Y?Zv.yTipBackground:Y,W=t.custom,X=void 0!==W&&W,z=t.customText,U=r(r({},t.itemMarkerStyle),Zv.itemMarkerStyle),H=r(r({},Zv.background),l),q=e.px2hd("6px");return Mh("group",null,h?Mh($v,{coord:i,context:e,records:n,markerBackgroundStyle:f}):null,M?Mh(Jv,{chart:u,coord:i,records:n,xPositionType:A,yPositionType:R,crosshairsType:k,crosshairsStyle:r(r({},Zv.crosshairsStyle),w)}):null,P?n.map((function(t){var e=t.color;return Mh("circle",{style:r(r({cx:"coord"===A?s.x:t.x,cy:"coord"===R?s.y:t.y,r:"6px",stroke:e,fill:e},t.shape),N)})})):null,C&&Mh(Qv,{records:n,coord:i,xTip:L,xPositionType:A,xTipTextStyle:r(r({},Zv.xTipTextStyle),D),xTipBackground:r(r({},Zv.xTipBackground),G)}),O&&Mh(tg,{records:n,coord:i,yTip:_,yPositionType:R,yTipTextStyle:r(r({},Zv.yTipTextStyle),B),yTipBackground:r(r({},Zv.yTipBackground),V)}),!X&&Mh(eg,{records:n,coord:i,itemMarkerStyle:U,customText:z,showItemMarker:y,x:a,arrowWidth:q,background:H,nameStyle:r(r({},Zv.nameStyle),v),valueStyle:r(r({},Zv.valueStyle),g),joinString:x}))},e}(an),rg=qv(ng),ig=cn((function(t){var e=$f.default;t.exports=function(t,n){if("object"!==e(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,n||"default");if("object"!==e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports})),og=cn((function(t){var e=$f.default;t.exports=function(t){var n=ig(t,"string");return"symbol"===e(n)?n:n+""},t.exports.__esModule=!0,t.exports.default=t.exports})),ag=ln(cn((function(t){t.exports=function(t,e,n){return(e=og(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},t.exports.__esModule=!0,t.exports.default=t.exports})));function sg(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}var ug=cn((function(t){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);e>n;n++)r[n]=t[n];return r},t.exports.__esModule=!0,t.exports.default=t.exports})),lg=cn((function(t){t.exports=function(t,e){if(t){if("string"==typeof t)return ug(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ug(t,e):void 0}},t.exports.__esModule=!0,t.exports.default=t.exports})),cg=cn((function(t){t.exports=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=lg(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return t.length>r?{done:!1,value:t[r++]}:{done:!0}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}},t.exports.__esModule=!0,t.exports.default=t.exports})),hg=ln(cg);var pg=cn((function(t){var e=$f.default;function n(){t.exports=n=function(){return i},t.exports.__esModule=!0,t.exports.default=t.exports;var r,i={},o=Object.prototype,a=o.hasOwnProperty,s=Object.defineProperty||function(t,e,n){t[e]=n.value},u="function"==typeof Symbol?Symbol:{},l=u.iterator||"@@iterator",c=u.asyncIterator||"@@asyncIterator",h=u.toStringTag||"@@toStringTag";function p(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{p({},"")}catch(r){p=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var i=Object.create((e&&e.prototype instanceof b?e:b).prototype),o=new L(r||[]);return s(i,"_invoke",{value:C(t,n,o)}),i}function d(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}i.wrap=f;var y="suspendedStart",v="suspendedYield",g="executing",m="completed",x={};function b(){}function M(){}function w(){}var E={};p(E,l,(function(){return this}));var k=Object.getPrototypeOf,S=k&&k(k(_([])));S&&S!==o&&a.call(S,l)&&(E=S);var P=w.prototype=b.prototype=Object.create(E);function T(t){["next","throw","return"].forEach((function(e){p(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,n){function r(i,o,s,u){var l=d(t[i],t,o);if("throw"!==l.type){var c=l.arg,h=c.value;return h&&"object"==e(h)&&a.call(h,"__await")?n.resolve(h.__await).then((function(t){r("next",t,s,u)}),(function(t){r("throw",t,s,u)})):n.resolve(h).then((function(t){c.value=t,s(c)}),(function(t){return r("throw",t,s,u)}))}u(l.arg)}var i;s(this,"_invoke",{value:function(t,e){function o(){return new n((function(n,i){r(t,e,n,i)}))}return i=i?i.then(o,o):o()}})}function C(t,e,n){var i=y;return function(o,a){if(i===g)throw Error("Generator is already running");if(i===m){if("throw"===o)throw a;return{value:r,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=A(s,n);if(u){if(u===x)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===y)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=g;var l=d(t,e,n);if("normal"===l.type){if(i=n.done?m:v,l.arg===x)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=m,n.method="throw",n.arg=l.arg)}}}function A(t,e){var n=e.method,i=t.iterator[n];if(i===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=r,A(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),x;var o=d(i,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,x;var a=o.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,x):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,x)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function _(t){if(t||""===t){var n=t[l];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function e(){for(;++i<t.length;)if(a.call(t,i))return e.value=t[i],e.done=!1,e;return e.value=r,e.done=!0,e};return o.next=o}}throw new TypeError(e(t)+" is not iterable")}return M.prototype=w,s(P,"constructor",{value:w,configurable:!0}),s(w,"constructor",{value:M,configurable:!0}),M.displayName=p(w,h,"GeneratorFunction"),i.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===M||"GeneratorFunction"===(e.displayName||e.name))},i.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,p(t,h,"GeneratorFunction")),t.prototype=Object.create(P),t},i.awrap=function(t){return{__await:t}},T(N.prototype),p(N.prototype,c,(function(){return this})),i.AsyncIterator=N,i.async=function(t,e,n,r,o){void 0===o&&(o=Promise);var a=new N(f(t,e,n,r),o);return i.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},T(P),p(P,h,"Generator"),p(P,l,(function(){return this})),p(P,"toString",(function(){return"[object Generator]"})),i.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},i.values=_,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(R),!t)for(var e in this)"t"===e.charAt(0)&&a.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,i){return s.type="throw",s.arg=t,e.next=n,i&&(e.method="next",e.arg=r),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return n("end");if(this.prev>=o.tryLoc){var u=a.call(o,"catchLoc"),l=a.call(o,"finallyLoc");if(u&&l){if(o.catchLoc>this.prev)return n(o.catchLoc,!0);if(o.finallyLoc>this.prev)return n(o.finallyLoc)}else if(u){if(o.catchLoc>this.prev)return n(o.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(this.prev>=r.tryLoc&&a.call(r,"finallyLoc")&&r.finallyLoc>this.prev){var i=r;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,x):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),x},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),R(n),x}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;R(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:_(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),x}},i}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports})),fg=pg(),dg=fg;try{regeneratorRuntime=fg}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=fg:Function("r","regeneratorRuntime = r")(fg)}var yg=dg.mark(vg);function vg(){var t,e,n,r,i,o;return dg.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:n=[t=this];case 1:e=n.reverse(),n=[];case 2:if(!(t=e.pop())){a.next=8;break}return a.next=5,t;case 5:if(r=t.children)for(i=0,o=r.length;o>i;++i)n.push(r[i]);a.next=2;break;case 8:if(n.length){a.next=1;break}case 9:case"end":return a.stop()}}),yg,this)}function gg(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=xg)):void 0===e&&(e=mg);for(var n,r,i,o,a,s=new wg(t),u=[s];n=u.pop();)if((i=e(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)u.push(r=i[o]=new wg(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Mg)}function mg(t){return t.children}function xg(t){return Array.isArray(t)?t[1]:null}function bg(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function Mg(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function wg(t){this.data=t,this.depth=this.height=0,this.parent=null}function Eg(){return 0}function kg(t){return function(){return t}}function Sg(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 Pg(t,e,n,r,i){for(var o,a=t.children,s=-1,u=a.length,l=t.value&&(r-e)/t.value;++s<u;)(o=a[s]).y0=n,o.y1=i,o.x0=e,o.x1=e+=o.value*l}function Tg(){var t=1,e=1,n=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=n,i.x1=t,i.y1=e/o,i.eachBefore(function(t,e){return function(r){r.children&&Pg(r,r.x0,t*(r.depth+1)/e,r.x1,t*(r.depth+2)/e);var i=r.x0,o=r.y0,a=r.x1-n,s=r.y1-n;i>a&&(i=a=(i+a)/2),o>s&&(o=s=(o+s)/2),r.x0=i,r.y0=o,r.x1=a,r.y1=s}}(e,o)),r&&i.eachBefore(Sg),i}return i.round=function(t){return arguments.length?(r=!!t,i):r},i.size=function(n){return arguments.length?(t=+n[0],e=+n[1],i):[t,e]},i.padding=function(t){return arguments.length?(n=+t,i):n},i}function Ng(t,e,n,r,i){for(var o,a=t.children,s=-1,u=a.length,l=t.value&&(i-n)/t.value;++s<u;)(o=a[s]).x0=e,o.x1=r,o.y0=n,o.y1=n+=o.value*l}wg.prototype=gg.prototype=ag({constructor:wg,count:function(){return this.eachAfter(sg)},each:function(t,e){var n,r=-1,i=hg(this);try{for(i.s();!(n=i.n()).done;){t.call(e,n.value,++r,this)}}catch(t){i.e(t)}finally{i.f()}return this},eachAfter:function(t,e){for(var n,r,i,o=this,a=[o],s=[],u=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;i>r;++r)a.push(n[r]);for(;o=s.pop();)t.call(e,o,++u,this);return this},eachBefore:function(t,e){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(t.call(e,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(t,e){var n,r=-1,i=hg(this);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(t.call(e,o,++r,this))return o}}catch(t){i.e(t)}finally{i.f()}},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;t=n.pop(),e=r.pop();for(;t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)r.push(e=e.parent);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return gg(this).eachBefore(bg)}},Symbol.iterator,vg);var Cg=function t(e){function n(t,n,r,i,o){!function(t,e,n,r,i,o){for(var a,s,u,l,c,h,p,f,d,y,v,g=[],m=e.children,x=0,b=0,M=m.length,w=e.value;M>x;){u=i-n,l=o-r;do{c=m[b++].value}while(!c&&M>b);for(h=p=c,d=Math.max(p/(v=c*c*(y=Math.max(l/u,u/l)/(w*t))),v/h);M>b;++b){if(c+=s=m[b].value,h>s&&(h=s),s>p&&(p=s),(f=Math.max(p/(v=c*c*y),v/h))>d){c-=s;break}d=f}g.push(a={value:c,dice:l>u,children:m.slice(x,b)}),a.dice?Pg(a,n,r,i,w?r+=l*c/w:o):Ng(a,n,r,w?n+=u*c/w:i,o),w-=c,x=b}}(e,t,n,r,i,o)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(1.618033988749895);function Ag(){var t=Cg,e=!1,n=1,r=1,i=[0],o=Eg,a=Eg,s=Eg,u=Eg,l=Eg;function c(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(h),i=[0],e&&t.eachBefore(Sg),t}function h(e){var n=i[e.depth],r=e.x0+n,c=e.y0+n,h=e.x1-n,p=e.y1-n;r>h&&(r=h=(r+h)/2),c>p&&(c=p=(c+p)/2),e.x0=r,e.y0=c,e.x1=h,e.y1=p,e.children&&(n=i[e.depth+1]=o(e)/2,r+=l(e)-n,c+=a(e)-n,r>(h-=s(e)-n)&&(r=h=(r+h)/2),c>(p-=u(e)-n)&&(c=p=(c+p)/2),t(e,r,c,h,p))}return c.round=function(t){return arguments.length?(e=!!t,c):e},c.size=function(t){return arguments.length?(n=+t[0],r=+t[1],c):[n,r]},c.tile=function(e){return arguments.length?(t=function(t){if("function"!=typeof t)throw Error();return t}(e),c):t},c.padding=function(t){return arguments.length?c.paddingInner(t).paddingOuter(t):c.paddingInner()},c.paddingInner=function(t){return arguments.length?(o="function"==typeof t?t:kg(+t),c):o},c.paddingOuter=function(t){return arguments.length?c.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):c.paddingTop()},c.paddingTop=function(t){return arguments.length?(a="function"==typeof t?t:kg(+t),c):a},c.paddingRight=function(t){return arguments.length?(s="function"==typeof t?t:kg(+t),c):s},c.paddingBottom=function(t){return arguments.length?(u="function"==typeof t?t:kg(+t),c):u},c.paddingLeft=function(t){return arguments.length?(l="function"==typeof t?t:kg(+t),c):l},c}function Og(t,e,n,r,i){var o,a,s=t.children,u=s.length,l=Array(u+1);for(l[0]=a=o=0;u>o;++o)l[o+1]=a+=s[o].value;!function t(e,n,r,i,o,a,u){if(e>=n-1){var c=s[e];return c.x0=i,c.y0=o,c.x1=a,void(c.y1=u)}var h=l[e],p=r/2+h,f=e+1,d=n-1;for(;d>f;){var y=f+d>>>1;p>l[y]?f=y+1:d=y}l[f]-p>p-l[f-1]&&f>e+1&&--f;var v=l[f]-h,g=r-v;if(a-i>u-o){var m=r?(i*g+a*v)/r:a;t(e,f,v,i,o,m,u),t(f,n,g,m,o,a,u)}else{var x=r?(o*g+u*v)/r:u;t(e,f,v,i,o,a,x),t(f,n,g,i,x,a,u)}}(0,u,t.value,e,n,r,i)}var Rg=function(t){return function(e){function i(t,n){var i=e.call(this,t,n)||this,o=t.color,a=t.data,s=t.theme,u=t.selection,l=void 0===u?{}:u;n.theme=Z((0,n.px2hd)(Gf),s),i.coord=new $p,i.color=new Ld(r(r({range:n.theme.colors},o),{data:a}));var c=l.defaultSelected;return i.state.selected=void 0===c?null:c,i.coordRef={current:null},i.records=[],i}return n(i,e),i.prototype.isSelected=function(t){var e=this.state.selected;if(!e||!e.length)return!1;for(var n=0,r=e.length;r>n;n++){if(Yu(t,e[n]))return!0}return!1},i.prototype.getSelectionStyle=function(t){var e=this.state.selected;if(!e||!e.length)return null;var n=this.props.selection,r=n.selectedStyle,i=n.unSelectedStyle;return this.isSelected(t)?h(r)?r(t):r:h(i)?i(t):i},i.prototype.willMount=function(){var t=this,e=t.coord,n=t.props.coord;e.updateLayout(t.layout),e.create(n)},i.prototype.willReceiveProps=function(t){var e=t.selection,n=this.props.selection;if(e&&n){var r=e.defaultSelected;Yu(r,n.defaultSelected)||(this.state.selected=r)}},i.prototype.treemapLayout=function(){var t=this,e=this,n=e.props,i=e.color,o=e.coord.getCoord(),a=o.width,s=o.height,u=n.value,l=n.space,c=void 0===l?0:l,h=gg({children:n.data}).sum((function(t){return t[u]})).sort((function(t,e){return e[u]-t[u]}));return Ag().tile(Og).round(!1).size([a,s]).paddingInner(c)(h).children.map((function(e){var n=e.data,o=e.x0,a=e.y0,s=e.x1,u=e.y1,l=i.mapping(n[i.field]),c={xMin:o,xMax:s,yMin:a,yMax:u},h=t.getSelectionStyle(n);return r(r({key:n.key,origin:n,color:l},c),{style:h})}))},i.prototype.select=function(t,e){var n=this,r=this.props.selection,i=void 0===r?{}:r,o=i.triggerOn,a=i.type,s=void 0===a?"single":a,u=i.cancelable,c=void 0===u||u;if(o&&e===o){var h="click"===o?{x:t.canvasX,y:t.canvasY}:t.points[0],p=this.state.selected,f=[];if(g(this.records,(function(t){t.xMin>h.x||h.x>t.xMax||t.yMin>h.y||h.y>t.yMax||f.push(null==t?void 0:t.origin)})),f)if(p){var d=[];f.forEach((function(t){n.isSelected(t)||d.push(t)})),this.setState("single"!==s?{selected:l(l([],d,!0),p,!0)}:{selected:c?d:f})}else this.setState({selected:f});else this.setState({selected:null})}},i.prototype.render=function(){var e=this,n=this.treemapLayout();this.records=n;var i=this.props,o=this.coord,a=o.getCoord();return Mh("group",{style:{width:a.width,height:a.height,fill:"transparent"},onClick:function(t){return e.select(t,"click")},onPress:function(t){return e.select(t,"press")}},Mh(t,r({nodes:n},i,{coord:o.getCoord()})))},i}(an)},Lg=function(t){var e=t.nodes,n=t.coord,i=t.onClick,o=t.label,a=void 0!==o&&o;if(n.isPolar){var s=n.center,u=s.x,l=s.y;return Mh("group",null,e.map((function(t){return Mh("sector",{style:r({cx:u,cy:l,lineWidth:"1px",stroke:"#fff",startAngle:t.xMin,endAngle:t.xMax,r0:t.yMin,r:t.yMax,fill:t.color},t.style),onClick:i?function(){return i(t)}:null})})))}return Mh("group",null,e.map((function(t){var e=t.xMin,n=t.xMax,o=t.yMin,s=t.yMax;return Mh("group",null,Mh("rect",{key:t.key,style:r({x:e,y:o,width:n-e,height:s-o,fill:t.color,lineWidth:"4px",stroke:"#fff",radius:"8px"},t.style),animation:{appear:{easing:"linear",duration:450,property:["fillOpacity","strokeOpacity"],start:{fillOpacity:0,strokeOpacity:0}},update:{easing:"linear",duration:450,property:["x","y","width","height","radius","lineWidth","fillOpacity","strokeOpacity"]}},onClick:i?function(){return i(t)}:null}),a&&Mh("text",{style:r({x:(e+n)/2,y:(o+s)/2,text:t.origin.name,fill:"white",textAlign:"center",textBaseline:"middle"},a)}))})))},_g=Rg(Lg);function Ig(t){for(var e=t;e.depth>1;)e=e.parent;return e}var Dg=function(t){return function(e){function i(t,n){var i=e.call(this,t,n)||this,o=t.color,a=t.data;return i.coord=new $p,i.color=new Ld(r(r({range:Gf.colors},o),{data:a})),i}return n(i,e),i.prototype.willMount=function(){var t=this,e=t.coord,n=t.props.coord;e.updateLayout(t.layout),e.create(n)},i.prototype.didMount=function(){},i.prototype._mapping=function(t){for(var e=this.color,n=this.coord,r=0,i=t.length;i>r;r++){var o=t[r],a=Ig(o),s=e.mapping(a.data[e.field]);o.color=s;var u=o.x0,l=o.x1,c=o.y0,h=o.y1;z(o,n.getCoord().convertRect({x:[u,l],y:[c,h]})),o.children&&o.children.length&&this._mapping(o.children)}},i.prototype.sunburst=function(){var t=this.props,e=t.value,n=t.sort,r=void 0===n||n,i=gg({children:t.data}).sum((function(t){return t[e]}));if(!0===r||h(r)){var o=h(r)?r:function(t,n){return n[e]-t[e]};i.sort(o)}var a=Tg()(i);return this._mapping(a.children),a},i.prototype.render=function(){var e=this.sunburst();return Mh(t,r({},this.props,{coord:this.coord.getCoord(),node:e,triggerRef:this.triggerRef}))},i}(an)},Fg=function(t){var e=t.onClick,n=t.coord.center,r=n.x,i=n.y;return function t(n){return Mh("group",null,n.map((function(n){var o=n.xMax,a=n.yMin,s=n.yMax,u=n.color,l=n.children;return Mh("group",{onClick:e},Mh("sector",{attrs:{cx:r,cy:i,lineWidth:"1px",stroke:"#fff",startAngle:"".concat(n.xMin," rad"),endAngle:"".concat(o," rad"),r0:a,r:s,fill:u}}),l&&l.length?t(l):null)})))}(t.node.children)},Bg=function(t){var e=t.onClick;return function t(n){return Mh("group",null,n.map((function(n){var r=n.xMin,i=n.yMin,o=n.children;return Mh("group",{onClick:e},Mh("rect",{attrs:{x:r,y:i,width:n.xMax-r,height:n.yMax-i,lineWidth:"1px",stroke:"#fff",fill:n.color}}),o&&o.length?t(o):null)})))}(t.node.children)},jg=Dg((function(t){return Mh("polar"===t.coord.type?Fg:Bg,r({},t))})),Gg={anchorOffset:"10px",inflectionOffset:"30px",sidePadding:"15px",height:"64px",adjustOffset:"30",triggerOn:"click",label1OffsetY:"-4px",label2OffsetY:"4px"};function Yg(t,e,n){return{x:t.x+n*Math.cos(e),y:t.y+n*Math.sin(e)}}function Vg(t,e,n,r){var i=r.x,o=t.sort((function(t,e){var n=Math.abs(t.x-i);return Math.abs(e.x-i)-n}));return[o.slice(0,o.length-n),o.slice(o.length-n).concat(e)]}function Wg(t){return t>=-Math.PI/2&&0>t}function Xg(t){return t>=0&&Math.PI/2>t}function zg(t){return t>=Math.PI/2&&Math.PI>t}function Ug(t){return t>=Math.PI&&3*Math.PI/2>t}var Hg=function(t){return function(e){function i(t){return e.call(this,t)||this}return n(i,e),i.prototype.willMount=function(){},i.prototype.didMount=function(){},i.prototype.getLabels=function(t){var e=t.chart,n=t.coord,r=t.anchorOffset,i=t.inflectionOffset,o=t.label1,a=t.label2,s=t.sidePadding,u=n.center,l=n.radius,c=n.width,p=n.height,f=n.left,d=n.right,y=n.top,v=Math.floor(p/t.height),g=2*v,m=e.getGeometrys()[0].flatRecords().sort((function(t,e){return e.xMax-e.xMin-(t.xMax-t.xMin)})).slice(0,g),x=[[],[]];if(m.forEach((function(t){var e,n,s=t.color,c=t.origin,p=((e=t.xMin)>(n=t.xMax)&&(n+=2*Math.PI),(n+e)/2),f=Yg(u,p,l+r),d=Yg(u,p,l+i),y=u.x>f.x?"left":"right",v={origin:c,angle:p,anchor:f,inflection:d,side:y,x:d.x,y:d.y,r:l+i,color:s,label1:h(o)?o(c,t):o,label2:h(a)?a(c,t):a};"left"===y?x[0].push(v):x[1].push(v)})),x[0].length>v)x=Vg(x[0],x[1],x[0].length-v,u);else if(x[1].length>v){var b=Vg(x[1],x[0],x[1].length-v,u);x=[b[1],b[0]]}var M=c/2-l-r-i-2*s,w=[];return x.forEach((function(t,e){var n=0===e?"left":"right";t.sort((function(t,e){var r=t.angle,i=e.angle;return"left"===n?(r=Wg(r)?r+2*Math.PI:r,(i=Wg(i)?i+2*Math.PI:i)-r):(r=Ug(r)?r-2*Math.PI:r)-(i=Ug(i)?i-2*Math.PI:i)}));var r=t.map((function(t){return t.y})),i=Math.max.apply(null,r),o=Math.min.apply(null,r),a=t.length,u=p/a,l=u/2;t.forEach("left"===n?function(t,e){var r=t.angle,c=t.x,h=t.y,p=[t.anchor,t.inflection],d=f+s,v=y+l+u*e,g={x:d+M+2*e,y:v},m={x:d,y:v};if(Wg(r))p.push({x:c,y:x=o-2*(a-e)}),p.push({x:g.x,y:x});else if(zg(r)||Ug(r))p.push({x:g.x,y:h});else if(Xg(r)){var x;p.push({x:c,y:x=i+2*e}),p.push({x:g.x,y:x})}p.push(g),p.push(m),t.points=p,t.side=n,w.push(t)}:function(t,e){var r=t.angle,c=t.x,h=t.y,p=[t.anchor,t.inflection],f=d-s,v=y+l+u*e,g={x:f-M-2*e,y:v},m={x:f,y:v};if(Ug(r))p.push({x:c,y:x=o-2*(a-e)}),p.push({x:g.x,y:x});else if(Wg(r)||Xg(r))p.push({x:g.x,y:h});else if(zg(r)){var x;p.push({x:c,y:x=i+2*e}),p.push({x:g.x,y:x})}p.push(g),p.push(m),t.points=p,t.side=n,w.push(t)})})),w},i.prototype.render=function(){var e=this.context.px2hd(Z({},Gg,this.props)),n=this.getLabels(e);return Mh(t,r({labels:n},e))},i}(an)},qg=function(t){var e=t.lineStyle,n=t.anchorStyle,i=t.label1OffsetY,o=t.label2OffsetY,a=t.onClick;return Mh("group",{ref:t.triggerRef},t.labels.map((function(t){var s=t.origin,u=t.anchor,l=t.side,c=t.color,h=t.label1,p=t.label2,f=t.points,d=f[f.length-1];return Mh("group",{onClick:a?function(){a(t)}:null},Mh("circle",{attrs:r({r:"4px",cx:u.x,cy:u.y,fill:c},n)}),Mh("polyline",{attrs:r({points:f.map((function(t){return[t.x,t.y]})),lineWidth:"2px",stroke:c},e)}),Mh("text",{className:"click",attrs:r({x:d.x,y:d.y+i,fontSize:"24px",lineHeight:"24px",fill:c,textBaseline:"bottom",textAlign:"left"===l?"left":"right"},h),data:s}),Mh("text",{className:"click",attrs:r({x:d.x,y:d.y+o,fontSize:"24px",lineHeight:"24px",fill:"#808080",textBaseline:"top",textAlign:"left"===l?"left":"right"},p),data:s}))})))},Zg=Hg(qg),Kg=function(t,e,n){return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},$g=function(t){return function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return n(i,e),i.prototype.render=function(){var e=this.props,n=this.context,i=e.tickOffset,o=e.tickLength,a=function(t,e,n,r,i,o,a){for(var s=[],u=e-t,l=0;n>=l;l++){var c=t+u*l/n,h=Kg(r,c,i+o-a),p=Kg(r,c,i+o);s.push({tickValue:c,start:h,end:p})}return s}(e.startAngle,e.endAngle,e.tickCount,e.center,n.px2hd(e.r),n.px2hd(i),n.px2hd(o));return Mh(t,r({},e,{ticks:a}))},i}(an)},Jg=function(t){var e=t.center,n=t.startAngle,r=t.endAngle,i=t.r,o=t.percent,a=t.ticks,s=e.x,u=e.y,l=r-n;return Mh("group",null,Mh("arc",{attrs:{cx:s,cy:u,r:i,startAngle:"".concat(n," rad"),endAngle:"".concat(r," rad"),lineWidth:"20px",lineCap:"round",stroke:"#e7e7e7"}}),Mh("arc",{attrs:{cx:s,cy:u,r:i,startAngle:"".concat(n," rad"),endAngle:"".concat(n," rad"),lineWidth:"40px",lineCap:"round",stroke:"#0075ff"},animation:{appear:{easing:"linear",duration:500,property:["endAngle"],start:{endAngle:"".concat(n," rad")},end:{endAngle:"".concat(n+l*o," rad")}}}}),a.map((function(t){var e=t.start,n=t.end;return Mh("line",{attrs:{x1:e.x,y1:e.y,x2:n.x,y2:n.y,lineWidth:"6px",lineCap:"round",stroke:"#e7e7e7"}})})))},Qg=$g(Jg);function tm(t,e){if(t.length!==e.length)return!1;var n=t.length-1;return t[0]===e[0]&&t[n]===e[n]}function em(t,e,n){var r=t.isLinear;return t.isCategory?function(t,e,n){var r=t.values,i=t.ticks,o=t.tickMethod,a=t.tickCount,s=e.values,u=s.length,l=n[0]*u,c=Math.round(parseFloat((n[1]*u-l).toFixed(3))),h=Math.min(Math.round(l),u-c),p=s.slice(h,h+c),f=Math.round(a*s.length/p.length),d=Qp(o)({tickCount:f,values:s});if(!tm(r,p)||!tm(i,d))return t.change({values:p,ticks:d}),t}(t,e,n):r?function(t,e,n){var r=e.min,i=e.max;t.change({min:r+(i-r)*n[0],max:r+(i-r)*n[1],nice:!1})}(t,e,n):void 0}function nm(t,e,n){var r=e.field,i=e.type,o={};return e.values.forEach((function(t){o[t]=!0})),t.map((function(t){var e=t.field,a=[];return n.forEach((function(t){var n="timeCat"===i?Zf(t[r]):t[r];if(o[n]){var s=t[e];y(s)?a.push.apply(a,s):a.push(s)}})),function(t,e){if(t.isLinear){var n=S(e);return t.change({min:n.min,max:n.max,nice:!0})}}(t,a)}))}function rm(t,e,n){return(e-t)*n+t}function im(t,e){if(!e)return!1;for(var n=0,r=t.length;r>n;n++)if(!D(t[n],e[n]))return!1;return!0}function om(t,e){if(!e)return!1;if(y(t))return im(t,e);for(var n in t)if(!im(t[n],e[n]))return!1;return!0}function am(t,e){return new t.constructor(r(r({},t.__cfg__),e))}var sm=function(t){return function(e){function i(t){var n=this;(n=e.call(this,r(r({},{onPanStart:function(){},onPinchStart:function(){},onPan:function(){},onPinch:function(){},onInit:function(){},onPanEnd:function(){},onPinchEnd:function(){},minCount:10}),t))||this).scale={},n.originScale={},n.swipeEnd={startX:0,startY:0,endX:0,endY:0},n.onStart=function(){n.startRange=n.state.range,n.loop&&cancelAnimationFrame(n.loop)},n.onPan=function(t){var e={};g(n.dims,(function(r){"x"!==r?"y"!==r||(e.y=n._doYPan(t)):e.x=n._doXPan(t)})),n.renderRange(e)},n.onSwipe=function(t){var e=n.props,r=t.velocity,i=t.direction,o=t.velocityX,a=void 0===o?0:o,s=t.velocityY,u=void 0===s?0:s,l=e.mode,c=n.state.range;if(e.swipe&&l)if(1!==l.length){var h=t.points[0],p=h.x,f=h.y;5e-4>Math.abs((null==c?void 0:c.x[0])-0)&&a>0||5e-4>Math.abs((null==c?void 0:c.x[1])-1)&&0>a||5e-4>Math.abs((null==c?void 0:c.y[0])-0)&&0>u||5e-4>Math.abs((null==c?void 0:c.x[1])-1)&&u>0||(n.swipeEnd={startX:p,startY:f,endX:p+50*a,endY:f-50*u},n.onStart(),n.update())}else n.animateSwipe(l,c[l],"right"===i||"down"===i?-r:r)},n.onPinch=function(t){var e={};g(n.dims,(function(r){"x"!==r?"y"!==r||(e.y=n._doYPinch(t)):e.x=n._doXPinch(t)})),n.renderRange(e)},n.onEnd=function(){n.startRange=null};var i=t.mode;return n.dims=y(i)?i:[i],n}return n(i,e),i.prototype.didMount=function(){(0,this.props.onInit)({scale:this.scale}),this._bindEvents()},i.prototype.willReceiveProps=function(t){var e=t.range;if(!Yu(e,this.props.range)){var n={};g(this.dims,(function(t){n[t]=e})),this.state={range:n}}},i.prototype.willMount=function(){var t=this,e=this.props,n=e.minCount,r=e.range,i=5e-324,o={};g(this.dims,(function(e){var n=t._getScale(e),a=n.values;i=a.length>i?a.length:i,t.scale[e]=n,t.originScale[e]=am(n),t.updateRange(r,e),o[e]=r})),this.minScale=n/i,this.renderRange(o)},i.prototype.willUpdate=function(){var t=this,e=this,n=e.props,i=e.state,o=n.minCount,a=n.range,s=5e-324,u={};if(g(e.dims,(function(e){var n=t._getScale(e);if(n!==t.scale[e]){var r=n.values;s=r.length>s?r.length:s,t.scale[e]=n,t.originScale[e]=am(n),t.state.range[e]=[0,1],t.updateRange(a,e),u[e]=a}})),Object.keys(u).length>0){this.minScale=o/s;var l=r(r({},i.range),u);this.renderRange(l)}},i.prototype.didUnmount=function(){this.loop&&cancelAnimationFrame(this.loop)},i.prototype._bindEvents=function(){var t=this,e=this.scale,n=this.props,r=n.chart,i=n.onPinchStart,o=n.onPanStart,a=n.onPanEnd,s=n.pinch,u=n.swipe,l=n.onPan,c=n.onPinch,h=n.onPinchEnd;!1!==n.pan&&(r.on("panstart",(function(){t.onStart(),o({scale:e})})),r.on("pan",(function(e){t.onPan(e),l(e)})),r.on("panend",(function(){t.onEnd(),a({scale:e})}))),!1!==s&&(r.on("pinchstart",(function(){t.onStart(),i()})),r.on("pinch",(function(e){t.onPinch(e),c(e)})),r.on("pinchend",(function(){t.onEnd(),h({scale:e})}))),!1!==u&&r.on("swipe",this.onSwipe)},i.prototype.update=function(){var t=this,e=this.swipeEnd,n=e.startX,r=e.startY,i=e.endX,o=e.endY,a=rm(n,i,.05),s=rm(r,o,.05);this.swipeEnd={startX:a,startY:s,endX:i,endY:o};var u=this.props.coord,l=u.height,c={};c.x=this._doPan((a-n)/u.width,"x"),c.y=this._doPan((s-r)/l,"y"),this.renderRange(c),this.startRange=c,this.loop=requestAnimationFrame((function(){return t.update()})),5e-4>Math.abs(a-i)&&5e-4>Math.abs(s-o)&&(this.onEnd(),cancelAnimationFrame(this.loop))},i.prototype.animateSwipe=function(t,e,n){var r=this,i=this.context.canvas.requestAnimationFrame,o=this.props.swipeDuration,a=void 0===o?1e3:o,s=(e[1]-e[0])*n,u=Date.now(),l=function(n){var i=r.updateRange([e[0]+s*n,e[1]+s*n],t);r.renderRange({x:i})};!function t(){var e=Date.now()-u;if(a>e){var n,r=(n=e/a)*(2-n);l(r),i((function(){t()}))}else l(1)}()},i.prototype._doXPan=function(t){var e=t.direction,n=t.deltaX;if(1===this.props.mode.length&&("up"===e||"down"===e))return this.state.range.x;t.preventDefault&&t.preventDefault();var r=this.props,i=r.panSensitive;return this._doPan(n/r.coord.width*(void 0===i?1:i),"x")},i.prototype._doYPan=function(t){var e=t.direction,n=t.deltaY;if(1===this.props.mode.length&&("left"===e||"right"===e))return this.state.range.y;t.preventDefault&&t.preventDefault();var r=this.props,i=r.panSensitive;return this._doPan(-n/r.coord.height*(void 0===i?1:i),"y")},i.prototype._doPan=function(t,e){var n=this.startRange[e],r=n[0],i=n[1],o=(i-r)*t;return this.updateRange([r-o,i-o],e)},i.prototype._doXPinch=function(t){t.preventDefault&&t.preventDefault();var e=t.zoom,n=t.center,r=this.props.coord,i=r.width,o=r.right;return this._doPinch(Math.abs(n.x-r.left)/i,Math.abs(o-n.x)/i,e,"x")},i.prototype._doYPinch=function(t){t.preventDefault&&t.preventDefault();var e=t.zoom,n=t.center,r=this.props.coord,i=r.height,o=r.bottom;return this._doPinch(Math.abs(n.y-r.top)/i,Math.abs(o-n.y)/i,e,"y")},i.prototype._doPinch=function(t,e,n,r){var i=this,o=i.minScale,a=i.props.pinchSensitive,s=void 0===a?1:a,u=i.startRange[r],l=u[0],c=u[1],h=(c-l)*(1>n?(1/n-1)*s:(1-n)*s),p=h*e,f=Math.max(0,l-h*t),d=Math.min(1,c+p);return o>d-f?this.state.range[r]:this.updateRange([f,d],r)},i.prototype.updateRange=function(t,e){if(t){var n,r=t[0],i=t[1],o=i-r;n=0>r?[0,o]:i>1?[1-o,1]:t;var a=this,s=a.props,u=a.scale,l=a.originScale,c=s.data,h=s.autoFit,p=a.state.range;if(p&&om(n,p[e]))return n;if(em(u[e],l[e],n),h){var f=this._getFollowScales(e);this.updateFollow(f,u[e],c)}return n}},i.prototype.updateFollow=function(t,e,n){nm(t,e,n)},i.prototype._getScale=function(t){var e=this.props,n=e.coord,r=e.chart;return"x"===t?n.transposed?r.getYScales()[0]:r.getXScales()[0]:n.transposed?r.getXScales()[0]:r.getYScales()[0]},i.prototype._getFollowScales=function(t){var e=this.props,n=e.coord,r=e.chart;return"x"===t?n.transposed?r.getXScales():r.getYScales():"y"===t?n.transposed?r.getYScales():r.getXScales():void 0},i.prototype.renderRange=function(t){var e=this.state,n=this.props;if(!om(t,e.range)){var r=n.chart,i=r.animate;r.setAnimate(!1),e.range=t,r.forceUpdate((function(){r.setAnimate(i)}))}},i.prototype.render=function(){return Mh(t,r({},this.props,this.state))},i}(an)},um=function(t){return function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return n(i,e),i.prototype.willMount=function(){e.prototype.willMount.call(this);var t=this.props,n=t.visible,r=t.position,i=void 0===r?"bottom":r,o=t.margin,a=t.chart,s=this.context.px2hd(void 0===o?"16px":o);if(!1===n)return null;a.updateCoordFor(this,{position:i,width:"left"===i||"right"===i?s:0,height:"bottom"===i||"top"===i?s:0})},i.prototype.render=function(){var e=this.props;return!1===e.visible?null:Mh(t,r({position:"bottom"},e,this.state))},i}(sm(t))},lm=function(t,e){var n=t.coord,r=t.range,i=t.position,o=t.layout,a=n.left,s=n.width,u=o.top,l=o.height,c=(null==r?void 0:r.x)||(null==r?void 0:r.y),h=c[0],p=s*h,f=s*(c[1]-h);if(!isNaN(f))return Mh("group",{style:{display:"flex",left:a,top:"top"===i?u-e.px2hd("8px"):u+l}},Mh("line",{style:{display:"flex",position:"absolute",left:0,width:s,height:0,stroke:"rgba(202, 215, 239, .2)",lineCap:"round",lineWidth:"8px"}}),Mh("line",{style:{display:"flex",position:"absolute",left:p,width:f,height:0,stroke:"rgba(202, 215, 239, .5)",lineCap:"round",lineWidth:"8px"}}))},cm=function(t,e){var n=t.coord,r=t.range,i=t.layout,o=n.height,a=i.left,s=i.width,u=(null==r?void 0:r.y)||(null==r?void 0:r.x),l=u[0],c=o*l,h=o*(u[1]-l);return Mh("group",{style:{display:"flex",top:n.top,left:"left"===t.position?a-e.px2hd("8px"):a+s}},Mh("line",{style:{position:"absolute",top:0,left:0,width:0,height:o,stroke:"rgba(202, 215, 239, .2)",lineCap:"round",lineWidth:"8px"}}),Mh("line",{style:{position:"absolute",top:c,width:0,height:h,stroke:"rgba(202, 215, 239, .5)",lineCap:"round",lineWidth:"8px"}}))},hm=function(t){var e=t.position;return t.mode.length>1?Mh("group",null,Mh(cm,r({},t)),Mh(lm,r({},t))):Mh("left"===e||"right"===e?cm:lm,r({},t))},pm=um(hm),fm=["#E62C3B","#0E9976","#999999"],dm=function(t){return function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return n(i,e),i.prototype.getDefaultCfg=function(){return{geomType:"candlestick"}},i.prototype.getSize=function(){var t=this.props.sizeRatio;return 1/this.attrs.x.scale.values.length*(void 0===t?.5:t)},i.prototype.mapping=function(){for(var t=e.prototype.mapping.call(this),n=this.props.coord,r=this.getY0Value(),i=this.getSize(),o=this.getAttr("color"),a=o?o.range:fm,s=0,u=t.length;u>s;s++)for(var l=t[s].children,c=0,h=l.length;h>c;c++){var f=l[c],d=f.normalized,y=f.size;if(p(y)){var v=d.size;z(f,n.convertRect({x:d.x,y:d.y,y0:r,size:void 0===v?i:v}))}else{z(f,n.transformToRect({x:f.x,y:f.y,y0:r,size:y}))}var g=d.y,m=g[0],x=g[1];f.color=x>m?a[0]:m>x?a[1]:a[2],z(f.shape,this.getSelectionStyle(f))}return t},i.prototype.render=function(){var e=this.props,n=this.mapping();return Mh(t,r({},e,{records:n}))},i}(zd)},ym=function(t){var e=t.animation,n=t.y0,i=t.onClick;return Mh("group",null,t.records.map((function(t){return Mh("group",{key:t.key},t.children.map((function(t){var o=t.key,a=t.xMin,s=t.xMax,u=t.yMin,l=t.yMax,c=t.x,h=t.y,p=t.color,f=t.shape;return isNaN(a)||isNaN(s)||isNaN(u)||isNaN(l)?null:Mh("group",null,Mh("line",{style:{x1:c,y1:h[2],x2:c,y2:h[3],stroke:p,lineWidth:"2px",lineCap:"round"},animation:{appear:{easing:"linear",duration:300,property:["y1","y2"],start:{y1:0,y2:0}},update:{easing:"linear",duration:300,property:["x1","y1","x2","y2"]}}}),Mh("rect",{key:o,style:r({x:a,y:u,width:s-a,height:l-u,fill:p,radius:"2px"},f),onClick:i,animation:Z({appear:{easing:"linear",duration:300,property:["y","height"],start:{y:n,height:0}},update:{easing:"linear",duration:300,property:["x","y","width","height"]}},e)}))})))})))},vm=dm(ym);t.ArcGuide=Vv,t.Area=$d,t.AreaView=Kd,t.Axis=Ey,t.AxisView=wy,t.Candlestick=vm,t.CandlestickView=ym,t.Canvas=Bp,t.CanvasRenderer=bh,t.Chart=Yf,t.Children=un,t.Component=an,t.Fragment=function(t){return t.children},t.Gauge=Qg,t.GaugeView=Jg,t.Geometry=zd,t.Gesture=Ru,t.Guide=Hv,t.ImageGuide=Xv,t.Interval=uy,t.IntervalView=oy,t.Legend=Py,t.LegendView=Sy,t.Line=qd,t.LineGuide=Yv,t.LineView=Hd,t.LottieGuide=Uv,t.PieLabel=Zg,t.PieLabelView=qg,t.Player=Wp,t.Point=hy,t.PointGuide=Gv,t.PointView=cy,t.RectGuide=Wv,t.Scale=ef,t.ScrollBar=pm,t.ScrollBarView=hm,t.Smooth=Au,t.Sunburst=jg,t.SunburstView=Fg,t.TagGuide=zv,t.TextGuide=jv,t.Timeline=Gp,t.Tooltip=rg,t.TooltipView=ng,t.Treemap=_g,t.TreemapView=Lg,t.Zoom=sm,t.computeLayout=uc,t.createContext=function(t){var e={_currentValue:t},n=function(t,e){var n=t.children,r=i(t,["children"]);return Object.assign(e,r),n};return n.contextInjecter=e,e.Provider=function(t){var n=t.children;return e._currentValue=t.value,n},e.Injecter=n,e.Consumer=function(t){return(0,t.children)(e._currentValue)},e},t.createElement=Mh,t.createRef=jp,t.isEqual=Yu,t.jsx=Mh,t.registerTag=_u,t.withArea=Zd,t.withAxis=py,t.withCandlestick=dm,t.withGauge=$g,t.withGuide=Ty,t.withInterval=ny,t.withLegend=ky,t.withLine=Ud,t.withPieLabel=Hg,t.withPoint=ly,t.withScrollBar=um,t.withSunburst=Dg,t.withTooltip=qv,t.withTreemap=Rg,Object.defineProperty(t,"__esModule",{value:!0})}));
|