@antv/g 6.3.1 → 6.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,22 +1,22 @@
1
1
  /*!
2
2
  * @antv/g
3
3
  * @description A core module for rendering engine implements DOM API.
4
- * @version 6.3.1
5
- * @date 12/24/2025, 11:55:39 AM
4
+ * @version 6.3.2
5
+ * @date 10/10/2026, 9:45:49 AM
6
6
  * @author AntVis
7
7
  * @docs https://g.antv.antgroup.com/
8
8
  */
9
- !function(A,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((A="undefined"!=typeof globalThis?globalThis:A||self).G={})}(this,function(A){"use strict";function t(A){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},t(A)}function e(A){var e=function(A,e){if("object"!=t(A)||!A)return A;var n=A[Symbol.toPrimitive];if(void 0!==n){var r=n.call(A,e||"default");if("object"!=t(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(A)}(A,"string");return"symbol"==t(e)?e:e+""}function n(A,t,n){return(t=e(t))in A?Object.defineProperty(A,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):A[t]=n,A}function r(A,t){var e=Object.keys(A);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(A,t).enumerable})),e.push.apply(e,n)}return e}function i(A){for(var t=1;arguments.length>t;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?r(Object(e),!0).forEach(function(t){n(A,t,e[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(e)):r(Object(e)).forEach(function(t){Object.defineProperty(A,t,Object.getOwnPropertyDescriptor(e,t))})}return A}function a(A,t){if(!(A instanceof t))throw new TypeError("Cannot call a class as a function")}function o(A,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(A,e(r.key),r)}}function s(A,t,e){return t&&o(A.prototype,t),e&&o(A,e),Object.defineProperty(A,"prototype",{writable:!1}),A}function u(A,t){(null==t||t>A.length)&&(t=A.length);for(var e=0,n=Array(t);t>e;e++)n[e]=A[e];return n}function c(A,t){if(A){if("string"==typeof A)return u(A,t);var e={}.toString.call(A).slice(8,-1);return"Object"===e&&A.constructor&&(e=A.constructor.name),"Map"===e||"Set"===e?Array.from(A):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?u(A,t):void 0}}function l(A){return function(A){if(Array.isArray(A))return u(A)}(A)||function(A){if("undefined"!=typeof Symbol&&null!=A[Symbol.iterator]||null!=A["@@iterator"])return Array.from(A)}(A)||c(A)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(A){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},h(A)}function d(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(d=function(){return!!A})()}function f(A,e){if(e&&("object"==t(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}function B(A,t,e){return t=h(t),f(A,d()?Reflect.construct(t,e||[],h(A).constructor):t.apply(A,e))}function g(A,t){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,t){return A.__proto__=t,A},g(A,t)}function p(A,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(t&&t.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),t&&g(A,t)}function v(A,t){return function(A){if(Array.isArray(A))return A}(A)||function(A,t){var e=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null!=e){var n,r,i,a,o=[],s=!0,u=!1;try{if(i=(e=e.call(A)).next,0===t){if(Object(e)!==e)return;s=!1}else for(;!(s=(n=i.call(e)).done)&&(o.push(n.value),o.length!==t);s=!0);}catch(A){u=!0,r=A}finally{try{if(!s&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(u)throw r}}return o}}(A,t)||c(A,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var w={exports:{}};!function(A){var t=Object.prototype.hasOwnProperty,e="~";function n(){}function r(A,t,e){this.fn=A,this.context=t,this.once=e||!1}function i(A,t,n,i,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var o=new r(n,i||A,a),s=e?e+t:t;return A._events[s]?A._events[s].fn?A._events[s]=[A._events[s],o]:A._events[s].push(o):(A._events[s]=o,A._eventsCount++),A}function a(A,t){0===--A._eventsCount?A._events=new n:delete A._events[t]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(e=!1)),o.prototype.eventNames=function(){var A,n,r=[];if(0===this._eventsCount)return r;for(n in A=this._events)t.call(A,n)&&r.push(e?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(A)):r},o.prototype.listeners=function(A){var t=this._events[e?e+A:A];if(!t)return[];if(t.fn)return[t.fn];for(var n=0,r=t.length,i=Array(r);r>n;n++)i[n]=t[n].fn;return i},o.prototype.listenerCount=function(A){var t=this._events[e?e+A:A];return t?t.fn?1:t.length:0},o.prototype.emit=function(A,t,n,r,i,a){var o=e?e+A:A;if(!this._events[o])return!1;var s,u,c=this._events[o],l=arguments.length;if(c.fn){switch(c.once&&this.removeListener(A,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,r),!0;case 5:return c.fn.call(c.context,t,n,r,i),!0;case 6:return c.fn.call(c.context,t,n,r,i,a),!0}for(u=1,s=Array(l-1);l>u;u++)s[u-1]=arguments[u];c.fn.apply(c.context,s)}else{var h,d=c.length;for(u=0;d>u;u++)switch(c[u].once&&this.removeListener(A,c[u].fn,void 0,!0),l){case 1:c[u].fn.call(c[u].context);break;case 2:c[u].fn.call(c[u].context,t);break;case 3:c[u].fn.call(c[u].context,t,n);break;case 4:c[u].fn.call(c[u].context,t,n,r);break;default:if(!s)for(h=1,s=Array(l-1);l>h;h++)s[h-1]=arguments[h];c[u].fn.apply(c[u].context,s)}}return!0},o.prototype.on=function(A,t,e){return i(this,A,t,e,!1)},o.prototype.once=function(A,t,e){return i(this,A,t,e,!0)},o.prototype.removeListener=function(A,t,n,r){var i=e?e+A:A;if(!this._events[i])return this;if(!t)return a(this,i),this;var o=this._events[i];if(o.fn)o.fn!==t||r&&!o.once||n&&o.context!==n||a(this,i);else{for(var s=0,u=[],c=o.length;c>s;s++)(o[s].fn!==t||r&&!o[s].once||n&&o[s].context!==n)&&u.push(o[s]);u.length?this._events[i]=1===u.length?u[0]:u:a(this,i)}return this},o.prototype.removeAllListeners=function(A){var t;return A?this._events[t=e?e+A:A]&&a(this,t):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=e,o.EventEmitter=o,A.exports=o}(w);var y=w.exports,m=1e-6,C="undefined"!=typeof Float32Array?Float32Array:Array;function Q(){var A=new C(9);return C!=Float32Array&&(A[1]=0,A[2]=0,A[3]=0,A[5]=0,A[6]=0,A[7]=0),A[0]=1,A[4]=1,A[8]=1,A}function F(){var A=new C(16);return C!=Float32Array&&(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[6]=0,A[7]=0,A[8]=0,A[9]=0,A[11]=0,A[12]=0,A[13]=0,A[14]=0),A[0]=1,A[5]=1,A[10]=1,A[15]=1,A}function U(A){var t=new C(16);return t[0]=A[0],t[1]=A[1],t[2]=A[2],t[3]=A[3],t[4]=A[4],t[5]=A[5],t[6]=A[6],t[7]=A[7],t[8]=A[8],t[9]=A[9],t[10]=A[10],t[11]=A[11],t[12]=A[12],t[13]=A[13],t[14]=A[14],t[15]=A[15],t}function E(A,t){return A[0]=t[0],A[1]=t[1],A[2]=t[2],A[3]=t[3],A[4]=t[4],A[5]=t[5],A[6]=t[6],A[7]=t[7],A[8]=t[8],A[9]=t[9],A[10]=t[10],A[11]=t[11],A[12]=t[12],A[13]=t[13],A[14]=t[14],A[15]=t[15],A}function b(A,t,e,n,r,i,a,o,s,u,c,l,h,d,f,B,g){return A[0]=t,A[1]=e,A[2]=n,A[3]=r,A[4]=i,A[5]=a,A[6]=o,A[7]=s,A[8]=u,A[9]=c,A[10]=l,A[11]=h,A[12]=d,A[13]=f,A[14]=B,A[15]=g,A}function k(A){return A[0]=1,A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=1,A[6]=0,A[7]=0,A[8]=0,A[9]=0,A[10]=1,A[11]=0,A[12]=0,A[13]=0,A[14]=0,A[15]=1,A}function x(A,t){if(A===t){var e=t[1],n=t[2],r=t[3],i=t[6],a=t[7],o=t[11];A[1]=t[4],A[2]=t[8],A[3]=t[12],A[4]=e,A[6]=t[9],A[7]=t[13],A[8]=n,A[9]=i,A[11]=t[14],A[12]=r,A[13]=a,A[14]=o}else A[0]=t[0],A[1]=t[4],A[2]=t[8],A[3]=t[12],A[4]=t[1],A[5]=t[5],A[6]=t[9],A[7]=t[13],A[8]=t[2],A[9]=t[6],A[10]=t[10],A[11]=t[14],A[12]=t[3],A[13]=t[7],A[14]=t[11],A[15]=t[15];return A}function H(A,t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],u=t[7],c=t[8],l=t[9],h=t[10],d=t[11],f=t[12],B=t[13],g=t[14],p=t[15],v=e*o-n*a,w=e*s-r*a,y=e*u-i*a,m=n*s-r*o,C=n*u-i*o,Q=r*u-i*s,F=c*B-l*f,U=c*g-h*f,E=c*p-d*f,b=l*g-h*B,k=l*p-d*B,x=h*p-d*g,H=v*x-w*k+y*b+m*E-C*U+Q*F;return H?(A[0]=(o*x-s*k+u*b)*(H=1/H),A[1]=(r*k-n*x-i*b)*H,A[2]=(B*Q-g*C+p*m)*H,A[3]=(h*C-l*Q-d*m)*H,A[4]=(s*E-a*x-u*U)*H,A[5]=(e*x-r*E+i*U)*H,A[6]=(g*y-f*Q-p*w)*H,A[7]=(c*Q-h*y+d*w)*H,A[8]=(a*k-o*E+u*F)*H,A[9]=(n*E-e*k-i*F)*H,A[10]=(f*C-B*y+p*v)*H,A[11]=(l*y-c*C-d*v)*H,A[12]=(o*U-a*b-s*F)*H,A[13]=(e*b-n*U+r*F)*H,A[14]=(B*w-f*m-g*v)*H,A[15]=(c*m-l*w+h*v)*H,A):null}function I(A){var t=A[0],e=A[1],n=A[2],r=A[4],i=A[5],a=A[6],o=A[8],s=A[9],u=A[10],c=A[12],l=A[13],h=A[14],d=t*i-e*r,f=t*a-n*r,B=e*a-n*i,g=o*l-s*c,p=o*h-u*c,v=s*h-u*l;return A[7]*(t*v-e*p+n*g)-A[3]*(r*v-i*p+a*g)+A[15]*(o*B-s*f+u*d)-A[11]*(c*B-l*f+h*d)}function T(A,t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],h=t[9],d=t[10],f=t[11],B=t[12],g=t[13],p=t[14],v=t[15],w=e[0],y=e[1],m=e[2],C=e[3];return A[0]=w*n+y*o+m*l+C*B,A[1]=w*r+y*s+m*h+C*g,A[2]=w*i+y*u+m*d+C*p,A[3]=w*a+y*c+m*f+C*v,A[4]=(w=e[4])*n+(y=e[5])*o+(m=e[6])*l+(C=e[7])*B,A[5]=w*r+y*s+m*h+C*g,A[6]=w*i+y*u+m*d+C*p,A[7]=w*a+y*c+m*f+C*v,A[8]=(w=e[8])*n+(y=e[9])*o+(m=e[10])*l+(C=e[11])*B,A[9]=w*r+y*s+m*h+C*g,A[10]=w*i+y*u+m*d+C*p,A[11]=w*a+y*c+m*f+C*v,A[12]=(w=e[12])*n+(y=e[13])*o+(m=e[14])*l+(C=e[15])*B,A[13]=w*r+y*s+m*h+C*g,A[14]=w*i+y*u+m*d+C*p,A[15]=w*a+y*c+m*f+C*v,A}function M(A,t,e){var n,r,i,a,o,s,u,c,l,h,d,f,B=e[0],g=e[1],p=e[2];return t===A?(A[12]=t[0]*B+t[4]*g+t[8]*p+t[12],A[13]=t[1]*B+t[5]*g+t[9]*p+t[13],A[14]=t[2]*B+t[6]*g+t[10]*p+t[14],A[15]=t[3]*B+t[7]*g+t[11]*p+t[15]):(r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],h=t[9],d=t[10],f=t[11],A[0]=n=t[0],A[1]=r,A[2]=i,A[3]=a,A[4]=o,A[5]=s,A[6]=u,A[7]=c,A[8]=l,A[9]=h,A[10]=d,A[11]=f,A[12]=n*B+o*g+l*p+t[12],A[13]=r*B+s*g+h*p+t[13],A[14]=i*B+u*g+d*p+t[14],A[15]=a*B+c*g+f*p+t[15]),A}function S(A,t,e){var n=e[0],r=e[1],i=e[2];return A[0]=t[0]*n,A[1]=t[1]*n,A[2]=t[2]*n,A[3]=t[3]*n,A[4]=t[4]*r,A[5]=t[5]*r,A[6]=t[6]*r,A[7]=t[7]*r,A[8]=t[8]*i,A[9]=t[9]*i,A[10]=t[10]*i,A[11]=t[11]*i,A[12]=t[12],A[13]=t[13],A[14]=t[14],A[15]=t[15],A}function L(A,t,e){var n=Math.sin(e),r=Math.cos(e),i=t[4],a=t[5],o=t[6],s=t[7],u=t[8],c=t[9],l=t[10],h=t[11];return t!==A&&(A[0]=t[0],A[1]=t[1],A[2]=t[2],A[3]=t[3],A[12]=t[12],A[13]=t[13],A[14]=t[14],A[15]=t[15]),A[4]=i*r+u*n,A[5]=a*r+c*n,A[6]=o*r+l*n,A[7]=s*r+h*n,A[8]=u*r-i*n,A[9]=c*r-a*n,A[10]=l*r-o*n,A[11]=h*r-s*n,A}function D(A,t,e){var n=Math.sin(e),r=Math.cos(e),i=t[0],a=t[1],o=t[2],s=t[3],u=t[8],c=t[9],l=t[10],h=t[11];return t!==A&&(A[4]=t[4],A[5]=t[5],A[6]=t[6],A[7]=t[7],A[12]=t[12],A[13]=t[13],A[14]=t[14],A[15]=t[15]),A[0]=i*r-u*n,A[1]=a*r-c*n,A[2]=o*r-l*n,A[3]=s*r-h*n,A[8]=i*n+u*r,A[9]=a*n+c*r,A[10]=o*n+l*r,A[11]=s*n+h*r,A}function P(A,t){return A[0]=1,A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=1,A[6]=0,A[7]=0,A[8]=0,A[9]=0,A[10]=1,A[11]=0,A[12]=t[0],A[13]=t[1],A[14]=t[2],A[15]=1,A}function N(A,t){return A[0]=t[0],A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=t[1],A[6]=0,A[7]=0,A[8]=0,A[9]=0,A[10]=t[2],A[11]=0,A[12]=0,A[13]=0,A[14]=0,A[15]=1,A}function O(A,t,e){var n,r,i,a=e[0],o=e[1],s=e[2],u=Math.sqrt(a*a+o*o+s*s);return m>u?null:(a*=u=1/u,o*=u,s*=u,n=Math.sin(t),A[0]=a*a*(i=1-(r=Math.cos(t)))+r,A[1]=o*a*i+s*n,A[2]=s*a*i-o*n,A[3]=0,A[4]=a*o*i-s*n,A[5]=o*o*i+r,A[6]=s*o*i+a*n,A[7]=0,A[8]=a*s*i+o*n,A[9]=o*s*i-a*n,A[10]=s*s*i+r,A[11]=0,A[12]=0,A[13]=0,A[14]=0,A[15]=1,A)}function K(A,t){var e=Math.sin(t),n=Math.cos(t);return A[0]=1,A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=n,A[6]=e,A[7]=0,A[8]=0,A[9]=-e,A[10]=n,A[11]=0,A[12]=0,A[13]=0,A[14]=0,A[15]=1,A}function R(A,t){var e=Math.sin(t),n=Math.cos(t);return A[0]=n,A[1]=0,A[2]=-e,A[3]=0,A[4]=0,A[5]=1,A[6]=0,A[7]=0,A[8]=e,A[9]=0,A[10]=n,A[11]=0,A[12]=0,A[13]=0,A[14]=0,A[15]=1,A}function G(A,t){var e=Math.sin(t),n=Math.cos(t);return A[0]=n,A[1]=e,A[2]=0,A[3]=0,A[4]=-e,A[5]=n,A[6]=0,A[7]=0,A[8]=0,A[9]=0,A[10]=1,A[11]=0,A[12]=0,A[13]=0,A[14]=0,A[15]=1,A}function V(A,t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=n+n,s=r+r,u=i+i,c=n*o,l=n*s,h=n*u,d=r*s,f=r*u,B=i*u,g=a*o,p=a*s,v=a*u;return A[0]=1-(d+B),A[1]=l+v,A[2]=h-p,A[3]=0,A[4]=l-v,A[5]=1-(c+B),A[6]=f+g,A[7]=0,A[8]=h+p,A[9]=f-g,A[10]=1-(c+d),A[11]=0,A[12]=e[0],A[13]=e[1],A[14]=e[2],A[15]=1,A}function _(A,t){return A[0]=t[12],A[1]=t[13],A[2]=t[14],A}function X(A,t){var e=t[0],n=t[1],r=t[2],i=t[4],a=t[5],o=t[6],s=t[8],u=t[9],c=t[10];return A[0]=Math.sqrt(e*e+n*n+r*r),A[1]=Math.sqrt(i*i+a*a+o*o),A[2]=Math.sqrt(s*s+u*u+c*c),A}function Y(A,t){var e=new C(3);X(e,t);var n=1/e[0],r=1/e[1],i=1/e[2],a=t[0]*n,o=t[1]*r,s=t[2]*i,u=t[4]*n,c=t[5]*r,l=t[6]*i,h=t[8]*n,d=t[9]*r,f=t[10]*i,B=a+c+f,g=0;return B>0?(A[3]=.25*(g=2*Math.sqrt(B+1)),A[0]=(l-d)/g,A[1]=(h-s)/g,A[2]=(o-u)/g):a>c&&a>f?(A[3]=(l-d)/(g=2*Math.sqrt(1+a-c-f)),A[0]=.25*g,A[1]=(o+u)/g,A[2]=(h+s)/g):c>f?(A[3]=(h-s)/(g=2*Math.sqrt(1+c-a-f)),A[0]=(o+u)/g,A[1]=.25*g,A[2]=(l+d)/g):(A[3]=(o-u)/(g=2*Math.sqrt(1+f-a-c)),A[0]=(h+s)/g,A[1]=(l+d)/g,A[2]=.25*g),A}function W(A,t,e,n,r){var i=t[0],a=t[1],o=t[2],s=t[3],u=i+i,c=a+a,l=o+o,h=i*u,d=i*c,f=i*l,B=a*c,g=a*l,p=o*l,v=s*u,w=s*c,y=s*l,m=n[0],C=n[1],Q=n[2],F=r[0],U=r[1],E=r[2],b=(1-(B+p))*m,k=(d+y)*m,x=(f-w)*m,H=(d-y)*C,I=(1-(h+p))*C,T=(g+v)*C,M=(f+w)*Q,S=(g-v)*Q,L=(1-(h+B))*Q;return A[0]=b,A[1]=k,A[2]=x,A[3]=0,A[4]=H,A[5]=I,A[6]=T,A[7]=0,A[8]=M,A[9]=S,A[10]=L,A[11]=0,A[12]=e[0]+F-(b*F+H*U+M*E),A[13]=e[1]+U-(k*F+I*U+S*E),A[14]=e[2]+E-(x*F+T*U+L*E),A[15]=1,A}function J(A,t){var e=t[0],n=t[1],r=t[2],i=t[3],a=e+e,o=n+n,s=r+r,u=e*a,c=n*a,l=n*o,h=r*a,d=r*o,f=r*s,B=i*a,g=i*o,p=i*s;return A[0]=1-l-f,A[1]=c+p,A[2]=h-g,A[3]=0,A[4]=c-p,A[5]=1-u-f,A[6]=d+B,A[7]=0,A[8]=h+g,A[9]=d-B,A[10]=1-u-l,A[11]=0,A[12]=0,A[13]=0,A[14]=0,A[15]=1,A}function Z(A,t,e,n,r){var i=1/Math.tan(t/2);if(A[0]=i/e,A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=i,A[6]=0,A[7]=0,A[8]=0,A[9]=0,A[11]=-1,A[12]=0,A[13]=0,A[15]=0,null!=r&&r!==1/0){var a=1/(n-r);A[10]=(r+n)*a,A[14]=2*r*n*a}else A[10]=-1,A[14]=-2*n;return A}function z(A,t,e,n,r,i,a){var o=1/(t-e),s=1/(n-r),u=1/(i-a);return A[0]=-2*o,A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=-2*s,A[6]=0,A[7]=0,A[8]=0,A[9]=0,A[10]=2*u,A[11]=0,A[12]=(t+e)*o,A[13]=(r+n)*s,A[14]=(a+i)*u,A[15]=1,A}var j=z;function q(A,t,e,n,r,i,a){var o=1/(t-e),s=1/(n-r),u=1/(i-a);return A[0]=-2*o,A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=-2*s,A[6]=0,A[7]=0,A[8]=0,A[9]=0,A[10]=u,A[11]=0,A[12]=(t+e)*o,A[13]=(r+n)*s,A[14]=i*u,A[15]=1,A}function $(A,t,e,n){var r,i,a,o,s,u,c,l,h,d,f=t[0],B=t[1],g=t[2],p=n[0],v=n[1],w=n[2],y=e[0],C=e[1],Q=e[2];return m>Math.abs(f-y)&&m>Math.abs(B-C)&&m>Math.abs(g-Q)?k(A):(h=g-Q,(d=Math.sqrt((r=v*(h*=d=1/Math.sqrt((c=f-y)*c+(l=B-C)*l+h*h))-w*(l*=d))*r+(i=w*(c*=d)-p*h)*i+(a=p*l-v*c)*a))?(r*=d=1/d,i*=d,a*=d):(r=0,i=0,a=0),(d=Math.sqrt((o=l*a-h*i)*o+(s=h*r-c*a)*s+(u=c*i-l*r)*u))?(o*=d=1/d,s*=d,u*=d):(o=0,s=0,u=0),A[0]=r,A[1]=o,A[2]=c,A[3]=0,A[4]=i,A[5]=s,A[6]=l,A[7]=0,A[8]=a,A[9]=u,A[10]=h,A[11]=0,A[12]=-(r*f+i*B+a*g),A[13]=-(o*f+s*B+u*g),A[14]=-(c*f+l*B+h*g),A[15]=1,A)}function AA(A,t,e){return A[0]=t[0]-e[0],A[1]=t[1]-e[1],A[2]=t[2]-e[2],A[3]=t[3]-e[3],A[4]=t[4]-e[4],A[5]=t[5]-e[5],A[6]=t[6]-e[6],A[7]=t[7]-e[7],A[8]=t[8]-e[8],A[9]=t[9]-e[9],A[10]=t[10]-e[10],A[11]=t[11]-e[11],A[12]=t[12]-e[12],A[13]=t[13]-e[13],A[14]=t[14]-e[14],A[15]=t[15]-e[15],A}var tA=T,eA=Object.freeze({__proto__:null,add:function(A,t,e){return A[0]=t[0]+e[0],A[1]=t[1]+e[1],A[2]=t[2]+e[2],A[3]=t[3]+e[3],A[4]=t[4]+e[4],A[5]=t[5]+e[5],A[6]=t[6]+e[6],A[7]=t[7]+e[7],A[8]=t[8]+e[8],A[9]=t[9]+e[9],A[10]=t[10]+e[10],A[11]=t[11]+e[11],A[12]=t[12]+e[12],A[13]=t[13]+e[13],A[14]=t[14]+e[14],A[15]=t[15]+e[15],A},adjoint:function(A,t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],u=t[7],c=t[8],l=t[9],h=t[10],d=t[11],f=t[12],B=t[13],g=t[14],p=t[15],v=e*o-n*a,w=e*s-r*a,y=e*u-i*a,m=n*s-r*o,C=n*u-i*o,Q=r*u-i*s,F=c*B-l*f,U=c*g-h*f,E=c*p-d*f,b=l*g-h*B,k=l*p-d*B,x=h*p-d*g;return A[0]=o*x-s*k+u*b,A[1]=r*k-n*x-i*b,A[2]=B*Q-g*C+p*m,A[3]=h*C-l*Q-d*m,A[4]=s*E-a*x-u*U,A[5]=e*x-r*E+i*U,A[6]=g*y-f*Q-p*w,A[7]=c*Q-h*y+d*w,A[8]=a*k-o*E+u*F,A[9]=n*E-e*k-i*F,A[10]=f*C-B*y+p*v,A[11]=l*y-c*C-d*v,A[12]=o*U-a*b-s*F,A[13]=e*b-n*U+r*F,A[14]=B*w-f*m-g*v,A[15]=c*m-l*w+h*v,A},clone:U,copy:E,create:F,decompose:function(A,t,e,n){t[0]=n[12],t[1]=n[13],t[2]=n[14];var r=n[0],i=n[1],a=n[2],o=n[4],s=n[5],u=n[6],c=n[8],l=n[9],h=n[10];e[0]=Math.sqrt(r*r+i*i+a*a),e[1]=Math.sqrt(o*o+s*s+u*u),e[2]=Math.sqrt(c*c+l*l+h*h);var d=1/e[0],f=1/e[1],B=1/e[2],g=r*d,p=i*f,v=a*B,w=o*d,y=s*f,m=u*B,C=c*d,Q=l*f,F=h*B,U=g+y+F,E=0;return U>0?(A[3]=.25*(E=2*Math.sqrt(U+1)),A[0]=(m-Q)/E,A[1]=(C-v)/E,A[2]=(p-w)/E):g>y&&g>F?(A[3]=(m-Q)/(E=2*Math.sqrt(1+g-y-F)),A[0]=.25*E,A[1]=(p+w)/E,A[2]=(C+v)/E):y>F?(A[3]=(C-v)/(E=2*Math.sqrt(1+y-g-F)),A[0]=(p+w)/E,A[1]=.25*E,A[2]=(m+Q)/E):(A[3]=(p-w)/(E=2*Math.sqrt(1+F-g-y)),A[0]=(C+v)/E,A[1]=(m+Q)/E,A[2]=.25*E),A},determinant:I,equals:function(A,t){var e=A[0],n=A[1],r=A[2],i=A[3],a=A[4],o=A[5],s=A[6],u=A[7],c=A[8],l=A[9],h=A[10],d=A[11],f=A[12],B=A[13],g=A[14],p=A[15],v=t[0],w=t[1],y=t[2],C=t[3],Q=t[4],F=t[5],U=t[6],E=t[7],b=t[8],k=t[9],x=t[10],H=t[11],I=t[12],T=t[13],M=t[14],S=t[15];return!(Math.abs(e-v)>m*Math.max(1,Math.abs(e),Math.abs(v))||Math.abs(n-w)>m*Math.max(1,Math.abs(n),Math.abs(w))||Math.abs(r-y)>m*Math.max(1,Math.abs(r),Math.abs(y))||Math.abs(i-C)>m*Math.max(1,Math.abs(i),Math.abs(C))||Math.abs(a-Q)>m*Math.max(1,Math.abs(a),Math.abs(Q))||Math.abs(o-F)>m*Math.max(1,Math.abs(o),Math.abs(F))||Math.abs(s-U)>m*Math.max(1,Math.abs(s),Math.abs(U))||Math.abs(u-E)>m*Math.max(1,Math.abs(u),Math.abs(E))||Math.abs(c-b)>m*Math.max(1,Math.abs(c),Math.abs(b))||Math.abs(l-k)>m*Math.max(1,Math.abs(l),Math.abs(k))||Math.abs(h-x)>m*Math.max(1,Math.abs(h),Math.abs(x))||Math.abs(d-H)>m*Math.max(1,Math.abs(d),Math.abs(H))||Math.abs(f-I)>m*Math.max(1,Math.abs(f),Math.abs(I))||Math.abs(B-T)>m*Math.max(1,Math.abs(B),Math.abs(T))||Math.abs(g-M)>m*Math.max(1,Math.abs(g),Math.abs(M))||Math.abs(p-S)>m*Math.max(1,Math.abs(p),Math.abs(S)))},exactEquals:function(A,t){return A[0]===t[0]&&A[1]===t[1]&&A[2]===t[2]&&A[3]===t[3]&&A[4]===t[4]&&A[5]===t[5]&&A[6]===t[6]&&A[7]===t[7]&&A[8]===t[8]&&A[9]===t[9]&&A[10]===t[10]&&A[11]===t[11]&&A[12]===t[12]&&A[13]===t[13]&&A[14]===t[14]&&A[15]===t[15]},frob:function(A){return Math.sqrt(A[0]*A[0]+A[1]*A[1]+A[2]*A[2]+A[3]*A[3]+A[4]*A[4]+A[5]*A[5]+A[6]*A[6]+A[7]*A[7]+A[8]*A[8]+A[9]*A[9]+A[10]*A[10]+A[11]*A[11]+A[12]*A[12]+A[13]*A[13]+A[14]*A[14]+A[15]*A[15])},fromQuat:J,fromQuat2:function(A,t){var e=new C(3),n=-t[0],r=-t[1],i=-t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=n*n+r*r+i*i+a*a;return l>0?(e[0]=2*(o*a+c*n+s*i-u*r)/l,e[1]=2*(s*a+c*r+u*n-o*i)/l,e[2]=2*(u*a+c*i+o*r-s*n)/l):(e[0]=2*(o*a+c*n+s*i-u*r),e[1]=2*(s*a+c*r+u*n-o*i),e[2]=2*(u*a+c*i+o*r-s*n)),V(A,t,e),A},fromRotation:O,fromRotationTranslation:V,fromRotationTranslationScale:function(A,t,e,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=r+r,u=i+i,c=a+a,l=r*s,h=r*u,d=r*c,f=i*u,B=i*c,g=a*c,p=o*s,v=o*u,w=o*c,y=n[0],m=n[1],C=n[2];return A[0]=(1-(f+g))*y,A[1]=(h+w)*y,A[2]=(d-v)*y,A[3]=0,A[4]=(h-w)*m,A[5]=(1-(l+g))*m,A[6]=(B+p)*m,A[7]=0,A[8]=(d+v)*C,A[9]=(B-p)*C,A[10]=(1-(l+f))*C,A[11]=0,A[12]=e[0],A[13]=e[1],A[14]=e[2],A[15]=1,A},fromRotationTranslationScaleOrigin:W,fromScaling:N,fromTranslation:P,fromValues:function(A,t,e,n,r,i,a,o,s,u,c,l,h,d,f,B){var g=new C(16);return g[0]=A,g[1]=t,g[2]=e,g[3]=n,g[4]=r,g[5]=i,g[6]=a,g[7]=o,g[8]=s,g[9]=u,g[10]=c,g[11]=l,g[12]=h,g[13]=d,g[14]=f,g[15]=B,g},fromXRotation:K,fromYRotation:R,fromZRotation:G,frustum:function(A,t,e,n,r,i,a){var o=1/(e-t),s=1/(r-n),u=1/(i-a);return A[0]=2*i*o,A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=2*i*s,A[6]=0,A[7]=0,A[8]=(e+t)*o,A[9]=(r+n)*s,A[10]=(a+i)*u,A[11]=-1,A[12]=0,A[13]=0,A[14]=a*i*2*u,A[15]=0,A},getRotation:Y,getScaling:X,getTranslation:_,identity:k,invert:H,lookAt:$,mul:tA,multiply:T,multiplyScalar:function(A,t,e){return A[0]=t[0]*e,A[1]=t[1]*e,A[2]=t[2]*e,A[3]=t[3]*e,A[4]=t[4]*e,A[5]=t[5]*e,A[6]=t[6]*e,A[7]=t[7]*e,A[8]=t[8]*e,A[9]=t[9]*e,A[10]=t[10]*e,A[11]=t[11]*e,A[12]=t[12]*e,A[13]=t[13]*e,A[14]=t[14]*e,A[15]=t[15]*e,A},multiplyScalarAndAdd:function(A,t,e,n){return A[0]=t[0]+e[0]*n,A[1]=t[1]+e[1]*n,A[2]=t[2]+e[2]*n,A[3]=t[3]+e[3]*n,A[4]=t[4]+e[4]*n,A[5]=t[5]+e[5]*n,A[6]=t[6]+e[6]*n,A[7]=t[7]+e[7]*n,A[8]=t[8]+e[8]*n,A[9]=t[9]+e[9]*n,A[10]=t[10]+e[10]*n,A[11]=t[11]+e[11]*n,A[12]=t[12]+e[12]*n,A[13]=t[13]+e[13]*n,A[14]=t[14]+e[14]*n,A[15]=t[15]+e[15]*n,A},ortho:j,orthoNO:z,orthoZO:q,perspective:Z,perspectiveFromFieldOfView:function(A,t,e,n){var r=Math.tan(t.upDegrees*Math.PI/180),i=Math.tan(t.downDegrees*Math.PI/180),a=Math.tan(t.leftDegrees*Math.PI/180),o=Math.tan(t.rightDegrees*Math.PI/180),s=2/(a+o),u=2/(r+i);return A[0]=s,A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=u,A[6]=0,A[7]=0,A[8]=-(a-o)*s*.5,A[9]=(r-i)*u*.5,A[10]=n/(e-n),A[11]=-1,A[12]=0,A[13]=0,A[14]=n*e/(e-n),A[15]=0,A},perspectiveNO:Z,perspectiveZO:function(A,t,e,n,r){var i=1/Math.tan(t/2);if(A[0]=i/e,A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=i,A[6]=0,A[7]=0,A[8]=0,A[9]=0,A[11]=-1,A[12]=0,A[13]=0,A[15]=0,null!=r&&r!==1/0){var a=1/(n-r);A[10]=r*a,A[14]=r*n*a}else A[10]=-1,A[14]=-n;return A},rotate:function(A,t,e,n){var r,i,a,o,s,u,c,l,h,d,f,B,g,p,v,w,y,C,Q,F,U,E,b,k,x=n[0],H=n[1],I=n[2],T=Math.sqrt(x*x+H*H+I*I);return m>T?null:(x*=T=1/T,H*=T,I*=T,r=Math.sin(e),s=t[1],u=t[2],c=t[3],h=t[5],d=t[6],f=t[7],g=t[9],p=t[10],v=t[11],Q=x*H*(a=1-(i=Math.cos(e)))-I*r,F=H*H*a+i,U=I*H*a+x*r,E=x*I*a+H*r,b=H*I*a-x*r,k=I*I*a+i,A[0]=(o=t[0])*(w=x*x*a+i)+(l=t[4])*(y=H*x*a+I*r)+(B=t[8])*(C=I*x*a-H*r),A[1]=s*w+h*y+g*C,A[2]=u*w+d*y+p*C,A[3]=c*w+f*y+v*C,A[4]=o*Q+l*F+B*U,A[5]=s*Q+h*F+g*U,A[6]=u*Q+d*F+p*U,A[7]=c*Q+f*F+v*U,A[8]=o*E+l*b+B*k,A[9]=s*E+h*b+g*k,A[10]=u*E+d*b+p*k,A[11]=c*E+f*b+v*k,t!==A&&(A[12]=t[12],A[13]=t[13],A[14]=t[14],A[15]=t[15]),A)},rotateX:L,rotateY:D,rotateZ:function(A,t,e){var n=Math.sin(e),r=Math.cos(e),i=t[0],a=t[1],o=t[2],s=t[3],u=t[4],c=t[5],l=t[6],h=t[7];return t!==A&&(A[8]=t[8],A[9]=t[9],A[10]=t[10],A[11]=t[11],A[12]=t[12],A[13]=t[13],A[14]=t[14],A[15]=t[15]),A[0]=i*r+u*n,A[1]=a*r+c*n,A[2]=o*r+l*n,A[3]=s*r+h*n,A[4]=u*r-i*n,A[5]=c*r-a*n,A[6]=l*r-o*n,A[7]=h*r-s*n,A},scale:S,set:b,str:function(A){return"mat4("+A[0]+", "+A[1]+", "+A[2]+", "+A[3]+", "+A[4]+", "+A[5]+", "+A[6]+", "+A[7]+", "+A[8]+", "+A[9]+", "+A[10]+", "+A[11]+", "+A[12]+", "+A[13]+", "+A[14]+", "+A[15]+")"},sub:AA,subtract:AA,targetTo:function(A,t,e,n){var r=t[0],i=t[1],a=t[2],o=n[0],s=n[1],u=n[2],c=r-e[0],l=i-e[1],h=a-e[2],d=c*c+l*l+h*h;d>0&&(c*=d=1/Math.sqrt(d),l*=d,h*=d);var f=s*h-u*l,B=u*c-o*h,g=o*l-s*c;return(d=f*f+B*B+g*g)>0&&(f*=d=1/Math.sqrt(d),B*=d,g*=d),A[0]=f,A[1]=B,A[2]=g,A[3]=0,A[4]=l*g-h*B,A[5]=h*f-c*g,A[6]=c*B-l*f,A[7]=0,A[8]=c,A[9]=l,A[10]=h,A[11]=0,A[12]=r,A[13]=i,A[14]=a,A[15]=1,A},translate:M,transpose:x});function nA(){var A=new C(3);return C!=Float32Array&&(A[0]=0,A[1]=0,A[2]=0),A}function rA(A){var t=new C(3);return t[0]=A[0],t[1]=A[1],t[2]=A[2],t}function iA(A){var t=A[0],e=A[1],n=A[2];return Math.sqrt(t*t+e*e+n*n)}function aA(A,t,e){var n=new C(3);return n[0]=A,n[1]=t,n[2]=e,n}function oA(A,t){return A[0]=t[0],A[1]=t[1],A[2]=t[2],A}function sA(A,t,e,n){return A[0]=t,A[1]=e,A[2]=n,A}function uA(A,t,e){return A[0]=t[0]+e[0],A[1]=t[1]+e[1],A[2]=t[2]+e[2],A}function cA(A,t,e){return A[0]=t[0]-e[0],A[1]=t[1]-e[1],A[2]=t[2]-e[2],A}function lA(A,t,e){return A[0]=t[0]*e,A[1]=t[1]*e,A[2]=t[2]*e,A}function hA(A,t){var e=t[0],n=t[1],r=t[2],i=e*e+n*n+r*r;return i>0&&(i=1/Math.sqrt(i)),A[0]=t[0]*i,A[1]=t[1]*i,A[2]=t[2]*i,A}function dA(A,t){return A[0]*t[0]+A[1]*t[1]+A[2]*t[2]}function fA(A,t,e){var n=t[0],r=t[1],i=t[2],a=e[0],o=e[1],s=e[2];return A[0]=r*s-i*o,A[1]=i*a-n*s,A[2]=n*o-r*a,A}function BA(A,t,e,n){var r=t[0],i=t[1],a=t[2];return A[0]=r+n*(e[0]-r),A[1]=i+n*(e[1]-i),A[2]=a+n*(e[2]-a),A}function gA(A,t,e){var n=t[0],r=t[1],i=t[2],a=e[3]*n+e[7]*r+e[11]*i+e[15];return A[0]=(e[0]*n+e[4]*r+e[8]*i+e[12])/(a=a||1),A[1]=(e[1]*n+e[5]*r+e[9]*i+e[13])/a,A[2]=(e[2]*n+e[6]*r+e[10]*i+e[14])/a,A}function pA(A,t){var e=A[0],n=A[1],r=A[2],i=t[0],a=t[1],o=t[2];return m*Math.max(1,Math.abs(e),Math.abs(i))>=Math.abs(e-i)&&m*Math.max(1,Math.abs(n),Math.abs(a))>=Math.abs(n-a)&&m*Math.max(1,Math.abs(r),Math.abs(o))>=Math.abs(r-o)}var vA=cA,wA=function(A,t){var e=t[0]-A[0],n=t[1]-A[1],r=t[2]-A[2];return Math.sqrt(e*e+n*n+r*r)},yA=iA;function mA(){var A=new C(4);return C!=Float32Array&&(A[0]=0,A[1]=0,A[2]=0,A[3]=0),A}function CA(A,t,e,n){var r=new C(4);return r[0]=A,r[1]=t,r[2]=e,r[3]=n,r}function QA(A,t,e){var n=t[0],r=t[1],i=t[2],a=t[3];return A[0]=e[0]*n+e[4]*r+e[8]*i+e[12]*a,A[1]=e[1]*n+e[5]*r+e[9]*i+e[13]*a,A[2]=e[2]*n+e[6]*r+e[10]*i+e[14]*a,A[3]=e[3]*n+e[7]*r+e[11]*i+e[15]*a,A}function FA(){var A=new C(4);return C!=Float32Array&&(A[0]=0,A[1]=0,A[2]=0),A[3]=1,A}function UA(A,t,e){var n=Math.sin(e*=.5);return A[0]=n*t[0],A[1]=n*t[1],A[2]=n*t[2],A[3]=Math.cos(e),A}function EA(A,t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=e[0],s=e[1],u=e[2],c=e[3];return A[0]=n*c+a*o+r*u-i*s,A[1]=r*c+a*s+i*o-n*u,A[2]=i*c+a*u+n*s-r*o,A[3]=a*c-n*o-r*s-i*u,A}function bA(A,t){var e=t[0],n=t[1],r=t[2],i=t[3],a=e*e+n*n+r*r+i*i,o=a?1/a:0;return A[0]=-e*o,A[1]=-n*o,A[2]=-r*o,A[3]=i*o,A}function kA(A,t,e,n){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"zyx",i=Math.PI/360;n*=i,e*=i;var a=Math.sin(t*=i),o=Math.cos(t),s=Math.sin(e),u=Math.cos(e),c=Math.sin(n),l=Math.cos(n);switch(r){case"xyz":A[0]=a*u*l+o*s*c,A[1]=o*s*l-a*u*c,A[2]=o*u*c+a*s*l,A[3]=o*u*l-a*s*c;break;case"xzy":A[0]=a*u*l-o*s*c,A[1]=o*s*l-a*u*c,A[2]=o*u*c+a*s*l,A[3]=o*u*l+a*s*c;break;case"yxz":A[0]=a*u*l+o*s*c,A[1]=o*s*l-a*u*c,A[2]=o*u*c-a*s*l,A[3]=o*u*l+a*s*c;break;case"yzx":A[0]=a*u*l+o*s*c,A[1]=o*s*l+a*u*c,A[2]=o*u*c-a*s*l,A[3]=o*u*l-a*s*c;break;case"zxy":A[0]=a*u*l-o*s*c,A[1]=o*s*l+a*u*c,A[2]=o*u*c+a*s*l,A[3]=o*u*l-a*s*c;break;case"zyx":A[0]=a*u*l-o*s*c,A[1]=o*s*l+a*u*c,A[2]=o*u*c-a*s*l,A[3]=o*u*l+a*s*c;break;default:throw Error("Unknown angle order "+r)}return A}nA(),function(){var A=mA()}();var xA=CA,HA=function(A,t){return A[0]=t[0],A[1]=t[1],A[2]=t[2],A[3]=t[3],A},IA=function(A,t,e,n,r){return A[0]=t,A[1]=e,A[2]=n,A[3]=r,A},TA=EA,MA=function(A,t){var e=t[0],n=t[1],r=t[2],i=t[3],a=e*e+n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),A[0]=e*a,A[1]=n*a,A[2]=r*a,A[3]=i*a,A};function SA(){var A=new C(2);return C!=Float32Array&&(A[0]=0,A[1]=0),A}function LA(A){return"function"==typeof A}function DA(A){return null==A}function PA(A){return Array.isArray(A)}nA(),aA(1,0,0),aA(0,1,0),FA(),FA(),Q(),function(){var A=SA()}();var NA={}.toString,OA=function(A,t){return NA.call(A)==="[object "+t+"]"};function KA(A){if(!Array.isArray(A))return-1/0;var t=A.length;if(!t)return-1/0;for(var e=A[0],n=1;t>n;n++)e=Math.max(e,A[n]);return e}var RA=function(A){if(PA(A))return A.reduce(function(A,t){return Math.min(A,t)},A[0])};function GA(A){return"string"==typeof A}var VA=function(A,t,e){return t>A?t:A>e?e:A};function _A(A){return"number"==typeof A}function XA(A,t,e){return void 0===e&&(e=1e-5),A===t||e>Math.abs(A-t)}var YA=function(A,t){return(A%t+t)%t},WA=function(A){return OA(A,"Boolean")},JA=function(A){return void 0===A},ZA=function(){return ZA=Object.assign||function(A){for(var t,e=1,n=arguments.length;n>e;e++)for(var r in t=arguments[e])Object.prototype.hasOwnProperty.call(t,r)&&(A[r]=t[r]);return A},ZA.apply(this,arguments)};function zA(A,t,e){if(e||2===arguments.length)for(var n,r=0,i=t.length;i>r;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return A.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var jA={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function qA(A,t,e){if(A[e].length>7){A[e].shift();for(var n=A[e],r=e;n.length;)t[e]="A",A.splice(r+=1,0,["C"].concat(n.splice(0,6)));A.splice(e,1)}}var $A={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function At(A){return Array.isArray(A)&&A.every(function(A){var t=A[0].toLowerCase();return $A[t]===A.length-1&&"achlmqstvz".includes(t)})}function tt(A){return At(A)&&A.every(function(A){var t=A[0];return t===t.toUpperCase()})}function et(A){return tt(A)&&A.every(function(A){return"ACLMQZ".includes(A[0])})}function nt(A){for(var t=A.pathValue[A.segmentStart],e=t.toLowerCase(),n=A.data;n.length>=$A[e]&&("m"===e&&n.length>2?(A.segments.push([t].concat(n.splice(0,2))),e="l",t="m"===t?"l":"L"):A.segments.push([t].concat(n.splice(0,$A[e]))),$A[e]););}function rt(A){var t=A.index,e=A.pathValue,n=e.charCodeAt(t);return 48===n?(A.param=0,void(A.index+=1)):49===n?(A.param=1,void(A.index+=1)):void(A.err='[path-util]: invalid Arc flag "'.concat(e[t],'", expecting 0 or 1 at index ').concat(t))}function it(A){return A>=48&&57>=A||43===A||45===A||46===A}function at(A){return A>=48&&57>=A}function ot(A){var t,e=A.max,n=A.pathValue,r=A.index,i=r,a=!1,o=!1,s=!1,u=!1;if(e>i)if(43!==(t=n.charCodeAt(i))&&45!==t||(t=n.charCodeAt(i+=1)),at(t)||46===t){if(46!==t){if(a=48===t,t=n.charCodeAt(i+=1),a&&e>i&&t&&at(t))return void(A.err="[path-util]: Invalid path value at index ".concat(r,', "').concat(n[r],'" illegal number'));for(;e>i&&at(n.charCodeAt(i));)i+=1,o=!0;t=n.charCodeAt(i)}if(46===t){for(u=!0,i+=1;at(n.charCodeAt(i));)i+=1,s=!0;t=n.charCodeAt(i)}if(101===t||69===t){if(u&&!o&&!s)return void(A.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(n[i],'" invalid float exponent'));if(43!==(t=n.charCodeAt(i+=1))&&45!==t||(i+=1),i>=e||!at(n.charCodeAt(i)))return void(A.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(n[i],'" invalid integer exponent'));for(;e>i&&at(n.charCodeAt(i));)i+=1}A.index=i,A.param=+A.pathValue.slice(r,i)}else A.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(n[i],'" is not a number');else A.err="[path-util]: Invalid path value at index ".concat(i,', "pathValue" is missing param')}function st(A){return 10===A||13===A||8232===A||8233===A||32===A||9===A||11===A||12===A||160===A||A>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(A)}function ut(A){for(var t=A.pathValue,e=A.max;e>A.index&&st(t.charCodeAt(A.index));)A.index+=1}function ct(A){return 97==(32|A)}function lt(A){var t=A.max,e=A.pathValue,n=A.index,r=e.charCodeAt(n),i=$A[e[n].toLowerCase()];if(A.segmentStart=n,function(A){switch(32|A){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}}(r))if(A.index+=1,ut(A),A.data=[],i){for(;;){for(var a=i;a>0;a-=1){if(!ct(r)||3!==a&&4!==a?ot(A):rt(A),A.err.length)return;A.data.push(A.param),ut(A),t>A.index&&44===e.charCodeAt(A.index)&&(A.index+=1,ut(A))}if(A.index>=A.max)break;if(!it(e.charCodeAt(A.index)))break}nt(A)}else nt(A);else A.err='[path-util]: Invalid path value "'.concat(e[n],'" is not a path command')}var ht=function(A){this.pathValue=A,this.segments=[],this.max=A.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function dt(A){if(tt(A))return[].concat(A);var t=function(A){if(At(A))return[].concat(A);var t=new ht(A);for(ut(t);t.max>t.index&&!t.err.length;)lt(t);return t.err?t.err:t.segments}(A),e=0,n=0,r=0,i=0;return t.map(function(A){var t,a=A.slice(1).map(Number),o=A[0],s=o.toUpperCase();if("M"===o)return r=e=a[0],i=n=a[1],["M",e,n];if(o!==s)switch(s){case"A":t=[s,a[0],a[1],a[2],a[3],a[4],a[5]+e,a[6]+n];break;case"V":t=[s,a[0]+n];break;case"H":t=[s,a[0]+e];break;default:var u=a.map(function(A,t){return A+(t%2?n:e)});t=[s].concat(u)}else t=[s].concat(a);var c=t.length;switch(s){case"Z":e=r,n=i;break;case"H":e=t[1];break;case"V":n=t[1];break;default:e=t[c-2],n=t[c-1],"M"===s&&(r=e,i=n)}return t})}function ft(A,t){var e=A[0],n=t.x1,r=t.y1,i=t.x2,a=t.y2,o=A.slice(1).map(Number),s=A;if("TQ".includes(e)||(t.qx=null,t.qy=null),"H"===e)s=["L",A[1],r];else if("V"===e)s=["L",n,A[1]];else if("S"===e){var u=2*n-i,c=2*r-a;t.x1=u,t.y1=c,s=["C",u,c].concat(o)}else if("T"===e){var l=2*n-t.qx,h=2*r-t.qy;t.qx=l,t.qy=h,s=["Q",l,h].concat(o)}else if("Q"===e){var d=o[1];t.qx=o[0],t.qy=d}return s}function Bt(A){if(et(A))return[].concat(A);for(var t=dt(A),e=ZA({},jA),n=0;t.length>n;n+=1){t[n]=ft(t[n],e);var r=t[n],i=r.length;e.x1=+r[i-2],e.y1=+r[i-1],e.x2=+r[i-4]||e.x1,e.y2=+r[i-3]||e.y1}return t}function gt(A,t,e){return{x:A*Math.cos(e)-t*Math.sin(e),y:A*Math.sin(e)+t*Math.cos(e)}}function pt(A,t,e,n,r,i,a,o,s,u){var c,l,h,d,f,B=A,g=t,p=e,v=n,w=o,y=s,m=120*Math.PI/180,C=Math.PI/180*(+r||0),Q=[];if(u)l=u[0],h=u[1],d=u[2],f=u[3];else{g=(c=gt(B,g,-C)).y;var F=((B=c.x)-(w=(c=gt(w,y,-C)).x))/2,U=(g-(y=c.y))/2,E=F*F/(p*p)+U*U/(v*v);E>1&&(p*=E=Math.sqrt(E),v*=E);var b=p*p,k=v*v,x=(i===a?-1:1)*Math.sqrt(Math.abs((b*k-b*U*U-k*F*F)/(b*U*U+k*F*F)));d=x*p*U/v+(B+w)/2,l=Math.asin(((g-(f=x*-v*F/p+(g+y)/2))/v*1e9|0)/1e9),h=Math.asin(((y-f)/v*1e9|0)/1e9),0>(l=d>B?Math.PI-l:l)&&(l=2*Math.PI+l),0>(h=d>w?Math.PI-h:h)&&(h=2*Math.PI+h),a&&l>h&&(l-=2*Math.PI),!a&&h>l&&(h-=2*Math.PI)}var H=h-l;if(Math.abs(H)>m){var I=h,T=w,M=y;Q=pt(w=d+p*Math.cos(h=l+m*(a&&h>l?1:-1)),y=f+v*Math.sin(h),p,v,r,0,a,T,M,[h,I,d,f])}H=h-l;var S=Math.cos(l),L=Math.sin(l),D=Math.cos(h),P=Math.sin(h),N=Math.tan(H/4),O=4/3*p*N,K=4/3*v*N,R=[B,g],G=[B+O*L,g-K*S],V=[w+O*P,y-K*D],_=[w,y];if(G[0]=2*R[0]-G[0],G[1]=2*R[1]-G[1],u)return G.concat(V,_,Q);for(var X=[],Y=0,W=(Q=G.concat(V,_,Q)).length;W>Y;Y+=1)X[Y]=Y%2?gt(Q[Y-1],Q[Y],C).y:gt(Q[Y],Q[Y+1],C).x;return X}function vt(A,t,e){var n=A[0],r=A[1];return[n+(t[0]-n)*e,r+(t[1]-r)*e]}var wt=function(A,t,e,n){return zA(zA([],vt([A,t],[e,n],.5),!0),[e,n,e,n],!1)};function yt(A,t){var e,n,r,i,a,o,s,u=A[0],c=A.slice(1).map(Number),l=c[0],h=c[1],d=t.x1,f=t.y1,B=t.x,g=t.y;switch("TQ".includes(u)||(t.qx=null,t.qy=null),u){case"M":return t.x=l,t.y=h,A;case"A":return e=[d,f].concat(c),["C"].concat(pt(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9]));case"Q":return t.qx=l,t.qy=h,e=[d,f].concat(c),["C"].concat([(o=1/3)*e[0]+(s=2/3)*(n=e[2]),o*e[1]+s*(r=e[3]),o*(i=e[4])+s*n,o*(a=e[5])+s*r,i,a]);case"L":return["C"].concat(wt(d,f,l,h));case"Z":return d===B&&f===g?["C",d,f,B,g,B,g]:["C"].concat(wt(d,f,B,g))}return A}function mt(A,t){if(void 0===t&&(t=!1),function(A){return et(A)&&A.every(function(A){return"MC".includes(A[0])})}(A)){var e=[].concat(A);return t?[e,[]]:e}for(var n,r,i=Bt(A),a=ZA({},jA),o=[],s="",u=i.length,c=[],l=0;u>l;l+=1){i[l]&&(s=i[l][0]),o[l]=s;var h=yt(i[l],a);i[l]=h,qA(i,o,l),u=i.length,"Z"===s&&c.push(l),a.x1=+(n=i[l])[(r=n.length)-2],a.y1=+n[r-1],a.x2=+n[r-4]||a.x1,a.y2=+n[r-3]||a.y1}return t?[i,c]:i}function Ct(A,t){return Math.sqrt((A[0]-t[0])*(A[0]-t[0])+(A[1]-t[1])*(A[1]-t[1]))}function Qt(A,t,e,n,r){var i=Ct([A,t],[e,n]),a={x:0,y:0};if("number"==typeof r)if(0<r)if(r<i){var o=vt([A,t],[e,n],r/i);a={x:o[0],y:o[1]}}else a={x:e,y:n};else a={x:A,y:t};return{length:i,point:a,min:{x:Math.min(A,e),y:Math.min(t,n)},max:{x:Math.max(A,e),y:Math.max(t,n)}}}function Ft(A,t){var e=A.x,n=A.y,r=t.x,i=t.y;return(0>e*i-n*r?-1:1)*Math.acos((e*r+n*i)/Math.sqrt((Math.pow(e,2)+Math.pow(n,2))*(Math.pow(r,2)+Math.pow(i,2))))}function Ut(A,t,e,n,r,i,a,o,s,u){var c=Math.abs,l=Math.sin,h=Math.cos,d=Math.sqrt,f=Math.PI,B=c(e),g=c(n),p=(r%360+360)%360*(f/180);if(A===o&&t===s)return{x:A,y:t};if(0===B||0===g)return Qt(A,t,o,s,u).point;var v=(A-o)/2,w=(t-s)/2,y={x:h(p)*v+l(p)*w,y:-l(p)*v+h(p)*w},m=Math.pow(y.x,2)/Math.pow(B,2)+Math.pow(y.y,2)/Math.pow(g,2);m>1&&(B*=d(m),g*=d(m));var C=(Math.pow(B,2)*Math.pow(g,2)-Math.pow(B,2)*Math.pow(y.y,2)-Math.pow(g,2)*Math.pow(y.x,2))/(Math.pow(B,2)*Math.pow(y.y,2)+Math.pow(g,2)*Math.pow(y.x,2)),Q=(i!==a?1:-1)*d(C=0>C?0:C),F=Q*(B*y.y/g),U=Q*(-g*y.x/B),E=h(p)*F-l(p)*U+(A+o)/2,b=l(p)*F+h(p)*U+(t+s)/2,k={x:(y.x-F)/B,y:(y.y-U)/g},x=Ft({x:1,y:0},k),H=Ft(k,{x:(-y.x-F)/B,y:(-y.y-U)/g});!a&&H>0?H-=2*f:a&&0>H&&(H+=2*f);var I=x+(H%=2*f)*u,T=B*h(I),M=g*l(I);return{x:h(p)*T-l(p)*M+E,y:l(p)*T+h(p)*M+b}}function Et(A,t,e,n,r,i,a,o,s,u,c){var l,h=c.bbox,d=void 0===h||h,f=c.length,B=void 0===f||f,g=c.sampleSize,p=void 0===g?30:g,v="number"==typeof u,w=A,y=t,m=0,C=[w,y,m],Q=[w,y],F={x:0,y:0},U=[{x:w,y:y}];v&&0>=u&&(F={x:w,y:y});for(var E=0;p>=E;E+=1){if(w=(l=Ut(A,t,e,n,r,i,a,o,s,E/p)).x,y=l.y,d&&U.push({x:w,y:y}),B&&(m+=Ct(Q,[w,y])),Q=[w,y],v&&m>=u&&u>C[2]){var b=(m-u)/(m-C[2]);F={x:Q[0]*(1-b)+C[0]*b,y:Q[1]*(1-b)+C[1]*b}}C=[w,y,m]}return v&&u>=m&&(F={x:o,y:s}),{length:m,point:F,min:{x:Math.min.apply(null,U.map(function(A){return A.x})),y:Math.min.apply(null,U.map(function(A){return A.y}))},max:{x:Math.max.apply(null,U.map(function(A){return A.x})),y:Math.max.apply(null,U.map(function(A){return A.y}))}}}function bt(A,t,e,n,r,i,a,o,s){var u=1-s;return{x:Math.pow(u,3)*A+3*Math.pow(u,2)*s*e+3*u*Math.pow(s,2)*r+Math.pow(s,3)*a,y:Math.pow(u,3)*t+3*Math.pow(u,2)*s*n+3*u*Math.pow(s,2)*i+Math.pow(s,3)*o}}function kt(A,t,e,n,r,i,a,o,s,u){var c,l=u.bbox,h=void 0===l||l,d=u.length,f=void 0===d||d,B=u.sampleSize,g=void 0===B?10:B,p="number"==typeof s,v=A,w=t,y=0,m=[v,w,y],C=[v,w],Q={x:0,y:0},F=[{x:v,y:w}];p&&0>=s&&(Q={x:v,y:w});for(var U=0;g>=U;U+=1){if(v=(c=bt(A,t,e,n,r,i,a,o,U/g)).x,w=c.y,h&&F.push({x:v,y:w}),f&&(y+=Ct(C,[v,w])),C=[v,w],p&&y>=s&&s>m[2]){var E=(y-s)/(y-m[2]);Q={x:C[0]*(1-E)+m[0]*E,y:C[1]*(1-E)+m[1]*E}}m=[v,w,y]}return p&&s>=y&&(Q={x:a,y:o}),{length:y,point:Q,min:{x:Math.min.apply(null,F.map(function(A){return A.x})),y:Math.min.apply(null,F.map(function(A){return A.y}))},max:{x:Math.max.apply(null,F.map(function(A){return A.x})),y:Math.max.apply(null,F.map(function(A){return A.y}))}}}function xt(A,t,e,n,r,i,a){var o=1-a;return{x:Math.pow(o,2)*A+2*o*a*e+Math.pow(a,2)*r,y:Math.pow(o,2)*t+2*o*a*n+Math.pow(a,2)*i}}function Ht(A,t,e,n,r,i,a,o){var s,u=o.bbox,c=void 0===u||u,l=o.length,h=void 0===l||l,d=o.sampleSize,f=void 0===d?10:d,B="number"==typeof a,g=A,p=t,v=0,w=[g,p,v],y=[g,p],m={x:0,y:0},C=[{x:g,y:p}];B&&0>=a&&(m={x:g,y:p});for(var Q=0;f>=Q;Q+=1){if(g=(s=xt(A,t,e,n,r,i,Q/f)).x,p=s.y,c&&C.push({x:g,y:p}),h&&(v+=Ct(y,[g,p])),y=[g,p],B&&v>=a&&a>w[2]){var F=(v-a)/(v-w[2]);m={x:y[0]*(1-F)+w[0]*F,y:y[1]*(1-F)+w[1]*F}}w=[g,p,v]}return B&&a>=v&&(m={x:r,y:i}),{length:v,point:m,min:{x:Math.min.apply(null,C.map(function(A){return A.x})),y:Math.min.apply(null,C.map(function(A){return A.y}))},max:{x:Math.max.apply(null,C.map(function(A){return A.x})),y:Math.max.apply(null,C.map(function(A){return A.y}))}}}function It(A,t,e){for(var n,r,i,a,o,s,u,c,l,h=Bt(A),d="number"==typeof t,f=[],B=0,g=0,p=0,v=0,w=[],y=[],m=0,C={x:0,y:0},Q=C,F=C,U=C,E=0,b=0,k=h.length;k>b;b+=1)f=(u="M"===(c=(l=h[b])[0]))?f:[B,g].concat(l.slice(1)),u?(Q=C={x:p=l[1],y:v=l[2]},m=0,d&&.001>t&&(U=C)):"L"===c?(m=(n=Qt(f[0],f[1],f[2],f[3],(t||0)-E)).length,C=n.min,Q=n.max,F=n.point):"A"===c?(m=(r=Et(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],(t||0)-E,e||{})).length,C=r.min,Q=r.max,F=r.point):"C"===c?(m=(i=kt(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],(t||0)-E,e||{})).length,C=i.min,Q=i.max,F=i.point):"Q"===c?(m=(a=Ht(f[0],f[1],f[2],f[3],f[4],f[5],(t||0)-E,e||{})).length,C=a.min,Q=a.max,F=a.point):"Z"===c&&(m=(o=Qt((f=[B,g,p,v])[0],f[1],f[2],f[3],(t||0)-E)).length,C=o.min,Q=o.max,F=o.point),d&&t>E&&E+m>=t&&(U=F),y.push(Q),w.push(C),E+=m,B=(s="Z"!==c?l.slice(-2):[p,v])[0],g=s[1];return d&&t>=E&&(U={x:B,y:g}),{length:E,point:U,min:{x:Math.min.apply(null,w.map(function(A){return A.x})),y:Math.min.apply(null,w.map(function(A){return A.y}))},max:{x:Math.max.apply(null,y.map(function(A){return A.x})),y:Math.max.apply(null,y.map(function(A){return A.y}))}}}function Tt(A,t){var e=A.length-1,n=[],r=0,i=function(A){var t=A.length,e=t-1;return A.map(function(n,r){return A.map(function(n,i){var a=r+i;return 0===i||A[a]&&"M"===A[a][0]?["M"].concat(A[a].slice(-2)):(t>a||(a-=e),A[a])})})}(A);return i.forEach(function(i,a){A.slice(1).forEach(function(n,i){r+=Ct(A[(a+i)%e].slice(-2),t[i%e].slice(-2))}),n[a]=r,r=0}),i[n.indexOf(Math.min.apply(null,n))]}function Mt(A){return function(A){var t=0,e=0,n=0;return mt(A).map(function(A){var r;if("M"===A[0])return t=A[1],e=A[2],0;var i,a,o,s,u,c,l,h,d=A.slice(1);return n=3*(((h=d[5])-(a=e))*((o=d[0])+(u=d[2]))-((l=d[4])-(i=t))*((s=d[1])+(c=d[3]))+s*(i-u)-o*(a-c)+h*(u+i/3)-l*(c+a/3))/20,r=A.slice(-2),t=r[0],e=r[1],n}).reduce(function(A,t){return A+t},0)}(A)>=0}function St(A){return A.map(function(A,t,e){var n=t&&e[t-1].slice(-2).concat(A.slice(1)),r=t?kt(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],{bbox:!1}).length:0;return{s:A,ss:t?r?function(A,t){void 0===t&&(t=.5);var e=A.slice(0,2),n=A.slice(2,4),r=A.slice(4,6),i=A.slice(6,8),a=vt(e,n,t),o=vt(n,r,t),s=vt(r,i,t),u=vt(a,o,t),c=vt(o,s,t),l=vt(u,c,t);return[["C"].concat(a,u,l),["C"].concat(c,s,i)]}(n):[A,A]:[A],l:r}})}function Lt(A,t,e,n){if(void 0===n&&(n=0),n>50)return console.warn("Maximum recursion depth reached in equalizeSegments"),[A,t];var r=St(A),i=St(t),a=r.length,o=i.length,s=r.filter(function(A){return A.l}).length,u=i.filter(function(A){return A.l}).length,c=r.filter(function(A){return A.l}).reduce(function(A,t){return A+t.l},0)/s||0,l=i.filter(function(A){return A.l}).reduce(function(A,t){return A+t.l},0)/u||0,h=e||Math.max(a,o),d=[c,l],f=[h-a,h-o],B=0,g=[r,i].map(function(A,t){return A.l===h?A.map(function(A){return A.s}):A.map(function(A,e){return f[t]-=(B=e&&f[t]&&A.l>=d[t])?1:0,B?A.ss:[A.s]}).flat()});return g[0].length===g[1].length?g:Lt(g[0],g[1],h,n+1)}function Dt(){return Dt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(A,t,e){var n=function(A,t){for(;!{}.hasOwnProperty.call(A,t)&&null!==(A=h(A)););return A}(A,t);if(n){var r=Object.getOwnPropertyDescriptor(n,t);return r.get?r.get.call(3>arguments.length?A:e):r.value}},Dt.apply(null,arguments)}function Pt(A,t,e,n){var r=Dt(h(1&n?A.prototype:A),t,e);return 2&n&&"function"==typeof r?function(A){return r.apply(e,A)}:r}
9
+ !function(A,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((A="undefined"!=typeof globalThis?globalThis:A||self).G={})}(this,function(A){"use strict";function t(A){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},t(A)}function e(A){var e=function(A,e){if("object"!=t(A)||!A)return A;var n;if("undefined"!=typeof Symbol&&void 0!==(n=A[Symbol.toPrimitive])){var r=n.call(A,e||"default");if("object"!=t(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(A)}(A,"string");return"symbol"==t(e)?e:e+""}function n(A,t,n){return(t=e(t))in A?Object.defineProperty(A,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):A[t]=n,A}function r(A,t){var e=Object.keys(A);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(A,t).enumerable})),e.push.apply(e,n)}return e}function i(A){for(var t=1;arguments.length>t;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?r(Object(e),!0).forEach(function(t){n(A,t,e[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(e)):r(Object(e)).forEach(function(t){Object.defineProperty(A,t,Object.getOwnPropertyDescriptor(e,t))})}return A}function a(A,t){if(!(A instanceof t))throw new TypeError("Cannot call a class as a function")}function o(A,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(A,e(r.key),r)}}function s(A,t,e){return t&&o(A.prototype,t),e&&o(A,e),Object.defineProperty(A,"prototype",{writable:!1}),A}function u(A,t){(null==t||t>A.length)&&(t=A.length);for(var e=0,n=Array(t);t>e;e++)n[e]=A[e];return n}function c(A,t){if(A){if("string"==typeof A)return u(A,t);var e={}.toString.call(A).slice(8,-1);return"Object"===e&&A.constructor&&(e=A.constructor.name),"Map"===e||"Set"===e?Array.from(A):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?u(A,t):void 0}}function l(A){return function(A){if(Array.isArray(A))return u(A)}(A)||function(A){if("undefined"!=typeof Symbol&&null!=A[Symbol.iterator]||null!=A["@@iterator"])return Array.from(A)}(A)||c(A)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(A){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},h(A)}function d(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(d=function(){return!!A})()}function f(A,e){if(e&&("object"==t(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}function B(A,t,e){return t=h(t),f(A,d()?Reflect.construct(t,e||[],h(A).constructor):t.apply(A,e))}function g(A,t){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,t){return A.__proto__=t,A},g(A,t)}function p(A,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(t&&t.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),t&&g(A,t)}function v(A,t){return function(A){if(Array.isArray(A))return A}(A)||function(A,t){var e=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null!=e){var n,r,i,a,o=[],s=!0,u=!1;try{if(i=(e=e.call(A)).next,0===t){if(Object(e)!==e)return;s=!1}else for(;!(s=(n=i.call(e)).done)&&(o.push(n.value),o.length!==t);s=!0);}catch(A){u=!0,r=A}finally{try{if(!s&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(u)throw r}}return o}}(A,t)||c(A,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var w={exports:{}};!function(A){var t=Object.prototype.hasOwnProperty,e="~";function n(){}function r(A,t,e){this.fn=A,this.context=t,this.once=e||!1}function i(A,t,n,i,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var o=new r(n,i||A,a),s=e?e+t:t;return A._events[s]?A._events[s].fn?A._events[s]=[A._events[s],o]:A._events[s].push(o):(A._events[s]=o,A._eventsCount++),A}function a(A,t){0===--A._eventsCount?A._events=new n:delete A._events[t]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(e=!1)),o.prototype.eventNames=function(){var A,n,r=[];if(0===this._eventsCount)return r;for(n in A=this._events)t.call(A,n)&&r.push(e?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(A)):r},o.prototype.listeners=function(A){var t=this._events[e?e+A:A];if(!t)return[];if(t.fn)return[t.fn];for(var n=0,r=t.length,i=Array(r);r>n;n++)i[n]=t[n].fn;return i},o.prototype.listenerCount=function(A){var t=this._events[e?e+A:A];return t?t.fn?1:t.length:0},o.prototype.emit=function(A,t,n,r,i,a){var o=e?e+A:A;if(!this._events[o])return!1;var s,u,c=this._events[o],l=arguments.length;if(c.fn){switch(c.once&&this.removeListener(A,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,r),!0;case 5:return c.fn.call(c.context,t,n,r,i),!0;case 6:return c.fn.call(c.context,t,n,r,i,a),!0}for(u=1,s=Array(l-1);l>u;u++)s[u-1]=arguments[u];c.fn.apply(c.context,s)}else{var h,d=c.length;for(u=0;d>u;u++)switch(c[u].once&&this.removeListener(A,c[u].fn,void 0,!0),l){case 1:c[u].fn.call(c[u].context);break;case 2:c[u].fn.call(c[u].context,t);break;case 3:c[u].fn.call(c[u].context,t,n);break;case 4:c[u].fn.call(c[u].context,t,n,r);break;default:if(!s)for(h=1,s=Array(l-1);l>h;h++)s[h-1]=arguments[h];c[u].fn.apply(c[u].context,s)}}return!0},o.prototype.on=function(A,t,e){return i(this,A,t,e,!1)},o.prototype.once=function(A,t,e){return i(this,A,t,e,!0)},o.prototype.removeListener=function(A,t,n,r){var i=e?e+A:A;if(!this._events[i])return this;if(!t)return a(this,i),this;var o=this._events[i];if(o.fn)o.fn!==t||r&&!o.once||n&&o.context!==n||a(this,i);else{for(var s=0,u=[],c=o.length;c>s;s++)(o[s].fn!==t||r&&!o[s].once||n&&o[s].context!==n)&&u.push(o[s]);u.length?this._events[i]=1===u.length?u[0]:u:a(this,i)}return this},o.prototype.removeAllListeners=function(A){var t;return A?this._events[t=e?e+A:A]&&a(this,t):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=e,o.EventEmitter=o,A.exports=o}(w);var y=w.exports,m=1e-6,C="undefined"!=typeof Float32Array?Float32Array:Array;function Q(){var A=new C(9);return C!=Float32Array&&(A[1]=0,A[2]=0,A[3]=0,A[5]=0,A[6]=0,A[7]=0),A[0]=1,A[4]=1,A[8]=1,A}function F(){var A=new C(16);return C!=Float32Array&&(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[6]=0,A[7]=0,A[8]=0,A[9]=0,A[11]=0,A[12]=0,A[13]=0,A[14]=0),A[0]=1,A[5]=1,A[10]=1,A[15]=1,A}function U(A){var t=new C(16);return t[0]=A[0],t[1]=A[1],t[2]=A[2],t[3]=A[3],t[4]=A[4],t[5]=A[5],t[6]=A[6],t[7]=A[7],t[8]=A[8],t[9]=A[9],t[10]=A[10],t[11]=A[11],t[12]=A[12],t[13]=A[13],t[14]=A[14],t[15]=A[15],t}function E(A,t){return A[0]=t[0],A[1]=t[1],A[2]=t[2],A[3]=t[3],A[4]=t[4],A[5]=t[5],A[6]=t[6],A[7]=t[7],A[8]=t[8],A[9]=t[9],A[10]=t[10],A[11]=t[11],A[12]=t[12],A[13]=t[13],A[14]=t[14],A[15]=t[15],A}function b(A,t,e,n,r,i,a,o,s,u,c,l,h,d,f,B,g){return A[0]=t,A[1]=e,A[2]=n,A[3]=r,A[4]=i,A[5]=a,A[6]=o,A[7]=s,A[8]=u,A[9]=c,A[10]=l,A[11]=h,A[12]=d,A[13]=f,A[14]=B,A[15]=g,A}function k(A){return A[0]=1,A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=1,A[6]=0,A[7]=0,A[8]=0,A[9]=0,A[10]=1,A[11]=0,A[12]=0,A[13]=0,A[14]=0,A[15]=1,A}function x(A,t){if(A===t){var e=t[1],n=t[2],r=t[3],i=t[6],a=t[7],o=t[11];A[1]=t[4],A[2]=t[8],A[3]=t[12],A[4]=e,A[6]=t[9],A[7]=t[13],A[8]=n,A[9]=i,A[11]=t[14],A[12]=r,A[13]=a,A[14]=o}else A[0]=t[0],A[1]=t[4],A[2]=t[8],A[3]=t[12],A[4]=t[1],A[5]=t[5],A[6]=t[9],A[7]=t[13],A[8]=t[2],A[9]=t[6],A[10]=t[10],A[11]=t[14],A[12]=t[3],A[13]=t[7],A[14]=t[11],A[15]=t[15];return A}function H(A,t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],u=t[7],c=t[8],l=t[9],h=t[10],d=t[11],f=t[12],B=t[13],g=t[14],p=t[15],v=e*o-n*a,w=e*s-r*a,y=e*u-i*a,m=n*s-r*o,C=n*u-i*o,Q=r*u-i*s,F=c*B-l*f,U=c*g-h*f,E=c*p-d*f,b=l*g-h*B,k=l*p-d*B,x=h*p-d*g,H=v*x-w*k+y*b+m*E-C*U+Q*F;return H?(A[0]=(o*x-s*k+u*b)*(H=1/H),A[1]=(r*k-n*x-i*b)*H,A[2]=(B*Q-g*C+p*m)*H,A[3]=(h*C-l*Q-d*m)*H,A[4]=(s*E-a*x-u*U)*H,A[5]=(e*x-r*E+i*U)*H,A[6]=(g*y-f*Q-p*w)*H,A[7]=(c*Q-h*y+d*w)*H,A[8]=(a*k-o*E+u*F)*H,A[9]=(n*E-e*k-i*F)*H,A[10]=(f*C-B*y+p*v)*H,A[11]=(l*y-c*C-d*v)*H,A[12]=(o*U-a*b-s*F)*H,A[13]=(e*b-n*U+r*F)*H,A[14]=(B*w-f*m-g*v)*H,A[15]=(c*m-l*w+h*v)*H,A):null}function I(A){var t=A[0],e=A[1],n=A[2],r=A[4],i=A[5],a=A[6],o=A[8],s=A[9],u=A[10],c=A[12],l=A[13],h=A[14],d=t*i-e*r,f=t*a-n*r,B=e*a-n*i,g=o*l-s*c,p=o*h-u*c,v=s*h-u*l;return A[7]*(t*v-e*p+n*g)-A[3]*(r*v-i*p+a*g)+A[15]*(o*B-s*f+u*d)-A[11]*(c*B-l*f+h*d)}function T(A,t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],h=t[9],d=t[10],f=t[11],B=t[12],g=t[13],p=t[14],v=t[15],w=e[0],y=e[1],m=e[2],C=e[3];return A[0]=w*n+y*o+m*l+C*B,A[1]=w*r+y*s+m*h+C*g,A[2]=w*i+y*u+m*d+C*p,A[3]=w*a+y*c+m*f+C*v,A[4]=(w=e[4])*n+(y=e[5])*o+(m=e[6])*l+(C=e[7])*B,A[5]=w*r+y*s+m*h+C*g,A[6]=w*i+y*u+m*d+C*p,A[7]=w*a+y*c+m*f+C*v,A[8]=(w=e[8])*n+(y=e[9])*o+(m=e[10])*l+(C=e[11])*B,A[9]=w*r+y*s+m*h+C*g,A[10]=w*i+y*u+m*d+C*p,A[11]=w*a+y*c+m*f+C*v,A[12]=(w=e[12])*n+(y=e[13])*o+(m=e[14])*l+(C=e[15])*B,A[13]=w*r+y*s+m*h+C*g,A[14]=w*i+y*u+m*d+C*p,A[15]=w*a+y*c+m*f+C*v,A}function M(A,t,e){var n,r,i,a,o,s,u,c,l,h,d,f,B=e[0],g=e[1],p=e[2];return t===A?(A[12]=t[0]*B+t[4]*g+t[8]*p+t[12],A[13]=t[1]*B+t[5]*g+t[9]*p+t[13],A[14]=t[2]*B+t[6]*g+t[10]*p+t[14],A[15]=t[3]*B+t[7]*g+t[11]*p+t[15]):(r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],h=t[9],d=t[10],f=t[11],A[0]=n=t[0],A[1]=r,A[2]=i,A[3]=a,A[4]=o,A[5]=s,A[6]=u,A[7]=c,A[8]=l,A[9]=h,A[10]=d,A[11]=f,A[12]=n*B+o*g+l*p+t[12],A[13]=r*B+s*g+h*p+t[13],A[14]=i*B+u*g+d*p+t[14],A[15]=a*B+c*g+f*p+t[15]),A}function S(A,t,e){var n=e[0],r=e[1],i=e[2];return A[0]=t[0]*n,A[1]=t[1]*n,A[2]=t[2]*n,A[3]=t[3]*n,A[4]=t[4]*r,A[5]=t[5]*r,A[6]=t[6]*r,A[7]=t[7]*r,A[8]=t[8]*i,A[9]=t[9]*i,A[10]=t[10]*i,A[11]=t[11]*i,A[12]=t[12],A[13]=t[13],A[14]=t[14],A[15]=t[15],A}function L(A,t,e){var n=Math.sin(e),r=Math.cos(e),i=t[4],a=t[5],o=t[6],s=t[7],u=t[8],c=t[9],l=t[10],h=t[11];return t!==A&&(A[0]=t[0],A[1]=t[1],A[2]=t[2],A[3]=t[3],A[12]=t[12],A[13]=t[13],A[14]=t[14],A[15]=t[15]),A[4]=i*r+u*n,A[5]=a*r+c*n,A[6]=o*r+l*n,A[7]=s*r+h*n,A[8]=u*r-i*n,A[9]=c*r-a*n,A[10]=l*r-o*n,A[11]=h*r-s*n,A}function D(A,t,e){var n=Math.sin(e),r=Math.cos(e),i=t[0],a=t[1],o=t[2],s=t[3],u=t[8],c=t[9],l=t[10],h=t[11];return t!==A&&(A[4]=t[4],A[5]=t[5],A[6]=t[6],A[7]=t[7],A[12]=t[12],A[13]=t[13],A[14]=t[14],A[15]=t[15]),A[0]=i*r-u*n,A[1]=a*r-c*n,A[2]=o*r-l*n,A[3]=s*r-h*n,A[8]=i*n+u*r,A[9]=a*n+c*r,A[10]=o*n+l*r,A[11]=s*n+h*r,A}function P(A,t){return A[0]=1,A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=1,A[6]=0,A[7]=0,A[8]=0,A[9]=0,A[10]=1,A[11]=0,A[12]=t[0],A[13]=t[1],A[14]=t[2],A[15]=1,A}function N(A,t){return A[0]=t[0],A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=t[1],A[6]=0,A[7]=0,A[8]=0,A[9]=0,A[10]=t[2],A[11]=0,A[12]=0,A[13]=0,A[14]=0,A[15]=1,A}function O(A,t,e){var n,r,i,a=e[0],o=e[1],s=e[2],u=Math.sqrt(a*a+o*o+s*s);return m>u?null:(a*=u=1/u,o*=u,s*=u,n=Math.sin(t),A[0]=a*a*(i=1-(r=Math.cos(t)))+r,A[1]=o*a*i+s*n,A[2]=s*a*i-o*n,A[3]=0,A[4]=a*o*i-s*n,A[5]=o*o*i+r,A[6]=s*o*i+a*n,A[7]=0,A[8]=a*s*i+o*n,A[9]=o*s*i-a*n,A[10]=s*s*i+r,A[11]=0,A[12]=0,A[13]=0,A[14]=0,A[15]=1,A)}function K(A,t){var e=Math.sin(t),n=Math.cos(t);return A[0]=1,A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=n,A[6]=e,A[7]=0,A[8]=0,A[9]=-e,A[10]=n,A[11]=0,A[12]=0,A[13]=0,A[14]=0,A[15]=1,A}function R(A,t){var e=Math.sin(t),n=Math.cos(t);return A[0]=n,A[1]=0,A[2]=-e,A[3]=0,A[4]=0,A[5]=1,A[6]=0,A[7]=0,A[8]=e,A[9]=0,A[10]=n,A[11]=0,A[12]=0,A[13]=0,A[14]=0,A[15]=1,A}function G(A,t){var e=Math.sin(t),n=Math.cos(t);return A[0]=n,A[1]=e,A[2]=0,A[3]=0,A[4]=-e,A[5]=n,A[6]=0,A[7]=0,A[8]=0,A[9]=0,A[10]=1,A[11]=0,A[12]=0,A[13]=0,A[14]=0,A[15]=1,A}function V(A,t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=n+n,s=r+r,u=i+i,c=n*o,l=n*s,h=n*u,d=r*s,f=r*u,B=i*u,g=a*o,p=a*s,v=a*u;return A[0]=1-(d+B),A[1]=l+v,A[2]=h-p,A[3]=0,A[4]=l-v,A[5]=1-(c+B),A[6]=f+g,A[7]=0,A[8]=h+p,A[9]=f-g,A[10]=1-(c+d),A[11]=0,A[12]=e[0],A[13]=e[1],A[14]=e[2],A[15]=1,A}function _(A,t){return A[0]=t[12],A[1]=t[13],A[2]=t[14],A}function X(A,t){var e=t[0],n=t[1],r=t[2],i=t[4],a=t[5],o=t[6],s=t[8],u=t[9],c=t[10];return A[0]=Math.sqrt(e*e+n*n+r*r),A[1]=Math.sqrt(i*i+a*a+o*o),A[2]=Math.sqrt(s*s+u*u+c*c),A}function Y(A,t){var e=new C(3);X(e,t);var n=1/e[0],r=1/e[1],i=1/e[2],a=t[0]*n,o=t[1]*r,s=t[2]*i,u=t[4]*n,c=t[5]*r,l=t[6]*i,h=t[8]*n,d=t[9]*r,f=t[10]*i,B=a+c+f,g=0;return B>0?(A[3]=.25*(g=2*Math.sqrt(B+1)),A[0]=(l-d)/g,A[1]=(h-s)/g,A[2]=(o-u)/g):a>c&&a>f?(A[3]=(l-d)/(g=2*Math.sqrt(1+a-c-f)),A[0]=.25*g,A[1]=(o+u)/g,A[2]=(h+s)/g):c>f?(A[3]=(h-s)/(g=2*Math.sqrt(1+c-a-f)),A[0]=(o+u)/g,A[1]=.25*g,A[2]=(l+d)/g):(A[3]=(o-u)/(g=2*Math.sqrt(1+f-a-c)),A[0]=(h+s)/g,A[1]=(l+d)/g,A[2]=.25*g),A}function W(A,t,e,n,r){var i=t[0],a=t[1],o=t[2],s=t[3],u=i+i,c=a+a,l=o+o,h=i*u,d=i*c,f=i*l,B=a*c,g=a*l,p=o*l,v=s*u,w=s*c,y=s*l,m=n[0],C=n[1],Q=n[2],F=r[0],U=r[1],E=r[2],b=(1-(B+p))*m,k=(d+y)*m,x=(f-w)*m,H=(d-y)*C,I=(1-(h+p))*C,T=(g+v)*C,M=(f+w)*Q,S=(g-v)*Q,L=(1-(h+B))*Q;return A[0]=b,A[1]=k,A[2]=x,A[3]=0,A[4]=H,A[5]=I,A[6]=T,A[7]=0,A[8]=M,A[9]=S,A[10]=L,A[11]=0,A[12]=e[0]+F-(b*F+H*U+M*E),A[13]=e[1]+U-(k*F+I*U+S*E),A[14]=e[2]+E-(x*F+T*U+L*E),A[15]=1,A}function J(A,t){var e=t[0],n=t[1],r=t[2],i=t[3],a=e+e,o=n+n,s=r+r,u=e*a,c=n*a,l=n*o,h=r*a,d=r*o,f=r*s,B=i*a,g=i*o,p=i*s;return A[0]=1-l-f,A[1]=c+p,A[2]=h-g,A[3]=0,A[4]=c-p,A[5]=1-u-f,A[6]=d+B,A[7]=0,A[8]=h+g,A[9]=d-B,A[10]=1-u-l,A[11]=0,A[12]=0,A[13]=0,A[14]=0,A[15]=1,A}function Z(A,t,e,n,r){var i=1/Math.tan(t/2);if(A[0]=i/e,A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=i,A[6]=0,A[7]=0,A[8]=0,A[9]=0,A[11]=-1,A[12]=0,A[13]=0,A[15]=0,null!=r&&r!==1/0){var a=1/(n-r);A[10]=(r+n)*a,A[14]=2*r*n*a}else A[10]=-1,A[14]=-2*n;return A}function z(A,t,e,n,r,i,a){var o=1/(t-e),s=1/(n-r),u=1/(i-a);return A[0]=-2*o,A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=-2*s,A[6]=0,A[7]=0,A[8]=0,A[9]=0,A[10]=2*u,A[11]=0,A[12]=(t+e)*o,A[13]=(r+n)*s,A[14]=(a+i)*u,A[15]=1,A}var j=z;function q(A,t,e,n,r,i,a){var o=1/(t-e),s=1/(n-r),u=1/(i-a);return A[0]=-2*o,A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=-2*s,A[6]=0,A[7]=0,A[8]=0,A[9]=0,A[10]=u,A[11]=0,A[12]=(t+e)*o,A[13]=(r+n)*s,A[14]=i*u,A[15]=1,A}function $(A,t,e,n){var r,i,a,o,s,u,c,l,h,d,f=t[0],B=t[1],g=t[2],p=n[0],v=n[1],w=n[2],y=e[0],C=e[1],Q=e[2];return m>Math.abs(f-y)&&m>Math.abs(B-C)&&m>Math.abs(g-Q)?k(A):(h=g-Q,(d=Math.sqrt((r=v*(h*=d=1/Math.sqrt((c=f-y)*c+(l=B-C)*l+h*h))-w*(l*=d))*r+(i=w*(c*=d)-p*h)*i+(a=p*l-v*c)*a))?(r*=d=1/d,i*=d,a*=d):(r=0,i=0,a=0),(d=Math.sqrt((o=l*a-h*i)*o+(s=h*r-c*a)*s+(u=c*i-l*r)*u))?(o*=d=1/d,s*=d,u*=d):(o=0,s=0,u=0),A[0]=r,A[1]=o,A[2]=c,A[3]=0,A[4]=i,A[5]=s,A[6]=l,A[7]=0,A[8]=a,A[9]=u,A[10]=h,A[11]=0,A[12]=-(r*f+i*B+a*g),A[13]=-(o*f+s*B+u*g),A[14]=-(c*f+l*B+h*g),A[15]=1,A)}function AA(A,t,e){return A[0]=t[0]-e[0],A[1]=t[1]-e[1],A[2]=t[2]-e[2],A[3]=t[3]-e[3],A[4]=t[4]-e[4],A[5]=t[5]-e[5],A[6]=t[6]-e[6],A[7]=t[7]-e[7],A[8]=t[8]-e[8],A[9]=t[9]-e[9],A[10]=t[10]-e[10],A[11]=t[11]-e[11],A[12]=t[12]-e[12],A[13]=t[13]-e[13],A[14]=t[14]-e[14],A[15]=t[15]-e[15],A}var tA=T,eA=Object.freeze({__proto__:null,add:function(A,t,e){return A[0]=t[0]+e[0],A[1]=t[1]+e[1],A[2]=t[2]+e[2],A[3]=t[3]+e[3],A[4]=t[4]+e[4],A[5]=t[5]+e[5],A[6]=t[6]+e[6],A[7]=t[7]+e[7],A[8]=t[8]+e[8],A[9]=t[9]+e[9],A[10]=t[10]+e[10],A[11]=t[11]+e[11],A[12]=t[12]+e[12],A[13]=t[13]+e[13],A[14]=t[14]+e[14],A[15]=t[15]+e[15],A},adjoint:function(A,t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],u=t[7],c=t[8],l=t[9],h=t[10],d=t[11],f=t[12],B=t[13],g=t[14],p=t[15],v=e*o-n*a,w=e*s-r*a,y=e*u-i*a,m=n*s-r*o,C=n*u-i*o,Q=r*u-i*s,F=c*B-l*f,U=c*g-h*f,E=c*p-d*f,b=l*g-h*B,k=l*p-d*B,x=h*p-d*g;return A[0]=o*x-s*k+u*b,A[1]=r*k-n*x-i*b,A[2]=B*Q-g*C+p*m,A[3]=h*C-l*Q-d*m,A[4]=s*E-a*x-u*U,A[5]=e*x-r*E+i*U,A[6]=g*y-f*Q-p*w,A[7]=c*Q-h*y+d*w,A[8]=a*k-o*E+u*F,A[9]=n*E-e*k-i*F,A[10]=f*C-B*y+p*v,A[11]=l*y-c*C-d*v,A[12]=o*U-a*b-s*F,A[13]=e*b-n*U+r*F,A[14]=B*w-f*m-g*v,A[15]=c*m-l*w+h*v,A},clone:U,copy:E,create:F,decompose:function(A,t,e,n){t[0]=n[12],t[1]=n[13],t[2]=n[14];var r=n[0],i=n[1],a=n[2],o=n[4],s=n[5],u=n[6],c=n[8],l=n[9],h=n[10];e[0]=Math.sqrt(r*r+i*i+a*a),e[1]=Math.sqrt(o*o+s*s+u*u),e[2]=Math.sqrt(c*c+l*l+h*h);var d=1/e[0],f=1/e[1],B=1/e[2],g=r*d,p=i*f,v=a*B,w=o*d,y=s*f,m=u*B,C=c*d,Q=l*f,F=h*B,U=g+y+F,E=0;return U>0?(A[3]=.25*(E=2*Math.sqrt(U+1)),A[0]=(m-Q)/E,A[1]=(C-v)/E,A[2]=(p-w)/E):g>y&&g>F?(A[3]=(m-Q)/(E=2*Math.sqrt(1+g-y-F)),A[0]=.25*E,A[1]=(p+w)/E,A[2]=(C+v)/E):y>F?(A[3]=(C-v)/(E=2*Math.sqrt(1+y-g-F)),A[0]=(p+w)/E,A[1]=.25*E,A[2]=(m+Q)/E):(A[3]=(p-w)/(E=2*Math.sqrt(1+F-g-y)),A[0]=(C+v)/E,A[1]=(m+Q)/E,A[2]=.25*E),A},determinant:I,equals:function(A,t){var e=A[0],n=A[1],r=A[2],i=A[3],a=A[4],o=A[5],s=A[6],u=A[7],c=A[8],l=A[9],h=A[10],d=A[11],f=A[12],B=A[13],g=A[14],p=A[15],v=t[0],w=t[1],y=t[2],C=t[3],Q=t[4],F=t[5],U=t[6],E=t[7],b=t[8],k=t[9],x=t[10],H=t[11],I=t[12],T=t[13],M=t[14],S=t[15];return!(Math.abs(e-v)>m*Math.max(1,Math.abs(e),Math.abs(v))||Math.abs(n-w)>m*Math.max(1,Math.abs(n),Math.abs(w))||Math.abs(r-y)>m*Math.max(1,Math.abs(r),Math.abs(y))||Math.abs(i-C)>m*Math.max(1,Math.abs(i),Math.abs(C))||Math.abs(a-Q)>m*Math.max(1,Math.abs(a),Math.abs(Q))||Math.abs(o-F)>m*Math.max(1,Math.abs(o),Math.abs(F))||Math.abs(s-U)>m*Math.max(1,Math.abs(s),Math.abs(U))||Math.abs(u-E)>m*Math.max(1,Math.abs(u),Math.abs(E))||Math.abs(c-b)>m*Math.max(1,Math.abs(c),Math.abs(b))||Math.abs(l-k)>m*Math.max(1,Math.abs(l),Math.abs(k))||Math.abs(h-x)>m*Math.max(1,Math.abs(h),Math.abs(x))||Math.abs(d-H)>m*Math.max(1,Math.abs(d),Math.abs(H))||Math.abs(f-I)>m*Math.max(1,Math.abs(f),Math.abs(I))||Math.abs(B-T)>m*Math.max(1,Math.abs(B),Math.abs(T))||Math.abs(g-M)>m*Math.max(1,Math.abs(g),Math.abs(M))||Math.abs(p-S)>m*Math.max(1,Math.abs(p),Math.abs(S)))},exactEquals:function(A,t){return A[0]===t[0]&&A[1]===t[1]&&A[2]===t[2]&&A[3]===t[3]&&A[4]===t[4]&&A[5]===t[5]&&A[6]===t[6]&&A[7]===t[7]&&A[8]===t[8]&&A[9]===t[9]&&A[10]===t[10]&&A[11]===t[11]&&A[12]===t[12]&&A[13]===t[13]&&A[14]===t[14]&&A[15]===t[15]},frob:function(A){return Math.sqrt(A[0]*A[0]+A[1]*A[1]+A[2]*A[2]+A[3]*A[3]+A[4]*A[4]+A[5]*A[5]+A[6]*A[6]+A[7]*A[7]+A[8]*A[8]+A[9]*A[9]+A[10]*A[10]+A[11]*A[11]+A[12]*A[12]+A[13]*A[13]+A[14]*A[14]+A[15]*A[15])},fromQuat:J,fromQuat2:function(A,t){var e=new C(3),n=-t[0],r=-t[1],i=-t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=n*n+r*r+i*i+a*a;return l>0?(e[0]=2*(o*a+c*n+s*i-u*r)/l,e[1]=2*(s*a+c*r+u*n-o*i)/l,e[2]=2*(u*a+c*i+o*r-s*n)/l):(e[0]=2*(o*a+c*n+s*i-u*r),e[1]=2*(s*a+c*r+u*n-o*i),e[2]=2*(u*a+c*i+o*r-s*n)),V(A,t,e),A},fromRotation:O,fromRotationTranslation:V,fromRotationTranslationScale:function(A,t,e,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=r+r,u=i+i,c=a+a,l=r*s,h=r*u,d=r*c,f=i*u,B=i*c,g=a*c,p=o*s,v=o*u,w=o*c,y=n[0],m=n[1],C=n[2];return A[0]=(1-(f+g))*y,A[1]=(h+w)*y,A[2]=(d-v)*y,A[3]=0,A[4]=(h-w)*m,A[5]=(1-(l+g))*m,A[6]=(B+p)*m,A[7]=0,A[8]=(d+v)*C,A[9]=(B-p)*C,A[10]=(1-(l+f))*C,A[11]=0,A[12]=e[0],A[13]=e[1],A[14]=e[2],A[15]=1,A},fromRotationTranslationScaleOrigin:W,fromScaling:N,fromTranslation:P,fromValues:function(A,t,e,n,r,i,a,o,s,u,c,l,h,d,f,B){var g=new C(16);return g[0]=A,g[1]=t,g[2]=e,g[3]=n,g[4]=r,g[5]=i,g[6]=a,g[7]=o,g[8]=s,g[9]=u,g[10]=c,g[11]=l,g[12]=h,g[13]=d,g[14]=f,g[15]=B,g},fromXRotation:K,fromYRotation:R,fromZRotation:G,frustum:function(A,t,e,n,r,i,a){var o=1/(e-t),s=1/(r-n),u=1/(i-a);return A[0]=2*i*o,A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=2*i*s,A[6]=0,A[7]=0,A[8]=(e+t)*o,A[9]=(r+n)*s,A[10]=(a+i)*u,A[11]=-1,A[12]=0,A[13]=0,A[14]=a*i*2*u,A[15]=0,A},getRotation:Y,getScaling:X,getTranslation:_,identity:k,invert:H,lookAt:$,mul:tA,multiply:T,multiplyScalar:function(A,t,e){return A[0]=t[0]*e,A[1]=t[1]*e,A[2]=t[2]*e,A[3]=t[3]*e,A[4]=t[4]*e,A[5]=t[5]*e,A[6]=t[6]*e,A[7]=t[7]*e,A[8]=t[8]*e,A[9]=t[9]*e,A[10]=t[10]*e,A[11]=t[11]*e,A[12]=t[12]*e,A[13]=t[13]*e,A[14]=t[14]*e,A[15]=t[15]*e,A},multiplyScalarAndAdd:function(A,t,e,n){return A[0]=t[0]+e[0]*n,A[1]=t[1]+e[1]*n,A[2]=t[2]+e[2]*n,A[3]=t[3]+e[3]*n,A[4]=t[4]+e[4]*n,A[5]=t[5]+e[5]*n,A[6]=t[6]+e[6]*n,A[7]=t[7]+e[7]*n,A[8]=t[8]+e[8]*n,A[9]=t[9]+e[9]*n,A[10]=t[10]+e[10]*n,A[11]=t[11]+e[11]*n,A[12]=t[12]+e[12]*n,A[13]=t[13]+e[13]*n,A[14]=t[14]+e[14]*n,A[15]=t[15]+e[15]*n,A},ortho:j,orthoNO:z,orthoZO:q,perspective:Z,perspectiveFromFieldOfView:function(A,t,e,n){var r=Math.tan(t.upDegrees*Math.PI/180),i=Math.tan(t.downDegrees*Math.PI/180),a=Math.tan(t.leftDegrees*Math.PI/180),o=Math.tan(t.rightDegrees*Math.PI/180),s=2/(a+o),u=2/(r+i);return A[0]=s,A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=u,A[6]=0,A[7]=0,A[8]=-(a-o)*s*.5,A[9]=(r-i)*u*.5,A[10]=n/(e-n),A[11]=-1,A[12]=0,A[13]=0,A[14]=n*e/(e-n),A[15]=0,A},perspectiveNO:Z,perspectiveZO:function(A,t,e,n,r){var i=1/Math.tan(t/2);if(A[0]=i/e,A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=i,A[6]=0,A[7]=0,A[8]=0,A[9]=0,A[11]=-1,A[12]=0,A[13]=0,A[15]=0,null!=r&&r!==1/0){var a=1/(n-r);A[10]=r*a,A[14]=r*n*a}else A[10]=-1,A[14]=-n;return A},rotate:function(A,t,e,n){var r,i,a,o,s,u,c,l,h,d,f,B,g,p,v,w,y,C,Q,F,U,E,b,k,x=n[0],H=n[1],I=n[2],T=Math.sqrt(x*x+H*H+I*I);return m>T?null:(x*=T=1/T,H*=T,I*=T,r=Math.sin(e),s=t[1],u=t[2],c=t[3],h=t[5],d=t[6],f=t[7],g=t[9],p=t[10],v=t[11],Q=x*H*(a=1-(i=Math.cos(e)))-I*r,F=H*H*a+i,U=I*H*a+x*r,E=x*I*a+H*r,b=H*I*a-x*r,k=I*I*a+i,A[0]=(o=t[0])*(w=x*x*a+i)+(l=t[4])*(y=H*x*a+I*r)+(B=t[8])*(C=I*x*a-H*r),A[1]=s*w+h*y+g*C,A[2]=u*w+d*y+p*C,A[3]=c*w+f*y+v*C,A[4]=o*Q+l*F+B*U,A[5]=s*Q+h*F+g*U,A[6]=u*Q+d*F+p*U,A[7]=c*Q+f*F+v*U,A[8]=o*E+l*b+B*k,A[9]=s*E+h*b+g*k,A[10]=u*E+d*b+p*k,A[11]=c*E+f*b+v*k,t!==A&&(A[12]=t[12],A[13]=t[13],A[14]=t[14],A[15]=t[15]),A)},rotateX:L,rotateY:D,rotateZ:function(A,t,e){var n=Math.sin(e),r=Math.cos(e),i=t[0],a=t[1],o=t[2],s=t[3],u=t[4],c=t[5],l=t[6],h=t[7];return t!==A&&(A[8]=t[8],A[9]=t[9],A[10]=t[10],A[11]=t[11],A[12]=t[12],A[13]=t[13],A[14]=t[14],A[15]=t[15]),A[0]=i*r+u*n,A[1]=a*r+c*n,A[2]=o*r+l*n,A[3]=s*r+h*n,A[4]=u*r-i*n,A[5]=c*r-a*n,A[6]=l*r-o*n,A[7]=h*r-s*n,A},scale:S,set:b,str:function(A){return"mat4("+A[0]+", "+A[1]+", "+A[2]+", "+A[3]+", "+A[4]+", "+A[5]+", "+A[6]+", "+A[7]+", "+A[8]+", "+A[9]+", "+A[10]+", "+A[11]+", "+A[12]+", "+A[13]+", "+A[14]+", "+A[15]+")"},sub:AA,subtract:AA,targetTo:function(A,t,e,n){var r=t[0],i=t[1],a=t[2],o=n[0],s=n[1],u=n[2],c=r-e[0],l=i-e[1],h=a-e[2],d=c*c+l*l+h*h;d>0&&(c*=d=1/Math.sqrt(d),l*=d,h*=d);var f=s*h-u*l,B=u*c-o*h,g=o*l-s*c;return(d=f*f+B*B+g*g)>0&&(f*=d=1/Math.sqrt(d),B*=d,g*=d),A[0]=f,A[1]=B,A[2]=g,A[3]=0,A[4]=l*g-h*B,A[5]=h*f-c*g,A[6]=c*B-l*f,A[7]=0,A[8]=c,A[9]=l,A[10]=h,A[11]=0,A[12]=r,A[13]=i,A[14]=a,A[15]=1,A},translate:M,transpose:x});function nA(){var A=new C(3);return C!=Float32Array&&(A[0]=0,A[1]=0,A[2]=0),A}function rA(A){var t=new C(3);return t[0]=A[0],t[1]=A[1],t[2]=A[2],t}function iA(A){var t=A[0],e=A[1],n=A[2];return Math.sqrt(t*t+e*e+n*n)}function aA(A,t,e){var n=new C(3);return n[0]=A,n[1]=t,n[2]=e,n}function oA(A,t){return A[0]=t[0],A[1]=t[1],A[2]=t[2],A}function sA(A,t,e,n){return A[0]=t,A[1]=e,A[2]=n,A}function uA(A,t,e){return A[0]=t[0]+e[0],A[1]=t[1]+e[1],A[2]=t[2]+e[2],A}function cA(A,t,e){return A[0]=t[0]-e[0],A[1]=t[1]-e[1],A[2]=t[2]-e[2],A}function lA(A,t,e){return A[0]=t[0]*e,A[1]=t[1]*e,A[2]=t[2]*e,A}function hA(A,t){var e=t[0],n=t[1],r=t[2],i=e*e+n*n+r*r;return i>0&&(i=1/Math.sqrt(i)),A[0]=t[0]*i,A[1]=t[1]*i,A[2]=t[2]*i,A}function dA(A,t){return A[0]*t[0]+A[1]*t[1]+A[2]*t[2]}function fA(A,t,e){var n=t[0],r=t[1],i=t[2],a=e[0],o=e[1],s=e[2];return A[0]=r*s-i*o,A[1]=i*a-n*s,A[2]=n*o-r*a,A}function BA(A,t,e,n){var r=t[0],i=t[1],a=t[2];return A[0]=r+n*(e[0]-r),A[1]=i+n*(e[1]-i),A[2]=a+n*(e[2]-a),A}function gA(A,t,e){var n=t[0],r=t[1],i=t[2],a=e[3]*n+e[7]*r+e[11]*i+e[15];return A[0]=(e[0]*n+e[4]*r+e[8]*i+e[12])/(a=a||1),A[1]=(e[1]*n+e[5]*r+e[9]*i+e[13])/a,A[2]=(e[2]*n+e[6]*r+e[10]*i+e[14])/a,A}function pA(A,t){var e=A[0],n=A[1],r=A[2],i=t[0],a=t[1],o=t[2];return m*Math.max(1,Math.abs(e),Math.abs(i))>=Math.abs(e-i)&&m*Math.max(1,Math.abs(n),Math.abs(a))>=Math.abs(n-a)&&m*Math.max(1,Math.abs(r),Math.abs(o))>=Math.abs(r-o)}var vA=cA,wA=function(A,t){var e=t[0]-A[0],n=t[1]-A[1],r=t[2]-A[2];return Math.sqrt(e*e+n*n+r*r)},yA=iA;function mA(){var A=new C(4);return C!=Float32Array&&(A[0]=0,A[1]=0,A[2]=0,A[3]=0),A}function CA(A,t,e,n){var r=new C(4);return r[0]=A,r[1]=t,r[2]=e,r[3]=n,r}function QA(A,t,e){var n=t[0],r=t[1],i=t[2],a=t[3];return A[0]=e[0]*n+e[4]*r+e[8]*i+e[12]*a,A[1]=e[1]*n+e[5]*r+e[9]*i+e[13]*a,A[2]=e[2]*n+e[6]*r+e[10]*i+e[14]*a,A[3]=e[3]*n+e[7]*r+e[11]*i+e[15]*a,A}function FA(){var A=new C(4);return C!=Float32Array&&(A[0]=0,A[1]=0,A[2]=0),A[3]=1,A}function UA(A,t,e){var n=Math.sin(e*=.5);return A[0]=n*t[0],A[1]=n*t[1],A[2]=n*t[2],A[3]=Math.cos(e),A}function EA(A,t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=e[0],s=e[1],u=e[2],c=e[3];return A[0]=n*c+a*o+r*u-i*s,A[1]=r*c+a*s+i*o-n*u,A[2]=i*c+a*u+n*s-r*o,A[3]=a*c-n*o-r*s-i*u,A}function bA(A,t){var e=t[0],n=t[1],r=t[2],i=t[3],a=e*e+n*n+r*r+i*i,o=a?1/a:0;return A[0]=-e*o,A[1]=-n*o,A[2]=-r*o,A[3]=i*o,A}function kA(A,t,e,n){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"zyx",i=Math.PI/360;n*=i,e*=i;var a=Math.sin(t*=i),o=Math.cos(t),s=Math.sin(e),u=Math.cos(e),c=Math.sin(n),l=Math.cos(n);switch(r){case"xyz":A[0]=a*u*l+o*s*c,A[1]=o*s*l-a*u*c,A[2]=o*u*c+a*s*l,A[3]=o*u*l-a*s*c;break;case"xzy":A[0]=a*u*l-o*s*c,A[1]=o*s*l-a*u*c,A[2]=o*u*c+a*s*l,A[3]=o*u*l+a*s*c;break;case"yxz":A[0]=a*u*l+o*s*c,A[1]=o*s*l-a*u*c,A[2]=o*u*c-a*s*l,A[3]=o*u*l+a*s*c;break;case"yzx":A[0]=a*u*l+o*s*c,A[1]=o*s*l+a*u*c,A[2]=o*u*c-a*s*l,A[3]=o*u*l-a*s*c;break;case"zxy":A[0]=a*u*l-o*s*c,A[1]=o*s*l+a*u*c,A[2]=o*u*c+a*s*l,A[3]=o*u*l-a*s*c;break;case"zyx":A[0]=a*u*l-o*s*c,A[1]=o*s*l+a*u*c,A[2]=o*u*c-a*s*l,A[3]=o*u*l+a*s*c;break;default:throw Error("Unknown angle order "+r)}return A}nA(),function(){var A=mA()}();var xA=CA,HA=function(A,t){return A[0]=t[0],A[1]=t[1],A[2]=t[2],A[3]=t[3],A},IA=function(A,t,e,n,r){return A[0]=t,A[1]=e,A[2]=n,A[3]=r,A},TA=EA,MA=function(A,t){var e=t[0],n=t[1],r=t[2],i=t[3],a=e*e+n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),A[0]=e*a,A[1]=n*a,A[2]=r*a,A[3]=i*a,A};function SA(){var A=new C(2);return C!=Float32Array&&(A[0]=0,A[1]=0),A}function LA(A){return"function"==typeof A}function DA(A){return null==A}function PA(A){return Array.isArray(A)}nA(),aA(1,0,0),aA(0,1,0),FA(),FA(),Q(),function(){var A=SA()}();var NA={}.toString,OA=function(A,t){return NA.call(A)==="[object "+t+"]"};function KA(A){if(!Array.isArray(A))return-1/0;var t=A.length;if(!t)return-1/0;for(var e=A[0],n=1;t>n;n++)e=Math.max(e,A[n]);return e}var RA=function(A){if(PA(A))return A.reduce(function(A,t){return Math.min(A,t)},A[0])};function GA(A){return"string"==typeof A}var VA=function(A,t,e){return t>A?t:A>e?e:A};function _A(A){return"number"==typeof A}function XA(A,t,e){return void 0===e&&(e=1e-5),A===t||e>Math.abs(A-t)}var YA=function(A,t){return(A%t+t)%t},WA=function(A){return OA(A,"Boolean")},JA=function(A){return void 0===A},ZA=function(){return ZA=Object.assign||function(A){for(var t,e=1,n=arguments.length;n>e;e++)for(var r in t=arguments[e])Object.prototype.hasOwnProperty.call(t,r)&&(A[r]=t[r]);return A},ZA.apply(this,arguments)};function zA(A,t,e){if(e||2===arguments.length)for(var n,r=0,i=t.length;i>r;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return A.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var jA={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function qA(A,t,e){if(A[e].length>7){A[e].shift();for(var n=A[e],r=e;n.length;)t[e]="A",A.splice(r+=1,0,["C"].concat(n.splice(0,6)));A.splice(e,1)}}var $A={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function At(A){return Array.isArray(A)&&A.every(function(A){var t=A[0].toLowerCase();return $A[t]===A.length-1&&"achlmqstvz".includes(t)})}function tt(A){return At(A)&&A.every(function(A){var t=A[0];return t===t.toUpperCase()})}function et(A){return tt(A)&&A.every(function(A){return"ACLMQZ".includes(A[0])})}function nt(A){for(var t=A.pathValue[A.segmentStart],e=t.toLowerCase(),n=A.data;n.length>=$A[e]&&("m"===e&&n.length>2?(A.segments.push([t].concat(n.splice(0,2))),e="l",t="m"===t?"l":"L"):A.segments.push([t].concat(n.splice(0,$A[e]))),$A[e]););}function rt(A){var t=A.index,e=A.pathValue,n=e.charCodeAt(t);return 48===n?(A.param=0,void(A.index+=1)):49===n?(A.param=1,void(A.index+=1)):void(A.err='[path-util]: invalid Arc flag "'.concat(e[t],'", expecting 0 or 1 at index ').concat(t))}function it(A){return A>=48&&57>=A||43===A||45===A||46===A}function at(A){return A>=48&&57>=A}function ot(A){var t,e=A.max,n=A.pathValue,r=A.index,i=r,a=!1,o=!1,s=!1,u=!1;if(e>i)if(43!==(t=n.charCodeAt(i))&&45!==t||(t=n.charCodeAt(i+=1)),at(t)||46===t){if(46!==t){if(a=48===t,t=n.charCodeAt(i+=1),a&&e>i&&t&&at(t))return void(A.err="[path-util]: Invalid path value at index ".concat(r,', "').concat(n[r],'" illegal number'));for(;e>i&&at(n.charCodeAt(i));)i+=1,o=!0;t=n.charCodeAt(i)}if(46===t){for(u=!0,i+=1;at(n.charCodeAt(i));)i+=1,s=!0;t=n.charCodeAt(i)}if(101===t||69===t){if(u&&!o&&!s)return void(A.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(n[i],'" invalid float exponent'));if(43!==(t=n.charCodeAt(i+=1))&&45!==t||(i+=1),i>=e||!at(n.charCodeAt(i)))return void(A.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(n[i],'" invalid integer exponent'));for(;e>i&&at(n.charCodeAt(i));)i+=1}A.index=i,A.param=+A.pathValue.slice(r,i)}else A.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(n[i],'" is not a number');else A.err="[path-util]: Invalid path value at index ".concat(i,', "pathValue" is missing param')}function st(A){return 10===A||13===A||8232===A||8233===A||32===A||9===A||11===A||12===A||160===A||A>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(A)}function ut(A){for(var t=A.pathValue,e=A.max;e>A.index&&st(t.charCodeAt(A.index));)A.index+=1}function ct(A){return 97==(32|A)}function lt(A){var t=A.max,e=A.pathValue,n=A.index,r=e.charCodeAt(n),i=$A[e[n].toLowerCase()];if(A.segmentStart=n,function(A){switch(32|A){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}}(r))if(A.index+=1,ut(A),A.data=[],i){for(;;){for(var a=i;a>0;a-=1){if(!ct(r)||3!==a&&4!==a?ot(A):rt(A),A.err.length)return;A.data.push(A.param),ut(A),t>A.index&&44===e.charCodeAt(A.index)&&(A.index+=1,ut(A))}if(A.index>=A.max)break;if(!it(e.charCodeAt(A.index)))break}nt(A)}else nt(A);else A.err='[path-util]: Invalid path value "'.concat(e[n],'" is not a path command')}var ht=function(A){this.pathValue=A,this.segments=[],this.max=A.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function dt(A){if(tt(A))return[].concat(A);var t=function(A){if(At(A))return[].concat(A);var t=new ht(A);for(ut(t);t.max>t.index&&!t.err.length;)lt(t);return t.err?t.err:t.segments}(A),e=0,n=0,r=0,i=0;return t.map(function(A){var t,a=A.slice(1).map(Number),o=A[0],s=o.toUpperCase();if("M"===o)return r=e=a[0],i=n=a[1],["M",e,n];if(o!==s)switch(s){case"A":t=[s,a[0],a[1],a[2],a[3],a[4],a[5]+e,a[6]+n];break;case"V":t=[s,a[0]+n];break;case"H":t=[s,a[0]+e];break;default:var u=a.map(function(A,t){return A+(t%2?n:e)});t=[s].concat(u)}else t=[s].concat(a);var c=t.length;switch(s){case"Z":e=r,n=i;break;case"H":e=t[1];break;case"V":n=t[1];break;default:e=t[c-2],n=t[c-1],"M"===s&&(r=e,i=n)}return t})}function ft(A,t){var e=A[0],n=t.x1,r=t.y1,i=t.x2,a=t.y2,o=A.slice(1).map(Number),s=A;if("TQ".includes(e)||(t.qx=null,t.qy=null),"H"===e)s=["L",A[1],r];else if("V"===e)s=["L",n,A[1]];else if("S"===e){var u=2*n-i,c=2*r-a;t.x1=u,t.y1=c,s=["C",u,c].concat(o)}else if("T"===e){var l=2*n-t.qx,h=2*r-t.qy;t.qx=l,t.qy=h,s=["Q",l,h].concat(o)}else if("Q"===e){var d=o[1];t.qx=o[0],t.qy=d}return s}function Bt(A){if(et(A))return[].concat(A);for(var t=dt(A),e=ZA({},jA),n=0;t.length>n;n+=1){t[n]=ft(t[n],e);var r=t[n],i=r.length;e.x1=+r[i-2],e.y1=+r[i-1],e.x2=+r[i-4]||e.x1,e.y2=+r[i-3]||e.y1}return t}function gt(A,t,e){return{x:A*Math.cos(e)-t*Math.sin(e),y:A*Math.sin(e)+t*Math.cos(e)}}function pt(A,t,e,n,r,i,a,o,s,u){var c,l,h,d,f,B=A,g=t,p=e,v=n,w=o,y=s,m=120*Math.PI/180,C=Math.PI/180*(+r||0),Q=[];if(u)l=u[0],h=u[1],d=u[2],f=u[3];else{g=(c=gt(B,g,-C)).y;var F=((B=c.x)-(w=(c=gt(w,y,-C)).x))/2,U=(g-(y=c.y))/2,E=F*F/(p*p)+U*U/(v*v);E>1&&(p*=E=Math.sqrt(E),v*=E);var b=p*p,k=v*v,x=(i===a?-1:1)*Math.sqrt(Math.abs((b*k-b*U*U-k*F*F)/(b*U*U+k*F*F)));d=x*p*U/v+(B+w)/2,l=Math.asin(((g-(f=x*-v*F/p+(g+y)/2))/v*1e9|0)/1e9),h=Math.asin(((y-f)/v*1e9|0)/1e9),0>(l=d>B?Math.PI-l:l)&&(l=2*Math.PI+l),0>(h=d>w?Math.PI-h:h)&&(h=2*Math.PI+h),a&&l>h&&(l-=2*Math.PI),!a&&h>l&&(h-=2*Math.PI)}var H=h-l;if(Math.abs(H)>m){var I=h,T=w,M=y;Q=pt(w=d+p*Math.cos(h=l+m*(a&&h>l?1:-1)),y=f+v*Math.sin(h),p,v,r,0,a,T,M,[h,I,d,f])}H=h-l;var S=Math.cos(l),L=Math.sin(l),D=Math.cos(h),P=Math.sin(h),N=Math.tan(H/4),O=4/3*p*N,K=4/3*v*N,R=[B,g],G=[B+O*L,g-K*S],V=[w+O*P,y-K*D],_=[w,y];if(G[0]=2*R[0]-G[0],G[1]=2*R[1]-G[1],u)return G.concat(V,_,Q);for(var X=[],Y=0,W=(Q=G.concat(V,_,Q)).length;W>Y;Y+=1)X[Y]=Y%2?gt(Q[Y-1],Q[Y],C).y:gt(Q[Y],Q[Y+1],C).x;return X}function vt(A,t,e){var n=A[0],r=A[1];return[n+(t[0]-n)*e,r+(t[1]-r)*e]}var wt=function(A,t,e,n){return zA(zA([],vt([A,t],[e,n],.5),!0),[e,n,e,n],!1)};function yt(A,t){var e,n,r,i,a,o,s,u=A[0],c=A.slice(1).map(Number),l=c[0],h=c[1],d=t.x1,f=t.y1,B=t.x,g=t.y;switch("TQ".includes(u)||(t.qx=null,t.qy=null),u){case"M":return t.x=l,t.y=h,A;case"A":return e=[d,f].concat(c),["C"].concat(pt(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9]));case"Q":return t.qx=l,t.qy=h,e=[d,f].concat(c),["C"].concat([(o=1/3)*e[0]+(s=2/3)*(n=e[2]),o*e[1]+s*(r=e[3]),o*(i=e[4])+s*n,o*(a=e[5])+s*r,i,a]);case"L":return["C"].concat(wt(d,f,l,h));case"Z":return d===B&&f===g?["C",d,f,B,g,B,g]:["C"].concat(wt(d,f,B,g))}return A}function mt(A,t){if(void 0===t&&(t=!1),function(A){return et(A)&&A.every(function(A){return"MC".includes(A[0])})}(A)){var e=[].concat(A);return t?[e,[]]:e}for(var n,r,i=Bt(A),a=ZA({},jA),o=[],s="",u=i.length,c=[],l=0;u>l;l+=1){i[l]&&(s=i[l][0]),o[l]=s;var h=yt(i[l],a);i[l]=h,qA(i,o,l),u=i.length,"Z"===s&&c.push(l),a.x1=+(n=i[l])[(r=n.length)-2],a.y1=+n[r-1],a.x2=+n[r-4]||a.x1,a.y2=+n[r-3]||a.y1}return t?[i,c]:i}function Ct(A,t){return Math.sqrt((A[0]-t[0])*(A[0]-t[0])+(A[1]-t[1])*(A[1]-t[1]))}function Qt(A,t,e,n,r){var i=Ct([A,t],[e,n]),a={x:0,y:0};if("number"==typeof r)if(0<r)if(r<i){var o=vt([A,t],[e,n],r/i);a={x:o[0],y:o[1]}}else a={x:e,y:n};else a={x:A,y:t};return{length:i,point:a,min:{x:Math.min(A,e),y:Math.min(t,n)},max:{x:Math.max(A,e),y:Math.max(t,n)}}}function Ft(A,t){var e=A.x,n=A.y,r=t.x,i=t.y;return(0>e*i-n*r?-1:1)*Math.acos((e*r+n*i)/Math.sqrt((Math.pow(e,2)+Math.pow(n,2))*(Math.pow(r,2)+Math.pow(i,2))))}function Ut(A,t,e,n,r,i,a,o,s,u){var c=Math.abs,l=Math.sin,h=Math.cos,d=Math.sqrt,f=Math.PI,B=c(e),g=c(n),p=(r%360+360)%360*(f/180);if(A===o&&t===s)return{x:A,y:t};if(0===B||0===g)return Qt(A,t,o,s,u).point;var v=(A-o)/2,w=(t-s)/2,y={x:h(p)*v+l(p)*w,y:-l(p)*v+h(p)*w},m=Math.pow(y.x,2)/Math.pow(B,2)+Math.pow(y.y,2)/Math.pow(g,2);m>1&&(B*=d(m),g*=d(m));var C=(Math.pow(B,2)*Math.pow(g,2)-Math.pow(B,2)*Math.pow(y.y,2)-Math.pow(g,2)*Math.pow(y.x,2))/(Math.pow(B,2)*Math.pow(y.y,2)+Math.pow(g,2)*Math.pow(y.x,2)),Q=(i!==a?1:-1)*d(C=0>C?0:C),F=Q*(B*y.y/g),U=Q*(-g*y.x/B),E=h(p)*F-l(p)*U+(A+o)/2,b=l(p)*F+h(p)*U+(t+s)/2,k={x:(y.x-F)/B,y:(y.y-U)/g},x=Ft({x:1,y:0},k),H=Ft(k,{x:(-y.x-F)/B,y:(-y.y-U)/g});!a&&H>0?H-=2*f:a&&0>H&&(H+=2*f);var I=x+(H%=2*f)*u,T=B*h(I),M=g*l(I);return{x:h(p)*T-l(p)*M+E,y:l(p)*T+h(p)*M+b}}function Et(A,t,e,n,r,i,a,o,s,u,c){var l,h=c.bbox,d=void 0===h||h,f=c.length,B=void 0===f||f,g=c.sampleSize,p=void 0===g?30:g,v="number"==typeof u,w=A,y=t,m=0,C=[w,y,m],Q=[w,y],F={x:0,y:0},U=[{x:w,y:y}];v&&0>=u&&(F={x:w,y:y});for(var E=0;p>=E;E+=1){if(w=(l=Ut(A,t,e,n,r,i,a,o,s,E/p)).x,y=l.y,d&&U.push({x:w,y:y}),B&&(m+=Ct(Q,[w,y])),Q=[w,y],v&&m>=u&&u>C[2]){var b=(m-u)/(m-C[2]);F={x:Q[0]*(1-b)+C[0]*b,y:Q[1]*(1-b)+C[1]*b}}C=[w,y,m]}return v&&u>=m&&(F={x:o,y:s}),{length:m,point:F,min:{x:Math.min.apply(null,U.map(function(A){return A.x})),y:Math.min.apply(null,U.map(function(A){return A.y}))},max:{x:Math.max.apply(null,U.map(function(A){return A.x})),y:Math.max.apply(null,U.map(function(A){return A.y}))}}}function bt(A,t,e,n,r,i,a,o,s){var u=1-s;return{x:Math.pow(u,3)*A+3*Math.pow(u,2)*s*e+3*u*Math.pow(s,2)*r+Math.pow(s,3)*a,y:Math.pow(u,3)*t+3*Math.pow(u,2)*s*n+3*u*Math.pow(s,2)*i+Math.pow(s,3)*o}}function kt(A,t,e,n,r,i,a,o,s,u){var c,l=u.bbox,h=void 0===l||l,d=u.length,f=void 0===d||d,B=u.sampleSize,g=void 0===B?10:B,p="number"==typeof s,v=A,w=t,y=0,m=[v,w,y],C=[v,w],Q={x:0,y:0},F=[{x:v,y:w}];p&&0>=s&&(Q={x:v,y:w});for(var U=0;g>=U;U+=1){if(v=(c=bt(A,t,e,n,r,i,a,o,U/g)).x,w=c.y,h&&F.push({x:v,y:w}),f&&(y+=Ct(C,[v,w])),C=[v,w],p&&y>=s&&s>m[2]){var E=(y-s)/(y-m[2]);Q={x:C[0]*(1-E)+m[0]*E,y:C[1]*(1-E)+m[1]*E}}m=[v,w,y]}return p&&s>=y&&(Q={x:a,y:o}),{length:y,point:Q,min:{x:Math.min.apply(null,F.map(function(A){return A.x})),y:Math.min.apply(null,F.map(function(A){return A.y}))},max:{x:Math.max.apply(null,F.map(function(A){return A.x})),y:Math.max.apply(null,F.map(function(A){return A.y}))}}}function xt(A,t,e,n,r,i,a){var o=1-a;return{x:Math.pow(o,2)*A+2*o*a*e+Math.pow(a,2)*r,y:Math.pow(o,2)*t+2*o*a*n+Math.pow(a,2)*i}}function Ht(A,t,e,n,r,i,a,o){var s,u=o.bbox,c=void 0===u||u,l=o.length,h=void 0===l||l,d=o.sampleSize,f=void 0===d?10:d,B="number"==typeof a,g=A,p=t,v=0,w=[g,p,v],y=[g,p],m={x:0,y:0},C=[{x:g,y:p}];B&&0>=a&&(m={x:g,y:p});for(var Q=0;f>=Q;Q+=1){if(g=(s=xt(A,t,e,n,r,i,Q/f)).x,p=s.y,c&&C.push({x:g,y:p}),h&&(v+=Ct(y,[g,p])),y=[g,p],B&&v>=a&&a>w[2]){var F=(v-a)/(v-w[2]);m={x:y[0]*(1-F)+w[0]*F,y:y[1]*(1-F)+w[1]*F}}w=[g,p,v]}return B&&a>=v&&(m={x:r,y:i}),{length:v,point:m,min:{x:Math.min.apply(null,C.map(function(A){return A.x})),y:Math.min.apply(null,C.map(function(A){return A.y}))},max:{x:Math.max.apply(null,C.map(function(A){return A.x})),y:Math.max.apply(null,C.map(function(A){return A.y}))}}}function It(A,t,e){for(var n,r,i,a,o,s,u,c,l,h=Bt(A),d="number"==typeof t,f=[],B=0,g=0,p=0,v=0,w=[],y=[],m=0,C={x:0,y:0},Q=C,F=C,U=C,E=0,b=0,k=h.length;k>b;b+=1)f=(u="M"===(c=(l=h[b])[0]))?f:[B,g].concat(l.slice(1)),u?(Q=C={x:p=l[1],y:v=l[2]},m=0,d&&.001>t&&(U=C)):"L"===c?(m=(n=Qt(f[0],f[1],f[2],f[3],(t||0)-E)).length,C=n.min,Q=n.max,F=n.point):"A"===c?(m=(r=Et(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],(t||0)-E,e||{})).length,C=r.min,Q=r.max,F=r.point):"C"===c?(m=(i=kt(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],(t||0)-E,e||{})).length,C=i.min,Q=i.max,F=i.point):"Q"===c?(m=(a=Ht(f[0],f[1],f[2],f[3],f[4],f[5],(t||0)-E,e||{})).length,C=a.min,Q=a.max,F=a.point):"Z"===c&&(m=(o=Qt((f=[B,g,p,v])[0],f[1],f[2],f[3],(t||0)-E)).length,C=o.min,Q=o.max,F=o.point),d&&t>E&&E+m>=t&&(U=F),y.push(Q),w.push(C),E+=m,B=(s="Z"!==c?l.slice(-2):[p,v])[0],g=s[1];return d&&t>=E&&(U={x:B,y:g}),{length:E,point:U,min:{x:Math.min.apply(null,w.map(function(A){return A.x})),y:Math.min.apply(null,w.map(function(A){return A.y}))},max:{x:Math.max.apply(null,y.map(function(A){return A.x})),y:Math.max.apply(null,y.map(function(A){return A.y}))}}}function Tt(A,t){var e=A.length-1,n=[],r=0,i=function(A){var t=A.length,e=t-1;return A.map(function(n,r){return A.map(function(n,i){var a=r+i;return 0===i||A[a]&&"M"===A[a][0]?["M"].concat(A[a].slice(-2)):(t>a||(a-=e),A[a])})})}(A);return i.forEach(function(i,a){A.slice(1).forEach(function(n,i){r+=Ct(A[(a+i)%e].slice(-2),t[i%e].slice(-2))}),n[a]=r,r=0}),i[n.indexOf(Math.min.apply(null,n))]}function Mt(A){return function(A){var t=0,e=0,n=0;return mt(A).map(function(A){var r;if("M"===A[0])return t=A[1],e=A[2],0;var i,a,o,s,u,c,l,h,d=A.slice(1);return n=3*(((h=d[5])-(a=e))*((o=d[0])+(u=d[2]))-((l=d[4])-(i=t))*((s=d[1])+(c=d[3]))+s*(i-u)-o*(a-c)+h*(u+i/3)-l*(c+a/3))/20,r=A.slice(-2),t=r[0],e=r[1],n}).reduce(function(A,t){return A+t},0)}(A)>=0}function St(A){return A.map(function(A,t,e){var n=t&&e[t-1].slice(-2).concat(A.slice(1)),r=t?kt(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],{bbox:!1}).length:0;return{s:A,ss:t?r?function(A,t){void 0===t&&(t=.5);var e=A.slice(0,2),n=A.slice(2,4),r=A.slice(4,6),i=A.slice(6,8),a=vt(e,n,t),o=vt(n,r,t),s=vt(r,i,t),u=vt(a,o,t),c=vt(o,s,t),l=vt(u,c,t);return[["C"].concat(a,u,l),["C"].concat(c,s,i)]}(n):[A,A]:[A],l:r}})}function Lt(A,t,e,n){if(void 0===n&&(n=0),n>50)return console.warn("Maximum recursion depth reached in equalizeSegments"),[A,t];var r=St(A),i=St(t),a=r.length,o=i.length,s=r.filter(function(A){return A.l}).length,u=i.filter(function(A){return A.l}).length,c=r.filter(function(A){return A.l}).reduce(function(A,t){return A+t.l},0)/s||0,l=i.filter(function(A){return A.l}).reduce(function(A,t){return A+t.l},0)/u||0,h=e||Math.max(a,o),d=[c,l],f=[h-a,h-o],B=0,g=[r,i].map(function(A,t){return A.l===h?A.map(function(A){return A.s}):A.map(function(A,e){return f[t]-=(B=e&&f[t]&&A.l>=d[t])?1:0,B?A.ss:[A.s]}).flat()});return g[0].length===g[1].length?g:Lt(g[0],g[1],h,n+1)}function Dt(){return Dt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(A,t,e){var n=function(A,t){for(;!{}.hasOwnProperty.call(A,t)&&null!==(A=h(A)););return A}(A,t);if(n){var r=Object.getOwnPropertyDescriptor(n,t);return r.get?r.get.call(3>arguments.length?A:e):r.value}},Dt.apply(null,arguments)}function Pt(A,t,e,n){var r=Dt(h(1&n?A.prototype:A),t,e);return 2&n&&"function"==typeof r?function(A){return r.apply(e,A)}:r}
10
10
  /*!
11
11
  * @antv/g-math
12
12
  * @description Geometry util
13
13
  * @version 3.1.0
14
- * @date 12/24/2025, 11:55:15 AM
14
+ * @date 10/10/2026, 9:45:31 AM
15
15
  * @author AntVis
16
16
  * @docs https://g.antv.antgroup.com/
17
17
  */function Nt(A,t,e,n){var r=A-e,i=t-n;return Math.sqrt(r*r+i*i)}function Ot(A,t){var e=Math.min.apply(Math,l(A)),n=Math.min.apply(Math,l(t));return{x:e,y:n,width:Math.max.apply(Math,l(A))-e,height:Math.max.apply(Math,l(t))-n}}function Kt(A,t,e,n,r,i){return e*Math.cos(r)*Math.cos(i)-n*Math.sin(r)*Math.sin(i)+A}function Rt(A,t,e,n,r,i){return e*Math.sin(r)*Math.cos(i)+n*Math.cos(r)*Math.sin(i)+t}function Gt(A,t,e,n,r,i,a){for(var o=function(A,t,e){return Math.atan(-t/A*Math.tan(e))}(e,n,r),s=1/0,u=-1/0,c=[i,a],l=2*-Math.PI;2*Math.PI>=l;l+=Math.PI){var h=o+l;a>i?h>i&&a>h&&c.push(h):h>a&&i>h&&c.push(h)}for(var d=0;c.length>d;d++){var f=Kt(A,0,e,n,r,c[d]);s>f&&(s=f),f>u&&(u=f)}for(var B=function(A,t,e){return Math.atan(t/(A*Math.tan(e)))}(e,n,r),g=1/0,p=-1/0,v=[i,a],w=2*-Math.PI;2*Math.PI>=w;w+=Math.PI){var y=B+w;a>i?y>i&&a>y&&v.push(y):y>a&&i>y&&v.push(y)}for(var m=0;v.length>m;m++){var C=Rt(0,t,e,n,r,v[m]);g>C&&(g=C),C>p&&(p=C)}return{x:s,y:g,width:u-s,height:p-g}}function Vt(A,t,e,n){return Nt(A,t,e,n)}function _t(A,t,e,n,r){return{x:(1-r)*A+r*e,y:(1-r)*t+r*n}}function Xt(A,t,e,n,r){var i=1-r;return i*i*i*A+3*t*r*i*i+3*e*r*r*i+n*r*r*r}function Yt(A,t,e,n){var r,i,a,o=-3*A+9*t-9*e+3*n,s=6*A-12*t+6*e,u=3*t-3*A,c=[];if(XA(o,0))XA(s,0)||0>(r=-u/s)||r>1||c.push(r);else{var l=s*s-4*o*u;XA(l,0)?c.push(-s/(2*o)):l>0&&(i=(-s-(a=Math.sqrt(l)))/(2*o),0>(r=(-s+a)/(2*o))||r>1||c.push(r),0>i||i>1||c.push(i))}return c}function Wt(A,t,e,n,r,i,a,o){for(var s=[A,a],u=[t,o],c=Yt(A,e,r,a),l=Yt(t,n,i,o),h=0;c.length>h;h++)s.push(Xt(A,e,r,a,c[h]));for(var d=0;l.length>d;d++)u.push(Xt(t,n,i,o,l[d]));return Ot(s,u)}function Jt(A){return function(A){if(2>A.length)return 0;for(var t=0,e=0;A.length-1>e;e++){var n=A[e],r=A[e+1];t+=Nt(n[0],n[1],r[0],r[1])}return t}(A)}function Zt(A,t,e,n){var r=1-n;return r*r*A+2*n*r*t+n*n*e}function zt(A,t,e){var n=A+e-2*t;if(XA(n,0))return[.5];var r=(A-t)/n;return r>1||0>r?[]:[r]}function jt(A,t,e,n,r,i){var a=zt(A,e,r)[0],o=zt(t,n,i)[0],s=[A,r],u=[t,i];return void 0!==a&&s.push(Zt(A,e,r,a)),void 0!==o&&u.push(Zt(t,n,i,o)),Ot(s,u)}function qt(A,t){this.v=A,this.k=t}function $t(A,t,e,n){var r=Object.defineProperty;try{r({},"",{})}catch(A){r=0}$t=function(A,t,e,n){function i(t,e){$t(A,t,function(A){return this._invoke(t,e,A)})}t?r?r(A,t,{value:e,enumerable:!n,configurable:!n,writable:!n}):A[t]=e:(i("next",0),i("throw",1),i("return",2))},$t(A,t,e,n)}function Ae(){
18
18
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
19
- var A,t,e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",r=e.toStringTag||"@@toStringTag";function i(e,n,r,i){var s=Object.create((n&&n.prototype instanceof o?n:o).prototype);return $t(s,"_invoke",function(e,n,r){var i,o,s,u=0,c=r||[],l=!1,h={p:0,n:0,v:A,a:d,f:d.bind(A,4),d:function(t,e){return i=t,o=0,s=A,h.n=e,a}};function d(e,n){for(o=e,s=n,t=0;!l&&u&&!r&&c.length>t;t++){var r,i=c[t],d=h.p,f=i[2];e>3?(r=f===n)&&(s=i[(o=i[4])?5:(o=3,3)],i[4]=i[5]=A):d>=i[0]&&((r=2>e&&i[1]>d)?(o=0,h.v=n,h.n=i[1]):f>d&&(r=3>e||i[0]>n||n>f)&&(i[4]=e,i[5]=n,h.n=f,o=0))}if(r||e>1)return a;throw l=!0,n}return function(r,c,f){if(u>1)throw TypeError("Generator is already running");for(l&&1===c&&d(c,f),o=c,s=f;(t=2>o?A:s)||!l;){i||(o?3>o?(o>1&&(h.n=-1),d(o,s)):h.n=s:h.v=s);try{if(u=2,i){if(o||(r="next"),t=i[r]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,2>o&&(o=0)}else 1===o&&(t=i.return)&&t.call(i),2>o&&(s=TypeError("The iterator does not provide a '"+r+"' method"),o=1);i=A}else if((t=(l=0>h.n)?s:e.call(n,h))!==a)break}catch(t){i=A,o=1,s=t}finally{u=1}}return{value:t,done:l}}}(e,r,i),!0),s}var a={};function o(){}function s(){}function u(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):($t(t={},n,function(){return this}),t),l=u.prototype=o.prototype=Object.create(c);function h(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,u):(A.__proto__=u,$t(A,r,"GeneratorFunction")),A.prototype=Object.create(l),A}return s.prototype=u,$t(l,"constructor",u),$t(u,"constructor",s),s.displayName="GeneratorFunction",$t(u,r,"GeneratorFunction"),$t(l),$t(l,r,"Generator"),$t(l,n,function(){return this}),$t(l,"toString",function(){return"[object Generator]"}),(Ae=function(){return{w:i,m:h}})()}function te(A,t){function e(n,r,i,a){try{var o=A[n](r),s=o.value;return s instanceof qt?t.resolve(s.v).then(function(A){e("next",A,i,a)},function(A){e("throw",A,i,a)}):t.resolve(s).then(function(A){o.value=A,i(o)},function(A){return e("throw",A,i,a)})}catch(A){a(A)}}var n;this.next||($t(te.prototype),$t(te.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),$t(this,"_invoke",function(A,r,i){function a(){return new t(function(t,n){e(A,i,t,n)})}return n=n?n.then(a,a):a()},!0)}function ee(A,t,e,n,r){return new te(Ae().w(A,t,e,n),r||Promise)}function ne(A,t,e,n,r){var i=ee(A,t,e,n,r);return i.next().then(function(A){return A.done?A.value:i.next()})}function re(A){var t=Object(A),e=[];for(var n in t)e.unshift(n);return function A(){for(;e.length;)if((n=e.pop())in t)return A.value=n,A.done=!1,A;return A.done=!0,A}}function ie(A){if(null!=A){var e=A["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(e)return e.call(A);if("function"==typeof A.next)return A;if(!isNaN(A.length))return{next:function(){return A&&n>=A.length&&(A=void 0),{value:A&&A[n++],done:!A}}}}throw new TypeError(t(A)+" is not iterable")}function ae(){var A=Ae(),t=A.m(ae),e=(Object.getPrototypeOf?Object.getPrototypeOf(t):t.__proto__).constructor;function n(A){var t="function"==typeof A&&A.constructor;return!!t&&(t===e||"GeneratorFunction"===(t.displayName||t.name))}var r={throw:1,return:2,break:3,continue:3};function i(A){var t,e;return function(n){t||(t={stop:function(){return e(n.a,2)},catch:function(){return n.v},abrupt:function(A,t){return e(n.a,r[A],t)},delegateYield:function(A,r,i){return t.resultName=r,e(n.d,ie(A),i)},finish:function(A){return e(n.f,A)}},e=function(A,e,r){n.p=t.prev,n.n=t.next;try{return A(e,r)}finally{t.next=n.n}}),t.resultName&&(t[t.resultName]=n.v,t.resultName=void 0),t.sent=n.v,t.next=n.n;try{return A.call(this,t)}finally{n.p=t.prev,n.n=t.next}}}return(ae=function(){return{wrap:function(t,e,n,r){return A.w(i(t),e,n,r&&r.reverse())},isGeneratorFunction:n,mark:A.m,awrap:function(A,t){return new qt(A,t)},AsyncIterator:te,async:function(A,t,e,r,a){return(n(t)?ee:ne)(i(A),t,e,r,a)},keys:re,values:ie}})()}function oe(A,t,e,n,r,i,a){try{var o=A[i](a),s=o.value}catch(A){return void e(A)}o.done?t(s):Promise.resolve(s).then(n,r)}function se(A){return function(){var t=this,e=arguments;return new Promise(function(n,r){var i=A.apply(t,e);function a(A){oe(i,n,r,a,o,"next",A)}function o(A){oe(i,n,r,a,o,"throw",A)}a(void 0)})}}function ue(A,t){var e="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!e){if(Array.isArray(A)||(e=c(A))||t&&A&&"number"==typeof A.length){e&&(A=e);var n=0,r=function(){};return{s:r,n:function(){return A.length>n?{done:!1,value:A[n++]}:{done:!0}},e:function(A){throw A},f:r}}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 i,a=!0,o=!1;return{s:function(){e=e.call(A)},n:function(){var A=e.next();return a=A.done,A},e:function(A){o=!0,i=A},f:function(){try{a||null==e.return||e.return()}finally{if(o)throw i}}}}function ce(A,t){if(null==A)return{};var e,n,r=function(A,t){if(null==A)return{};var e={};for(var n in A)if({}.hasOwnProperty.call(A,n)){if(-1!==t.indexOf(n))continue;e[n]=A[n]}return e}(A,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(A);for(n=0;i.length>n;n++)-1===t.indexOf(e=i[n])&&{}.propertyIsEnumerable.call(A,e)&&(r[e]=A[e])}return r}var le=function(A){return A.GROUP="g",A.FRAGMENT="fragment",A.CIRCLE="circle",A.ELLIPSE="ellipse",A.IMAGE="image",A.RECT="rect",A.LINE="line",A.POLYLINE="polyline",A.POLYGON="polygon",A.TEXT="text",A.PATH="path",A.HTML="html",A.MESH="mesh",A}({}),he=function(A){return A[A.ZERO=0]="ZERO",A[A.NEGATIVE_ONE=1]="NEGATIVE_ONE",A}({}),de=function(){return s(function A(){a(this,A),this.plugins=[]},[{key:"addRenderingPlugin",value:function(A){this.plugins.push(A),this.context.renderingPlugins.push(A)}},{key:"removeAllRenderingPlugins",value:function(){var A=this;this.plugins.forEach(function(t){var e=A.context.renderingPlugins.indexOf(t);0>e||A.context.renderingPlugins.splice(e,1)})}}])}(),fe=function(){return s(function A(t){a(this,A),this.clipSpaceNearZ=he.NEGATIVE_ONE,this.plugins=[],this.config=i({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0,enableRenderingOptimization:!1},t)},[{key:"registerPlugin",value:function(A){-1===this.plugins.findIndex(function(t){return t===A})&&this.plugins.push(A)}},{key:"unregisterPlugin",value:function(A){var t=this.plugins.findIndex(function(t){return t===A});t>-1&&this.plugins.splice(t,1)}},{key:"getPlugins",value:function(){return this.plugins}},{key:"getPlugin",value:function(A){return this.plugins.find(function(t){return t.name===A})}},{key:"getConfig",value:function(){return this.config}},{key:"setConfig",value:function(A){Object.assign(this.config,A)}}])}(),Be=uA,ge=oA,pe=function(A,t,e){return A[0]=Math.max(t[0],e[0]),A[1]=Math.max(t[1],e[1]),A[2]=Math.max(t[2],e[2]),A},ve=function(A,t,e){return A[0]=Math.min(t[0],e[0]),A[1]=Math.min(t[1],e[1]),A[2]=Math.min(t[2],e[2]),A},we=lA,ye=vA,me=function(){function A(){a(this,A),this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return s(A,[{key:"update",value:function(A,t){ge(this.center,A),ge(this.halfExtents,t),ye(this.min,this.center,this.halfExtents),Be(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(A,t){Be(this.center,t,A),we(this.center,this.center,.5),ye(this.halfExtents,t,A),we(this.halfExtents,this.halfExtents,.5),ge(this.min,A),ge(this.max,t)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(t){if(!A.isEmpty(t))if(A.isEmpty(this))this.setMinMax(t.getMin(),t.getMax());else{var e=this.center,n=e[0],r=e[1],i=e[2],a=this.halfExtents,o=a[0],s=a[1],u=a[2],c=n-o,l=n+o,h=r-s,d=r+s,f=i-u,B=i+u,g=t.center,p=g[0],v=g[1],w=g[2],y=t.halfExtents,m=y[0],C=y[1],Q=y[2],F=p-m,U=p+m,E=v-C,b=v+C,k=w-Q,x=w+Q;c>F&&(c=F),U>l&&(l=U),h>E&&(h=E),b>d&&(d=b),f>k&&(f=k),x>B&&(B=x),e[0]=.5*(c+l),e[1]=.5*(h+d),e[2]=.5*(f+B),a[0]=.5*(l-c),a[1]=.5*(d-h),a[2]=.5*(B-f),this.min[0]=c,this.min[1]=h,this.min[2]=f,this.max[0]=l,this.max[1]=d,this.max[2]=B}}},{key:"setFromTransformedAABB",value:function(A,t){var e=this.center,n=this.halfExtents,r=A.center,i=A.halfExtents,a=t[0],o=t[4],s=t[8],u=t[1],c=t[5],l=t[9],h=t[2],d=t[6],f=t[10],B=Math.abs(a),g=Math.abs(o),p=Math.abs(s),v=Math.abs(u),w=Math.abs(c),y=Math.abs(l),m=Math.abs(h),C=Math.abs(d),Q=Math.abs(f);e[0]=t[12]+a*r[0]+o*r[1]+s*r[2],e[1]=t[13]+u*r[0]+c*r[1]+l*r[2],e[2]=t[14]+h*r[0]+d*r[1]+f*r[2],n[0]=B*i[0]+g*i[1]+p*i[2],n[1]=v*i[0]+w*i[1]+y*i[2],n[2]=m*i[0]+C*i[1]+Q*i[2],ye(this.min,e,n),Be(this.max,e,n)}},{key:"intersects",value:function(A){var t=this.getMax(),e=this.getMin(),n=A.getMax(),r=A.getMin();return!(e[0]>n[0]||r[0]>t[0]||e[1]>n[1]||r[1]>t[1]||e[2]>n[2]||r[2]>t[2])}},{key:"intersection",value:function(t){if(!this.intersects(t))return null;var e=new A,n=pe([0,0,0],this.getMin(),t.getMin()),r=ve([0,0,0],this.getMax(),t.getMax());return e.setMinMax(n,r),e}},{key:"getNegativeFarPoint",value:function(A){return 273===A.pnVertexFlag?ge([0,0,0],this.min):272===A.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:257===A.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:256===A.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:17===A.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:16===A.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:1===A.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]}},{key:"getPositiveFarPoint",value:function(A){return 273===A.pnVertexFlag?ge([0,0,0],this.max):272===A.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:257===A.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:256===A.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:17===A.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:16===A.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:1===A.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]}}],[{key:"isEmpty",value:function(A){return!A||0===A.halfExtents[0]&&0===A.halfExtents[1]&&0===A.halfExtents[2]}}])}(),Ce=function(){return s(function A(t,e){a(this,A),this.distance=t||0,this.normal=e||aA(0,1,0),this.updatePNVertexFlag()},[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(A){return dA(A,this.normal)-this.distance}},{key:"normalize",value:function(){var A=1/yA(this.normal);lA(this.normal,this.normal,A),this.distance*=A}},{key:"intersectsLine",value:function(A,t,e){var n=this.distanceToPoint(A),r=n/(n-this.distanceToPoint(t)),i=r>=0&&1>=r;return i&&e&&BA(e,A,t,r),i}}])}(),Qe=function(A){return A[A.OUTSIDE=4294967295]="OUTSIDE",A[A.INSIDE=0]="INSIDE",A[A.INDETERMINATE=2147483647]="INDETERMINATE",A}({}),Fe=function(){return s(function A(t){if(a(this,A),this.planes=[],t)this.planes=t;else for(var e=0;6>e;e++)this.planes.push(new Ce)},[{key:"extractFromVPMatrix",value:function(A){var t=v(A,16),e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],u=t[7],c=t[8],l=t[9],h=t[10],d=t[11],f=t[12],B=t[13],g=t[14],p=t[15];sA(this.planes[0].normal,i-e,u-a,d-c),this.planes[0].distance=p-f,sA(this.planes[1].normal,i+e,u+a,d+c),this.planes[1].distance=p+f,sA(this.planes[2].normal,i+n,u+o,d+l),this.planes[2].distance=p+B,sA(this.planes[3].normal,i-n,u-o,d-l),this.planes[3].distance=p-B,sA(this.planes[4].normal,i-r,u-s,d-h),this.planes[4].distance=p-g,sA(this.planes[5].normal,i+r,u+s,d+h),this.planes[5].distance=p+g,this.planes.forEach(function(A){A.normalize(),A.updatePNVertexFlag()})}}])}(),Ue=function(){function A(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;a(this,A),this.x=0,this.y=0,this.x=t,this.y=e}return s(A,[{key:"clone",value:function(){return new A(this.x,this.y)}},{key:"copyFrom",value:function(A){this.x=A.x,this.y=A.y}}])}(),Ee=function(){function A(t,e,n,r){a(this,A),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 s(A,[{key:"toJSON",value:function(){}}],[{key:"fromRect",value:function(t){return new A(t.x,t.y,t.width,t.height)}},{key:"applyTransform",value:function(t,e){var n=CA(t.x,t.y,0,1),r=CA(t.x+t.width,t.y,0,1),i=CA(t.x,t.y+t.height,0,1),a=CA(t.x+t.width,t.y+t.height,0,1),o=mA(),s=mA(),u=mA(),c=mA();QA(o,n,e),QA(s,r,e),QA(u,i,e),QA(c,a,e);var l=Math.min(o[0],s[0],u[0],c[0]),h=Math.min(o[1],s[1],u[1],c[1]);return A.fromRect({x:l,y:h,width:Math.max(o[0],s[0],u[0],c[0])-l,height:Math.max(o[1],s[1],u[1],c[1])-h})}}])}(),be="Method not implemented.",ke="Use document.documentElement instead.";function xe(A){return void 0===A?0:A>360||-360>A?A%360:A}var He=nA();function Ie(A){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=3>=arguments.length||void 0===arguments[3]||arguments[3];return Array.isArray(A)&&3===A.length?n?rA(A):oA(He,A):_A(A)?n?aA(A,t,e):sA(He,A,t,e):n?aA(A[0],A[1]||t,A[2]||e):sA(He,A[0],A[1]||t,A[2]||e)}var Te=Math.PI/180;function Me(A){return A*Te}var Se=180/Math.PI;function Le(A){return A*Se}function De(A){return 360*A}var Pe=Math.PI/2;function Ne(A,t){return 16===t.length?function(A,t){var e,n,r=v(X(nA(),t),3),i=r[0],a=r[1],o=r[2],s=Math.asin(-t[2]/i);return Pe>s?s>-Pe?(e=Math.atan2(t[6]/a,t[10]/o),n=Math.atan2(t[1]/i,t[0]/i)):(n=0,e=-Math.atan2(t[4]/a,t[5]/a)):(n=0,e=Math.atan2(t[4]/a,t[5]/a)),A[0]=e,A[1]=s,A[2]=n,A}(A,t):function(A,t){var e=t[0],n=t[1],r=t[2],i=t[3],a=n*n,o=r*r,s=i*i,u=e*e+a+o+s,c=e*i-n*r;return c>.499995*u?(A[0]=Pe,A[1]=2*Math.atan2(n,e),A[2]=0):-.499995*u>c?(A[0]=-Pe,A[1]=2*Math.atan2(n,e),A[2]=0):(A[0]=Math.asin(2*(e*r-i*n)),A[1]=Math.atan2(2*(e*i+n*r),1-2*(o+s)),A[2]=Math.atan2(2*(e*n+r*i),1-2*(a+o))),A}(A,t)}function Oe(A,t,e,n,r){var i,a,o,s,u,c,l,h,d,f,B=Math.cos(A),g=Math.sin(A);return i=n*B,a=r*g,o=0,s=-n*g,u=r*B,c=0,l=t,h=e,d=1,(f=new C(9))[0]=i,f[1]=a,f[2]=o,f[3]=s,f[4]=u,f[5]=c,f[6]=l,f[7]=h,f[8]=d,f}function Ke(A){var t=A[0],e=A[1],n=A[3],r=A[4],i=Math.sqrt(t*t+e*e),a=Math.sqrt(n*n+r*r);if(0>t*r-e*n&&(r>t?i=-i:a=-a),i){var o=1/i;t*=o,e*=o}if(a){var s=1/a;n*=s,r*=s}var u=Le(Math.atan2(e,t));return[A[6],A[7],i,a,u]}var Re=F(),Ge=F(),Ve=mA(),_e=[nA(),nA(),nA()],Xe=nA();function Ye(A,t,e,n,r){A[0]=t[0]*n+e[0]*r,A[1]=t[1]*n+e[1]*r,A[2]=t[2]*n+e[2]*r}var We=function(A){return A[A.ORBITING=0]="ORBITING",A[A.EXPLORING=1]="EXPLORING",A[A.TRACKING=2]="TRACKING",A}({}),Je=function(A){return A[A.DEFAULT=0]="DEFAULT",A[A.ROTATIONAL=1]="ROTATIONAL",A[A.TRANSLATIONAL=2]="TRANSLATIONAL",A[A.CINEMATIC=3]="CINEMATIC",A}({}),Ze=function(A){return A[A.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",A[A.PERSPECTIVE=1]="PERSPECTIVE",A}({}),ze={UPDATED:"updated"},je=2e-4,qe=function(){return s(function A(){a(this,A),this.clipSpaceNearZ=he.NEGATIVE_ONE,this.eventEmitter=new y,this.matrix=F(),this.right=aA(1,0,0),this.up=aA(0,1,0),this.forward=aA(0,0,1),this.position=aA(0,0,1),this.focalPoint=aA(0,0,0),this.distanceVector=aA(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=F(),this.projectionMatrixInverse=F(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=We.EXPLORING,this.trackingMode=Je.DEFAULT,this.projectionMode=Ze.PERSPECTIVE,this.frustum=new Fe,this.orthoMatrix=F()},[{key:"isOrtho",value:function(){return this.projectionMode===Ze.ORTHOGRAPHIC}},{key:"getProjectionMode",value:function(){return this.projectionMode}},{key:"getPerspective",value:function(){return this.jitteredProjectionMatrix||this.projectionMatrix}},{key:"getPerspectiveInverse",value:function(){return this.projectionMatrixInverse}},{key:"getFrustum",value:function(){return this.frustum}},{key:"getPosition",value:function(){return this.position}},{key:"getFocalPoint",value:function(){return this.focalPoint}},{key:"getDollyingStep",value:function(){return this.dollyingStep}},{key:"getNear",value:function(){return this.near}},{key:"getFar",value:function(){return this.far}},{key:"getZoom",value:function(){return this.zoom}},{key:"getOrthoMatrix",value:function(){return this.orthoMatrix}},{key:"getView",value:function(){return this.view}},{key:"setEnableUpdate",value:function(A){this.enableUpdate=A}},{key:"setType",value:function(A,t){return this.type=A,this.setWorldRotation(this.type===We.EXPLORING),this._getAngles(),this.type===We.TRACKING&&void 0!==t&&this.setTrackingMode(t),this}},{key:"setProjectionMode",value:function(A){return this.projectionMode=A,this}},{key:"setTrackingMode",value:function(A){if(this.type!==We.TRACKING)throw Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=A,this}},{key:"setWorldRotation",value:function(A){return this.rotateWorld=A,this._getAngles(),this}},{key:"getViewTransform",value:function(){return H(F(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"jitterProjectionMatrix",value:function(A,t){var e=P(F(),[A,t,0]);this.jitteredProjectionMatrix=T(F(),e,this.projectionMatrix)}},{key:"clearJitterProjectionMatrix",value:function(){this.jitteredProjectionMatrix=void 0}},{key:"setMatrix",value:function(A){return this.matrix=A,this._update(),this}},{key:"setProjectionMatrix",value:function(A){this.projectionMatrix=A}},{key:"setFov",value:function(A){return this.setPerspective(this.near,this.far,A,this.aspect),this}},{key:"setAspect",value:function(A){return this.setPerspective(this.near,this.far,this.fov,A),this}},{key:"setNear",value:function(A){return this.projectionMode===Ze.PERSPECTIVE?this.setPerspective(A,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,A,this.far),this}},{key:"setFar",value:function(A){return this.projectionMode===Ze.PERSPECTIVE?this.setPerspective(this.near,A,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,A),this}},{key:"setViewOffset",value:function(A,t,e,n,r,i){return this.aspect=A/t,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=A,this.view.fullHeight=t,this.view.offsetX=e,this.view.offsetY=n,this.view.width=r,this.view.height=i,this.projectionMode===Ze.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"clearViewOffset",value:function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===Ze.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"setZoom",value:function(A){return this.zoom=A,this.projectionMode===Ze.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===Ze.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this}},{key:"setZoomByViewportPoint",value:function(A,t){var e=this.canvas.viewport2Canvas({x:t[0],y:t[1]}),n=e.x,r=e.y,i=this.roll;this.rotate(0,0,-i),this.setPosition(n,r),this.setFocalPoint(n,r),this.setZoom(A),this.rotate(0,0,i);var a=this.canvas.viewport2Canvas({x:t[0],y:t[1]}),o=aA(a.x-n,a.y-r,0),s=dA(o,this.right)/iA(this.right),u=dA(o,this.up)/iA(this.up),c=v(this.getPosition(),2),l=c[0],h=c[1],d=v(this.getFocalPoint(),2),f=d[0],B=d[1];return this.setPosition(l-s,h-u),this.setFocalPoint(f-s,B-u),this}},{key:"setPerspective",value:function(A,t,e,n){var r;this.projectionMode=Ze.PERSPECTIVE,this.fov=e,this.near=A,this.far=t,this.aspect=n;var i=this.near*Math.tan(Me(.5*this.fov))/this.zoom,a=2*i,o=this.aspect*a,s=-.5*o;if(null!==(r=this.view)&&void 0!==r&&r.enabled){var u=this.view.fullWidth,c=this.view.fullHeight;s+=this.view.offsetX*o/u,i-=this.view.offsetY*a/c,o*=this.view.width/u,a*=this.view.height/c}return function(A,t,e,n,r,i,a){var o,s,u=2*i,c=e-t,l=n-r,h=u/l,d=(e+t)/c,f=(n+r)/l,B=a-i,g=a*i;arguments.length>7&&void 0!==arguments[7]&&arguments[7]?(o=-a/B,s=-g/B):(o=-(a+i)/B,s=-2*g/B),A[0]=u/c,A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=h,A[6]=0,A[7]=0,A[8]=d,A[9]=f,A[10]=o,A[11]=-1,A[12]=0,A[13]=0,A[14]=s,A[15]=0}(this.projectionMatrix,s,s+o,i-a,i,A,this.far,this.clipSpaceNearZ===he.ZERO),H(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this}},{key:"setOrthographic",value:function(A,t,e,n,r,i){var a;this.projectionMode=Ze.ORTHOGRAPHIC,this.rright=t,this.left=A,this.top=e,this.bottom=n,this.near=r,this.far=i;var o=(this.rright-this.left)/(2*this.zoom),s=(this.top-this.bottom)/(2*this.zoom),u=(this.rright+this.left)/2,c=(this.top+this.bottom)/2,l=u-o,h=u+o,d=c+s,f=c-s;if(null!==(a=this.view)&&void 0!==a&&a.enabled){var B=(this.rright-this.left)/this.view.fullWidth/this.zoom,g=(this.top-this.bottom)/this.view.fullHeight/this.zoom;h=(l+=B*this.view.offsetX)+B*this.view.width,f=(d-=g*this.view.offsetY)-g*this.view.height}return this.clipSpaceNearZ===he.NEGATIVE_ONE?j(this.projectionMatrix,l,h,d,f,r,i):q(this.projectionMatrix,l,h,d,f,r,i),H(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this}},{key:"setPosition",value:function(A){var t=Ie(A,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.position[1],arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.position[2]);return this._setPosition(t),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this}},{key:"setFocalPoint",value:function(A){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.focalPoint[1],e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.focalPoint[2],n=aA(0,1,0);if(this.focalPoint=Ie(A,t,e),this.trackingMode===Je.CINEMATIC){var r=cA(nA(),this.focalPoint,this.position);A=r[0],t=r[1],e=r[2];var i=iA(r),a=Le(Math.asin(t/i)),o=90+Le(Math.atan2(e,A)),s=F();D(s,s,Me(o)),L(s,s,Me(a)),n=gA(nA(),[0,1,0],s)}return H(this.matrix,$(F(),this.position,this.focalPoint,n)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this}},{key:"getDistance",value:function(){return this.distance}},{key:"getDistanceVector",value:function(){return this.distanceVector}},{key:"setDistance",value:function(A){if(this.distance===A||0>A)return this;this.distance=A,je>this.distance&&(this.distance=je),this.dollyingStep=this.distance/100;var t=nA(),e=this.forward,n=this.focalPoint;return t[0]=(A=this.distance)*e[0]+n[0],t[1]=A*e[1]+n[1],t[2]=A*e[2]+n[2],this._setPosition(t),this.triggerUpdate(),this}},{key:"setMaxDistance",value:function(A){return this.maxDistance=A,this}},{key:"setMinDistance",value:function(A){return this.minDistance=A,this}},{key:"setAzimuth",value:function(A){return this.azimuth=xe(A),this.computeMatrix(),this._getAxes(),this.type===We.ORBITING||this.type===We.EXPLORING?this._getPosition():this.type===We.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(A){return this.elevation=xe(A),this.computeMatrix(),this._getAxes(),this.type===We.ORBITING||this.type===We.EXPLORING?this._getPosition():this.type===We.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getElevation",value:function(){return this.elevation}},{key:"setRoll",value:function(A){return this.roll=xe(A),this.computeMatrix(),this._getAxes(),this.type===We.ORBITING||this.type===We.EXPLORING?this._getPosition():this.type===We.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getRoll",value:function(){return this.roll}},{key:"_update",value:function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()}},{key:"computeMatrix",value:function(){var A=UA(FA(),[0,0,1],Me(this.roll));k(this.matrix);var t=UA(FA(),[1,0,0],Me((this.rotateWorld&&this.type!==We.TRACKING||this.type===We.TRACKING?1:-1)*this.elevation)),e=UA(FA(),[0,1,0],Me((this.rotateWorld&&this.type!==We.TRACKING||this.type===We.TRACKING?1:-1)*this.azimuth)),n=EA(FA(),e,t);n=EA(FA(),n,A);var r=J(F(),n);this.type===We.ORBITING||this.type===We.EXPLORING?(M(this.matrix,this.matrix,this.focalPoint),T(this.matrix,this.matrix,r),M(this.matrix,this.matrix,[0,0,this.distance])):this.type===We.TRACKING&&(M(this.matrix,this.matrix,this.position),T(this.matrix,this.matrix,r))}},{key:"_setPosition",value:function(A,t,e){this.position=Ie(A,t,e);var n=this.matrix;n[12]=this.position[0],n[13]=this.position[1],n[14]=this.position[2],n[15]=1,this._getOrthoMatrix()}},{key:"_getAxes",value:function(){oA(this.right,Ie(QA(mA(),[1,0,0,0],this.matrix))),oA(this.up,Ie(QA(mA(),[0,1,0,0],this.matrix))),oA(this.forward,Ie(QA(mA(),[0,0,1,0],this.matrix))),hA(this.right,this.right),hA(this.up,this.up),hA(this.forward,this.forward)}},{key:"_getAngles",value:function(){var A=this.distanceVector[0],t=this.distanceVector[1],e=this.distanceVector[2],n=iA(this.distanceVector);if(0===n)return this.elevation=0,void(this.azimuth=0);this.type===We.TRACKING||this.rotateWorld?(this.elevation=Le(Math.asin(t/n)),this.azimuth=Le(Math.atan2(-A,-e))):(this.elevation=-Le(Math.asin(t/n)),this.azimuth=-Le(Math.atan2(-A,-e)))}},{key:"_getPosition",value:function(){oA(this.position,Ie(QA(mA(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){!function(A,t,e){var n=t[0],r=t[1],i=t[2];A[0]=n*e[0]+r*e[3]+i*e[6],A[1]=n*e[1]+r*e[4]+i*e[7],A[2]=n*e[2]+r*e[5]+i*e[8]}(this.distanceVector,[0,0,-this.distance],function(A,t){return A[0]=t[0],A[1]=t[1],A[2]=t[2],A[3]=t[4],A[4]=t[5],A[5]=t[6],A[6]=t[8],A[7]=t[9],A[8]=t[10],A}(Q(),this.matrix)),uA(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=cA(nA(),this.focalPoint,this.position),this.distance=iA(this.distanceVector),this.dollyingStep=this.distance/100}},{key:"_getOrthoMatrix",value:function(){if(this.projectionMode===Ze.ORTHOGRAPHIC){var A=this.position,t=UA(FA(),[0,0,1],-this.roll*Math.PI/180);W(this.orthoMatrix,t,aA((this.rright-this.left)/2-A[0],(this.top-this.bottom)/2-A[1],0),aA(this.zoom,this.zoom,1),A)}}},{key:"triggerUpdate",value:function(){if(this.enableUpdate){var A=this.getViewTransform(),t=T(F(),this.getPerspective(),A);this.getFrustum().extractFromVPMatrix(t),this.eventEmitter.emit(ze.UPDATED)}}},{key:"rotate",value:function(A,t,e){throw Error(be)}},{key:"pan",value:function(A,t){throw Error(be)}},{key:"dolly",value:function(A){throw Error(be)}},{key:"createLandmark",value:function(A,t){throw Error(be)}},{key:"gotoLandmark",value:function(A,t){throw Error(be)}},{key:"cancelLandmarkAnimation",value:function(){throw Error(be)}}])}(),$e=function(A){return A[A.Standard=0]="Standard",A}({}),An=function(A){return A[A.ADDED=0]="ADDED",A[A.REMOVED=1]="REMOVED",A[A.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED",A}({}),tn=nA(),en=F(),nn=FA();function rn(A){if(A.localDirtyFlag){if(0!==A.localSkew[0]||0!==A.localSkew[1]){W(A.localTransform,A.localRotation,A.localPosition,aA(1,1,1),A.origin),0===A.localSkew[0]&&0===A.localSkew[1]||(k(en),en[4]=Math.tan(A.localSkew[0]),en[1]=Math.tan(A.localSkew[1]),T(A.localTransform,A.localTransform,en));var t=W(en,IA(nn,0,0,0,1),sA(tn,1,1,1),A.localScale,A.origin);T(A.localTransform,A.localTransform,t)}else{var e=A.localTransform,n=A.localPosition,r=A.localRotation,i=A.localScale,a=A.origin,o=0!==n[0]||0!==n[1]||0!==n[2];1!==r[3]||0!==r[0]||0!==r[1]||0!==r[2]||(1!==i[0]||1!==i[1]||1!==i[2])||(0!==a[0]||0!==a[1]||0!==a[2])?W(e,r,n,i,a):o?P(e,n):k(e)}A.localDirtyFlag=!1}}function an(A,t){A.dirtyFlag&&(t?T(A.worldTransform,t.worldTransform,A.localTransform):E(A.worldTransform,A.localTransform),A.dirtyFlag=!1)}var on={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Ee(0,0,0,0)},sn=function(A){return A.COORDINATE="<coordinate>",A.COLOR="<color>",A.PAINT="<paint>",A.NUMBER="<number>",A.ANGLE="<angle>",A.OPACITY_VALUE="<opacity-value>",A.SHADOW_BLUR="<shadow-blur>",A.LENGTH="<length>",A.PERCENTAGE="<percentage>",A.LENGTH_PERCENTAGE="<length> | <percentage>",A.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",A.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",A.LIST_OF_POINTS="<list-of-points>",A.PATH="<path>",A.FILTER="<filter>",A.Z_INDEX="<z-index>",A.OFFSET_DISTANCE="<offset-distance>",A.DEFINED_PATH="<defined-path>",A.MARKER="<marker>",A.TRANSFORM="<transform>",A.TRANSFORM_ORIGIN="<transform-origin>",A.TEXT="<text>",A.TEXT_TRANSFORM="<text-transform>",A}({});function un(A,t,e){A.prototype=t.prototype=e,e.constructor=A}function cn(A,t){var e=Object.create(A.prototype);for(var n in t)e[n]=t[n];return e}function ln(){}var hn=.7,dn=1/hn,fn="\\s*([+-]?\\d+)\\s*",Bn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",gn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",pn=/^#([0-9a-f]{3,8})$/,vn=RegExp("^rgb\\(".concat(fn,",").concat(fn,",").concat(fn,"\\)$")),wn=RegExp("^rgb\\(".concat(gn,",").concat(gn,",").concat(gn,"\\)$")),yn=RegExp("^rgba\\(".concat(fn,",").concat(fn,",").concat(fn,",").concat(Bn,"\\)$")),mn=RegExp("^rgba\\(".concat(gn,",").concat(gn,",").concat(gn,",").concat(Bn,"\\)$")),Cn=RegExp("^hsl\\(".concat(Bn,",").concat(gn,",").concat(gn,"\\)$")),Qn=RegExp("^hsla\\(".concat(Bn,",").concat(gn,",").concat(gn,",").concat(Bn,"\\)$")),Fn={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 Un(){return this.rgb().formatHex()}function En(){return this.rgb().formatRgb()}function bn(A){var t,e;return A=(A+"").trim().toLowerCase(),(t=pn.exec(A))?(e=t[1].length,t=parseInt(t[1],16),6===e?kn(t):3===e?new Hn(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===e?xn(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===e?xn(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=vn.exec(A))?new Hn(t[1],t[2],t[3],1):(t=wn.exec(A))?new Hn(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=yn.exec(A))?xn(t[1],t[2],t[3],t[4]):(t=mn.exec(A))?xn(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Cn.exec(A))?Dn(t[1],t[2]/100,t[3]/100,1):(t=Qn.exec(A))?Dn(t[1],t[2]/100,t[3]/100,t[4]):Fn.hasOwnProperty(A)?kn(Fn[A]):"transparent"===A?new Hn(NaN,NaN,NaN,0):null}function kn(A){return new Hn(A>>16&255,A>>8&255,255&A,1)}function xn(A,t,e,n){return n>0||(A=t=e=NaN),new Hn(A,t,e,n)}function Hn(A,t,e,n){this.r=+A,this.g=+t,this.b=+e,this.opacity=+n}function In(){return"#".concat(Ln(this.r)).concat(Ln(this.g)).concat(Ln(this.b))}function Tn(){var A=Mn(this.opacity);return"".concat(1===A?"rgb(":"rgba(").concat(Sn(this.r),", ").concat(Sn(this.g),", ").concat(Sn(this.b)).concat(1===A?")":", ".concat(A,")"))}function Mn(A){return isNaN(A)?1:Math.max(0,Math.min(1,A))}function Sn(A){return Math.max(0,Math.min(255,Math.round(A)||0))}function Ln(A){return(16>(A=Sn(A))?"0":"")+A.toString(16)}function Dn(A,t,e,n){return n>0?e>0&&1>e?t>0||(A=NaN):A=t=NaN:A=t=e=NaN,new Nn(A,t,e,n)}function Pn(A){if(A instanceof Nn)return new Nn(A.h,A.s,A.l,A.opacity);if(A instanceof ln||(A=bn(A)),!A)return new Nn;if(A instanceof Nn)return A;var t=(A=A.rgb()).r/255,e=A.g/255,n=A.b/255,r=Math.min(t,e,n),i=Math.max(t,e,n),a=NaN,o=i-r,s=(i+r)/2;return o?(a=t===i?(e-n)/o+6*(n>e):e===i?(n-t)/o+2:(t-e)/o+4,o/=.5>s?i+r:2-i-r,a*=60):o=s>0&&1>s?0:a,new Nn(a,o,s,A.opacity)}function Nn(A,t,e,n){this.h=+A,this.s=+t,this.l=+e,this.opacity=+n}function On(A){return 0>(A=(A||0)%360)?A+360:A}function Kn(A){return Math.max(0,Math.min(1,A||0))}function Rn(A,t,e){return 255*(60>A?t+(e-t)*A/60:180>A?e:240>A?t+(e-t)*(240-A)/60:t)}function Gn(A,t){if("function"!=typeof A||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var e=function(){for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];var a=t?t.apply(this,r):r[0],o=e.cache;if(o.has(a))return o.get(a);var s=A.apply(this,r);return e.cache=o.set(a,s)||o,s};return e.cache=new(Gn.Cache||Map),Gn.cacheList.push(e.cache),e}un(ln,bn,{copy:function(A){return Object.assign(new this.constructor,this,A)},displayable:function(){return this.rgb().displayable()},hex:Un,formatHex:Un,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Pn(this).formatHsl()},formatRgb:En,toString:En}),un(Hn,function(A,t,e,n){return 1===arguments.length?((r=A)instanceof ln||(r=bn(r)),r?new Hn((r=r.rgb()).r,r.g,r.b,r.opacity):new Hn):new Hn(A,t,e,null==n?1:n);var r},cn(ln,{brighter:function(A){return new Hn(this.r*(A=null==A?dn:Math.pow(dn,A)),this.g*A,this.b*A,this.opacity)},darker:function(A){return new Hn(this.r*(A=null==A?hn:Math.pow(hn,A)),this.g*A,this.b*A,this.opacity)},rgb:function(){return this},clamp:function(){return new Hn(Sn(this.r),Sn(this.g),Sn(this.b),Mn(this.opacity))},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:In,formatHex:In,formatHex8:function(){return"#".concat(Ln(this.r)).concat(Ln(this.g)).concat(Ln(this.b)).concat(Ln(255*(isNaN(this.opacity)?1:this.opacity)))},formatRgb:Tn,toString:Tn})),un(Nn,function(A,t,e,n){return 1===arguments.length?Pn(A):new Nn(A,t,e,null==n?1:n)},cn(ln,{brighter:function(A){return new Nn(this.h,this.s,this.l*(A=null==A?dn:Math.pow(dn,A)),this.opacity)},darker:function(A){return new Nn(this.h,this.s,this.l*(A=null==A?hn:Math.pow(hn,A)),this.opacity)},rgb:function(){var A=this.h%360+360*(0>this.h),t=this.l,e=t+(.5>t?t:1-t)*(isNaN(A)||isNaN(this.s)?0:this.s),n=2*t-e;return new Hn(Rn(240>A?A+120:A-240,n,e),Rn(A,n,e),Rn(120>A?A+240:A-120,n,e),this.opacity)},clamp:function(){return new Nn(On(this.h),Kn(this.s),Kn(this.l),Mn(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 A=Mn(this.opacity);return"".concat(1===A?"hsl(":"hsla(").concat(On(this.h),", ").concat(100*Kn(this.s),"%, ").concat(100*Kn(this.l),"%").concat(1===A?")":", ".concat(A,")"))}})),Gn.Cache=Map,Gn.cacheList=[],Gn.clearCache=function(){Gn.cacheList.forEach(function(A){return A.clear()})};var Vn=function(A){return A[A.kUnknown=0]="kUnknown",A[A.kNumber=1]="kNumber",A[A.kPercentage=2]="kPercentage",A[A.kEms=3]="kEms",A[A.kPixels=4]="kPixels",A[A.kRems=5]="kRems",A[A.kDegrees=6]="kDegrees",A[A.kRadians=7]="kRadians",A[A.kGradians=8]="kGradians",A[A.kTurns=9]="kTurns",A[A.kMilliseconds=10]="kMilliseconds",A[A.kSeconds=11]="kSeconds",A[A.kInteger=12]="kInteger",A}({}),_n=function(A){return A[A.kUNumber=0]="kUNumber",A[A.kUPercent=1]="kUPercent",A[A.kULength=2]="kULength",A[A.kUAngle=3]="kUAngle",A[A.kUTime=4]="kUTime",A[A.kUOther=5]="kUOther",A}({}),Xn=function(A){return A[A.kYes=0]="kYes",A[A.kNo=1]="kNo",A}({}),Yn=function(A){return A[A.kYes=0]="kYes",A[A.kNo=1]="kNo",A}({}),Wn=[{name:"em",unit_type:Vn.kEms},{name:"px",unit_type:Vn.kPixels},{name:"deg",unit_type:Vn.kDegrees},{name:"rad",unit_type:Vn.kRadians},{name:"grad",unit_type:Vn.kGradians},{name:"ms",unit_type:Vn.kMilliseconds},{name:"s",unit_type:Vn.kSeconds},{name:"rem",unit_type:Vn.kRems},{name:"turn",unit_type:Vn.kTurns}],Jn=function(A){return A[A.kUnknownType=0]="kUnknownType",A[A.kUnparsedType=1]="kUnparsedType",A[A.kKeywordType=2]="kKeywordType",A[A.kUnitType=3]="kUnitType",A[A.kSumType=4]="kSumType",A[A.kProductType=5]="kProductType",A[A.kNegateType=6]="kNegateType",A[A.kInvertType=7]="kInvertType",A[A.kMinType=8]="kMinType",A[A.kMaxType=9]="kMaxType",A[A.kClampType=10]="kClampType",A[A.kTransformType=11]="kTransformType",A[A.kPositionType=12]="kPositionType",A[A.kURLImageType=13]="kURLImageType",A[A.kColorType=14]="kColorType",A[A.kUnsupportedColorType=15]="kUnsupportedColorType",A}({}),Zn=function(A){return A?"number"===A?Vn.kNumber:"percent"===A||"%"===A?Vn.kPercentage:function(A){return Wn.find(function(t){return t.name===A}).unit_type}(A):Vn.kUnknown},zn=function(A){var t=1;switch(A){case Vn.kPixels:case Vn.kDegrees:case Vn.kSeconds:break;case Vn.kMilliseconds:t=.001;break;case Vn.kRadians:t=180/Math.PI;break;case Vn.kGradians:t=.9;break;case Vn.kTurns:t=360}return t},jn=function(A){switch(A){case Vn.kNumber:case Vn.kInteger:return"";case Vn.kPercentage:return"%";case Vn.kEms:return"em";case Vn.kRems:return"rem";case Vn.kPixels:return"px";case Vn.kDegrees:return"deg";case Vn.kRadians:return"rad";case Vn.kGradians:return"grad";case Vn.kMilliseconds:return"ms";case Vn.kSeconds:return"s";case Vn.kTurns:return"turn"}return""},qn=function(){return s(function A(){a(this,A)},[{key:"toString",value:function(){return this.buildCSSText(Xn.kNo,Yn.kNo,"")}},{key:"isNumericValue",value:function(){return this.getType()>=Jn.kUnitType&&this.getType()<=Jn.kClampType}}],[{key:"isAngle",value:function(A){return A===Vn.kDegrees||A===Vn.kRadians||A===Vn.kGradians||A===Vn.kTurns}},{key:"isLength",value:function(A){return A>=Vn.kEms&&Vn.kDegrees>A}},{key:"isRelativeUnit",value:function(A){return A===Vn.kPercentage||A===Vn.kEms||A===Vn.kRems}},{key:"isTime",value:function(A){return A===Vn.kSeconds||A===Vn.kMilliseconds}}])}(),$n=function(A){function t(A){var e;return a(this,t),(e=B(this,t)).colorSpace=A,e}return p(t,A),s(t,[{key:"getType",value:function(){return Jn.kColorType}},{key:"to",value:function(A){return this}}])}(qn),Ar=function(A){return A[A.Constant=0]="Constant",A[A.LinearGradient=1]="LinearGradient",A[A.RadialGradient=2]="RadialGradient",A}({}),tr=function(A){function t(A,e){var n;return a(this,t),(n=B(this,t)).type=A,n.value=e,n}return p(t,A),s(t,[{key:"clone",value:function(){return new t(this.type,this.value)}},{key:"buildCSSText",value:function(A,t,e){return e}},{key:"getType",value:function(){return Jn.kColorType}}])}(qn),er=function(A){function t(A){var e;return a(this,t),(e=B(this,t)).value=A,e}return p(t,A),s(t,[{key:"clone",value:function(){return new t(this.value)}},{key:"getType",value:function(){return Jn.kKeywordType}},{key:"buildCSSText",value:function(A,t,e){return e+this.value}}])}(qn),nr=function(A){return function(A){switch(A){case _n.kUNumber:return Vn.kNumber;case _n.kULength:return Vn.kPixels;case _n.kUPercent:return Vn.kPercentage;case _n.kUTime:return Vn.kSeconds;case _n.kUAngle:return Vn.kDegrees;default:return Vn.kUnknown}}(function(A){switch(A){case Vn.kNumber:case Vn.kInteger:return _n.kUNumber;case Vn.kPercentage:return _n.kUPercent;case Vn.kPixels:return _n.kULength;case Vn.kMilliseconds:case Vn.kSeconds:return _n.kUTime;case Vn.kDegrees:case Vn.kRadians:case Vn.kGradians:case Vn.kTurns:return _n.kUAngle;default:return _n.kUOther}}(A))},rr=function(A){function t(A){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Vn.kNumber;return a(this,t),e=B(this,t),n="string"==typeof r?Zn(r):r,e.unit=n,e.value=A,e}return p(t,A),s(t,[{key:"clone",value:function(){return new t(this.value,this.unit)}},{key:"equals",value:function(A){return this.value===A.value&&this.unit===A.unit}},{key:"getType",value:function(){return Jn.kUnitType}},{key:"convertTo",value:function(A){if(this.unit===A)return new t(this.value,this.unit);var e=nr(this.unit);if(e!==nr(A)||e===Vn.kUnknown)return null;var n=zn(this.unit)/zn(A);return new t(this.value*n,A)}},{key:"buildCSSText",value:function(A,t,e){var n;switch(this.unit){case Vn.kUnknown:break;case Vn.kInteger:n=Number(this.value).toFixed(0);break;case Vn.kNumber:case Vn.kPercentage:case Vn.kEms:case Vn.kRems:case Vn.kPixels:case Vn.kDegrees:case Vn.kRadians:case Vn.kGradians:case Vn.kMilliseconds:case Vn.kSeconds:case Vn.kTurns:var r=this.value,i=jn(this.unit);if(-999999>r||r>999999){var a=jn(this.unit);n=!Number.isFinite(r)||Number.isNaN(r)?function(A){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(Number.isFinite(A)?"NaN":A>0?"infinity":"-infinity")+t}(r,a):r+(a||"")}else n="".concat(r).concat(i)}return e+=n}}])}(qn),ir=new rr(0,"px");new rr(1,"px");var ar=new rr(0,"deg"),or=function(A){function t(A,e,n){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return a(this,t),(r=B(this,t,["rgb"])).r=A,r.g=e,r.b=n,r.alpha=i,r.isNone=o,r}return p(t,A),s(t,[{key:"clone",value:function(){return new t(this.r,this.g,this.b,this.alpha)}},{key:"buildCSSText",value:function(A,t,e){return"".concat(e,"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")}}])}($n),sr=new er("unset"),ur={"":sr,unset:sr,initial:new er("initial"),inherit:new er("inherit")},cr=new or(0,0,0,0,!0),lr=new or(0,0,0,0),hr=Gn(function(A,t,e,n){return new or(A,t,e,n)},function(A,t,e,n){return"rgba(".concat(A,",").concat(t,",").concat(e,",").concat(n,")")}),dr=function(A){return new rr(A,arguments.length>1&&void 0!==arguments[1]?arguments[1]:Vn.kNumber)};function fr(A){var t=A.type,e=A.value;return"hex"===t?"#".concat(e):"literal"===t?e:"rgb"===t?"rgb(".concat(e.join(","),")"):"rgba(".concat(e.join(","),")")}new rr(50,"%");var Br=function(){var A=/^(linear\-gradient)/i,t=/^(repeating\-linear\-gradient)/i,e=/^(radial\-gradient)/i,n=/^(repeating\-radial\-gradient)/i,r=/^(conic\-gradient)/i,i=/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,a=/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,o=/^(left|center|right|top|bottom)/i,s=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,u=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,c=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,l=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,h=/^\(/,d=/^\)/,f=/^,/,B=/^\#([0-9a-fA-F]+)/,g=/^([a-zA-Z]+)/,p=/^rgb/i,v=/^rgba/i,w=/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,y="";function m(A){throw Error("".concat(y,": ").concat(A))}function C(){var A=T(Q);return y.length>0&&m("Invalid input not EOF"),A}function Q(){return F("linear-gradient",A,E)||F("repeating-linear-gradient",t,E)||F("radial-gradient",e,b)||F("repeating-radial-gradient",n,b)||F("conic-gradient",r,b)}function F(A,t,e){return U(t,function(t){var n=e();return n&&(N(f)||m("Missing comma before color stops")),{type:A,orientation:n,colorStops:T(M)}})}function U(A,t){var e=N(A);if(e){N(h)||m("Missing (");var n=t(e);return N(d)||m("Missing )"),n}}function E(){return P("directional",i,1)||P("angular",l,1)}function b(){var A,t,e=k();return e&&((A=[]).push(e),t=y,N(f)&&((e=k())?A.push(e):y=t)),A}function k(){var A=function(){var A=P("shape",/^(circle)/i,0);A&&(A.style=D()||x());return A}()||function(){var A=P("shape",/^(ellipse)/i,0);A&&(A.style=L()||x());return A}();if(A)A.at=H();else{var t=x();if(t){A=t;var e=H();e&&(A.at=e)}else{var n=I();n&&(A={type:"default-radial",at:n})}}return A}function x(){return P("extent-keyword",a,1)}function H(){if(P("position",/^at/,0)){var A=I();return A||m("Missing positioning value"),A}}function I(){var A={x:L(),y:L()};if(A.x||A.y)return{type:"position",value:A}}function T(A){var t=A(),e=[];if(t)for(e.push(t);N(f);)(t=A())?e.push(t):m("One extra comma");return e}function M(){var A=P("hex",B,1)||U(v,function(){return{type:"rgba",value:T(S)}})||U(p,function(){return{type:"rgb",value:T(S)}})||P("literal",g,0);return A||m("Expected color definition"),A.length=L(),A}function S(){return N(w)[1]}function L(){return P("%",u,1)||P("position-keyword",o,1)||D()}function D(){return P("px",s,1)||P("em",c,1)}function P(A,t,e){var n=N(t);if(n)return{type:A,value:n[e]}}function N(A){var t=/^[\n\r\t\s]+/.exec(y);t&&O(t[0].length);var e=A.exec(y);return e&&O(e[0].length),e}function O(A){y=y.substring(A)}return function(A){return y=A,C()}}();function gr(A,t,e,n){var r=Me(n.value),i=0+t/2,a=0+e/2,o=Math.abs(t*Math.cos(r))+Math.abs(e*Math.sin(r));return{x1:A[0]+i-Math.cos(r)*o/2,y1:A[1]+a-Math.sin(r)*o/2,x2:A[0]+i+Math.cos(r)*o/2,y2:A[1]+a+Math.sin(r)*o/2}}function pr(A,t,e,n,r,i){var a=n.value,o=r.value;n.unit===Vn.kPercentage&&(a=n.value/100*t),r.unit===Vn.kPercentage&&(o=r.value/100*e);var s=Math.max(Ct([0,0],[a,o]),Ct([0,e],[a,o]),Ct([t,e],[a,o]),Ct([t,0],[a,o]));return i&&(i instanceof rr?s=i.value:i instanceof er&&("closest-side"===i.value?s=Math.min(a,t-a,o,e-o):"farthest-side"===i.value?s=Math.max(a,t-a,o,e-o):"closest-corner"===i.value&&(s=Math.min(Ct([0,0],[a,o]),Ct([0,e],[a,o]),Ct([t,e],[a,o]),Ct([t,0],[a,o]))))),{x:a+A[0],y:o+A[1],r:s}}var vr=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,wr=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,yr=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,mr=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var Cr={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},Qr=Gn(function(A){return dr("angular"===A.type?Number(A.value):Cr[A.value]||0,"deg")}),Fr=Gn(function(A){var t=50,e=50,n="%",r="%";if("position"===(null==A?void 0:A.type)){var i=A.value,a=i.x,o=i.y;"position-keyword"===(null==a?void 0:a.type)&&("left"===a.value?t=0:"center"===a.value?t=50:"right"===a.value?t=100:"top"===a.value?e=0:"bottom"===a.value&&(e=100)),"position-keyword"===(null==o?void 0:o.type)&&("left"===o.value?t=0:"center"===o.value?e=50:"right"===o.value?t=100:"top"===o.value?e=0:"bottom"===o.value&&(e=100)),"px"!==(null==a?void 0:a.type)&&"%"!==(null==a?void 0:a.type)&&"em"!==(null==a?void 0:a.type)||(n=null==a?void 0:a.type,t=Number(a.value)),"px"!==(null==o?void 0:o.type)&&"%"!==(null==o?void 0:o.type)&&"em"!==(null==o?void 0:o.type)||(r=null==o?void 0:o.type,e=Number(o.value))}return{cx:dr(t,n),cy:dr(e,r)}}),Ur=Gn(function(A){if(A.indexOf("linear")>-1||A.indexOf("radial")>-1)return Br(A).map(function(A){var t=A.type,e=A.orientation,n=A.colorStops;!function(A){var t,e,n=A.length;A[n-1].length=null!==(t=A[n-1].length)&&void 0!==t?t:{type:"%",value:"100"},n>1&&(A[0].length=null!==(e=A[0].length)&&void 0!==e?e:{type:"%",value:"0"});for(var r=0,i=Number(A[0].length.value),a=1;n>a;a++){var o,s=null===(o=A[a].length)||void 0===o?void 0:o.value;if(!DA(s)&&!DA(i)){for(var u=1;a-r>u;u++)A[r+u].length={type:"%",value:"".concat(i+(Number(s)-i)*u/(a-r))};r=a,i=Number(s)}}}(n);var r,i=n.map(function(A){return{offset:dr(Number(A.length.value),"%"),color:fr(A)}});if("linear-gradient"===t)return new tr(Ar.LinearGradient,{angle:e?Qr(e):ar,steps:i});if("radial-gradient"===t&&(e||(e=[{type:"shape",value:"circle"}]),"shape"===e[0].type&&"circle"===e[0].value)){var a,o=Fr(e[0].at),s=o.cx,u=o.cy;if(e[0].style){var c=e[0].style,l=c.type,h=c.value;"extent-keyword"===l?(ur[r=h]||(ur[r]=new er(r)),a=ur[r]):a=dr(h,l)}return new tr(Ar.RadialGradient,{cx:s,cy:u,size:a,steps:i})}});var t=A[0];if("("===A[1]||"("===A[2])if("l"===t){var e=vr.exec(A);if(e){var n,r=(null===(n=e[2].match(mr))||void 0===n?void 0:n.map(function(A){return A.split(":")}))||[];return[new tr(Ar.LinearGradient,{angle:dr(parseFloat(e[1]),"deg"),steps:r.map(function(A){var t=v(A,2),e=t[1];return{offset:dr(100*Number(t[0]),"%"),color:e}})})]}}else if("r"===t){var i=function(A){var t=wr.exec(A);if(t){var e,n=(null===(e=t[4].match(mr))||void 0===e?void 0:e.map(function(A){return A.split(":")}))||[];return{cx:dr(50,"%"),cy:dr(50,"%"),steps:n.map(function(A){var t=v(A,2),e=t[1];return{offset:dr(100*Number(t[0]),"%"),color:e}})}}return null}(A);if(i){if(!GA(i))return[new tr(Ar.RadialGradient,i)];A=i}}else if("p"===t)return function(A){var t=yr.exec(A);if(t){var e=t[1],n=t[2];switch(e){case"a":e="repeat";break;case"x":e="repeat-x";break;case"y":e="repeat-y";break;default:e="no-repeat"}return{image:n,repetition:e}}return null}(A)});function Er(A){return A&&!!A.image}function br(A){return A&&!DA(A.r)&&!DA(A.g)&&!DA(A.b)}var kr=Gn(function(A){if(Er(A))return i({repetition:"repeat"},A);if(DA(A)&&(A=""),"transparent"===A)return lr;if("currentColor"===A)A="black";else if("none"===A)return cr;var t=Ur(A);if(t)return t;var e=bn(A),n=[0,0,0,0];return null!==e&&(n[0]=e.r||0,n[1]=e.g||0,n[2]=e.b||0,n[3]=e.opacity),hr.apply(void 0,n)});function xr(A,t){if(br(A)&&br(t))return[[Number(A.r),Number(A.g),Number(A.b),Number(A.alpha)],[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],function(A){var t=A.slice();if(t[3])for(var e=0;3>e;e++)t[e]=Math.round(VA(t[e],0,255));return t[3]=VA(t[3],0,1),"rgba(".concat(t.join(","),")")}]}function Hr(A,t){if(DA(t))return dr(0,"px");if(t="".concat(t).trim().toLowerCase(),isFinite(Number(t))){if("px".search(A)>=0)return dr(Number(t),"px");if("deg".search(A)>=0)return dr(Number(t),"deg")}var e=[];t=t.replace(A,function(A){return e.push(A),"U".concat(A)});var n="U(".concat(A.source,")");return e.map(function(A){return dr(Number(t.replace(RegExp("U".concat(A),"g"),"").replace(RegExp(n,"g"),"*0")),A)})[0]}var Ir=function(A){return Hr(/px/g,A)},Tr=Gn(Ir);Gn(function(A){return Hr(RegExp("%","g"),A)});var Mr=function(A){return _A(A)||isFinite(Number(A))?dr(Number(A)||0,"px"):Hr(RegExp("px|%|em|rem","g"),A)},Sr=Gn(Mr),Lr=function(A){return Hr(/deg|rad|grad|turn/g,A)},Dr=Gn(Lr);function Pr(A,t,e,n){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,i="",a=A.value||0,o=t.value||0,s=nr(A.unit),u=A.convertTo(s),c=t.convertTo(s);return u&&c?(a=u.value,o=c.value,i=jn(A.unit)):(rr.isLength(A.unit)||rr.isLength(t.unit))&&(a=Kr(A,r,e),o=Kr(t,r,e),i="px"),[a,o,function(A){return n&&(A=Math.max(A,0)),A+i}]}function Nr(A){var t=0;return A.unit===Vn.kDegrees?t=A.value:A.unit===Vn.kRadians?t=Le(Number(A.value)):A.unit===Vn.kTurns?t=De(Number(A.value)):A.value&&(t=A.value),t}function Or(A,t){var e;return Array.isArray(A)?e=A.map(function(A){return Number(A)}):GA(A)?e=A.split(" ").map(function(A){return Number(A)}):_A(A)&&(e=[A]),2===t?1===e.length?[e[0],e[0]]:[e[0],e[1]]:4===t?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]]:"even"===t&&e.length%2==1?[].concat(l(e),l(e)):e}function Kr(A,t,e){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(A.unit===Vn.kPixels)return Number(A.value);if(A.unit===Vn.kPercentage&&e){var r=e.nodeName===le.GROUP?e.getLocalBounds():e.getGeometryBounds();return(n?r.min[t]:0)+A.value/100*r.halfExtents[t]*2}return 0}var Rr=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Gr(A){return""+A}var Vr=function(A){return dr("number"==typeof A?A:/^\s*[-+]?(\d*\.)?\d+\s*$/.test(A)?Number(A):0)},_r=Gn(Vr);function Xr(A,t){return[A,t,Gr]}function Yr(A,t){return function(e,n){return[e,n,function(e){return Gr(VA(e,A,t))}]}}function Wr(A,t){if(A.length===t.length)return[A,t,function(A){return A}]}function Jr(A){var t;return 0===A.parsedStyle.d.totalLength&&(A.parsedStyle.d.totalLength=It(A.parsedStyle.d.absolutePath,void 0,ZA(ZA({},t),{bbox:!1,length:!0})).length),A.parsedStyle.d.totalLength}function Zr(A,t){return A[0]===t[0]&&A[1]===t[1]}function zr(A,t){var e=A.prePoint,n=A.currentPoint,r=A.nextPoint,i=Math.pow(n[0]-e[0],2)+Math.pow(n[1]-e[1],2),a=Math.pow(n[0]-r[0],2)+Math.pow(n[1]-r[1],2),o=Math.acos((i+a-(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2)))/(2*Math.sqrt(i)*Math.sqrt(a)));if(!o||0===Math.sin(o)||XA(o,0))return{xExtra:0,yExtra:0};var s=Math.abs(Math.atan2(r[1]-n[1],r[0]-n[0])),u=Math.abs(Math.atan2(r[0]-n[0],r[1]-n[1]));return u=u>Math.PI/2?Math.PI-u:u,{xExtra:Math.cos(o/2-(s=s>Math.PI/2?Math.PI-s:s))*(t/2*(1/Math.sin(o/2)))-t/2||0,yExtra:Math.cos(u-o/2)*(t/2*(1/Math.sin(o/2)))-t/2||0}}function jr(A,t){return[t[0]+(t[0]-A[0]),t[1]+(t[1]-A[1])]}Gn(function(A){return GA(A)?A.split(" ").map(_r):A.map(_r)});var qr=function(A,t){return(0>A.x*t.y-A.y*t.x?-1:1)*Math.acos((A.x*t.x+A.y*t.y)/Math.sqrt((Math.pow(A.x,2)+Math.pow(A.y,2))*(Math.pow(t.x,2)+Math.pow(t.y,2))))},$r=function(A,t,e,n,r,i,a,o){t=Math.abs(t),e=Math.abs(e);var s=Me(n=YA(n,360));if(A.x===a.x&&A.y===a.y)return{x:A.x,y:A.y,ellipticalArcAngle:0};if(0===t||0===e)return{x:0,y:0,ellipticalArcAngle:0};var u=(A.x-a.x)/2,c=(A.y-a.y)/2,l={x:Math.cos(s)*u+Math.sin(s)*c,y:-Math.sin(s)*u+Math.cos(s)*c},h=Math.pow(l.x,2)/Math.pow(t,2)+Math.pow(l.y,2)/Math.pow(e,2);h>1&&(t*=Math.sqrt(h),e*=Math.sqrt(h));var d=(Math.pow(t,2)*Math.pow(e,2)-Math.pow(t,2)*Math.pow(l.y,2)-Math.pow(e,2)*Math.pow(l.x,2))/(Math.pow(t,2)*Math.pow(l.y,2)+Math.pow(e,2)*Math.pow(l.x,2)),f=(r!==i?1:-1)*Math.sqrt(d=0>d?0:d),B=f*(t*l.y/e),g=f*(-e*l.x/t),p={x:Math.cos(s)*B-Math.sin(s)*g+(A.x+a.x)/2,y:Math.sin(s)*B+Math.cos(s)*g+(A.y+a.y)/2},v={x:(l.x-B)/t,y:(l.y-g)/e},w=qr({x:1,y:0},v),y=qr(v,{x:(-l.x-B)/t,y:(-l.y-g)/e});!i&&y>0?y-=2*Math.PI:i&&0>y&&(y+=2*Math.PI);var m=w+(y%=2*Math.PI)*o,C=t*Math.cos(m),Q=e*Math.sin(m);return{x:Math.cos(s)*C-Math.sin(s)*Q+p.x,y:Math.sin(s)*C+Math.cos(s)*Q+p.y,ellipticalArcStartAngle:w,ellipticalArcEndAngle:w+y,ellipticalArcAngle:m,ellipticalArcCenter:p,resultantRx:t,resultantRy:e}};function Ai(A,t){var e=2>=arguments.length||void 0===arguments[2]||arguments[2],n=A.arcParams,r=n.rx,i=void 0===r?0:r,a=n.ry,o=void 0===a?0:a,s=n.xRotation,u=n.arcFlag,c=n.sweepFlag,l=$r({x:A.prePoint[0],y:A.prePoint[1]},i,o,s,!!u,!!c,{x:A.currentPoint[0],y:A.currentPoint[1]},t),h=$r({x:A.prePoint[0],y:A.prePoint[1]},i,o,s,!!u,!!c,{x:A.currentPoint[0],y:A.currentPoint[1]},e?t+.005:t-.005),d=h.x-l.x,f=h.y-l.y,B=Math.sqrt(d*d+f*f);return{x:-d/B,y:-f/B}}function ti(A){return Math.sqrt(A[0]*A[0]+A[1]*A[1])}function ei(A,t){return ti(A)*ti(t)?(A[0]*t[0]+A[1]*t[1])/(ti(A)*ti(t)):1}function ni(A,t){return(A[1]*t[0]>A[0]*t[1]?-1:1)*Math.acos(ei(A,t))}function ri(A,t){var e=t[1],n=t[2],r=YA(Me(t[3]),2*Math.PI),i=t[4],a=t[5],o=A[0],s=A[1],u=t[6],c=t[7],l=Math.cos(r)*(o-u)/2+Math.sin(r)*(s-c)/2,h=-1*Math.sin(r)*(o-u)/2+Math.cos(r)*(s-c)/2,d=l*l/(e*e)+h*h/(n*n);d>1&&(e*=Math.sqrt(d),n*=Math.sqrt(d));var f=e*e*(h*h)+n*n*(l*l),B=f?Math.sqrt((e*e*(n*n)-f)/f):1;i===a&&(B*=-1),isNaN(B)&&(B=0);var g=n?B*e*h/n:0,p=e?B*-n*l/e:0,v=(o+u)/2+Math.cos(r)*g-Math.sin(r)*p,w=(s+c)/2+Math.sin(r)*g+Math.cos(r)*p,y=[(l-g)/e,(h-p)/n],m=[(-1*l-g)/e,(-1*h-p)/n],C=ni([1,0],y),Q=ni(y,m);return ei(y,m)>-1||(Q=Math.PI),1>ei(y,m)||(Q=0),0===a&&Q>0&&(Q-=2*Math.PI),1===a&&0>Q&&(Q+=2*Math.PI),{cx:v,cy:w,rx:Zr(A,[u,c])?0:e,ry:Zr(A,[u,c])?0:n,startAngle:C,endAngle:C+Q,xRotation:r,arcFlag:i,sweepFlag:a}}function ii(A,t,e,n){var r=.5522847498307936,i=A*r,a=t*r,o=e-A,s=e+A,u=n-t,c=n+t;return[["M",o,n],["C",o,n-a,e-i,u,e,u],["C",e+i,u,s,n-a,s,n],["C",s,n+a,e+i,c,e,c],["C",e-i,c,o,n+a,o,n],["Z"]]}var ai=function(A){if(""===A||Array.isArray(A)&&0===A.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var t;try{t=Bt(A)}catch(e){t=Bt(""),console.error("[g]: Invalid SVG Path definition: ".concat(A))}!function(A){for(var t=0;A.length>t;t++){var e=A[t-1],n=A[t];if("M"===n[0]&&e){var r=e[0],i=void 0;"L"===r||"M"===r?i=[e[1],e[2]]:"C"!==r&&"A"!==r&&"Q"!==r||(i=[e[e.length-2],e[e.length-1]]),i&&Zr([n[1],n[2]],i)&&(A.splice(t,1),t--)}}}(t);var e=function(A){for(var t=!1,e=A.length,n=0;e>n;n++){var r=A[n][0];if("C"===r||"A"===r||"Q"===r){t=!0;break}}return t}(t),n=function(A){for(var t=[],e=[],n=[],r=0;A.length>r;r++){var i=A[r],a=i[0];"M"===a?(n.length&&(e.push(n),n=[]),n.push([i[1],i[2]])):"Z"===a?n.length&&(t.push(n),n=[]):n.push([i[1],i[2]])}return n.length>0&&e.push(n),{polygons:t,polylines:e}}(t),r=n.polygons,i=n.polylines,a=function(A){for(var t=[],e=null,n=null,r=null,i=0,a=A.length,o=0;a>o;o++){var s=A[o];n=A[o+1];var u=s[0],c={command:u,prePoint:e,params:s,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(u){case"M":r=[s[1],s[2]],i=o;break;case"A":var l=ri(e,s);c.arcParams=l}if("Z"===u)e=r,n=A[i+1];else{var h=s.length;e=[s[h-2],s[h-1]]}n&&"Z"===n[0]&&(n=A[i],t[i]&&(t[i].prePoint=e)),c.currentPoint=e,t[i]&&Zr(e,t[i].currentPoint)&&(t[i].prePoint=c.prePoint),c.nextPoint=n?[n[n.length-2],n[n.length-1]]:null;var d=c.prePoint;if(["L","H","V"].includes(u))c.startTangent=[d[0]-e[0],d[1]-e[1]],c.endTangent=[e[0]-d[0],e[1]-d[1]];else if("Q"===u){var f=[s[1],s[2]];c.startTangent=[d[0]-f[0],d[1]-f[1]],c.endTangent=[e[0]-f[0],e[1]-f[1]]}else if("T"===u){var B=t[o-1],g=jr(B.currentPoint,d);"Q"===B.command?(c.command="Q",c.startTangent=[d[0]-g[0],d[1]-g[1]],c.endTangent=[e[0]-g[0],e[1]-g[1]]):(c.command="TL",c.startTangent=[d[0]-e[0],d[1]-e[1]],c.endTangent=[e[0]-d[0],e[1]-d[1]])}else if("C"===u){var p=[s[1],s[2]],v=[s[3],s[4]];c.startTangent=[d[0]-p[0],d[1]-p[1]],c.endTangent=[e[0]-v[0],e[1]-v[1]],0===c.startTangent[0]&&0===c.startTangent[1]&&(c.startTangent=[p[0]-v[0],p[1]-v[1]]),0===c.endTangent[0]&&0===c.endTangent[1]&&(c.endTangent=[v[0]-p[0],v[1]-p[1]])}else if("S"===u){var w=t[o-1],y=jr(w.currentPoint,d),m=[s[1],s[2]];"C"===w.command?(c.command="C",c.startTangent=[d[0]-y[0],d[1]-y[1]],c.endTangent=[e[0]-m[0],e[1]-m[1]]):(c.command="SQ",c.startTangent=[d[0]-m[0],d[1]-m[1]],c.endTangent=[e[0]-m[0],e[1]-m[1]])}else if("A"===u){var C=Ai(c,0),Q=C.x,F=C.y,U=Ai(c,1,!1),E=U.x,b=U.y;c.startTangent=[Q,F],c.endTangent=[E,b]}t.push(c)}return t}(t),o=function(A,t){for(var e=[],n=[],r=[],i=0;A.length>i;i++){var a=A[i],o=a.currentPoint,s=a.params,u=a.prePoint,c=void 0;switch(a.command){case"Q":c=jt(u[0],u[1],s[1],s[2],s[3],s[4]);break;case"C":c=Wt(u[0],u[1],s[1],s[2],s[3],s[4],s[5],s[6]);break;case"A":var l=a.arcParams;c=Gt(l.cx,l.cy,l.rx,l.ry,l.xRotation,l.startAngle,l.endAngle);break;default:e.push(o[0]),n.push(o[1])}c&&(a.box=c,e.push(c.x,c.x+c.width),n.push(c.y,c.y+c.height)),t&&("L"===a.command||"M"===a.command)&&a.prePoint&&a.nextPoint&&r.push(a)}e=e.filter(function(A){return!Number.isNaN(A)&&A!==1/0&&A!==-1/0}),n=n.filter(function(A){return!Number.isNaN(A)&&A!==1/0&&A!==-1/0});var h=RA(e),d=RA(n),f=KA(e),B=KA(n);if(0===r.length)return{x:h,y:d,width:f-h,height:B-d};for(var g=0;r.length>g;g++){var p=r[g],v=p.currentPoint;v[0]===h?h-=zr(p,t).xExtra:v[0]===f&&(f+=zr(p,t).xExtra),v[1]===d?d-=zr(p,t).yExtra:v[1]===B&&(B+=zr(p,t).yExtra)}return{x:h,y:d,width:f-h,height:B-d}}(a,0),s=o.x,u=o.y,c=o.width,l=o.height;return{absolutePath:t,hasArc:e,segments:a,polygons:r,polylines:i,totalLength:0,rect:{x:Number.isFinite(s)?s:0,y:Number.isFinite(u)?u:0,width:Number.isFinite(c)?c:0,height:Number.isFinite(l)?l:0}}},oi=Gn(ai);function si(A){return GA(A)?oi(A):ai(A)}function ui(A,t,e){var n=A.curve,r=t.curve;n&&0!==n.length||(n=mt(A.absolutePath,!1),A.curve=n),r&&0!==r.length||(r=mt(t.absolutePath,!1),t.curve=r);var i=[n,r];n.length!==r.length&&(i=Lt(n,r));var a,o,s=Mt(i[0])!==Mt(i[1])?(o=(a=i[0]).slice(1).map(function(A,t,e){return t?e[t-1].slice(-2).concat(A.slice(1)):a[0].slice(1).concat(A.slice(1))}).map(function(A){return A.map(function(t,e){return A[A.length-e-2*(1-e%2)]})}).reverse(),[["M"].concat(o[0].slice(0,2))].concat(o.map(function(A){return["C"].concat(A.slice(2))}))):i[0].map(function(A){return Array.isArray(A)?[].concat(A):A});return[s,Tt(i[1],s),function(A){return A}]}function ci(A,t){return[A.points,t.points,function(A){return A}]}var li=null,hi=/\s*(\w+)\(([^)]*)\)/g;function di(A){return function(t){var e=0;return A.map(function(A){return A===li?t[e++]:A})}}function fi(A){return A}var Bi={matrix:["NNNNNN",[li,li,0,0,li,li,0,0,0,0,1,0,li,li,0,1],fi],matrix3d:["NNNNNNNNNNNNNNNN",fi],rotate:["A"],rotateX:["A"],rotateY:["A"],rotateZ:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",di([li,li,new rr(1)]),fi],scaleX:["N",di([li,new rr(1),new rr(1)]),di([li,new rr(1)])],scaleY:["N",di([new rr(1),li,new rr(1)]),di([new rr(1),li])],scaleZ:["N",di([new rr(1),new rr(1),li])],scale3d:["NNN",fi],skew:["Aa",null,fi],skewX:["A",null,di([li,ar])],skewY:["A",null,di([ar,li])],translate:["Tt",di([li,li,ir]),fi],translateX:["T",di([li,ir,ir]),di([li,ir])],translateY:["T",di([ir,li,ir]),di([ir,li])],translateZ:["L",di([ir,ir,li])],translate3d:["TTL",fi]};function gi(A){for(var t=[],e=A.length,n=0;e>n;n++){var r=A[n],i=r[0],a=r.slice(1);if("translate"===i||"skew"===i?1===a.length&&a.push(0):"scale"===i&&1===a.length&&a.push(a[0]),!Bi[i])return[];var o=a.map(function(A){return dr(A)});t.push({t:i,d:o})}return t}function pi(A){if(Array.isArray(A))return gi(A);if("none"===(A=(A||"none").trim()))return[];var t,e=[],n=0;for(hi.lastIndex=0;t=hi.exec(A);){if(t.index!==n)return[];n=t.index+t[0].length;var r=t[1],i=Bi[r];if(!i)return[];var a=t[2].split(","),o=i[0];if(a.length>o.length)return[];for(var s=[],u=0;o.length>u;u++){var c=a[u],l=o[u],h=void 0;if(void 0===(h=c?{A:function(A){return"0"===A.trim()?ar:Dr(A)},N:_r,T:Sr,L:Tr}[l.toUpperCase()](c):{a:ar,n:s[0],t:ir}[l]))return[];s.push(h)}if(e.push({t:r,d:s}),hi.lastIndex===A.length)return e}return[]}function vi(A){if(Array.isArray(A))return gi(A);if("none"===(A=(A||"none").trim()))return[];var t,e=[],n=0;for(hi.lastIndex=0;t=hi.exec(A);){if(t.index!==n)return[];n=t.index+t[0].length;var r=t[1],i=Bi[r];if(!i)return[];var a=t[2].split(","),o=i[0];if(a.length>o.length)return[];for(var s=[],u=0;o.length>u;u++){var c=a[u],l=o[u],h=void 0;if(void 0===(h=c?{A:function(A){return"0"===A.trim()?ar:Lr(A)},N:Vr,T:Mr,L:Ir}[l.toUpperCase()](c):{a:ar,n:s[0],t:ir}[l]))return[];s.push(h)}if(e.push({t:r,d:s}),hi.lastIndex===A.length)return e}return[]}function wi(A){var t,e,n,r;switch(A.t){case"rotateX":return r=Me(Nr(A.d[0])),[1,0,0,0,0,Math.cos(r),Math.sin(r),0,0,-Math.sin(r),Math.cos(r),0,0,0,0,1];case"rotateY":return r=Me(Nr(A.d[0])),[Math.cos(r),0,-Math.sin(r),0,0,1,0,0,Math.sin(r),0,Math.cos(r),0,0,0,0,1];case"rotate":case"rotateZ":return r=Me(Nr(A.d[0])),[Math.cos(r),Math.sin(r),0,0,-Math.sin(r),Math.cos(r),0,0,0,0,1,0,0,0,0,1];case"rotate3d":t=A.d[0].value,e=A.d[1].value,n=A.d[2].value,r=Me(Nr(A.d[3]));var i=t*t+e*e+n*n;if(0===i)t=1,e=0,n=0;else if(1!==i){var a=Math.sqrt(i);t/=a,e/=a,n/=a}var o=Math.sin(r/2),s=o*Math.cos(r/2),u=o*o;return[1-2*(e*e+n*n)*u,2*(t*e*u+n*s),2*(t*n*u-e*s),0,2*(t*e*u-n*s),1-2*(t*t+n*n)*u,2*(e*n*u+t*s),0,2*(t*n*u+e*s),2*(e*n*u-t*s),1-2*(t*t+e*e)*u,0,0,0,0,1];case"scale":return[A.d[0].value,0,0,0,0,A.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scaleX":return[A.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,A.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,A.d[0].value,0,0,0,0,1];case"scale3d":return[A.d[0].value,0,0,0,0,A.d[1].value,0,0,0,0,A.d[2].value,0,0,0,0,1];case"skew":var c=Me(Nr(A.d[0])),l=Me(Nr(A.d[1]));return[1,Math.tan(l),0,0,Math.tan(c),1,0,0,0,0,1,0,0,0,0,1];case"skewX":return r=Me(Nr(A.d[0])),[1,0,0,0,Math.tan(r),1,0,0,0,0,1,0,0,0,0,1];case"skewY":return r=Me(Nr(A.d[0])),[1,Math.tan(r),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,t=Kr(A.d[0],0,null)||0,e=Kr(A.d[1],0,null)||0,0,1];case"translateX":return[1,0,0,0,0,1,0,0,0,0,1,0,t=Kr(A.d[0],0,null)||0,0,0,1];case"translateY":return[1,0,0,0,0,1,0,0,0,0,1,0,0,e=Kr(A.d[0],0,null)||0,0,1];case"translateZ":return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,n=Kr(A.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,t=Kr(A.d[0],0,null)||0,e=Kr(A.d[1],0,null)||0,n=Kr(A.d[2],0,null)||0,1];case"perspective":var h=Kr(A.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,h?-1/h:0,0,0,0,1];case"matrix":return[A.d[0].value,A.d[1].value,0,0,A.d[2].value,A.d[3].value,0,0,0,0,1,0,A.d[4].value,A.d[5].value,0,1];case"matrix3d":return A.d.map(function(A){return A.value})}}function yi(A,t){return[A[0]*t[0]+A[4]*t[1]+A[8]*t[2]+A[12]*t[3],A[1]*t[0]+A[5]*t[1]+A[9]*t[2]+A[13]*t[3],A[2]*t[0]+A[6]*t[1]+A[10]*t[2]+A[14]*t[3],A[3]*t[0]+A[7]*t[1]+A[11]*t[2]+A[15]*t[3],A[0]*t[4]+A[4]*t[5]+A[8]*t[6]+A[12]*t[7],A[1]*t[4]+A[5]*t[5]+A[9]*t[6]+A[13]*t[7],A[2]*t[4]+A[6]*t[5]+A[10]*t[6]+A[14]*t[7],A[3]*t[4]+A[7]*t[5]+A[11]*t[6]+A[15]*t[7],A[0]*t[8]+A[4]*t[9]+A[8]*t[10]+A[12]*t[11],A[1]*t[8]+A[5]*t[9]+A[9]*t[10]+A[13]*t[11],A[2]*t[8]+A[6]*t[9]+A[10]*t[10]+A[14]*t[11],A[3]*t[8]+A[7]*t[9]+A[11]*t[10]+A[15]*t[11],A[0]*t[12]+A[4]*t[13]+A[8]*t[14]+A[12]*t[15],A[1]*t[12]+A[5]*t[13]+A[9]*t[14]+A[13]*t[15],A[2]*t[12]+A[6]*t[13]+A[10]*t[14]+A[14]*t[15],A[3]*t[12]+A[7]*t[13]+A[11]*t[14]+A[15]*t[15]]}function mi(A){var t=[0,0,0],e=[1,1,1],n=[0,0,0],r=[0,0,0,1],i=[0,0,0,1];return function(A,t,e,n,r,i){if(!function(A,t){var e=t[15];if(0===e)return!1;for(var n=1/e,r=0;16>r;r++)A[r]=t[r]*n;return!0}(Re,A))return!1;if(E(Ge,Re),Ge[3]=0,Ge[7]=0,Ge[11]=0,Ge[15]=1,1e-8>Math.abs(I(Ge)))return!1;var a,o,s=Re[3],u=Re[7],c=Re[11],l=Re[12],h=Re[13],d=Re[14],f=Re[15];if(0!==s||0!==u||0!==c){if(Ve[0]=s,Ve[1]=u,Ve[2]=c,Ve[3]=f,!H(Ge,Ge))return!1;x(Ge,Ge),QA(r,Ve,Ge)}else r[0]=r[1]=r[2]=0,r[3]=1;if(t[0]=l,t[1]=h,t[2]=d,(a=_e)[0][0]=(o=Re)[0],a[0][1]=o[1],a[0][2]=o[2],a[1][0]=o[4],a[1][1]=o[5],a[1][2]=o[6],a[2][0]=o[8],a[2][1]=o[9],a[2][2]=o[10],e[0]=iA(_e[0]),hA(_e[0],_e[0]),n[0]=dA(_e[0],_e[1]),Ye(_e[1],_e[1],_e[0],1,-n[0]),e[1]=iA(_e[1]),hA(_e[1],_e[1]),n[0]/=e[1],n[1]=dA(_e[0],_e[2]),Ye(_e[2],_e[2],_e[0],1,-n[1]),n[2]=dA(_e[1],_e[2]),Ye(_e[2],_e[2],_e[1],1,-n[2]),e[2]=iA(_e[2]),hA(_e[2],_e[2]),n[1]/=e[2],n[2]/=e[2],fA(Xe,_e[1],_e[2]),0>dA(_e[0],Xe))for(var B=0;3>B;B++)e[B]*=-1,_e[B][0]*=-1,_e[B][1]*=-1,_e[B][2]*=-1;i[0]=.5*Math.sqrt(Math.max(1+_e[0][0]-_e[1][1]-_e[2][2],0)),i[1]=.5*Math.sqrt(Math.max(1-_e[0][0]+_e[1][1]-_e[2][2],0)),i[2]=.5*Math.sqrt(Math.max(1-_e[0][0]-_e[1][1]+_e[2][2],0)),i[3]=.5*Math.sqrt(Math.max(1+_e[0][0]+_e[1][1]+_e[2][2],0)),_e[2][1]>_e[1][2]&&(i[0]=-i[0]),_e[0][2]>_e[2][0]&&(i[1]=-i[1]),_e[1][0]>_e[0][1]&&(i[2]=-i[2])}(function(A){return 0===A.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:A.map(wi).reduce(yi)}(A),t,e,n,r,i),[[t,e,n,i,r]]}var Ci=function(){function A(A,t){for(var e=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],n=0;4>n;n++)for(var r=0;4>r;r++)for(var i=0;4>i;i++)e[n][r]+=t[n][i]*A[i][r];return e}return function(t,e,n,r,i){for(var a=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],o=0;4>o;o++)a[o][3]=i[o];for(var s=0;3>s;s++)for(var u=0;3>u;u++)a[3][s]+=t[u]*a[u][s];var c=r[0],l=r[1],h=r[2],d=r[3],f=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];f[0][0]=1-2*(l*l+h*h),f[0][1]=2*(c*l-h*d),f[0][2]=2*(c*h+l*d),f[1][0]=2*(c*l+h*d),f[1][1]=1-2*(c*c+h*h),f[1][2]=2*(l*h-c*d),f[2][0]=2*(c*h-l*d),f[2][1]=2*(l*h+c*d),f[2][2]=1-2*(c*c+l*l),a=A(a,f);var B,g=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];n[2]&&(g[2][1]=n[2],a=A(a,g)),n[1]&&(g[2][1]=0,g[2][0]=n[0],a=A(a,g)),n[0]&&(g[2][0]=0,g[1][0]=n[0],a=A(a,g));for(var p=0;3>p;p++)for(var v=0;3>v;v++)a[p][v]*=e[p];return 0===(B=a)[0][2]&&0===B[0][3]&&0===B[1][2]&&0===B[1][3]&&0===B[2][0]&&0===B[2][1]&&1===B[2][2]&&0===B[2][3]&&0===B[3][2]&&1===B[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 Qi(A){return A.toFixed(6).replace(".000000","")}function Fi(A,t){var e,n;return A.decompositionPair!==t&&(A.decompositionPair=t,e=mi(A)),t.decompositionPair!==A&&(t.decompositionPair=A,n=mi(t)),null===e[0]||null===n[0]?[[!1],[!0],function(e){return e?t[0].d:A[0].d}]:(e[0].push(0),n[0].push(1),[e,n,function(A){var t=function(A,t,e){var n=function(A,t){for(var e=0,n=0;A.length>n;n++)e+=A[n]*t[n];return e}(A,t);n=VA(n,-1,1);var r=[];if(1===n)r=A;else for(var i=Math.acos(n),a=1*Math.sin(e*i)/Math.sqrt(1-n*n),o=0;4>o;o++)r.push(A[o]*(Math.cos(e*i)-n*a)+t[o]*a);return r}(e[0][3],n[0][3],A[5]);return Ci(A[0],A[1],A[2],t,A[4]).map(Qi).join(",")}])}function Ui(A){return A.replace(/[XY]/,"")}function Ei(A){return A.replace(/(X|Y|Z|3d)?$/,"3d")}var bi=function(A,t){return"perspective"===A&&"perspective"===t||("matrix"===A||"matrix3d"===A)&&("matrix"===t||"matrix3d"===t)};function ki(A,t,e){var n=!1;if(!A.length||!t.length){A.length||(n=!0,A=t,t=[]);for(var r=function(){var e=A[i],n=e.t,r=e.d,a="scale"===n.substring(0,5)?1:0;t.push({t:n,d:r.map(function(A){return"number"==typeof A?dr(a):dr(a,A.unit)})})},i=0;A.length>i;i++)r()}var a=[],o=[],s=[];if(A.length!==t.length){var u=Fi(A,t);a=[u[0]],o=[u[1]],s=[["matrix",[u[2]]]]}else for(var c=0;A.length>c;c++){var l=A[c].t,h=t[c].t,d=A[c].d,f=t[c].d,B=Bi[l],g=Bi[h],p=void 0;if(bi(l,h)){var v=Fi([A[c]],[t[c]]);a.push(v[0]),o.push(v[1]),s.push(["matrix",[v[2]]])}else{if(l===h)p=l;else if(B[2]&&g[2]&&Ui(l)===Ui(h))p=Ui(l),d=B[2](d),f=g[2](f);else{if(!B[1]||!g[1]||Ei(l)!==Ei(h)){var w=Fi(A,t);a=[w[0]],o=[w[1]],s=[["matrix",[w[2]]]];break}p=Ei(l),d=B[1](d),f=g[1](f)}for(var y=[],m=[],C=[],Q=0;d.length>Q;Q++){var F=Pr(d[Q],f[Q],e,!1,Q);y[Q]=F[0],m[Q]=F[1],C.push(F[2])}a.push(y),o.push(m),s.push([p,C])}}if(n){var U=a;a=o,o=U}return[a,o,function(A){return A.map(function(A,t){var e=A.map(function(A,e){return s[t][1][e](A)}).join(",");return"matrix"===s[t][0]&&16===e.split(",").length&&(s[t][0]="matrix3d"),"matrix3d"===s[t][0]&&6===e.split(",").length&&(s[t][0]="matrix"),"".concat(s[t][0],"(").concat(e,")")}).join(" ")}]}var xi=Gn(function(A){if(GA(A)){if("text-anchor"===A)return[dr(0,"px"),dr(0,"px")];var t=A.split(" ");return 1===t.length&&("top"===t[0]||"bottom"===t[0]?(t[1]=t[0],t[0]="center"):t[1]="center"),2!==t.length?null:[Sr(Hi(t[0])),Sr(Hi(t[1]))]}return[dr(A[0]||0,"px"),dr(A[1]||0,"px")]});function Hi(A){return"center"===A?"50%":"left"===A||"top"===A?"0%":"right"===A||"bottom"===A?"100%":A}var Ii=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:sn.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:sn.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:sn.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:sn.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:sn.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:sn.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:sn.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:sn.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:sn.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:sn.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:sn.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:sn.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:sn.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:sn.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:sn.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:sn.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:sn.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:sn.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:sn.FILTER},{n:"clipPath",syntax:sn.DEFINED_PATH},{n:"textPath",syntax:sn.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:sn.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:sn.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:sn.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:sn.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:sn.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:sn.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:sn.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:sn.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:sn.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:sn.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:sn.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:sn.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:sn.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:sn.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:sn.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:sn.COORDINATE},{n:"y1",int:!0,l:!0,syntax:sn.COORDINATE},{n:"z1",int:!0,l:!0,syntax:sn.COORDINATE},{n:"x2",int:!0,l:!0,syntax:sn.COORDINATE},{n:"y2",int:!0,l:!0,syntax:sn.COORDINATE},{n:"z2",int:!0,l:!0,syntax:sn.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:sn.PATH,p:50},{n:"points",int:!0,l:!0,syntax:sn.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:sn.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:sn.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:sn.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:sn.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:sn.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:sn.NUMBER,d:function(A){return A===le.PATH||A===le.POLYGON||A===le.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:sn.MARKER},{n:"markerEnd",syntax:sn.MARKER},{n:"markerMid",syntax:sn.MARKER},{n:"markerStartOffset",syntax:sn.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:sn.LENGTH,l:!0,int:!0,d:"0"}],Ti=new Set(Ii.filter(function(A){return!!A.l}).map(function(A){return A.n})),Mi={},Si=function(){return s(function A(t){var e=this;a(this,A),this.runtime=t,Ii.forEach(function(A){e.registerMetadata(A)})},[{key:"registerMetadata",value:function(A){[A.n].concat(l(A.a||[])).forEach(function(t){Mi[t]=A})}},{key:"getPropertySyntax",value:function(A){return this.runtime.CSSPropertySyntaxFactory[A]}},{key:"processProperties",value:function(A,t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0};Object.assign(A.attributes,t);var n=A.parsedStyle.clipPath,r=A.parsedStyle.offsetPath;!function(A,t){var e=Li(A);for(var n in t)e.has(n)&&(A.parsedStyle[n]=t[n])}(A,t);var a=!!e.forceUpdateGeometry;if(!a)for(var o in t)if(Ti.has(o)){a=!0;break}var s,u=Li(A);u.has("fill")&&t.fill&&(A.parsedStyle.fill=kr(t.fill)),u.has("stroke")&&t.stroke&&(A.parsedStyle.stroke=kr(t.stroke)),u.has("shadowColor")&&t.shadowColor&&(A.parsedStyle.shadowColor=kr(t.shadowColor)),u.has("filter")&&t.filter&&(A.parsedStyle.filter=function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if("none"===(A=A.toLowerCase().trim()))return[];for(var t,e=/\s*([\w-]+)\(([^)]*)\)/g,n=[],r=0;t=e.exec(A);){if(t.index!==r)return[];if(r=t.index+t[0].length,Rr.indexOf(t[1])>-1&&n.push({name:t[1],params:t[2].split(" ").map(function(A){return Hr(/deg|rad|grad|turn|px|%/g,A)||kr(A)})}),e.lastIndex===A.length)return n}return[]}(t.filter)),u.has("radius")&&!DA(t.radius)&&(A.parsedStyle.radius=Or(t.radius,4)),u.has("lineDash")&&!DA(t.lineDash)&&(A.parsedStyle.lineDash=Or(t.lineDash,"even")),u.has("points")&&t.points&&(A.parsedStyle.points={points:GA(s=t.points)?s.split(" ").map(function(A){var t=v(A.split(","),2),e=t[1];return[Number(t[0]),Number(e)]}):s,totalLength:0,segments:[]}),u.has("d")&&""===t.d&&(A.parsedStyle.d=i({},on)),u.has("d")&&t.d&&(A.parsedStyle.d=si(t.d)),u.has("textTransform")&&t.textTransform&&this.runtime.CSSPropertySyntaxFactory[sn.TEXT_TRANSFORM].calculator(null,null,{value:t.textTransform},A,null),u.has("clipPath")&&!JA(t.clipPath)&&this.runtime.CSSPropertySyntaxFactory[sn.DEFINED_PATH].calculator("clipPath",n,t.clipPath,A,this.runtime),u.has("offsetPath")&&t.offsetPath&&this.runtime.CSSPropertySyntaxFactory[sn.DEFINED_PATH].calculator("offsetPath",r,t.offsetPath,A,this.runtime),u.has("transform")&&t.transform&&(A.parsedStyle.transform=pi(t.transform)),u.has("transformOrigin")&&t.transformOrigin&&(A.parsedStyle.transformOrigin=xi(t.transformOrigin)),u.has("markerStart")&&t.markerStart&&(A.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[sn.MARKER].calculator(null,t.markerStart,t.markerStart,null,null)),u.has("markerEnd")&&t.markerEnd&&(A.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[sn.MARKER].calculator(null,t.markerEnd,t.markerEnd,null,null)),u.has("markerMid")&&t.markerMid&&(A.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[sn.MARKER].calculator("",t.markerMid,t.markerMid,null,null)),u.has("zIndex")&&!DA(t.zIndex)&&this.runtime.CSSPropertySyntaxFactory[sn.Z_INDEX].postProcessor(A),u.has("offsetDistance")&&!DA(t.offsetDistance)&&this.runtime.CSSPropertySyntaxFactory[sn.OFFSET_DISTANCE].postProcessor(A),u.has("transform")&&t.transform&&this.runtime.CSSPropertySyntaxFactory[sn.TRANSFORM].postProcessor(A),u.has("transformOrigin")&&t.transformOrigin&&this.runtime.CSSPropertySyntaxFactory[sn.TRANSFORM_ORIGIN].postProcessor(A),a&&(A.dirty(!0,!0),e.forceUpdateGeometry||this.runtime.sceneGraphService.dirtyToRoot(A))}},{key:"updateGeometry",value:function(A){var t=A.nodeName,e=this.runtime.geometryUpdaterFactory[t];if(e){var n=A.geometry;n.contentBounds||(n.contentBounds=new me),n.renderBounds||(n.renderBounds=new me);var r=A.parsedStyle,i=e.update(r,A),a=i.cx,o=void 0===a?0:a,s=i.cy,u=void 0===s?0:s,c=i.cz,l=void 0===c?0:c,h=i.hwidth,d=void 0===h?0:h,f=i.hheight,B=void 0===f?0:f,g=i.hdepth,p=void 0===g?0:g,v=[Math.abs(d),Math.abs(B),p],w=r.stroke,y=r.lineWidth,m=void 0===y?1:y,C=r.increasedLineWidthForHitTesting,Q=void 0===C?0:C,F=r.shadowType,U=void 0===F?"outer":F,E=r.shadowColor,b=r.filter,k=void 0===b?[]:b,x=r.transformOrigin,H=[o,u,l];if(n.contentBounds.update(H,v),w&&!w.isNone){var I=((m||0)+(Q||0))*(t===le.POLYLINE||t===le.POLYGON||t===le.PATH?Math.SQRT2:.5);v[0]+=I,v[1]+=I}if(n.renderBounds.update(H,v),E&&U&&"inner"!==U){var T=n.renderBounds,M=T.min,S=T.max,L=r.shadowBlur||0,D=r.shadowOffsetX||0,P=r.shadowOffsetY||0,N=S[0]+L+D,O=M[1]-L+P,K=S[1]+L+P;M[0]=Math.min(M[0],M[0]-L+D),S[0]=Math.max(S[0],N),M[1]=Math.min(M[1],O),S[1]=Math.max(S[1],K),n.renderBounds.setMinMax(M,S)}k.forEach(function(A){var t=A.name,e=A.params;if("blur"===t){var r=e[0].value;n.renderBounds.update(n.renderBounds.center,uA(n.renderBounds.halfExtents,n.renderBounds.halfExtents,[r,r,0]))}else if("drop-shadow"===t){var i=e[0].value,a=e[1].value,o=e[2].value,s=n.renderBounds,u=s.min,c=s.max,l=c[0]+o+i,h=u[1]-o+a,d=c[1]+o+a;u[0]=Math.min(u[0],u[0]-o+i),c[0]=Math.max(c[0],l),u[1]=Math.min(u[1],h),c[1]=Math.max(c[1],d),n.renderBounds.setMinMax(u,c)}}),A.geometry.dirty=!1;var R=0>B,G=(0>d?-1:1)*(x?Kr(x[0],0,A,!0):0),V=(R?-1:1)*(x?Kr(x[1],1,A,!0):0);(G||V)&&A.setOrigin(G,V)}}},{key:"updateSizeAttenuation",value:function(A,t){A.style.isSizeAttenuation?(A.style.rawLineWidth||(A.style.rawLineWidth=A.style.lineWidth),A.style.lineWidth=(A.style.rawLineWidth||1)/t,A.nodeName===le.CIRCLE&&(A.style.rawR||(A.style.rawR=A.style.r),A.style.r=(A.style.rawR||1)/t)):(A.style.rawLineWidth&&(A.style.lineWidth=A.style.rawLineWidth,delete A.style.rawLineWidth),A.nodeName===le.CIRCLE&&A.style.rawR&&(A.style.r=A.style.rawR,delete A.style.rawR))}}])}();function Li(A){return A.constructor.PARSED_STYLE_LIST}var Di=function(){return s(function A(){a(this,A),this.mixer=Xr},[{key:"calculator",value:function(A,t,e,n){return Nr(e)}}])}(),Pi=function(){return s(function A(){a(this,A)},[{key:"calculator",value:function(A,t,e,n,r){return e instanceof er&&(e=null),r.sceneGraphService.updateDisplayObjectDependency(A,t,e,n),"clipPath"===A&&n.forEach(function(A){0===A.childNodes.length&&r.sceneGraphService.dirtyToRoot(A)}),e}}])}(),Ni=function(){return s(function A(){a(this,A),this.parser=kr,this.mixer=xr},[{key:"calculator",value:function(A,t,e,n){return e instanceof er?"none"===e.value?cr:lr:e}}])}(),Oi=function(){return s(function A(){a(this,A)},[{key:"calculator",value:function(A,t,e){return e instanceof er?[]:e}}])}();function Ki(A){var t=A.parsedStyle.fontSize;return DA(t)?null:t}var Ri=function(){return s(function A(){a(this,A),this.mixer=Xr},[{key:"calculator",value:function(A,t,e,n,r){if(_A(e))return e;if(!rr.isRelativeUnit(e.unit))return e.value;if(e.unit===Vn.kPercentage)return 0;if(e.unit===Vn.kEms){if(n.parentNode){var i=Ki(n.parentNode);if(i)return i*=e.value}return 0}if(e.unit===Vn.kRems){var a;if(null!=n&&null!==(a=n.ownerDocument)&&void 0!==a&&a.documentElement){var o=Ki(n.ownerDocument.documentElement);if(o)return o*=e.value}return 0}}}])}(),Gi=function(){return s(function A(){a(this,A),this.mixer=Wr},[{key:"calculator",value:function(A,t,e){return e.map(function(A){return A.value})}}])}(),Vi=function(){return s(function A(){a(this,A),this.mixer=Wr},[{key:"calculator",value:function(A,t,e){return e.map(function(A){return A.value})}}])}(),_i=function(){return s(function A(){a(this,A)},[{key:"calculator",value:function(A,t,e,n){var r;e instanceof er&&(e=null);var i=null===(r=e)||void 0===r?void 0:r.cloneNode(!0);return i&&(i.style.isMarker=!0),i}}])}(),Xi=function(){return s(function A(){a(this,A),this.mixer=Xr},[{key:"calculator",value:function(A,t,e){return e.value}}])}(),Yi=function(){return s(function A(){a(this,A),this.mixer=Yr(0,1)},[{key:"calculator",value:function(A,t,e){return e.value}},{key:"postProcessor",value:function(A){var t=A.parsedStyle,e=t.offsetPath;if(e){var n=e.nodeName;if(n===le.LINE||n===le.PATH||n===le.POLYLINE){var r=e.getPoint(t.offsetDistance);r&&A.setLocalPosition(r.x,r.y)}}}}])}(),Wi=function(){return s(function A(){a(this,A),this.mixer=Yr(0,1)},[{key:"calculator",value:function(A,t,e){return e.value}}])}(),Ji=function(){return s(function A(){a(this,A),this.parser=si,this.mixer=ui},[{key:"calculator",value:function(A,t,e){return e instanceof er&&"unset"===e.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Ee(0,0,0,0)}:e}}])}(),Zi=s(function A(){a(this,A),this.mixer=ci}),zi=function(A){function t(){var A;a(this,t);for(var e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];return(A=B(this,t,[].concat(n))).mixer=Yr(0,1/0),A}return p(t,A),s(t)}(Ri),ji=function(){return s(function A(){a(this,A)},[{key:"calculator",value:function(A,t,e,n){return e instanceof er?"unset"===e.value?"":e.value:"".concat(e)}},{key:"postProcessor",value:function(A){A.nodeValue="".concat(A.parsedStyle.text)||""}}])}(),qi=function(){return s(function A(){a(this,A)},[{key:"calculator",value:function(A,t,e,n){var r=n.getAttribute("text");if(r){var i=r;"capitalize"===e.value?i=r.charAt(0).toUpperCase()+r.slice(1):"lowercase"===e.value?i=r.toLowerCase():"uppercase"===e.value&&(i=r.toUpperCase()),n.parsedStyle.text=i}return e.value}}])}(),$i=new WeakMap;var Aa="undefined"!=typeof window&&void 0!==window.document;function ta(A){return!!A.getAttribute}function ea(A,t){var e=Number(A.parsedStyle.zIndex||0),n=Number(t.parsedStyle.zIndex||0);if(e===n){var r=A.parentNode;if(r){var i=r.childNodes||[];return i.indexOf(A)-i.indexOf(t)}}return e-n}function na(A){var t=A;do{var e;if(null===(e=t.parsedStyle)||void 0===e?void 0:e.clipPath)return t;t=t.parentElement}while(null!==t);return null}function ra(A,t){if(Aa)return document.defaultView.getComputedStyle(A,null).getPropertyValue(t)}var ia={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},aa="object"==typeof performance&&performance.now?performance:Date;function oa(A){return A.nodeName===le.FRAGMENT||A.getRootNode().nodeName===le.FRAGMENT}var sa=1,ua="object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:{},ca=Date.now(),la={},ha=Date.now(),da=function(A){if("function"!=typeof A)throw new TypeError("".concat(A," is not a function"));var t=Date.now(),e=t-ha,n=e>16?0:16-e,r=sa++;return la[r]=A,Object.keys(la).length>1||setTimeout(function(){ha=t;var A=la;la={},Object.keys(A).forEach(function(t){return A[t](ua.performance&&"function"==typeof ua.performance.now?ua.performance.now():Date.now()-ca)})},n),r},fa=function(A){delete la[A]},Ba=function(A){return"string"!=typeof A?da:""===A?ua.requestAnimationFrame:ua["".concat(A,"RequestAnimationFrame")]},ga=function(A,t){for(var e=0;void 0!==A[e];){if(t(A[e]))return A[e];e+=1}}(["","webkit","moz","ms","o"],function(A){return!!Ba(A)}),pa=Ba(ga),va=function(A){return"string"!=typeof A?fa:""===A?ua.cancelAnimationFrame:ua["".concat(A,"CancelAnimationFrame")]||ua["".concat(A,"CancelRequestAnimationFrame")]}(ga);ua.requestAnimationFrame=pa,ua.cancelAnimationFrame=va;var wa=function(){return s(function A(){a(this,A),this.callbacks=[]},[{key:"getCallbacksNum",value:function(){return this.callbacks.length}},{key:"tapPromise",value:function(A,t){this.callbacks.push(t)}},{key:"promise",value:function(){for(var A=arguments.length,t=Array(A),e=0;A>e;e++)t[e]=arguments[e];return Promise.all(this.callbacks.map(function(A){return A.apply(void 0,t)}))}}])}(),ya=function(){return s(function A(){a(this,A),this.callbacks=[]},[{key:"tapPromise",value:function(A,t){this.callbacks.push(t)}},{key:"promise",value:(A=se(ae().mark(function A(){var t,e,n,r,i=arguments;return ae().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:if(!this.callbacks.length){A.next=6;break}return A.next=1,(t=this.callbacks)[0].apply(t,i);case 1:e=A.sent,n=1;case 2:if(n>=this.callbacks.length){A.next=5;break}return r=this.callbacks[n],A.next=3,r(e);case 3:e=A.sent;case 4:n++,A.next=2;break;case 5:return A.abrupt("return",e);case 6:return A.abrupt("return",null);case 7:case"end":return A.stop()}},A,this)})),function(){return A.apply(this,arguments)})}]);var A}(),ma=function(){return s(function A(){a(this,A),this.callbacks=[]},[{key:"tap",value:function(A,t){this.callbacks.push(t)}},{key:"call",value:function(){for(var A=arguments.length,t=Array(A),e=0;A>e;e++)t[e]=arguments[e];var n=arguments;this.callbacks.forEach(function(A){A.apply(void 0,n)})}}])}(),Ca=function(){return s(function A(){a(this,A),this.callbacks=[]},[{key:"tap",value:function(A,t){this.callbacks.push(t)}},{key:"call",value:function(){for(var A=arguments.length,t=Array(A),e=0;A>e;e++)t[e]=arguments[e];if(this.callbacks.length){for(var n=this.callbacks[0].apply(void 0,arguments),r=1;this.callbacks.length>r;r++){n=(0,this.callbacks[r])(n)}return n}return null}}])}(),Qa=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Fa=/([\"\'])[^\'\"]+\1/;function Ua(A){var t=A.fontSize,e=A.fontFamily,n=A.fontStyle,r=A.fontVariant,i=A.fontWeight;return{fontSize:void 0===t?16:t,fontFamily:void 0===e?"sans-serif":e,fontStyle:void 0===n?"normal":n,fontVariant:void 0===r?"normal":r,fontWeight:void 0===i?"normal":i}}var Ea=Gn(function(A){for(var t=Ua(A),e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,a=t.fontWeight,o=_A(e)&&"".concat(e,"px")||"16px",s=n.split(","),u=s.length-1;u>=0;u--){var c=s[u].trim();!Fa.test(c)&&0>Qa.indexOf(c)&&(c='"'.concat(c,'"')),s[u]=c}return"".concat(r," ").concat(i," ").concat(a," ").concat(o," ").concat(s.join(","))},function(A){var t=Ua(A),e=t.fontSize,n=t.fontFamily,r=t.fontVariant,i=t.fontWeight;return"".concat(t.fontStyle,"_").concat(r,"_").concat(i,"_").concat(e,"_").concat(n)}),ba=function(A){return Math.max(A,1e-6)};function ka(A,t,e){return k(A),A[4]=Math.tan(t),A[1]=Math.tan(e),A}var xa=F(),Ha=F(),Ia={scale:function(A){N(xa,[A[0].value,A[1].value,1].map(function(A){return ba(A)}))},scaleX:function(A){N(xa,[A[0].value,1,1].map(function(A){return ba(A)}))},scaleY:function(A){N(xa,[1,A[0].value,1].map(function(A){return ba(A)}))},scaleZ:function(A){N(xa,[1,1,A[0].value].map(function(A){return ba(A)}))},scale3d:function(A){N(xa,[A[0].value,A[1].value,A[2].value].map(function(A){return ba(A)}))},translate:function(A){P(xa,[A[0].value,A[1].value,0])},translateX:function(A){P(xa,[A[0].value,0,0])},translateY:function(A){P(xa,[0,A[0].value,0])},translateZ:function(A){P(xa,[0,0,A[0].value])},translate3d:function(A){P(xa,[A[0].value,A[1].value,A[2].value])},rotate:function(A){G(xa,Me(Nr(A[0])))},rotateX:function(A){K(xa,Me(Nr(A[0])))},rotateY:function(A){R(xa,Me(Nr(A[0])))},rotateZ:function(A){G(xa,Me(Nr(A[0])))},rotate3d:function(A){O(xa,Me(Nr(A[3])),[A[0].value,A[1].value,A[2].value])},skew:function(A){ka(xa,Me(A[0].value),Me(A[1].value))},skewX:function(A){ka(xa,Me(A[0].value),0)},skewY:function(A){ka(xa,0,Me(A[0].value))},matrix:function(A){b(xa,A[0].value,A[1].value,0,0,A[2].value,A[3].value,0,0,0,0,1,0,A[4].value,A[5].value,0,1)},matrix3d:function(A){b.apply(eA,[xa].concat(l(A.map(function(A){return A.value}))))}},Ta=aA(1,1,1),Ma=nA(),Sa={translate:function(A,t){No.sceneGraphService.setLocalScale(A,Ta,!1),No.sceneGraphService.setLocalEulerAngles(A,Ma,void 0,void 0,!1),No.sceneGraphService.setLocalPosition(A,[t[0].value,t[1].value,0],!1),No.sceneGraphService.dirtyLocalTransform(A,A.transformable)}};function La(A,t){if(A.length){if(1===A.length&&Sa[A[0].t])return void Sa[A[0].t](t,A[0].d);for(var e=k(Ha),n=0;A.length>n;n++){var r=A[n],i=Ia[r.t];i&&(i(r.d),tA(e,e,xa))}t.setLocalTransform(e)}else t.resetLocalTransform();return t.getLocalTransform()}var Da=function(){return s(function A(){a(this,A),this.parser=vi,this.mixer=ki},[{key:"calculator",value:function(A,t,e,n){return e instanceof er?[]:e}},{key:"postProcessor",value:function(A){La(A.parsedStyle.transform,A)}}])}(),Pa=function(){return s(function A(){a(this,A)},[{key:"postProcessor",value:function(A){var t=A.parsedStyle.transformOrigin;t[0].unit===Vn.kPixels&&t[1].unit===Vn.kPixels?A.setOrigin(t[0].value,t[1].value):A.getGeometryBounds()}}])}(),Na=function(){return s(function A(){a(this,A)},[{key:"calculator",value:function(A,t,e,n){return e.value}},{key:"postProcessor",value:function(A){if(A.parentNode){var t=A.parentNode,e=t.sortable;t.renderable&&t.dirty(),e&&(e.dirty=!0,e.dirtyReason=An.Z_INDEX_CHANGED)}}}])}(),Oa=function(){return s(function A(){a(this,A)},[{key:"update",value:function(A,t){var e=A.cx,n=A.cy,r=A.r,i=void 0===r?0:r;return{cx:void 0===e?0:e,cy:void 0===n?0:n,hwidth:i,hheight:i}}}])}(),Ka=function(){return s(function A(){a(this,A)},[{key:"update",value:function(A,t){var e=A.cx,n=A.cy,r=A.rx,i=A.ry;return{cx:void 0===e?0:e,cy:void 0===n?0:n,hwidth:void 0===r?0:r,hheight:void 0===i?0:i}}}])}(),Ra=function(){return s(function A(){a(this,A)},[{key:"update",value:function(A){var t=A.x1,e=A.y1,n=A.x2,r=A.y2,i=Math.min(t,n),a=Math.max(t,n),o=Math.min(e,r),s=(a-i)/2,u=(Math.max(e,r)-o)/2;return{cx:i+s,cy:o+u,hwidth:s,hheight:u}}}])}(),Ga=function(){return s(function A(){a(this,A)},[{key:"update",value:function(A){var t=A.d.rect,e=t.width/2,n=t.height/2;return{cx:t.x+e,cy:t.y+n,hwidth:e,hheight:n}}}])}(),Va=function(){return s(function A(){a(this,A)},[{key:"update",value:function(A){if(A.points&&PA(A.points.points)){var t=A.points.points,e=Math.min.apply(Math,l(t.map(function(A){return A[0]}))),n=Math.max.apply(Math,l(t.map(function(A){return A[0]}))),r=Math.min.apply(Math,l(t.map(function(A){return A[1]}))),i=(n-e)/2,a=(Math.max.apply(Math,l(t.map(function(A){return A[1]})))-r)/2;return{cx:e+i,cy:r+a,hwidth:i,hheight:a}}return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),_a=function(){return s(function A(){a(this,A)},[{key:"update",value:function(A,t){var e=A.x,n=void 0===e?0:e,r=A.y,i=void 0===r?0:r,a=A.src,o=A.width,s=A.height,u=void 0===o?0:o,c=void 0===s?0:s;return a&&!GA(a)&&(u||(A.width=u=a.width),c||(A.height=c=a.height)),{cx:n+u/2,cy:i+c/2,hwidth:u/2,hheight:c/2}}}])}(),Xa=function(){return s(function A(t){a(this,A),this.globalRuntime=t},[{key:"isReadyToMeasure",value:function(A,t){return A.text}},{key:"update",value:function(A,t){var e,n=A.text,r=A.textAlign,i=void 0===r?"start":r,a=A.lineWidth,o=void 0===a?1:a,s=A.textBaseline,u=void 0===s?"alphabetic":s,c=A.dx,l=void 0===c?0:c,h=A.dy,d=void 0===h?0:h,f=A.x,B=void 0===f?0:f,g=A.y,p=void 0===g?0:g;if(!this.isReadyToMeasure(A,t))return A.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{hwidth:0,hheight:0,cx:0,cy:0};var v=(null==t||null===(e=t.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e?void 0:e.getConfig())||{},w=this.globalRuntime.textService.measureText(n,A,v.offscreenCanvas);A.metrics=w;var y=w.width/2,m=w.height/2,C=B+y;"center"===i||"middle"===i?C+=o/2-y:"right"!==i&&"end"!==i||(C+=o-2*y);var Q=p-m;return"middle"===u?Q+=m:"top"===u||"hanging"===u?Q+=2*m:"alphabetic"===u||"bottom"!==u&&"ideographic"!==u||(Q+=0),l&&(C+=l),d&&(Q+=d),{cx:C,cy:Q,hwidth:y,hheight:m}}}])}(),Ya=function(){return s(function A(){a(this,A)},[{key:"update",value:function(A,t){return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),Wa=function(){return s(function A(){a(this,A)},[{key:"update",value:function(A,t){var e=A.x,n=A.y,r=A.width,i=void 0===r?0:r,a=A.height,o=void 0===a?0:a;return{cx:(void 0===e?0:e)+i/2,cy:(void 0===n?0:n)+o/2,hwidth:i/2,hheight:o/2}}}])}();var Ja=function(){return s(function A(t){a(this,A),this.eventPhase=A.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Ue,this.page=new Ue,this.canvas=new Ue,this.viewport=new Ue,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t},[{key:"name",get:function(){return this.type}},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"composedPath",value:function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}},{key:"propagationPath",get:function(){return this.composedPath()}},{key:"preventDefault",value:function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}},{key:"stopImmediatePropagation",value:function(){this.propagationImmediatelyStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"initEvent",value:function(){}},{key:"initUIEvent",value:function(){}},{key:"clone",value:function(){throw Error(be)}}])}(),Za=function(A){function t(){var A;a(this,t);for(var e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];return(A=B(this,t,[].concat(n))).client=new Ue,A.movement=new Ue,A.offset=new Ue,A.global=new Ue,A.screen=new Ue,A}return p(t,A),s(t,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}},{key:"getModifierState",value:function(A){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(A)}},{key:"initMouseEvent",value:function(){throw Error(be)}}])}(Ja),za=function(A){function t(){var A;a(this,t);for(var e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];return(A=B(this,t,[].concat(n))).width=0,A.height=0,A.isPrimary=!1,A}return p(t,A),s(t,[{key:"getCoalescedEvents",value:function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}},{key:"getPredictedEvents",value:function(){throw Error("getPredictedEvents is not supported!")}},{key:"clone",value:function(){return this.manager.clonePointerEvent(this)}}])}(Za),ja=function(A){function t(){return a(this,t),B(this,t,arguments)}return p(t,A),s(t,[{key:"clone",value:function(){return this.manager.cloneWheelEvent(this)}}])}(Za),qa=function(A){function t(A,e){var n;return a(this,t),(n=B(this,t,[null])).type=A,n.detail=null==e?void 0:e.detail,e&&!("detail"in e)&&(n.detail=e),Object.assign(n,e),n}return p(t,A),s(t)}(Ja),$a=function(){return s(function A(){a(this,A),this.emitter=new y},[{key:"on",value:function(A,t,e){return this.addEventListener(A,t,e),this}},{key:"addEventListener",value:function(A,t,e){var n=!1,r=!1;if(WA(e))n=e;else if(e){var i=e.capture;n=void 0!==i&&i;var a=e.once;r=void 0!==a&&a}n&&(A+="capture"),t=LA(t)?t:t.handleEvent;var o=LA(t)?void 0:t;return r?this.emitter.once(A,t,o):this.emitter.on(A,t,o),this}},{key:"off",value:function(A,t,e){return A?this.removeEventListener(A,t,e):this.removeAllEventListeners(),this}},{key:"removeAllEventListeners",value:function(){var A;null===(A=this.emitter)||void 0===A||A.removeAllListeners()}},{key:"removeEventListener",value:function(A,t,e){var n;if(!this.emitter)return this;(WA(e)?e:null==e?void 0:e.capture)&&(A+="capture"),t=LA(t)?t:null===(n=t)||void 0===n?void 0:n.handleEvent;var r=LA(t)?void 0:t;return this.emitter.off(A,t,r),this}},{key:"emit",value:function(A,t){this.dispatchEvent(new qa(A,t))}},{key:"dispatchEventToSelf",value:function(A){A.target||(A.target=this),A.currentTarget=this,this.emitter.emit(A.type,A)}},{key:"dispatchEvent",value:function(A){var t,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(arguments.length>2?arguments[2]:void 0)return this.dispatchEventToSelf(A),!0;if(this.document)t=this;else if(this.defaultView)t=this.defaultView;else{var n;t=null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView}if(t){if(A.manager=t.getEventService(),!A.manager)return!1;A.defaultPrevented=!1,A.path?A.path.length=0:A.page=[],e||(A.target=this),A.manager.dispatchEvent(A,A.type,e)}else this.dispatchEventToSelf(A);return!A.defaultPrevented}}])}(),Ao=function(A){function t(){var A;a(this,t);for(var e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];return(A=B(this,t,[].concat(n))).shadow=!1,A.ownerDocument=null,A.isConnected=!1,A.baseURI="",A.childNodes=[],A.nodeType=0,A.nodeName="",A.nodeValue=null,A.mutations=void 0,A.parentNode=null,A.destroyed=!1,A}return p(t,A),s(t,[{key:"textContent",get:function(){var A="";this.nodeName===le.TEXT&&(A+=this.style.text);var t,e=ue(this.childNodes);try{for(e.s();!(t=e.n()).done;){var n=t.value;A+=n.nodeName===le.TEXT?n.nodeValue:n.textContent}}catch(A){e.e(A)}finally{e.f()}return A},set:function(A){var t=this;this.childNodes.slice().forEach(function(A){t.removeChild(A)}),this.nodeName===le.TEXT&&(this.style.text="".concat(A))}},{key:"getRootNode",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.parentNode?this.parentNode.getRootNode(A):A.composed&&this.host?this.host.getRootNode(A):this}},{key:"hasChildNodes",value:function(){return this.childNodes.length>0}},{key:"isDefaultNamespace",value:function(A){throw Error(be)}},{key:"lookupNamespaceURI",value:function(A){throw Error(be)}},{key:"lookupPrefix",value:function(A){throw Error(be)}},{key:"normalize",value:function(){throw Error(be)}},{key:"isEqualNode",value:function(A){return this===A}},{key:"isSameNode",value:function(A){return this.isEqualNode(A)}},{key:"parent",get:function(){return this.parentNode}},{key:"parentElement",get:function(){return null}},{key:"nextSibling",get:function(){return null}},{key:"previousSibling",get:function(){return null}},{key:"firstChild",get:function(){return this.childNodes.length>0?this.childNodes[0]:null}},{key:"lastChild",get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}},{key:"compareDocumentPosition",value:function(A){if(A===this)return 0;for(var e=A,n=this,r=[e],i=[n];null!==(a=e.parentNode)&&void 0!==a?a:n.parentNode;){var a;e=e.parentNode?(r.push(e.parentNode),e.parentNode):e,n=n.parentNode?(i.push(n.parentNode),n.parentNode):n}if(e!==n)return t.DOCUMENT_POSITION_DISCONNECTED|t.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|t.DOCUMENT_POSITION_PRECEDING;var o=r.length>i.length?r:i,s=o===r?i:r;if(o[o.length-s.length]===s[0])return o===r?t.DOCUMENT_POSITION_CONTAINED_BY|t.DOCUMENT_POSITION_FOLLOWING:t.DOCUMENT_POSITION_CONTAINS|t.DOCUMENT_POSITION_PRECEDING;for(var u=o.length-s.length,c=s.length-1;c>=0;c--){var l=s[c],h=o[u+c];if(h!==l){var d=l.parentNode.childNodes;return d.indexOf(l)<d.indexOf(h)?s===r?t.DOCUMENT_POSITION_PRECEDING:t.DOCUMENT_POSITION_FOLLOWING:o===r?t.DOCUMENT_POSITION_PRECEDING:t.DOCUMENT_POSITION_FOLLOWING}}return t.DOCUMENT_POSITION_FOLLOWING}},{key:"contain",value:function(A){return this.contains(A)}},{key:"contains",value:function(A){for(var t=A;t&&this!==t;)t=t.parentNode;return!!t}},{key:"getAncestor",value:function(A){for(var t=this;A>0&&t;)t=t.parentNode,A--;return t}},{key:"forEach",value:function(A){for(var t=[this];t.length>0;){var e=t.pop();if(!1===A(e))break;for(var n=e.childNodes.length-1;n>=0;n--)t.push(e.childNodes[n])}}}],[{key:"isNode",value:function(A){return!!A.childNodes}}])}($a);Ao.DOCUMENT_POSITION_DISCONNECTED=1,Ao.DOCUMENT_POSITION_PRECEDING=2,Ao.DOCUMENT_POSITION_FOLLOWING=4,Ao.DOCUMENT_POSITION_CONTAINS=8,Ao.DOCUMENT_POSITION_CONTAINED_BY=16,Ao.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var to=function(){return s(function A(t,e){var n=this;a(this,A),this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=F(),this.tmpVec3=nA(),this.onPointerDown=function(A){var t=n.createPointerEvent(A);if(n.dispatchEvent(t,"pointerdown"),"touch"===t.pointerType)n.dispatchEvent(t,"touchstart");else if("mouse"===t.pointerType||"pen"===t.pointerType){n.dispatchEvent(t,2===t.button?"rightdown":"mousedown")}n.trackingData(A.pointerId).pressTargetsByButton[A.button]=t.composedPath(),n.freeEvent(t)},this.onPointerUp=function(A){var t=aa.now(),e=n.createPointerEvent(A,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);if(n.dispatchEvent(e,"pointerup"),"touch"===e.pointerType)n.dispatchEvent(e,"touchend");else if("mouse"===e.pointerType||"pen"===e.pointerType){n.dispatchEvent(e,2===e.button?"rightup":"mouseup")}var r=n.trackingData(A.pointerId),i=n.findMountedTarget(r.pressTargetsByButton[A.button]),a=i;if(i&&!e.composedPath().includes(i)){for(var o=i;o&&!e.composedPath().includes(o);){if(e.currentTarget=o,n.notifyTarget(e,"pointerupoutside"),"touch"===e.pointerType)n.notifyTarget(e,"touchendoutside");else if("mouse"===e.pointerType||"pen"===e.pointerType){n.notifyTarget(e,2===e.button?"rightupoutside":"mouseupoutside")}Ao.isNode(o)&&(o=o.parentNode)}delete r.pressTargetsByButton[A.button],a=o}if(a){var s,u=n.clonePointerEvent(e,"click");u.target=a,u.path=[],r.clicksByButton[A.button]||(r.clicksByButton[A.button]={clickCount:0,target:u.target,timeStamp:t});var c=r.clicksByButton[A.button];c.target===u.target&&t-c.timeStamp<n.context.renderingContext.root.ownerDocument.defaultView.getConfig().dblClickSpeed?++c.clickCount:c.clickCount=1,c.target=u.target,c.timeStamp=t,u.detail=c.clickCount,null!==(s=e.detail)&&void 0!==s&&s.preventClick||(n.context.config.useNativeClickEvent||"mouse"!==u.pointerType&&"touch"!==u.pointerType||n.dispatchEvent(u,"click"),n.dispatchEvent(u,"pointertap")),n.freeEvent(u)}n.freeEvent(e)},this.onPointerMove=function(A){var t=n.createPointerEvent(A,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0),e="mouse"===t.pointerType||"pen"===t.pointerType,r=n.trackingData(A.pointerId),i=n.findMountedTarget(r.overTargets);if(r.overTargets&&i!==t.target){var a=n.createPointerEvent(A,"mousemove"===A.type?"mouseout":"pointerout",i||void 0);if(n.dispatchEvent(a,"pointerout"),e&&n.dispatchEvent(a,"mouseout"),!t.composedPath().includes(i)){var o=n.createPointerEvent(A,"pointerleave",i||void 0);for(o.eventPhase=o.AT_TARGET;o.target&&!t.composedPath().includes(o.target);)o.currentTarget=o.target,n.notifyTarget(o),e&&n.notifyTarget(o,"mouseleave"),Ao.isNode(o.target)&&(o.target=o.target.parentNode);n.freeEvent(o)}n.freeEvent(a)}if(i!==t.target){var s=n.clonePointerEvent(t,"mousemove"===A.type?"mouseover":"pointerover");n.dispatchEvent(s,"pointerover"),e&&n.dispatchEvent(s,"mouseover");for(var u=i&&Ao.isNode(i)&&i.parentNode;u&&u!==(Ao.isNode(n.rootTarget)&&n.rootTarget.parentNode)&&u!==t.target;)u=u.parentNode;if(!u||u===(Ao.isNode(n.rootTarget)&&n.rootTarget.parentNode)){var c=n.clonePointerEvent(t,"pointerenter");for(c.eventPhase=c.AT_TARGET;c.target&&c.target!==i&&c.target!==(Ao.isNode(n.rootTarget)&&n.rootTarget.parentNode);)c.currentTarget=c.target,n.notifyTarget(c),e&&n.notifyTarget(c,"mouseenter"),Ao.isNode(c.target)&&(c.target=c.target.parentNode);n.freeEvent(c)}n.freeEvent(s)}n.dispatchEvent(t,"pointermove"),"touch"===t.pointerType&&n.dispatchEvent(t,"touchmove"),e&&(n.dispatchEvent(t,"mousemove"),n.cursor=n.getCursor(t.target)),r.overTargets=t.composedPath(),n.freeEvent(t)},this.onPointerOut=function(A){var t=n.trackingData(A.pointerId);if(t.overTargets){var e="mouse"===A.pointerType||"pen"===A.pointerType,r=n.findMountedTarget(t.overTargets),i=n.createPointerEvent(A,"pointerout",r||void 0);n.dispatchEvent(i),e&&n.dispatchEvent(i,"mouseout");var a=n.createPointerEvent(A,"pointerleave",r||void 0);for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(Ao.isNode(n.rootTarget)&&n.rootTarget.parentNode);)a.currentTarget=a.target,n.notifyTarget(a),e&&n.notifyTarget(a,"mouseleave"),Ao.isNode(a.target)&&(a.target=a.target.parentNode);t.overTargets=null,n.freeEvent(i),n.freeEvent(a)}n.cursor=null},this.onPointerOver=function(A){var t=n.trackingData(A.pointerId),e=n.createPointerEvent(A),r="mouse"===e.pointerType||"pen"===e.pointerType;n.dispatchEvent(e,"pointerover"),r&&n.dispatchEvent(e,"mouseover"),"mouse"===e.pointerType&&(n.cursor=n.getCursor(e.target));var i=n.clonePointerEvent(e,"pointerenter");for(i.eventPhase=i.AT_TARGET;i.target&&i.target!==(Ao.isNode(n.rootTarget)&&n.rootTarget.parentNode);)i.currentTarget=i.target,n.notifyTarget(i),r&&n.notifyTarget(i,"mouseenter"),Ao.isNode(i.target)&&(i.target=i.target.parentNode);t.overTargets=e.composedPath(),n.freeEvent(e),n.freeEvent(i)},this.onPointerUpOutside=function(A){var t=n.trackingData(A.pointerId),e=n.findMountedTarget(t.pressTargetsByButton[A.button]),r=n.createPointerEvent(A);if(e){for(var i=e;i;)r.currentTarget=i,n.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType||"mouse"!==r.pointerType&&"pen"!==r.pointerType||n.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside"),Ao.isNode(i)&&(i=i.parentNode);delete t.pressTargetsByButton[A.button]}n.freeEvent(r)},this.onWheel=function(A){var t=n.createWheelEvent(A);n.dispatchEvent(t),n.freeEvent(t)},this.onClick=function(A){if(n.context.config.useNativeClickEvent){var t=n.createPointerEvent(A);n.dispatchEvent(t),n.freeEvent(t)}},this.onPointerCancel=function(A){var t=n.createPointerEvent(A,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);n.dispatchEvent(t),n.freeEvent(t)},this.globalRuntime=t,this.context=e},[{key:"init",value:function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)}},{key:"destroy",value:function(){this.mappingTable={},this.mappingState={},this.eventPool.clear()}},{key:"getScale",value:function(){var A=this.context.contextService.getBoundingClientRect(),t=1,e=1,n=this.context.contextService.getDomElement();if(n&&A){var r=n.offsetWidth,i=n.offsetHeight;r&&i&&(t=A.width/r,e=A.height/i)}return{scaleX:t,scaleY:e,bbox:A}}},{key:"client2Viewport",value:function(A){var t=this.getScale(),e=t.bbox;return new Ue((A.x-((null==e?void 0:e.left)||0))/t.scaleX,(A.y-((null==e?void 0:e.top)||0))/t.scaleY)}},{key:"viewport2Client",value:function(A){var t=this.getScale(),e=t.bbox;return new Ue((A.x+((null==e?void 0:e.left)||0))*t.scaleX,(A.y+((null==e?void 0:e.top)||0))*t.scaleY)}},{key:"viewport2Canvas",value:function(A){var t=A.x,e=A.y,n=this.rootTarget.defaultView.getCamera(),r=this.context.config,i=r.width,a=r.height,o=n.getPerspectiveInverse(),s=n.getWorldTransform(),u=T(this.tmpMatrix,s,o),c=sA(this.tmpVec3,t/i*2-1,2*(1-e/a)-1,0);return gA(c,c,u),new Ue(c[0],c[1])}},{key:"canvas2Viewport",value:function(A){var t=this.rootTarget.defaultView.getCamera(),e=t.getPerspective(),n=t.getViewTransform(),r=T(this.tmpMatrix,e,n),i=sA(this.tmpVec3,A.x,A.y,0);gA(this.tmpVec3,this.tmpVec3,r);var a=this.context.config;return new Ue((i[0]+1)/2*a.width,(1-(i[1]+1)/2)*a.height)}},{key:"setPickHandler",value:function(A){this.pickHandler=A}},{key:"addEventMapping",value:function(A,t){this.mappingTable[A]||(this.mappingTable[A]=[]),this.mappingTable[A].push({fn:t,priority:0}),this.mappingTable[A].sort(function(A,t){return A.priority-t.priority})}},{key:"mapEvent",value:function(A){if(this.rootTarget){var t=this.mappingTable[A.type];if(t)for(var e=0,n=t.length;n>e;e++)t[e].fn(A);else console.warn("[EventService]: Event mapping not defined for ".concat(A.type))}}},{key:"dispatchEvent",value:function(A,t,e){e?(A.eventPhase=A.AT_TARGET,A.currentTarget=this.rootTarget.defaultView||null,this.notifyListeners(A,t)):(A.propagationStopped=!1,A.propagationImmediatelyStopped=!1,this.propagate(A,t))}},{key:"propagate",value:function(A,t){if(A.target){var e=A.composedPath();A.eventPhase=A.CAPTURING_PHASE;for(var n=e.length-1;n>=1;n--)if(A.currentTarget=e[n],this.notifyTarget(A,t),A.propagationStopped||A.propagationImmediatelyStopped)return;if(A.eventPhase=A.AT_TARGET,A.currentTarget=A.target,this.notifyTarget(A,t),!A.propagationStopped&&!A.propagationImmediatelyStopped){var r=e.indexOf(A.currentTarget);A.eventPhase=A.BUBBLING_PHASE;for(var i=r+1;e.length>i;i++)if(A.currentTarget=e[i],this.notifyTarget(A,t),A.propagationStopped||A.propagationImmediatelyStopped)return}}}},{key:"propagationPath",value:function(A){var t=[A],e=this.rootTarget.defaultView||null;if(e&&e===A)return t.unshift(e.document),t;for(var n=0;2048>n&&A!==this.rootTarget;n++)Ao.isNode(A)&&A.parentNode&&(t.push(A.parentNode),A=A.parentNode);return e&&t.push(e),t}},{key:"hitTest",value:function(A){var t=A.viewportX,e=A.viewportY,n=this.context.config;return 0>t||0>e||t>n.width||e>n.height?null:!n.disableHitTesting&&this.pickHandler(A)||this.rootTarget||null}},{key:"isNativeEventFromCanvas",value:function(A,t){var e,n=null==t?void 0:t.target;if(null!==(e=n)&&void 0!==e&&e.shadowRoot&&(n=t.composedPath()[0]),n){if(n===A)return!0;if(A&&A.contains)return A.contains(n)}return!(null==t||!t.composedPath)&&t.composedPath().indexOf(A)>-1}},{key:"getExistedHTML",value:function(A){if(A.nativeEvent.composedPath)for(var t=0,e=A.nativeEvent.composedPath();e.length>t;t++){var n=this.nativeHTMLMap.get(e[t]);if(n)return n}return null}},{key:"pickTarget",value:function(A){return this.hitTest({clientX:A.clientX,clientY:A.clientY,viewportX:A.viewportX,viewportY:A.viewportY,x:A.canvasX,y:A.canvasY})}},{key:"createPointerEvent",value:function(A,t,e,n){var r=this.allocateEvent(za);this.copyPointerData(A,r),this.copyMouseData(A,r),this.copyData(A,r),r.nativeEvent=A.nativeEvent,r.originalEvent=A;var i=this.getExistedHTML(r),a=this.context.contextService.getDomElement();return r.target=null!=e?e:i||this.isNativeEventFromCanvas(a,r.nativeEvent)&&this.pickTarget(r)||n,"string"==typeof t&&(r.type=t),r}},{key:"createWheelEvent",value:function(A){var t=this.allocateEvent(ja);this.copyWheelData(A,t),this.copyMouseData(A,t),this.copyData(A,t),t.nativeEvent=A.nativeEvent,t.originalEvent=A;var e=this.getExistedHTML(t),n=this.context.contextService.getDomElement();return t.target=e||this.isNativeEventFromCanvas(n,t.nativeEvent)&&this.pickTarget(t),t}},{key:"trackingData",value:function(A){return this.mappingState.trackingData[A]||(this.mappingState.trackingData[A]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[A]}},{key:"cloneWheelEvent",value:function(A){var t=this.allocateEvent(ja);return t.nativeEvent=A.nativeEvent,t.originalEvent=A.originalEvent,this.copyWheelData(A,t),this.copyMouseData(A,t),this.copyData(A,t),t.target=A.target,t.path=A.composedPath().slice(),t.type=A.type,t}},{key:"clonePointerEvent",value:function(A,t){var e=this.allocateEvent(za);return e.nativeEvent=A.nativeEvent,e.originalEvent=A.originalEvent,this.copyPointerData(A,e),this.copyMouseData(A,e),this.copyData(A,e),e.target=A.target,e.path=A.composedPath().slice(),e.type=null!=t?t:e.type,e}},{key:"copyPointerData",value:function(A,t){t.pointerId=A.pointerId,t.width=A.width,t.height=A.height,t.isPrimary=A.isPrimary,t.pointerType=A.pointerType,t.pressure=A.pressure,t.tangentialPressure=A.tangentialPressure,t.tiltX=A.tiltX,t.tiltY=A.tiltY,t.twist=A.twist}},{key:"copyMouseData",value:function(A,t){t.altKey=A.altKey,t.button=A.button,t.buttons=A.buttons,t.ctrlKey=A.ctrlKey,t.metaKey=A.metaKey,t.shiftKey=A.shiftKey,t.client.copyFrom(A.client),t.movement.copyFrom(A.movement),t.canvas.copyFrom(A.canvas),t.screen.copyFrom(A.screen),t.global.copyFrom(A.global),t.offset.copyFrom(A.offset)}},{key:"copyWheelData",value:function(A,t){t.deltaMode=A.deltaMode,t.deltaX=A.deltaX,t.deltaY=A.deltaY,t.deltaZ=A.deltaZ}},{key:"copyData",value:function(A,t){t.isTrusted=A.isTrusted,t.timeStamp=aa.now(),t.type=A.type,t.detail=A.detail,t.view=A.view,t.page.copyFrom(A.page),t.viewport.copyFrom(A.viewport)}},{key:"allocateEvent",value:function(A){this.eventPool.has(A)||this.eventPool.set(A,[]);var t=this.eventPool.get(A).pop()||new A(this);return t.eventPhase=t.NONE,t.currentTarget=null,t.path=[],t.target=null,t}},{key:"freeEvent",value:function(A){if(A.manager!==this)throw Error("It is illegal to free an event not managed by this EventBoundary!");var t=A.constructor;this.eventPool.has(t)||this.eventPool.set(t,[]),this.eventPool.get(t).push(A)}},{key:"notifyTarget",value:function(A,t){t=null!=t?t:A.type,this.notifyListeners(A,A.eventPhase===A.CAPTURING_PHASE||A.eventPhase===A.AT_TARGET?"".concat(t,"capture"):t),A.eventPhase===A.AT_TARGET&&this.notifyListeners(A,t)}},{key:"notifyListeners",value:function(A,t){var e=A.currentTarget.emitter,n=e._events[t];if(n)if("fn"in n)n.once&&e.removeListener(t,n.fn,void 0,!0),n.fn.call(A.currentTarget||n.context,A);else for(var r=0;n.length>r&&!A.propagationImmediatelyStopped;r++)n[r].once&&e.removeListener(t,n[r].fn,void 0,!0),n[r].fn.call(A.currentTarget||n[r].context,A)}},{key:"findMountedTarget",value:function(A){if(!A)return null;for(var t=A[A.length-1],e=A.length-2;e>=0;e--){var n=A[e];if(!(n===this.rootTarget||Ao.isNode(n)&&n.parentNode===t))break;t=A[e]}return t}},{key:"getCursor",value:function(A){for(var t=A;t;){var e=ta(t)&&t.getAttribute("cursor");if(e)return e;t=Ao.isNode(t)&&t.parentNode}}}])}(),eo=function(){return s(function A(){a(this,A)},[{key:"getOrCreateCanvas",value:function(A,t){if(this.canvas)return this.canvas;if(A||No.offscreenCanvas)this.canvas=A||No.offscreenCanvas,this.context=this.canvas.getContext("2d",i({willReadFrequently:!0},t));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",i({willReadFrequently:!0},t)),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(A){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",i({willReadFrequently:!0},t))}return this.canvas.width=10,this.canvas.height=10,this.canvas}},{key:"getOrCreateContext",value:function(A,t){return this.context||this.getOrCreateCanvas(A,t),this.context}}],[{key:"createCanvas",value:function(){try{return new window.OffscreenCanvas(0,0)}catch(A){}try{return document.createElement("canvas")}catch(A){}return null}}])}(),no=function(A){return A[A.CAMERA_CHANGED=0]="CAMERA_CHANGED",A[A.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",A[A.NONE=2]="NONE",A}({}),ro=function(){return s(function A(t,e){a(this,A),this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new ma,initAsync:new wa,dirtycheck:new Ca,cull:new Ca,beginFrame:new ma,beforeRender:new ma,render:new ma,afterRender:new ma,endFrame:new ma,destroy:new ma,pick:new ya,pickSync:new Ca,pointerDown:new ma,pointerUp:new ma,pointerMove:new ma,pointerOut:new ma,pointerOver:new ma,pointerWheel:new ma,pointerCancel:new ma,click:new ma},this.globalRuntime=t,this.context=e},[{key:"init",value:function(A){var t=this,e=i(i({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach(function(A){A.apply(e,t.globalRuntime)}),this.hooks.init.call(),0===this.hooks.initAsync.getCallbacksNum()?(this.inited=!0,A()):this.hooks.initAsync.promise().then(function(){t.inited=!0,A()}).catch(function(A){})}},{key:"getStats",value:function(){return this.stats}},{key:"disableDirtyRectangleRendering",value:function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(no.CAMERA_CHANGED)}},{key:"render",value:function(A,t,e){var n=this,r=A.getConfig(),i=this.context.renderingContext;if(this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0,this.globalRuntime.sceneGraphService.syncHierarchy(i.root),this.globalRuntime.sceneGraphService.notifyMutationObservers(A),i.renderReasons.size&&this.inited){i.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var a=1===i.renderReasons.size&&i.renderReasons.has(no.CAMERA_CHANGED),o=!r.disableRenderHooks||!a;o&&this.renderDisplayObject(i.root,r,i),this.hooks.beginFrame.call(t),o&&i.renderListCurrentFrame.forEach(function(A){n.hooks.beforeRender.call(A),n.hooks.render.call(A),n.hooks.afterRender.call(A)}),this.hooks.endFrame.call(t),i.renderListCurrentFrame=[],i.renderReasons.clear(),e()}}},{key:"renderDisplayObject",value:function(A,t,e){var n=this,r=t.renderer.getConfig(),i=r.enableDirtyCheck,a=r.enableCulling;function o(A){var t=A.sortable,r=i?A.renderable.dirty||e.dirtyRectangleRenderingDisabled?A:null:A,o=null;r&&(o=a?n.hooks.cull.call(r,n.context.camera):r)&&(n.stats.rendered+=1,e.renderListCurrentFrame.push(o)),A.dirty(!1),t.renderOrder=n.zIndexCounter,n.zIndexCounter+=1,n.stats.total+=1,t.dirty&&(n.sort(A,t),t.dirty=!1,t.dirtyChildren=[],t.dirtyReason=void 0)}for(var s=[A];s.length>0;){var u,c=s.pop();o(c);for(var l=(null===(u=c.sortable)||void 0===u||null===(u=u.sorted)||void 0===u?void 0:u.length)>0?c.sortable.sorted:c.childNodes,h=l.length-1;h>=0;h--)s.push(l[h])}}},{key:"sort",value:function(A,t){var e,n;(null==t||null===(e=t.sorted)||void 0===e?void 0:e.length)>0&&t.dirtyReason!==An.Z_INDEX_CHANGED?t.dirtyChildren.forEach(function(e){var n=t.sorted.indexOf(e);if(n>-1&&t.sorted.splice(n,1),A.childNodes.indexOf(e)>-1)if(0===t.sorted.length)t.sorted.push(e);else{var r=function(A,t){for(var e=0,n=A.length;n>e;){var r=e+n>>>1;0>ea(A[r],t)?e=r+1:n=r}return e}(t.sorted,e);t.sorted.splice(r,0,e)}}):t.sorted=A.childNodes.slice().sort(ea),(null===(n=t.sorted)||void 0===n?void 0:n.length)>0&&0===A.childNodes.filter(function(A){return A.parsedStyle.zIndex}).length&&(t.sorted=[])}},{key:"destroy",value:function(){this.inited=!1,this.hooks.destroy.call()}},{key:"dirty",value:function(){this.context.renderingContext.renderReasons.add(no.DISPLAY_OBJECT_CHANGED)}}])}(),io=/\[\s*(.*)=(.*)\s*\]/,ao=function(){return s(function A(){a(this,A)},[{key:"selectOne",value:function(A,t){var e=this;if(A.startsWith("."))return t.find(function(t){return((null==t?void 0:t.classList)||[]).indexOf(e.getIdOrClassname(A))>-1});if(A.startsWith("#"))return t.find(function(t){return t.id===e.getIdOrClassname(A)});if(A.startsWith("[")){var n=this.getAttribute(A),r=n.name,i=n.value;return r?t.find(function(A){return t!==A&&("name"===r?A.name===i:e.attributeToString(A,r)===i)}):null}return t.find(function(e){return t!==e&&e.nodeName===A})}},{key:"selectAll",value:function(A,t){var e=this;if(A.startsWith("."))return t.findAll(function(n){return t!==n&&((null==n?void 0:n.classList)||[]).indexOf(e.getIdOrClassname(A))>-1});if(A.startsWith("#"))return t.findAll(function(n){return t!==n&&n.id===e.getIdOrClassname(A)});if(A.startsWith("[")){var n=this.getAttribute(A),r=n.name,i=n.value;return r?t.findAll(function(A){return t!==A&&("name"===r?A.name===i:e.attributeToString(A,r)===i)}):[]}return t.findAll(function(e){return t!==e&&e.nodeName===A})}},{key:"is",value:function(A,t){if(A.startsWith("."))return t.className===this.getIdOrClassname(A);if(A.startsWith("#"))return t.id===this.getIdOrClassname(A);if(A.startsWith("[")){var e=this.getAttribute(A),n=e.name,r=e.value;return"name"===n?t.name===r:this.attributeToString(t,n)===r}return t.nodeName===A}},{key:"getIdOrClassname",value:function(A){return A.substring(1)}},{key:"getAttribute",value:function(A){var t=A.match(io),e="",n="";return t&&t.length>2&&(e=t[1].replace(/"/g,""),n=t[2].replace(/"/g,"")),{name:e,value:n}}},{key:"attributeToString",value:function(A,t){if(!A.getAttribute)return"";var e=A.getAttribute(t);return DA(e)?"":e.toString?""+e:""}}])}(),oo=function(A){return A.ATTR_MODIFIED="DOMAttrModified",A.INSERTED="DOMNodeInserted",A.MOUNTED="DOMNodeInsertedIntoDocument",A.REMOVED="removed",A.UNMOUNTED="DOMNodeRemovedFromDocument",A.REPARENT="reparent",A.DESTROY="destroy",A.BOUNDS_CHANGED="bounds-changed",A.CULLED="culled",A}({}),so=function(A){function t(A,e,n,r,i,o,s,u){var c;return a(this,t),(c=B(this,t,[null])).relatedNode=e,c.prevValue=n,c.newValue=r,c.attrName=i,c.attrChange=o,c.prevParsedValue=s,c.newParsedValue=u,c.type=A,c}return p(t,A),s(t)}(Ja);so.ADDITION=2,so.MODIFICATION=1,so.REMOVAL=3;var uo,co,lo,ho=new so(oo.REPARENT,null,"","","",0,"",""),fo=SA(),Bo=nA(),go=aA(1,1,1),po=F(),vo=SA(),wo=nA(),yo=F(),mo=FA(),Co=nA(),Qo=FA(),Fo=nA(),Uo=nA(),Eo=nA(),bo=F(),ko=FA(),xo=FA(),Ho=FA(),Io=function(){return s(function A(t){a(this,A),this.displayObjectDependencyMap=new WeakMap,this.runtime=t},[{key:"matches",value:function(A,t){return this.runtime.sceneGraphSelector.is(A,t)}},{key:"querySelector",value:function(A,t){return this.runtime.sceneGraphSelector.selectOne(A,t)}},{key:"querySelectorAll",value:function(A,t){return this.runtime.sceneGraphSelector.selectAll(A,t)}},{key:"attach",value:function(A,t,e){var n,r=!1;A.parentNode&&(r=A.parentNode!==t,this.detach(A));var i=A.nodeName===le.FRAGMENT,a=oa(t);A.parentNode=t;var o=i?A.childNodes:[A];_A(e)?o.forEach(function(A){t.childNodes.splice(e,0,A),A.parentNode=t}):o.forEach(function(A){t.childNodes.push(A),A.parentNode=t});var s=t.sortable;if((null!=s&&null!==(n=s.sorted)&&void 0!==n&&n.length||s.dirty||A.parsedStyle.zIndex)&&(-1===s.dirtyChildren.indexOf(A)&&s.dirtyChildren.push(A),s.dirty=!0,s.dirtyReason=An.ADDED),!a){if(i)this.dirtyFragment(A);else{var u=A.transformable;u&&this.dirtyWorldTransform(A,u)}if(r){var c,l=!0===(null===(c=t.ownerDocument)||void 0===c||null===(c=c.defaultView)||void 0===c||null===(c=c.getConfig())||void 0===c||null===(c=c.future)||void 0===c?void 0:c.experimentalCancelEventPropagation);A.dispatchEvent(ho,l,l)}}}},{key:"detach",value:function(A){var t,e;if(A.parentNode){var n=A.transformable,r=A.parentNode.sortable;(null!=r&&null!==(t=r.sorted)&&void 0!==t&&t.length||null!==(e=A.style)&&void 0!==e&&e.zIndex)&&(-1===r.dirtyChildren.indexOf(A)&&r.dirtyChildren.push(A),r.dirty=!0,r.dirtyReason=An.REMOVED);var i=A.parentNode.childNodes.indexOf(A);i>-1&&A.parentNode.childNodes.splice(i,1),n&&this.dirtyWorldTransform(A,n),A.parentNode=null}}},{key:"getLocalPosition",value:function(A){return A.transformable.localPosition}},{key:"getLocalRotation",value:function(A){return A.transformable.localRotation}},{key:"getLocalScale",value:function(A){return A.transformable.localScale}},{key:"getLocalSkew",value:function(A){return A.transformable.localSkew}},{key:"getLocalTransform",value:function(A){var t=A.transformable;return rn(t),t.localTransform}},{key:"setLocalPosition",value:function(A,t){var e,n=2>=arguments.length||void 0===arguments[2]||arguments[2],r=A.transformable;Uo[0]=t[0],Uo[1]=t[1],Uo[2]=null!==(e=t[2])&&void 0!==e?e:0,pA(r.localPosition,Uo)||(oA(r.localPosition,Uo),n&&this.dirtyLocalTransform(A,r))}},{key:"translateLocal",value:function(A,t){"number"==typeof t&&(t=aA(t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var e=A.transformable;pA(t,Bo)||(!function(A,t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=t[0],s=t[1],u=t[2],c=r*u-i*s,l=i*o-n*u,h=n*s-r*o;A[0]=o+a*(c+=c)+r*(h+=h)-i*(l+=l),A[1]=s+a*l+i*c-n*h,A[2]=u+a*h+n*l-r*c}(t,t,e.localRotation),uA(e.localPosition,e.localPosition,t),this.dirtyLocalTransform(A,e))}},{key:"setLocalRotation",value:function(A,t,e,n,r){var i=5>=arguments.length||void 0===arguments[5]||arguments[5];"number"==typeof t&&(t=IA(mo,t,e,n,r));var a=A.transformable;HA(a.localRotation,t),i&&this.dirtyLocalTransform(A,a)}},{key:"rotateLocal",value:function(A,t){"number"==typeof t&&(t=aA(t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var e=A.transformable;kA(xo,t[0],t[1],t[2]),TA(e.localRotation,e.localRotation,xo),this.dirtyLocalTransform(A,e)}},{key:"setLocalScale",value:function(A,t){var e,n=2>=arguments.length||void 0===arguments[2]||arguments[2],r=A.transformable;sA(wo,t[0],t[1],null!==(e=t[2])&&void 0!==e?e:r.localScale[2]),pA(wo,r.localScale)||(oA(r.localScale,wo),n&&this.dirtyLocalTransform(A,r))}},{key:"scaleLocal",value:function(A,t){var e,n=A.transformable;!function(A,t,e){A[0]=t[0]*e[0],A[1]=t[1]*e[1],A[2]=t[2]*e[2]}(n.localScale,n.localScale,sA(wo,t[0],t[1],null!==(e=t[2])&&void 0!==e?e:1)),this.dirtyLocalTransform(A,n)}},{key:"setLocalSkew",value:function(A,t,e){var n=3>=arguments.length||void 0===arguments[3]||arguments[3];"number"==typeof t&&(t=function(A,t,e){return A[0]=t,A[1]=e,A}(vo,t,e));var r=A.transformable;!function(A,t){A[0]=t[0],A[1]=t[1]}(r.localSkew,t),n&&this.dirtyLocalTransform(A,r)}},{key:"setLocalEulerAngles",value:function(A,t){var e=4>=arguments.length||void 0===arguments[4]||arguments[4];"number"==typeof t&&(t=aA(t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=A.transformable;kA(n.localRotation,t[0],t[1],t[2]),e&&this.dirtyLocalTransform(A,n)}},{key:"setLocalTransform",value:function(A,t){var e=_(Co,t),n=Y(Qo,t),r=X(Fo,t);this.setLocalScale(A,r,!1),this.setLocalPosition(A,e,!1),this.setLocalRotation(A,n,void 0,void 0,void 0,!1),this.dirtyLocalTransform(A,A.transformable)}},{key:"resetLocalTransform",value:function(A){this.setLocalScale(A,go,!1),this.setLocalPosition(A,Bo,!1),this.setLocalEulerAngles(A,Bo,void 0,void 0,!1),this.setLocalSkew(A,fo,void 0,!1),this.dirtyLocalTransform(A,A.transformable)}},{key:"getPosition",value:function(A){var t=A.transformable;return _(t.position,this.getWorldTransform(A,t))}},{key:"getRotation",value:function(A){var t=A.transformable;return Y(t.rotation,this.getWorldTransform(A,t))}},{key:"getScale",value:function(A){var t=A.transformable;return X(t.scaling,this.getWorldTransform(A,t))}},{key:"getOrigin",value:function(A){return A.getGeometryBounds(),A.transformable.origin}},{key:"getWorldTransform",value:function(A){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:A.transformable;return t.localDirtyFlag||t.dirtyFlag?(A.parentNode&&A.parentNode.transformable&&this.getWorldTransform(A.parentNode),this.internalUpdateTransform(A),t.worldTransform):t.worldTransform}},{key:"setPosition",value:function(A,t){var e,n=A.transformable;if(Eo[0]=t[0],Eo[1]=t[1],Eo[2]=null!==(e=t[2])&&void 0!==e?e:0,!pA(this.getPosition(A),Eo)){if(oA(n.position,Eo),null!==A.parentNode&&A.parentNode.transformable)E(bo,A.parentNode.transformable.worldTransform),H(bo,bo),gA(n.localPosition,Eo,bo);else oA(n.localPosition,Eo);this.dirtyLocalTransform(A,n)}}},{key:"translate",value:function(A,t){"number"==typeof t&&(t=sA(wo,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)),pA(t,Bo)||(uA(wo,this.getPosition(A),t),this.setPosition(A,wo))}},{key:"setRotation",value:function(A,t,e,n,r){var i=A.transformable;if("number"==typeof t&&(t=xA(t,e,n,r)),null!==A.parentNode&&A.parentNode.transformable){var a=this.getRotation(A.parentNode);HA(mo,a),bA(mo,mo),EA(i.localRotation,mo,t),MA(i.localRotation,i.localRotation),this.dirtyLocalTransform(A,i)}else this.setLocalRotation(A,t)}},{key:"rotate",value:function(A,t){"number"==typeof t&&(t=aA(t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var e=A.transformable;if(null!==A.parentNode&&A.parentNode.transformable){var n=mo;kA(n,t[0],t[1],t[2]);var r=this.getRotation(A),i=this.getRotation(A.parentNode);HA(Ho,i),bA(Ho,Ho),EA(n,Ho,n),EA(e.localRotation,n,r),MA(e.localRotation,e.localRotation),this.dirtyLocalTransform(A,e)}else this.rotateLocal(A,t)}},{key:"setOrigin",value:function(A,t){"number"==typeof t&&(t=[t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0]);var e=A.transformable;if(t[0]!==e.origin[0]||t[1]!==e.origin[1]||t[2]!==e.origin[2]){var n=e.origin;n[0]=t[0],n[1]=t[1],n[2]=t[2]||0,this.dirtyLocalTransform(A,e)}}},{key:"setEulerAngles",value:function(A,t){"number"==typeof t&&(t=aA(t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var e=A.transformable;if(null!==A.parentNode&&A.parentNode.transformable){kA(e.localRotation,t[0],t[1],t[2]);var n=this.getRotation(A.parentNode);HA(ko,bA(mo,n)),TA(e.localRotation,e.localRotation,ko),this.dirtyLocalTransform(A,e)}else this.setLocalEulerAngles(A,t)}},{key:"getGeometryBounds",value:function(A){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],e=A.geometry;return e.dirty&&No.styleValueRegistry.updateGeometry(A),(t?e.renderBounds:e.contentBounds||null)||new me}},{key:"getTransformedGeometryBounds",value:function(A){var t=arguments.length>2?arguments[2]:void 0,e=this.getGeometryBounds(A,arguments.length>1&&void 0!==arguments[1]&&arguments[1]);if(!me.isEmpty(e)){var n=t||new me;return n.setFromTransformedAABB(e,this.getWorldTransform(A)),n}return null}},{key:"getBounds",value:function(A){var t=this,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=A.renderable;if(!n.boundsDirty&&!e&&n.bounds)return n.bounds;if(!n.renderBoundsDirty&&e&&n.renderBounds)return n.renderBounds;var r=e?n.renderBounds:n.bounds,i=this.getTransformedGeometryBounds(A,e,r);if(A.childNodes.forEach(function(A){var n=t.getBounds(A,e);n&&(i?i.add(n):(i=r||new me).update(n.center,n.halfExtents))}),i||(i=new me),e){var a=na(A);if(a){var o=a.parsedStyle.clipPath.getBounds(e);i?o&&(i=o.intersection(i)):i.update(o.center,o.halfExtents)}}return e?(n.renderBounds=i,n.renderBoundsDirty=!1):(n.bounds=i,n.boundsDirty=!1),i}},{key:"getLocalBounds",value:function(A){if(A.parentNode){var t=po;A.parentNode.transformable&&(t=H(yo,this.getWorldTransform(A.parentNode)));var e=this.getBounds(A);if(!me.isEmpty(e)){var n=new me;return n.setFromTransformedAABB(e,t),n}}return this.getBounds(A)}},{key:"getBoundingClientRect",value:function(A){var t,e,n=this.getGeometryBounds(A);me.isEmpty(n)||(e=new me).setFromTransformedAABB(n,this.getWorldTransform(A));var r=null===(t=A.ownerDocument)||void 0===t||null===(t=t.defaultView)||void 0===t?void 0:t.getContextService().getBoundingClientRect();if(e){var i=v(e.getMin(),2),a=i[0],o=i[1],s=v(e.getMax(),2);return new Ee(a+((null==r?void 0:r.left)||0),o+((null==r?void 0:r.top)||0),s[0]-a,s[1]-o)}return new Ee((null==r?void 0:r.left)||0,(null==r?void 0:r.top)||0,0,0)}},{key:"internalUpdateTransform",value:function(A){var t,e=null===(t=A.parentNode)||void 0===t?void 0:t.transformable;rn(A.transformable),an(A.transformable,e)}},{key:"internalUpdateElement",value:function(A,t){var e,n,r,i,a,o,s=!0===(null===(e=A.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e||null===(e=e.getConfig())||void 0===e||null===(e=e.future)||void 0===e?void 0:e.experimentalAttributeUpdateOptimization),u=t[t.length-1],c=(null==u?void 0:u.transformDirty)||(null===(n=A.transformable)||void 0===n?void 0:n.localDirtyFlag);A.transformable&&((a=A.transformable).dirtyFlag||(a.dirtyFlag=c));(this.internalUpdateTransform(A),c)&&(null===(o=A.dirty)||void 0===o||o.call(A,!0,!0));var l=(null===(r=A.renderable)||void 0===r?void 0:r.boundsDirty)||(null===(i=A.renderable)||void 0===i?void 0:i.renderBoundsDirty);if((c||l)&&!1===(null==u?void 0:u.shapeUpdated)&&s)for(var h=t.length-1;h>=0;){var d,f,B=t[h];if(B.shapeUpdated)break;null===(d=(f=B.node).dirty)||void 0===d||d.call(f,!0,!0),B.shapeUpdated=!0,h-=1}return c}},{key:"syncHierarchy",value:function(A){for(var t,e,n=[A],r=A.parentNode?[{node:A.parentNode,transformDirty:(null===(t=A.parentNode.transformable)||void 0===t?void 0:t.localDirtyFlag)||(null===(e=A.parentNode.transformable)||void 0===e?void 0:e.dirtyFlag),shapeUpdated:!1}]:[];n.length>0;){for(var i=n.pop(),a=r[r.length-1];r.length>0&&i.parentNode!==a.node;)a=r.pop();var o=this.internalUpdateElement(i,r);if(i.childNodes.length>0){for(var s=i.childNodes.length-1;s>=0;s--)n.push(i.childNodes[s]);r.push({node:i,transformDirty:o,shapeUpdated:!1})}}}},{key:"dirtyLocalTransform",value:function(A,t){oa(A)||t.localDirtyFlag||(t.localDirtyFlag=!0,t.dirtyFlag||this.dirtyWorldTransform(A,t))}},{key:"dirtyWorldTransform",value:function(A,t){this.dirtyWorldInternal(A,t),this.dirtyToRoot(A,!0)}},{key:"dirtyWorldInternal",value:function(A,t){var e,n=this,r=!0===(null===(e=A.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e||null===(e=e.getConfig())||void 0===e||null===(e=e.future)||void 0===e?void 0:e.experimentalAttributeUpdateOptimization);t.dirtyFlag||(t.dirtyFlag=!0,A.dirty(!0,!0),r||A.childNodes.forEach(function(A){n.dirtyWorldInternal(A,A.transformable)}))}},{key:"dirtyToRoot",value:function(A){for(var t,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=A,r=!0===(null===(t=A.ownerDocument)||void 0===t||null===(t=t.defaultView)||void 0===t||null===(t=t.getConfig())||void 0===t||null===(t=t.future)||void 0===t?void 0:t.experimentalAttributeUpdateOptimization);n;){var i,a;if(null===(i=(a=n).dirty)||void 0===i||i.call(a,!0,!0),r)break;n=n.parentNode}e&&A.forEach(function(A){var t;null===(t=A.dirty)||void 0===t||t.call(A,!0,!0)}),this.informDependentDisplayObjects(A);var o=A.mutations||[],s=o.find(function(A){return"attributes"===A.type&&A._boundsChangeData});s?s._boundsChangeData={affectChildren:s._boundsChangeData.affectChildren||e}:o.push(s={type:"attributes",target:A,_boundsChangeData:{affectChildren:e}}),A.mutations=o}},{key:"dirtyFragment",value:function(A){var t,e,n=A.transformable;n&&(n.dirtyFlag=!0,n.localDirtyFlag=!0),null===(t=(e=A).dirty)||void 0===t||t.call(e,!0,!0);for(var r=A.childNodes.length,i=0;r>i;i++)this.dirtyFragment(A.childNodes[i])}},{key:"notifyMutationObservers",value:function(A){var t=new Set;if(A.getRoot().forEach(function(A){(A.mutations||[]).forEach(function(e){"attributes"===e.type&&e._boundsChangeData&&(e._boundsChangeData.affectChildren?A.forEach(function(A){var n=i({},e);n.target=A,t.add(n)}):t.add(e))}),A.mutations=void 0}),t.size>0){var e=new qa(oo.BOUNDS_CHANGED,{detail:Array.from(t)});A.dispatchEvent(e,!0,!0)}}},{key:"updateDisplayObjectDependency",value:function(A,t,e,n){if(t&&t!==e){var r=this.displayObjectDependencyMap.get(t);if(r&&r[A]){var i=r[A].indexOf(n);r[A].splice(i,1)}}if(e){var a=this.displayObjectDependencyMap.get(e);a||(this.displayObjectDependencyMap.set(e,{}),a=this.displayObjectDependencyMap.get(e)),a[A]||(a[A]=[]),a[A].push(n)}}},{key:"informDependentDisplayObjects",value:function(A){var t,e=this,n=this.displayObjectDependencyMap.get(A);if(n){var r=null===(t=A.ownerDocument)||void 0===t||null===(t=t.defaultView)||void 0===t||null===(t=t.getConfig())||void 0===t||null===(t=t.future)||void 0===t?void 0:t.experimentalCancelEventPropagation;Object.keys(n).forEach(function(A){n[A].forEach(function(t){e.dirtyToRoot(t,!0),t.dispatchEvent(new so(oo.ATTR_MODIFIED,t,e,e,A,so.MODIFICATION,e,e),r,r),t.isCustomElement&&t.isConnected&&t.attributeChangedCallback&&t.attributeChangedCallback(A,e,e)})})}}}])}(),To=function(){return s(function A(t){if(a(this,A),0>=t)throw Error("LRU capacity must be a positive number.");this.capacity=t,this.cache=new Map},[{key:"get",value:function(A){if(this.cache.has(A)){var t=this.cache.get(A);return this.cache.delete(A),this.cache.set(A,t),t}}},{key:"put",value:function(A,t){if(this.cache.has(A)&&this.cache.delete(A),this.cache.set(A,t),this.cache.size>this.capacity){var e=this.cache.keys().next().value;this.cache.delete(e)}}},{key:"len",value:function(){return this.cache.size}},{key:"clear",value:function(){this.cache.clear()}}])}(),Mo={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]},So=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,Lo=RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),Do=RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),Po=function(){return s(function A(t){var e=this;a(this,A),this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(A,t){return!e.isBreakingSpace(t)&&!(!A||!Do.exec(t)&&!Lo.exec(A))},this.trimByKinsokuShorui=function(A){var t=l(A),e=t[t.length-2];if(!e)return A;var n=e[e.length-1];return t[t.length-2]=e.slice(0,-1),t[t.length-1]=n+t[t.length-1],t},this.runtime=t,this.charWidthCache=new To(100)},[{key:"measureFont",value:function(A,t){if(this.fontMetricsCache[A])return this.fontMetricsCache[A];var e={ascent:0,descent:0,fontSize:0},n=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(t),r=this.runtime.offscreenCanvasCreator.getOrCreateContext(t,{willReadFrequently:!0});r.font=A;var i=Mo.MetricsString+Mo.BaselineSymbol,a=Math.ceil(r.measureText(i).width),o=Math.ceil(r.measureText(Mo.BaselineSymbol).width),s=Mo.HeightMultiplier*o;o=o*Mo.BaselineMultiplier|0,n.width=a,n.height=s,r.fillStyle="#f00",r.fillRect(0,0,a,s),r.font=A,r.textBaseline="alphabetic",r.fillStyle="#000",r.fillText(i,0,o);var u=r.getImageData(0,0,a||1,s||1).data,c=u.length,l=4*a,h=0,d=0,f=!1;for(h=0;o>h;++h){for(var B=0;l>B;B+=4)if(255!==u[d+B]){f=!0;break}if(f)break;d+=l}for(e.ascent=o-h,d=c-l,f=!1,h=s;h>o;--h){for(var g=0;l>g;g+=4)if(255!==u[d+g]){f=!0;break}if(f)break;d-=l}return e.descent=h-o,e.fontSize=e.ascent+e.descent,this.fontMetricsCache[A]=e,e}},{key:"measureText",value:function(A,t,e){var n=t.fontSize,r=void 0===n?16:n,i=t.wordWrap,a=void 0!==i&&i,o=t.lineHeight,s=t.lineWidth,u=void 0===s?1:s,c=t.textBaseline,l=void 0===c?"alphabetic":c,h=t.textAlign,d=void 0===h?"start":h,f=t.letterSpacing,B=void 0===f?0:f,g=t.textPath,p=t.leading,v=void 0===p?0:p,w=Ea(t),y=this.measureFont(w,e);0===y.fontSize&&(y.fontSize=r,y.ascent=r);var m=this.runtime.offscreenCanvasCreator.getOrCreateContext(e);m.font=w,t.isOverflowing=!1;var C=(a?this.wordWrap(A,t,e):A).split(/(?:\r\n|\r|\n)/),Q=Array(C.length),F=0;if(!g){for(var U=0;C.length>U;U++){var E=m.measureText(C[U]).width+(C[U].length-1)*B;Q[U]=E,F=Math.max(F,E)}var b=F+u,k=o||y.fontSize+u,x=Math.max(k,y.fontSize+u)+(C.length-1)*(k+v),H=0;return"middle"===l?H=-x/2:"bottom"===l||"alphabetic"===l||"ideographic"===l?H=-x:"top"!==l&&"hanging"!==l||(H=0),{font:w,width:b,height:x,lines:C,lineWidths:Q,lineHeight:k+=v,maxLineWidth:F,fontProperties:y,lineMetrics:Q.map(function(A,t){var e=0;return"center"===d||"middle"===d?e-=A/2:"right"!==d&&"end"!==d||(e-=A),new Ee(e-u/2,H+t*k,A+u,k)})}}g.getTotalLength();for(var I=0;C.length>I;I++)m.measureText(C[I])}},{key:"wordWrap",value:function(A,t,e){var n=this,r=Array.from(A);if(0===r.length)return"";var i=this,a=t.wordWrapWidth,o=void 0===a?0:a,s=t.letterSpacing,u=void 0===s?0:s,c=t.maxLines,l=void 0===c?1/0:c,h=t.textOverflow,d=this.runtime.offscreenCanvasCreator.getOrCreateContext(e),f=o+u,B="";"ellipsis"===h?B="...":h&&"clip"!==h&&(B=h);var g=[""],p=0,v=0,w=-1,y=Ea(t),m=this.charWidthCache.get(y);m||(m=new To(500),this.charWidthCache.put(y,m));var C=function(A){return n.getFromCache(A,u,m,d)},Q=C(B);function F(A,t,e,n){for(;C(A)<n&&r.length-1>t&&!i.isNewline(r[t+1]);)A+=r[t+=1];for(;C(A)>n&&t>=e;)t-=1,A=A.slice(0,-1);return{lineTxt:A,txtLastCharIndex:t}}function U(A,t){if(Q>0&&f>=Q)if(g[A]){var e=F(g[A],t,w+1,f-Q);g[A]=e.lineTxt+B}else g[A]=B}for(var E=0;r.length>E;E++){var b=r[E],k=r[E-1],x=r[E+1],H=C(b);if(this.isNewline(b)){if(p+1>=l){r.length-1>E&&U(p,E-1),t.isOverflowing=!0;break}w=E-1,v=0,g[p+=1]=""}else{if(H>f){U(p,E-1),t.isOverflowing=!0;break}if(v>0&&v+H>f){var I=F(g[p],E-1,w+1,f);if(I.txtLastCharIndex!==E-1){if(g[p]=I.lineTxt,I.txtLastCharIndex===r.length-1)break;k=r[(E=I.txtLastCharIndex+1)-1],x=r[E+1],H=C(b=r[E])}if(p+1>=l){U(p,E-1),t.isOverflowing=!0;break}if(w=E-1,v=0,g[p+=1]="",this.isBreakingSpace(b))continue;this.canBreakInLastChar(b)||(g=this.trimToBreakable(g),v=this.sumTextWidthByCache(g[p]||"",C)),this.shouldBreakByKinsokuShorui(b,x)&&(g=this.trimByKinsokuShorui(g),v+=C(k||""))}v+=H,g[p]+=b}}return g.join("\n")}},{key:"isBreakingSpace",value:function(A){return"string"==typeof A&&Mo.BreakingSpaces.indexOf(A.charCodeAt(0))>=0}},{key:"isNewline",value:function(A){return"string"==typeof A&&Mo.Newlines.indexOf(A.charCodeAt(0))>=0}},{key:"trimToBreakable",value:function(A){var t=l(A),e=t[t.length-2],n=this.findBreakableIndex(e);if(-1===n||!e)return t;var r=e.slice(n,n+1),i=n+(this.isBreakingSpace(r)?0:1);return t[t.length-1]+=e.slice(n+1,e.length),t[t.length-2]=e.slice(0,i),t}},{key:"canBreakInLastChar",value:function(A){return!A||!So.test(A)}},{key:"sumTextWidthByCache",value:function(A,t){return A.split("").reduce(function(A,e){return A+t(e)},0)}},{key:"findBreakableIndex",value:function(A){for(var t=A.length-1;t>=0;t--)if(!So.test(A[t]))return t;return-1}},{key:"getFromCache",value:function(A,t,e,n){var r=e.get(A);if("number"!=typeof r){var i=A.length*t,a=n.measureText(A);e.put(A,r=a.width+i)}return r}},{key:"clearCache",value:function(){this.fontMetricsCache={},this.charWidthCache.clear()}}])}(),No={},Oo=(co=new _a,lo=new Va,n(n(n(n(n(n(n(n(n(n(uo={},le.FRAGMENT,null),le.CIRCLE,new Oa),le.ELLIPSE,new Ka),le.RECT,co),le.IMAGE,co),le.GROUP,new Ya),le.LINE,new Ra),le.TEXT,new Xa(No)),le.POLYLINE,lo),le.POLYGON,lo),n(n(n(uo,le.PATH,new Ga),le.HTML,new Wa),le.MESH,null)),Ko=function(A){var t=new Ni,e=new Ri;return n(n(n(n(n(n(n(n(n(n(A={},sn.PERCENTAGE,null),sn.NUMBER,new Xi),sn.ANGLE,new Di),sn.DEFINED_PATH,new Pi),sn.PAINT,t),sn.COLOR,t),sn.FILTER,new Oi),sn.LENGTH,e),sn.LENGTH_PERCENTAGE,e),sn.LENGTH_PERCENTAGE_12,new Gi),n(n(n(n(n(n(n(n(n(n(A,sn.LENGTH_PERCENTAGE_14,new Vi),sn.COORDINATE,new Ri),sn.OFFSET_DISTANCE,new Yi),sn.OPACITY_VALUE,new Wi),sn.PATH,new Ji),sn.LIST_OF_POINTS,new Zi),sn.SHADOW_BLUR,new zi),sn.TEXT,new ji),sn.TEXT_TRANSFORM,new qi),sn.TRANSFORM,new Da),n(n(n(A,sn.TRANSFORM_ORIGIN,new Pa),sn.Z_INDEX,new Na),sn.MARKER,new _i)}();No.CameraContribution=qe,No.AnimationTimeline=null,No.EasingFunction=null,No.offscreenCanvasCreator=new eo,No.sceneGraphSelector=new ao,No.sceneGraphService=new Io(No),No.textService=new Po(No),No.geometryUpdaterFactory=Oo,No.CSSPropertySyntaxFactory=Ko,No.styleValueRegistry=new Si(No),No.layoutRegistry=null,No.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},No.enableStyleSyntax=!0,No.enableSizeAttenuation=!1;var Ro=0;var Go=new so(oo.INSERTED,null,"","","",0,"",""),Vo=new so(oo.REMOVED,null,"","","",0,"",""),_o=new qa(oo.DESTROY),Xo=function(A){function t(){var A;a(this,t);for(var e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];return(A=B(this,t,[].concat(n))).entity=Ro++,A.transformable={dirtyFlag:!1,localDirtyFlag:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},A.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},A.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},A.cullable={strategy:$e.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},A.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},A.namespaceURI="g",A.scrollLeft=0,A.scrollTop=0,A.clientTop=0,A.clientLeft=0,A.style={},A.computedStyle={},A.parsedStyle={},A.attributes={},A}return p(t,A),s(t,[{key:"dirty",value:function(){var A=arguments.length>1?arguments[1]:void 0;this.renderable.dirty=0>=arguments.length||void 0===arguments[0]||arguments[0],void 0!==A&&(this.renderable.boundsDirty=A,this.renderable.renderBoundsDirty=A,this.geometry.dirty=A)}},{key:"className",get:function(){return this.getAttribute("class")||""},set:function(A){this.setAttribute("class",A)}},{key:"classList",get:function(){return this.className.split(" ").filter(function(A){return""!==A})}},{key:"tagName",get:function(){return this.nodeName}},{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"parentElement",get:function(){return this.parentNode}},{key:"nextSibling",get:function(){if(this.parentNode){var A=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[A+1]||null}return null}},{key:"previousSibling",get:function(){if(this.parentNode){var A=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[A-1]||null}return null}},{key:"cloneNode",value:function(A){throw Error(be)}},{key:"appendChild",value:function(A,t){var e;if(A.destroyed)throw Error("Cannot append a destroyed element.");return No.sceneGraphService.attach(A,this,t),null!==(e=this.ownerDocument)&&void 0!==e&&e.defaultView&&(oa(this)||A.nodeName!==le.FRAGMENT?this.ownerDocument.defaultView.mountChildren(A):this.ownerDocument.defaultView.mountFragment(A)),this.isMutationObserved&&(Go.relatedNode=this,A.dispatchEvent(Go)),A}},{key:"insertBefore",value:function(A,t){if(t){A.parentElement&&A.parentElement.removeChild(A);var e=this.childNodes.indexOf(t);-1===e?this.appendChild(A):this.appendChild(A,e)}else this.appendChild(A);return A}},{key:"replaceChild",value:function(A,t){var e=this.childNodes.indexOf(t);return this.removeChild(t),this.appendChild(A,e),t}},{key:"removeChild",value:function(A){var t,e,n=!0===(null===(t=this.ownerDocument)||void 0===t||null===(t=t.defaultView)||void 0===t||null===(t=t.getConfig().future)||void 0===t?void 0:t.experimentalCancelEventPropagation);return Vo.relatedNode=this,A.dispatchEvent(Vo,n,n),null!==(e=A.ownerDocument)&&void 0!==e&&e.defaultView&&A.ownerDocument.defaultView.unmountChildren(A),No.sceneGraphService.detach(A),A}},{key:"removeChildren",value:function(){for(var A=this.childNodes.length-1;A>=0;A--){this.removeChild(this.childNodes[A])}}},{key:"destroyChildren",value:function(){for(var A=this.childNodes.length-1;A>=0;A--){var t=this.childNodes[A];t.childNodes.length>0&&t.destroyChildren(),t.destroy()}}},{key:"matches",value:function(A){return No.sceneGraphService.matches(A,this)}},{key:"getElementById",value:function(A){return No.sceneGraphService.querySelector("#".concat(A),this)}},{key:"getElementsByName",value:function(A){return No.sceneGraphService.querySelectorAll('[name="'.concat(A,'"]'),this)}},{key:"getElementsByClassName",value:function(A){return No.sceneGraphService.querySelectorAll(".".concat(A),this)}},{key:"getElementsByTagName",value:function(A){return No.sceneGraphService.querySelectorAll(A,this)}},{key:"querySelector",value:function(A){return No.sceneGraphService.querySelector(A,this)}},{key:"querySelectorAll",value:function(A){return No.sceneGraphService.querySelectorAll(A,this)}},{key:"closest",value:function(A){var t=this;do{if(No.sceneGraphService.matches(A,t))return t;t=t.parentElement}while(null!==t);return null}},{key:"find",value:function(A){var t=this,e=null;return this.forEach(function(n){return n===t||!A(n)||(e=n,!1)}),e}},{key:"findAll",value:function(A){var t=this,e=[];return this.forEach(function(n){n!==t&&A(n)&&e.push(n)}),e}},{key:"after",value:function(){var A=this;if(this.parentNode){for(var t=this.parentNode.childNodes.indexOf(this),e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];n.forEach(function(e,n){var r;return null===(r=A.parentNode)||void 0===r?void 0:r.appendChild(e,t+n+1)})}}},{key:"before",value:function(){if(this.parentNode){for(var A,t=this.parentNode.childNodes.indexOf(this),e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=n[0],a=u(n).slice(1);this.parentNode.appendChild(i,t),(A=i).after.apply(A,l(a))}}},{key:"replaceWith",value:function(){this.after.apply(this,arguments),this.remove()}},{key:"append",value:function(){for(var A=this,t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];e.forEach(function(t){return A.appendChild(t)})}},{key:"prepend",value:function(){for(var A=this,t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];e.forEach(function(t,e){return A.appendChild(t,e)})}},{key:"replaceChildren",value:function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)}},{key:"remove",value:function(){return this.parentNode?this.parentNode.removeChild(this):this}},{key:"destroy",value:function(){var A,t=!0===(null===(A=this.ownerDocument)||void 0===A||null===(A=A.defaultView)||void 0===A||null===(A=A.getConfig().future)||void 0===A?void 0:A.experimentalCancelEventPropagation);this.destroyChildren(),this.dispatchEvent(_o,t,t),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0}},{key:"getGeometryBounds",value:function(){return No.sceneGraphService.getGeometryBounds(this,arguments.length>0&&void 0!==arguments[0]&&arguments[0])}},{key:"getTransformedGeometryBounds",value:function(){return No.sceneGraphService.getTransformedGeometryBounds(this,arguments.length>0&&void 0!==arguments[0]&&arguments[0])}},{key:"getBounds",value:function(){return No.sceneGraphService.getBounds(this)}},{key:"getRenderBounds",value:function(){return No.sceneGraphService.getBounds(this,!0)}},{key:"getLocalBounds",value:function(){return No.sceneGraphService.getLocalBounds(this)}},{key:"getBoundingClientRect",value:function(){return No.sceneGraphService.getBoundingClientRect(this)}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"computedStyleMap",value:function(){return new Map(Object.entries(this.computedStyle))}},{key:"getAttributeNames",value:function(){return Object.keys(this.attributes)}},{key:"getAttribute",value:function(A){if("symbol"!=typeof A){var t=this.attributes[A];return t}}},{key:"hasAttribute",value:function(A){return this.getAttributeNames().includes(A)}},{key:"hasAttributes",value:function(){return!!this.getAttributeNames().length}},{key:"removeAttribute",value:function(A){this.setAttribute(A,null),delete this.attributes[A]}},{key:"setAttribute",value:function(A,t){this.attributes[A]=t}},{key:"getAttributeNS",value:function(A,t){throw Error(be)}},{key:"getAttributeNode",value:function(A){throw Error(be)}},{key:"getAttributeNodeNS",value:function(A,t){throw Error(be)}},{key:"hasAttributeNS",value:function(A,t){throw Error(be)}},{key:"removeAttributeNS",value:function(A,t){throw Error(be)}},{key:"removeAttributeNode",value:function(A){throw Error(be)}},{key:"setAttributeNS",value:function(A,t,e){throw Error(be)}},{key:"setAttributeNode",value:function(A){throw Error(be)}},{key:"setAttributeNodeNS",value:function(A){throw Error(be)}},{key:"toggleAttribute",value:function(A,t){throw Error(be)}}])}(Ao);function Yo(A){return!(null==A||!A.nodeName)}var Wo=No.globalThis.Proxy?No.globalThis.Proxy:function(){},Jo=new so(oo.ATTR_MODIFIED,null,null,null,null,so.MODIFICATION,null,null),Zo=nA(),zo=FA(),jo=function(A){function t(A){var e;return a(this,t),(e=B(this,t)).isCustomElement=!1,e.isMutationObserved=!1,e.activeAnimations=[],e.config=A,e.id=A.id||"",e.name=A.name||"",(A.className||A.class)&&(e.className=A.className||A.class),e.nodeName=A.type||le.GROUP,A.initialParsedStyle&&Object.assign(e.parsedStyle,A.initialParsedStyle),e.initAttributes(A.style),No.enableStyleSyntax&&(e.style=new Wo({setProperty:function(A,t){e.setAttribute(A,t)},getPropertyValue:function(A){return e.getAttribute(A)},removeProperty:function(A){e.removeAttribute(A)},item:function(){return""}},{get:function(A,t){return void 0!==A[t]?A[t]:e.getAttribute(t)},set:function(A,t,n){return e.setAttribute(t,n),!0}})),e}return p(t,A),s(t,[{key:"destroy",value:function(){Pt(t,"destroy",this,3)([]),this.getAnimations().forEach(function(A){A.cancel()})}},{key:"cloneNode",value:function(A,t){var e=i({},this.attributes);for(var n in e){var r=e[n];Yo(r)&&"clipPath"!==n&&"offsetPath"!==n&&"textPath"!==n&&(e[n]=r.cloneNode(A)),t&&(e[n]=t(n,r))}var a=new this.constructor(i(i({},this.config),{},{style:e}));return a.setLocalTransform(this.getLocalTransform()),A&&this.children.forEach(function(t){if(!t.style.isMarker){var e=t.cloneNode(A);a.appendChild(e)}}),a}},{key:"initAttributes",value:function(){No.styleValueRegistry.processProperties(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{forceUpdateGeometry:!0}),this.dirty()}},{key:"setAttribute",value:function(A,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=3>=arguments.length||void 0===arguments[3]||arguments[3];JA(e)||(n||e!==this.attributes[A])&&(this.internalSetAttribute(A,e,{memoize:r}),Pt(t,"setAttribute",this,3)([A,e]))}},{key:"setAttributes",value:function(A){var t,e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.skipDispatchAttrModifiedEvent,a=void 0!==r&&r;if(a||(t=i({},this.attributes),e=i({},this.parsedStyle)),No.styleValueRegistry.processProperties(this,A,n),this.dirty(),!a)for(var o in A)this.dispatchAttrModifiedEvent(o,t[o],A[o],e[o])}},{key:"internalSetAttribute",value:function(A,t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.attributes[A],i=this.parsedStyle[A];No.styleValueRegistry.processProperties(this,n({},A,t),e),this.dirty(),this.dispatchAttrModifiedEvent(A,r,t,i)}},{key:"dispatchAttrModifiedEvent",value:function(A,t,e,n){var r,i=this.parsedStyle[A];if(this.isConnected)if(Jo.relatedNode=this,Jo.prevValue=t,Jo.newValue=e,Jo.attrName=A,Jo.prevParsedValue=n,Jo.newParsedValue=i,this.isMutationObserved)this.dispatchEvent(Jo);else{var a,o=!0===(null===(a=this.ownerDocument.defaultView.getConfig().future)||void 0===a?void 0:a.experimentalCancelEventPropagation);Jo.target=this,this.ownerDocument.defaultView.dispatchEvent(Jo,!0,o)}(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&(null===(r=this.attributeChangedCallback)||void 0===r||r.call(this,A,t,e,n,i))}},{key:"getBBox",value:function(){var A=this.getBounds(),t=v(A.getMin(),2),e=t[0],n=t[1],r=v(A.getMax(),2);return new Ee(e,n,r[0]-e,r[1]-n)}},{key:"setOrigin",value:function(A){return No.sceneGraphService.setOrigin(this,Ie(A,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"getOrigin",value:function(){return No.sceneGraphService.getOrigin(this)}},{key:"setPosition",value:function(A){return No.sceneGraphService.setPosition(this,Ie(A,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"setLocalPosition",value:function(A){return No.sceneGraphService.setLocalPosition(this,Ie(A,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"translate",value:function(A){return No.sceneGraphService.translate(this,Ie(A,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"translateLocal",value:function(A){return No.sceneGraphService.translateLocal(this,Ie(A,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"getPosition",value:function(){return No.sceneGraphService.getPosition(this)}},{key:"getLocalPosition",value:function(){return No.sceneGraphService.getLocalPosition(this)}},{key:"scale",value:function(A,t,e){return this.scaleLocal(A,t,e)}},{key:"scaleLocal",value:function(A,t,e){return"number"==typeof A&&(A=Ie(A,t=t||A,e=e||A,!1)),No.sceneGraphService.scaleLocal(this,A),this}},{key:"setLocalScale",value:function(A,t,e){return"number"==typeof A&&(A=Ie(A,t=t||A,e=e||A,!1)),No.sceneGraphService.setLocalScale(this,A),this}},{key:"getLocalScale",value:function(){return No.sceneGraphService.getLocalScale(this)}},{key:"getScale",value:function(){return No.sceneGraphService.getScale(this)}},{key:"getEulerAngles",value:function(){return Le(v(Ne(Zo,No.sceneGraphService.getWorldTransform(this)),3)[2])}},{key:"getLocalEulerAngles",value:function(){return Le(v(Ne(Zo,No.sceneGraphService.getLocalRotation(this)),3)[2])}},{key:"setEulerAngles",value:function(A){return No.sceneGraphService.setEulerAngles(this,0,0,A),this}},{key:"setLocalEulerAngles",value:function(A){return No.sceneGraphService.setLocalEulerAngles(this,0,0,A),this}},{key:"rotateLocal",value:function(A,t,e){return DA(t)&&DA(e)?No.sceneGraphService.rotateLocal(this,0,0,A):No.sceneGraphService.rotateLocal(this,A,t,e),this}},{key:"rotate",value:function(A,t,e){return DA(t)&&DA(e)?No.sceneGraphService.rotate(this,0,0,A):No.sceneGraphService.rotate(this,A,t,e),this}},{key:"setRotation",value:function(A,t,e,n){return No.sceneGraphService.setRotation(this,A,t,e,n),this}},{key:"setLocalRotation",value:function(A,t,e,n){return No.sceneGraphService.setLocalRotation(this,A,t,e,n),this}},{key:"setLocalSkew",value:function(A,t){return No.sceneGraphService.setLocalSkew(this,A,t),this}},{key:"getRotation",value:function(){return No.sceneGraphService.getRotation(this)}},{key:"getLocalRotation",value:function(){return No.sceneGraphService.getLocalRotation(this)}},{key:"getLocalSkew",value:function(){return No.sceneGraphService.getLocalSkew(this)}},{key:"getLocalTransform",value:function(){return No.sceneGraphService.getLocalTransform(this)}},{key:"getWorldTransform",value:function(){return No.sceneGraphService.getWorldTransform(this)}},{key:"setLocalTransform",value:function(A){return No.sceneGraphService.setLocalTransform(this,A),this}},{key:"resetLocalTransform",value:function(){No.sceneGraphService.resetLocalTransform(this)}},{key:"getAnimations",value:function(){return this.activeAnimations}},{key:"animate",value:function(A,t){var e,n=null===(e=this.ownerDocument)||void 0===e?void 0:e.timeline;return n?n.play(this,A,t):null}},{key:"isVisible",value:function(){var A;return"hidden"!==(null===(A=this.parsedStyle)||void 0===A?void 0:A.visibility)}},{key:"interactive",get:function(){return this.isInteractive()},set:function(A){this.style.pointerEvents=A?"auto":"none"}},{key:"isInteractive",value:function(){var A;return"none"!==(null===(A=this.parsedStyle)||void 0===A?void 0:A.pointerEvents)}},{key:"isCulled",value:function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)}},{key:"toFront",value:function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,l(this.parentNode.children.map(function(A){return Number(A.style.zIndex)})))+1),this}},{key:"toBack",value:function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,l(this.parentNode.children.map(function(A){return Number(A.style.zIndex)})))-1),this}},{key:"getConfig",value:function(){return this.config}},{key:"attr",value:function(){for(var A=this,t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=e[0],i=e[1];return r?function(A){var t=typeof A;return null!==A&&"object"===t||"function"===t}(r)?(Object.keys(r).forEach(function(t){A.setAttribute(t,r[t])}),this):2===e.length?(this.setAttribute(r,i),this):this.attributes[r]:this.attributes}},{key:"getMatrix",value:function(A){var t=A||this.getWorldTransform(),e=v(_(Zo,t),2),n=e[0],r=e[1],i=v(X(Zo,t),2),a=i[0],o=i[1],s=Y(zo,t),u=v(Ne(Zo,s),3);return Oe(u[0]||u[2],n,r,a,o)}},{key:"getLocalMatrix",value:function(){return this.getMatrix(this.getLocalTransform())}},{key:"setMatrix",value:function(A){var t=v(Ke(A),5),e=t[0],n=t[1],r=t[2],i=t[3];this.setEulerAngles(t[4]).setPosition(e,n).setLocalScale(r,i)}},{key:"setLocalMatrix",value:function(A){var t=v(Ke(A),5),e=t[0],n=t[1],r=t[2],i=t[3];this.setLocalEulerAngles(t[4]).setLocalPosition(e,n).setLocalScale(r,i)}},{key:"show",value:function(){this.forEach(function(A){A.style.visibility="visible"})}},{key:"hide",value:function(){this.forEach(function(A){A.style.visibility="hidden"})}},{key:"getCount",value:function(){return this.childElementCount}},{key:"getParent",value:function(){return this.parentElement}},{key:"getChildren",value:function(){return this.children}},{key:"getFirst",value:function(){return this.firstElementChild}},{key:"getLast",value:function(){return this.lastElementChild}},{key:"getChildByIndex",value:function(A){return this.children[A]||null}},{key:"add",value:function(A,t){return this.appendChild(A,t)}},{key:"set",value:function(A,t){this.config[A]=t}},{key:"get",value:function(A){return this.config[A]}},{key:"moveTo",value:function(A){return this.setPosition(A,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0),this}},{key:"move",value:function(A){return this.setPosition(A,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0),this}},{key:"setZIndex",value:function(A){return this.style.zIndex=A,this}}])}(Xo);jo.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","display","draggable","droppable","fill","fillOpacity","fillRule","filter","increasedLineWidthForHitTesting","lineCap","lineDash","lineDashOffset","lineJoin","lineWidth","miterLimit","hitArea","offsetDistance","offsetPath","offsetX","offsetY","opacity","pointerEvents","shadowColor","shadowType","shadowBlur","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","strokeWidth","strokeLinecap","strokeLineJoin","strokeDasharray","strokeDashoffset","transform","transformOrigin","textTransform","visibility","zIndex"]);var qo=function(A){function t(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a(this,t),B(this,t,[i({type:le.CIRCLE},A)])}return p(t,A),s(t)}(jo);qo.PARSED_STYLE_LIST=new Set([].concat(l(jo.PARSED_STYLE_LIST),["cx","cy","cz","r","isBillboard","isSizeAttenuation"]));var $o=["style"],As=function(A){function t(){var A,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.style,r=ce(e,$o);return a(this,t),(A=B(this,t,[i({style:n},r)])).isCustomElement=!0,A}return p(t,A),s(t)}(jo);As.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var ts=function(A){function t(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a(this,t),B(this,t,[i({type:le.ELLIPSE},A)])}return p(t,A),s(t)}(jo);ts.PARSED_STYLE_LIST=new Set([].concat(l(jo.PARSED_STYLE_LIST),["cx","cy","cz","rx","ry","isBillboard","isSizeAttenuation"]));var es=function(A){function t(){return a(this,t),B(this,t,[{type:le.FRAGMENT}])}return p(t,A),s(t)}(jo);es.PARSED_STYLE_LIST=new Set(["class","className"]);var ns=function(A){function t(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a(this,t),B(this,t,[i({type:le.GROUP},A)])}return p(t,A),s(t)}(jo);ns.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var rs=["style"],is=function(A){function t(){var A,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.style,r=ce(e,rs);return a(this,t),(A=B(this,t,[i({type:le.HTML,style:n},r)])).cullable.enable=!1,A}return p(t,A),s(t,[{key:"getDomElement",value:function(){return this.parsedStyle.$el}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"getLocalBounds",value:function(){if(this.parentNode){var A=H(F(),this.parentNode.getWorldTransform()),t=this.getBounds();if(!me.isEmpty(t)){var e=new me;return e.setFromTransformedAABB(t,A),e}}return this.getBounds()}}])}(jo);is.PARSED_STYLE_LIST=new Set([].concat(l(jo.PARSED_STYLE_LIST),["x","y","$el","innerHTML","width","height"]));var as=function(A){function t(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a(this,t),B(this,t,[i({type:le.IMAGE},A)])}return p(t,A),s(t)}(jo);as.PARSED_STYLE_LIST=new Set([].concat(l(jo.PARSED_STYLE_LIST),["x","y","z","src","width","height","isBillboard","billboardRotation","isSizeAttenuation","keepAspectRatio"]));var os=["style"],ss=function(A){function t(){var A,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.style,r=ce(e,os);a(this,t),(A=B(this,t,[i({type:le.LINE,style:i({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},n)},r)])).markerStartAngle=0,A.markerEndAngle=0;var o=A.parsedStyle,s=o.markerStart,u=o.markerEnd;return s&&Yo(s)&&(A.markerStartAngle=s.getLocalEulerAngles(),A.appendChild(s)),u&&Yo(u)&&(A.markerEndAngle=u.getLocalEulerAngles(),A.appendChild(u)),A.transformMarker(!0),A.transformMarker(!1),A}return p(t,A),s(t,[{key:"attributeChangedCallback",value:function(A,t,e,n,r){"x1"===A||"y1"===A||"x2"===A||"y2"===A||"markerStartOffset"===A||"markerEndOffset"===A?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===A?(n&&Yo(n)&&(this.markerStartAngle=0,n.remove()),r&&Yo(r)&&(this.markerStartAngle=r.getLocalEulerAngles(),this.appendChild(r),this.transformMarker(!0))):"markerEnd"===A&&(n&&Yo(n)&&(this.markerEndAngle=0,n.remove()),r&&Yo(r)&&(this.markerEndAngle=r.getLocalEulerAngles(),this.appendChild(r),this.transformMarker(!1)))}},{key:"transformMarker",value:function(A){var t=this.parsedStyle,e=t.markerStartOffset,n=t.markerEndOffset,r=t.x1,i=t.x2,a=t.y1,o=t.y2,s=A?t.markerStart:t.markerEnd;if(s&&Yo(s)){var u,c,l,h,d,f,B;A?(h=r,d=a,c=i-r,l=o-a,f=e||0,B=this.markerStartAngle):(h=i,d=o,c=r-i,l=a-o,f=n||0,B=this.markerEndAngle),s.setLocalEulerAngles(180*(u=Math.atan2(l,c))/Math.PI+B),s.setLocalPosition(h+Math.cos(u)*f,d+Math.sin(u)*f)}}},{key:"getPoint",value:function(A){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],e=this.parsedStyle,n=_t(e.x1,e.y1,e.x2,e.y2,A),r=n.x,i=n.y,a=gA(nA(),aA(r,i,0),t?this.getWorldTransform():this.getLocalTransform());return new Ue(a[0],a[1])}},{key:"getPointAtLength",value:function(A){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(A/this.getTotalLength(),t)}},{key:"getTotalLength",value:function(){var A=this.parsedStyle;return Vt(A.x1,A.y1,A.x2,A.y2)}}])}(jo);ss.PARSED_STYLE_LIST=new Set([].concat(l(jo.PARSED_STYLE_LIST),["x1","y1","x2","y2","z1","z2","isBillboard","isSizeAttenuation","markerStart","markerEnd","markerStartOffset","markerEndOffset"]));var us=["style"],cs=function(A){function t(){var A,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.style,r=ce(e,us);a(this,t),(A=B(this,t,[i({type:le.PATH,style:n,initialParsedStyle:{miterLimit:4,d:i({},on)}},r)])).markerStartAngle=0,A.markerEndAngle=0,A.markerMidList=[];var o=A.parsedStyle,s=o.markerStart,u=o.markerEnd,c=o.markerMid;return s&&Yo(s)&&(A.markerStartAngle=s.getLocalEulerAngles(),A.appendChild(s)),c&&Yo(c)&&A.placeMarkerMid(c),u&&Yo(u)&&(A.markerEndAngle=u.getLocalEulerAngles(),A.appendChild(u)),A.transformMarker(!0),A.transformMarker(!1),A}return p(t,A),s(t,[{key:"attributeChangedCallback",value:function(A,t,e,n,r){"d"===A?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===A||"markerEndOffset"===A?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===A?(n&&Yo(n)&&(this.markerStartAngle=0,n.remove()),r&&Yo(r)&&(this.markerStartAngle=r.getLocalEulerAngles(),this.appendChild(r),this.transformMarker(!0))):"markerEnd"===A?(n&&Yo(n)&&(this.markerEndAngle=0,n.remove()),r&&Yo(r)&&(this.markerEndAngle=r.getLocalEulerAngles(),this.appendChild(r),this.transformMarker(!1))):"markerMid"===A&&this.placeMarkerMid(r)}},{key:"transformMarker",value:function(A){var t=this.parsedStyle,e=t.markerStartOffset,n=t.markerEndOffset,r=A?t.markerStart:t.markerEnd;if(r&&Yo(r)){var i,a,o,s,u,c,l;if(A){var h=v(this.getStartTangent(),2),d=h[0],f=h[1];s=f[0],u=f[1],a=d[0]-f[0],o=d[1]-f[1],c=e||0,l=this.markerStartAngle}else{var B=v(this.getEndTangent(),2),g=B[0],p=B[1];s=p[0],u=p[1],a=g[0]-p[0],o=g[1]-p[1],c=n||0,l=this.markerEndAngle}r.setLocalEulerAngles(180*(i=Math.atan2(o,a))/Math.PI+l),r.setLocalPosition(s+Math.cos(i)*c,u+Math.sin(i)*c)}}},{key:"placeMarkerMid",value:function(A){var t=this.parsedStyle.d.segments;if(this.markerMidList.forEach(function(A){A.remove()}),A&&Yo(A))for(var e=1;t.length-1>e;e++){var n=v(t[e].currentPoint,2),r=n[0],i=n[1],a=1===e?A:A.cloneNode(!0);this.markerMidList.push(a),this.appendChild(a),a.setLocalPosition(r,i)}}},{key:"getTotalLength",value:function(){return Jr(this)}},{key:"getPointAtLength",value:function(A){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],e=function(A,t,e){return It(A,t,ZA(ZA({},e),{bbox:!1,length:!0})).point}(this.parsedStyle.d.absolutePath,A),n=e.x,r=e.y,i=gA(nA(),aA(n,r,0),t?this.getWorldTransform():this.getLocalTransform());return new Ue(i[0],i[1])}},{key:"getPoint",value:function(A){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPointAtLength(A*Jr(this),t)}},{key:"getStartTangent",value:function(){var A=this.parsedStyle.d.segments,t=[];if(A.length>1){var e=A[0].currentPoint,n=A[1].currentPoint,r=A[1].startTangent;t=[],r?(t.push([e[0]-r[0],e[1]-r[1]]),t.push([e[0],e[1]])):(t.push([n[0],n[1]]),t.push([e[0],e[1]]))}return t}},{key:"getEndTangent",value:function(){var A=this.parsedStyle.d.segments,t=A.length,e=[];if(t>1){var n=A[t-2].currentPoint,r=A[t-1].currentPoint,i=A[t-1].endTangent;e=[],i?(e.push([r[0]-i[0],r[1]-i[1]]),e.push([r[0],r[1]])):(e.push([n[0],n[1]]),e.push([r[0],r[1]]))}return e}}])}(jo);cs.PARSED_STYLE_LIST=new Set([].concat(l(jo.PARSED_STYLE_LIST),["d","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard","isSizeAttenuation"]));var ls=["style"],hs=function(A){function t(){var A,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.style,r=ce(e,ls);a(this,t),(A=B(this,t,[i({type:le.POLYGON,style:n,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},r)])).markerStartAngle=0,A.markerEndAngle=0,A.markerMidList=[];var o=A.parsedStyle,s=o.markerStart,u=o.markerEnd,c=o.markerMid;return s&&Yo(s)&&(A.markerStartAngle=s.getLocalEulerAngles(),A.appendChild(s)),c&&Yo(c)&&A.placeMarkerMid(c),u&&Yo(u)&&(A.markerEndAngle=u.getLocalEulerAngles(),A.appendChild(u)),A.transformMarker(!0),A.transformMarker(!1),A}return p(t,A),s(t,[{key:"attributeChangedCallback",value:function(A,t,e,n,r){"points"===A?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===A||"markerEndOffset"===A?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===A?(n&&Yo(n)&&(this.markerStartAngle=0,n.remove()),r&&Yo(r)&&(this.markerStartAngle=r.getLocalEulerAngles(),this.appendChild(r),this.transformMarker(!0))):"markerEnd"===A?(n&&Yo(n)&&(this.markerEndAngle=0,n.remove()),r&&Yo(r)&&(this.markerEndAngle=r.getLocalEulerAngles(),this.appendChild(r),this.transformMarker(!1))):"markerMid"===A&&this.placeMarkerMid(r)}},{key:"transformMarker",value:function(A){var t=this.parsedStyle,e=t.markerStartOffset,n=t.markerEndOffset,r=(t.points||{}).points,i=A?t.markerStart:t.markerEnd;if(i&&Yo(i)&&r){var a,o,s,u,c,l,h;if(u=r[0][0],c=r[0][1],A)o=r[1][0]-r[0][0],s=r[1][1]-r[0][1],l=e||0,h=this.markerStartAngle;else{var d=r.length;this.parsedStyle.isClosed?(o=r[d-1][0]-r[0][0],s=r[d-1][1]-r[0][1]):(u=r[d-1][0],c=r[d-1][1],o=r[d-2][0]-r[d-1][0],s=r[d-2][1]-r[d-1][1]),l=n||0,h=this.markerEndAngle}i.setLocalEulerAngles(180*(a=Math.atan2(s,o))/Math.PI+h),i.setLocalPosition(u+Math.cos(a)*l,c+Math.sin(a)*l)}}},{key:"placeMarkerMid",value:function(A){var t=(this.parsedStyle.points||{}).points;if(this.markerMidList.forEach(function(A){A.remove()}),this.markerMidList=[],A&&Yo(A)&&t)for(var e=1;(this.parsedStyle.isClosed?t.length:t.length-1)>e;e++){var n=t[e][0],r=t[e][1],i=1===e?A:A.cloneNode(!0);this.markerMidList.push(i),this.appendChild(i),i.setLocalPosition(n,r)}}}])}(jo);hs.PARSED_STYLE_LIST=new Set([].concat(l(jo.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isClosed","isBillboard","isSizeAttenuation"]));var ds=["style"],fs=function(A){function t(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=A.style,n=ce(A,ds);return a(this,t),B(this,t,[i({type:le.POLYLINE,style:e,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},n)])}return p(t,A),s(t,[{key:"getTotalLength",value:function(){return 0===(A=this).parsedStyle.points.totalLength&&(A.parsedStyle.points.totalLength=Jt(A.parsedStyle.points.points)),A.parsedStyle.points.totalLength;var A}},{key:"getPointAtLength",value:function(A){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(A/this.getTotalLength(),t)}},{key:"getPoint",value:function(A){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],e=this.parsedStyle.points.points;if(0===this.parsedStyle.points.segments.length){var n,r,i=[],a=0,o=this.getTotalLength();e.forEach(function(A,t){e[t+1]&&((n=[0,0])[0]=a/o,r=Vt(A[0],A[1],e[t+1][0],e[t+1][1]),n[1]=(a+=r)/o,i.push(n))}),this.parsedStyle.points.segments=i}var s=0,u=0;this.parsedStyle.points.segments.forEach(function(t,e){t[0]>A||A>t[1]||(s=(A-t[0])/(t[1]-t[0]),u=e)});var c=_t(e[u][0],e[u][1],e[u+1][0],e[u+1][1],s),l=c.x,h=c.y,d=gA(nA(),aA(l,h,0),t?this.getWorldTransform():this.getLocalTransform());return new Ue(d[0],d[1])}},{key:"getStartTangent",value:function(){var A=this.parsedStyle.points.points,t=[];return t.push([A[1][0],A[1][1]]),t.push([A[0][0],A[0][1]]),t}},{key:"getEndTangent",value:function(){var A=this.parsedStyle.points.points,t=A.length-1,e=[];return e.push([A[t-1][0],A[t-1][1]]),e.push([A[t][0],A[t][1]]),e}}])}(hs);fs.PARSED_STYLE_LIST=new Set([].concat(l(hs.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard"]));var Bs=function(A){function t(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a(this,t),B(this,t,[i({type:le.RECT},A)])}return p(t,A),s(t)}(jo);Bs.PARSED_STYLE_LIST=new Set([].concat(l(jo.PARSED_STYLE_LIST),["x","y","z","width","height","isBillboard","isSizeAttenuation","radius"]));var gs=["style"],ps=function(A){function t(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=A.style,n=ce(A,gs);return a(this,t),B(this,t,[i({type:le.TEXT,style:i({fill:"black"},e)},n)])}return p(t,A),s(t,[{key:"getComputedTextLength",value:function(){var A;return this.getGeometryBounds(),(null===(A=this.parsedStyle.metrics)||void 0===A?void 0:A.maxLineWidth)||0}},{key:"getLineBoundingRects",value:function(){var A;return this.getGeometryBounds(),(null===(A=this.parsedStyle.metrics)||void 0===A?void 0:A.lineMetrics)||[]}},{key:"isOverflowing",value:function(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing}}])}(jo);ps.PARSED_STYLE_LIST=new Set([].concat(l(jo.PARSED_STYLE_LIST),["x","y","z","isBillboard","billboardRotation","isSizeAttenuation","text","textAlign","textBaseline","fontStyle","fontSize","fontFamily","fontWeight","fontVariant","lineHeight","letterSpacing","leading","wordWrap","wordWrapWidth","maxLines","textOverflow","isOverflowing","textPath","textDecorationLine","textDecorationColor","textDecorationStyle","textDecorationThickness","textPathSide","textPathStartOffset","metrics","dx","dy"]));var vs=function(){return s(function A(){a(this,A),this.registry={},this.define(le.CIRCLE,qo),this.define(le.ELLIPSE,ts),this.define(le.RECT,Bs),this.define(le.IMAGE,as),this.define(le.LINE,ss),this.define(le.GROUP,ns),this.define(le.PATH,cs),this.define(le.POLYGON,hs),this.define(le.POLYLINE,fs),this.define(le.TEXT,ps),this.define(le.HTML,is)},[{key:"define",value:function(A,t){this.registry[A]=t}},{key:"get",value:function(A){return this.registry[A]}}])}(),ws={number:function(A){return new rr(A)},percent:function(A){return new rr(A,"%")},px:function(A){return new rr(A,"px")},em:function(A){return new rr(A,"em")},rem:function(A){return new rr(A,"rem")},deg:function(A){return new rr(A,"deg")},grad:function(A){return new rr(A,"grad")},rad:function(A){return new rr(A,"rad")},turn:function(A){return new rr(A,"turn")},s:function(A){return new rr(A,"s")},ms:function(A){return new rr(A,"ms")},registerProperty:function(A){No.styleValueRegistry.registerMetadata({n:A.name,inh:A.inherits,int:A.interpolable,d:A.initialValue,syntax:A.syntax})},registerLayout:function(A,t){No.layoutRegistry.registerLayout(A,t)}},ys=function(A){function t(){var A;a(this,t),(A=B(this,t)).defaultView=null,A.ownerDocument=null,A.nodeName="document";try{A.timeline=new No.AnimationTimeline(A)}catch(A){}var e={};return Ii.forEach(function(A){var t=A.d;A.inh&&t&&(e[A.n]=LA(t)?t(le.GROUP):t)}),A.documentElement=new ns({id:"g-root",style:e}),A.documentElement.ownerDocument=A,A.documentElement.parentNode=A,A.childNodes=[A.documentElement],A}return p(t,A),s(t,[{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"createElement",value:function(A,t){if("svg"===A)return this.documentElement;var e=this.defaultView.customElements.get(A);e||(console.warn("Unsupported tagName: ",A),e="tspan"===A?ps:ns);var n=new e(t);return n.ownerDocument=this,n}},{key:"createElementNS",value:function(A,t,e){return this.createElement(t,e)}},{key:"cloneNode",value:function(A){throw Error(be)}},{key:"destroy",value:function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(A){}}},{key:"elementsFromBBox",value:function(A,t,e,n){var r=[],i=function(a){if(a.isInteractive()&&!a.isCulled()){var o=a.parsedStyle.pointerEvents;if(!["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(void 0===o?"auto":o)||a.isVisible()){var s=a.getTransformedGeometryBounds(!0);s&&!me.isEmpty(s)&&(A>s.max[0]||s.min[0]>e||t>s.max[1]||s.min[1]>n||r.push(a))}a.childNodes&&a.childNodes.forEach(function(A){A instanceof jo&&i(A)})}};return i(this.documentElement),r.sort(function(A,t){return t.sortable.renderOrder-A.sortable.renderOrder}),r}},{key:"elementFromPointSync",value:function(A,t){var e=this.defaultView.canvas2Viewport({x:A,y:t}),n=e.x,r=e.y,i=this.defaultView.getConfig();if(0>n||0>r||n>i.width||r>i.height)return null;var a=this.defaultView.viewport2Client({x:n,y:r}),o=a.x,s=a.y,u=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:A,y:t,viewportX:n,viewportY:r,clientX:o,clientY:s},picked:[]}).picked;return u&&u[0]||this.documentElement}},{key:"elementFromPoint",value:(n=se(ae().mark(function A(t,e){var n,r,i,a,o,s,u,c,l,h;return ae().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:if(n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,a=this.defaultView.getConfig(),o=a.width,s=a.height,!(0>r||0>i||r>o||i>s)){A.next=1;break}return A.abrupt("return",null);case 1:return u=this.defaultView.viewport2Client({x:r,y:i}),c=u.x,l=u.y,A.next=2,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:c,clientY:l},picked:[]});case 2:return A.abrupt("return",(h=A.sent.picked)&&h[0]||this.documentElement);case 3:case"end":return A.stop()}},A,this)})),function(A,t){return n.apply(this,arguments)})},{key:"elementsFromPointSync",value:function(A,t){var e=this.defaultView.canvas2Viewport({x:A,y:t}),n=e.x,r=e.y,i=this.defaultView.getConfig();if(0>n||0>r||n>i.width||r>i.height)return[];var a=this.defaultView.viewport2Client({x:n,y:r}),o=a.x,s=a.y,u=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:A,y:t,viewportX:n,viewportY:r,clientX:o,clientY:s},picked:[]}).picked;return u[u.length-1]!==this.documentElement&&u.push(this.documentElement),u}},{key:"elementsFromPoint",value:(e=se(ae().mark(function A(t,e){var n,r,i,a,o,s,u,c,l,h;return ae().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:if(n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,a=this.defaultView.getConfig(),o=a.width,s=a.height,!(0>r||0>i||r>o||i>s)){A.next=1;break}return A.abrupt("return",[]);case 1:return u=this.defaultView.viewport2Client({x:r,y:i}),c=u.x,l=u.y,A.next=2,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:c,clientY:l},picked:[]});case 2:return(h=A.sent.picked)[h.length-1]!==this.documentElement&&h.push(this.documentElement),A.abrupt("return",h);case 3:case"end":return A.stop()}},A,this)})),function(A,t){return e.apply(this,arguments)})},{key:"appendChild",value:function(A,t){throw Error(ke)}},{key:"insertBefore",value:function(A,t){throw Error(ke)}},{key:"removeChild",value:function(A,t){throw Error(ke)}},{key:"replaceChild",value:function(A,t,e){throw Error(ke)}},{key:"append",value:function(){throw Error(ke)}},{key:"prepend",value:function(){throw Error(ke)}},{key:"getElementById",value:function(A){return this.documentElement.getElementById(A)}},{key:"getElementsByName",value:function(A){return this.documentElement.getElementsByName(A)}},{key:"getElementsByTagName",value:function(A){return this.documentElement.getElementsByTagName(A)}},{key:"getElementsByClassName",value:function(A){return this.documentElement.getElementsByClassName(A)}},{key:"querySelector",value:function(A){return this.documentElement.querySelector(A)}},{key:"querySelectorAll",value:function(A){return this.documentElement.querySelectorAll(A)}},{key:"find",value:function(A){return this.documentElement.find(A)}},{key:"findAll",value:function(A){return this.documentElement.findAll(A)}}]);var e,n}(Ao),ms=function(){function A(t){a(this,A),this.strategies=t}return s(A,[{key:"apply",value:function(t){var e=t.config,n=t.camera,r=t.renderingService,i=t.renderingContext,a=this.strategies;r.hooks.cull.tap(A.tag,function(A){if(A){var t,r=A.cullable;if(r.visible=0===a.length?i.unculledEntities.indexOf(A.entity)>-1:a.every(function(t){return t.isVisible(n,A)}),!A.isCulled()&&A.isVisible())return A;var o=!0===(null===(t=e.future)||void 0===t?void 0:t.experimentalCancelEventPropagation);return A.dispatchEvent(new qa(oo.CULLED),o,o),null}return A}),r.hooks.afterRender.tap(A.tag,function(A){A.cullable.visibilityPlaneMask=-1})}}])}();ms.tag="Culling";var Cs=function(){function A(){var t=this;a(this,A),this.autoPreventDefault=!1,this.rootPointerEvent=new za(null),this.rootWheelEvent=new ja(null),this.onPointerMove=function(A){var e,n=null===(e=t.context.renderingContext.root)||void 0===e||null===(e=e.ownerDocument)||void 0===e?void 0:e.defaultView;if(!n.supportsTouchEvents||"touch"!==A.pointerType){var r,i=ue(t.normalizeToPointerEvent(A,n));try{for(i.s();!(r=i.n()).done;){var a=t.bootstrapEvent(t.rootPointerEvent,r.value,n,A);t.context.eventService.mapEvent(a)}}catch(A){i.e(A)}finally{i.f()}t.setCursor(t.context.eventService.cursor)}},this.onClick=function(A){var e,n,r=null===(e=t.context.renderingContext.root)||void 0===e||null===(e=e.ownerDocument)||void 0===e?void 0:e.defaultView,i=ue(t.normalizeToPointerEvent(A,r));try{for(i.s();!(n=i.n()).done;){var a=t.bootstrapEvent(t.rootPointerEvent,n.value,r,A);t.context.eventService.mapEvent(a)}}catch(A){i.e(A)}finally{i.f()}t.setCursor(t.context.eventService.cursor)}}return s(A,[{key:"apply",value:function(t){var e=this;this.context=t;var n=t.renderingService,r=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler(function(A){return e.context.renderingService.hooks.pickSync.call({position:A,picked:[],topmost:!0}).picked[0]||null}),n.hooks.pointerWheel.tap(A.tag,function(A){var t=e.normalizeWheelEvent(A);e.context.eventService.mapEvent(t)}),n.hooks.pointerDown.tap(A.tag,function(A){if(!r.supportsTouchEvents||"touch"!==A.pointerType){var t=e.normalizeToPointerEvent(A,r);if(e.autoPreventDefault&&t[0].isNormalized)(A.cancelable||!("cancelable"in A))&&A.preventDefault();var n,i=ue(t);try{for(i.s();!(n=i.n()).done;){var a=e.bootstrapEvent(e.rootPointerEvent,n.value,r,A);e.context.eventService.mapEvent(a)}}catch(A){i.e(A)}finally{i.f()}e.setCursor(e.context.eventService.cursor)}}),n.hooks.pointerUp.tap(A.tag,function(A){if(!r.supportsTouchEvents||"touch"!==A.pointerType){var t,n=e.context.contextService.getDomElement(),i=e.context.eventService.isNativeEventFromCanvas(n,A)?"":"outside",a=ue(e.normalizeToPointerEvent(A,r));try{for(a.s();!(t=a.n()).done;){var o=e.bootstrapEvent(e.rootPointerEvent,t.value,r,A);o.type+=i,e.context.eventService.mapEvent(o)}}catch(A){a.e(A)}finally{a.f()}e.setCursor(e.context.eventService.cursor)}}),n.hooks.pointerMove.tap(A.tag,this.onPointerMove),n.hooks.pointerOver.tap(A.tag,this.onPointerMove),n.hooks.pointerOut.tap(A.tag,this.onPointerMove),n.hooks.click.tap(A.tag,this.onClick),n.hooks.pointerCancel.tap(A.tag,function(A){var t,n=ue(e.normalizeToPointerEvent(A,r));try{for(n.s();!(t=n.n()).done;){var i=e.bootstrapEvent(e.rootPointerEvent,t.value,r,A);e.context.eventService.mapEvent(i)}}catch(A){n.e(A)}finally{n.f()}e.setCursor(e.context.eventService.cursor)})}},{key:"bootstrapEvent",value:function(A,t,e,n){A.view=e,A.originalEvent=null,A.nativeEvent=n,A.pointerId=t.pointerId,A.width=t.width,A.height=t.height,A.isPrimary=t.isPrimary,A.pointerType=t.pointerType,A.pressure=t.pressure,A.tangentialPressure=t.tangentialPressure,A.tiltX=t.tiltX,A.tiltY=t.tiltY,A.twist=t.twist,this.transferMouseData(A,t);var r=this.context.eventService.client2Viewport({x:t.clientX,y:t.clientY}),i=r.y;A.viewport.x=r.x,A.viewport.y=i;var a=this.context.eventService.viewport2Canvas(A.viewport),o=a.y;return A.canvas.x=a.x,A.canvas.y=o,A.global.copyFrom(A.canvas),A.offset.copyFrom(A.canvas),A.isTrusted=n.isTrusted,"pointerleave"===A.type&&(A.type="pointerout"),A.type.startsWith("mouse")&&(A.type=A.type.replace("mouse","pointer")),A.type.startsWith("touch")&&(A.type=ia[A.type]||A.type),A}},{key:"normalizeWheelEvent",value:function(A){var t=this.rootWheelEvent;this.transferMouseData(t,A),t.deltaMode=A.deltaMode,t.deltaX=A.deltaX,t.deltaY=A.deltaY,t.deltaZ=A.deltaZ;var e=this.context.eventService.client2Viewport({x:A.clientX,y:A.clientY}),n=e.y;t.viewport.x=e.x,t.viewport.y=n;var r=this.context.eventService.viewport2Canvas(t.viewport),i=r.y;return t.canvas.x=r.x,t.canvas.y=i,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.nativeEvent=A,t.type=A.type,t}},{key:"transferMouseData",value:function(A,t){A.isTrusted=t.isTrusted,A.srcElement=t.srcElement,A.timeStamp=aa.now(),A.type=t.type,A.altKey=t.altKey,A.metaKey=t.metaKey,A.shiftKey=t.shiftKey,A.ctrlKey=t.ctrlKey,A.button=t.button,A.buttons=t.buttons,A.client.x=t.clientX,A.client.y=t.clientY,A.movement.x=t.movementX,A.movement.y=t.movementY,A.page.x=t.pageX,A.page.y=t.pageY,A.screen.x=t.screenX,A.screen.y=t.screenY,A.relatedTarget=null}},{key:"setCursor",value:function(A){this.context.contextService.applyCursorStyle(A||this.context.config.cursor||"default")}},{key:"normalizeToPointerEvent",value:function(A,t){var e=[];if(t.isTouchEvent(A))for(var n=0;A.changedTouches.length>n;n++){var r=A.changedTouches[n];JA(r.button)&&(r.button=0),JA(r.buttons)&&(r.buttons=1),JA(r.isPrimary)&&(r.isPrimary=1===A.touches.length&&"touchstart"===A.type),JA(r.width)&&(r.width=r.radiusX||1),JA(r.height)&&(r.height=r.radiusY||1),JA(r.tiltX)&&(r.tiltX=0),JA(r.tiltY)&&(r.tiltY=0),JA(r.pointerType)&&(r.pointerType="touch"),JA(r.pointerId)&&(r.pointerId=r.identifier||0),JA(r.pressure)&&(r.pressure=r.force||.5),JA(r.twist)&&(r.twist=0),JA(r.tangentialPressure)&&(r.tangentialPressure=0),r.isNormalized=!0,r.type=A.type,e.push(r)}else if(t.isMouseEvent(A)){var i=A;JA(i.isPrimary)&&(i.isPrimary=!0),JA(i.width)&&(i.width=1),JA(i.height)&&(i.height=1),JA(i.tiltX)&&(i.tiltX=0),JA(i.tiltY)&&(i.tiltY=0),JA(i.pointerType)&&(i.pointerType="mouse"),JA(i.pointerId)&&(i.pointerId=1),JA(i.pressure)&&(i.pressure=.5),JA(i.twist)&&(i.twist=0),JA(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,e.push(i)}else e.push(A);return e}}])}();Cs.tag="Event";var Qs=[le.CIRCLE,le.ELLIPSE,le.IMAGE,le.RECT,le.LINE,le.POLYLINE,le.POLYGON,le.TEXT,le.PATH,le.HTML],Fs=function(){return s(function A(){a(this,A)},[{key:"isVisible",value:function(A,t){var e,n=t.cullable;if(!n.enable)return!0;var r=t.getRenderBounds();if(me.isEmpty(r))return!1;var i=A.getFrustum(),a=null===(e=t.parentNode)||void 0===e||null===(e=e.cullable)||void 0===e?void 0:e.visibilityPlaneMask;return n.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(t,r,a||Qe.INDETERMINATE,i.planes),n.visible=n.visibilityPlaneMask!==Qe.OUTSIDE,n.visible}},{key:"computeVisibilityWithPlaneMask",value:function(A,t,e,n){if(e===Qe.OUTSIDE||e===Qe.INSIDE)return e;for(var r=Qe.INSIDE,i=Qs.indexOf(A.nodeName)>-1,a=0,o=n.length;o>a;++a){var s=1<<a;if(0!==(e&s)&&(!i||4!==a&&5!==a)){var u=n[a],c=u.normal,l=u.distance;if(0>dA(c,t.getPositiveFarPoint(n[a]))+l)return Qe.OUTSIDE;0>dA(c,t.getNegativeFarPoint(n[a]))+l&&(r|=s)}}return r}}])}(),Us=function(){function A(){a(this,A),this.mutationRecords=[],this.isFirstTimeRendering=!0,this.isFirstTimeRenderingFinished=!1}return s(A,[{key:"apply",value:function(t){var e,n=this,r=t.renderingService,i=t.renderingContext.root.ownerDocument.defaultView,a=function(A){r.dirty()},o=function(A){var t;(t=n.mutationRecords).push.apply(t,l(A.detail)),r.dirty()},s=function(A){No.enableSizeAttenuation&&No.styleValueRegistry.updateSizeAttenuation(A.target,i.getCamera().getZoom())},u=function(A){No.sceneGraphService.dirtyToRoot(A.target),r.dirty()};r.hooks.init.tap(A.tag,function(){i.addEventListener(oo.MOUNTED,s),i.addEventListener(oo.UNMOUNTED,u),i.addEventListener(oo.ATTR_MODIFIED,a),i.addEventListener(oo.BOUNDS_CHANGED,o)}),r.hooks.destroy.tap(A.tag,function(){i.removeEventListener(oo.MOUNTED,s),i.removeEventListener(oo.UNMOUNTED,u),i.removeEventListener(oo.ATTR_MODIFIED,a),i.removeEventListener(oo.BOUNDS_CHANGED,o),n.mutationRecords=[]});var c=null!==(e=No.globalThis.requestIdleCallback)&&void 0!==e?e:pa.bind(No.globalThis);r.hooks.endFrame.tap(A.tag,function(){n.isFirstTimeRendering&&(n.isFirstTimeRendering=!1,c(function(){n.isFirstTimeRenderingFinished=!0})),n.mutationRecords=[]})}}])}();Us.tag="Prepare";var Es,bs,ks=function(A){return A.READY="ready",A.BEFORE_RENDER="beforerender",A.RERENDER="rerender",A.AFTER_RENDER="afterrender",A.BEFORE_DESTROY="beforedestroy",A.AFTER_DESTROY="afterdestroy",A.RESIZE="resize",A.DIRTY_RECTANGLE="dirtyrectangle",A.RENDERER_CHANGED="rendererchanged",A}({}),xs=new qa(oo.MOUNTED),Hs=new qa(oo.UNMOUNTED),Is=new qa(ks.BEFORE_RENDER),Ts=new qa(ks.RERENDER),Ms=new qa(ks.AFTER_RENDER),Ss=function(A){function t(A){var e;a(this,t),(e=B(this,t)).Element=jo,e.inited=!1,e.context={};var n=A.container,r=A.canvas,o=A.renderer,s=A.width,u=A.height,c=A.background,l=A.cursor,h=A.supportsMutipleCanvasesInOneContainer,d=A.cleanUpOnDestroy,f=void 0===d||d,g=A.offscreenCanvas,p=A.requestAnimationFrame,v=A.cancelAnimationFrame,w=A.createImage,y=A.supportsTouchEvents,m=A.supportsPointerEvents,C=A.isTouchEvent,Q=A.isMouseEvent,F=A.dblClickSpeed,U=s,E=u,b=A.devicePixelRatio||Aa&&window.devicePixelRatio||1;return b=1>b?1:Math.ceil(b),r&&(U=s||function(A){var t=ra(A,"width");return"auto"===t?A.offsetWidth:parseFloat(t)}(r)||r.width/b,E=u||function(A){var t=ra(A,"height");return"auto"===t?A.offsetHeight:parseFloat(t)}(r)||r.height/b),e.customElements=new vs,e.devicePixelRatio=b,e.requestAnimationFrame=null!=p?p:pa.bind(No.globalThis),e.cancelAnimationFrame=null!=v?v:va.bind(No.globalThis),e.createImage=null!=w?w:function(){return new window.Image},e.supportsTouchEvents=null!=y?y:"ontouchstart"in No.globalThis,e.supportsPointerEvents=null!=m?m:!!No.globalThis.PointerEvent,e.isTouchEvent=null!=C?C:function(A){return e.supportsTouchEvents&&A instanceof No.globalThis.TouchEvent},e.isMouseEvent=null!=Q?Q:function(A){return!No.globalThis.MouseEvent||A instanceof No.globalThis.MouseEvent&&(!e.supportsPointerEvents||!(A instanceof No.globalThis.PointerEvent))},g&&(No.offscreenCanvas=g),e.document=new ys,e.document.defaultView=e,h||function(A,t,e){if(A){var n="string"==typeof A?document.getElementById(A):A;$i.has(n)&&$i.get(n).destroy(e),$i.set(n,t)}}(n,e,f),e.initRenderingContext(i(i({},A),{},{width:U,height:E,background:null!=c?c:"transparent",cursor:null!=l?l:"default",cleanUpOnDestroy:f,devicePixelRatio:b,requestAnimationFrame:e.requestAnimationFrame,cancelAnimationFrame:e.cancelAnimationFrame,createImage:e.createImage,supportsTouchEvents:e.supportsTouchEvents,supportsPointerEvents:e.supportsPointerEvents,isTouchEvent:e.isTouchEvent,isMouseEvent:e.isMouseEvent,dblClickSpeed:null!=F?F:200})),e.initDefaultCamera(U,E,o.clipSpaceNearZ),e.initRenderer(o,!0),e}return p(t,A),s(t,[{key:"initRenderingContext",value:function(A){this.context.config=A,this.context.renderingContext={root:this.document.documentElement,unculledEntities:[],renderListCurrentFrame:[],renderReasons:new Set,force:!1,dirty:!1}}},{key:"initDefaultCamera",value:function(A,t,e){var n=this,r=new No.CameraContribution;r.clipSpaceNearZ=e,r.setType(We.EXPLORING,Je.DEFAULT).setPosition(A/2,t/2,500).setFocalPoint(A/2,t/2,0).setOrthographic(A/-2,A/2,t/2,t/-2,.1,1e3),r.canvas=this,r.eventEmitter.on(ze.UPDATED,function(){n.context.renderingContext.renderReasons.add(no.CAMERA_CHANGED),No.enableSizeAttenuation&&n.getConfig().renderer.getConfig().enableSizeAttenuation&&n.updateSizeAttenuation()}),this.context.camera=r}},{key:"updateSizeAttenuation",value:function(){var A=this.getCamera().getZoom();this.document.documentElement.forEach(function(t){No.styleValueRegistry.updateSizeAttenuation(t,A)})}},{key:"getConfig",value:function(){return this.context.config}},{key:"getRoot",value:function(){return this.document.documentElement}},{key:"getCamera",value:function(){return this.context.camera}},{key:"getContextService",value:function(){return this.context.contextService}},{key:"getEventService",value:function(){return this.context.eventService}},{key:"getRenderingService",value:function(){return this.context.renderingService}},{key:"getRenderingContext",value:function(){return this.context.renderingContext}},{key:"getStats",value:function(){return this.getRenderingService().getStats()}},{key:"ready",get:function(){var A=this;return this.readyPromise||(this.readyPromise=new Promise(function(t){A.resolveReadyPromise=function(){t(A)}}),this.inited&&this.resolveReadyPromise()),this.readyPromise}},{key:"destroy",value:function(){var A,t=0>=arguments.length||void 0===arguments[0]||arguments[0],e=arguments.length>1?arguments[1]:void 0;Gn.clearCache();var n=!0===(null===(A=this.getConfig().future)||void 0===A?void 0:A.experimentalCancelEventPropagation);e||this.dispatchEvent(new qa(ks.BEFORE_DESTROY),n,n),this.frameId&&this.cancelAnimationFrame(this.frameId);var r=this.getRoot();t&&(this.unmountChildren(r),this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),e||this.dispatchEvent(new qa(ks.AFTER_DESTROY),n,n);var i=function(A){A.currentTarget=null,A.manager=null,A.target=null,A.relatedNode=null};i(xs),i(Hs),i(Is),i(Ts),i(Ms),i(Jo),i(Go),i(Vo),i(_o),No.textService.clearCache()}},{key:"changeSize",value:function(A,t){this.resize(A,t)}},{key:"resize",value:function(A,t){var e,n=this.context.config;n.width=A,n.height=t,this.getContextService().resize(A,t);var r=this.context.camera,i=r.getProjectionMode();r.setPosition(A/2,t/2,500).setFocalPoint(A/2,t/2,0),i===Ze.ORTHOGRAPHIC?r.setOrthographic(A/-2,A/2,t/2,t/-2,r.getNear(),r.getFar()):r.setAspect(A/t);var a=!0===(null===(e=n.future)||void 0===e?void 0:e.experimentalCancelEventPropagation);this.dispatchEvent(new qa(ks.RESIZE,{width:A,height:t}),a,a)}},{key:"appendChild",value:function(A,t){return this.document.documentElement.appendChild(A,t)}},{key:"insertBefore",value:function(A,t){return this.document.documentElement.insertBefore(A,t)}},{key:"removeChild",value:function(A){return this.document.documentElement.removeChild(A)}},{key:"removeChildren",value:function(){this.document.documentElement.removeChildren()}},{key:"destroyChildren",value:function(){this.document.documentElement.destroyChildren()}},{key:"render",value:function(A){var t,e=this;A&&(Is.detail=A,Ms.detail=A);var n=!0===(null===(t=this.getConfig().future)||void 0===t?void 0:t.experimentalCancelEventPropagation);this.dispatchEvent(Is,n,n),this.getRenderingService().render(this,A,function(){e.dispatchEvent(Ts,n,n)}),this.dispatchEvent(Ms,n,n)}},{key:"run",value:function(){var A=this,t=function(e,n){A.render(n),A.frameId=A.requestAnimationFrame(t)};t()}},{key:"initRenderer",value:function(A){var t=this,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!A)throw Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new Cs,new Us,new ms([new Fs])),this.loadRendererContainerModule(A),this.context.contextService=new this.context.ContextService(i(i({},No),this.context)),this.context.renderingService=new ro(No,this.context),this.context.eventService=new to(No,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(A,e,!0)):this.context.contextService.initAsync().then(function(){t.initRenderingService(A,e)}).catch(function(A){console.error(A)})}},{key:"initRenderingService",value:function(A){var t=this,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.context.renderingService.init(function(){var r;t.inited=!0;var i=!0===(null===(r=t.getConfig().future)||void 0===r?void 0:r.experimentalCancelEventPropagation);e?n?t.requestAnimationFrame(function(){t.dispatchEvent(new qa(ks.READY),i,i)}):t.dispatchEvent(new qa(ks.READY),i,i):t.dispatchEvent(new qa(ks.RENDERER_CHANGED),i,i),t.readyPromise&&t.resolveReadyPromise(),e||t.getRoot().forEach(function(A){var t,e;null===(t=(e=A).dirty)||void 0===t||t.call(e,!0,!0)}),t.mountChildren(t.getRoot()),A.getConfig().enableAutoRendering&&t.run()})}},{key:"loadRendererContainerModule",value:function(A){var t=this;A.getPlugins().forEach(function(A){A.context=t.context,A.init(No)})}},{key:"setRenderer",value:function(A){var t=this.getConfig();if(t.renderer!==A){var e=t.renderer;t.renderer=A,this.destroy(!1,!0),l((null==e?void 0:e.getPlugins())||[]).reverse().forEach(function(A){A.destroy(No)}),this.initRenderer(A)}}},{key:"setCursor",value:function(A){this.getConfig().cursor=A,this.getContextService().applyCursorStyle(A)}},{key:"unmountChildren",value:function(A){var t=this;if(A.childNodes.forEach(function(A){t.unmountChildren(A)}),this.inited){if(A.isMutationObserved)A.dispatchEvent(Hs);else{var e,n=!0===(null===(e=this.getConfig().future)||void 0===e?void 0:e.experimentalCancelEventPropagation);Hs.target=A,this.dispatchEvent(Hs,!0,n)}A!==this.document.documentElement&&(A.ownerDocument=null),A.isConnected=!1}A.isCustomElement&&A.disconnectedCallback&&A.disconnectedCallback()}},{key:"mountChildren",value:function(A){var t=this,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:oa(A);if(this.inited){if(!A.isConnected&&(A.ownerDocument=this.document,A.isConnected=!0,!e))if(A.isMutationObserved)A.dispatchEvent(xs);else{var n,r=!0===(null===(n=this.getConfig().future)||void 0===n?void 0:n.experimentalCancelEventPropagation);xs.target=A,this.dispatchEvent(xs,!0,r)}}else console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",A.nodeName);A.childNodes.forEach(function(A){t.mountChildren(A,e)}),A.isCustomElement&&A.connectedCallback&&A.connectedCallback()}},{key:"mountFragment",value:function(A){this.mountChildren(A,!1)}},{key:"client2Viewport",value:function(A){return this.getEventService().client2Viewport(A)}},{key:"viewport2Client",value:function(A){return this.getEventService().viewport2Client(A)}},{key:"viewport2Canvas",value:function(A){return this.getEventService().viewport2Canvas(A)}},{key:"canvas2Viewport",value:function(A){return this.getEventService().canvas2Viewport(A)}},{key:"getPointByClient",value:function(A,t){return this.client2Viewport({x:A,y:t})}},{key:"getClientByPoint",value:function(A,t){return this.viewport2Client({x:A,y:t})}}])}($a),Ls=0,Ds=new WeakMap,Ps=function(){function A(t,e){a(this,A),this.addedNodes=[],this.attributeName=null,this.attributeNamespace=null,this.nextSibling=null,this.oldValue=null,this.previousSibling=null,this.removedNodes=[],this.type=t,this.target=e}return s(A,null,[{key:"copy",value:function(t){var e=new A(t.type,t.target);return e.addedNodes=t.addedNodes.slice(),e.removedNodes=t.removedNodes.slice(),e.previousSibling=t.previousSibling,e.nextSibling=t.nextSibling,e.attributeName=t.attributeName,e.attributeNamespace=t.attributeNamespace,e.oldValue=t.oldValue,e}}])}(),Ns=function(){return s(function A(t,e,n){a(this,A),this.transientObservedNodes=[],this.observer=t,this.target=e,this.options=n},[{key:"enqueue",value:function(A){var t=this.observer.records,e=t.length;if(t.length>0){var n=function(A,t){return A===t?A:bs&&function(A){return A===bs||A===Es}(A)?bs:null}(t[e-1],A);if(n)return void(t[e-1]=n)}else Vs.push(this.observer),Gs||(Gs=!0,void 0!==No.globalThis?No.globalThis.setTimeout(_s):_s());t[e]=A}},{key:"addListeners",value:function(){this.addListeners_(this.target)}},{key:"addListeners_",value:function(A){var t=this.options;t.attributes&&A.addEventListener(oo.ATTR_MODIFIED,this,!0),t.childList&&A.addEventListener(oo.INSERTED,this,!0),(t.childList||t.subtree)&&A.addEventListener(oo.REMOVED,this,!0)}},{key:"removeListeners",value:function(){this.removeListeners_(this.target)}},{key:"removeListeners_",value:function(A){var t=this.options;t.attributes&&A.removeEventListener(oo.ATTR_MODIFIED,this,!0),t.childList&&A.removeEventListener(oo.INSERTED,this,!0),(t.childList||t.subtree)&&A.removeEventListener(oo.REMOVED,this,!0)}},{key:"removeTransientObservers",value:function(){var A=this.transientObservedNodes;this.transientObservedNodes=[],A.forEach(function(A){this.removeListeners_(A);for(var t=Ds.get(A),e=0;t.length>e;e++)if(t[e]===this){t.splice(e,1);break}},this)}},{key:"handleEvent",value:function(A){var t,e;switch(A.stopImmediatePropagation(),A.type){case oo.ATTR_MODIFIED:var n=A.attrName,r=A.relatedNode.namespaceURI;(t=Ks("attributes",e=A.target)).attributeName=n,t.attributeNamespace=r;var i=A.attrChange===so.ADDITION?null:A.prevValue;Rs(e,function(A){if(A.attributes&&(!A.attributeFilter||!A.attributeFilter.length||-1!==A.attributeFilter.indexOf(n)||-1!==A.attributeFilter.indexOf(r)))return A.attributeOldValue?function(A){return bs||((bs=Ps.copy(Es)).oldValue=A,bs)}(i):t});break;case oo.REMOVED:case oo.INSERTED:var a,o,s=A.target;A.type===oo.INSERTED?(a=[s],o=[]):(a=[],o=[s]);var u=s.previousSibling,c=s.nextSibling;(t=Ks("childList",e=A.relatedNode)).addedNodes=a,t.removedNodes=o,t.previousSibling=u,t.nextSibling=c,Rs(e,function(A){if(A.childList)return t})}Es=bs=void 0}}])}(),Os=function(){return s(function A(t){a(this,A),this.nodes=[],this.records=[],this.uid=Ls++,this.callback=t},[{key:"observe",value:function(A,t){if(!t.childList&&!t.attributes&&!t.characterData||t.attributeOldValue&&!t.attributes||t.attributeFilter&&t.attributeFilter.length&&!t.attributes||t.characterDataOldValue&&!t.characterData)throw new SyntaxError;var e,n=Ds.get(A);n||Ds.set(A,n=[]);for(var r=0;n.length>r;r++)if(n[r].observer===this){(e=n[r]).removeListeners(),e.options=t;break}e||(e=new Ns(this,A,t),n.push(e),this.nodes.push(A)),e.addListeners()}},{key:"disconnect",value:function(){var A=this;this.nodes.forEach(function(t){for(var e=Ds.get(t),n=0;e.length>n;n++){var r=e[n];if(r.observer===A){r.removeListeners(),e.splice(n,1);break}}},this),this.records=[]}},{key:"takeRecords",value:function(){var A=this.records;return this.records=[],A}}])}();function Ks(A,t){return Es=new Ps(A,t)}function Rs(A,t){for(var e=A;e;e=e.parentNode){var n=Ds.get(e);if(n)for(var r=0;n.length>r;r++){var i=n[r],a=i.options;if(e===A||a.subtree){var o=t(a);o&&i.enqueue(o)}}}}var Gs=!1,Vs=[];function _s(){Gs=!1;var A=Vs;Vs=[],A.sort(function(A,t){return A.uid-t.uid});var t=!1;A.forEach(function(A){var e=A.takeRecords();!function(A){A.nodes.forEach(function(t){var e=Ds.get(t);e&&e.forEach(function(t){t.observer===A&&t.removeTransientObservers()})})}(A),e.length&&(A.callback(e,A),t=!0)}),t&&_s()}var Xs=function(){return s(function A(){a(this,A),this.cacheStore=new Map},[{key:"onRefAdded",value:function(A){}},{key:"has",value:function(A){return this.cacheStore.has(A)}},{key:"put",value:function(A,t,e){return!this.cacheStore.has(A)&&(this.cacheStore.set(A,{value:t,counter:new Set([e.entity])}),this.onRefAdded(e),!0)}},{key:"get",value:function(A,t){var e=this.cacheStore.get(A);return e?(e.counter.has(t.entity)||(e.counter.add(t.entity),this.onRefAdded(t)),e.value):null}},{key:"update",value:function(A,t,e){var n=this.cacheStore.get(A);return!!n&&(n.value=i(i({},n.value),t),n.counter.has(e.entity)||(n.counter.add(e.entity),this.onRefAdded(e)),!0)}},{key:"release",value:function(A,t){var e=this.cacheStore.get(A);return!!e&&(e.counter.delete(t.entity),e.counter.size>0||this.cacheStore.delete(A),!0)}},{key:"releaseRef",value:function(A){var t=this;Array.from(this.cacheStore.keys()).forEach(function(e){t.release(e,A)})}},{key:"getSize",value:function(){return this.cacheStore.size}},{key:"clear",value:function(){this.cacheStore.clear()}}])}(),Ys=[],Ws=[],Js=function(){function A(){a(this,A)}return s(A,null,[{key:"stop",value:function(){A.rafId&&((arguments.length>0&&void 0!==arguments[0]?arguments[0]:A.api).cancelAnimationFrame(A.rafId),A.rafId=null)}},{key:"executeTask",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:A.api;(Ys.length>0||Ws.length>0)&&(Ws.forEach(function(A){return A()}),Ws=Ys.splice(0,A.TASK_NUM_PER_FRAME),A.rafId=t.requestAnimationFrame(function(){A.executeTask(t)}))}},{key:"sliceImage",value:function(t,e,n,r){for(var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:A.api,o=t.naturalWidth||t.width,s=t.naturalHeight||t.height,u=e-i,c=n-i,l=Math.ceil(o/u),h=Math.ceil(s/c),d={tileSize:[e,n],gridSize:[h,l],tiles:Array(h).fill(null).map(function(){return Array(l).fill(null)})},f=function(A){for(var i=function(i){Ys.push(function(){var l=i*u,h=A*c,f=[Math.min(e,o-l),Math.min(n,s-h)],B=f[0],g=f[1],p=a.createCanvas();p.width=e,p.height=n,p.getContext("2d").drawImage(t,l,h,B,g,0,0,B,g),d.tiles[A][i]={x:l,y:h,tileX:i,tileY:A,data:p},r()})},h=0;l>h;h++)i(h)},B=0;h>B;B++)f(B);return A.stop(),A.executeTask(),d}}])}();Js.TASK_NUM_PER_FRAME=10;var Zs=new Xs;Zs.onRefAdded=function(A){var t=this;A.addEventListener(oo.DESTROY,function(){t.releaseRef(A)},{once:!0})};var zs=function(){return s(function A(t,e){a(this,A),this.gradientCache={},this.patternCache={},this.context=t,this.runtime=e},[{key:"getImageSync",value:function(A,t,e){var n=GA(A)?A:A.src;if(Zs.has(n)){var r=Zs.get(n,t);if(r.img.complete)return null==e||e(r),r}return this.getOrCreateImage(A,t).then(function(A){null==e||e(A)}).catch(function(A){console.error(A)}),null}},{key:"getOrCreateImage",value:function(A,t){var e=this,n=GA(A)?A:A.src;if(!GA(A)&&!Zs.has(n)){var r={img:A,size:[A.naturalWidth||A.width,A.naturalHeight||A.height],tileSize:js(A)};Zs.put(n,r,t)}if(Zs.has(n)){var i=Zs.get(n,t);return i.img.complete?Promise.resolve(i):new Promise(function(A,t){i.img.addEventListener("load",function(){i.size=[i.img.naturalWidth||i.img.width,i.img.naturalHeight||i.img.height],i.tileSize=js(i.img),A(i)}),i.img.addEventListener("error",function(A){t(A)})})}return new Promise(function(A,r){var i=e.context.config.createImage();if(i){var a={img:i,size:[0,0],tileSize:js(i)};Zs.put(n,a,t),i.onload=function(){a.size=[i.naturalWidth||i.width,i.naturalHeight||i.height],a.tileSize=js(a.img),A(a)},i.onerror=function(A){r(A)},i.crossOrigin="Anonymous",i.src=n}})}},{key:"createDownSampledImage",value:(t=se(ae().mark(function A(t,e){var n,r,a,o,s,u,c,l,h,d,f,B,g,p;return ae().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=1,this.getOrCreateImage(t,e);case 1:if(void 0===(n=A.sent).downSamplingRate){A.next=2;break}return A.abrupt("return",n);case 2:if(s=void 0===(o=(a="boolean"==typeof(r=this.context.config.enableLargeImageOptimization)?{}:r).maxDownSampledImageSize)?2048:o,c=void 0===(u=a.downSamplingRateThreshold)?.5:u,l=this.runtime.globalThis.createImageBitmap,h=v(n.size,2),B=n.img,g=Math.min((s+s)/((d=h[0])+(f=h[1])),Math.max(.01,Math.min(c,.5))),p=i(i({},n),{},{downSamplingRate:g}),Zs.update(n.img.src,p,e),!l){A.next=7;break}return A.prev=3,A.next=4,l(n.img,{resizeWidth:d*g,resizeHeight:f*g});case 4:B=A.sent,A.next=6;break;case 5:A.prev=5,A.catch(3),g=1;case 6:A.next=8;break;case 7:g=1;case 8:return p=i(i({},this.getImageSync(t,e)),{},{downSampled:B,downSamplingRate:g}),Zs.update(n.img.src,p,e),A.abrupt("return",p);case 9:case"end":return A.stop()}},A,this,[[3,5]])})),function(A,e){return t.apply(this,arguments)})},{key:"createImageTiles",value:(A=se(ae().mark(function A(t,e,n,r){var a,o,s;return ae().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=1,this.getOrCreateImage(t,r);case 1:return a=A.sent,Js.api={requestAnimationFrame:(o=r.ownerDocument.defaultView).requestAnimationFrame,cancelAnimationFrame:o.cancelAnimationFrame,createCanvas:function(){return eo.createCanvas()}},s=i(i({},a),Js.sliceImage(a.img,a.tileSize[0],a.tileSize[0],n)),Zs.update(a.img.src,s,r),A.abrupt("return",s);case 2:case"end":return A.stop()}},A,this)})),function(t,e,n,r){return A.apply(this,arguments)})},{key:"releaseImage",value:function(A,t){Zs.release(GA(A)?A:A.src,t)}},{key:"releaseImageRef",value:function(A){Zs.releaseRef(A)}},{key:"getOrCreatePatternSync",value:function(A,t,e,n,r,i,a){var o=this.generatePatternKey(t);if(o&&this.patternCache[o])return this.patternCache[o];var s,u=t.image,c=t.repetition,l=t.transform,h=!1;if(GA(u)){var d=this.getImageSync(u,A,a);s=null==d?void 0:d.img}else n?(s=n,h=!0):s=u;var f,B=s&&e.createPattern(s,c);B&&(f=l?La(pi(l),new jo({})):k(F()),h&&S(f,f,[1/r,1/r,1]),B.setTransform({a:f[0],b:f[1],c:f[4],d:f[5],e:f[12]+i[0],f:f[13]+i[1]}));return o&&B&&(this.patternCache[o]=B),B}},{key:"getOrCreateGradient",value:function(A,t){var e=this.generateGradientKey(A),n=A.type,r=A.steps,i=A.min,a=A.width,o=A.height,s=A.cx,u=A.cy,c=A.size;if(this.gradientCache[e])return this.gradientCache[e];var l=null;if(n===Ar.LinearGradient){var h=gr(i,a,o,A.angle);l=t.createLinearGradient(h.x1,h.y1,h.x2,h.y2)}else if(n===Ar.RadialGradient){var d=pr(i,a,o,s,u,c),f=d.x,B=d.y;l=t.createRadialGradient(f,B,0,f,B,d.r)}return l&&(r.forEach(function(A){var t,e=A.offset;e.unit===Vn.kPercentage&&(null===(t=l)||void 0===t||t.addColorStop(e.value/100,""+A.color))}),this.gradientCache[e]=l),this.gradientCache[e]}},{key:"generateGradientKey",value:function(A){var t=A.min,e=A.width,n=A.height,r=A.steps,i=A.angle,a=A.cx,o=A.cy,s=A.size;return"gradient-".concat(A.type,"-").concat((null==i?void 0:""+i)||0,"-").concat((null==a?void 0:""+a)||0,"-").concat((null==o?void 0:""+o)||0,"-").concat((null==s?void 0:""+s)||0,"-").concat(t[0],"-").concat(t[1],"-").concat(e,"-").concat(n,"-").concat(r.map(function(A){var t=A.color;return"".concat(A.offset).concat(t)}).join("-"))}},{key:"generatePatternKey",value:function(A){var t=A.image,e=A.repetition;return GA(t)?"pattern-".concat(t,"-").concat(e):"rect"===t.nodeName?"pattern-".concat(t.entity,"-").concat(e):void 0}}]);var A,t}();function js(A){if(!A.complete)return[0,0];var t=A.naturalWidth||A.width,e=A.naturalHeight||A.height,n=256;return[256,512].forEach(function(A){1e3>Math.ceil(e/A)*Math.ceil(t/A)&&(n=A)}),[n,n]}zs.isSupportTile=!!eo.createCanvas();var qs=function(){function A(){a(this,A)}return s(A,[{key:"apply",value:function(t){var e=t.renderingService,n=t.imagePool,r=t.renderingContext.root.ownerDocument.defaultView,i=function(A,t,e){var n=A.parsedStyle,r=n.width,i=n.height;r&&!i?A.setAttribute("height",e/t*r):!r&&i&&A.setAttribute("width",t/e*i)},a=function(A){var t=A.target,r=t.attributes;if(t.nodeName===le.IMAGE){var a=r.keepAspectRatio;n.getImageSync(r.src,t,function(A){var n=A.img;a&&i(t,n.width,n.height),t.dirty(),e.dirty()})}},o=function(A){var t=A.target,r=A.prevValue,a=A.newValue;t.nodeName===le.IMAGE&&"src"===A.attrName&&(r!==a&&n.releaseImage(r,t),GA(a)&&n.getOrCreateImage(a,t).then(function(A){var n=A.img;t.attributes.keepAspectRatio&&i(t,n.width,n.height),t.dirty(),e.dirty()}).catch(function(){}))};e.hooks.init.tap(A.tag,function(){r.addEventListener(oo.MOUNTED,a),r.addEventListener(oo.ATTR_MODIFIED,o)}),e.hooks.destroy.tap(A.tag,function(){r.removeEventListener(oo.MOUNTED,a),r.removeEventListener(oo.ATTR_MODIFIED,o)})}}])}();qs.tag="LoadImage";var $s=function(A){function t(){var A;a(this,t);for(var e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];return(A=B(this,t,[].concat(n))).name="image-loader",A}return p(t,A),s(t,[{key:"init",value:function(A){this.context.imagePool=new zs(this.context,A),this.addRenderingPlugin(new qs)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(de),Au=Object.freeze({__proto__:null,ImagePool:zs,Plugin:$s}),tu=function(){function A(){a(this,A),this.displayObjectHTMLElementMap=new WeakMap}return s(A,[{key:"joinTransformMatrix",value:function(A){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return"matrix(".concat([A[0],A[1],A[4],A[5],A[12]+t[0],A[13]+t[1]].join(","),")")}},{key:"apply",value:function(t,e){var n=this,r=t.camera,i=t.renderingContext,a=t.renderingService;this.context=t;var o=i.root.ownerDocument.defaultView,s=o.context.eventService.nativeHTMLMap,u=function(A,t){t.style.transform=n.joinTransformMatrix(A.getWorldTransform(),A.getOrigin())},c=function(A){var t=A.target;if(t.nodeName===le.HTML){n.$camera||(n.$camera=n.createCamera(r));var e=n.getOrCreateEl(t);n.$camera.appendChild(e),Object.keys(t.attributes).forEach(function(A){n.updateAttribute(A,t)}),u(t,e),s.set(e,t)}},l=function(A){var t=A.target;if(t.nodeName===le.HTML&&n.$camera){var e=n.getOrCreateEl(t);e&&(e.remove(),s.delete(e))}},h=function(A){var t=A.target;t.nodeName===le.HTML&&n.updateAttribute(A.attrName,t)},d=function(A){for(var t=A.detail,e=0;t.length>e;e++){var r=t[e].target;(r.nodeName===le.FRAGMENT?r.childNodes:[r]).forEach(function(A){if(A.nodeName===le.HTML){var t=n.getOrCreateEl(A);u(A,t)}})}},f=function(){if(n.$camera){var A=n.context.config,t=A.height;n.$camera.parentElement.style.width="".concat(A.width||0,"px"),n.$camera.parentElement.style.height="".concat(t||0,"px")}};a.hooks.init.tap(A.tag,function(){o.addEventListener(ks.RESIZE,f),o.addEventListener(oo.MOUNTED,c),o.addEventListener(oo.UNMOUNTED,l),o.addEventListener(oo.ATTR_MODIFIED,h),o.addEventListener(oo.BOUNDS_CHANGED,d)}),a.hooks.endFrame.tap(A.tag,function(){n.$camera&&i.renderReasons.has(no.CAMERA_CHANGED)&&(n.$camera.style.transform=n.joinTransformMatrix(r.getOrthoMatrix()))}),a.hooks.destroy.tap(A.tag,function(){n.$camera&&n.$camera.remove(),o.removeEventListener(ks.RESIZE,f),o.removeEventListener(oo.MOUNTED,c),o.removeEventListener(oo.UNMOUNTED,l),o.removeEventListener(oo.ATTR_MODIFIED,h),o.removeEventListener(oo.BOUNDS_CHANGED,d)})}},{key:"createCamera",value:function(A){var t=this.context.config,e=t.document,n=t.width,r=t.height,i=this.context.contextService.getDomElement(),a=i.parentNode;if(a){var o="g-canvas-camera",s=a.querySelector("#".concat(o));if(!s){var u=(e||document).createElement("div");u.style.overflow="hidden",u.style.pointerEvents="none",u.style.position="absolute",u.style.left="0px",u.style.top="0px",u.style.width="".concat(n||0,"px"),u.style.height="".concat(r||0,"px");var c=(e||document).createElement("div");s=c,c.id=o,c.style.position="absolute",c.style.left="".concat(i.offsetLeft||0,"px"),c.style.top="".concat(i.offsetTop||0,"px"),c.style.transformOrigin="left top",c.style.transform=this.joinTransformMatrix(A.getOrthoMatrix()),c.style.pointerEvents="none",c.style.width="100%",c.style.height="100%",u.appendChild(c),a.appendChild(u)}return s}return null}},{key:"getOrCreateEl",value:function(A){var t=this.context.config.document,e=this.displayObjectHTMLElementMap.get(A);return e||(e=(t||document).createElement("div"),A.parsedStyle.$el=e,this.displayObjectHTMLElementMap.set(A,e),A.id&&(e.id=A.id),A.name&&e.setAttribute("name",A.name),A.className&&(e.className=A.className),e.style.position="absolute",e.style["will-change"]="transform",e.style.transform=this.joinTransformMatrix(A.getWorldTransform(),A.getOrigin())),e}},{key:"updateAttribute",value:function(A,t){var e=this.getOrCreateEl(t);switch(A){case"innerHTML":var n=t.parsedStyle.innerHTML;GA(n)?e.innerHTML=n:(e.innerHTML="",e.appendChild(n));break;case"x":e.style.left="".concat(t.parsedStyle.x,"px");break;case"y":e.style.top="".concat(t.parsedStyle.y,"px");break;case"transformOrigin":var r=t.parsedStyle.transformOrigin;e.style["transform-origin"]="".concat(r[0].buildCSSText(null,null,"")," ").concat(r[1].buildCSSText(null,null,""));break;case"width":var i=t.parsedStyle.width;e.style.width=_A(i)?"".concat(i,"px"):""+i;break;case"height":var a=t.parsedStyle.height;e.style.height=_A(a)?"".concat(a,"px"):""+a;break;case"zIndex":e.style["z-index"]="".concat(t.parsedStyle.zIndex);break;case"visibility":e.style.visibility=t.parsedStyle.visibility;break;case"pointerEvents":var o=t.parsedStyle.pointerEvents;e.style.pointerEvents=void 0===o?"auto":o;break;case"opacity":e.style.opacity="".concat(t.parsedStyle.opacity);break;case"fill":var s=t.parsedStyle.fill,u="";br(s)?u=s.isNone?"transparent":t.getAttribute("fill"):Array.isArray(s)?u=t.getAttribute("fill"):Er(s),e.style.background=u;break;case"stroke":var c=t.parsedStyle.stroke,l="";br(c)?l=c.isNone?"transparent":t.getAttribute("stroke"):Array.isArray(c)?l=t.getAttribute("stroke"):Er(c),e.style["border-color"]=l,e.style["border-style"]="solid";break;case"lineWidth":e.style["border-width"]="".concat(t.parsedStyle.lineWidth||0,"px");break;case"lineDash":e.style["border-style"]="dashed";break;case"filter":e.style.filter=t.style.filter;break;default:DA(t.style[A])||""===t.style[A]||(e.style[A]=t.style[A])}}}])}();tu.tag="HTMLRendering";var eu=function(A){function t(){var A;a(this,t);for(var e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];return(A=B(this,t,[].concat(n))).name="html-renderer",A}return p(t,A),s(t,[{key:"init",value:function(){this.addRenderingPlugin(new tu)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(de),nu=Object.freeze({__proto__:null,Plugin:eu}),ru=function(){function A(){a(this,A)}return s(A,[{key:"apply",value:function(t,e){var n=this,r=t.renderingService,i=t.renderingContext,a=t.config;this.context=t;var o=i.root.ownerDocument.defaultView,s=function(A){r.hooks.pointerMove.call(A)},u=function(A){r.hooks.pointerUp.call(A)},c=function(A){r.hooks.pointerDown.call(A)},l=function(A){r.hooks.pointerOver.call(A)},h=function(A){r.hooks.pointerOut.call(A)},d=function(A){r.hooks.pointerCancel.call(A)},f=function(A){r.hooks.pointerWheel.call(A)},B=function(A){r.hooks.click.call(A)};r.hooks.init.tap(A.tag,function(){var A=n.context.contextService.getDomElement();e.globalThis.navigator.msPointerEnabled?(A.style.msContentZooming="none",A.style.msTouchAction="none"):o.supportsPointerEvents&&(A.style.touchAction="none"),o.supportsPointerEvents?function(A){e.globalThis.document.addEventListener("pointermove",s,!0),A.addEventListener("pointerdown",c,!0),A.addEventListener("pointerleave",h,!0),A.addEventListener("pointerover",l,!0),e.globalThis.addEventListener("pointerup",u,!0),e.globalThis.addEventListener("pointercancel",d,!0)}(A):function(A){e.globalThis.document.addEventListener("mousemove",s,!0),A.addEventListener("mousedown",c,!0),A.addEventListener("mouseout",h,!0),A.addEventListener("mouseover",l,!0),e.globalThis.addEventListener("mouseup",u,!0)}(A),o.supportsTouchEvents&&function(A){A.addEventListener("touchstart",c,!0),A.addEventListener("touchend",u,!0),A.addEventListener("touchmove",s,!0),A.addEventListener("touchcancel",d,!0)}(A),a.useNativeClickEvent&&A.addEventListener("click",B,!0),A.addEventListener("wheel",f,{passive:!0,capture:!0})}),r.hooks.destroy.tap(A.tag,function(){var A=n.context.contextService.getDomElement();e.globalThis.navigator.msPointerEnabled?(A.style.msContentZooming="",A.style.msTouchAction=""):o.supportsPointerEvents&&(A.style.touchAction=""),o.supportsPointerEvents?function(A){e.globalThis.document.removeEventListener("pointermove",s,!0),A.removeEventListener("pointerdown",c,!0),A.removeEventListener("pointerleave",h,!0),A.removeEventListener("pointerover",l,!0),e.globalThis.removeEventListener("pointerup",u,!0),e.globalThis.removeEventListener("pointercancel",d,!0)}(A):function(A){e.globalThis.document.removeEventListener("mousemove",s,!0),A.removeEventListener("mousedown",c,!0),A.removeEventListener("mouseout",h,!0),A.removeEventListener("mouseover",l,!0),e.globalThis.removeEventListener("mouseup",u,!0)}(A),o.supportsTouchEvents&&function(A){A.removeEventListener("touchstart",c,!0),A.removeEventListener("touchend",u,!0),A.removeEventListener("touchmove",s,!0),A.removeEventListener("touchcancel",d,!0)}(A),a.useNativeClickEvent&&A.removeEventListener("click",B,!0),A.removeEventListener("wheel",f,!0)})}}])}();ru.tag="DOMInteraction";var iu=function(A){function t(){var A;a(this,t);for(var e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];return(A=B(this,t,[].concat(n))).name="dom-interaction",A}return p(t,A),s(t,[{key:"init",value:function(){this.addRenderingPlugin(new ru)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(de),au=Object.freeze({__proto__:null,Plugin:iu}),ou=function(){function A(){a(this,A)}return s(A,[{key:"apply",value:function(t){var e=t.renderingService,n=t.config,r=t.contextService.getDomElement(),i=function(A){e.hooks.pointerDown.call(A)},a=function(A){e.hooks.pointerUp.call(A)},o=function(A){e.hooks.pointerMove.call(A)},s=function(A){e.hooks.pointerOver.call(A)},u=function(A){e.hooks.pointerOut.call(A)},c=function(A){e.hooks.click.call(A)},l=function(A){e.hooks.pointerCancel.call(A)};e.hooks.init.tap(A.tag,function(){r.addEventListener("touchstart",i,!0),r.addEventListener("touchend",a,!0),r.addEventListener("touchmove",o,!0),r.addEventListener("touchcancel",l,!0),r.addEventListener("mouseout",u,!0),r.addEventListener("mouseover",s,!0),n.useNativeClickEvent&&r.addEventListener("click",c,!0)}),e.hooks.destroy.tap(A.tag,function(){r.removeEventListener("touchstart",i,!0),r.removeEventListener("touchend",a,!0),r.removeEventListener("touchmove",o,!0),r.removeEventListener("touchcancel",l,!0),r.removeEventListener("mouseout",u,!0),r.removeEventListener("mouseover",s,!0),n.useNativeClickEvent&&r.removeEventListener("click",c,!0)})}}])}();ou.tag="MobileInteraction";var su=function(A){function t(){var A;a(this,t);for(var e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];return(A=B(this,t,[].concat(n))).name="mobile-interaction",A}return p(t,A),s(t,[{key:"init",value:function(){this.addRenderingPlugin(new ou)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(de),uu=Object.freeze({__proto__:null,Plugin:su}),cu=function(A){function t(A,e,n,r){var i;return a(this,t),(i=B(this,t,[A])).currentTime=n,i.timelineTime=r,i.target=e,i.type="finish",i.bubbles=!1,i.currentTarget=e,i.defaultPrevented=!1,i.eventPhase=i.AT_TARGET,i.timeStamp=Date.now(),i.currentTime=n,i.timelineTime=r,i}return p(t,A),s(t)}(Ja),lu=0,hu=function(){return s(function A(t,e){var n;a(this,A),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(lu++),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()},[{key:"pending",get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending}},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"ready",get:function(){var A=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise(function(t,e){A.resolveReadyPromise=function(){t(A)},A.rejectReadyPromise=function(){e(Error())}}),this.pending||this.resolveReadyPromise()),this.readyPromise}},{key:"finished",get:function(){var A=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise(function(t,e){A.resolveFinishedPromise=function(){t(A)},A.rejectFinishedPromise=function(){e(Error())}}),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(A){if(!isNaN(A=Number(A))){var t;if(this.timeline.restart(),!this._paused&&null!==this._startTime)this._startTime=Number(null===(t=this.timeline)||void 0===t?void 0:t.currentTime)-A/this.playbackRate;this.currentTimePending=!1,this._currentTime!==A&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(A,!0),this.timeline.applyDirtiedAnimation(this))}}},{key:"startTime",get:function(){return this._startTime},set:function(A){if(null!==A){if(this.updatePromises(),isNaN(A=Number(A)))return;if(this._paused||this._idle)return;this._startTime=A,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}}},{key:"playbackRate",get:function(){return this._playbackRate},set:function(A){if(A!==this._playbackRate){this.updatePromises();var t=this.currentTime;this._playbackRate=A,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==t&&(this.currentTime=t),this.updatePromises()}}},{key:"_isFinished",get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||0>this._playbackRate&&0>=Number(this._currentTime))}},{key:"totalDuration",get:function(){return this._totalDuration}},{key:"_needsTick",get:function(){return this.pending||"running"===this.playState||!this._finishedFlag}},{key:"updatePromises",value:function(){var A;if(null!==(A=this.effect.target)&&void 0!==A&&A.destroyed)return this.readyPromise=void 0,this.finishedPromise=void 0,!1;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}},{key:"play",value:function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()}},{key:"pause",value:function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()}},{key:"finish",value:function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())}},{key:"cancel",value:function(){var A=this;if(this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=null,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises(),this.oncancel)){var t=new cu(null,this,this.currentTime,null);setTimeout(function(){A.oncancel(t)})}}},{key:"reverse",value:function(){this.updatePromises();var A=this.currentTime;this.playbackRate*=-1,this.play(),null!==A&&(this.currentTime=A),this.updatePromises()}},{key:"updatePlaybackRate",value:function(A){this.playbackRate=A}},{key:"targetAnimations",value:function(){var A;return(null===(A=this.effect)||void 0===A?void 0:A.target).getAnimations()}},{key:"markTarget",value:function(){var A=this.targetAnimations();-1===A.indexOf(this)&&A.push(this)}},{key:"unmarkTarget",value:function(){var A=this.targetAnimations(),t=A.indexOf(this);-1!==t&&A.splice(t,1)}},{key:"tick",value:function(A,t){this._idle||this._paused||(null===this._startTime?t&&(this.startTime=A-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((A-this._startTime)*this.playbackRate)),t&&(this.currentTimePending=!1,this.fireEvents(A))}},{key:"rewind",value: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}},{key:"persist",value:function(){throw Error(be)}},{key:"addEventListener",value:function(A,t,e){throw Error(be)}},{key:"removeEventListener",value:function(A,t,e){throw Error(be)}},{key:"dispatchEvent",value:function(A){throw Error(be)}},{key:"commitStyles",value:function(){throw Error(be)}},{key:"ensureAlive",value:function(){var A,t;0>this.playbackRate&&0===this.currentTime?this._inEffect=!(null===(A=this.effect)||void 0===A||!A.update(-1)):this._inEffect=!(null===(t=this.effect)||void 0===t||!t.update(this.currentTime));this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))}},{key:"tickCurrentTime",value:function(A,t){A!==this._currentTime&&(this._currentTime=A,this._isFinished&&!t&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())}},{key:"fireEvents",value:function(A){var t=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var e=new cu(null,this,this.currentTime,A);setTimeout(function(){t.onfinish&&t.onfinish(e)})}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var n=new cu(null,this,this.currentTime,A);this.onframe(n)}this._finishedFlag=!1}}}])}(),du=.1,fu="function"==typeof Float32Array,Bu=function(A,t){return 1-3*t+3*A},gu=function(A,t){return 3*t-6*A},pu=function(A){return 3*A},vu=function(A,t,e){return((Bu(t,e)*A+gu(t,e))*A+pu(t))*A},wu=function(A,t,e){return 3*Bu(t,e)*A*A+2*gu(t,e)*A+pu(t)},yu=function(A,t,e,n){if(0>A||A>1||0>e||e>1)throw Error("bezier x values must be in [0, 1] range");if(A===t&&e===n)return function(A){return A};for(var r=fu?new Float32Array(11):[,,,,,,,,,,,],i=0;11>i;++i)r[i]=vu(i*du,A,e);var a=function(t){for(var n=0,i=1;10!==i&&t>=r[i];++i)n+=du;--i;var a=n+(t-r[i])/(r[i+1]-r[i])*du,o=wu(a,A,e);return.001>o?0===o?a:function(A,t,e,n,r){var i,a,o=0;do{(i=vu(a=t+(e-t)/2,n,r)-A)>0?e=a:t=a}while(Math.abs(i)>1e-7&&10>++o);return a}(t,n,n+du,A,e):function(A,t,e,n){for(var r=0;4>r;++r){var i=wu(t,e,n);if(0===i)return t;t-=(vu(t,e,n)-A)/i}return t}(t,a,A,e)};return function(A){return 0===A||1===A?A:vu(a(A),t,n)}},mu=function(A){return Math.pow(A,2)},Cu=function(A){return Math.pow(A,3)},Qu=function(A){return Math.pow(A,4)},Fu=function(A){return Math.pow(A,5)},Uu=function(A){return Math.pow(A,6)},Eu=function(A){return 1-Math.cos(A*Math.PI/2)},bu=function(A){return 1-Math.sqrt(1-A*A)},ku=function(A){return A*A*(3*A-2)},xu=function(A){for(var t,e=4;A<((t=Math.pow(2,--e))-1)/11;);return 1/Math.pow(4,3-e)-7.5625*Math.pow((3*t-2)/22-A,2)},Hu=function(A){var t=v(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],2),e=t[0],n=t[1],r=void 0===n?.5:n,i=VA(Number(void 0===e?1:e),1,10),a=VA(Number(r),.1,2);return 0===A||1===A?A:-i*Math.pow(2,10*(A-1))*Math.sin(2*Math.PI*(A-1-a/(2*Math.PI)*Math.asin(1/i))/a)},Iu=function(A){var t=arguments.length>2?arguments[2]:void 0,e=v(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],4),n=e[0],r=void 0===n?1:n,i=e[1],a=void 0===i?100:i,o=e[2],s=void 0===o?10:o,u=e[3],c=void 0===u?0:u;r=VA(r,.1,1e3),a=VA(a,.1,1e3),s=VA(s,.1,1e3),c=VA(c,.1,1e3);var l=Math.sqrt(a/r),h=s/(2*Math.sqrt(a*r)),d=1>h?l*Math.sqrt(1-h*h):0,f=1>h?(h*l-c)/d:-c+l,B=t?t*A/1e3:A;return B=1>h?Math.exp(-B*h*l)*(1*Math.cos(d*B)+f*Math.sin(d*B)):(1+f*B)*Math.exp(-B*l),0===A||1===A?A:1-B},Tu=function(A){var t=v(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],2),e=t[0],n=void 0===e?10:e;return("start"===t[1]?Math.ceil:Math.floor)(VA(A,0,1)*n)/n},Mu=function(A){var t=v(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],4);return yu(t[0],t[1],t[2],t[3])(A)},Su=yu(.42,0,1,1),Lu=function(A){return function(t){return 1-A(1-t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],arguments.length>2?arguments[2]:void 0)}},Du=function(A){return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;return.5>t?A(2*t,e,n)/2:1-A(-2*t+2,e,n)/2}},Pu=function(A){return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;return.5>t?(1-A(1-2*t,e,n))/2:(A(2*t-1,e,n)+1)/2}},Nu={steps:Tu,"step-start":function(A){return Tu(A,[1,"start"])},"step-end":function(A){return Tu(A,[1,"end"])},linear:function(A){return A},"cubic-bezier":Mu,ease:function(A){return Mu(A,[.25,.1,.25,1])},in:Su,out:Lu(Su),"in-out":Du(Su),"out-in":Pu(Su),"in-quad":mu,"out-quad":Lu(mu),"in-out-quad":Du(mu),"out-in-quad":Pu(mu),"in-cubic":Cu,"out-cubic":Lu(Cu),"in-out-cubic":Du(Cu),"out-in-cubic":Pu(Cu),"in-quart":Qu,"out-quart":Lu(Qu),"in-out-quart":Du(Qu),"out-in-quart":Pu(Qu),"in-quint":Fu,"out-quint":Lu(Fu),"in-out-quint":Du(Fu),"out-in-quint":Pu(Fu),"in-expo":Uu,"out-expo":Lu(Uu),"in-out-expo":Du(Uu),"out-in-expo":Pu(Uu),"in-sine":Eu,"out-sine":Lu(Eu),"in-out-sine":Du(Eu),"out-in-sine":Pu(Eu),"in-circ":bu,"out-circ":Lu(bu),"in-out-circ":Du(bu),"out-in-circ":Pu(bu),"in-back":ku,"out-back":Lu(ku),"in-out-back":Du(ku),"out-in-back":Pu(ku),"in-bounce":xu,"out-bounce":Lu(xu),"in-out-bounce":Du(xu),"out-in-bounce":Pu(xu),"in-elastic":Hu,"out-elastic":Lu(Hu),"in-out-elastic":Du(Hu),"out-in-elastic":Pu(Hu),spring:Iu,"spring-in":Iu,"spring-out":Lu(Iu),"spring-in-out":Du(Iu),"spring-out-in":Pu(Iu)},Ou=function(A){return A};function Ku(A,t){return function(e){if(e>=1)return 1;var n=1/A;return(e+=t*n)-e%n}}var Ru="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",Gu=RegExp("cubic-bezier\\(".concat(Ru,",").concat(Ru,",").concat(Ru,",").concat(Ru,"\\)")),Vu=/steps\(\s*(\d+)\s*\)/,_u=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Xu(A){var t=Gu.exec(A);if(t)return yu.apply(void 0,l(t.slice(1).map(Number)));var e=Vu.exec(A);if(e)return Ku(Number(e[1]),0);var n=_u.exec(A);return n?Ku(Number(n[1]),{start:1,middle:.5,end:0}[n[2]]):Nu[function(A){return function(A){return"-"===(A=A.replace(/([A-Z])/g,function(A){return"-".concat(A.toLowerCase())})).charAt(0)?A.substring(1):A}(A).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()}(A)]||Nu.linear}function Yu(A){return Math.abs(function(A){var t;if(0===A.duration||0===A.iterations)return 0;return("auto"===A.duration?0:Number(A.duration))*(null!==(t=A.iterations)&&void 0!==t?t:1)}(A)/(A.playbackRate||1))}function Wu(A,t,e){var n=function(A,t,e){if(null===t)return 0;var n=e.endTime;return Math.min(e.delay,n)>t?1:Math.min(e.delay+A+e.endDelay,n)>t?3:2}(A,t,e),r=function(A,t,e,n,r){switch(n){case 1:return"backwards"===t||"both"===t?0:null;case 3:return e-r;case 2:return"forwards"===t||"both"===t?A:null;case 0:return null}}(A,e.fill,t,n,e.delay);if(null===r)return null;var i="auto"===e.duration?0:e.duration,a=function(A,t,e,n,r){var i=r;return 0===A?1!==t&&(i+=e):i+=n/A,i}(i,n,e.iterations,r,e.iterationStart),o=function(A,t,e,n,r,i){var a=A===1/0?t%1:A%1;return 0!==a||2!==e||0===n||0===r&&0!==i||(a=1),a}(a,e.iterationStart,n,e.iterations,r,i),s=function(A,t,e,n){return 2===A&&t===1/0?1/0:1===e?Math.floor(n)-1:Math.floor(n)}(n,e.iterations,o,a),u=function(A,t,e){var n=A;if("normal"!==A&&"reverse"!==A){var r=t;"alternate-reverse"===A&&(r+=1),n="normal",r!==1/0&&r%2!=0&&(n="reverse")}return"normal"===n?e:1-e}(e.direction,s,o);return e.currentIteration=s,e.progress=u,e.easingFunction(u)}function Ju(A,t,e){var n=function(A,t){for(var e={},n=0;A.length>n;n++)for(var r in A[n])if(Zu(r)){var i={offset:A[n].offset,computedOffset:A[n].computedOffset,easing:A[n].easing,easingFunction:Xu(A[n].easing)||t.easingFunction,value:A[n][r]};e[r]=e[r]||[],e[r].push(i)}return e}(A,t),r=function(A,t){var e=[];for(var n in A)for(var r=A[n],i=0;r.length-1>i;i++){var a=i,o=i+1,s=r[a].computedOffset,u=r[o].computedOffset,c=s,l=u;0===i&&(c=-1/0,0===u&&(o=a)),i===r.length-2&&(l=1/0,1===s&&(a=o)),e.push({applyFrom:c,applyTo:l,startOffset:r[a].computedOffset,endOffset:r[o].computedOffset,easingFunction:r[a].easingFunction,property:n,interpolation:ju(n,r[a].value,r[o].value,t)})}return e.sort(function(A,t){return A.startOffset-t.startOffset}),e}(n,e);return function(A,t){if(null!==t)r.filter(function(A){return t>=A.applyFrom&&A.applyTo>t}).forEach(function(e){var n=e.endOffset-e.startOffset;A.setAttribute(e.property,e.interpolation(0===n?0:(t-e.startOffset)/n),!1,!1)});else for(var e in n)Zu(e)&&A.setAttribute(e,null)}}function Zu(A){return"offset"!==A&&"easing"!==A&&"composite"!==A&&"computedOffset"!==A}var zu=function(A,t,e){return function(n){var r=qu(A,t,n);return _A(r)?r:e(r)}};function ju(A,t,e,n){var r=Mi[A];if(r&&r.syntax&&r.int){var i=No.styleValueRegistry.getPropertySyntax(r.syntax);if(i){var a=i.parser,o=a?a(t,n):t,s=a?a(e,n):e,u=i.mixer(o,s,n);if(u){var c=zu.apply(void 0,l(u));return function(A){return 0===A?t:1===A?e:c(A)}}}}return zu(!1,!0,function(A){return A?e:t})}function qu(A,t,e){if("number"==typeof A&&"number"==typeof t)return A*(1-e)+t*e;if("boolean"==typeof A&&"boolean"==typeof t||"string"==typeof A&&"string"==typeof t)return.5>e?A:t;if(Array.isArray(A)&&Array.isArray(t)){for(var n=A.length,r=t.length,i=Math.max(n,r),a=[],o=0;i>o;o++)a.push(qu(A[n>o?o:n-1],t[r>o?o:r-1],e));return a}throw Error("Mismatched interpolation arguments ".concat(A,":").concat(t))}var $u=function(){return s(function A(){a(this,A),this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=Ou,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null},[{key:"easing",get:function(){return this._easing},set:function(A){this.easingFunction=Xu(A),this._easing=A}}])}();function Ac(A,t){if(null===A)return[];Array.isArray(A)||(A=function(A){var t=[];for(var e in A)if(!(e in["easing","offset","composite"])){var n=A[e];Array.isArray(n)||(n=[n]);for(var r=n.length,i=0;r>i;i++){if(!t[i]){var a={};"offset"in A&&(a.offset=Number(A.offset)),"easing"in A&&(a.easing=A.easing),"composite"in A&&(a.composite=A.composite),t[i]=a}null!=n[i]&&(t[i][e]=n[i])}}return t.sort(function(A,t){return(A.computedOffset||0)-(t.computedOffset||0)}),t}(A));for(var e=A.map(function(A){var e={};for(var n in null!=t&&t.composite&&(e.composite="auto"),A){var r=A[n];if("offset"===n){if(null!==r){if(!isFinite(r=Number(r)))throw Error("Keyframe offsets must be numbers.");if(0>r||r>1)throw Error("Keyframe offsets must be between 0 and 1.");e.computedOffset=r}}else if("composite"===n&&-1===["replace","add","accumulate","auto"].indexOf(r))throw Error("".concat(r," compositing is not supported"));e[n]=r}return void 0===e.offset&&(e.offset=null),void 0===e.easing&&(e.easing=(null==t?void 0:t.easing)||"linear"),void 0===e.composite&&(e.composite="auto"),e}),n=!0,r=-1/0,i=0;e.length>i;i++){var a=e[i].offset;if(DA(a))n=!1;else{if(r>a)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");r=a}}return e=e.filter(function(A){return Number(A.offset)>=0&&1>=Number(A.offset)}),n||function(){var A,t,n=e.length;e[n-1].computedOffset=Number(null!==(A=e[n-1].offset)&&void 0!==A?A:1),n>1&&(e[0].computedOffset=Number(null!==(t=e[0].offset)&&void 0!==t?t:0));for(var r=0,i=Number(e[0].computedOffset),a=1;n>a;a++){var o=e[a].computedOffset;if(!DA(o)&&!DA(i)){for(var s=1;a-r>s;s++)e[r+s].computedOffset=i+(Number(o)-i)*s/(a-r);r=a,i=Number(o)}}}(),e}var tc="backwards|forwards|both|none".split("|"),ec="reverse|alternate|alternate-reverse".split("|");function nc(A,t){var e=new $u;return t&&(e.fill="both",e.duration="auto"),"number"!=typeof A||isNaN(A)?void 0!==A&&Object.keys(A).forEach(function(t){if(null!=A[t]&&"auto"!==A[t]){if(("number"==typeof e[t]||"duration"===t)&&("number"!=typeof A[t]||isNaN(A[t])))return;if("fill"===t&&-1===tc.indexOf(A[t]))return;if("direction"===t&&-1===ec.indexOf(A[t]))return;e[t]=A[t]}}):e.duration=A,e}function rc(A,t){return nc(A=ic(null!=A?A:{duration:"auto"}),t)}function ic(A){return"number"==typeof A&&(A=isNaN(A)?{duration:"auto"}:{duration:A}),A}var ac=function(){return s(function A(t,e,n){var r=this;a(this,A),this.composite="replace",this.iterationComposite="replace",this.target=t,this.timing=rc(n,!1),this.timing.effect=this,this.timing.activeDuration=Yu(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=Ac(e,this.timing),this.interpolations=Ju(this.normalizedKeyframes,this.timing,this.target);var i=No.globalThis.Proxy;this.computedTiming=i?new i(this.timing,{get:function(A,t){return"duration"===t?"auto"===A.duration?0:A.duration:"fill"===t?"auto"===A.fill?"none":A.fill:"localTime"===t?r.animation&&r.animation.currentTime||null:"currentIteration"===t?r.animation&&"running"===r.animation.playState?A.currentIteration||0:null:"progress"===t?r.animation&&"running"===r.animation.playState?A.progress||0:null:A[t]},set:function(){return!0}}):this.timing},[{key:"applyInterpolations",value:function(){this.interpolations(this.target,Number(this.timeFraction))}},{key:"update",value:function(A){return null!==A&&(this.timeFraction=Wu(this.timing.activeDuration,A,this.timing),null!==this.timeFraction)}},{key:"getKeyframes",value:function(){return this.normalizedKeyframes}},{key:"setKeyframes",value:function(A){this.normalizedKeyframes=Ac(A)}},{key:"getComputedTiming",value:function(){return this.computedTiming}},{key:"getTiming",value:function(){return this.timing}},{key:"updateTiming",value:function(A){var t=this;Object.keys(A||{}).forEach(function(e){t.timing[e]=A[e]})}}])}();function oc(A,t){return Number(A.id)-Number(t.id)}var sc=function(){return s(function A(t){var e=this;a(this,A),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(A){e.currentTime=A,e.discardAnimations(),0===e.animations.length?e.timelineTicking=!1:e.requestAnimationFrame(e.webAnimationsNextTick)},this.processRafCallbacks=function(A){var t=e.rafCallbacks;e.rafCallbacks=[],Number(e.currentTime)>A&&(A=Number(e.currentTime)),e.animations.sort(oc),e.animations=e.tick(A,!0,e.animations)[0],t.forEach(function(t){t[1](A)}),e.applyPendingEffects()},this.document=t},[{key:"getAnimations",value:function(){return this.discardAnimations(),this.animations.slice()}},{key:"isTicking",value:function(){return this.inTick}},{key:"play",value:function(A,t,e){var n=new ac(A,t,e),r=new hu(n,this);return this.animations.push(r),this.restartWebAnimationsNextTick(),r.updatePromises(),r.play(),r.updatePromises(),r}},{key:"applyDirtiedAnimation",value:function(A){var t=this;if(!this.inTick){A.markTarget();var e=A.targetAnimations();e.sort(oc),this.tick(Number(this.currentTime),!1,e.slice())[1].forEach(function(A){var e=t.animations.indexOf(A);-1!==e&&t.animations.splice(e,1)}),this.applyPendingEffects()}}},{key:"restart",value:function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame(function(){}),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame}},{key:"destroy",value:function(){this.document.defaultView.cancelAnimationFrame(this.frameId)}},{key:"applyPendingEffects",value:function(){this.pendingEffects.forEach(function(A){null==A||A.applyInterpolations()}),this.pendingEffects=[]}},{key:"updateAnimationsPromises",value:function(){this.animationsWithPromises=this.animationsWithPromises.filter(function(A){return A.updatePromises()})}},{key:"discardAnimations",value:function(){this.updateAnimationsPromises(),this.animations=this.animations.filter(function(A){return"finished"!==A.playState&&"idle"!==A.playState})}},{key:"restartWebAnimationsNextTick",value:function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))}},{key:"rAF",value:function(A){var t=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([t,A]),t}},{key:"requestAnimationFrame",value:function(A){var t=this;return this.rAF(function(e){t.updateAnimationsPromises(),A(e),t.updateAnimationsPromises()})}},{key:"tick",value:function(A,t,e){var n,r,i=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=A,this.ticking=!1;var a=[],o=[],s=[],u=[];return e.forEach(function(e){e.tick(A,t),e._inEffect?(o.push(e.effect),e.markTarget()):(a.push(e.effect),e.unmarkTarget()),e._needsTick&&(i.ticking=!0);var n=e._inEffect||e._needsTick;e._inTimeline=n,n?s.push(e):u.push(e)}),(n=this.pendingEffects).push.apply(n,a),(r=this.pendingEffects).push.apply(r,o),this.ticking&&this.requestAnimationFrame(function(){}),this.inTick=!1,[s,u]}}])}();No.EasingFunction=Xu,No.AnimationTimeline=sc;var uc=function(A){function t(){var A;a(this,t);for(var e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];return(A=B(this,t,[].concat(n))).landmarks=[],A}return p(t,A),s(t,[{key:"rotate",value:function(A,t,e){if(this.relElevation=xe(t),this.relAzimuth=xe(A),this.relRoll=xe(e),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===We.EXPLORING){var n=UA(FA(),[1,0,0],Me((this.rotateWorld?1:-1)*this.relElevation)),r=UA(FA(),[0,1,0],Me((this.rotateWorld?1:-1)*this.relAzimuth)),i=UA(FA(),[0,0,1],Me(this.relRoll)),a=EA(FA(),r,n);a=EA(FA(),a,i);var o=J(F(),a);M(this.matrix,this.matrix,[0,0,-this.distance]),T(this.matrix,this.matrix,o),M(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===We.ORBITING||this.type===We.EXPLORING?this._getPosition():this.type===We.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(A,t){var e=Ie(A,t,0),n=rA(this.position);return uA(n,n,lA(nA(),this.right,e[0])),uA(n,n,lA(nA(),this.up,e[1])),this._setPosition(n),this.triggerUpdate(),this}},{key:"dolly",value:function(A){var t,e=this.forward,n=rA(this.position);return n[0]+=(t=Math.max(Math.min(this.distance+A*this.dollyingStep,this.maxDistance),this.minDistance)-this.distance)*e[0],n[1]+=t*e[1],n[2]+=t*e[2],this._setPosition(n),this.type===We.ORBITING||this.type===We.EXPLORING?this._getDistance():this.type===We.TRACKING&&uA(this.focalPoint,n,this.distanceVector),this.triggerUpdate(),this}},{key:"cancelLandmarkAnimation",value:function(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)}},{key:"createLandmark",value:function(A){var t,e,n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=i.position,o=void 0===a?this.position:a,s=i.focalPoint,u=void 0===s?this.focalPoint:s,c=i.roll,l=i.zoom,h=new No.CameraContribution;h.setType(this.type,void 0),h.setPosition(o[0],null!==(t=o[1])&&void 0!==t?t:this.position[1],null!==(e=o[2])&&void 0!==e?e:this.position[2]),h.setFocalPoint(u[0],null!==(n=u[1])&&void 0!==n?n:this.focalPoint[1],null!==(r=u[2])&&void 0!==r?r:this.focalPoint[2]),h.setRoll(null!=c?c:this.roll),h.setZoom(null!=l?l:this.zoom);var d={name:A,matrix:U(h.getWorldTransform()),right:rA(h.right),up:rA(h.up),forward:rA(h.forward),position:rA(h.getPosition()),focalPoint:rA(h.getFocalPoint()),distanceVector:rA(h.getDistanceVector()),distance:h.getDistance(),dollyingStep:h.getDollyingStep(),azimuth:h.getAzimuth(),elevation:h.getElevation(),roll:h.getRoll(),relAzimuth:h.relAzimuth,relElevation:h.relElevation,relRoll:h.relRoll,zoom:h.getZoom()};return this.landmarks.push(d),d}},{key:"gotoLandmark",value:function(A){var t=this,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=GA(A)?this.landmarks.find(function(t){return t.name===A}):A;if(n){var r=_A(e)?{duration:e}:e,i=r.easing,a=void 0===i?"linear":i,o=r.duration,s=void 0===o?100:o,u=r.easingFunction,c=void 0===u?void 0:u,l=r.onfinish,h=void 0===l?void 0:l,d=r.onframe,f=void 0===d?void 0:d;this.cancelLandmarkAnimation();var B,g=n.position,p=n.focalPoint,v=n.zoom,w=n.roll,y=c||No.EasingFunction(a),m=function(){t.setFocalPoint(p),t.setPosition(g),t.setRoll(w),t.setZoom(v),t.computeMatrix(),t.triggerUpdate(),null==h||h()};if(0===s)return m();var C=function(A){void 0===B&&(B=A);var e=A-B;if(s>e){var n,r,i=y(e/s),a=nA(),o=nA();if(BA(a,t.focalPoint,p,i),BA(o,t.position,g,i),r=t.roll*(1-i)+w*i,n=t.zoom*(1-i)+v*i,t.setFocalPoint(a),t.setPosition(o),t.setRoll(r),t.setZoom(n),.01>=wA(a,p)+wA(o,g)&&void 0===v&&void 0===w)return m();t.computeMatrix(),t.triggerUpdate(),s>e&&(null==f||f(i),t.landmarkAnimationID=t.canvas.requestAnimationFrame(C))}else m()};this.canvas.requestAnimationFrame(C)}}}])}(qe);No.CameraContribution=uc;
19
+ var A,t,e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",r=e.toStringTag||"@@toStringTag";function i(e,n,r,i){var s=Object.create((n&&n.prototype instanceof o?n:o).prototype);return $t(s,"_invoke",function(e,n,r){var i,o,s,u=0,c=r||[],l=!1,h={p:0,n:0,v:A,a:d,f:d.bind(A,4),d:function(t,e){return i=t,o=0,s=A,h.n=e,a}};function d(e,n){for(o=e,s=n,t=0;!l&&u&&!r&&c.length>t;t++){var r,i=c[t],d=h.p,f=i[2];e>3?(r=f===n)&&(s=i[(o=i[4])?5:(o=3,3)],i[4]=i[5]=A):d>=i[0]&&((r=2>e&&i[1]>d)?(o=0,h.v=n,h.n=i[1]):f>d&&(r=3>e||i[0]>n||n>f)&&(i[4]=e,i[5]=n,h.n=f,o=0))}if(r||e>1)return a;throw l=!0,n}return function(r,c,f){if(u>1)throw TypeError("Generator is already running");for(l&&1===c&&d(c,f),o=c,s=f;(t=2>o?A:s)||!l;){i||(o?3>o?(o>1&&(h.n=-1),d(o,s)):h.n=s:h.v=s);try{if(u=2,i){if(o||(r="next"),t=i[r]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,2>o&&(o=0)}else 1===o&&(t=i.return)&&t.call(i),2>o&&(s=TypeError("The iterator does not provide a '"+r+"' method"),o=1);i=A}else if((t=(l=0>h.n)?s:e.call(n,h))!==a)break}catch(t){i=A,o=1,s=t}finally{u=1}}return{value:t,done:l}}}(e,r,i),!0),s}var a={};function o(){}function s(){}function u(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):($t(t={},n,function(){return this}),t),l=u.prototype=o.prototype=Object.create(c);function h(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,u):(A.__proto__=u,$t(A,r,"GeneratorFunction")),A.prototype=Object.create(l),A}return s.prototype=u,$t(l,"constructor",u),$t(u,"constructor",s),s.displayName="GeneratorFunction",$t(u,r,"GeneratorFunction"),$t(l),$t(l,r,"Generator"),$t(l,n,function(){return this}),$t(l,"toString",function(){return"[object Generator]"}),(Ae=function(){return{w:i,m:h}})()}function te(A,t){function e(n,r,i,a){try{var o=A[n](r),s=o.value;return s instanceof qt?t.resolve(s.v).then(function(A){e("next",A,i,a)},function(A){e("throw",A,i,a)}):t.resolve(s).then(function(A){o.value=A,i(o)},function(A){return e("throw",A,i,a)})}catch(A){a(A)}}var n;this.next||($t(te.prototype),$t(te.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),$t(this,"_invoke",function(A,r,i){function a(){return new t(function(t,n){e(A,i,t,n)})}return n=n?n.then(a,a):a()},!0)}function ee(A,t,e,n,r){return new te(Ae().w(A,t,e,n),r||Promise)}function ne(A,t,e,n,r){var i=ee(A,t,e,n,r);return i.next().then(function(A){return A.done?A.value:i.next()})}function re(A){var t=Object(A),e=[];for(var n in t)e.unshift(n);return function A(){for(;e.length;)if((n=e.pop())in t)return A.value=n,A.done=!1,A;return A.done=!0,A}}function ie(A){if(null!=A){var e=A["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(e)return e.call(A);if("function"==typeof A.next)return A;if(!isNaN(A.length))return{next:function(){return A&&n>=A.length&&(A=void 0),{value:A&&A[n++],done:!A}}}}throw new TypeError(t(A)+" is not iterable")}function ae(){var A=Ae(),t=A.m(ae),e=(Object.getPrototypeOf?Object.getPrototypeOf(t):t.__proto__).constructor;function n(A){var t="function"==typeof A&&A.constructor;return!!t&&(t===e||"GeneratorFunction"===(t.displayName||t.name))}var r={throw:1,return:2,break:3,continue:3};function i(A){var t,e;return function(n){t||(t={stop:function(){return e(n.a,2)},catch:function(){return n.v},abrupt:function(A,t){return e(n.a,r[A],t)},delegateYield:function(A,r,i){return t.resultName=r,e(n.d,ie(A),i)},finish:function(A){return e(n.f,A)}},e=function(A,e,r){n.p=t.prev,n.n=t.next;try{return A(e,r)}finally{t.next=n.n}}),t.resultName&&(t[t.resultName]=n.v,t.resultName=void 0),t.sent=n.v,t.next=n.n;try{return A.call(this,t)}finally{n.p=t.prev,n.n=t.next}}}return(ae=function(){return{wrap:function(t,e,n,r){return A.w(i(t),e,n,r&&r.reverse())},isGeneratorFunction:n,mark:A.m,awrap:function(A,t){return new qt(A,t)},AsyncIterator:te,async:function(A,t,e,r,a){return(n(t)?ee:ne)(i(A),t,e,r,a)},keys:re,values:ie}})()}function oe(A,t,e,n,r,i,a){try{var o=A[i](a),s=o.value}catch(A){return void e(A)}o.done?t(s):Promise.resolve(s).then(n,r)}function se(A){return function(){var t=this,e=arguments;return new Promise(function(n,r){var i=A.apply(t,e);function a(A){oe(i,n,r,a,o,"next",A)}function o(A){oe(i,n,r,a,o,"throw",A)}a(void 0)})}}function ue(A,t){var e="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!e){if(Array.isArray(A)||(e=c(A))||t&&A&&"number"==typeof A.length){e&&(A=e);var n=0,r=function(){};return{s:r,n:function(){return A.length>n?{done:!1,value:A[n++]}:{done:!0}},e:function(A){throw A},f:r}}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 i,a=!0,o=!1;return{s:function(){e=e.call(A)},n:function(){var A=e.next();return a=A.done,A},e:function(A){o=!0,i=A},f:function(){try{a||null==e.return||e.return()}finally{if(o)throw i}}}}function ce(A,t){if(null==A)return{};var e,n,r=function(A,t){if(null==A)return{};var e={};for(var n in A)if({}.hasOwnProperty.call(A,n)){if(-1!==t.indexOf(n))continue;e[n]=A[n]}return e}(A,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(A);for(n=0;i.length>n;n++)-1===t.indexOf(e=i[n])&&{}.propertyIsEnumerable.call(A,e)&&(r[e]=A[e])}return r}var le=function(A){return A.GROUP="g",A.FRAGMENT="fragment",A.CIRCLE="circle",A.ELLIPSE="ellipse",A.IMAGE="image",A.RECT="rect",A.LINE="line",A.POLYLINE="polyline",A.POLYGON="polygon",A.TEXT="text",A.PATH="path",A.HTML="html",A.MESH="mesh",A}({}),he=function(A){return A[A.ZERO=0]="ZERO",A[A.NEGATIVE_ONE=1]="NEGATIVE_ONE",A}({}),de=function(){return s(function A(){a(this,A),this.plugins=[]},[{key:"addRenderingPlugin",value:function(A){this.plugins.push(A),this.context.renderingPlugins.push(A)}},{key:"removeAllRenderingPlugins",value:function(){var A=this;this.plugins.forEach(function(t){var e=A.context.renderingPlugins.indexOf(t);0>e||A.context.renderingPlugins.splice(e,1)})}}])}(),fe=function(){return s(function A(t){a(this,A),this.clipSpaceNearZ=he.NEGATIVE_ONE,this.plugins=[],this.config=i({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0,enableRenderingOptimization:!1},t)},[{key:"registerPlugin",value:function(A){-1===this.plugins.findIndex(function(t){return t===A})&&this.plugins.push(A)}},{key:"unregisterPlugin",value:function(A){var t=this.plugins.findIndex(function(t){return t===A});t>-1&&this.plugins.splice(t,1)}},{key:"getPlugins",value:function(){return this.plugins}},{key:"getPlugin",value:function(A){return this.plugins.find(function(t){return t.name===A})}},{key:"getConfig",value:function(){return this.config}},{key:"setConfig",value:function(A){Object.assign(this.config,A)}}])}(),Be=uA,ge=oA,pe=function(A,t,e){return A[0]=Math.max(t[0],e[0]),A[1]=Math.max(t[1],e[1]),A[2]=Math.max(t[2],e[2]),A},ve=function(A,t,e){return A[0]=Math.min(t[0],e[0]),A[1]=Math.min(t[1],e[1]),A[2]=Math.min(t[2],e[2]),A},we=lA,ye=vA,me=function(){function A(){a(this,A),this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return s(A,[{key:"update",value:function(A,t){ge(this.center,A),ge(this.halfExtents,t),ye(this.min,this.center,this.halfExtents),Be(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(A,t){Be(this.center,t,A),we(this.center,this.center,.5),ye(this.halfExtents,t,A),we(this.halfExtents,this.halfExtents,.5),ge(this.min,A),ge(this.max,t)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(t){if(!A.isEmpty(t))if(A.isEmpty(this))this.setMinMax(t.getMin(),t.getMax());else{var e=this.center,n=e[0],r=e[1],i=e[2],a=this.halfExtents,o=a[0],s=a[1],u=a[2],c=n-o,l=n+o,h=r-s,d=r+s,f=i-u,B=i+u,g=t.center,p=g[0],v=g[1],w=g[2],y=t.halfExtents,m=y[0],C=y[1],Q=y[2],F=p-m,U=p+m,E=v-C,b=v+C,k=w-Q,x=w+Q;c>F&&(c=F),U>l&&(l=U),h>E&&(h=E),b>d&&(d=b),f>k&&(f=k),x>B&&(B=x),e[0]=.5*(c+l),e[1]=.5*(h+d),e[2]=.5*(f+B),a[0]=.5*(l-c),a[1]=.5*(d-h),a[2]=.5*(B-f),this.min[0]=c,this.min[1]=h,this.min[2]=f,this.max[0]=l,this.max[1]=d,this.max[2]=B}}},{key:"setFromTransformedAABB",value:function(A,t){var e=this.center,n=this.halfExtents,r=A.center,i=A.halfExtents,a=t[0],o=t[4],s=t[8],u=t[1],c=t[5],l=t[9],h=t[2],d=t[6],f=t[10],B=Math.abs(a),g=Math.abs(o),p=Math.abs(s),v=Math.abs(u),w=Math.abs(c),y=Math.abs(l),m=Math.abs(h),C=Math.abs(d),Q=Math.abs(f);e[0]=t[12]+a*r[0]+o*r[1]+s*r[2],e[1]=t[13]+u*r[0]+c*r[1]+l*r[2],e[2]=t[14]+h*r[0]+d*r[1]+f*r[2],n[0]=B*i[0]+g*i[1]+p*i[2],n[1]=v*i[0]+w*i[1]+y*i[2],n[2]=m*i[0]+C*i[1]+Q*i[2],ye(this.min,e,n),Be(this.max,e,n)}},{key:"intersects",value:function(A){var t=this.getMax(),e=this.getMin(),n=A.getMax(),r=A.getMin();return!(e[0]>n[0]||r[0]>t[0]||e[1]>n[1]||r[1]>t[1]||e[2]>n[2]||r[2]>t[2])}},{key:"intersection",value:function(t){if(!this.intersects(t))return null;var e=new A,n=pe([0,0,0],this.getMin(),t.getMin()),r=ve([0,0,0],this.getMax(),t.getMax());return e.setMinMax(n,r),e}},{key:"getNegativeFarPoint",value:function(A){return 273===A.pnVertexFlag?ge([0,0,0],this.min):272===A.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:257===A.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:256===A.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:17===A.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:16===A.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:1===A.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]}},{key:"getPositiveFarPoint",value:function(A){return 273===A.pnVertexFlag?ge([0,0,0],this.max):272===A.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:257===A.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:256===A.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:17===A.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:16===A.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:1===A.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]}}],[{key:"isEmpty",value:function(A){return!A||0===A.halfExtents[0]&&0===A.halfExtents[1]&&0===A.halfExtents[2]}}])}(),Ce=function(){return s(function A(t,e){a(this,A),this.distance=t||0,this.normal=e||aA(0,1,0),this.updatePNVertexFlag()},[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(A){return dA(A,this.normal)-this.distance}},{key:"normalize",value:function(){var A=1/yA(this.normal);lA(this.normal,this.normal,A),this.distance*=A}},{key:"intersectsLine",value:function(A,t,e){var n=this.distanceToPoint(A),r=n/(n-this.distanceToPoint(t)),i=r>=0&&1>=r;return i&&e&&BA(e,A,t,r),i}}])}(),Qe=function(A){return A[A.OUTSIDE=4294967295]="OUTSIDE",A[A.INSIDE=0]="INSIDE",A[A.INDETERMINATE=2147483647]="INDETERMINATE",A}({}),Fe=function(){return s(function A(t){if(a(this,A),this.planes=[],t)this.planes=t;else for(var e=0;6>e;e++)this.planes.push(new Ce)},[{key:"extractFromVPMatrix",value:function(A){var t=v(A,16),e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],u=t[7],c=t[8],l=t[9],h=t[10],d=t[11],f=t[12],B=t[13],g=t[14],p=t[15];sA(this.planes[0].normal,i-e,u-a,d-c),this.planes[0].distance=p-f,sA(this.planes[1].normal,i+e,u+a,d+c),this.planes[1].distance=p+f,sA(this.planes[2].normal,i+n,u+o,d+l),this.planes[2].distance=p+B,sA(this.planes[3].normal,i-n,u-o,d-l),this.planes[3].distance=p-B,sA(this.planes[4].normal,i-r,u-s,d-h),this.planes[4].distance=p-g,sA(this.planes[5].normal,i+r,u+s,d+h),this.planes[5].distance=p+g,this.planes.forEach(function(A){A.normalize(),A.updatePNVertexFlag()})}}])}(),Ue=function(){function A(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;a(this,A),this.x=0,this.y=0,this.x=t,this.y=e}return s(A,[{key:"clone",value:function(){return new A(this.x,this.y)}},{key:"copyFrom",value:function(A){this.x=A.x,this.y=A.y}}])}(),Ee=function(){function A(t,e,n,r){a(this,A),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 s(A,[{key:"toJSON",value:function(){}}],[{key:"fromRect",value:function(t){return new A(t.x,t.y,t.width,t.height)}},{key:"applyTransform",value:function(t,e){var n=CA(t.x,t.y,0,1),r=CA(t.x+t.width,t.y,0,1),i=CA(t.x,t.y+t.height,0,1),a=CA(t.x+t.width,t.y+t.height,0,1),o=mA(),s=mA(),u=mA(),c=mA();QA(o,n,e),QA(s,r,e),QA(u,i,e),QA(c,a,e);var l=Math.min(o[0],s[0],u[0],c[0]),h=Math.min(o[1],s[1],u[1],c[1]);return A.fromRect({x:l,y:h,width:Math.max(o[0],s[0],u[0],c[0])-l,height:Math.max(o[1],s[1],u[1],c[1])-h})}}])}(),be="Method not implemented.",ke="Use document.documentElement instead.";function xe(A){return void 0===A?0:A>360||-360>A?A%360:A}var He=nA();function Ie(A){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=3>=arguments.length||void 0===arguments[3]||arguments[3];return Array.isArray(A)&&3===A.length?n?rA(A):oA(He,A):_A(A)?n?aA(A,t,e):sA(He,A,t,e):n?aA(A[0],A[1]||t,A[2]||e):sA(He,A[0],A[1]||t,A[2]||e)}var Te=Math.PI/180;function Me(A){return A*Te}var Se=180/Math.PI;function Le(A){return A*Se}function De(A){return 360*A}var Pe=Math.PI/2;function Ne(A,t){return 16===t.length?function(A,t){var e,n,r=v(X(nA(),t),3),i=r[0],a=r[1],o=r[2],s=Math.asin(-t[2]/i);return Pe>s?s>-Pe?(e=Math.atan2(t[6]/a,t[10]/o),n=Math.atan2(t[1]/i,t[0]/i)):(n=0,e=-Math.atan2(t[4]/a,t[5]/a)):(n=0,e=Math.atan2(t[4]/a,t[5]/a)),A[0]=e,A[1]=s,A[2]=n,A}(A,t):function(A,t){var e=t[0],n=t[1],r=t[2],i=t[3],a=n*n,o=r*r,s=i*i,u=e*e+a+o+s,c=e*i-n*r;return c>.499995*u?(A[0]=Pe,A[1]=2*Math.atan2(n,e),A[2]=0):-.499995*u>c?(A[0]=-Pe,A[1]=2*Math.atan2(n,e),A[2]=0):(A[0]=Math.asin(2*(e*r-i*n)),A[1]=Math.atan2(2*(e*i+n*r),1-2*(o+s)),A[2]=Math.atan2(2*(e*n+r*i),1-2*(a+o))),A}(A,t)}function Oe(A,t,e,n,r){var i,a,o,s,u,c,l,h,d,f,B=Math.cos(A),g=Math.sin(A);return i=n*B,a=r*g,o=0,s=-n*g,u=r*B,c=0,l=t,h=e,d=1,(f=new C(9))[0]=i,f[1]=a,f[2]=o,f[3]=s,f[4]=u,f[5]=c,f[6]=l,f[7]=h,f[8]=d,f}function Ke(A){var t=A[0],e=A[1],n=A[3],r=A[4],i=Math.sqrt(t*t+e*e),a=Math.sqrt(n*n+r*r);if(0>t*r-e*n&&(r>t?i=-i:a=-a),i){var o=1/i;t*=o,e*=o}if(a){var s=1/a;n*=s,r*=s}var u=Le(Math.atan2(e,t));return[A[6],A[7],i,a,u]}var Re=F(),Ge=F(),Ve=mA(),_e=[nA(),nA(),nA()],Xe=nA();function Ye(A,t,e,n,r){A[0]=t[0]*n+e[0]*r,A[1]=t[1]*n+e[1]*r,A[2]=t[2]*n+e[2]*r}var We=function(A){return A[A.ORBITING=0]="ORBITING",A[A.EXPLORING=1]="EXPLORING",A[A.TRACKING=2]="TRACKING",A}({}),Je=function(A){return A[A.DEFAULT=0]="DEFAULT",A[A.ROTATIONAL=1]="ROTATIONAL",A[A.TRANSLATIONAL=2]="TRANSLATIONAL",A[A.CINEMATIC=3]="CINEMATIC",A}({}),Ze=function(A){return A[A.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",A[A.PERSPECTIVE=1]="PERSPECTIVE",A}({}),ze={UPDATED:"updated"},je=2e-4,qe=function(){return s(function A(){a(this,A),this.clipSpaceNearZ=he.NEGATIVE_ONE,this.eventEmitter=new y,this.matrix=F(),this.right=aA(1,0,0),this.up=aA(0,1,0),this.forward=aA(0,0,1),this.position=aA(0,0,1),this.focalPoint=aA(0,0,0),this.distanceVector=aA(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=F(),this.projectionMatrixInverse=F(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=We.EXPLORING,this.trackingMode=Je.DEFAULT,this.projectionMode=Ze.PERSPECTIVE,this.frustum=new Fe,this.orthoMatrix=F()},[{key:"isOrtho",value:function(){return this.projectionMode===Ze.ORTHOGRAPHIC}},{key:"getProjectionMode",value:function(){return this.projectionMode}},{key:"getPerspective",value:function(){return this.jitteredProjectionMatrix||this.projectionMatrix}},{key:"getPerspectiveInverse",value:function(){return this.projectionMatrixInverse}},{key:"getFrustum",value:function(){return this.frustum}},{key:"getPosition",value:function(){return this.position}},{key:"getFocalPoint",value:function(){return this.focalPoint}},{key:"getDollyingStep",value:function(){return this.dollyingStep}},{key:"getNear",value:function(){return this.near}},{key:"getFar",value:function(){return this.far}},{key:"getZoom",value:function(){return this.zoom}},{key:"getOrthoMatrix",value:function(){return this.orthoMatrix}},{key:"getView",value:function(){return this.view}},{key:"setEnableUpdate",value:function(A){this.enableUpdate=A}},{key:"setType",value:function(A,t){return this.type=A,this.setWorldRotation(this.type===We.EXPLORING),this._getAngles(),this.type===We.TRACKING&&void 0!==t&&this.setTrackingMode(t),this}},{key:"setProjectionMode",value:function(A){return this.projectionMode=A,this}},{key:"setTrackingMode",value:function(A){if(this.type!==We.TRACKING)throw Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=A,this}},{key:"setWorldRotation",value:function(A){return this.rotateWorld=A,this._getAngles(),this}},{key:"getViewTransform",value:function(){return H(F(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"jitterProjectionMatrix",value:function(A,t){var e=P(F(),[A,t,0]);this.jitteredProjectionMatrix=T(F(),e,this.projectionMatrix)}},{key:"clearJitterProjectionMatrix",value:function(){this.jitteredProjectionMatrix=void 0}},{key:"setMatrix",value:function(A){return this.matrix=A,this._update(),this}},{key:"setProjectionMatrix",value:function(A){this.projectionMatrix=A}},{key:"setFov",value:function(A){return this.setPerspective(this.near,this.far,A,this.aspect),this}},{key:"setAspect",value:function(A){return this.setPerspective(this.near,this.far,this.fov,A),this}},{key:"setNear",value:function(A){return this.projectionMode===Ze.PERSPECTIVE?this.setPerspective(A,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,A,this.far),this}},{key:"setFar",value:function(A){return this.projectionMode===Ze.PERSPECTIVE?this.setPerspective(this.near,A,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,A),this}},{key:"setViewOffset",value:function(A,t,e,n,r,i){return this.aspect=A/t,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=A,this.view.fullHeight=t,this.view.offsetX=e,this.view.offsetY=n,this.view.width=r,this.view.height=i,this.projectionMode===Ze.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"clearViewOffset",value:function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===Ze.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"setZoom",value:function(A){return this.zoom=A,this.projectionMode===Ze.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===Ze.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this}},{key:"setZoomByViewportPoint",value:function(A,t){var e=this.canvas.viewport2Canvas({x:t[0],y:t[1]}),n=e.x,r=e.y,i=this.roll;this.rotate(0,0,-i),this.setPosition(n,r),this.setFocalPoint(n,r),this.setZoom(A),this.rotate(0,0,i);var a=this.canvas.viewport2Canvas({x:t[0],y:t[1]}),o=aA(a.x-n,a.y-r,0),s=dA(o,this.right)/iA(this.right),u=dA(o,this.up)/iA(this.up),c=v(this.getPosition(),2),l=c[0],h=c[1],d=v(this.getFocalPoint(),2),f=d[0],B=d[1];return this.setPosition(l-s,h-u),this.setFocalPoint(f-s,B-u),this}},{key:"setPerspective",value:function(A,t,e,n){var r;this.projectionMode=Ze.PERSPECTIVE,this.fov=e,this.near=A,this.far=t,this.aspect=n;var i=this.near*Math.tan(Me(.5*this.fov))/this.zoom,a=2*i,o=this.aspect*a,s=-.5*o;if(null!==(r=this.view)&&void 0!==r&&r.enabled){var u=this.view.fullWidth,c=this.view.fullHeight;s+=this.view.offsetX*o/u,i-=this.view.offsetY*a/c,o*=this.view.width/u,a*=this.view.height/c}return function(A,t,e,n,r,i,a){var o,s,u=2*i,c=e-t,l=n-r,h=u/l,d=(e+t)/c,f=(n+r)/l,B=a-i,g=a*i;arguments.length>7&&void 0!==arguments[7]&&arguments[7]?(o=-a/B,s=-g/B):(o=-(a+i)/B,s=-2*g/B),A[0]=u/c,A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=h,A[6]=0,A[7]=0,A[8]=d,A[9]=f,A[10]=o,A[11]=-1,A[12]=0,A[13]=0,A[14]=s,A[15]=0}(this.projectionMatrix,s,s+o,i-a,i,A,this.far,this.clipSpaceNearZ===he.ZERO),H(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this}},{key:"setOrthographic",value:function(A,t,e,n,r,i){var a;this.projectionMode=Ze.ORTHOGRAPHIC,this.rright=t,this.left=A,this.top=e,this.bottom=n,this.near=r,this.far=i;var o=(this.rright-this.left)/(2*this.zoom),s=(this.top-this.bottom)/(2*this.zoom),u=(this.rright+this.left)/2,c=(this.top+this.bottom)/2,l=u-o,h=u+o,d=c+s,f=c-s;if(null!==(a=this.view)&&void 0!==a&&a.enabled){var B=(this.rright-this.left)/this.view.fullWidth/this.zoom,g=(this.top-this.bottom)/this.view.fullHeight/this.zoom;h=(l+=B*this.view.offsetX)+B*this.view.width,f=(d-=g*this.view.offsetY)-g*this.view.height}return this.clipSpaceNearZ===he.NEGATIVE_ONE?j(this.projectionMatrix,l,h,d,f,r,i):q(this.projectionMatrix,l,h,d,f,r,i),H(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this}},{key:"setPosition",value:function(A){var t=Ie(A,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.position[1],arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.position[2]);return this._setPosition(t),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this}},{key:"setFocalPoint",value:function(A){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.focalPoint[1],e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.focalPoint[2],n=aA(0,1,0);if(this.focalPoint=Ie(A,t,e),this.trackingMode===Je.CINEMATIC){var r=cA(nA(),this.focalPoint,this.position);A=r[0],t=r[1],e=r[2];var i=iA(r),a=Le(Math.asin(t/i)),o=90+Le(Math.atan2(e,A)),s=F();D(s,s,Me(o)),L(s,s,Me(a)),n=gA(nA(),[0,1,0],s)}return H(this.matrix,$(F(),this.position,this.focalPoint,n)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this}},{key:"getDistance",value:function(){return this.distance}},{key:"getDistanceVector",value:function(){return this.distanceVector}},{key:"setDistance",value:function(A){if(this.distance===A||0>A)return this;this.distance=A,je>this.distance&&(this.distance=je),this.dollyingStep=this.distance/100;var t=nA(),e=this.forward,n=this.focalPoint;return t[0]=(A=this.distance)*e[0]+n[0],t[1]=A*e[1]+n[1],t[2]=A*e[2]+n[2],this._setPosition(t),this.triggerUpdate(),this}},{key:"setMaxDistance",value:function(A){return this.maxDistance=A,this}},{key:"setMinDistance",value:function(A){return this.minDistance=A,this}},{key:"setAzimuth",value:function(A){return this.azimuth=xe(A),this.computeMatrix(),this._getAxes(),this.type===We.ORBITING||this.type===We.EXPLORING?this._getPosition():this.type===We.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(A){return this.elevation=xe(A),this.computeMatrix(),this._getAxes(),this.type===We.ORBITING||this.type===We.EXPLORING?this._getPosition():this.type===We.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getElevation",value:function(){return this.elevation}},{key:"setRoll",value:function(A){return this.roll=xe(A),this.computeMatrix(),this._getAxes(),this.type===We.ORBITING||this.type===We.EXPLORING?this._getPosition():this.type===We.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getRoll",value:function(){return this.roll}},{key:"_update",value:function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()}},{key:"computeMatrix",value:function(){var A=UA(FA(),[0,0,1],Me(this.roll));k(this.matrix);var t=UA(FA(),[1,0,0],Me((this.rotateWorld&&this.type!==We.TRACKING||this.type===We.TRACKING?1:-1)*this.elevation)),e=UA(FA(),[0,1,0],Me((this.rotateWorld&&this.type!==We.TRACKING||this.type===We.TRACKING?1:-1)*this.azimuth)),n=EA(FA(),e,t);n=EA(FA(),n,A);var r=J(F(),n);this.type===We.ORBITING||this.type===We.EXPLORING?(M(this.matrix,this.matrix,this.focalPoint),T(this.matrix,this.matrix,r),M(this.matrix,this.matrix,[0,0,this.distance])):this.type===We.TRACKING&&(M(this.matrix,this.matrix,this.position),T(this.matrix,this.matrix,r))}},{key:"_setPosition",value:function(A,t,e){this.position=Ie(A,t,e);var n=this.matrix;n[12]=this.position[0],n[13]=this.position[1],n[14]=this.position[2],n[15]=1,this._getOrthoMatrix()}},{key:"_getAxes",value:function(){oA(this.right,Ie(QA(mA(),[1,0,0,0],this.matrix))),oA(this.up,Ie(QA(mA(),[0,1,0,0],this.matrix))),oA(this.forward,Ie(QA(mA(),[0,0,1,0],this.matrix))),hA(this.right,this.right),hA(this.up,this.up),hA(this.forward,this.forward)}},{key:"_getAngles",value:function(){var A=this.distanceVector[0],t=this.distanceVector[1],e=this.distanceVector[2],n=iA(this.distanceVector);if(0===n)return this.elevation=0,void(this.azimuth=0);this.type===We.TRACKING||this.rotateWorld?(this.elevation=Le(Math.asin(t/n)),this.azimuth=Le(Math.atan2(-A,-e))):(this.elevation=-Le(Math.asin(t/n)),this.azimuth=-Le(Math.atan2(-A,-e)))}},{key:"_getPosition",value:function(){oA(this.position,Ie(QA(mA(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){!function(A,t,e){var n=t[0],r=t[1],i=t[2];A[0]=n*e[0]+r*e[3]+i*e[6],A[1]=n*e[1]+r*e[4]+i*e[7],A[2]=n*e[2]+r*e[5]+i*e[8]}(this.distanceVector,[0,0,-this.distance],function(A,t){return A[0]=t[0],A[1]=t[1],A[2]=t[2],A[3]=t[4],A[4]=t[5],A[5]=t[6],A[6]=t[8],A[7]=t[9],A[8]=t[10],A}(Q(),this.matrix)),uA(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=cA(nA(),this.focalPoint,this.position),this.distance=iA(this.distanceVector),this.dollyingStep=this.distance/100}},{key:"_getOrthoMatrix",value:function(){if(this.projectionMode===Ze.ORTHOGRAPHIC){var A=this.position,t=UA(FA(),[0,0,1],-this.roll*Math.PI/180);W(this.orthoMatrix,t,aA((this.rright-this.left)/2-A[0],(this.top-this.bottom)/2-A[1],0),aA(this.zoom,this.zoom,1),A)}}},{key:"triggerUpdate",value:function(){if(this.enableUpdate){var A=this.getViewTransform(),t=T(F(),this.getPerspective(),A);this.getFrustum().extractFromVPMatrix(t),this.eventEmitter.emit(ze.UPDATED)}}},{key:"rotate",value:function(A,t,e){throw Error(be)}},{key:"pan",value:function(A,t){throw Error(be)}},{key:"dolly",value:function(A){throw Error(be)}},{key:"createLandmark",value:function(A,t){throw Error(be)}},{key:"gotoLandmark",value:function(A,t){throw Error(be)}},{key:"cancelLandmarkAnimation",value:function(){throw Error(be)}}])}(),$e=function(A){return A[A.Standard=0]="Standard",A}({}),An=function(A){return A[A.ADDED=0]="ADDED",A[A.REMOVED=1]="REMOVED",A[A.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED",A}({}),tn=nA(),en=F(),nn=FA();function rn(A){if(A.localDirtyFlag){if(0!==A.localSkew[0]||0!==A.localSkew[1]){W(A.localTransform,A.localRotation,A.localPosition,aA(1,1,1),A.origin),0===A.localSkew[0]&&0===A.localSkew[1]||(k(en),en[4]=Math.tan(A.localSkew[0]),en[1]=Math.tan(A.localSkew[1]),T(A.localTransform,A.localTransform,en));var t=W(en,IA(nn,0,0,0,1),sA(tn,1,1,1),A.localScale,A.origin);T(A.localTransform,A.localTransform,t)}else{var e=A.localTransform,n=A.localPosition,r=A.localRotation,i=A.localScale,a=A.origin,o=0!==n[0]||0!==n[1]||0!==n[2];1!==r[3]||0!==r[0]||0!==r[1]||0!==r[2]||(1!==i[0]||1!==i[1]||1!==i[2])||(0!==a[0]||0!==a[1]||0!==a[2])?W(e,r,n,i,a):o?P(e,n):k(e)}A.localDirtyFlag=!1}}function an(A,t){A.dirtyFlag&&(t?T(A.worldTransform,t.worldTransform,A.localTransform):E(A.worldTransform,A.localTransform),A.dirtyFlag=!1)}var on={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Ee(0,0,0,0)},sn=function(A){return A.COORDINATE="<coordinate>",A.COLOR="<color>",A.PAINT="<paint>",A.NUMBER="<number>",A.ANGLE="<angle>",A.OPACITY_VALUE="<opacity-value>",A.SHADOW_BLUR="<shadow-blur>",A.LENGTH="<length>",A.PERCENTAGE="<percentage>",A.LENGTH_PERCENTAGE="<length> | <percentage>",A.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",A.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",A.LIST_OF_POINTS="<list-of-points>",A.PATH="<path>",A.FILTER="<filter>",A.Z_INDEX="<z-index>",A.OFFSET_DISTANCE="<offset-distance>",A.DEFINED_PATH="<defined-path>",A.MARKER="<marker>",A.TRANSFORM="<transform>",A.TRANSFORM_ORIGIN="<transform-origin>",A.TEXT="<text>",A.TEXT_TRANSFORM="<text-transform>",A}({});function un(A,t,e){A.prototype=t.prototype=e,e.constructor=A}function cn(A,t){var e=Object.create(A.prototype);for(var n in t)e[n]=t[n];return e}function ln(){}var hn=.7,dn=1/hn,fn="\\s*([+-]?\\d+)\\s*",Bn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",gn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",pn=/^#([0-9a-f]{3,8})$/,vn=RegExp("^rgb\\(".concat(fn,",").concat(fn,",").concat(fn,"\\)$")),wn=RegExp("^rgb\\(".concat(gn,",").concat(gn,",").concat(gn,"\\)$")),yn=RegExp("^rgba\\(".concat(fn,",").concat(fn,",").concat(fn,",").concat(Bn,"\\)$")),mn=RegExp("^rgba\\(".concat(gn,",").concat(gn,",").concat(gn,",").concat(Bn,"\\)$")),Cn=RegExp("^hsl\\(".concat(Bn,",").concat(gn,",").concat(gn,"\\)$")),Qn=RegExp("^hsla\\(".concat(Bn,",").concat(gn,",").concat(gn,",").concat(Bn,"\\)$")),Fn={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 Un(){return this.rgb().formatHex()}function En(){return this.rgb().formatRgb()}function bn(A){var t,e;return A=(A+"").trim().toLowerCase(),(t=pn.exec(A))?(e=t[1].length,t=parseInt(t[1],16),6===e?kn(t):3===e?new Hn(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===e?xn(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===e?xn(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=vn.exec(A))?new Hn(t[1],t[2],t[3],1):(t=wn.exec(A))?new Hn(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=yn.exec(A))?xn(t[1],t[2],t[3],t[4]):(t=mn.exec(A))?xn(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Cn.exec(A))?Dn(t[1],t[2]/100,t[3]/100,1):(t=Qn.exec(A))?Dn(t[1],t[2]/100,t[3]/100,t[4]):Fn.hasOwnProperty(A)?kn(Fn[A]):"transparent"===A?new Hn(NaN,NaN,NaN,0):null}function kn(A){return new Hn(A>>16&255,A>>8&255,255&A,1)}function xn(A,t,e,n){return n>0||(A=t=e=NaN),new Hn(A,t,e,n)}function Hn(A,t,e,n){this.r=+A,this.g=+t,this.b=+e,this.opacity=+n}function In(){return"#".concat(Ln(this.r)).concat(Ln(this.g)).concat(Ln(this.b))}function Tn(){var A=Mn(this.opacity);return"".concat(1===A?"rgb(":"rgba(").concat(Sn(this.r),", ").concat(Sn(this.g),", ").concat(Sn(this.b)).concat(1===A?")":", ".concat(A,")"))}function Mn(A){return isNaN(A)?1:Math.max(0,Math.min(1,A))}function Sn(A){return Math.max(0,Math.min(255,Math.round(A)||0))}function Ln(A){return(16>(A=Sn(A))?"0":"")+A.toString(16)}function Dn(A,t,e,n){return n>0?e>0&&1>e?t>0||(A=NaN):A=t=NaN:A=t=e=NaN,new Nn(A,t,e,n)}function Pn(A){if(A instanceof Nn)return new Nn(A.h,A.s,A.l,A.opacity);if(A instanceof ln||(A=bn(A)),!A)return new Nn;if(A instanceof Nn)return A;var t=(A=A.rgb()).r/255,e=A.g/255,n=A.b/255,r=Math.min(t,e,n),i=Math.max(t,e,n),a=NaN,o=i-r,s=(i+r)/2;return o?(a=t===i?(e-n)/o+6*(n>e):e===i?(n-t)/o+2:(t-e)/o+4,o/=.5>s?i+r:2-i-r,a*=60):o=s>0&&1>s?0:a,new Nn(a,o,s,A.opacity)}function Nn(A,t,e,n){this.h=+A,this.s=+t,this.l=+e,this.opacity=+n}function On(A){return 0>(A=(A||0)%360)?A+360:A}function Kn(A){return Math.max(0,Math.min(1,A||0))}function Rn(A,t,e){return 255*(60>A?t+(e-t)*A/60:180>A?e:240>A?t+(e-t)*(240-A)/60:t)}function Gn(A,t){if("function"!=typeof A||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var e=function(){for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];var a=t?t.apply(this,r):r[0],o=e.cache;if(o.has(a))return o.get(a);var s=A.apply(this,r);return e.cache=o.set(a,s)||o,s};return e.cache=new(Gn.Cache||Map),Gn.cacheList.push(e.cache),e}un(ln,bn,{copy:function(A){return Object.assign(new this.constructor,this,A)},displayable:function(){return this.rgb().displayable()},hex:Un,formatHex:Un,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Pn(this).formatHsl()},formatRgb:En,toString:En}),un(Hn,function(A,t,e,n){return 1===arguments.length?((r=A)instanceof ln||(r=bn(r)),r?new Hn((r=r.rgb()).r,r.g,r.b,r.opacity):new Hn):new Hn(A,t,e,null==n?1:n);var r},cn(ln,{brighter:function(A){return new Hn(this.r*(A=null==A?dn:Math.pow(dn,A)),this.g*A,this.b*A,this.opacity)},darker:function(A){return new Hn(this.r*(A=null==A?hn:Math.pow(hn,A)),this.g*A,this.b*A,this.opacity)},rgb:function(){return this},clamp:function(){return new Hn(Sn(this.r),Sn(this.g),Sn(this.b),Mn(this.opacity))},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:In,formatHex:In,formatHex8:function(){return"#".concat(Ln(this.r)).concat(Ln(this.g)).concat(Ln(this.b)).concat(Ln(255*(isNaN(this.opacity)?1:this.opacity)))},formatRgb:Tn,toString:Tn})),un(Nn,function(A,t,e,n){return 1===arguments.length?Pn(A):new Nn(A,t,e,null==n?1:n)},cn(ln,{brighter:function(A){return new Nn(this.h,this.s,this.l*(A=null==A?dn:Math.pow(dn,A)),this.opacity)},darker:function(A){return new Nn(this.h,this.s,this.l*(A=null==A?hn:Math.pow(hn,A)),this.opacity)},rgb:function(){var A=this.h%360+360*(0>this.h),t=this.l,e=t+(.5>t?t:1-t)*(isNaN(A)||isNaN(this.s)?0:this.s),n=2*t-e;return new Hn(Rn(240>A?A+120:A-240,n,e),Rn(A,n,e),Rn(120>A?A+240:A-120,n,e),this.opacity)},clamp:function(){return new Nn(On(this.h),Kn(this.s),Kn(this.l),Mn(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 A=Mn(this.opacity);return"".concat(1===A?"hsl(":"hsla(").concat(On(this.h),", ").concat(100*Kn(this.s),"%, ").concat(100*Kn(this.l),"%").concat(1===A?")":", ".concat(A,")"))}})),Gn.Cache=Map,Gn.cacheList=[],Gn.clearCache=function(){Gn.cacheList.forEach(function(A){return A.clear()})};var Vn=function(A){return A[A.kUnknown=0]="kUnknown",A[A.kNumber=1]="kNumber",A[A.kPercentage=2]="kPercentage",A[A.kEms=3]="kEms",A[A.kPixels=4]="kPixels",A[A.kRems=5]="kRems",A[A.kDegrees=6]="kDegrees",A[A.kRadians=7]="kRadians",A[A.kGradians=8]="kGradians",A[A.kTurns=9]="kTurns",A[A.kMilliseconds=10]="kMilliseconds",A[A.kSeconds=11]="kSeconds",A[A.kInteger=12]="kInteger",A}({}),_n=function(A){return A[A.kUNumber=0]="kUNumber",A[A.kUPercent=1]="kUPercent",A[A.kULength=2]="kULength",A[A.kUAngle=3]="kUAngle",A[A.kUTime=4]="kUTime",A[A.kUOther=5]="kUOther",A}({}),Xn=function(A){return A[A.kYes=0]="kYes",A[A.kNo=1]="kNo",A}({}),Yn=function(A){return A[A.kYes=0]="kYes",A[A.kNo=1]="kNo",A}({}),Wn=[{name:"em",unit_type:Vn.kEms},{name:"px",unit_type:Vn.kPixels},{name:"deg",unit_type:Vn.kDegrees},{name:"rad",unit_type:Vn.kRadians},{name:"grad",unit_type:Vn.kGradians},{name:"ms",unit_type:Vn.kMilliseconds},{name:"s",unit_type:Vn.kSeconds},{name:"rem",unit_type:Vn.kRems},{name:"turn",unit_type:Vn.kTurns}],Jn=function(A){return A[A.kUnknownType=0]="kUnknownType",A[A.kUnparsedType=1]="kUnparsedType",A[A.kKeywordType=2]="kKeywordType",A[A.kUnitType=3]="kUnitType",A[A.kSumType=4]="kSumType",A[A.kProductType=5]="kProductType",A[A.kNegateType=6]="kNegateType",A[A.kInvertType=7]="kInvertType",A[A.kMinType=8]="kMinType",A[A.kMaxType=9]="kMaxType",A[A.kClampType=10]="kClampType",A[A.kTransformType=11]="kTransformType",A[A.kPositionType=12]="kPositionType",A[A.kURLImageType=13]="kURLImageType",A[A.kColorType=14]="kColorType",A[A.kUnsupportedColorType=15]="kUnsupportedColorType",A}({}),Zn=function(A){return A?"number"===A?Vn.kNumber:"percent"===A||"%"===A?Vn.kPercentage:function(A){return Wn.find(function(t){return t.name===A}).unit_type}(A):Vn.kUnknown},zn=function(A){var t=1;switch(A){case Vn.kPixels:case Vn.kDegrees:case Vn.kSeconds:break;case Vn.kMilliseconds:t=.001;break;case Vn.kRadians:t=180/Math.PI;break;case Vn.kGradians:t=.9;break;case Vn.kTurns:t=360}return t},jn=function(A){switch(A){case Vn.kNumber:case Vn.kInteger:return"";case Vn.kPercentage:return"%";case Vn.kEms:return"em";case Vn.kRems:return"rem";case Vn.kPixels:return"px";case Vn.kDegrees:return"deg";case Vn.kRadians:return"rad";case Vn.kGradians:return"grad";case Vn.kMilliseconds:return"ms";case Vn.kSeconds:return"s";case Vn.kTurns:return"turn"}return""},qn=function(){return s(function A(){a(this,A)},[{key:"toString",value:function(){return this.buildCSSText(Xn.kNo,Yn.kNo,"")}},{key:"isNumericValue",value:function(){return this.getType()>=Jn.kUnitType&&this.getType()<=Jn.kClampType}}],[{key:"isAngle",value:function(A){return A===Vn.kDegrees||A===Vn.kRadians||A===Vn.kGradians||A===Vn.kTurns}},{key:"isLength",value:function(A){return A>=Vn.kEms&&Vn.kDegrees>A}},{key:"isRelativeUnit",value:function(A){return A===Vn.kPercentage||A===Vn.kEms||A===Vn.kRems}},{key:"isTime",value:function(A){return A===Vn.kSeconds||A===Vn.kMilliseconds}}])}(),$n=function(A){function t(A){var e;return a(this,t),(e=B(this,t)).colorSpace=A,e}return p(t,A),s(t,[{key:"getType",value:function(){return Jn.kColorType}},{key:"to",value:function(A){return this}}])}(qn),Ar=function(A){return A[A.Constant=0]="Constant",A[A.LinearGradient=1]="LinearGradient",A[A.RadialGradient=2]="RadialGradient",A}({}),tr=function(A){function t(A,e){var n;return a(this,t),(n=B(this,t)).type=A,n.value=e,n}return p(t,A),s(t,[{key:"clone",value:function(){return new t(this.type,this.value)}},{key:"buildCSSText",value:function(A,t,e){return e}},{key:"getType",value:function(){return Jn.kColorType}}])}(qn),er=function(A){function t(A){var e;return a(this,t),(e=B(this,t)).value=A,e}return p(t,A),s(t,[{key:"clone",value:function(){return new t(this.value)}},{key:"getType",value:function(){return Jn.kKeywordType}},{key:"buildCSSText",value:function(A,t,e){return e+this.value}}])}(qn),nr=function(A){return function(A){switch(A){case _n.kUNumber:return Vn.kNumber;case _n.kULength:return Vn.kPixels;case _n.kUPercent:return Vn.kPercentage;case _n.kUTime:return Vn.kSeconds;case _n.kUAngle:return Vn.kDegrees;default:return Vn.kUnknown}}(function(A){switch(A){case Vn.kNumber:case Vn.kInteger:return _n.kUNumber;case Vn.kPercentage:return _n.kUPercent;case Vn.kPixels:return _n.kULength;case Vn.kMilliseconds:case Vn.kSeconds:return _n.kUTime;case Vn.kDegrees:case Vn.kRadians:case Vn.kGradians:case Vn.kTurns:return _n.kUAngle;default:return _n.kUOther}}(A))},rr=function(A){function t(A){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Vn.kNumber;return a(this,t),e=B(this,t),n="string"==typeof r?Zn(r):r,e.unit=n,e.value=A,e}return p(t,A),s(t,[{key:"clone",value:function(){return new t(this.value,this.unit)}},{key:"equals",value:function(A){return this.value===A.value&&this.unit===A.unit}},{key:"getType",value:function(){return Jn.kUnitType}},{key:"convertTo",value:function(A){if(this.unit===A)return new t(this.value,this.unit);var e=nr(this.unit);if(e!==nr(A)||e===Vn.kUnknown)return null;var n=zn(this.unit)/zn(A);return new t(this.value*n,A)}},{key:"buildCSSText",value:function(A,t,e){var n;switch(this.unit){case Vn.kUnknown:break;case Vn.kInteger:n=Number(this.value).toFixed(0);break;case Vn.kNumber:case Vn.kPercentage:case Vn.kEms:case Vn.kRems:case Vn.kPixels:case Vn.kDegrees:case Vn.kRadians:case Vn.kGradians:case Vn.kMilliseconds:case Vn.kSeconds:case Vn.kTurns:var r=this.value,i=jn(this.unit);if(-999999>r||r>999999){var a=jn(this.unit);n=!Number.isFinite(r)||Number.isNaN(r)?function(A){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(Number.isFinite(A)?"NaN":A>0?"infinity":"-infinity")+t}(r,a):r+(a||"")}else n="".concat(r).concat(i)}return e+=n}}])}(qn),ir=new rr(0,"px");new rr(1,"px");var ar=new rr(0,"deg"),or=function(A){function t(A,e,n){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return a(this,t),(r=B(this,t,["rgb"])).r=A,r.g=e,r.b=n,r.alpha=i,r.isNone=o,r}return p(t,A),s(t,[{key:"clone",value:function(){return new t(this.r,this.g,this.b,this.alpha)}},{key:"buildCSSText",value:function(A,t,e){return"".concat(e,"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")}}])}($n),sr=new er("unset"),ur={"":sr,unset:sr,initial:new er("initial"),inherit:new er("inherit")},cr=new or(0,0,0,0,!0),lr=new or(0,0,0,0),hr=Gn(function(A,t,e,n){return new or(A,t,e,n)},function(A,t,e,n){return"rgba(".concat(A,",").concat(t,",").concat(e,",").concat(n,")")}),dr=function(A){return new rr(A,arguments.length>1&&void 0!==arguments[1]?arguments[1]:Vn.kNumber)};function fr(A){var t=A.type,e=A.value;return"hex"===t?"#".concat(e):"literal"===t?e:"rgb"===t?"rgb(".concat(e.join(","),")"):"rgba(".concat(e.join(","),")")}new rr(50,"%");var Br=function(){var A=/^(linear\-gradient)/i,t=/^(repeating\-linear\-gradient)/i,e=/^(radial\-gradient)/i,n=/^(repeating\-radial\-gradient)/i,r=/^(conic\-gradient)/i,i=/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,a=/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,o=/^(left|center|right|top|bottom)/i,s=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,u=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,c=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,l=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,h=/^\(/,d=/^\)/,f=/^,/,B=/^\#([0-9a-fA-F]+)/,g=/^([a-zA-Z]+)/,p=/^rgb/i,v=/^rgba/i,w=/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,y="";function m(A){throw Error("".concat(y,": ").concat(A))}function C(){var A=T(Q);return y.length>0&&m("Invalid input not EOF"),A}function Q(){return F("linear-gradient",A,E)||F("repeating-linear-gradient",t,E)||F("radial-gradient",e,b)||F("repeating-radial-gradient",n,b)||F("conic-gradient",r,b)}function F(A,t,e){return U(t,function(t){var n=e();return n&&(N(f)||m("Missing comma before color stops")),{type:A,orientation:n,colorStops:T(M)}})}function U(A,t){var e=N(A);if(e){N(h)||m("Missing (");var n=t(e);return N(d)||m("Missing )"),n}}function E(){return P("directional",i,1)||P("angular",l,1)}function b(){var A,t,e=k();return e&&((A=[]).push(e),t=y,N(f)&&((e=k())?A.push(e):y=t)),A}function k(){var A=function(){var A=P("shape",/^(circle)/i,0);A&&(A.style=D()||x());return A}()||function(){var A=P("shape",/^(ellipse)/i,0);A&&(A.style=L()||x());return A}();if(A)A.at=H();else{var t=x();if(t){A=t;var e=H();e&&(A.at=e)}else{var n=I();n&&(A={type:"default-radial",at:n})}}return A}function x(){return P("extent-keyword",a,1)}function H(){if(P("position",/^at/,0)){var A=I();return A||m("Missing positioning value"),A}}function I(){var A={x:L(),y:L()};if(A.x||A.y)return{type:"position",value:A}}function T(A){var t=A(),e=[];if(t)for(e.push(t);N(f);)(t=A())?e.push(t):m("One extra comma");return e}function M(){var A=P("hex",B,1)||U(v,function(){return{type:"rgba",value:T(S)}})||U(p,function(){return{type:"rgb",value:T(S)}})||P("literal",g,0);return A||m("Expected color definition"),A.length=L(),A}function S(){return N(w)[1]}function L(){return P("%",u,1)||P("position-keyword",o,1)||D()}function D(){return P("px",s,1)||P("em",c,1)}function P(A,t,e){var n=N(t);if(n)return{type:A,value:n[e]}}function N(A){var t=/^[\n\r\t\s]+/.exec(y);t&&O(t[0].length);var e=A.exec(y);return e&&O(e[0].length),e}function O(A){y=y.substring(A)}return function(A){return y=A,C()}}();function gr(A,t,e,n){var r=Me(n.value),i=0+t/2,a=0+e/2,o=Math.abs(t*Math.cos(r))+Math.abs(e*Math.sin(r));return{x1:A[0]+i-Math.cos(r)*o/2,y1:A[1]+a-Math.sin(r)*o/2,x2:A[0]+i+Math.cos(r)*o/2,y2:A[1]+a+Math.sin(r)*o/2}}function pr(A,t,e,n,r,i){var a=n.value,o=r.value;n.unit===Vn.kPercentage&&(a=n.value/100*t),r.unit===Vn.kPercentage&&(o=r.value/100*e);var s=Math.max(Ct([0,0],[a,o]),Ct([0,e],[a,o]),Ct([t,e],[a,o]),Ct([t,0],[a,o]));return i&&(i instanceof rr?s=i.value:i instanceof er&&("closest-side"===i.value?s=Math.min(a,t-a,o,e-o):"farthest-side"===i.value?s=Math.max(a,t-a,o,e-o):"closest-corner"===i.value&&(s=Math.min(Ct([0,0],[a,o]),Ct([0,e],[a,o]),Ct([t,e],[a,o]),Ct([t,0],[a,o]))))),{x:a+A[0],y:o+A[1],r:s}}var vr=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,wr=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,yr=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,mr=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var Cr={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},Qr=Gn(function(A){return dr("angular"===A.type?Number(A.value):Cr[A.value]||0,"deg")}),Fr=Gn(function(A){var t=50,e=50,n="%",r="%";if("position"===(null==A?void 0:A.type)){var i=A.value,a=i.x,o=i.y;"position-keyword"===(null==a?void 0:a.type)&&("left"===a.value?t=0:"center"===a.value?t=50:"right"===a.value?t=100:"top"===a.value?e=0:"bottom"===a.value&&(e=100)),"position-keyword"===(null==o?void 0:o.type)&&("left"===o.value?t=0:"center"===o.value?e=50:"right"===o.value?t=100:"top"===o.value?e=0:"bottom"===o.value&&(e=100)),"px"!==(null==a?void 0:a.type)&&"%"!==(null==a?void 0:a.type)&&"em"!==(null==a?void 0:a.type)||(n=null==a?void 0:a.type,t=Number(a.value)),"px"!==(null==o?void 0:o.type)&&"%"!==(null==o?void 0:o.type)&&"em"!==(null==o?void 0:o.type)||(r=null==o?void 0:o.type,e=Number(o.value))}return{cx:dr(t,n),cy:dr(e,r)}}),Ur=Gn(function(A){if(A.indexOf("linear")>-1||A.indexOf("radial")>-1)return Br(A).map(function(A){var t=A.type,e=A.orientation,n=A.colorStops;!function(A){var t,e,n=A.length;A[n-1].length=null!==(t=A[n-1].length)&&void 0!==t?t:{type:"%",value:"100"},n>1&&(A[0].length=null!==(e=A[0].length)&&void 0!==e?e:{type:"%",value:"0"});for(var r=0,i=Number(A[0].length.value),a=1;n>a;a++){var o,s=null===(o=A[a].length)||void 0===o?void 0:o.value;if(!DA(s)&&!DA(i)){for(var u=1;a-r>u;u++)A[r+u].length={type:"%",value:"".concat(i+(Number(s)-i)*u/(a-r))};r=a,i=Number(s)}}}(n);var r,i=n.map(function(A){return{offset:dr(Number(A.length.value),"%"),color:fr(A)}});if("linear-gradient"===t)return new tr(Ar.LinearGradient,{angle:e?Qr(e):ar,steps:i});if("radial-gradient"===t&&(e||(e=[{type:"shape",value:"circle"}]),"shape"===e[0].type&&"circle"===e[0].value)){var a,o=Fr(e[0].at),s=o.cx,u=o.cy;if(e[0].style){var c=e[0].style,l=c.type,h=c.value;"extent-keyword"===l?(ur[r=h]||(ur[r]=new er(r)),a=ur[r]):a=dr(h,l)}return new tr(Ar.RadialGradient,{cx:s,cy:u,size:a,steps:i})}});var t=A[0];if("("===A[1]||"("===A[2])if("l"===t){var e=vr.exec(A);if(e){var n,r=(null===(n=e[2].match(mr))||void 0===n?void 0:n.map(function(A){return A.split(":")}))||[];return[new tr(Ar.LinearGradient,{angle:dr(parseFloat(e[1]),"deg"),steps:r.map(function(A){var t=v(A,2),e=t[1];return{offset:dr(100*Number(t[0]),"%"),color:e}})})]}}else if("r"===t){var i=function(A){var t=wr.exec(A);if(t){var e,n=(null===(e=t[4].match(mr))||void 0===e?void 0:e.map(function(A){return A.split(":")}))||[];return{cx:dr(50,"%"),cy:dr(50,"%"),steps:n.map(function(A){var t=v(A,2),e=t[1];return{offset:dr(100*Number(t[0]),"%"),color:e}})}}return null}(A);if(i){if(!GA(i))return[new tr(Ar.RadialGradient,i)];A=i}}else if("p"===t)return function(A){var t=yr.exec(A);if(t){var e=t[1],n=t[2];switch(e){case"a":e="repeat";break;case"x":e="repeat-x";break;case"y":e="repeat-y";break;default:e="no-repeat"}return{image:n,repetition:e}}return null}(A)});function Er(A){return A&&!!A.image}function br(A){return A&&!DA(A.r)&&!DA(A.g)&&!DA(A.b)}var kr=Gn(function(A){if(Er(A))return i({repetition:"repeat"},A);if(DA(A)&&(A=""),"transparent"===A)return lr;if("currentColor"===A)A="black";else if("none"===A)return cr;var t=Ur(A);if(t)return t;var e=bn(A),n=[0,0,0,0];return null!==e&&(n[0]=e.r||0,n[1]=e.g||0,n[2]=e.b||0,n[3]=e.opacity),hr.apply(void 0,n)});function xr(A,t){if(br(A)&&br(t))return[[Number(A.r),Number(A.g),Number(A.b),Number(A.alpha)],[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],function(A){var t=A.slice();if(t[3])for(var e=0;3>e;e++)t[e]=Math.round(VA(t[e],0,255));return t[3]=VA(t[3],0,1),"rgba(".concat(t.join(","),")")}]}function Hr(A,t){if(DA(t))return dr(0,"px");if(t="".concat(t).trim().toLowerCase(),isFinite(Number(t))){if("px".search(A)>=0)return dr(Number(t),"px");if("deg".search(A)>=0)return dr(Number(t),"deg")}var e=[];t=t.replace(A,function(A){return e.push(A),"U".concat(A)});var n="U(".concat(A.source,")");return e.map(function(A){return dr(Number(t.replace(RegExp("U".concat(A),"g"),"").replace(RegExp(n,"g"),"*0")),A)})[0]}var Ir=function(A){return Hr(/px/g,A)},Tr=Gn(Ir);Gn(function(A){return Hr(RegExp("%","g"),A)});var Mr=function(A){return _A(A)||isFinite(Number(A))?dr(Number(A)||0,"px"):Hr(RegExp("px|%|em|rem","g"),A)},Sr=Gn(Mr),Lr=function(A){return Hr(/deg|rad|grad|turn/g,A)},Dr=Gn(Lr);function Pr(A,t,e,n){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,i="",a=A.value||0,o=t.value||0,s=nr(A.unit),u=A.convertTo(s),c=t.convertTo(s);return u&&c?(a=u.value,o=c.value,i=jn(A.unit)):(rr.isLength(A.unit)||rr.isLength(t.unit))&&(a=Kr(A,r,e),o=Kr(t,r,e),i="px"),[a,o,function(A){return n&&(A=Math.max(A,0)),A+i}]}function Nr(A){var t=0;return A.unit===Vn.kDegrees?t=A.value:A.unit===Vn.kRadians?t=Le(Number(A.value)):A.unit===Vn.kTurns?t=De(Number(A.value)):A.value&&(t=A.value),t}function Or(A,t){var e;return Array.isArray(A)?e=A.map(function(A){return Number(A)}):GA(A)?e=A.split(" ").map(function(A){return Number(A)}):_A(A)&&(e=[A]),2===t?1===e.length?[e[0],e[0]]:[e[0],e[1]]:4===t?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]]:"even"===t&&e.length%2==1?[].concat(l(e),l(e)):e}function Kr(A,t,e){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(A.unit===Vn.kPixels)return Number(A.value);if(A.unit===Vn.kPercentage&&e){var r=e.nodeName===le.GROUP?e.getLocalBounds():e.getGeometryBounds();return(n?r.min[t]:0)+A.value/100*r.halfExtents[t]*2}return 0}var Rr=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Gr(A){return""+A}var Vr=function(A){return dr("number"==typeof A?A:/^\s*[-+]?(\d*\.)?\d+\s*$/.test(A)?Number(A):0)},_r=Gn(Vr);function Xr(A,t){return[A,t,Gr]}function Yr(A,t){return function(e,n){return[e,n,function(e){return Gr(VA(e,A,t))}]}}function Wr(A,t){if(A.length===t.length)return[A,t,function(A){return A}]}function Jr(A){var t;return 0===A.parsedStyle.d.totalLength&&(A.parsedStyle.d.totalLength=It(A.parsedStyle.d.absolutePath,void 0,ZA(ZA({},t),{bbox:!1,length:!0})).length),A.parsedStyle.d.totalLength}function Zr(A,t){return A[0]===t[0]&&A[1]===t[1]}function zr(A,t){var e=A.prePoint,n=A.currentPoint,r=A.nextPoint,i=Math.pow(n[0]-e[0],2)+Math.pow(n[1]-e[1],2),a=Math.pow(n[0]-r[0],2)+Math.pow(n[1]-r[1],2),o=Math.acos((i+a-(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2)))/(2*Math.sqrt(i)*Math.sqrt(a)));if(!o||0===Math.sin(o)||XA(o,0))return{xExtra:0,yExtra:0};var s=Math.abs(Math.atan2(r[1]-n[1],r[0]-n[0])),u=Math.abs(Math.atan2(r[0]-n[0],r[1]-n[1]));return u=u>Math.PI/2?Math.PI-u:u,{xExtra:Math.cos(o/2-(s=s>Math.PI/2?Math.PI-s:s))*(t/2*(1/Math.sin(o/2)))-t/2||0,yExtra:Math.cos(u-o/2)*(t/2*(1/Math.sin(o/2)))-t/2||0}}function jr(A,t){return[t[0]+(t[0]-A[0]),t[1]+(t[1]-A[1])]}Gn(function(A){return GA(A)?A.split(" ").map(_r):A.map(_r)});var qr=function(A,t){return(0>A.x*t.y-A.y*t.x?-1:1)*Math.acos((A.x*t.x+A.y*t.y)/Math.sqrt((Math.pow(A.x,2)+Math.pow(A.y,2))*(Math.pow(t.x,2)+Math.pow(t.y,2))))},$r=function(A,t,e,n,r,i,a,o){t=Math.abs(t),e=Math.abs(e);var s=Me(n=YA(n,360));if(A.x===a.x&&A.y===a.y)return{x:A.x,y:A.y,ellipticalArcAngle:0};if(0===t||0===e)return{x:0,y:0,ellipticalArcAngle:0};var u=(A.x-a.x)/2,c=(A.y-a.y)/2,l={x:Math.cos(s)*u+Math.sin(s)*c,y:-Math.sin(s)*u+Math.cos(s)*c},h=Math.pow(l.x,2)/Math.pow(t,2)+Math.pow(l.y,2)/Math.pow(e,2);h>1&&(t*=Math.sqrt(h),e*=Math.sqrt(h));var d=(Math.pow(t,2)*Math.pow(e,2)-Math.pow(t,2)*Math.pow(l.y,2)-Math.pow(e,2)*Math.pow(l.x,2))/(Math.pow(t,2)*Math.pow(l.y,2)+Math.pow(e,2)*Math.pow(l.x,2)),f=(r!==i?1:-1)*Math.sqrt(d=0>d?0:d),B=f*(t*l.y/e),g=f*(-e*l.x/t),p={x:Math.cos(s)*B-Math.sin(s)*g+(A.x+a.x)/2,y:Math.sin(s)*B+Math.cos(s)*g+(A.y+a.y)/2},v={x:(l.x-B)/t,y:(l.y-g)/e},w=qr({x:1,y:0},v),y=qr(v,{x:(-l.x-B)/t,y:(-l.y-g)/e});!i&&y>0?y-=2*Math.PI:i&&0>y&&(y+=2*Math.PI);var m=w+(y%=2*Math.PI)*o,C=t*Math.cos(m),Q=e*Math.sin(m);return{x:Math.cos(s)*C-Math.sin(s)*Q+p.x,y:Math.sin(s)*C+Math.cos(s)*Q+p.y,ellipticalArcStartAngle:w,ellipticalArcEndAngle:w+y,ellipticalArcAngle:m,ellipticalArcCenter:p,resultantRx:t,resultantRy:e}};function Ai(A,t){var e=2>=arguments.length||void 0===arguments[2]||arguments[2],n=A.arcParams,r=n.rx,i=void 0===r?0:r,a=n.ry,o=void 0===a?0:a,s=n.xRotation,u=n.arcFlag,c=n.sweepFlag,l=$r({x:A.prePoint[0],y:A.prePoint[1]},i,o,s,!!u,!!c,{x:A.currentPoint[0],y:A.currentPoint[1]},t),h=$r({x:A.prePoint[0],y:A.prePoint[1]},i,o,s,!!u,!!c,{x:A.currentPoint[0],y:A.currentPoint[1]},e?t+.005:t-.005),d=h.x-l.x,f=h.y-l.y,B=Math.sqrt(d*d+f*f);return{x:-d/B,y:-f/B}}function ti(A){return Math.sqrt(A[0]*A[0]+A[1]*A[1])}function ei(A,t){return ti(A)*ti(t)?(A[0]*t[0]+A[1]*t[1])/(ti(A)*ti(t)):1}function ni(A,t){return(A[1]*t[0]>A[0]*t[1]?-1:1)*Math.acos(ei(A,t))}function ri(A,t){var e=t[1],n=t[2],r=YA(Me(t[3]),2*Math.PI),i=t[4],a=t[5],o=A[0],s=A[1],u=t[6],c=t[7],l=Math.cos(r)*(o-u)/2+Math.sin(r)*(s-c)/2,h=-1*Math.sin(r)*(o-u)/2+Math.cos(r)*(s-c)/2,d=l*l/(e*e)+h*h/(n*n);d>1&&(e*=Math.sqrt(d),n*=Math.sqrt(d));var f=e*e*(h*h)+n*n*(l*l),B=f?Math.sqrt((e*e*(n*n)-f)/f):1;i===a&&(B*=-1),isNaN(B)&&(B=0);var g=n?B*e*h/n:0,p=e?B*-n*l/e:0,v=(o+u)/2+Math.cos(r)*g-Math.sin(r)*p,w=(s+c)/2+Math.sin(r)*g+Math.cos(r)*p,y=[(l-g)/e,(h-p)/n],m=[(-1*l-g)/e,(-1*h-p)/n],C=ni([1,0],y),Q=ni(y,m);return ei(y,m)>-1||(Q=Math.PI),1>ei(y,m)||(Q=0),0===a&&Q>0&&(Q-=2*Math.PI),1===a&&0>Q&&(Q+=2*Math.PI),{cx:v,cy:w,rx:Zr(A,[u,c])?0:e,ry:Zr(A,[u,c])?0:n,startAngle:C,endAngle:C+Q,xRotation:r,arcFlag:i,sweepFlag:a}}function ii(A,t,e,n){var r=.5522847498307936,i=A*r,a=t*r,o=e-A,s=e+A,u=n-t,c=n+t;return[["M",o,n],["C",o,n-a,e-i,u,e,u],["C",e+i,u,s,n-a,s,n],["C",s,n+a,e+i,c,e,c],["C",e-i,c,o,n+a,o,n],["Z"]]}var ai=function(A){if(""===A||Array.isArray(A)&&0===A.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var t;try{t=Bt(A)}catch(e){t=Bt(""),console.error("[g]: Invalid SVG Path definition: ".concat(A))}!function(A){for(var t=0;A.length>t;t++){var e=A[t-1],n=A[t];if("M"===n[0]&&e){var r=e[0],i=void 0;"L"===r||"M"===r?i=[e[1],e[2]]:"C"!==r&&"A"!==r&&"Q"!==r||(i=[e[e.length-2],e[e.length-1]]),i&&Zr([n[1],n[2]],i)&&(A.splice(t,1),t--)}}}(t);var e=function(A){for(var t=!1,e=A.length,n=0;e>n;n++){var r=A[n][0];if("C"===r||"A"===r||"Q"===r){t=!0;break}}return t}(t),n=function(A){for(var t=[],e=[],n=[],r=0;A.length>r;r++){var i=A[r],a=i[0];"M"===a?(n.length&&(e.push(n),n=[]),n.push([i[1],i[2]])):"Z"===a?n.length&&(t.push(n),n=[]):n.push([i[1],i[2]])}return n.length>0&&e.push(n),{polygons:t,polylines:e}}(t),r=n.polygons,i=n.polylines,a=function(A){for(var t=[],e=null,n=null,r=null,i=0,a=A.length,o=0;a>o;o++){var s=A[o];n=A[o+1];var u=s[0],c={command:u,prePoint:e,params:s,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(u){case"M":r=[s[1],s[2]],i=o;break;case"A":var l=ri(e,s);c.arcParams=l}if("Z"===u)e=r,n=A[i+1];else{var h=s.length;e=[s[h-2],s[h-1]]}n&&"Z"===n[0]&&(n=A[i],t[i]&&(t[i].prePoint=e)),c.currentPoint=e,t[i]&&Zr(e,t[i].currentPoint)&&(t[i].prePoint=c.prePoint),c.nextPoint=n?[n[n.length-2],n[n.length-1]]:null;var d=c.prePoint;if(["L","H","V"].includes(u))c.startTangent=[d[0]-e[0],d[1]-e[1]],c.endTangent=[e[0]-d[0],e[1]-d[1]];else if("Q"===u){var f=[s[1],s[2]];c.startTangent=[d[0]-f[0],d[1]-f[1]],c.endTangent=[e[0]-f[0],e[1]-f[1]]}else if("T"===u){var B=t[o-1],g=jr(B.currentPoint,d);"Q"===B.command?(c.command="Q",c.startTangent=[d[0]-g[0],d[1]-g[1]],c.endTangent=[e[0]-g[0],e[1]-g[1]]):(c.command="TL",c.startTangent=[d[0]-e[0],d[1]-e[1]],c.endTangent=[e[0]-d[0],e[1]-d[1]])}else if("C"===u){var p=[s[1],s[2]],v=[s[3],s[4]];c.startTangent=[d[0]-p[0],d[1]-p[1]],c.endTangent=[e[0]-v[0],e[1]-v[1]],0===c.startTangent[0]&&0===c.startTangent[1]&&(c.startTangent=[p[0]-v[0],p[1]-v[1]]),0===c.endTangent[0]&&0===c.endTangent[1]&&(c.endTangent=[v[0]-p[0],v[1]-p[1]])}else if("S"===u){var w=t[o-1],y=jr(w.currentPoint,d),m=[s[1],s[2]];"C"===w.command?(c.command="C",c.startTangent=[d[0]-y[0],d[1]-y[1]],c.endTangent=[e[0]-m[0],e[1]-m[1]]):(c.command="SQ",c.startTangent=[d[0]-m[0],d[1]-m[1]],c.endTangent=[e[0]-m[0],e[1]-m[1]])}else if("A"===u){var C=Ai(c,0),Q=C.x,F=C.y,U=Ai(c,1,!1),E=U.x,b=U.y;c.startTangent=[Q,F],c.endTangent=[E,b]}t.push(c)}return t}(t),o=function(A,t){for(var e=[],n=[],r=[],i=0;A.length>i;i++){var a=A[i],o=a.currentPoint,s=a.params,u=a.prePoint,c=void 0;switch(a.command){case"Q":c=jt(u[0],u[1],s[1],s[2],s[3],s[4]);break;case"C":c=Wt(u[0],u[1],s[1],s[2],s[3],s[4],s[5],s[6]);break;case"A":var l=a.arcParams;c=Gt(l.cx,l.cy,l.rx,l.ry,l.xRotation,l.startAngle,l.endAngle);break;default:e.push(o[0]),n.push(o[1])}c&&(a.box=c,e.push(c.x,c.x+c.width),n.push(c.y,c.y+c.height)),t&&("L"===a.command||"M"===a.command)&&a.prePoint&&a.nextPoint&&r.push(a)}e=e.filter(function(A){return!Number.isNaN(A)&&A!==1/0&&A!==-1/0}),n=n.filter(function(A){return!Number.isNaN(A)&&A!==1/0&&A!==-1/0});var h=RA(e),d=RA(n),f=KA(e),B=KA(n);if(0===r.length)return{x:h,y:d,width:f-h,height:B-d};for(var g=0;r.length>g;g++){var p=r[g],v=p.currentPoint;v[0]===h?h-=zr(p,t).xExtra:v[0]===f&&(f+=zr(p,t).xExtra),v[1]===d?d-=zr(p,t).yExtra:v[1]===B&&(B+=zr(p,t).yExtra)}return{x:h,y:d,width:f-h,height:B-d}}(a,0),s=o.x,u=o.y,c=o.width,l=o.height;return{absolutePath:t,hasArc:e,segments:a,polygons:r,polylines:i,totalLength:0,rect:{x:Number.isFinite(s)?s:0,y:Number.isFinite(u)?u:0,width:Number.isFinite(c)?c:0,height:Number.isFinite(l)?l:0}}},oi=Gn(ai);function si(A){return GA(A)?oi(A):ai(A)}function ui(A,t,e){var n=A.curve,r=t.curve;n&&0!==n.length||(n=mt(A.absolutePath,!1),A.curve=n),r&&0!==r.length||(r=mt(t.absolutePath,!1),t.curve=r);var i=[n,r];n.length!==r.length&&(i=Lt(n,r));var a,o,s=Mt(i[0])!==Mt(i[1])?(o=(a=i[0]).slice(1).map(function(A,t,e){return t?e[t-1].slice(-2).concat(A.slice(1)):a[0].slice(1).concat(A.slice(1))}).map(function(A){return A.map(function(t,e){return A[A.length-e-2*(1-e%2)]})}).reverse(),[["M"].concat(o[0].slice(0,2))].concat(o.map(function(A){return["C"].concat(A.slice(2))}))):i[0].map(function(A){return Array.isArray(A)?[].concat(A):A});return[s,Tt(i[1],s),function(A){return A}]}function ci(A,t){return[A.points,t.points,function(A){return A}]}var li=null,hi=/\s*(\w+)\(([^)]*)\)/g;function di(A){return function(t){var e=0;return A.map(function(A){return A===li?t[e++]:A})}}function fi(A){return A}var Bi={matrix:["NNNNNN",[li,li,0,0,li,li,0,0,0,0,1,0,li,li,0,1],fi],matrix3d:["NNNNNNNNNNNNNNNN",fi],rotate:["A"],rotateX:["A"],rotateY:["A"],rotateZ:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",di([li,li,new rr(1)]),fi],scaleX:["N",di([li,new rr(1),new rr(1)]),di([li,new rr(1)])],scaleY:["N",di([new rr(1),li,new rr(1)]),di([new rr(1),li])],scaleZ:["N",di([new rr(1),new rr(1),li])],scale3d:["NNN",fi],skew:["Aa",null,fi],skewX:["A",null,di([li,ar])],skewY:["A",null,di([ar,li])],translate:["Tt",di([li,li,ir]),fi],translateX:["T",di([li,ir,ir]),di([li,ir])],translateY:["T",di([ir,li,ir]),di([ir,li])],translateZ:["L",di([ir,ir,li])],translate3d:["TTL",fi]};function gi(A){for(var t=[],e=A.length,n=0;e>n;n++){var r=A[n],i=r[0],a=r.slice(1);if("translate"===i||"skew"===i?1===a.length&&a.push(0):"scale"===i&&1===a.length&&a.push(a[0]),!Bi[i])return[];var o=a.map(function(A){return dr(A)});t.push({t:i,d:o})}return t}function pi(A){if(Array.isArray(A))return gi(A);if("none"===(A=(A||"none").trim()))return[];var t,e=[],n=0;for(hi.lastIndex=0;t=hi.exec(A);){if(t.index!==n)return[];n=t.index+t[0].length;var r=t[1],i=Bi[r];if(!i)return[];var a=t[2].split(","),o=i[0];if(a.length>o.length)return[];for(var s=[],u=0;o.length>u;u++){var c=a[u],l=o[u],h=void 0;if(void 0===(h=c?{A:function(A){return"0"===A.trim()?ar:Dr(A)},N:_r,T:Sr,L:Tr}[l.toUpperCase()](c):{a:ar,n:s[0],t:ir}[l]))return[];s.push(h)}if(e.push({t:r,d:s}),hi.lastIndex===A.length)return e}return[]}function vi(A){if(Array.isArray(A))return gi(A);if("none"===(A=(A||"none").trim()))return[];var t,e=[],n=0;for(hi.lastIndex=0;t=hi.exec(A);){if(t.index!==n)return[];n=t.index+t[0].length;var r=t[1],i=Bi[r];if(!i)return[];var a=t[2].split(","),o=i[0];if(a.length>o.length)return[];for(var s=[],u=0;o.length>u;u++){var c=a[u],l=o[u],h=void 0;if(void 0===(h=c?{A:function(A){return"0"===A.trim()?ar:Lr(A)},N:Vr,T:Mr,L:Ir}[l.toUpperCase()](c):{a:ar,n:s[0],t:ir}[l]))return[];s.push(h)}if(e.push({t:r,d:s}),hi.lastIndex===A.length)return e}return[]}function wi(A){var t,e,n,r;switch(A.t){case"rotateX":return r=Me(Nr(A.d[0])),[1,0,0,0,0,Math.cos(r),Math.sin(r),0,0,-Math.sin(r),Math.cos(r),0,0,0,0,1];case"rotateY":return r=Me(Nr(A.d[0])),[Math.cos(r),0,-Math.sin(r),0,0,1,0,0,Math.sin(r),0,Math.cos(r),0,0,0,0,1];case"rotate":case"rotateZ":return r=Me(Nr(A.d[0])),[Math.cos(r),Math.sin(r),0,0,-Math.sin(r),Math.cos(r),0,0,0,0,1,0,0,0,0,1];case"rotate3d":t=A.d[0].value,e=A.d[1].value,n=A.d[2].value,r=Me(Nr(A.d[3]));var i=t*t+e*e+n*n;if(0===i)t=1,e=0,n=0;else if(1!==i){var a=Math.sqrt(i);t/=a,e/=a,n/=a}var o=Math.sin(r/2),s=o*Math.cos(r/2),u=o*o;return[1-2*(e*e+n*n)*u,2*(t*e*u+n*s),2*(t*n*u-e*s),0,2*(t*e*u-n*s),1-2*(t*t+n*n)*u,2*(e*n*u+t*s),0,2*(t*n*u+e*s),2*(e*n*u-t*s),1-2*(t*t+e*e)*u,0,0,0,0,1];case"scale":return[A.d[0].value,0,0,0,0,A.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scaleX":return[A.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,A.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,A.d[0].value,0,0,0,0,1];case"scale3d":return[A.d[0].value,0,0,0,0,A.d[1].value,0,0,0,0,A.d[2].value,0,0,0,0,1];case"skew":var c=Me(Nr(A.d[0])),l=Me(Nr(A.d[1]));return[1,Math.tan(l),0,0,Math.tan(c),1,0,0,0,0,1,0,0,0,0,1];case"skewX":return r=Me(Nr(A.d[0])),[1,0,0,0,Math.tan(r),1,0,0,0,0,1,0,0,0,0,1];case"skewY":return r=Me(Nr(A.d[0])),[1,Math.tan(r),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,t=Kr(A.d[0],0,null)||0,e=Kr(A.d[1],0,null)||0,0,1];case"translateX":return[1,0,0,0,0,1,0,0,0,0,1,0,t=Kr(A.d[0],0,null)||0,0,0,1];case"translateY":return[1,0,0,0,0,1,0,0,0,0,1,0,0,e=Kr(A.d[0],0,null)||0,0,1];case"translateZ":return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,n=Kr(A.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,t=Kr(A.d[0],0,null)||0,e=Kr(A.d[1],0,null)||0,n=Kr(A.d[2],0,null)||0,1];case"perspective":var h=Kr(A.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,h?-1/h:0,0,0,0,1];case"matrix":return[A.d[0].value,A.d[1].value,0,0,A.d[2].value,A.d[3].value,0,0,0,0,1,0,A.d[4].value,A.d[5].value,0,1];case"matrix3d":return A.d.map(function(A){return A.value})}}function yi(A,t){return[A[0]*t[0]+A[4]*t[1]+A[8]*t[2]+A[12]*t[3],A[1]*t[0]+A[5]*t[1]+A[9]*t[2]+A[13]*t[3],A[2]*t[0]+A[6]*t[1]+A[10]*t[2]+A[14]*t[3],A[3]*t[0]+A[7]*t[1]+A[11]*t[2]+A[15]*t[3],A[0]*t[4]+A[4]*t[5]+A[8]*t[6]+A[12]*t[7],A[1]*t[4]+A[5]*t[5]+A[9]*t[6]+A[13]*t[7],A[2]*t[4]+A[6]*t[5]+A[10]*t[6]+A[14]*t[7],A[3]*t[4]+A[7]*t[5]+A[11]*t[6]+A[15]*t[7],A[0]*t[8]+A[4]*t[9]+A[8]*t[10]+A[12]*t[11],A[1]*t[8]+A[5]*t[9]+A[9]*t[10]+A[13]*t[11],A[2]*t[8]+A[6]*t[9]+A[10]*t[10]+A[14]*t[11],A[3]*t[8]+A[7]*t[9]+A[11]*t[10]+A[15]*t[11],A[0]*t[12]+A[4]*t[13]+A[8]*t[14]+A[12]*t[15],A[1]*t[12]+A[5]*t[13]+A[9]*t[14]+A[13]*t[15],A[2]*t[12]+A[6]*t[13]+A[10]*t[14]+A[14]*t[15],A[3]*t[12]+A[7]*t[13]+A[11]*t[14]+A[15]*t[15]]}function mi(A){var t=[0,0,0],e=[1,1,1],n=[0,0,0],r=[0,0,0,1],i=[0,0,0,1];return function(A,t,e,n,r,i){if(!function(A,t){var e=t[15];if(0===e)return!1;for(var n=1/e,r=0;16>r;r++)A[r]=t[r]*n;return!0}(Re,A))return!1;if(E(Ge,Re),Ge[3]=0,Ge[7]=0,Ge[11]=0,Ge[15]=1,1e-8>Math.abs(I(Ge)))return!1;var a,o,s=Re[3],u=Re[7],c=Re[11],l=Re[12],h=Re[13],d=Re[14],f=Re[15];if(0!==s||0!==u||0!==c){if(Ve[0]=s,Ve[1]=u,Ve[2]=c,Ve[3]=f,!H(Ge,Ge))return!1;x(Ge,Ge),QA(r,Ve,Ge)}else r[0]=r[1]=r[2]=0,r[3]=1;if(t[0]=l,t[1]=h,t[2]=d,(a=_e)[0][0]=(o=Re)[0],a[0][1]=o[1],a[0][2]=o[2],a[1][0]=o[4],a[1][1]=o[5],a[1][2]=o[6],a[2][0]=o[8],a[2][1]=o[9],a[2][2]=o[10],e[0]=iA(_e[0]),hA(_e[0],_e[0]),n[0]=dA(_e[0],_e[1]),Ye(_e[1],_e[1],_e[0],1,-n[0]),e[1]=iA(_e[1]),hA(_e[1],_e[1]),n[0]/=e[1],n[1]=dA(_e[0],_e[2]),Ye(_e[2],_e[2],_e[0],1,-n[1]),n[2]=dA(_e[1],_e[2]),Ye(_e[2],_e[2],_e[1],1,-n[2]),e[2]=iA(_e[2]),hA(_e[2],_e[2]),n[1]/=e[2],n[2]/=e[2],fA(Xe,_e[1],_e[2]),0>dA(_e[0],Xe))for(var B=0;3>B;B++)e[B]*=-1,_e[B][0]*=-1,_e[B][1]*=-1,_e[B][2]*=-1;i[0]=.5*Math.sqrt(Math.max(1+_e[0][0]-_e[1][1]-_e[2][2],0)),i[1]=.5*Math.sqrt(Math.max(1-_e[0][0]+_e[1][1]-_e[2][2],0)),i[2]=.5*Math.sqrt(Math.max(1-_e[0][0]-_e[1][1]+_e[2][2],0)),i[3]=.5*Math.sqrt(Math.max(1+_e[0][0]+_e[1][1]+_e[2][2],0)),_e[2][1]>_e[1][2]&&(i[0]=-i[0]),_e[0][2]>_e[2][0]&&(i[1]=-i[1]),_e[1][0]>_e[0][1]&&(i[2]=-i[2])}(function(A){return 0===A.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:A.map(wi).reduce(yi)}(A),t,e,n,r,i),[[t,e,n,i,r]]}var Ci=function(){function A(A,t){for(var e=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],n=0;4>n;n++)for(var r=0;4>r;r++)for(var i=0;4>i;i++)e[n][r]+=t[n][i]*A[i][r];return e}return function(t,e,n,r,i){for(var a=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],o=0;4>o;o++)a[o][3]=i[o];for(var s=0;3>s;s++)for(var u=0;3>u;u++)a[3][s]+=t[u]*a[u][s];var c=r[0],l=r[1],h=r[2],d=r[3],f=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];f[0][0]=1-2*(l*l+h*h),f[0][1]=2*(c*l-h*d),f[0][2]=2*(c*h+l*d),f[1][0]=2*(c*l+h*d),f[1][1]=1-2*(c*c+h*h),f[1][2]=2*(l*h-c*d),f[2][0]=2*(c*h-l*d),f[2][1]=2*(l*h+c*d),f[2][2]=1-2*(c*c+l*l),a=A(a,f);var B,g=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];n[2]&&(g[2][1]=n[2],a=A(a,g)),n[1]&&(g[2][1]=0,g[2][0]=n[0],a=A(a,g)),n[0]&&(g[2][0]=0,g[1][0]=n[0],a=A(a,g));for(var p=0;3>p;p++)for(var v=0;3>v;v++)a[p][v]*=e[p];return 0===(B=a)[0][2]&&0===B[0][3]&&0===B[1][2]&&0===B[1][3]&&0===B[2][0]&&0===B[2][1]&&1===B[2][2]&&0===B[2][3]&&0===B[3][2]&&1===B[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 Qi(A){return A.toFixed(6).replace(".000000","")}function Fi(A,t){var e,n;return A.decompositionPair!==t&&(A.decompositionPair=t,e=mi(A)),t.decompositionPair!==A&&(t.decompositionPair=A,n=mi(t)),null===e[0]||null===n[0]?[[!1],[!0],function(e){return e?t[0].d:A[0].d}]:(e[0].push(0),n[0].push(1),[e,n,function(A){var t=function(A,t,e){var n=function(A,t){for(var e=0,n=0;A.length>n;n++)e+=A[n]*t[n];return e}(A,t);n=VA(n,-1,1);var r=[];if(1===n)r=A;else for(var i=Math.acos(n),a=1*Math.sin(e*i)/Math.sqrt(1-n*n),o=0;4>o;o++)r.push(A[o]*(Math.cos(e*i)-n*a)+t[o]*a);return r}(e[0][3],n[0][3],A[5]);return Ci(A[0],A[1],A[2],t,A[4]).map(Qi).join(",")}])}function Ui(A){return A.replace(/[XY]/,"")}function Ei(A){return A.replace(/(X|Y|Z|3d)?$/,"3d")}var bi=function(A,t){return"perspective"===A&&"perspective"===t||("matrix"===A||"matrix3d"===A)&&("matrix"===t||"matrix3d"===t)};function ki(A,t,e){var n=!1;if(!A.length||!t.length){A.length||(n=!0,A=t,t=[]);for(var r=function(){var e=A[i],n=e.t,r=e.d,a="scale"===n.substring(0,5)?1:0;t.push({t:n,d:r.map(function(A){return"number"==typeof A?dr(a):dr(a,A.unit)})})},i=0;A.length>i;i++)r()}var a=[],o=[],s=[];if(A.length!==t.length){var u=Fi(A,t);a=[u[0]],o=[u[1]],s=[["matrix",[u[2]]]]}else for(var c=0;A.length>c;c++){var l=A[c].t,h=t[c].t,d=A[c].d,f=t[c].d,B=Bi[l],g=Bi[h],p=void 0;if(bi(l,h)){var v=Fi([A[c]],[t[c]]);a.push(v[0]),o.push(v[1]),s.push(["matrix",[v[2]]])}else{if(l===h)p=l;else if(B[2]&&g[2]&&Ui(l)===Ui(h))p=Ui(l),d=B[2](d),f=g[2](f);else{if(!B[1]||!g[1]||Ei(l)!==Ei(h)){var w=Fi(A,t);a=[w[0]],o=[w[1]],s=[["matrix",[w[2]]]];break}p=Ei(l),d=B[1](d),f=g[1](f)}for(var y=[],m=[],C=[],Q=0;d.length>Q;Q++){var F=Pr(d[Q],f[Q],e,!1,Q);y[Q]=F[0],m[Q]=F[1],C.push(F[2])}a.push(y),o.push(m),s.push([p,C])}}if(n){var U=a;a=o,o=U}return[a,o,function(A){return A.map(function(A,t){var e=A.map(function(A,e){return s[t][1][e](A)}).join(",");return"matrix"===s[t][0]&&16===e.split(",").length&&(s[t][0]="matrix3d"),"matrix3d"===s[t][0]&&6===e.split(",").length&&(s[t][0]="matrix"),"".concat(s[t][0],"(").concat(e,")")}).join(" ")}]}var xi=Gn(function(A){if(GA(A)){if("text-anchor"===A)return[dr(0,"px"),dr(0,"px")];var t=A.split(" ");return 1===t.length&&("top"===t[0]||"bottom"===t[0]?(t[1]=t[0],t[0]="center"):t[1]="center"),2!==t.length?null:[Sr(Hi(t[0])),Sr(Hi(t[1]))]}return[dr(A[0]||0,"px"),dr(A[1]||0,"px")]});function Hi(A){return"center"===A?"50%":"left"===A||"top"===A?"0%":"right"===A||"bottom"===A?"100%":A}var Ii=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:sn.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:sn.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:sn.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:sn.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:sn.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:sn.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:sn.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:sn.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:sn.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:sn.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:sn.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:sn.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:sn.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:sn.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:sn.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:sn.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:sn.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:sn.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:sn.FILTER},{n:"clipPath",syntax:sn.DEFINED_PATH},{n:"textPath",syntax:sn.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:sn.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:sn.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:sn.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:sn.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:sn.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:sn.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:sn.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:sn.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:sn.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:sn.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:sn.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:sn.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:sn.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:sn.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:sn.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:sn.COORDINATE},{n:"y1",int:!0,l:!0,syntax:sn.COORDINATE},{n:"z1",int:!0,l:!0,syntax:sn.COORDINATE},{n:"x2",int:!0,l:!0,syntax:sn.COORDINATE},{n:"y2",int:!0,l:!0,syntax:sn.COORDINATE},{n:"z2",int:!0,l:!0,syntax:sn.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:sn.PATH,p:50},{n:"points",int:!0,l:!0,syntax:sn.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:sn.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:sn.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:sn.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:sn.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:sn.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:sn.NUMBER,d:function(A){return A===le.PATH||A===le.POLYGON||A===le.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:sn.MARKER},{n:"markerEnd",syntax:sn.MARKER},{n:"markerMid",syntax:sn.MARKER},{n:"markerStartOffset",syntax:sn.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:sn.LENGTH,l:!0,int:!0,d:"0"}],Ti=new Set(Ii.filter(function(A){return!!A.l}).map(function(A){return A.n})),Mi={},Si=function(){return s(function A(t){var e=this;a(this,A),this.runtime=t,Ii.forEach(function(A){e.registerMetadata(A)})},[{key:"registerMetadata",value:function(A){[A.n].concat(l(A.a||[])).forEach(function(t){Mi[t]=A})}},{key:"getPropertySyntax",value:function(A){return this.runtime.CSSPropertySyntaxFactory[A]}},{key:"processProperties",value:function(A,t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0};Object.assign(A.attributes,t);var n=A.parsedStyle.clipPath,r=A.parsedStyle.offsetPath;!function(A,t){var e=Li(A);for(var n in t)e.has(n)&&(A.parsedStyle[n]=t[n])}(A,t);var a=!!e.forceUpdateGeometry;if(!a)for(var o in t)if(Ti.has(o)){a=!0;break}var s,u=Li(A);u.has("fill")&&t.fill&&(A.parsedStyle.fill=kr(t.fill)),u.has("stroke")&&t.stroke&&(A.parsedStyle.stroke=kr(t.stroke)),u.has("shadowColor")&&t.shadowColor&&(A.parsedStyle.shadowColor=kr(t.shadowColor)),u.has("filter")&&t.filter&&(A.parsedStyle.filter=function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if("none"===(A=A.toLowerCase().trim()))return[];for(var t,e=/\s*([\w-]+)\(([^)]*)\)/g,n=[],r=0;t=e.exec(A);){if(t.index!==r)return[];if(r=t.index+t[0].length,Rr.indexOf(t[1])>-1&&n.push({name:t[1],params:t[2].split(" ").map(function(A){return Hr(/deg|rad|grad|turn|px|%/g,A)||kr(A)})}),e.lastIndex===A.length)return n}return[]}(t.filter)),u.has("radius")&&!DA(t.radius)&&(A.parsedStyle.radius=Or(t.radius,4)),u.has("lineDash")&&!DA(t.lineDash)&&(A.parsedStyle.lineDash=Or(t.lineDash,"even")),u.has("points")&&t.points&&(A.parsedStyle.points={points:GA(s=t.points)?s.split(" ").map(function(A){var t=v(A.split(","),2),e=t[1];return[Number(t[0]),Number(e)]}):s,totalLength:0,segments:[]}),u.has("d")&&""===t.d&&(A.parsedStyle.d=i({},on)),u.has("d")&&t.d&&(A.parsedStyle.d=si(t.d)),u.has("textTransform")&&t.textTransform&&this.runtime.CSSPropertySyntaxFactory[sn.TEXT_TRANSFORM].calculator(null,null,{value:t.textTransform},A,null),u.has("clipPath")&&!JA(t.clipPath)&&this.runtime.CSSPropertySyntaxFactory[sn.DEFINED_PATH].calculator("clipPath",n,t.clipPath,A,this.runtime),u.has("offsetPath")&&t.offsetPath&&this.runtime.CSSPropertySyntaxFactory[sn.DEFINED_PATH].calculator("offsetPath",r,t.offsetPath,A,this.runtime),u.has("transform")&&t.transform&&(A.parsedStyle.transform=pi(t.transform)),u.has("transformOrigin")&&t.transformOrigin&&(A.parsedStyle.transformOrigin=xi(t.transformOrigin)),u.has("markerStart")&&t.markerStart&&(A.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[sn.MARKER].calculator(null,t.markerStart,t.markerStart,null,null)),u.has("markerEnd")&&t.markerEnd&&(A.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[sn.MARKER].calculator(null,t.markerEnd,t.markerEnd,null,null)),u.has("markerMid")&&t.markerMid&&(A.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[sn.MARKER].calculator("",t.markerMid,t.markerMid,null,null)),u.has("zIndex")&&!DA(t.zIndex)&&this.runtime.CSSPropertySyntaxFactory[sn.Z_INDEX].postProcessor(A),u.has("offsetDistance")&&!DA(t.offsetDistance)&&this.runtime.CSSPropertySyntaxFactory[sn.OFFSET_DISTANCE].postProcessor(A),u.has("transform")&&t.transform&&this.runtime.CSSPropertySyntaxFactory[sn.TRANSFORM].postProcessor(A),u.has("transformOrigin")&&t.transformOrigin&&this.runtime.CSSPropertySyntaxFactory[sn.TRANSFORM_ORIGIN].postProcessor(A),a&&(A.dirty(!0,!0),e.forceUpdateGeometry||this.runtime.sceneGraphService.dirtyToRoot(A))}},{key:"updateGeometry",value:function(A){var t=A.nodeName,e=this.runtime.geometryUpdaterFactory[t];if(e){var n=A.geometry;n.contentBounds||(n.contentBounds=new me),n.renderBounds||(n.renderBounds=new me);var r=A.parsedStyle,i=e.update(r,A),a=i.cx,o=void 0===a?0:a,s=i.cy,u=void 0===s?0:s,c=i.cz,l=void 0===c?0:c,h=i.hwidth,d=void 0===h?0:h,f=i.hheight,B=void 0===f?0:f,g=i.hdepth,p=void 0===g?0:g,v=[Math.abs(d),Math.abs(B),p],w=r.stroke,y=r.lineWidth,m=void 0===y?1:y,C=r.increasedLineWidthForHitTesting,Q=void 0===C?0:C,F=r.shadowType,U=void 0===F?"outer":F,E=r.shadowColor,b=r.filter,k=void 0===b?[]:b,x=r.transformOrigin,H=[o,u,l];if(n.contentBounds.update(H,v),w&&!w.isNone){var I=((m||0)+(Q||0))*(t===le.POLYLINE||t===le.POLYGON||t===le.PATH?Math.SQRT2:.5);v[0]+=I,v[1]+=I}if(n.renderBounds.update(H,v),E&&U&&"inner"!==U){var T=n.renderBounds,M=T.min,S=T.max,L=r.shadowBlur||0,D=r.shadowOffsetX||0,P=r.shadowOffsetY||0,N=S[0]+L+D,O=M[1]-L+P,K=S[1]+L+P;M[0]=Math.min(M[0],M[0]-L+D),S[0]=Math.max(S[0],N),M[1]=Math.min(M[1],O),S[1]=Math.max(S[1],K),n.renderBounds.setMinMax(M,S)}k.forEach(function(A){var t=A.name,e=A.params;if("blur"===t){var r=e[0].value;n.renderBounds.update(n.renderBounds.center,uA(n.renderBounds.halfExtents,n.renderBounds.halfExtents,[r,r,0]))}else if("drop-shadow"===t){var i=e[0].value,a=e[1].value,o=e[2].value,s=n.renderBounds,u=s.min,c=s.max,l=c[0]+o+i,h=u[1]-o+a,d=c[1]+o+a;u[0]=Math.min(u[0],u[0]-o+i),c[0]=Math.max(c[0],l),u[1]=Math.min(u[1],h),c[1]=Math.max(c[1],d),n.renderBounds.setMinMax(u,c)}}),A.geometry.dirty=!1;var R=0>B,G=(0>d?-1:1)*(x?Kr(x[0],0,A,!0):0),V=(R?-1:1)*(x?Kr(x[1],1,A,!0):0);(G||V)&&A.setOrigin(G,V)}}},{key:"updateSizeAttenuation",value:function(A,t){A.style.isSizeAttenuation?(A.style.rawLineWidth||(A.style.rawLineWidth=A.style.lineWidth),A.style.lineWidth=(A.style.rawLineWidth||1)/t,A.nodeName===le.CIRCLE&&(A.style.rawR||(A.style.rawR=A.style.r),A.style.r=(A.style.rawR||1)/t)):(A.style.rawLineWidth&&(A.style.lineWidth=A.style.rawLineWidth,delete A.style.rawLineWidth),A.nodeName===le.CIRCLE&&A.style.rawR&&(A.style.r=A.style.rawR,delete A.style.rawR))}}])}();function Li(A){return A.constructor.PARSED_STYLE_LIST}var Di=function(){return s(function A(){a(this,A),this.mixer=Xr},[{key:"calculator",value:function(A,t,e,n){return Nr(e)}}])}(),Pi=function(){return s(function A(){a(this,A)},[{key:"calculator",value:function(A,t,e,n,r){return e instanceof er&&(e=null),r.sceneGraphService.updateDisplayObjectDependency(A,t,e,n),"clipPath"===A&&n.forEach(function(A){0===A.childNodes.length&&r.sceneGraphService.dirtyToRoot(A)}),e}}])}(),Ni=function(){return s(function A(){a(this,A),this.parser=kr,this.mixer=xr},[{key:"calculator",value:function(A,t,e,n){return e instanceof er?"none"===e.value?cr:lr:e}}])}(),Oi=function(){return s(function A(){a(this,A)},[{key:"calculator",value:function(A,t,e){return e instanceof er?[]:e}}])}();function Ki(A){var t=A.parsedStyle.fontSize;return DA(t)?null:t}var Ri=function(){return s(function A(){a(this,A),this.mixer=Xr},[{key:"calculator",value:function(A,t,e,n,r){if(_A(e))return e;if(!rr.isRelativeUnit(e.unit))return e.value;if(e.unit===Vn.kPercentage)return 0;if(e.unit===Vn.kEms){if(n.parentNode){var i=Ki(n.parentNode);if(i)return i*=e.value}return 0}if(e.unit===Vn.kRems){var a;if(null!=n&&null!==(a=n.ownerDocument)&&void 0!==a&&a.documentElement){var o=Ki(n.ownerDocument.documentElement);if(o)return o*=e.value}return 0}}}])}(),Gi=function(){return s(function A(){a(this,A),this.mixer=Wr},[{key:"calculator",value:function(A,t,e){return e.map(function(A){return A.value})}}])}(),Vi=function(){return s(function A(){a(this,A),this.mixer=Wr},[{key:"calculator",value:function(A,t,e){return e.map(function(A){return A.value})}}])}(),_i=function(){return s(function A(){a(this,A)},[{key:"calculator",value:function(A,t,e,n){var r;e instanceof er&&(e=null);var i=null===(r=e)||void 0===r?void 0:r.cloneNode(!0);return i&&(i.style.isMarker=!0),i}}])}(),Xi=function(){return s(function A(){a(this,A),this.mixer=Xr},[{key:"calculator",value:function(A,t,e){return e.value}}])}(),Yi=function(){return s(function A(){a(this,A),this.mixer=Yr(0,1)},[{key:"calculator",value:function(A,t,e){return e.value}},{key:"postProcessor",value:function(A){var t=A.parsedStyle,e=t.offsetPath;if(e){var n=e.nodeName;if(n===le.LINE||n===le.PATH||n===le.POLYLINE){var r=e.getPoint(t.offsetDistance);r&&A.setLocalPosition(r.x,r.y)}}}}])}(),Wi=function(){return s(function A(){a(this,A),this.mixer=Yr(0,1)},[{key:"calculator",value:function(A,t,e){return e.value}}])}(),Ji=function(){return s(function A(){a(this,A),this.parser=si,this.mixer=ui},[{key:"calculator",value:function(A,t,e){return e instanceof er&&"unset"===e.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Ee(0,0,0,0)}:e}}])}(),Zi=s(function A(){a(this,A),this.mixer=ci}),zi=function(A){function t(){var A;a(this,t);for(var e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];return(A=B(this,t,[].concat(n))).mixer=Yr(0,1/0),A}return p(t,A),s(t)}(Ri),ji=function(){return s(function A(){a(this,A)},[{key:"calculator",value:function(A,t,e,n){return e instanceof er?"unset"===e.value?"":e.value:"".concat(e)}},{key:"postProcessor",value:function(A){A.nodeValue="".concat(A.parsedStyle.text)||""}}])}(),qi=function(){return s(function A(){a(this,A)},[{key:"calculator",value:function(A,t,e,n){var r=n.getAttribute("text");if(r){var i=r;"capitalize"===e.value?i=r.charAt(0).toUpperCase()+r.slice(1):"lowercase"===e.value?i=r.toLowerCase():"uppercase"===e.value&&(i=r.toUpperCase()),n.parsedStyle.text=i}return e.value}}])}(),$i=new WeakMap;var Aa="undefined"!=typeof window&&void 0!==window.document;function ta(A){return!!A.getAttribute}function ea(A,t){var e=Number(A.parsedStyle.zIndex||0),n=Number(t.parsedStyle.zIndex||0);if(e===n){var r=A.parentNode;if(r){var i=r.childNodes||[];return i.indexOf(A)-i.indexOf(t)}}return e-n}function na(A){var t=A;do{var e;if(null===(e=t.parsedStyle)||void 0===e?void 0:e.clipPath)return t;t=t.parentElement}while(null!==t);return null}function ra(A,t){if(Aa)return document.defaultView.getComputedStyle(A,null).getPropertyValue(t)}var ia={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},aa="object"==typeof performance&&performance.now?performance:Date;function oa(A){return A.nodeName===le.FRAGMENT||A.getRootNode().nodeName===le.FRAGMENT}var sa=1,ua="object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:{},ca=Date.now(),la={},ha=Date.now(),da=function(A){if("function"!=typeof A)throw new TypeError("".concat(A," is not a function"));var t=Date.now(),e=t-ha,n=e>16?0:16-e,r=sa++;return la[r]=A,Object.keys(la).length>1||setTimeout(function(){ha=t;var A=la;la={},Object.keys(A).forEach(function(t){return A[t](ua.performance&&"function"==typeof ua.performance.now?ua.performance.now():Date.now()-ca)})},n),r},fa=function(A){delete la[A]},Ba=function(A){return"string"!=typeof A?da:""===A?ua.requestAnimationFrame:ua["".concat(A,"RequestAnimationFrame")]},ga=function(A,t){for(var e=0;void 0!==A[e];){if(t(A[e]))return A[e];e+=1}}(["","webkit","moz","ms","o"],function(A){return!!Ba(A)}),pa=Ba(ga),va=function(A){return"string"!=typeof A?fa:""===A?ua.cancelAnimationFrame:ua["".concat(A,"CancelAnimationFrame")]||ua["".concat(A,"CancelRequestAnimationFrame")]}(ga);ua.requestAnimationFrame=pa,ua.cancelAnimationFrame=va;var wa=function(){return s(function A(){a(this,A),this.callbacks=[]},[{key:"getCallbacksNum",value:function(){return this.callbacks.length}},{key:"tapPromise",value:function(A,t){this.callbacks.push(t)}},{key:"promise",value:function(){for(var A=arguments.length,t=Array(A),e=0;A>e;e++)t[e]=arguments[e];return Promise.all(this.callbacks.map(function(A){return A.apply(void 0,t)}))}}])}(),ya=function(){return s(function A(){a(this,A),this.callbacks=[]},[{key:"tapPromise",value:function(A,t){this.callbacks.push(t)}},{key:"promise",value:(A=se(ae().mark(function A(){var t,e,n,r,i=arguments;return ae().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:if(!this.callbacks.length){A.next=6;break}return A.next=1,(t=this.callbacks)[0].apply(t,i);case 1:e=A.sent,n=1;case 2:if(n>=this.callbacks.length){A.next=5;break}return r=this.callbacks[n],A.next=3,r(e);case 3:e=A.sent;case 4:n++,A.next=2;break;case 5:return A.abrupt("return",e);case 6:return A.abrupt("return",null);case 7:case"end":return A.stop()}},A,this)})),function(){return A.apply(this,arguments)})}]);var A}(),ma=function(){return s(function A(){a(this,A),this.callbacks=[]},[{key:"tap",value:function(A,t){this.callbacks.push(t)}},{key:"call",value:function(){for(var A=arguments.length,t=Array(A),e=0;A>e;e++)t[e]=arguments[e];var n=arguments;this.callbacks.forEach(function(A){A.apply(void 0,n)})}}])}(),Ca=function(){return s(function A(){a(this,A),this.callbacks=[]},[{key:"tap",value:function(A,t){this.callbacks.push(t)}},{key:"call",value:function(){for(var A=arguments.length,t=Array(A),e=0;A>e;e++)t[e]=arguments[e];if(this.callbacks.length){for(var n=this.callbacks[0].apply(void 0,arguments),r=1;this.callbacks.length>r;r++){n=(0,this.callbacks[r])(n)}return n}return null}}])}(),Qa=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Fa=/([\"\'])[^\'\"]+\1/;function Ua(A){var t=A.fontSize,e=A.fontFamily,n=A.fontStyle,r=A.fontVariant,i=A.fontWeight;return{fontSize:void 0===t?16:t,fontFamily:void 0===e?"sans-serif":e,fontStyle:void 0===n?"normal":n,fontVariant:void 0===r?"normal":r,fontWeight:void 0===i?"normal":i}}var Ea=Gn(function(A){for(var t=Ua(A),e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,a=t.fontWeight,o=_A(e)&&"".concat(e,"px")||"16px",s=n.split(","),u=s.length-1;u>=0;u--){var c=s[u].trim();!Fa.test(c)&&0>Qa.indexOf(c)&&(c='"'.concat(c,'"')),s[u]=c}return"".concat(r," ").concat(i," ").concat(a," ").concat(o," ").concat(s.join(","))},function(A){var t=Ua(A),e=t.fontSize,n=t.fontFamily,r=t.fontVariant,i=t.fontWeight;return"".concat(t.fontStyle,"_").concat(r,"_").concat(i,"_").concat(e,"_").concat(n)}),ba=function(A){return Math.max(A,1e-6)};function ka(A,t,e){return k(A),A[4]=Math.tan(t),A[1]=Math.tan(e),A}var xa=F(),Ha=F(),Ia={scale:function(A){N(xa,[A[0].value,A[1].value,1].map(function(A){return ba(A)}))},scaleX:function(A){N(xa,[A[0].value,1,1].map(function(A){return ba(A)}))},scaleY:function(A){N(xa,[1,A[0].value,1].map(function(A){return ba(A)}))},scaleZ:function(A){N(xa,[1,1,A[0].value].map(function(A){return ba(A)}))},scale3d:function(A){N(xa,[A[0].value,A[1].value,A[2].value].map(function(A){return ba(A)}))},translate:function(A){P(xa,[A[0].value,A[1].value,0])},translateX:function(A){P(xa,[A[0].value,0,0])},translateY:function(A){P(xa,[0,A[0].value,0])},translateZ:function(A){P(xa,[0,0,A[0].value])},translate3d:function(A){P(xa,[A[0].value,A[1].value,A[2].value])},rotate:function(A){G(xa,Me(Nr(A[0])))},rotateX:function(A){K(xa,Me(Nr(A[0])))},rotateY:function(A){R(xa,Me(Nr(A[0])))},rotateZ:function(A){G(xa,Me(Nr(A[0])))},rotate3d:function(A){O(xa,Me(Nr(A[3])),[A[0].value,A[1].value,A[2].value])},skew:function(A){ka(xa,Me(A[0].value),Me(A[1].value))},skewX:function(A){ka(xa,Me(A[0].value),0)},skewY:function(A){ka(xa,0,Me(A[0].value))},matrix:function(A){b(xa,A[0].value,A[1].value,0,0,A[2].value,A[3].value,0,0,0,0,1,0,A[4].value,A[5].value,0,1)},matrix3d:function(A){b.apply(eA,[xa].concat(l(A.map(function(A){return A.value}))))}},Ta=aA(1,1,1),Ma=nA(),Sa={translate:function(A,t){No.sceneGraphService.setLocalScale(A,Ta,!1),No.sceneGraphService.setLocalEulerAngles(A,Ma,void 0,void 0,!1),No.sceneGraphService.setLocalPosition(A,[t[0].value,t[1].value,0],!1),No.sceneGraphService.dirtyLocalTransform(A,A.transformable)}};function La(A,t){if(A.length){if(1===A.length&&Sa[A[0].t])return void Sa[A[0].t](t,A[0].d);for(var e=k(Ha),n=0;A.length>n;n++){var r=A[n],i=Ia[r.t];i&&(i(r.d),tA(e,e,xa))}t.setLocalTransform(e)}else t.resetLocalTransform();return t.getLocalTransform()}var Da=function(){return s(function A(){a(this,A),this.parser=vi,this.mixer=ki},[{key:"calculator",value:function(A,t,e,n){return e instanceof er?[]:e}},{key:"postProcessor",value:function(A){La(A.parsedStyle.transform,A)}}])}(),Pa=function(){return s(function A(){a(this,A)},[{key:"postProcessor",value:function(A){var t=A.parsedStyle.transformOrigin;t[0].unit===Vn.kPixels&&t[1].unit===Vn.kPixels?A.setOrigin(t[0].value,t[1].value):A.getGeometryBounds()}}])}(),Na=function(){return s(function A(){a(this,A)},[{key:"calculator",value:function(A,t,e,n){return e.value}},{key:"postProcessor",value:function(A){if(A.parentNode){var t=A.parentNode,e=t.sortable;t.renderable&&t.dirty(),e&&(e.dirty=!0,e.dirtyReason=An.Z_INDEX_CHANGED)}}}])}(),Oa=function(){return s(function A(){a(this,A)},[{key:"update",value:function(A,t){var e=A.cx,n=A.cy,r=A.r,i=void 0===r?0:r;return{cx:void 0===e?0:e,cy:void 0===n?0:n,hwidth:i,hheight:i}}}])}(),Ka=function(){return s(function A(){a(this,A)},[{key:"update",value:function(A,t){var e=A.cx,n=A.cy,r=A.rx,i=A.ry;return{cx:void 0===e?0:e,cy:void 0===n?0:n,hwidth:void 0===r?0:r,hheight:void 0===i?0:i}}}])}(),Ra=function(){return s(function A(){a(this,A)},[{key:"update",value:function(A){var t=A.x1,e=A.y1,n=A.x2,r=A.y2,i=Math.min(t,n),a=Math.max(t,n),o=Math.min(e,r),s=(a-i)/2,u=(Math.max(e,r)-o)/2;return{cx:i+s,cy:o+u,hwidth:s,hheight:u}}}])}(),Ga=function(){return s(function A(){a(this,A)},[{key:"update",value:function(A){var t=A.d.rect,e=t.width/2,n=t.height/2;return{cx:t.x+e,cy:t.y+n,hwidth:e,hheight:n}}}])}(),Va=function(){return s(function A(){a(this,A)},[{key:"update",value:function(A){if(A.points&&PA(A.points.points)){var t=A.points.points,e=Math.min.apply(Math,l(t.map(function(A){return A[0]}))),n=Math.max.apply(Math,l(t.map(function(A){return A[0]}))),r=Math.min.apply(Math,l(t.map(function(A){return A[1]}))),i=(n-e)/2,a=(Math.max.apply(Math,l(t.map(function(A){return A[1]})))-r)/2;return{cx:e+i,cy:r+a,hwidth:i,hheight:a}}return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),_a=function(){return s(function A(){a(this,A)},[{key:"update",value:function(A,t){var e=A.x,n=void 0===e?0:e,r=A.y,i=void 0===r?0:r,a=A.src,o=A.width,s=A.height,u=void 0===o?0:o,c=void 0===s?0:s;return a&&!GA(a)&&(u||(A.width=u=a.width),c||(A.height=c=a.height)),{cx:n+u/2,cy:i+c/2,hwidth:u/2,hheight:c/2}}}])}(),Xa=function(){return s(function A(t){a(this,A),this.globalRuntime=t},[{key:"isReadyToMeasure",value:function(A,t){return A.text}},{key:"update",value:function(A,t){var e,n=A.text,r=A.textAlign,i=void 0===r?"start":r,a=A.lineWidth,o=void 0===a?1:a,s=A.textBaseline,u=void 0===s?"alphabetic":s,c=A.dx,l=void 0===c?0:c,h=A.dy,d=void 0===h?0:h,f=A.x,B=void 0===f?0:f,g=A.y,p=void 0===g?0:g;if(!this.isReadyToMeasure(A,t))return A.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{hwidth:0,hheight:0,cx:0,cy:0};var v=(null==t||null===(e=t.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e?void 0:e.getConfig())||{},w=this.globalRuntime.textService.measureText(n,A,v.offscreenCanvas);A.metrics=w;var y=w.width/2,m=w.height/2,C=B+y;"center"===i||"middle"===i?C+=o/2-y:"right"!==i&&"end"!==i||(C+=o-2*y);var Q=p-m;return"middle"===u?Q+=m:"top"===u||"hanging"===u?Q+=2*m:"alphabetic"===u||"bottom"!==u&&"ideographic"!==u||(Q+=0),l&&(C+=l),d&&(Q+=d),{cx:C,cy:Q,hwidth:y,hheight:m}}}])}(),Ya=function(){return s(function A(){a(this,A)},[{key:"update",value:function(A,t){return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),Wa=function(){return s(function A(){a(this,A)},[{key:"update",value:function(A,t){var e=A.x,n=A.y,r=A.width,i=void 0===r?0:r,a=A.height,o=void 0===a?0:a;return{cx:(void 0===e?0:e)+i/2,cy:(void 0===n?0:n)+o/2,hwidth:i/2,hheight:o/2}}}])}();var Ja=function(){return s(function A(t){a(this,A),this.eventPhase=A.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Ue,this.page=new Ue,this.canvas=new Ue,this.viewport=new Ue,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t},[{key:"name",get:function(){return this.type}},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"composedPath",value:function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}},{key:"propagationPath",get:function(){return this.composedPath()}},{key:"preventDefault",value:function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}},{key:"stopImmediatePropagation",value:function(){this.propagationImmediatelyStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"initEvent",value:function(){}},{key:"initUIEvent",value:function(){}},{key:"clone",value:function(){throw Error(be)}}])}(),Za=function(A){function t(){var A;a(this,t);for(var e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];return(A=B(this,t,[].concat(n))).client=new Ue,A.movement=new Ue,A.offset=new Ue,A.global=new Ue,A.screen=new Ue,A}return p(t,A),s(t,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}},{key:"getModifierState",value:function(A){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(A)}},{key:"initMouseEvent",value:function(){throw Error(be)}}])}(Ja),za=function(A){function t(){var A;a(this,t);for(var e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];return(A=B(this,t,[].concat(n))).width=0,A.height=0,A.isPrimary=!1,A}return p(t,A),s(t,[{key:"getCoalescedEvents",value:function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}},{key:"getPredictedEvents",value:function(){throw Error("getPredictedEvents is not supported!")}},{key:"clone",value:function(){return this.manager.clonePointerEvent(this)}}])}(Za),ja=function(A){function t(){return a(this,t),B(this,t,arguments)}return p(t,A),s(t,[{key:"clone",value:function(){return this.manager.cloneWheelEvent(this)}}])}(Za),qa=function(A){function t(A,e){var n;return a(this,t),(n=B(this,t,[null])).type=A,n.detail=null==e?void 0:e.detail,e&&!("detail"in e)&&(n.detail=e),Object.assign(n,e),n}return p(t,A),s(t)}(Ja),$a=function(){return s(function A(){a(this,A),this.emitter=new y},[{key:"on",value:function(A,t,e){return this.addEventListener(A,t,e),this}},{key:"addEventListener",value:function(A,t,e){var n=!1,r=!1;if(WA(e))n=e;else if(e){var i=e.capture;n=void 0!==i&&i;var a=e.once;r=void 0!==a&&a}n&&(A+="capture"),t=LA(t)?t:t.handleEvent;var o=LA(t)?void 0:t;return r?this.emitter.once(A,t,o):this.emitter.on(A,t,o),this}},{key:"off",value:function(A,t,e){return A?this.removeEventListener(A,t,e):this.removeAllEventListeners(),this}},{key:"removeAllEventListeners",value:function(){var A;null===(A=this.emitter)||void 0===A||A.removeAllListeners()}},{key:"removeEventListener",value:function(A,t,e){var n;if(!this.emitter)return this;(WA(e)?e:null==e?void 0:e.capture)&&(A+="capture"),t=LA(t)?t:null===(n=t)||void 0===n?void 0:n.handleEvent;var r=LA(t)?void 0:t;return this.emitter.off(A,t,r),this}},{key:"emit",value:function(A,t){this.dispatchEvent(new qa(A,t))}},{key:"dispatchEventToSelf",value:function(A){A.target||(A.target=this),A.currentTarget=this,this.emitter.emit(A.type,A)}},{key:"dispatchEvent",value:function(A){var t,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(arguments.length>2?arguments[2]:void 0)return this.dispatchEventToSelf(A),!0;if(this.document)t=this;else if(this.defaultView)t=this.defaultView;else{var n;t=null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView}if(t){if(A.manager=t.getEventService(),!A.manager)return!1;A.defaultPrevented=!1,A.path?A.path.length=0:A.page=[],e||(A.target=this),A.manager.dispatchEvent(A,A.type,e)}else this.dispatchEventToSelf(A);return!A.defaultPrevented}}])}(),Ao=function(A){function t(){var A;a(this,t);for(var e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];return(A=B(this,t,[].concat(n))).shadow=!1,A.ownerDocument=null,A.isConnected=!1,A.baseURI="",A.childNodes=[],A.nodeType=0,A.nodeName="",A.nodeValue=null,A.mutations=void 0,A.parentNode=null,A.destroyed=!1,A}return p(t,A),s(t,[{key:"textContent",get:function(){var A="";this.nodeName===le.TEXT&&(A+=this.style.text);var t,e=ue(this.childNodes);try{for(e.s();!(t=e.n()).done;){var n=t.value;A+=n.nodeName===le.TEXT?n.nodeValue:n.textContent}}catch(A){e.e(A)}finally{e.f()}return A},set:function(A){var t=this;this.childNodes.slice().forEach(function(A){t.removeChild(A)}),this.nodeName===le.TEXT&&(this.style.text="".concat(A))}},{key:"getRootNode",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.parentNode?this.parentNode.getRootNode(A):A.composed&&this.host?this.host.getRootNode(A):this}},{key:"hasChildNodes",value:function(){return this.childNodes.length>0}},{key:"isDefaultNamespace",value:function(A){throw Error(be)}},{key:"lookupNamespaceURI",value:function(A){throw Error(be)}},{key:"lookupPrefix",value:function(A){throw Error(be)}},{key:"normalize",value:function(){throw Error(be)}},{key:"isEqualNode",value:function(A){return this===A}},{key:"isSameNode",value:function(A){return this.isEqualNode(A)}},{key:"parent",get:function(){return this.parentNode}},{key:"parentElement",get:function(){return null}},{key:"nextSibling",get:function(){return null}},{key:"previousSibling",get:function(){return null}},{key:"firstChild",get:function(){return this.childNodes.length>0?this.childNodes[0]:null}},{key:"lastChild",get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}},{key:"compareDocumentPosition",value:function(A){if(A===this)return 0;for(var e=A,n=this,r=[e],i=[n];null!==(a=e.parentNode)&&void 0!==a?a:n.parentNode;){var a;e=e.parentNode?(r.push(e.parentNode),e.parentNode):e,n=n.parentNode?(i.push(n.parentNode),n.parentNode):n}if(e!==n)return t.DOCUMENT_POSITION_DISCONNECTED|t.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|t.DOCUMENT_POSITION_PRECEDING;var o=r.length>i.length?r:i,s=o===r?i:r;if(o[o.length-s.length]===s[0])return o===r?t.DOCUMENT_POSITION_CONTAINED_BY|t.DOCUMENT_POSITION_FOLLOWING:t.DOCUMENT_POSITION_CONTAINS|t.DOCUMENT_POSITION_PRECEDING;for(var u=o.length-s.length,c=s.length-1;c>=0;c--){var l=s[c],h=o[u+c];if(h!==l){var d=l.parentNode.childNodes;return d.indexOf(l)<d.indexOf(h)?s===r?t.DOCUMENT_POSITION_PRECEDING:t.DOCUMENT_POSITION_FOLLOWING:o===r?t.DOCUMENT_POSITION_PRECEDING:t.DOCUMENT_POSITION_FOLLOWING}}return t.DOCUMENT_POSITION_FOLLOWING}},{key:"contain",value:function(A){return this.contains(A)}},{key:"contains",value:function(A){for(var t=A;t&&this!==t;)t=t.parentNode;return!!t}},{key:"getAncestor",value:function(A){for(var t=this;A>0&&t;)t=t.parentNode,A--;return t}},{key:"forEach",value:function(A){for(var t=[this];t.length>0;){var e=t.pop();if(!1===A(e))break;for(var n=e.childNodes.length-1;n>=0;n--)t.push(e.childNodes[n])}}}],[{key:"isNode",value:function(A){return!!A.childNodes}}])}($a);Ao.DOCUMENT_POSITION_DISCONNECTED=1,Ao.DOCUMENT_POSITION_PRECEDING=2,Ao.DOCUMENT_POSITION_FOLLOWING=4,Ao.DOCUMENT_POSITION_CONTAINS=8,Ao.DOCUMENT_POSITION_CONTAINED_BY=16,Ao.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var to=function(){return s(function A(t,e){var n=this;a(this,A),this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=F(),this.tmpVec3=nA(),this.onPointerDown=function(A){var t=n.createPointerEvent(A);if(n.dispatchEvent(t,"pointerdown"),"touch"===t.pointerType)n.dispatchEvent(t,"touchstart");else if("mouse"===t.pointerType||"pen"===t.pointerType){n.dispatchEvent(t,2===t.button?"rightdown":"mousedown")}n.trackingData(A.pointerId).pressTargetsByButton[A.button]=t.composedPath(),n.freeEvent(t)},this.onPointerUp=function(A){var t=aa.now(),e=n.createPointerEvent(A,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);if(n.dispatchEvent(e,"pointerup"),"touch"===e.pointerType)n.dispatchEvent(e,"touchend");else if("mouse"===e.pointerType||"pen"===e.pointerType){n.dispatchEvent(e,2===e.button?"rightup":"mouseup")}var r=n.trackingData(A.pointerId),i=n.findMountedTarget(r.pressTargetsByButton[A.button]),a=i;if(i&&!e.composedPath().includes(i)){for(var o=i;o&&!e.composedPath().includes(o);){if(e.currentTarget=o,n.notifyTarget(e,"pointerupoutside"),"touch"===e.pointerType)n.notifyTarget(e,"touchendoutside");else if("mouse"===e.pointerType||"pen"===e.pointerType){n.notifyTarget(e,2===e.button?"rightupoutside":"mouseupoutside")}Ao.isNode(o)&&(o=o.parentNode)}delete r.pressTargetsByButton[A.button],a=o}if(a){var s,u=n.clonePointerEvent(e,"click");u.target=a,u.path=[],r.clicksByButton[A.button]||(r.clicksByButton[A.button]={clickCount:0,target:u.target,timeStamp:t});var c=r.clicksByButton[A.button];c.target===u.target&&t-c.timeStamp<n.context.renderingContext.root.ownerDocument.defaultView.getConfig().dblClickSpeed?++c.clickCount:c.clickCount=1,c.target=u.target,c.timeStamp=t,u.detail=c.clickCount,null!==(s=e.detail)&&void 0!==s&&s.preventClick||(n.context.config.useNativeClickEvent||"mouse"!==u.pointerType&&"touch"!==u.pointerType||n.dispatchEvent(u,"click"),n.dispatchEvent(u,"pointertap")),n.freeEvent(u)}n.freeEvent(e)},this.onPointerMove=function(A){var t=n.createPointerEvent(A,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0),e="mouse"===t.pointerType||"pen"===t.pointerType,r=n.trackingData(A.pointerId),i=n.findMountedTarget(r.overTargets);if(r.overTargets&&i!==t.target){var a=n.createPointerEvent(A,"mousemove"===A.type?"mouseout":"pointerout",i||void 0);if(n.dispatchEvent(a,"pointerout"),e&&n.dispatchEvent(a,"mouseout"),!t.composedPath().includes(i)){var o=n.createPointerEvent(A,"pointerleave",i||void 0);for(o.eventPhase=o.AT_TARGET;o.target&&!t.composedPath().includes(o.target);)o.currentTarget=o.target,n.notifyTarget(o),e&&n.notifyTarget(o,"mouseleave"),Ao.isNode(o.target)&&(o.target=o.target.parentNode);n.freeEvent(o)}n.freeEvent(a)}if(i!==t.target){var s=n.clonePointerEvent(t,"mousemove"===A.type?"mouseover":"pointerover");n.dispatchEvent(s,"pointerover"),e&&n.dispatchEvent(s,"mouseover");for(var u=i&&Ao.isNode(i)&&i.parentNode;u&&u!==(Ao.isNode(n.rootTarget)&&n.rootTarget.parentNode)&&u!==t.target;)u=u.parentNode;if(!u||u===(Ao.isNode(n.rootTarget)&&n.rootTarget.parentNode)){var c=n.clonePointerEvent(t,"pointerenter");for(c.eventPhase=c.AT_TARGET;c.target&&c.target!==i&&c.target!==(Ao.isNode(n.rootTarget)&&n.rootTarget.parentNode);)c.currentTarget=c.target,n.notifyTarget(c),e&&n.notifyTarget(c,"mouseenter"),Ao.isNode(c.target)&&(c.target=c.target.parentNode);n.freeEvent(c)}n.freeEvent(s)}n.dispatchEvent(t,"pointermove"),"touch"===t.pointerType&&n.dispatchEvent(t,"touchmove"),e&&(n.dispatchEvent(t,"mousemove"),n.cursor=n.getCursor(t.target)),r.overTargets=t.composedPath(),n.freeEvent(t)},this.onPointerOut=function(A){var t=n.trackingData(A.pointerId);if(t.overTargets){var e="mouse"===A.pointerType||"pen"===A.pointerType,r=n.findMountedTarget(t.overTargets),i=n.createPointerEvent(A,"pointerout",r||void 0);n.dispatchEvent(i),e&&n.dispatchEvent(i,"mouseout");var a=n.createPointerEvent(A,"pointerleave",r||void 0);for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(Ao.isNode(n.rootTarget)&&n.rootTarget.parentNode);)a.currentTarget=a.target,n.notifyTarget(a),e&&n.notifyTarget(a,"mouseleave"),Ao.isNode(a.target)&&(a.target=a.target.parentNode);t.overTargets=null,n.freeEvent(i),n.freeEvent(a)}n.cursor=null},this.onPointerOver=function(A){var t=n.trackingData(A.pointerId),e=n.createPointerEvent(A),r="mouse"===e.pointerType||"pen"===e.pointerType;n.dispatchEvent(e,"pointerover"),r&&n.dispatchEvent(e,"mouseover"),"mouse"===e.pointerType&&(n.cursor=n.getCursor(e.target));var i=n.clonePointerEvent(e,"pointerenter");for(i.eventPhase=i.AT_TARGET;i.target&&i.target!==(Ao.isNode(n.rootTarget)&&n.rootTarget.parentNode);)i.currentTarget=i.target,n.notifyTarget(i),r&&n.notifyTarget(i,"mouseenter"),Ao.isNode(i.target)&&(i.target=i.target.parentNode);t.overTargets=e.composedPath(),n.freeEvent(e),n.freeEvent(i)},this.onPointerUpOutside=function(A){var t=n.trackingData(A.pointerId),e=n.findMountedTarget(t.pressTargetsByButton[A.button]),r=n.createPointerEvent(A);if(e){for(var i=e;i;)r.currentTarget=i,n.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType||"mouse"!==r.pointerType&&"pen"!==r.pointerType||n.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside"),Ao.isNode(i)&&(i=i.parentNode);delete t.pressTargetsByButton[A.button]}n.freeEvent(r)},this.onWheel=function(A){var t=n.createWheelEvent(A);n.dispatchEvent(t),n.freeEvent(t)},this.onClick=function(A){if(n.context.config.useNativeClickEvent){var t=n.createPointerEvent(A);n.dispatchEvent(t),n.freeEvent(t)}},this.onPointerCancel=function(A){var t=n.createPointerEvent(A,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);n.dispatchEvent(t),n.freeEvent(t)},this.globalRuntime=t,this.context=e},[{key:"init",value:function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)}},{key:"destroy",value:function(){this.mappingTable={},this.mappingState={},this.eventPool.clear()}},{key:"getScale",value:function(){var A=this.context.contextService.getBoundingClientRect(),t=1,e=1,n=this.context.contextService.getDomElement();if(n&&A){var r=n.offsetWidth,i=n.offsetHeight;r&&i&&(t=A.width/r,e=A.height/i)}return{scaleX:t,scaleY:e,bbox:A}}},{key:"client2Viewport",value:function(A){var t=this.getScale(),e=t.bbox;return new Ue((A.x-((null==e?void 0:e.left)||0))/t.scaleX,(A.y-((null==e?void 0:e.top)||0))/t.scaleY)}},{key:"viewport2Client",value:function(A){var t=this.getScale(),e=t.bbox;return new Ue((A.x+((null==e?void 0:e.left)||0))*t.scaleX,(A.y+((null==e?void 0:e.top)||0))*t.scaleY)}},{key:"viewport2Canvas",value:function(A){var t=A.x,e=A.y,n=this.rootTarget.defaultView.getCamera(),r=this.context.config,i=r.width,a=r.height,o=n.getPerspectiveInverse(),s=n.getWorldTransform(),u=T(this.tmpMatrix,s,o),c=sA(this.tmpVec3,t/i*2-1,2*(1-e/a)-1,0);return gA(c,c,u),new Ue(c[0],c[1])}},{key:"canvas2Viewport",value:function(A){var t=this.rootTarget.defaultView.getCamera(),e=t.getPerspective(),n=t.getViewTransform(),r=T(this.tmpMatrix,e,n),i=sA(this.tmpVec3,A.x,A.y,0);gA(this.tmpVec3,this.tmpVec3,r);var a=this.context.config;return new Ue((i[0]+1)/2*a.width,(1-(i[1]+1)/2)*a.height)}},{key:"setPickHandler",value:function(A){this.pickHandler=A}},{key:"addEventMapping",value:function(A,t){this.mappingTable[A]||(this.mappingTable[A]=[]),this.mappingTable[A].push({fn:t,priority:0}),this.mappingTable[A].sort(function(A,t){return A.priority-t.priority})}},{key:"mapEvent",value:function(A){if(this.rootTarget){var t=this.mappingTable[A.type];if(t)for(var e=0,n=t.length;n>e;e++)t[e].fn(A);else console.warn("[EventService]: Event mapping not defined for ".concat(A.type))}}},{key:"dispatchEvent",value:function(A,t,e){e?(A.eventPhase=A.AT_TARGET,A.currentTarget=this.rootTarget.defaultView||null,this.notifyListeners(A,t)):(A.propagationStopped=!1,A.propagationImmediatelyStopped=!1,this.propagate(A,t))}},{key:"propagate",value:function(A,t){if(A.target){var e=A.composedPath();A.eventPhase=A.CAPTURING_PHASE;for(var n=e.length-1;n>=1;n--)if(A.currentTarget=e[n],this.notifyTarget(A,t),A.propagationStopped||A.propagationImmediatelyStopped)return;if(A.eventPhase=A.AT_TARGET,A.currentTarget=A.target,this.notifyTarget(A,t),!A.propagationStopped&&!A.propagationImmediatelyStopped){var r=e.indexOf(A.currentTarget);A.eventPhase=A.BUBBLING_PHASE;for(var i=r+1;e.length>i;i++)if(A.currentTarget=e[i],this.notifyTarget(A,t),A.propagationStopped||A.propagationImmediatelyStopped)return}}}},{key:"propagationPath",value:function(A){var t=[A],e=this.rootTarget.defaultView||null;if(e&&e===A)return t.unshift(e.document),t;for(var n=0;2048>n&&A!==this.rootTarget;n++)Ao.isNode(A)&&A.parentNode&&(t.push(A.parentNode),A=A.parentNode);return e&&t.push(e),t}},{key:"hitTest",value:function(A){var t=A.viewportX,e=A.viewportY,n=this.context.config;return 0>t||0>e||t>n.width||e>n.height?null:!n.disableHitTesting&&this.pickHandler(A)||this.rootTarget||null}},{key:"isNativeEventFromCanvas",value:function(A,t){var e,n=null==t?void 0:t.target;if(null!==(e=n)&&void 0!==e&&e.shadowRoot&&(n=t.composedPath()[0]),n){if(n===A)return!0;if(A&&A.contains)return A.contains(n)}return!(null==t||!t.composedPath)&&t.composedPath().indexOf(A)>-1}},{key:"getExistedHTML",value:function(A){if(A.nativeEvent.composedPath)for(var t=0,e=A.nativeEvent.composedPath();e.length>t;t++){var n=this.nativeHTMLMap.get(e[t]);if(n)return n}return null}},{key:"pickTarget",value:function(A){return this.hitTest({clientX:A.clientX,clientY:A.clientY,viewportX:A.viewportX,viewportY:A.viewportY,x:A.canvasX,y:A.canvasY})}},{key:"createPointerEvent",value:function(A,t,e,n){var r=this.allocateEvent(za);this.copyPointerData(A,r),this.copyMouseData(A,r),this.copyData(A,r),r.nativeEvent=A.nativeEvent,r.originalEvent=A;var i=this.getExistedHTML(r),a=this.context.contextService.getDomElement();return r.target=null!=e?e:i||this.isNativeEventFromCanvas(a,r.nativeEvent)&&this.pickTarget(r)||n,"string"==typeof t&&(r.type=t),r}},{key:"createWheelEvent",value:function(A){var t=this.allocateEvent(ja);this.copyWheelData(A,t),this.copyMouseData(A,t),this.copyData(A,t),t.nativeEvent=A.nativeEvent,t.originalEvent=A;var e=this.getExistedHTML(t),n=this.context.contextService.getDomElement();return t.target=e||this.isNativeEventFromCanvas(n,t.nativeEvent)&&this.pickTarget(t),t}},{key:"trackingData",value:function(A){return this.mappingState.trackingData[A]||(this.mappingState.trackingData[A]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[A]}},{key:"cloneWheelEvent",value:function(A){var t=this.allocateEvent(ja);return t.nativeEvent=A.nativeEvent,t.originalEvent=A.originalEvent,this.copyWheelData(A,t),this.copyMouseData(A,t),this.copyData(A,t),t.target=A.target,t.path=A.composedPath().slice(),t.type=A.type,t}},{key:"clonePointerEvent",value:function(A,t){var e=this.allocateEvent(za);return e.nativeEvent=A.nativeEvent,e.originalEvent=A.originalEvent,this.copyPointerData(A,e),this.copyMouseData(A,e),this.copyData(A,e),e.target=A.target,e.path=A.composedPath().slice(),e.type=null!=t?t:e.type,e}},{key:"copyPointerData",value:function(A,t){t.pointerId=A.pointerId,t.width=A.width,t.height=A.height,t.isPrimary=A.isPrimary,t.pointerType=A.pointerType,t.pressure=A.pressure,t.tangentialPressure=A.tangentialPressure,t.tiltX=A.tiltX,t.tiltY=A.tiltY,t.twist=A.twist}},{key:"copyMouseData",value:function(A,t){t.altKey=A.altKey,t.button=A.button,t.buttons=A.buttons,t.ctrlKey=A.ctrlKey,t.metaKey=A.metaKey,t.shiftKey=A.shiftKey,t.client.copyFrom(A.client),t.movement.copyFrom(A.movement),t.canvas.copyFrom(A.canvas),t.screen.copyFrom(A.screen),t.global.copyFrom(A.global),t.offset.copyFrom(A.offset)}},{key:"copyWheelData",value:function(A,t){t.deltaMode=A.deltaMode,t.deltaX=A.deltaX,t.deltaY=A.deltaY,t.deltaZ=A.deltaZ}},{key:"copyData",value:function(A,t){t.isTrusted=A.isTrusted,t.timeStamp=aa.now(),t.type=A.type,t.detail=A.detail,t.view=A.view,t.page.copyFrom(A.page),t.viewport.copyFrom(A.viewport)}},{key:"allocateEvent",value:function(A){this.eventPool.has(A)||this.eventPool.set(A,[]);var t=this.eventPool.get(A).pop()||new A(this);return t.eventPhase=t.NONE,t.currentTarget=null,t.path=[],t.target=null,t}},{key:"freeEvent",value:function(A){if(A.manager!==this)throw Error("It is illegal to free an event not managed by this EventBoundary!");var t=A.constructor;this.eventPool.has(t)||this.eventPool.set(t,[]),this.eventPool.get(t).push(A)}},{key:"notifyTarget",value:function(A,t){t=null!=t?t:A.type,this.notifyListeners(A,A.eventPhase===A.CAPTURING_PHASE||A.eventPhase===A.AT_TARGET?"".concat(t,"capture"):t),A.eventPhase===A.AT_TARGET&&this.notifyListeners(A,t)}},{key:"notifyListeners",value:function(A,t){var e=A.currentTarget.emitter,n=e._events[t];if(n)if("fn"in n)n.once&&e.removeListener(t,n.fn,void 0,!0),n.fn.call(A.currentTarget||n.context,A);else for(var r=0;n.length>r&&!A.propagationImmediatelyStopped;r++)n[r].once&&e.removeListener(t,n[r].fn,void 0,!0),n[r].fn.call(A.currentTarget||n[r].context,A)}},{key:"findMountedTarget",value:function(A){if(!A)return null;for(var t=A[A.length-1],e=A.length-2;e>=0;e--){var n=A[e];if(!(n===this.rootTarget||Ao.isNode(n)&&n.parentNode===t))break;t=A[e]}return t}},{key:"getCursor",value:function(A){for(var t=A;t;){var e=ta(t)&&t.getAttribute("cursor");if(e)return e;t=Ao.isNode(t)&&t.parentNode}}}])}(),eo=function(){return s(function A(){a(this,A)},[{key:"getOrCreateCanvas",value:function(A,t){if(this.canvas)return this.canvas;if(A||No.offscreenCanvas)this.canvas=A||No.offscreenCanvas,this.context=this.canvas.getContext("2d",i({willReadFrequently:!0},t));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",i({willReadFrequently:!0},t)),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(A){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",i({willReadFrequently:!0},t))}return this.canvas.width=10,this.canvas.height=10,this.canvas}},{key:"getOrCreateContext",value:function(A,t){return this.context||this.getOrCreateCanvas(A,t),this.context}}],[{key:"createCanvas",value:function(){try{return new window.OffscreenCanvas(0,0)}catch(A){}try{return document.createElement("canvas")}catch(A){}return null}}])}(),no=function(A){return A[A.CAMERA_CHANGED=0]="CAMERA_CHANGED",A[A.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",A[A.NONE=2]="NONE",A}({}),ro=function(){return s(function A(t,e){a(this,A),this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new ma,initAsync:new wa,dirtycheck:new Ca,cull:new Ca,beginFrame:new ma,beforeRender:new ma,render:new ma,afterRender:new ma,endFrame:new ma,destroy:new ma,pick:new ya,pickSync:new Ca,pointerDown:new ma,pointerUp:new ma,pointerMove:new ma,pointerOut:new ma,pointerOver:new ma,pointerWheel:new ma,pointerCancel:new ma,click:new ma},this.globalRuntime=t,this.context=e},[{key:"init",value:function(A){var t=this,e=i(i({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach(function(A){A.apply(e,t.globalRuntime)}),this.hooks.init.call(),0===this.hooks.initAsync.getCallbacksNum()?(this.inited=!0,A()):this.hooks.initAsync.promise().then(function(){t.inited=!0,A()}).catch(function(A){})}},{key:"getStats",value:function(){return this.stats}},{key:"disableDirtyRectangleRendering",value:function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(no.CAMERA_CHANGED)}},{key:"render",value:function(A,t,e){var n=this,r=A.getConfig(),i=this.context.renderingContext;if(this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0,this.globalRuntime.sceneGraphService.syncHierarchy(i.root),this.globalRuntime.sceneGraphService.notifyMutationObservers(A),i.renderReasons.size&&this.inited){i.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var a=1===i.renderReasons.size&&i.renderReasons.has(no.CAMERA_CHANGED),o=!r.disableRenderHooks||!a;o&&this.renderDisplayObject(i.root,r,i),this.hooks.beginFrame.call(t),o&&i.renderListCurrentFrame.forEach(function(A){n.hooks.beforeRender.call(A),n.hooks.render.call(A),n.hooks.afterRender.call(A)}),this.hooks.endFrame.call(t),i.renderListCurrentFrame=[],i.renderReasons.clear(),e()}}},{key:"renderDisplayObject",value:function(A,t,e){var n=this,r=t.renderer.getConfig(),i=r.enableDirtyCheck,a=r.enableCulling;function o(A){var t=A.sortable,r=i?A.renderable.dirty||e.dirtyRectangleRenderingDisabled?A:null:A,o=null;r&&(o=a?n.hooks.cull.call(r,n.context.camera):r)&&(n.stats.rendered+=1,e.renderListCurrentFrame.push(o)),A.dirty(!1),t.renderOrder=n.zIndexCounter,n.zIndexCounter+=1,n.stats.total+=1,t.dirty&&(n.sort(A,t),t.dirty=!1,t.dirtyChildren=[],t.dirtyReason=void 0)}for(var s=[A];s.length>0;){var u,c=s.pop();o(c);for(var l=(null===(u=c.sortable)||void 0===u||null===(u=u.sorted)||void 0===u?void 0:u.length)>0?c.sortable.sorted:c.childNodes,h=l.length-1;h>=0;h--)s.push(l[h])}}},{key:"sort",value:function(A,t){var e,n;(null==t||null===(e=t.sorted)||void 0===e?void 0:e.length)>0&&t.dirtyReason!==An.Z_INDEX_CHANGED?t.dirtyChildren.forEach(function(e){var n=t.sorted.indexOf(e);if(n>-1&&t.sorted.splice(n,1),A.childNodes.indexOf(e)>-1)if(0===t.sorted.length)t.sorted.push(e);else{var r=function(A,t){for(var e=0,n=A.length;n>e;){var r=e+n>>>1;0>ea(A[r],t)?e=r+1:n=r}return e}(t.sorted,e);t.sorted.splice(r,0,e)}}):t.sorted=A.childNodes.slice().sort(ea),(null===(n=t.sorted)||void 0===n?void 0:n.length)>0&&0===A.childNodes.filter(function(A){return A.parsedStyle.zIndex}).length&&(t.sorted=[])}},{key:"destroy",value:function(){this.inited=!1,this.hooks.destroy.call()}},{key:"dirty",value:function(){this.context.renderingContext.renderReasons.add(no.DISPLAY_OBJECT_CHANGED)}}])}(),io=/\[\s*(.*)=(.*)\s*\]/,ao=function(){return s(function A(){a(this,A)},[{key:"selectOne",value:function(A,t){var e=this;if(A.startsWith("."))return t.find(function(t){return((null==t?void 0:t.classList)||[]).indexOf(e.getIdOrClassname(A))>-1});if(A.startsWith("#"))return t.find(function(t){return t.id===e.getIdOrClassname(A)});if(A.startsWith("[")){var n=this.getAttribute(A),r=n.name,i=n.value;return r?t.find(function(A){return t!==A&&("name"===r?A.name===i:e.attributeToString(A,r)===i)}):null}return t.find(function(e){return t!==e&&e.nodeName===A})}},{key:"selectAll",value:function(A,t){var e=this;if(A.startsWith("."))return t.findAll(function(n){return t!==n&&((null==n?void 0:n.classList)||[]).indexOf(e.getIdOrClassname(A))>-1});if(A.startsWith("#"))return t.findAll(function(n){return t!==n&&n.id===e.getIdOrClassname(A)});if(A.startsWith("[")){var n=this.getAttribute(A),r=n.name,i=n.value;return r?t.findAll(function(A){return t!==A&&("name"===r?A.name===i:e.attributeToString(A,r)===i)}):[]}return t.findAll(function(e){return t!==e&&e.nodeName===A})}},{key:"is",value:function(A,t){if(A.startsWith("."))return t.className===this.getIdOrClassname(A);if(A.startsWith("#"))return t.id===this.getIdOrClassname(A);if(A.startsWith("[")){var e=this.getAttribute(A),n=e.name,r=e.value;return"name"===n?t.name===r:this.attributeToString(t,n)===r}return t.nodeName===A}},{key:"getIdOrClassname",value:function(A){return A.substring(1)}},{key:"getAttribute",value:function(A){var t=A.match(io),e="",n="";return t&&t.length>2&&(e=t[1].replace(/"/g,""),n=t[2].replace(/"/g,"")),{name:e,value:n}}},{key:"attributeToString",value:function(A,t){if(!A.getAttribute)return"";var e=A.getAttribute(t);return DA(e)?"":e.toString?""+e:""}}])}(),oo=function(A){return A.ATTR_MODIFIED="DOMAttrModified",A.INSERTED="DOMNodeInserted",A.MOUNTED="DOMNodeInsertedIntoDocument",A.REMOVED="removed",A.UNMOUNTED="DOMNodeRemovedFromDocument",A.REPARENT="reparent",A.DESTROY="destroy",A.BOUNDS_CHANGED="bounds-changed",A.CULLED="culled",A}({}),so=function(A){function t(A,e,n,r,i,o,s,u){var c;return a(this,t),(c=B(this,t,[null])).relatedNode=e,c.prevValue=n,c.newValue=r,c.attrName=i,c.attrChange=o,c.prevParsedValue=s,c.newParsedValue=u,c.type=A,c}return p(t,A),s(t)}(Ja);so.ADDITION=2,so.MODIFICATION=1,so.REMOVAL=3;var uo,co,lo,ho=new so(oo.REPARENT,null,"","","",0,"",""),fo=SA(),Bo=nA(),go=aA(1,1,1),po=F(),vo=SA(),wo=nA(),yo=F(),mo=FA(),Co=nA(),Qo=FA(),Fo=nA(),Uo=nA(),Eo=nA(),bo=F(),ko=FA(),xo=FA(),Ho=FA(),Io=function(){return s(function A(t){a(this,A),this.displayObjectDependencyMap=new WeakMap,this.runtime=t},[{key:"matches",value:function(A,t){return this.runtime.sceneGraphSelector.is(A,t)}},{key:"querySelector",value:function(A,t){return this.runtime.sceneGraphSelector.selectOne(A,t)}},{key:"querySelectorAll",value:function(A,t){return this.runtime.sceneGraphSelector.selectAll(A,t)}},{key:"attach",value:function(A,t,e){var n,r=!1;A.parentNode&&(r=A.parentNode!==t,this.detach(A));var i=A.nodeName===le.FRAGMENT,a=oa(t);A.parentNode=t;var o=i?A.childNodes:[A];_A(e)?o.forEach(function(A){t.childNodes.splice(e,0,A),A.parentNode=t}):o.forEach(function(A){t.childNodes.push(A),A.parentNode=t});var s=t.sortable;if((null!=s&&null!==(n=s.sorted)&&void 0!==n&&n.length||s.dirty||A.parsedStyle.zIndex)&&(-1===s.dirtyChildren.indexOf(A)&&s.dirtyChildren.push(A),s.dirty=!0,s.dirtyReason=An.ADDED),!a){if(i)this.dirtyFragment(A);else{var u=A.transformable;u&&this.dirtyWorldTransform(A,u)}if(r){var c,l=!0===(null===(c=t.ownerDocument)||void 0===c||null===(c=c.defaultView)||void 0===c||null===(c=c.getConfig())||void 0===c||null===(c=c.future)||void 0===c?void 0:c.experimentalCancelEventPropagation);A.dispatchEvent(ho,l,l)}}}},{key:"detach",value:function(A){var t,e;if(A.parentNode){var n=A.transformable,r=A.parentNode.sortable;(null!=r&&null!==(t=r.sorted)&&void 0!==t&&t.length||null!==(e=A.style)&&void 0!==e&&e.zIndex)&&(-1===r.dirtyChildren.indexOf(A)&&r.dirtyChildren.push(A),r.dirty=!0,r.dirtyReason=An.REMOVED);var i=A.parentNode.childNodes.indexOf(A);i>-1&&A.parentNode.childNodes.splice(i,1),n&&this.dirtyWorldTransform(A,n),A.parentNode=null}}},{key:"getLocalPosition",value:function(A){return A.transformable.localPosition}},{key:"getLocalRotation",value:function(A){return A.transformable.localRotation}},{key:"getLocalScale",value:function(A){return A.transformable.localScale}},{key:"getLocalSkew",value:function(A){return A.transformable.localSkew}},{key:"getLocalTransform",value:function(A){var t=A.transformable;return rn(t),t.localTransform}},{key:"setLocalPosition",value:function(A,t){var e,n=2>=arguments.length||void 0===arguments[2]||arguments[2],r=A.transformable;Uo[0]=t[0],Uo[1]=t[1],Uo[2]=null!==(e=t[2])&&void 0!==e?e:0,pA(r.localPosition,Uo)||(oA(r.localPosition,Uo),n&&this.dirtyLocalTransform(A,r))}},{key:"translateLocal",value:function(A,t){"number"==typeof t&&(t=aA(t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var e=A.transformable;pA(t,Bo)||(!function(A,t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=t[0],s=t[1],u=t[2],c=r*u-i*s,l=i*o-n*u,h=n*s-r*o;A[0]=o+a*(c+=c)+r*(h+=h)-i*(l+=l),A[1]=s+a*l+i*c-n*h,A[2]=u+a*h+n*l-r*c}(t,t,e.localRotation),uA(e.localPosition,e.localPosition,t),this.dirtyLocalTransform(A,e))}},{key:"setLocalRotation",value:function(A,t,e,n,r){var i=5>=arguments.length||void 0===arguments[5]||arguments[5];"number"==typeof t&&(t=IA(mo,t,e,n,r));var a=A.transformable;HA(a.localRotation,t),i&&this.dirtyLocalTransform(A,a)}},{key:"rotateLocal",value:function(A,t){"number"==typeof t&&(t=aA(t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var e=A.transformable;kA(xo,t[0],t[1],t[2]),TA(e.localRotation,e.localRotation,xo),this.dirtyLocalTransform(A,e)}},{key:"setLocalScale",value:function(A,t){var e,n=2>=arguments.length||void 0===arguments[2]||arguments[2],r=A.transformable;sA(wo,t[0],t[1],null!==(e=t[2])&&void 0!==e?e:r.localScale[2]),pA(wo,r.localScale)||(oA(r.localScale,wo),n&&this.dirtyLocalTransform(A,r))}},{key:"scaleLocal",value:function(A,t){var e,n=A.transformable;!function(A,t,e){A[0]=t[0]*e[0],A[1]=t[1]*e[1],A[2]=t[2]*e[2]}(n.localScale,n.localScale,sA(wo,t[0],t[1],null!==(e=t[2])&&void 0!==e?e:1)),this.dirtyLocalTransform(A,n)}},{key:"setLocalSkew",value:function(A,t,e){var n=3>=arguments.length||void 0===arguments[3]||arguments[3];"number"==typeof t&&(t=function(A,t,e){return A[0]=t,A[1]=e,A}(vo,t,e));var r=A.transformable;!function(A,t){A[0]=t[0],A[1]=t[1]}(r.localSkew,t),n&&this.dirtyLocalTransform(A,r)}},{key:"setLocalEulerAngles",value:function(A,t){var e=4>=arguments.length||void 0===arguments[4]||arguments[4];"number"==typeof t&&(t=aA(t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=A.transformable;kA(n.localRotation,t[0],t[1],t[2]),e&&this.dirtyLocalTransform(A,n)}},{key:"setLocalTransform",value:function(A,t){var e=_(Co,t),n=Y(Qo,t),r=X(Fo,t);this.setLocalScale(A,r,!1),this.setLocalPosition(A,e,!1),this.setLocalRotation(A,n,void 0,void 0,void 0,!1),this.dirtyLocalTransform(A,A.transformable)}},{key:"resetLocalTransform",value:function(A){this.setLocalScale(A,go,!1),this.setLocalPosition(A,Bo,!1),this.setLocalEulerAngles(A,Bo,void 0,void 0,!1),this.setLocalSkew(A,fo,void 0,!1),this.dirtyLocalTransform(A,A.transformable)}},{key:"getPosition",value:function(A){var t=A.transformable;return _(t.position,this.getWorldTransform(A,t))}},{key:"getRotation",value:function(A){var t=A.transformable;return Y(t.rotation,this.getWorldTransform(A,t))}},{key:"getScale",value:function(A){var t=A.transformable;return X(t.scaling,this.getWorldTransform(A,t))}},{key:"getOrigin",value:function(A){return A.getGeometryBounds(),A.transformable.origin}},{key:"getWorldTransform",value:function(A){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:A.transformable;return t.localDirtyFlag||t.dirtyFlag?(A.parentNode&&A.parentNode.transformable&&this.getWorldTransform(A.parentNode),this.internalUpdateTransform(A),t.worldTransform):t.worldTransform}},{key:"setPosition",value:function(A,t){var e,n=A.transformable;if(Eo[0]=t[0],Eo[1]=t[1],Eo[2]=null!==(e=t[2])&&void 0!==e?e:0,!pA(this.getPosition(A),Eo)){if(oA(n.position,Eo),null!==A.parentNode&&A.parentNode.transformable)E(bo,A.parentNode.transformable.worldTransform),H(bo,bo),gA(n.localPosition,Eo,bo);else oA(n.localPosition,Eo);this.dirtyLocalTransform(A,n)}}},{key:"translate",value:function(A,t){"number"==typeof t&&(t=sA(wo,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)),pA(t,Bo)||(uA(wo,this.getPosition(A),t),this.setPosition(A,wo))}},{key:"setRotation",value:function(A,t,e,n,r){var i=A.transformable;if("number"==typeof t&&(t=xA(t,e,n,r)),null!==A.parentNode&&A.parentNode.transformable){var a=this.getRotation(A.parentNode);HA(mo,a),bA(mo,mo),EA(i.localRotation,mo,t),MA(i.localRotation,i.localRotation),this.dirtyLocalTransform(A,i)}else this.setLocalRotation(A,t)}},{key:"rotate",value:function(A,t){"number"==typeof t&&(t=aA(t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var e=A.transformable;if(null!==A.parentNode&&A.parentNode.transformable){var n=mo;kA(n,t[0],t[1],t[2]);var r=this.getRotation(A),i=this.getRotation(A.parentNode);HA(Ho,i),bA(Ho,Ho),EA(n,Ho,n),EA(e.localRotation,n,r),MA(e.localRotation,e.localRotation),this.dirtyLocalTransform(A,e)}else this.rotateLocal(A,t)}},{key:"setOrigin",value:function(A,t){"number"==typeof t&&(t=[t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0]);var e=A.transformable;if(t[0]!==e.origin[0]||t[1]!==e.origin[1]||t[2]!==e.origin[2]){var n=e.origin;n[0]=t[0],n[1]=t[1],n[2]=t[2]||0,this.dirtyLocalTransform(A,e)}}},{key:"setEulerAngles",value:function(A,t){"number"==typeof t&&(t=aA(t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var e=A.transformable;if(null!==A.parentNode&&A.parentNode.transformable){kA(e.localRotation,t[0],t[1],t[2]);var n=this.getRotation(A.parentNode);HA(ko,bA(mo,n)),TA(e.localRotation,e.localRotation,ko),this.dirtyLocalTransform(A,e)}else this.setLocalEulerAngles(A,t)}},{key:"getGeometryBounds",value:function(A){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],e=A.geometry;return e.dirty&&No.styleValueRegistry.updateGeometry(A),(t?e.renderBounds:e.contentBounds||null)||new me}},{key:"getTransformedGeometryBounds",value:function(A){var t=arguments.length>2?arguments[2]:void 0,e=this.getGeometryBounds(A,arguments.length>1&&void 0!==arguments[1]&&arguments[1]);if(!me.isEmpty(e)){var n=t||new me;return n.setFromTransformedAABB(e,this.getWorldTransform(A)),n}return null}},{key:"getBounds",value:function(A){var t=this,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=A.renderable;if(!n.boundsDirty&&!e&&n.bounds)return n.bounds;if(!n.renderBoundsDirty&&e&&n.renderBounds)return n.renderBounds;var r=e?n.renderBounds:n.bounds,i=this.getTransformedGeometryBounds(A,e,r);if(A.childNodes.forEach(function(A){var n=t.getBounds(A,e);n&&(i?i.add(n):(i=r||new me).update(n.center,n.halfExtents))}),i||(i=new me),e){var a=na(A);if(a){var o=a.parsedStyle.clipPath.getBounds(e);i?o&&(i=o.intersection(i)):i.update(o.center,o.halfExtents)}}return e?(n.renderBounds=i,n.renderBoundsDirty=!1):(n.bounds=i,n.boundsDirty=!1),i}},{key:"getLocalBounds",value:function(A){if(A.parentNode){var t=po;A.parentNode.transformable&&(t=H(yo,this.getWorldTransform(A.parentNode)));var e=this.getBounds(A);if(!me.isEmpty(e)){var n=new me;return n.setFromTransformedAABB(e,t),n}}return this.getBounds(A)}},{key:"getBoundingClientRect",value:function(A){var t,e,n=this.getGeometryBounds(A);me.isEmpty(n)||(e=new me).setFromTransformedAABB(n,this.getWorldTransform(A));var r=null===(t=A.ownerDocument)||void 0===t||null===(t=t.defaultView)||void 0===t?void 0:t.getContextService().getBoundingClientRect();if(e){var i=v(e.getMin(),2),a=i[0],o=i[1],s=v(e.getMax(),2);return new Ee(a+((null==r?void 0:r.left)||0),o+((null==r?void 0:r.top)||0),s[0]-a,s[1]-o)}return new Ee((null==r?void 0:r.left)||0,(null==r?void 0:r.top)||0,0,0)}},{key:"internalUpdateTransform",value:function(A){var t,e=null===(t=A.parentNode)||void 0===t?void 0:t.transformable;rn(A.transformable),an(A.transformable,e)}},{key:"internalUpdateElement",value:function(A,t){var e,n,r,i,a,o,s=!0===(null===(e=A.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e||null===(e=e.getConfig())||void 0===e||null===(e=e.future)||void 0===e?void 0:e.experimentalAttributeUpdateOptimization),u=t[t.length-1],c=(null==u?void 0:u.transformDirty)||(null===(n=A.transformable)||void 0===n?void 0:n.localDirtyFlag);A.transformable&&((a=A.transformable).dirtyFlag||(a.dirtyFlag=c));(this.internalUpdateTransform(A),c)&&(null===(o=A.dirty)||void 0===o||o.call(A,!0,!0));var l=(null===(r=A.renderable)||void 0===r?void 0:r.boundsDirty)||(null===(i=A.renderable)||void 0===i?void 0:i.renderBoundsDirty);if((c||l)&&!1===(null==u?void 0:u.shapeUpdated)&&s)for(var h=t.length-1;h>=0;){var d,f,B=t[h];if(B.shapeUpdated)break;null===(d=(f=B.node).dirty)||void 0===d||d.call(f,!0,!0),B.shapeUpdated=!0,h-=1}return c}},{key:"syncHierarchy",value:function(A){for(var t,e,n=[A],r=A.parentNode?[{node:A.parentNode,transformDirty:(null===(t=A.parentNode.transformable)||void 0===t?void 0:t.localDirtyFlag)||(null===(e=A.parentNode.transformable)||void 0===e?void 0:e.dirtyFlag),shapeUpdated:!1}]:[];n.length>0;){for(var i=n.pop(),a=r[r.length-1];r.length>0&&i.parentNode!==a.node;)a=r.pop();var o=this.internalUpdateElement(i,r);if(i.childNodes.length>0){for(var s=i.childNodes.length-1;s>=0;s--)n.push(i.childNodes[s]);r.push({node:i,transformDirty:o,shapeUpdated:!1})}}}},{key:"dirtyLocalTransform",value:function(A,t){oa(A)||t.localDirtyFlag||(t.localDirtyFlag=!0,t.dirtyFlag||this.dirtyWorldTransform(A,t))}},{key:"dirtyWorldTransform",value:function(A,t){this.dirtyWorldInternal(A,t),this.dirtyToRoot(A,!0)}},{key:"dirtyWorldInternal",value:function(A,t){var e,n=this,r=!0===(null===(e=A.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e||null===(e=e.getConfig())||void 0===e||null===(e=e.future)||void 0===e?void 0:e.experimentalAttributeUpdateOptimization);t.dirtyFlag||(t.dirtyFlag=!0,A.dirty(!0,!0),r||A.childNodes.forEach(function(A){n.dirtyWorldInternal(A,A.transformable)}))}},{key:"dirtyToRoot",value:function(A){for(var t,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=A,r=!0===(null===(t=A.ownerDocument)||void 0===t||null===(t=t.defaultView)||void 0===t||null===(t=t.getConfig())||void 0===t||null===(t=t.future)||void 0===t?void 0:t.experimentalAttributeUpdateOptimization);n;){var i,a;if(null===(i=(a=n).dirty)||void 0===i||i.call(a,!0,!0),r)break;n=n.parentNode}e&&A.forEach(function(A){var t;null===(t=A.dirty)||void 0===t||t.call(A,!0,!0)}),this.informDependentDisplayObjects(A);var o=A.mutations||[],s=o.find(function(A){return"attributes"===A.type&&A._boundsChangeData});s?s._boundsChangeData={affectChildren:s._boundsChangeData.affectChildren||e}:o.push(s={type:"attributes",target:A,_boundsChangeData:{affectChildren:e}}),A.mutations=o}},{key:"dirtyFragment",value:function(A){var t,e,n=A.transformable;n&&(n.dirtyFlag=!0,n.localDirtyFlag=!0),null===(t=(e=A).dirty)||void 0===t||t.call(e,!0,!0);for(var r=A.childNodes.length,i=0;r>i;i++)this.dirtyFragment(A.childNodes[i])}},{key:"notifyMutationObservers",value:function(A){var t=new Set;if(A.getRoot().forEach(function(A){(A.mutations||[]).forEach(function(e){"attributes"===e.type&&e._boundsChangeData&&(e._boundsChangeData.affectChildren?A.forEach(function(A){var n=i({},e);n.target=A,t.add(n)}):t.add(e))}),A.mutations=void 0}),t.size>0){var e=new qa(oo.BOUNDS_CHANGED,{detail:Array.from(t)});A.dispatchEvent(e,!0,!0)}}},{key:"updateDisplayObjectDependency",value:function(A,t,e,n){if(t&&t!==e){var r=this.displayObjectDependencyMap.get(t);if(r&&r[A]){var i=r[A].indexOf(n);r[A].splice(i,1)}}if(e){var a=this.displayObjectDependencyMap.get(e);a||(this.displayObjectDependencyMap.set(e,{}),a=this.displayObjectDependencyMap.get(e)),a[A]||(a[A]=[]),a[A].push(n)}}},{key:"informDependentDisplayObjects",value:function(A){var t,e=this,n=this.displayObjectDependencyMap.get(A);if(n){var r=null===(t=A.ownerDocument)||void 0===t||null===(t=t.defaultView)||void 0===t||null===(t=t.getConfig())||void 0===t||null===(t=t.future)||void 0===t?void 0:t.experimentalCancelEventPropagation;Object.keys(n).forEach(function(A){n[A].forEach(function(t){e.dirtyToRoot(t,!0),t.dispatchEvent(new so(oo.ATTR_MODIFIED,t,e,e,A,so.MODIFICATION,e,e),r,r),t.isCustomElement&&t.isConnected&&t.attributeChangedCallback&&t.attributeChangedCallback(A,e,e)})})}}}])}(),To=function(){return s(function A(t){if(a(this,A),0>=t)throw Error("LRU capacity must be a positive number.");this.capacity=t,this.cache=new Map},[{key:"get",value:function(A){if(this.cache.has(A)){var t=this.cache.get(A);return this.cache.delete(A),this.cache.set(A,t),t}}},{key:"put",value:function(A,t){if(this.cache.has(A)&&this.cache.delete(A),this.cache.set(A,t),this.cache.size>this.capacity){var e=this.cache.keys().next().value;this.cache.delete(e)}}},{key:"len",value:function(){return this.cache.size}},{key:"clear",value:function(){this.cache.clear()}}])}(),Mo={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]},So=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,Lo=RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),Do=RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),Po=function(){return s(function A(t){var e=this;a(this,A),this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(A,t){return!e.isBreakingSpace(t)&&!(!A||!Do.exec(t)&&!Lo.exec(A))},this.trimByKinsokuShorui=function(A){var t=l(A),e=t[t.length-2];if(!e)return A;var n=e[e.length-1];return t[t.length-2]=e.slice(0,-1),t[t.length-1]=n+t[t.length-1],t},this.runtime=t,this.charWidthCache=new To(100)},[{key:"measureFont",value:function(A,t){if(this.fontMetricsCache[A])return this.fontMetricsCache[A];var e={ascent:0,descent:0,fontSize:0},n=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(t),r=this.runtime.offscreenCanvasCreator.getOrCreateContext(t,{willReadFrequently:!0});r.font=A;var i=Mo.MetricsString+Mo.BaselineSymbol,a=Math.ceil(r.measureText(i).width),o=Math.ceil(r.measureText(Mo.BaselineSymbol).width),s=Mo.HeightMultiplier*o;o=o*Mo.BaselineMultiplier|0,n.width=a,n.height=s,r.fillStyle="#f00",r.fillRect(0,0,a,s),r.font=A,r.textBaseline="alphabetic",r.fillStyle="#000",r.fillText(i,0,o);var u=r.getImageData(0,0,a||1,s||1).data,c=u.length,l=4*a,h=0,d=0,f=!1;for(h=0;o>h;++h){for(var B=0;l>B;B+=4)if(255!==u[d+B]){f=!0;break}if(f)break;d+=l}for(e.ascent=o-h,d=c-l,f=!1,h=s;h>o;--h){for(var g=0;l>g;g+=4)if(255!==u[d+g]){f=!0;break}if(f)break;d-=l}return e.descent=h-o,e.fontSize=e.ascent+e.descent,this.fontMetricsCache[A]=e,e}},{key:"measureText",value:function(A,t,e){var n=t.fontSize,r=void 0===n?16:n,i=t.wordWrap,a=void 0!==i&&i,o=t.lineHeight,s=t.lineWidth,u=void 0===s?1:s,c=t.textBaseline,l=void 0===c?"alphabetic":c,h=t.textAlign,d=void 0===h?"start":h,f=t.letterSpacing,B=void 0===f?0:f,g=t.textPath,p=t.leading,v=void 0===p?0:p,w=Ea(t),y=this.measureFont(w,e);0===y.fontSize&&(y.fontSize=r,y.ascent=r);var m=this.runtime.offscreenCanvasCreator.getOrCreateContext(e);m.font=w,t.isOverflowing=!1;var C=(a?this.wordWrap(A,t,e):A).split(/(?:\r\n|\r|\n)/),Q=Array(C.length),F=0;if(!g){for(var U=0;C.length>U;U++){var E=m.measureText(C[U]).width+(C[U].length-1)*B;Q[U]=E,F=Math.max(F,E)}var b=F+u,k=o||y.fontSize+u,x=Math.max(k,y.fontSize+u)+(C.length-1)*(k+v),H=0;return"middle"===l?H=-x/2:"bottom"===l||"alphabetic"===l||"ideographic"===l?H=-x:"top"!==l&&"hanging"!==l||(H=0),{font:w,width:b,height:x,lines:C,lineWidths:Q,lineHeight:k+=v,maxLineWidth:F,fontProperties:y,lineMetrics:Q.map(function(A,t){var e=0;return"center"===d||"middle"===d?e-=A/2:"right"!==d&&"end"!==d||(e-=A),new Ee(e-u/2,H+t*k,A+u,k)})}}g.getTotalLength();for(var I=0;C.length>I;I++)m.measureText(C[I])}},{key:"wordWrap",value:function(A,t,e){var n=this,r=Array.from(A);if(0===r.length)return"";var i=this,a=t.wordWrapWidth,o=void 0===a?0:a,s=t.letterSpacing,u=void 0===s?0:s,c=t.maxLines,l=void 0===c?1/0:c,h=t.textOverflow,d=this.runtime.offscreenCanvasCreator.getOrCreateContext(e),f=o+u,B="";"ellipsis"===h?B="...":h&&"clip"!==h&&(B=h);var g=[""],p=0,v=0,w=-1,y=Ea(t),m=this.charWidthCache.get(y);m||(m=new To(500),this.charWidthCache.put(y,m));var C=function(A){return n.getFromCache(A,u,m,d)},Q=C(B);function F(A,t,e,n){for(;C(A)<n&&r.length-1>t&&!i.isNewline(r[t+1]);)A+=r[t+=1];for(;C(A)>n&&t>=e;)t-=1,A=A.slice(0,-1);return{lineTxt:A,txtLastCharIndex:t}}function U(A,t){if(Q>0&&f>=Q)if(g[A]){var e=F(g[A],t,w+1,f-Q);g[A]=e.lineTxt+B}else g[A]=B}for(var E=0;r.length>E;E++){var b=r[E],k=r[E-1],x=r[E+1],H=C(b);if(this.isNewline(b)){if(p+1>=l){r.length-1>E&&U(p,E-1),t.isOverflowing=!0;break}w=E-1,v=0,g[p+=1]=""}else{if(H>f){U(p,E-1),t.isOverflowing=!0;break}if(v>0&&v+H>f){var I=F(g[p],E-1,w+1,f);if(I.txtLastCharIndex!==E-1){if(g[p]=I.lineTxt,I.txtLastCharIndex===r.length-1)break;k=r[(E=I.txtLastCharIndex+1)-1],x=r[E+1],H=C(b=r[E])}if(p+1>=l){U(p,E-1),t.isOverflowing=!0;break}if(w=E-1,v=0,g[p+=1]="",this.isBreakingSpace(b))continue;this.canBreakInLastChar(b)||(g=this.trimToBreakable(g),v=this.sumTextWidthByCache(g[p]||"",C)),this.shouldBreakByKinsokuShorui(b,x)&&(g=this.trimByKinsokuShorui(g),v+=C(k||""))}v+=H,g[p]+=b}}return g.join("\n")}},{key:"isBreakingSpace",value:function(A){return"string"==typeof A&&Mo.BreakingSpaces.indexOf(A.charCodeAt(0))>=0}},{key:"isNewline",value:function(A){return"string"==typeof A&&Mo.Newlines.indexOf(A.charCodeAt(0))>=0}},{key:"trimToBreakable",value:function(A){var t=l(A),e=t[t.length-2],n=this.findBreakableIndex(e);if(-1===n||!e)return t;var r=e.slice(n,n+1),i=n+(this.isBreakingSpace(r)?0:1);return t[t.length-1]+=e.slice(n+1,e.length),t[t.length-2]=e.slice(0,i),t}},{key:"canBreakInLastChar",value:function(A){return!A||!So.test(A)}},{key:"sumTextWidthByCache",value:function(A,t){return A.split("").reduce(function(A,e){return A+t(e)},0)}},{key:"findBreakableIndex",value:function(A){for(var t=A.length-1;t>=0;t--)if(!So.test(A[t]))return t;return-1}},{key:"getFromCache",value:function(A,t,e,n){var r=e.get(A);if("number"!=typeof r){var i=A.length*t,a=n.measureText(A);e.put(A,r=a.width+i)}return r}},{key:"clearCache",value:function(){this.fontMetricsCache={},this.charWidthCache.clear()}}])}(),No={},Oo=(co=new _a,lo=new Va,n(n(n(n(n(n(n(n(n(n(uo={},le.FRAGMENT,null),le.CIRCLE,new Oa),le.ELLIPSE,new Ka),le.RECT,co),le.IMAGE,co),le.GROUP,new Ya),le.LINE,new Ra),le.TEXT,new Xa(No)),le.POLYLINE,lo),le.POLYGON,lo),n(n(n(uo,le.PATH,new Ga),le.HTML,new Wa),le.MESH,null)),Ko=function(A){var t=new Ni,e=new Ri;return n(n(n(n(n(n(n(n(n(n(A={},sn.PERCENTAGE,null),sn.NUMBER,new Xi),sn.ANGLE,new Di),sn.DEFINED_PATH,new Pi),sn.PAINT,t),sn.COLOR,t),sn.FILTER,new Oi),sn.LENGTH,e),sn.LENGTH_PERCENTAGE,e),sn.LENGTH_PERCENTAGE_12,new Gi),n(n(n(n(n(n(n(n(n(n(A,sn.LENGTH_PERCENTAGE_14,new Vi),sn.COORDINATE,new Ri),sn.OFFSET_DISTANCE,new Yi),sn.OPACITY_VALUE,new Wi),sn.PATH,new Ji),sn.LIST_OF_POINTS,new Zi),sn.SHADOW_BLUR,new zi),sn.TEXT,new ji),sn.TEXT_TRANSFORM,new qi),sn.TRANSFORM,new Da),n(n(n(A,sn.TRANSFORM_ORIGIN,new Pa),sn.Z_INDEX,new Na),sn.MARKER,new _i)}();No.CameraContribution=qe,No.AnimationTimeline=null,No.EasingFunction=null,No.offscreenCanvasCreator=new eo,No.sceneGraphSelector=new ao,No.sceneGraphService=new Io(No),No.textService=new Po(No),No.geometryUpdaterFactory=Oo,No.CSSPropertySyntaxFactory=Ko,No.styleValueRegistry=new Si(No),No.layoutRegistry=null,No.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},No.enableStyleSyntax=!0,No.enableSizeAttenuation=!1;var Ro=0;var Go=new so(oo.INSERTED,null,"","","",0,"",""),Vo=new so(oo.REMOVED,null,"","","",0,"",""),_o=new qa(oo.DESTROY),Xo=function(A){function t(){var A;a(this,t);for(var e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];return(A=B(this,t,[].concat(n))).entity=Ro++,A.transformable={dirtyFlag:!1,localDirtyFlag:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},A.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},A.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},A.cullable={strategy:$e.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},A.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},A.namespaceURI="g",A.scrollLeft=0,A.scrollTop=0,A.clientTop=0,A.clientLeft=0,A.style={},A.computedStyle={},A.parsedStyle={},A.attributes={},A}return p(t,A),s(t,[{key:"dirty",value:function(){var A=arguments.length>1?arguments[1]:void 0;this.renderable.dirty=0>=arguments.length||void 0===arguments[0]||arguments[0],void 0!==A&&(this.renderable.boundsDirty=A,this.renderable.renderBoundsDirty=A,this.geometry.dirty=A)}},{key:"className",get:function(){return this.getAttribute("class")||""},set:function(A){this.setAttribute("class",A)}},{key:"classList",get:function(){return this.className.split(" ").filter(function(A){return""!==A})}},{key:"tagName",get:function(){return this.nodeName}},{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"parentElement",get:function(){return this.parentNode}},{key:"nextSibling",get:function(){if(this.parentNode){var A=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[A+1]||null}return null}},{key:"previousSibling",get:function(){if(this.parentNode){var A=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[A-1]||null}return null}},{key:"cloneNode",value:function(A){throw Error(be)}},{key:"appendChild",value:function(A,t){var e;if(A.destroyed)throw Error("Cannot append a destroyed element.");return No.sceneGraphService.attach(A,this,t),null!==(e=this.ownerDocument)&&void 0!==e&&e.defaultView&&(oa(this)||A.nodeName!==le.FRAGMENT?this.ownerDocument.defaultView.mountChildren(A):this.ownerDocument.defaultView.mountFragment(A)),this.isMutationObserved&&(Go.relatedNode=this,A.dispatchEvent(Go)),A}},{key:"insertBefore",value:function(A,t){if(t){A.parentElement&&A.parentElement.removeChild(A);var e=this.childNodes.indexOf(t);-1===e?this.appendChild(A):this.appendChild(A,e)}else this.appendChild(A);return A}},{key:"replaceChild",value:function(A,t){var e=this.childNodes.indexOf(t);return this.removeChild(t),this.appendChild(A,e),t}},{key:"removeChild",value:function(A){var t,e,n=!0===(null===(t=this.ownerDocument)||void 0===t||null===(t=t.defaultView)||void 0===t||null===(t=t.getConfig().future)||void 0===t?void 0:t.experimentalCancelEventPropagation);return Vo.relatedNode=this,A.dispatchEvent(Vo,n,n),null!==(e=A.ownerDocument)&&void 0!==e&&e.defaultView&&A.ownerDocument.defaultView.unmountChildren(A),No.sceneGraphService.detach(A),A}},{key:"removeChildren",value:function(){for(var A=this.childNodes.length-1;A>=0;A--){this.removeChild(this.childNodes[A])}}},{key:"destroyChildren",value:function(){for(var A=this.childNodes.length-1;A>=0;A--){var t=this.childNodes[A];t.childNodes.length>0&&t.destroyChildren(),t.destroy()}}},{key:"matches",value:function(A){return No.sceneGraphService.matches(A,this)}},{key:"getElementById",value:function(A){return No.sceneGraphService.querySelector("#".concat(A),this)}},{key:"getElementsByName",value:function(A){return No.sceneGraphService.querySelectorAll('[name="'.concat(A,'"]'),this)}},{key:"getElementsByClassName",value:function(A){return No.sceneGraphService.querySelectorAll(".".concat(A),this)}},{key:"getElementsByTagName",value:function(A){return No.sceneGraphService.querySelectorAll(A,this)}},{key:"querySelector",value:function(A){return No.sceneGraphService.querySelector(A,this)}},{key:"querySelectorAll",value:function(A){return No.sceneGraphService.querySelectorAll(A,this)}},{key:"closest",value:function(A){var t=this;do{if(No.sceneGraphService.matches(A,t))return t;t=t.parentElement}while(null!==t);return null}},{key:"find",value:function(A){var t=this,e=null;return this.forEach(function(n){return n===t||!A(n)||(e=n,!1)}),e}},{key:"findAll",value:function(A){var t=this,e=[];return this.forEach(function(n){n!==t&&A(n)&&e.push(n)}),e}},{key:"after",value:function(){var A=this;if(this.parentNode){for(var t=this.parentNode.childNodes.indexOf(this),e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];n.forEach(function(e,n){var r;return null===(r=A.parentNode)||void 0===r?void 0:r.appendChild(e,t+n+1)})}}},{key:"before",value:function(){if(this.parentNode){for(var A,t=this.parentNode.childNodes.indexOf(this),e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=n[0],a=u(n).slice(1);this.parentNode.appendChild(i,t),(A=i).after.apply(A,l(a))}}},{key:"replaceWith",value:function(){this.after.apply(this,arguments),this.remove()}},{key:"append",value:function(){for(var A=this,t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];e.forEach(function(t){return A.appendChild(t)})}},{key:"prepend",value:function(){for(var A=this,t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];e.forEach(function(t,e){return A.appendChild(t,e)})}},{key:"replaceChildren",value:function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)}},{key:"remove",value:function(){return this.parentNode?this.parentNode.removeChild(this):this}},{key:"destroy",value:function(){var A,t=!0===(null===(A=this.ownerDocument)||void 0===A||null===(A=A.defaultView)||void 0===A||null===(A=A.getConfig().future)||void 0===A?void 0:A.experimentalCancelEventPropagation);this.destroyChildren(),this.dispatchEvent(_o,t,t),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0}},{key:"getGeometryBounds",value:function(){return No.sceneGraphService.getGeometryBounds(this,arguments.length>0&&void 0!==arguments[0]&&arguments[0])}},{key:"getTransformedGeometryBounds",value:function(){return No.sceneGraphService.getTransformedGeometryBounds(this,arguments.length>0&&void 0!==arguments[0]&&arguments[0])}},{key:"getBounds",value:function(){return No.sceneGraphService.getBounds(this)}},{key:"getRenderBounds",value:function(){return No.sceneGraphService.getBounds(this,!0)}},{key:"getLocalBounds",value:function(){return No.sceneGraphService.getLocalBounds(this)}},{key:"getBoundingClientRect",value:function(){return No.sceneGraphService.getBoundingClientRect(this)}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"computedStyleMap",value:function(){return new Map(Object.entries(this.computedStyle))}},{key:"getAttributeNames",value:function(){return Object.keys(this.attributes)}},{key:"getAttribute",value:function(A){if("symbol"!=typeof A){var t=this.attributes[A];return t}}},{key:"hasAttribute",value:function(A){return this.getAttributeNames().includes(A)}},{key:"hasAttributes",value:function(){return!!this.getAttributeNames().length}},{key:"removeAttribute",value:function(A){this.setAttribute(A,null),delete this.attributes[A]}},{key:"setAttribute",value:function(A,t){this.attributes[A]=t}},{key:"getAttributeNS",value:function(A,t){throw Error(be)}},{key:"getAttributeNode",value:function(A){throw Error(be)}},{key:"getAttributeNodeNS",value:function(A,t){throw Error(be)}},{key:"hasAttributeNS",value:function(A,t){throw Error(be)}},{key:"removeAttributeNS",value:function(A,t){throw Error(be)}},{key:"removeAttributeNode",value:function(A){throw Error(be)}},{key:"setAttributeNS",value:function(A,t,e){throw Error(be)}},{key:"setAttributeNode",value:function(A){throw Error(be)}},{key:"setAttributeNodeNS",value:function(A){throw Error(be)}},{key:"toggleAttribute",value:function(A,t){throw Error(be)}}])}(Ao);function Yo(A){return!(null==A||!A.nodeName)}var Wo=No.globalThis.Proxy?No.globalThis.Proxy:function(){},Jo=new so(oo.ATTR_MODIFIED,null,null,null,null,so.MODIFICATION,null,null),Zo=nA(),zo=FA(),jo=function(A){function t(A){var e;return a(this,t),(e=B(this,t)).isCustomElement=!1,e.isMutationObserved=!1,e.activeAnimations=[],e.config=A,e.id=A.id||"",e.name=A.name||"",(A.className||A.class)&&(e.className=A.className||A.class),e.nodeName=A.type||le.GROUP,A.initialParsedStyle&&Object.assign(e.parsedStyle,A.initialParsedStyle),e.initAttributes(A.style),No.enableStyleSyntax&&(e.style=new Wo({setProperty:function(A,t){e.setAttribute(A,t)},getPropertyValue:function(A){return e.getAttribute(A)},removeProperty:function(A){e.removeAttribute(A)},item:function(){return""}},{get:function(A,t){return void 0!==A[t]?A[t]:e.getAttribute(t)},set:function(A,t,n){return e.setAttribute(t,n),!0}})),e}return p(t,A),s(t,[{key:"destroy",value:function(){Pt(t,"destroy",this,3)([]),this.getAnimations().forEach(function(A){A.cancel()})}},{key:"cloneNode",value:function(A,t){var e=i({},this.attributes);for(var n in e){var r=e[n];Yo(r)&&"clipPath"!==n&&"offsetPath"!==n&&"textPath"!==n&&(e[n]=r.cloneNode(A)),t&&(e[n]=t(n,r))}var a=new this.constructor(i(i({},this.config),{},{style:e}));return a.setLocalTransform(this.getLocalTransform()),A&&this.children.forEach(function(t){if(!t.style.isMarker){var e=t.cloneNode(A);a.appendChild(e)}}),a}},{key:"initAttributes",value:function(){No.styleValueRegistry.processProperties(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{forceUpdateGeometry:!0}),this.dirty()}},{key:"setAttribute",value:function(A,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=3>=arguments.length||void 0===arguments[3]||arguments[3];JA(e)||(n||e!==this.attributes[A])&&(this.internalSetAttribute(A,e,{memoize:r}),Pt(t,"setAttribute",this,3)([A,e]))}},{key:"setAttributes",value:function(A){var t,e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.skipDispatchAttrModifiedEvent,a=void 0!==r&&r;if(a||(t=i({},this.attributes),e=i({},this.parsedStyle)),No.styleValueRegistry.processProperties(this,A,n),this.dirty(),!a)for(var o in A)this.dispatchAttrModifiedEvent(o,t[o],A[o],e[o])}},{key:"internalSetAttribute",value:function(A,t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.attributes[A],i=this.parsedStyle[A];No.styleValueRegistry.processProperties(this,n({},A,t),e),this.dirty(),this.dispatchAttrModifiedEvent(A,r,t,i)}},{key:"dispatchAttrModifiedEvent",value:function(A,t,e,n){var r,i=this.parsedStyle[A];if(this.isConnected)if(Jo.relatedNode=this,Jo.prevValue=t,Jo.newValue=e,Jo.attrName=A,Jo.prevParsedValue=n,Jo.newParsedValue=i,this.isMutationObserved)this.dispatchEvent(Jo);else{var a,o=!0===(null===(a=this.ownerDocument.defaultView.getConfig().future)||void 0===a?void 0:a.experimentalCancelEventPropagation);Jo.target=this,this.ownerDocument.defaultView.dispatchEvent(Jo,!0,o)}(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&(null===(r=this.attributeChangedCallback)||void 0===r||r.call(this,A,t,e,n,i))}},{key:"getBBox",value:function(){var A=this.getBounds(),t=v(A.getMin(),2),e=t[0],n=t[1],r=v(A.getMax(),2);return new Ee(e,n,r[0]-e,r[1]-n)}},{key:"setOrigin",value:function(A){return No.sceneGraphService.setOrigin(this,Ie(A,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"getOrigin",value:function(){return No.sceneGraphService.getOrigin(this)}},{key:"setPosition",value:function(A){return No.sceneGraphService.setPosition(this,Ie(A,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"setLocalPosition",value:function(A){return No.sceneGraphService.setLocalPosition(this,Ie(A,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"translate",value:function(A){return No.sceneGraphService.translate(this,Ie(A,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"translateLocal",value:function(A){return No.sceneGraphService.translateLocal(this,Ie(A,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"getPosition",value:function(){return No.sceneGraphService.getPosition(this)}},{key:"getLocalPosition",value:function(){return No.sceneGraphService.getLocalPosition(this)}},{key:"scale",value:function(A,t,e){return this.scaleLocal(A,t,e)}},{key:"scaleLocal",value:function(A,t,e){return"number"==typeof A&&(A=Ie(A,t=t||A,e=e||A,!1)),No.sceneGraphService.scaleLocal(this,A),this}},{key:"setLocalScale",value:function(A,t,e){return"number"==typeof A&&(A=Ie(A,t=t||A,e=e||A,!1)),No.sceneGraphService.setLocalScale(this,A),this}},{key:"getLocalScale",value:function(){return No.sceneGraphService.getLocalScale(this)}},{key:"getScale",value:function(){return No.sceneGraphService.getScale(this)}},{key:"getEulerAngles",value:function(){return Le(v(Ne(Zo,No.sceneGraphService.getWorldTransform(this)),3)[2])}},{key:"getLocalEulerAngles",value:function(){return Le(v(Ne(Zo,No.sceneGraphService.getLocalRotation(this)),3)[2])}},{key:"setEulerAngles",value:function(A){return No.sceneGraphService.setEulerAngles(this,0,0,A),this}},{key:"setLocalEulerAngles",value:function(A){return No.sceneGraphService.setLocalEulerAngles(this,0,0,A),this}},{key:"rotateLocal",value:function(A,t,e){return DA(t)&&DA(e)?No.sceneGraphService.rotateLocal(this,0,0,A):No.sceneGraphService.rotateLocal(this,A,t,e),this}},{key:"rotate",value:function(A,t,e){return DA(t)&&DA(e)?No.sceneGraphService.rotate(this,0,0,A):No.sceneGraphService.rotate(this,A,t,e),this}},{key:"setRotation",value:function(A,t,e,n){return No.sceneGraphService.setRotation(this,A,t,e,n),this}},{key:"setLocalRotation",value:function(A,t,e,n){return No.sceneGraphService.setLocalRotation(this,A,t,e,n),this}},{key:"setLocalSkew",value:function(A,t){return No.sceneGraphService.setLocalSkew(this,A,t),this}},{key:"getRotation",value:function(){return No.sceneGraphService.getRotation(this)}},{key:"getLocalRotation",value:function(){return No.sceneGraphService.getLocalRotation(this)}},{key:"getLocalSkew",value:function(){return No.sceneGraphService.getLocalSkew(this)}},{key:"getLocalTransform",value:function(){return No.sceneGraphService.getLocalTransform(this)}},{key:"getWorldTransform",value:function(){return No.sceneGraphService.getWorldTransform(this)}},{key:"setLocalTransform",value:function(A){return No.sceneGraphService.setLocalTransform(this,A),this}},{key:"resetLocalTransform",value:function(){No.sceneGraphService.resetLocalTransform(this)}},{key:"getAnimations",value:function(){return this.activeAnimations}},{key:"animate",value:function(A,t){var e,n=null===(e=this.ownerDocument)||void 0===e?void 0:e.timeline;return n?n.play(this,A,t):null}},{key:"isVisible",value:function(){var A;return"hidden"!==(null===(A=this.parsedStyle)||void 0===A?void 0:A.visibility)}},{key:"interactive",get:function(){return this.isInteractive()},set:function(A){this.style.pointerEvents=A?"auto":"none"}},{key:"isInteractive",value:function(){var A;return"none"!==(null===(A=this.parsedStyle)||void 0===A?void 0:A.pointerEvents)}},{key:"isCulled",value:function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)}},{key:"toFront",value:function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,l(this.parentNode.children.map(function(A){return Number(A.style.zIndex)})))+1),this}},{key:"toBack",value:function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,l(this.parentNode.children.map(function(A){return Number(A.style.zIndex)})))-1),this}},{key:"getConfig",value:function(){return this.config}},{key:"attr",value:function(){for(var A=this,t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=e[0],i=e[1];return r?function(A){var t=typeof A;return null!==A&&"object"===t||"function"===t}(r)?(Object.keys(r).forEach(function(t){A.setAttribute(t,r[t])}),this):2===e.length?(this.setAttribute(r,i),this):this.attributes[r]:this.attributes}},{key:"getMatrix",value:function(A){var t=A||this.getWorldTransform(),e=v(_(Zo,t),2),n=e[0],r=e[1],i=v(X(Zo,t),2),a=i[0],o=i[1],s=Y(zo,t),u=v(Ne(Zo,s),3);return Oe(u[0]||u[2],n,r,a,o)}},{key:"getLocalMatrix",value:function(){return this.getMatrix(this.getLocalTransform())}},{key:"setMatrix",value:function(A){var t=v(Ke(A),5),e=t[0],n=t[1],r=t[2],i=t[3];this.setEulerAngles(t[4]).setPosition(e,n).setLocalScale(r,i)}},{key:"setLocalMatrix",value:function(A){var t=v(Ke(A),5),e=t[0],n=t[1],r=t[2],i=t[3];this.setLocalEulerAngles(t[4]).setLocalPosition(e,n).setLocalScale(r,i)}},{key:"show",value:function(){this.forEach(function(A){A.style.visibility="visible"})}},{key:"hide",value:function(){this.forEach(function(A){A.style.visibility="hidden"})}},{key:"getCount",value:function(){return this.childElementCount}},{key:"getParent",value:function(){return this.parentElement}},{key:"getChildren",value:function(){return this.children}},{key:"getFirst",value:function(){return this.firstElementChild}},{key:"getLast",value:function(){return this.lastElementChild}},{key:"getChildByIndex",value:function(A){return this.children[A]||null}},{key:"add",value:function(A,t){return this.appendChild(A,t)}},{key:"set",value:function(A,t){this.config[A]=t}},{key:"get",value:function(A){return this.config[A]}},{key:"moveTo",value:function(A){return this.setPosition(A,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0),this}},{key:"move",value:function(A){return this.setPosition(A,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0),this}},{key:"setZIndex",value:function(A){return this.style.zIndex=A,this}}])}(Xo);jo.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","display","draggable","droppable","fill","fillOpacity","fillRule","filter","increasedLineWidthForHitTesting","lineCap","lineDash","lineDashOffset","lineJoin","lineWidth","miterLimit","hitArea","offsetDistance","offsetPath","offsetX","offsetY","opacity","pointerEvents","shadowColor","shadowType","shadowBlur","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","strokeWidth","strokeLinecap","strokeLineJoin","strokeDasharray","strokeDashoffset","transform","transformOrigin","textTransform","visibility","zIndex"]);var qo=function(A){function t(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a(this,t),B(this,t,[i({type:le.CIRCLE},A)])}return p(t,A),s(t)}(jo);qo.PARSED_STYLE_LIST=new Set([].concat(l(jo.PARSED_STYLE_LIST),["cx","cy","cz","r","isBillboard","isSizeAttenuation"]));var $o=["style"],As=function(A){function t(){var A,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.style,r=ce(e,$o);return a(this,t),(A=B(this,t,[i({style:n},r)])).isCustomElement=!0,A}return p(t,A),s(t)}(jo);As.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var ts=function(A){function t(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a(this,t),B(this,t,[i({type:le.ELLIPSE},A)])}return p(t,A),s(t)}(jo);ts.PARSED_STYLE_LIST=new Set([].concat(l(jo.PARSED_STYLE_LIST),["cx","cy","cz","rx","ry","isBillboard","isSizeAttenuation"]));var es=function(A){function t(){return a(this,t),B(this,t,[{type:le.FRAGMENT}])}return p(t,A),s(t)}(jo);es.PARSED_STYLE_LIST=new Set(["class","className"]);var ns=function(A){function t(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a(this,t),B(this,t,[i({type:le.GROUP},A)])}return p(t,A),s(t)}(jo);ns.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var rs=["style"],is=function(A){function t(){var A,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.style,r=ce(e,rs);return a(this,t),(A=B(this,t,[i({type:le.HTML,style:n},r)])).cullable.enable=!1,A}return p(t,A),s(t,[{key:"getDomElement",value:function(){return this.parsedStyle.$el}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"getLocalBounds",value:function(){if(this.parentNode){var A=H(F(),this.parentNode.getWorldTransform()),t=this.getBounds();if(!me.isEmpty(t)){var e=new me;return e.setFromTransformedAABB(t,A),e}}return this.getBounds()}}])}(jo);is.PARSED_STYLE_LIST=new Set([].concat(l(jo.PARSED_STYLE_LIST),["x","y","$el","innerHTML","width","height"]));var as=function(A){function t(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a(this,t),B(this,t,[i({type:le.IMAGE},A)])}return p(t,A),s(t)}(jo);as.PARSED_STYLE_LIST=new Set([].concat(l(jo.PARSED_STYLE_LIST),["x","y","z","src","width","height","isBillboard","billboardRotation","isSizeAttenuation","keepAspectRatio"]));var os=["style"],ss=function(A){function t(){var A,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.style,r=ce(e,os);a(this,t),(A=B(this,t,[i({type:le.LINE,style:i({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},n)},r)])).markerStartAngle=0,A.markerEndAngle=0;var o=A.parsedStyle,s=o.markerStart,u=o.markerEnd;return s&&Yo(s)&&(A.markerStartAngle=s.getLocalEulerAngles(),A.appendChild(s)),u&&Yo(u)&&(A.markerEndAngle=u.getLocalEulerAngles(),A.appendChild(u)),A.transformMarker(!0),A.transformMarker(!1),A}return p(t,A),s(t,[{key:"attributeChangedCallback",value:function(A,t,e,n,r){"x1"===A||"y1"===A||"x2"===A||"y2"===A||"markerStartOffset"===A||"markerEndOffset"===A?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===A?(n&&Yo(n)&&(this.markerStartAngle=0,n.remove()),r&&Yo(r)&&(this.markerStartAngle=r.getLocalEulerAngles(),this.appendChild(r),this.transformMarker(!0))):"markerEnd"===A&&(n&&Yo(n)&&(this.markerEndAngle=0,n.remove()),r&&Yo(r)&&(this.markerEndAngle=r.getLocalEulerAngles(),this.appendChild(r),this.transformMarker(!1)))}},{key:"transformMarker",value:function(A){var t=this.parsedStyle,e=t.markerStartOffset,n=t.markerEndOffset,r=t.x1,i=t.x2,a=t.y1,o=t.y2,s=A?t.markerStart:t.markerEnd;if(s&&Yo(s)){var u,c,l,h,d,f,B;A?(h=r,d=a,c=i-r,l=o-a,f=e||0,B=this.markerStartAngle):(h=i,d=o,c=r-i,l=a-o,f=n||0,B=this.markerEndAngle),s.setLocalEulerAngles(180*(u=Math.atan2(l,c))/Math.PI+B),s.setLocalPosition(h+Math.cos(u)*f,d+Math.sin(u)*f)}}},{key:"getPoint",value:function(A){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],e=this.parsedStyle,n=_t(e.x1,e.y1,e.x2,e.y2,A),r=n.x,i=n.y,a=gA(nA(),aA(r,i,0),t?this.getWorldTransform():this.getLocalTransform());return new Ue(a[0],a[1])}},{key:"getPointAtLength",value:function(A){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(A/this.getTotalLength(),t)}},{key:"getTotalLength",value:function(){var A=this.parsedStyle;return Vt(A.x1,A.y1,A.x2,A.y2)}}])}(jo);ss.PARSED_STYLE_LIST=new Set([].concat(l(jo.PARSED_STYLE_LIST),["x1","y1","x2","y2","z1","z2","isBillboard","isSizeAttenuation","markerStart","markerEnd","markerStartOffset","markerEndOffset"]));var us=["style"],cs=function(A){function t(){var A,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.style,r=ce(e,us);a(this,t),(A=B(this,t,[i({type:le.PATH,style:n,initialParsedStyle:{miterLimit:4,d:i({},on)}},r)])).markerStartAngle=0,A.markerEndAngle=0,A.markerMidList=[];var o=A.parsedStyle,s=o.markerStart,u=o.markerEnd,c=o.markerMid;return s&&Yo(s)&&(A.markerStartAngle=s.getLocalEulerAngles(),A.appendChild(s)),c&&Yo(c)&&A.placeMarkerMid(c),u&&Yo(u)&&(A.markerEndAngle=u.getLocalEulerAngles(),A.appendChild(u)),A.transformMarker(!0),A.transformMarker(!1),A}return p(t,A),s(t,[{key:"attributeChangedCallback",value:function(A,t,e,n,r){"d"===A?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===A||"markerEndOffset"===A?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===A?(n&&Yo(n)&&(this.markerStartAngle=0,n.remove()),r&&Yo(r)&&(this.markerStartAngle=r.getLocalEulerAngles(),this.appendChild(r),this.transformMarker(!0))):"markerEnd"===A?(n&&Yo(n)&&(this.markerEndAngle=0,n.remove()),r&&Yo(r)&&(this.markerEndAngle=r.getLocalEulerAngles(),this.appendChild(r),this.transformMarker(!1))):"markerMid"===A&&this.placeMarkerMid(r)}},{key:"transformMarker",value:function(A){var t=this.parsedStyle,e=t.markerStartOffset,n=t.markerEndOffset,r=A?t.markerStart:t.markerEnd;if(r&&Yo(r)){var i,a,o,s,u,c,l;if(A){var h=v(this.getStartTangent(),2),d=h[0],f=h[1];s=f[0],u=f[1],a=d[0]-f[0],o=d[1]-f[1],c=e||0,l=this.markerStartAngle}else{var B=v(this.getEndTangent(),2),g=B[0],p=B[1];s=p[0],u=p[1],a=g[0]-p[0],o=g[1]-p[1],c=n||0,l=this.markerEndAngle}r.setLocalEulerAngles(180*(i=Math.atan2(o,a))/Math.PI+l),r.setLocalPosition(s+Math.cos(i)*c,u+Math.sin(i)*c)}}},{key:"placeMarkerMid",value:function(A){var t=this.parsedStyle.d.segments;if(this.markerMidList.forEach(function(A){A.remove()}),A&&Yo(A))for(var e=1;t.length-1>e;e++){var n=v(t[e].currentPoint,2),r=n[0],i=n[1],a=1===e?A:A.cloneNode(!0);this.markerMidList.push(a),this.appendChild(a),a.setLocalPosition(r,i)}}},{key:"getTotalLength",value:function(){return Jr(this)}},{key:"getPointAtLength",value:function(A){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],e=function(A,t,e){return It(A,t,ZA(ZA({},e),{bbox:!1,length:!0})).point}(this.parsedStyle.d.absolutePath,A),n=e.x,r=e.y,i=gA(nA(),aA(n,r,0),t?this.getWorldTransform():this.getLocalTransform());return new Ue(i[0],i[1])}},{key:"getPoint",value:function(A){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPointAtLength(A*Jr(this),t)}},{key:"getStartTangent",value:function(){var A=this.parsedStyle.d.segments,t=[];if(A.length>1){var e=A[0].currentPoint,n=A[1].currentPoint,r=A[1].startTangent;t=[],r?(t.push([e[0]-r[0],e[1]-r[1]]),t.push([e[0],e[1]])):(t.push([n[0],n[1]]),t.push([e[0],e[1]]))}return t}},{key:"getEndTangent",value:function(){var A=this.parsedStyle.d.segments,t=A.length,e=[];if(t>1){var n=A[t-2].currentPoint,r=A[t-1].currentPoint,i=A[t-1].endTangent;e=[],i?(e.push([r[0]-i[0],r[1]-i[1]]),e.push([r[0],r[1]])):(e.push([n[0],n[1]]),e.push([r[0],r[1]]))}return e}}])}(jo);cs.PARSED_STYLE_LIST=new Set([].concat(l(jo.PARSED_STYLE_LIST),["d","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard","isSizeAttenuation"]));var ls=["style"],hs=function(A){function t(){var A,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.style,r=ce(e,ls);a(this,t),(A=B(this,t,[i({type:le.POLYGON,style:n,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},r)])).markerStartAngle=0,A.markerEndAngle=0,A.markerMidList=[];var o=A.parsedStyle,s=o.markerStart,u=o.markerEnd,c=o.markerMid;return s&&Yo(s)&&(A.markerStartAngle=s.getLocalEulerAngles(),A.appendChild(s)),c&&Yo(c)&&A.placeMarkerMid(c),u&&Yo(u)&&(A.markerEndAngle=u.getLocalEulerAngles(),A.appendChild(u)),A.transformMarker(!0),A.transformMarker(!1),A}return p(t,A),s(t,[{key:"attributeChangedCallback",value:function(A,t,e,n,r){"points"===A?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===A||"markerEndOffset"===A?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===A?(n&&Yo(n)&&(this.markerStartAngle=0,n.remove()),r&&Yo(r)&&(this.markerStartAngle=r.getLocalEulerAngles(),this.appendChild(r),this.transformMarker(!0))):"markerEnd"===A?(n&&Yo(n)&&(this.markerEndAngle=0,n.remove()),r&&Yo(r)&&(this.markerEndAngle=r.getLocalEulerAngles(),this.appendChild(r),this.transformMarker(!1))):"markerMid"===A&&this.placeMarkerMid(r)}},{key:"transformMarker",value:function(A){var t=this.parsedStyle,e=t.markerStartOffset,n=t.markerEndOffset,r=(t.points||{}).points,i=A?t.markerStart:t.markerEnd;if(i&&Yo(i)&&r){var a,o,s,u,c,l,h;if(u=r[0][0],c=r[0][1],A)o=r[1][0]-r[0][0],s=r[1][1]-r[0][1],l=e||0,h=this.markerStartAngle;else{var d=r.length;this.parsedStyle.isClosed?(o=r[d-1][0]-r[0][0],s=r[d-1][1]-r[0][1]):(u=r[d-1][0],c=r[d-1][1],o=r[d-2][0]-r[d-1][0],s=r[d-2][1]-r[d-1][1]),l=n||0,h=this.markerEndAngle}i.setLocalEulerAngles(180*(a=Math.atan2(s,o))/Math.PI+h),i.setLocalPosition(u+Math.cos(a)*l,c+Math.sin(a)*l)}}},{key:"placeMarkerMid",value:function(A){var t=(this.parsedStyle.points||{}).points;if(this.markerMidList.forEach(function(A){A.remove()}),this.markerMidList=[],A&&Yo(A)&&t)for(var e=1;(this.parsedStyle.isClosed?t.length:t.length-1)>e;e++){var n=t[e][0],r=t[e][1],i=1===e?A:A.cloneNode(!0);this.markerMidList.push(i),this.appendChild(i),i.setLocalPosition(n,r)}}}])}(jo);hs.PARSED_STYLE_LIST=new Set([].concat(l(jo.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isClosed","isBillboard","isSizeAttenuation"]));var ds=["style"],fs=function(A){function t(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=A.style,n=ce(A,ds);return a(this,t),B(this,t,[i({type:le.POLYLINE,style:e,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},n)])}return p(t,A),s(t,[{key:"getTotalLength",value:function(){return 0===(A=this).parsedStyle.points.totalLength&&(A.parsedStyle.points.totalLength=Jt(A.parsedStyle.points.points)),A.parsedStyle.points.totalLength;var A}},{key:"getPointAtLength",value:function(A){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(A/this.getTotalLength(),t)}},{key:"getPoint",value:function(A){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],e=this.parsedStyle.points.points;if(0===this.parsedStyle.points.segments.length){var n,r,i=[],a=0,o=this.getTotalLength();e.forEach(function(A,t){e[t+1]&&((n=[0,0])[0]=a/o,r=Vt(A[0],A[1],e[t+1][0],e[t+1][1]),n[1]=(a+=r)/o,i.push(n))}),this.parsedStyle.points.segments=i}var s=0,u=0;this.parsedStyle.points.segments.forEach(function(t,e){t[0]>A||A>t[1]||(s=(A-t[0])/(t[1]-t[0]),u=e)});var c=_t(e[u][0],e[u][1],e[u+1][0],e[u+1][1],s),l=c.x,h=c.y,d=gA(nA(),aA(l,h,0),t?this.getWorldTransform():this.getLocalTransform());return new Ue(d[0],d[1])}},{key:"getStartTangent",value:function(){var A=this.parsedStyle.points.points,t=[];return t.push([A[1][0],A[1][1]]),t.push([A[0][0],A[0][1]]),t}},{key:"getEndTangent",value:function(){var A=this.parsedStyle.points.points,t=A.length-1,e=[];return e.push([A[t-1][0],A[t-1][1]]),e.push([A[t][0],A[t][1]]),e}}])}(hs);fs.PARSED_STYLE_LIST=new Set([].concat(l(hs.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard"]));var Bs=function(A){function t(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a(this,t),B(this,t,[i({type:le.RECT},A)])}return p(t,A),s(t)}(jo);Bs.PARSED_STYLE_LIST=new Set([].concat(l(jo.PARSED_STYLE_LIST),["x","y","z","width","height","isBillboard","isSizeAttenuation","radius"]));var gs=["style"],ps=function(A){function t(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=A.style,n=ce(A,gs);return a(this,t),B(this,t,[i({type:le.TEXT,style:i({fill:"black"},e)},n)])}return p(t,A),s(t,[{key:"getComputedTextLength",value:function(){var A;return this.getGeometryBounds(),(null===(A=this.parsedStyle.metrics)||void 0===A?void 0:A.maxLineWidth)||0}},{key:"getLineBoundingRects",value:function(){var A;return this.getGeometryBounds(),(null===(A=this.parsedStyle.metrics)||void 0===A?void 0:A.lineMetrics)||[]}},{key:"isOverflowing",value:function(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing}}])}(jo);ps.PARSED_STYLE_LIST=new Set([].concat(l(jo.PARSED_STYLE_LIST),["x","y","z","isBillboard","billboardRotation","isSizeAttenuation","text","textAlign","textBaseline","fontStyle","fontSize","fontFamily","fontWeight","fontVariant","lineHeight","letterSpacing","leading","wordWrap","wordWrapWidth","maxLines","textOverflow","isOverflowing","textPath","textDecorationLine","textDecorationColor","textDecorationStyle","textDecorationThickness","textPathSide","textPathStartOffset","metrics","dx","dy"]));var vs=function(){return s(function A(){a(this,A),this.registry={},this.define(le.CIRCLE,qo),this.define(le.ELLIPSE,ts),this.define(le.RECT,Bs),this.define(le.IMAGE,as),this.define(le.LINE,ss),this.define(le.GROUP,ns),this.define(le.PATH,cs),this.define(le.POLYGON,hs),this.define(le.POLYLINE,fs),this.define(le.TEXT,ps),this.define(le.HTML,is)},[{key:"define",value:function(A,t){this.registry[A]=t}},{key:"get",value:function(A){return this.registry[A]}}])}(),ws={number:function(A){return new rr(A)},percent:function(A){return new rr(A,"%")},px:function(A){return new rr(A,"px")},em:function(A){return new rr(A,"em")},rem:function(A){return new rr(A,"rem")},deg:function(A){return new rr(A,"deg")},grad:function(A){return new rr(A,"grad")},rad:function(A){return new rr(A,"rad")},turn:function(A){return new rr(A,"turn")},s:function(A){return new rr(A,"s")},ms:function(A){return new rr(A,"ms")},registerProperty:function(A){No.styleValueRegistry.registerMetadata({n:A.name,inh:A.inherits,int:A.interpolable,d:A.initialValue,syntax:A.syntax})},registerLayout:function(A,t){No.layoutRegistry.registerLayout(A,t)}},ys=function(A){function t(){var A;a(this,t),(A=B(this,t)).defaultView=null,A.ownerDocument=null,A.nodeName="document";try{A.timeline=new No.AnimationTimeline(A)}catch(A){}var e={};return Ii.forEach(function(A){var t=A.d;A.inh&&t&&(e[A.n]=LA(t)?t(le.GROUP):t)}),A.documentElement=new ns({id:"g-root",style:e}),A.documentElement.ownerDocument=A,A.documentElement.parentNode=A,A.childNodes=[A.documentElement],A}return p(t,A),s(t,[{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"createElement",value:function(A,t){if("svg"===A)return this.documentElement;var e=this.defaultView.customElements.get(A);e||(console.warn("Unsupported tagName: ",A),e="tspan"===A?ps:ns);var n=new e(t);return n.ownerDocument=this,n}},{key:"createElementNS",value:function(A,t,e){return this.createElement(t,e)}},{key:"cloneNode",value:function(A){throw Error(be)}},{key:"destroy",value:function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(A){}}},{key:"elementsFromBBox",value:function(A,t,e,n){var r=[],i=function(a){if(a.isInteractive()&&!a.isCulled()){var o=a.parsedStyle.pointerEvents;if(!["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(void 0===o?"auto":o)||a.isVisible()){var s=a.getTransformedGeometryBounds(!0);s&&!me.isEmpty(s)&&(A>s.max[0]||s.min[0]>e||t>s.max[1]||s.min[1]>n||r.push(a))}a.childNodes&&a.childNodes.forEach(function(A){A instanceof jo&&i(A)})}};return i(this.documentElement),r.sort(function(A,t){return t.sortable.renderOrder-A.sortable.renderOrder}),r}},{key:"elementFromPointSync",value:function(A,t){var e=this.defaultView.canvas2Viewport({x:A,y:t}),n=e.x,r=e.y,i=this.defaultView.getConfig();if(0>n||0>r||n>i.width||r>i.height)return null;var a=this.defaultView.viewport2Client({x:n,y:r}),o=a.x,s=a.y,u=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:A,y:t,viewportX:n,viewportY:r,clientX:o,clientY:s},picked:[]}).picked;return u&&u[0]||this.documentElement}},{key:"elementFromPoint",value:(n=se(ae().mark(function A(t,e){var n,r,i,a,o,s,u,c,l,h;return ae().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:if(n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,a=this.defaultView.getConfig(),o=a.width,s=a.height,!(0>r||0>i||r>o||i>s)){A.next=1;break}return A.abrupt("return",null);case 1:return u=this.defaultView.viewport2Client({x:r,y:i}),c=u.x,l=u.y,A.next=2,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:c,clientY:l},picked:[]});case 2:return A.abrupt("return",(h=A.sent.picked)&&h[0]||this.documentElement);case 3:case"end":return A.stop()}},A,this)})),function(A,t){return n.apply(this,arguments)})},{key:"elementsFromPointSync",value:function(A,t){var e=this.defaultView.canvas2Viewport({x:A,y:t}),n=e.x,r=e.y,i=this.defaultView.getConfig();if(0>n||0>r||n>i.width||r>i.height)return[];var a=this.defaultView.viewport2Client({x:n,y:r}),o=a.x,s=a.y,u=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:A,y:t,viewportX:n,viewportY:r,clientX:o,clientY:s},picked:[]}).picked;return u[u.length-1]!==this.documentElement&&u.push(this.documentElement),u}},{key:"elementsFromPoint",value:(e=se(ae().mark(function A(t,e){var n,r,i,a,o,s,u,c,l,h;return ae().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:if(n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,a=this.defaultView.getConfig(),o=a.width,s=a.height,!(0>r||0>i||r>o||i>s)){A.next=1;break}return A.abrupt("return",[]);case 1:return u=this.defaultView.viewport2Client({x:r,y:i}),c=u.x,l=u.y,A.next=2,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:c,clientY:l},picked:[]});case 2:return(h=A.sent.picked)[h.length-1]!==this.documentElement&&h.push(this.documentElement),A.abrupt("return",h);case 3:case"end":return A.stop()}},A,this)})),function(A,t){return e.apply(this,arguments)})},{key:"appendChild",value:function(A,t){throw Error(ke)}},{key:"insertBefore",value:function(A,t){throw Error(ke)}},{key:"removeChild",value:function(A,t){throw Error(ke)}},{key:"replaceChild",value:function(A,t,e){throw Error(ke)}},{key:"append",value:function(){throw Error(ke)}},{key:"prepend",value:function(){throw Error(ke)}},{key:"getElementById",value:function(A){return this.documentElement.getElementById(A)}},{key:"getElementsByName",value:function(A){return this.documentElement.getElementsByName(A)}},{key:"getElementsByTagName",value:function(A){return this.documentElement.getElementsByTagName(A)}},{key:"getElementsByClassName",value:function(A){return this.documentElement.getElementsByClassName(A)}},{key:"querySelector",value:function(A){return this.documentElement.querySelector(A)}},{key:"querySelectorAll",value:function(A){return this.documentElement.querySelectorAll(A)}},{key:"find",value:function(A){return this.documentElement.find(A)}},{key:"findAll",value:function(A){return this.documentElement.findAll(A)}}]);var e,n}(Ao),ms=function(){function A(t){a(this,A),this.strategies=t}return s(A,[{key:"apply",value:function(t){var e=t.config,n=t.camera,r=t.renderingService,i=t.renderingContext,a=this.strategies;r.hooks.cull.tap(A.tag,function(A){if(A){var t,r=A.cullable;if(r.visible=0===a.length?i.unculledEntities.indexOf(A.entity)>-1:a.every(function(t){return t.isVisible(n,A)}),!A.isCulled()&&A.isVisible())return A;var o=!0===(null===(t=e.future)||void 0===t?void 0:t.experimentalCancelEventPropagation);return A.dispatchEvent(new qa(oo.CULLED),o,o),null}return A}),r.hooks.afterRender.tap(A.tag,function(A){A.cullable.visibilityPlaneMask=-1})}}])}();ms.tag="Culling";var Cs=function(){function A(){var t=this;a(this,A),this.autoPreventDefault=!1,this.rootPointerEvent=new za(null),this.rootWheelEvent=new ja(null),this.onPointerMove=function(A){var e,n=null===(e=t.context.renderingContext.root)||void 0===e||null===(e=e.ownerDocument)||void 0===e?void 0:e.defaultView;if(!n.supportsTouchEvents||"touch"!==A.pointerType){var r,i=ue(t.normalizeToPointerEvent(A,n));try{for(i.s();!(r=i.n()).done;){var a=t.bootstrapEvent(t.rootPointerEvent,r.value,n,A);t.context.eventService.mapEvent(a)}}catch(A){i.e(A)}finally{i.f()}t.setCursor(t.context.eventService.cursor)}},this.onClick=function(A){var e,n,r=null===(e=t.context.renderingContext.root)||void 0===e||null===(e=e.ownerDocument)||void 0===e?void 0:e.defaultView,i=ue(t.normalizeToPointerEvent(A,r));try{for(i.s();!(n=i.n()).done;){var a=t.bootstrapEvent(t.rootPointerEvent,n.value,r,A);t.context.eventService.mapEvent(a)}}catch(A){i.e(A)}finally{i.f()}t.setCursor(t.context.eventService.cursor)}}return s(A,[{key:"apply",value:function(t){var e=this;this.context=t;var n=t.renderingService,r=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler(function(A){return e.context.renderingService.hooks.pickSync.call({position:A,picked:[],topmost:!0}).picked[0]||null}),n.hooks.pointerWheel.tap(A.tag,function(A){var t=e.normalizeWheelEvent(A);e.context.eventService.mapEvent(t)}),n.hooks.pointerDown.tap(A.tag,function(A){if(!r.supportsTouchEvents||"touch"!==A.pointerType){var t=e.normalizeToPointerEvent(A,r);if(e.autoPreventDefault&&t[0].isNormalized)(A.cancelable||!("cancelable"in A))&&A.preventDefault();var n,i=ue(t);try{for(i.s();!(n=i.n()).done;){var a=e.bootstrapEvent(e.rootPointerEvent,n.value,r,A);e.context.eventService.mapEvent(a)}}catch(A){i.e(A)}finally{i.f()}e.setCursor(e.context.eventService.cursor)}}),n.hooks.pointerUp.tap(A.tag,function(A){if(!r.supportsTouchEvents||"touch"!==A.pointerType){var t,n=e.context.contextService.getDomElement(),i=e.context.eventService.isNativeEventFromCanvas(n,A)?"":"outside",a=ue(e.normalizeToPointerEvent(A,r));try{for(a.s();!(t=a.n()).done;){var o=e.bootstrapEvent(e.rootPointerEvent,t.value,r,A);o.type+=i,e.context.eventService.mapEvent(o)}}catch(A){a.e(A)}finally{a.f()}e.setCursor(e.context.eventService.cursor)}}),n.hooks.pointerMove.tap(A.tag,this.onPointerMove),n.hooks.pointerOver.tap(A.tag,this.onPointerMove),n.hooks.pointerOut.tap(A.tag,this.onPointerMove),n.hooks.click.tap(A.tag,this.onClick),n.hooks.pointerCancel.tap(A.tag,function(A){var t,n=ue(e.normalizeToPointerEvent(A,r));try{for(n.s();!(t=n.n()).done;){var i=e.bootstrapEvent(e.rootPointerEvent,t.value,r,A);e.context.eventService.mapEvent(i)}}catch(A){n.e(A)}finally{n.f()}e.setCursor(e.context.eventService.cursor)})}},{key:"bootstrapEvent",value:function(A,t,e,n){A.view=e,A.originalEvent=null,A.nativeEvent=n,A.pointerId=t.pointerId,A.width=t.width,A.height=t.height,A.isPrimary=t.isPrimary,A.pointerType=t.pointerType,A.pressure=t.pressure,A.tangentialPressure=t.tangentialPressure,A.tiltX=t.tiltX,A.tiltY=t.tiltY,A.twist=t.twist,this.transferMouseData(A,t);var r=this.context.eventService.client2Viewport({x:t.clientX,y:t.clientY}),i=r.y;A.viewport.x=r.x,A.viewport.y=i;var a=this.context.eventService.viewport2Canvas(A.viewport),o=a.y;return A.canvas.x=a.x,A.canvas.y=o,A.global.copyFrom(A.canvas),A.offset.copyFrom(A.canvas),A.isTrusted=n.isTrusted,"pointerleave"===A.type&&(A.type="pointerout"),A.type.startsWith("mouse")&&(A.type=A.type.replace("mouse","pointer")),A.type.startsWith("touch")&&(A.type=ia[A.type]||A.type),A}},{key:"normalizeWheelEvent",value:function(A){var t=this.rootWheelEvent;this.transferMouseData(t,A),t.deltaMode=A.deltaMode,t.deltaX=A.deltaX,t.deltaY=A.deltaY,t.deltaZ=A.deltaZ;var e=this.context.eventService.client2Viewport({x:A.clientX,y:A.clientY}),n=e.y;t.viewport.x=e.x,t.viewport.y=n;var r=this.context.eventService.viewport2Canvas(t.viewport),i=r.y;return t.canvas.x=r.x,t.canvas.y=i,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.nativeEvent=A,t.type=A.type,t}},{key:"transferMouseData",value:function(A,t){A.isTrusted=t.isTrusted,A.srcElement=t.srcElement,A.timeStamp=aa.now(),A.type=t.type,A.altKey=t.altKey,A.metaKey=t.metaKey,A.shiftKey=t.shiftKey,A.ctrlKey=t.ctrlKey,A.button=t.button,A.buttons=t.buttons,A.client.x=t.clientX,A.client.y=t.clientY,A.movement.x=t.movementX,A.movement.y=t.movementY,A.page.x=t.pageX,A.page.y=t.pageY,A.screen.x=t.screenX,A.screen.y=t.screenY,A.relatedTarget=null}},{key:"setCursor",value:function(A){this.context.contextService.applyCursorStyle(A||this.context.config.cursor||"default")}},{key:"normalizeToPointerEvent",value:function(A,t){var e=[];if(t.isTouchEvent(A))for(var n=0;A.changedTouches.length>n;n++){var r=A.changedTouches[n];JA(r.button)&&(r.button=0),JA(r.buttons)&&(r.buttons=1),JA(r.isPrimary)&&(r.isPrimary=1===A.touches.length&&"touchstart"===A.type),JA(r.width)&&(r.width=r.radiusX||1),JA(r.height)&&(r.height=r.radiusY||1),JA(r.tiltX)&&(r.tiltX=0),JA(r.tiltY)&&(r.tiltY=0),JA(r.pointerType)&&(r.pointerType="touch"),JA(r.pointerId)&&(r.pointerId=r.identifier||0),JA(r.pressure)&&(r.pressure=r.force||.5),JA(r.twist)&&(r.twist=0),JA(r.tangentialPressure)&&(r.tangentialPressure=0),r.isNormalized=!0,r.type=A.type,e.push(r)}else if(t.isMouseEvent(A)){var i=A;JA(i.isPrimary)&&(i.isPrimary=!0),JA(i.width)&&(i.width=1),JA(i.height)&&(i.height=1),JA(i.tiltX)&&(i.tiltX=0),JA(i.tiltY)&&(i.tiltY=0),JA(i.pointerType)&&(i.pointerType="mouse"),JA(i.pointerId)&&(i.pointerId=1),JA(i.pressure)&&(i.pressure=.5),JA(i.twist)&&(i.twist=0),JA(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,e.push(i)}else e.push(A);return e}}])}();Cs.tag="Event";var Qs=[le.CIRCLE,le.ELLIPSE,le.IMAGE,le.RECT,le.LINE,le.POLYLINE,le.POLYGON,le.TEXT,le.PATH,le.HTML],Fs=function(){return s(function A(){a(this,A)},[{key:"isVisible",value:function(A,t){var e,n=t.cullable;if(!n.enable)return!0;var r=t.getRenderBounds();if(me.isEmpty(r))return!1;var i=A.getFrustum(),a=null===(e=t.parentNode)||void 0===e||null===(e=e.cullable)||void 0===e?void 0:e.visibilityPlaneMask;return n.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(t,r,a||Qe.INDETERMINATE,i.planes),n.visible=n.visibilityPlaneMask!==Qe.OUTSIDE,n.visible}},{key:"computeVisibilityWithPlaneMask",value:function(A,t,e,n){if(e===Qe.OUTSIDE||e===Qe.INSIDE)return e;for(var r=Qe.INSIDE,i=Qs.indexOf(A.nodeName)>-1,a=0,o=n.length;o>a;++a){var s=1<<a;if(0!==(e&s)&&(!i||4!==a&&5!==a)){var u=n[a],c=u.normal,l=u.distance;if(0>dA(c,t.getPositiveFarPoint(n[a]))+l)return Qe.OUTSIDE;0>dA(c,t.getNegativeFarPoint(n[a]))+l&&(r|=s)}}return r}}])}(),Us=function(){function A(){a(this,A),this.mutationRecords=[],this.isFirstTimeRendering=!0,this.isFirstTimeRenderingFinished=!1}return s(A,[{key:"apply",value:function(t){var e,n=this,r=t.renderingService,i=t.renderingContext.root.ownerDocument.defaultView,a=function(A){r.dirty()},o=function(A){var t,e=ue(A.detail);try{for(e.s();!(t=e.n()).done;){n.mutationRecords.push(t.value)}}catch(A){e.e(A)}finally{e.f()}r.dirty()},s=function(A){No.enableSizeAttenuation&&No.styleValueRegistry.updateSizeAttenuation(A.target,i.getCamera().getZoom())},u=function(A){No.sceneGraphService.dirtyToRoot(A.target),r.dirty()};r.hooks.init.tap(A.tag,function(){i.addEventListener(oo.MOUNTED,s),i.addEventListener(oo.UNMOUNTED,u),i.addEventListener(oo.ATTR_MODIFIED,a),i.addEventListener(oo.BOUNDS_CHANGED,o)}),r.hooks.destroy.tap(A.tag,function(){i.removeEventListener(oo.MOUNTED,s),i.removeEventListener(oo.UNMOUNTED,u),i.removeEventListener(oo.ATTR_MODIFIED,a),i.removeEventListener(oo.BOUNDS_CHANGED,o),n.mutationRecords=[]});var c=null!==(e=No.globalThis.requestIdleCallback)&&void 0!==e?e:pa.bind(No.globalThis);r.hooks.endFrame.tap(A.tag,function(){n.isFirstTimeRendering&&(n.isFirstTimeRendering=!1,c(function(){n.isFirstTimeRenderingFinished=!0})),n.mutationRecords=[]})}}])}();Us.tag="Prepare";var Es,bs,ks=function(A){return A.READY="ready",A.BEFORE_RENDER="beforerender",A.RERENDER="rerender",A.AFTER_RENDER="afterrender",A.BEFORE_DESTROY="beforedestroy",A.AFTER_DESTROY="afterdestroy",A.RESIZE="resize",A.DIRTY_RECTANGLE="dirtyrectangle",A.RENDERER_CHANGED="rendererchanged",A}({}),xs=new qa(oo.MOUNTED),Hs=new qa(oo.UNMOUNTED),Is=new qa(ks.BEFORE_RENDER),Ts=new qa(ks.RERENDER),Ms=new qa(ks.AFTER_RENDER),Ss=function(A){function t(A){var e;a(this,t),(e=B(this,t)).Element=jo,e.inited=!1,e.context={};var n=A.container,r=A.canvas,o=A.renderer,s=A.width,u=A.height,c=A.background,l=A.cursor,h=A.supportsMutipleCanvasesInOneContainer,d=A.cleanUpOnDestroy,f=void 0===d||d,g=A.offscreenCanvas,p=A.requestAnimationFrame,v=A.cancelAnimationFrame,w=A.createImage,y=A.supportsTouchEvents,m=A.supportsPointerEvents,C=A.isTouchEvent,Q=A.isMouseEvent,F=A.dblClickSpeed,U=s,E=u,b=A.devicePixelRatio||Aa&&window.devicePixelRatio||1;return b=1>b?1:Math.ceil(b),r&&(U=s||function(A){var t=ra(A,"width");return"auto"===t?A.offsetWidth:parseFloat(t)}(r)||r.width/b,E=u||function(A){var t=ra(A,"height");return"auto"===t?A.offsetHeight:parseFloat(t)}(r)||r.height/b),e.customElements=new vs,e.devicePixelRatio=b,e.requestAnimationFrame=null!=p?p:pa.bind(No.globalThis),e.cancelAnimationFrame=null!=v?v:va.bind(No.globalThis),e.createImage=null!=w?w:function(){return new window.Image},e.supportsTouchEvents=null!=y?y:"ontouchstart"in No.globalThis,e.supportsPointerEvents=null!=m?m:!!No.globalThis.PointerEvent,e.isTouchEvent=null!=C?C:function(A){return e.supportsTouchEvents&&A instanceof No.globalThis.TouchEvent},e.isMouseEvent=null!=Q?Q:function(A){return!No.globalThis.MouseEvent||A instanceof No.globalThis.MouseEvent&&(!e.supportsPointerEvents||!(A instanceof No.globalThis.PointerEvent))},g&&(No.offscreenCanvas=g),e.document=new ys,e.document.defaultView=e,h||function(A,t,e){if(A){var n="string"==typeof A?document.getElementById(A):A;$i.has(n)&&$i.get(n).destroy(e),$i.set(n,t)}}(n,e,f),e.initRenderingContext(i(i({},A),{},{width:U,height:E,background:null!=c?c:"transparent",cursor:null!=l?l:"default",cleanUpOnDestroy:f,devicePixelRatio:b,requestAnimationFrame:e.requestAnimationFrame,cancelAnimationFrame:e.cancelAnimationFrame,createImage:e.createImage,supportsTouchEvents:e.supportsTouchEvents,supportsPointerEvents:e.supportsPointerEvents,isTouchEvent:e.isTouchEvent,isMouseEvent:e.isMouseEvent,dblClickSpeed:null!=F?F:200})),e.initDefaultCamera(U,E,o.clipSpaceNearZ),e.initRenderer(o,!0),e}return p(t,A),s(t,[{key:"initRenderingContext",value:function(A){this.context.config=A,this.context.renderingContext={root:this.document.documentElement,unculledEntities:[],renderListCurrentFrame:[],renderReasons:new Set,force:!1,dirty:!1}}},{key:"initDefaultCamera",value:function(A,t,e){var n=this,r=new No.CameraContribution;r.clipSpaceNearZ=e,r.setType(We.EXPLORING,Je.DEFAULT).setPosition(A/2,t/2,500).setFocalPoint(A/2,t/2,0).setOrthographic(A/-2,A/2,t/2,t/-2,.1,1e3),r.canvas=this,r.eventEmitter.on(ze.UPDATED,function(){n.context.renderingContext.renderReasons.add(no.CAMERA_CHANGED),No.enableSizeAttenuation&&n.getConfig().renderer.getConfig().enableSizeAttenuation&&n.updateSizeAttenuation()}),this.context.camera=r}},{key:"updateSizeAttenuation",value:function(){var A=this.getCamera().getZoom();this.document.documentElement.forEach(function(t){No.styleValueRegistry.updateSizeAttenuation(t,A)})}},{key:"getConfig",value:function(){return this.context.config}},{key:"getRoot",value:function(){return this.document.documentElement}},{key:"getCamera",value:function(){return this.context.camera}},{key:"getContextService",value:function(){return this.context.contextService}},{key:"getEventService",value:function(){return this.context.eventService}},{key:"getRenderingService",value:function(){return this.context.renderingService}},{key:"getRenderingContext",value:function(){return this.context.renderingContext}},{key:"getStats",value:function(){return this.getRenderingService().getStats()}},{key:"ready",get:function(){var A=this;return this.readyPromise||(this.readyPromise=new Promise(function(t){A.resolveReadyPromise=function(){t(A)}}),this.inited&&this.resolveReadyPromise()),this.readyPromise}},{key:"destroy",value:function(){var A,t=0>=arguments.length||void 0===arguments[0]||arguments[0],e=arguments.length>1?arguments[1]:void 0;Gn.clearCache();var n=!0===(null===(A=this.getConfig().future)||void 0===A?void 0:A.experimentalCancelEventPropagation);e||this.dispatchEvent(new qa(ks.BEFORE_DESTROY),n,n),this.frameId&&this.cancelAnimationFrame(this.frameId);var r=this.getRoot();t&&(this.unmountChildren(r),this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),e||this.dispatchEvent(new qa(ks.AFTER_DESTROY),n,n);var i=function(A){A.currentTarget=null,A.manager=null,A.target=null,A.relatedNode=null};i(xs),i(Hs),i(Is),i(Ts),i(Ms),i(Jo),i(Go),i(Vo),i(_o),No.textService.clearCache()}},{key:"changeSize",value:function(A,t){this.resize(A,t)}},{key:"resize",value:function(A,t){var e,n=this.context.config;n.width=A,n.height=t,this.getContextService().resize(A,t);var r=this.context.camera,i=r.getProjectionMode();r.setPosition(A/2,t/2,500).setFocalPoint(A/2,t/2,0),i===Ze.ORTHOGRAPHIC?r.setOrthographic(A/-2,A/2,t/2,t/-2,r.getNear(),r.getFar()):r.setAspect(A/t);var a=!0===(null===(e=n.future)||void 0===e?void 0:e.experimentalCancelEventPropagation);this.dispatchEvent(new qa(ks.RESIZE,{width:A,height:t}),a,a)}},{key:"appendChild",value:function(A,t){return this.document.documentElement.appendChild(A,t)}},{key:"insertBefore",value:function(A,t){return this.document.documentElement.insertBefore(A,t)}},{key:"removeChild",value:function(A){return this.document.documentElement.removeChild(A)}},{key:"removeChildren",value:function(){this.document.documentElement.removeChildren()}},{key:"destroyChildren",value:function(){this.document.documentElement.destroyChildren()}},{key:"render",value:function(A){var t,e=this;A&&(Is.detail=A,Ms.detail=A);var n=!0===(null===(t=this.getConfig().future)||void 0===t?void 0:t.experimentalCancelEventPropagation);this.dispatchEvent(Is,n,n),this.getRenderingService().render(this,A,function(){e.dispatchEvent(Ts,n,n)}),this.dispatchEvent(Ms,n,n)}},{key:"run",value:function(){var A=this,t=function(e,n){A.render(n),A.frameId=A.requestAnimationFrame(t)};t()}},{key:"initRenderer",value:function(A){var t=this,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!A)throw Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new Cs,new Us,new ms([new Fs])),this.loadRendererContainerModule(A),this.context.contextService=new this.context.ContextService(i(i({},No),this.context)),this.context.renderingService=new ro(No,this.context),this.context.eventService=new to(No,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(A,e,!0)):this.context.contextService.initAsync().then(function(){t.initRenderingService(A,e)}).catch(function(A){console.error(A)})}},{key:"initRenderingService",value:function(A){var t=this,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.context.renderingService.init(function(){var r;t.inited=!0;var i=!0===(null===(r=t.getConfig().future)||void 0===r?void 0:r.experimentalCancelEventPropagation);e?n?t.requestAnimationFrame(function(){t.dispatchEvent(new qa(ks.READY),i,i)}):t.dispatchEvent(new qa(ks.READY),i,i):t.dispatchEvent(new qa(ks.RENDERER_CHANGED),i,i),t.readyPromise&&t.resolveReadyPromise(),e||t.getRoot().forEach(function(A){var t,e;null===(t=(e=A).dirty)||void 0===t||t.call(e,!0,!0)}),t.mountChildren(t.getRoot()),A.getConfig().enableAutoRendering&&t.run()})}},{key:"loadRendererContainerModule",value:function(A){var t=this;A.getPlugins().forEach(function(A){A.context=t.context,A.init(No)})}},{key:"setRenderer",value:function(A){var t=this.getConfig();if(t.renderer!==A){var e=t.renderer;t.renderer=A,this.destroy(!1,!0),l((null==e?void 0:e.getPlugins())||[]).reverse().forEach(function(A){A.destroy(No)}),this.initRenderer(A)}}},{key:"setCursor",value:function(A){this.getConfig().cursor=A,this.getContextService().applyCursorStyle(A)}},{key:"unmountChildren",value:function(A){var t=this;if(A.childNodes.forEach(function(A){t.unmountChildren(A)}),this.inited){if(A.isMutationObserved)A.dispatchEvent(Hs);else{var e,n=!0===(null===(e=this.getConfig().future)||void 0===e?void 0:e.experimentalCancelEventPropagation);Hs.target=A,this.dispatchEvent(Hs,!0,n)}A!==this.document.documentElement&&(A.ownerDocument=null),A.isConnected=!1}A.isCustomElement&&A.disconnectedCallback&&A.disconnectedCallback()}},{key:"mountChildren",value:function(A){var t=this,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:oa(A);if(this.inited){if(!A.isConnected&&(A.ownerDocument=this.document,A.isConnected=!0,!e))if(A.isMutationObserved)A.dispatchEvent(xs);else{var n,r=!0===(null===(n=this.getConfig().future)||void 0===n?void 0:n.experimentalCancelEventPropagation);xs.target=A,this.dispatchEvent(xs,!0,r)}}else console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",A.nodeName);A.childNodes.forEach(function(A){t.mountChildren(A,e)}),A.isCustomElement&&A.connectedCallback&&A.connectedCallback()}},{key:"mountFragment",value:function(A){this.mountChildren(A,!1)}},{key:"client2Viewport",value:function(A){return this.getEventService().client2Viewport(A)}},{key:"viewport2Client",value:function(A){return this.getEventService().viewport2Client(A)}},{key:"viewport2Canvas",value:function(A){return this.getEventService().viewport2Canvas(A)}},{key:"canvas2Viewport",value:function(A){return this.getEventService().canvas2Viewport(A)}},{key:"getPointByClient",value:function(A,t){return this.client2Viewport({x:A,y:t})}},{key:"getClientByPoint",value:function(A,t){return this.viewport2Client({x:A,y:t})}}])}($a),Ls=0,Ds=new WeakMap,Ps=function(){function A(t,e){a(this,A),this.addedNodes=[],this.attributeName=null,this.attributeNamespace=null,this.nextSibling=null,this.oldValue=null,this.previousSibling=null,this.removedNodes=[],this.type=t,this.target=e}return s(A,null,[{key:"copy",value:function(t){var e=new A(t.type,t.target);return e.addedNodes=t.addedNodes.slice(),e.removedNodes=t.removedNodes.slice(),e.previousSibling=t.previousSibling,e.nextSibling=t.nextSibling,e.attributeName=t.attributeName,e.attributeNamespace=t.attributeNamespace,e.oldValue=t.oldValue,e}}])}(),Ns=function(){return s(function A(t,e,n){a(this,A),this.transientObservedNodes=[],this.observer=t,this.target=e,this.options=n},[{key:"enqueue",value:function(A){var t=this.observer.records,e=t.length;if(t.length>0){var n=function(A,t){return A===t?A:bs&&function(A){return A===bs||A===Es}(A)?bs:null}(t[e-1],A);if(n)return void(t[e-1]=n)}else Vs.push(this.observer),Gs||(Gs=!0,void 0!==No.globalThis?No.globalThis.setTimeout(_s):_s());t[e]=A}},{key:"addListeners",value:function(){this.addListeners_(this.target)}},{key:"addListeners_",value:function(A){var t=this.options;t.attributes&&A.addEventListener(oo.ATTR_MODIFIED,this,!0),t.childList&&A.addEventListener(oo.INSERTED,this,!0),(t.childList||t.subtree)&&A.addEventListener(oo.REMOVED,this,!0)}},{key:"removeListeners",value:function(){this.removeListeners_(this.target)}},{key:"removeListeners_",value:function(A){var t=this.options;t.attributes&&A.removeEventListener(oo.ATTR_MODIFIED,this,!0),t.childList&&A.removeEventListener(oo.INSERTED,this,!0),(t.childList||t.subtree)&&A.removeEventListener(oo.REMOVED,this,!0)}},{key:"removeTransientObservers",value:function(){var A=this.transientObservedNodes;this.transientObservedNodes=[],A.forEach(function(A){this.removeListeners_(A);for(var t=Ds.get(A),e=0;t.length>e;e++)if(t[e]===this){t.splice(e,1);break}},this)}},{key:"handleEvent",value:function(A){var t,e;switch(A.stopImmediatePropagation(),A.type){case oo.ATTR_MODIFIED:var n=A.attrName,r=A.relatedNode.namespaceURI;(t=Ks("attributes",e=A.target)).attributeName=n,t.attributeNamespace=r;var i=A.attrChange===so.ADDITION?null:A.prevValue;Rs(e,function(A){if(A.attributes&&(!A.attributeFilter||!A.attributeFilter.length||-1!==A.attributeFilter.indexOf(n)||-1!==A.attributeFilter.indexOf(r)))return A.attributeOldValue?function(A){return bs||((bs=Ps.copy(Es)).oldValue=A,bs)}(i):t});break;case oo.REMOVED:case oo.INSERTED:var a,o,s=A.target;A.type===oo.INSERTED?(a=[s],o=[]):(a=[],o=[s]);var u=s.previousSibling,c=s.nextSibling;(t=Ks("childList",e=A.relatedNode)).addedNodes=a,t.removedNodes=o,t.previousSibling=u,t.nextSibling=c,Rs(e,function(A){if(A.childList)return t})}Es=bs=void 0}}])}(),Os=function(){return s(function A(t){a(this,A),this.nodes=[],this.records=[],this.uid=Ls++,this.callback=t},[{key:"observe",value:function(A,t){if(!t.childList&&!t.attributes&&!t.characterData||t.attributeOldValue&&!t.attributes||t.attributeFilter&&t.attributeFilter.length&&!t.attributes||t.characterDataOldValue&&!t.characterData)throw new SyntaxError;var e,n=Ds.get(A);n||Ds.set(A,n=[]);for(var r=0;n.length>r;r++)if(n[r].observer===this){(e=n[r]).removeListeners(),e.options=t;break}e||(e=new Ns(this,A,t),n.push(e),this.nodes.push(A)),e.addListeners()}},{key:"disconnect",value:function(){var A=this;this.nodes.forEach(function(t){for(var e=Ds.get(t),n=0;e.length>n;n++){var r=e[n];if(r.observer===A){r.removeListeners(),e.splice(n,1);break}}},this),this.records=[]}},{key:"takeRecords",value:function(){var A=this.records;return this.records=[],A}}])}();function Ks(A,t){return Es=new Ps(A,t)}function Rs(A,t){for(var e=A;e;e=e.parentNode){var n=Ds.get(e);if(n)for(var r=0;n.length>r;r++){var i=n[r],a=i.options;if(e===A||a.subtree){var o=t(a);o&&i.enqueue(o)}}}}var Gs=!1,Vs=[];function _s(){Gs=!1;var A=Vs;Vs=[],A.sort(function(A,t){return A.uid-t.uid});var t=!1;A.forEach(function(A){var e=A.takeRecords();!function(A){A.nodes.forEach(function(t){var e=Ds.get(t);e&&e.forEach(function(t){t.observer===A&&t.removeTransientObservers()})})}(A),e.length&&(A.callback(e,A),t=!0)}),t&&_s()}var Xs=function(){return s(function A(){a(this,A),this.cacheStore=new Map},[{key:"onRefAdded",value:function(A){}},{key:"has",value:function(A){return this.cacheStore.has(A)}},{key:"put",value:function(A,t,e){return!this.cacheStore.has(A)&&(this.cacheStore.set(A,{value:t,counter:new Set([e.entity])}),this.onRefAdded(e),!0)}},{key:"get",value:function(A,t){var e=this.cacheStore.get(A);return e?(e.counter.has(t.entity)||(e.counter.add(t.entity),this.onRefAdded(t)),e.value):null}},{key:"update",value:function(A,t,e){var n=this.cacheStore.get(A);return!!n&&(n.value=i(i({},n.value),t),n.counter.has(e.entity)||(n.counter.add(e.entity),this.onRefAdded(e)),!0)}},{key:"release",value:function(A,t){var e=this.cacheStore.get(A);return!!e&&(e.counter.delete(t.entity),e.counter.size>0||this.cacheStore.delete(A),!0)}},{key:"releaseRef",value:function(A){var t=this;Array.from(this.cacheStore.keys()).forEach(function(e){t.release(e,A)})}},{key:"getSize",value:function(){return this.cacheStore.size}},{key:"clear",value:function(){this.cacheStore.clear()}}])}(),Ys=[],Ws=[],Js=function(){function A(){a(this,A)}return s(A,null,[{key:"stop",value:function(){A.rafId&&((arguments.length>0&&void 0!==arguments[0]?arguments[0]:A.api).cancelAnimationFrame(A.rafId),A.rafId=null)}},{key:"executeTask",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:A.api;(Ys.length>0||Ws.length>0)&&(Ws.forEach(function(A){return A()}),Ws=Ys.splice(0,A.TASK_NUM_PER_FRAME),A.rafId=t.requestAnimationFrame(function(){A.executeTask(t)}))}},{key:"sliceImage",value:function(t,e,n,r){for(var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:A.api,o=t.naturalWidth||t.width,s=t.naturalHeight||t.height,u=e-i,c=n-i,l=Math.ceil(o/u),h=Math.ceil(s/c),d={tileSize:[e,n],gridSize:[h,l],tiles:Array(h).fill(null).map(function(){return Array(l).fill(null)})},f=function(A){for(var i=function(i){Ys.push(function(){var l=i*u,h=A*c,f=[Math.min(e,o-l),Math.min(n,s-h)],B=f[0],g=f[1],p=a.createCanvas();p.width=e,p.height=n,p.getContext("2d").drawImage(t,l,h,B,g,0,0,B,g),d.tiles[A][i]={x:l,y:h,tileX:i,tileY:A,data:p},r()})},h=0;l>h;h++)i(h)},B=0;h>B;B++)f(B);return A.stop(),A.executeTask(),d}}])}();Js.TASK_NUM_PER_FRAME=10;var Zs=new Xs;Zs.onRefAdded=function(A){var t=this;A.addEventListener(oo.DESTROY,function(){t.releaseRef(A)},{once:!0})};var zs=function(){return s(function A(t,e){a(this,A),this.gradientCache={},this.patternCache={},this.context=t,this.runtime=e},[{key:"getImageSync",value:function(A,t,e){var n=GA(A)?A:A.src;if(Zs.has(n)){var r=Zs.get(n,t);if(r.img.complete)return null==e||e(r),r}return this.getOrCreateImage(A,t).then(function(A){null==e||e(A)}).catch(function(A){console.error(A)}),null}},{key:"getOrCreateImage",value:function(A,t){var e=this,n=GA(A)?A:A.src;if(!GA(A)&&!Zs.has(n)){var r={img:A,size:[A.naturalWidth||A.width,A.naturalHeight||A.height],tileSize:js(A)};Zs.put(n,r,t)}if(Zs.has(n)){var i=Zs.get(n,t);return i.img.complete?Promise.resolve(i):new Promise(function(A,t){i.img.addEventListener("load",function(){i.size=[i.img.naturalWidth||i.img.width,i.img.naturalHeight||i.img.height],i.tileSize=js(i.img),A(i)}),i.img.addEventListener("error",function(A){t(A)})})}return new Promise(function(A,r){var i=e.context.config.createImage();if(i){var a={img:i,size:[0,0],tileSize:js(i)};Zs.put(n,a,t),i.onload=function(){a.size=[i.naturalWidth||i.width,i.naturalHeight||i.height],a.tileSize=js(a.img),A(a)},i.onerror=function(A){r(A)},i.crossOrigin="Anonymous",i.src=n}})}},{key:"createDownSampledImage",value:(t=se(ae().mark(function A(t,e){var n,r,a,o,s,u,c,l,h,d,f,B,g,p;return ae().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=1,this.getOrCreateImage(t,e);case 1:if(void 0===(n=A.sent).downSamplingRate){A.next=2;break}return A.abrupt("return",n);case 2:if(s=void 0===(o=(a="boolean"==typeof(r=this.context.config.enableLargeImageOptimization)?{}:r).maxDownSampledImageSize)?2048:o,c=void 0===(u=a.downSamplingRateThreshold)?.5:u,l=this.runtime.globalThis.createImageBitmap,h=v(n.size,2),B=n.img,g=Math.min((s+s)/((d=h[0])+(f=h[1])),Math.max(.01,Math.min(c,.5))),p=i(i({},n),{},{downSamplingRate:g}),Zs.update(n.img.src,p,e),!l){A.next=7;break}return A.prev=3,A.next=4,l(n.img,{resizeWidth:d*g,resizeHeight:f*g});case 4:B=A.sent,A.next=6;break;case 5:A.prev=5,A.catch(3),g=1;case 6:A.next=8;break;case 7:g=1;case 8:return p=i(i({},this.getImageSync(t,e)),{},{downSampled:B,downSamplingRate:g}),Zs.update(n.img.src,p,e),A.abrupt("return",p);case 9:case"end":return A.stop()}},A,this,[[3,5]])})),function(A,e){return t.apply(this,arguments)})},{key:"createImageTiles",value:(A=se(ae().mark(function A(t,e,n,r){var a,o,s;return ae().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=1,this.getOrCreateImage(t,r);case 1:return a=A.sent,Js.api={requestAnimationFrame:(o=r.ownerDocument.defaultView).requestAnimationFrame,cancelAnimationFrame:o.cancelAnimationFrame,createCanvas:function(){return eo.createCanvas()}},s=i(i({},a),Js.sliceImage(a.img,a.tileSize[0],a.tileSize[0],n)),Zs.update(a.img.src,s,r),A.abrupt("return",s);case 2:case"end":return A.stop()}},A,this)})),function(t,e,n,r){return A.apply(this,arguments)})},{key:"releaseImage",value:function(A,t){Zs.release(GA(A)?A:A.src,t)}},{key:"releaseImageRef",value:function(A){Zs.releaseRef(A)}},{key:"getOrCreatePatternSync",value:function(A,t,e,n,r,i,a){var o=this.generatePatternKey(t);if(o&&this.patternCache[o])return this.patternCache[o];var s,u=t.image,c=t.repetition,l=t.transform,h=!1;if(GA(u)){var d=this.getImageSync(u,A,a);s=null==d?void 0:d.img}else n?(s=n,h=!0):s=u;var f,B=s&&e.createPattern(s,c);B&&(f=l?La(pi(l),new jo({})):k(F()),h&&S(f,f,[1/r,1/r,1]),B.setTransform({a:f[0],b:f[1],c:f[4],d:f[5],e:f[12]+i[0],f:f[13]+i[1]}));return o&&B&&(this.patternCache[o]=B),B}},{key:"getOrCreateGradient",value:function(A,t){var e=this.generateGradientKey(A),n=A.type,r=A.steps,i=A.min,a=A.width,o=A.height,s=A.cx,u=A.cy,c=A.size;if(this.gradientCache[e])return this.gradientCache[e];var l=null;if(n===Ar.LinearGradient){var h=gr(i,a,o,A.angle);l=t.createLinearGradient(h.x1,h.y1,h.x2,h.y2)}else if(n===Ar.RadialGradient){var d=pr(i,a,o,s,u,c),f=d.x,B=d.y;l=t.createRadialGradient(f,B,0,f,B,d.r)}return l&&(r.forEach(function(A){var t,e=A.offset;e.unit===Vn.kPercentage&&(null===(t=l)||void 0===t||t.addColorStop(e.value/100,""+A.color))}),this.gradientCache[e]=l),this.gradientCache[e]}},{key:"generateGradientKey",value:function(A){var t=A.min,e=A.width,n=A.height,r=A.steps,i=A.angle,a=A.cx,o=A.cy,s=A.size;return"gradient-".concat(A.type,"-").concat((null==i?void 0:""+i)||0,"-").concat((null==a?void 0:""+a)||0,"-").concat((null==o?void 0:""+o)||0,"-").concat((null==s?void 0:""+s)||0,"-").concat(t[0],"-").concat(t[1],"-").concat(e,"-").concat(n,"-").concat(r.map(function(A){var t=A.color;return"".concat(A.offset).concat(t)}).join("-"))}},{key:"generatePatternKey",value:function(A){var t=A.image,e=A.repetition;return GA(t)?"pattern-".concat(t,"-").concat(e):"rect"===t.nodeName?"pattern-".concat(t.entity,"-").concat(e):void 0}}]);var A,t}();function js(A){if(!A.complete)return[0,0];var t=A.naturalWidth||A.width,e=A.naturalHeight||A.height,n=256;return[256,512].forEach(function(A){1e3>Math.ceil(e/A)*Math.ceil(t/A)&&(n=A)}),[n,n]}zs.isSupportTile=!!eo.createCanvas();var qs=function(){function A(){a(this,A)}return s(A,[{key:"apply",value:function(t){var e=t.renderingService,n=t.imagePool,r=t.renderingContext.root.ownerDocument.defaultView,i=function(A,t,e){var n=A.parsedStyle,r=n.width,i=n.height;r&&!i?A.setAttribute("height",e/t*r):!r&&i&&A.setAttribute("width",t/e*i)},a=function(A){var t=A.target,r=t.attributes;if(t.nodeName===le.IMAGE){var a=r.keepAspectRatio;n.getImageSync(r.src,t,function(A){var n=A.img;a&&i(t,n.width,n.height),t.dirty(),e.dirty()})}},o=function(A){var t=A.target,r=A.prevValue,a=A.newValue;t.nodeName===le.IMAGE&&"src"===A.attrName&&(r!==a&&n.releaseImage(r,t),GA(a)&&n.getOrCreateImage(a,t).then(function(A){var n=A.img;t.attributes.keepAspectRatio&&i(t,n.width,n.height),t.dirty(),e.dirty()}).catch(function(){}))};e.hooks.init.tap(A.tag,function(){r.addEventListener(oo.MOUNTED,a),r.addEventListener(oo.ATTR_MODIFIED,o)}),e.hooks.destroy.tap(A.tag,function(){r.removeEventListener(oo.MOUNTED,a),r.removeEventListener(oo.ATTR_MODIFIED,o)})}}])}();qs.tag="LoadImage";var $s=function(A){function t(){var A;a(this,t);for(var e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];return(A=B(this,t,[].concat(n))).name="image-loader",A}return p(t,A),s(t,[{key:"init",value:function(A){this.context.imagePool=new zs(this.context,A),this.addRenderingPlugin(new qs)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(de),Au=Object.freeze({__proto__:null,ImagePool:zs,Plugin:$s}),tu=function(){function A(){a(this,A),this.displayObjectHTMLElementMap=new WeakMap}return s(A,[{key:"joinTransformMatrix",value:function(A){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return"matrix(".concat([A[0],A[1],A[4],A[5],A[12]+t[0],A[13]+t[1]].join(","),")")}},{key:"apply",value:function(t,e){var n=this,r=t.camera,i=t.renderingContext,a=t.renderingService;this.context=t;var o=i.root.ownerDocument.defaultView,s=o.context.eventService.nativeHTMLMap,u=function(A,t){t.style.transform=n.joinTransformMatrix(A.getWorldTransform(),A.getOrigin())},c=function(A){var t=A.target;if(t.nodeName===le.HTML){n.$camera||(n.$camera=n.createCamera(r));var e=n.getOrCreateEl(t);n.$camera.appendChild(e),Object.keys(t.attributes).forEach(function(A){n.updateAttribute(A,t)}),u(t,e),s.set(e,t)}},l=function(A){var t=A.target;if(t.nodeName===le.HTML&&n.$camera){var e=n.getOrCreateEl(t);e&&(e.remove(),s.delete(e))}},h=function(A){var t=A.target;t.nodeName===le.HTML&&n.updateAttribute(A.attrName,t)},d=function(A){for(var t=A.detail,e=0;t.length>e;e++){var r=t[e].target;(r.nodeName===le.FRAGMENT?r.childNodes:[r]).forEach(function(A){if(A.nodeName===le.HTML){var t=n.getOrCreateEl(A);u(A,t)}})}},f=function(){if(n.$camera){var A=n.context.config,t=A.height;n.$camera.parentElement.style.width="".concat(A.width||0,"px"),n.$camera.parentElement.style.height="".concat(t||0,"px")}};a.hooks.init.tap(A.tag,function(){o.addEventListener(ks.RESIZE,f),o.addEventListener(oo.MOUNTED,c),o.addEventListener(oo.UNMOUNTED,l),o.addEventListener(oo.ATTR_MODIFIED,h),o.addEventListener(oo.BOUNDS_CHANGED,d)}),a.hooks.endFrame.tap(A.tag,function(){n.$camera&&i.renderReasons.has(no.CAMERA_CHANGED)&&(n.$camera.style.transform=n.joinTransformMatrix(r.getOrthoMatrix()))}),a.hooks.destroy.tap(A.tag,function(){n.$camera&&n.$camera.remove(),o.removeEventListener(ks.RESIZE,f),o.removeEventListener(oo.MOUNTED,c),o.removeEventListener(oo.UNMOUNTED,l),o.removeEventListener(oo.ATTR_MODIFIED,h),o.removeEventListener(oo.BOUNDS_CHANGED,d)})}},{key:"createCamera",value:function(A){var t=this.context.config,e=t.document,n=t.width,r=t.height,i=this.context.contextService.getDomElement(),a=i.parentNode;if(a){var o="g-canvas-camera",s=a.querySelector("#".concat(o));if(!s){var u=(e||document).createElement("div");u.style.overflow="hidden",u.style.pointerEvents="none",u.style.position="absolute",u.style.left="0px",u.style.top="0px",u.style.width="".concat(n||0,"px"),u.style.height="".concat(r||0,"px");var c=(e||document).createElement("div");s=c,c.id=o,c.style.position="absolute",c.style.left="".concat(i.offsetLeft||0,"px"),c.style.top="".concat(i.offsetTop||0,"px"),c.style.transformOrigin="left top",c.style.transform=this.joinTransformMatrix(A.getOrthoMatrix()),c.style.pointerEvents="none",c.style.width="100%",c.style.height="100%",u.appendChild(c),a.appendChild(u)}return s}return null}},{key:"getOrCreateEl",value:function(A){var t=this.context.config.document,e=this.displayObjectHTMLElementMap.get(A);return e||(e=(t||document).createElement("div"),A.parsedStyle.$el=e,this.displayObjectHTMLElementMap.set(A,e),A.id&&(e.id=A.id),A.name&&e.setAttribute("name",A.name),A.className&&(e.className=A.className),e.style.position="absolute",e.style["will-change"]="transform",e.style.transform=this.joinTransformMatrix(A.getWorldTransform(),A.getOrigin())),e}},{key:"updateAttribute",value:function(A,t){var e=this.getOrCreateEl(t);switch(A){case"innerHTML":var n=t.parsedStyle.innerHTML;GA(n)?e.innerHTML=n:(e.innerHTML="",e.appendChild(n));break;case"x":e.style.left="".concat(t.parsedStyle.x,"px");break;case"y":e.style.top="".concat(t.parsedStyle.y,"px");break;case"transformOrigin":var r=t.parsedStyle.transformOrigin;e.style["transform-origin"]="".concat(r[0].buildCSSText(null,null,"")," ").concat(r[1].buildCSSText(null,null,""));break;case"width":var i=t.parsedStyle.width;e.style.width=_A(i)?"".concat(i,"px"):""+i;break;case"height":var a=t.parsedStyle.height;e.style.height=_A(a)?"".concat(a,"px"):""+a;break;case"zIndex":e.style["z-index"]="".concat(t.parsedStyle.zIndex);break;case"visibility":e.style.visibility=t.parsedStyle.visibility;break;case"pointerEvents":var o=t.parsedStyle.pointerEvents;e.style.pointerEvents=void 0===o?"auto":o;break;case"opacity":e.style.opacity="".concat(t.parsedStyle.opacity);break;case"fill":var s=t.parsedStyle.fill,u="";br(s)?u=s.isNone?"transparent":t.getAttribute("fill"):Array.isArray(s)?u=t.getAttribute("fill"):Er(s),e.style.background=u;break;case"stroke":var c=t.parsedStyle.stroke,l="";br(c)?l=c.isNone?"transparent":t.getAttribute("stroke"):Array.isArray(c)?l=t.getAttribute("stroke"):Er(c),e.style["border-color"]=l,e.style["border-style"]="solid";break;case"lineWidth":e.style["border-width"]="".concat(t.parsedStyle.lineWidth||0,"px");break;case"lineDash":e.style["border-style"]="dashed";break;case"filter":e.style.filter=t.style.filter;break;default:DA(t.style[A])||""===t.style[A]||(e.style[A]=t.style[A])}}}])}();tu.tag="HTMLRendering";var eu=function(A){function t(){var A;a(this,t);for(var e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];return(A=B(this,t,[].concat(n))).name="html-renderer",A}return p(t,A),s(t,[{key:"init",value:function(){this.addRenderingPlugin(new tu)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(de),nu=Object.freeze({__proto__:null,Plugin:eu}),ru=function(){function A(){a(this,A)}return s(A,[{key:"apply",value:function(t,e){var n=this,r=t.renderingService,i=t.renderingContext,a=t.config;this.context=t;var o=i.root.ownerDocument.defaultView,s=function(A){r.hooks.pointerMove.call(A)},u=function(A){r.hooks.pointerUp.call(A)},c=function(A){r.hooks.pointerDown.call(A)},l=function(A){r.hooks.pointerOver.call(A)},h=function(A){r.hooks.pointerOut.call(A)},d=function(A){r.hooks.pointerCancel.call(A)},f=function(A){r.hooks.pointerWheel.call(A)},B=function(A){r.hooks.click.call(A)};r.hooks.init.tap(A.tag,function(){var A=n.context.contextService.getDomElement();e.globalThis.navigator.msPointerEnabled?(A.style.msContentZooming="none",A.style.msTouchAction="none"):o.supportsPointerEvents&&(A.style.touchAction="none"),o.supportsPointerEvents?function(A){e.globalThis.document.addEventListener("pointermove",s,!0),A.addEventListener("pointerdown",c,!0),A.addEventListener("pointerleave",h,!0),A.addEventListener("pointerover",l,!0),e.globalThis.addEventListener("pointerup",u,!0),e.globalThis.addEventListener("pointercancel",d,!0)}(A):function(A){e.globalThis.document.addEventListener("mousemove",s,!0),A.addEventListener("mousedown",c,!0),A.addEventListener("mouseout",h,!0),A.addEventListener("mouseover",l,!0),e.globalThis.addEventListener("mouseup",u,!0)}(A),o.supportsTouchEvents&&function(A){A.addEventListener("touchstart",c,!0),A.addEventListener("touchend",u,!0),A.addEventListener("touchmove",s,!0),A.addEventListener("touchcancel",d,!0)}(A),a.useNativeClickEvent&&A.addEventListener("click",B,!0),A.addEventListener("wheel",f,{passive:!0,capture:!0})}),r.hooks.destroy.tap(A.tag,function(){var A=n.context.contextService.getDomElement();e.globalThis.navigator.msPointerEnabled?(A.style.msContentZooming="",A.style.msTouchAction=""):o.supportsPointerEvents&&(A.style.touchAction=""),o.supportsPointerEvents?function(A){e.globalThis.document.removeEventListener("pointermove",s,!0),A.removeEventListener("pointerdown",c,!0),A.removeEventListener("pointerleave",h,!0),A.removeEventListener("pointerover",l,!0),e.globalThis.removeEventListener("pointerup",u,!0),e.globalThis.removeEventListener("pointercancel",d,!0)}(A):function(A){e.globalThis.document.removeEventListener("mousemove",s,!0),A.removeEventListener("mousedown",c,!0),A.removeEventListener("mouseout",h,!0),A.removeEventListener("mouseover",l,!0),e.globalThis.removeEventListener("mouseup",u,!0)}(A),o.supportsTouchEvents&&function(A){A.removeEventListener("touchstart",c,!0),A.removeEventListener("touchend",u,!0),A.removeEventListener("touchmove",s,!0),A.removeEventListener("touchcancel",d,!0)}(A),a.useNativeClickEvent&&A.removeEventListener("click",B,!0),A.removeEventListener("wheel",f,!0)})}}])}();ru.tag="DOMInteraction";var iu=function(A){function t(){var A;a(this,t);for(var e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];return(A=B(this,t,[].concat(n))).name="dom-interaction",A}return p(t,A),s(t,[{key:"init",value:function(){this.addRenderingPlugin(new ru)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(de),au=Object.freeze({__proto__:null,Plugin:iu}),ou=function(){function A(){a(this,A)}return s(A,[{key:"apply",value:function(t){var e=t.renderingService,n=t.config,r=t.contextService.getDomElement(),i=function(A){e.hooks.pointerDown.call(A)},a=function(A){e.hooks.pointerUp.call(A)},o=function(A){e.hooks.pointerMove.call(A)},s=function(A){e.hooks.pointerOver.call(A)},u=function(A){e.hooks.pointerOut.call(A)},c=function(A){e.hooks.click.call(A)},l=function(A){e.hooks.pointerCancel.call(A)};e.hooks.init.tap(A.tag,function(){r.addEventListener("touchstart",i,!0),r.addEventListener("touchend",a,!0),r.addEventListener("touchmove",o,!0),r.addEventListener("touchcancel",l,!0),r.addEventListener("mouseout",u,!0),r.addEventListener("mouseover",s,!0),n.useNativeClickEvent&&r.addEventListener("click",c,!0)}),e.hooks.destroy.tap(A.tag,function(){r.removeEventListener("touchstart",i,!0),r.removeEventListener("touchend",a,!0),r.removeEventListener("touchmove",o,!0),r.removeEventListener("touchcancel",l,!0),r.removeEventListener("mouseout",u,!0),r.removeEventListener("mouseover",s,!0),n.useNativeClickEvent&&r.removeEventListener("click",c,!0)})}}])}();ou.tag="MobileInteraction";var su=function(A){function t(){var A;a(this,t);for(var e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];return(A=B(this,t,[].concat(n))).name="mobile-interaction",A}return p(t,A),s(t,[{key:"init",value:function(){this.addRenderingPlugin(new ou)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(de),uu=Object.freeze({__proto__:null,Plugin:su}),cu=function(A){function t(A,e,n,r){var i;return a(this,t),(i=B(this,t,[A])).currentTime=n,i.timelineTime=r,i.target=e,i.type="finish",i.bubbles=!1,i.currentTarget=e,i.defaultPrevented=!1,i.eventPhase=i.AT_TARGET,i.timeStamp=Date.now(),i.currentTime=n,i.timelineTime=r,i}return p(t,A),s(t)}(Ja),lu=0,hu=function(){return s(function A(t,e){var n;a(this,A),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(lu++),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()},[{key:"pending",get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending}},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"ready",get:function(){var A=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise(function(t,e){A.resolveReadyPromise=function(){t(A)},A.rejectReadyPromise=function(){e(Error())}}),this.pending||this.resolveReadyPromise()),this.readyPromise}},{key:"finished",get:function(){var A=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise(function(t,e){A.resolveFinishedPromise=function(){t(A)},A.rejectFinishedPromise=function(){e(Error())}}),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(A){if(!isNaN(A=Number(A))){var t;if(this.timeline.restart(),!this._paused&&null!==this._startTime)this._startTime=Number(null===(t=this.timeline)||void 0===t?void 0:t.currentTime)-A/this.playbackRate;this.currentTimePending=!1,this._currentTime!==A&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(A,!0),this.timeline.applyDirtiedAnimation(this))}}},{key:"startTime",get:function(){return this._startTime},set:function(A){if(null!==A){if(this.updatePromises(),isNaN(A=Number(A)))return;if(this._paused||this._idle)return;this._startTime=A,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}}},{key:"playbackRate",get:function(){return this._playbackRate},set:function(A){if(A!==this._playbackRate){this.updatePromises();var t=this.currentTime;this._playbackRate=A,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==t&&(this.currentTime=t),this.updatePromises()}}},{key:"_isFinished",get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||0>this._playbackRate&&0>=Number(this._currentTime))}},{key:"totalDuration",get:function(){return this._totalDuration}},{key:"_needsTick",get:function(){return this.pending||"running"===this.playState||!this._finishedFlag}},{key:"updatePromises",value:function(){var A;if(null!==(A=this.effect.target)&&void 0!==A&&A.destroyed)return this.readyPromise=void 0,this.finishedPromise=void 0,!1;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}},{key:"play",value:function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()}},{key:"pause",value:function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()}},{key:"finish",value:function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())}},{key:"cancel",value:function(){var A=this;if(this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=null,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises(),this.oncancel)){var t=new cu(null,this,this.currentTime,null);setTimeout(function(){A.oncancel(t)})}}},{key:"reverse",value:function(){this.updatePromises();var A=this.currentTime;this.playbackRate*=-1,this.play(),null!==A&&(this.currentTime=A),this.updatePromises()}},{key:"updatePlaybackRate",value:function(A){this.playbackRate=A}},{key:"targetAnimations",value:function(){var A;return(null===(A=this.effect)||void 0===A?void 0:A.target).getAnimations()}},{key:"markTarget",value:function(){var A=this.targetAnimations();-1===A.indexOf(this)&&A.push(this)}},{key:"unmarkTarget",value:function(){var A=this.targetAnimations(),t=A.indexOf(this);-1!==t&&A.splice(t,1)}},{key:"tick",value:function(A,t){this._idle||this._paused||(null===this._startTime?t&&(this.startTime=A-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((A-this._startTime)*this.playbackRate)),t&&(this.currentTimePending=!1,this.fireEvents(A))}},{key:"rewind",value: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}},{key:"persist",value:function(){throw Error(be)}},{key:"addEventListener",value:function(A,t,e){throw Error(be)}},{key:"removeEventListener",value:function(A,t,e){throw Error(be)}},{key:"dispatchEvent",value:function(A){throw Error(be)}},{key:"commitStyles",value:function(){throw Error(be)}},{key:"ensureAlive",value:function(){var A,t;0>this.playbackRate&&0===this.currentTime?this._inEffect=!(null===(A=this.effect)||void 0===A||!A.update(-1)):this._inEffect=!(null===(t=this.effect)||void 0===t||!t.update(this.currentTime));this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))}},{key:"tickCurrentTime",value:function(A,t){A!==this._currentTime&&(this._currentTime=A,this._isFinished&&!t&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())}},{key:"fireEvents",value:function(A){var t=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var e=new cu(null,this,this.currentTime,A);setTimeout(function(){t.onfinish&&t.onfinish(e)})}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var n=new cu(null,this,this.currentTime,A);this.onframe(n)}this._finishedFlag=!1}}}])}(),du=.1,fu="function"==typeof Float32Array,Bu=function(A,t){return 1-3*t+3*A},gu=function(A,t){return 3*t-6*A},pu=function(A){return 3*A},vu=function(A,t,e){return((Bu(t,e)*A+gu(t,e))*A+pu(t))*A},wu=function(A,t,e){return 3*Bu(t,e)*A*A+2*gu(t,e)*A+pu(t)},yu=function(A,t,e,n){if(0>A||A>1||0>e||e>1)throw Error("bezier x values must be in [0, 1] range");if(A===t&&e===n)return function(A){return A};for(var r=fu?new Float32Array(11):[,,,,,,,,,,,],i=0;11>i;++i)r[i]=vu(i*du,A,e);var a=function(t){for(var n=0,i=1;10!==i&&t>=r[i];++i)n+=du;--i;var a=n+(t-r[i])/(r[i+1]-r[i])*du,o=wu(a,A,e);return.001>o?0===o?a:function(A,t,e,n,r){var i,a,o=0;do{(i=vu(a=t+(e-t)/2,n,r)-A)>0?e=a:t=a}while(Math.abs(i)>1e-7&&10>++o);return a}(t,n,n+du,A,e):function(A,t,e,n){for(var r=0;4>r;++r){var i=wu(t,e,n);if(0===i)return t;t-=(vu(t,e,n)-A)/i}return t}(t,a,A,e)};return function(A){return 0===A||1===A?A:vu(a(A),t,n)}},mu=function(A){return Math.pow(A,2)},Cu=function(A){return Math.pow(A,3)},Qu=function(A){return Math.pow(A,4)},Fu=function(A){return Math.pow(A,5)},Uu=function(A){return Math.pow(A,6)},Eu=function(A){return 1-Math.cos(A*Math.PI/2)},bu=function(A){return 1-Math.sqrt(1-A*A)},ku=function(A){return A*A*(3*A-2)},xu=function(A){for(var t,e=4;A<((t=Math.pow(2,--e))-1)/11;);return 1/Math.pow(4,3-e)-7.5625*Math.pow((3*t-2)/22-A,2)},Hu=function(A){var t=v(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],2),e=t[0],n=t[1],r=void 0===n?.5:n,i=VA(Number(void 0===e?1:e),1,10),a=VA(Number(r),.1,2);return 0===A||1===A?A:-i*Math.pow(2,10*(A-1))*Math.sin(2*Math.PI*(A-1-a/(2*Math.PI)*Math.asin(1/i))/a)},Iu=function(A){var t=arguments.length>2?arguments[2]:void 0,e=v(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],4),n=e[0],r=void 0===n?1:n,i=e[1],a=void 0===i?100:i,o=e[2],s=void 0===o?10:o,u=e[3],c=void 0===u?0:u;r=VA(r,.1,1e3),a=VA(a,.1,1e3),s=VA(s,.1,1e3),c=VA(c,.1,1e3);var l=Math.sqrt(a/r),h=s/(2*Math.sqrt(a*r)),d=1>h?l*Math.sqrt(1-h*h):0,f=1>h?(h*l-c)/d:-c+l,B=t?t*A/1e3:A;return B=1>h?Math.exp(-B*h*l)*(1*Math.cos(d*B)+f*Math.sin(d*B)):(1+f*B)*Math.exp(-B*l),0===A||1===A?A:1-B},Tu=function(A){var t=v(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],2),e=t[0],n=void 0===e?10:e;return("start"===t[1]?Math.ceil:Math.floor)(VA(A,0,1)*n)/n},Mu=function(A){var t=v(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],4);return yu(t[0],t[1],t[2],t[3])(A)},Su=yu(.42,0,1,1),Lu=function(A){return function(t){return 1-A(1-t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],arguments.length>2?arguments[2]:void 0)}},Du=function(A){return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;return.5>t?A(2*t,e,n)/2:1-A(-2*t+2,e,n)/2}},Pu=function(A){return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;return.5>t?(1-A(1-2*t,e,n))/2:(A(2*t-1,e,n)+1)/2}},Nu={steps:Tu,"step-start":function(A){return Tu(A,[1,"start"])},"step-end":function(A){return Tu(A,[1,"end"])},linear:function(A){return A},"cubic-bezier":Mu,ease:function(A){return Mu(A,[.25,.1,.25,1])},in:Su,out:Lu(Su),"in-out":Du(Su),"out-in":Pu(Su),"in-quad":mu,"out-quad":Lu(mu),"in-out-quad":Du(mu),"out-in-quad":Pu(mu),"in-cubic":Cu,"out-cubic":Lu(Cu),"in-out-cubic":Du(Cu),"out-in-cubic":Pu(Cu),"in-quart":Qu,"out-quart":Lu(Qu),"in-out-quart":Du(Qu),"out-in-quart":Pu(Qu),"in-quint":Fu,"out-quint":Lu(Fu),"in-out-quint":Du(Fu),"out-in-quint":Pu(Fu),"in-expo":Uu,"out-expo":Lu(Uu),"in-out-expo":Du(Uu),"out-in-expo":Pu(Uu),"in-sine":Eu,"out-sine":Lu(Eu),"in-out-sine":Du(Eu),"out-in-sine":Pu(Eu),"in-circ":bu,"out-circ":Lu(bu),"in-out-circ":Du(bu),"out-in-circ":Pu(bu),"in-back":ku,"out-back":Lu(ku),"in-out-back":Du(ku),"out-in-back":Pu(ku),"in-bounce":xu,"out-bounce":Lu(xu),"in-out-bounce":Du(xu),"out-in-bounce":Pu(xu),"in-elastic":Hu,"out-elastic":Lu(Hu),"in-out-elastic":Du(Hu),"out-in-elastic":Pu(Hu),spring:Iu,"spring-in":Iu,"spring-out":Lu(Iu),"spring-in-out":Du(Iu),"spring-out-in":Pu(Iu)},Ou=function(A){return A};function Ku(A,t){return function(e){if(e>=1)return 1;var n=1/A;return(e+=t*n)-e%n}}var Ru="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",Gu=RegExp("cubic-bezier\\(".concat(Ru,",").concat(Ru,",").concat(Ru,",").concat(Ru,"\\)")),Vu=/steps\(\s*(\d+)\s*\)/,_u=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Xu(A){var t=Gu.exec(A);if(t)return yu.apply(void 0,l(t.slice(1).map(Number)));var e=Vu.exec(A);if(e)return Ku(Number(e[1]),0);var n=_u.exec(A);return n?Ku(Number(n[1]),{start:1,middle:.5,end:0}[n[2]]):Nu[function(A){return function(A){return"-"===(A=A.replace(/([A-Z])/g,function(A){return"-".concat(A.toLowerCase())})).charAt(0)?A.substring(1):A}(A).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()}(A)]||Nu.linear}function Yu(A){return Math.abs(function(A){var t;if(0===A.duration||0===A.iterations)return 0;return("auto"===A.duration?0:Number(A.duration))*(null!==(t=A.iterations)&&void 0!==t?t:1)}(A)/(A.playbackRate||1))}function Wu(A,t,e){var n=function(A,t,e){if(null===t)return 0;var n=e.endTime;return Math.min(e.delay,n)>t?1:Math.min(e.delay+A+e.endDelay,n)>t?3:2}(A,t,e),r=function(A,t,e,n,r){switch(n){case 1:return"backwards"===t||"both"===t?0:null;case 3:return e-r;case 2:return"forwards"===t||"both"===t?A:null;case 0:return null}}(A,e.fill,t,n,e.delay);if(null===r)return null;var i="auto"===e.duration?0:e.duration,a=function(A,t,e,n,r){var i=r;return 0===A?1!==t&&(i+=e):i+=n/A,i}(i,n,e.iterations,r,e.iterationStart),o=function(A,t,e,n,r,i){var a=A===1/0?t%1:A%1;return 0!==a||2!==e||0===n||0===r&&0!==i||(a=1),a}(a,e.iterationStart,n,e.iterations,r,i),s=function(A,t,e,n){return 2===A&&t===1/0?1/0:1===e?Math.floor(n)-1:Math.floor(n)}(n,e.iterations,o,a),u=function(A,t,e){var n=A;if("normal"!==A&&"reverse"!==A){var r=t;"alternate-reverse"===A&&(r+=1),n="normal",r!==1/0&&r%2!=0&&(n="reverse")}return"normal"===n?e:1-e}(e.direction,s,o);return e.currentIteration=s,e.progress=u,e.easingFunction(u)}function Ju(A,t,e){var n=function(A,t){for(var e={},n=0;A.length>n;n++)for(var r in A[n])if(Zu(r)){var i={offset:A[n].offset,computedOffset:A[n].computedOffset,easing:A[n].easing,easingFunction:Xu(A[n].easing)||t.easingFunction,value:A[n][r]};e[r]=e[r]||[],e[r].push(i)}return e}(A,t),r=function(A,t){var e=[];for(var n in A)for(var r=A[n],i=0;r.length-1>i;i++){var a=i,o=i+1,s=r[a].computedOffset,u=r[o].computedOffset,c=s,l=u;0===i&&(c=-1/0,0===u&&(o=a)),i===r.length-2&&(l=1/0,1===s&&(a=o)),e.push({applyFrom:c,applyTo:l,startOffset:r[a].computedOffset,endOffset:r[o].computedOffset,easingFunction:r[a].easingFunction,property:n,interpolation:ju(n,r[a].value,r[o].value,t)})}return e.sort(function(A,t){return A.startOffset-t.startOffset}),e}(n,e);return function(A,t){if(null!==t)r.filter(function(A){return t>=A.applyFrom&&A.applyTo>t}).forEach(function(e){var n=e.endOffset-e.startOffset;A.setAttribute(e.property,e.interpolation(0===n?0:(t-e.startOffset)/n),!1,!1)});else for(var e in n)Zu(e)&&A.setAttribute(e,null)}}function Zu(A){return"offset"!==A&&"easing"!==A&&"composite"!==A&&"computedOffset"!==A}var zu=function(A,t,e){return function(n){var r=qu(A,t,n);return _A(r)?r:e(r)}};function ju(A,t,e,n){var r=Mi[A];if(r&&r.syntax&&r.int){var i=No.styleValueRegistry.getPropertySyntax(r.syntax);if(i){var a=i.parser,o=a?a(t,n):t,s=a?a(e,n):e,u=i.mixer(o,s,n);if(u){var c=zu.apply(void 0,l(u));return function(A){return 0===A?t:1===A?e:c(A)}}}}return zu(!1,!0,function(A){return A?e:t})}function qu(A,t,e){if("number"==typeof A&&"number"==typeof t)return A*(1-e)+t*e;if("boolean"==typeof A&&"boolean"==typeof t||"string"==typeof A&&"string"==typeof t)return.5>e?A:t;if(Array.isArray(A)&&Array.isArray(t)){for(var n=A.length,r=t.length,i=Math.max(n,r),a=[],o=0;i>o;o++)a.push(qu(A[n>o?o:n-1],t[r>o?o:r-1],e));return a}throw Error("Mismatched interpolation arguments ".concat(A,":").concat(t))}var $u=function(){return s(function A(){a(this,A),this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=Ou,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null},[{key:"easing",get:function(){return this._easing},set:function(A){this.easingFunction=Xu(A),this._easing=A}}])}();function Ac(A,t){if(null===A)return[];Array.isArray(A)||(A=function(A){var t=[];for(var e in A)if(!(e in["easing","offset","composite"])){var n=A[e];Array.isArray(n)||(n=[n]);for(var r=n.length,i=0;r>i;i++){if(!t[i]){var a={};"offset"in A&&(a.offset=Number(A.offset)),"easing"in A&&(a.easing=A.easing),"composite"in A&&(a.composite=A.composite),t[i]=a}null!=n[i]&&(t[i][e]=n[i])}}return t.sort(function(A,t){return(A.computedOffset||0)-(t.computedOffset||0)}),t}(A));for(var e=A.map(function(A){var e={};for(var n in null!=t&&t.composite&&(e.composite="auto"),A){var r=A[n];if("offset"===n){if(null!==r){if(!isFinite(r=Number(r)))throw Error("Keyframe offsets must be numbers.");if(0>r||r>1)throw Error("Keyframe offsets must be between 0 and 1.");e.computedOffset=r}}else if("composite"===n&&-1===["replace","add","accumulate","auto"].indexOf(r))throw Error("".concat(r," compositing is not supported"));e[n]=r}return void 0===e.offset&&(e.offset=null),void 0===e.easing&&(e.easing=(null==t?void 0:t.easing)||"linear"),void 0===e.composite&&(e.composite="auto"),e}),n=!0,r=-1/0,i=0;e.length>i;i++){var a=e[i].offset;if(DA(a))n=!1;else{if(r>a)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");r=a}}return e=e.filter(function(A){return Number(A.offset)>=0&&1>=Number(A.offset)}),n||function(){var A,t,n=e.length;e[n-1].computedOffset=Number(null!==(A=e[n-1].offset)&&void 0!==A?A:1),n>1&&(e[0].computedOffset=Number(null!==(t=e[0].offset)&&void 0!==t?t:0));for(var r=0,i=Number(e[0].computedOffset),a=1;n>a;a++){var o=e[a].computedOffset;if(!DA(o)&&!DA(i)){for(var s=1;a-r>s;s++)e[r+s].computedOffset=i+(Number(o)-i)*s/(a-r);r=a,i=Number(o)}}}(),e}var tc="backwards|forwards|both|none".split("|"),ec="reverse|alternate|alternate-reverse".split("|");function nc(A,t){var e=new $u;return t&&(e.fill="both",e.duration="auto"),"number"!=typeof A||isNaN(A)?void 0!==A&&Object.keys(A).forEach(function(t){if(null!=A[t]&&"auto"!==A[t]){if(("number"==typeof e[t]||"duration"===t)&&("number"!=typeof A[t]||isNaN(A[t])))return;if("fill"===t&&-1===tc.indexOf(A[t]))return;if("direction"===t&&-1===ec.indexOf(A[t]))return;e[t]=A[t]}}):e.duration=A,e}function rc(A,t){return nc(A=ic(null!=A?A:{duration:"auto"}),t)}function ic(A){return"number"==typeof A&&(A=isNaN(A)?{duration:"auto"}:{duration:A}),A}var ac=function(){return s(function A(t,e,n){var r=this;a(this,A),this.composite="replace",this.iterationComposite="replace",this.target=t,this.timing=rc(n,!1),this.timing.effect=this,this.timing.activeDuration=Yu(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=Ac(e,this.timing),this.interpolations=Ju(this.normalizedKeyframes,this.timing,this.target);var i=No.globalThis.Proxy;this.computedTiming=i?new i(this.timing,{get:function(A,t){return"duration"===t?"auto"===A.duration?0:A.duration:"fill"===t?"auto"===A.fill?"none":A.fill:"localTime"===t?r.animation&&r.animation.currentTime||null:"currentIteration"===t?r.animation&&"running"===r.animation.playState?A.currentIteration||0:null:"progress"===t?r.animation&&"running"===r.animation.playState?A.progress||0:null:A[t]},set:function(){return!0}}):this.timing},[{key:"applyInterpolations",value:function(){this.interpolations(this.target,Number(this.timeFraction))}},{key:"update",value:function(A){return null!==A&&(this.timeFraction=Wu(this.timing.activeDuration,A,this.timing),null!==this.timeFraction)}},{key:"getKeyframes",value:function(){return this.normalizedKeyframes}},{key:"setKeyframes",value:function(A){this.normalizedKeyframes=Ac(A)}},{key:"getComputedTiming",value:function(){return this.computedTiming}},{key:"getTiming",value:function(){return this.timing}},{key:"updateTiming",value:function(A){var t=this;Object.keys(A||{}).forEach(function(e){t.timing[e]=A[e]})}}])}();function oc(A,t){return Number(A.id)-Number(t.id)}var sc=function(){return s(function A(t){var e=this;a(this,A),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(A){e.currentTime=A,e.discardAnimations(),0===e.animations.length?e.timelineTicking=!1:e.requestAnimationFrame(e.webAnimationsNextTick)},this.processRafCallbacks=function(A){var t=e.rafCallbacks;e.rafCallbacks=[],Number(e.currentTime)>A&&(A=Number(e.currentTime)),e.animations.sort(oc),e.animations=e.tick(A,!0,e.animations)[0],t.forEach(function(t){t[1](A)}),e.applyPendingEffects()},this.document=t},[{key:"getAnimations",value:function(){return this.discardAnimations(),this.animations.slice()}},{key:"isTicking",value:function(){return this.inTick}},{key:"play",value:function(A,t,e){var n=new ac(A,t,e),r=new hu(n,this);return this.animations.push(r),this.restartWebAnimationsNextTick(),r.updatePromises(),r.play(),r.updatePromises(),r}},{key:"applyDirtiedAnimation",value:function(A){var t=this;if(!this.inTick){A.markTarget();var e=A.targetAnimations();e.sort(oc),this.tick(Number(this.currentTime),!1,e.slice())[1].forEach(function(A){var e=t.animations.indexOf(A);-1!==e&&t.animations.splice(e,1)}),this.applyPendingEffects()}}},{key:"restart",value:function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame(function(){}),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame}},{key:"destroy",value:function(){this.document.defaultView.cancelAnimationFrame(this.frameId)}},{key:"applyPendingEffects",value:function(){this.pendingEffects.forEach(function(A){null==A||A.applyInterpolations()}),this.pendingEffects=[]}},{key:"updateAnimationsPromises",value:function(){this.animationsWithPromises=this.animationsWithPromises.filter(function(A){return A.updatePromises()})}},{key:"discardAnimations",value:function(){this.updateAnimationsPromises(),this.animations=this.animations.filter(function(A){return"finished"!==A.playState&&"idle"!==A.playState})}},{key:"restartWebAnimationsNextTick",value:function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))}},{key:"rAF",value:function(A){var t=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([t,A]),t}},{key:"requestAnimationFrame",value:function(A){var t=this;return this.rAF(function(e){t.updateAnimationsPromises(),A(e),t.updateAnimationsPromises()})}},{key:"tick",value:function(A,t,e){var n,r,i=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=A,this.ticking=!1;var a=[],o=[],s=[],u=[];return e.forEach(function(e){e.tick(A,t),e._inEffect?(o.push(e.effect),e.markTarget()):(a.push(e.effect),e.unmarkTarget()),e._needsTick&&(i.ticking=!0);var n=e._inEffect||e._needsTick;e._inTimeline=n,n?s.push(e):u.push(e)}),(n=this.pendingEffects).push.apply(n,a),(r=this.pendingEffects).push.apply(r,o),this.ticking&&this.requestAnimationFrame(function(){}),this.inTick=!1,[s,u]}}])}();No.EasingFunction=Xu,No.AnimationTimeline=sc;var uc=function(A){function t(){var A;a(this,t);for(var e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];return(A=B(this,t,[].concat(n))).landmarks=[],A}return p(t,A),s(t,[{key:"rotate",value:function(A,t,e){if(this.relElevation=xe(t),this.relAzimuth=xe(A),this.relRoll=xe(e),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===We.EXPLORING){var n=UA(FA(),[1,0,0],Me((this.rotateWorld?1:-1)*this.relElevation)),r=UA(FA(),[0,1,0],Me((this.rotateWorld?1:-1)*this.relAzimuth)),i=UA(FA(),[0,0,1],Me(this.relRoll)),a=EA(FA(),r,n);a=EA(FA(),a,i);var o=J(F(),a);M(this.matrix,this.matrix,[0,0,-this.distance]),T(this.matrix,this.matrix,o),M(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===We.ORBITING||this.type===We.EXPLORING?this._getPosition():this.type===We.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(A,t){var e=Ie(A,t,0),n=rA(this.position);return uA(n,n,lA(nA(),this.right,e[0])),uA(n,n,lA(nA(),this.up,e[1])),this._setPosition(n),this.triggerUpdate(),this}},{key:"dolly",value:function(A){var t,e=this.forward,n=rA(this.position);return n[0]+=(t=Math.max(Math.min(this.distance+A*this.dollyingStep,this.maxDistance),this.minDistance)-this.distance)*e[0],n[1]+=t*e[1],n[2]+=t*e[2],this._setPosition(n),this.type===We.ORBITING||this.type===We.EXPLORING?this._getDistance():this.type===We.TRACKING&&uA(this.focalPoint,n,this.distanceVector),this.triggerUpdate(),this}},{key:"cancelLandmarkAnimation",value:function(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)}},{key:"createLandmark",value:function(A){var t,e,n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=i.position,o=void 0===a?this.position:a,s=i.focalPoint,u=void 0===s?this.focalPoint:s,c=i.roll,l=i.zoom,h=new No.CameraContribution;h.setType(this.type,void 0),h.setPosition(o[0],null!==(t=o[1])&&void 0!==t?t:this.position[1],null!==(e=o[2])&&void 0!==e?e:this.position[2]),h.setFocalPoint(u[0],null!==(n=u[1])&&void 0!==n?n:this.focalPoint[1],null!==(r=u[2])&&void 0!==r?r:this.focalPoint[2]),h.setRoll(null!=c?c:this.roll),h.setZoom(null!=l?l:this.zoom);var d={name:A,matrix:U(h.getWorldTransform()),right:rA(h.right),up:rA(h.up),forward:rA(h.forward),position:rA(h.getPosition()),focalPoint:rA(h.getFocalPoint()),distanceVector:rA(h.getDistanceVector()),distance:h.getDistance(),dollyingStep:h.getDollyingStep(),azimuth:h.getAzimuth(),elevation:h.getElevation(),roll:h.getRoll(),relAzimuth:h.relAzimuth,relElevation:h.relElevation,relRoll:h.relRoll,zoom:h.getZoom()};return this.landmarks.push(d),d}},{key:"gotoLandmark",value:function(A){var t=this,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=GA(A)?this.landmarks.find(function(t){return t.name===A}):A;if(n){var r=_A(e)?{duration:e}:e,i=r.easing,a=void 0===i?"linear":i,o=r.duration,s=void 0===o?100:o,u=r.easingFunction,c=void 0===u?void 0:u,l=r.onfinish,h=void 0===l?void 0:l,d=r.onframe,f=void 0===d?void 0:d;this.cancelLandmarkAnimation();var B,g=n.position,p=n.focalPoint,v=n.zoom,w=n.roll,y=c||No.EasingFunction(a),m=function(){t.setFocalPoint(p),t.setPosition(g),t.setRoll(w),t.setZoom(v),t.computeMatrix(),t.triggerUpdate(),null==h||h()};if(0===s)return m();var C=function(A){void 0===B&&(B=A);var e=A-B;if(s>e){var n,r,i=y(e/s),a=nA(),o=nA();if(BA(a,t.focalPoint,p,i),BA(o,t.position,g,i),r=t.roll*(1-i)+w*i,n=t.zoom*(1-i)+v*i,t.setFocalPoint(a),t.setPosition(o),t.setRoll(r),t.setZoom(n),.01>=wA(a,p)+wA(o,g)&&void 0===v&&void 0===w)return m();t.computeMatrix(),t.triggerUpdate(),s>e&&(null==f||f(i),t.landmarkAnimationID=t.canvas.requestAnimationFrame(C))}else m()};this.canvas.requestAnimationFrame(C)}}}])}(qe);No.CameraContribution=uc;
20
20
  /*!
21
21
  * html2canvas 1.4.1 <https://html2canvas.hertzen.com>
22
22
  * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>