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.
18 lines
212 KiB
18 lines
212 KiB
/*!
|
|
* @antv/g-camera-api
|
|
* @description A simple implementation of Camera API.
|
|
* @version 2.0.41
|
|
* @date 7/30/2025, 1:34:37 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=t.G||{},t.G.CameraAPI={}))}(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 r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,n||"default");if("object"!=e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==e(n)?n:n+""}function r(t,e,r){return(e=n(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function a(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach(function(e){r(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(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 r=0;e.length>r;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,n(i.key),i)}}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,r=Array(e);e>n;n++)r[n]=t[n];return r}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 y(t,e){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},y(t,e)}function m(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&&y(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 r,i,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=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}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 x={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function a(t,e,r,a,o){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,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 r:delete t._events[e]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},s.prototype.listeners=function(t){var e=this._events[n?n+t:t];if(!e)return[];if(e.fn)return[e.fn];for(var r=0,i=e.length,a=Array(i);i>r;r++)a[r]=e[r].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,r,i,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,r),!0;case 4:return c.fn.call(c.context,e,r,i),!0;case 5:return c.fn.call(c.context,e,r,i,a),!0;case 6:return c.fn.call(c.context,e,r,i,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,r);break;case 4:c[l].fn.call(c[l].context,e,r,i);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,r,i){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||i&&!s.once||r&&s.context!==r||o(this,a);else{for(var u=0,l=[],c=s.length;c>u;u++)(s[u].fn!==e||i&&!s[u].once||r&&s[u].context!==r)&&l.push(s[u]);l.length?this._events[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 r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s}(x);var k=x.exports,M=1e-6,b="undefined"!=typeof Float32Array?Float32Array:Array;function E(){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 T(){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 S(t,e,n,r,i,a,o,s,u,l,c,h,f,d,v,p,y){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=u,t[8]=l,t[9]=c,t[10]=h,t[11]=f,t[12]=d,t[13]=v,t[14]=p,t[15]=y,t}function P(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 A(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s}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 C(t,e){var n=e[0],r=e[1],i=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],y=e[14],m=e[15],g=n*s-r*o,x=n*u-i*o,k=n*l-a*o,M=r*u-i*s,b=r*l-a*s,E=i*l-a*u,T=c*p-h*v,w=c*y-f*v,N=c*m-d*v,S=h*y-f*p,P=h*m-d*p,A=f*m-d*y,C=g*A-x*P+k*S+M*N-b*w+E*T;return C?(t[0]=(s*A-u*P+l*S)*(C=1/C),t[1]=(i*P-r*A-a*S)*C,t[2]=(p*E-y*b+m*M)*C,t[3]=(f*b-h*E-d*M)*C,t[4]=(u*N-o*A-l*w)*C,t[5]=(n*A-i*N+a*w)*C,t[6]=(y*k-v*E-m*x)*C,t[7]=(c*E-f*k+d*x)*C,t[8]=(o*P-s*N+l*T)*C,t[9]=(r*N-n*P-a*T)*C,t[10]=(v*b-p*k+m*g)*C,t[11]=(h*k-c*b-d*g)*C,t[12]=(s*w-o*S-u*T)*C,t[13]=(n*S-r*w+i*T)*C,t[14]=(p*x-v*M-y*g)*C,t[15]=(c*M-h*x+f*g)*C,t):null}function O(t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],u=t[7],l=t[8],c=t[9],h=t[10],f=t[11],d=t[12],v=t[13],p=t[14],y=t[15];return(e*o-n*a)*(h*y-f*p)-(e*s-r*a)*(c*y-f*v)+(e*u-i*a)*(c*p-h*v)+(n*s-r*o)*(l*y-f*d)-(n*u-i*o)*(l*p-h*d)+(r*u-i*s)*(l*v-c*d)}function R(t,e,n){var r=e[0],i=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],y=e[13],m=e[14],g=e[15],x=n[0],k=n[1],M=n[2],b=n[3];return t[0]=x*r+k*s+M*h+b*p,t[1]=x*i+k*u+M*f+b*y,t[2]=x*a+k*l+M*d+b*m,t[3]=x*o+k*c+M*v+b*g,t[4]=(x=n[4])*r+(k=n[5])*s+(M=n[6])*h+(b=n[7])*p,t[5]=x*i+k*u+M*f+b*y,t[6]=x*a+k*l+M*d+b*m,t[7]=x*o+k*c+M*v+b*g,t[8]=(x=n[8])*r+(k=n[9])*s+(M=n[10])*h+(b=n[11])*p,t[9]=x*i+k*u+M*f+b*y,t[10]=x*a+k*l+M*d+b*m,t[11]=x*o+k*c+M*v+b*g,t[12]=(x=n[12])*r+(k=n[13])*s+(M=n[14])*h+(b=n[15])*p,t[13]=x*i+k*u+M*f+b*y,t[14]=x*a+k*l+M*d+b*m,t[15]=x*o+k*c+M*v+b*g,t}function L(t,e,n){var r,i,a,o,s,u,l,c,h,f,d,v,p=n[0],y=n[1],m=n[2];return e===t?(t[12]=e[0]*p+e[4]*y+e[8]*m+e[12],t[13]=e[1]*p+e[5]*y+e[9]*m+e[13],t[14]=e[2]*p+e[6]*y+e[10]*m+e[14],t[15]=e[3]*p+e[7]*y+e[11]*m+e[15]):(i=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]=r=e[0],t[1]=i,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]=r*p+s*y+h*m+e[12],t[13]=i*p+u*y+f*m+e[13],t[14]=a*p+l*y+d*m+e[14],t[15]=o*p+c*y+v*m+e[15]),t}function I(t,e,n){var r=Math.sin(n),i=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*i+l*r,t[5]=o*i+c*r,t[6]=s*i+h*r,t[7]=u*i+f*r,t[8]=l*i-a*r,t[9]=c*i-o*r,t[10]=h*i-s*r,t[11]=f*i-u*r,t}function D(t,e,n){var r=Math.sin(n),i=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*i-l*r,t[1]=o*i-c*r,t[2]=s*i-h*r,t[3]=u*i-f*r,t[8]=a*r+l*i,t[9]=o*r+c*i,t[10]=s*r+h*i,t[11]=u*r+f*i,t}function _(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 G(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 F(t,e,n){var r,i,a,o=n[0],s=n[1],u=n[2],l=Math.hypot(o,s,u);return M>l?null:(o*=l=1/l,s*=l,u*=l,r=Math.sin(e),t[0]=o*o*(a=1-(i=Math.cos(e)))+i,t[1]=s*o*a+u*r,t[2]=u*o*a-s*r,t[3]=0,t[4]=o*s*a-u*r,t[5]=s*s*a+i,t[6]=u*s*a+o*r,t[7]=0,t[8]=o*u*a+s*r,t[9]=s*u*a-o*r,t[10]=u*u*a+i,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),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function U(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Y(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function V(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=r+r,u=i+i,l=a+a,c=r*s,h=r*u,f=r*l,d=i*u,v=i*l,p=a*l,y=o*s,m=o*u,g=o*l;return t[0]=1-(d+p),t[1]=h+g,t[2]=f-m,t[3]=0,t[4]=h-g,t[5]=1-(c+p),t[6]=v+y,t[7]=0,t[8]=f+m,t[9]=v-y,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],r=e[5],i=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,r,i),t[2]=Math.hypot(a,o,s),t}function X(t,e){var n=new b(3);j(n,e);var r=1/n[0],i=1/n[1],a=1/n[2],o=e[0]*r,s=e[1]*i,u=e[2]*a,l=e[4]*r,c=e[5]*i,h=e[6]*a,f=e[8]*r,d=e[9]*i,v=e[10]*a,p=o+c+v,y=0;return p>0?(t[3]=.25*(y=2*Math.sqrt(p+1)),t[0]=(h-d)/y,t[1]=(f-u)/y,t[2]=(s-l)/y):o>c&&o>v?(t[3]=(h-d)/(y=2*Math.sqrt(1+o-c-v)),t[0]=.25*y,t[1]=(s+l)/y,t[2]=(f+u)/y):c>v?(t[3]=(f-u)/(y=2*Math.sqrt(1+c-o-v)),t[0]=(s+l)/y,t[1]=.25*y,t[2]=(h+d)/y):(t[3]=(s-l)/(y=2*Math.sqrt(1+v-o-c)),t[0]=(f+u)/y,t[1]=(h+d)/y,t[2]=.25*y),t}function W(t,e,n,r,i){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,y=o*h,m=s*h,g=u*l,x=u*c,k=u*h,M=r[0],b=r[1],E=r[2],T=i[0],w=i[1],N=i[2],S=(1-(p+m))*M,P=(d+k)*M,A=(v-x)*M,C=(d-k)*b,O=(1-(f+m))*b,R=(y+g)*b,L=(v+x)*E,I=(y-g)*E,D=(1-(f+p))*E;return t[0]=S,t[1]=P,t[2]=A,t[3]=0,t[4]=C,t[5]=O,t[6]=R,t[7]=0,t[8]=L,t[9]=I,t[10]=D,t[11]=0,t[12]=n[0]+T-(S*T+C*w+L*N),t[13]=n[1]+w-(P*T+O*w+I*N),t[14]=n[2]+N-(A*T+R*w+D*N),t[15]=1,t}function H(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n+n,s=r+r,u=i+i,l=n*o,c=r*o,h=r*s,f=i*o,d=i*s,v=i*u,p=a*o,y=a*s,m=a*u;return t[0]=1-h-v,t[1]=c+m,t[2]=f-y,t[3]=0,t[4]=c-m,t[5]=1-l-v,t[6]=d+p,t[7]=0,t[8]=f+y,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,r,i){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!=i&&i!==1/0?(t[10]=(i+r)*(a=1/(r-i)),t[14]=2*i*r*a):(t[10]=-1,t[14]=-2*r),t}function Z(t,e,n,r,i,a,o){var s=1/(e-n),u=1/(r-i),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]=(i+r)*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,r,i,a,o){var s=1/(e-n),u=1/(r-i),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]=(i+r)*u,t[14]=a*l,t[15]=1,t}function $(t,e,n,r){var i,a,o,s,u,l,c,h,f,d,v=e[0],p=e[1],y=e[2],m=r[0],g=r[1],x=r[2],k=n[0],b=n[1],E=n[2];return M>Math.abs(v-k)&&M>Math.abs(p-b)&&M>Math.abs(y-E)?P(t):(d=1/Math.hypot(c=v-k,h=p-b,f=y-E),(d=Math.hypot(i=g*(f*=d)-x*(h*=d),a=x*(c*=d)-m*f,o=m*h-g*c))?(i*=d=1/d,a*=d,o*=d):(i=0,a=0,o=0),(d=Math.hypot(s=h*o-f*a,u=f*i-c*o,l=c*a-h*i))?(s*=d=1/d,u*=d,l*=d):(s=0,u=0,l=0),t[0]=i,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]=-(i*v+a*p+o*y),t[13]=-(s*v+u*p+l*y),t[14]=-(c*v+h*p+f*y),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=R,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],r=e[1],i=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],y=e[14],m=e[15];return t[0]=s*(f*m-d*y)-h*(u*m-l*y)+p*(u*d-l*f),t[1]=-(r*(f*m-d*y)-h*(i*m-a*y)+p*(i*d-a*f)),t[2]=r*(u*m-l*y)-s*(i*m-a*y)+p*(i*l-a*u),t[3]=-(r*(u*d-l*f)-s*(i*d-a*f)+h*(i*l-a*u)),t[4]=-(o*(f*m-d*y)-c*(u*m-l*y)+v*(u*d-l*f)),t[5]=n*(f*m-d*y)-c*(i*m-a*y)+v*(i*d-a*f),t[6]=-(n*(u*m-l*y)-o*(i*m-a*y)+v*(i*l-a*u)),t[7]=n*(u*d-l*f)-o*(i*d-a*f)+c*(i*l-a*u),t[8]=o*(h*m-d*p)-c*(s*m-l*p)+v*(s*d-l*h),t[9]=-(n*(h*m-d*p)-c*(r*m-a*p)+v*(r*d-a*h)),t[10]=n*(s*m-l*p)-o*(r*m-a*p)+v*(r*l-a*s),t[11]=-(n*(s*d-l*h)-o*(r*d-a*h)+c*(r*l-a*s)),t[12]=-(o*(h*y-f*p)-c*(s*y-u*p)+v*(s*f-u*h)),t[13]=n*(h*y-f*p)-c*(r*y-i*p)+v*(r*f-i*h),t[14]=-(n*(s*y-u*p)-o*(r*y-i*p)+v*(r*u-i*s)),t[15]=n*(s*f-u*h)-o*(r*f-i*h)+c*(r*u-i*s),t},clone:w,copy:N,create:T,determinant:O,equals:function(t,e){var n=t[0],r=t[1],i=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],y=t[14],m=t[15],g=e[0],x=e[1],k=e[2],b=e[3],E=e[4],T=e[5],w=e[6],N=e[7],S=e[8],P=e[9],A=e[10],C=e[11],O=e[12],R=e[13],L=e[14],I=e[15];return!(Math.abs(n-g)>M*Math.max(1,Math.abs(n),Math.abs(g))||Math.abs(r-x)>M*Math.max(1,Math.abs(r),Math.abs(x))||Math.abs(i-k)>M*Math.max(1,Math.abs(i),Math.abs(k))||Math.abs(a-b)>M*Math.max(1,Math.abs(a),Math.abs(b))||Math.abs(o-E)>M*Math.max(1,Math.abs(o),Math.abs(E))||Math.abs(s-T)>M*Math.max(1,Math.abs(s),Math.abs(T))||Math.abs(u-w)>M*Math.max(1,Math.abs(u),Math.abs(w))||Math.abs(l-N)>M*Math.max(1,Math.abs(l),Math.abs(N))||Math.abs(c-S)>M*Math.max(1,Math.abs(c),Math.abs(S))||Math.abs(h-P)>M*Math.max(1,Math.abs(h),Math.abs(P))||Math.abs(f-A)>M*Math.max(1,Math.abs(f),Math.abs(A))||Math.abs(d-C)>M*Math.max(1,Math.abs(d),Math.abs(C))||Math.abs(v-O)>M*Math.max(1,Math.abs(v),Math.abs(O))||Math.abs(p-R)>M*Math.max(1,Math.abs(p),Math.abs(R))||Math.abs(y-L)>M*Math.max(1,Math.abs(y),Math.abs(L))||Math.abs(m-I)>M*Math.max(1,Math.abs(m),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:H,fromQuat2:function(t,e){var n=new b(3),r=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=r*r+i*i+a*a+o*o;return h>0?(n[0]=2*(s*o+c*r+u*a-l*i)/h,n[1]=2*(u*o+c*i+l*r-s*a)/h,n[2]=2*(l*o+c*a+s*i-u*r)/h):(n[0]=2*(s*o+c*r+u*a-l*i),n[1]=2*(u*o+c*i+l*r-s*a),n[2]=2*(l*o+c*a+s*i-u*r)),V(t,e,n),t},fromRotation:F,fromRotationTranslation:V,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],a=e[1],o=e[2],s=e[3],u=i+i,l=a+a,c=o+o,h=i*u,f=i*l,d=i*c,v=a*l,p=a*c,y=o*c,m=s*u,g=s*l,x=s*c,k=r[0],M=r[1],b=r[2];return t[0]=(1-(v+y))*k,t[1]=(f+x)*k,t[2]=(d-g)*k,t[3]=0,t[4]=(f-x)*M,t[5]=(1-(h+y))*M,t[6]=(p+m)*M,t[7]=0,t[8]=(d+g)*b,t[9]=(p-m)*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:W,fromScaling:G,fromTranslation:_,fromValues:function(t,e,n,r,i,a,o,s,u,l,c,h,f,d,v,p){var y=new b(16);return y[0]=t,y[1]=e,y[2]=n,y[3]=r,y[4]=i,y[5]=a,y[6]=o,y[7]=s,y[8]=u,y[9]=l,y[10]=c,y[11]=h,y[12]=f,y[13]=d,y[14]=v,y[15]=p,y},fromXRotation:B,fromYRotation:U,fromZRotation:Y,frustum:function(t,e,n,r,i,a,o){var s=1/(n-e),u=1/(i-r),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]=(i+r)*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:P,invert:C,lookAt:$,mul:tt,multiply:R,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},ortho:K,orthoNO:Z,orthoZO:Q,perspective:q,perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(o+s),l=2/(i+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]=(i-a)*l*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},perspectiveNO:q,perspectiveZO:function(t,e,n,r,i){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!=i&&i!==1/0?(t[10]=i*(a=1/(r-i)),t[14]=i*r*a):(t[10]=-1,t[14]=-r),t},rotate:function(t,e,n,r){var i,a,o,s,u,l,c,h,f,d,v,p,y,m,g,x,k,b,E,T,w,N,S,P,A=r[0],C=r[1],O=r[2],R=Math.hypot(A,C,O);return M>R?null:(A*=R=1/R,C*=R,O*=R,i=Math.sin(n),u=e[1],l=e[2],c=e[3],f=e[5],d=e[6],v=e[7],y=e[9],m=e[10],g=e[11],E=A*C*(o=1-(a=Math.cos(n)))-O*i,T=C*C*o+a,w=O*C*o+A*i,N=A*O*o+C*i,S=C*O*o-A*i,P=O*O*o+a,t[0]=(s=e[0])*(x=A*A*o+a)+(h=e[4])*(k=C*A*o+O*i)+(p=e[8])*(b=O*A*o-C*i),t[1]=u*x+f*k+y*b,t[2]=l*x+d*k+m*b,t[3]=c*x+v*k+g*b,t[4]=s*E+h*T+p*w,t[5]=u*E+f*T+y*w,t[6]=l*E+d*T+m*w,t[7]=c*E+v*T+g*w,t[8]=s*N+h*S+p*P,t[9]=u*N+f*S+y*P,t[10]=l*N+d*S+m*P,t[11]=c*N+v*S+g*P,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:I,rotateY:D,rotateZ:function(t,e,n){var r=Math.sin(n),i=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*i+l*r,t[1]=o*i+c*r,t[2]=s*i+h*r,t[3]=u*i+f*r,t[4]=l*i-a*r,t[5]=c*i-o*r,t[6]=h*i-s*r,t[7]=f*i-u*r,t},scale:function(t,e,n){var r=n[0],i=n[1],a=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*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:S,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,r){var i=e[0],a=e[1],o=e[2],s=r[0],u=r[1],l=r[2],c=i-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,y=s*h-u*c;return(d=v*v+p*p+y*y)>0&&(v*=d=1/Math.sqrt(d),p*=d,y*=d),t[0]=v,t[1]=p,t[2]=y,t[3]=0,t[4]=h*y-f*p,t[5]=f*v-c*y,t[6]=c*p-h*v,t[7]=0,t[8]=c,t[9]=h,t[10]=f,t[11]=0,t[12]=i,t[13]=a,t[14]=o,t[15]=1,t},translate:L,transpose:A});function nt(){var t=new b(3);return b!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function rt(t){var e=new b(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function it(t){return Math.hypot(t[0],t[1],t[2])}function at(t,e,n){var r=new b(3);return r[0]=t,r[1]=e,r[2]=n,r}function ot(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function st(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,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],r=e[1],i=e[2],a=n*n+r*r+i*i;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 r=e[0],i=e[1],a=e[2],o=n[0],s=n[1],u=n[2];return t[0]=i*u-a*s,t[1]=a*o-r*u,t[2]=r*s-i*o,t}function vt(t,e,n,r){var i=e[0],a=e[1],o=e[2];return t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t[2]=o+r*(n[2]-o),t}function pt(t,e,n){var r=e[0],i=e[1],a=e[2],o=n[3]*r+n[7]*i+n[11]*a+n[15];return t[0]=(n[0]*r+n[4]*i+n[8]*a+n[12])/(o=o||1),t[1]=(n[1]*r+n[5]*i+n[9]*a+n[13])/o,t[2]=(n[2]*r+n[6]*i+n[10]*a+n[14])/o,t}function yt(t,e){var n=t[0],r=t[1],i=t[2],a=e[0],o=e[1],s=e[2];return M*Math.max(1,Math.abs(n),Math.abs(a))>=Math.abs(n-a)&&M*Math.max(1,Math.abs(r),Math.abs(o))>=Math.abs(r-o)&&M*Math.max(1,Math.abs(i),Math.abs(s))>=Math.abs(i-s)}var mt=lt,gt=function(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1],e[2]-t[2])},xt=it;function kt(){var t=new b(4);return b!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Mt(t,e,n,r){var i=new b(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function bt(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*o,t[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*o,t[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*o,t[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*o,t}function Et(){var t=new b(4);return b!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Tt(t,e,n){var r=Math.sin(n*=.5);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function wt(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=n[0],u=n[1],l=n[2],c=n[3];return t[0]=r*c+o*s+i*l-a*u,t[1]=i*c+o*u+a*s-r*l,t[2]=a*c+o*l+r*u-i*s,t[3]=o*c-r*s-i*u-a*l,t}function Nt(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n*n+r*r+i*i+a*a,s=o?1/o:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=a*s,t}function St(t,e,n,r){var i=.5*Math.PI/180;n*=i,r*=i;var a=Math.sin(e*=i),o=Math.cos(e),s=Math.sin(n),u=Math.cos(n),l=Math.sin(r),c=Math.cos(r);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=kt()}();var Pt=Mt,At=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},Ct=function(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t},Ot=wt,Rt=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n*n+r*r+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),t[0]=n*o,t[1]=r*o,t[2]=i*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 Dt(t){return null==t}function _t(t){return Array.isArray(t)}nt(),at(1,0,0),at(0,1,0),Et(),Et(),E(),function(){var t=Lt()}();var Gt={}.toString,Ft=function(t,e){return Gt.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],r=1;e>r;r++)n=Math.max(n,t[r]);return n}var Ut=function(t){if(_t(t))return t.reduce(function(t,e){return Math.min(t,e)},t[0])};function Yt(t){return"string"==typeof t}var Vt=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},Wt=function(t){return Ft(t,"Boolean")},Ht=function(t){return void 0===t},qt=function(){return qt=Object.assign||function(t){for(var e,n=1,r=arguments.length;r>n;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},qt.apply(this,arguments)};function Zt(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;a>i;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var 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 r=t[n],i=n;r.length;)e[n]="A",t.splice(i+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var $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(),r=t.data;r.length>=$t[n]&&("m"===n&&r.length>2?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,$t[n]))),$t[n]););}function re(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'.concat(n[e],'", expecting 0 or 1 at index ').concat(e))}function ie(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,r=t.pathValue,i=t.index,a=i,o=!1,s=!1,u=!1,l=!1;if(n>a)if(43!==(e=r.charCodeAt(a))&&45!==e||(e=r.charCodeAt(a+=1)),ae(e)||46===e){if(46!==e){if(o=48===e,e=r.charCodeAt(a+=1),o&&n>a&&e&&ae(e))return void(t.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(r[i],'" illegal number'));for(;n>a&&ae(r.charCodeAt(a));)a+=1,s=!0;e=r.charCodeAt(a)}if(46===e){for(l=!0,a+=1;ae(r.charCodeAt(a));)a+=1,u=!0;e=r.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(r[a],'" invalid float exponent'));if(43!==(e=r.charCodeAt(a+=1))&&45!==e||(a+=1),a>=n||!ae(r.charCodeAt(a)))return void(t.err="[path-util]: Invalid path value at index ".concat(a,', "').concat(r[a],'" invalid integer exponent'));for(;n>a&&ae(r.charCodeAt(a));)a+=1}t.index=a,t.param=+t.pathValue.slice(i,a)}else t.err="[path-util]: Invalid path value at index ".concat(a,', "').concat(r[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,r=t.index,i=n.charCodeAt(r),a=$t[n[r].toLowerCase()];if(t.segmentStart=r,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}(i))if(t.index+=1,ue(t),t.data=[],a){for(;;){for(var o=a;o>0;o-=1){if(!le(i)||3!==o&&4!==o?oe(t):re(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(!ie(n.charCodeAt(t.index)))break}ne(t)}else ne(t);else t.err='[path-util]: Invalid path value "'.concat(n[r],'" 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,r=0,i=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 i=n=o[0],a=r=o[1],["M",n,r];if(s!==u)switch(u){case"A":e=[u,o[0],o[1],o[2],o[3],o[4],o[5]+n,o[6]+r];break;case"V":e=[u,o[0]+r];break;case"H":e=[u,o[0]+n];break;default:var l=o.map(function(t,e){return t+(e%2?r:n)});e=[u].concat(l)}else e=[u].concat(o);var c=e.length;switch(u){case"Z":n=i,r=a;break;case"H":n=e[1];break;case"V":r=e[1];break;default:n=e[c-2],r=e[c-1],"M"===u&&(i=n,a=r)}return e})}function de(t,e){var n=t[0],r=e.x1,i=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],i];else if("V"===n)u=["L",r,t[1]];else if("S"===n){var l=2*r-a,c=2*i-o;e.x1=l,e.y1=c,u=["C",l,c].concat(s)}else if("T"===n){var h=2*r-e.qx,f=2*i-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),r=0;e.length>r;r+=1){e[r]=de(e[r],n);var i=e[r],a=i.length;n.x1=+i[a-2],n.y1=+i[a-1],n.x2=+i[a-4]||n.x1,n.y2=+i[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 ye(t,e,n,r,i,a,o,s,u,l){var c,h,f,d,v,p=t,y=e,m=n,g=r,x=s,k=u,M=120*Math.PI/180,b=Math.PI/180*(+i||0),E=[];if(l)h=l[0],f=l[1],d=l[2],v=l[3];else{y=(c=pe(p,y,-b)).y;var T=((p=c.x)-(x=(c=pe(x,k,-b)).x))/2,w=(y-(k=c.y))/2,N=T*T/(m*m)+w*w/(g*g);N>1&&(m*=N=Math.sqrt(N),g*=N);var S=m*m,P=g*g,A=(a===o?-1:1)*Math.sqrt(Math.abs((S*P-S*w*w-P*T*T)/(S*w*w+P*T*T)));d=A*m*w/g+(p+x)/2,h=Math.asin(((y-(v=A*-g*T/m+(y+k)/2))/g*1e9|0)/1e9),f=Math.asin(((k-v)/g*1e9|0)/1e9),0>(h=d>p?Math.PI-h:h)&&(h=2*Math.PI+h),0>(f=d>x?Math.PI-f:f)&&(f=2*Math.PI+f),o&&h>f&&(h-=2*Math.PI),!o&&f>h&&(f-=2*Math.PI)}var C=f-h;if(Math.abs(C)>M){var O=f,R=x,L=k;E=ye(x=d+m*Math.cos(f=h+M*(o&&f>h?1:-1)),k=v+g*Math.sin(f),m,g,i,0,o,R,L,[f,O,d,v])}C=f-h;var I=Math.cos(h),D=Math.sin(h),_=Math.cos(f),G=Math.sin(f),F=Math.tan(C/4),B=4/3*m*F,U=4/3*g*F,Y=[p,y],V=[p+B*D,y-U*I],z=[x+B*G,k-U*_],j=[x,k];if(V[0]=2*Y[0]-V[0],V[1]=2*Y[1]-V[1],l)return V.concat(z,j,E);for(var X=[],W=0,H=(E=V.concat(z,j,E)).length;H>W;W+=1)X[W]=W%2?pe(E[W-1],E[W],b).y:pe(E[W],E[W+1],b).x;return X}function me(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}var ge=function(t,e,n,r){return Zt(Zt([],me([t,e],[n,r],.5),!0),[n,r,n,r],!1)};function xe(t,e){var n,r,i,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,y=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(ye(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)*(r=n[2]),s*n[1]+u*(i=n[3]),s*(a=n[4])+u*r,s*(o=n[5])+u*i,a,o]);case"L":return["C"].concat(ge(d,v,h,f));case"Z":return d===p&&v===y?["C",d,v,p,y,p,y]:["C"].concat(ge(d,v,p,y))}return t}function ke(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 r,i,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=xe(a[h],o);a[h]=f,Qt(a,s,h),l=a.length,"Z"===u&&c.push(h),o.x1=+(r=a[h])[(i=r.length)-2],o.y1=+r[i-1],o.x2=+r[i-4]||o.x1,o.y2=+r[i-3]||o.y1}return e?[a,c]:a}function Me(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,r,i){var a=Me([t,e],[n,r]),o={x:0,y:0};if("number"==typeof i)if(0<i)if(i<a){var s=me([t,e],[n,r],i/a);o={x:s[0],y:s[1]}}else o={x:n,y:r};else o={x:t,y:e};return{length:a,point:o,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function Ee(t,e){var n=t.x,r=t.y,i=e.x,a=e.y;return(0>n*a-r*i?-1:1)*Math.acos((n*i+r*a)/Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(a,2))))}function Te(t,e,n,r,i,a,o,s,u,l){var c=Math.abs,h=Math.sin,f=Math.cos,d=Math.sqrt,v=Math.PI,p=c(n),y=c(r),m=(i%360+360)%360*(v/180);if(t===s&&e===u)return{x:t,y:e};if(0===p||0===y)return be(t,e,s,u,l).point;var g=(t-s)/2,x=(e-u)/2,k={x:f(m)*g+h(m)*x,y:-h(m)*g+f(m)*x},M=Math.pow(k.x,2)/Math.pow(p,2)+Math.pow(k.y,2)/Math.pow(y,2);M>1&&(p*=d(M),y*=d(M));var b=(Math.pow(p,2)*Math.pow(y,2)-Math.pow(p,2)*Math.pow(k.y,2)-Math.pow(y,2)*Math.pow(k.x,2))/(Math.pow(p,2)*Math.pow(k.y,2)+Math.pow(y,2)*Math.pow(k.x,2)),E=(a!==o?1:-1)*d(b=0>b?0:b),T=E*(p*k.y/y),w=E*(-y*k.x/p),N=f(m)*T-h(m)*w+(t+s)/2,S=h(m)*T+f(m)*w+(e+u)/2,P={x:(k.x-T)/p,y:(k.y-w)/y},A=Ee({x:1,y:0},P),C=Ee(P,{x:(-k.x-T)/p,y:(-k.y-w)/y});!o&&C>0?C-=2*v:o&&0>C&&(C+=2*v);var O=A+(C%=2*v)*l,R=p*f(O),L=y*h(O);return{x:f(m)*R-h(m)*L+N,y:h(m)*R+f(m)*L+S}}function we(t,e,n,r,i,a,o,s,u,l,c){var h,f=c.bbox,d=void 0===f||f,v=c.length,p=void 0===v||v,y=c.sampleSize,m=void 0===y?30:y,g="number"==typeof l,x=t,k=e,M=0,b=[x,k,M],E=[x,k],T={x:0,y:0},w=[{x:x,y:k}];g&&0>=l&&(T={x:x,y:k});for(var N=0;m>=N;N+=1){if(x=(h=Te(t,e,n,r,i,a,o,s,u,N/m)).x,k=h.y,d&&w.push({x:x,y:k}),p&&(M+=Me(E,[x,k])),E=[x,k],g&&M>=l&&l>b[2]){var S=(M-l)/(M-b[2]);T={x:E[0]*(1-S)+b[0]*S,y:E[1]*(1-S)+b[1]*S}}b=[x,k,M]}return g&&l>=M&&(T={x:s,y:u}),{length:M,point:T,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,r,i,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)*i+Math.pow(u,3)*o,y:Math.pow(l,3)*e+3*Math.pow(l,2)*u*r+3*l*Math.pow(u,2)*a+Math.pow(u,3)*s}}function Se(t,e,n,r,i,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,y=void 0===p?10:p,m="number"==typeof u,g=t,x=e,k=0,M=[g,x,k],b=[g,x],E={x:0,y:0},T=[{x:g,y:x}];m&&0>=u&&(E={x:g,y:x});for(var w=0;y>=w;w+=1){if(g=(c=Ne(t,e,n,r,i,a,o,s,w/y)).x,x=c.y,f&&T.push({x:g,y:x}),v&&(k+=Me(b,[g,x])),b=[g,x],m&&k>=u&&u>M[2]){var N=(k-u)/(k-M[2]);E={x:b[0]*(1-N)+M[0]*N,y:b[1]*(1-N)+M[1]*N}}M=[g,x,k]}return m&&u>=k&&(E={x:o,y:s}),{length:k,point:E,min:{x:Math.min.apply(null,T.map(function(t){return t.x})),y:Math.min.apply(null,T.map(function(t){return t.y}))},max:{x:Math.max.apply(null,T.map(function(t){return t.x})),y:Math.max.apply(null,T.map(function(t){return t.y}))}}}function Pe(t,e,n,r,i,a,o){var s=1-o;return{x:Math.pow(s,2)*t+2*s*o*n+Math.pow(o,2)*i,y:Math.pow(s,2)*e+2*s*o*r+Math.pow(o,2)*a}}function Ae(t,e,n,r,i,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,y=t,m=e,g=0,x=[y,m,g],k=[y,m],M={x:0,y:0},b=[{x:y,y:m}];p&&0>=o&&(M={x:y,y:m});for(var E=0;v>=E;E+=1){if(y=(u=Pe(t,e,n,r,i,a,E/v)).x,m=u.y,c&&b.push({x:y,y:m}),f&&(g+=Me(k,[y,m])),k=[y,m],p&&g>=o&&o>x[2]){var T=(g-o)/(g-x[2]);M={x:k[0]*(1-T)+x[0]*T,y:k[1]*(1-T)+x[1]*T}}x=[y,m,g]}return p&&o>=g&&(M={x:i,y:a}),{length:g,point:M,min:{x:Math.min.apply(null,b.map(function(t){return t.x})),y:Math.min.apply(null,b.map(function(t){return t.y}))},max:{x:Math.max.apply(null,b.map(function(t){return t.x})),y:Math.max.apply(null,b.map(function(t){return t.y}))}}}function Ce(t,e,n){for(var r,i,a,o,s,u,l,c,h,f=ve(t),d="number"==typeof e,v=[],p=0,y=0,m=0,g=0,x=[],k=[],M=0,b={x:0,y:0},E=b,T=b,w=b,N=0,S=0,P=f.length;P>S;S+=1)v=(l="M"===(c=(h=f[S])[0]))?v:[p,y].concat(h.slice(1)),l?(E=b={x:m=h[1],y:g=h[2]},M=0,d&&.001>e&&(w=b)):"L"===c?(M=(r=be(v[0],v[1],v[2],v[3],(e||0)-N)).length,b=r.min,E=r.max,T=r.point):"A"===c?(M=(i=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=i.min,E=i.max,T=i.point):"C"===c?(M=(a=Se(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],(e||0)-N,n||{})).length,b=a.min,E=a.max,T=a.point):"Q"===c?(M=(o=Ae(v[0],v[1],v[2],v[3],v[4],v[5],(e||0)-N,n||{})).length,b=o.min,E=o.max,T=o.point):"Z"===c&&(M=(s=be((v=[p,y,m,g])[0],v[1],v[2],v[3],(e||0)-N)).length,b=s.min,E=s.max,T=s.point),d&&e>N&&N+M>=e&&(w=T),k.push(E),x.push(b),N+=M,p=(u="Z"!==c?h.slice(-2):[m,g])[0],y=u[1];return d&&e>=N&&(w={x:p,y:y}),{length:N,point:w,min:{x:Math.min.apply(null,x.map(function(t){return t.x})),y:Math.min.apply(null,x.map(function(t){return t.y}))},max:{x:Math.max.apply(null,k.map(function(t){return t.x})),y:Math.max.apply(null,k.map(function(t){return t.y}))}}}function Oe(t){return function(t){var e=0,n=0,r=0;return ke(t).map(function(t){var i;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 r=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,i=t.slice(-2),e=i[0],n=i[1],r}).reduce(function(t,e){return t+e},0)}(t)>=0}function Re(t){return t.map(function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?Se(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),a=t.slice(6,8),o=me(n,r,e),s=me(r,i,e),u=me(i,a,e),l=me(o,s,e),c=me(s,u,e),h=me(l,c,e);return[["C"].concat(o,l,h),["C"].concat(c,u,a)]}(r):[t,t]:[t],l:i}})}function Le(t,e,n,r){if(void 0===r&&(r=0),r>50)return console.warn("Maximum recursion depth reached in equalizeSegments"),[t,e];var i=Re(t),a=Re(e),o=i.length,s=a.length,u=i.filter(function(t){return t.l}).length,l=a.filter(function(t){return t.l}).length,c=i.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,y=[i,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 y[0].length===y[1].length?y:Le(y[0],y[1],f,r+1)}function Ie(){return Ie="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=f(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(3>arguments.length?t:n):i.value}},Ie.apply(null,arguments)}function De(t,e,n,r){var i=Ie(f(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof i?function(t){return i.apply(n,t)}:i}
|
|
/*!
|
|
* @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 _e(t,e,n,r){var i=t-n,a=e-r;return Math.sqrt(i*i+a*a)}function Ge(t,e){var n=Math.min.apply(Math,h(t)),r=Math.min.apply(Math,h(e));return{x:n,y:r,width:Math.max.apply(Math,h(t))-n,height:Math.max.apply(Math,h(e))-r}}function Fe(t,e,n,r,i,a){return n*Math.cos(i)*Math.cos(a)-r*Math.sin(i)*Math.sin(a)+t}function Be(t,e,n,r,i,a){return n*Math.sin(i)*Math.cos(a)+r*Math.cos(i)*Math.sin(a)+e}function Ue(t,e,n,r,i,a,o){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),u=1/0,l=-1/0,c=[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=Fe(t,0,n,r,i,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,r,i),y=1/0,m=-1/0,g=[a,o],x=2*-Math.PI;2*Math.PI>=x;x+=Math.PI){var k=p+x;o>a?k>a&&o>k&&g.push(k):k>o&&a>k&&g.push(k)}for(var M=0;g.length>M;M++){var b=Be(0,e,n,r,i,g[M]);y>b&&(y=b),b>m&&(m=b)}return{x:u,y:y,width:l-u,height:m-y}}function Ye(t,e,n,r){return _e(t,e,n,r)}function Ve(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function ze(t,e,n,r,i){var a=1-i;return a*a*a*t+3*e*i*a*a+3*n*i*i*a+r*i*i*i}function je(t,e,n,r){var i,a,o,s=-3*t+9*e-9*n+3*r,u=6*t-12*e+6*n,l=3*e-3*t,c=[];if(jt(s,0))jt(u,0)||0>(i=-l/u)||i>1||c.push(i);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>(i=(-u+o)/(2*s))||i>1||c.push(i),0>a||a>1||c.push(a))}return c}function Xe(t,e,n,r,i,a,o,s){for(var u=[t,o],l=[e,s],c=je(t,n,i,o),h=je(e,r,a,s),f=0;c.length>f;f++)u.push(ze(t,n,i,o,c[f]));for(var d=0;h.length>d;d++)l.push(ze(e,r,a,s,h[d]));return Ge(u,l)}function We(t){return function(t){if(2>t.length)return 0;for(var e=0,n=0;t.length-1>n;n++){var r=t[n],i=t[n+1];e+=_e(r[0],r[1],i[0],i[1])}return e}(t)}function He(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function qe(t,e,n){var r=t+n-2*e;if(jt(r,0))return[.5];var i=(t-e)/r;return i>1||0>i?[]:[i]}function Ze(t,e,n,r,i,a){var o=qe(t,n,i)[0],s=qe(e,r,a)[0],u=[t,i],l=[e,a];return void 0!==o&&u.push(He(t,n,i,o)),void 0!==s&&l.push(He(e,r,a,s)),Ge(u,l)}function Ke(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 r=0,i=function(){};return{s:i,n:function(){return t.length>r?{done:!1,value:t[r++]}:{done:!0}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var 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 Qe(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;a.length>r;r++)-1===e.indexOf(n=a[r])&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;!function(t){t.exports=function(){function t(t,n,i,a,o){e(t,n,i||0,a||t.length-1,o||r)}function e(t,r,i,a,o){for(;a>i;){if(a-i>600){var s=a-i+1,u=r-i+1,l=Math.log(s),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(s-c)/s)*(0>u-s/2?-1:1);e(t,r,Math.max(i,Math.floor(r-u*c/s+h)),Math.min(a,Math.floor(r+(s-u)*c/s+h)),o)}var f=t[r],d=i,v=a;for(n(t,i,r),o(t[a],f)>0&&n(t,i,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[i],f)?n(t,i,v):n(t,++v,a),v>r||(i=v+1),r>v||(a=v-1)}}function n(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function r(t,e){return e>t?-1:t>e?1:0}var i=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(t,e,n){if(!n)return e.indexOf(t);for(var r=0;e.length>r;r++)if(n(t,e[r]))return r;return-1}function o(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,r,i){i||(i=m(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var a=e;n>a;a++){var o=t.children[a];u(i,t.leaf?r(o):o)}return i}function u(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function c(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function 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),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),a=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,a-r)}function p(t,e){return!(t.minX>e.minX||t.minY>e.minY||e.maxX>t.maxX||e.maxY>t.maxY)}function y(t,e){return!(e.minX>t.maxX||e.minY>t.maxY||t.minX>e.maxX||t.minY>e.maxY)}function m(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(e,n,r,i,a){for(var o=[n,r];o.length;)if((r=o.pop())-(n=o.pop())>i){var s=n+Math.ceil((r-n)/i/2)*i;t(e,s,n,r,a),o.push(n,s,s,r)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,n=[];if(!y(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var a=0;e.children.length>a;a++){var o=e.children[a],s=e.leaf?r(o):o;y(t,s)&&(e.leaf?n.push(o):p(t,s)?this._all(o,n):i.push(o))}e=i.pop()}return n},i.prototype.collides=function(t){var e=this.data;if(!y(t,e))return!1;for(var n=[];e;){for(var r=0;e.children.length>r;r++){var i=e.children[r],a=e.leaf?this.toBBox(i):i;if(y(t,a)){if(e.leaf||p(t,a))return!0;n.push(i)}}e=n.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(this._minEntries>t.length){for(var e=0;t.length>e;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(n.height>this.data.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=m([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,r,i,o=this.data,s=this.toBBox(t),u=[],l=[];o||u.length;){if(o||(o=u.pop(),r=u[u.length-1],n=l.pop(),i=!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}i||o.leaf||!p(o,s)?r?(n++,o=r.children[n],i=!1):o=null:(u.push(o),l.push(n),n=0,r=o,o=o.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},i.prototype._build=function(t,e,n,r){var i,a=n-e+1,s=this._maxEntries;if(s>=a)return o(i=m(t.slice(e,n+1)),this.toBBox),i;r||(s=Math.ceil(a/Math.pow(s,(r=Math.ceil(Math.log(a)/Math.log(s)))-1))),(i=m([])).leaf=!1,i.height=r;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)i.children.push(this._build(t,f,Math.min(f+u-1,h),r-1))}return o(i,this.toBBox),i},i.prototype._chooseSubtree=function(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){for(var i=1/0,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,i=i>l?l:i,o=u):c===a&&i>l&&(i=l,o=u)}e=o||e.children[0]}return e},i.prototype._insert=function(t,e,n){var r=n?t:this.toBBox(t),i=[],a=this._chooseSubtree(r,this.data,e,i);for(a.children.push(t),u(a,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)},i.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var a=this._chooseSplitIndex(n,i,r),s=m(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)},i.prototype._splitRoot=function(t,e){this.data=m([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,n){for(var r,i=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);i>c?(i=c,r=o,a=a>f?f:a):c===i&&a>f&&(a=f,r=o)}return r||n-e},i.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:l,i=t.leaf?this.compareMinY:c,a=this._allDistMargin(t,e,n,r);this._allDistMargin(t,e,n,i)>a&&t.children.sort(r)},i.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,a=s(t,0,e,i),o=s(t,n-e,n,i),l=f(a)+f(o),c=e;n-e>c;c++){var h=t.children[c];u(a,t.leaf?i(h):h),l+=f(a)}for(var d=n-e-1;d>=e;d--){var v=t.children[d];u(o,t.leaf?i(v):v),l+=f(o)}return l},i.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)u(e[r],t)},i.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},i}()}({exports:{}});var $e=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}({}),Je=function(t){return t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE",t}({}),tn=ut,en=ot,nn=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},rn=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},an=ct,on=mt,sn=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){en(this.center,t),en(this.halfExtents,e),on(this.min,this.center,this.halfExtents),tn(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,e){tn(this.center,e,t),an(this.center,this.center,.5),on(this.halfExtents,e,t),an(this.halfExtents,this.halfExtents,.5),en(this.min,t),en(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,r=n[0],i=n[1],a=n[2],o=this.halfExtents,s=o[0],u=o[1],l=o[2],c=r-s,h=r+s,f=i-u,d=i+u,v=a-l,p=a+l,y=e.center,m=y[0],g=y[1],x=y[2],k=e.halfExtents,M=k[0],b=k[1],E=k[2],T=m-M,w=m+M,N=g-b,S=g+b,P=x-E,A=x+E;c>T&&(c=T),w>h&&(h=w),f>N&&(f=N),S>d&&(d=S),v>P&&(v=P),A>p&&(p=A),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,r=this.halfExtents,i=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),y=Math.abs(s),m=Math.abs(u),g=Math.abs(l),x=Math.abs(c),k=Math.abs(h),M=Math.abs(f),b=Math.abs(d),E=Math.abs(v);n[0]=e[12]+o*i[0]+s*i[1]+u*i[2],n[1]=e[13]+l*i[0]+c*i[1]+h*i[2],n[2]=e[14]+f*i[0]+d*i[1]+v*i[2],r[0]=p*a[0]+y*a[1]+m*a[2],r[1]=g*a[0]+x*a[1]+k*a[2],r[2]=M*a[0]+b*a[1]+E*a[2],on(this.min,n,r),tn(this.max,n,r)}},{key:"intersects",value:function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return!(n[0]>r[0]||i[0]>e[0]||n[1]>r[1]||i[1]>e[1]||n[2]>r[2]||i[2]>e[2])}},{key:"intersection",value:function(e){if(!this.intersects(e))return null;var n=new t,r=nn([0,0,0],this.getMin(),e.getMin()),i=rn([0,0,0],this.getMax(),e.getMax());return n.setMinMax(r,i),n}},{key:"getNegativeFarPoint",value:function(t){return 273===t.pnVertexFlag?en([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?en([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]}}])}(),un=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/xt(this.normal);ct(this.normal,this.normal,t),this.distance*=t}},{key:"intersectsLine",value:function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),a=i>=0&&1>=i;return a&&n&&vt(n,t,e,i),a}}])}(),ln=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 un)},[{key:"extractFromVPMatrix",value:function(t){var e=g(t,16),n=e[0],r=e[1],i=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],y=e[14],m=e[15];st(this.planes[0].normal,a-n,l-o,d-c),this.planes[0].distance=m-v,st(this.planes[1].normal,a+n,l+o,d+c),this.planes[1].distance=m+v,st(this.planes[2].normal,a+r,l+s,d+h),this.planes[2].distance=m+p,st(this.planes[3].normal,a-r,l-s,d-h),this.planes[3].distance=m-p,st(this.planes[4].normal,a-i,l-u,d-f),this.planes[4].distance=m-y,st(this.planes[5].normal,a+i,l+u,d+f),this.planes[5].distance=m+y,this.planes.forEach(function(t){t.normalize(),t.updatePNVertexFlag()})}}])}(),cn=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}}])}(),hn=function(){function t(e,n,r,i){o(this,t),this.x=e,this.y=n,this.width=r,this.height=i,this.left=e,this.right=e+r,this.top=n,this.bottom=n+i}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 r=Mt(e.x,e.y,0,1),i=Mt(e.x+e.width,e.y,0,1),a=Mt(e.x,e.y+e.height,0,1),o=Mt(e.x+e.width,e.y+e.height,0,1),s=kt(),u=kt(),l=kt(),c=kt();bt(s,r,n),bt(u,i,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})}}])}(),fn="Method not implemented.";function dn(t){return void 0===t?0:t>360||-360>t?t%360:t}var vn=nt();function pn(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=3>=arguments.length||void 0===arguments[3]||arguments[3];return Array.isArray(t)&&3===t.length?r?rt(t):ot(vn,t):zt(t)?r?at(t,e,n):st(vn,t,e,n):r?at(t[0],t[1]||e,t[2]||n):st(vn,t[0],t[1]||e,t[2]||n)}var yn=Math.PI/180;function mn(t){return t*yn}var gn=180/Math.PI;function xn(t){return t*gn}var kn=Math.PI/2;function Mn(t,e){return 16===e.length?function(t,e){var n,r,i=g(j(nt(),e),3),a=i[0],o=i[1],s=i[2],u=Math.asin(-e[2]/a);return kn>u?u>-kn?(n=Math.atan2(e[6]/o,e[10]/s),r=Math.atan2(e[1]/a,e[0]/a)):(r=0,n=-Math.atan2(e[4]/o,e[5]/o)):(r=0,n=Math.atan2(e[4]/o,e[5]/o)),t[0]=n,t[1]=u,t[2]=r,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=r*r,s=i*i,u=a*a,l=n*n+o+s+u,c=n*a-r*i;return c>.499995*l?(t[0]=kn,t[1]=2*Math.atan2(r,n),t[2]=0):-.499995*l>c?(t[0]=-kn,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-a*r)),t[1]=Math.atan2(2*(n*a+r*i),1-2*(s+u)),t[2]=Math.atan2(2*(n*r+i*a),1-2*(o+s))),t}(t,e)}function bn(t,e,n,r,i){var a,o,s,u,l,c,h,f,d,v,p=Math.cos(t),y=Math.sin(t);return a=r*p,o=i*y,s=0,u=-r*y,l=i*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 En(t){var e=t[0],n=t[1],r=t[3],i=t[4],a=Math.sqrt(e*e+n*n),o=Math.sqrt(r*r+i*i);if(0>e*i-n*r&&(i>e?a=-a:o=-o),a){var s=1/a;e*=s,n*=s}if(o){var u=1/o;r*=u,i*=u}var l=xn(Math.atan2(n,e));return[t[6],t[7],a,o,l]}var Tn=T(),wn=T(),Nn=kt(),Sn=[nt(),nt(),nt()],Pn=nt();function An(t,e,n,r,i){t[0]=e[0]*r+n[0]*i,t[1]=e[1]*r+n[1]*i,t[2]=e[2]*r+n[2]*i}var Cn=function(t){return t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING",t}({}),On=function(t){return t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC",t}({}),Rn=function(t){return t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE",t}({}),Ln="updated",In=2e-4,Dn=function(){return u(function t(){o(this,t),this.clipSpaceNearZ=Je.NEGATIVE_ONE,this.eventEmitter=new k,this.matrix=T(),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=T(),this.projectionMatrixInverse=T(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=Cn.EXPLORING,this.trackingMode=On.DEFAULT,this.projectionMode=Rn.PERSPECTIVE,this.frustum=new ln,this.orthoMatrix=T()},[{key:"isOrtho",value:function(){return this.projectionMode===Rn.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===Cn.EXPLORING),this._getAngles(),this.type===Cn.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!==Cn.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 C(T(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"jitterProjectionMatrix",value:function(t,e){var n=_(T(),[t,e,0]);this.jitteredProjectionMatrix=R(T(),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===Rn.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===Rn.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,r,i,a){return this.aspect=t/e,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.projectionMode===Rn.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===Rn.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===Rn.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===Rn.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]}),r=n.x,i=n.y,a=this.roll;this.rotate(0,0,-a),this.setPosition(r,i),this.setFocalPoint(r,i),this.setZoom(t),this.rotate(0,0,a);var o=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),s=at(o.x-r,o.y-i,0),u=ft(s,this.right)/it(this.right),l=ft(s,this.up)/it(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,r){var i;this.projectionMode=Rn.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var a=this.near*Math.tan(mn(.5*this.fov))/this.zoom,o=2*a,s=this.aspect*o,u=-.5*s;if(null!==(i=this.view)&&void 0!==i&&i.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,r,i,a,o){var s,u,l=2*a,c=n-e,h=r-i,f=l/h,d=(n+e)/c,v=(r+i)/h,p=o-a,y=o*a;arguments.length>7&&void 0!==arguments[7]&&arguments[7]?(s=-o/p,u=-y/p):(s=-(o+a)/p,u=-2*y/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===Je.ZERO),C(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this}},{key:"setOrthographic",value:function(t,e,n,r,i,a){var o;this.projectionMode=Rn.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,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,y=(this.top-this.bottom)/this.view.fullHeight/this.zoom;f=(h+=p*this.view.offsetX)+p*this.view.width,v=(d-=y*this.view.offsetY)-y*this.view.height}return this.clipSpaceNearZ===Je.NEGATIVE_ONE?K(this.projectionMatrix,h,f,d,v,i,a):Q(this.projectionMatrix,h,f,d,v,i,a),C(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this}},{key:"setPosition",value:function(t){var e=pn(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],r=at(0,1,0);if(this.focalPoint=pn(t,e,n),this.trackingMode===On.CINEMATIC){var i=lt(nt(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var a=it(i),o=xn(Math.asin(e/a)),s=90+xn(Math.atan2(n,t)),u=T();D(u,u,mn(s)),I(u,u,mn(o)),r=pt(nt(),[0,1,0],u)}return C(this.matrix,$(T(),this.position,this.focalPoint,r)),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,In>this.distance&&(this.distance=In),this.dollyingStep=this.distance/100;var e=nt(),n=this.forward,r=this.focalPoint;return e[0]=(t=this.distance)*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this.triggerUpdate(),this}},{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=dn(t),this.computeMatrix(),this._getAxes(),this.type===Cn.ORBITING||this.type===Cn.EXPLORING?this._getPosition():this.type===Cn.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(t){return this.elevation=dn(t),this.computeMatrix(),this._getAxes(),this.type===Cn.ORBITING||this.type===Cn.EXPLORING?this._getPosition():this.type===Cn.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getElevation",value:function(){return this.elevation}},{key:"setRoll",value:function(t){return this.roll=dn(t),this.computeMatrix(),this._getAxes(),this.type===Cn.ORBITING||this.type===Cn.EXPLORING?this._getPosition():this.type===Cn.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=Tt(Et(),[0,0,1],mn(this.roll));P(this.matrix);var e=Tt(Et(),[1,0,0],mn((this.rotateWorld&&this.type!==Cn.TRACKING||this.type===Cn.TRACKING?1:-1)*this.elevation)),n=Tt(Et(),[0,1,0],mn((this.rotateWorld&&this.type!==Cn.TRACKING||this.type===Cn.TRACKING?1:-1)*this.azimuth)),r=wt(Et(),n,e);r=wt(Et(),r,t);var i=H(T(),r);this.type===Cn.ORBITING||this.type===Cn.EXPLORING?(L(this.matrix,this.matrix,this.focalPoint),R(this.matrix,this.matrix,i),L(this.matrix,this.matrix,[0,0,this.distance])):this.type===Cn.TRACKING&&(L(this.matrix,this.matrix,this.position),R(this.matrix,this.matrix,i))}},{key:"_setPosition",value:function(t,e,n){this.position=pn(t,e,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1,this._getOrthoMatrix()}},{key:"_getAxes",value:function(){ot(this.right,pn(bt(kt(),[1,0,0,0],this.matrix))),ot(this.up,pn(bt(kt(),[0,1,0,0],this.matrix))),ot(this.forward,pn(bt(kt(),[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],r=it(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===Cn.TRACKING||this.rotateWorld?(this.elevation=xn(Math.asin(e/r)),this.azimuth=xn(Math.atan2(-t,-n))):(this.elevation=-xn(Math.asin(e/r)),this.azimuth=-xn(Math.atan2(-t,-n)))}},{key:"_getPosition",value:function(){ot(this.position,pn(bt(kt(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){var t,e;!function(t,e,n){var r=e[0],i=e[1],a=e[2];t[0]=r*n[0]+i*n[3]+a*n[6],t[1]=r*n[1]+i*n[4]+a*n[7],t[2]=r*n[2]+i*n[5]+a*n[8]}(this.distanceVector,[0,0,-this.distance],(t=E(),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=it(this.distanceVector),this.dollyingStep=this.distance/100}},{key:"_getOrthoMatrix",value:function(){if(this.projectionMode===Rn.ORTHOGRAPHIC){var t=this.position,e=Tt(Et(),[0,0,1],-this.roll*Math.PI/180);W(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=R(T(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(Ln)}}},{key:"rotate",value:function(t,e,n){throw Error(fn)}},{key:"pan",value:function(t,e){throw Error(fn)}},{key:"dolly",value:function(t){throw Error(fn)}},{key:"createLandmark",value:function(t,e){throw Error(fn)}},{key:"gotoLandmark",value:function(t,e){throw Error(fn)}},{key:"cancelLandmarkAnimation",value:function(){throw Error(fn)}}])}(),_n=function(t){return t[t.Standard=0]="Standard",t}({}),Gn=function(t){return t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED",t}({}),Fn=nt(),Bn=T(),Un=Et();function Yn(t){if(t.localDirtyFlag){if(0!==t.localSkew[0]||0!==t.localSkew[1]){W(t.localTransform,t.localRotation,t.localPosition,at(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||(P(Bn),Bn[4]=Math.tan(t.localSkew[0]),Bn[1]=Math.tan(t.localSkew[1]),R(t.localTransform,t.localTransform,Bn));var e=W(Bn,Ct(Un,0,0,0,1),st(Fn,1,1,1),t.localScale,t.origin);R(t.localTransform,t.localTransform,e)}else{var n=t.localTransform,r=t.localPosition,i=t.localRotation,a=t.localScale,o=t.origin,s=0!==r[0]||0!==r[1]||0!==r[2];1!==i[3]||0!==i[0]||0!==i[1]||0!==i[2]||(1!==a[0]||1!==a[1]||1!==a[2])||(0!==o[0]||0!==o[1]||0!==o[2])?W(n,i,r,a,o):s?_(n,r):P(n)}t.localDirtyFlag=!1}}var Vn={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new hn(0,0,0,0)},zn=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 jn(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Xn(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Wn(){}var Hn=.7,qn=1/Hn,Zn="\\s*([+-]?\\d+)\\s*",Kn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Qn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",$n=/^#([0-9a-f]{3,8})$/,Jn=RegExp("^rgb\\(".concat(Zn,",").concat(Zn,",").concat(Zn,"\\)$")),tr=RegExp("^rgb\\(".concat(Qn,",").concat(Qn,",").concat(Qn,"\\)$")),er=RegExp("^rgba\\(".concat(Zn,",").concat(Zn,",").concat(Zn,",").concat(Kn,"\\)$")),nr=RegExp("^rgba\\(".concat(Qn,",").concat(Qn,",").concat(Qn,",").concat(Kn,"\\)$")),rr=RegExp("^hsl\\(".concat(Kn,",").concat(Qn,",").concat(Qn,"\\)$")),ir=RegExp("^hsla\\(".concat(Kn,",").concat(Qn,",").concat(Qn,",").concat(Kn,"\\)$")),ar={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 or(){return this.rgb().formatHex()}function sr(){return this.rgb().formatRgb()}function ur(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=$n.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?lr(e):3===n?new hr(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?cr(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?cr(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=Jn.exec(t))?new hr(e[1],e[2],e[3],1):(e=tr.exec(t))?new hr(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=er.exec(t))?cr(e[1],e[2],e[3],e[4]):(e=nr.exec(t))?cr(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=rr.exec(t))?mr(e[1],e[2]/100,e[3]/100,1):(e=ir.exec(t))?mr(e[1],e[2]/100,e[3]/100,e[4]):ar.hasOwnProperty(t)?lr(ar[t]):"transparent"===t?new hr(NaN,NaN,NaN,0):null}function lr(t){return new hr(t>>16&255,t>>8&255,255&t,1)}function cr(t,e,n,r){return r>0||(t=e=n=NaN),new hr(t,e,n,r)}function hr(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function fr(){return"#".concat(yr(this.r)).concat(yr(this.g)).concat(yr(this.b))}function dr(){var t=vr(this.opacity);return"".concat(1===t?"rgb(":"rgba(").concat(pr(this.r),", ").concat(pr(this.g),", ").concat(pr(this.b)).concat(1===t?")":", ".concat(t,")"))}function vr(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function pr(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function yr(t){return(16>(t=pr(t))?"0":"")+t.toString(16)}function mr(t,e,n,r){return r>0?n>0&&1>n?e>0||(t=NaN):t=e=NaN:t=e=n=NaN,new xr(t,e,n,r)}function gr(t){if(t instanceof xr)return new xr(t.h,t.s,t.l,t.opacity);if(t instanceof Wn||(t=ur(t)),!t)return new xr;if(t instanceof xr)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,u=(a+i)/2;return s?(o=e===a?(n-r)/s+6*(r>n):n===a?(r-e)/s+2:(e-n)/s+4,s/=.5>u?a+i:2-a-i,o*=60):s=u>0&&1>u?0:o,new xr(o,s,u,t.opacity)}function xr(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function kr(t){return 0>(t=(t||0)%360)?t+360:t}function Mr(t){return Math.max(0,Math.min(1,t||0))}function br(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 Er(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){for(var r=arguments.length,i=Array(r),a=0;r>a;a++)i[a]=arguments[a];var o=e?e.apply(this,i):i[0],s=n.cache;if(s.has(o))return s.get(o);var u=t.apply(this,i);return n.cache=s.set(o,u)||s,u};return n.cache=new(Er.Cache||Map),Er.cacheList.push(n.cache),n}jn(Wn,ur,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:or,formatHex:or,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return gr(this).formatHsl()},formatRgb:sr,toString:sr}),jn(hr,function(t,e,n,r){return 1===arguments.length?((i=t)instanceof Wn||(i=ur(i)),i?new hr((i=i.rgb()).r,i.g,i.b,i.opacity):new hr):new hr(t,e,n,null==r?1:r);var i},Xn(Wn,{brighter:function(t){return new hr(this.r*(t=null==t?qn:Math.pow(qn,t)),this.g*t,this.b*t,this.opacity)},darker:function(t){return new hr(this.r*(t=null==t?Hn:Math.pow(Hn,t)),this.g*t,this.b*t,this.opacity)},rgb:function(){return this},clamp:function(){return new hr(pr(this.r),pr(this.g),pr(this.b),vr(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:fr,formatHex:fr,formatHex8:function(){return"#".concat(yr(this.r)).concat(yr(this.g)).concat(yr(this.b)).concat(yr(255*(isNaN(this.opacity)?1:this.opacity)))},formatRgb:dr,toString:dr})),jn(xr,function(t,e,n,r){return 1===arguments.length?gr(t):new xr(t,e,n,null==r?1:r)},Xn(Wn,{brighter:function(t){return new xr(this.h,this.s,this.l*(t=null==t?qn:Math.pow(qn,t)),this.opacity)},darker:function(t){return new xr(this.h,this.s,this.l*(t=null==t?Hn:Math.pow(Hn,t)),this.opacity)},rgb:function(){var t=this.h%360+360*(0>this.h),e=this.l,n=e+(.5>e?e:1-e)*(isNaN(t)||isNaN(this.s)?0:this.s),r=2*e-n;return new hr(br(240>t?t+120:t-240,r,n),br(t,r,n),br(120>t?t+240:t-120,r,n),this.opacity)},clamp:function(){return new xr(kr(this.h),Mr(this.s),Mr(this.l),vr(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=vr(this.opacity);return"".concat(1===t?"hsl(":"hsla(").concat(kr(this.h),", ").concat(100*Mr(this.s),"%, ").concat(100*Mr(this.l),"%").concat(1===t?")":", ".concat(t,")"))}})),Er.Cache=Map,Er.cacheList=[],Er.clearCache=function(){Er.cacheList.forEach(function(t){return t.clear()})};var Tr=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}({}),wr=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}({}),Nr=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),Sr=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),Pr=[{name:"em",unit_type:Tr.kEms},{name:"px",unit_type:Tr.kPixels},{name:"deg",unit_type:Tr.kDegrees},{name:"rad",unit_type:Tr.kRadians},{name:"grad",unit_type:Tr.kGradians},{name:"ms",unit_type:Tr.kMilliseconds},{name:"s",unit_type:Tr.kSeconds},{name:"rem",unit_type:Tr.kRems},{name:"turn",unit_type:Tr.kTurns}],Ar=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}({}),Cr=function(t){return t?"number"===t?Tr.kNumber:"percent"===t||"%"===t?Tr.kPercentage:function(t){return Pr.find(function(e){return e.name===t}).unit_type}(t):Tr.kUnknown},Or=function(t){var e=1;switch(t){case Tr.kPixels:case Tr.kDegrees:case Tr.kSeconds:break;case Tr.kMilliseconds:e=.001;break;case Tr.kRadians:e=180/Math.PI;break;case Tr.kGradians:e=.9;break;case Tr.kTurns:e=360}return e},Rr=function(t){switch(t){case Tr.kNumber:case Tr.kInteger:return"";case Tr.kPercentage:return"%";case Tr.kEms:return"em";case Tr.kRems:return"rem";case Tr.kPixels:return"px";case Tr.kDegrees:return"deg";case Tr.kRadians:return"rad";case Tr.kGradians:return"grad";case Tr.kMilliseconds:return"ms";case Tr.kSeconds:return"s";case Tr.kTurns:return"turn"}return""},Lr=function(){return u(function t(){o(this,t)},[{key:"toString",value:function(){return this.buildCSSText(Nr.kNo,Sr.kNo,"")}},{key:"isNumericValue",value:function(){return this.getType()>=Ar.kUnitType&&this.getType()<=Ar.kClampType}}],[{key:"isAngle",value:function(t){return t===Tr.kDegrees||t===Tr.kRadians||t===Tr.kGradians||t===Tr.kTurns}},{key:"isLength",value:function(t){return t>=Tr.kEms&&Tr.kDegrees>t}},{key:"isRelativeUnit",value:function(t){return t===Tr.kPercentage||t===Tr.kEms||t===Tr.kRems}},{key:"isTime",value:function(t){return t===Tr.kSeconds||t===Tr.kMilliseconds}}])}(),Ir=function(t){function e(t){var n;return o(this,e),(n=p(this,e)).colorSpace=t,n}return m(e,t),u(e,[{key:"getType",value:function(){return Ar.kColorType}},{key:"to",value:function(t){return this}}])}(Lr),Dr=function(t){return t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient",t}({}),_r=function(t){function e(t,n){var r;return o(this,e),(r=p(this,e)).type=t,r.value=n,r}return m(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 Ar.kColorType}}])}(Lr),Gr=function(t){function e(t){var n;return o(this,e),(n=p(this,e)).value=t,n}return m(e,t),u(e,[{key:"clone",value:function(){return new e(this.value)}},{key:"getType",value:function(){return Ar.kKeywordType}},{key:"buildCSSText",value:function(t,e,n){return n+this.value}}])}(Lr),Fr=function(t){return function(t){switch(t){case wr.kUNumber:return Tr.kNumber;case wr.kULength:return Tr.kPixels;case wr.kUPercent:return Tr.kPercentage;case wr.kUTime:return Tr.kSeconds;case wr.kUAngle:return Tr.kDegrees;default:return Tr.kUnknown}}(function(t){switch(t){case Tr.kNumber:case Tr.kInteger:return wr.kUNumber;case Tr.kPercentage:return wr.kUPercent;case Tr.kPixels:return wr.kULength;case Tr.kMilliseconds:case Tr.kSeconds:return wr.kUTime;case Tr.kDegrees:case Tr.kRadians:case Tr.kGradians:case Tr.kTurns:return wr.kUAngle;default:return wr.kUOther}}(t))},Br=function(t){function e(t){var n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Tr.kNumber;return o(this,e),n=p(this,e),r="string"==typeof i?Cr(i):i,n.unit=r,n.value=t,n}return m(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 Ar.kUnitType}},{key:"convertTo",value:function(t){if(this.unit===t)return new e(this.value,this.unit);var n=Fr(this.unit);if(n!==Fr(t)||n===Tr.kUnknown)return null;var r=Or(this.unit)/Or(t);return new e(this.value*r,t)}},{key:"buildCSSText",value:function(t,e,n){var r;switch(this.unit){case Tr.kUnknown:break;case Tr.kInteger:r=Number(this.value).toFixed(0);break;case Tr.kNumber:case Tr.kPercentage:case Tr.kEms:case Tr.kRems:case Tr.kPixels:case Tr.kDegrees:case Tr.kRadians:case Tr.kGradians:case Tr.kMilliseconds:case Tr.kSeconds:case Tr.kTurns:var i=this.value,a=Rr(this.unit);if(-999999>i||i>999999){var o=Rr(this.unit);r=!Number.isFinite(i)||Number.isNaN(i)?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(Number.isFinite(t)?"NaN":t>0?"infinity":"-infinity")+e}(i,o):i+(o||"")}else r="".concat(i).concat(a)}return n+=r}}])}(Lr),Ur=new Br(0,"px");new Br(1,"px");var Yr=new Br(0,"deg"),Vr=function(t){function e(t,n,r){var i,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),(i=p(this,e,["rgb"])).r=t,i.g=n,i.b=r,i.alpha=a,i.isNone=s,i}return m(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,")")}}])}(Ir),zr=new Gr("unset"),jr={"":zr,unset:zr,initial:new Gr("initial"),inherit:new Gr("inherit")},Xr=new Vr(0,0,0,0,!0),Wr=new Vr(0,0,0,0),Hr=Er(function(t,e,n,r){return new Vr(t,e,n,r)},function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")}),qr=function(t){return new Br(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:Tr.kNumber)};function Zr(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 Br(50,"%");var Kr=function(){var t=/^(linear\-gradient)/i,e=/^(repeating\-linear\-gradient)/i,n=/^(radial\-gradient)/i,r=/^(repeating\-radial\-gradient)/i,i=/^(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]+)/,y=/^([a-zA-Z]+)/,m=/^rgb/i,g=/^rgba/i,x=/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,k="";function M(t){throw Error("".concat(k,": ").concat(t))}function b(){var t=R(E);return k.length>0&&M("Invalid input not EOF"),t}function E(){return T("linear-gradient",t,N)||T("repeating-linear-gradient",e,N)||T("radial-gradient",n,S)||T("repeating-radial-gradient",r,S)||T("conic-gradient",i,S)}function T(t,e,n){return w(e,function(e){var r=n();return r&&(F(v)||M("Missing comma before color stops")),{type:t,orientation:r,colorStops:R(L)}})}function w(t,e){var n=F(t);if(n){F(f)||M("Missing (");var r=e(n);return F(d)||M("Missing )"),r}}function N(){return G("directional",a,1)||G("angular",h,1)}function S(){var t,e,n=P();return n&&((t=[]).push(n),e=k,F(v)&&((n=P())?t.push(n):k=e)),t}function P(){var t=function(){var t=G("shape",/^(circle)/i,0);t&&(t.style=_()||A());return t}()||function(){var t=G("shape",/^(ellipse)/i,0);t&&(t.style=D()||A());return t}();if(t)t.at=C();else{var e=A();if(e){t=e;var n=C();n&&(t.at=n)}else{var r=O();r&&(t={type:"default-radial",at:r})}}return t}function A(){return G("extent-keyword",o,1)}function C(){if(G("position",/^at/,0)){var t=O();return t||M("Missing positioning value"),t}}function O(){var t={x:D(),y:D()};if(t.x||t.y)return{type:"position",value:t}}function R(t){var e=t(),n=[];if(e)for(n.push(e);F(v);)(e=t())?n.push(e):M("One extra comma");return n}function L(){var t=G("hex",p,1)||w(g,function(){return{type:"rgba",value:R(I)}})||w(m,function(){return{type:"rgb",value:R(I)}})||G("literal",y,0);return t||M("Expected color definition"),t.length=D(),t}function I(){return F(x)[1]}function D(){return G("%",l,1)||G("position-keyword",s,1)||_()}function _(){return G("px",u,1)||G("em",c,1)}function G(t,e,n){var r=F(e);if(r)return{type:t,value:r[n]}}function F(t){var e=/^[\n\r\t\s]+/.exec(k);e&&B(e[0].length);var n=t.exec(k);return n&&B(n[0].length),n}function B(t){k=k.substring(t)}return function(t){return k=t,b()}}(),Qr=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,$r=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Jr=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,ti=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var ei={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},ni=Er(function(t){return qr("angular"===t.type?Number(t.value):ei[t.value]||0,"deg")}),ri=Er(function(t){var e=50,n=50,r="%",i="%";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)||(r=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)||(i=null==s?void 0:s.type,n=Number(s.value))}return{cx:qr(e,r),cy:qr(n,i)}}),ii=Er(function(t){if(t.indexOf("linear")>-1||t.indexOf("radial")>-1)return Kr(t).map(function(t){var e=t.type,n=t.orientation,r=t.colorStops;!function(t){var e,n,r=t.length;t[r-1].length=null!==(e=t[r-1].length)&&void 0!==e?e:{type:"%",value:"100"},r>1&&(t[0].length=null!==(n=t[0].length)&&void 0!==n?n:{type:"%",value:"0"});for(var i=0,a=Number(t[0].length.value),o=1;r>o;o++){var s,u=null===(s=t[o].length)||void 0===s?void 0:s.value;if(!Dt(u)&&!Dt(a)){for(var l=1;o-i>l;l++)t[i+l].length={type:"%",value:"".concat(a+(Number(u)-a)*l/(o-i))};i=o,a=Number(u)}}}(r);var i,a=r.map(function(t){return{offset:qr(Number(t.length.value),"%"),color:Zr(t)}});if("linear-gradient"===e)return new _r(Dr.LinearGradient,{angle:n?ni(n):Yr,steps:a});if("radial-gradient"===e&&(n||(n=[{type:"shape",value:"circle"}]),"shape"===n[0].type&&"circle"===n[0].value)){var o,s=ri(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?(jr[i=f]||(jr[i]=new Gr(i)),o=jr[i]):o=qr(f,h)}return new _r(Dr.RadialGradient,{cx:u,cy:l,size:o,steps:a})}});var e=t[0];if("("===t[1]||"("===t[2])if("l"===e){var n=Qr.exec(t);if(n){var r,i=(null===(r=n[2].match(ti))||void 0===r?void 0:r.map(function(t){return t.split(":")}))||[];return[new _r(Dr.LinearGradient,{angle:qr(parseFloat(n[1]),"deg"),steps:i.map(function(t){var e=g(t,2),n=e[1];return{offset:qr(100*Number(e[0]),"%"),color:n}})})]}}else if("r"===e){var a=function(t){var e=$r.exec(t);if(e){var n,r=(null===(n=e[4].match(ti))||void 0===n?void 0:n.map(function(t){return t.split(":")}))||[];return{cx:qr(50,"%"),cy:qr(50,"%"),steps:r.map(function(t){var e=g(t,2),n=e[1];return{offset:qr(100*Number(e[0]),"%"),color:n}})}}return null}(t);if(a){if(!Yt(a))return[new _r(Dr.RadialGradient,a)];t=a}}else if("p"===e)return function(t){var e=Jr.exec(t);if(e){var n=e[1],r=e[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;default:n="no-repeat"}return{image:r,repetition:n}}return null}(t)});function ai(t){return t&&!Dt(t.r)&&!Dt(t.g)&&!Dt(t.b)}var oi=Er(function(t){if((e=t)&&e.image)return a({repetition:"repeat"},t);var e;if(Dt(t)&&(t=""),"transparent"===t)return Wr;if("currentColor"===t)t="black";else if("none"===t)return Xr;var n=ii(t);if(n)return n;var r=ur(t),i=[0,0,0,0];return null!==r&&(i[0]=r.r||0,i[1]=r.g||0,i[2]=r.b||0,i[3]=r.opacity),Hr.apply(void 0,i)});function si(t,e){if(ai(t)&&ai(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(Vt(e[n],0,255));return e[3]=Vt(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function ui(t,e){if(Dt(e))return qr(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return qr(Number(e),"px");if("deg".search(t)>=0)return qr(Number(e),"deg")}var n=[];e=e.replace(t,function(t){return n.push(t),"U".concat(t)});var r="U(".concat(t.source,")");return n.map(function(t){return qr(Number(e.replace(RegExp("U".concat(t),"g"),"").replace(RegExp(r,"g"),"*0")),t)})[0]}var li=function(t){return ui(/px/g,t)},ci=Er(li);Er(function(t){return ui(RegExp("%","g"),t)});var hi=function(t){return zt(t)||isFinite(Number(t))?qr(Number(t)||0,"px"):ui(RegExp("px|%|em|rem","g"),t)},fi=Er(hi),di=function(t){return ui(/deg|rad|grad|turn/g,t)},vi=Er(di);function pi(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a="",o=t.value||0,s=e.value||0,u=Fr(t.unit),l=t.convertTo(u),c=e.convertTo(u);return l&&c?(o=l.value,s=c.value,a=Rr(t.unit)):(Br.isLength(t.unit)||Br.isLength(e.unit))&&(o=gi(t,i,n),s=gi(e,i,n),a="px"),[o,s,function(t){return r&&(t=Math.max(t,0)),t+a}]}function yi(t){var e=0;return t.unit===Tr.kDegrees?e=t.value:t.unit===Tr.kRadians?e=xn(Number(t.value)):t.unit===Tr.kTurns?e=360*Number(t.value):t.value&&(e=t.value),e}function mi(t,e){var n;return Array.isArray(t)?n=t.map(function(t){return Number(t)}):Yt(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 gi(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(t.unit===Tr.kPixels)return Number(t.value);if(t.unit===Tr.kPercentage&&n){var i=n.nodeName===$e.GROUP?n.getLocalBounds():n.getGeometryBounds();return(r?i.min[e]:0)+t.value/100*i.halfExtents[e]*2}return 0}var xi=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function ki(t){return""+t}var Mi=function(t){return qr("number"==typeof t?t:/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Number(t):0)},bi=Er(Mi);function Ei(t,e){return[t,e,ki]}function Ti(t,e){return function(n,r){return[n,r,function(n){return ki(Vt(n,t,e))}]}}function wi(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function Ni(t){var e;return 0===t.parsedStyle.d.totalLength&&(t.parsedStyle.d.totalLength=Ce(t.parsedStyle.d.absolutePath,void 0,qt(qt({},e),{bbox:!1,length:!0})).length),t.parsedStyle.d.totalLength}function Si(t,e){return t[0]===e[0]&&t[1]===e[1]}function Pi(t,e){var n=t.prePoint,r=t.currentPoint,i=t.nextPoint,a=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),o=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.acos((a+o-(Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[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(i[1]-r[1],i[0]-r[0])),l=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));return l=l>Math.PI/2?Math.PI-l:l,{xExtra:Math.cos(s/2-(u=u>Math.PI/2?Math.PI-u:u))*(e/2*(1/Math.sin(s/2)))-e/2||0,yExtra:Math.cos(l-s/2)*(e/2*(1/Math.sin(s/2)))-e/2||0}}function Ai(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}Er(function(t){return Yt(t)?t.split(" ").map(bi):t.map(bi)});var Ci=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))))},Oi=function(t,e,n,r,i,a,o,s){e=Math.abs(e),n=Math.abs(n);var u=mn(r=Xt(r,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=(i!==a?1:-1)*Math.sqrt(d=0>d?0:d),p=v*(e*h.y/n),y=v*(-n*h.x/e),m={x:Math.cos(u)*p-Math.sin(u)*y+(t.x+o.x)/2,y:Math.sin(u)*p+Math.cos(u)*y+(t.y+o.y)/2},g={x:(h.x-p)/e,y:(h.y-y)/n},x=Ci({x:1,y:0},g),k=Ci(g,{x:(-h.x-p)/e,y:(-h.y-y)/n});!a&&k>0?k-=2*Math.PI:a&&0>k&&(k+=2*Math.PI);var M=x+(k%=2*Math.PI)*s,b=e*Math.cos(M),E=n*Math.sin(M);return{x:Math.cos(u)*b-Math.sin(u)*E+m.x,y:Math.sin(u)*b+Math.cos(u)*E+m.y,ellipticalArcStartAngle:x,ellipticalArcEndAngle:x+k,ellipticalArcAngle:M,ellipticalArcCenter:m,resultantRx:e,resultantRy:n}};function Ri(t,e){var n=2>=arguments.length||void 0===arguments[2]||arguments[2],r=t.arcParams,i=r.rx,a=void 0===i?0:i,o=r.ry,s=void 0===o?0:o,u=r.xRotation,l=r.arcFlag,c=r.sweepFlag,h=Oi({x:t.prePoint[0],y:t.prePoint[1]},a,s,u,!!l,!!c,{x:t.currentPoint[0],y:t.currentPoint[1]},e),f=Oi({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 Li(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Ii(t,e){return Li(t)*Li(e)?(t[0]*e[0]+t[1]*e[1])/(Li(t)*Li(e)):1}function Di(t,e){return(t[1]*e[0]>t[0]*e[1]?-1:1)*Math.acos(Ii(t,e))}function _i(t,e){var n=e[1],r=e[2],i=Xt(mn(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(i)*(s-l)/2+Math.sin(i)*(u-c)/2,f=-1*Math.sin(i)*(s-l)/2+Math.cos(i)*(u-c)/2,d=h*h/(n*n)+f*f/(r*r);d>1&&(n*=Math.sqrt(d),r*=Math.sqrt(d));var v=n*n*(f*f)+r*r*(h*h),p=v?Math.sqrt((n*n*(r*r)-v)/v):1;a===o&&(p*=-1),isNaN(p)&&(p=0);var y=r?p*n*f/r:0,m=n?p*-r*h/n:0,g=(s+l)/2+Math.cos(i)*y-Math.sin(i)*m,x=(u+c)/2+Math.sin(i)*y+Math.cos(i)*m,k=[(h-y)/n,(f-m)/r],M=[(-1*h-y)/n,(-1*f-m)/r],b=Di([1,0],k),E=Di(k,M);return Ii(k,M)>-1||(E=Math.PI),1>Ii(k,M)||(E=0),0===o&&E>0&&(E-=2*Math.PI),1===o&&0>E&&(E+=2*Math.PI),{cx:g,cy:x,rx:Si(t,[l,c])?0:n,ry:Si(t,[l,c])?0:r,startAngle:b,endAngle:b+E,xRotation:i,arcFlag:a,sweepFlag:o}}var Gi=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],r=t[e];if("M"===r[0]&&n){var i=n[0],a=void 0;"L"===i||"M"===i?a=[n[1],n[2]]:"C"!==i&&"A"!==i&&"Q"!==i||(a=[n[n.length-2],n[n.length-1]]),a&&Si([r[1],r[2]],a)&&(t.splice(e,1),e--)}}}(e);var n=function(t){for(var e=!1,n=t.length,r=0;n>r;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e}(e),r=function(t){for(var e=[],n=[],r=[],i=0;t.length>i;i++){var a=t[i],o=a[0];"M"===o?(r.length&&(n.push(r),r=[]),r.push([a[1],a[2]])):"Z"===o?r.length&&(e.push(r),r=[]):r.push([a[1],a[2]])}return r.length>0&&n.push(r),{polygons:e,polylines:n}}(e),i=r.polygons,a=r.polylines,o=function(t){for(var e=[],n=null,r=null,i=null,a=0,o=t.length,s=0;o>s;s++){var u=t[s];r=t[s+1];var l=u[0],c={command:l,prePoint:n,params:u,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(l){case"M":i=[u[1],u[2]],a=s;break;case"A":var h=_i(n,u);c.arcParams=h}if("Z"===l)n=i,r=t[a+1];else{var f=u.length;n=[u[f-2],u[f-1]]}r&&"Z"===r[0]&&(r=t[a],e[a]&&(e[a].prePoint=n)),c.currentPoint=n,e[a]&&Si(n,e[a].currentPoint)&&(e[a].prePoint=c.prePoint),c.nextPoint=r?[r[r.length-2],r[r.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],y=Ai(p.currentPoint,d);"Q"===p.command?(c.command="Q",c.startTangent=[d[0]-y[0],d[1]-y[1]],c.endTangent=[n[0]-y[0],n[1]-y[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 m=[u[1],u[2]],g=[u[3],u[4]];c.startTangent=[d[0]-m[0],d[1]-m[1]],c.endTangent=[n[0]-g[0],n[1]-g[1]],0===c.startTangent[0]&&0===c.startTangent[1]&&(c.startTangent=[m[0]-g[0],m[1]-g[1]]),0===c.endTangent[0]&&0===c.endTangent[1]&&(c.endTangent=[g[0]-m[0],g[1]-m[1]])}else if("S"===l){var x=e[s-1],k=Ai(x.currentPoint,d),M=[u[1],u[2]];"C"===x.command?(c.command="C",c.startTangent=[d[0]-k[0],d[1]-k[1]],c.endTangent=[n[0]-M[0],n[1]-M[1]]):(c.command="SQ",c.startTangent=[d[0]-M[0],d[1]-M[1]],c.endTangent=[n[0]-M[0],n[1]-M[1]])}else if("A"===l){var b=Ri(c,0),E=b.x,T=b.y,w=Ri(c,1,!1),N=w.x,S=w.y;c.startTangent=[E,T],c.endTangent=[N,S]}e.push(c)}return e}(e),s=function(t,e){for(var n=[],r=[],i=[],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=Ue(h.cx,h.cy,h.rx,h.ry,h.xRotation,h.startAngle,h.endAngle);break;default:n.push(s[0]),r.push(s[1])}c&&(o.box=c,n.push(c.x,c.x+c.width),r.push(c.y,c.y+c.height)),e&&("L"===o.command||"M"===o.command)&&o.prePoint&&o.nextPoint&&i.push(o)}n=n.filter(function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}),r=r.filter(function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0});var f=Ut(n),d=Ut(r),v=Bt(n),p=Bt(r);if(0===i.length)return{x:f,y:d,width:v-f,height:p-d};for(var y=0;i.length>y;y++){var m=i[y],g=m.currentPoint;g[0]===f?f-=Pi(m,e).xExtra:g[0]===v&&(v+=Pi(m,e).xExtra),g[1]===d?d-=Pi(m,e).yExtra:g[1]===p&&(p+=Pi(m,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:i,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}}},Fi=Er(Gi);function Bi(t){return Yt(t)?Fi(t):Gi(t)}function Ui(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=ke(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=ke(e.absolutePath,!1),e.curve=i);var a=[r,i];r.length!==i.length&&(a=Le(r,i));var o,s,u,l,c,h,f,d,v=Oe(a[0])!==Oe(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(r,i){return t.map(function(r,a){var o=i+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+=Me(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 Yi(t,e){return[t.points,e.points,function(t){return t}]}var Vi=null,zi=/\s*(\w+)\(([^)]*)\)/g;function ji(t){return function(e){var n=0;return t.map(function(t){return t===Vi?e[n++]:t})}}function Xi(t){return t}var Wi={matrix:["NNNNNN",[Vi,Vi,0,0,Vi,Vi,0,0,0,0,1,0,Vi,Vi,0,1],Xi],matrix3d:["NNNNNNNNNNNNNNNN",Xi],rotate:["A"],rotateX:["A"],rotateY:["A"],rotateZ:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",ji([Vi,Vi,new Br(1)]),Xi],scaleX:["N",ji([Vi,new Br(1),new Br(1)]),ji([Vi,new Br(1)])],scaleY:["N",ji([new Br(1),Vi,new Br(1)]),ji([new Br(1),Vi])],scaleZ:["N",ji([new Br(1),new Br(1),Vi])],scale3d:["NNN",Xi],skew:["Aa",null,Xi],skewX:["A",null,ji([Vi,Yr])],skewY:["A",null,ji([Yr,Vi])],translate:["Tt",ji([Vi,Vi,Ur]),Xi],translateX:["T",ji([Vi,Ur,Ur]),ji([Vi,Ur])],translateY:["T",ji([Ur,Vi,Ur]),ji([Ur,Vi])],translateZ:["L",ji([Ur,Ur,Vi])],translate3d:["TTL",Xi]};function Hi(t){for(var e=[],n=t.length,r=0;n>r;r++){var i=t[r],a=i[0],o=i.slice(1);if("translate"===a||"skew"===a?1===o.length&&o.push(0):"scale"===a&&1===o.length&&o.push(o[0]),!Wi[a])return[];var s=o.map(function(t){return qr(t)});e.push({t:a,d:s})}return e}function qi(t){if(Array.isArray(t))return Hi(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(zi.lastIndex=0;e=zi.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],a=Wi[i];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()?Yr:di(t)},N:Mi,T:hi,L:li}[h.toUpperCase()](c):{a:Yr,n:u[0],t:Ur}[h]))return[];u.push(f)}if(n.push({t:i,d:u}),zi.lastIndex===t.length)return n}return[]}function Zi(t){var e,n,r,i;switch(t.t){case"rotateX":return i=mn(yi(t.d[0])),[1,0,0,0,0,Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1];case"rotateY":return i=mn(yi(t.d[0])),[Math.cos(i),0,-Math.sin(i),0,0,1,0,0,Math.sin(i),0,Math.cos(i),0,0,0,0,1];case"rotate":case"rotateZ":return i=mn(yi(t.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":e=t.d[0].value,n=t.d[1].value,r=t.d[2].value,i=mn(yi(t.d[3]));var a=e*e+n*n+r*r;if(0===a)e=1,n=0,r=0;else if(1!==a){var o=Math.sqrt(a);e/=o,n/=o,r/=o}var s=Math.sin(i/2),u=s*Math.cos(i/2),l=s*s;return[1-2*(n*n+r*r)*l,2*(e*n*l+r*u),2*(e*r*l-n*u),0,2*(e*n*l-r*u),1-2*(e*e+r*r)*l,2*(n*r*l+e*u),0,2*(e*r*l+n*u),2*(n*r*l-e*u),1-2*(e*e+n*n)*l,0,0,0,0,1];case"scale":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scaleX":return[t.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaleY":return[1,0,0,0,0,t.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scaleZ":return[1,0,0,0,0,1,0,0,0,0,t.d[0].value,0,0,0,0,1];case"scale3d":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,t.d[2].value,0,0,0,0,1];case"skew":var c=mn(yi(t.d[0])),h=mn(yi(t.d[1]));return[1,Math.tan(h),0,0,Math.tan(c),1,0,0,0,0,1,0,0,0,0,1];case"skewX":return i=mn(yi(t.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewY":return i=mn(yi(t.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return[1,0,0,0,0,1,0,0,0,0,1,0,e=gi(t.d[0],0,null)||0,n=gi(t.d[1],0,null)||0,0,1];case"translateX":return[1,0,0,0,0,1,0,0,0,0,1,0,e=gi(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=gi(t.d[0],0,null)||0,0,1];case"translateZ":return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,r=gi(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=gi(t.d[0],0,null)||0,n=gi(t.d[1],0,null)||0,r=gi(t.d[2],0,null)||0,1];case"perspective":var f=gi(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 Ki(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 Qi(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],a=[0,0,0,1];return function(t,e,n,r,i,a){if(!function(t,e){var n=e[15];if(0===n)return!1;for(var r=1/n,i=0;16>i;i++)t[i]=e[i]*r;return!0}(Tn,t))return!1;if(N(wn,Tn),wn[3]=0,wn[7]=0,wn[11]=0,wn[15]=1,1e-8>Math.abs(O(wn)))return!1;var o,s,u=Tn[3],l=Tn[7],c=Tn[11],h=Tn[12],f=Tn[13],d=Tn[14],v=Tn[15];if(0!==u||0!==l||0!==c){if(Nn[0]=u,Nn[1]=l,Nn[2]=c,Nn[3]=v,!C(wn,wn))return!1;A(wn,wn),bt(i,Nn,wn)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=h,e[1]=f,e[2]=d,(o=Sn)[0][0]=(s=Tn)[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]=it(Sn[0]),ht(Sn[0],Sn[0]),r[0]=ft(Sn[0],Sn[1]),An(Sn[1],Sn[1],Sn[0],1,-r[0]),n[1]=it(Sn[1]),ht(Sn[1],Sn[1]),r[0]/=n[1],r[1]=ft(Sn[0],Sn[2]),An(Sn[2],Sn[2],Sn[0],1,-r[1]),r[2]=ft(Sn[1],Sn[2]),An(Sn[2],Sn[2],Sn[1],1,-r[2]),n[2]=it(Sn[2]),ht(Sn[2],Sn[2]),r[1]/=n[2],r[2]/=n[2],dt(Pn,Sn[1],Sn[2]),0>ft(Sn[0],Pn))for(var p=0;3>p;p++)n[p]*=-1,Sn[p][0]*=-1,Sn[p][1]*=-1,Sn[p][2]*=-1;a[0]=.5*Math.sqrt(Math.max(1+Sn[0][0]-Sn[1][1]-Sn[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-Sn[0][0]+Sn[1][1]-Sn[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-Sn[0][0]-Sn[1][1]+Sn[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+Sn[0][0]+Sn[1][1]+Sn[2][2],0)),Sn[2][1]>Sn[1][2]&&(a[0]=-a[0]),Sn[0][2]>Sn[2][0]&&(a[1]=-a[1]),Sn[1][0]>Sn[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(Zi).reduce(Ki)}(t),e,n,r,i,a),[[e,n,r,a,i]]}var $i=function(){function t(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],r=0;4>r;r++)for(var i=0;4>i;i++)for(var a=0;4>a;a++)n[r][i]+=e[r][a]*t[a][i];return n}return function(e,n,r,i,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=i[0],h=i[1],f=i[2],d=i[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,y=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];r[2]&&(y[2][1]=r[2],o=t(o,y)),r[1]&&(y[2][1]=0,y[2][0]=r[0],o=t(o,y)),r[0]&&(y[2][0]=0,y[1][0]=r[0],o=t(o,y));for(var m=0;3>m;m++)for(var g=0;3>g;g++)o[m][g]*=n[m];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 Ji(t){return t.toFixed(6).replace(".000000","")}function ta(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=Qi(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=Qi(e)),null===n[0]||null===r[0]?[[!1],[!0],function(n){return n?e[0].d:t[0].d}]:(n[0].push(0),r[0].push(1),[n,r,function(t){var e=function(t,e,n){var r=function(t,e){for(var n=0,r=0;t.length>r;r++)n+=t[r]*e[r];return n}(t,e);r=Vt(r,-1,1);var i=[];if(1===r)i=t;else for(var a=Math.acos(r),o=1*Math.sin(n*a)/Math.sqrt(1-r*r),s=0;4>s;s++)i.push(t[s]*(Math.cos(n*a)-r*o)+e[s]*o);return i}(n[0][3],r[0][3],t[5]);return $i(t[0],t[1],t[2],e,t[4]).map(Ji).join(",")}])}function ea(t){return t.replace(/[XY]/,"")}function na(t){return t.replace(/(X|Y|Z|3d)?$/,"3d")}var ra=function(t,e){return"perspective"===t&&"perspective"===e||("matrix"===t||"matrix3d"===t)&&("matrix"===e||"matrix3d"===e)};function ia(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(){var n=t[a],r=n.t,i=n.d,o="scale"===r.substring(0,5)?1:0;e.push({t:r,d:i.map(function(t){return"number"==typeof t?qr(o):qr(o,t.unit)})})},a=0;t.length>a;a++)i()}var o=[],s=[],u=[];if(t.length!==e.length){var l=ta(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=Wi[h],y=Wi[f],m=void 0;if(ra(h,f)){var g=ta([t[c]],[e[c]]);o.push(g[0]),s.push(g[1]),u.push(["matrix",[g[2]]])}else{if(h===f)m=h;else if(p[2]&&y[2]&&ea(h)===ea(f))m=ea(h),d=p[2](d),v=y[2](v);else{if(!p[1]||!y[1]||na(h)!==na(f)){var x=ta(t,e);o=[x[0]],s=[x[1]],u=[["matrix",[x[2]]]];break}m=na(h),d=p[1](d),v=y[1](v)}for(var k=[],M=[],b=[],E=0;d.length>E;E++){var T=pi(d[E],v[E],n,!1,E);k[E]=T[0],M[E]=T[1],b.push(T[2])}o.push(k),s.push(M),u.push([m,b])}}if(r){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 aa=Er(function(t){if(Yt(t)){if("text-anchor"===t)return[qr(0,"px"),qr(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:[fi(oa(e[0])),fi(oa(e[1]))]}return[qr(t[0]||0,"px"),qr(t[1]||0,"px")]});function oa(t){return"center"===t?"50%":"left"===t||"top"===t?"0%":"right"===t||"bottom"===t?"100%":t}var sa=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:zn.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:zn.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:zn.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:zn.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:zn.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:zn.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:zn.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:zn.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:zn.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:zn.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:zn.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:zn.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:zn.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:zn.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:zn.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:zn.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:zn.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:zn.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:zn.FILTER},{n:"clipPath",syntax:zn.DEFINED_PATH},{n:"textPath",syntax:zn.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:zn.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:zn.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:zn.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:zn.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:zn.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:zn.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:zn.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:zn.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:zn.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:zn.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:zn.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:zn.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:zn.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:zn.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:zn.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:zn.COORDINATE},{n:"y1",int:!0,l:!0,syntax:zn.COORDINATE},{n:"z1",int:!0,l:!0,syntax:zn.COORDINATE},{n:"x2",int:!0,l:!0,syntax:zn.COORDINATE},{n:"y2",int:!0,l:!0,syntax:zn.COORDINATE},{n:"z2",int:!0,l:!0,syntax:zn.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:zn.PATH,p:50},{n:"points",int:!0,l:!0,syntax:zn.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:zn.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:zn.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:zn.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:zn.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:zn.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:zn.NUMBER,d:function(t){return t===$e.PATH||t===$e.POLYGON||t===$e.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:zn.MARKER},{n:"markerEnd",syntax:zn.MARKER},{n:"markerMid",syntax:zn.MARKER},{n:"markerStartOffset",syntax:zn.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:zn.LENGTH,l:!0,int:!0,d:"0"}],ua=new Set(sa.filter(function(t){return!!t.l}).map(function(t){return t.n})),la=function(){return u(function t(e){var n=this;o(this,t),this.runtime=e,sa.forEach(function(t){n.registerMetadata(t)})},[{key:"registerMetadata",value:function(t){[t.n].concat(h(t.a||[])).forEach(function(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 r=t.parsedStyle.clipPath,i=t.parsedStyle.offsetPath;!function(t,e){var n=ca(t);for(var r in e)n.has(r)&&(t.parsedStyle[r]=e[r])}(t,e);var o=!!n.forceUpdateGeometry;if(!o)for(var s in e)if(ua.has(s)){o=!0;break}var u,l=ca(t);l.has("fill")&&e.fill&&(t.parsedStyle.fill=oi(e.fill)),l.has("stroke")&&e.stroke&&(t.parsedStyle.stroke=oi(e.stroke)),l.has("shadowColor")&&e.shadowColor&&(t.parsedStyle.shadowColor=oi(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,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];if(i=e.index+e[0].length,xi.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map(function(t){return ui(/deg|rad|grad|turn|px|%/g,t)||oi(t)})}),n.lastIndex===t.length)return r}return[]}(e.filter)),l.has("radius")&&!Dt(e.radius)&&(t.parsedStyle.radius=mi(e.radius,4)),l.has("lineDash")&&!Dt(e.lineDash)&&(t.parsedStyle.lineDash=mi(e.lineDash,"even")),l.has("points")&&e.points&&(t.parsedStyle.points={points:Yt(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({},Vn)),l.has("d")&&e.d&&(t.parsedStyle.d=Bi(e.d)),l.has("textTransform")&&e.textTransform&&this.runtime.CSSPropertySyntaxFactory[zn.TEXT_TRANSFORM].calculator(null,null,{value:e.textTransform},t,null),l.has("clipPath")&&!Ht(e.clipPath)&&this.runtime.CSSPropertySyntaxFactory[zn.DEFINED_PATH].calculator("clipPath",r,e.clipPath,t,this.runtime),l.has("offsetPath")&&e.offsetPath&&this.runtime.CSSPropertySyntaxFactory[zn.DEFINED_PATH].calculator("offsetPath",i,e.offsetPath,t,this.runtime),l.has("transform")&&e.transform&&(t.parsedStyle.transform=function(t){if(Array.isArray(t))return Hi(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(zi.lastIndex=0;e=zi.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],a=Wi[i];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()?Yr:vi(t)},N:bi,T:fi,L:ci}[h.toUpperCase()](c):{a:Yr,n:u[0],t:Ur}[h]))return[];u.push(f)}if(n.push({t:i,d:u}),zi.lastIndex===t.length)return n}return[]}(e.transform)),l.has("transformOrigin")&&e.transformOrigin&&(t.parsedStyle.transformOrigin=aa(e.transformOrigin)),l.has("markerStart")&&e.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[zn.MARKER].calculator(null,e.markerStart,e.markerStart,null,null)),l.has("markerEnd")&&e.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[zn.MARKER].calculator(null,e.markerEnd,e.markerEnd,null,null)),l.has("markerMid")&&e.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[zn.MARKER].calculator("",e.markerMid,e.markerMid,null,null)),l.has("zIndex")&&!Dt(e.zIndex)&&this.runtime.CSSPropertySyntaxFactory[zn.Z_INDEX].postProcessor(t),l.has("offsetDistance")&&!Dt(e.offsetDistance)&&this.runtime.CSSPropertySyntaxFactory[zn.OFFSET_DISTANCE].postProcessor(t),l.has("transform")&&e.transform&&this.runtime.CSSPropertySyntaxFactory[zn.TRANSFORM].postProcessor(t),l.has("transformOrigin")&&e.transformOrigin&&this.runtime.CSSPropertySyntaxFactory[zn.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 r=t.geometry;r.contentBounds||(r.contentBounds=new sn),r.renderBounds||(r.renderBounds=new sn);var i=t.parsedStyle,a=n.update(i,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,y=a.hdepth,m=void 0===y?0:y,g=[Math.abs(d),Math.abs(p),m],x=i.stroke,k=i.lineWidth,M=void 0===k?1:k,b=i.increasedLineWidthForHitTesting,E=void 0===b?0:b,T=i.shadowType,w=void 0===T?"outer":T,N=i.shadowColor,S=i.filter,P=void 0===S?[]:S,A=i.transformOrigin,C=[s,l,h];if(r.contentBounds.update(C,g),x&&!x.isNone){var O=((M||0)+(E||0))*(e===$e.POLYLINE||e===$e.POLYGON||e===$e.PATH?Math.SQRT2:.5);g[0]+=O,g[1]+=O}if(r.renderBounds.update(C,g),N&&w&&"inner"!==w){var R=r.renderBounds,L=R.min,I=R.max,D=i.shadowBlur||0,_=i.shadowOffsetX||0,G=i.shadowOffsetY||0,F=I[0]+D+_,B=L[1]-D+G,U=I[1]+D+G;L[0]=Math.min(L[0],L[0]-D+_),I[0]=Math.max(I[0],F),L[1]=Math.min(L[1],B),I[1]=Math.max(I[1],U),r.renderBounds.setMinMax(L,I)}P.forEach(function(t){var e=t.name,n=t.params;if("blur"===e){var i=n[0].value;r.renderBounds.update(r.renderBounds.center,ut(r.renderBounds.halfExtents,r.renderBounds.halfExtents,[i,i,0]))}else if("drop-shadow"===e){var a=n[0].value,o=n[1].value,s=n[2].value,u=r.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),r.renderBounds.setMinMax(l,c)}}),t.geometry.dirty=!1;var Y=0>p,V=(0>d?-1:1)*(A?gi(A[0],0,t,!0):0),z=(Y?-1:1)*(A?gi(A[1],1,t,!0):0);(V||z)&&t.setOrigin(V,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===$e.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===$e.CIRCLE&&t.style.rawR&&(t.style.r=t.style.rawR,delete t.style.rawR))}}])}();function ca(t){return t.constructor.PARSED_STYLE_LIST}var ha=function(){return u(function t(){o(this,t),this.mixer=Ei},[{key:"calculator",value:function(t,e,n,r){return yi(n)}}])}(),fa=function(){return u(function t(){o(this,t)},[{key:"calculator",value:function(t,e,n,r,i){return n instanceof Gr&&(n=null),i.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach(function(t){0===t.childNodes.length&&i.sceneGraphService.dirtyToRoot(t)}),n}}])}(),da=function(){return u(function t(){o(this,t),this.parser=oi,this.mixer=si},[{key:"calculator",value:function(t,e,n,r){return n instanceof Gr?"none"===n.value?Xr:Wr:n}}])}(),va=function(){return u(function t(){o(this,t)},[{key:"calculator",value:function(t,e,n){return n instanceof Gr?[]:n}}])}();function pa(t){var e=t.parsedStyle.fontSize;return Dt(e)?null:e}var ya=function(){return u(function t(){o(this,t),this.mixer=Ei},[{key:"calculator",value:function(t,e,n,r,i){if(zt(n))return n;if(!Br.isRelativeUnit(n.unit))return n.value;if(n.unit===Tr.kPercentage)return 0;if(n.unit===Tr.kEms){if(r.parentNode){var a=pa(r.parentNode);if(a)return a*=n.value}return 0}if(n.unit===Tr.kRems){var o;if(null!=r&&null!==(o=r.ownerDocument)&&void 0!==o&&o.documentElement){var s=pa(r.ownerDocument.documentElement);if(s)return s*=n.value}return 0}}}])}(),ma=function(){return u(function t(){o(this,t),this.mixer=wi},[{key:"calculator",value:function(t,e,n){return n.map(function(t){return t.value})}}])}(),ga=function(){return u(function t(){o(this,t),this.mixer=wi},[{key:"calculator",value:function(t,e,n){return n.map(function(t){return t.value})}}])}(),xa=function(){return u(function t(){o(this,t)},[{key:"calculator",value:function(t,e,n,r){var i;n instanceof Gr&&(n=null);var a=null===(i=n)||void 0===i?void 0:i.cloneNode(!0);return a&&(a.style.isMarker=!0),a}}])}(),ka=function(){return u(function t(){o(this,t),this.mixer=Ei},[{key:"calculator",value:function(t,e,n){return n.value}}])}(),Ma=function(){return u(function t(){o(this,t),this.mixer=Ti(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 r=n.nodeName;if(r===$e.LINE||r===$e.PATH||r===$e.POLYLINE){var i=n.getPoint(e.offsetDistance);i&&t.setLocalPosition(i.x,i.y)}}}}])}(),ba=function(){return u(function t(){o(this,t),this.mixer=Ti(0,1)},[{key:"calculator",value:function(t,e,n){return n.value}}])}(),Ea=function(){return u(function t(){o(this,t),this.parser=Bi,this.mixer=Ui},[{key:"calculator",value:function(t,e,n){return n instanceof Gr&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new hn(0,0,0,0)}:n}}])}(),Ta=u(function t(){o(this,t),this.mixer=Yi}),wa=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=p(this,e,[].concat(r))).mixer=Ti(0,1/0),t}return m(e,t),u(e)}(ya),Na=function(){return u(function t(){o(this,t)},[{key:"calculator",value:function(t,e,n,r){return n instanceof Gr?"unset"===n.value?"":n.value:"".concat(n)}},{key:"postProcessor",value:function(t){t.nodeValue="".concat(t.parsedStyle.text)||""}}])}(),Sa=function(){return u(function t(){o(this,t)},[{key:"calculator",value:function(t,e,n,r){var i=r.getAttribute("text");if(i){var a=i;"capitalize"===n.value?a=i.charAt(0).toUpperCase()+i.slice(1):"lowercase"===n.value?a=i.toLowerCase():"uppercase"===n.value&&(a=i.toUpperCase()),r.parsedStyle.text=a}return n.value}}])}();var Pa={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},Aa="object"==typeof performance&&performance.now?performance:Date;function Ca(t){return t.nodeName===$e.FRAGMENT||t.getRootNode().nodeName===$e.FRAGMENT}var Oa=1,Ra="object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:{},La=Date.now(),Ia={},Da=Date.now(),_a=function(t){if("function"!=typeof t)throw new TypeError("".concat(t," is not a function"));var e=Date.now(),n=e-Da,r=n>16?0:16-n,i=Oa++;return Ia[i]=t,Object.keys(Ia).length>1||setTimeout(function(){Da=e;var t=Ia;Ia={},Object.keys(t).forEach(function(e){return t[e](Ra.performance&&"function"==typeof Ra.performance.now?Ra.performance.now():Date.now()-La)})},r),i},Ga=function(t){delete Ia[t]},Fa=function(t){return"string"!=typeof t?_a:""===t?Ra.requestAnimationFrame:Ra["".concat(t,"RequestAnimationFrame")]},Ba=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!!Fa(t)}),Ua=Fa(Ba),Ya=function(t){return"string"!=typeof t?Ga:""===t?Ra.cancelAnimationFrame:Ra["".concat(t,"CancelAnimationFrame")]||Ra["".concat(t,"CancelRequestAnimationFrame")]}(Ba);Ra.requestAnimationFrame=Ua,Ra.cancelAnimationFrame=Ya;var Va=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],za=/([\"\'])[^\'\"]+\1/;function ja(t){var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,a=t.fontWeight;return{fontSize:void 0===e?16:e,fontFamily:void 0===n?"sans-serif":n,fontStyle:void 0===r?"normal":r,fontVariant:void 0===i?"normal":i,fontWeight:void 0===a?"normal":a}}var Xa=Er(function(t){for(var e=ja(t),n=e.fontSize,r=e.fontFamily,i=e.fontStyle,a=e.fontVariant,o=e.fontWeight,s=zt(n)&&"".concat(n,"px")||"16px",u=r.split(","),l=u.length-1;l>=0;l--){var c=u[l].trim();!za.test(c)&&0>Va.indexOf(c)&&(c='"'.concat(c,'"')),u[l]=c}return"".concat(i," ").concat(a," ").concat(o," ").concat(s," ").concat(u.join(","))},function(t){var e=ja(t),n=e.fontSize,r=e.fontFamily,i=e.fontVariant,a=e.fontWeight;return"".concat(e.fontStyle,"_").concat(i,"_").concat(a,"_").concat(n,"_").concat(r)}),Wa=function(t){return Math.max(t,1e-6)};function Ha(t,e,n){return P(t),t[4]=Math.tan(e),t[1]=Math.tan(n),t}var qa=T(),Za=T(),Ka={scale:function(t){G(qa,[t[0].value,t[1].value,1].map(function(t){return Wa(t)}))},scaleX:function(t){G(qa,[t[0].value,1,1].map(function(t){return Wa(t)}))},scaleY:function(t){G(qa,[1,t[0].value,1].map(function(t){return Wa(t)}))},scaleZ:function(t){G(qa,[1,1,t[0].value].map(function(t){return Wa(t)}))},scale3d:function(t){G(qa,[t[0].value,t[1].value,t[2].value].map(function(t){return Wa(t)}))},translate:function(t){_(qa,[t[0].value,t[1].value,0])},translateX:function(t){_(qa,[t[0].value,0,0])},translateY:function(t){_(qa,[0,t[0].value,0])},translateZ:function(t){_(qa,[0,0,t[0].value])},translate3d:function(t){_(qa,[t[0].value,t[1].value,t[2].value])},rotate:function(t){Y(qa,mn(yi(t[0])))},rotateX:function(t){B(qa,mn(yi(t[0])))},rotateY:function(t){U(qa,mn(yi(t[0])))},rotateZ:function(t){Y(qa,mn(yi(t[0])))},rotate3d:function(t){F(qa,mn(yi(t[3])),[t[0].value,t[1].value,t[2].value])},skew:function(t){Ha(qa,mn(t[0].value),mn(t[1].value))},skewX:function(t){Ha(qa,mn(t[0].value),0)},skewY:function(t){Ha(qa,0,mn(t[0].value))},matrix:function(t){S(qa,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){S.apply(et,[qa].concat(h(t.map(function(t){return t.value}))))}},Qa=at(1,1,1),$a=nt(),Ja={translate:function(t,e){ts.sceneGraphService.setLocalScale(t,Qa,!1),ts.sceneGraphService.setLocalEulerAngles(t,$a,void 0,void 0,!1),ts.sceneGraphService.setLocalPosition(t,[e[0].value,e[1].value,0],!1),ts.sceneGraphService.dirtyLocalTransform(t,t.transformable)}};var to=function(){return u(function t(){o(this,t),this.parser=qi,this.mixer=ia},[{key:"calculator",value:function(t,e,n,r){return n instanceof Gr?[]:n}},{key:"postProcessor",value:function(t){!function(t,e){if(t.length){if(1===t.length&&Ja[t[0].t])return void Ja[t[0].t](e,t[0].d);for(var n=P(Za),r=0;t.length>r;r++){var i=t[r],a=Ka[i.t];a&&(a(i.d),tt(n,n,qa))}e.setLocalTransform(n)}else e.resetLocalTransform();e.getLocalTransform()}(t.parsedStyle.transform,t)}}])}(),eo=function(){return u(function t(){o(this,t)},[{key:"postProcessor",value:function(t){var e=t.parsedStyle.transformOrigin;e[0].unit===Tr.kPixels&&e[1].unit===Tr.kPixels?t.setOrigin(e[0].value,e[1].value):t.getGeometryBounds()}}])}(),no=function(){return u(function t(){o(this,t)},[{key:"calculator",value:function(t,e,n,r){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=Gn.Z_INDEX_CHANGED)}}}])}(),ro=function(){return u(function t(){o(this,t)},[{key:"update",value:function(t,e){var n=t.cx,r=t.cy,i=t.r,a=void 0===i?0:i;return{cx:void 0===n?0:n,cy:void 0===r?0:r,hwidth:a,hheight:a}}}])}(),io=function(){return u(function t(){o(this,t)},[{key:"update",value:function(t,e){var n=t.cx,r=t.cy,i=t.rx,a=t.ry;return{cx:void 0===n?0:n,cy:void 0===r?0:r,hwidth:void 0===i?0:i,hheight:void 0===a?0:a}}}])}(),ao=function(){return u(function t(){o(this,t)},[{key:"update",value:function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,a=Math.min(e,r),o=Math.max(e,r),s=Math.min(n,i),u=(o-a)/2,l=(Math.max(n,i)-s)/2;return{cx:a+u,cy:s+l,hwidth:u,hheight:l}}}])}(),oo=function(){return u(function t(){o(this,t)},[{key:"update",value:function(t){var e=t.d.rect,n=e.width/2,r=e.height/2;return{cx:e.x+n,cy:e.y+r,hwidth:n,hheight:r}}}])}(),so=function(){return u(function t(){o(this,t)},[{key:"update",value:function(t){if(t.points&&_t(t.points.points)){var e=t.points.points,n=Math.min.apply(Math,h(e.map(function(t){return t[0]}))),r=Math.max.apply(Math,h(e.map(function(t){return t[0]}))),i=Math.min.apply(Math,h(e.map(function(t){return t[1]}))),a=(r-n)/2,o=(Math.max.apply(Math,h(e.map(function(t){return t[1]})))-i)/2;return{cx:n+a,cy:i+o,hwidth:a,hheight:o}}return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),uo=function(){return u(function t(){o(this,t)},[{key:"update",value:function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,a=void 0===i?0:i,o=t.src,s=t.width,u=t.height,l=void 0===s?0:s,c=void 0===u?0:u;return o&&!Yt(o)&&(l||(t.width=l=o.width),c||(t.height=c=o.height)),{cx:r+l/2,cy:a+c/2,hwidth:l/2,hheight:c/2}}}])}(),lo=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,r=t.text,i=t.textAlign,a=void 0===i?"start":i,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,y=t.y,m=void 0===y?0:y;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())||{},x=this.globalRuntime.textService.measureText(r,t,g.offscreenCanvas);t.metrics=x;var k=x.width/2,M=x.height/2,b=p+k;"center"===a||"middle"===a?b+=s/2-k:"right"!==a&&"end"!==a||(b+=s-2*k);var E=m-M;return"middle"===l?E+=M:"top"===l||"hanging"===l?E+=2*M:"alphabetic"===l||"bottom"!==l&&"ideographic"!==l||(E+=0),h&&(b+=h),d&&(E+=d),{cx:b,cy:E,hwidth:k,hheight:M}}}])}(),co=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,r=t.y,i=t.width,a=void 0===i?0:i,o=t.height,s=void 0===o?0:o;return{cx:(void 0===n?0:n)+a/2,cy:(void 0===r?0:r)+s/2,hwidth:a/2,hheight:s/2}}}])}(),fo=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 cn,this.page=new cn,this.canvas=new cn,this.viewport=new cn,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(fn)}}])}(),vo=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=p(this,e,[].concat(r))).client=new cn,t.movement=new cn,t.offset=new cn,t.global=new cn,t.screen=new cn,t}return m(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(fn)}}])}(fo),po=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=p(this,e,[].concat(r))).width=0,t.height=0,t.isPrimary=!1,t}return m(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)}}])}(vo),yo=function(t){function e(){return o(this,e),p(this,e,arguments)}return m(e,t),u(e,[{key:"clone",value:function(){return this.manager.cloneWheelEvent(this)}}])}(vo),mo=function(t){function e(t,n){var r;return o(this,e),(r=p(this,e,[null])).type=t,r.detail=n,Object.assign(r,n),r}return m(e,t),u(e)}(fo),go=function(){return u(function t(){o(this,t),this.emitter=new k},[{key:"on",value:function(t,e,n){return this.addEventListener(t,e,n),this}},{key:"addEventListener",value:function(t,e,n){var r=!1,i=!1;if(Wt(n))r=n;else if(n){var a=n.capture;r=void 0!==a&&a;var o=n.once;i=void 0!==o&&o}r&&(t+="capture"),e=It(e)?e:e.handleEvent;var s=It(e)?void 0:e;return i?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 r;if(!this.emitter)return this;(Wt(n)?n:null==n?void 0:n.capture)&&(t+="capture"),e=It(e)?e:null===(r=e)||void 0===r?void 0:r.handleEvent;var i=It(e)?void 0:e;return this.emitter.off(t,e,i),this}},{key:"emit",value:function(t,e){this.dispatchEvent(new mo(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 r;e=null===(r=this.ownerDocument)||void 0===r?void 0:r.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}}])}(),xo=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=p(this,e,[].concat(r))).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 m(e,t),u(e,[{key:"textContent",get:function(){var t="";this.nodeName===$e.TEXT&&(t+=this.style.text);var e,n=Ke(this.childNodes);try{for(n.s();!(e=n.n()).done;){var r=e.value;t+=r.nodeName===$e.TEXT?r.nodeValue:r.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===$e.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(fn)}},{key:"lookupNamespaceURI",value:function(t){throw Error(fn)}},{key:"lookupPrefix",value:function(t){throw Error(fn)}},{key:"normalize",value:function(){throw Error(fn)}},{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,r=this,i=[n],a=[r];null!==(o=n.parentNode)&&void 0!==o?o:r.parentNode;){var o;n=n.parentNode?(i.push(n.parentNode),n.parentNode):n,r=r.parentNode?(a.push(r.parentNode),r.parentNode):r}if(n!==r)return e.DOCUMENT_POSITION_DISCONNECTED|e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|e.DOCUMENT_POSITION_PRECEDING;var s=i.length>a.length?i:a,u=s===i?a:i;if(s[s.length-u.length]===u[0])return s===i?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===i?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING:s===i?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 r=n.childNodes.length-1;r>=0;r--)e.push(n.childNodes[r])}}}],[{key:"isNode",value:function(t){return!!t.childNodes}}])}(go);xo.DOCUMENT_POSITION_DISCONNECTED=1,xo.DOCUMENT_POSITION_PRECEDING=2,xo.DOCUMENT_POSITION_FOLLOWING=4,xo.DOCUMENT_POSITION_CONTAINS=8,xo.DOCUMENT_POSITION_CONTAINED_BY=16,xo.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var ko=function(){return u(function t(){o(this,t)},[{key:"getOrCreateCanvas",value:function(t,e){if(this.canvas)return this.canvas;if(t||ts.offscreenCanvas)this.canvas=t||ts.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}}])}(),Mo=/\[\s*(.*)=(.*)\s*\]/,bo=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 r=this.getAttribute(t),i=r.name,a=r.value;return i?e.find(function(t){return e!==t&&("name"===i?t.name===a:n.attributeToString(t,i)===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(r){return e!==r&&((null==r?void 0:r.classList)||[]).indexOf(n.getIdOrClassname(t))>-1});if(t.startsWith("#"))return e.findAll(function(r){return e!==r&&r.id===n.getIdOrClassname(t)});if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,a=r.value;return i?e.findAll(function(t){return e!==t&&("name"===i?t.name===a:n.attributeToString(t,i)===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),r=n.name,i=n.value;return"name"===r?e.name===i:this.attributeToString(e,r)===i}return e.nodeName===t}},{key:"getIdOrClassname",value:function(t){return t.substring(1)}},{key:"getAttribute",value:function(t){var e=t.match(Mo),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}}},{key:"attributeToString",value:function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return Dt(n)?"":n.toString?""+n:""}}])}(),Eo=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}({}),To=function(t){function e(t,n,r,i,a,s,u,l){var c;return o(this,e),(c=p(this,e,[null])).relatedNode=n,c.prevValue=r,c.newValue=i,c.attrName=a,c.attrChange=s,c.prevParsedValue=u,c.newParsedValue=l,c.type=t,c}return m(e,t),u(e)}(fo);To.ADDITION=2,To.MODIFICATION=1,To.REMOVAL=3;var wo,No,So,Po=new To(Eo.REPARENT,null,"","","",0,"",""),Ao=Lt(),Co=nt(),Oo=at(1,1,1),Ro=T(),Lo=Lt(),Io=nt(),Do=T(),_o=Et(),Go=nt(),Fo=Et(),Bo=nt(),Uo=nt(),Yo=nt(),Vo=T(),zo=Et(),jo=Et(),Xo=Et(),Wo={affectChildren:!0},Ho=function(){return u(function t(e){o(this,t),this.pendingEvents=new Map,this.boundsChangedEvent=new mo(Eo.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 r,i=!1;t.parentNode&&(i=t.parentNode!==e,this.detach(t));var a=t.nodeName===$e.FRAGMENT,o=Ca(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!==(r=u.sorted)&&void 0!==r&&r.length||u.dirty||t.parsedStyle.zIndex)&&(-1===u.dirtyChildren.indexOf(t)&&u.dirtyChildren.push(t),u.dirty=!0,u.dirtyReason=Gn.ADDED),!o){if(a)this.dirtifyFragment(t);else{var l=t.transformable;l&&this.dirtyWorldTransform(t,l)}if(i){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(Po,h,h)}}}},{key:"detach",value:function(t){var e,n;if(t.parentNode){var r=t.transformable,i=t.parentNode.sortable;(null!=i&&null!==(e=i.sorted)&&void 0!==e&&e.length||null!==(n=t.style)&&void 0!==n&&n.zIndex)&&(-1===i.dirtyChildren.indexOf(t)&&i.dirtyChildren.push(t),i.dirty=!0,i.dirtyReason=Gn.REMOVED);var a=t.parentNode.childNodes.indexOf(t);a>-1&&t.parentNode.childNodes.splice(a,1),r&&this.dirtyWorldTransform(t,r),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 Yn(e),e.localTransform}},{key:"setLocalPosition",value:function(t,e){var n,r=2>=arguments.length||void 0===arguments[2]||arguments[2],i=t.transformable;Uo[0]=e[0],Uo[1]=e[1],Uo[2]=null!==(n=e[2])&&void 0!==n?n:0,yt(i.localPosition,Uo)||(ot(i.localPosition,Uo),r&&this.dirtyLocalTransform(t,i))}},{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;yt(e,Co)||(!function(t,e,n){var r=n[0],i=n[1],a=n[2],o=e[0],s=e[1],u=e[2],l=i*u-a*s,c=a*o-r*u,h=r*s-i*o,f=i*h-a*c,d=a*l-r*h,v=r*c-i*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,r,i){var a=5>=arguments.length||void 0===arguments[5]||arguments[5];"number"==typeof e&&(e=Ct(_o,e,n,r,i));var o=t.transformable;At(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;St(jo,e[0],e[1],e[2]),Ot(n.localRotation,n.localRotation,jo),this.dirtyLocalTransform(t,n)}},{key:"setLocalScale",value:function(t,e){var n,r=2>=arguments.length||void 0===arguments[2]||arguments[2],i=t.transformable;st(Io,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:i.localScale[2]),yt(Io,i.localScale)||(ot(i.localScale,Io),r&&this.dirtyLocalTransform(t,i))}},{key:"scaleLocal",value:function(t,e){var n,r,i,a,o=t.transformable;r=o.localScale,i=o.localScale,a=st(Io,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:1),r[0]=i[0]*a[0],r[1]=i[1]*a[1],r[2]=i[2]*a[2],this.dirtyLocalTransform(t,o)}},{key:"setLocalSkew",value:function(t,e,n){var r=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}(Lo,e,n));var i,a,o=t.transformable;(i=o.localSkew)[0]=(a=e)[0],i[1]=a[1],r&&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 r=t.transformable;St(r.localRotation,e[0],e[1],e[2]),n&&this.dirtyLocalTransform(t,r)}},{key:"setLocalTransform",value:function(t,e){var n=z(Go,e),r=X(Fo,e),i=j(Bo,e);this.setLocalScale(t,i,!1),this.setLocalPosition(t,n,!1),this.setLocalRotation(t,r,void 0,void 0,void 0,!1),this.dirtyLocalTransform(t,t.transformable)}},{key:"resetLocalTransform",value:function(t){this.setLocalScale(t,Oo,!1),this.setLocalPosition(t,Co,!1),this.setLocalEulerAngles(t,Co,void 0,void 0,!1),this.setLocalSkew(t,Ao,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,r=t.transformable;if(Yo[0]=e[0],Yo[1]=e[1],Yo[2]=null!==(n=e[2])&&void 0!==n?n:0,!yt(this.getPosition(t),Yo)){if(ot(r.position,Yo),null!==t.parentNode&&t.parentNode.transformable)N(Vo,t.parentNode.transformable.worldTransform),C(Vo,Vo),pt(r.localPosition,Yo,Vo);else ot(r.localPosition,Yo);this.dirtyLocalTransform(t,r)}}},{key:"translate",value:function(t,e){"number"==typeof e&&(e=st(Io,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)),yt(e,Co)||(ut(Io,this.getPosition(t),e),this.setPosition(t,Io))}},{key:"setRotation",value:function(t,e,n,r,i){var a=t.transformable;if("number"==typeof e&&(e=Pt(e,n,r,i)),null!==t.parentNode&&t.parentNode.transformable){var o=this.getRotation(t.parentNode);At(_o,o),Nt(_o,_o),wt(a.localRotation,_o,e),Rt(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 r=_o;St(r,e[0],e[1],e[2]);var i=this.getRotation(t),a=this.getRotation(t.parentNode);At(Xo,a),Nt(Xo,Xo),wt(r,Xo,r),wt(n.localRotation,r,i),Rt(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 r=n.origin;r[0]=e[0],r[1]=e[1],r[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){St(n.localRotation,e[0],e[1],e[2]);var r=this.getRotation(t.parentNode);At(zo,Nt(_o,r)),Ot(n.localRotation,n.localRotation,zo),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(!sn.isEmpty(n)){var r=e||new sn;return r.setFromTransformedAABB(n,this.getWorldTransform(t)),r}return null}},{key:"getGeometryBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.geometry;return n.dirty&&ts.styleValueRegistry.updateGeometry(t),(e?n.renderBounds:n.contentBounds||null)||new sn}},{key:"getBounds",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t.renderable;if(!r.boundsDirty&&!n&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&n&&r.renderBounds)return r.renderBounds;var i=n?r.renderBounds:r.bounds,a=this.getTransformedGeometryBounds(t,n,i);if(t.childNodes.forEach(function(t){var r=e.getBounds(t,n);r&&(a?a.add(r):(a=i||new sn).update(r.center,r.halfExtents))}),a||(a=new sn),n){var o=function(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}(t);if(o){var s=o.parsedStyle.clipPath.getBounds(n);a?s&&(a=s.intersection(a)):a.update(s.center,s.halfExtents)}}return n?(r.renderBounds=a,r.renderBoundsDirty=!1):(r.bounds=a,r.boundsDirty=!1),a}},{key:"getLocalBounds",value:function(t){if(t.parentNode){var e=Ro;t.parentNode.transformable&&(e=C(Do,this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!sn.isEmpty(n)){var r=new sn;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)}},{key:"getBoundingClientRect",value:function(t){var e,n,r=this.getGeometryBounds(t);sn.isEmpty(r)||(n=new sn).setFromTransformedAABB(r,this.getWorldTransform(t));var i=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 hn(o+((null==i?void 0:i.left)||0),s+((null==i?void 0:i.top)||0),u[0]-o,u[1]-s)}return new hn((null==i?void 0:i.left)||0,(null==i?void 0:i.top)||0,0,0)}},{key:"internalUpdateTransform",value:function(t){var e,n=null===(e=t.parentNode)||void 0===e?void 0:e.transformable;Yn(t.transformable),function(t,e){t.dirtyFlag&&(e?R(t.worldTransform,e.worldTransform,t.localTransform):N(t.worldTransform,t.localTransform),t.dirtyFlag=!1)}(t.transformable,n)}},{key:"internalUpdateElement",value:function(t,e){var n,r,i,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===(r=t.transformable)||void 0===r?void 0:r.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===(i=t.renderable)||void 0===i?void 0:i.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,r=[t],i=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}]:[];r.length>0;){for(var a=r.pop(),o=i[i.length-1];i.length>0&&a.parentNode!==o.node;)o=i.pop();var s=this.internalUpdateElement(a,i);if(a.childNodes.length>0){for(var u=a.childNodes.length-1;u>=0;u--)r.push(a.childNodes[u]);i.push({node:a,transformDirty:s,shapeUpdated:!1})}}}},{key:"dirtyLocalTransform",value:function(t,e){Ca(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,r=this,i=!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),i||t.childNodes.forEach(function(t){r.dirtifyWorldInternal(t,t.transformable)}))}},{key:"dirtyToRoot",value:function(t){for(var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t,i=!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);r;){var a,o;if(null===(a=(o=r).dirty)||void 0===a||a.call(o,!0,!0),i)break;r=r.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,r=t.transformable;r&&(r.dirtyFlag=!0,r.localDirtyFlag=!0),null===(e=(n=t).dirty)||void 0===e||e.call(n,!0,!0);for(var i=t.childNodes.length,a=0;i>a;a++)this.dirtifyFragment(t.childNodes[a]);t.nodeName===$e.FRAGMENT&&this.pendingEvents.set(t,!1)}},{key:"triggerPendingEvents",value:function(){var t,e,n=this,r=new Set,i=function(e,i){if(e.isConnected&&!r.has(e)&&e.nodeName!==$e.FRAGMENT){if(n.boundsChangedEvent.detail=i,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)}r.add(e)}};this.pendingEvents.forEach(function(t,n){if(n.nodeName!==$e.FRAGMENT){var r;if(void 0===e)e=!0===(null===(r=n.ownerDocument)||void 0===r||null===(r=r.defaultView)||void 0===r||null===(r=r.getConfig())||void 0===r||null===(r=r.future)||void 0===r?void 0:r.experimentalAttributeUpdateOptimization);Wo.affectChildren=t,e?i(n,Wo):t?n.forEach(function(t){i(t,Wo)}):i(n,Wo)}}),r.clear(),this.clearPendingEvents()}},{key:"clearPendingEvents",value:function(){this.pendingEvents.clear()}},{key:"updateDisplayObjectDependency",value:function(t,e,n,r){if(e&&e!==n){var i=this.displayObjectDependencyMap.get(e);if(i&&i[t]){var a=i[t].indexOf(r);i[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(r)}}},{key:"informDependentDisplayObjects",value:function(t){var e,n=this,r=this.displayObjectDependencyMap.get(t);if(r){var i=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(r).forEach(function(t){r[t].forEach(function(e){n.dirtyToRoot(e,!0),e.dispatchEvent(new To(Eo.ATTR_MODIFIED,e,n,n,t,To.MODIFICATION,n,n),i,i),e.isCustomElement&&e.isConnected&&e.attributeChangedCallback&&e.attributeChangedCallback(t,n,n)})})}}}])}(),qo=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()}}])}(),Zo={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]},Ko=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,Qo=RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),$o=RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),Jo=function(){return u(function t(e){var n=this;o(this,t),this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,e){return!n.isBreakingSpace(e)&&!(!t||!$o.exec(e)&&!Qo.exec(t))},this.trimByKinsokuShorui=function(t){var e=h(t),n=e[e.length-2];if(!n)return t;var r=n[n.length-1];return e[e.length-2]=n.slice(0,-1),e[e.length-1]=r+e[e.length-1],e},this.runtime=e,this.charWidthCache=new qo(100)},[{key:"measureFont",value:function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(e),i=this.runtime.offscreenCanvasCreator.getOrCreateContext(e,{willReadFrequently:!0});i.font=t;var a=Zo.MetricsString+Zo.BaselineSymbol,o=Math.ceil(i.measureText(a).width),s=Math.ceil(i.measureText(Zo.BaselineSymbol).width),u=Zo.HeightMultiplier*s;s=s*Zo.BaselineMultiplier|0,r.width=o,r.height=u,i.fillStyle="#f00",i.fillRect(0,0,o,u),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(a,0,s);var l=i.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 y=0;h>y;y+=4)if(255!==l[d+y]){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 r=e.fontSize,i=void 0===r?16:r,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,y=e.textPath,m=e.leading,g=void 0===m?0:m,x=Xa(e),k=this.measureFont(x,n);0===k.fontSize&&(k.fontSize=i,k.ascent=i);var M=this.runtime.offscreenCanvasCreator.getOrCreateContext(n);M.font=x,e.isOverflowing=!1;var b=(o?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),E=Array(b.length),T=0;if(!y){for(var w=0;b.length>w;w++){var N=M.measureText(b[w]).width+(b[w].length-1)*p;E[w]=N,T=Math.max(T,N)}var S=T+l,P=s||k.fontSize+l,A=Math.max(P,k.fontSize+l)+(b.length-1)*(P+g),C=0;return"middle"===h?C=-A/2:"bottom"===h||"alphabetic"===h||"ideographic"===h?C=-A:"top"!==h&&"hanging"!==h||(C=0),{font:x,width:S,height:A,lines:b,lineWidths:E,lineHeight:P+=g,maxLineWidth:T,fontProperties:k,lineMetrics:E.map(function(t,e){var n=0;return"center"===d||"middle"===d?n-=t/2:"right"!==d&&"end"!==d||(n-=t),new hn(n-l/2,C+e*P,t+l,P)})}}y.getTotalLength();for(var O=0;b.length>O;O++)M.measureText(b[O])}},{key:"wordWrap",value:function(t,e,n){var r=this,i=Array.from(t);if(0===i.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 y=[""],m=0,g=0,x=-1,k=Xa(e),M=this.charWidthCache.get(k);M||(M=new qo(500),this.charWidthCache.put(k,M));var b=function(t){return r.getFromCache(t,l,M,d)},E=b(p);function T(t,e,n,r){for(;b(t)<r&&i.length-1>e&&!a.isNewline(i[e+1]);)t+=i[e+=1];for(;b(t)>r&&e>=n;)e-=1,t=t.slice(0,-1);return{lineTxt:t,txtLastCharIndex:e}}function w(t,e){if(E>0&&v>=E)if(y[t]){var n=T(y[t],e,x+1,v-E);y[t]=n.lineTxt+p}else y[t]=p}for(var N=0;i.length>N;N++){var S=i[N],P=i[N-1],A=i[N+1],C=b(S);if(this.isNewline(S)){if(m+1>=h){i.length-1>N&&w(m,N-1),e.isOverflowing=!0;break}x=N-1,g=0,y[m+=1]=""}else{if(C>v){w(m,N-1),e.isOverflowing=!0;break}if(g>0&&g+C>v){var O=T(y[m],N-1,x+1,v);if(O.txtLastCharIndex!==N-1){if(y[m]=O.lineTxt,O.txtLastCharIndex===i.length-1)break;P=i[(N=O.txtLastCharIndex+1)-1],A=i[N+1],C=b(S=i[N])}if(m+1>=h){w(m,N-1),e.isOverflowing=!0;break}if(x=N-1,g=0,y[m+=1]="",this.isBreakingSpace(S))continue;this.canBreakInLastChar(S)||(y=this.trimToBreakable(y),g=this.sumTextWidthByCache(y[m]||"",b)),this.shouldBreakByKinsokuShorui(S,A)&&(y=this.trimByKinsokuShorui(y),g+=b(P||""))}g+=C,y[m]+=S}}return y.join("\n")}},{key:"isBreakingSpace",value:function(t){return"string"==typeof t&&Zo.BreakingSpaces.indexOf(t.charCodeAt(0))>=0}},{key:"isNewline",value:function(t){return"string"==typeof t&&Zo.Newlines.indexOf(t.charCodeAt(0))>=0}},{key:"trimToBreakable",value:function(t){var e=h(t),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),a=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(r+1,n.length),e[e.length-2]=n.slice(0,a),e}},{key:"canBreakInLastChar",value:function(t){return!t||!Ko.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(!Ko.test(t[e]))return e;return-1}},{key:"getFromCache",value:function(t,e,n,r){var i=n.get(t);if("number"!=typeof i){var a=t.length*e,o=r.measureText(t);n.put(t,i=o.width+a)}return i}},{key:"clearCache",value:function(){this.fontMetricsCache={},this.charWidthCache.clear()}}])}(),ts={},es=(No=new uo,So=new so,r(r(r(r(r(r(r(r(r(r(wo={},$e.FRAGMENT,null),$e.CIRCLE,new ro),$e.ELLIPSE,new io),$e.RECT,No),$e.IMAGE,No),$e.GROUP,new co),$e.LINE,new ao),$e.TEXT,new lo(ts)),$e.POLYLINE,So),$e.POLYGON,So),r(r(r(wo,$e.PATH,new oo),$e.HTML,new ho),$e.MESH,null)),ns=function(t){var e=new da,n=new ya;return r(r(r(r(r(r(r(r(r(r(t={},zn.PERCENTAGE,null),zn.NUMBER,new ka),zn.ANGLE,new ha),zn.DEFINED_PATH,new fa),zn.PAINT,e),zn.COLOR,e),zn.FILTER,new va),zn.LENGTH,n),zn.LENGTH_PERCENTAGE,n),zn.LENGTH_PERCENTAGE_12,new ma),r(r(r(r(r(r(r(r(r(r(t,zn.LENGTH_PERCENTAGE_14,new ga),zn.COORDINATE,new ya),zn.OFFSET_DISTANCE,new Ma),zn.OPACITY_VALUE,new ba),zn.PATH,new Ea),zn.LIST_OF_POINTS,new Ta),zn.SHADOW_BLUR,new wa),zn.TEXT,new Na),zn.TEXT_TRANSFORM,new Sa),zn.TRANSFORM,new to),r(r(r(t,zn.TRANSFORM_ORIGIN,new eo),zn.Z_INDEX,new no),zn.MARKER,new xa)}();ts.CameraContribution=Dn,ts.AnimationTimeline=null,ts.EasingFunction=null,ts.offscreenCanvasCreator=new ko,ts.sceneGraphSelector=new bo,ts.sceneGraphService=new Ho(ts),ts.textService=new Jo(ts),ts.geometryUpdaterFactory=es,ts.CSSPropertySyntaxFactory=ns,ts.styleValueRegistry=new la(ts),ts.layoutRegistry=null,ts.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},ts.enableStyleSyntax=!0,ts.enableSizeAttenuation=!1;var rs=0,is=new To(Eo.INSERTED,null,"","","",0,"",""),as=new To(Eo.REMOVED,null,"","","",0,"",""),os=new mo(Eo.DESTROY),ss=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=p(this,e,[].concat(r))).entity=rs++,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:_n.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 m(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(fn)}},{key:"appendChild",value:function(t,e){var n;if(t.destroyed)throw Error("Cannot append a destroyed element.");return ts.sceneGraphService.attach(t,this,e),null!==(n=this.ownerDocument)&&void 0!==n&&n.defaultView&&(Ca(this)||t.nodeName!==$e.FRAGMENT?this.ownerDocument.defaultView.mountChildren(t):this.ownerDocument.defaultView.mountFragment(t)),this.isMutationObserved&&(is.relatedNode=this,t.dispatchEvent(is)),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,r=!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 as.relatedNode=this,t.dispatchEvent(as,r,r),null!==(n=t.ownerDocument)&&void 0!==n&&n.defaultView&&t.ownerDocument.defaultView.unmountChildren(t),ts.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 ts.sceneGraphService.matches(t,this)}},{key:"getElementById",value:function(t){return ts.sceneGraphService.querySelector("#".concat(t),this)}},{key:"getElementsByName",value:function(t){return ts.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)}},{key:"getElementsByClassName",value:function(t){return ts.sceneGraphService.querySelectorAll(".".concat(t),this)}},{key:"getElementsByTagName",value:function(t){return ts.sceneGraphService.querySelectorAll(t,this)}},{key:"querySelector",value:function(t){return ts.sceneGraphService.querySelector(t,this)}},{key:"querySelectorAll",value:function(t){return ts.sceneGraphService.querySelectorAll(t,this)}},{key:"closest",value:function(t){var e=this;do{if(ts.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(r){return r===e||!t(r)||(n=r,!1)}),n}},{key:"findAll",value:function(t){var e=this,n=[];return this.forEach(function(r){r!==e&&t(r)&&n.push(r)}),n}},{key:"after",value:function(){var t=this;if(this.parentNode){for(var e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];r.forEach(function(n,r){var i;return null===(i=t.parentNode)||void 0===i?void 0:i.appendChild(n,e+r+1)})}}},{key:"before",value:function(){if(this.parentNode){for(var t,e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];var a=r[0],o=r.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),r=0;e>r;r++)n[r]=arguments[r];n.forEach(function(e){return t.appendChild(e)})}},{key:"prepend",value:function(){for(var t=this,e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];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(os,e,e),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0}},{key:"getGeometryBounds",value:function(){return ts.sceneGraphService.getGeometryBounds(this)}},{key:"getRenderBounds",value:function(){return ts.sceneGraphService.getBounds(this,!0)}},{key:"getBounds",value:function(){return ts.sceneGraphService.getBounds(this)}},{key:"getLocalBounds",value:function(){return ts.sceneGraphService.getLocalBounds(this)}},{key:"getBoundingClientRect",value:function(){return ts.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,r){this.attributes[t]=e}},{key:"getAttributeNS",value:function(t,e){throw Error(fn)}},{key:"getAttributeNode",value:function(t){throw Error(fn)}},{key:"getAttributeNodeNS",value:function(t,e){throw Error(fn)}},{key:"hasAttributeNS",value:function(t,e){throw Error(fn)}},{key:"removeAttributeNS",value:function(t,e){throw Error(fn)}},{key:"removeAttributeNode",value:function(t){throw Error(fn)}},{key:"setAttributeNS",value:function(t,e,n){throw Error(fn)}},{key:"setAttributeNode",value:function(t){throw Error(fn)}},{key:"setAttributeNodeNS",value:function(t){throw Error(fn)}},{key:"toggleAttribute",value:function(t,e){throw Error(fn)}}])}(xo);function us(t){return!(null==t||!t.nodeName)}var ls=ts.globalThis.Proxy?ts.globalThis.Proxy:function(){},cs=new To(Eo.ATTR_MODIFIED,null,null,null,null,To.MODIFICATION,null,null),hs=nt(),fs=Et(),ds=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||$e.GROUP,t.initialParsedStyle&&Object.assign(n.parsedStyle,t.initialParsedStyle),n.initAttributes(t.style),ts.enableStyleSyntax&&(n.style=new ls({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,r){return n.setAttribute(e,r),!0}})),n}return m(e,t),u(e,[{key:"destroy",value:function(){De(e,"destroy",this,3)([]),this.getAnimations().forEach(function(t){t.cancel()})}},{key:"cloneNode",value:function(t,e){var n=a({},this.attributes);for(var r in n){var i=n[r];us(i)&&"clipPath"!==r&&"offsetPath"!==r&&"textPath"!==r&&(n[r]=i.cloneNode(t)),e&&(n[r]=e(r,i))}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(){ts.styleValueRegistry.processProperties(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{forceUpdateGeometry:!0}),this.dirty()}},{key:"setAttribute",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=3>=arguments.length||void 0===arguments[3]||arguments[3];Ht(n)||(r||n!==this.attributes[t])&&(this.internalSetAttribute(t,n,{memoize:i}),De(e,"setAttribute",this,3)([t,n]))}},{key:"internalSetAttribute",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.attributes[t],a=this.parsedStyle[t];ts.styleValueRegistry.processProperties(this,r({},t,e),n),this.dirty();var o,s=this.parsedStyle[t];if(this.isConnected)if(cs.relatedNode=this,cs.prevValue=i,cs.newValue=e,cs.attrName=t,cs.prevParsedValue=a,cs.newParsedValue=s,this.isMutationObserved)this.dispatchEvent(cs);else{var u,l=!0===(null===(u=this.ownerDocument.defaultView.getConfig().future)||void 0===u?void 0:u.experimentalCancelEventPropagation);cs.target=this,this.ownerDocument.defaultView.dispatchEvent(cs,!0,l)}(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&(null===(o=this.attributeChangedCallback)||void 0===o||o.call(this,t,i,e,a,s))}},{key:"getBBox",value:function(){var t=this.getBounds(),e=g(t.getMin(),2),n=e[0],r=e[1],i=g(t.getMax(),2);return new hn(n,r,i[0]-n,i[1]-r)}},{key:"setOrigin",value:function(t){return ts.sceneGraphService.setOrigin(this,pn(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 ts.sceneGraphService.getOrigin(this)}},{key:"setPosition",value:function(t){return ts.sceneGraphService.setPosition(this,pn(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 ts.sceneGraphService.setLocalPosition(this,pn(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 ts.sceneGraphService.translate(this,pn(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 ts.sceneGraphService.translateLocal(this,pn(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 ts.sceneGraphService.getPosition(this)}},{key:"getLocalPosition",value:function(){return ts.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=pn(t,e=e||t,n=n||t,!1)),ts.sceneGraphService.scaleLocal(this,t),this}},{key:"setLocalScale",value:function(t,e,n){return"number"==typeof t&&(t=pn(t,e=e||t,n=n||t,!1)),ts.sceneGraphService.setLocalScale(this,t),this}},{key:"getLocalScale",value:function(){return ts.sceneGraphService.getLocalScale(this)}},{key:"getScale",value:function(){return ts.sceneGraphService.getScale(this)}},{key:"getEulerAngles",value:function(){return xn(g(Mn(hs,ts.sceneGraphService.getWorldTransform(this)),3)[2])}},{key:"getLocalEulerAngles",value:function(){return xn(g(Mn(hs,ts.sceneGraphService.getLocalRotation(this)),3)[2])}},{key:"setEulerAngles",value:function(t){return ts.sceneGraphService.setEulerAngles(this,0,0,t),this}},{key:"setLocalEulerAngles",value:function(t){return ts.sceneGraphService.setLocalEulerAngles(this,0,0,t),this}},{key:"rotateLocal",value:function(t,e,n){return Dt(e)&&Dt(n)?ts.sceneGraphService.rotateLocal(this,0,0,t):ts.sceneGraphService.rotateLocal(this,t,e,n),this}},{key:"rotate",value:function(t,e,n){return Dt(e)&&Dt(n)?ts.sceneGraphService.rotate(this,0,0,t):ts.sceneGraphService.rotate(this,t,e,n),this}},{key:"setRotation",value:function(t,e,n,r){return ts.sceneGraphService.setRotation(this,t,e,n,r),this}},{key:"setLocalRotation",value:function(t,e,n,r){return ts.sceneGraphService.setLocalRotation(this,t,e,n,r),this}},{key:"setLocalSkew",value:function(t,e){return ts.sceneGraphService.setLocalSkew(this,t,e),this}},{key:"getRotation",value:function(){return ts.sceneGraphService.getRotation(this)}},{key:"getLocalRotation",value:function(){return ts.sceneGraphService.getLocalRotation(this)}},{key:"getLocalSkew",value:function(){return ts.sceneGraphService.getLocalSkew(this)}},{key:"getLocalTransform",value:function(){return ts.sceneGraphService.getLocalTransform(this)}},{key:"getWorldTransform",value:function(){return ts.sceneGraphService.getWorldTransform(this)}},{key:"setLocalTransform",value:function(t){return ts.sceneGraphService.setLocalTransform(this,t),this}},{key:"resetLocalTransform",value:function(){ts.sceneGraphService.resetLocalTransform(this)}},{key:"getAnimations",value:function(){return this.activeAnimations}},{key:"animate",value:function(t,e){var n,r=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;return r?r.play(this,t,e):null}},{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),r=0;e>r;r++)n[r]=arguments[r];var i=n[0],a=n[1];return i?function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e}(i)?(Object.keys(i).forEach(function(e){t.setAttribute(e,i[e])}),this):2===n.length?(this.setAttribute(i,a),this):this.attributes[i]:this.attributes}},{key:"getMatrix",value:function(t){var e=t||this.getWorldTransform(),n=g(z(hs,e),2),r=n[0],i=n[1],a=g(j(hs,e),2),o=a[0],s=a[1],u=X(fs,e),l=g(Mn(hs,u),3);return bn(l[0]||l[2],r,i,o,s)}},{key:"getLocalMatrix",value:function(){return this.getMatrix(this.getLocalTransform())}},{key:"setMatrix",value:function(t){var e=g(En(t),5),n=e[0],r=e[1],i=e[2],a=e[3];this.setEulerAngles(e[4]).setPosition(n,r).setLocalScale(i,a)}},{key:"setLocalMatrix",value:function(t){var e=g(En(t),5),n=e[0],r=e[1],i=e[2],a=e[3];this.setLocalEulerAngles(e[4]).setLocalPosition(n,r).setLocalScale(i,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}}])}(ss);ds.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 vs=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,e),p(this,e,[a({type:$e.CIRCLE},t)])}return m(e,t),u(e)}(ds);vs.PARSED_STYLE_LIST=new Set([].concat(h(ds.PARSED_STYLE_LIST),["cx","cy","cz","r","isBillboard","isSizeAttenuation"]));var ps=["style"],ys=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Qe(n,ps);return o(this,e),(t=p(this,e,[a({style:r},i)])).isCustomElement=!0,t}return m(e,t),u(e)}(ds);ys.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var ms=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,e),p(this,e,[a({type:$e.ELLIPSE},t)])}return m(e,t),u(e)}(ds);ms.PARSED_STYLE_LIST=new Set([].concat(h(ds.PARSED_STYLE_LIST),["cx","cy","cz","rx","ry","isBillboard","isSizeAttenuation"])),(function(t){function e(){return o(this,e),p(this,e,[{type:$e.FRAGMENT}])}return m(e,t),u(e)}(ds)).PARSED_STYLE_LIST=new Set(["class","className"]);var gs=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,e),p(this,e,[a({type:$e.GROUP},t)])}return m(e,t),u(e)}(ds);gs.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var xs=["style"],ks=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Qe(n,xs);return o(this,e),(t=p(this,e,[a({type:$e.HTML,style:r},i)])).cullable.enable=!1,t}return m(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=C(T(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!sn.isEmpty(e)){var n=new sn;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()}}])}(ds);ks.PARSED_STYLE_LIST=new Set([].concat(h(ds.PARSED_STYLE_LIST),["x","y","$el","innerHTML","width","height"]));var Ms=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,e),p(this,e,[a({type:$e.IMAGE},t)])}return m(e,t),u(e)}(ds);Ms.PARSED_STYLE_LIST=new Set([].concat(h(ds.PARSED_STYLE_LIST),["x","y","z","src","width","height","isBillboard","billboardRotation","isSizeAttenuation","keepAspectRatio"]));var bs=["style"],Es=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Qe(n,bs);o(this,e),(t=p(this,e,[a({type:$e.LINE,style:a({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},r)},i)])).markerStartAngle=0,t.markerEndAngle=0;var s=t.parsedStyle,u=s.markerStart,l=s.markerEnd;return u&&us(u)&&(t.markerStartAngle=u.getLocalEulerAngles(),t.appendChild(u)),l&&us(l)&&(t.markerEndAngle=l.getLocalEulerAngles(),t.appendChild(l)),t.transformMarker(!0),t.transformMarker(!1),t}return m(e,t),u(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&us(r)&&(this.markerStartAngle=0,r.remove()),i&&us(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&us(r)&&(this.markerEndAngle=0,r.remove()),i&&us(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=e.x1,a=e.x2,o=e.y1,s=e.y2,u=t?e.markerStart:e.markerEnd;if(u&&us(u)){var l,c,h,f,d,v,p;t?(f=i,d=o,c=a-i,h=s-o,v=n||0,p=this.markerStartAngle):(f=a,d=s,c=i-a,h=o-s,v=r||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,r=Ve(n.x1,n.y1,n.x2,n.y2,t),i=r.x,a=r.y,o=pt(nt(),at(i,a,0),e?this.getWorldTransform():this.getLocalTransform());return new cn(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 Ye(t.x1,t.y1,t.x2,t.y2)}}])}(ds);Es.PARSED_STYLE_LIST=new Set([].concat(h(ds.PARSED_STYLE_LIST),["x1","y1","x2","y2","z1","z2","isBillboard","isSizeAttenuation","markerStart","markerEnd","markerStartOffset","markerEndOffset"]));var Ts=["style"],ws=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Qe(n,Ts);o(this,e),(t=p(this,e,[a({type:$e.PATH,style:r,initialParsedStyle:{miterLimit:4,d:a({},Vn)}},i)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var s=t.parsedStyle,u=s.markerStart,l=s.markerEnd,c=s.markerMid;return u&&us(u)&&(t.markerStartAngle=u.getLocalEulerAngles(),t.appendChild(u)),c&&us(c)&&t.placeMarkerMid(c),l&&us(l)&&(t.markerEndAngle=l.getLocalEulerAngles(),t.appendChild(l)),t.transformMarker(!0),t.transformMarker(!1),t}return m(e,t),u(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"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?(r&&us(r)&&(this.markerStartAngle=0,r.remove()),i&&us(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&us(r)&&(this.markerEndAngle=0,r.remove()),i&&us(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=t?e.markerStart:e.markerEnd;if(i&&us(i)){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),y=p[0],m=p[1];u=m[0],l=m[1],o=y[0]-m[0],s=y[1]-m[1],c=r||0,h=this.markerEndAngle}i.setLocalEulerAngles(180*(a=Math.atan2(s,o))/Math.PI+h),i.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&&us(t))for(var n=1;e.length-1>n;n++){var r=g(e[n].currentPoint,2),i=r[0],a=r[1],o=1===n?t:t.cloneNode(!0);this.markerMidList.push(o),this.appendChild(o),o.setLocalPosition(i,a)}}},{key:"getTotalLength",value:function(){return Ni(this)}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=function(t,e,n){return Ce(t,e,qt(qt({},n),{bbox:!1,length:!0})).point}(this.parsedStyle.d.absolutePath,t),r=n.x,i=n.y,a=pt(nt(),at(r,i,0),e?this.getWorldTransform():this.getLocalTransform());return new cn(a[0],a[1])}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPointAtLength(t*Ni(this),e)}},{key:"getStartTangent",value:function(){var t=this.parsedStyle.d.segments,e=[];if(t.length>1){var n=t[0].currentPoint,r=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([n[0]-i[0],n[1]-i[1]]),e.push([n[0],n[1]])):(e.push([r[0],r[1]]),e.push([n[0],n[1]]))}return e}},{key:"getEndTangent",value:function(){var t=this.parsedStyle.d.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,a=t[e-1].endTangent;n=[],a?(n.push([i[0]-a[0],i[1]-a[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n}}])}(ds);ws.PARSED_STYLE_LIST=new Set([].concat(h(ds.PARSED_STYLE_LIST),["d","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard","isSizeAttenuation"]));var Ns=["style"],Ss=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Qe(n,Ns);o(this,e),(t=p(this,e,[a({type:$e.POLYGON,style:r,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},i)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var s=t.parsedStyle,u=s.markerStart,l=s.markerEnd,c=s.markerMid;return u&&us(u)&&(t.markerStartAngle=u.getLocalEulerAngles(),t.appendChild(u)),c&&us(c)&&t.placeMarkerMid(c),l&&us(l)&&(t.markerEndAngle=l.getLocalEulerAngles(),t.appendChild(l)),t.transformMarker(!0),t.transformMarker(!1),t}return m(e,t),u(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&us(r)&&(this.markerStartAngle=0,r.remove()),i&&us(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&us(r)&&(this.markerEndAngle=0,r.remove()),i&&us(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=(e.points||{}).points,a=t?e.markerStart:e.markerEnd;if(a&&us(a)&&i){var o,s,u,l,c,h,f;if(l=i[0][0],c=i[0][1],t)s=i[1][0]-i[0][0],u=i[1][1]-i[0][1],h=n||0,f=this.markerStartAngle;else{var d=i.length;this.parsedStyle.isClosed?(s=i[d-1][0]-i[0][0],u=i[d-1][1]-i[0][1]):(l=i[d-1][0],c=i[d-1][1],s=i[d-2][0]-i[d-1][0],u=i[d-2][1]-i[d-1][1]),h=r||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&&us(t)&&e)for(var n=1;(this.parsedStyle.isClosed?e.length:e.length-1)>n;n++){var r=e[n][0],i=e[n][1],a=1===n?t:t.cloneNode(!0);this.markerMidList.push(a),this.appendChild(a),a.setLocalPosition(r,i)}}}])}(ds);Ss.PARSED_STYLE_LIST=new Set([].concat(h(ds.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isClosed","isBillboard","isSizeAttenuation"]));var Ps=["style"],As=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,r=Qe(t,Ps);return o(this,e),p(this,e,[a({type:$e.POLYLINE,style:n,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},r)])}return m(e,t),u(e,[{key:"getTotalLength",value:function(){return 0===(t=this).parsedStyle.points.totalLength&&(t.parsedStyle.points.totalLength=We(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 r,i,a=[],o=0,s=this.getTotalLength();n.forEach(function(t,e){n[e+1]&&((r=[0,0])[0]=o/s,i=Ye(t[0],t[1],n[e+1][0],n[e+1][1]),r[1]=(o+=i)/s,a.push(r))}),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=Ve(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 cn(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}}])}(Ss);As.PARSED_STYLE_LIST=new Set([].concat(h(Ss.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard"]));var Cs=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,e),p(this,e,[a({type:$e.RECT},t)])}return m(e,t),u(e)}(ds);Cs.PARSED_STYLE_LIST=new Set([].concat(h(ds.PARSED_STYLE_LIST),["x","y","z","width","height","isBillboard","isSizeAttenuation","radius"]));var Os=["style"],Rs=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,r=Qe(t,Os);return o(this,e),p(this,e,[a({type:$e.TEXT,style:a({fill:"black"},n)},r)])}return m(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}}])}(ds);Rs.PARSED_STYLE_LIST=new Set([].concat(h(ds.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"])),(function(){function t(e){o(this,t),this.strategies=e}return u(t,[{key:"apply",value:function(e){var n=e.config,r=e.camera,i=e.renderingService,a=e.renderingContext,o=this.strategies;i.hooks.cull.tap(t.tag,function(t){if(t){var e,i=t.cullable;if(i.visible=0===o.length?a.unculledEntities.indexOf(t.entity)>-1:o.every(function(e){return e.isVisible(r,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 mo(Eo.CULLED),s,s),null}return t}),i.hooks.afterRender.tap(t.tag,function(t){t.cullable.visibilityPlaneMask=-1})}}])}()).tag="Culling",(function(){function t(){var e=this;o(this,t),this.autoPreventDefault=!1,this.rootPointerEvent=new po(null),this.rootWheelEvent=new yo(null),this.onPointerMove=function(t){var n,r=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView;if(!r.supportsTouchEvents||"touch"!==t.pointerType){var i,a=Ke(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)}},this.onClick=function(t){var n,r,i=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView,a=Ke(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)}}return u(t,[{key:"apply",value:function(e){var n=this;this.context=e;var r=e.renderingService,i=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler(function(t){return n.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null}),r.hooks.pointerWheel.tap(t.tag,function(t){var e=n.normalizeWheelEvent(t);n.context.eventService.mapEvent(e)}),r.hooks.pointerDown.tap(t.tag,function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e=n.normalizeToPointerEvent(t,i);if(n.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();var r,a=Ke(e);try{for(a.s();!(r=a.n()).done;){var o=n.bootstrapEvent(n.rootPointerEvent,r.value,i,t);n.context.eventService.mapEvent(o)}}catch(t){a.e(t)}finally{a.f()}n.setCursor(n.context.eventService.cursor)}}),r.hooks.pointerUp.tap(t.tag,function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e,r=n.context.contextService.getDomElement(),a=n.context.eventService.isNativeEventFromCanvas(r,t)?"":"outside",o=Ke(n.normalizeToPointerEvent(t,i));try{for(o.s();!(e=o.n()).done;){var s=n.bootstrapEvent(n.rootPointerEvent,e.value,i,t);s.type+=a,n.context.eventService.mapEvent(s)}}catch(t){o.e(t)}finally{o.f()}n.setCursor(n.context.eventService.cursor)}}),r.hooks.pointerMove.tap(t.tag,this.onPointerMove),r.hooks.pointerOver.tap(t.tag,this.onPointerMove),r.hooks.pointerOut.tap(t.tag,this.onPointerMove),r.hooks.click.tap(t.tag,this.onClick),r.hooks.pointerCancel.tap(t.tag,function(t){var e,r=Ke(n.normalizeToPointerEvent(t,i));try{for(r.s();!(e=r.n()).done;){var a=n.bootstrapEvent(n.rootPointerEvent,e.value,i,t);n.context.eventService.mapEvent(a)}}catch(t){r.e(t)}finally{r.f()}n.setCursor(n.context.eventService.cursor)})}},{key:"bootstrapEvent",value:function(t,e,n,r){t.view=n,t.originalEvent=null,t.nativeEvent=r,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var i=this.context.eventService.client2Viewport({x:e.clientX,y:e.clientY}),a=i.y;t.viewport.x=i.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=r.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=Pa[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}),r=n.y;e.viewport.x=n.x,e.viewport.y=r;var i=this.context.eventService.viewport2Canvas(e.viewport),a=i.y;return e.canvas.x=i.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=Aa.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 r=0;t.changedTouches.length>r;r++){var i=t.changedTouches[r];Ht(i.button)&&(i.button=0),Ht(i.buttons)&&(i.buttons=1),Ht(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),Ht(i.width)&&(i.width=i.radiusX||1),Ht(i.height)&&(i.height=i.radiusY||1),Ht(i.tiltX)&&(i.tiltX=0),Ht(i.tiltY)&&(i.tiltY=0),Ht(i.pointerType)&&(i.pointerType="touch"),Ht(i.pointerId)&&(i.pointerId=i.identifier||0),Ht(i.pressure)&&(i.pressure=i.force||.5),Ht(i.twist)&&(i.twist=0),Ht(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var a=t;Ht(a.isPrimary)&&(a.isPrimary=!0),Ht(a.width)&&(a.width=1),Ht(a.height)&&(a.height=1),Ht(a.tiltX)&&(a.tiltX=0),Ht(a.tiltY)&&(a.tiltY=0),Ht(a.pointerType)&&(a.pointerType="mouse"),Ht(a.pointerId)&&(a.pointerId=1),Ht(a.pressure)&&(a.pressure=.5),Ht(a.twist)&&(a.twist=0),Ht(a.tangentialPressure)&&(a.tangentialPressure=0),a.isNormalized=!0,n.push(a)}else n.push(t);return n}}])}()).tag="Event";var Ls=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,r,i=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){i.syncTasks.set(t.target,t.detail.affectChildren),o.dirtify()},c=function(t){ts.enableSizeAttenuation&&ts.styleValueRegistry.updateSizeAttenuation(t.target,s.getCamera().getZoom())},h=function(t){var e=t.target,n=e.rBushNode;null!=n&&n.aabb&&i.rBush.remove(n.aabb),i.syncTasks.delete(e),ts.sceneGraphService.dirtyToRoot(e),o.dirtify()};o.hooks.init.tap(t.tag,function(){s.addEventListener(Eo.MOUNTED,c),s.addEventListener(Eo.UNMOUNTED,h),s.addEventListener(Eo.ATTR_MODIFIED,u),s.addEventListener(Eo.BOUNDS_CHANGED,l)}),o.hooks.destroy.tap(t.tag,function(){s.removeEventListener(Eo.MOUNTED,c),s.removeEventListener(Eo.UNMOUNTED,h),s.removeEventListener(Eo.ATTR_MODIFIED,u),s.removeEventListener(Eo.BOUNDS_CHANGED,l),i.syncTasks.clear()});var f=null!==(n=ts.globalThis.requestIdleCallback)&&void 0!==n?n:Ua.bind(ts.globalThis),d=!0===(null===(r=a.future)||void 0===r?void 0:r.experimentalRICSyncRTree);o.hooks.endFrame.tap(t.tag,function(){i.isFirstTimeRendering?(i.isFirstTimeRendering=!1,i.syncing=!0,f(function(){i.syncRTree(!0),i.isFirstTimeRenderingFinished=!0})):d&&ts.globalThis.requestIdleCallback&&ts.globalThis.cancelIdleCallback?(ts.globalThis.cancelIdleCallback(i.ricSyncRTreeId),i.ricSyncRTreeId=ts.globalThis.requestIdleCallback(function(){return i.syncRTree()})):i.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 r=t.getRenderBounds();if(r){var i=t.renderable;e&&(i.dirtyRenderBounds||(i.dirtyRenderBounds=new sn),i.dirtyRenderBounds.update(r.center,r.halfExtents));var a=g(r.getMin(),2),o=a[0],s=a[1],u=g(r.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=[],r=new Set,i=function(i){if(!r.has(i)&&i.renderable){var a=t.syncNode(i,e);a&&(n.push(a),r.add(i))}};this.syncTasks.forEach(function(t,e){t&&e.forEach(i);for(var n=e;n;)i(n),n=n.parentElement}),this.rBush.load(n),n.length=0,this.syncing=!1}}}])}();Ls.tag="Prepare";var Is=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}({});new mo(Eo.MOUNTED),new mo(Eo.UNMOUNTED),new mo(Is.BEFORE_RENDER),new mo(Is.RERENDER),new mo(Is.AFTER_RENDER);var Ds=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=p(this,e,[].concat(r))).landmarks=[],t}return m(e,t),u(e,[{key:"rotate",value:function(t,e,n){if(this.relElevation=dn(e),this.relAzimuth=dn(t),this.relRoll=dn(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===Cn.EXPLORING){var r=Tt(Et(),[1,0,0],mn((this.rotateWorld?1:-1)*this.relElevation)),i=Tt(Et(),[0,1,0],mn((this.rotateWorld?1:-1)*this.relAzimuth)),a=Tt(Et(),[0,0,1],mn(this.relRoll)),o=wt(Et(),i,r);o=wt(Et(),o,a);var s=H(T(),o);L(this.matrix,this.matrix,[0,0,-this.distance]),R(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===Cn.ORBITING||this.type===Cn.EXPLORING?this._getPosition():this.type===Cn.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(t,e){var n=pn(t,e,0),r=rt(this.position);return ut(r,r,ct(nt(),this.right,n[0])),ut(r,r,ct(nt(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this}},{key:"dolly",value:function(t){var e,n=this.forward,r=rt(this.position);return r[0]+=(e=Math.max(Math.min(this.distance+t*this.dollyingStep,this.maxDistance),this.minDistance)-this.distance)*n[0],r[1]+=e*n[1],r[2]+=e*n[2],this._setPosition(r),this.type===Cn.ORBITING||this.type===Cn.EXPLORING?this._getDistance():this.type===Cn.TRACKING&&ut(this.focalPoint,r,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,r,i,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 ts.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!==(r=l[1])&&void 0!==r?r:this.focalPoint[1],null!==(i=l[2])&&void 0!==i?i: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:rt(f.right),up:rt(f.up),forward:rt(f.forward),position:rt(f.getPosition()),focalPoint:rt(f.getFocalPoint()),distanceVector:rt(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]:{},r=Yt(t)?this.landmarks.find(function(e){return e.name===t}):t;if(r){var i=zt(n)?{duration:n}:n,a=i.easing,o=void 0===a?"linear":a,s=i.duration,u=void 0===s?100:s,l=i.easingFunction,c=void 0===l?void 0:l,h=i.onfinish,f=void 0===h?void 0:h,d=i.onframe,v=void 0===d?void 0:d;this.cancelLandmarkAnimation();var p,y=r.position,m=r.focalPoint,g=r.zoom,x=r.roll,k=c||ts.EasingFunction(o),M=function(){e.setFocalPoint(m),e.setPosition(y),e.setRoll(x),e.setZoom(g),e.computeMatrix(),e.triggerUpdate(),null==f||f()};if(0===u)return M();var b=function(t){void 0===p&&(p=t);var n=t-p;if(u>n){var r,i,a=k(n/u),o=nt(),s=nt();if(vt(o,e.focalPoint,m,a),vt(s,e.position,y,a),i=e.roll*(1-a)+x*a,r=e.zoom*(1-a)+g*a,e.setFocalPoint(o),e.setPosition(s),e.setRoll(i),e.setZoom(r),.01>=gt(o,m)+gt(s,y)&&void 0===g&&void 0===x)return M();e.computeMatrix(),e.triggerUpdate(),u>n&&(null==v||v(a),e.landmarkAnimationID=e.canvas.requestAnimationFrame(b))}else M()};this.canvas.requestAnimationFrame(b)}}}])}(Dn);ts.CameraContribution=Ds,t.AdvancedCamera=Ds});
|
|
//# sourceMappingURL=index.umd.min.js.map
|
|
|