You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

37 lines
288 KiB

/*!
* @antv/g
* @description A core module for rendering engine implements DOM API.
* @version 6.1.28
* @date 7/30/2025, 1:36:29 PM
* @author AntVis
* @docs https://g.antv.antgroup.com/
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G={})}(this,function(t){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function n(t){var n=function(t,n){if("object"!=e(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,n||"default");if("object"!=e(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==e(n)?n:n+""}function i(t,e,i){return(e=n(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function a(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach(function(e){i(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var i=0;e.length>i;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,n(r.key),r)}}function u(t,e,n){return e&&s(t.prototype,e),n&&s(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);e>n;n++)i[n]=t[n];return i}function c(t,e){if(t){if("string"==typeof t)return l(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(t,e):void 0}}function h(t){return function(t){if(Array.isArray(t))return l(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||c(t)||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 f(t){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},f(t)}function d(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(d=function(){return!!t})()}function v(t,n){if(n&&("object"==e(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function p(t,e,n){return e=f(e),v(t,d()?Reflect.construct(e,n||[],f(t).constructor):e.apply(t,n))}function m(t,e){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},m(t,e)}function y(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&m(t,e)}function g(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,a,o,s=[],u=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(i=a.call(n)).done)&&(s.push(i.value),s.length!==e);u=!0);}catch(t){l=!0,r=t}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw r}}return s}}(t,e)||c(t,e)||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 k={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,n="~";function i(){}function r(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function a(t,e,i,a,o){if("function"!=typeof i)throw new TypeError("The listener must be a function");var s=new r(i,a||t,o),u=n?n+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}function o(t,e){0===--t._eventsCount?t._events=new i:delete t._events[e]}function s(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,i,r=[];if(0===this._eventsCount)return r;for(i in t=this._events)e.call(t,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},s.prototype.listeners=function(t){var e=this._events[n?n+t:t];if(!e)return[];if(e.fn)return[e.fn];for(var i=0,r=e.length,a=Array(r);r>i;i++)a[i]=e[i].fn;return a},s.prototype.listenerCount=function(t){var e=this._events[n?n+t:t];return e?e.fn?1:e.length:0},s.prototype.emit=function(t,e,i,r,a,o){var s=n?n+t:t;if(!this._events[s])return!1;var u,l,c=this._events[s],h=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,i),!0;case 4:return c.fn.call(c.context,e,i,r),!0;case 5:return c.fn.call(c.context,e,i,r,a),!0;case 6:return c.fn.call(c.context,e,i,r,a,o),!0}for(l=1,u=Array(h-1);h>l;l++)u[l-1]=arguments[l];c.fn.apply(c.context,u)}else{var f,d=c.length;for(l=0;d>l;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),h){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,e);break;case 3:c[l].fn.call(c[l].context,e,i);break;case 4:c[l].fn.call(c[l].context,e,i,r);break;default:if(!u)for(f=1,u=Array(h-1);h>f;f++)u[f-1]=arguments[f];c[l].fn.apply(c[l].context,u)}}return!0},s.prototype.on=function(t,e,n){return a(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return a(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,i,r){var a=n?n+t:t;if(!this._events[a])return this;if(!e)return o(this,a),this;var s=this._events[a];if(s.fn)s.fn!==e||r&&!s.once||i&&s.context!==i||o(this,a);else{for(var u=0,l=[],c=s.length;c>u;u++)(s[u].fn!==e||r&&!s[u].once||i&&s[u].context!==i)&&l.push(s[u]);l.length?this._events[a]=1===l.length?l[0]:l:o(this,a)}return this},s.prototype.removeAllListeners=function(t){var e;return t?this._events[e=n?n+t:t]&&o(this,e):(this._events=new i,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s}(k);var E=k.exports,x=1e-6,b="undefined"!=typeof Float32Array?Float32Array:Array;function T(){var t=new b(9);return b!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function M(){var t=new b(16);return b!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function w(t){var e=new b(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function N(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function P(t,e,n,i,r,a,o,s,u,l,c,h,f,d,v,p,m){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t[4]=a,t[5]=o,t[6]=s,t[7]=u,t[8]=l,t[9]=c,t[10]=h,t[11]=f,t[12]=d,t[13]=v,t[14]=p,t[15]=m,t}function S(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function C(t,e){if(t===e){var n=e[1],i=e[2],r=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=a,t[11]=e[14],t[12]=r,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function A(t,e){var n=e[0],i=e[1],r=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=e[9],f=e[10],d=e[11],v=e[12],p=e[13],m=e[14],y=e[15],g=n*s-i*o,k=n*u-r*o,E=n*l-a*o,x=i*u-r*s,b=i*l-a*s,T=r*l-a*u,M=c*p-h*v,w=c*m-f*v,N=c*y-d*v,P=h*m-f*p,S=h*y-d*p,C=f*y-d*m,A=g*C-k*S+E*P+x*N-b*w+T*M;return A?(t[0]=(s*C-u*S+l*P)*(A=1/A),t[1]=(r*S-i*C-a*P)*A,t[2]=(p*T-m*b+y*x)*A,t[3]=(f*b-h*T-d*x)*A,t[4]=(u*N-o*C-l*w)*A,t[5]=(n*C-r*N+a*w)*A,t[6]=(m*E-v*T-y*k)*A,t[7]=(c*T-f*E+d*k)*A,t[8]=(o*S-s*N+l*M)*A,t[9]=(i*N-n*S-a*M)*A,t[10]=(v*b-p*E+y*g)*A,t[11]=(h*E-c*b-d*g)*A,t[12]=(s*w-o*P-u*M)*A,t[13]=(n*P-i*w+r*M)*A,t[14]=(p*k-v*x-m*g)*A,t[15]=(c*x-h*k+f*g)*A,t):null}function R(t){var e=t[0],n=t[1],i=t[2],r=t[3],a=t[4],o=t[5],s=t[6],u=t[7],l=t[8],c=t[9],h=t[10],f=t[11],d=t[12],v=t[13],p=t[14],m=t[15];return(e*o-n*a)*(h*m-f*p)-(e*s-i*a)*(c*m-f*v)+(e*u-r*a)*(c*p-h*v)+(n*s-i*o)*(l*m-f*d)-(n*u-r*o)*(l*p-h*d)+(i*u-r*s)*(l*v-c*d)}function O(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],f=e[9],d=e[10],v=e[11],p=e[12],m=e[13],y=e[14],g=e[15],k=n[0],E=n[1],x=n[2],b=n[3];return t[0]=k*i+E*s+x*h+b*p,t[1]=k*r+E*u+x*f+b*m,t[2]=k*a+E*l+x*d+b*y,t[3]=k*o+E*c+x*v+b*g,t[4]=(k=n[4])*i+(E=n[5])*s+(x=n[6])*h+(b=n[7])*p,t[5]=k*r+E*u+x*f+b*m,t[6]=k*a+E*l+x*d+b*y,t[7]=k*o+E*c+x*v+b*g,t[8]=(k=n[8])*i+(E=n[9])*s+(x=n[10])*h+(b=n[11])*p,t[9]=k*r+E*u+x*f+b*m,t[10]=k*a+E*l+x*d+b*y,t[11]=k*o+E*c+x*v+b*g,t[12]=(k=n[12])*i+(E=n[13])*s+(x=n[14])*h+(b=n[15])*p,t[13]=k*r+E*u+x*f+b*m,t[14]=k*a+E*l+x*d+b*y,t[15]=k*o+E*c+x*v+b*g,t}function L(t,e,n){var i,r,a,o,s,u,l,c,h,f,d,v,p=n[0],m=n[1],y=n[2];return e===t?(t[12]=e[0]*p+e[4]*m+e[8]*y+e[12],t[13]=e[1]*p+e[5]*m+e[9]*y+e[13],t[14]=e[2]*p+e[6]*m+e[10]*y+e[14],t[15]=e[3]*p+e[7]*m+e[11]*y+e[15]):(r=e[1],a=e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],f=e[9],d=e[10],v=e[11],t[0]=i=e[0],t[1]=r,t[2]=a,t[3]=o,t[4]=s,t[5]=u,t[6]=l,t[7]=c,t[8]=h,t[9]=f,t[10]=d,t[11]=v,t[12]=i*p+s*m+h*y+e[12],t[13]=r*p+u*m+f*y+e[13],t[14]=a*p+l*m+d*y+e[14],t[15]=o*p+c*m+v*y+e[15]),t}function I(t,e,n){var i=Math.sin(n),r=Math.cos(n),a=e[4],o=e[5],s=e[6],u=e[7],l=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*r+l*i,t[5]=o*r+c*i,t[6]=s*r+h*i,t[7]=u*r+f*i,t[8]=l*r-a*i,t[9]=c*r-o*i,t[10]=h*r-s*i,t[11]=f*r-u*i,t}function _(t,e,n){var i=Math.sin(n),r=Math.cos(n),a=e[0],o=e[1],s=e[2],u=e[3],l=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*r-l*i,t[1]=o*r-c*i,t[2]=s*r-h*i,t[3]=u*r-f*i,t[8]=a*i+l*r,t[9]=o*i+c*r,t[10]=s*i+h*r,t[11]=u*i+f*r,t}function D(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function F(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function G(t,e,n){var i,r,a,o=n[0],s=n[1],u=n[2],l=Math.hypot(o,s,u);return x>l?null:(o*=l=1/l,s*=l,u*=l,i=Math.sin(e),t[0]=o*o*(a=1-(r=Math.cos(e)))+r,t[1]=s*o*a+u*i,t[2]=u*o*a-s*i,t[3]=0,t[4]=o*s*a-u*i,t[5]=s*s*a+r,t[6]=u*s*a+o*i,t[7]=0,t[8]=o*u*a+s*i,t[9]=s*u*a-o*i,t[10]=u*u*a+r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function B(t,e){var n=Math.sin(e),i=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function V(t,e){var n=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function U(t,e){var n=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=i,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Y(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[3],s=i+i,u=r+r,l=a+a,c=i*s,h=i*u,f=i*l,d=r*u,v=r*l,p=a*l,m=o*s,y=o*u,g=o*l;return t[0]=1-(d+p),t[1]=h+g,t[2]=f-y,t[3]=0,t[4]=h-g,t[5]=1-(c+p),t[6]=v+m,t[7]=0,t[8]=f+y,t[9]=v-m,t[10]=1-(c+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function z(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function j(t,e){var n=e[4],i=e[5],r=e[6],a=e[8],o=e[9],s=e[10];return t[0]=Math.hypot(e[0],e[1],e[2]),t[1]=Math.hypot(n,i,r),t[2]=Math.hypot(a,o,s),t}function X(t,e){var n=new b(3);j(n,e);var i=1/n[0],r=1/n[1],a=1/n[2],o=e[0]*i,s=e[1]*r,u=e[2]*a,l=e[4]*i,c=e[5]*r,h=e[6]*a,f=e[8]*i,d=e[9]*r,v=e[10]*a,p=o+c+v,m=0;return p>0?(t[3]=.25*(m=2*Math.sqrt(p+1)),t[0]=(h-d)/m,t[1]=(f-u)/m,t[2]=(s-l)/m):o>c&&o>v?(t[3]=(h-d)/(m=2*Math.sqrt(1+o-c-v)),t[0]=.25*m,t[1]=(s+l)/m,t[2]=(f+u)/m):c>v?(t[3]=(f-u)/(m=2*Math.sqrt(1+c-o-v)),t[0]=(s+l)/m,t[1]=.25*m,t[2]=(h+d)/m):(t[3]=(s-l)/(m=2*Math.sqrt(1+v-o-c)),t[0]=(f+u)/m,t[1]=(h+d)/m,t[2]=.25*m),t}function H(t,e,n,i,r){var a=e[0],o=e[1],s=e[2],u=e[3],l=a+a,c=o+o,h=s+s,f=a*l,d=a*c,v=a*h,p=o*c,m=o*h,y=s*h,g=u*l,k=u*c,E=u*h,x=i[0],b=i[1],T=i[2],M=r[0],w=r[1],N=r[2],P=(1-(p+y))*x,S=(d+E)*x,C=(v-k)*x,A=(d-E)*b,R=(1-(f+y))*b,O=(m+g)*b,L=(v+k)*T,I=(m-g)*T,_=(1-(f+p))*T;return t[0]=P,t[1]=S,t[2]=C,t[3]=0,t[4]=A,t[5]=R,t[6]=O,t[7]=0,t[8]=L,t[9]=I,t[10]=_,t[11]=0,t[12]=n[0]+M-(P*M+A*w+L*N),t[13]=n[1]+w-(S*M+R*w+I*N),t[14]=n[2]+N-(C*M+O*w+_*N),t[15]=1,t}function W(t,e){var n=e[0],i=e[1],r=e[2],a=e[3],o=n+n,s=i+i,u=r+r,l=n*o,c=i*o,h=i*s,f=r*o,d=r*s,v=r*u,p=a*o,m=a*s,y=a*u;return t[0]=1-h-v,t[1]=c+y,t[2]=f-m,t[3]=0,t[4]=c-y,t[5]=1-l-v,t[6]=d+p,t[7]=0,t[8]=f+m,t[9]=d-p,t[10]=1-l-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function q(t,e,n,i,r){var a,o=1/Math.tan(e/2);return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=r&&r!==1/0?(t[10]=(r+i)*(a=1/(i-r)),t[14]=2*r*i*a):(t[10]=-1,t[14]=-2*i),t}function Z(t,e,n,i,r,a,o){var s=1/(e-n),u=1/(i-r),l=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+n)*s,t[13]=(r+i)*u,t[14]=(o+a)*l,t[15]=1,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var K=Z;function Q(t,e,n,i,r,a,o){var s=1/(e-n),u=1/(i-r),l=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=l,t[11]=0,t[12]=(e+n)*s,t[13]=(r+i)*u,t[14]=a*l,t[15]=1,t}function $(t,e,n,i){var r,a,o,s,u,l,c,h,f,d,v=e[0],p=e[1],m=e[2],y=i[0],g=i[1],k=i[2],E=n[0],b=n[1],T=n[2];return x>Math.abs(v-E)&&x>Math.abs(p-b)&&x>Math.abs(m-T)?S(t):(d=1/Math.hypot(c=v-E,h=p-b,f=m-T),(d=Math.hypot(r=g*(f*=d)-k*(h*=d),a=k*(c*=d)-y*f,o=y*h-g*c))?(r*=d=1/d,a*=d,o*=d):(r=0,a=0,o=0),(d=Math.hypot(s=h*o-f*a,u=f*r-c*o,l=c*a-h*r))?(s*=d=1/d,u*=d,l*=d):(s=0,u=0,l=0),t[0]=r,t[1]=s,t[2]=c,t[3]=0,t[4]=a,t[5]=u,t[6]=h,t[7]=0,t[8]=o,t[9]=l,t[10]=f,t[11]=0,t[12]=-(r*v+a*p+o*m),t[13]=-(s*v+u*p+l*m),t[14]=-(c*v+h*p+f*m),t[15]=1,t)}function J(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}var tt=O,et=Object.freeze({__proto__:null,add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},adjoint:function(t,e){var n=e[0],i=e[1],r=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=e[9],f=e[10],d=e[11],v=e[12],p=e[13],m=e[14],y=e[15];return t[0]=s*(f*y-d*m)-h*(u*y-l*m)+p*(u*d-l*f),t[1]=-(i*(f*y-d*m)-h*(r*y-a*m)+p*(r*d-a*f)),t[2]=i*(u*y-l*m)-s*(r*y-a*m)+p*(r*l-a*u),t[3]=-(i*(u*d-l*f)-s*(r*d-a*f)+h*(r*l-a*u)),t[4]=-(o*(f*y-d*m)-c*(u*y-l*m)+v*(u*d-l*f)),t[5]=n*(f*y-d*m)-c*(r*y-a*m)+v*(r*d-a*f),t[6]=-(n*(u*y-l*m)-o*(r*y-a*m)+v*(r*l-a*u)),t[7]=n*(u*d-l*f)-o*(r*d-a*f)+c*(r*l-a*u),t[8]=o*(h*y-d*p)-c*(s*y-l*p)+v*(s*d-l*h),t[9]=-(n*(h*y-d*p)-c*(i*y-a*p)+v*(i*d-a*h)),t[10]=n*(s*y-l*p)-o*(i*y-a*p)+v*(i*l-a*s),t[11]=-(n*(s*d-l*h)-o*(i*d-a*h)+c*(i*l-a*s)),t[12]=-(o*(h*m-f*p)-c*(s*m-u*p)+v*(s*f-u*h)),t[13]=n*(h*m-f*p)-c*(i*m-r*p)+v*(i*f-r*h),t[14]=-(n*(s*m-u*p)-o*(i*m-r*p)+v*(i*u-r*s)),t[15]=n*(s*f-u*h)-o*(i*f-r*h)+c*(i*u-r*s),t},clone:w,copy:N,create:M,determinant:R,equals:function(t,e){var n=t[0],i=t[1],r=t[2],a=t[3],o=t[4],s=t[5],u=t[6],l=t[7],c=t[8],h=t[9],f=t[10],d=t[11],v=t[12],p=t[13],m=t[14],y=t[15],g=e[0],k=e[1],E=e[2],b=e[3],T=e[4],M=e[5],w=e[6],N=e[7],P=e[8],S=e[9],C=e[10],A=e[11],R=e[12],O=e[13],L=e[14],I=e[15];return!(Math.abs(n-g)>x*Math.max(1,Math.abs(n),Math.abs(g))||Math.abs(i-k)>x*Math.max(1,Math.abs(i),Math.abs(k))||Math.abs(r-E)>x*Math.max(1,Math.abs(r),Math.abs(E))||Math.abs(a-b)>x*Math.max(1,Math.abs(a),Math.abs(b))||Math.abs(o-T)>x*Math.max(1,Math.abs(o),Math.abs(T))||Math.abs(s-M)>x*Math.max(1,Math.abs(s),Math.abs(M))||Math.abs(u-w)>x*Math.max(1,Math.abs(u),Math.abs(w))||Math.abs(l-N)>x*Math.max(1,Math.abs(l),Math.abs(N))||Math.abs(c-P)>x*Math.max(1,Math.abs(c),Math.abs(P))||Math.abs(h-S)>x*Math.max(1,Math.abs(h),Math.abs(S))||Math.abs(f-C)>x*Math.max(1,Math.abs(f),Math.abs(C))||Math.abs(d-A)>x*Math.max(1,Math.abs(d),Math.abs(A))||Math.abs(v-R)>x*Math.max(1,Math.abs(v),Math.abs(R))||Math.abs(p-O)>x*Math.max(1,Math.abs(p),Math.abs(O))||Math.abs(m-L)>x*Math.max(1,Math.abs(m),Math.abs(L))||Math.abs(y-I)>x*Math.max(1,Math.abs(y),Math.abs(I)))},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},fromQuat:W,fromQuat2:function(t,e){var n=new b(3),i=-e[0],r=-e[1],a=-e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=i*i+r*r+a*a+o*o;return h>0?(n[0]=2*(s*o+c*i+u*a-l*r)/h,n[1]=2*(u*o+c*r+l*i-s*a)/h,n[2]=2*(l*o+c*a+s*r-u*i)/h):(n[0]=2*(s*o+c*i+u*a-l*r),n[1]=2*(u*o+c*r+l*i-s*a),n[2]=2*(l*o+c*a+s*r-u*i)),Y(t,e,n),t},fromRotation:G,fromRotationTranslation:Y,fromRotationTranslationScale:function(t,e,n,i){var r=e[0],a=e[1],o=e[2],s=e[3],u=r+r,l=a+a,c=o+o,h=r*u,f=r*l,d=r*c,v=a*l,p=a*c,m=o*c,y=s*u,g=s*l,k=s*c,E=i[0],x=i[1],b=i[2];return t[0]=(1-(v+m))*E,t[1]=(f+k)*E,t[2]=(d-g)*E,t[3]=0,t[4]=(f-k)*x,t[5]=(1-(h+m))*x,t[6]=(p+y)*x,t[7]=0,t[8]=(d+g)*b,t[9]=(p-y)*b,t[10]=(1-(h+v))*b,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:H,fromScaling:F,fromTranslation:D,fromValues:function(t,e,n,i,r,a,o,s,u,l,c,h,f,d,v,p){var m=new b(16);return m[0]=t,m[1]=e,m[2]=n,m[3]=i,m[4]=r,m[5]=a,m[6]=o,m[7]=s,m[8]=u,m[9]=l,m[10]=c,m[11]=h,m[12]=f,m[13]=d,m[14]=v,m[15]=p,m},fromXRotation:B,fromYRotation:V,fromZRotation:U,frustum:function(t,e,n,i,r,a,o){var s=1/(n-e),u=1/(r-i),l=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*u,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(r+i)*u,t[10]=(o+a)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*l,t[15]=0,t},getRotation:X,getScaling:j,getTranslation:z,identity:S,invert:A,lookAt:$,mul:tt,multiply:O,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t[3]=e[3]+n[3]*i,t[4]=e[4]+n[4]*i,t[5]=e[5]+n[5]*i,t[6]=e[6]+n[6]*i,t[7]=e[7]+n[7]*i,t[8]=e[8]+n[8]*i,t[9]=e[9]+n[9]*i,t[10]=e[10]+n[10]*i,t[11]=e[11]+n[11]*i,t[12]=e[12]+n[12]*i,t[13]=e[13]+n[13]*i,t[14]=e[14]+n[14]*i,t[15]=e[15]+n[15]*i,t},ortho:K,orthoNO:Z,orthoZO:Q,perspective:q,perspectiveFromFieldOfView:function(t,e,n,i){var r=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(o+s),l=2/(r+a);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(o-s)*u*.5,t[9]=(r-a)*l*.5,t[10]=i/(n-i),t[11]=-1,t[12]=0,t[13]=0,t[14]=i*n/(n-i),t[15]=0,t},perspectiveNO:q,perspectiveZO:function(t,e,n,i,r){var a,o=1/Math.tan(e/2);return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=r&&r!==1/0?(t[10]=r*(a=1/(i-r)),t[14]=r*i*a):(t[10]=-1,t[14]=-i),t},rotate:function(t,e,n,i){var r,a,o,s,u,l,c,h,f,d,v,p,m,y,g,k,E,b,T,M,w,N,P,S,C=i[0],A=i[1],R=i[2],O=Math.hypot(C,A,R);return x>O?null:(C*=O=1/O,A*=O,R*=O,r=Math.sin(n),u=e[1],l=e[2],c=e[3],f=e[5],d=e[6],v=e[7],m=e[9],y=e[10],g=e[11],T=C*A*(o=1-(a=Math.cos(n)))-R*r,M=A*A*o+a,w=R*A*o+C*r,N=C*R*o+A*r,P=A*R*o-C*r,S=R*R*o+a,t[0]=(s=e[0])*(k=C*C*o+a)+(h=e[4])*(E=A*C*o+R*r)+(p=e[8])*(b=R*C*o-A*r),t[1]=u*k+f*E+m*b,t[2]=l*k+d*E+y*b,t[3]=c*k+v*E+g*b,t[4]=s*T+h*M+p*w,t[5]=u*T+f*M+m*w,t[6]=l*T+d*M+y*w,t[7]=c*T+v*M+g*w,t[8]=s*N+h*P+p*S,t[9]=u*N+f*P+m*S,t[10]=l*N+d*P+y*S,t[11]=c*N+v*P+g*S,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:I,rotateY:_,rotateZ:function(t,e,n){var i=Math.sin(n),r=Math.cos(n),a=e[0],o=e[1],s=e[2],u=e[3],l=e[4],c=e[5],h=e[6],f=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*r+l*i,t[1]=o*r+c*i,t[2]=s*r+h*i,t[3]=u*r+f*i,t[4]=l*r-a*i,t[5]=c*r-o*i,t[6]=h*r-s*i,t[7]=f*r-u*i,t},scale:function(t,e,n){var i=n[0],r=n[1],a=n[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},set:P,str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},sub:J,subtract:J,targetTo:function(t,e,n,i){var r=e[0],a=e[1],o=e[2],s=i[0],u=i[1],l=i[2],c=r-n[0],h=a-n[1],f=o-n[2],d=c*c+h*h+f*f;d>0&&(c*=d=1/Math.sqrt(d),h*=d,f*=d);var v=u*f-l*h,p=l*c-s*f,m=s*h-u*c;return(d=v*v+p*p+m*m)>0&&(v*=d=1/Math.sqrt(d),p*=d,m*=d),t[0]=v,t[1]=p,t[2]=m,t[3]=0,t[4]=h*m-f*p,t[5]=f*v-c*m,t[6]=c*p-h*v,t[7]=0,t[8]=c,t[9]=h,t[10]=f,t[11]=0,t[12]=r,t[13]=a,t[14]=o,t[15]=1,t},translate:L,transpose:C});function nt(){var t=new b(3);return b!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function it(t){var e=new b(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function rt(t){return Math.hypot(t[0],t[1],t[2])}function at(t,e,n){var i=new b(3);return i[0]=t,i[1]=e,i[2]=n,i}function ot(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function st(t,e,n,i){return t[0]=e,t[1]=n,t[2]=i,t}function ut(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function lt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function ct(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function ht(t,e){var n=e[0],i=e[1],r=e[2],a=n*n+i*i+r*r;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}function ft(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function dt(t,e,n){var i=e[0],r=e[1],a=e[2],o=n[0],s=n[1],u=n[2];return t[0]=r*u-a*s,t[1]=a*o-i*u,t[2]=i*s-r*o,t}function vt(t,e,n,i){var r=e[0],a=e[1],o=e[2];return t[0]=r+i*(n[0]-r),t[1]=a+i*(n[1]-a),t[2]=o+i*(n[2]-o),t}function pt(t,e,n){var i=e[0],r=e[1],a=e[2],o=n[3]*i+n[7]*r+n[11]*a+n[15];return t[0]=(n[0]*i+n[4]*r+n[8]*a+n[12])/(o=o||1),t[1]=(n[1]*i+n[5]*r+n[9]*a+n[13])/o,t[2]=(n[2]*i+n[6]*r+n[10]*a+n[14])/o,t}function mt(t,e){var n=t[0],i=t[1],r=t[2],a=e[0],o=e[1],s=e[2];return x*Math.max(1,Math.abs(n),Math.abs(a))>=Math.abs(n-a)&&x*Math.max(1,Math.abs(i),Math.abs(o))>=Math.abs(i-o)&&x*Math.max(1,Math.abs(r),Math.abs(s))>=Math.abs(r-s)}var yt=lt,gt=function(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1],e[2]-t[2])},kt=rt;function Et(){var t=new b(4);return b!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function xt(t,e,n,i){var r=new b(4);return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r}function bt(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[3];return t[0]=n[0]*i+n[4]*r+n[8]*a+n[12]*o,t[1]=n[1]*i+n[5]*r+n[9]*a+n[13]*o,t[2]=n[2]*i+n[6]*r+n[10]*a+n[14]*o,t[3]=n[3]*i+n[7]*r+n[11]*a+n[15]*o,t}function Tt(){var t=new b(4);return b!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Mt(t,e,n){var i=Math.sin(n*=.5);return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=Math.cos(n),t}function wt(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[3],s=n[0],u=n[1],l=n[2],c=n[3];return t[0]=i*c+o*s+r*l-a*u,t[1]=r*c+o*u+a*s-i*l,t[2]=a*c+o*l+i*u-r*s,t[3]=o*c-i*s-r*u-a*l,t}function Nt(t,e){var n=e[0],i=e[1],r=e[2],a=e[3],o=n*n+i*i+r*r+a*a,s=o?1/o:0;return t[0]=-n*s,t[1]=-i*s,t[2]=-r*s,t[3]=a*s,t}function Pt(t,e,n,i){var r=.5*Math.PI/180;n*=r,i*=r;var a=Math.sin(e*=r),o=Math.cos(e),s=Math.sin(n),u=Math.cos(n),l=Math.sin(i),c=Math.cos(i);return t[0]=a*u*c-o*s*l,t[1]=o*s*c+a*u*l,t[2]=o*u*l-a*s*c,t[3]=o*u*c+a*s*l,t}nt(),function(){var t=Et()}();var St=xt,Ct=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},At=function(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t},Rt=wt,Ot=function(t,e){var n=e[0],i=e[1],r=e[2],a=e[3],o=n*n+i*i+r*r+a*a;return o>0&&(o=1/Math.sqrt(o)),t[0]=n*o,t[1]=i*o,t[2]=r*o,t[3]=a*o,t};function Lt(){var t=new b(2);return b!=Float32Array&&(t[0]=0,t[1]=0),t}function It(t){return"function"==typeof t}function _t(t){return null==t}function Dt(t){return Array.isArray(t)}nt(),at(1,0,0),at(0,1,0),Tt(),Tt(),T(),function(){var t=Lt()}();var Ft={}.toString,Gt=function(t,e){return Ft.call(t)==="[object "+e+"]"};function Bt(t){if(!Array.isArray(t))return-1/0;var e=t.length;if(!e)return-1/0;for(var n=t[0],i=1;e>i;i++)n=Math.max(n,t[i]);return n}var Vt=function(t){if(Dt(t))return t.reduce(function(t,e){return Math.min(t,e)},t[0])};function Ut(t){return"string"==typeof t}var Yt=function(t,e,n){return e>t?e:t>n?n:t};function zt(t){return"number"==typeof t}function jt(t,e,n){return void 0===n&&(n=1e-5),t===e||n>Math.abs(t-e)}var Xt=function(t,e){return(t%e+e)%e},Ht=function(t){return Gt(t,"Boolean")},Wt=function(t){return void 0===t},qt=function(){return qt=Object.assign||function(t){for(var e,n=1,i=arguments.length;i>n;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},qt.apply(this,arguments)};function Zt(t,e,n){if(n||2===arguments.length)for(var i,r=0,a=e.length;a>r;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var Kt={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function Qt(t,e,n){if(t[n].length>7){t[n].shift();for(var i=t[n],r=n;i.length;)e[n]="A",t.splice(r+=1,0,["C"].concat(i.splice(0,6)));t.splice(n,1)}}var $t={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Jt(t){return Array.isArray(t)&&t.every(function(t){var e=t[0].toLowerCase();return $t[e]===t.length-1&&"achlmqstvz".includes(e)})}function te(t){return Jt(t)&&t.every(function(t){var e=t[0];return e===e.toUpperCase()})}function ee(t){return te(t)&&t.every(function(t){return"ACLMQZ".includes(t[0])})}function ne(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),i=t.data;i.length>=$t[n]&&("m"===n&&i.length>2?(t.segments.push([e].concat(i.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(i.splice(0,$t[n]))),$t[n]););}function ie(t){var e=t.index,n=t.pathValue,i=n.charCodeAt(e);return 48===i?(t.param=0,void(t.index+=1)):49===i?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'.concat(n[e],'", expecting 0 or 1 at index ').concat(e))}function re(t){return t>=48&&57>=t||43===t||45===t||46===t}function ae(t){return t>=48&&57>=t}function oe(t){var e,n=t.max,i=t.pathValue,r=t.index,a=r,o=!1,s=!1,u=!1,l=!1;if(n>a)if(43!==(e=i.charCodeAt(a))&&45!==e||(e=i.charCodeAt(a+=1)),ae(e)||46===e){if(46!==e){if(o=48===e,e=i.charCodeAt(a+=1),o&&n>a&&e&&ae(e))return void(t.err="[path-util]: Invalid path value at index ".concat(r,', "').concat(i[r],'" illegal number'));for(;n>a&&ae(i.charCodeAt(a));)a+=1,s=!0;e=i.charCodeAt(a)}if(46===e){for(l=!0,a+=1;ae(i.charCodeAt(a));)a+=1,u=!0;e=i.charCodeAt(a)}if(101===e||69===e){if(l&&!s&&!u)return void(t.err="[path-util]: Invalid path value at index ".concat(a,', "').concat(i[a],'" invalid float exponent'));if(43!==(e=i.charCodeAt(a+=1))&&45!==e||(a+=1),a>=n||!ae(i.charCodeAt(a)))return void(t.err="[path-util]: Invalid path value at index ".concat(a,', "').concat(i[a],'" invalid integer exponent'));for(;n>a&&ae(i.charCodeAt(a));)a+=1}t.index=a,t.param=+t.pathValue.slice(r,a)}else t.err="[path-util]: Invalid path value at index ".concat(a,', "').concat(i[a],'" is not a number');else t.err="[path-util]: Invalid path value at index ".concat(a,', "pathValue" is missing param')}function se(t){return 10===t||13===t||8232===t||8233===t||32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(t)}function ue(t){for(var e=t.pathValue,n=t.max;n>t.index&&se(e.charCodeAt(t.index));)t.index+=1}function le(t){return 97==(32|t)}function ce(t){var e=t.max,n=t.pathValue,i=t.index,r=n.charCodeAt(i),a=$t[n[i].toLowerCase()];if(t.segmentStart=i,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}(r))if(t.index+=1,ue(t),t.data=[],a){for(;;){for(var o=a;o>0;o-=1){if(!le(r)||3!==o&&4!==o?oe(t):ie(t),t.err.length)return;t.data.push(t.param),ue(t),e>t.index&&44===n.charCodeAt(t.index)&&(t.index+=1,ue(t))}if(t.index>=t.max)break;if(!re(n.charCodeAt(t.index)))break}ne(t)}else ne(t);else t.err='[path-util]: Invalid path value "'.concat(n[i],'" is not a path command')}var he=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function fe(t){if(te(t))return[].concat(t);var e=function(t){if(Jt(t))return[].concat(t);var e=new he(t);for(ue(e);e.max>e.index&&!e.err.length;)ce(e);return e.err?e.err:e.segments}(t),n=0,i=0,r=0,a=0;return e.map(function(t){var e,o=t.slice(1).map(Number),s=t[0],u=s.toUpperCase();if("M"===s)return r=n=o[0],a=i=o[1],["M",n,i];if(s!==u)switch(u){case"A":e=[u,o[0],o[1],o[2],o[3],o[4],o[5]+n,o[6]+i];break;case"V":e=[u,o[0]+i];break;case"H":e=[u,o[0]+n];break;default:var l=o.map(function(t,e){return t+(e%2?i:n)});e=[u].concat(l)}else e=[u].concat(o);var c=e.length;switch(u){case"Z":n=r,i=a;break;case"H":n=e[1];break;case"V":i=e[1];break;default:n=e[c-2],i=e[c-1],"M"===u&&(r=n,a=i)}return e})}function de(t,e){var n=t[0],i=e.x1,r=e.y1,a=e.x2,o=e.y2,s=t.slice(1).map(Number),u=t;if("TQ".includes(n)||(e.qx=null,e.qy=null),"H"===n)u=["L",t[1],r];else if("V"===n)u=["L",i,t[1]];else if("S"===n){var l=2*i-a,c=2*r-o;e.x1=l,e.y1=c,u=["C",l,c].concat(s)}else if("T"===n){var h=2*i-e.qx,f=2*r-e.qy;e.qx=h,e.qy=f,u=["Q",h,f].concat(s)}else if("Q"===n){var d=s[1];e.qx=s[0],e.qy=d}return u}function ve(t){if(ee(t))return[].concat(t);for(var e=fe(t),n=qt({},Kt),i=0;e.length>i;i+=1){e[i]=de(e[i],n);var r=e[i],a=r.length;n.x1=+r[a-2],n.y1=+r[a-1],n.x2=+r[a-4]||n.x1,n.y2=+r[a-3]||n.y1}return e}function pe(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function me(t,e,n,i,r,a,o,s,u,l){var c,h,f,d,v,p=t,m=e,y=n,g=i,k=s,E=u,x=120*Math.PI/180,b=Math.PI/180*(+r||0),T=[];if(l)h=l[0],f=l[1],d=l[2],v=l[3];else{m=(c=pe(p,m,-b)).y;var M=((p=c.x)-(k=(c=pe(k,E,-b)).x))/2,w=(m-(E=c.y))/2,N=M*M/(y*y)+w*w/(g*g);N>1&&(y*=N=Math.sqrt(N),g*=N);var P=y*y,S=g*g,C=(a===o?-1:1)*Math.sqrt(Math.abs((P*S-P*w*w-S*M*M)/(P*w*w+S*M*M)));d=C*y*w/g+(p+k)/2,h=Math.asin(((m-(v=C*-g*M/y+(m+E)/2))/g*1e9|0)/1e9),f=Math.asin(((E-v)/g*1e9|0)/1e9),0>(h=d>p?Math.PI-h:h)&&(h=2*Math.PI+h),0>(f=d>k?Math.PI-f:f)&&(f=2*Math.PI+f),o&&h>f&&(h-=2*Math.PI),!o&&f>h&&(f-=2*Math.PI)}var A=f-h;if(Math.abs(A)>x){var R=f,O=k,L=E;T=me(k=d+y*Math.cos(f=h+x*(o&&f>h?1:-1)),E=v+g*Math.sin(f),y,g,r,0,o,O,L,[f,R,d,v])}A=f-h;var I=Math.cos(h),_=Math.sin(h),D=Math.cos(f),F=Math.sin(f),G=Math.tan(A/4),B=4/3*y*G,V=4/3*g*G,U=[p,m],Y=[p+B*_,m-V*I],z=[k+B*F,E-V*D],j=[k,E];if(Y[0]=2*U[0]-Y[0],Y[1]=2*U[1]-Y[1],l)return Y.concat(z,j,T);for(var X=[],H=0,W=(T=Y.concat(z,j,T)).length;W>H;H+=1)X[H]=H%2?pe(T[H-1],T[H],b).y:pe(T[H],T[H+1],b).x;return X}function ye(t,e,n){var i=t[0],r=t[1];return[i+(e[0]-i)*n,r+(e[1]-r)*n]}var ge=function(t,e,n,i){return Zt(Zt([],ye([t,e],[n,i],.5),!0),[n,i,n,i],!1)};function ke(t,e){var n,i,r,a,o,s,u,l=t[0],c=t.slice(1).map(Number),h=c[0],f=c[1],d=e.x1,v=e.y1,p=e.x,m=e.y;switch("TQ".includes(l)||(e.qx=null,e.qy=null),l){case"M":return e.x=h,e.y=f,t;case"A":return n=[d,v].concat(c),["C"].concat(me(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9]));case"Q":return e.qx=h,e.qy=f,n=[d,v].concat(c),["C"].concat([(s=1/3)*n[0]+(u=2/3)*(i=n[2]),s*n[1]+u*(r=n[3]),s*(a=n[4])+u*i,s*(o=n[5])+u*r,a,o]);case"L":return["C"].concat(ge(d,v,h,f));case"Z":return d===p&&v===m?["C",d,v,p,m,p,m]:["C"].concat(ge(d,v,p,m))}return t}function Ee(t,e){if(void 0===e&&(e=!1),function(t){return ee(t)&&t.every(function(t){return"MC".includes(t[0])})}(t)){var n=[].concat(t);return e?[n,[]]:n}for(var i,r,a=ve(t),o=qt({},Kt),s=[],u="",l=a.length,c=[],h=0;l>h;h+=1){a[h]&&(u=a[h][0]),s[h]=u;var f=ke(a[h],o);a[h]=f,Qt(a,s,h),l=a.length,"Z"===u&&c.push(h),o.x1=+(i=a[h])[(r=i.length)-2],o.y1=+i[r-1],o.x2=+i[r-4]||o.x1,o.y2=+i[r-3]||o.y1}return e?[a,c]:a}function xe(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function be(t,e,n,i,r){var a=xe([t,e],[n,i]),o={x:0,y:0};if("number"==typeof r)if(0<r)if(r<a){var s=ye([t,e],[n,i],r/a);o={x:s[0],y:s[1]}}else o={x:n,y:i};else o={x:t,y:e};return{length:a,point:o,min:{x:Math.min(t,n),y:Math.min(e,i)},max:{x:Math.max(t,n),y:Math.max(e,i)}}}function Te(t,e){var n=t.x,i=t.y,r=e.x,a=e.y;return(0>n*a-i*r?-1:1)*Math.acos((n*r+i*a)/Math.sqrt((Math.pow(n,2)+Math.pow(i,2))*(Math.pow(r,2)+Math.pow(a,2))))}function Me(t,e,n,i,r,a,o,s,u,l){var c=Math.abs,h=Math.sin,f=Math.cos,d=Math.sqrt,v=Math.PI,p=c(n),m=c(i),y=(r%360+360)%360*(v/180);if(t===s&&e===u)return{x:t,y:e};if(0===p||0===m)return be(t,e,s,u,l).point;var g=(t-s)/2,k=(e-u)/2,E={x:f(y)*g+h(y)*k,y:-h(y)*g+f(y)*k},x=Math.pow(E.x,2)/Math.pow(p,2)+Math.pow(E.y,2)/Math.pow(m,2);x>1&&(p*=d(x),m*=d(x));var b=(Math.pow(p,2)*Math.pow(m,2)-Math.pow(p,2)*Math.pow(E.y,2)-Math.pow(m,2)*Math.pow(E.x,2))/(Math.pow(p,2)*Math.pow(E.y,2)+Math.pow(m,2)*Math.pow(E.x,2)),T=(a!==o?1:-1)*d(b=0>b?0:b),M=T*(p*E.y/m),w=T*(-m*E.x/p),N=f(y)*M-h(y)*w+(t+s)/2,P=h(y)*M+f(y)*w+(e+u)/2,S={x:(E.x-M)/p,y:(E.y-w)/m},C=Te({x:1,y:0},S),A=Te(S,{x:(-E.x-M)/p,y:(-E.y-w)/m});!o&&A>0?A-=2*v:o&&0>A&&(A+=2*v);var R=C+(A%=2*v)*l,O=p*f(R),L=m*h(R);return{x:f(y)*O-h(y)*L+N,y:h(y)*O+f(y)*L+P}}function we(t,e,n,i,r,a,o,s,u,l,c){var h,f=c.bbox,d=void 0===f||f,v=c.length,p=void 0===v||v,m=c.sampleSize,y=void 0===m?30:m,g="number"==typeof l,k=t,E=e,x=0,b=[k,E,x],T=[k,E],M={x:0,y:0},w=[{x:k,y:E}];g&&0>=l&&(M={x:k,y:E});for(var N=0;y>=N;N+=1){if(k=(h=Me(t,e,n,i,r,a,o,s,u,N/y)).x,E=h.y,d&&w.push({x:k,y:E}),p&&(x+=xe(T,[k,E])),T=[k,E],g&&x>=l&&l>b[2]){var P=(x-l)/(x-b[2]);M={x:T[0]*(1-P)+b[0]*P,y:T[1]*(1-P)+b[1]*P}}b=[k,E,x]}return g&&l>=x&&(M={x:s,y:u}),{length:x,point:M,min:{x:Math.min.apply(null,w.map(function(t){return t.x})),y:Math.min.apply(null,w.map(function(t){return t.y}))},max:{x:Math.max.apply(null,w.map(function(t){return t.x})),y:Math.max.apply(null,w.map(function(t){return t.y}))}}}function Ne(t,e,n,i,r,a,o,s,u){var l=1-u;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*u*n+3*l*Math.pow(u,2)*r+Math.pow(u,3)*o,y:Math.pow(l,3)*e+3*Math.pow(l,2)*u*i+3*l*Math.pow(u,2)*a+Math.pow(u,3)*s}}function Pe(t,e,n,i,r,a,o,s,u,l){var c,h=l.bbox,f=void 0===h||h,d=l.length,v=void 0===d||d,p=l.sampleSize,m=void 0===p?10:p,y="number"==typeof u,g=t,k=e,E=0,x=[g,k,E],b=[g,k],T={x:0,y:0},M=[{x:g,y:k}];y&&0>=u&&(T={x:g,y:k});for(var w=0;m>=w;w+=1){if(g=(c=Ne(t,e,n,i,r,a,o,s,w/m)).x,k=c.y,f&&M.push({x:g,y:k}),v&&(E+=xe(b,[g,k])),b=[g,k],y&&E>=u&&u>x[2]){var N=(E-u)/(E-x[2]);T={x:b[0]*(1-N)+x[0]*N,y:b[1]*(1-N)+x[1]*N}}x=[g,k,E]}return y&&u>=E&&(T={x:o,y:s}),{length:E,point:T,min:{x:Math.min.apply(null,M.map(function(t){return t.x})),y:Math.min.apply(null,M.map(function(t){return t.y}))},max:{x:Math.max.apply(null,M.map(function(t){return t.x})),y:Math.max.apply(null,M.map(function(t){return t.y}))}}}function Se(t,e,n,i,r,a,o){var s=1-o;return{x:Math.pow(s,2)*t+2*s*o*n+Math.pow(o,2)*r,y:Math.pow(s,2)*e+2*s*o*i+Math.pow(o,2)*a}}function Ce(t,e,n,i,r,a,o,s){var u,l=s.bbox,c=void 0===l||l,h=s.length,f=void 0===h||h,d=s.sampleSize,v=void 0===d?10:d,p="number"==typeof o,m=t,y=e,g=0,k=[m,y,g],E=[m,y],x={x:0,y:0},b=[{x:m,y:y}];p&&0>=o&&(x={x:m,y:y});for(var T=0;v>=T;T+=1){if(m=(u=Se(t,e,n,i,r,a,T/v)).x,y=u.y,c&&b.push({x:m,y:y}),f&&(g+=xe(E,[m,y])),E=[m,y],p&&g>=o&&o>k[2]){var M=(g-o)/(g-k[2]);x={x:E[0]*(1-M)+k[0]*M,y:E[1]*(1-M)+k[1]*M}}k=[m,y,g]}return p&&o>=g&&(x={x:r,y:a}),{length:g,point:x,min:{x:Math.min.apply(null,b.map(function(t){return t.x})),y:Math.min.apply(null,b.map(function(t){return t.y}))},max:{x:Math.max.apply(null,b.map(function(t){return t.x})),y:Math.max.apply(null,b.map(function(t){return t.y}))}}}function Ae(t,e,n){for(var i,r,a,o,s,u,l,c,h,f=ve(t),d="number"==typeof e,v=[],p=0,m=0,y=0,g=0,k=[],E=[],x=0,b={x:0,y:0},T=b,M=b,w=b,N=0,P=0,S=f.length;S>P;P+=1)v=(l="M"===(c=(h=f[P])[0]))?v:[p,m].concat(h.slice(1)),l?(T=b={x:y=h[1],y:g=h[2]},x=0,d&&.001>e&&(w=b)):"L"===c?(x=(i=be(v[0],v[1],v[2],v[3],(e||0)-N)).length,b=i.min,T=i.max,M=i.point):"A"===c?(x=(r=we(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],v[8],(e||0)-N,n||{})).length,b=r.min,T=r.max,M=r.point):"C"===c?(x=(a=Pe(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],(e||0)-N,n||{})).length,b=a.min,T=a.max,M=a.point):"Q"===c?(x=(o=Ce(v[0],v[1],v[2],v[3],v[4],v[5],(e||0)-N,n||{})).length,b=o.min,T=o.max,M=o.point):"Z"===c&&(x=(s=be((v=[p,m,y,g])[0],v[1],v[2],v[3],(e||0)-N)).length,b=s.min,T=s.max,M=s.point),d&&e>N&&N+x>=e&&(w=M),E.push(T),k.push(b),N+=x,p=(u="Z"!==c?h.slice(-2):[y,g])[0],m=u[1];return d&&e>=N&&(w={x:p,y:m}),{length:N,point:w,min:{x:Math.min.apply(null,k.map(function(t){return t.x})),y:Math.min.apply(null,k.map(function(t){return t.y}))},max:{x:Math.max.apply(null,E.map(function(t){return t.x})),y:Math.max.apply(null,E.map(function(t){return t.y}))}}}function Re(t){return function(t){var e=0,n=0,i=0;return Ee(t).map(function(t){var r;if("M"===t[0])return e=t[1],n=t[2],0;var a,o,s,u,l,c,h,f,d=t.slice(1);return i=3*(((f=d[5])-(o=n))*((s=d[0])+(l=d[2]))-((h=d[4])-(a=e))*((u=d[1])+(c=d[3]))+u*(a-l)-s*(o-c)+f*(l+a/3)-h*(c+o/3))/20,r=t.slice(-2),e=r[0],n=r[1],i}).reduce(function(t,e){return t+e},0)}(t)>=0}function Oe(t){return t.map(function(t,e,n){var i=e&&n[e-1].slice(-2).concat(t.slice(1)),r=e?Pe(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8],{bbox:!1}).length:0;return{s:t,ss:e?r?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),i=t.slice(2,4),r=t.slice(4,6),a=t.slice(6,8),o=ye(n,i,e),s=ye(i,r,e),u=ye(r,a,e),l=ye(o,s,e),c=ye(s,u,e),h=ye(l,c,e);return[["C"].concat(o,l,h),["C"].concat(c,u,a)]}(i):[t,t]:[t],l:r}})}function Le(t,e,n,i){if(void 0===i&&(i=0),i>50)return console.warn("Maximum recursion depth reached in equalizeSegments"),[t,e];var r=Oe(t),a=Oe(e),o=r.length,s=a.length,u=r.filter(function(t){return t.l}).length,l=a.filter(function(t){return t.l}).length,c=r.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/u||0,h=a.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/l||0,f=n||Math.max(o,s),d=[c,h],v=[f-o,f-s],p=0,m=[r,a].map(function(t,e){return t.l===f?t.map(function(t){return t.s}):t.map(function(t,n){return v[e]-=(p=n&&v[e]&&t.l>=d[e])?1:0,p?t.ss:[t.s]}).flat()});return m[0].length===m[1].length?m:Le(m[0],m[1],f,i+1)}function Ie(){return Ie="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=f(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(3>arguments.length?t:n):r.value}},Ie.apply(null,arguments)}function _e(t,e,n,i){var r=Ie(f(1&i?t.prototype:t),e,n);return 2&i&&"function"==typeof r?function(t){return r.apply(n,t)}:r}
/*!
* @antv/g-math
* @description Geometry util
* @version 3.0.1
* @date 7/30/2025, 1:34:14 PM
* @author AntVis
* @docs https://g.antv.antgroup.com/
*/function De(t,e,n,i){var r=t-n,a=e-i;return Math.sqrt(r*r+a*a)}function Fe(t,e){var n=Math.min.apply(Math,h(t)),i=Math.min.apply(Math,h(e));return{x:n,y:i,width:Math.max.apply(Math,h(t))-n,height:Math.max.apply(Math,h(e))-i}}function Ge(t,e,n,i,r,a){return n*Math.cos(r)*Math.cos(a)-i*Math.sin(r)*Math.sin(a)+t}function Be(t,e,n,i,r,a){return n*Math.sin(r)*Math.cos(a)+i*Math.cos(r)*Math.sin(a)+e}function Ve(t,e,n,i,r,a,o){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,i,r),u=1/0,l=-1/0,c=[a,o],h=2*-Math.PI;2*Math.PI>=h;h+=Math.PI){var f=s+h;o>a?f>a&&o>f&&c.push(f):f>o&&a>f&&c.push(f)}for(var d=0;c.length>d;d++){var v=Ge(t,0,n,i,r,c[d]);u>v&&(u=v),v>l&&(l=v)}for(var p=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,i,r),m=1/0,y=-1/0,g=[a,o],k=2*-Math.PI;2*Math.PI>=k;k+=Math.PI){var E=p+k;o>a?E>a&&o>E&&g.push(E):E>o&&a>E&&g.push(E)}for(var x=0;g.length>x;x++){var b=Be(0,e,n,i,r,g[x]);m>b&&(m=b),b>y&&(y=b)}return{x:u,y:m,width:l-u,height:y-m}}function Ue(t,e,n,i){return De(t,e,n,i)}function Ye(t,e,n,i,r){return{x:(1-r)*t+r*n,y:(1-r)*e+r*i}}function ze(t,e,n,i,r){var a=1-r;return a*a*a*t+3*e*r*a*a+3*n*r*r*a+i*r*r*r}function je(t,e,n,i){var r,a,o,s=-3*t+9*e-9*n+3*i,u=6*t-12*e+6*n,l=3*e-3*t,c=[];if(jt(s,0))jt(u,0)||0>(r=-l/u)||r>1||c.push(r);else{var h=u*u-4*s*l;jt(h,0)?c.push(-u/(2*s)):h>0&&(a=(-u-(o=Math.sqrt(h)))/(2*s),0>(r=(-u+o)/(2*s))||r>1||c.push(r),0>a||a>1||c.push(a))}return c}function Xe(t,e,n,i,r,a,o,s){for(var u=[t,o],l=[e,s],c=je(t,n,r,o),h=je(e,i,a,s),f=0;c.length>f;f++)u.push(ze(t,n,r,o,c[f]));for(var d=0;h.length>d;d++)l.push(ze(e,i,a,s,h[d]));return Fe(u,l)}function He(t){return function(t){if(2>t.length)return 0;for(var e=0,n=0;t.length-1>n;n++){var i=t[n],r=t[n+1];e+=De(i[0],i[1],r[0],r[1])}return e}(t)}function We(t,e,n,i){var r=1-i;return r*r*t+2*i*r*e+i*i*n}function qe(t,e,n){var i=t+n-2*e;if(jt(i,0))return[.5];var r=(t-e)/i;return r>1||0>r?[]:[r]}function Ze(t,e,n,i,r,a){var o=qe(t,n,r)[0],s=qe(e,i,a)[0],u=[t,r],l=[e,a];return void 0!==o&&u.push(We(t,n,r,o)),void 0!==s&&l.push(We(e,i,a,s)),Fe(u,l)}function Ke(t,e){this.v=t,this.k=e}function Qe(t,e,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(t){r=0}Qe=function(t,e,n,i){function a(e,n){Qe(t,e,function(t){return this._invoke(e,n,t)})}e?r?r(t,e,{value:n,enumerable:!i,configurable:!i,writable:!i}):t[e]=n:(a("next",0),a("throw",1),a("return",2))},Qe(t,e,n,i)}function $e(){
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
var t,e,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function a(n,i,r,a){var u=Object.create((i&&i.prototype instanceof s?i:s).prototype);return Qe(u,"_invoke",function(n,i,r){var a,s,u,l=0,c=r||[],h=!1,f={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,n){return a=e,s=0,u=t,f.n=n,o}};function d(n,i){for(s=n,u=i,e=0;!h&&l&&!r&&c.length>e;e++){var r,a=c[e],d=f.p,v=a[2];n>3?(r=v===i)&&(u=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=t):d>=a[0]&&((r=2>n&&a[1]>d)?(s=0,f.v=i,f.n=a[1]):v>d&&(r=3>n||a[0]>i||i>v)&&(a[4]=n,a[5]=i,f.n=v,s=0))}if(r||n>1)return o;throw h=!0,i}return function(r,c,v){if(l>1)throw TypeError("Generator is already running");for(h&&1===c&&d(c,v),s=c,u=v;(e=2>s?t:u)||!h;){a||(s?3>s?(s>1&&(f.n=-1),d(s,u)):f.n=u:f.v=u);try{if(l=2,a){if(s||(r="next"),e=a[r]){if(!(e=e.call(a,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,2>s&&(s=0)}else 1===s&&(e=a.return)&&e.call(a),2>s&&(u=TypeError("The iterator does not provide a '"+r+"' method"),s=1);a=t}else if((e=(h=0>f.n)?u:n.call(i,f))!==o)break}catch(e){a=t,s=1,u=e}finally{l=1}}return{value:e,done:h}}}(n,r,a),!0),u}var o={};function s(){}function u(){}function l(){}e=Object.getPrototypeOf;var c=[][i]?e(e([][i]())):(Qe(e={},i,function(){return this}),e),h=l.prototype=s.prototype=Object.create(c);function f(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,Qe(t,r,"GeneratorFunction")),t.prototype=Object.create(h),t}return u.prototype=l,Qe(h,"constructor",l),Qe(l,"constructor",u),u.displayName="GeneratorFunction",Qe(l,r,"GeneratorFunction"),Qe(h),Qe(h,r,"Generator"),Qe(h,i,function(){return this}),Qe(h,"toString",function(){return"[object Generator]"}),($e=function(){return{w:a,m:f}})()}function Je(t,e){function n(i,r,a,o){try{var s=t[i](r),u=s.value;return u instanceof Ke?e.resolve(u.v).then(function(t){n("next",t,a,o)},function(t){n("throw",t,a,o)}):e.resolve(u).then(function(t){s.value=t,a(s)},function(t){return n("throw",t,a,o)})}catch(t){o(t)}}var i;this.next||(Qe(Je.prototype),Qe(Je.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),Qe(this,"_invoke",function(t,r,a){function o(){return new e(function(e,i){n(t,a,e,i)})}return i=i?i.then(o,o):o()},!0)}function tn(t,e,n,i,r){return new Je($e().w(t,e,n,i),r||Promise)}function en(t,e,n,i,r){var a=tn(t,e,n,i,r);return a.next().then(function(t){return t.done?t.value:a.next()})}function nn(t){var e=Object(t),n=[];for(var i in e)n.unshift(i);return function t(){for(;n.length;)if((i=n.pop())in e)return t.value=i,t.done=!1,t;return t.done=!0,t}}function rn(t){if(null!=t){var n=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],i=0;if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}}}throw new TypeError(e(t)+" is not iterable")}function an(){var t=$e(),e=t.m(an),n=(Object.getPrototypeOf?Object.getPrototypeOf(e):e.__proto__).constructor;function i(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===n||"GeneratorFunction"===(e.displayName||e.name))}var r={throw:1,return:2,break:3,continue:3};function a(t){var e,n;return function(i){e||(e={stop:function(){return n(i.a,2)},catch:function(){return i.v},abrupt:function(t,e){return n(i.a,r[t],e)},delegateYield:function(t,r,a){return e.resultName=r,n(i.d,rn(t),a)},finish:function(t){return n(i.f,t)}},n=function(t,n,r){i.p=e.prev,i.n=e.next;try{return t(n,r)}finally{e.next=i.n}}),e.resultName&&(e[e.resultName]=i.v,e.resultName=void 0),e.sent=i.v,e.next=i.n;try{return t.call(this,e)}finally{i.p=e.prev,i.n=e.next}}}return(an=function(){return{wrap:function(e,n,i,r){return t.w(a(e),n,i,r&&r.reverse())},isGeneratorFunction:i,mark:t.m,awrap:function(t,e){return new Ke(t,e)},AsyncIterator:Je,async:function(t,e,n,r,o){return(i(e)?tn:en)(a(t),e,n,r,o)},keys:nn,values:rn}})()}function on(t,e,n,i,r,a,o){try{var s=t[a](o),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(i,r)}function sn(t){return function(){var e=this,n=arguments;return new Promise(function(i,r){var a=t.apply(e,n);function o(t){on(a,i,r,o,s,"next",t)}function s(t){on(a,i,r,o,s,"throw",t)}o(void 0)})}}function un(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=c(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return t.length>i?{done:!1,value:t[i++]}:{done:!0}},e:function(t){throw t},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 a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function ln(t,e){if(null==t)return{};var n,i,r=function(t,e){if(null==t)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;n[i]=t[i]}return n}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;a.length>i;i++)-1===e.indexOf(n=a[i])&&{}.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var cn={exports:{}};!function(t){t.exports=function(){function t(t,n,r,a,o){e(t,n,r||0,a||t.length-1,o||i)}function e(t,i,r,a,o){for(;a>r;){if(a-r>600){var s=a-r+1,u=i-r+1,l=Math.log(s),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(s-c)/s)*(0>u-s/2?-1:1);e(t,i,Math.max(r,Math.floor(i-u*c/s+h)),Math.min(a,Math.floor(i+(s-u)*c/s+h)),o)}var f=t[i],d=r,v=a;for(n(t,r,i),o(t[a],f)>0&&n(t,r,a);v>d;){for(n(t,d,v),d++,v--;0>o(t[d],f);)d++;for(;o(t[v],f)>0;)v--}0===o(t[r],f)?n(t,r,v):n(t,++v,a),v>i||(r=v+1),i>v||(a=v-1)}}function n(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function i(t,e){return e>t?-1:t>e?1:0}var r=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(t,e,n){if(!n)return e.indexOf(t);for(var i=0;e.length>i;i++)if(n(t,e[i]))return i;return-1}function o(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,i,r){r||(r=y(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(var a=e;n>a;a++){var o=t.children[a];u(r,t.leaf?i(o):o)}return r}function u(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function c(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function f(t){return t.maxX-t.minX+(t.maxY-t.minY)}function d(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function v(t,e){var n=Math.max(t.minX,e.minX),i=Math.max(t.minY,e.minY),r=Math.min(t.maxX,e.maxX),a=Math.min(t.maxY,e.maxY);return Math.max(0,r-n)*Math.max(0,a-i)}function p(t,e){return!(t.minX>e.minX||t.minY>e.minY||e.maxX>t.maxX||e.maxY>t.maxY)}function m(t,e){return!(e.minX>t.maxX||e.minY>t.maxY||t.minX>e.maxX||t.minY>e.maxY)}function y(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(e,n,i,r,a){for(var o=[n,i];o.length;)if((i=o.pop())-(n=o.pop())>r){var s=n+Math.ceil((i-n)/r/2)*r;t(e,s,n,i,a),o.push(n,s,s,i)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var e=this.data,n=[];if(!m(t,e))return n;for(var i=this.toBBox,r=[];e;){for(var a=0;e.children.length>a;a++){var o=e.children[a],s=e.leaf?i(o):o;m(t,s)&&(e.leaf?n.push(o):p(t,s)?this._all(o,n):r.push(o))}e=r.pop()}return n},r.prototype.collides=function(t){var e=this.data;if(!m(t,e))return!1;for(var n=[];e;){for(var i=0;e.children.length>i;i++){var r=e.children[i],a=e.leaf?this.toBBox(r):r;if(m(t,a)){if(e.leaf||p(t,a))return!0;n.push(r)}}e=n.pop()}return!1},r.prototype.load=function(t){if(!t||!t.length)return this;if(this._minEntries>t.length){for(var e=0;t.length>e;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(n.height>this.data.height){var i=this.data;this.data=n,n=i}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},r.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},r.prototype.clear=function(){return this.data=y([]),this},r.prototype.remove=function(t,e){if(!t)return this;for(var n,i,r,o=this.data,s=this.toBBox(t),u=[],l=[];o||u.length;){if(o||(o=u.pop(),i=u[u.length-1],n=l.pop(),r=!0),o.leaf){var c=a(t,o.children,e);if(-1!==c)return o.children.splice(c,1),u.push(o),this._condense(u),this}r||o.leaf||!p(o,s)?i?(n++,o=i.children[n],r=!1):o=null:(u.push(o),l.push(n),n=0,i=o,o=o.children[0])}return this},r.prototype.toBBox=function(t){return t},r.prototype.compareMinX=function(t,e){return t.minX-e.minX},r.prototype.compareMinY=function(t,e){return t.minY-e.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(t){return this.data=t,this},r.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},r.prototype._build=function(t,e,n,i){var r,a=n-e+1,s=this._maxEntries;if(s>=a)return o(r=y(t.slice(e,n+1)),this.toBBox),r;i||(s=Math.ceil(a/Math.pow(s,(i=Math.ceil(Math.log(a)/Math.log(s)))-1))),(r=y([])).leaf=!1,r.height=i;var u=Math.ceil(a/s),l=u*Math.ceil(Math.sqrt(s));g(t,e,n,l,this.compareMinX);for(var c=e;n>=c;c+=l){var h=Math.min(c+l-1,n);g(t,c,h,u,this.compareMinY);for(var f=c;h>=f;f+=u)r.children.push(this._build(t,f,Math.min(f+u-1,h),i-1))}return o(r,this.toBBox),r},r.prototype._chooseSubtree=function(t,e,n,i){for(;i.push(e),!e.leaf&&i.length-1!==n;){for(var r=1/0,a=1/0,o=void 0,s=0;e.children.length>s;s++){var u=e.children[s],l=h(u),c=d(t,u)-l;a>c?(a=c,r=r>l?l:r,o=u):c===a&&r>l&&(r=l,o=u)}e=o||e.children[0]}return e},r.prototype._insert=function(t,e,n){var i=n?t:this.toBBox(t),r=[],a=this._chooseSubtree(i,this.data,e,r);for(a.children.push(t),u(a,i);e>=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(i,r,e)},r.prototype._split=function(t,e){var n=t[e],i=n.children.length,r=this._minEntries;this._chooseSplitAxis(n,r,i);var a=this._chooseSplitIndex(n,r,i),s=y(n.children.splice(a,n.children.length-a));s.height=n.height,s.leaf=n.leaf,o(n,this.toBBox),o(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},r.prototype._splitRoot=function(t,e){this.data=y([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,e,n){for(var i,r=1/0,a=1/0,o=e;n-e>=o;o++){var u=s(t,0,o,this.toBBox),l=s(t,o,n,this.toBBox),c=v(u,l),f=h(u)+h(l);r>c?(r=c,i=o,a=a>f?f:a):c===r&&a>f&&(a=f,i=o)}return i||n-e},r.prototype._chooseSplitAxis=function(t,e,n){var i=t.leaf?this.compareMinX:l,r=t.leaf?this.compareMinY:c,a=this._allDistMargin(t,e,n,i);this._allDistMargin(t,e,n,r)>a&&t.children.sort(i)},r.prototype._allDistMargin=function(t,e,n,i){t.children.sort(i);for(var r=this.toBBox,a=s(t,0,e,r),o=s(t,n-e,n,r),l=f(a)+f(o),c=e;n-e>c;c++){var h=t.children[c];u(a,t.leaf?r(h):h),l+=f(a)}for(var d=n-e-1;d>=e;d--){var v=t.children[d];u(o,t.leaf?r(v):v),l+=f(o)}return l},r.prototype._adjustParentBBoxes=function(t,e,n){for(var i=n;i>=0;i--)u(e[i],t)},r.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},r}()}(cn);var hn=cn.exports,fn=function(t){return t.GROUP="g",t.FRAGMENT="fragment",t.CIRCLE="circle",t.ELLIPSE="ellipse",t.IMAGE="image",t.RECT="rect",t.LINE="line",t.POLYLINE="polyline",t.POLYGON="polygon",t.TEXT="text",t.PATH="path",t.HTML="html",t.MESH="mesh",t}({}),dn=function(t){return t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE",t}({}),vn=function(){return u(function t(){o(this,t),this.plugins=[]},[{key:"addRenderingPlugin",value:function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)}},{key:"removeAllRenderingPlugins",value:function(){var t=this;this.plugins.forEach(function(e){var n=t.context.renderingPlugins.indexOf(e);0>n||t.context.renderingPlugins.splice(n,1)})}}])}(),pn=function(){return u(function t(e){o(this,t),this.clipSpaceNearZ=dn.NEGATIVE_ONE,this.plugins=[],this.config=a({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0,enableRenderingOptimization:!1},e)},[{key:"registerPlugin",value:function(t){-1===this.plugins.findIndex(function(e){return e===t})&&this.plugins.push(t)}},{key:"unregisterPlugin",value:function(t){var e=this.plugins.findIndex(function(e){return e===t});e>-1&&this.plugins.splice(e,1)}},{key:"getPlugins",value:function(){return this.plugins}},{key:"getPlugin",value:function(t){return this.plugins.find(function(e){return e.name===t})}},{key:"getConfig",value:function(){return this.config}},{key:"setConfig",value:function(t){Object.assign(this.config,t)}}])}(),mn=ut,yn=ot,gn=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t},kn=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t},En=ct,xn=yt,bn=function(){function t(){o(this,t),this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return u(t,[{key:"update",value:function(t,e){yn(this.center,t),yn(this.halfExtents,e),xn(this.min,this.center,this.halfExtents),mn(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,e){mn(this.center,e,t),En(this.center,this.center,.5),xn(this.halfExtents,e,t),En(this.halfExtents,this.halfExtents,.5),yn(this.min,t),yn(this.max,e)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(e){if(!t.isEmpty(e))if(t.isEmpty(this))this.setMinMax(e.getMin(),e.getMax());else{var n=this.center,i=n[0],r=n[1],a=n[2],o=this.halfExtents,s=o[0],u=o[1],l=o[2],c=i-s,h=i+s,f=r-u,d=r+u,v=a-l,p=a+l,m=e.center,y=m[0],g=m[1],k=m[2],E=e.halfExtents,x=E[0],b=E[1],T=E[2],M=y-x,w=y+x,N=g-b,P=g+b,S=k-T,C=k+T;c>M&&(c=M),w>h&&(h=w),f>N&&(f=N),P>d&&(d=P),v>S&&(v=S),C>p&&(p=C),n[0]=.5*(c+h),n[1]=.5*(f+d),n[2]=.5*(v+p),o[0]=.5*(h-c),o[1]=.5*(d-f),o[2]=.5*(p-v),this.min[0]=c,this.min[1]=f,this.min[2]=v,this.max[0]=h,this.max[1]=d,this.max[2]=p}}},{key:"setFromTransformedAABB",value:function(t,e){var n=this.center,i=this.halfExtents,r=t.center,a=t.halfExtents,o=e[0],s=e[4],u=e[8],l=e[1],c=e[5],h=e[9],f=e[2],d=e[6],v=e[10],p=Math.abs(o),m=Math.abs(s),y=Math.abs(u),g=Math.abs(l),k=Math.abs(c),E=Math.abs(h),x=Math.abs(f),b=Math.abs(d),T=Math.abs(v);n[0]=e[12]+o*r[0]+s*r[1]+u*r[2],n[1]=e[13]+l*r[0]+c*r[1]+h*r[2],n[2]=e[14]+f*r[0]+d*r[1]+v*r[2],i[0]=p*a[0]+m*a[1]+y*a[2],i[1]=g*a[0]+k*a[1]+E*a[2],i[2]=x*a[0]+b*a[1]+T*a[2],xn(this.min,n,i),mn(this.max,n,i)}},{key:"intersects",value:function(t){var e=this.getMax(),n=this.getMin(),i=t.getMax(),r=t.getMin();return!(n[0]>i[0]||r[0]>e[0]||n[1]>i[1]||r[1]>e[1]||n[2]>i[2]||r[2]>e[2])}},{key:"intersection",value:function(e){if(!this.intersects(e))return null;var n=new t,i=gn([0,0,0],this.getMin(),e.getMin()),r=kn([0,0,0],this.getMax(),e.getMax());return n.setMinMax(i,r),n}},{key:"getNegativeFarPoint",value:function(t){return 273===t.pnVertexFlag?yn([0,0,0],this.min):272===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:257===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:256===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:17===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:16===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:1===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]}},{key:"getPositiveFarPoint",value:function(t){return 273===t.pnVertexFlag?yn([0,0,0],this.max):272===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:257===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:256===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:17===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:16===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:1===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]}}],[{key:"isEmpty",value:function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]}}])}(),Tn=function(){return u(function t(e,n){o(this,t),this.distance=e||0,this.normal=n||at(0,1,0),this.updatePNVertexFlag()},[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(t){return ft(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t=1/kt(this.normal);ct(this.normal,this.normal,t),this.distance*=t}},{key:"intersectsLine",value:function(t,e,n){var i=this.distanceToPoint(t),r=i/(i-this.distanceToPoint(e)),a=r>=0&&1>=r;return a&&n&&vt(n,t,e,r),a}}])}(),Mn=function(t){return t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE",t}({}),wn=function(){return u(function t(e){if(o(this,t),this.planes=[],e)this.planes=e;else for(var n=0;6>n;n++)this.planes.push(new Tn)},[{key:"extractFromVPMatrix",value:function(t){var e=g(t,16),n=e[0],i=e[1],r=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=e[9],f=e[10],d=e[11],v=e[12],p=e[13],m=e[14],y=e[15];st(this.planes[0].normal,a-n,l-o,d-c),this.planes[0].distance=y-v,st(this.planes[1].normal,a+n,l+o,d+c),this.planes[1].distance=y+v,st(this.planes[2].normal,a+i,l+s,d+h),this.planes[2].distance=y+p,st(this.planes[3].normal,a-i,l-s,d-h),this.planes[3].distance=y-p,st(this.planes[4].normal,a-r,l-u,d-f),this.planes[4].distance=y-m,st(this.planes[5].normal,a+r,l+u,d+f),this.planes[5].distance=y+m,this.planes.forEach(function(t){t.normalize(),t.updatePNVertexFlag()})}}])}(),Nn=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;o(this,t),this.x=0,this.y=0,this.x=e,this.y=n}return u(t,[{key:"clone",value:function(){return new t(this.x,this.y)}},{key:"copyFrom",value:function(t){this.x=t.x,this.y=t.y}}])}(),Pn=function(){function t(e,n,i,r){o(this,t),this.x=e,this.y=n,this.width=i,this.height=r,this.left=e,this.right=e+i,this.top=n,this.bottom=n+r}return u(t,[{key:"toJSON",value:function(){}}],[{key:"fromRect",value:function(e){return new t(e.x,e.y,e.width,e.height)}},{key:"applyTransform",value:function(e,n){var i=xt(e.x,e.y,0,1),r=xt(e.x+e.width,e.y,0,1),a=xt(e.x,e.y+e.height,0,1),o=xt(e.x+e.width,e.y+e.height,0,1),s=Et(),u=Et(),l=Et(),c=Et();bt(s,i,n),bt(u,r,n),bt(l,a,n),bt(c,o,n);var h=Math.min(s[0],u[0],l[0],c[0]),f=Math.min(s[1],u[1],l[1],c[1]);return t.fromRect({x:h,y:f,width:Math.max(s[0],u[0],l[0],c[0])-h,height:Math.max(s[1],u[1],l[1],c[1])-f})}}])}(),Sn="Method not implemented.",Cn="Use document.documentElement instead.";function An(t){return void 0===t?0:t>360||-360>t?t%360:t}var Rn=nt();function On(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=3>=arguments.length||void 0===arguments[3]||arguments[3];return Array.isArray(t)&&3===t.length?i?it(t):ot(Rn,t):zt(t)?i?at(t,e,n):st(Rn,t,e,n):i?at(t[0],t[1]||e,t[2]||n):st(Rn,t[0],t[1]||e,t[2]||n)}var Ln=Math.PI/180;function In(t){return t*Ln}var _n=180/Math.PI;function Dn(t){return t*_n}function Fn(t){return 360*t}var Gn=Math.PI/2;function Bn(t,e){return 16===e.length?function(t,e){var n,i,r=g(j(nt(),e),3),a=r[0],o=r[1],s=r[2],u=Math.asin(-e[2]/a);return Gn>u?u>-Gn?(n=Math.atan2(e[6]/o,e[10]/s),i=Math.atan2(e[1]/a,e[0]/a)):(i=0,n=-Math.atan2(e[4]/o,e[5]/o)):(i=0,n=Math.atan2(e[4]/o,e[5]/o)),t[0]=n,t[1]=u,t[2]=i,t}(t,e):function(t,e){var n=e[0],i=e[1],r=e[2],a=e[3],o=i*i,s=r*r,u=a*a,l=n*n+o+s+u,c=n*a-i*r;return c>.499995*l?(t[0]=Gn,t[1]=2*Math.atan2(i,n),t[2]=0):-.499995*l>c?(t[0]=-Gn,t[1]=2*Math.atan2(i,n),t[2]=0):(t[0]=Math.asin(2*(n*r-a*i)),t[1]=Math.atan2(2*(n*a+i*r),1-2*(s+u)),t[2]=Math.atan2(2*(n*i+r*a),1-2*(o+s))),t}(t,e)}function Vn(t,e,n,i,r){var a,o,s,u,l,c,h,f,d,v,p=Math.cos(t),m=Math.sin(t);return a=i*p,o=r*m,s=0,u=-i*m,l=r*p,c=0,h=e,f=n,d=1,(v=new b(9))[0]=a,v[1]=o,v[2]=s,v[3]=u,v[4]=l,v[5]=c,v[6]=h,v[7]=f,v[8]=d,v}function Un(t){var e=t[0],n=t[1],i=t[3],r=t[4],a=Math.sqrt(e*e+n*n),o=Math.sqrt(i*i+r*r);if(0>e*r-n*i&&(r>e?a=-a:o=-o),a){var s=1/a;e*=s,n*=s}if(o){var u=1/o;i*=u,r*=u}var l=Dn(Math.atan2(n,e));return[t[6],t[7],a,o,l]}var Yn=M(),zn=M(),jn=Et(),Xn=[nt(),nt(),nt()],Hn=nt();function Wn(t,e,n,i,r){t[0]=e[0]*i+n[0]*r,t[1]=e[1]*i+n[1]*r,t[2]=e[2]*i+n[2]*r}var qn=function(t){return t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING",t}({}),Zn=function(t){return t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC",t}({}),Kn=function(t){return t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE",t}({}),Qn={UPDATED:"updated"},$n=2e-4,Jn=function(){return u(function t(){o(this,t),this.clipSpaceNearZ=dn.NEGATIVE_ONE,this.eventEmitter=new E,this.matrix=M(),this.right=at(1,0,0),this.up=at(0,1,0),this.forward=at(0,0,1),this.position=at(0,0,1),this.focalPoint=at(0,0,0),this.distanceVector=at(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=M(),this.projectionMatrixInverse=M(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=qn.EXPLORING,this.trackingMode=Zn.DEFAULT,this.projectionMode=Kn.PERSPECTIVE,this.frustum=new wn,this.orthoMatrix=M()},[{key:"isOrtho",value:function(){return this.projectionMode===Kn.ORTHOGRAPHIC}},{key:"getProjectionMode",value:function(){return this.projectionMode}},{key:"getPerspective",value:function(){return this.jitteredProjectionMatrix||this.projectionMatrix}},{key:"getPerspectiveInverse",value:function(){return this.projectionMatrixInverse}},{key:"getFrustum",value:function(){return this.frustum}},{key:"getPosition",value:function(){return this.position}},{key:"getFocalPoint",value:function(){return this.focalPoint}},{key:"getDollyingStep",value:function(){return this.dollyingStep}},{key:"getNear",value:function(){return this.near}},{key:"getFar",value:function(){return this.far}},{key:"getZoom",value:function(){return this.zoom}},{key:"getOrthoMatrix",value:function(){return this.orthoMatrix}},{key:"getView",value:function(){return this.view}},{key:"setEnableUpdate",value:function(t){this.enableUpdate=t}},{key:"setType",value:function(t,e){return this.type=t,this.setWorldRotation(this.type===qn.EXPLORING),this._getAngles(),this.type===qn.TRACKING&&void 0!==e&&this.setTrackingMode(e),this}},{key:"setProjectionMode",value:function(t){return this.projectionMode=t,this}},{key:"setTrackingMode",value:function(t){if(this.type!==qn.TRACKING)throw Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this}},{key:"setWorldRotation",value:function(t){return this.rotateWorld=t,this._getAngles(),this}},{key:"getViewTransform",value:function(){return A(M(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"jitterProjectionMatrix",value:function(t,e){var n=D(M(),[t,e,0]);this.jitteredProjectionMatrix=O(M(),n,this.projectionMatrix)}},{key:"clearJitterProjectionMatrix",value:function(){this.jitteredProjectionMatrix=void 0}},{key:"setMatrix",value:function(t){return this.matrix=t,this._update(),this}},{key:"setProjectionMatrix",value:function(t){this.projectionMatrix=t}},{key:"setFov",value:function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this}},{key:"setAspect",value:function(t){return this.setPerspective(this.near,this.far,this.fov,t),this}},{key:"setNear",value:function(t){return this.projectionMode===Kn.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this}},{key:"setFar",value:function(t){return this.projectionMode===Kn.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this}},{key:"setViewOffset",value:function(t,e,n,i,r,a){return this.aspect=t/e,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.projectionMode===Kn.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===Kn.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"setZoom",value:function(t){return this.zoom=t,this.projectionMode===Kn.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===Kn.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this}},{key:"setZoomByViewportPoint",value:function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),i=n.x,r=n.y,a=this.roll;this.rotate(0,0,-a),this.setPosition(i,r),this.setFocalPoint(i,r),this.setZoom(t),this.rotate(0,0,a);var o=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),s=at(o.x-i,o.y-r,0),u=ft(s,this.right)/rt(this.right),l=ft(s,this.up)/rt(this.up),c=g(this.getPosition(),2),h=c[0],f=c[1],d=g(this.getFocalPoint(),2),v=d[0],p=d[1];return this.setPosition(h-u,f-l),this.setFocalPoint(v-u,p-l),this}},{key:"setPerspective",value:function(t,e,n,i){var r;this.projectionMode=Kn.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=i;var a=this.near*Math.tan(In(.5*this.fov))/this.zoom,o=2*a,s=this.aspect*o,u=-.5*s;if(null!==(r=this.view)&&void 0!==r&&r.enabled){var l=this.view.fullWidth,c=this.view.fullHeight;u+=this.view.offsetX*s/l,a-=this.view.offsetY*o/c,s*=this.view.width/l,o*=this.view.height/c}return function(t,e,n,i,r,a,o){var s,u,l=2*a,c=n-e,h=i-r,f=l/h,d=(n+e)/c,v=(i+r)/h,p=o-a,m=o*a;arguments.length>7&&void 0!==arguments[7]&&arguments[7]?(s=-o/p,u=-m/p):(s=-(o+a)/p,u=-2*m/p),t[0]=l/c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=f,t[6]=0,t[7]=0,t[8]=d,t[9]=v,t[10]=s,t[11]=-1,t[12]=0,t[13]=0,t[14]=u,t[15]=0}(this.projectionMatrix,u,u+s,a-o,a,t,this.far,this.clipSpaceNearZ===dn.ZERO),A(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this}},{key:"setOrthographic",value:function(t,e,n,i,r,a){var o;this.projectionMode=Kn.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=i,this.near=r,this.far=a;var s=(this.rright-this.left)/(2*this.zoom),u=(this.top-this.bottom)/(2*this.zoom),l=(this.rright+this.left)/2,c=(this.top+this.bottom)/2,h=l-s,f=l+s,d=c+u,v=c-u;if(null!==(o=this.view)&&void 0!==o&&o.enabled){var p=(this.rright-this.left)/this.view.fullWidth/this.zoom,m=(this.top-this.bottom)/this.view.fullHeight/this.zoom;f=(h+=p*this.view.offsetX)+p*this.view.width,v=(d-=m*this.view.offsetY)-m*this.view.height}return this.clipSpaceNearZ===dn.NEGATIVE_ONE?K(this.projectionMatrix,h,f,d,v,r,a):Q(this.projectionMatrix,h,f,d,v,r,a),A(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this}},{key:"setPosition",value:function(t){var e=On(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.position[1],arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.position[2]);return this._setPosition(e),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this}},{key:"setFocalPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.focalPoint[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.focalPoint[2],i=at(0,1,0);if(this.focalPoint=On(t,e,n),this.trackingMode===Zn.CINEMATIC){var r=lt(nt(),this.focalPoint,this.position);t=r[0],e=r[1],n=r[2];var a=rt(r),o=Dn(Math.asin(e/a)),s=90+Dn(Math.atan2(n,t)),u=M();_(u,u,In(s)),I(u,u,In(o)),i=pt(nt(),[0,1,0],u)}return A(this.matrix,$(M(),this.position,this.focalPoint,i)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this}},{key:"getDistance",value:function(){return this.distance}},{key:"getDistanceVector",value:function(){return this.distanceVector}},{key:"setDistance",value:function(t){if(this.distance===t||0>t)return this;this.distance=t,$n>this.distance&&(this.distance=$n),this.dollyingStep=this.distance/100;var e=nt(),n=this.forward,i=this.focalPoint;return e[0]=(t=this.distance)*n[0]+i[0],e[1]=t*n[1]+i[1],e[2]=t*n[2]+i[2],this._setPosition(e),this.triggerUpdate(),this}},{key:"setMaxDistance",value:function(t){return this.maxDistance=t,this}},{key:"setMinDistance",value:function(t){return this.minDistance=t,this}},{key:"setAzimuth",value:function(t){return this.azimuth=An(t),this.computeMatrix(),this._getAxes(),this.type===qn.ORBITING||this.type===qn.EXPLORING?this._getPosition():this.type===qn.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(t){return this.elevation=An(t),this.computeMatrix(),this._getAxes(),this.type===qn.ORBITING||this.type===qn.EXPLORING?this._getPosition():this.type===qn.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getElevation",value:function(){return this.elevation}},{key:"setRoll",value:function(t){return this.roll=An(t),this.computeMatrix(),this._getAxes(),this.type===qn.ORBITING||this.type===qn.EXPLORING?this._getPosition():this.type===qn.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getRoll",value:function(){return this.roll}},{key:"_update",value:function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()}},{key:"computeMatrix",value:function(){var t=Mt(Tt(),[0,0,1],In(this.roll));S(this.matrix);var e=Mt(Tt(),[1,0,0],In((this.rotateWorld&&this.type!==qn.TRACKING||this.type===qn.TRACKING?1:-1)*this.elevation)),n=Mt(Tt(),[0,1,0],In((this.rotateWorld&&this.type!==qn.TRACKING||this.type===qn.TRACKING?1:-1)*this.azimuth)),i=wt(Tt(),n,e);i=wt(Tt(),i,t);var r=W(M(),i);this.type===qn.ORBITING||this.type===qn.EXPLORING?(L(this.matrix,this.matrix,this.focalPoint),O(this.matrix,this.matrix,r),L(this.matrix,this.matrix,[0,0,this.distance])):this.type===qn.TRACKING&&(L(this.matrix,this.matrix,this.position),O(this.matrix,this.matrix,r))}},{key:"_setPosition",value:function(t,e,n){this.position=On(t,e,n);var i=this.matrix;i[12]=this.position[0],i[13]=this.position[1],i[14]=this.position[2],i[15]=1,this._getOrthoMatrix()}},{key:"_getAxes",value:function(){ot(this.right,On(bt(Et(),[1,0,0,0],this.matrix))),ot(this.up,On(bt(Et(),[0,1,0,0],this.matrix))),ot(this.forward,On(bt(Et(),[0,0,1,0],this.matrix))),ht(this.right,this.right),ht(this.up,this.up),ht(this.forward,this.forward)}},{key:"_getAngles",value:function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],i=rt(this.distanceVector);if(0===i)return this.elevation=0,void(this.azimuth=0);this.type===qn.TRACKING||this.rotateWorld?(this.elevation=Dn(Math.asin(e/i)),this.azimuth=Dn(Math.atan2(-t,-n))):(this.elevation=-Dn(Math.asin(e/i)),this.azimuth=-Dn(Math.atan2(-t,-n)))}},{key:"_getPosition",value:function(){ot(this.position,On(bt(Et(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){var t,e;!function(t,e,n){var i=e[0],r=e[1],a=e[2];t[0]=i*n[0]+r*n[3]+a*n[6],t[1]=i*n[1]+r*n[4]+a*n[7],t[2]=i*n[2]+r*n[5]+a*n[8]}(this.distanceVector,[0,0,-this.distance],(t=T(),e=this.matrix,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t)),ut(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=lt(nt(),this.focalPoint,this.position),this.distance=rt(this.distanceVector),this.dollyingStep=this.distance/100}},{key:"_getOrthoMatrix",value:function(){if(this.projectionMode===Kn.ORTHOGRAPHIC){var t=this.position,e=Mt(Tt(),[0,0,1],-this.roll*Math.PI/180);H(this.orthoMatrix,e,at((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),at(this.zoom,this.zoom,1),t)}}},{key:"triggerUpdate",value:function(){if(this.enableUpdate){var t=this.getViewTransform(),e=O(M(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(Qn.UPDATED)}}},{key:"rotate",value:function(t,e,n){throw Error(Sn)}},{key:"pan",value:function(t,e){throw Error(Sn)}},{key:"dolly",value:function(t){throw Error(Sn)}},{key:"createLandmark",value:function(t,e){throw Error(Sn)}},{key:"gotoLandmark",value:function(t,e){throw Error(Sn)}},{key:"cancelLandmarkAnimation",value:function(){throw Error(Sn)}}])}(),ti=function(t){return t[t.Standard=0]="Standard",t}({}),ei=function(t){return t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED",t}({}),ni=nt(),ii=M(),ri=Tt();function ai(t){if(t.localDirtyFlag){if(0!==t.localSkew[0]||0!==t.localSkew[1]){H(t.localTransform,t.localRotation,t.localPosition,at(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||(S(ii),ii[4]=Math.tan(t.localSkew[0]),ii[1]=Math.tan(t.localSkew[1]),O(t.localTransform,t.localTransform,ii));var e=H(ii,At(ri,0,0,0,1),st(ni,1,1,1),t.localScale,t.origin);O(t.localTransform,t.localTransform,e)}else{var n=t.localTransform,i=t.localPosition,r=t.localRotation,a=t.localScale,o=t.origin,s=0!==i[0]||0!==i[1]||0!==i[2];1!==r[3]||0!==r[0]||0!==r[1]||0!==r[2]||(1!==a[0]||1!==a[1]||1!==a[2])||(0!==o[0]||0!==o[1]||0!==o[2])?H(n,r,i,a,o):s?D(n,i):S(n)}t.localDirtyFlag=!1}}function oi(t,e){t.dirtyFlag&&(e?O(t.worldTransform,e.worldTransform,t.localTransform):N(t.worldTransform,t.localTransform),t.dirtyFlag=!1)}var si={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Pn(0,0,0,0)},ui=function(t){return t.COORDINATE="<coordinate>",t.COLOR="<color>",t.PAINT="<paint>",t.NUMBER="<number>",t.ANGLE="<angle>",t.OPACITY_VALUE="<opacity-value>",t.SHADOW_BLUR="<shadow-blur>",t.LENGTH="<length>",t.PERCENTAGE="<percentage>",t.LENGTH_PERCENTAGE="<length> | <percentage>",t.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",t.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",t.LIST_OF_POINTS="<list-of-points>",t.PATH="<path>",t.FILTER="<filter>",t.Z_INDEX="<z-index>",t.OFFSET_DISTANCE="<offset-distance>",t.DEFINED_PATH="<defined-path>",t.MARKER="<marker>",t.TRANSFORM="<transform>",t.TRANSFORM_ORIGIN="<transform-origin>",t.TEXT="<text>",t.TEXT_TRANSFORM="<text-transform>",t}({});function li(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function ci(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function hi(){}var fi=.7,di=1/fi,vi="\\s*([+-]?\\d+)\\s*",pi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",mi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",yi=/^#([0-9a-f]{3,8})$/,gi=RegExp("^rgb\\(".concat(vi,",").concat(vi,",").concat(vi,"\\)$")),ki=RegExp("^rgb\\(".concat(mi,",").concat(mi,",").concat(mi,"\\)$")),Ei=RegExp("^rgba\\(".concat(vi,",").concat(vi,",").concat(vi,",").concat(pi,"\\)$")),xi=RegExp("^rgba\\(".concat(mi,",").concat(mi,",").concat(mi,",").concat(pi,"\\)$")),bi=RegExp("^hsl\\(".concat(pi,",").concat(mi,",").concat(mi,"\\)$")),Ti=RegExp("^hsla\\(".concat(pi,",").concat(mi,",").concat(mi,",").concat(pi,"\\)$")),Mi={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 wi(){return this.rgb().formatHex()}function Ni(){return this.rgb().formatRgb()}function Pi(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=yi.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Si(e):3===n?new Ai(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Ci(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Ci(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=gi.exec(t))?new Ai(e[1],e[2],e[3],1):(e=ki.exec(t))?new Ai(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Ei.exec(t))?Ci(e[1],e[2],e[3],e[4]):(e=xi.exec(t))?Ci(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=bi.exec(t))?Di(e[1],e[2]/100,e[3]/100,1):(e=Ti.exec(t))?Di(e[1],e[2]/100,e[3]/100,e[4]):Mi.hasOwnProperty(t)?Si(Mi[t]):"transparent"===t?new Ai(NaN,NaN,NaN,0):null}function Si(t){return new Ai(t>>16&255,t>>8&255,255&t,1)}function Ci(t,e,n,i){return i>0||(t=e=n=NaN),new Ai(t,e,n,i)}function Ai(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function Ri(){return"#".concat(_i(this.r)).concat(_i(this.g)).concat(_i(this.b))}function Oi(){var t=Li(this.opacity);return"".concat(1===t?"rgb(":"rgba(").concat(Ii(this.r),", ").concat(Ii(this.g),", ").concat(Ii(this.b)).concat(1===t?")":", ".concat(t,")"))}function Li(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ii(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function _i(t){return(16>(t=Ii(t))?"0":"")+t.toString(16)}function Di(t,e,n,i){return i>0?n>0&&1>n?e>0||(t=NaN):t=e=NaN:t=e=n=NaN,new Gi(t,e,n,i)}function Fi(t){if(t instanceof Gi)return new Gi(t.h,t.s,t.l,t.opacity);if(t instanceof hi||(t=Pi(t)),!t)return new Gi;if(t instanceof Gi)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),a=Math.max(e,n,i),o=NaN,s=a-r,u=(a+r)/2;return s?(o=e===a?(n-i)/s+6*(i>n):n===a?(i-e)/s+2:(e-n)/s+4,s/=.5>u?a+r:2-a-r,o*=60):s=u>0&&1>u?0:o,new Gi(o,s,u,t.opacity)}function Gi(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function Bi(t){return 0>(t=(t||0)%360)?t+360:t}function Vi(t){return Math.max(0,Math.min(1,t||0))}function Ui(t,e,n){return 255*(60>t?e+(n-e)*t/60:180>t?n:240>t?e+(n-e)*(240-t)/60:e)}function Yi(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){for(var i=arguments.length,r=Array(i),a=0;i>a;a++)r[a]=arguments[a];var o=e?e.apply(this,r):r[0],s=n.cache;if(s.has(o))return s.get(o);var u=t.apply(this,r);return n.cache=s.set(o,u)||s,u};return n.cache=new(Yi.Cache||Map),Yi.cacheList.push(n.cache),n}li(hi,Pi,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:wi,formatHex:wi,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Fi(this).formatHsl()},formatRgb:Ni,toString:Ni}),li(Ai,function(t,e,n,i){return 1===arguments.length?((r=t)instanceof hi||(r=Pi(r)),r?new Ai((r=r.rgb()).r,r.g,r.b,r.opacity):new Ai):new Ai(t,e,n,null==i?1:i);var r},ci(hi,{brighter:function(t){return new Ai(this.r*(t=null==t?di:Math.pow(di,t)),this.g*t,this.b*t,this.opacity)},darker:function(t){return new Ai(this.r*(t=null==t?fi:Math.pow(fi,t)),this.g*t,this.b*t,this.opacity)},rgb:function(){return this},clamp:function(){return new Ai(Ii(this.r),Ii(this.g),Ii(this.b),Li(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:Ri,formatHex:Ri,formatHex8:function(){return"#".concat(_i(this.r)).concat(_i(this.g)).concat(_i(this.b)).concat(_i(255*(isNaN(this.opacity)?1:this.opacity)))},formatRgb:Oi,toString:Oi})),li(Gi,function(t,e,n,i){return 1===arguments.length?Fi(t):new Gi(t,e,n,null==i?1:i)},ci(hi,{brighter:function(t){return new Gi(this.h,this.s,this.l*(t=null==t?di:Math.pow(di,t)),this.opacity)},darker:function(t){return new Gi(this.h,this.s,this.l*(t=null==t?fi:Math.pow(fi,t)),this.opacity)},rgb:function(){var t=this.h%360+360*(0>this.h),e=this.l,n=e+(.5>e?e:1-e)*(isNaN(t)||isNaN(this.s)?0:this.s),i=2*e-n;return new Ai(Ui(240>t?t+120:t-240,i,n),Ui(t,i,n),Ui(120>t?t+240:t-120,i,n),this.opacity)},clamp:function(){return new Gi(Bi(this.h),Vi(this.s),Vi(this.l),Li(this.opacity))},displayable:function(){return(this.s>=0&&1>=this.s||isNaN(this.s))&&this.l>=0&&1>=this.l&&this.opacity>=0&&1>=this.opacity},formatHsl:function(){var t=Li(this.opacity);return"".concat(1===t?"hsl(":"hsla(").concat(Bi(this.h),", ").concat(100*Vi(this.s),"%, ").concat(100*Vi(this.l),"%").concat(1===t?")":", ".concat(t,")"))}})),Yi.Cache=Map,Yi.cacheList=[],Yi.clearCache=function(){Yi.cacheList.forEach(function(t){return t.clear()})};var zi=function(t){return t[t.kUnknown=0]="kUnknown",t[t.kNumber=1]="kNumber",t[t.kPercentage=2]="kPercentage",t[t.kEms=3]="kEms",t[t.kPixels=4]="kPixels",t[t.kRems=5]="kRems",t[t.kDegrees=6]="kDegrees",t[t.kRadians=7]="kRadians",t[t.kGradians=8]="kGradians",t[t.kTurns=9]="kTurns",t[t.kMilliseconds=10]="kMilliseconds",t[t.kSeconds=11]="kSeconds",t[t.kInteger=12]="kInteger",t}({}),ji=function(t){return t[t.kUNumber=0]="kUNumber",t[t.kUPercent=1]="kUPercent",t[t.kULength=2]="kULength",t[t.kUAngle=3]="kUAngle",t[t.kUTime=4]="kUTime",t[t.kUOther=5]="kUOther",t}({}),Xi=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),Hi=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),Wi=[{name:"em",unit_type:zi.kEms},{name:"px",unit_type:zi.kPixels},{name:"deg",unit_type:zi.kDegrees},{name:"rad",unit_type:zi.kRadians},{name:"grad",unit_type:zi.kGradians},{name:"ms",unit_type:zi.kMilliseconds},{name:"s",unit_type:zi.kSeconds},{name:"rem",unit_type:zi.kRems},{name:"turn",unit_type:zi.kTurns}],qi=function(t){return t[t.kUnknownType=0]="kUnknownType",t[t.kUnparsedType=1]="kUnparsedType",t[t.kKeywordType=2]="kKeywordType",t[t.kUnitType=3]="kUnitType",t[t.kSumType=4]="kSumType",t[t.kProductType=5]="kProductType",t[t.kNegateType=6]="kNegateType",t[t.kInvertType=7]="kInvertType",t[t.kMinType=8]="kMinType",t[t.kMaxType=9]="kMaxType",t[t.kClampType=10]="kClampType",t[t.kTransformType=11]="kTransformType",t[t.kPositionType=12]="kPositionType",t[t.kURLImageType=13]="kURLImageType",t[t.kColorType=14]="kColorType",t[t.kUnsupportedColorType=15]="kUnsupportedColorType",t}({}),Zi=function(t){return t?"number"===t?zi.kNumber:"percent"===t||"%"===t?zi.kPercentage:function(t){return Wi.find(function(e){return e.name===t}).unit_type}(t):zi.kUnknown},Ki=function(t){var e=1;switch(t){case zi.kPixels:case zi.kDegrees:case zi.kSeconds:break;case zi.kMilliseconds:e=.001;break;case zi.kRadians:e=180/Math.PI;break;case zi.kGradians:e=.9;break;case zi.kTurns:e=360}return e},Qi=function(t){switch(t){case zi.kNumber:case zi.kInteger:return"";case zi.kPercentage:return"%";case zi.kEms:return"em";case zi.kRems:return"rem";case zi.kPixels:return"px";case zi.kDegrees:return"deg";case zi.kRadians:return"rad";case zi.kGradians:return"grad";case zi.kMilliseconds:return"ms";case zi.kSeconds:return"s";case zi.kTurns:return"turn"}return""},$i=function(){return u(function t(){o(this,t)},[{key:"toString",value:function(){return this.buildCSSText(Xi.kNo,Hi.kNo,"")}},{key:"isNumericValue",value:function(){return this.getType()>=qi.kUnitType&&this.getType()<=qi.kClampType}}],[{key:"isAngle",value:function(t){return t===zi.kDegrees||t===zi.kRadians||t===zi.kGradians||t===zi.kTurns}},{key:"isLength",value:function(t){return t>=zi.kEms&&zi.kDegrees>t}},{key:"isRelativeUnit",value:function(t){return t===zi.kPercentage||t===zi.kEms||t===zi.kRems}},{key:"isTime",value:function(t){return t===zi.kSeconds||t===zi.kMilliseconds}}])}(),Ji=function(t){function e(t){var n;return o(this,e),(n=p(this,e)).colorSpace=t,n}return y(e,t),u(e,[{key:"getType",value:function(){return qi.kColorType}},{key:"to",value:function(t){return this}}])}($i),tr=function(t){return t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient",t}({}),er=function(t){function e(t,n){var i;return o(this,e),(i=p(this,e)).type=t,i.value=n,i}return y(e,t),u(e,[{key:"clone",value:function(){return new e(this.type,this.value)}},{key:"buildCSSText",value:function(t,e,n){return n}},{key:"getType",value:function(){return qi.kColorType}}])}($i),nr=function(t){function e(t){var n;return o(this,e),(n=p(this,e)).value=t,n}return y(e,t),u(e,[{key:"clone",value:function(){return new e(this.value)}},{key:"getType",value:function(){return qi.kKeywordType}},{key:"buildCSSText",value:function(t,e,n){return n+this.value}}])}($i),ir=function(t){return function(t){switch(t){case ji.kUNumber:return zi.kNumber;case ji.kULength:return zi.kPixels;case ji.kUPercent:return zi.kPercentage;case ji.kUTime:return zi.kSeconds;case ji.kUAngle:return zi.kDegrees;default:return zi.kUnknown}}(function(t){switch(t){case zi.kNumber:case zi.kInteger:return ji.kUNumber;case zi.kPercentage:return ji.kUPercent;case zi.kPixels:return ji.kULength;case zi.kMilliseconds:case zi.kSeconds:return ji.kUTime;case zi.kDegrees:case zi.kRadians:case zi.kGradians:case zi.kTurns:return ji.kUAngle;default:return ji.kUOther}}(t))},rr=function(t){function e(t){var n,i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zi.kNumber;return o(this,e),n=p(this,e),i="string"==typeof r?Zi(r):r,n.unit=i,n.value=t,n}return y(e,t),u(e,[{key:"clone",value:function(){return new e(this.value,this.unit)}},{key:"equals",value:function(t){return this.value===t.value&&this.unit===t.unit}},{key:"getType",value:function(){return qi.kUnitType}},{key:"convertTo",value:function(t){if(this.unit===t)return new e(this.value,this.unit);var n=ir(this.unit);if(n!==ir(t)||n===zi.kUnknown)return null;var i=Ki(this.unit)/Ki(t);return new e(this.value*i,t)}},{key:"buildCSSText",value:function(t,e,n){var i;switch(this.unit){case zi.kUnknown:break;case zi.kInteger:i=Number(this.value).toFixed(0);break;case zi.kNumber:case zi.kPercentage:case zi.kEms:case zi.kRems:case zi.kPixels:case zi.kDegrees:case zi.kRadians:case zi.kGradians:case zi.kMilliseconds:case zi.kSeconds:case zi.kTurns:var r=this.value,a=Qi(this.unit);if(-999999>r||r>999999){var o=Qi(this.unit);i=!Number.isFinite(r)||Number.isNaN(r)?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(Number.isFinite(t)?"NaN":t>0?"infinity":"-infinity")+e}(r,o):r+(o||"")}else i="".concat(r).concat(a)}return n+=i}}])}($i),ar=new rr(0,"px");new rr(1,"px");var or=new rr(0,"deg"),sr=function(t){function e(t,n,i){var r,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return o(this,e),(r=p(this,e,["rgb"])).r=t,r.g=n,r.b=i,r.alpha=a,r.isNone=s,r}return y(e,t),u(e,[{key:"clone",value:function(){return new e(this.r,this.g,this.b,this.alpha)}},{key:"buildCSSText",value:function(t,e,n){return"".concat(n,"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")}}])}(Ji),ur=new nr("unset"),lr={"":ur,unset:ur,initial:new nr("initial"),inherit:new nr("inherit")},cr=new sr(0,0,0,0,!0),hr=new sr(0,0,0,0),fr=Yi(function(t,e,n,i){return new sr(t,e,n,i)},function(t,e,n,i){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(i,")")}),dr=function(t){return new rr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:zi.kNumber)};function vr(t){var e=t.type,n=t.value;return"hex"===e?"#".concat(n):"literal"===e?n:"rgb"===e?"rgb(".concat(n.join(","),")"):"rgba(".concat(n.join(","),")")}new rr(50,"%");var pr=function(){var t=/^(linear\-gradient)/i,e=/^(repeating\-linear\-gradient)/i,n=/^(radial\-gradient)/i,i=/^(repeating\-radial\-gradient)/i,r=/^(conic\-gradient)/i,a=/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,o=/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,s=/^(left|center|right|top|bottom)/i,u=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,l=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,c=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,h=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,f=/^\(/,d=/^\)/,v=/^,/,p=/^\#([0-9a-fA-F]+)/,m=/^([a-zA-Z]+)/,y=/^rgb/i,g=/^rgba/i,k=/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,E="";function x(t){throw Error("".concat(E,": ").concat(t))}function b(){var t=O(T);return E.length>0&&x("Invalid input not EOF"),t}function T(){return M("linear-gradient",t,N)||M("repeating-linear-gradient",e,N)||M("radial-gradient",n,P)||M("repeating-radial-gradient",i,P)||M("conic-gradient",r,P)}function M(t,e,n){return w(e,function(e){var i=n();return i&&(G(v)||x("Missing comma before color stops")),{type:t,orientation:i,colorStops:O(L)}})}function w(t,e){var n=G(t);if(n){G(f)||x("Missing (");var i=e(n);return G(d)||x("Missing )"),i}}function N(){return F("directional",a,1)||F("angular",h,1)}function P(){var t,e,n=S();return n&&((t=[]).push(n),e=E,G(v)&&((n=S())?t.push(n):E=e)),t}function S(){var t=function(){var t=F("shape",/^(circle)/i,0);t&&(t.style=D()||C());return t}()||function(){var t=F("shape",/^(ellipse)/i,0);t&&(t.style=_()||C());return t}();if(t)t.at=A();else{var e=C();if(e){t=e;var n=A();n&&(t.at=n)}else{var i=R();i&&(t={type:"default-radial",at:i})}}return t}function C(){return F("extent-keyword",o,1)}function A(){if(F("position",/^at/,0)){var t=R();return t||x("Missing positioning value"),t}}function R(){var t={x:_(),y:_()};if(t.x||t.y)return{type:"position",value:t}}function O(t){var e=t(),n=[];if(e)for(n.push(e);G(v);)(e=t())?n.push(e):x("One extra comma");return n}function L(){var t=F("hex",p,1)||w(g,function(){return{type:"rgba",value:O(I)}})||w(y,function(){return{type:"rgb",value:O(I)}})||F("literal",m,0);return t||x("Expected color definition"),t.length=_(),t}function I(){return G(k)[1]}function _(){return F("%",l,1)||F("position-keyword",s,1)||D()}function D(){return F("px",u,1)||F("em",c,1)}function F(t,e,n){var i=G(e);if(i)return{type:t,value:i[n]}}function G(t){var e=/^[\n\r\t\s]+/.exec(E);e&&B(e[0].length);var n=t.exec(E);return n&&B(n[0].length),n}function B(t){E=E.substring(t)}return function(t){return E=t,b()}}();var mr=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,yr=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,gr=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,kr=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var Er={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},xr=Yi(function(t){return dr("angular"===t.type?Number(t.value):Er[t.value]||0,"deg")}),br=Yi(function(t){var e=50,n=50,i="%",r="%";if("position"===(null==t?void 0:t.type)){var a=t.value,o=a.x,s=a.y;"position-keyword"===(null==o?void 0:o.type)&&("left"===o.value?e=0:"center"===o.value?e=50:"right"===o.value?e=100:"top"===o.value?n=0:"bottom"===o.value&&(n=100)),"position-keyword"===(null==s?void 0:s.type)&&("left"===s.value?e=0:"center"===s.value?n=50:"right"===s.value?e=100:"top"===s.value?n=0:"bottom"===s.value&&(n=100)),"px"!==(null==o?void 0:o.type)&&"%"!==(null==o?void 0:o.type)&&"em"!==(null==o?void 0:o.type)||(i=null==o?void 0:o.type,e=Number(o.value)),"px"!==(null==s?void 0:s.type)&&"%"!==(null==s?void 0:s.type)&&"em"!==(null==s?void 0:s.type)||(r=null==s?void 0:s.type,n=Number(s.value))}return{cx:dr(e,i),cy:dr(n,r)}}),Tr=Yi(function(t){if(t.indexOf("linear")>-1||t.indexOf("radial")>-1)return pr(t).map(function(t){var e=t.type,n=t.orientation,i=t.colorStops;!function(t){var e,n,i=t.length;t[i-1].length=null!==(e=t[i-1].length)&&void 0!==e?e:{type:"%",value:"100"},i>1&&(t[0].length=null!==(n=t[0].length)&&void 0!==n?n:{type:"%",value:"0"});for(var r=0,a=Number(t[0].length.value),o=1;i>o;o++){var s,u=null===(s=t[o].length)||void 0===s?void 0:s.value;if(!_t(u)&&!_t(a)){for(var l=1;o-r>l;l++)t[r+l].length={type:"%",value:"".concat(a+(Number(u)-a)*l/(o-r))};r=o,a=Number(u)}}}(i);var r,a=i.map(function(t){return{offset:dr(Number(t.length.value),"%"),color:vr(t)}});if("linear-gradient"===e)return new er(tr.LinearGradient,{angle:n?xr(n):or,steps:a});if("radial-gradient"===e&&(n||(n=[{type:"shape",value:"circle"}]),"shape"===n[0].type&&"circle"===n[0].value)){var o,s=br(n[0].at),u=s.cx,l=s.cy;if(n[0].style){var c=n[0].style,h=c.type,f=c.value;"extent-keyword"===h?(lr[r=f]||(lr[r]=new nr(r)),o=lr[r]):o=dr(f,h)}return new er(tr.RadialGradient,{cx:u,cy:l,size:o,steps:a})}});var e=t[0];if("("===t[1]||"("===t[2])if("l"===e){var n=mr.exec(t);if(n){var i,r=(null===(i=n[2].match(kr))||void 0===i?void 0:i.map(function(t){return t.split(":")}))||[];return[new er(tr.LinearGradient,{angle:dr(parseFloat(n[1]),"deg"),steps:r.map(function(t){var e=g(t,2),n=e[1];return{offset:dr(100*Number(e[0]),"%"),color:n}})})]}}else if("r"===e){var a=function(t){var e=yr.exec(t);if(e){var n,i=(null===(n=e[4].match(kr))||void 0===n?void 0:n.map(function(t){return t.split(":")}))||[];return{cx:dr(50,"%"),cy:dr(50,"%"),steps:i.map(function(t){var e=g(t,2),n=e[1];return{offset:dr(100*Number(e[0]),"%"),color:n}})}}return null}(t);if(a){if(!Ut(a))return[new er(tr.RadialGradient,a)];t=a}}else if("p"===e)return function(t){var e=gr.exec(t);if(e){var n=e[1],i=e[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;default:n="no-repeat"}return{image:i,repetition:n}}return null}(t)});function Mr(t){return t&&!!t.image}function wr(t){return t&&!_t(t.r)&&!_t(t.g)&&!_t(t.b)}var Nr=Yi(function(t){if(Mr(t))return a({repetition:"repeat"},t);if(_t(t)&&(t=""),"transparent"===t)return hr;if("currentColor"===t)t="black";else if("none"===t)return cr;var e=Tr(t);if(e)return e;var n=Pi(t),i=[0,0,0,0];return null!==n&&(i[0]=n.r||0,i[1]=n.g||0,i[2]=n.b||0,i[3]=n.opacity),fr.apply(void 0,i)});function Pr(t,e){if(wr(t)&&wr(e))return[[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],function(t){var e=t.slice();if(e[3])for(var n=0;3>n;n++)e[n]=Math.round(Yt(e[n],0,255));return e[3]=Yt(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function Sr(t,e){if(_t(e))return dr(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return dr(Number(e),"px");if("deg".search(t)>=0)return dr(Number(e),"deg")}var n=[];e=e.replace(t,function(t){return n.push(t),"U".concat(t)});var i="U(".concat(t.source,")");return n.map(function(t){return dr(Number(e.replace(RegExp("U".concat(t),"g"),"").replace(RegExp(i,"g"),"*0")),t)})[0]}var Cr=function(t){return Sr(/px/g,t)},Ar=Yi(Cr);Yi(function(t){return Sr(RegExp("%","g"),t)});var Rr=function(t){return zt(t)||isFinite(Number(t))?dr(Number(t)||0,"px"):Sr(RegExp("px|%|em|rem","g"),t)},Or=Yi(Rr),Lr=function(t){return Sr(/deg|rad|grad|turn/g,t)},Ir=Yi(Lr);function _r(t,e,n,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a="",o=t.value||0,s=e.value||0,u=ir(t.unit),l=t.convertTo(u),c=e.convertTo(u);return l&&c?(o=l.value,s=c.value,a=Qi(t.unit)):(rr.isLength(t.unit)||rr.isLength(e.unit))&&(o=Gr(t,r,n),s=Gr(e,r,n),a="px"),[o,s,function(t){return i&&(t=Math.max(t,0)),t+a}]}function Dr(t){var e=0;return t.unit===zi.kDegrees?e=t.value:t.unit===zi.kRadians?e=Dn(Number(t.value)):t.unit===zi.kTurns?e=Fn(Number(t.value)):t.value&&(e=t.value),e}function Fr(t,e){var n;return Array.isArray(t)?n=t.map(function(t){return Number(t)}):Ut(t)?n=t.split(" ").map(function(t){return Number(t)}):zt(t)&&(n=[t]),2===e?1===n.length?[n[0],n[0]]:[n[0],n[1]]:4===e?1===n.length?[n[0],n[0],n[0],n[0]]:2===n.length?[n[0],n[1],n[0],n[1]]:3===n.length?[n[0],n[1],n[2],n[1]]:[n[0],n[1],n[2],n[3]]:"even"===e&&n.length%2==1?[].concat(h(n),h(n)):n}function Gr(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(t.unit===zi.kPixels)return Number(t.value);if(t.unit===zi.kPercentage&&n){var r=n.nodeName===fn.GROUP?n.getLocalBounds():n.getGeometryBounds();return(i?r.min[e]:0)+t.value/100*r.halfExtents[e]*2}return 0}var Br=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Vr(t){return""+t}var Ur=function(t){return dr("number"==typeof t?t:/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Number(t):0)},Yr=Yi(Ur);function zr(t,e){return[t,e,Vr]}function jr(t,e){return function(n,i){return[n,i,function(n){return Vr(Yt(n,t,e))}]}}function Xr(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function Hr(t){var e;return 0===t.parsedStyle.d.totalLength&&(t.parsedStyle.d.totalLength=Ae(t.parsedStyle.d.absolutePath,void 0,qt(qt({},e),{bbox:!1,length:!0})).length),t.parsedStyle.d.totalLength}function Wr(t,e){return t[0]===e[0]&&t[1]===e[1]}function qr(t,e){var n=t.prePoint,i=t.currentPoint,r=t.nextPoint,a=Math.pow(i[0]-n[0],2)+Math.pow(i[1]-n[1],2),o=Math.pow(i[0]-r[0],2)+Math.pow(i[1]-r[1],2),s=Math.acos((a+o-(Math.pow(n[0]-r[0],2)+Math.pow(n[1]-r[1],2)))/(2*Math.sqrt(a)*Math.sqrt(o)));if(!s||0===Math.sin(s)||jt(s,0))return{xExtra:0,yExtra:0};var u=Math.abs(Math.atan2(r[1]-i[1],r[0]-i[0])),l=Math.abs(Math.atan2(r[0]-i[0],r[1]-i[1]));return l=l>Math.PI/2?Math.PI-l:l,{xExtra:Math.cos(s/2-(u=u>Math.PI/2?Math.PI-u:u))*(e/2*(1/Math.sin(s/2)))-e/2||0,yExtra:Math.cos(l-s/2)*(e/2*(1/Math.sin(s/2)))-e/2||0}}function Zr(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}Yi(function(t){return Ut(t)?t.split(" ").map(Yr):t.map(Yr)});var Kr=function(t,e){return(0>t.x*e.y-t.y*e.x?-1:1)*Math.acos((t.x*e.x+t.y*e.y)/Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2))))},Qr=function(t,e,n,i,r,a,o,s){e=Math.abs(e),n=Math.abs(n);var u=In(i=Xt(i,360));if(t.x===o.x&&t.y===o.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===e||0===n)return{x:0,y:0,ellipticalArcAngle:0};var l=(t.x-o.x)/2,c=(t.y-o.y)/2,h={x:Math.cos(u)*l+Math.sin(u)*c,y:-Math.sin(u)*l+Math.cos(u)*c},f=Math.pow(h.x,2)/Math.pow(e,2)+Math.pow(h.y,2)/Math.pow(n,2);f>1&&(e*=Math.sqrt(f),n*=Math.sqrt(f));var d=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(h.y,2)-Math.pow(n,2)*Math.pow(h.x,2))/(Math.pow(e,2)*Math.pow(h.y,2)+Math.pow(n,2)*Math.pow(h.x,2)),v=(r!==a?1:-1)*Math.sqrt(d=0>d?0:d),p=v*(e*h.y/n),m=v*(-n*h.x/e),y={x:Math.cos(u)*p-Math.sin(u)*m+(t.x+o.x)/2,y:Math.sin(u)*p+Math.cos(u)*m+(t.y+o.y)/2},g={x:(h.x-p)/e,y:(h.y-m)/n},k=Kr({x:1,y:0},g),E=Kr(g,{x:(-h.x-p)/e,y:(-h.y-m)/n});!a&&E>0?E-=2*Math.PI:a&&0>E&&(E+=2*Math.PI);var x=k+(E%=2*Math.PI)*s,b=e*Math.cos(x),T=n*Math.sin(x);return{x:Math.cos(u)*b-Math.sin(u)*T+y.x,y:Math.sin(u)*b+Math.cos(u)*T+y.y,ellipticalArcStartAngle:k,ellipticalArcEndAngle:k+E,ellipticalArcAngle:x,ellipticalArcCenter:y,resultantRx:e,resultantRy:n}};function $r(t,e){var n=2>=arguments.length||void 0===arguments[2]||arguments[2],i=t.arcParams,r=i.rx,a=void 0===r?0:r,o=i.ry,s=void 0===o?0:o,u=i.xRotation,l=i.arcFlag,c=i.sweepFlag,h=Qr({x:t.prePoint[0],y:t.prePoint[1]},a,s,u,!!l,!!c,{x:t.currentPoint[0],y:t.currentPoint[1]},e),f=Qr({x:t.prePoint[0],y:t.prePoint[1]},a,s,u,!!l,!!c,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),d=f.x-h.x,v=f.y-h.y,p=Math.sqrt(d*d+v*v);return{x:-d/p,y:-v/p}}function Jr(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function ta(t,e){return Jr(t)*Jr(e)?(t[0]*e[0]+t[1]*e[1])/(Jr(t)*Jr(e)):1}function ea(t,e){return(t[1]*e[0]>t[0]*e[1]?-1:1)*Math.acos(ta(t,e))}function na(t,e){var n=e[1],i=e[2],r=Xt(In(e[3]),2*Math.PI),a=e[4],o=e[5],s=t[0],u=t[1],l=e[6],c=e[7],h=Math.cos(r)*(s-l)/2+Math.sin(r)*(u-c)/2,f=-1*Math.sin(r)*(s-l)/2+Math.cos(r)*(u-c)/2,d=h*h/(n*n)+f*f/(i*i);d>1&&(n*=Math.sqrt(d),i*=Math.sqrt(d));var v=n*n*(f*f)+i*i*(h*h),p=v?Math.sqrt((n*n*(i*i)-v)/v):1;a===o&&(p*=-1),isNaN(p)&&(p=0);var m=i?p*n*f/i:0,y=n?p*-i*h/n:0,g=(s+l)/2+Math.cos(r)*m-Math.sin(r)*y,k=(u+c)/2+Math.sin(r)*m+Math.cos(r)*y,E=[(h-m)/n,(f-y)/i],x=[(-1*h-m)/n,(-1*f-y)/i],b=ea([1,0],E),T=ea(E,x);return ta(E,x)>-1||(T=Math.PI),1>ta(E,x)||(T=0),0===o&&T>0&&(T-=2*Math.PI),1===o&&0>T&&(T+=2*Math.PI),{cx:g,cy:k,rx:Wr(t,[l,c])?0:n,ry:Wr(t,[l,c])?0:i,startAngle:b,endAngle:b+T,xRotation:r,arcFlag:a,sweepFlag:o}}function ia(t,e,n,i){var r=.5522847498307936,a=t*r,o=e*r,s=n-t,u=n+t,l=i-e,c=i+e;return[["M",s,i],["C",s,i-o,n-a,l,n,l],["C",n+a,l,u,i-o,u,i],["C",u,i+o,n+a,c,n,c],["C",n-a,c,s,i+o,s,i],["Z"]]}var ra=function(t){if(""===t||Array.isArray(t)&&0===t.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var e;try{e=ve(t)}catch(n){e=ve(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}!function(t){for(var e=0;t.length>e;e++){var n=t[e-1],i=t[e];if("M"===i[0]&&n){var r=n[0],a=void 0;"L"===r||"M"===r?a=[n[1],n[2]]:"C"!==r&&"A"!==r&&"Q"!==r||(a=[n[n.length-2],n[n.length-1]]),a&&Wr([i[1],i[2]],a)&&(t.splice(e,1),e--)}}}(e);var n=function(t){for(var e=!1,n=t.length,i=0;n>i;i++){var r=t[i][0];if("C"===r||"A"===r||"Q"===r){e=!0;break}}return e}(e),i=function(t){for(var e=[],n=[],i=[],r=0;t.length>r;r++){var a=t[r],o=a[0];"M"===o?(i.length&&(n.push(i),i=[]),i.push([a[1],a[2]])):"Z"===o?i.length&&(e.push(i),i=[]):i.push([a[1],a[2]])}return i.length>0&&n.push(i),{polygons:e,polylines:n}}(e),r=i.polygons,a=i.polylines,o=function(t){for(var e=[],n=null,i=null,r=null,a=0,o=t.length,s=0;o>s;s++){var u=t[s];i=t[s+1];var l=u[0],c={command:l,prePoint:n,params:u,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(l){case"M":r=[u[1],u[2]],a=s;break;case"A":var h=na(n,u);c.arcParams=h}if("Z"===l)n=r,i=t[a+1];else{var f=u.length;n=[u[f-2],u[f-1]]}i&&"Z"===i[0]&&(i=t[a],e[a]&&(e[a].prePoint=n)),c.currentPoint=n,e[a]&&Wr(n,e[a].currentPoint)&&(e[a].prePoint=c.prePoint),c.nextPoint=i?[i[i.length-2],i[i.length-1]]:null;var d=c.prePoint;if(["L","H","V"].includes(l))c.startTangent=[d[0]-n[0],d[1]-n[1]],c.endTangent=[n[0]-d[0],n[1]-d[1]];else if("Q"===l){var v=[u[1],u[2]];c.startTangent=[d[0]-v[0],d[1]-v[1]],c.endTangent=[n[0]-v[0],n[1]-v[1]]}else if("T"===l){var p=e[s-1],m=Zr(p.currentPoint,d);"Q"===p.command?(c.command="Q",c.startTangent=[d[0]-m[0],d[1]-m[1]],c.endTangent=[n[0]-m[0],n[1]-m[1]]):(c.command="TL",c.startTangent=[d[0]-n[0],d[1]-n[1]],c.endTangent=[n[0]-d[0],n[1]-d[1]])}else if("C"===l){var y=[u[1],u[2]],g=[u[3],u[4]];c.startTangent=[d[0]-y[0],d[1]-y[1]],c.endTangent=[n[0]-g[0],n[1]-g[1]],0===c.startTangent[0]&&0===c.startTangent[1]&&(c.startTangent=[y[0]-g[0],y[1]-g[1]]),0===c.endTangent[0]&&0===c.endTangent[1]&&(c.endTangent=[g[0]-y[0],g[1]-y[1]])}else if("S"===l){var k=e[s-1],E=Zr(k.currentPoint,d),x=[u[1],u[2]];"C"===k.command?(c.command="C",c.startTangent=[d[0]-E[0],d[1]-E[1]],c.endTangent=[n[0]-x[0],n[1]-x[1]]):(c.command="SQ",c.startTangent=[d[0]-x[0],d[1]-x[1]],c.endTangent=[n[0]-x[0],n[1]-x[1]])}else if("A"===l){var b=$r(c,0),T=b.x,M=b.y,w=$r(c,1,!1),N=w.x,P=w.y;c.startTangent=[T,M],c.endTangent=[N,P]}e.push(c)}return e}(e),s=function(t,e){for(var n=[],i=[],r=[],a=0;t.length>a;a++){var o=t[a],s=o.currentPoint,u=o.params,l=o.prePoint,c=void 0;switch(o.command){case"Q":c=Ze(l[0],l[1],u[1],u[2],u[3],u[4]);break;case"C":c=Xe(l[0],l[1],u[1],u[2],u[3],u[4],u[5],u[6]);break;case"A":var h=o.arcParams;c=Ve(h.cx,h.cy,h.rx,h.ry,h.xRotation,h.startAngle,h.endAngle);break;default:n.push(s[0]),i.push(s[1])}c&&(o.box=c,n.push(c.x,c.x+c.width),i.push(c.y,c.y+c.height)),e&&("L"===o.command||"M"===o.command)&&o.prePoint&&o.nextPoint&&r.push(o)}n=n.filter(function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}),i=i.filter(function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0});var f=Vt(n),d=Vt(i),v=Bt(n),p=Bt(i);if(0===r.length)return{x:f,y:d,width:v-f,height:p-d};for(var m=0;r.length>m;m++){var y=r[m],g=y.currentPoint;g[0]===f?f-=qr(y,e).xExtra:g[0]===v&&(v+=qr(y,e).xExtra),g[1]===d?d-=qr(y,e).yExtra:g[1]===p&&(p+=qr(y,e).yExtra)}return{x:f,y:d,width:v-f,height:p-d}}(o,0),u=s.x,l=s.y,c=s.width,h=s.height;return{absolutePath:e,hasArc:n,segments:o,polygons:r,polylines:a,totalLength:0,rect:{x:Number.isFinite(u)?u:0,y:Number.isFinite(l)?l:0,width:Number.isFinite(c)?c:0,height:Number.isFinite(h)?h:0}}},aa=Yi(ra);function oa(t){return Ut(t)?aa(t):ra(t)}function sa(t,e,n){var i=t.curve,r=e.curve;i&&0!==i.length||(i=Ee(t.absolutePath,!1),t.curve=i),r&&0!==r.length||(r=Ee(e.absolutePath,!1),e.curve=r);var a=[i,r];i.length!==r.length&&(a=Le(i,r));var o,s,u,l,c,h,f,d,v=Re(a[0])!==Re(a[1])?(s=(o=a[0]).slice(1).map(function(t,e,n){return e?n[e-1].slice(-2).concat(t.slice(1)):o[0].slice(1).concat(t.slice(1))}).map(function(t){return t.map(function(e,n){return t[t.length-n-2*(1-n%2)]})}).reverse(),[["M"].concat(s[0].slice(0,2))].concat(s.map(function(t){return["C"].concat(t.slice(2))}))):a[0].map(function(t){return Array.isArray(t)?[].concat(t):t});return[v,(u=a[1],l=v,c=u.length-1,h=[],f=0,d=function(t){var e=t.length,n=e-1;return t.map(function(i,r){return t.map(function(i,a){var o=r+a;return 0===a||t[o]&&"M"===t[o][0]?["M"].concat(t[o].slice(-2)):(e>o||(o-=n),t[o])})})}(u),d.forEach(function(t,e){u.slice(1).forEach(function(t,n){f+=xe(u[(e+n)%c].slice(-2),l[n%c].slice(-2))}),h[e]=f,f=0}),d[h.indexOf(Math.min.apply(null,h))]),function(t){return t}]}function ua(t,e){return[t.points,e.points,function(t){return t}]}var la=null,ca=/\s*(\w+)\(([^)]*)\)/g;function ha(t){return function(e){var n=0;return t.map(function(t){return t===la?e[n++]:t})}}function fa(t){return t}var da={matrix:["NNNNNN",[la,la,0,0,la,la,0,0,0,0,1,0,la,la,0,1],fa],matrix3d:["NNNNNNNNNNNNNNNN",fa],rotate:["A"],rotateX:["A"],rotateY:["A"],rotateZ:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",ha([la,la,new rr(1)]),fa],scaleX:["N",ha([la,new rr(1),new rr(1)]),ha([la,new rr(1)])],scaleY:["N",ha([new rr(1),la,new rr(1)]),ha([new rr(1),la])],scaleZ:["N",ha([new rr(1),new rr(1),la])],scale3d:["NNN",fa],skew:["Aa",null,fa],skewX:["A",null,ha([la,or])],skewY:["A",null,ha([or,la])],translate:["Tt",ha([la,la,ar]),fa],translateX:["T",ha([la,ar,ar]),ha([la,ar])],translateY:["T",ha([ar,la,ar]),ha([ar,la])],translateZ:["L",ha([ar,ar,la])],translate3d:["TTL",fa]};function va(t){for(var e=[],n=t.length,i=0;n>i;i++){var r=t[i],a=r[0],o=r.slice(1);if("translate"===a||"skew"===a?1===o.length&&o.push(0):"scale"===a&&1===o.length&&o.push(o[0]),!da[a])return[];var s=o.map(function(t){return dr(t)});e.push({t:a,d:s})}return e}function pa(t){if(Array.isArray(t))return va(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],i=0;for(ca.lastIndex=0;e=ca.exec(t);){if(e.index!==i)return[];i=e.index+e[0].length;var r=e[1],a=da[r];if(!a)return[];var o=e[2].split(","),s=a[0];if(o.length>s.length)return[];for(var u=[],l=0;s.length>l;l++){var c=o[l],h=s[l],f=void 0;if(void 0===(f=c?{A:function(t){return"0"===t.trim()?or:Ir(t)},N:Yr,T:Or,L:Ar}[h.toUpperCase()](c):{a:or,n:u[0],t:ar}[h]))return[];u.push(f)}if(n.push({t:r,d:u}),ca.lastIndex===t.length)return n}return[]}function ma(t){if(Array.isArray(t))return va(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],i=0;for(ca.lastIndex=0;e=ca.exec(t);){if(e.index!==i)return[];i=e.index+e[0].length;var r=e[1],a=da[r];if(!a)return[];var o=e[2].split(","),s=a[0];if(o.length>s.length)return[];for(var u=[],l=0;s.length>l;l++){var c=o[l],h=s[l],f=void 0;if(void 0===(f=c?{A:function(t){return"0"===t.trim()?or:Lr(t)},N:Ur,T:Rr,L:Cr}[h.toUpperCase()](c):{a:or,n:u[0],t:ar}[h]))return[];u.push(f)}if(n.push({t:r,d:u}),ca.lastIndex===t.length)return n}return[]}function ya(t){var e,n,i,r;switch(t.t){case"rotateX":return r=In(Dr(t.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=In(Dr(t.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=In(Dr(t.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":e=t.d[0].value,n=t.d[1].value,i=t.d[2].value,r=In(Dr(t.d[3]));var a=e*e+n*n+i*i;if(0===a)e=1,n=0,i=0;else if(1!==a){var o=Math.sqrt(a);e/=o,n/=o,i/=o}var s=Math.sin(r/2),u=s*Math.cos(r/2),l=s*s;return[1-2*(n*n+i*i)*l,2*(e*n*l+i*u),2*(e*i*l-n*u),0,2*(e*n*l-i*u),1-2*(e*e+i*i)*l,2*(n*i*l+e*u),0,2*(e*i*l+n*u),2*(n*i*l-e*u),1-2*(e*e+n*n)*l,0,0,0,0,1];case"scale":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scaleX":return[t.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaleY":return[1,0,0,0,0,t.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scaleZ":return[1,0,0,0,0,1,0,0,0,0,t.d[0].value,0,0,0,0,1];case"scale3d":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,t.d[2].value,0,0,0,0,1];case"skew":var c=In(Dr(t.d[0])),h=In(Dr(t.d[1]));return[1,Math.tan(h),0,0,Math.tan(c),1,0,0,0,0,1,0,0,0,0,1];case"skewX":return r=In(Dr(t.d[0])),[1,0,0,0,Math.tan(r),1,0,0,0,0,1,0,0,0,0,1];case"skewY":return r=In(Dr(t.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,e=Gr(t.d[0],0,null)||0,n=Gr(t.d[1],0,null)||0,0,1];case"translateX":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Gr(t.d[0],0,null)||0,0,0,1];case"translateY":return[1,0,0,0,0,1,0,0,0,0,1,0,0,n=Gr(t.d[0],0,null)||0,0,1];case"translateZ":return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,i=Gr(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Gr(t.d[0],0,null)||0,n=Gr(t.d[1],0,null)||0,i=Gr(t.d[2],0,null)||0,1];case"perspective":var f=Gr(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,f?-1/f:0,0,0,0,1];case"matrix":return[t.d[0].value,t.d[1].value,0,0,t.d[2].value,t.d[3].value,0,0,0,0,1,0,t.d[4].value,t.d[5].value,0,1];case"matrix3d":return t.d.map(function(t){return t.value})}}function ga(t,e){return[t[0]*e[0]+t[4]*e[1]+t[8]*e[2]+t[12]*e[3],t[1]*e[0]+t[5]*e[1]+t[9]*e[2]+t[13]*e[3],t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]*e[3],t[3]*e[0]+t[7]*e[1]+t[11]*e[2]+t[15]*e[3],t[0]*e[4]+t[4]*e[5]+t[8]*e[6]+t[12]*e[7],t[1]*e[4]+t[5]*e[5]+t[9]*e[6]+t[13]*e[7],t[2]*e[4]+t[6]*e[5]+t[10]*e[6]+t[14]*e[7],t[3]*e[4]+t[7]*e[5]+t[11]*e[6]+t[15]*e[7],t[0]*e[8]+t[4]*e[9]+t[8]*e[10]+t[12]*e[11],t[1]*e[8]+t[5]*e[9]+t[9]*e[10]+t[13]*e[11],t[2]*e[8]+t[6]*e[9]+t[10]*e[10]+t[14]*e[11],t[3]*e[8]+t[7]*e[9]+t[11]*e[10]+t[15]*e[11],t[0]*e[12]+t[4]*e[13]+t[8]*e[14]+t[12]*e[15],t[1]*e[12]+t[5]*e[13]+t[9]*e[14]+t[13]*e[15],t[2]*e[12]+t[6]*e[13]+t[10]*e[14]+t[14]*e[15],t[3]*e[12]+t[7]*e[13]+t[11]*e[14]+t[15]*e[15]]}function ka(t){var e=[0,0,0],n=[1,1,1],i=[0,0,0],r=[0,0,0,1],a=[0,0,0,1];return function(t,e,n,i,r,a){if(!function(t,e){var n=e[15];if(0===n)return!1;for(var i=1/n,r=0;16>r;r++)t[r]=e[r]*i;return!0}(Yn,t))return!1;if(N(zn,Yn),zn[3]=0,zn[7]=0,zn[11]=0,zn[15]=1,1e-8>Math.abs(R(zn)))return!1;var o,s,u=Yn[3],l=Yn[7],c=Yn[11],h=Yn[12],f=Yn[13],d=Yn[14],v=Yn[15];if(0!==u||0!==l||0!==c){if(jn[0]=u,jn[1]=l,jn[2]=c,jn[3]=v,!A(zn,zn))return!1;C(zn,zn),bt(r,jn,zn)}else r[0]=r[1]=r[2]=0,r[3]=1;if(e[0]=h,e[1]=f,e[2]=d,(o=Xn)[0][0]=(s=Yn)[0],o[0][1]=s[1],o[0][2]=s[2],o[1][0]=s[4],o[1][1]=s[5],o[1][2]=s[6],o[2][0]=s[8],o[2][1]=s[9],o[2][2]=s[10],n[0]=rt(Xn[0]),ht(Xn[0],Xn[0]),i[0]=ft(Xn[0],Xn[1]),Wn(Xn[1],Xn[1],Xn[0],1,-i[0]),n[1]=rt(Xn[1]),ht(Xn[1],Xn[1]),i[0]/=n[1],i[1]=ft(Xn[0],Xn[2]),Wn(Xn[2],Xn[2],Xn[0],1,-i[1]),i[2]=ft(Xn[1],Xn[2]),Wn(Xn[2],Xn[2],Xn[1],1,-i[2]),n[2]=rt(Xn[2]),ht(Xn[2],Xn[2]),i[1]/=n[2],i[2]/=n[2],dt(Hn,Xn[1],Xn[2]),0>ft(Xn[0],Hn))for(var p=0;3>p;p++)n[p]*=-1,Xn[p][0]*=-1,Xn[p][1]*=-1,Xn[p][2]*=-1;a[0]=.5*Math.sqrt(Math.max(1+Xn[0][0]-Xn[1][1]-Xn[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-Xn[0][0]+Xn[1][1]-Xn[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-Xn[0][0]-Xn[1][1]+Xn[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+Xn[0][0]+Xn[1][1]+Xn[2][2],0)),Xn[2][1]>Xn[1][2]&&(a[0]=-a[0]),Xn[0][2]>Xn[2][0]&&(a[1]=-a[1]),Xn[1][0]>Xn[0][1]&&(a[2]=-a[2])}(function(t){return 0===t.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(ya).reduce(ga)}(t),e,n,i,r,a),[[e,n,i,a,r]]}var Ea=function(){function t(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],i=0;4>i;i++)for(var r=0;4>r;r++)for(var a=0;4>a;a++)n[i][r]+=e[i][a]*t[a][r];return n}return function(e,n,i,r,a){for(var o=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;4>s;s++)o[s][3]=a[s];for(var u=0;3>u;u++)for(var l=0;3>l;l++)o[3][u]+=e[l]*o[l][u];var c=r[0],h=r[1],f=r[2],d=r[3],v=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];v[0][0]=1-2*(h*h+f*f),v[0][1]=2*(c*h-f*d),v[0][2]=2*(c*f+h*d),v[1][0]=2*(c*h+f*d),v[1][1]=1-2*(c*c+f*f),v[1][2]=2*(h*f-c*d),v[2][0]=2*(c*f-h*d),v[2][1]=2*(h*f+c*d),v[2][2]=1-2*(c*c+h*h),o=t(o,v);var p,m=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];i[2]&&(m[2][1]=i[2],o=t(o,m)),i[1]&&(m[2][1]=0,m[2][0]=i[0],o=t(o,m)),i[0]&&(m[2][0]=0,m[1][0]=i[0],o=t(o,m));for(var y=0;3>y;y++)for(var g=0;3>g;g++)o[y][g]*=n[y];return 0===(p=o)[0][2]&&0===p[0][3]&&0===p[1][2]&&0===p[1][3]&&0===p[2][0]&&0===p[2][1]&&1===p[2][2]&&0===p[2][3]&&0===p[3][2]&&1===p[3][3]?[o[0][0],o[0][1],o[1][0],o[1][1],o[3][0],o[3][1]]:o[0].concat(o[1],o[2],o[3])}}();function xa(t){return t.toFixed(6).replace(".000000","")}function ba(t,e){var n,i;return t.decompositionPair!==e&&(t.decompositionPair=e,n=ka(t)),e.decompositionPair!==t&&(e.decompositionPair=t,i=ka(e)),null===n[0]||null===i[0]?[[!1],[!0],function(n){return n?e[0].d:t[0].d}]:(n[0].push(0),i[0].push(1),[n,i,function(t){var e=function(t,e,n){var i=function(t,e){for(var n=0,i=0;t.length>i;i++)n+=t[i]*e[i];return n}(t,e);i=Yt(i,-1,1);var r=[];if(1===i)r=t;else for(var a=Math.acos(i),o=1*Math.sin(n*a)/Math.sqrt(1-i*i),s=0;4>s;s++)r.push(t[s]*(Math.cos(n*a)-i*o)+e[s]*o);return r}(n[0][3],i[0][3],t[5]);return Ea(t[0],t[1],t[2],e,t[4]).map(xa).join(",")}])}function Ta(t){return t.replace(/[XY]/,"")}function Ma(t){return t.replace(/(X|Y|Z|3d)?$/,"3d")}var wa=function(t,e){return"perspective"===t&&"perspective"===e||("matrix"===t||"matrix3d"===t)&&("matrix"===e||"matrix3d"===e)};function Na(t,e,n){var i=!1;if(!t.length||!e.length){t.length||(i=!0,t=e,e=[]);for(var r=function(){var n=t[a],i=n.t,r=n.d,o="scale"===i.substring(0,5)?1:0;e.push({t:i,d:r.map(function(t){return"number"==typeof t?dr(o):dr(o,t.unit)})})},a=0;t.length>a;a++)r()}var o=[],s=[],u=[];if(t.length!==e.length){var l=ba(t,e);o=[l[0]],s=[l[1]],u=[["matrix",[l[2]]]]}else for(var c=0;t.length>c;c++){var h=t[c].t,f=e[c].t,d=t[c].d,v=e[c].d,p=da[h],m=da[f],y=void 0;if(wa(h,f)){var g=ba([t[c]],[e[c]]);o.push(g[0]),s.push(g[1]),u.push(["matrix",[g[2]]])}else{if(h===f)y=h;else if(p[2]&&m[2]&&Ta(h)===Ta(f))y=Ta(h),d=p[2](d),v=m[2](v);else{if(!p[1]||!m[1]||Ma(h)!==Ma(f)){var k=ba(t,e);o=[k[0]],s=[k[1]],u=[["matrix",[k[2]]]];break}y=Ma(h),d=p[1](d),v=m[1](v)}for(var E=[],x=[],b=[],T=0;d.length>T;T++){var M=_r(d[T],v[T],n,!1,T);E[T]=M[0],x[T]=M[1],b.push(M[2])}o.push(E),s.push(x),u.push([y,b])}}if(i){var w=o;o=s,s=w}return[o,s,function(t){return t.map(function(t,e){var n=t.map(function(t,n){return u[e][1][n](t)}).join(",");return"matrix"===u[e][0]&&16===n.split(",").length&&(u[e][0]="matrix3d"),"matrix3d"===u[e][0]&&6===n.split(",").length&&(u[e][0]="matrix"),"".concat(u[e][0],"(").concat(n,")")}).join(" ")}]}var Pa=Yi(function(t){if(Ut(t)){if("text-anchor"===t)return[dr(0,"px"),dr(0,"px")];var e=t.split(" ");return 1===e.length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[Or(Sa(e[0])),Or(Sa(e[1]))]}return[dr(t[0]||0,"px"),dr(t[1]||0,"px")]});function Sa(t){return"center"===t?"50%":"left"===t||"top"===t?"0%":"right"===t||"bottom"===t?"100%":t}var Ca=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:ui.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:ui.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:ui.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:ui.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:ui.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:ui.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:ui.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:ui.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:ui.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:ui.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:ui.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:ui.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:ui.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:ui.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:ui.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:ui.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:ui.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:ui.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:ui.FILTER},{n:"clipPath",syntax:ui.DEFINED_PATH},{n:"textPath",syntax:ui.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:ui.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:ui.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:ui.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:ui.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:ui.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:ui.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:ui.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:ui.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:ui.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:ui.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:ui.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:ui.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:ui.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:ui.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:ui.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:ui.COORDINATE},{n:"y1",int:!0,l:!0,syntax:ui.COORDINATE},{n:"z1",int:!0,l:!0,syntax:ui.COORDINATE},{n:"x2",int:!0,l:!0,syntax:ui.COORDINATE},{n:"y2",int:!0,l:!0,syntax:ui.COORDINATE},{n:"z2",int:!0,l:!0,syntax:ui.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:ui.PATH,p:50},{n:"points",int:!0,l:!0,syntax:ui.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:ui.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:ui.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:ui.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:ui.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:ui.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:ui.NUMBER,d:function(t){return t===fn.PATH||t===fn.POLYGON||t===fn.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:ui.MARKER},{n:"markerEnd",syntax:ui.MARKER},{n:"markerMid",syntax:ui.MARKER},{n:"markerStartOffset",syntax:ui.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:ui.LENGTH,l:!0,int:!0,d:"0"}],Aa=new Set(Ca.filter(function(t){return!!t.l}).map(function(t){return t.n})),Ra={},Oa=function(){return u(function t(e){var n=this;o(this,t),this.runtime=e,Ca.forEach(function(t){n.registerMetadata(t)})},[{key:"registerMetadata",value:function(t){[t.n].concat(h(t.a||[])).forEach(function(e){Ra[e]=t})}},{key:"getPropertySyntax",value:function(t){return this.runtime.CSSPropertySyntaxFactory[t]}},{key:"processProperties",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0};Object.assign(t.attributes,e);var i=t.parsedStyle.clipPath,r=t.parsedStyle.offsetPath;!function(t,e){var n=La(t);for(var i in e)n.has(i)&&(t.parsedStyle[i]=e[i])}(t,e);var o=!!n.forceUpdateGeometry;if(!o)for(var s in e)if(Aa.has(s)){o=!0;break}var u,l=La(t);l.has("fill")&&e.fill&&(t.parsedStyle.fill=Nr(e.fill)),l.has("stroke")&&e.stroke&&(t.parsedStyle.stroke=Nr(e.stroke)),l.has("shadowColor")&&e.shadowColor&&(t.parsedStyle.shadowColor=Nr(e.shadowColor)),l.has("filter")&&e.filter&&(t.parsedStyle.filter=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if("none"===(t=t.toLowerCase().trim()))return[];for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,i=[],r=0;e=n.exec(t);){if(e.index!==r)return[];if(r=e.index+e[0].length,Br.indexOf(e[1])>-1&&i.push({name:e[1],params:e[2].split(" ").map(function(t){return Sr(/deg|rad|grad|turn|px|%/g,t)||Nr(t)})}),n.lastIndex===t.length)return i}return[]}(e.filter)),l.has("radius")&&!_t(e.radius)&&(t.parsedStyle.radius=Fr(e.radius,4)),l.has("lineDash")&&!_t(e.lineDash)&&(t.parsedStyle.lineDash=Fr(e.lineDash,"even")),l.has("points")&&e.points&&(t.parsedStyle.points={points:Ut(u=e.points)?u.split(" ").map(function(t){var e=g(t.split(","),2),n=e[1];return[Number(e[0]),Number(n)]}):u,totalLength:0,segments:[]}),l.has("d")&&""===e.d&&(t.parsedStyle.d=a({},si)),l.has("d")&&e.d&&(t.parsedStyle.d=oa(e.d)),l.has("textTransform")&&e.textTransform&&this.runtime.CSSPropertySyntaxFactory[ui.TEXT_TRANSFORM].calculator(null,null,{value:e.textTransform},t,null),l.has("clipPath")&&!Wt(e.clipPath)&&this.runtime.CSSPropertySyntaxFactory[ui.DEFINED_PATH].calculator("clipPath",i,e.clipPath,t,this.runtime),l.has("offsetPath")&&e.offsetPath&&this.runtime.CSSPropertySyntaxFactory[ui.DEFINED_PATH].calculator("offsetPath",r,e.offsetPath,t,this.runtime),l.has("transform")&&e.transform&&(t.parsedStyle.transform=pa(e.transform)),l.has("transformOrigin")&&e.transformOrigin&&(t.parsedStyle.transformOrigin=Pa(e.transformOrigin)),l.has("markerStart")&&e.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[ui.MARKER].calculator(null,e.markerStart,e.markerStart,null,null)),l.has("markerEnd")&&e.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[ui.MARKER].calculator(null,e.markerEnd,e.markerEnd,null,null)),l.has("markerMid")&&e.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[ui.MARKER].calculator("",e.markerMid,e.markerMid,null,null)),l.has("zIndex")&&!_t(e.zIndex)&&this.runtime.CSSPropertySyntaxFactory[ui.Z_INDEX].postProcessor(t),l.has("offsetDistance")&&!_t(e.offsetDistance)&&this.runtime.CSSPropertySyntaxFactory[ui.OFFSET_DISTANCE].postProcessor(t),l.has("transform")&&e.transform&&this.runtime.CSSPropertySyntaxFactory[ui.TRANSFORM].postProcessor(t),l.has("transformOrigin")&&e.transformOrigin&&this.runtime.CSSPropertySyntaxFactory[ui.TRANSFORM_ORIGIN].postProcessor(t),o&&(t.geometry.dirty=!0,t.dirty(!0,!0),n.forceUpdateGeometry||this.runtime.sceneGraphService.dirtyToRoot(t))}},{key:"updateGeometry",value:function(t){var e=t.nodeName,n=this.runtime.geometryUpdaterFactory[e];if(n){var i=t.geometry;i.contentBounds||(i.contentBounds=new bn),i.renderBounds||(i.renderBounds=new bn);var r=t.parsedStyle,a=n.update(r,t),o=a.cx,s=void 0===o?0:o,u=a.cy,l=void 0===u?0:u,c=a.cz,h=void 0===c?0:c,f=a.hwidth,d=void 0===f?0:f,v=a.hheight,p=void 0===v?0:v,m=a.hdepth,y=void 0===m?0:m,g=[Math.abs(d),Math.abs(p),y],k=r.stroke,E=r.lineWidth,x=void 0===E?1:E,b=r.increasedLineWidthForHitTesting,T=void 0===b?0:b,M=r.shadowType,w=void 0===M?"outer":M,N=r.shadowColor,P=r.filter,S=void 0===P?[]:P,C=r.transformOrigin,A=[s,l,h];if(i.contentBounds.update(A,g),k&&!k.isNone){var R=((x||0)+(T||0))*(e===fn.POLYLINE||e===fn.POLYGON||e===fn.PATH?Math.SQRT2:.5);g[0]+=R,g[1]+=R}if(i.renderBounds.update(A,g),N&&w&&"inner"!==w){var O=i.renderBounds,L=O.min,I=O.max,_=r.shadowBlur||0,D=r.shadowOffsetX||0,F=r.shadowOffsetY||0,G=I[0]+_+D,B=L[1]-_+F,V=I[1]+_+F;L[0]=Math.min(L[0],L[0]-_+D),I[0]=Math.max(I[0],G),L[1]=Math.min(L[1],B),I[1]=Math.max(I[1],V),i.renderBounds.setMinMax(L,I)}S.forEach(function(t){var e=t.name,n=t.params;if("blur"===e){var r=n[0].value;i.renderBounds.update(i.renderBounds.center,ut(i.renderBounds.halfExtents,i.renderBounds.halfExtents,[r,r,0]))}else if("drop-shadow"===e){var a=n[0].value,o=n[1].value,s=n[2].value,u=i.renderBounds,l=u.min,c=u.max,h=c[0]+s+a,f=l[1]-s+o,d=c[1]+s+o;l[0]=Math.min(l[0],l[0]-s+a),c[0]=Math.max(c[0],h),l[1]=Math.min(l[1],f),c[1]=Math.max(c[1],d),i.renderBounds.setMinMax(l,c)}}),t.geometry.dirty=!1;var U=0>p,Y=(0>d?-1:1)*(C?Gr(C[0],0,t,!0):0),z=(U?-1:1)*(C?Gr(C[1],1,t,!0):0);(Y||z)&&t.setOrigin(Y,z)}}},{key:"updateSizeAttenuation",value:function(t,e){t.style.isSizeAttenuation?(t.style.rawLineWidth||(t.style.rawLineWidth=t.style.lineWidth),t.style.lineWidth=(t.style.rawLineWidth||1)/e,t.nodeName===fn.CIRCLE&&(t.style.rawR||(t.style.rawR=t.style.r),t.style.r=(t.style.rawR||1)/e)):(t.style.rawLineWidth&&(t.style.lineWidth=t.style.rawLineWidth,delete t.style.rawLineWidth),t.nodeName===fn.CIRCLE&&t.style.rawR&&(t.style.r=t.style.rawR,delete t.style.rawR))}}])}();function La(t){return t.constructor.PARSED_STYLE_LIST}var Ia=function(){return u(function t(){o(this,t),this.mixer=zr},[{key:"calculator",value:function(t,e,n,i){return Dr(n)}}])}(),_a=function(){return u(function t(){o(this,t)},[{key:"calculator",value:function(t,e,n,i,r){return n instanceof nr&&(n=null),r.sceneGraphService.updateDisplayObjectDependency(t,e,n,i),"clipPath"===t&&i.forEach(function(t){0===t.childNodes.length&&r.sceneGraphService.dirtyToRoot(t)}),n}}])}(),Da=function(){return u(function t(){o(this,t),this.parser=Nr,this.mixer=Pr},[{key:"calculator",value:function(t,e,n,i){return n instanceof nr?"none"===n.value?cr:hr:n}}])}(),Fa=function(){return u(function t(){o(this,t)},[{key:"calculator",value:function(t,e,n){return n instanceof nr?[]:n}}])}();function Ga(t){var e=t.parsedStyle.fontSize;return _t(e)?null:e}var Ba=function(){return u(function t(){o(this,t),this.mixer=zr},[{key:"calculator",value:function(t,e,n,i,r){if(zt(n))return n;if(!rr.isRelativeUnit(n.unit))return n.value;if(n.unit===zi.kPercentage)return 0;if(n.unit===zi.kEms){if(i.parentNode){var a=Ga(i.parentNode);if(a)return a*=n.value}return 0}if(n.unit===zi.kRems){var o;if(null!=i&&null!==(o=i.ownerDocument)&&void 0!==o&&o.documentElement){var s=Ga(i.ownerDocument.documentElement);if(s)return s*=n.value}return 0}}}])}(),Va=function(){return u(function t(){o(this,t),this.mixer=Xr},[{key:"calculator",value:function(t,e,n){return n.map(function(t){return t.value})}}])}(),Ua=function(){return u(function t(){o(this,t),this.mixer=Xr},[{key:"calculator",value:function(t,e,n){return n.map(function(t){return t.value})}}])}(),Ya=function(){return u(function t(){o(this,t)},[{key:"calculator",value:function(t,e,n,i){var r;n instanceof nr&&(n=null);var a=null===(r=n)||void 0===r?void 0:r.cloneNode(!0);return a&&(a.style.isMarker=!0),a}}])}(),za=function(){return u(function t(){o(this,t),this.mixer=zr},[{key:"calculator",value:function(t,e,n){return n.value}}])}(),ja=function(){return u(function t(){o(this,t),this.mixer=jr(0,1)},[{key:"calculator",value:function(t,e,n){return n.value}},{key:"postProcessor",value:function(t){var e=t.parsedStyle,n=e.offsetPath;if(n){var i=n.nodeName;if(i===fn.LINE||i===fn.PATH||i===fn.POLYLINE){var r=n.getPoint(e.offsetDistance);r&&t.setLocalPosition(r.x,r.y)}}}}])}(),Xa=function(){return u(function t(){o(this,t),this.mixer=jr(0,1)},[{key:"calculator",value:function(t,e,n){return n.value}}])}(),Ha=function(){return u(function t(){o(this,t),this.parser=oa,this.mixer=sa},[{key:"calculator",value:function(t,e,n){return n instanceof nr&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Pn(0,0,0,0)}:n}}])}(),Wa=u(function t(){o(this,t),this.mixer=ua}),qa=function(t){function e(){var t;o(this,e);for(var n=arguments.length,i=Array(n),r=0;n>r;r++)i[r]=arguments[r];return(t=p(this,e,[].concat(i))).mixer=jr(0,1/0),t}return y(e,t),u(e)}(Ba),Za=function(){return u(function t(){o(this,t)},[{key:"calculator",value:function(t,e,n,i){return n instanceof nr?"unset"===n.value?"":n.value:"".concat(n)}},{key:"postProcessor",value:function(t){t.nodeValue="".concat(t.parsedStyle.text)||""}}])}(),Ka=function(){return u(function t(){o(this,t)},[{key:"calculator",value:function(t,e,n,i){var r=i.getAttribute("text");if(r){var a=r;"capitalize"===n.value?a=r.charAt(0).toUpperCase()+r.slice(1):"lowercase"===n.value?a=r.toLowerCase():"uppercase"===n.value&&(a=r.toUpperCase()),i.parsedStyle.text=a}return n.value}}])}(),Qa=new WeakMap;var $a="undefined"!=typeof window&&void 0!==window.document;function Ja(t){return!!t.getAttribute}function to(t,e){var n=Number(t.parsedStyle.zIndex||0),i=Number(e.parsedStyle.zIndex||0);if(n===i){var r=t.parentNode;if(r){var a=r.childNodes||[];return a.indexOf(t)-a.indexOf(e)}}return n-i}function eo(t){var e=t;do{var n;if(null===(n=e.parsedStyle)||void 0===n?void 0:n.clipPath)return e;e=e.parentElement}while(null!==e);return null}function no(t,e){if($a)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var io={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},ro="object"==typeof performance&&performance.now?performance:Date;function ao(t){return t.nodeName===fn.FRAGMENT||t.getRootNode().nodeName===fn.FRAGMENT}var oo=1,so="object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:{},uo=Date.now(),lo={},co=Date.now(),ho=function(t){if("function"!=typeof t)throw new TypeError("".concat(t," is not a function"));var e=Date.now(),n=e-co,i=n>16?0:16-n,r=oo++;return lo[r]=t,Object.keys(lo).length>1||setTimeout(function(){co=e;var t=lo;lo={},Object.keys(t).forEach(function(e){return t[e](so.performance&&"function"==typeof so.performance.now?so.performance.now():Date.now()-uo)})},i),r},fo=function(t){delete lo[t]},vo=function(t){return"string"!=typeof t?ho:""===t?so.requestAnimationFrame:so["".concat(t,"RequestAnimationFrame")]},po=function(t,e){for(var n=0;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}}(["","webkit","moz","ms","o"],function(t){return!!vo(t)}),mo=vo(po),yo=function(t){return"string"!=typeof t?fo:""===t?so.cancelAnimationFrame:so["".concat(t,"CancelAnimationFrame")]||so["".concat(t,"CancelRequestAnimationFrame")]}(po);so.requestAnimationFrame=mo,so.cancelAnimationFrame=yo;var go=function(){return u(function t(){o(this,t),this.callbacks=[]},[{key:"getCallbacksNum",value:function(){return this.callbacks.length}},{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];return Promise.all(this.callbacks.map(function(t){return t.apply(void 0,e)}))}}])}(),ko=function(){return u(function t(){o(this,t),this.callbacks=[]},[{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:(t=sn(an().mark(function t(){var e,n,i,r,a=arguments;return an().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.callbacks.length){t.next=6;break}return t.next=1,(e=this.callbacks)[0].apply(e,a);case 1:n=t.sent,i=0;case 2:if(i>=this.callbacks.length-1){t.next=5;break}return r=this.callbacks[i],t.next=3,r(n);case 3:n=t.sent;case 4:i++,t.next=2;break;case 5:return t.abrupt("return",n);case 6:return t.abrupt("return",null);case 7:case"end":return t.stop()}},t,this)})),function(){return t.apply(this,arguments)})}]);var t}(),Eo=function(){return u(function t(){o(this,t),this.callbacks=[]},[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];var i=arguments;this.callbacks.forEach(function(t){t.apply(void 0,i)})}}])}(),xo=function(){return u(function t(){o(this,t),this.callbacks=[]},[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];if(this.callbacks.length){for(var i=this.callbacks[0].apply(void 0,arguments),r=0;this.callbacks.length-1>r;r++){i=(0,this.callbacks[r])(i)}return i}return null}}])}(),bo=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],To=/([\"\'])[^\'\"]+\1/;function Mo(t){var e=t.fontSize,n=t.fontFamily,i=t.fontStyle,r=t.fontVariant,a=t.fontWeight;return{fontSize:void 0===e?16:e,fontFamily:void 0===n?"sans-serif":n,fontStyle:void 0===i?"normal":i,fontVariant:void 0===r?"normal":r,fontWeight:void 0===a?"normal":a}}var wo=Yi(function(t){for(var e=Mo(t),n=e.fontSize,i=e.fontFamily,r=e.fontStyle,a=e.fontVariant,o=e.fontWeight,s=zt(n)&&"".concat(n,"px")||"16px",u=i.split(","),l=u.length-1;l>=0;l--){var c=u[l].trim();!To.test(c)&&0>bo.indexOf(c)&&(c='"'.concat(c,'"')),u[l]=c}return"".concat(r," ").concat(a," ").concat(o," ").concat(s," ").concat(u.join(","))},function(t){var e=Mo(t),n=e.fontSize,i=e.fontFamily,r=e.fontVariant,a=e.fontWeight;return"".concat(e.fontStyle,"_").concat(r,"_").concat(a,"_").concat(n,"_").concat(i)}),No=function(t){return Math.max(t,1e-6)};function Po(t,e,n){return S(t),t[4]=Math.tan(e),t[1]=Math.tan(n),t}var So=M(),Co=M(),Ao={scale:function(t){F(So,[t[0].value,t[1].value,1].map(function(t){return No(t)}))},scaleX:function(t){F(So,[t[0].value,1,1].map(function(t){return No(t)}))},scaleY:function(t){F(So,[1,t[0].value,1].map(function(t){return No(t)}))},scaleZ:function(t){F(So,[1,1,t[0].value].map(function(t){return No(t)}))},scale3d:function(t){F(So,[t[0].value,t[1].value,t[2].value].map(function(t){return No(t)}))},translate:function(t){D(So,[t[0].value,t[1].value,0])},translateX:function(t){D(So,[t[0].value,0,0])},translateY:function(t){D(So,[0,t[0].value,0])},translateZ:function(t){D(So,[0,0,t[0].value])},translate3d:function(t){D(So,[t[0].value,t[1].value,t[2].value])},rotate:function(t){U(So,In(Dr(t[0])))},rotateX:function(t){B(So,In(Dr(t[0])))},rotateY:function(t){V(So,In(Dr(t[0])))},rotateZ:function(t){U(So,In(Dr(t[0])))},rotate3d:function(t){G(So,In(Dr(t[3])),[t[0].value,t[1].value,t[2].value])},skew:function(t){Po(So,In(t[0].value),In(t[1].value))},skewX:function(t){Po(So,In(t[0].value),0)},skewY:function(t){Po(So,0,In(t[0].value))},matrix:function(t){P(So,t[0].value,t[1].value,0,0,t[2].value,t[3].value,0,0,0,0,1,0,t[4].value,t[5].value,0,1)},matrix3d:function(t){P.apply(et,[So].concat(h(t.map(function(t){return t.value}))))}},Ro=at(1,1,1),Oo=nt(),Lo={translate:function(t,e){Fs.sceneGraphService.setLocalScale(t,Ro,!1),Fs.sceneGraphService.setLocalEulerAngles(t,Oo,void 0,void 0,!1),Fs.sceneGraphService.setLocalPosition(t,[e[0].value,e[1].value,0],!1),Fs.sceneGraphService.dirtyLocalTransform(t,t.transformable)}};function Io(t,e){if(t.length){if(1===t.length&&Lo[t[0].t])return void Lo[t[0].t](e,t[0].d);for(var n=S(Co),i=0;t.length>i;i++){var r=t[i],a=Ao[r.t];a&&(a(r.d),tt(n,n,So))}e.setLocalTransform(n)}else e.resetLocalTransform();return e.getLocalTransform()}var _o=function(){return u(function t(){o(this,t),this.parser=ma,this.mixer=Na},[{key:"calculator",value:function(t,e,n,i){return n instanceof nr?[]:n}},{key:"postProcessor",value:function(t){Io(t.parsedStyle.transform,t)}}])}(),Do=function(){return u(function t(){o(this,t)},[{key:"postProcessor",value:function(t){var e=t.parsedStyle.transformOrigin;e[0].unit===zi.kPixels&&e[1].unit===zi.kPixels?t.setOrigin(e[0].value,e[1].value):t.getGeometryBounds()}}])}(),Fo=function(){return u(function t(){o(this,t)},[{key:"calculator",value:function(t,e,n,i){return n.value}},{key:"postProcessor",value:function(t){if(t.parentNode){var e=t.parentNode,n=e.sortable;e.renderable&&e.dirty(),n&&(n.dirty=!0,n.dirtyReason=ei.Z_INDEX_CHANGED)}}}])}(),Go=function(){return u(function t(){o(this,t)},[{key:"update",value:function(t,e){var n=t.cx,i=t.cy,r=t.r,a=void 0===r?0:r;return{cx:void 0===n?0:n,cy:void 0===i?0:i,hwidth:a,hheight:a}}}])}(),Bo=function(){return u(function t(){o(this,t)},[{key:"update",value:function(t,e){var n=t.cx,i=t.cy,r=t.rx,a=t.ry;return{cx:void 0===n?0:n,cy:void 0===i?0:i,hwidth:void 0===r?0:r,hheight:void 0===a?0:a}}}])}(),Vo=function(){return u(function t(){o(this,t)},[{key:"update",value:function(t){var e=t.x1,n=t.y1,i=t.x2,r=t.y2,a=Math.min(e,i),o=Math.max(e,i),s=Math.min(n,r),u=(o-a)/2,l=(Math.max(n,r)-s)/2;return{cx:a+u,cy:s+l,hwidth:u,hheight:l}}}])}(),Uo=function(){return u(function t(){o(this,t)},[{key:"update",value:function(t){var e=t.d.rect,n=e.width/2,i=e.height/2;return{cx:e.x+n,cy:e.y+i,hwidth:n,hheight:i}}}])}(),Yo=function(){return u(function t(){o(this,t)},[{key:"update",value:function(t){if(t.points&&Dt(t.points.points)){var e=t.points.points,n=Math.min.apply(Math,h(e.map(function(t){return t[0]}))),i=Math.max.apply(Math,h(e.map(function(t){return t[0]}))),r=Math.min.apply(Math,h(e.map(function(t){return t[1]}))),a=(i-n)/2,o=(Math.max.apply(Math,h(e.map(function(t){return t[1]})))-r)/2;return{cx:n+a,cy:r+o,hwidth:a,hheight:o}}return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),zo=function(){return u(function t(){o(this,t)},[{key:"update",value:function(t,e){var n=t.x,i=void 0===n?0:n,r=t.y,a=void 0===r?0:r,o=t.src,s=t.width,u=t.height,l=void 0===s?0:s,c=void 0===u?0:u;return o&&!Ut(o)&&(l||(t.width=l=o.width),c||(t.height=c=o.height)),{cx:i+l/2,cy:a+c/2,hwidth:l/2,hheight:c/2}}}])}(),jo=function(){return u(function t(e){o(this,t),this.globalRuntime=e},[{key:"isReadyToMeasure",value:function(t,e){return t.text}},{key:"update",value:function(t,e){var n,i=t.text,r=t.textAlign,a=void 0===r?"start":r,o=t.lineWidth,s=void 0===o?1:o,u=t.textBaseline,l=void 0===u?"alphabetic":u,c=t.dx,h=void 0===c?0:c,f=t.dy,d=void 0===f?0:f,v=t.x,p=void 0===v?0:v,m=t.y,y=void 0===m?0:m;if(!this.isReadyToMeasure(t,e))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{hwidth:0,hheight:0,cx:0,cy:0};var g=(null==e||null===(n=e.ownerDocument)||void 0===n||null===(n=n.defaultView)||void 0===n?void 0:n.getConfig())||{},k=this.globalRuntime.textService.measureText(i,t,g.offscreenCanvas);t.metrics=k;var E=k.width/2,x=k.height/2,b=p+E;"center"===a||"middle"===a?b+=s/2-E:"right"!==a&&"end"!==a||(b+=s-2*E);var T=y-x;return"middle"===l?T+=x:"top"===l||"hanging"===l?T+=2*x:"alphabetic"===l||"bottom"!==l&&"ideographic"!==l||(T+=0),h&&(b+=h),d&&(T+=d),{cx:b,cy:T,hwidth:E,hheight:x}}}])}(),Xo=function(){return u(function t(){o(this,t)},[{key:"update",value:function(t,e){return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),Ho=function(){return u(function t(){o(this,t)},[{key:"update",value:function(t,e){var n=t.x,i=t.y,r=t.width,a=void 0===r?0:r,o=t.height,s=void 0===o?0:o;return{cx:(void 0===n?0:n)+a/2,cy:(void 0===i?0:i)+s/2,hwidth:a/2,hheight:s/2}}}])}();var Wo=function(){return u(function t(e){o(this,t),this.eventPhase=t.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Nn,this.page=new Nn,this.canvas=new Nn,this.viewport=new Nn,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e},[{key:"name",get:function(){return this.type}},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"composedPath",value:function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}},{key:"propagationPath",get:function(){return this.composedPath()}},{key:"preventDefault",value:function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}},{key:"stopImmediatePropagation",value:function(){this.propagationImmediatelyStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"initEvent",value:function(){}},{key:"initUIEvent",value:function(){}},{key:"clone",value:function(){throw Error(Sn)}}])}(),qo=function(t){function e(){var t;o(this,e);for(var n=arguments.length,i=Array(n),r=0;n>r;r++)i[r]=arguments[r];return(t=p(this,e,[].concat(i))).client=new Nn,t.movement=new Nn,t.offset=new Nn,t.global=new Nn,t.screen=new Nn,t}return y(e,t),u(e,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}},{key:"getModifierState",value:function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}},{key:"initMouseEvent",value:function(){throw Error(Sn)}}])}(Wo),Zo=function(t){function e(){var t;o(this,e);for(var n=arguments.length,i=Array(n),r=0;n>r;r++)i[r]=arguments[r];return(t=p(this,e,[].concat(i))).width=0,t.height=0,t.isPrimary=!1,t}return y(e,t),u(e,[{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)}}])}(qo),Ko=function(t){function e(){return o(this,e),p(this,e,arguments)}return y(e,t),u(e,[{key:"clone",value:function(){return this.manager.cloneWheelEvent(this)}}])}(qo),Qo=function(t){function e(t,n){var i;return o(this,e),(i=p(this,e,[null])).type=t,i.detail=n,Object.assign(i,n),i}return y(e,t),u(e)}(Wo),$o=function(){return u(function t(){o(this,t),this.emitter=new E},[{key:"on",value:function(t,e,n){return this.addEventListener(t,e,n),this}},{key:"addEventListener",value:function(t,e,n){var i=!1,r=!1;if(Ht(n))i=n;else if(n){var a=n.capture;i=void 0!==a&&a;var o=n.once;r=void 0!==o&&o}i&&(t+="capture"),e=It(e)?e:e.handleEvent;var s=It(e)?void 0:e;return r?this.emitter.once(t,e,s):this.emitter.on(t,e,s),this}},{key:"off",value:function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this}},{key:"removeAllEventListeners",value:function(){var t;null===(t=this.emitter)||void 0===t||t.removeAllListeners()}},{key:"removeEventListener",value:function(t,e,n){var i;if(!this.emitter)return this;(Ht(n)?n:null==n?void 0:n.capture)&&(t+="capture"),e=It(e)?e:null===(i=e)||void 0===i?void 0:i.handleEvent;var r=It(e)?void 0:e;return this.emitter.off(t,e,r),this}},{key:"emit",value:function(t,e){this.dispatchEvent(new Qo(t,e))}},{key:"dispatchEventToSelf",value:function(t){t.target||(t.target=this),t.currentTarget=this,this.emitter.emit(t.type,t)}},{key:"dispatchEvent",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(arguments.length>2?arguments[2]:void 0)return this.dispatchEventToSelf(t),!0;if(this.document)e=this;else if(this.defaultView)e=this.defaultView;else{var i;e=null===(i=this.ownerDocument)||void 0===i?void 0:i.defaultView}if(e){if(t.manager=e.getEventService(),!t.manager)return!1;t.defaultPrevented=!1,t.path?t.path.length=0:t.page=[],n||(t.target=this),t.manager.dispatchEvent(t,t.type,n)}else this.dispatchEventToSelf(t);return!t.defaultPrevented}}])}(),Jo=function(t){function e(){var t;o(this,e);for(var n=arguments.length,i=Array(n),r=0;n>r;r++)i[r]=arguments[r];return(t=p(this,e,[].concat(i))).shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t.destroyed=!1,t}return y(e,t),u(e,[{key:"textContent",get:function(){var t="";this.nodeName===fn.TEXT&&(t+=this.style.text);var e,n=un(this.childNodes);try{for(n.s();!(e=n.n()).done;){var i=e.value;t+=i.nodeName===fn.TEXT?i.nodeValue:i.textContent}}catch(t){n.e(t)}finally{n.f()}return t},set:function(t){var e=this;this.childNodes.slice().forEach(function(t){e.removeChild(t)}),this.nodeName===fn.TEXT&&(this.style.text="".concat(t))}},{key:"getRootNode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this}},{key:"hasChildNodes",value:function(){return this.childNodes.length>0}},{key:"isDefaultNamespace",value:function(t){throw Error(Sn)}},{key:"lookupNamespaceURI",value:function(t){throw Error(Sn)}},{key:"lookupPrefix",value:function(t){throw Error(Sn)}},{key:"normalize",value:function(){throw Error(Sn)}},{key:"isEqualNode",value:function(t){return this===t}},{key:"isSameNode",value:function(t){return this.isEqualNode(t)}},{key:"parent",get:function(){return this.parentNode}},{key:"parentElement",get:function(){return null}},{key:"nextSibling",get:function(){return null}},{key:"previousSibling",get:function(){return null}},{key:"firstChild",get:function(){return this.childNodes.length>0?this.childNodes[0]:null}},{key:"lastChild",get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}},{key:"compareDocumentPosition",value:function(t){if(t===this)return 0;for(var n=t,i=this,r=[n],a=[i];null!==(o=n.parentNode)&&void 0!==o?o:i.parentNode;){var o;n=n.parentNode?(r.push(n.parentNode),n.parentNode):n,i=i.parentNode?(a.push(i.parentNode),i.parentNode):i}if(n!==i)return e.DOCUMENT_POSITION_DISCONNECTED|e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|e.DOCUMENT_POSITION_PRECEDING;var s=r.length>a.length?r:a,u=s===r?a:r;if(s[s.length-u.length]===u[0])return s===r?e.DOCUMENT_POSITION_CONTAINED_BY|e.DOCUMENT_POSITION_FOLLOWING:e.DOCUMENT_POSITION_CONTAINS|e.DOCUMENT_POSITION_PRECEDING;for(var l=s.length-u.length,c=u.length-1;c>=0;c--){var h=u[c],f=s[l+c];if(f!==h){var d=h.parentNode.childNodes;return d.indexOf(h)<d.indexOf(f)?u===r?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING:s===r?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING}}return e.DOCUMENT_POSITION_FOLLOWING}},{key:"contain",value:function(t){return this.contains(t)}},{key:"contains",value:function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e}},{key:"getAncestor",value:function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e}},{key:"forEach",value:function(t){for(var e=[this];e.length>0;){var n=e.pop();if(!1===t(n))break;for(var i=n.childNodes.length-1;i>=0;i--)e.push(n.childNodes[i])}}}],[{key:"isNode",value:function(t){return!!t.childNodes}}])}($o);Jo.DOCUMENT_POSITION_DISCONNECTED=1,Jo.DOCUMENT_POSITION_PRECEDING=2,Jo.DOCUMENT_POSITION_FOLLOWING=4,Jo.DOCUMENT_POSITION_CONTAINS=8,Jo.DOCUMENT_POSITION_CONTAINED_BY=16,Jo.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var ts=function(){return u(function t(e,n){var i=this;o(this,t),this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=M(),this.tmpVec3=nt(),this.onPointerDown=function(t){var e=i.createPointerEvent(t);if(i.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)i.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){i.dispatchEvent(e,2===e.button?"rightdown":"mousedown")}i.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),i.freeEvent(e)},this.onPointerUp=function(t){var e=ro.now(),n=i.createPointerEvent(t,void 0,void 0,i.context.config.alwaysTriggerPointerEventOnCanvas?i.rootTarget:void 0);if(i.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)i.dispatchEvent(n,"touchend");else if("mouse"===n.pointerType||"pen"===n.pointerType){i.dispatchEvent(n,2===n.button?"rightup":"mouseup")}var r=i.trackingData(t.pointerId),a=i.findMountedTarget(r.pressTargetsByButton[t.button]),o=a;if(a&&!n.composedPath().includes(a)){for(var s=a;s&&!n.composedPath().includes(s);){if(n.currentTarget=s,i.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType)i.notifyTarget(n,"touchendoutside");else if("mouse"===n.pointerType||"pen"===n.pointerType){i.notifyTarget(n,2===n.button?"rightupoutside":"mouseupoutside")}Jo.isNode(s)&&(s=s.parentNode)}delete r.pressTargetsByButton[t.button],o=s}if(o){var u,l=i.clonePointerEvent(n,"click");l.target=o,l.path=[],r.clicksByButton[t.button]||(r.clicksByButton[t.button]={clickCount:0,target:l.target,timeStamp:e});var c=r.clicksByButton[t.button];c.target===l.target&&e-c.timeStamp<i.context.renderingContext.root.ownerDocument.defaultView.getConfig().dblClickSpeed?++c.clickCount:c.clickCount=1,c.target=l.target,c.timeStamp=e,l.detail=c.clickCount,null!==(u=n.detail)&&void 0!==u&&u.preventClick||(i.context.config.useNativeClickEvent||"mouse"!==l.pointerType&&"touch"!==l.pointerType||i.dispatchEvent(l,"click"),i.dispatchEvent(l,"pointertap")),i.freeEvent(l)}i.freeEvent(n)},this.onPointerMove=function(t){var e=i.createPointerEvent(t,void 0,void 0,i.context.config.alwaysTriggerPointerEventOnCanvas?i.rootTarget:void 0),n="mouse"===e.pointerType||"pen"===e.pointerType,r=i.trackingData(t.pointerId),a=i.findMountedTarget(r.overTargets);if(r.overTargets&&a!==e.target){var o=i.createPointerEvent(t,"mousemove"===t.type?"mouseout":"pointerout",a||void 0);if(i.dispatchEvent(o,"pointerout"),n&&i.dispatchEvent(o,"mouseout"),!e.composedPath().includes(a)){var s=i.createPointerEvent(t,"pointerleave",a||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&!e.composedPath().includes(s.target);)s.currentTarget=s.target,i.notifyTarget(s),n&&i.notifyTarget(s,"mouseleave"),Jo.isNode(s.target)&&(s.target=s.target.parentNode);i.freeEvent(s)}i.freeEvent(o)}if(a!==e.target){var u=i.clonePointerEvent(e,"mousemove"===t.type?"mouseover":"pointerover");i.dispatchEvent(u,"pointerover"),n&&i.dispatchEvent(u,"mouseover");for(var l=a&&Jo.isNode(a)&&a.parentNode;l&&l!==(Jo.isNode(i.rootTarget)&&i.rootTarget.parentNode)&&l!==e.target;)l=l.parentNode;if(!l||l===(Jo.isNode(i.rootTarget)&&i.rootTarget.parentNode)){var c=i.clonePointerEvent(e,"pointerenter");for(c.eventPhase=c.AT_TARGET;c.target&&c.target!==a&&c.target!==(Jo.isNode(i.rootTarget)&&i.rootTarget.parentNode);)c.currentTarget=c.target,i.notifyTarget(c),n&&i.notifyTarget(c,"mouseenter"),Jo.isNode(c.target)&&(c.target=c.target.parentNode);i.freeEvent(c)}i.freeEvent(u)}i.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&i.dispatchEvent(e,"touchmove"),n&&(i.dispatchEvent(e,"mousemove"),i.cursor=i.getCursor(e.target)),r.overTargets=e.composedPath(),i.freeEvent(e)},this.onPointerOut=function(t){var e=i.trackingData(t.pointerId);if(e.overTargets){var n="mouse"===t.pointerType||"pen"===t.pointerType,r=i.findMountedTarget(e.overTargets),a=i.createPointerEvent(t,"pointerout",r||void 0);i.dispatchEvent(a),n&&i.dispatchEvent(a,"mouseout");var o=i.createPointerEvent(t,"pointerleave",r||void 0);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==(Jo.isNode(i.rootTarget)&&i.rootTarget.parentNode);)o.currentTarget=o.target,i.notifyTarget(o),n&&i.notifyTarget(o,"mouseleave"),Jo.isNode(o.target)&&(o.target=o.target.parentNode);e.overTargets=null,i.freeEvent(a),i.freeEvent(o)}i.cursor=null},this.onPointerOver=function(t){var e=i.trackingData(t.pointerId),n=i.createPointerEvent(t),r="mouse"===n.pointerType||"pen"===n.pointerType;i.dispatchEvent(n,"pointerover"),r&&i.dispatchEvent(n,"mouseover"),"mouse"===n.pointerType&&(i.cursor=i.getCursor(n.target));var a=i.clonePointerEvent(n,"pointerenter");for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(Jo.isNode(i.rootTarget)&&i.rootTarget.parentNode);)a.currentTarget=a.target,i.notifyTarget(a),r&&i.notifyTarget(a,"mouseenter"),Jo.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=n.composedPath(),i.freeEvent(n),i.freeEvent(a)},this.onPointerUpOutside=function(t){var e=i.trackingData(t.pointerId),n=i.findMountedTarget(e.pressTargetsByButton[t.button]),r=i.createPointerEvent(t);if(n){for(var a=n;a;)r.currentTarget=a,i.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType||"mouse"!==r.pointerType&&"pen"!==r.pointerType||i.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside"),Jo.isNode(a)&&(a=a.parentNode);delete e.pressTargetsByButton[t.button]}i.freeEvent(r)},this.onWheel=function(t){var e=i.createWheelEvent(t);i.dispatchEvent(e),i.freeEvent(e)},this.onClick=function(t){if(i.context.config.useNativeClickEvent){var e=i.createPointerEvent(t);i.dispatchEvent(e),i.freeEvent(e)}},this.onPointerCancel=function(t){var e=i.createPointerEvent(t,void 0,void 0,i.context.config.alwaysTriggerPointerEventOnCanvas?i.rootTarget:void 0);i.dispatchEvent(e),i.freeEvent(e)},this.globalRuntime=e,this.context=n},[{key:"init",value:function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)}},{key:"destroy",value:function(){this.mappingTable={},this.mappingState={},this.eventPool.clear()}},{key:"getScale",value:function(){var t=this.context.contextService.getBoundingClientRect(),e=1,n=1,i=this.context.contextService.getDomElement();if(i&&t){var r=i.offsetWidth,a=i.offsetHeight;r&&a&&(e=t.width/r,n=t.height/a)}return{scaleX:e,scaleY:n,bbox:t}}},{key:"client2Viewport",value:function(t){var e=this.getScale(),n=e.bbox;return new Nn((t.x-((null==n?void 0:n.left)||0))/e.scaleX,(t.y-((null==n?void 0:n.top)||0))/e.scaleY)}},{key:"viewport2Client",value:function(t){var e=this.getScale(),n=e.bbox;return new Nn((t.x+((null==n?void 0:n.left)||0))*e.scaleX,(t.y+((null==n?void 0:n.top)||0))*e.scaleY)}},{key:"viewport2Canvas",value:function(t){var e=t.x,n=t.y,i=this.rootTarget.defaultView.getCamera(),r=this.context.config,a=r.width,o=r.height,s=i.getPerspectiveInverse(),u=i.getWorldTransform(),l=O(this.tmpMatrix,u,s),c=st(this.tmpVec3,e/a*2-1,2*(1-n/o)-1,0);return pt(c,c,l),new Nn(c[0],c[1])}},{key:"canvas2Viewport",value:function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),i=e.getViewTransform(),r=O(this.tmpMatrix,n,i),a=st(this.tmpVec3,t.x,t.y,0);pt(this.tmpVec3,this.tmpVec3,r);var o=this.context.config;return new Nn((a[0]+1)/2*o.width,(1-(a[1]+1)/2)*o.height)}},{key:"setPickHandler",value:function(t){this.pickHandler=t}},{key:"addEventMapping",value:function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(function(t,e){return t.priority-e.priority})}},{key:"mapEvent",value:function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,i=e.length;i>n;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for ".concat(t.type))}}},{key:"dispatchEvent",value:function(t,e,n){n?(t.eventPhase=t.AT_TARGET,t.currentTarget=this.rootTarget.defaultView||null,this.notifyListeners(t,e)):(t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e))}},{key:"propagate",value:function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var i=n.length-1;i>=1;i--)if(t.currentTarget=n[i],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var r=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var a=r+1;n.length>a;a++)if(t.currentTarget=n[a],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}}},{key:"propagationPath",value:function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)return e.unshift(n.document),e;for(var i=0;2048>i&&t!==this.rootTarget;i++)Jo.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e}},{key:"hitTest",value:function(t){var e=t.viewportX,n=t.viewportY,i=this.context.config;return 0>e||0>n||e>i.width||n>i.height?null:!i.disableHitTesting&&this.pickHandler(t)||this.rootTarget||null}},{key:"isNativeEventFromCanvas",value:function(t,e){var n,i=null==e?void 0:e.target;if(null!==(n=i)&&void 0!==n&&n.shadowRoot&&(i=e.composedPath()[0]),i){if(i===t)return!0;if(t&&t.contains)return t.contains(i)}return!(null==e||!e.composedPath)&&e.composedPath().indexOf(t)>-1}},{key:"getExistedHTML",value:function(t){if(t.nativeEvent.composedPath)for(var e=0,n=t.nativeEvent.composedPath();n.length>e;e++){var i=this.nativeHTMLMap.get(n[e]);if(i)return i}return null}},{key:"pickTarget",value:function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})}},{key:"createPointerEvent",value:function(t,e,n,i){var r=this.allocateEvent(Zo);this.copyPointerData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.nativeEvent=t.nativeEvent,r.originalEvent=t;var a=this.getExistedHTML(r),o=this.context.contextService.getDomElement();return r.target=null!=n?n:a||this.isNativeEventFromCanvas(o,r.nativeEvent)&&this.pickTarget(r)||i,"string"==typeof e&&(r.type=e),r}},{key:"createWheelEvent",value:function(t){var e=this.allocateEvent(Ko);this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t;var n=this.getExistedHTML(e),i=this.context.contextService.getDomElement();return e.target=n||this.isNativeEventFromCanvas(i,e.nativeEvent)&&this.pickTarget(e),e}},{key:"trackingData",value:function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}},{key:"cloneWheelEvent",value:function(t){var e=this.allocateEvent(Ko);return e.nativeEvent=t.nativeEvent,e.originalEvent=t.originalEvent,this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.target=t.target,e.path=t.composedPath().slice(),e.type=t.type,e}},{key:"clonePointerEvent",value:function(t,e){var n=this.allocateEvent(Zo);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n}},{key:"copyPointerData",value:function(t,e){e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist}},{key:"copyMouseData",value:function(t,e){e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset)}},{key:"copyWheelData",value:function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}},{key:"copyData",value:function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=ro.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)}},{key:"allocateEvent",value:function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e}},{key:"freeEvent",value:function(t){if(t.manager!==this)throw Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)}},{key:"notifyTarget",value:function(t,e){e=null!=e?e:t.type,this.notifyListeners(t,t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(e,"capture"):e),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}},{key:"notifyListeners",value:function(t,e){var n=t.currentTarget.emitter,i=n._events[e];if(i)if("fn"in i)i.once&&n.removeListener(e,i.fn,void 0,!0),i.fn.call(t.currentTarget||i.context,t);else for(var r=0;i.length>r&&!t.propagationImmediatelyStopped;r++)i[r].once&&n.removeListener(e,i[r].fn,void 0,!0),i[r].fn.call(t.currentTarget||i[r].context,t)}},{key:"findMountedTarget",value:function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;n>=0;n--){var i=t[n];if(!(i===this.rootTarget||Jo.isNode(i)&&i.parentNode===e))break;e=t[n]}return e}},{key:"getCursor",value:function(t){for(var e=t;e;){var n=Ja(e)&&e.getAttribute("cursor");if(n)return n;e=Jo.isNode(e)&&e.parentNode}}}])}(),es=function(){return u(function t(){o(this,t)},[{key:"getOrCreateCanvas",value:function(t,e){if(this.canvas)return this.canvas;if(t||Fs.offscreenCanvas)this.canvas=t||Fs.offscreenCanvas,this.context=this.canvas.getContext("2d",a({willReadFrequently:!0},e));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",a({willReadFrequently:!0},e)),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",a({willReadFrequently:!0},e))}return this.canvas.width=10,this.canvas.height=10,this.canvas}},{key:"getOrCreateContext",value:function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context}}],[{key:"createCanvas",value:function(){try{return new window.OffscreenCanvas(0,0)}catch(t){}try{return document.createElement("canvas")}catch(t){}return null}}])}(),ns=function(t){return t[t.CAMERA_CHANGED=0]="CAMERA_CHANGED",t[t.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",t[t.NONE=2]="NONE",t}({}),is=function(){return u(function t(e,n){o(this,t),this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new Eo,initAsync:new go,dirtycheck:new xo,cull:new xo,beginFrame:new Eo,beforeRender:new Eo,render:new Eo,afterRender:new Eo,endFrame:new Eo,destroy:new Eo,pick:new ko,pickSync:new xo,pointerDown:new Eo,pointerUp:new Eo,pointerMove:new Eo,pointerOut:new Eo,pointerOver:new Eo,pointerWheel:new Eo,pointerCancel:new Eo,click:new Eo},this.globalRuntime=e,this.context=n},[{key:"init",value:function(t){var e=this,n=a(a({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach(function(t){t.apply(n,e.globalRuntime)}),this.hooks.init.call(),0===this.hooks.initAsync.getCallbacksNum()?(this.inited=!0,t()):this.hooks.initAsync.promise().then(function(){e.inited=!0,t()}).catch(function(t){})}},{key:"getStats",value:function(){return this.stats}},{key:"disableDirtyRectangleRendering",value:function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(ns.CAMERA_CHANGED)}},{key:"render",value:function(t,e,n){var i=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var r=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(r.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),r.renderReasons.size&&this.inited){r.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var a=1===r.renderReasons.size&&r.renderReasons.has(ns.CAMERA_CHANGED),o=!t.disableRenderHooks||!a;o&&this.renderDisplayObject(r.root,t,r),this.hooks.beginFrame.call(e),o&&r.renderListCurrentFrame.forEach(function(t){i.hooks.beforeRender.call(t),i.hooks.render.call(t),i.hooks.afterRender.call(t)}),this.hooks.endFrame.call(e),r.renderListCurrentFrame=[],r.renderReasons.clear(),n()}}},{key:"renderDisplayObject",value:function(t,e,n){var i=this,r=e.renderer.getConfig(),a=r.enableDirtyCheck,o=r.enableCulling;function s(t){var e=t.sortable,r=a?t.renderable.dirty||n.dirtyRectangleRenderingDisabled?t:null:t,s=null;r&&(s=o?i.hooks.cull.call(r,i.context.camera):r)&&(i.stats.rendered+=1,n.renderListCurrentFrame.push(s)),t.dirty(!1),e.renderOrder=i.zIndexCounter,i.zIndexCounter+=1,i.stats.total+=1,e.dirty&&(i.sort(t,e),e.dirty=!1,e.dirtyChildren=[],e.dirtyReason=void 0)}for(var u=[t];u.length>0;){var l,c=u.pop();s(c);for(var h=(null===(l=c.sortable)||void 0===l||null===(l=l.sorted)||void 0===l?void 0:l.length)>0?c.sortable.sorted:c.childNodes,f=h.length-1;f>=0;f--)u.push(h[f])}}},{key:"sort",value:function(t,e){var n,i;(null==e||null===(n=e.sorted)||void 0===n?void 0:n.length)>0&&e.dirtyReason!==ei.Z_INDEX_CHANGED?e.dirtyChildren.forEach(function(n){var i=e.sorted.indexOf(n);if(i>-1&&e.sorted.splice(i,1),t.childNodes.indexOf(n)>-1)if(0===e.sorted.length)e.sorted.push(n);else{var r=function(t,e){for(var n=0,i=t.length;i>n;){var r=n+i>>>1;0>to(t[r],e)?n=r+1:i=r}return n}(e.sorted,n);e.sorted.splice(r,0,n)}}):e.sorted=t.childNodes.slice().sort(to),(null===(i=e.sorted)||void 0===i?void 0:i.length)>0&&0===t.childNodes.filter(function(t){return t.parsedStyle.zIndex}).length&&(e.sorted=[])}},{key:"destroy",value:function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()}},{key:"dirtify",value:function(){this.context.renderingContext.renderReasons.add(ns.DISPLAY_OBJECT_CHANGED)}}])}(),rs=/\[\s*(.*)=(.*)\s*\]/,as=function(){return u(function t(){o(this,t)},[{key:"selectOne",value:function(t,e){var n=this;if(t.startsWith("."))return e.find(function(e){return((null==e?void 0:e.classList)||[]).indexOf(n.getIdOrClassname(t))>-1});if(t.startsWith("#"))return e.find(function(e){return e.id===n.getIdOrClassname(t)});if(t.startsWith("[")){var i=this.getAttribute(t),r=i.name,a=i.value;return r?e.find(function(t){return e!==t&&("name"===r?t.name===a:n.attributeToString(t,r)===a)}):null}return e.find(function(n){return e!==n&&n.nodeName===t})}},{key:"selectAll",value:function(t,e){var n=this;if(t.startsWith("."))return e.findAll(function(i){return e!==i&&((null==i?void 0:i.classList)||[]).indexOf(n.getIdOrClassname(t))>-1});if(t.startsWith("#"))return e.findAll(function(i){return e!==i&&i.id===n.getIdOrClassname(t)});if(t.startsWith("[")){var i=this.getAttribute(t),r=i.name,a=i.value;return r?e.findAll(function(t){return e!==t&&("name"===r?t.name===a:n.attributeToString(t,r)===a)}):[]}return e.findAll(function(n){return e!==n&&n.nodeName===t})}},{key:"is",value:function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var n=this.getAttribute(t),i=n.name,r=n.value;return"name"===i?e.name===r:this.attributeToString(e,i)===r}return e.nodeName===t}},{key:"getIdOrClassname",value:function(t){return t.substring(1)}},{key:"getAttribute",value:function(t){var e=t.match(rs),n="",i="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),i=e[2].replace(/"/g,"")),{name:n,value:i}}},{key:"attributeToString",value:function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return _t(n)?"":n.toString?""+n:""}}])}(),os=function(t){return t.ATTR_MODIFIED="DOMAttrModified",t.INSERTED="DOMNodeInserted",t.MOUNTED="DOMNodeInsertedIntoDocument",t.REMOVED="removed",t.UNMOUNTED="DOMNodeRemovedFromDocument",t.REPARENT="reparent",t.DESTROY="destroy",t.BOUNDS_CHANGED="bounds-changed",t.CULLED="culled",t}({}),ss=function(t){function e(t,n,i,r,a,s,u,l){var c;return o(this,e),(c=p(this,e,[null])).relatedNode=n,c.prevValue=i,c.newValue=r,c.attrName=a,c.attrChange=s,c.prevParsedValue=u,c.newParsedValue=l,c.type=t,c}return y(e,t),u(e)}(Wo);ss.ADDITION=2,ss.MODIFICATION=1,ss.REMOVAL=3;var us,ls,cs,hs=new ss(os.REPARENT,null,"","","",0,"",""),fs=Lt(),ds=nt(),vs=at(1,1,1),ps=M(),ms=Lt(),ys=nt(),gs=M(),ks=Tt(),Es=nt(),xs=Tt(),bs=nt(),Ts=nt(),Ms=nt(),ws=M(),Ns=Tt(),Ps=Tt(),Ss=Tt(),Cs={affectChildren:!0},As=function(){return u(function t(e){o(this,t),this.pendingEvents=new Map,this.boundsChangedEvent=new Qo(os.BOUNDS_CHANGED),this.displayObjectDependencyMap=new WeakMap,this.runtime=e},[{key:"matches",value:function(t,e){return this.runtime.sceneGraphSelector.is(t,e)}},{key:"querySelector",value:function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)}},{key:"querySelectorAll",value:function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)}},{key:"attach",value:function(t,e,n){var i,r=!1;t.parentNode&&(r=t.parentNode!==e,this.detach(t));var a=t.nodeName===fn.FRAGMENT,o=ao(e);t.parentNode=e;var s=a?t.childNodes:[t];zt(n)?s.forEach(function(t){e.childNodes.splice(n,0,t),t.parentNode=e}):s.forEach(function(t){e.childNodes.push(t),t.parentNode=e});var u=e.sortable;if((null!=u&&null!==(i=u.sorted)&&void 0!==i&&i.length||u.dirty||t.parsedStyle.zIndex)&&(-1===u.dirtyChildren.indexOf(t)&&u.dirtyChildren.push(t),u.dirty=!0,u.dirtyReason=ei.ADDED),!o){if(a)this.dirtifyFragment(t);else{var l=t.transformable;l&&this.dirtyWorldTransform(t,l)}if(r){var c,h=!0===(null===(c=e.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);t.dispatchEvent(hs,h,h)}}}},{key:"detach",value:function(t){var e,n;if(t.parentNode){var i=t.transformable,r=t.parentNode.sortable;(null!=r&&null!==(e=r.sorted)&&void 0!==e&&e.length||null!==(n=t.style)&&void 0!==n&&n.zIndex)&&(-1===r.dirtyChildren.indexOf(t)&&r.dirtyChildren.push(t),r.dirty=!0,r.dirtyReason=ei.REMOVED);var a=t.parentNode.childNodes.indexOf(t);a>-1&&t.parentNode.childNodes.splice(a,1),i&&this.dirtyWorldTransform(t,i),t.parentNode=null}}},{key:"getLocalPosition",value:function(t){return t.transformable.localPosition}},{key:"getLocalRotation",value:function(t){return t.transformable.localRotation}},{key:"getLocalScale",value:function(t){return t.transformable.localScale}},{key:"getLocalSkew",value:function(t){return t.transformable.localSkew}},{key:"getLocalTransform",value:function(t){var e=t.transformable;return ai(e),e.localTransform}},{key:"setLocalPosition",value:function(t,e){var n,i=2>=arguments.length||void 0===arguments[2]||arguments[2],r=t.transformable;Ts[0]=e[0],Ts[1]=e[1],Ts[2]=null!==(n=e[2])&&void 0!==n?n:0,mt(r.localPosition,Ts)||(ot(r.localPosition,Ts),i&&this.dirtyLocalTransform(t,r))}},{key:"translateLocal",value:function(t,e){"number"==typeof e&&(e=at(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;mt(e,ds)||(!function(t,e,n){var i=n[0],r=n[1],a=n[2],o=e[0],s=e[1],u=e[2],l=r*u-a*s,c=a*o-i*u,h=i*s-r*o,f=r*h-a*c,d=a*l-i*h,v=i*c-r*l,p=2*n[3];c*=p,h*=p,d*=2,v*=2,t[0]=o+(l*=p)+(f*=2),t[1]=s+c+d,t[2]=u+h+v}(e,e,n.localRotation),ut(n.localPosition,n.localPosition,e),this.dirtyLocalTransform(t,n))}},{key:"setLocalRotation",value:function(t,e,n,i,r){var a=5>=arguments.length||void 0===arguments[5]||arguments[5];"number"==typeof e&&(e=At(ks,e,n,i,r));var o=t.transformable;Ct(o.localRotation,e),a&&this.dirtyLocalTransform(t,o)}},{key:"rotateLocal",value:function(t,e){"number"==typeof e&&(e=at(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;Pt(Ps,e[0],e[1],e[2]),Rt(n.localRotation,n.localRotation,Ps),this.dirtyLocalTransform(t,n)}},{key:"setLocalScale",value:function(t,e){var n,i=2>=arguments.length||void 0===arguments[2]||arguments[2],r=t.transformable;st(ys,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:r.localScale[2]),mt(ys,r.localScale)||(ot(r.localScale,ys),i&&this.dirtyLocalTransform(t,r))}},{key:"scaleLocal",value:function(t,e){var n,i,r,a,o=t.transformable;i=o.localScale,r=o.localScale,a=st(ys,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:1),i[0]=r[0]*a[0],i[1]=r[1]*a[1],i[2]=r[2]*a[2],this.dirtyLocalTransform(t,o)}},{key:"setLocalSkew",value:function(t,e,n){var i=3>=arguments.length||void 0===arguments[3]||arguments[3];"number"==typeof e&&(e=function(t,e,n){return t[0]=e,t[1]=n,t}(ms,e,n));var r,a,o=t.transformable;(r=o.localSkew)[0]=(a=e)[0],r[1]=a[1],i&&this.dirtyLocalTransform(t,o)}},{key:"setLocalEulerAngles",value:function(t,e){var n=4>=arguments.length||void 0===arguments[4]||arguments[4];"number"==typeof e&&(e=at(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var i=t.transformable;Pt(i.localRotation,e[0],e[1],e[2]),n&&this.dirtyLocalTransform(t,i)}},{key:"setLocalTransform",value:function(t,e){var n=z(Es,e),i=X(xs,e),r=j(bs,e);this.setLocalScale(t,r,!1),this.setLocalPosition(t,n,!1),this.setLocalRotation(t,i,void 0,void 0,void 0,!1),this.dirtyLocalTransform(t,t.transformable)}},{key:"resetLocalTransform",value:function(t){this.setLocalScale(t,vs,!1),this.setLocalPosition(t,ds,!1),this.setLocalEulerAngles(t,ds,void 0,void 0,!1),this.setLocalSkew(t,fs,void 0,!1),this.dirtyLocalTransform(t,t.transformable)}},{key:"getPosition",value:function(t){var e=t.transformable;return z(e.position,this.getWorldTransform(t,e))}},{key:"getRotation",value:function(t){var e=t.transformable;return X(e.rotation,this.getWorldTransform(t,e))}},{key:"getScale",value:function(t){var e=t.transformable;return j(e.scaling,this.getWorldTransform(t,e))}},{key:"getOrigin",value:function(t){return t.getGeometryBounds(),t.transformable.origin}},{key:"getWorldTransform",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.transformable;return e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.internalUpdateTransform(t),e.worldTransform):e.worldTransform}},{key:"setPosition",value:function(t,e){var n,i=t.transformable;if(Ms[0]=e[0],Ms[1]=e[1],Ms[2]=null!==(n=e[2])&&void 0!==n?n:0,!mt(this.getPosition(t),Ms)){if(ot(i.position,Ms),null!==t.parentNode&&t.parentNode.transformable)N(ws,t.parentNode.transformable.worldTransform),A(ws,ws),pt(i.localPosition,Ms,ws);else ot(i.localPosition,Ms);this.dirtyLocalTransform(t,i)}}},{key:"translate",value:function(t,e){"number"==typeof e&&(e=st(ys,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)),mt(e,ds)||(ut(ys,this.getPosition(t),e),this.setPosition(t,ys))}},{key:"setRotation",value:function(t,e,n,i,r){var a=t.transformable;if("number"==typeof e&&(e=St(e,n,i,r)),null!==t.parentNode&&t.parentNode.transformable){var o=this.getRotation(t.parentNode);Ct(ks,o),Nt(ks,ks),wt(a.localRotation,ks,e),Ot(a.localRotation,a.localRotation),this.dirtyLocalTransform(t,a)}else this.setLocalRotation(t,e)}},{key:"rotate",value:function(t,e){"number"==typeof e&&(e=at(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var i=ks;Pt(i,e[0],e[1],e[2]);var r=this.getRotation(t),a=this.getRotation(t.parentNode);Ct(Ss,a),Nt(Ss,Ss),wt(i,Ss,i),wt(n.localRotation,i,r),Ot(n.localRotation,n.localRotation),this.dirtyLocalTransform(t,n)}else this.rotateLocal(t,e)}},{key:"setOrigin",value:function(t,e){"number"==typeof e&&(e=[e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0]);var n=t.transformable;if(e[0]!==n.origin[0]||e[1]!==n.origin[1]||e[2]!==n.origin[2]){var i=n.origin;i[0]=e[0],i[1]=e[1],i[2]=e[2]||0,this.dirtyLocalTransform(t,n)}}},{key:"setEulerAngles",value:function(t,e){"number"==typeof e&&(e=at(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){Pt(n.localRotation,e[0],e[1],e[2]);var i=this.getRotation(t.parentNode);Ct(Ns,Nt(ks,i)),Rt(n.localRotation,n.localRotation,Ns),this.dirtyLocalTransform(t,n)}else this.setLocalEulerAngles(t,e)}},{key:"getTransformedGeometryBounds",value:function(t){var e=arguments.length>2?arguments[2]:void 0,n=this.getGeometryBounds(t,arguments.length>1&&void 0!==arguments[1]&&arguments[1]);if(!bn.isEmpty(n)){var i=e||new bn;return i.setFromTransformedAABB(n,this.getWorldTransform(t)),i}return null}},{key:"getGeometryBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.geometry;return n.dirty&&Fs.styleValueRegistry.updateGeometry(t),(e?n.renderBounds:n.contentBounds||null)||new bn}},{key:"getBounds",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=t.renderable;if(!i.boundsDirty&&!n&&i.bounds)return i.bounds;if(!i.renderBoundsDirty&&n&&i.renderBounds)return i.renderBounds;var r=n?i.renderBounds:i.bounds,a=this.getTransformedGeometryBounds(t,n,r);if(t.childNodes.forEach(function(t){var i=e.getBounds(t,n);i&&(a?a.add(i):(a=r||new bn).update(i.center,i.halfExtents))}),a||(a=new bn),n){var o=eo(t);if(o){var s=o.parsedStyle.clipPath.getBounds(n);a?s&&(a=s.intersection(a)):a.update(s.center,s.halfExtents)}}return n?(i.renderBounds=a,i.renderBoundsDirty=!1):(i.bounds=a,i.boundsDirty=!1),a}},{key:"getLocalBounds",value:function(t){if(t.parentNode){var e=ps;t.parentNode.transformable&&(e=A(gs,this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!bn.isEmpty(n)){var i=new bn;return i.setFromTransformedAABB(n,e),i}}return this.getBounds(t)}},{key:"getBoundingClientRect",value:function(t){var e,n,i=this.getGeometryBounds(t);bn.isEmpty(i)||(n=new bn).setFromTransformedAABB(i,this.getWorldTransform(t));var r=null===(e=t.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect();if(n){var a=g(n.getMin(),2),o=a[0],s=a[1],u=g(n.getMax(),2);return new Pn(o+((null==r?void 0:r.left)||0),s+((null==r?void 0:r.top)||0),u[0]-o,u[1]-s)}return new Pn((null==r?void 0:r.left)||0,(null==r?void 0:r.top)||0,0,0)}},{key:"internalUpdateTransform",value:function(t){var e,n=null===(e=t.parentNode)||void 0===e?void 0:e.transformable;ai(t.transformable),oi(t.transformable,n)}},{key:"internalUpdateElement",value:function(t,e){var n,i,r,a,o,s,u=!0===(null===(n=t.ownerDocument)||void 0===n||null===(n=n.defaultView)||void 0===n||null===(n=n.getConfig())||void 0===n||null===(n=n.future)||void 0===n?void 0:n.experimentalAttributeUpdateOptimization),l=e[e.length-1],c=(null==l?void 0:l.transformDirty)||(null===(i=t.transformable)||void 0===i?void 0:i.localDirtyFlag);t.transformable&&((o=t.transformable).dirtyFlag||(o.dirtyFlag=c));(this.internalUpdateTransform(t),c)&&(null===(s=t.dirty)||void 0===s||s.call(t,!0,!0));var h=(null===(r=t.renderable)||void 0===r?void 0:r.boundsDirty)||(null===(a=t.renderable)||void 0===a?void 0:a.renderBoundsDirty);if((c||h)&&!1===(null==l?void 0:l.shapeUpdated)&&u)for(var f=e.length-1;f>=0;){var d,v,p=e[f];if(p.shapeUpdated)break;null===(d=(v=p.node).dirty)||void 0===d||d.call(v,!0,!0),p.shapeUpdated=!0,f-=1}return c}},{key:"syncHierarchy",value:function(t){for(var e,n,i=[t],r=t.parentNode?[{node:t.parentNode,transformDirty:(null===(e=t.parentNode.transformable)||void 0===e?void 0:e.localDirtyFlag)||(null===(n=t.parentNode.transformable)||void 0===n?void 0:n.dirtyFlag),shapeUpdated:!1}]:[];i.length>0;){for(var a=i.pop(),o=r[r.length-1];r.length>0&&a.parentNode!==o.node;)o=r.pop();var s=this.internalUpdateElement(a,r);if(a.childNodes.length>0){for(var u=a.childNodes.length-1;u>=0;u--)i.push(a.childNodes[u]);r.push({node:a,transformDirty:s,shapeUpdated:!1})}}}},{key:"dirtyLocalTransform",value:function(t,e){ao(t)||e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtyWorldTransform(t,e))}},{key:"dirtyWorldTransform",value:function(t,e){this.dirtifyWorldInternal(t,e),this.dirtyToRoot(t,!0)}},{key:"dirtifyWorldInternal",value:function(t,e){var n,i=this,r=!0===(null===(n=t.ownerDocument)||void 0===n||null===(n=n.defaultView)||void 0===n||null===(n=n.getConfig())||void 0===n||null===(n=n.future)||void 0===n?void 0:n.experimentalAttributeUpdateOptimization);e.dirtyFlag||(e.dirtyFlag=!0,t.dirty(!0,!0),r||t.childNodes.forEach(function(t){i.dirtifyWorldInternal(t,t.transformable)}))}},{key:"dirtyToRoot",value:function(t){for(var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=t,r=!0===(null===(e=t.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e||null===(e=e.getConfig())||void 0===e||null===(e=e.future)||void 0===e?void 0:e.experimentalAttributeUpdateOptimization);i;){var a,o;if(null===(a=(o=i).dirty)||void 0===a||a.call(o,!0,!0),r)break;i=i.parentNode}n&&t.forEach(function(t){var e;null===(e=t.dirty)||void 0===e||e.call(t,!0,!0)}),this.informDependentDisplayObjects(t),this.pendingEvents.set(t,n)}},{key:"dirtifyFragment",value:function(t){var e,n,i=t.transformable;i&&(i.dirtyFlag=!0,i.localDirtyFlag=!0),null===(e=(n=t).dirty)||void 0===e||e.call(n,!0,!0);for(var r=t.childNodes.length,a=0;r>a;a++)this.dirtifyFragment(t.childNodes[a]);t.nodeName===fn.FRAGMENT&&this.pendingEvents.set(t,!1)}},{key:"triggerPendingEvents",value:function(){var t,e,n=this,i=new Set,r=function(e,r){if(e.isConnected&&!i.has(e)&&e.nodeName!==fn.FRAGMENT){if(n.boundsChangedEvent.detail=r,n.boundsChangedEvent.target=e,e.isMutationObserved)e.dispatchEvent(n.boundsChangedEvent);else{var a;if(void 0===t)t=!0===(null===(a=e.ownerDocument.defaultView)||void 0===a||null===(a=a.getConfig())||void 0===a||null===(a=a.future)||void 0===a?void 0:a.experimentalCancelEventPropagation);e.ownerDocument.defaultView.dispatchEvent(n.boundsChangedEvent,!0,t)}i.add(e)}};this.pendingEvents.forEach(function(t,n){if(n.nodeName!==fn.FRAGMENT){var i;if(void 0===e)e=!0===(null===(i=n.ownerDocument)||void 0===i||null===(i=i.defaultView)||void 0===i||null===(i=i.getConfig())||void 0===i||null===(i=i.future)||void 0===i?void 0:i.experimentalAttributeUpdateOptimization);Cs.affectChildren=t,e?r(n,Cs):t?n.forEach(function(t){r(t,Cs)}):r(n,Cs)}}),i.clear(),this.clearPendingEvents()}},{key:"clearPendingEvents",value:function(){this.pendingEvents.clear()}},{key:"updateDisplayObjectDependency",value:function(t,e,n,i){if(e&&e!==n){var r=this.displayObjectDependencyMap.get(e);if(r&&r[t]){var a=r[t].indexOf(i);r[t].splice(a,1)}}if(n){var o=this.displayObjectDependencyMap.get(n);o||(this.displayObjectDependencyMap.set(n,{}),o=this.displayObjectDependencyMap.get(n)),o[t]||(o[t]=[]),o[t].push(i)}}},{key:"informDependentDisplayObjects",value:function(t){var e,n=this,i=this.displayObjectDependencyMap.get(t);if(i){var r=null===(e=t.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e||null===(e=e.getConfig())||void 0===e||null===(e=e.future)||void 0===e?void 0:e.experimentalCancelEventPropagation;Object.keys(i).forEach(function(t){i[t].forEach(function(e){n.dirtyToRoot(e,!0),e.dispatchEvent(new ss(os.ATTR_MODIFIED,e,n,n,t,ss.MODIFICATION,n,n),r,r),e.isCustomElement&&e.isConnected&&e.attributeChangedCallback&&e.attributeChangedCallback(t,n,n)})})}}}])}(),Rs=function(){return u(function t(e){if(o(this,t),0>=e)throw Error("LRU capacity must be a positive number.");this.capacity=e,this.cache=new Map},[{key:"get",value:function(t){if(this.cache.has(t)){var e=this.cache.get(t);return this.cache.delete(t),this.cache.set(t,e),e}}},{key:"put",value:function(t,e){if(this.cache.has(t)&&this.cache.delete(t),this.cache.set(t,e),this.cache.size>this.capacity){var n=this.cache.keys().next().value;this.cache.delete(n)}}},{key:"len",value:function(){return this.cache.size}},{key:"clear",value:function(){this.cache.clear()}}])}(),Os={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]},Ls=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,Is=RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),_s=RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),Ds=function(){return u(function t(e){var n=this;o(this,t),this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,e){return!n.isBreakingSpace(e)&&!(!t||!_s.exec(e)&&!Is.exec(t))},this.trimByKinsokuShorui=function(t){var e=h(t),n=e[e.length-2];if(!n)return t;var i=n[n.length-1];return e[e.length-2]=n.slice(0,-1),e[e.length-1]=i+e[e.length-1],e},this.runtime=e,this.charWidthCache=new Rs(100)},[{key:"measureFont",value:function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var n={ascent:0,descent:0,fontSize:0},i=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(e),r=this.runtime.offscreenCanvasCreator.getOrCreateContext(e,{willReadFrequently:!0});r.font=t;var a=Os.MetricsString+Os.BaselineSymbol,o=Math.ceil(r.measureText(a).width),s=Math.ceil(r.measureText(Os.BaselineSymbol).width),u=Os.HeightMultiplier*s;s=s*Os.BaselineMultiplier|0,i.width=o,i.height=u,r.fillStyle="#f00",r.fillRect(0,0,o,u),r.font=t,r.textBaseline="alphabetic",r.fillStyle="#000",r.fillText(a,0,s);var l=r.getImageData(0,0,o||1,u||1).data,c=l.length,h=4*o,f=0,d=0,v=!1;for(f=0;s>f;++f){for(var p=0;h>p;p+=4)if(255!==l[d+p]){v=!0;break}if(v)break;d+=h}for(n.ascent=s-f,d=c-h,v=!1,f=u;f>s;--f){for(var m=0;h>m;m+=4)if(255!==l[d+m]){v=!0;break}if(v)break;d-=h}return n.descent=f-s,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n,n}},{key:"measureText",value:function(t,e,n){var i=e.fontSize,r=void 0===i?16:i,a=e.wordWrap,o=void 0!==a&&a,s=e.lineHeight,u=e.lineWidth,l=void 0===u?1:u,c=e.textBaseline,h=void 0===c?"alphabetic":c,f=e.textAlign,d=void 0===f?"start":f,v=e.letterSpacing,p=void 0===v?0:v,m=e.textPath,y=e.leading,g=void 0===y?0:y,k=wo(e),E=this.measureFont(k,n);0===E.fontSize&&(E.fontSize=r,E.ascent=r);var x=this.runtime.offscreenCanvasCreator.getOrCreateContext(n);x.font=k,e.isOverflowing=!1;var b=(o?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),T=Array(b.length),M=0;if(!m){for(var w=0;b.length>w;w++){var N=x.measureText(b[w]).width+(b[w].length-1)*p;T[w]=N,M=Math.max(M,N)}var P=M+l,S=s||E.fontSize+l,C=Math.max(S,E.fontSize+l)+(b.length-1)*(S+g),A=0;return"middle"===h?A=-C/2:"bottom"===h||"alphabetic"===h||"ideographic"===h?A=-C:"top"!==h&&"hanging"!==h||(A=0),{font:k,width:P,height:C,lines:b,lineWidths:T,lineHeight:S+=g,maxLineWidth:M,fontProperties:E,lineMetrics:T.map(function(t,e){var n=0;return"center"===d||"middle"===d?n-=t/2:"right"!==d&&"end"!==d||(n-=t),new Pn(n-l/2,A+e*S,t+l,S)})}}m.getTotalLength();for(var R=0;b.length>R;R++)x.measureText(b[R])}},{key:"wordWrap",value:function(t,e,n){var i=this,r=Array.from(t);if(0===r.length)return"";var a=this,o=e.wordWrapWidth,s=void 0===o?0:o,u=e.letterSpacing,l=void 0===u?0:u,c=e.maxLines,h=void 0===c?1/0:c,f=e.textOverflow,d=this.runtime.offscreenCanvasCreator.getOrCreateContext(n),v=s+l,p="";"ellipsis"===f?p="...":f&&"clip"!==f&&(p=f);var m=[""],y=0,g=0,k=-1,E=wo(e),x=this.charWidthCache.get(E);x||(x=new Rs(500),this.charWidthCache.put(E,x));var b=function(t){return i.getFromCache(t,l,x,d)},T=b(p);function M(t,e,n,i){for(;b(t)<i&&r.length-1>e&&!a.isNewline(r[e+1]);)t+=r[e+=1];for(;b(t)>i&&e>=n;)e-=1,t=t.slice(0,-1);return{lineTxt:t,txtLastCharIndex:e}}function w(t,e){if(T>0&&v>=T)if(m[t]){var n=M(m[t],e,k+1,v-T);m[t]=n.lineTxt+p}else m[t]=p}for(var N=0;r.length>N;N++){var P=r[N],S=r[N-1],C=r[N+1],A=b(P);if(this.isNewline(P)){if(y+1>=h){r.length-1>N&&w(y,N-1),e.isOverflowing=!0;break}k=N-1,g=0,m[y+=1]=""}else{if(A>v){w(y,N-1),e.isOverflowing=!0;break}if(g>0&&g+A>v){var R=M(m[y],N-1,k+1,v);if(R.txtLastCharIndex!==N-1){if(m[y]=R.lineTxt,R.txtLastCharIndex===r.length-1)break;S=r[(N=R.txtLastCharIndex+1)-1],C=r[N+1],A=b(P=r[N])}if(y+1>=h){w(y,N-1),e.isOverflowing=!0;break}if(k=N-1,g=0,m[y+=1]="",this.isBreakingSpace(P))continue;this.canBreakInLastChar(P)||(m=this.trimToBreakable(m),g=this.sumTextWidthByCache(m[y]||"",b)),this.shouldBreakByKinsokuShorui(P,C)&&(m=this.trimByKinsokuShorui(m),g+=b(S||""))}g+=A,m[y]+=P}}return m.join("\n")}},{key:"isBreakingSpace",value:function(t){return"string"==typeof t&&Os.BreakingSpaces.indexOf(t.charCodeAt(0))>=0}},{key:"isNewline",value:function(t){return"string"==typeof t&&Os.Newlines.indexOf(t.charCodeAt(0))>=0}},{key:"trimToBreakable",value:function(t){var e=h(t),n=e[e.length-2],i=this.findBreakableIndex(n);if(-1===i||!n)return e;var r=n.slice(i,i+1),a=i+(this.isBreakingSpace(r)?0:1);return e[e.length-1]+=n.slice(i+1,n.length),e[e.length-2]=n.slice(0,a),e}},{key:"canBreakInLastChar",value:function(t){return!t||!Ls.test(t)}},{key:"sumTextWidthByCache",value:function(t,e){return t.split("").reduce(function(t,n){return t+e(n)},0)}},{key:"findBreakableIndex",value:function(t){for(var e=t.length-1;e>=0;e--)if(!Ls.test(t[e]))return e;return-1}},{key:"getFromCache",value:function(t,e,n,i){var r=n.get(t);if("number"!=typeof r){var a=t.length*e,o=i.measureText(t);n.put(t,r=o.width+a)}return r}},{key:"clearCache",value:function(){this.fontMetricsCache={},this.charWidthCache.clear()}}])}(),Fs={},Gs=(ls=new zo,cs=new Yo,i(i(i(i(i(i(i(i(i(i(us={},fn.FRAGMENT,null),fn.CIRCLE,new Go),fn.ELLIPSE,new Bo),fn.RECT,ls),fn.IMAGE,ls),fn.GROUP,new Xo),fn.LINE,new Vo),fn.TEXT,new jo(Fs)),fn.POLYLINE,cs),fn.POLYGON,cs),i(i(i(us,fn.PATH,new Uo),fn.HTML,new Ho),fn.MESH,null)),Bs=function(t){var e=new Da,n=new Ba;return i(i(i(i(i(i(i(i(i(i(t={},ui.PERCENTAGE,null),ui.NUMBER,new za),ui.ANGLE,new Ia),ui.DEFINED_PATH,new _a),ui.PAINT,e),ui.COLOR,e),ui.FILTER,new Fa),ui.LENGTH,n),ui.LENGTH_PERCENTAGE,n),ui.LENGTH_PERCENTAGE_12,new Va),i(i(i(i(i(i(i(i(i(i(t,ui.LENGTH_PERCENTAGE_14,new Ua),ui.COORDINATE,new Ba),ui.OFFSET_DISTANCE,new ja),ui.OPACITY_VALUE,new Xa),ui.PATH,new Ha),ui.LIST_OF_POINTS,new Wa),ui.SHADOW_BLUR,new qa),ui.TEXT,new Za),ui.TEXT_TRANSFORM,new Ka),ui.TRANSFORM,new _o),i(i(i(t,ui.TRANSFORM_ORIGIN,new Do),ui.Z_INDEX,new Fo),ui.MARKER,new Ya)}();Fs.CameraContribution=Jn,Fs.AnimationTimeline=null,Fs.EasingFunction=null,Fs.offscreenCanvasCreator=new es,Fs.sceneGraphSelector=new as,Fs.sceneGraphService=new As(Fs),Fs.textService=new Ds(Fs),Fs.geometryUpdaterFactory=Gs,Fs.CSSPropertySyntaxFactory=Bs,Fs.styleValueRegistry=new Oa(Fs),Fs.layoutRegistry=null,Fs.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},Fs.enableStyleSyntax=!0,Fs.enableSizeAttenuation=!1;var Vs=0;var Us=new ss(os.INSERTED,null,"","","",0,"",""),Ys=new ss(os.REMOVED,null,"","","",0,"",""),zs=new Qo(os.DESTROY),js=function(t){function e(){var t;o(this,e);for(var n=arguments.length,i=Array(n),r=0;n>r;r++)i[r]=arguments[r];return(t=p(this,e,[].concat(i))).entity=Vs++,t.transformable={dirtyFlag:!1,localDirtyFlag:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},t.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},t.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},t.cullable={strategy:ti.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},t.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},t.rBushNode={aabb:void 0},t.namespaceURI="g",t.scrollLeft=0,t.scrollTop=0,t.clientTop=0,t.clientLeft=0,t.style={},t.computedStyle={},t.parsedStyle={},t.attributes={},t}return y(e,t),u(e,[{key:"dirty",value:function(){var t=0>=arguments.length||void 0===arguments[0]||arguments[0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.renderable.dirty=t,e&&(this.renderable.boundsDirty=t,this.renderable.renderBoundsDirty=t)}},{key:"className",get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)}},{key:"classList",get:function(){return this.className.split(" ").filter(function(t){return""!==t})}},{key:"tagName",get:function(){return this.nodeName}},{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"parentElement",get:function(){return this.parentNode}},{key:"nextSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null}},{key:"previousSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null}},{key:"cloneNode",value:function(t){throw Error(Sn)}},{key:"appendChild",value:function(t,e){var n;if(t.destroyed)throw Error("Cannot append a destroyed element.");return Fs.sceneGraphService.attach(t,this,e),null!==(n=this.ownerDocument)&&void 0!==n&&n.defaultView&&(ao(this)||t.nodeName!==fn.FRAGMENT?this.ownerDocument.defaultView.mountChildren(t):this.ownerDocument.defaultView.mountFragment(t)),this.isMutationObserved&&(Us.relatedNode=this,t.dispatchEvent(Us)),t}},{key:"insertBefore",value:function(t,e){if(e){t.parentElement&&t.parentElement.removeChild(t);var n=this.childNodes.indexOf(e);-1===n?this.appendChild(t):this.appendChild(t,n)}else this.appendChild(t);return t}},{key:"replaceChild",value:function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e}},{key:"removeChild",value:function(t){var e,n,i=!0===(null===(e=this.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e||null===(e=e.getConfig().future)||void 0===e?void 0:e.experimentalCancelEventPropagation);return Ys.relatedNode=this,t.dispatchEvent(Ys,i,i),null!==(n=t.ownerDocument)&&void 0!==n&&n.defaultView&&t.ownerDocument.defaultView.unmountChildren(t),Fs.sceneGraphService.detach(t),t}},{key:"removeChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){this.removeChild(this.childNodes[t])}}},{key:"destroyChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length>0&&e.destroyChildren(),e.destroy()}}},{key:"matches",value:function(t){return Fs.sceneGraphService.matches(t,this)}},{key:"getElementById",value:function(t){return Fs.sceneGraphService.querySelector("#".concat(t),this)}},{key:"getElementsByName",value:function(t){return Fs.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)}},{key:"getElementsByClassName",value:function(t){return Fs.sceneGraphService.querySelectorAll(".".concat(t),this)}},{key:"getElementsByTagName",value:function(t){return Fs.sceneGraphService.querySelectorAll(t,this)}},{key:"querySelector",value:function(t){return Fs.sceneGraphService.querySelector(t,this)}},{key:"querySelectorAll",value:function(t){return Fs.sceneGraphService.querySelectorAll(t,this)}},{key:"closest",value:function(t){var e=this;do{if(Fs.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null}},{key:"find",value:function(t){var e=this,n=null;return this.forEach(function(i){return i===e||!t(i)||(n=i,!1)}),n}},{key:"findAll",value:function(t){var e=this,n=[];return this.forEach(function(i){i!==e&&t(i)&&n.push(i)}),n}},{key:"after",value:function(){var t=this;if(this.parentNode){for(var e=this.parentNode.childNodes.indexOf(this),n=arguments.length,i=Array(n),r=0;n>r;r++)i[r]=arguments[r];i.forEach(function(n,i){var r;return null===(r=t.parentNode)||void 0===r?void 0:r.appendChild(n,e+i+1)})}}},{key:"before",value:function(){if(this.parentNode){for(var t,e=this.parentNode.childNodes.indexOf(this),n=arguments.length,i=Array(n),r=0;n>r;r++)i[r]=arguments[r];var a=i[0],o=i.slice(1);this.parentNode.appendChild(a,e),(t=a).after.apply(t,h(o))}}},{key:"replaceWith",value:function(){this.after.apply(this,arguments),this.remove()}},{key:"append",value:function(){for(var t=this,e=arguments.length,n=Array(e),i=0;e>i;i++)n[i]=arguments[i];n.forEach(function(e){return t.appendChild(e)})}},{key:"prepend",value:function(){for(var t=this,e=arguments.length,n=Array(e),i=0;e>i;i++)n[i]=arguments[i];n.forEach(function(e,n){return t.appendChild(e,n)})}},{key:"replaceChildren",value:function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)}},{key:"remove",value:function(){return this.parentNode?this.parentNode.removeChild(this):this}},{key:"destroy",value:function(){var t,e=!0===(null===(t=this.ownerDocument)||void 0===t||null===(t=t.defaultView)||void 0===t||null===(t=t.getConfig().future)||void 0===t?void 0:t.experimentalCancelEventPropagation);this.destroyChildren(),this.dispatchEvent(zs,e,e),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0}},{key:"getGeometryBounds",value:function(){return Fs.sceneGraphService.getGeometryBounds(this)}},{key:"getRenderBounds",value:function(){return Fs.sceneGraphService.getBounds(this,!0)}},{key:"getBounds",value:function(){return Fs.sceneGraphService.getBounds(this)}},{key:"getLocalBounds",value:function(){return Fs.sceneGraphService.getLocalBounds(this)}},{key:"getBoundingClientRect",value:function(){return Fs.sceneGraphService.getBoundingClientRect(this)}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"computedStyleMap",value:function(){return new Map(Object.entries(this.computedStyle))}},{key:"getAttributeNames",value:function(){return Object.keys(this.attributes)}},{key:"getAttribute",value:function(t){if("symbol"!=typeof t){var e=this.attributes[t];return e}}},{key:"hasAttribute",value:function(t){return this.getAttributeNames().includes(t)}},{key:"hasAttributes",value:function(){return!!this.getAttributeNames().length}},{key:"removeAttribute",value:function(t){this.setAttribute(t,null),delete this.attributes[t]}},{key:"setAttribute",value:function(t,e,n,i){this.attributes[t]=e}},{key:"getAttributeNS",value:function(t,e){throw Error(Sn)}},{key:"getAttributeNode",value:function(t){throw Error(Sn)}},{key:"getAttributeNodeNS",value:function(t,e){throw Error(Sn)}},{key:"hasAttributeNS",value:function(t,e){throw Error(Sn)}},{key:"removeAttributeNS",value:function(t,e){throw Error(Sn)}},{key:"removeAttributeNode",value:function(t){throw Error(Sn)}},{key:"setAttributeNS",value:function(t,e,n){throw Error(Sn)}},{key:"setAttributeNode",value:function(t){throw Error(Sn)}},{key:"setAttributeNodeNS",value:function(t){throw Error(Sn)}},{key:"toggleAttribute",value:function(t,e){throw Error(Sn)}}])}(Jo);function Xs(t){return!(null==t||!t.nodeName)}var Hs=Fs.globalThis.Proxy?Fs.globalThis.Proxy:function(){},Ws=new ss(os.ATTR_MODIFIED,null,null,null,null,ss.MODIFICATION,null,null),qs=nt(),Zs=Tt(),Ks=function(t){function e(t){var n;return o(this,e),(n=p(this,e)).isCustomElement=!1,n.isMutationObserved=!1,n.activeAnimations=[],n.config=t,n.id=t.id||"",n.name=t.name||"",(t.className||t.class)&&(n.className=t.className||t.class),n.nodeName=t.type||fn.GROUP,t.initialParsedStyle&&Object.assign(n.parsedStyle,t.initialParsedStyle),n.initAttributes(t.style),Fs.enableStyleSyntax&&(n.style=new Hs({setProperty:function(t,e){n.setAttribute(t,e)},getPropertyValue:function(t){return n.getAttribute(t)},removeProperty:function(t){n.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:n.getAttribute(e)},set:function(t,e,i){return n.setAttribute(e,i),!0}})),n}return y(e,t),u(e,[{key:"destroy",value:function(){_e(e,"destroy",this,3)([]),this.getAnimations().forEach(function(t){t.cancel()})}},{key:"cloneNode",value:function(t,e){var n=a({},this.attributes);for(var i in n){var r=n[i];Xs(r)&&"clipPath"!==i&&"offsetPath"!==i&&"textPath"!==i&&(n[i]=r.cloneNode(t)),e&&(n[i]=e(i,r))}var o=new this.constructor(a(a({},this.config),{},{style:n}));return o.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach(function(e){if(!e.style.isMarker){var n=e.cloneNode(t);o.appendChild(n)}}),o}},{key:"initAttributes",value:function(){Fs.styleValueRegistry.processProperties(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{forceUpdateGeometry:!0}),this.dirty()}},{key:"setAttribute",value:function(t,n){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=3>=arguments.length||void 0===arguments[3]||arguments[3];Wt(n)||(i||n!==this.attributes[t])&&(this.internalSetAttribute(t,n,{memoize:r}),_e(e,"setAttribute",this,3)([t,n]))}},{key:"internalSetAttribute",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.attributes[t],a=this.parsedStyle[t];Fs.styleValueRegistry.processProperties(this,i({},t,e),n),this.dirty();var o,s=this.parsedStyle[t];if(this.isConnected)if(Ws.relatedNode=this,Ws.prevValue=r,Ws.newValue=e,Ws.attrName=t,Ws.prevParsedValue=a,Ws.newParsedValue=s,this.isMutationObserved)this.dispatchEvent(Ws);else{var u,l=!0===(null===(u=this.ownerDocument.defaultView.getConfig().future)||void 0===u?void 0:u.experimentalCancelEventPropagation);Ws.target=this,this.ownerDocument.defaultView.dispatchEvent(Ws,!0,l)}(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&(null===(o=this.attributeChangedCallback)||void 0===o||o.call(this,t,r,e,a,s))}},{key:"getBBox",value:function(){var t=this.getBounds(),e=g(t.getMin(),2),n=e[0],i=e[1],r=g(t.getMax(),2);return new Pn(n,i,r[0]-n,r[1]-i)}},{key:"setOrigin",value:function(t){return Fs.sceneGraphService.setOrigin(this,On(t,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 Fs.sceneGraphService.getOrigin(this)}},{key:"setPosition",value:function(t){return Fs.sceneGraphService.setPosition(this,On(t,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(t){return Fs.sceneGraphService.setLocalPosition(this,On(t,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(t){return Fs.sceneGraphService.translate(this,On(t,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(t){return Fs.sceneGraphService.translateLocal(this,On(t,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 Fs.sceneGraphService.getPosition(this)}},{key:"getLocalPosition",value:function(){return Fs.sceneGraphService.getLocalPosition(this)}},{key:"scale",value:function(t,e,n){return this.scaleLocal(t,e,n)}},{key:"scaleLocal",value:function(t,e,n){return"number"==typeof t&&(t=On(t,e=e||t,n=n||t,!1)),Fs.sceneGraphService.scaleLocal(this,t),this}},{key:"setLocalScale",value:function(t,e,n){return"number"==typeof t&&(t=On(t,e=e||t,n=n||t,!1)),Fs.sceneGraphService.setLocalScale(this,t),this}},{key:"getLocalScale",value:function(){return Fs.sceneGraphService.getLocalScale(this)}},{key:"getScale",value:function(){return Fs.sceneGraphService.getScale(this)}},{key:"getEulerAngles",value:function(){return Dn(g(Bn(qs,Fs.sceneGraphService.getWorldTransform(this)),3)[2])}},{key:"getLocalEulerAngles",value:function(){return Dn(g(Bn(qs,Fs.sceneGraphService.getLocalRotation(this)),3)[2])}},{key:"setEulerAngles",value:function(t){return Fs.sceneGraphService.setEulerAngles(this,0,0,t),this}},{key:"setLocalEulerAngles",value:function(t){return Fs.sceneGraphService.setLocalEulerAngles(this,0,0,t),this}},{key:"rotateLocal",value:function(t,e,n){return _t(e)&&_t(n)?Fs.sceneGraphService.rotateLocal(this,0,0,t):Fs.sceneGraphService.rotateLocal(this,t,e,n),this}},{key:"rotate",value:function(t,e,n){return _t(e)&&_t(n)?Fs.sceneGraphService.rotate(this,0,0,t):Fs.sceneGraphService.rotate(this,t,e,n),this}},{key:"setRotation",value:function(t,e,n,i){return Fs.sceneGraphService.setRotation(this,t,e,n,i),this}},{key:"setLocalRotation",value:function(t,e,n,i){return Fs.sceneGraphService.setLocalRotation(this,t,e,n,i),this}},{key:"setLocalSkew",value:function(t,e){return Fs.sceneGraphService.setLocalSkew(this,t,e),this}},{key:"getRotation",value:function(){return Fs.sceneGraphService.getRotation(this)}},{key:"getLocalRotation",value:function(){return Fs.sceneGraphService.getLocalRotation(this)}},{key:"getLocalSkew",value:function(){return Fs.sceneGraphService.getLocalSkew(this)}},{key:"getLocalTransform",value:function(){return Fs.sceneGraphService.getLocalTransform(this)}},{key:"getWorldTransform",value:function(){return Fs.sceneGraphService.getWorldTransform(this)}},{key:"setLocalTransform",value:function(t){return Fs.sceneGraphService.setLocalTransform(this,t),this}},{key:"resetLocalTransform",value:function(){Fs.sceneGraphService.resetLocalTransform(this)}},{key:"getAnimations",value:function(){return this.activeAnimations}},{key:"animate",value:function(t,e){var n,i=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;return i?i.play(this,t,e):null}},{key:"isVisible",value:function(){var t;return"hidden"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)}},{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}},{key:"isInteractive",value:function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)}},{key:"isCulled",value:function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)}},{key:"toFront",value:function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,h(this.parentNode.children.map(function(t){return Number(t.style.zIndex)})))+1),this}},{key:"toBack",value:function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,h(this.parentNode.children.map(function(t){return Number(t.style.zIndex)})))-1),this}},{key:"getConfig",value:function(){return this.config}},{key:"attr",value:function(){for(var t=this,e=arguments.length,n=Array(e),i=0;e>i;i++)n[i]=arguments[i];var r=n[0],a=n[1];return r?function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e}(r)?(Object.keys(r).forEach(function(e){t.setAttribute(e,r[e])}),this):2===n.length?(this.setAttribute(r,a),this):this.attributes[r]:this.attributes}},{key:"getMatrix",value:function(t){var e=t||this.getWorldTransform(),n=g(z(qs,e),2),i=n[0],r=n[1],a=g(j(qs,e),2),o=a[0],s=a[1],u=X(Zs,e),l=g(Bn(qs,u),3);return Vn(l[0]||l[2],i,r,o,s)}},{key:"getLocalMatrix",value:function(){return this.getMatrix(this.getLocalTransform())}},{key:"setMatrix",value:function(t){var e=g(Un(t),5),n=e[0],i=e[1],r=e[2],a=e[3];this.setEulerAngles(e[4]).setPosition(n,i).setLocalScale(r,a)}},{key:"setLocalMatrix",value:function(t){var e=g(Un(t),5),n=e[0],i=e[1],r=e[2],a=e[3];this.setLocalEulerAngles(e[4]).setLocalPosition(n,i).setLocalScale(r,a)}},{key:"show",value:function(){this.forEach(function(t){t.style.visibility="visible"})}},{key:"hide",value:function(){this.forEach(function(t){t.style.visibility="hidden"})}},{key:"getCount",value:function(){return this.childElementCount}},{key:"getParent",value:function(){return this.parentElement}},{key:"getChildren",value:function(){return this.children}},{key:"getFirst",value:function(){return this.firstElementChild}},{key:"getLast",value:function(){return this.lastElementChild}},{key:"getChildByIndex",value:function(t){return this.children[t]||null}},{key:"add",value:function(t,e){return this.appendChild(t,e)}},{key:"set",value:function(t,e){this.config[t]=e}},{key:"get",value:function(t){return this.config[t]}},{key:"moveTo",value:function(t){return this.setPosition(t,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(t){return this.setPosition(t,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(t){return this.style.zIndex=t,this}}])}(js);Ks.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 Qs=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,e),p(this,e,[a({type:fn.CIRCLE},t)])}return y(e,t),u(e)}(Ks);Qs.PARSED_STYLE_LIST=new Set([].concat(h(Ks.PARSED_STYLE_LIST),["cx","cy","cz","r","isBillboard","isSizeAttenuation"]));var $s=["style"],Js=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.style,r=ln(n,$s);return o(this,e),(t=p(this,e,[a({style:i},r)])).isCustomElement=!0,t}return y(e,t),u(e)}(Ks);Js.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var tu=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,e),p(this,e,[a({type:fn.ELLIPSE},t)])}return y(e,t),u(e)}(Ks);tu.PARSED_STYLE_LIST=new Set([].concat(h(Ks.PARSED_STYLE_LIST),["cx","cy","cz","rx","ry","isBillboard","isSizeAttenuation"]));var eu=function(t){function e(){return o(this,e),p(this,e,[{type:fn.FRAGMENT}])}return y(e,t),u(e)}(Ks);eu.PARSED_STYLE_LIST=new Set(["class","className"]);var nu=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,e),p(this,e,[a({type:fn.GROUP},t)])}return y(e,t),u(e)}(Ks);nu.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var iu=["style"],ru=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.style,r=ln(n,iu);return o(this,e),(t=p(this,e,[a({type:fn.HTML,style:i},r)])).cullable.enable=!1,t}return y(e,t),u(e,[{key:"getDomElement",value:function(){return this.parsedStyle.$el}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"getLocalBounds",value:function(){if(this.parentNode){var t=A(M(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!bn.isEmpty(e)){var n=new bn;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()}}])}(Ks);ru.PARSED_STYLE_LIST=new Set([].concat(h(Ks.PARSED_STYLE_LIST),["x","y","$el","innerHTML","width","height"]));var au=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,e),p(this,e,[a({type:fn.IMAGE},t)])}return y(e,t),u(e)}(Ks);au.PARSED_STYLE_LIST=new Set([].concat(h(Ks.PARSED_STYLE_LIST),["x","y","z","src","width","height","isBillboard","billboardRotation","isSizeAttenuation","keepAspectRatio"]));var ou=["style"],su=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.style,r=ln(n,ou);o(this,e),(t=p(this,e,[a({type:fn.LINE,style:a({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},i)},r)])).markerStartAngle=0,t.markerEndAngle=0;var s=t.parsedStyle,u=s.markerStart,l=s.markerEnd;return u&&Xs(u)&&(t.markerStartAngle=u.getLocalEulerAngles(),t.appendChild(u)),l&&Xs(l)&&(t.markerEndAngle=l.getLocalEulerAngles(),t.appendChild(l)),t.transformMarker(!0),t.transformMarker(!1),t}return y(e,t),u(e,[{key:"attributeChangedCallback",value:function(t,e,n,i,r){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(i&&Xs(i)&&(this.markerStartAngle=0,i.remove()),r&&Xs(r)&&(this.markerStartAngle=r.getLocalEulerAngles(),this.appendChild(r),this.transformMarker(!0))):"markerEnd"===t&&(i&&Xs(i)&&(this.markerEndAngle=0,i.remove()),r&&Xs(r)&&(this.markerEndAngle=r.getLocalEulerAngles(),this.appendChild(r),this.transformMarker(!1)))}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStartOffset,i=e.markerEndOffset,r=e.x1,a=e.x2,o=e.y1,s=e.y2,u=t?e.markerStart:e.markerEnd;if(u&&Xs(u)){var l,c,h,f,d,v,p;t?(f=r,d=o,c=a-r,h=s-o,v=n||0,p=this.markerStartAngle):(f=a,d=s,c=r-a,h=o-s,v=i||0,p=this.markerEndAngle),u.setLocalEulerAngles(180*(l=Math.atan2(h,c))/Math.PI+p),u.setLocalPosition(f+Math.cos(l)*v,d+Math.sin(l)*v)}}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle,i=Ye(n.x1,n.y1,n.x2,n.y2,t),r=i.x,a=i.y,o=pt(nt(),at(r,a,0),e?this.getWorldTransform():this.getLocalTransform());return new Nn(o[0],o[1])}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getTotalLength",value:function(){var t=this.parsedStyle;return Ue(t.x1,t.y1,t.x2,t.y2)}}])}(Ks);su.PARSED_STYLE_LIST=new Set([].concat(h(Ks.PARSED_STYLE_LIST),["x1","y1","x2","y2","z1","z2","isBillboard","isSizeAttenuation","markerStart","markerEnd","markerStartOffset","markerEndOffset"]));var uu=["style"],lu=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.style,r=ln(n,uu);o(this,e),(t=p(this,e,[a({type:fn.PATH,style:i,initialParsedStyle:{miterLimit:4,d:a({},si)}},r)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var s=t.parsedStyle,u=s.markerStart,l=s.markerEnd,c=s.markerMid;return u&&Xs(u)&&(t.markerStartAngle=u.getLocalEulerAngles(),t.appendChild(u)),c&&Xs(c)&&t.placeMarkerMid(c),l&&Xs(l)&&(t.markerEndAngle=l.getLocalEulerAngles(),t.appendChild(l)),t.transformMarker(!0),t.transformMarker(!1),t}return y(e,t),u(e,[{key:"attributeChangedCallback",value:function(t,e,n,i,r){"d"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(i&&Xs(i)&&(this.markerStartAngle=0,i.remove()),r&&Xs(r)&&(this.markerStartAngle=r.getLocalEulerAngles(),this.appendChild(r),this.transformMarker(!0))):"markerEnd"===t?(i&&Xs(i)&&(this.markerEndAngle=0,i.remove()),r&&Xs(r)&&(this.markerEndAngle=r.getLocalEulerAngles(),this.appendChild(r),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(r)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStartOffset,i=e.markerEndOffset,r=t?e.markerStart:e.markerEnd;if(r&&Xs(r)){var a,o,s,u,l,c,h;if(t){var f=g(this.getStartTangent(),2),d=f[0],v=f[1];u=v[0],l=v[1],o=d[0]-v[0],s=d[1]-v[1],c=n||0,h=this.markerStartAngle}else{var p=g(this.getEndTangent(),2),m=p[0],y=p[1];u=y[0],l=y[1],o=m[0]-y[0],s=m[1]-y[1],c=i||0,h=this.markerEndAngle}r.setLocalEulerAngles(180*(a=Math.atan2(s,o))/Math.PI+h),r.setLocalPosition(u+Math.cos(a)*c,l+Math.sin(a)*c)}}},{key:"placeMarkerMid",value:function(t){var e=this.parsedStyle.d.segments;if(this.markerMidList.forEach(function(t){t.remove()}),t&&Xs(t))for(var n=1;e.length-1>n;n++){var i=g(e[n].currentPoint,2),r=i[0],a=i[1],o=1===n?t:t.cloneNode(!0);this.markerMidList.push(o),this.appendChild(o),o.setLocalPosition(r,a)}}},{key:"getTotalLength",value:function(){return Hr(this)}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=function(t,e,n){return Ae(t,e,qt(qt({},n),{bbox:!1,length:!0})).point}(this.parsedStyle.d.absolutePath,t),i=n.x,r=n.y,a=pt(nt(),at(i,r,0),e?this.getWorldTransform():this.getLocalTransform());return new Nn(a[0],a[1])}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPointAtLength(t*Hr(this),e)}},{key:"getStartTangent",value:function(){var t=this.parsedStyle.d.segments,e=[];if(t.length>1){var n=t[0].currentPoint,i=t[1].currentPoint,r=t[1].startTangent;e=[],r?(e.push([n[0]-r[0],n[1]-r[1]]),e.push([n[0],n[1]])):(e.push([i[0],i[1]]),e.push([n[0],n[1]]))}return e}},{key:"getEndTangent",value:function(){var t=this.parsedStyle.d.segments,e=t.length,n=[];if(e>1){var i=t[e-2].currentPoint,r=t[e-1].currentPoint,a=t[e-1].endTangent;n=[],a?(n.push([r[0]-a[0],r[1]-a[1]]),n.push([r[0],r[1]])):(n.push([i[0],i[1]]),n.push([r[0],r[1]]))}return n}}])}(Ks);lu.PARSED_STYLE_LIST=new Set([].concat(h(Ks.PARSED_STYLE_LIST),["d","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard","isSizeAttenuation"]));var cu=["style"],hu=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.style,r=ln(n,cu);o(this,e),(t=p(this,e,[a({type:fn.POLYGON,style:i,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},r)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var s=t.parsedStyle,u=s.markerStart,l=s.markerEnd,c=s.markerMid;return u&&Xs(u)&&(t.markerStartAngle=u.getLocalEulerAngles(),t.appendChild(u)),c&&Xs(c)&&t.placeMarkerMid(c),l&&Xs(l)&&(t.markerEndAngle=l.getLocalEulerAngles(),t.appendChild(l)),t.transformMarker(!0),t.transformMarker(!1),t}return y(e,t),u(e,[{key:"attributeChangedCallback",value:function(t,e,n,i,r){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(i&&Xs(i)&&(this.markerStartAngle=0,i.remove()),r&&Xs(r)&&(this.markerStartAngle=r.getLocalEulerAngles(),this.appendChild(r),this.transformMarker(!0))):"markerEnd"===t?(i&&Xs(i)&&(this.markerEndAngle=0,i.remove()),r&&Xs(r)&&(this.markerEndAngle=r.getLocalEulerAngles(),this.appendChild(r),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(r)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStartOffset,i=e.markerEndOffset,r=(e.points||{}).points,a=t?e.markerStart:e.markerEnd;if(a&&Xs(a)&&r){var o,s,u,l,c,h,f;if(l=r[0][0],c=r[0][1],t)s=r[1][0]-r[0][0],u=r[1][1]-r[0][1],h=n||0,f=this.markerStartAngle;else{var d=r.length;this.parsedStyle.isClosed?(s=r[d-1][0]-r[0][0],u=r[d-1][1]-r[0][1]):(l=r[d-1][0],c=r[d-1][1],s=r[d-2][0]-r[d-1][0],u=r[d-2][1]-r[d-1][1]),h=i||0,f=this.markerEndAngle}a.setLocalEulerAngles(180*(o=Math.atan2(u,s))/Math.PI+f),a.setLocalPosition(l+Math.cos(o)*h,c+Math.sin(o)*h)}}},{key:"placeMarkerMid",value:function(t){var e=(this.parsedStyle.points||{}).points;if(this.markerMidList.forEach(function(t){t.remove()}),this.markerMidList=[],t&&Xs(t)&&e)for(var n=1;(this.parsedStyle.isClosed?e.length:e.length-1)>n;n++){var i=e[n][0],r=e[n][1],a=1===n?t:t.cloneNode(!0);this.markerMidList.push(a),this.appendChild(a),a.setLocalPosition(i,r)}}}])}(Ks);hu.PARSED_STYLE_LIST=new Set([].concat(h(Ks.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isClosed","isBillboard","isSizeAttenuation"]));var fu=["style"],du=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,i=ln(t,fu);return o(this,e),p(this,e,[a({type:fn.POLYLINE,style:n,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},i)])}return y(e,t),u(e,[{key:"getTotalLength",value:function(){return 0===(t=this).parsedStyle.points.totalLength&&(t.parsedStyle.points.totalLength=He(t.parsedStyle.points.points)),t.parsedStyle.points.totalLength;var t}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle.points.points;if(0===this.parsedStyle.points.segments.length){var i,r,a=[],o=0,s=this.getTotalLength();n.forEach(function(t,e){n[e+1]&&((i=[0,0])[0]=o/s,r=Ue(t[0],t[1],n[e+1][0],n[e+1][1]),i[1]=(o+=r)/s,a.push(i))}),this.parsedStyle.points.segments=a}var u=0,l=0;this.parsedStyle.points.segments.forEach(function(e,n){e[0]>t||t>e[1]||(u=(t-e[0])/(e[1]-e[0]),l=n)});var c=Ye(n[l][0],n[l][1],n[l+1][0],n[l+1][1],u),h=c.x,f=c.y,d=pt(nt(),at(h,f,0),e?this.getWorldTransform():this.getLocalTransform());return new Nn(d[0],d[1])}},{key:"getStartTangent",value:function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e}},{key:"getEndTangent",value:function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n}}])}(hu);du.PARSED_STYLE_LIST=new Set([].concat(h(hu.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard"]));var vu=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,e),p(this,e,[a({type:fn.RECT},t)])}return y(e,t),u(e)}(Ks);vu.PARSED_STYLE_LIST=new Set([].concat(h(Ks.PARSED_STYLE_LIST),["x","y","z","width","height","isBillboard","isSizeAttenuation","radius"]));var pu=["style"],mu=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,i=ln(t,pu);return o(this,e),p(this,e,[a({type:fn.TEXT,style:a({fill:"black"},n)},i)])}return y(e,t),u(e,[{key:"getComputedTextLength",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0}},{key:"getLineBoundingRects",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]}},{key:"isOverflowing",value:function(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing}}])}(Ks);mu.PARSED_STYLE_LIST=new Set([].concat(h(Ks.PARSED_STYLE_LIST),["x","y","z","isBillboard","billboardRotation","isSizeAttenuation","text","textAlign","textBaseline","fontStyle","fontSize","fontFamily","fontWeight","fontVariant","lineHeight","letterSpacing","leading","wordWrap","wordWrapWidth","maxLines","textOverflow","isOverflowing","textPath","textDecorationLine","textDecorationColor","textDecorationStyle","textPathSide","textPathStartOffset","metrics","dx","dy"]));var yu=function(){return u(function t(){o(this,t),this.registry={},this.define(fn.CIRCLE,Qs),this.define(fn.ELLIPSE,tu),this.define(fn.RECT,vu),this.define(fn.IMAGE,au),this.define(fn.LINE,su),this.define(fn.GROUP,nu),this.define(fn.PATH,lu),this.define(fn.POLYGON,hu),this.define(fn.POLYLINE,du),this.define(fn.TEXT,mu),this.define(fn.HTML,ru)},[{key:"define",value:function(t,e){this.registry[t]=e}},{key:"get",value:function(t){return this.registry[t]}}])}(),gu={number:function(t){return new rr(t)},percent:function(t){return new rr(t,"%")},px:function(t){return new rr(t,"px")},em:function(t){return new rr(t,"em")},rem:function(t){return new rr(t,"rem")},deg:function(t){return new rr(t,"deg")},grad:function(t){return new rr(t,"grad")},rad:function(t){return new rr(t,"rad")},turn:function(t){return new rr(t,"turn")},s:function(t){return new rr(t,"s")},ms:function(t){return new rr(t,"ms")},registerProperty:function(t){Fs.styleValueRegistry.registerMetadata({n:t.name,inh:t.inherits,int:t.interpolable,d:t.initialValue,syntax:t.syntax})},registerLayout:function(t,e){Fs.layoutRegistry.registerLayout(t,e)}},ku=function(t){function e(){var t;o(this,e),(t=p(this,e)).defaultView=null,t.ownerDocument=null,t.nodeName="document";try{t.timeline=new Fs.AnimationTimeline(t)}catch(t){}var n={};return Ca.forEach(function(t){var e=t.d;t.inh&&e&&(n[t.n]=It(e)?e(fn.GROUP):e)}),t.documentElement=new nu({id:"g-root",style:n}),t.documentElement.ownerDocument=t,t.documentElement.parentNode=t,t.childNodes=[t.documentElement],t}return y(e,t),u(e,[{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"createElement",value:function(t,e){if("svg"===t)return this.documentElement;var n=this.defaultView.customElements.get(t);n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?mu:nu);var i=new n(e);return i.ownerDocument=this,i}},{key:"createElementNS",value:function(t,e,n){return this.createElement(e,n)}},{key:"cloneNode",value:function(t){throw Error(Sn)}},{key:"destroy",value:function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}}},{key:"elementsFromBBox",value:function(t,e,n,i){var r=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:i}),a=[];return r.forEach(function(t){var e=t.displayObject,n=e.parsedStyle.pointerEvents,i=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(void 0===n?"auto":n);(!i||i&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&a.push(e)}),a.sort(function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder}),a}},{key:"elementFromPointSync",value:function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),i=n.x,r=n.y,a=this.defaultView.getConfig();if(0>i||0>r||i>a.width||r>a.height)return null;var o=this.defaultView.viewport2Client({x:i,y:r}),s=o.x,u=o.y,l=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:i,viewportY:r,clientX:s,clientY:u},picked:[]}).picked;return l&&l[0]||this.documentElement}},{key:"elementFromPoint",value:(i=sn(an().mark(function t(e,n){var i,r,a,o,s,u,l,c,h,f;return an().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this.defaultView.canvas2Viewport({x:e,y:n}),r=i.x,a=i.y,o=this.defaultView.getConfig(),s=o.width,u=o.height,!(0>r||0>a||r>s||a>u)){t.next=1;break}return t.abrupt("return",null);case 1:return l=this.defaultView.viewport2Client({x:r,y:a}),c=l.x,h=l.y,t.next=2,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:r,viewportY:a,clientX:c,clientY:h},picked:[]});case 2:return t.abrupt("return",(f=t.sent.picked)&&f[0]||this.documentElement);case 3:case"end":return t.stop()}},t,this)})),function(t,e){return i.apply(this,arguments)})},{key:"elementsFromPointSync",value:function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),i=n.x,r=n.y,a=this.defaultView.getConfig();if(0>i||0>r||i>a.width||r>a.height)return[];var o=this.defaultView.viewport2Client({x:i,y:r}),s=o.x,u=o.y,l=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:i,viewportY:r,clientX:s,clientY:u},picked:[]}).picked;return l[l.length-1]!==this.documentElement&&l.push(this.documentElement),l}},{key:"elementsFromPoint",value:(n=sn(an().mark(function t(e,n){var i,r,a,o,s,u,l,c,h,f;return an().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this.defaultView.canvas2Viewport({x:e,y:n}),r=i.x,a=i.y,o=this.defaultView.getConfig(),s=o.width,u=o.height,!(0>r||0>a||r>s||a>u)){t.next=1;break}return t.abrupt("return",[]);case 1:return l=this.defaultView.viewport2Client({x:r,y:a}),c=l.x,h=l.y,t.next=2,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:r,viewportY:a,clientX:c,clientY:h},picked:[]});case 2:return(f=t.sent.picked)[f.length-1]!==this.documentElement&&f.push(this.documentElement),t.abrupt("return",f);case 3:case"end":return t.stop()}},t,this)})),function(t,e){return n.apply(this,arguments)})},{key:"appendChild",value:function(t,e){throw Error(Cn)}},{key:"insertBefore",value:function(t,e){throw Error(Cn)}},{key:"removeChild",value:function(t,e){throw Error(Cn)}},{key:"replaceChild",value:function(t,e,n){throw Error(Cn)}},{key:"append",value:function(){throw Error(Cn)}},{key:"prepend",value:function(){throw Error(Cn)}},{key:"getElementById",value:function(t){return this.documentElement.getElementById(t)}},{key:"getElementsByName",value:function(t){return this.documentElement.getElementsByName(t)}},{key:"getElementsByTagName",value:function(t){return this.documentElement.getElementsByTagName(t)}},{key:"getElementsByClassName",value:function(t){return this.documentElement.getElementsByClassName(t)}},{key:"querySelector",value:function(t){return this.documentElement.querySelector(t)}},{key:"querySelectorAll",value:function(t){return this.documentElement.querySelectorAll(t)}},{key:"find",value:function(t){return this.documentElement.find(t)}},{key:"findAll",value:function(t){return this.documentElement.findAll(t)}}]);var n,i}(Jo),Eu=function(){function t(e){o(this,t),this.strategies=e}return u(t,[{key:"apply",value:function(e){var n=e.config,i=e.camera,r=e.renderingService,a=e.renderingContext,o=this.strategies;r.hooks.cull.tap(t.tag,function(t){if(t){var e,r=t.cullable;if(r.visible=0===o.length?a.unculledEntities.indexOf(t.entity)>-1:o.every(function(e){return e.isVisible(i,t)}),!t.isCulled()&&t.isVisible())return t;var s=!0===(null===(e=n.future)||void 0===e?void 0:e.experimentalCancelEventPropagation);return t.dispatchEvent(new Qo(os.CULLED),s,s),null}return t}),r.hooks.afterRender.tap(t.tag,function(t){t.cullable.visibilityPlaneMask=-1})}}])}();Eu.tag="Culling";var xu=function(){function t(){var e=this;o(this,t),this.autoPreventDefault=!1,this.rootPointerEvent=new Zo(null),this.rootWheelEvent=new Ko(null),this.onPointerMove=function(t){var n,i=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView;if(!i.supportsTouchEvents||"touch"!==t.pointerType){var r,a=un(e.normalizeToPointerEvent(t,i));try{for(a.s();!(r=a.n()).done;){var o=e.bootstrapEvent(e.rootPointerEvent,r.value,i,t);e.context.eventService.mapEvent(o)}}catch(t){a.e(t)}finally{a.f()}e.setCursor(e.context.eventService.cursor)}},this.onClick=function(t){var n,i,r=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView,a=un(e.normalizeToPointerEvent(t,r));try{for(a.s();!(i=a.n()).done;){var o=e.bootstrapEvent(e.rootPointerEvent,i.value,r,t);e.context.eventService.mapEvent(o)}}catch(t){a.e(t)}finally{a.f()}e.setCursor(e.context.eventService.cursor)}}return u(t,[{key:"apply",value:function(e){var n=this;this.context=e;var i=e.renderingService,r=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler(function(t){return n.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null}),i.hooks.pointerWheel.tap(t.tag,function(t){var e=n.normalizeWheelEvent(t);n.context.eventService.mapEvent(e)}),i.hooks.pointerDown.tap(t.tag,function(t){if(!r.supportsTouchEvents||"touch"!==t.pointerType){var e=n.normalizeToPointerEvent(t,r);if(n.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();var i,a=un(e);try{for(a.s();!(i=a.n()).done;){var o=n.bootstrapEvent(n.rootPointerEvent,i.value,r,t);n.context.eventService.mapEvent(o)}}catch(t){a.e(t)}finally{a.f()}n.setCursor(n.context.eventService.cursor)}}),i.hooks.pointerUp.tap(t.tag,function(t){if(!r.supportsTouchEvents||"touch"!==t.pointerType){var e,i=n.context.contextService.getDomElement(),a=n.context.eventService.isNativeEventFromCanvas(i,t)?"":"outside",o=un(n.normalizeToPointerEvent(t,r));try{for(o.s();!(e=o.n()).done;){var s=n.bootstrapEvent(n.rootPointerEvent,e.value,r,t);s.type+=a,n.context.eventService.mapEvent(s)}}catch(t){o.e(t)}finally{o.f()}n.setCursor(n.context.eventService.cursor)}}),i.hooks.pointerMove.tap(t.tag,this.onPointerMove),i.hooks.pointerOver.tap(t.tag,this.onPointerMove),i.hooks.pointerOut.tap(t.tag,this.onPointerMove),i.hooks.click.tap(t.tag,this.onClick),i.hooks.pointerCancel.tap(t.tag,function(t){var e,i=un(n.normalizeToPointerEvent(t,r));try{for(i.s();!(e=i.n()).done;){var a=n.bootstrapEvent(n.rootPointerEvent,e.value,r,t);n.context.eventService.mapEvent(a)}}catch(t){i.e(t)}finally{i.f()}n.setCursor(n.context.eventService.cursor)})}},{key:"bootstrapEvent",value:function(t,e,n,i){t.view=n,t.originalEvent=null,t.nativeEvent=i,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var r=this.context.eventService.client2Viewport({x:e.clientX,y:e.clientY}),a=r.y;t.viewport.x=r.x,t.viewport.y=a;var o=this.context.eventService.viewport2Canvas(t.viewport),s=o.y;return t.canvas.x=o.x,t.canvas.y=s,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=i.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=io[t.type]||t.type),t}},{key:"normalizeWheelEvent",value:function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.context.eventService.client2Viewport({x:t.clientX,y:t.clientY}),i=n.y;e.viewport.x=n.x,e.viewport.y=i;var r=this.context.eventService.viewport2Canvas(e.viewport),a=r.y;return e.canvas.x=r.x,e.canvas.y=a,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e}},{key:"transferMouseData",value:function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=ro.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null}},{key:"setCursor",value:function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")}},{key:"normalizeToPointerEvent",value:function(t,e){var n=[];if(e.isTouchEvent(t))for(var i=0;t.changedTouches.length>i;i++){var r=t.changedTouches[i];Wt(r.button)&&(r.button=0),Wt(r.buttons)&&(r.buttons=1),Wt(r.isPrimary)&&(r.isPrimary=1===t.touches.length&&"touchstart"===t.type),Wt(r.width)&&(r.width=r.radiusX||1),Wt(r.height)&&(r.height=r.radiusY||1),Wt(r.tiltX)&&(r.tiltX=0),Wt(r.tiltY)&&(r.tiltY=0),Wt(r.pointerType)&&(r.pointerType="touch"),Wt(r.pointerId)&&(r.pointerId=r.identifier||0),Wt(r.pressure)&&(r.pressure=r.force||.5),Wt(r.twist)&&(r.twist=0),Wt(r.tangentialPressure)&&(r.tangentialPressure=0),r.isNormalized=!0,r.type=t.type,n.push(r)}else if(e.isMouseEvent(t)){var a=t;Wt(a.isPrimary)&&(a.isPrimary=!0),Wt(a.width)&&(a.width=1),Wt(a.height)&&(a.height=1),Wt(a.tiltX)&&(a.tiltX=0),Wt(a.tiltY)&&(a.tiltY=0),Wt(a.pointerType)&&(a.pointerType="mouse"),Wt(a.pointerId)&&(a.pointerId=1),Wt(a.pressure)&&(a.pressure=.5),Wt(a.twist)&&(a.twist=0),Wt(a.tangentialPressure)&&(a.tangentialPressure=0),a.isNormalized=!0,n.push(a)}else n.push(t);return n}}])}();xu.tag="Event";var bu=[fn.CIRCLE,fn.ELLIPSE,fn.IMAGE,fn.RECT,fn.LINE,fn.POLYLINE,fn.POLYGON,fn.TEXT,fn.PATH,fn.HTML],Tu=function(){return u(function t(){o(this,t)},[{key:"isVisible",value:function(t,e){var n,i=e.cullable;if(!i.enable)return!0;var r=e.getRenderBounds();if(bn.isEmpty(r))return!1;var a=t.getFrustum(),o=null===(n=e.parentNode)||void 0===n||null===(n=n.cullable)||void 0===n?void 0:n.visibilityPlaneMask;return i.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,r,o||Mn.INDETERMINATE,a.planes),i.visible=i.visibilityPlaneMask!==Mn.OUTSIDE,i.visible}},{key:"computeVisibilityWithPlaneMask",value:function(t,e,n,i){if(n===Mn.OUTSIDE||n===Mn.INSIDE)return n;for(var r=Mn.INSIDE,a=bu.indexOf(t.nodeName)>-1,o=0,s=i.length;s>o;++o){var u=1<<o;if(0!==(n&u)&&(!a||4!==o&&5!==o)){var l=i[o],c=l.normal,h=l.distance;if(0>ft(c,e.getPositiveFarPoint(i[o]))+h)return Mn.OUTSIDE;0>ft(c,e.getNegativeFarPoint(i[o]))+h&&(r|=u)}}return r}}])}(),Mu=function(){function t(){o(this,t),this.syncTasks=new Map,this.isFirstTimeRendering=!0,this.syncing=!1,this.isFirstTimeRenderingFinished=!1}return u(t,[{key:"apply",value:function(e){var n,i,r=this,a=e.config,o=e.renderingService,s=e.renderingContext.root.ownerDocument.defaultView;this.rBush=e.rBushRoot;var u=function(t){o.dirtify()},l=function(t){r.syncTasks.set(t.target,t.detail.affectChildren),o.dirtify()},c=function(t){Fs.enableSizeAttenuation&&Fs.styleValueRegistry.updateSizeAttenuation(t.target,s.getCamera().getZoom())},h=function(t){var e=t.target,n=e.rBushNode;null!=n&&n.aabb&&r.rBush.remove(n.aabb),r.syncTasks.delete(e),Fs.sceneGraphService.dirtyToRoot(e),o.dirtify()};o.hooks.init.tap(t.tag,function(){s.addEventListener(os.MOUNTED,c),s.addEventListener(os.UNMOUNTED,h),s.addEventListener(os.ATTR_MODIFIED,u),s.addEventListener(os.BOUNDS_CHANGED,l)}),o.hooks.destroy.tap(t.tag,function(){s.removeEventListener(os.MOUNTED,c),s.removeEventListener(os.UNMOUNTED,h),s.removeEventListener(os.ATTR_MODIFIED,u),s.removeEventListener(os.BOUNDS_CHANGED,l),r.syncTasks.clear()});var f=null!==(n=Fs.globalThis.requestIdleCallback)&&void 0!==n?n:mo.bind(Fs.globalThis),d=!0===(null===(i=a.future)||void 0===i?void 0:i.experimentalRICSyncRTree);o.hooks.endFrame.tap(t.tag,function(){r.isFirstTimeRendering?(r.isFirstTimeRendering=!1,r.syncing=!0,f(function(){r.syncRTree(!0),r.isFirstTimeRenderingFinished=!0})):d&&Fs.globalThis.requestIdleCallback&&Fs.globalThis.cancelIdleCallback?(Fs.globalThis.cancelIdleCallback(r.ricSyncRTreeId),r.ricSyncRTreeId=Fs.globalThis.requestIdleCallback(function(){return r.syncRTree()})):r.syncRTree()})}},{key:"syncNode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.isConnected){var n=t.rBushNode;n.aabb&&this.rBush.remove(n.aabb);var i=t.getRenderBounds();if(i){var r=t.renderable;e&&(r.dirtyRenderBounds||(r.dirtyRenderBounds=new bn),r.dirtyRenderBounds.update(i.center,i.halfExtents));var a=g(i.getMin(),2),o=a[0],s=a[1],u=g(i.getMax(),2),l=u[0],c=u[1];n.aabb||(n.aabb={}),n.aabb.displayObject=t,n.aabb.minX=o,n.aabb.minY=s,n.aabb.maxX=l,n.aabb.maxY=c}return n.aabb&&!(isNaN(n.aabb.maxX)||isNaN(n.aabb.maxX)||isNaN(n.aabb.minX)||isNaN(n.aabb.minY))?n.aabb:void 0}}},{key:"syncRTree",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e||!this.syncing&&0!==this.syncTasks.size){this.syncing=!0;var n=[],i=new Set,r=function(r){if(!i.has(r)&&r.renderable){var a=t.syncNode(r,e);a&&(n.push(a),i.add(r))}};this.syncTasks.forEach(function(t,e){t&&e.forEach(r);for(var n=e;n;)r(n),n=n.parentElement}),this.rBush.load(n),n.length=0,this.syncing=!1}}}])}();Mu.tag="Prepare";var wu=function(t){return t.READY="ready",t.BEFORE_RENDER="beforerender",t.RERENDER="rerender",t.AFTER_RENDER="afterrender",t.BEFORE_DESTROY="beforedestroy",t.AFTER_DESTROY="afterdestroy",t.RESIZE="resize",t.DIRTY_RECTANGLE="dirtyrectangle",t.RENDERER_CHANGED="rendererchanged",t}({}),Nu=new Qo(os.MOUNTED),Pu=new Qo(os.UNMOUNTED),Su=new Qo(wu.BEFORE_RENDER),Cu=new Qo(wu.RERENDER),Au=new Qo(wu.AFTER_RENDER),Ru=function(t){function e(t){var n;o(this,e),(n=p(this,e)).Element=Ks,n.inited=!1,n.context={};var i=t.container,r=t.canvas,s=t.renderer,u=t.width,l=t.height,c=t.background,h=t.cursor,f=t.supportsMutipleCanvasesInOneContainer,d=t.cleanUpOnDestroy,v=void 0===d||d,m=t.offscreenCanvas,y=t.requestAnimationFrame,g=t.cancelAnimationFrame,k=t.createImage,E=t.supportsTouchEvents,x=t.supportsPointerEvents,b=t.isTouchEvent,T=t.isMouseEvent,M=t.dblClickSpeed,w=u,N=l,P=t.devicePixelRatio||$a&&window.devicePixelRatio||1;return P=1>P?1:Math.ceil(P),r&&(w=u||function(t){var e=no(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(r)||r.width/P,N=l||function(t){var e=no(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(r)||r.height/P),n.customElements=new yu,n.devicePixelRatio=P,n.requestAnimationFrame=null!=y?y:mo.bind(Fs.globalThis),n.cancelAnimationFrame=null!=g?g:yo.bind(Fs.globalThis),n.createImage=null!=k?k:function(){return new window.Image},n.supportsTouchEvents=null!=E?E:"ontouchstart"in Fs.globalThis,n.supportsPointerEvents=null!=x?x:!!Fs.globalThis.PointerEvent,n.isTouchEvent=null!=b?b:function(t){return n.supportsTouchEvents&&t instanceof Fs.globalThis.TouchEvent},n.isMouseEvent=null!=T?T:function(t){return!Fs.globalThis.MouseEvent||t instanceof Fs.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof Fs.globalThis.PointerEvent))},m&&(Fs.offscreenCanvas=m),n.document=new ku,n.document.defaultView=n,f||function(t,e,n){if(t){var i="string"==typeof t?document.getElementById(t):t;Qa.has(i)&&Qa.get(i).destroy(n),Qa.set(i,e)}}(i,n,v),n.initRenderingContext(a(a({},t),{},{width:w,height:N,background:null!=c?c:"transparent",cursor:null!=h?h:"default",cleanUpOnDestroy:v,devicePixelRatio:P,requestAnimationFrame:n.requestAnimationFrame,cancelAnimationFrame:n.cancelAnimationFrame,createImage:n.createImage,supportsTouchEvents:n.supportsTouchEvents,supportsPointerEvents:n.supportsPointerEvents,isTouchEvent:n.isTouchEvent,isMouseEvent:n.isMouseEvent,dblClickSpeed:null!=M?M:200})),n.initDefaultCamera(w,N,s.clipSpaceNearZ),n.initRenderer(s,!0),n}return y(e,t),u(e,[{key:"initRenderingContext",value:function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,unculledEntities:[],renderListCurrentFrame:[],renderReasons:new Set,force:!1,dirty:!1}}},{key:"initDefaultCamera",value:function(t,e,n){var i=this,r=new Fs.CameraContribution;r.clipSpaceNearZ=n,r.setType(qn.EXPLORING,Zn.DEFAULT).setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0).setOrthographic(t/-2,t/2,e/2,e/-2,.1,1e3),r.canvas=this,r.eventEmitter.on(Qn.UPDATED,function(){i.context.renderingContext.renderReasons.add(ns.CAMERA_CHANGED),Fs.enableSizeAttenuation&&i.getConfig().renderer.getConfig().enableSizeAttenuation&&i.updateSizeAttenuation()}),this.context.camera=r}},{key:"updateSizeAttenuation",value:function(){var t=this.getCamera().getZoom();this.document.documentElement.forEach(function(e){Fs.styleValueRegistry.updateSizeAttenuation(e,t)})}},{key:"getConfig",value:function(){return this.context.config}},{key:"getRoot",value:function(){return this.document.documentElement}},{key:"getCamera",value:function(){return this.context.camera}},{key:"getContextService",value:function(){return this.context.contextService}},{key:"getEventService",value:function(){return this.context.eventService}},{key:"getRenderingService",value:function(){return this.context.renderingService}},{key:"getRenderingContext",value:function(){return this.context.renderingContext}},{key:"getStats",value:function(){return this.getRenderingService().getStats()}},{key:"ready",get:function(){var t=this;return this.readyPromise||(this.readyPromise=new Promise(function(e){t.resolveReadyPromise=function(){e(t)}}),this.inited&&this.resolveReadyPromise()),this.readyPromise}},{key:"destroy",value:function(){var t,e=0>=arguments.length||void 0===arguments[0]||arguments[0],n=arguments.length>1?arguments[1]:void 0;Yi.clearCache();var i=!0===(null===(t=this.getConfig().future)||void 0===t?void 0:t.experimentalCancelEventPropagation);n||this.dispatchEvent(new Qo(wu.BEFORE_DESTROY),i,i),this.frameId&&this.cancelAnimationFrame(this.frameId);var r=this.getRoot();e&&(this.unmountChildren(r),this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),this.context.rBushRoot&&this.context.rBushRoot.clear(),n||this.dispatchEvent(new Qo(wu.AFTER_DESTROY),i,i);var a=function(t){t.currentTarget=null,t.manager=null,t.target=null,t.relatedNode=null};a(Nu),a(Pu),a(Su),a(Cu),a(Au),a(Ws),a(Us),a(Ys),a(zs),Fs.textService.clearCache()}},{key:"changeSize",value:function(t,e){this.resize(t,e)}},{key:"resize",value:function(t,e){var n,i=this.context.config;i.width=t,i.height=e,this.getContextService().resize(t,e);var r=this.context.camera,a=r.getProjectionMode();r.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),a===Kn.ORTHOGRAPHIC?r.setOrthographic(t/-2,t/2,e/2,e/-2,r.getNear(),r.getFar()):r.setAspect(t/e);var o=!0===(null===(n=i.future)||void 0===n?void 0:n.experimentalCancelEventPropagation);this.dispatchEvent(new Qo(wu.RESIZE,{width:t,height:e}),o,o)}},{key:"appendChild",value:function(t,e){return this.document.documentElement.appendChild(t,e)}},{key:"insertBefore",value:function(t,e){return this.document.documentElement.insertBefore(t,e)}},{key:"removeChild",value:function(t){return this.document.documentElement.removeChild(t)}},{key:"removeChildren",value:function(){this.document.documentElement.removeChildren()}},{key:"destroyChildren",value:function(){this.document.documentElement.destroyChildren()}},{key:"render",value:function(t){var e,n=this;t&&(Su.detail=t,Au.detail=t);var i=!0===(null===(e=this.getConfig().future)||void 0===e?void 0:e.experimentalCancelEventPropagation);this.dispatchEvent(Su,i,i),this.getRenderingService().render(this.getConfig(),t,function(){n.dispatchEvent(Cu,i,i)}),this.dispatchEvent(Au,i,i)}},{key:"run",value:function(){var t=this,e=function(n,i){t.render(i),t.frameId=t.requestAnimationFrame(e)};e()}},{key:"initRenderer",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)throw Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new hn,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new xu,new Mu,new Eu([new Tu])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(a(a({},Fs),this.context)),this.context.renderingService=new is(Fs,this.context),this.context.eventService=new ts(Fs,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(t,n,!0)):this.context.contextService.initAsync().then(function(){e.initRenderingService(t,n)}).catch(function(t){console.error(t)})}},{key:"initRenderingService",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.context.renderingService.init(function(){var r;e.inited=!0;var a=!0===(null===(r=e.getConfig().future)||void 0===r?void 0:r.experimentalCancelEventPropagation);n?i?e.requestAnimationFrame(function(){e.dispatchEvent(new Qo(wu.READY),a,a)}):e.dispatchEvent(new Qo(wu.READY),a,a):e.dispatchEvent(new Qo(wu.RENDERER_CHANGED),a,a),e.readyPromise&&e.resolveReadyPromise(),n||e.getRoot().forEach(function(t){var e,n;null===(e=(n=t).dirty)||void 0===e||e.call(n,!0,!0)}),e.mountChildren(e.getRoot()),t.getConfig().enableAutoRendering&&e.run()})}},{key:"loadRendererContainerModule",value:function(t){var e=this;t.getPlugins().forEach(function(t){t.context=e.context,t.init(Fs)})}},{key:"setRenderer",value:function(t){var e=this.getConfig();if(e.renderer!==t){var n=e.renderer;e.renderer=t,this.destroy(!1,!0),h((null==n?void 0:n.getPlugins())||[]).reverse().forEach(function(t){t.destroy(Fs)}),this.initRenderer(t)}}},{key:"setCursor",value:function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)}},{key:"unmountChildren",value:function(t){var e=this;if(t.childNodes.forEach(function(t){e.unmountChildren(t)}),this.inited){if(t.isMutationObserved)t.dispatchEvent(Pu);else{var n,i=!0===(null===(n=this.getConfig().future)||void 0===n?void 0:n.experimentalCancelEventPropagation);Pu.target=t,this.dispatchEvent(Pu,!0,i)}t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1}t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()}},{key:"mountChildren",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ao(t);if(this.inited){if(!t.isConnected&&(t.ownerDocument=this.document,t.isConnected=!0,!n))if(t.isMutationObserved)t.dispatchEvent(Nu);else{var i,r=!0===(null===(i=this.getConfig().future)||void 0===i?void 0:i.experimentalCancelEventPropagation);Nu.target=t,this.dispatchEvent(Nu,!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: ",t.nodeName);t.childNodes.forEach(function(t){e.mountChildren(t,n)}),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()}},{key:"mountFragment",value:function(t){this.mountChildren(t,!1)}},{key:"client2Viewport",value:function(t){return this.getEventService().client2Viewport(t)}},{key:"viewport2Client",value:function(t){return this.getEventService().viewport2Client(t)}},{key:"viewport2Canvas",value:function(t){return this.getEventService().viewport2Canvas(t)}},{key:"canvas2Viewport",value:function(t){return this.getEventService().canvas2Viewport(t)}},{key:"getPointByClient",value:function(t,e){return this.client2Viewport({x:t,y:e})}},{key:"getClientByPoint",value:function(t,e){return this.viewport2Client({x:t,y:e})}}])}($o),Ou=function(t){function e(){var t;o(this,e);for(var n=arguments.length,i=Array(n),r=0;n>r;r++)i[r]=arguments[r];return(t=p(this,e,[].concat(i))).landmarks=[],t}return y(e,t),u(e,[{key:"rotate",value:function(t,e,n){if(this.relElevation=An(e),this.relAzimuth=An(t),this.relRoll=An(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===qn.EXPLORING){var i=Mt(Tt(),[1,0,0],In((this.rotateWorld?1:-1)*this.relElevation)),r=Mt(Tt(),[0,1,0],In((this.rotateWorld?1:-1)*this.relAzimuth)),a=Mt(Tt(),[0,0,1],In(this.relRoll)),o=wt(Tt(),r,i);o=wt(Tt(),o,a);var s=W(M(),o);L(this.matrix,this.matrix,[0,0,-this.distance]),O(this.matrix,this.matrix,s),L(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===qn.ORBITING||this.type===qn.EXPLORING?this._getPosition():this.type===qn.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(t,e){var n=On(t,e,0),i=it(this.position);return ut(i,i,ct(nt(),this.right,n[0])),ut(i,i,ct(nt(),this.up,n[1])),this._setPosition(i),this.triggerUpdate(),this}},{key:"dolly",value:function(t){var e,n=this.forward,i=it(this.position);return i[0]+=(e=Math.max(Math.min(this.distance+t*this.dollyingStep,this.maxDistance),this.minDistance)-this.distance)*n[0],i[1]+=e*n[1],i[2]+=e*n[2],this._setPosition(i),this.type===qn.ORBITING||this.type===qn.EXPLORING?this._getDistance():this.type===qn.TRACKING&&ut(this.focalPoint,i,this.distanceVector),this.triggerUpdate(),this}},{key:"cancelLandmarkAnimation",value:function(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)}},{key:"createLandmark",value:function(t){var e,n,i,r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=a.position,s=void 0===o?this.position:o,u=a.focalPoint,l=void 0===u?this.focalPoint:u,c=a.roll,h=a.zoom,f=new Fs.CameraContribution;f.setType(this.type,void 0),f.setPosition(s[0],null!==(e=s[1])&&void 0!==e?e:this.position[1],null!==(n=s[2])&&void 0!==n?n:this.position[2]),f.setFocalPoint(l[0],null!==(i=l[1])&&void 0!==i?i:this.focalPoint[1],null!==(r=l[2])&&void 0!==r?r:this.focalPoint[2]),f.setRoll(null!=c?c:this.roll),f.setZoom(null!=h?h:this.zoom);var d={name:t,matrix:w(f.getWorldTransform()),right:it(f.right),up:it(f.up),forward:it(f.forward),position:it(f.getPosition()),focalPoint:it(f.getFocalPoint()),distanceVector:it(f.getDistanceVector()),distance:f.getDistance(),dollyingStep:f.getDollyingStep(),azimuth:f.getAzimuth(),elevation:f.getElevation(),roll:f.getRoll(),relAzimuth:f.relAzimuth,relElevation:f.relElevation,relRoll:f.relRoll,zoom:f.getZoom()};return this.landmarks.push(d),d}},{key:"gotoLandmark",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=Ut(t)?this.landmarks.find(function(e){return e.name===t}):t;if(i){var r=zt(n)?{duration:n}:n,a=r.easing,o=void 0===a?"linear":a,s=r.duration,u=void 0===s?100:s,l=r.easingFunction,c=void 0===l?void 0:l,h=r.onfinish,f=void 0===h?void 0:h,d=r.onframe,v=void 0===d?void 0:d;this.cancelLandmarkAnimation();var p,m=i.position,y=i.focalPoint,g=i.zoom,k=i.roll,E=c||Fs.EasingFunction(o),x=function(){e.setFocalPoint(y),e.setPosition(m),e.setRoll(k),e.setZoom(g),e.computeMatrix(),e.triggerUpdate(),null==f||f()};if(0===u)return x();var b=function(t){void 0===p&&(p=t);var n=t-p;if(u>n){var i,r,a=E(n/u),o=nt(),s=nt();if(vt(o,e.focalPoint,y,a),vt(s,e.position,m,a),r=e.roll*(1-a)+k*a,i=e.zoom*(1-a)+g*a,e.setFocalPoint(o),e.setPosition(s),e.setRoll(r),e.setZoom(i),.01>=gt(o,y)+gt(s,m)&&void 0===g&&void 0===k)return x();e.computeMatrix(),e.triggerUpdate(),u>n&&(null==v||v(a),e.landmarkAnimationID=e.canvas.requestAnimationFrame(b))}else x()};this.canvas.requestAnimationFrame(b)}}}])}(Jn);Fs.CameraContribution=Ou;
/*!
* @antv/g-dom-mutation-observer-api
* @description A simple implementation of DOM MutationObserver API.
* @version 2.0.38
* @date 7/30/2025, 1:34:51 PM
* @author AntVis
* @docs https://g.antv.antgroup.com/
*/
var Lu,Iu,_u=function(){function t(e,n){o(this,t),this.addedNodes=[],this.attributeName=null,this.attributeNamespace=null,this.nextSibling=null,this.oldValue=null,this.previousSibling=null,this.removedNodes=[],this.type=e,this.target=n}return u(t,null,[{key:"copy",value:function(e){var n=new t(e.type,e.target);return n.addedNodes=e.addedNodes.slice(),n.removedNodes=e.removedNodes.slice(),n.previousSibling=e.previousSibling,n.nextSibling=e.nextSibling,n.attributeName=e.attributeName,n.attributeNamespace=e.attributeNamespace,n.oldValue=e.oldValue,n}}])}(),Du=0,Fu=new WeakMap,Gu=function(){return u(function t(e,n,i){o(this,t),this.transientObservedNodes=[],this.observer=e,this.target=n,this.options=i},[{key:"enqueue",value:function(t){var e=this.observer.records,n=e.length;if(e.length>0){var i=function(t,e){return t===e?t:Iu&&function(t){return t===Iu||t===Lu}(t)?Iu:null}(e[n-1],t);if(i)return void(e[n-1]=i)}else zu.push(this.observer),Yu||(Yu=!0,void 0!==Fs.globalThis?Fs.globalThis.setTimeout(ju):ju());e[n]=t}},{key:"addListeners",value:function(){this.addListeners_(this.target)}},{key:"addListeners_",value:function(t){var e=this.options;e.attributes&&t.addEventListener(os.ATTR_MODIFIED,this,!0),e.childList&&t.addEventListener(os.INSERTED,this,!0),(e.childList||e.subtree)&&t.addEventListener(os.REMOVED,this,!0)}},{key:"removeListeners",value:function(){this.removeListeners_(this.target)}},{key:"removeListeners_",value:function(t){var e=this.options;e.attributes&&t.removeEventListener(os.ATTR_MODIFIED,this,!0),e.childList&&t.removeEventListener(os.INSERTED,this,!0),(e.childList||e.subtree)&&t.removeEventListener(os.REMOVED,this,!0)}},{key:"removeTransientObservers",value:function(){var t=this.transientObservedNodes;this.transientObservedNodes=[],t.forEach(function(t){this.removeListeners_(t);for(var e=Fu.get(t),n=0;e.length>n;n++)if(e[n]===this){e.splice(n,1);break}},this)}},{key:"handleEvent",value:function(t){var e,n;switch(t.stopImmediatePropagation(),t.type){case os.ATTR_MODIFIED:var i=t.attrName,r=t.relatedNode.namespaceURI;(e=Vu("attributes",n=t.target)).attributeName=i,e.attributeNamespace=r;var a=t.attrChange===ss.ADDITION?null:t.prevValue;Uu(n,function(t){if(t.attributes&&(!t.attributeFilter||!t.attributeFilter.length||-1!==t.attributeFilter.indexOf(i)||-1!==t.attributeFilter.indexOf(r)))return t.attributeOldValue?function(t){return Iu||((Iu=_u.copy(Lu)).oldValue=t,Iu)}(a):e});break;case os.REMOVED:case os.INSERTED:var o,s,u=t.target;t.type===os.INSERTED?(o=[u],s=[]):(o=[],s=[u]);var l=u.previousSibling,c=u.nextSibling;(e=Vu("childList",n=t.relatedNode)).addedNodes=o,e.removedNodes=s,e.previousSibling=l,e.nextSibling=c,Uu(n,function(t){if(t.childList)return e})}Lu=Iu=void 0}}])}(),Bu=function(){return u(function t(e){o(this,t),this.nodes=[],this.records=[],this.uid=Du++,this.callback=e},[{key:"observe",value:function(t,e){if(!e.childList&&!e.attributes&&!e.characterData||e.attributeOldValue&&!e.attributes||e.attributeFilter&&e.attributeFilter.length&&!e.attributes||e.characterDataOldValue&&!e.characterData)throw new SyntaxError;var n,i=Fu.get(t);i||Fu.set(t,i=[]);for(var r=0;i.length>r;r++)if(i[r].observer===this){(n=i[r]).removeListeners(),n.options=e;break}n||(n=new Gu(this,t,e),i.push(n),this.nodes.push(t)),n.addListeners()}},{key:"disconnect",value:function(){var t=this;this.nodes.forEach(function(e){for(var n=Fu.get(e),i=0;n.length>i;i++){var r=n[i];if(r.observer===t){r.removeListeners(),n.splice(i,1);break}}},this),this.records=[]}},{key:"takeRecords",value:function(){var t=this.records;return this.records=[],t}}])}();function Vu(t,e){return Lu=new _u(t,e)}function Uu(t,e){for(var n=t;n;n=n.parentNode){var i=Fu.get(n);if(i)for(var r=0;i.length>r;r++){var a=i[r],o=a.options;if(n===t||o.subtree){var s=e(o);s&&a.enqueue(s)}}}}var Yu=!1,zu=[];function ju(){Yu=!1;var t=zu;zu=[],t.sort(function(t,e){return t.uid-e.uid});var e=!1;t.forEach(function(t){var n=t.takeRecords();!function(t){t.nodes.forEach(function(e){var n=Fu.get(e);n&&n.forEach(function(e){e.observer===t&&e.removeTransientObservers()})})}(t),n.length&&(t.callback(n,t),e=!0)}),e&&ju()}
/*!
* @antv/g-web-animations-api
* @description A simple implementation of Web Animations API.
* @version 2.1.28
* @date 7/30/2025, 1:36:24 PM
* @author AntVis
* @docs https://g.antv.antgroup.com/
*/var Xu=function(t){function e(t,n,i,r){var a;return o(this,e),(a=p(this,e,[t])).currentTime=i,a.timelineTime=r,a.target=n,a.type="finish",a.bubbles=!1,a.currentTarget=n,a.defaultPrevented=!1,a.eventPhase=a.AT_TARGET,a.timeStamp=Date.now(),a.currentTime=i,a.timelineTime=r,a}return y(e,t),u(e)}(Wo),Hu=0,Wu=function(){return u(function t(e,n){var i;o(this,t),this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=e,e.animation=this,this.timeline=n,this.id="".concat(Hu++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null===(i=this.effect)||void 0===i?void 0:i.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()},[{key:"pending",get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending}},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"ready",get:function(){var t=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise(function(e,n){t.resolveReadyPromise=function(){e(t)},t.rejectReadyPromise=function(){n(Error())}}),this.pending||this.resolveReadyPromise()),this.readyPromise}},{key:"finished",get:function(){var t=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise(function(e,n){t.resolveFinishedPromise=function(){e(t)},t.rejectFinishedPromise=function(){n(Error())}}),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){if(!isNaN(t=Number(t))){var e;if(this.timeline.restart(),!this._paused&&null!==this._startTime)this._startTime=Number(null===(e=this.timeline)||void 0===e?void 0:e.currentTime)-t/this.playbackRate;this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this))}}},{key:"startTime",get:function(){return this._startTime},set:function(t){if(null!==t){if(this.updatePromises(),isNaN(t=Number(t)))return;if(this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}}},{key:"playbackRate",get:function(){return this._playbackRate},set:function(t){if(t!==this._playbackRate){this.updatePromises();var e=this.currentTime;this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==e&&(this.currentTime=e),this.updatePromises()}}},{key:"_isFinished",get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||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 t;if(null!==(t=this.effect.target)&&void 0!==t&&t.destroyed)return this.readyPromise=void 0,this.finishedPromise=void 0,!1;var e=this.oldPlayState,n=this.pending?"pending":this.playState;return this.readyPromise&&n!==e&&("idle"===n?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===e?this.resolveReadyPromise():"pending"===n&&(this.readyPromise=void 0)),this.finishedPromise&&n!==e&&("idle"===n?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===n?this.resolveFinishedPromise():"finished"===e&&(this.finishedPromise=void 0)),this.oldPlayState=n,this.readyPromise||this.finishedPromise}},{key:"play",value:function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()}},{key:"pause",value:function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()}},{key:"finish",value:function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())}},{key:"cancel",value:function(){var t=this;if(this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises(),this.oncancel)){var e=new Xu(null,this,this.currentTime,null);setTimeout(function(){t.oncancel(e)})}}},{key:"reverse",value:function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()}},{key:"updatePlaybackRate",value:function(t){this.playbackRate=t}},{key:"targetAnimations",value:function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()}},{key:"markTarget",value:function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)}},{key:"unmarkTarget",value:function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)}},{key:"tick",value:function(t,e){this._idle||this._paused||(null===this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))}},{key:"rewind",value:function(){if(this.playbackRate<0){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(Sn)}},{key:"addEventListener",value:function(t,e,n){throw Error(Sn)}},{key:"removeEventListener",value:function(t,e,n){throw Error(Sn)}},{key:"dispatchEvent",value:function(t){throw Error(Sn)}},{key:"commitStyles",value:function(){throw Error(Sn)}},{key:"ensureAlive",value:function(){var t,e;0>this.playbackRate&&0===this.currentTime?this._inEffect=!(null===(t=this.effect)||void 0===t||!t.update(-1)):this._inEffect=!(null===(e=this.effect)||void 0===e||!e.update(this.currentTime));this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))}},{key:"tickCurrentTime",value:function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())}},{key:"fireEvents",value:function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new Xu(null,this,this.currentTime,t);setTimeout(function(){e.onfinish&&e.onfinish(n)})}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var i=new Xu(null,this,this.currentTime,t);this.onframe(i)}this._finishedFlag=!1}}}])}(),qu=.1,Zu="function"==typeof Float32Array,Ku=function(t,e){return 1-3*e+3*t},Qu=function(t,e){return 3*e-6*t},$u=function(t){return 3*t},Ju=function(t,e,n){return((Ku(e,n)*t+Qu(e,n))*t+$u(e))*t},tl=function(t,e,n){return 3*Ku(e,n)*t*t+2*Qu(e,n)*t+$u(e)},el=function(t,e,n,i){if(0>t||t>1||0>n||n>1)throw Error("bezier x values must be in [0, 1] range");if(t===e&&n===i)return function(t){return t};for(var r=Zu?new Float32Array(11):[,,,,,,,,,,,],a=0;11>a;++a)r[a]=Ju(a*qu,t,n);var o=function(e){for(var i=0,a=1;10!==a&&e>=r[a];++a)i+=qu;--a;var o=i+(e-r[a])/(r[a+1]-r[a])*qu,s=tl(o,t,n);return.001>s?0===s?o:function(t,e,n,i,r){var a,o,s=0;do{(a=Ju(o=e+(n-e)/2,i,r)-t)>0?n=o:e=o}while(Math.abs(a)>1e-7&&10>++s);return o}(e,i,i+qu,t,n):function(t,e,n,i){for(var r=0;4>r;++r){var a=tl(e,n,i);if(0===a)return e;e-=(Ju(e,n,i)-t)/a}return e}(e,o,t,n)};return function(t){return 0===t||1===t?t:Ju(o(t),e,i)}},nl=function(t){return Math.pow(t,2)},il=function(t){return Math.pow(t,3)},rl=function(t){return Math.pow(t,4)},al=function(t){return Math.pow(t,5)},ol=function(t){return Math.pow(t,6)},sl=function(t){return 1-Math.cos(t*Math.PI/2)},ul=function(t){return 1-Math.sqrt(1-t*t)},ll=function(t){return t*t*(3*t-2)},cl=function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)},hl=function(t){var e=g(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],2),n=e[0],i=e[1],r=void 0===i?.5:i,a=Yt(Number(void 0===n?1:n),1,10),o=Yt(Number(r),.1,2);return 0===t||1===t?t:-a*Math.pow(2,10*(t-1))*Math.sin(2*Math.PI*(t-1-o/(2*Math.PI)*Math.asin(1/a))/o)},fl=function(t){var e=arguments.length>2?arguments[2]:void 0,n=g(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],4),i=n[0],r=void 0===i?1:i,a=n[1],o=void 0===a?100:a,s=n[2],u=void 0===s?10:s,l=n[3],c=void 0===l?0:l;r=Yt(r,.1,1e3),o=Yt(o,.1,1e3),u=Yt(u,.1,1e3),c=Yt(c,.1,1e3);var h=Math.sqrt(o/r),f=u/(2*Math.sqrt(o*r)),d=1>f?h*Math.sqrt(1-f*f):0,v=1>f?(f*h-c)/d:-c+h,p=e?e*t/1e3:t;return p=1>f?Math.exp(-p*f*h)*(1*Math.cos(d*p)+v*Math.sin(d*p)):(1+v*p)*Math.exp(-p*h),0===t||1===t?t:1-p},dl=function(t){var e=g(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],2),n=e[0],i=void 0===n?10:n;return("start"===e[1]?Math.ceil:Math.floor)(Yt(t,0,1)*i)/i},vl=function(t){var e=g(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],4);return el(e[0],e[1],e[2],e[3])(t)},pl=el(.42,0,1,1),ml=function(t){return function(e){return 1-t(1-e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],arguments.length>2?arguments[2]:void 0)}},yl=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;return.5>e?t(2*e,n,i)/2:1-t(-2*e+2,n,i)/2}},gl=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;return.5>e?(1-t(1-2*e,n,i))/2:(t(2*e-1,n,i)+1)/2}},kl={steps:dl,"step-start":function(t){return dl(t,[1,"start"])},"step-end":function(t){return dl(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":vl,ease:function(t){return vl(t,[.25,.1,.25,1])},in:pl,out:ml(pl),"in-out":yl(pl),"out-in":gl(pl),"in-quad":nl,"out-quad":ml(nl),"in-out-quad":yl(nl),"out-in-quad":gl(nl),"in-cubic":il,"out-cubic":ml(il),"in-out-cubic":yl(il),"out-in-cubic":gl(il),"in-quart":rl,"out-quart":ml(rl),"in-out-quart":yl(rl),"out-in-quart":gl(rl),"in-quint":al,"out-quint":ml(al),"in-out-quint":yl(al),"out-in-quint":gl(al),"in-expo":ol,"out-expo":ml(ol),"in-out-expo":yl(ol),"out-in-expo":gl(ol),"in-sine":sl,"out-sine":ml(sl),"in-out-sine":yl(sl),"out-in-sine":gl(sl),"in-circ":ul,"out-circ":ml(ul),"in-out-circ":yl(ul),"out-in-circ":gl(ul),"in-back":ll,"out-back":ml(ll),"in-out-back":yl(ll),"out-in-back":gl(ll),"in-bounce":cl,"out-bounce":ml(cl),"in-out-bounce":yl(cl),"out-in-bounce":gl(cl),"in-elastic":hl,"out-elastic":ml(hl),"in-out-elastic":yl(hl),"out-in-elastic":gl(hl),spring:fl,"spring-in":fl,"spring-out":ml(fl),"spring-in-out":yl(fl),"spring-out-in":gl(fl)},El=function(t){return t};function xl(t,e){return function(n){if(n>=1)return 1;var i=1/t;return(n+=e*i)-n%i}}var bl="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",Tl=RegExp("cubic-bezier\\(".concat(bl,",").concat(bl,",").concat(bl,",").concat(bl,"\\)")),Ml=/steps\(\s*(\d+)\s*\)/,wl=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Nl(t){var e=Tl.exec(t);if(e)return el.apply(void 0,h(e.slice(1).map(Number)));var n=Ml.exec(t);if(n)return xl(Number(n[1]),0);var i=wl.exec(t);return i?xl(Number(i[1]),{start:1,middle:.5,end:0}[i[2]]):kl[function(t){return function(t){return"-"===(t=t.replace(/([A-Z])/g,function(t){return"-".concat(t.toLowerCase())})).charAt(0)?t.substring(1):t}(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()}(t)]||kl.linear}function Pl(t){return Math.abs(function(t){var e;if(0===t.duration||0===t.iterations)return 0;return("auto"===t.duration?0:Number(t.duration))*(null!==(e=t.iterations)&&void 0!==e?e:1)}(t)/(t.playbackRate||1))}function Sl(t,e,n){var i=function(t,e,n){if(null===e)return 0;var i=n.endTime;return Math.min(n.delay,i)>e?1:Math.min(n.delay+t+n.endDelay,i)>e?3:2}(t,e,n),r=function(t,e,n,i,r){switch(i){case 1:return"backwards"===e||"both"===e?0:null;case 3:return n-r;case 2:return"forwards"===e||"both"===e?t:null;case 0:return null}}(t,n.fill,e,i,n.delay);if(null===r)return null;var a="auto"===n.duration?0:n.duration,o=function(t,e,n,i,r){var a=r;return 0===t?1!==e&&(a+=n):a+=i/t,a}(a,i,n.iterations,r,n.iterationStart),s=function(t,e,n,i,r,a){var o=t===1/0?e%1:t%1;return 0!==o||2!==n||0===i||0===r&&0!==a||(o=1),o}(o,n.iterationStart,i,n.iterations,r,a),u=function(t,e,n,i){return 2===t&&e===1/0?1/0:1===n?Math.floor(i)-1:Math.floor(i)}(i,n.iterations,s,o),l=function(t,e,n){var i=t;if("normal"!==t&&"reverse"!==t){var r=e;"alternate-reverse"===t&&(r+=1),i="normal",r!==1/0&&r%2!=0&&(i="reverse")}return"normal"===i?n:1-n}(n.direction,u,s);return n.currentIteration=u,n.progress=l,n.easingFunction(l)}function Cl(t,e,n){var i=function(t,e){for(var n={},i=0;t.length>i;i++)for(var r in t[i])if(Al(r)){var a={offset:t[i].offset,computedOffset:t[i].computedOffset,easing:t[i].easing,easingFunction:Nl(t[i].easing)||e.easingFunction,value:t[i][r]};n[r]=n[r]||[],n[r].push(a)}return n}(t,e),r=function(t,e){var n=[];for(var i in t)for(var r=t[i],a=0;r.length-1>a;a++){var o=a,s=a+1,u=r[o].computedOffset,l=r[s].computedOffset,c=u,h=l;0===a&&(c=-1/0,0===l&&(s=o)),a===r.length-2&&(h=1/0,1===u&&(o=s)),n.push({applyFrom:c,applyTo:h,startOffset:r[o].computedOffset,endOffset:r[s].computedOffset,easingFunction:r[o].easingFunction,property:i,interpolation:Ol(i,r[o].value,r[s].value,e)})}return n.sort(function(t,e){return t.startOffset-e.startOffset}),n}(i,n);return function(t,e){if(null!==e)r.filter(function(t){return e>=t.applyFrom&&t.applyTo>e}).forEach(function(n){var i=n.endOffset-n.startOffset;t.setAttribute(n.property,n.interpolation(0===i?0:(e-n.startOffset)/i),!1,!1)});else for(var n in i)Al(n)&&t.setAttribute(n,null)}}function Al(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var Rl=function(t,e,n){return function(i){var r=Ll(t,e,i);return zt(r)?r:n(r)}};function Ol(t,e,n,i){var r=Ra[t];if(r&&r.syntax&&r.int){var a=Fs.styleValueRegistry.getPropertySyntax(r.syntax);if(a){var o=a.parser,s=o?o(e,i):e,u=o?o(n,i):n,l=a.mixer(s,u,i);if(l){var c=Rl.apply(void 0,h(l));return function(t){return 0===t?e:1===t?n:c(t)}}}}return Rl(!1,!0,function(t){return t?n:e})}function Ll(t,e,n){if("number"==typeof t&&"number"==typeof e)return t*(1-n)+e*n;if("boolean"==typeof t&&"boolean"==typeof e||"string"==typeof t&&"string"==typeof e)return.5>n?t:e;if(Array.isArray(t)&&Array.isArray(e)){for(var i=t.length,r=e.length,a=Math.max(i,r),o=[],s=0;a>s;s++)o.push(Ll(t[i>s?s:i-1],e[r>s?s:r-1],n));return o}throw Error("Mismatched interpolation arguments ".concat(t,":").concat(e))}var Il=function(){return u(function t(){o(this,t),this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=El,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null},[{key:"easing",get:function(){return this._easing},set:function(t){this.easingFunction=Nl(t),this._easing=t}}])}();function _l(t,e){if(null===t)return[];Array.isArray(t)||(t=function(t){var e=[];for(var n in t)if(!(n in["easing","offset","composite"])){var i=t[n];Array.isArray(i)||(i=[i]);for(var r=i.length,a=0;r>a;a++){if(!e[a]){var o={};"offset"in t&&(o.offset=Number(t.offset)),"easing"in t&&(o.easing=t.easing),"composite"in t&&(o.composite=t.composite),e[a]=o}null!=i[a]&&(e[a][n]=i[a])}}return e.sort(function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)}),e}(t));for(var n=t.map(function(t){var n={};for(var i in null!=e&&e.composite&&(n.composite="auto"),t){var r=t[i];if("offset"===i){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.");n.computedOffset=r}}else if("composite"===i&&-1===["replace","add","accumulate","auto"].indexOf(r))throw Error("".concat(r," compositing is not supported"));n[i]=r}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==e?void 0:e.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n}),i=!0,r=-1/0,a=0;n.length>a;a++){var o=n[a].offset;if(_t(o))i=!1;else{if(r>o)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");r=o}}return n=n.filter(function(t){return Number(t.offset)>=0&&1>=Number(t.offset)}),i||function(){var t,e,i=n.length;n[i-1].computedOffset=Number(null!==(t=n[i-1].offset)&&void 0!==t?t:1),i>1&&(n[0].computedOffset=Number(null!==(e=n[0].offset)&&void 0!==e?e:0));for(var r=0,a=Number(n[0].computedOffset),o=1;i>o;o++){var s=n[o].computedOffset;if(!_t(s)&&!_t(a)){for(var u=1;o-r>u;u++)n[r+u].computedOffset=a+(Number(s)-a)*u/(o-r);r=o,a=Number(s)}}}(),n}var Dl="backwards|forwards|both|none".split("|"),Fl="reverse|alternate|alternate-reverse".split("|");function Gl(t,e){var n=new Il;return e&&(n.fill="both",n.duration="auto"),"number"!=typeof t||isNaN(t)?void 0!==t&&Object.keys(t).forEach(function(e){if(null!=t[e]&&"auto"!==t[e]){if(("number"==typeof n[e]||"duration"===e)&&("number"!=typeof t[e]||isNaN(t[e])))return;if("fill"===e&&-1===Dl.indexOf(t[e]))return;if("direction"===e&&-1===Fl.indexOf(t[e]))return;n[e]=t[e]}}):n.duration=t,n}function Bl(t,e){return Gl(t=Vl(null!=t?t:{duration:"auto"}),e)}function Vl(t){return"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t}),t}var Ul=function(){return u(function t(e,n,i){var r=this;o(this,t),this.composite="replace",this.iterationComposite="replace",this.target=e,this.timing=Bl(i,!1),this.timing.effect=this,this.timing.activeDuration=Pl(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=_l(n,this.timing),this.interpolations=Cl(this.normalizedKeyframes,this.timing,this.target);var a=Fs.globalThis.Proxy;this.computedTiming=a?new a(this.timing,{get:function(t,e){return"duration"===e?"auto"===t.duration?0:t.duration:"fill"===e?"auto"===t.fill?"none":t.fill:"localTime"===e?r.animation&&r.animation.currentTime||null:"currentIteration"===e?r.animation&&"running"===r.animation.playState?t.currentIteration||0:null:"progress"===e?r.animation&&"running"===r.animation.playState?t.progress||0:null:t[e]},set:function(){return!0}}):this.timing},[{key:"applyInterpolations",value:function(){this.interpolations(this.target,Number(this.timeFraction))}},{key:"update",value:function(t){return null!==t&&(this.timeFraction=Sl(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)}},{key:"getKeyframes",value:function(){return this.normalizedKeyframes}},{key:"setKeyframes",value:function(t){this.normalizedKeyframes=_l(t)}},{key:"getComputedTiming",value:function(){return this.computedTiming}},{key:"getTiming",value:function(){return this.timing}},{key:"updateTiming",value:function(t){var e=this;Object.keys(t||{}).forEach(function(n){e.timing[n]=t[n]})}}])}();function Yl(t,e){return Number(t.id)-Number(e.id)}var zl=function(){return u(function t(e){var n=this;o(this,t),this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.webAnimationsNextTick=function(t){n.currentTime=t,n.discardAnimations(),0===n.animations.length?n.timelineTicking=!1:n.requestAnimationFrame(n.webAnimationsNextTick)},this.processRafCallbacks=function(t){var e=n.rafCallbacks;n.rafCallbacks=[],Number(n.currentTime)>t&&(t=Number(n.currentTime)),n.animations.sort(Yl),n.animations=n.tick(t,!0,n.animations)[0],e.forEach(function(e){e[1](t)}),n.applyPendingEffects()},this.document=e},[{key:"getAnimations",value:function(){return this.discardAnimations(),this.animations.slice()}},{key:"isTicking",value:function(){return this.inTick}},{key:"play",value:function(t,e,n){var i=new Ul(t,e,n),r=new Wu(i,this);return this.animations.push(r),this.restartWebAnimationsNextTick(),r.updatePromises(),r.play(),r.updatePromises(),r}},{key:"applyDirtiedAnimation",value:function(t){var e=this;if(!this.inTick){t.markTarget();var n=t.targetAnimations();n.sort(Yl),this.tick(Number(this.currentTime),!1,n.slice())[1].forEach(function(t){var n=e.animations.indexOf(t);-1!==n&&e.animations.splice(n,1)}),this.applyPendingEffects()}}},{key:"restart",value:function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame(function(){}),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame}},{key:"destroy",value:function(){this.document.defaultView.cancelAnimationFrame(this.frameId)}},{key:"applyPendingEffects",value:function(){this.pendingEffects.forEach(function(t){null==t||t.applyInterpolations()}),this.pendingEffects=[]}},{key:"updateAnimationsPromises",value:function(){this.animationsWithPromises=this.animationsWithPromises.filter(function(t){return t.updatePromises()})}},{key:"discardAnimations",value:function(){this.updateAnimationsPromises(),this.animations=this.animations.filter(function(t){return"finished"!==t.playState&&"idle"!==t.playState})}},{key:"restartWebAnimationsNextTick",value:function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))}},{key:"rAF",value:function(t){var e=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([e,t]),e}},{key:"requestAnimationFrame",value:function(t){var e=this;return this.rAF(function(n){e.updateAnimationsPromises(),t(n),e.updateAnimationsPromises()})}},{key:"tick",value:function(t,e,n){var i,r,a=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var o=[],s=[],u=[],l=[];return n.forEach(function(n){n.tick(t,e),n._inEffect?(s.push(n.effect),n.markTarget()):(o.push(n.effect),n.unmarkTarget()),n._needsTick&&(a.ticking=!0);var i=n._inEffect||n._needsTick;n._inTimeline=i,i?u.push(n):l.push(n)}),(i=this.pendingEffects).push.apply(i,o),(r=this.pendingEffects).push.apply(r,s),this.ticking&&this.requestAnimationFrame(function(){}),this.inTick=!1,[u,l]}}])}();Fs.EasingFunction=Nl,Fs.AnimationTimeline=zl,t.AABB=bn,t.AbstractRenderer=pn,t.AbstractRendererPlugin=vn,t.AdvancedCamera=Ou,t.Animation=Wu,t.AnimationEvent=Xu,t.AnimationTimeline=zl,t.BUILT_IN_PROPERTIES=Ca,t.CSS=gu,t.CSSGradientValue=er,t.CSSKeywordValue=nr,t.CSSRGB=sr,t.CSSStyleValue=$i,t.CSSUnitValue=rr,t.Camera=Jn,t.CameraEvent=Qn,t.CameraProjectionMode=Kn,t.CameraTrackingMode=Zn,t.CameraType=qn,t.Canvas=Ru,t.CanvasEvent=wu,t.Circle=Qs,t.CircleUpdater=Go,t.ClipSpaceNearZ=dn,t.CustomElement=Js,t.CustomElementRegistry=yu,t.CustomEvent=Qo,t.DefaultSceneGraphSelector=as,t.DefaultSceneGraphService=As,t.DisplayObject=Ks,t.Document=ku,t.ERROR_MSG_METHOD_NOT_IMPLEMENTED=Sn,t.EasingFunctions=kl,t.Element=js,t.ElementEvent=os,t.Ellipse=tu,t.EllipseUpdater=Bo,t.EventService=ts,t.EventTarget=$o,t.FederatedEvent=Wo,t.FederatedMouseEvent=qo,t.FederatedPointerEvent=Zo,t.FederatedWheelEvent=Ko,t.Fragment=eu,t.Frustum=wn,t.GradientType=tr,t.Group=nu,t.GroupUpdater=Xo,t.HTML=ru,t.HTMLUpdater=Ho,t.Image=au,t.KeyframeEffect=Ul,t.Line=su,t.LineUpdater=Vo,t.Mask=Mn,t.MutationEvent=ss,t.MutationObserver=Bu,t.MutationRecord=_u,t.Node=Jo,t.OffscreenCanvasCreator=es,t.Path=lu,t.PathUpdater=Uo,t.Plane=Tn,t.Point=Nn,t.Polygon=hu,t.Polyline=du,t.PolylineUpdater=Yo,t.PropertySyntax=ui,t.RBush=hn,t.Rect=vu,t.RectUpdater=zo,t.Rectangle=Pn,t.Registration=Gu,t.RenderReason=ns,t.RenderingService=is,t.Shape=fn,t.SortReason=ei,t.Strategy=ti,t.Text=mu,t.TextService=Ds,t.TextUpdater=jo,t.UnitType=zi,t.attrModifiedEvent=Ws,t.compareAnimations=Yl,t.computeLinearGradient=function(t,e,n,i){var r=In(i.value),a=0+e/2,o=0+n/2,s=Math.abs(e*Math.cos(r))+Math.abs(n*Math.sin(r));return{x1:t[0]+a-Math.cos(r)*s/2,y1:t[1]+o-Math.sin(r)*s/2,x2:t[0]+a+Math.cos(r)*s/2,y2:t[1]+o+Math.sin(r)*s/2}},t.computeRadialGradient=function(t,e,n,i,r,a){var o=i.value,s=r.value;i.unit===zi.kPercentage&&(o=i.value/100*e),r.unit===zi.kPercentage&&(s=r.value/100*n);var u=Math.max(xe([0,0],[o,s]),xe([0,n],[o,s]),xe([e,n],[o,s]),xe([e,0],[o,s]));return a&&(a instanceof rr?u=a.value:a instanceof nr&&("closest-side"===a.value?u=Math.min(o,e-o,s,n-s):"farthest-side"===a.value?u=Math.max(o,e-o,s,n-s):"closest-corner"===a.value&&(u=Math.min(xe([0,0],[o,s]),xe([0,n],[o,s]),xe([e,n],[o,s]),xe([e,0],[o,s]))))),{x:o+t[0],y:s+t[1],r:u}},t.convertToPath=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.getLocalTransform(),n=[];switch(t.nodeName){case fn.LINE:var i=t.parsedStyle,r=i.x1,a=i.y1,o=i.x2,s=i.y2;n=function(t,e,n,i){return[["M",t,e],["L",n,i]]}(void 0===r?0:r,void 0===a?0:a,void 0===o?0:o,void 0===s?0:s);break;case fn.CIRCLE:var u=t.parsedStyle,l=u.r,c=void 0===l?0:l,f=u.cx,d=u.cy;n=ia(c,c,void 0===f?0:f,void 0===d?0:d);break;case fn.ELLIPSE:var v=t.parsedStyle,p=v.rx,m=v.ry,y=v.cx,k=v.cy;n=ia(void 0===p?0:p,void 0===m?0:m,void 0===y?0:y,void 0===k?0:k);break;case fn.POLYLINE:case fn.POLYGON:n=function(t,e){var n=t.map(function(t,e){return[0===e?"M":"L",t[0],t[1]]});return e&&n.push(["Z"]),n}(t.parsedStyle.points.points,t.nodeName===fn.POLYGON);break;case fn.RECT:var E=t.parsedStyle,x=E.width,b=void 0===x?0:x,T=E.height,M=void 0===T?0:T,w=E.x,N=void 0===w?0:w,P=E.y,S=void 0===P?0:P,C=E.radius,A=C&&C.some(function(t){return 0!==t});n=function(t,e,n,i,r){if(r){var a=g(r,4),o=a[0],s=a[1],u=a[2],l=a[3],c=t>0?1:-1,h=e>0?1:-1,f=c+h!==0?1:0;return[["M",c*o+n,i],["L",t-c*s+n,i],s?["A",s,s,0,0,f,t+n,h*s+i]:null,["L",t+n,e-h*u+i],u?["A",u,u,0,0,f,t+n-c*u,e+i]:null,["L",n+c*l,e+i],l?["A",l,l,0,0,f,n,e+i-h*l]:null,["L",n,h*o+i],o?["A",o,o,0,0,f,c*o+n,i]:null,["Z"]].filter(function(t){return t})}return[["M",n,i],["L",n+t,i],["L",n+t,i+e],["L",n,i+e],["Z"]]}(b,M,N,S,A&&C.map(function(t){return Yt(t,0,Math.min(Math.abs(b)/2,Math.abs(M)/2))}));break;case fn.PATH:n=h(t.parsedStyle.d.absolutePath)}if(n.length)return function(t,e,n){return t.reduce(function(t,e){var i="";if("M"===e[0]||"L"===e[0]){var r=at(e[1],e[2],0);n&&pt(r,r,n),i="".concat(e[0]).concat(r[0],",").concat(r[1])}else if("Z"===e[0])i=e[0];else if("C"===e[0]){var a=at(e[1],e[2],0),o=at(e[3],e[4],0),s=at(e[5],e[6],0);n&&(pt(a,a,n),pt(o,o,n),pt(s,s,n)),i="".concat(e[0]).concat(a[0],",").concat(a[1],",").concat(o[0],",").concat(o[1],",").concat(s[0],",").concat(s[1])}else if("A"===e[0]){var u=at(e[6],e[7],0);n&&pt(u,u,n),i="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(u[0],",").concat(u[1])}else if("Q"===e[0]){var l=at(e[1],e[2],0),c=at(e[3],e[4],0);n&&(pt(l,l,n),pt(c,c,n)),i="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}")}return t+i},"")}(n,0,e)},t.createVec3=On,t.decompose=Un,t.definedProps=function(t){return Object.fromEntries(Object.entries(t).filter(function(t){return void 0!==g(t,2)[1]}))},t.deg2rad=In,t.deg2turn=function(t){return t/360},t.destroyEvent=zs,t.findClosestClipPathTarget=eo,t.fromRotationTranslationScale=Vn,t.getAngle=An,t.getEuler=Bn,t.getOrCalculatePathTotalLength=Hr,t.grad2deg=function(t){return 0>(t%=400)&&(t+=400),.9*t},t.insertedEvent=Us,t.isBrowser=$a,t.isCSSGradientValue=function(t){return!!t.type&&!!t.value},t.isCSSRGB=wr,t.isCanvas=function(t){return!!t.document},t.isDisplayObject=Xs,t.isFederatedEvent=function(t){return!!t.type},t.isFillOrStrokeAffected=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auto",e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=!1,r=!1;return"visiblepainted"===t||"painted"===t||"auto"===t?(i=!!e&&!e.isNone,r=!!n&&!n.isNone):"visiblefill"===t||"fill"===t?i=!0:"visiblestroke"===t||"stroke"===t?r=!0:"visible"!==t&&"all"!==t||(i=!0,r=!0),[i,r]},t.isPattern=Mr,t.makeTiming=Gl,t.mergeColors=Pr,t.normalizeKeyframes=_l,t.normalizeTimingInput=Bl,t.numericTimingToObject=Vl,t.parseColor=Nr,t.parseLength=Ar,t.parsePath=oa,t.parseTransform=pa,t.parsedTransformToMat4=Io,t.propertyMetadataCache=Ra,t.rad2deg=Dn,t.removedEvent=Ys,t.resetEntityCounter=function(){Vs=0},t.runtime=Fs,t.setDOMSize=function(t,e,n){$a&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")},t.translatePathToString=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=t.map(function(a,o){var s=a[0],u=t[o+1],l=(o===t.length-1||u&&("M"===u[0]||"Z"===u[0]))&&0!==i&&0!==r,c=g(0===o&&(0!==e||0!==n)?[e,n]:[0,0],2),h=c[0],f=c[1],d=g(l?[i,r]:[0,0],2),v=d[0],p=d[1];switch(s){case"M":return"M ".concat(a[1]+h,",").concat(a[2]+f);case"L":return"L ".concat(a[1]+v,",").concat(a[2]+p);case"Q":return"Q ".concat(a[1]," ").concat(a[2],",").concat(a[3]+v," ").concat(a[4]+p);case"C":return"C ".concat(a[1]," ").concat(a[2],",").concat(a[3]," ").concat(a[4],",").concat(a[5]+v," ").concat(a[6]+p);case"A":return"A ".concat(a[1]," ").concat(a[2]," ").concat(a[3]," ").concat(a[4]," ").concat(a[5]," ").concat(a[6]," ").concat(a[7]).concat(l?" L ".concat(a[6]+i,",").concat(a[7]+r):"");case"Z":return"Z";default:return null}}).filter(function(t){return null!==t}).join(" ");return~a.indexOf("NaN")?"":a},t.turn2deg=Fn,t.updateLocalTransform=ai,t.updateWorldTransform=oi});
//# sourceMappingURL=index.umd.min.js.map