@antv/g 5.16.10 → 5.16.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G={})}(this,(function(t){"use strict";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function e(t,e,n){return t(n={path:e,exports:{},require:function(t,e){return function(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},n.exports),n.exports}var n=e((function(t,e){t.exports=function(){function t(t,n,i,o,a){e(t,n,i||0,o||t.length-1,a||r)}function e(t,r,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=r-i+1,c=Math.log(s),l=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*l*(s-l)/s)*(0>u-s/2?-1:1);e(t,r,Math.max(i,Math.floor(r-u*l/s+h)),Math.min(o,Math.floor(r+(s-u)*l/s+h)),a)}var f=t[r],d=i,p=o;for(n(t,i,r),a(t[o],f)>0&&n(t,i,o);p>d;){for(n(t,d,p),d++,p--;0>a(t[d],f);)d++;for(;a(t[p],f)>0;)p--}0===a(t[i],f)?n(t,i,p):n(t,++p,o),p>r||(i=p+1),r>p||(o=p-1)}}function n(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function r(t,e){return e>t?-1:t>e?1:0}var i=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(t,e,n){if(!n)return e.indexOf(t);for(var r=0;e.length>r;r++)if(n(t,e[r]))return r;return-1}function a(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,r,i){i||(i=y(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=e;n>o;o++){var a=t.children[o];u(i,t.leaf?r(a):a)}return i}function u(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function c(t,e){return t.minX-e.minX}function l(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 p(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function v(t,e){return!(t.minX>e.minX||t.minY>e.minY||e.maxX>t.maxX||e.maxY>t.maxY)}function m(t,e){return!(e.minX>t.maxX||e.minY>t.maxY||t.minX>e.maxX||t.minY>e.maxY)}function y(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(e,n,r,i,o){for(var a=[n,r];a.length;)if((r=a.pop())-(n=a.pop())>i){var s=n+Math.ceil((r-n)/i/2)*i;t(e,s,n,r,o),a.push(n,s,s,r)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,n=[];if(!m(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;e.children.length>o;o++){var a=e.children[o],s=e.leaf?r(a):a;m(t,s)&&(e.leaf?n.push(a):v(t,s)?this._all(a,n):i.push(a))}e=i.pop()}return n},i.prototype.collides=function(t){var e=this.data;if(!m(t,e))return!1;for(var n=[];e;){for(var r=0;e.children.length>r;r++){var i=e.children[r],o=e.leaf?this.toBBox(i):i;if(m(t,o)){if(e.leaf||v(t,o))return!0;n.push(i)}}e=n.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(this._minEntries>t.length){for(var e=0;t.length>e;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(n.height>this.data.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=y([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,r,i,a=this.data,s=this.toBBox(t),u=[],c=[];a||u.length;){if(a||(a=u.pop(),r=u[u.length-1],n=c.pop(),i=!0),a.leaf){var l=o(t,a.children,e);if(-1!==l)return a.children.splice(l,1),u.push(a),this._condense(u),this}i||a.leaf||!v(a,s)?r?(n++,a=r.children[n],i=!1):a=null:(u.push(a),c.push(n),n=0,r=a,a=a.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},i.prototype._build=function(t,e,n,r){var i,o=n-e+1,s=this._maxEntries;if(s>=o)return a(i=y(t.slice(e,n+1)),this.toBBox),i;r||(s=Math.ceil(o/Math.pow(s,(r=Math.ceil(Math.log(o)/Math.log(s)))-1))),(i=y([])).leaf=!1,i.height=r;var u=Math.ceil(o/s),c=u*Math.ceil(Math.sqrt(s));g(t,e,n,c,this.compareMinX);for(var l=e;n>=l;l+=c){var h=Math.min(l+c-1,n);g(t,l,h,u,this.compareMinY);for(var f=l;h>=f;f+=u)i.children.push(this._build(t,f,Math.min(f+u-1,h),r-1))}return a(i,this.toBBox),i},i.prototype._chooseSubtree=function(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){for(var i=1/0,o=1/0,a=void 0,s=0;e.children.length>s;s++){var u=e.children[s],c=h(u),l=d(t,u)-c;o>l?(o=l,i=i>c?c:i,a=u):l===o&&i>c&&(i=c,a=u)}e=a||e.children[0]}return e},i.prototype._insert=function(t,e,n){var r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),u(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)},i.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=y(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,a(n,this.toBBox),a(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},i.prototype._splitRoot=function(t,e){this.data=y([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,n){for(var r,i=1/0,o=1/0,a=e;n-e>=a;a++){var u=s(t,0,a,this.toBBox),c=s(t,a,n,this.toBBox),l=p(u,c),f=h(u)+h(c);i>l?(i=l,r=a,o=o>f?f:o):l===i&&o>f&&(o=f,r=a)}return r||n-e},i.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:c,i=t.leaf?this.compareMinY:l,o=this._allDistMargin(t,e,n,r);this._allDistMargin(t,e,n,i)>o&&t.children.sort(r)},i.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,o=s(t,0,e,i),a=s(t,n-e,n,i),c=f(o)+f(a),l=e;n-e>l;l++){var h=t.children[l];u(o,t.leaf?i(h):h),c+=f(o)}for(var d=n-e-1;d>=e;d--){var p=t.children[d];u(a,t.leaf?i(p):p),c+=f(a)}return c},i.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)u(e[r],t)},i.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():a(t[e],this.toBBox)},i}()})),r=1e-6,i="undefined"!=typeof Float32Array?Float32Array:Array;function o(){var t=new i(9);return i!=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 a(){var t=new i(16);return i!=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 s(t){var e=new i(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 u(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 c(t,e,n,r,i,o,a,s,u,c,l,h,f,d,p,v,m){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=c,t[9]=l,t[10]=h,t[11]=f,t[12]=d,t[13]=p,t[14]=v,t[15]=m,t}function l(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 h(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function f(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],f=e[10],d=e[11],p=e[12],v=e[13],m=e[14],y=e[15],g=n*s-r*a,x=n*u-i*a,E=n*c-o*a,b=r*u-i*s,T=r*c-o*s,S=i*c-o*u,P=l*v-h*p,w=l*m-f*p,M=l*y-d*p,k=h*m-f*v,N=h*y-d*v,C=f*y-d*m,A=g*C-x*N+E*k+b*M-T*w+S*P;return A?(t[0]=(s*C-u*N+c*k)*(A=1/A),t[1]=(i*N-r*C-o*k)*A,t[2]=(v*S-m*T+y*b)*A,t[3]=(f*T-h*S-d*b)*A,t[4]=(u*M-a*C-c*w)*A,t[5]=(n*C-i*M+o*w)*A,t[6]=(m*E-p*S-y*x)*A,t[7]=(l*S-f*E+d*x)*A,t[8]=(a*N-s*M+c*P)*A,t[9]=(r*M-n*N-o*P)*A,t[10]=(p*T-v*E+y*g)*A,t[11]=(h*E-l*T-d*g)*A,t[12]=(s*w-a*k-u*P)*A,t[13]=(n*k-r*w+i*P)*A,t[14]=(v*x-p*b-m*g)*A,t[15]=(l*b-h*x+f*g)*A,t):null}function d(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],h=t[10],f=t[11],d=t[12],p=t[13],v=t[14],m=t[15];return(e*a-n*o)*(h*m-f*v)-(e*s-r*o)*(l*m-f*p)+(e*u-i*o)*(l*v-h*p)+(n*s-r*a)*(c*m-f*d)-(n*u-i*a)*(c*v-h*d)+(r*u-i*s)*(c*p-l*d)}function p(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=e[9],d=e[10],p=e[11],v=e[12],m=e[13],y=e[14],g=e[15],x=n[0],E=n[1],b=n[2],T=n[3];return t[0]=x*r+E*s+b*h+T*v,t[1]=x*i+E*u+b*f+T*m,t[2]=x*o+E*c+b*d+T*y,t[3]=x*a+E*l+b*p+T*g,t[4]=(x=n[4])*r+(E=n[5])*s+(b=n[6])*h+(T=n[7])*v,t[5]=x*i+E*u+b*f+T*m,t[6]=x*o+E*c+b*d+T*y,t[7]=x*a+E*l+b*p+T*g,t[8]=(x=n[8])*r+(E=n[9])*s+(b=n[10])*h+(T=n[11])*v,t[9]=x*i+E*u+b*f+T*m,t[10]=x*o+E*c+b*d+T*y,t[11]=x*a+E*l+b*p+T*g,t[12]=(x=n[12])*r+(E=n[13])*s+(b=n[14])*h+(T=n[15])*v,t[13]=x*i+E*u+b*f+T*m,t[14]=x*o+E*c+b*d+T*y,t[15]=x*a+E*l+b*p+T*g,t}function v(t,e,n){var r,i,o,a,s,u,c,l,h,f,d,p,v=n[0],m=n[1],y=n[2];return e===t?(t[12]=e[0]*v+e[4]*m+e[8]*y+e[12],t[13]=e[1]*v+e[5]*m+e[9]*y+e[13],t[14]=e[2]*v+e[6]*m+e[10]*y+e[14],t[15]=e[3]*v+e[7]*m+e[11]*y+e[15]):(i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=e[9],d=e[10],p=e[11],t[0]=r=e[0],t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=c,t[7]=l,t[8]=h,t[9]=f,t[10]=d,t[11]=p,t[12]=r*v+s*m+h*y+e[12],t[13]=i*v+u*m+f*y+e[13],t[14]=o*v+c*m+d*y+e[14],t[15]=a*v+l*m+p*y+e[15]),t}function m(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function y(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=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]=o*i+c*r,t[5]=a*i+l*r,t[6]=s*i+h*r,t[7]=u*i+f*r,t[8]=c*i-o*r,t[9]=l*i-a*r,t[10]=h*i-s*r,t[11]=f*i-u*r,t}function g(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],c=e[8],l=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]=o*i-c*r,t[1]=a*i-l*r,t[2]=s*i-h*r,t[3]=u*i-f*r,t[8]=o*r+c*i,t[9]=a*r+l*i,t[10]=s*r+h*i,t[11]=u*r+f*i,t}function x(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 E(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=r+r,u=i+i,c=o+o,l=r*s,h=r*u,f=r*c,d=i*u,p=i*c,v=o*c,m=a*s,y=a*u,g=a*c;return t[0]=1-(d+v),t[1]=h+g,t[2]=f-y,t[3]=0,t[4]=h-g,t[5]=1-(l+v),t[6]=p+m,t[7]=0,t[8]=f+y,t[9]=p-m,t[10]=1-(l+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function b(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function T(t,e){var n=e[4],r=e[5],i=e[6],o=e[8],a=e[9],s=e[10];return t[0]=Math.hypot(e[0],e[1],e[2]),t[1]=Math.hypot(n,r,i),t[2]=Math.hypot(o,a,s),t}function S(t,e){var n=new i(3);T(n,e);var r=1/n[0],o=1/n[1],a=1/n[2],s=e[0]*r,u=e[1]*o,c=e[2]*a,l=e[4]*r,h=e[5]*o,f=e[6]*a,d=e[8]*r,p=e[9]*o,v=e[10]*a,m=s+h+v,y=0;return m>0?(t[3]=.25*(y=2*Math.sqrt(m+1)),t[0]=(f-p)/y,t[1]=(d-c)/y,t[2]=(u-l)/y):s>h&&s>v?(t[3]=(f-p)/(y=2*Math.sqrt(1+s-h-v)),t[0]=.25*y,t[1]=(u+l)/y,t[2]=(d+c)/y):h>v?(t[3]=(d-c)/(y=2*Math.sqrt(1+h-s-v)),t[0]=(u+l)/y,t[1]=.25*y,t[2]=(f+p)/y):(t[3]=(u-l)/(y=2*Math.sqrt(1+v-s-h)),t[0]=(d+c)/y,t[1]=(f+p)/y,t[2]=.25*y),t}function P(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],u=e[3],c=o+o,l=a+a,h=s+s,f=o*c,d=o*l,p=o*h,v=a*l,m=a*h,y=s*h,g=u*c,x=u*l,E=u*h,b=r[0],T=r[1],S=r[2],P=i[0],w=i[1],M=i[2],k=(1-(v+y))*b,N=(d+E)*b,C=(p-x)*b,A=(d-E)*T,O=(1-(f+y))*T,L=(m+g)*T,R=(p+x)*S,_=(m-g)*S,I=(1-(f+v))*S;return t[0]=k,t[1]=N,t[2]=C,t[3]=0,t[4]=A,t[5]=O,t[6]=L,t[7]=0,t[8]=R,t[9]=_,t[10]=I,t[11]=0,t[12]=n[0]+P-(k*P+A*w+R*M),t[13]=n[1]+w-(N*P+O*w+_*M),t[14]=n[2]+M-(C*P+L*w+I*M),t[15]=1,t}function w(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,c=n*a,l=r*a,h=r*s,f=i*a,d=i*s,p=i*u,v=o*a,m=o*s,y=o*u;return t[0]=1-h-p,t[1]=l+y,t[2]=f-m,t[3]=0,t[4]=l-y,t[5]=1-c-p,t[6]=d+v,t[7]=0,t[8]=f+m,t[9]=d-v,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function M(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=(i+r)*(o=1/(r-i)),t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t}function k(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=(a+o)*c,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 N=k;function C(t,e,n,i){var o,a,s,u,c,h,f,d,p,v,m=e[0],y=e[1],g=e[2],x=i[0],E=i[1],b=i[2],T=n[0],S=n[1],P=n[2];return r>Math.abs(m-T)&&r>Math.abs(y-S)&&r>Math.abs(g-P)?l(t):(v=1/Math.hypot(f=m-T,d=y-S,p=g-P),(v=Math.hypot(o=E*(p*=v)-b*(d*=v),a=b*(f*=v)-x*p,s=x*d-E*f))?(o*=v=1/v,a*=v,s*=v):(o=0,a=0,s=0),(v=Math.hypot(u=d*s-p*a,c=p*o-f*s,h=f*a-d*o))?(u*=v=1/v,c*=v,h*=v):(u=0,c=0,h=0),t[0]=o,t[1]=u,t[2]=f,t[3]=0,t[4]=a,t[5]=c,t[6]=d,t[7]=0,t[8]=s,t[9]=h,t[10]=p,t[11]=0,t[12]=-(o*m+a*y+s*g),t[13]=-(u*m+c*y+h*g),t[14]=-(f*m+d*y+p*g),t[15]=1,t)}function A(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 O=Object.freeze({__proto__:null,create:a,clone:s,copy:u,fromValues:function(t,e,n,r,o,a,s,u,c,l,h,f,d,p,v,m){var y=new i(16);return y[0]=t,y[1]=e,y[2]=n,y[3]=r,y[4]=o,y[5]=a,y[6]=s,y[7]=u,y[8]=c,y[9]=l,y[10]=h,y[11]=f,y[12]=d,y[13]=p,y[14]=v,y[15]=m,y},set:c,identity:l,transpose:h,invert:f,adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],f=e[10],d=e[11],p=e[12],v=e[13],m=e[14],y=e[15];return t[0]=s*(f*y-d*m)-h*(u*y-c*m)+v*(u*d-c*f),t[1]=-(r*(f*y-d*m)-h*(i*y-o*m)+v*(i*d-o*f)),t[2]=r*(u*y-c*m)-s*(i*y-o*m)+v*(i*c-o*u),t[3]=-(r*(u*d-c*f)-s*(i*d-o*f)+h*(i*c-o*u)),t[4]=-(a*(f*y-d*m)-l*(u*y-c*m)+p*(u*d-c*f)),t[5]=n*(f*y-d*m)-l*(i*y-o*m)+p*(i*d-o*f),t[6]=-(n*(u*y-c*m)-a*(i*y-o*m)+p*(i*c-o*u)),t[7]=n*(u*d-c*f)-a*(i*d-o*f)+l*(i*c-o*u),t[8]=a*(h*y-d*v)-l*(s*y-c*v)+p*(s*d-c*h),t[9]=-(n*(h*y-d*v)-l*(r*y-o*v)+p*(r*d-o*h)),t[10]=n*(s*y-c*v)-a*(r*y-o*v)+p*(r*c-o*s),t[11]=-(n*(s*d-c*h)-a*(r*d-o*h)+l*(r*c-o*s)),t[12]=-(a*(h*m-f*v)-l*(s*m-u*v)+p*(s*f-u*h)),t[13]=n*(h*m-f*v)-l*(r*m-i*v)+p*(r*f-i*h),t[14]=-(n*(s*m-u*v)-a*(r*m-i*v)+p*(r*u-i*s)),t[15]=n*(s*f-u*h)-a*(r*f-i*h)+l*(r*u-i*s),t},determinant:d,multiply:p,translate:v,scale:m,rotate:function(t,e,n,i){var o,a,s,u,c,l,h,f,d,p,v,m,y,g,x,E,b,T,S,P,w,M,k,N,C=i[0],A=i[1],O=i[2],L=Math.hypot(C,A,O);return r>L?null:(C*=L=1/L,A*=L,O*=L,o=Math.sin(n),c=e[1],l=e[2],h=e[3],d=e[5],p=e[6],v=e[7],y=e[9],g=e[10],x=e[11],S=C*A*(s=1-(a=Math.cos(n)))-O*o,P=A*A*s+a,w=O*A*s+C*o,M=C*O*s+A*o,k=A*O*s-C*o,N=O*O*s+a,t[0]=(u=e[0])*(E=C*C*s+a)+(f=e[4])*(b=A*C*s+O*o)+(m=e[8])*(T=O*C*s-A*o),t[1]=c*E+d*b+y*T,t[2]=l*E+p*b+g*T,t[3]=h*E+v*b+x*T,t[4]=u*S+f*P+m*w,t[5]=c*S+d*P+y*w,t[6]=l*S+p*P+g*w,t[7]=h*S+v*P+x*w,t[8]=u*M+f*k+m*N,t[9]=c*M+d*k+y*N,t[10]=l*M+p*k+g*N,t[11]=h*M+v*k+x*N,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:y,rotateY:g,rotateZ:function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],c=e[4],l=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]=o*i+c*r,t[1]=a*i+l*r,t[2]=s*i+h*r,t[3]=u*i+f*r,t[4]=c*i-o*r,t[5]=l*i-a*r,t[6]=h*i-s*r,t[7]=f*i-u*r,t},fromTranslation:x,fromScaling:function(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},fromRotation:function(t,e,n){var i,o,a,s=n[0],u=n[1],c=n[2],l=Math.hypot(s,u,c);return r>l?null:(s*=l=1/l,u*=l,c*=l,i=Math.sin(e),t[0]=s*s*(a=1-(o=Math.cos(e)))+o,t[1]=u*s*a+c*i,t[2]=c*s*a-u*i,t[3]=0,t[4]=s*u*a-c*i,t[5]=u*u*a+o,t[6]=c*u*a+s*i,t[7]=0,t[8]=s*c*a+u*i,t[9]=u*c*a-s*i,t[10]=c*c*a+o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},fromXRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromYRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromZRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromRotationTranslation:E,fromQuat2:function(t,e){var n=new i(3),r=-e[0],o=-e[1],a=-e[2],s=e[3],u=e[4],c=e[5],l=e[6],h=e[7],f=r*r+o*o+a*a+s*s;return f>0?(n[0]=2*(u*s+h*r+c*a-l*o)/f,n[1]=2*(c*s+h*o+l*r-u*a)/f,n[2]=2*(l*s+h*a+u*o-c*r)/f):(n[0]=2*(u*s+h*r+c*a-l*o),n[1]=2*(c*s+h*o+l*r-u*a),n[2]=2*(l*s+h*a+u*o-c*r)),E(t,e,n),t},getTranslation:b,getScaling:T,getRotation:S,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],u=i+i,c=o+o,l=a+a,h=i*u,f=i*c,d=i*l,p=o*c,v=o*l,m=a*l,y=s*u,g=s*c,x=s*l,E=r[0],b=r[1],T=r[2];return t[0]=(1-(p+m))*E,t[1]=(f+x)*E,t[2]=(d-g)*E,t[3]=0,t[4]=(f-x)*b,t[5]=(1-(h+m))*b,t[6]=(v+y)*b,t[7]=0,t[8]=(d+g)*T,t[9]=(v-y)*T,t[10]=(1-(h+p))*T,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:P,fromQuat:w,frustum:function(t,e,n,r,i,o,a){var s=1/(n-e),u=1/(i-r),c=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*u,t[10]=(a+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*c,t[15]=0,t},perspectiveNO:M,perspective:M,perspectiveZO:function(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=i*(o=1/(r-i)),t[14]=i*r*o):(t[10]=-1,t[14]=-r),t},perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+s),c=2/(i+o);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(a-s)*u*.5,t[9]=(i-o)*c*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},orthoNO:k,ortho:N,orthoZO:function(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=o*c,t[15]=1,t},lookAt:C,targetTo:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=r[0],u=r[1],c=r[2],l=i-n[0],h=o-n[1],f=a-n[2],d=l*l+h*h+f*f;d>0&&(l*=d=1/Math.sqrt(d),h*=d,f*=d);var p=u*f-c*h,v=c*l-s*f,m=s*h-u*l;return(d=p*p+v*v+m*m)>0&&(p*=d=1/Math.sqrt(d),v*=d,m*=d),t[0]=p,t[1]=v,t[2]=m,t[3]=0,t[4]=h*m-f*v,t[5]=f*p-l*m,t[6]=l*v-h*p,t[7]=0,t[8]=l,t[9]=h,t[10]=f,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t},str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},subtract:A,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},equals:function(t,e){var n=t[0],i=t[1],o=t[2],a=t[3],s=t[4],u=t[5],c=t[6],l=t[7],h=t[8],f=t[9],d=t[10],p=t[11],v=t[12],m=t[13],y=t[14],g=t[15],x=e[0],E=e[1],b=e[2],T=e[3],S=e[4],P=e[5],w=e[6],M=e[7],k=e[8],N=e[9],C=e[10],A=e[11],O=e[12],L=e[13],R=e[14],_=e[15];return!(Math.abs(n-x)>r*Math.max(1,Math.abs(n),Math.abs(x))||Math.abs(i-E)>r*Math.max(1,Math.abs(i),Math.abs(E))||Math.abs(o-b)>r*Math.max(1,Math.abs(o),Math.abs(b))||Math.abs(a-T)>r*Math.max(1,Math.abs(a),Math.abs(T))||Math.abs(s-S)>r*Math.max(1,Math.abs(s),Math.abs(S))||Math.abs(u-P)>r*Math.max(1,Math.abs(u),Math.abs(P))||Math.abs(c-w)>r*Math.max(1,Math.abs(c),Math.abs(w))||Math.abs(l-M)>r*Math.max(1,Math.abs(l),Math.abs(M))||Math.abs(h-k)>r*Math.max(1,Math.abs(h),Math.abs(k))||Math.abs(f-N)>r*Math.max(1,Math.abs(f),Math.abs(N))||Math.abs(d-C)>r*Math.max(1,Math.abs(d),Math.abs(C))||Math.abs(p-A)>r*Math.max(1,Math.abs(p),Math.abs(A))||Math.abs(v-O)>r*Math.max(1,Math.abs(v),Math.abs(O))||Math.abs(m-L)>r*Math.max(1,Math.abs(m),Math.abs(L))||Math.abs(y-R)>r*Math.max(1,Math.abs(y),Math.abs(R))||Math.abs(g-_)>r*Math.max(1,Math.abs(g),Math.abs(_)))},mul:p,sub:A});function L(){var t=new i(3);return i!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function R(t){var e=new i(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function _(t){return Math.hypot(t[0],t[1],t[2])}function I(t,e,n){var r=new i(3);return r[0]=t,r[1]=e,r[2]=n,r}function D(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function F(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function G(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function B(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function U(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function z(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function j(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function V(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=i*u-o*s,t[1]=o*a-r*u,t[2]=r*s-i*a,t}function H(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}function W(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/(a=a||1),t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function Y(t,e){var n=t[0],i=t[1],o=t[2],a=e[0],s=e[1],u=e[2];return r*Math.max(1,Math.abs(n),Math.abs(a))>=Math.abs(n-a)&&r*Math.max(1,Math.abs(i),Math.abs(s))>=Math.abs(i-s)&&r*Math.max(1,Math.abs(o),Math.abs(u))>=Math.abs(o-u)}var X,q=function(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1],e[2]-t[2])},K=_;X=L();function Z(){var t=new i(4);return i!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Q(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}!function(){var t=Z()}();function $(){var t=new i(4);return i!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function J(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 tt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],u=n[1],c=n[2],l=n[3];return t[0]=r*l+a*s+i*c-o*u,t[1]=i*l+a*u+o*s-r*c,t[2]=o*l+a*c+r*u-i*s,t[3]=a*l-r*s-i*u-o*c,t}function et(t,e,n,i){var o,a,s,u,c,l=e[0],h=e[1],f=e[2],d=e[3],p=n[0],v=n[1],m=n[2],y=n[3];return 0>(a=l*p+h*v+f*m+d*y)&&(a=-a,p=-p,v=-v,m=-m,y=-y),1-a>r?(s=Math.sin(o=Math.acos(a)),u=Math.sin((1-i)*o)/s,c=Math.sin(i*o)/s):(u=1-i,c=i),t[0]=u*l+c*p,t[1]=u*h+c*v,t[2]=u*f+c*m,t[3]=u*d+c*y,t}function nt(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,t}function rt(t,e,n,r){var i=.5*Math.PI/180;n*=i,r*=i;var o=Math.sin(e*=i),a=Math.cos(e),s=Math.sin(n),u=Math.cos(n),c=Math.sin(r),l=Math.cos(r);return t[0]=o*u*l-a*s*c,t[1]=a*s*l+o*u*c,t[2]=a*u*c-o*s*l,t[3]=a*u*l+o*s*c,t}var it,ot,at,st,ut,ct,lt=function(t,e,n,r){var o=new i(4);return o[0]=t,o[1]=e,o[2]=n,o[3]=r,o},ht=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},ft=tt,dt=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t};it=L(),ot=I(1,0,0),at=I(0,1,0),st=$(),ut=$(),ct=o();!function(){var t,e=(t=new i(2),i!=Float32Array&&(t[0]=0,t[1]=0),t)}();function pt(t){return t.map((function(t){return Array.isArray(t)?[].concat(t):t}))}var vt=function(){return vt=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},vt.apply(this,arguments)},mt={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function yt(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 gt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function xt(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return gt[e]===t.length-1&&"achlmqstvz".includes(e)}))}function Et(t){return xt(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function bt(t){return Et(t)&&t.every((function(t){return"ACLMQZ".includes(t[0])}))}function Tt(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=gt[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,gt[n]))),gt[n]););}function St(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'+n[e]+'", expecting 0 or 1 at index '+e)}function Pt(t){return t>=48&&57>=t||43===t||45===t||46===t}function wt(t){return t>=48&&57>=t}function Mt(t){var e,n=t.max,r=t.pathValue,i=t.index,o=i,a=!1,s=!1,u=!1,c=!1;if(n>o)if(43!==(e=r.charCodeAt(o))&&45!==e||(e=r.charCodeAt(o+=1)),wt(e)||46===e){if(46!==e){if(a=48===e,e=r.charCodeAt(o+=1),a&&n>o&&e&&wt(e))return void(t.err="[path-util]: Invalid path value at index "+i+', "'+r[i]+'" illegal number');for(;n>o&&wt(r.charCodeAt(o));)o+=1,s=!0;e=r.charCodeAt(o)}if(46===e){for(c=!0,o+=1;wt(r.charCodeAt(o));)o+=1,u=!0;e=r.charCodeAt(o)}if(101===e||69===e){if(c&&!s&&!u)return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid float exponent');if(43!==(e=r.charCodeAt(o+=1))&&45!==e||(o+=1),o>=n||!wt(r.charCodeAt(o)))return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid integer exponent');for(;n>o&&wt(r.charCodeAt(o));)o+=1}t.index=o,t.param=+t.pathValue.slice(i,o)}else t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" is not a number';else t.err="[path-util]: Invalid path value at index "+o+', "pathValue" is missing param'}function kt(t){for(var e,n=t.pathValue,r=t.max;r>t.index&&(10===(e=n.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function Nt(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),o=gt[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,kt(t),t.data=[],o){for(;;){for(var a=o;a>0;a-=1){if(97!=(32|i)||3!==a&&4!==a?Mt(t):St(t),t.err.length)return;t.data.push(t.param),kt(t),e>t.index&&44===n.charCodeAt(t.index)&&(t.index+=1,kt(t))}if(t.index>=t.max)break;if(!Pt(n.charCodeAt(t.index)))break}Tt(t)}else Tt(t);else t.err='[path-util]: Invalid path value "'+n[r]+'" is not a path command'}var Ct=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 At(t){if(Et(t))return pt(t);var e=function(t){if(xt(t))return pt(t);var e=new Ct(t);for(kt(e);e.max>e.index&&!e.err.length;)Nt(e);return e.err?e.err:e.segments}(t),n=0,r=0,i=0,o=0;return e.map((function(t){var e,a=t.slice(1).map(Number),s=t[0],u=s.toUpperCase();if("M"===s)return i=n=a[0],o=r=a[1],["M",n,r];if(s!==u)switch(u){case"A":e=[u,a[0],a[1],a[2],a[3],a[4],a[5]+n,a[6]+r];break;case"V":e=[u,a[0]+r];break;case"H":e=[u,a[0]+n];break;default:var c=a.map((function(t,e){return t+(e%2?r:n)}));e=[u].concat(c)}else e=[u].concat(a);var l=e.length;switch(u){case"Z":n=i,r=o;break;case"H":n=e[1];break;case"V":r=e[1];break;default:n=e[l-2],r=e[l-1],"M"===u&&(i=n,o=r)}return e}))}function Ot(t,e){var n=t[0],r=e.x1,i=e.y1,o=e.x2,a=e.y2,s=t.slice(1).map(Number),u=t;if("TQ".includes(n)||(e.qx=null,e.qy=null),"H"===n)u=["L",t[1],i];else if("V"===n)u=["L",r,t[1]];else if("S"===n){var c=2*r-o,l=2*i-a;e.x1=c,e.y1=l,u=["C",c,l].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 Lt(t){if(bt(t))return pt(t);for(var e=At(t),n=vt({},mt),r=0;e.length>r;r+=1){e[r]=Ot(e[r],n);var i=e[r],o=i.length;n.x1=+i[o-2],n.y1=+i[o-1],n.x2=+i[o-4]||n.x1,n.y2=+i[o-3]||n.y1}return e}function Rt(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function _t(t,e,n,r,i,o,a,s,u,c){var l,h,f,d,p,v=t,m=e,y=n,g=r,x=s,E=u,b=120*Math.PI/180,T=Math.PI/180*(+i||0),S=[];if(c)h=c[0],f=c[1],d=c[2],p=c[3];else{m=(l=Rt(v,m,-T)).y;var P=((v=l.x)-(x=(l=Rt(x,E,-T)).x))/2,w=(m-(E=l.y))/2,M=P*P/(y*y)+w*w/(g*g);M>1&&(y*=M=Math.sqrt(M),g*=M);var k=y*y,N=g*g,C=(o===a?-1:1)*Math.sqrt(Math.abs((k*N-k*w*w-N*P*P)/(k*w*w+N*P*P)));d=C*y*w/g+(v+x)/2,h=Math.asin(((m-(p=C*-g*P/y+(m+E)/2))/g*1e9>>0)/1e9),f=Math.asin(((E-p)/g*1e9>>0)/1e9),0>(h=d>v?Math.PI-h:h)&&(h=2*Math.PI+h),0>(f=d>x?Math.PI-f:f)&&(f=2*Math.PI+f),a&&h>f&&(h-=2*Math.PI),!a&&f>h&&(f-=2*Math.PI)}var A=f-h;if(Math.abs(A)>b){var O=f,L=x,R=E;S=_t(x=d+y*Math.cos(f=h+b*(a&&f>h?1:-1)),E=p+g*Math.sin(f),y,g,i,0,a,L,R,[f,O,d,p])}A=f-h;var _=Math.cos(h),I=Math.sin(h),D=Math.cos(f),F=Math.sin(f),G=Math.tan(A/4),B=4/3*y*G,U=4/3*g*G,z=[v,m],j=[v+B*I,m-U*_],V=[x+B*F,E-U*D],H=[x,E];if(j[0]=2*z[0]-j[0],j[1]=2*z[1]-j[1],c)return j.concat(V,H,S);for(var W=[],Y=0,X=(S=j.concat(V,H,S)).length;X>Y;Y+=1)W[Y]=Y%2?Rt(S[Y-1],S[Y],T).y:Rt(S[Y],S[Y+1],T).x;return W}function It(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}function Dt(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function Ft(t,e,n,r,i){var o=Dt([t,e],[n,r]),a={x:0,y:0};if("number"==typeof i)if(0<i)if(i<o){var s=It([t,e],[n,r],i/o);a={x:s[0],y:s[1]}}else a={x:n,y:r};else a={x:t,y:e};return{length:o,point:a,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function Gt(t,e,n,r){var i=.5,o=[t,e],a=[n,r],s=It(o,a,i),u=It(a,s,i),c=It(s,u,i),l=It(u,c,i),h=It(c,l,i),f=Ft(o[0],o[1],s[0],s[1],c[0]).point,d=Ft(h[0],h[1],l[0],l[1],u[0]).point;return[f.x,f.y,d.x,d.y,n,r]}function Bt(t,e){var n,r,i,o,a,s,u,c=t[0],l=t.slice(1).map(Number),h=l[0],f=l[1],d=e.x1,p=e.y1,v=e.x,m=e.y;switch("TQ".includes(c)||(e.qx=null,e.qy=null),c){case"M":return e.x=h,e.y=f,t;case"A":return n=[d,p].concat(l),["C"].concat(_t(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,p].concat(l),["C"].concat([(s=1/3)*n[0]+(u=2/3)*(r=n[2]),s*n[1]+u*(i=n[3]),s*(o=n[4])+u*r,s*(a=n[5])+u*i,o,a]);case"L":return["C"].concat(Gt(d,p,h,f));case"Z":return d===v&&p===m?["C",d,p,v,m,v,m]:["C"].concat(Gt(d,p,v,m))}return t}function Ut(t,e){if(void 0===e&&(e=!1),function(t){return bt(t)&&t.every((function(t){return"MC".includes(t[0])}))}(t)){var n=pt(t);return e?[n,[]]:n}for(var r,i,o=Lt(t),a=vt({},mt),s=[],u="",c=o.length,l=[],h=0;c>h;h+=1){o[h]&&(u=o[h][0]),s[h]=u;var f=Bt(o[h],a);o[h]=f,yt(o,s,h),c=o.length,"Z"===u&&l.push(h),a.x1=+(r=o[h])[(i=r.length)-2],a.y1=+r[i-1],a.x2=+r[i-4]||a.x1,a.y2=+r[i-3]||a.y1}return e?[o,l]:o}function zt(t,e){var n=t.x,r=t.y,i=e.x,o=e.y;return(0>n*o-r*i?-1:1)*Math.acos((n*i+r*o)/Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(o,2))))}function jt(t,e,n,r,i,o,a,s,u,c){var l=Math.abs,h=Math.sin,f=Math.cos,d=Math.sqrt,p=Math.PI,v=l(n),m=l(r),y=(i%360+360)%360*(p/180);if(t===s&&e===u)return{x:t,y:e};if(0===v||0===m)return Ft(t,e,s,u,c).point;var g=(t-s)/2,x=(e-u)/2,E={x:f(y)*g+h(y)*x,y:-h(y)*g+f(y)*x},b=Math.pow(E.x,2)/Math.pow(v,2)+Math.pow(E.y,2)/Math.pow(m,2);b>1&&(v*=d(b),m*=d(b));var T=(Math.pow(v,2)*Math.pow(m,2)-Math.pow(v,2)*Math.pow(E.y,2)-Math.pow(m,2)*Math.pow(E.x,2))/(Math.pow(v,2)*Math.pow(E.y,2)+Math.pow(m,2)*Math.pow(E.x,2)),S=(o!==a?1:-1)*d(T=0>T?0:T),P=S*(v*E.y/m),w=S*(-m*E.x/v),M=f(y)*P-h(y)*w+(t+s)/2,k=h(y)*P+f(y)*w+(e+u)/2,N={x:(E.x-P)/v,y:(E.y-w)/m},C=zt({x:1,y:0},N),A=zt(N,{x:(-E.x-P)/v,y:(-E.y-w)/m});!a&&A>0?A-=2*p:a&&0>A&&(A+=2*p);var O=C+(A%=2*p)*c,L=v*f(O),R=m*h(O);return{x:f(y)*L-h(y)*R+M,y:h(y)*L+f(y)*R+k}}function Vt(t,e,n,r,i,o,a,s,u,c,l){var h,f=l.bbox,d=void 0===f||f,p=l.length,v=void 0===p||p,m=l.sampleSize,y=void 0===m?30:m,g="number"==typeof c,x=t,E=e,b=0,T=[x,E,b],S=[x,E],P={x:0,y:0},w=[{x:x,y:E}];g&&0>=c&&(P={x:x,y:E});for(var M=0;y>=M;M+=1){if(x=(h=jt(t,e,n,r,i,o,a,s,u,M/y)).x,E=h.y,d&&w.push({x:x,y:E}),v&&(b+=Dt(S,[x,E])),S=[x,E],g&&b>=c&&c>T[2]){var k=(b-c)/(b-T[2]);P={x:S[0]*(1-k)+T[0]*k,y:S[1]*(1-k)+T[1]*k}}T=[x,E,b]}return g&&c>=b&&(P={x:s,y:u}),{length:b,point:P,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 Ht(t,e,n,r,i,o,a,s,u){var c=1-u;return{x:Math.pow(c,3)*t+3*Math.pow(c,2)*u*n+3*c*Math.pow(u,2)*i+Math.pow(u,3)*a,y:Math.pow(c,3)*e+3*Math.pow(c,2)*u*r+3*c*Math.pow(u,2)*o+Math.pow(u,3)*s}}function Wt(t,e,n,r,i,o,a,s,u,c){var l,h=c.bbox,f=void 0===h||h,d=c.length,p=void 0===d||d,v=c.sampleSize,m=void 0===v?10:v,y="number"==typeof u,g=t,x=e,E=0,b=[g,x,E],T=[g,x],S={x:0,y:0},P=[{x:g,y:x}];y&&0>=u&&(S={x:g,y:x});for(var w=0;m>=w;w+=1){if(g=(l=Ht(t,e,n,r,i,o,a,s,w/m)).x,x=l.y,f&&P.push({x:g,y:x}),p&&(E+=Dt(T,[g,x])),T=[g,x],y&&E>=u&&u>b[2]){var M=(E-u)/(E-b[2]);S={x:T[0]*(1-M)+b[0]*M,y:T[1]*(1-M)+b[1]*M}}b=[g,x,E]}return y&&u>=E&&(S={x:a,y:s}),{length:E,point:S,min:{x:Math.min.apply(null,P.map((function(t){return t.x}))),y:Math.min.apply(null,P.map((function(t){return t.y})))},max:{x:Math.max.apply(null,P.map((function(t){return t.x}))),y:Math.max.apply(null,P.map((function(t){return t.y})))}}}function Yt(t,e,n,r,i,o,a){var s=1-a;return{x:Math.pow(s,2)*t+2*s*a*n+Math.pow(a,2)*i,y:Math.pow(s,2)*e+2*s*a*r+Math.pow(a,2)*o}}function Xt(t,e,n,r,i,o,a,s){var u,c=s.bbox,l=void 0===c||c,h=s.length,f=void 0===h||h,d=s.sampleSize,p=void 0===d?10:d,v="number"==typeof a,m=t,y=e,g=0,x=[m,y,g],E=[m,y],b={x:0,y:0},T=[{x:m,y:y}];v&&0>=a&&(b={x:m,y:y});for(var S=0;p>=S;S+=1){if(m=(u=Yt(t,e,n,r,i,o,S/p)).x,y=u.y,l&&T.push({x:m,y:y}),f&&(g+=Dt(E,[m,y])),E=[m,y],v&&g>=a&&a>x[2]){var P=(g-a)/(g-x[2]);b={x:E[0]*(1-P)+x[0]*P,y:E[1]*(1-P)+x[1]*P}}x=[m,y,g]}return v&&a>=g&&(b={x:i,y:o}),{length:g,point:b,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 qt(t,e,n){for(var r,i,o,a,s,u,c,l,h,f=Lt(t),d="number"==typeof e,p=[],v=0,m=0,y=0,g=0,x=[],E=[],b=0,T={x:0,y:0},S=T,P=T,w=T,M=0,k=0,N=f.length;N>k;k+=1)p=(c="M"===(l=(h=f[k])[0]))?p:[v,m].concat(h.slice(1)),c?(S=T={x:y=h[1],y:g=h[2]},b=0,d&&.001>e&&(w=T)):"L"===l?(b=(r=Ft(p[0],p[1],p[2],p[3],(e||0)-M)).length,T=r.min,S=r.max,P=r.point):"A"===l?(b=(i=Vt(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8],(e||0)-M,n||{})).length,T=i.min,S=i.max,P=i.point):"C"===l?(b=(o=Wt(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],(e||0)-M,n||{})).length,T=o.min,S=o.max,P=o.point):"Q"===l?(b=(a=Xt(p[0],p[1],p[2],p[3],p[4],p[5],(e||0)-M,n||{})).length,T=a.min,S=a.max,P=a.point):"Z"===l&&(b=(s=Ft((p=[v,m,y,g])[0],p[1],p[2],p[3],(e||0)-M)).length,T=s.min,S=s.max,P=s.point),d&&e>M&&M+b>=e&&(w=P),E.push(S),x.push(T),M+=b,v=(u="Z"!==l?h.slice(-2):[y,g])[0],m=u[1];return d&&e>=M&&(w={x:v,y:m}),{length:M,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,E.map((function(t){return t.x}))),y:Math.max.apply(null,E.map((function(t){return t.y})))}}}function Kt(t){return function(t){var e=0,n=0,r=0;return Ut(t).map((function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var o,a,s,u,c,l,h,f,d=t.slice(1);return r=3*(((f=d[5])-(a=n))*((s=d[0])+(c=d[2]))-((h=d[4])-(o=e))*((u=d[1])+(l=d[3]))+u*(o-c)-s*(a-l)+f*(c+o/3)-h*(l+a/3))/20,i=t.slice(-2),e=i[0],n=i[1],r})).reduce((function(t,e){return t+e}),0)}(t)>=0}function Zt(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?Wt(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),a=It(n,r,e),s=It(r,i,e),u=It(i,o,e),c=It(a,s,e),l=It(s,u,e),h=It(c,l,e);return[["C"].concat(a,c,h),["C"].concat(l,u,o)]}(r):[t,t]:[t],l:i}}))}function Qt(t,e,n){var r=Zt(t),i=Zt(e),o=r.length,a=i.length,s=r.filter((function(t){return t.l})).length,u=i.filter((function(t){return t.l})).length,c=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,l=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/u||0,h=n||Math.max(o,a),f=[c,l],d=[h-o,h-a],p=0,v=[r,i].map((function(t,e){return t.l===h?t.map((function(t){return t.s})):t.map((function(t,n){return d[e]-=(p=n&&d[e]&&t.l>=f[e])?1:0,p?t.ss:[t.s]})).flat()}));return v[0].length===v[1].length?v:Qt(v[0],v[1],h)}var $t=function(t){return null==t},Jt={}.toString,te=function(t,e){return Jt.call(t)==="[object "+e+"]"},ee=function(t){return Array.isArray?Array.isArray(t):te(t,"Array")},ne=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e},re=function(t){if(ee(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},ie=function(t){if(ee(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},oe=function(t){return te(t,"String")},ae=function(t,e,n){return e>t?e:t>n?n:t},se=function(t){return te(t,"Number")};var ue=function(t,e){return(t%e+e)%e},ce=function(t){return te(t,"Boolean")},le=function(t){return void 0===t};function he(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function fe(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function de(){}var pe=.7,ve=1/pe,me="\\s*([+-]?\\d+)\\s*",ye="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",ge="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",xe=/^#([0-9a-f]{3,8})$/,Ee=RegExp("^rgb\\("+[me,me,me]+"\\)$"),be=RegExp("^rgb\\("+[ge,ge,ge]+"\\)$"),Te=RegExp("^rgba\\("+[me,me,me,ye]+"\\)$"),Se=RegExp("^rgba\\("+[ge,ge,ge,ye]+"\\)$"),Pe=RegExp("^hsl\\("+[ye,ge,ge]+"\\)$"),we=RegExp("^hsla\\("+[ye,ge,ge,ye]+"\\)$"),Me={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 ke(){return this.rgb().formatHex()}function Ne(){return this.rgb().formatRgb()}function Ce(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=xe.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Ae(e):3===n?new Re(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Oe(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Oe(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=Ee.exec(t))?new Re(e[1],e[2],e[3],1):(e=be.exec(t))?new Re(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Te.exec(t))?Oe(e[1],e[2],e[3],e[4]):(e=Se.exec(t))?Oe(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Pe.exec(t))?Fe(e[1],e[2]/100,e[3]/100,1):(e=we.exec(t))?Fe(e[1],e[2]/100,e[3]/100,e[4]):Me.hasOwnProperty(t)?Ae(Me[t]):"transparent"===t?new Re(NaN,NaN,NaN,0):null}function Ae(t){return new Re(t>>16&255,t>>8&255,255&t,1)}function Oe(t,e,n,r){return r>0||(t=e=n=NaN),new Re(t,e,n,r)}function Le(t){return t instanceof de||(t=Ce(t)),t?new Re((t=t.rgb()).r,t.g,t.b,t.opacity):new Re}function Re(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function _e(){return"#"+De(this.r)+De(this.g)+De(this.b)}function Ie(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function De(t){return(16>(t=Math.max(0,Math.min(255,Math.round(t)||0)))?"0":"")+t.toString(16)}function Fe(t,e,n,r){return r>0?n>0&&1>n?e>0||(t=NaN):t=e=NaN:t=e=n=NaN,new Be(t,e,n,r)}function Ge(t){if(t instanceof Be)return new Be(t.h,t.s,t.l,t.opacity);if(t instanceof de||(t=Ce(t)),!t)return new Be;if(t instanceof Be)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(r>n):n===o?(r-e)/s+2:(e-n)/s+4,s/=.5>u?o+i:2-o-i,a*=60):s=u>0&&1>u?0:a,new Be(a,s,u,t.opacity)}function Be(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Ue(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 ze(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function je(t,e){return.001>Math.abs(t-e)}function Ve(t,e){var n=Math.min.apply(Math,t),r=Math.min.apply(Math,e);return{x:n,y:r,width:Math.max.apply(Math,t)-n,height:Math.max.apply(Math,e)-r}}he(de,Ce,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:ke,formatHex:ke,formatHsl:function(){return Ge(this).formatHsl()},formatRgb:Ne,toString:Ne}),he(Re,(function(t,e,n,r){return 1===arguments.length?Le(t):new Re(t,e,n,null==r?1:r)}),fe(de,{brighter:function(t){return new Re(this.r*(t=null==t?ve:Math.pow(ve,t)),this.g*t,this.b*t,this.opacity)},darker:function(t){return new Re(this.r*(t=null==t?pe:Math.pow(pe,t)),this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return this.r>=-.5&&255.5>this.r&&this.g>=-.5&&255.5>this.g&&this.b>=-.5&&255.5>this.b&&this.opacity>=0&&1>=this.opacity},hex:_e,formatHex:_e,formatRgb:Ie,toString:Ie})),he(Be,(function(t,e,n,r){return 1===arguments.length?Ge(t):new Be(t,e,n,null==r?1:r)}),fe(de,{brighter:function(t){return new Be(this.h,this.s,this.l*(t=null==t?ve:Math.pow(ve,t)),this.opacity)},darker:function(t){return new Be(this.h,this.s,this.l*(t=null==t?pe:Math.pow(pe,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 Re(Ue(240>t?t+120:t-240,r,n),Ue(t,r,n),Ue(120>t?t+240:t-120,r,n),this.opacity)},displayable:function(){return(this.s>=0&&1>=this.s||isNaN(this.s))&&this.l>=0&&1>=this.l&&this.opacity>=0&&1>=this.opacity},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var He={box:function(t,e,n,r){return Ve([t,n],[e,r])},length:function(t,e,n,r){return ze(t,e,n,r)},pointAt:function(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}},pointDistance:function(t,e,n,r,i,o){var a=(n-t)*(i-t)+(r-e)*(o-e);return 0>a?ze(t,e,i,o):a>(n-t)*(n-t)+(r-e)*(r-e)?ze(n,r,i,o):this.pointToLine(t,e,n,r,i,o)},pointToLine:function(t,e,n,r,i,o){var a=[n-t,r-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var s=[-a[1],a[0]];return function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i}(s,s),Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}([i-t,o-e],s))},tangentAngle:function(t,e,n,r){return Math.atan2(r-e,n-t)}};function We(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function Ye(t,e,n){var r=t+n-2*e;if(je(r,0))return[.5];var i=(t-e)/r;return i>1||0>i?[]:[i]}var Xe=function(t,e,n,r,i,o){var a=Ye(t,n,i)[0],s=Ye(e,r,o)[0],u=[t,i],c=[e,o];return void 0!==a&&u.push(We(t,n,i,a)),void 0!==s&&c.push(We(e,r,o,s)),Ve(u,c)};function qe(t,e,n,r,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*n*i*i*o+r*i*i*i}function Ke(t,e,n,r){var i,o,a,s=-3*t+9*e-9*n+3*r,u=6*t-12*e+6*n,c=3*e-3*t,l=[];if(je(s,0))je(u,0)||0>(i=-c/u)||i>1||l.push(i);else{var h=u*u-4*s*c;je(h,0)?l.push(-u/(2*s)):h>0&&(o=(-u-(a=Math.sqrt(h)))/(2*s),0>(i=(-u+a)/(2*s))||i>1||l.push(i),0>o||o>1||l.push(o))}return l}var Ze=function(t,e,n,r,i,o,a,s){for(var u=[t,a],c=[e,s],l=Ke(t,n,i,a),h=Ke(e,r,o,s),f=0;l.length>f;f++)u.push(qe(t,n,i,a,l[f]));for(var d=0;h.length>d;d++)c.push(qe(e,r,o,s,h[d]));return Ve(u,c)};function Qe(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function $e(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}var Je=function(t,e,n,r,i,o,a){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),u=1/0,c=-1/0,l=[o,a],h=2*-Math.PI;2*Math.PI>=h;h+=Math.PI){var f=s+h;a>o?f>o&&a>f&&l.push(f):f>a&&o>f&&l.push(f)}for(var d=0;l.length>d;d++){var p=Qe(t,0,n,r,i,l[d]);u>p&&(u=p),p>c&&(c=p)}for(var v=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),m=1/0,y=-1/0,g=[o,a],x=2*-Math.PI;2*Math.PI>=x;x+=Math.PI){var E=v+x;a>o?E>o&&a>E&&g.push(E):E>a&&o>E&&g.push(E)}for(var b=0;g.length>b;b++){var T=$e(0,e,n,r,i,g[b]);m>T&&(m=T),T>y&&(y=T)}return{x:u,y:m,width:c-u,height:y-m}};var tn,en,nn,rn,on,an,sn=function(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+=ze(r[0],r[1],i[0],i[1])}return e}(t)},un=e((function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||t,a),u=n?n+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},s.prototype.listeners=function(t){var e=this._events[n?n+t:t];if(!e)return[];if(e.fn)return[e.fn];for(var r=0,i=e.length,o=Array(i);i>r;r++)o[r]=e[r].fn;return o},s.prototype.listenerCount=function(t){var e=this._events[n?n+t:t];return e?e.fn?1:e.length:0},s.prototype.emit=function(t,e,r,i,o,a){var s=n?n+t:t;if(!this._events[s])return!1;var u,c,l=this._events[s],h=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),h){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,r),!0;case 4:return l.fn.call(l.context,e,r,i),!0;case 5:return l.fn.call(l.context,e,r,i,o),!0;case 6:return l.fn.call(l.context,e,r,i,o,a),!0}for(c=1,u=Array(h-1);h>c;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var f,d=l.length;for(c=0;d>c;c++)switch(l[c].once&&this.removeListener(t,l[c].fn,void 0,!0),h){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,e);break;case 3:l[c].fn.call(l[c].context,e,r);break;case 4:l[c].fn.call(l[c].context,e,r,i);break;default:if(!u)for(f=1,u=Array(h-1);h>f;f++)u[f-1]=arguments[f];l[c].fn.apply(l[c].context,u)}}return!0},s.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,r,i){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var u=0,c=[],l=s.length;l>u;u++)(s[u].fn!==e||i&&!s[u].once||r&&s[u].context!==r)&&c.push(s[u]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(t){var e;return t?this._events[e=n?n+t:t]&&a(this,e):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s}));function cn(){cn=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function c(t,e,n,i){var o=Object.create((e&&e.prototype instanceof f?e:f).prototype),a=new w(i||[]);return r(o,"_invoke",{value:b(t,n,a)}),o}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var h={};function f(){}function d(){}function p(){}var v={};u(v,o,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(M([])));y&&y!==e&&n.call(y,o)&&(v=y);var g=p.prototype=f.prototype=Object.create(v);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function i(r,o,a,s){var u=l(t[r],t,o);if("throw"!==u.type){var c=u.arg,h=c.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){i("next",t,a,s)}),(function(t){i("throw",t,a,s)})):e.resolve(h).then((function(t){c.value=t,a(c)}),(function(t){return i("throw",t,a,s)}))}s(u.arg)}var o;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){i(t,n,e,r)}))}return o=o?o.then(r,r):r()}})}function b(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return k()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=T(a,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=l(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function T(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,T(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var i=l(r,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,h;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function M(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,r(g,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:d,configurable:!0}),d.displayName=u(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,u(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},x(E.prototype),u(E.prototype,a,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new E(c(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(g),u(g,s,"Generator"),u(g,o,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=M,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(this.prev>=o.tryLoc){var s=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(s&&u){if(o.catchLoc>this.prev)return r(o.catchLoc,!0);if(o.finallyLoc>this.prev)return r(o.finallyLoc)}else if(s){if(o.catchLoc>this.prev)return r(o.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(this.prev>=i.tryLoc&&n.call(i,"finallyLoc")&&i.finallyLoc>this.prev){var o=i;break}}o&&("break"===t||"continue"===t)&&e>=o.tryLoc&&o.finallyLoc>=e&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),P(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;P(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:M(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}function ln(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function hn(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){ln(o,r,i,a,s,"next",t)}function s(t){ln(o,r,i,a,s,"throw",t)}a(void 0)}))}}function fn(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(i=void 0,"symbol"==typeof(i=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(r.key,"string"))?i:i+""),r)}var i}function dn(t,e,n){return e&&fn(t.prototype,e),n&&fn(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function pn(){return pn=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},pn.apply(this,arguments)}function vn(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,mn(t,e)}function mn(t,e){return mn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},mn(t,e)}function yn(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;o.length>r;r++)0>e.indexOf(n=o[r])&&(i[n]=t[n]);return i}function gn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function xn(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 En(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return xn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0;return function(){return t.length>r?{done:!1,value:t[r++]}:{done:!0}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(tn=t.PropertySyntax||(t.PropertySyntax={})).COORDINATE="<coordinate>",tn.COLOR="<color>",tn.PAINT="<paint>",tn.NUMBER="<number>",tn.ANGLE="<angle>",tn.OPACITY_VALUE="<opacity-value>",tn.SHADOW_BLUR="<shadow-blur>",tn.LENGTH="<length>",tn.PERCENTAGE="<percentage>",tn.LENGTH_PERCENTAGE="<length> | <percentage>",tn.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",tn.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",tn.LIST_OF_POINTS="<list-of-points>",tn.PATH="<path>",tn.FILTER="<filter>",tn.Z_INDEX="<z-index>",tn.OFFSET_DISTANCE="<offset-distance>",tn.DEFINED_PATH="<defined-path>",tn.MARKER="<marker>",tn.TRANSFORM="<transform>",tn.TRANSFORM_ORIGIN="<transform-origin>",tn.TEXT="<text>",tn.TEXT_TRANSFORM="<text-transform>",(en=t.UnitType||(t.UnitType={}))[en.kUnknown=0]="kUnknown",en[en.kNumber=1]="kNumber",en[en.kPercentage=2]="kPercentage",en[en.kEms=3]="kEms",en[en.kPixels=4]="kPixels",en[en.kRems=5]="kRems",en[en.kDegrees=6]="kDegrees",en[en.kRadians=7]="kRadians",en[en.kGradians=8]="kGradians",en[en.kTurns=9]="kTurns",en[en.kMilliseconds=10]="kMilliseconds",en[en.kSeconds=11]="kSeconds",en[en.kInteger=12]="kInteger",function(t){t[t.kUNumber=0]="kUNumber",t[t.kUPercent=1]="kUPercent",t[t.kULength=2]="kULength",t[t.kUAngle=3]="kUAngle",t[t.kUTime=4]="kUTime",t[t.kUOther=5]="kUOther"}(nn||(nn={})),function(t){t[t.kAll=0]="kAll",t[t.kNonNegative=1]="kNonNegative",t[t.kInteger=2]="kInteger",t[t.kNonNegativeInteger=3]="kNonNegativeInteger",t[t.kPositiveInteger=4]="kPositiveInteger"}(rn||(rn={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(on||(on={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(an||(an={}));var bn,Tn=[{name:"em",unit_type:t.UnitType.kEms},{name:"px",unit_type:t.UnitType.kPixels},{name:"deg",unit_type:t.UnitType.kDegrees},{name:"rad",unit_type:t.UnitType.kRadians},{name:"grad",unit_type:t.UnitType.kGradians},{name:"ms",unit_type:t.UnitType.kMilliseconds},{name:"s",unit_type:t.UnitType.kSeconds},{name:"rem",unit_type:t.UnitType.kRems},{name:"turn",unit_type:t.UnitType.kTurns}];!function(t){t[t.kUnknownType=0]="kUnknownType",t[t.kUnparsedType=1]="kUnparsedType",t[t.kKeywordType=2]="kKeywordType",t[t.kUnitType=3]="kUnitType",t[t.kSumType=4]="kSumType",t[t.kProductType=5]="kProductType",t[t.kNegateType=6]="kNegateType",t[t.kInvertType=7]="kInvertType",t[t.kMinType=8]="kMinType",t[t.kMaxType=9]="kMaxType",t[t.kClampType=10]="kClampType",t[t.kTransformType=11]="kTransformType",t[t.kPositionType=12]="kPositionType",t[t.kURLImageType=13]="kURLImageType",t[t.kColorType=14]="kColorType",t[t.kUnsupportedColorType=15]="kUnsupportedColorType"}(bn||(bn={}));var Sn,Pn=function(e){return e?"number"===e?t.UnitType.kNumber:"percent"===e||"%"===e?t.UnitType.kPercentage:function(t){return Tn.find((function(e){return e.name===t})).unit_type}(e):t.UnitType.kUnknown},wn=function(e){var n=1;switch(e){case t.UnitType.kPixels:case t.UnitType.kDegrees:case t.UnitType.kSeconds:break;case t.UnitType.kMilliseconds:n=.001;break;case t.UnitType.kRadians:n=180/Math.PI;break;case t.UnitType.kGradians:n=.9;break;case t.UnitType.kTurns:n=360}return n},Mn=function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return"";case t.UnitType.kPercentage:return"%";case t.UnitType.kEms:return"em";case t.UnitType.kRems:return"rem";case t.UnitType.kPixels:return"px";case t.UnitType.kDegrees:return"deg";case t.UnitType.kRadians:return"rad";case t.UnitType.kGradians:return"grad";case t.UnitType.kMilliseconds:return"ms";case t.UnitType.kSeconds:return"s";case t.UnitType.kTurns:return"turn"}return""},kn=function(){function e(){}e.isAngle=function(e){return e===t.UnitType.kDegrees||e===t.UnitType.kRadians||e===t.UnitType.kGradians||e===t.UnitType.kTurns},e.isLength=function(e){return e>=t.UnitType.kEms&&t.UnitType.kDegrees>e},e.isRelativeUnit=function(e){return e===t.UnitType.kPercentage||e===t.UnitType.kEms||e===t.UnitType.kRems},e.isTime=function(e){return e===t.UnitType.kSeconds||e===t.UnitType.kMilliseconds};var n=e.prototype;return n.toString=function(){return this.buildCSSText(on.kNo,an.kNo,"")},n.isNumericValue=function(){return this.getType()>=bn.kUnitType&&this.getType()<=bn.kClampType},e}(),Nn=function(t){function e(e){var n;return(n=t.call(this)||this).colorSpace=void 0,n.colorSpace=e,n}vn(e,t);var n=e.prototype;return n.getType=function(){return bn.kColorType},n.to=function(t){return this},e}(kn);(Sn=t.GradientType||(t.GradientType={}))[Sn.Constant=0]="Constant",Sn[Sn.LinearGradient=1]="LinearGradient",Sn[Sn.RadialGradient=2]="RadialGradient";var Cn=function(t){function e(e,n){var r;return(r=t.call(this)||this).type=void 0,r.value=void 0,r.type=e,r.value=n,r}vn(e,t);var n=e.prototype;return n.clone=function(){return new e(this.type,this.value)},n.buildCSSText=function(t,e,n){return n},n.getType=function(){return bn.kColorType},e}(kn),An=function(t){function e(e){var n;return(n=t.call(this)||this).value=void 0,n.value=e,n}vn(e,t);var n=e.prototype;return n.clone=function(){return new e(this.value)},n.getType=function(){return bn.kKeywordType},n.buildCSSText=function(t,e,n){return n+this.value},e}(kn);function On(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function n(){for(var r=arguments.length,i=Array(r),o=0;r>o;o++)i[o]=arguments[o];var a=e?e.apply(this,i):i[0],s=n.cache;if(s.has(a))return s.get(a);var u=t.apply(this,i);return n.cache=s.set(a,u)||s,u};return n.cache=new(On.Cache||Map),n}On.Cache=Map;var Ln=On((function(t){return void 0===t&&(t=""),t.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))})),Rn=function(t){return t.split("").map((function(t,e){return t.toUpperCase()===t?(0!==e?"-":"")+t.toLowerCase():t})).join("")};function _n(t){return"function"==typeof t}var In={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},Dn=On((function(t){var e=Ln(t),n=In[e];return e=(null==n?void 0:n.alias)||e})),Fn=function(t,e){void 0===e&&(e="");var n="";return Number.isFinite(t)?(!function(t){if(!t)throw Error()}(Number.isNaN(t)),n="NaN"):n=t>0?"infinity":"-infinity",n+e},Gn=function(e){return function(e){switch(e){case nn.kUNumber:return t.UnitType.kNumber;case nn.kULength:return t.UnitType.kPixels;case nn.kUPercent:return t.UnitType.kPercentage;case nn.kUTime:return t.UnitType.kSeconds;case nn.kUAngle:return t.UnitType.kDegrees;default:return t.UnitType.kUnknown}}(function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return nn.kUNumber;case t.UnitType.kPercentage:return nn.kUPercent;case t.UnitType.kPixels:return nn.kULength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return nn.kUTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return nn.kUAngle;default:return nn.kUOther}}(e))},Bn=function(e){function n(n,r){var i,o;return void 0===r&&(r=t.UnitType.kNumber),(i=e.call(this)||this).unit=void 0,i.value=void 0,o="string"==typeof r?Pn(r):r,i.unit=o,i.value=n,i}vn(n,e);var r=n.prototype;return r.clone=function(){return new n(this.value,this.unit)},r.equals=function(t){return this.value===t.value&&this.unit===t.unit},r.getType=function(){return bn.kUnitType},r.convertTo=function(e){if(this.unit===e)return new n(this.value,this.unit);var r=Gn(this.unit);if(r!==Gn(e)||r===t.UnitType.kUnknown)return null;var i=wn(this.unit)/wn(e);return new n(this.value*i,e)},r.buildCSSText=function(e,n,r){var i;switch(this.unit){case t.UnitType.kUnknown:break;case t.UnitType.kInteger:i=Number(this.value).toFixed(0);break;case t.UnitType.kNumber:case t.UnitType.kPercentage:case t.UnitType.kEms:case t.UnitType.kRems:case t.UnitType.kPixels:case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:case t.UnitType.kTurns:var o=this.value,a=Mn(this.unit);if(-999999>o||o>999999){var s=Mn(this.unit);i=!Number.isFinite(o)||Number.isNaN(o)?Fn(o,s):o+(s||"")}else i=""+o+a}return r+=i},n}(kn),Un=new Bn(0,"px"),zn=(new Bn(1,"px"),new Bn(0,"deg")),jn=function(t){function e(e,n,r,i,o){var a;return void 0===i&&(i=1),void 0===o&&(o=!1),(a=t.call(this,"rgb")||this).r=void 0,a.g=void 0,a.b=void 0,a.alpha=void 0,a.isNone=void 0,a.r=e,a.g=n,a.b=r,a.alpha=i,a.isNone=o,a}vn(e,t);var n=e.prototype;return n.clone=function(){return new e(this.r,this.g,this.b,this.alpha)},n.buildCSSText=function(t,e,n){return n+"rgba("+this.r+","+this.g+","+this.b+","+this.alpha+")"},e}(Nn),Vn={number:function(t){return new Bn(t)},percent:function(t){return new Bn(t,"%")},px:function(t){return new Bn(t,"px")},em:function(t){return new Bn(t,"em")},rem:function(t){return new Bn(t,"rem")},deg:function(t){return new Bn(t,"deg")},grad:function(t){return new Bn(t,"grad")},rad:function(t){return new Bn(t,"rad")},turn:function(t){return new Bn(t,"turn")},s:function(t){return new Bn(t,"s")},ms:function(t){return new Bn(t,"ms")},registerProperty:function(t){Ls.styleValueRegistry.registerMetadata({n:t.name,inh:t.inherits,int:t.interpolable,d:t.initialValue,syntax:t.syntax})},registerLayout:function(t,e){Ls.layoutRegistry.registerLayout(t,e)}},Hn=new An("unset"),Wn=new An("initial"),Yn=new An("inherit"),Xn={"":Hn,unset:Hn,initial:Wn,inherit:Yn},qn=function(t){return Xn[t]||(Xn[t]=new An(t)),Xn[t]},Kn=new jn(0,0,0,0,!0),Zn=new jn(0,0,0,0),Qn=On((function(t,e,n,r){return new jn(t,e,n,r)}),(function(t,e,n,r){return"rgba("+t+","+e+","+n+","+r+")"})),$n=function(e,n){return void 0===n&&(n=t.UnitType.kNumber),new Bn(e,n)},Jn=new Bn(50,"%"),tr={},er=0;var nr="undefined"!=typeof window&&void 0!==window.document;function rr(t,e){var n=Number(t.parsedStyle.zIndex),r=Number(e.parsedStyle.zIndex);if(n===r){var i=t.parentNode;if(i){var o=i.childNodes||[];return o.indexOf(t)-o.indexOf(e)}}return n-r}function ir(t){var e=t;do{var n;if(null===(n=e.parsedStyle)||void 0===n?void 0:n.clipPath)return e;e=e.parentElement}while(null!==e);return null}function or(t,e){if(nr)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var ar="Method not implemented.",sr="Use document.documentElement instead.",ur={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};function cr(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function lr(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function hr(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function fr(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function dr(t){return void 0===t?0:t>360||-360>t?t%360:t}function pr(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Array.isArray(t)&&3===t.length?R(t):se(t)?I(t,e,n):I(t[0],t[1]||e,t[2]||n)}function vr(t){return t*(Math.PI/180)}function mr(t){return t*(180/Math.PI)}function yr(t){return 360*t}function gr(t,e){return 16===e.length?function(t,e){var n,r,i=.5*Math.PI,o=T(L(),e),a=o[0],s=o[1],u=o[2],c=Math.asin(-e[2]/a);return i>c?c>-i?(n=Math.atan2(e[6]/s,e[10]/u),r=Math.atan2(e[1]/a,e[0]/a)):(r=0,n=-Math.atan2(e[4]/s,e[5]/s)):(r=0,n=Math.atan2(e[4]/s,e[5]/s)),t[0]=n,t[1]=c,t[2]=r,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=r*r,s=i*i,u=o*o,c=n*n+a+s+u,l=n*o-r*i;return l>.499995*c?(t[0]=Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):-.499995*c>l?(t[0]=-Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-o*r)),t[1]=Math.atan2(2*(n*o+r*i),1-2*(s+u)),t[2]=Math.atan2(2*(n*r+i*o),1-2*(a+s))),t}(t,e)}function xr(t,e,n,r,o){var a,s,u,c,l,h,f,d,p,v,m=Math.cos(t),y=Math.sin(t);return a=r*m,s=o*y,u=0,c=-r*y,l=o*m,h=0,f=e,d=n,p=1,(v=new i(9))[0]=a,v[1]=s,v[2]=u,v[3]=c,v[4]=l,v[5]=h,v[6]=f,v[7]=d,v[8]=p,v}function Er(t){var e=t[0],n=t[1],r=t[3],i=t[4],o=Math.sqrt(e*e+n*n),a=Math.sqrt(r*r+i*i);0>e*i-n*r&&(i>e?o=-o:a=-a),o&&(e*=1/o,n*=1/o),a&&(r*=1/a,i*=1/a);var s=mr(Math.atan2(n,e));return[t[6],t[7],o,a,s]}var br=a(),Tr=a(),Sr=Z(),Pr=[L(),L(),L()],wr=L();function Mr(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 kr=a();function Nr(t,e){if(t&&t.length){var n=0,r=0;e?(n=e.parsedStyle.defX||0,r=e.parsedStyle.defY||0,e.resetLocalTransform(),e.setLocalPosition(n,r)):e=new wa({}),t.forEach((function(t){var i=t.t,o=t.d;if("scale"===i){var a=(null==o?void 0:o.map((function(t){return t.value})))||[1,1];e.scaleLocal(a[0],a[1],1)}else if("scalex"===i){var s=(null==o?void 0:o.map((function(t){return t.value})))||[1];e.scaleLocal(s[0],1,1)}else if("scaley"===i){var u=(null==o?void 0:o.map((function(t){return t.value})))||[1];e.scaleLocal(1,u[0],1)}else if("scalez"===i){var l=(null==o?void 0:o.map((function(t){return t.value})))||[1];e.scaleLocal(1,1,l[0])}else if("scale3d"===i){var h=(null==o?void 0:o.map((function(t){return t.value})))||[1,1,1];e.scaleLocal(h[0],h[1],h[2])}else if("translate"===i){var f=o||[Un,Un];e.translateLocal(f[0].value,f[1].value,0)}else if("translatex"===i){e.translateLocal((o||[Un])[0].value,0,0)}else if("translatey"===i){e.translateLocal(0,(o||[Un])[0].value,0)}else if("translatez"===i){e.translateLocal(0,0,(o||[Un])[0].value)}else if("translate3d"===i){var d=o||[Un,Un,Un];e.translateLocal(d[0].value,d[1].value,d[2].value)}else if("rotate"===i){e.rotateLocal(0,0,Wi((o||[zn])[0]))}else if("rotatex"===i){e.rotateLocal(Wi((o||[zn])[0]),0,0)}else if("rotatey"===i){e.rotateLocal(0,Wi((o||[zn])[0]),0)}else if("rotatez"===i){e.rotateLocal(0,0,Wi((o||[zn])[0]))}else if("rotate3d"===i);else if("skew"===i){var p=(null==o?void 0:o.map((function(t){return t.value})))||[0,0];e.setLocalSkew(vr(p[0]),vr(p[1]))}else if("skewx"===i){var v=(null==o?void 0:o.map((function(t){return t.value})))||[0];e.setLocalSkew(vr(v[0]),e.getLocalSkew()[1])}else if("skewy"===i){var m=(null==o?void 0:o.map((function(t){return t.value})))||[0];e.setLocalSkew(e.getLocalSkew()[0],vr(m[0]))}else if("matrix"===i){var y=o.map((function(t){return t.value}));e.setLocalTransform(c(kr,y[0],y[1],0,0,y[2],y[3],0,0,0,0,1,0,y[4]+n,y[5]+r,0,1))}else"matrix3d"===i&&(c.apply(O,[kr].concat(o.map((function(t){return t.value})))),kr[12]+=n,kr[13]+=r,e.setLocalTransform(kr))}))}return e.getLocalTransform()}function Cr(t){var e=t.type,n=t.value;return"hex"===e?"#"+n:"literal"===e?n:"rgb"===e?"rgb("+n.join(",")+")":"rgba("+n.join(",")+")"}var Ar,Or=function(){var t=/^(linear\-gradient)/i,e=/^(repeating\-linear\-gradient)/i,n=/^(radial\-gradient)/i,r=/^(repeating\-radial\-gradient)/i,i=/^(conic\-gradient)/i,o=/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,a=/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,s=/^(left|center|right|top|bottom)/i,u=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,c=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,l=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,h=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,f=/^\(/,d=/^\)/,p=/^,/,v=/^\#([0-9a-fA-F]+)/,m=/^([a-zA-Z]+)/,y=/^rgb/i,g=/^rgba/i,x=/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,E="";function b(t){throw Error(E+": "+t)}function T(){var t=L(S);return E.length>0&&b("Invalid input not EOF"),t}function S(){return P("linear-gradient",t,M)||P("repeating-linear-gradient",e,M)||P("radial-gradient",n,k)||P("repeating-radial-gradient",r,k)||P("conic-gradient",i,k)}function P(t,e,n){return w(e,(function(e){var r=n();return r&&(G(p)||b("Missing comma before color stops")),{type:t,orientation:r,colorStops:L(R)}}))}function w(t,e){var n=G(t);if(n){G(f)||b("Missing (");var r=e(n);return G(d)||b("Missing )"),r}}function M(){return F("directional",o,1)||F("angular",h,1)}function k(){var t,e,n=N();return n&&((t=[]).push(n),e=E,G(p)&&((n=N())?t.push(n):E=e)),t}function N(){var t=function(){var t=F("shape",/^(circle)/i,0);t&&(t.style=D()||C());return t}()||function(){var t=F("shape",/^(ellipse)/i,0);t&&(t.style=I()||C());return t}();if(t)t.at=A();else{var e=C();if(e){t=e;var n=A();n&&(t.at=n)}else{var r=O();r&&(t={type:"default-radial",at:r})}}return t}function C(){return F("extent-keyword",a,1)}function A(){if(F("position",/^at/,0)){var t=O();return t||b("Missing positioning value"),t}}function O(){var t={x:I(),y:I()};if(t.x||t.y)return{type:"position",value:t}}function L(t){var e=t(),n=[];if(e)for(n.push(e);G(p);)(e=t())?n.push(e):b("One extra comma");return n}function R(){var t=F("hex",v,1)||w(g,(function(){return{type:"rgba",value:L(_)}}))||w(y,(function(){return{type:"rgb",value:L(_)}}))||F("literal",m,0);return t||b("Expected color definition"),t.length=I(),t}function _(){return G(x)[1]}function I(){return F("%",c,1)||F("position-keyword",s,1)||D()}function D(){return F("px",u,1)||F("em",l,1)}function F(t,e,n){var r=G(e);if(r)return{type:t,value:r[n]}}function G(t){var e=/^[\n\r\t\s]+/.exec(E);e&&B(e[0].length);var n=t.exec(E);return n&&B(n[0].length),n}function B(t){E=E.substring(t)}return function(t){return E=t,T()}}();function Lr(t){var e;return 0===t.parsedStyle.path.totalLength&&(t.parsedStyle.path.totalLength=qt(t.parsedStyle.path.absolutePath,void 0,vt(vt({},e),{bbox:!1,length:!0})).length),t.parsedStyle.path.totalLength}function Rr(t,e){return t[0]===e[0]&&t[1]===e[1]}function _r(t,e){var n,r=t.prePoint,i=t.currentPoint,o=t.nextPoint,a=Math.pow(i[0]-r[0],2)+Math.pow(i[1]-r[1],2),s=Math.pow(i[0]-o[0],2)+Math.pow(i[1]-o[1],2),u=Math.acos((a+s-(Math.pow(r[0]-o[0],2)+Math.pow(r[1]-o[1],2)))/(2*Math.sqrt(a)*Math.sqrt(s)));if(!u||0===Math.sin(u)||(void 0===n&&(n=1e-5),n>Math.abs(u-0)))return{xExtra:0,yExtra:0};var c=Math.abs(Math.atan2(o[1]-i[1],o[0]-i[0])),l=Math.abs(Math.atan2(o[0]-i[0],o[1]-i[1]));return l=l>Math.PI/2?Math.PI-l:l,{xExtra:Math.cos(u/2-(c=c>Math.PI/2?Math.PI-c:c))*(e/2*(1/Math.sin(u/2)))-e/2||0,yExtra:Math.cos(l-u/2)*(e/2*(1/Math.sin(u/2)))-e/2||0}}function Ir(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}(Ar=t.Shape||(t.Shape={})).GROUP="g",Ar.CIRCLE="circle",Ar.ELLIPSE="ellipse",Ar.IMAGE="image",Ar.RECT="rect",Ar.LINE="line",Ar.POLYLINE="polyline",Ar.POLYGON="polygon",Ar.TEXT="text",Ar.PATH="path",Ar.HTML="html",Ar.MESH="mesh";var Dr=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))))},Fr=function(t,e,n,r,i,o,a,s){e=Math.abs(e),n=Math.abs(n);var u=vr(r=ue(r,360));if(t.x===a.x&&t.y===a.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===e||0===n)return{x:0,y:0,ellipticalArcAngle:0};var c=(t.x-a.x)/2,l=(t.y-a.y)/2,h={x:Math.cos(u)*c+Math.sin(u)*l,y:-Math.sin(u)*c+Math.cos(u)*l},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)),p=(i!==o?1:-1)*Math.sqrt(d=0>d?0:d),v=p*(e*h.y/n),m=p*(-n*h.x/e),y={x:Math.cos(u)*v-Math.sin(u)*m+(t.x+a.x)/2,y:Math.sin(u)*v+Math.cos(u)*m+(t.y+a.y)/2},g={x:(h.x-v)/e,y:(h.y-m)/n},x=Dr({x:1,y:0},g),E=Dr(g,{x:(-h.x-v)/e,y:(-h.y-m)/n});!o&&E>0?E-=2*Math.PI:o&&0>E&&(E+=2*Math.PI);var b=x+(E%=2*Math.PI)*s,T=e*Math.cos(b),S=n*Math.sin(b);return{x:Math.cos(u)*T-Math.sin(u)*S+y.x,y:Math.sin(u)*T+Math.cos(u)*S+y.y,ellipticalArcStartAngle:x,ellipticalArcEndAngle:x+E,ellipticalArcAngle:b,ellipticalArcCenter:y,resultantRx:e,resultantRy:n}};function Gr(t,e,n){void 0===n&&(n=!0);var r=t.arcParams,i=r.rx,o=void 0===i?0:i,a=r.ry,s=void 0===a?0:a,u=r.xRotation,c=r.arcFlag,l=r.sweepFlag,h=Fr({x:t.prePoint[0],y:t.prePoint[1]},o,s,u,!!c,!!l,{x:t.currentPoint[0],y:t.currentPoint[1]},e),f=Fr({x:t.prePoint[0],y:t.prePoint[1]},o,s,u,!!c,!!l,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),d=f.x-h.x,p=f.y-h.y,v=Math.sqrt(d*d+p*p);return{x:-d/v,y:-p/v}}function Br(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Ur(t,e){return Br(t)*Br(e)?(t[0]*e[0]+t[1]*e[1])/(Br(t)*Br(e)):1}function zr(t,e){return(t[1]*e[0]>t[0]*e[1]?-1:1)*Math.acos(Ur(t,e))}function jr(t,e){var n=e[1],r=e[2],i=ue(vr(e[3]),2*Math.PI),o=e[4],a=e[5],s=t[0],u=t[1],c=e[6],l=e[7],h=Math.cos(i)*(s-c)/2+Math.sin(i)*(u-l)/2,f=-1*Math.sin(i)*(s-c)/2+Math.cos(i)*(u-l)/2,d=h*h/(n*n)+f*f/(r*r);d>1&&(n*=Math.sqrt(d),r*=Math.sqrt(d));var p=n*n*(f*f)+r*r*(h*h),v=p?Math.sqrt((n*n*(r*r)-p)/p):1;o===a&&(v*=-1),isNaN(v)&&(v=0);var m=r?v*n*f/r:0,y=n?v*-r*h/n:0,g=(s+c)/2+Math.cos(i)*m-Math.sin(i)*y,x=(u+l)/2+Math.sin(i)*m+Math.cos(i)*y,E=[(h-m)/n,(f-y)/r],b=[(-1*h-m)/n,(-1*f-y)/r],T=zr([1,0],E),S=zr(E,b);return Ur(E,b)>-1||(S=Math.PI),1>Ur(E,b)||(S=0),0===a&&S>0&&(S-=2*Math.PI),1===a&&0>S&&(S+=2*Math.PI),{cx:g,cy:x,rx:Rr(t,[c,l])?0:n,ry:Rr(t,[c,l])?0:r,startAngle:T,endAngle:T+S,xRotation:i,arcFlag:o,sweepFlag:a}}function Vr(t,e,n,r){var i=.5522847498307936,o=t*i,a=e*i,s=n-t,u=n+t,c=r-e,l=r+e;return[["M",s,r],["C",s,r-a,n-o,c,n,c],["C",n+o,c,u,r-a,u,r],["C",u,r+a,n+o,l,n,l],["C",n-o,l,s,r+a,s,r],["Z"]]}var Hr=function(){return this.call=this._createCall("sync"),this.call.apply(this,arguments)},Wr=function(){return this.callAsync=this._createCall("async"),this.callAsync.apply(this,arguments)},Yr=function(){return this.promise=this._createCall("promise"),this.promise.apply(this,arguments)},Xr=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e=void 0),this.name=void 0,this.taps=void 0,this.promise=void 0,this._promise=void 0,this._args=t,this.name=e,this.taps=[],this.interceptors=[],this._call=Hr,this.call=Hr,this._callAsync=Wr,this.callAsync=Wr,this._promise=Yr,this.promise=Yr,this._x=void 0}var e=t.prototype;return e.compile=function(t){throw Error("Abstract: should be overridden")},e._createCall=function(t){return this.compile({taps:this.taps,interceptors:this.interceptors,args:this._args,type:t})},e._tap=function(t,e,n){if("string"==typeof e)e={name:e.trim()};else if("object"!=typeof e||null===e)throw Error("Invalid tap options");if("string"!=typeof e.name||""===e.name)throw Error("Missing name for tap");e=Object.assign({type:t,fn:n},e),e=this._runRegisterInterceptors(e),this._insert(e)},e.tap=function(t,e){this._tap("sync",t,e)},e.tapAsync=function(t,e){this._tap("async",t,e)},e.tapPromise=function(t,e){this._tap("promise",t,e)},e._runRegisterInterceptors=function(t){for(var e,n=En(this.interceptors);!(e=n()).done;){var r=e.value;if(r.register){var i=r.register(t);void 0!==i&&(t=i)}}return t},e.withOptions=function(t){var e=this,n=function(e){return Object.assign({},t,"string"==typeof e?{name:e}:e)};return{name:this.name,tap:function(t,r){return e.tap(n(t),r)},tapAsync:function(t,r){return e.tapAsync(n(t),r)},tapPromise:function(t,r){return e.tapPromise(n(t),r)},isUsed:function(){return e.isUsed()},withOptions:function(t){return e.withOptions(n(t))}}},e.isUsed=function(){return this.taps.length>0||this.interceptors.length>0},e._resetCompilation=function(){this.call=this._call,this.callAsync=this._callAsync,this.promise=this._promise},e._insert=function(t){var e;this._resetCompilation(),"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));var n=0;"number"==typeof t.stage&&(n=t.stage);for(var r=this.taps.length;r>0;){r--;var i=this.taps[r];this.taps[r+1]=i;var o=i.stage||0;if(e){if(e.has(i.name)){e.delete(i.name);continue}if(e.size>0)continue}if(n>=o){r++;break}}this.taps[r]=t},t}(),qr=function(){function t(t){this.config=t,this.options=void 0,this._args=void 0}var e=t.prototype;return e.create=function(t){var e;switch(this.init(t),this.options.type){case"sync":e=Function(this.args(),'"use strict";\n'+this.header()+this.contentWithInterceptors({onError:function(t){return"throw "+t+";\n"},onResult:function(t){return"return "+t+";\n"},resultReturns:!0,onDone:function(){return""},rethrowIfPossible:!0}));break;case"async":e=Function(this.args({after:"_callback"}),'"use strict";\n'+this.header()+this.contentWithInterceptors({onError:function(t){return"_callback("+t+");\n"},onResult:function(t){return"_callback(null, "+t+");\n"},onDone:function(){return"_callback();\n"}}));break;case"promise":var n=!1,r=this.contentWithInterceptors({onError:function(t){return n=!0,"_error("+t+");\n"},onResult:function(t){return"_resolve("+t+");\n"},onDone:function(){return"_resolve();\n"}}),i="";i+='"use strict";\n',i+=this.header(),i+="return new Promise((function(_resolve, _reject) {\n",n&&(i+="var _sync = true;\n",i+="function _error(_err) {\n",i+="if(_sync)\n",i+="_resolve(Promise.resolve().then((function() { throw _err; })));\n",i+="else\n",i+="_reject(_err);\n",i+="};\n"),i+=r,n&&(i+="_sync = false;\n"),i+="}));\n",e=Function(this.args(),i)}return this.deinit(),e},e.setup=function(t,e){t._x=e.taps.map((function(t){return t.fn}))},e.init=function(t){this.options=t,this._args=t.args.slice()},e.deinit=function(){this.options=void 0,this._args=void 0},e.contentWithInterceptors=function(t){var e=this;if(this.options.interceptors.length>0){for(var n=t.onError,r=t.onResult,i=t.onDone,o="",a=0;this.options.interceptors.length>a;a++){var s=this.options.interceptors[a];s.call&&(o+=this.getInterceptor(a)+".call("+this.args({before:s.context?"_context":void 0})+");\n")}return o+=this.content(Object.assign(t,{onError:n&&function(t){for(var r="",i=0;e.options.interceptors.length>i;i++){e.options.interceptors[i].error&&(r+=e.getInterceptor(i)+".error("+t+");\n")}return r+=n(t)},onResult:r&&function(t){for(var n="",i=0;e.options.interceptors.length>i;i++){e.options.interceptors[i].result&&(n+=e.getInterceptor(i)+".result("+t+");\n")}return n+=r(t)},onDone:i&&function(){for(var t="",n=0;e.options.interceptors.length>n;n++){e.options.interceptors[n].done&&(t+=e.getInterceptor(n)+".done();\n")}return t+=i()}}))}return this.content(t)},e.header=function(){var t="";return this.needContext()?t+="var _context = {};\n":t+="var _context;\n",t+="var _x = this._x;\n",this.options.interceptors.length>0&&(t+="var _taps = this.taps;\n",t+="var _interceptors = this.interceptors;\n"),t},e.needContext=function(){for(var t,e=En(this.options.taps);!(t=e()).done;){if(t.value.context)return!0}return!1},e.callTap=function(t,e){for(var n=e.onError,r=e.onResult,i=e.onDone,o=e.rethrowIfPossible,a="",s=!1,u=0;this.options.interceptors.length>u;u++){var c=this.options.interceptors[u];c.tap&&(s||(a+="var _tap"+t+" = "+this.getTap(t)+";\n",s=!0),a+=this.getInterceptor(u)+".tap("+(c.context?"_context, ":"")+"_tap"+t+");\n")}a+="var _fn"+t+" = "+this.getTapFn(t)+";\n";var l=this.options.taps[t];switch(l.type){case"sync":o||(a+="var _hasError"+t+" = false;\n",a+="try {\n"),a+=r?"var _result"+t+" = _fn"+t+"("+this.args({before:l.context?"_context":void 0})+");\n":"_fn"+t+"("+this.args({before:l.context?"_context":void 0})+");\n",o||(a+="} catch(_err) {\n",a+="_hasError"+t+" = true;\n",a+=n("_err"),a+="}\n",a+="if(!_hasError"+t+") {\n"),r&&(a+=r("_result"+t)),i&&(a+=i()),o||(a+="}\n");break;case"async":var h="";h+=r?"(function(_err"+t+", _result"+t+") {\n":"(function(_err"+t+") {\n",h+="if(_err"+t+") {\n",h+=n("_err"+t),h+="} else {\n",r&&(h+=r("_result"+t)),i&&(h+=i()),h+="}\n",a+="_fn"+t+"("+this.args({before:l.context?"_context":void 0,after:h+="})"})+");\n";break;case"promise":a+="var _hasResult"+t+" = false;\n",a+="var _promise"+t+" = _fn"+t+"("+this.args({before:l.context?"_context":void 0})+");\n",a+="if (!_promise"+t+" || !_promise"+t+".then)\n",a+=" throw new Error('Tap function (tapPromise) did not return promise (returned ' + _promise"+t+" + ')');\n",a+="_promise"+t+".then((function(_result"+t+") {\n",a+="_hasResult"+t+" = true;\n",r&&(a+=r("_result"+t)),i&&(a+=i()),a+="}), function(_err"+t+") {\n",a+="if(_hasResult"+t+") throw _err"+t+";\n",a+=n("_err"+t),a+="});\n"}return a},e.callTapsSeries=function(t){var e=this,n=t.onError,r=t.onResult,i=t.resultReturns,o=t.onDone,a=t.doneReturns,s=t.rethrowIfPossible;if(0===this.options.taps.length)return o();for(var u=this.options.taps.findIndex((function(t){return"sync"!==t.type})),c=i||a,l="",h=o,f=0,d=function(t){var i=t;h!==o&&("sync"!==e.options.taps[i].type||f++>20)&&(f=0,l+="function _next"+i+"() {\n",l+=h(),l+="}\n",h=function(){return(c?"return ":"")+"_next"+i+"();\n"});var a=h,d=function(t){return t?"":o()},p=e.callTap(i,{onError:function(t){return n(i,t,a,d)},onResult:r&&function(t){return r(i,t,a,d)},onDone:!r&&a,rethrowIfPossible:s&&(0>u||u>i)});h=function(){return p}},p=this.options.taps.length-1;p>=0;p--)d(p);return l+=h()},e.callTapsLooping=function(t){var e=t.onError,n=t.onDone,r=t.rethrowIfPossible;if(0===this.options.taps.length)return n();var i=this.options.taps.every((function(t){return"sync"===t.type})),o="";i||(o+="var _looper = (function() {\n",o+="var _loopAsync = false;\n"),o+="var _loop;\n",o+="do {\n",o+="_loop = false;\n";for(var a=0;this.options.interceptors.length>a;a++){var s=this.options.interceptors[a];s.loop&&(o+=this.getInterceptor(a)+".loop("+this.args({before:s.context?"_context":void 0})+");\n")}return o+=this.callTapsSeries({onError:e,onResult:function(t,e,n,r){var o="";return o+="if("+e+" !== undefined) {\n",o+="_loop = true;\n",i||(o+="if(_loopAsync) _looper();\n"),o+=r(!0),o+="} else {\n",o+=n(),o+="}\n"},onDone:n&&function(){var t="";return t+="if(!_loop) {\n",t+=n(),t+="}\n"},rethrowIfPossible:r&&i}),o+="} while(_loop);\n",i||(o+="_loopAsync = true;\n",o+="});\n",o+="_looper();\n"),o},e.callTapsParallel=function(t){var e=this,n=t.onError,r=t.onResult,i=t.onDone,o=t.rethrowIfPossible,a=t.onTap,s=void 0===a?function(t,e){return e()}:a;if(1>=this.options.taps.length)return this.callTapsSeries({onError:n,onResult:r,onDone:i,rethrowIfPossible:o});var u="";u+="do {\n",u+="var _counter = "+this.options.taps.length+";\n",i&&(u+="var _done = (function() {\n",u+=i(),u+="});\n");for(var c=function(t){var a=function(){return i?"if(--_counter === 0) _done();\n":"--_counter;"},c=function(t){return t||!i?"_counter = 0;\n":"_counter = 0;\n_done();\n"};u+="if(_counter <= 0) break;\n",u+=s(t,(function(){return e.callTap(t,{onError:function(e){var r="";return r+="if(_counter > 0) {\n",r+=n(t,e,a,c),r+="}\n"},onResult:r&&function(e){var n="";return n+="if(_counter > 0) {\n",n+=r(t,e,a,c),n+="}\n"},onDone:!r&&function(){return a()},rethrowIfPossible:o})}),a,c)},l=0;this.options.taps.length>l;l++)c(l);return u+="} while(false);\n"},e.args=function(t){var e=void 0===t?{}:t,n=e.before,r=e.after,i=this._args;return n&&(i=[n].concat(i)),r&&(i=i.concat(r)),0===i.length?"":i.join(", ")},e.getTapFn=function(t){return"_x["+t+"]"},e.getTap=function(t){return"_taps["+t+"]"},e.getInterceptor=function(t){return"_interceptors["+t+"]"},t}(),Kr=function(t){function e(){return t.apply(this,arguments)||this}return vn(e,t),e.prototype.content=function(t){var e=t.onError;return this.callTapsParallel({onError:function(t,n,r,i){return e(n)+i(!0)},onDone:t.onDone})},e}(qr),Zr=new Kr,Qr=function(t){return Zr.setup(this,t),Zr.create(t)},$r=function(t){function e(e,n){var r;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(r=t.call(this,e,n)||this).compile=Qr,r._call=void 0,r.call=void 0,r}return vn(e,t),e}(Xr),Jr=function(t){function e(){return t.apply(this,arguments)||this}return vn(e,t),e.prototype.content=function(t){var e=this,n=t.onError,r=t.onResult;return this.callTapsSeries({onError:function(t,e,r,i){return n(e)+i(!0)},onResult:function(t,n,r){var i="";return i+="if("+n+" !== undefined) {\n",i+=e._args[0]+" = "+n+";\n",i+="}\n",i+=r()},onDone:function(){return r(e._args[0])}})},e}(qr),ti=new Jr,ei=function(t){return ti.setup(this,t),ti.create(t)},ni=function(t){function e(e,n){var r;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(r=t.call(this,e,n)||this).compile=ei,r._call=void 0,r.call=void 0,r}return vn(e,t),e}(Xr),ri=function(t){function e(){return t.apply(this,arguments)||this}return vn(e,t),e.prototype.content=function(t){var e=t.onError;return this.callTapsSeries({onError:function(t,n){return e(n)},onDone:t.onDone,rethrowIfPossible:t.rethrowIfPossible})},e}(qr),ii=new ri,oi=function(){throw Error("tapAsync is not supported on a SyncHook")},ai=function(){throw Error("tapPromise is not supported on a SyncHook")},si=function(t){return ii.setup(this,t),ii.create(t)},ui=function(t){function e(e,n){var r;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(r=t.call(this,e,n)||this).tapAsync=oi,r.tapPromise=ai,r.compile=si,r}return vn(e,t),e}(Xr),ci=function(t){function e(){return t.apply(this,arguments)||this}return vn(e,t),e.prototype.content=function(t){var e=this,n=t.onError,r=t.onResult;return this.callTapsSeries({onError:function(t,e){return n(e)},onResult:function(t,n,r){var i="";return i+="if("+n+" !== undefined) {\n",i+=e._args[0]+" = "+n+";\n",i+="}\n",i+=r()},onDone:function(){return r(e._args[0])},doneReturns:t.resultReturns,rethrowIfPossible:t.rethrowIfPossible})},e}(qr),li=new ci,hi=function(){throw Error("tapAsync is not supported on a SyncWaterfallHook")},fi=function(){throw Error("tapPromise is not supported on a SyncWaterfallHook")},di=function(t){return li.setup(this,t),li.create(t)},pi=function(t){function e(e,n){var r;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(r=t.call(this,e,n)||this).tapAsync=hi,r.tapPromise=fi,r.compile=di,r}return vn(e,t),e}(ui),vi=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],mi=/([\"\'])[^\'\"]+\1/;var yi=1,gi="object"==typeof self&&self.self==self?self:"object"==typeof global&&global.global==global?global:{},xi=Date.now(),Ei={},bi=Date.now(),Ti=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var e=Date.now(),n=e-bi,r=n>16?0:16-n,i=yi++;return Ei[i]=t,Object.keys(Ei).length>1||setTimeout((function(){bi=e;var t=Ei;Ei={},Object.keys(t).forEach((function(e){return t[e](gi.performance&&"function"==typeof gi.performance.now?gi.performance.now():Date.now()-xi)}))}),r),i},Si=function(t){delete Ei[t]},Pi=function(t){return"string"!=typeof t?Ti:""===t?gi.requestAnimationFrame:gi[t+"RequestAnimationFrame"]},wi=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!!Pi(t)})),Mi=Pi(wi),ki=function(t){return"string"!=typeof t?Si:""===t?gi.cancelAnimationFrame:gi[t+"CancelAnimationFrame"]||gi[t+"CancelRequestAnimationFrame"]}(wi);gi.requestAnimationFrame=Mi,gi.cancelAnimationFrame=ki;var Ni=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,Ci=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Ai=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Oi=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var Li={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},Ri=On((function(t){return $n("angular"===t.type?Number(t.value):Li[t.value]||0,"deg")})),_i=On((function(t){var e=50,n=50,r="%",i="%";if("position"===(null==t?void 0:t.type)){var o=t.value,a=o.x,s=o.y;"position-keyword"===(null==a?void 0:a.type)&&("left"===a.value?e=0:"center"===a.value?e=50:"right"===a.value?e=100:"top"===a.value?n=0:"bottom"===a.value&&(n=100)),"position-keyword"===(null==s?void 0:s.type)&&("left"===s.value?e=0:"center"===s.value?n=50:"right"===s.value?e=100:"top"===s.value?n=0:"bottom"===s.value&&(n=100)),"px"!==(null==a?void 0:a.type)&&"%"!==(null==a?void 0:a.type)&&"em"!==(null==a?void 0:a.type)||(r=null==a?void 0:a.type,e=Number(a.value)),"px"!==(null==s?void 0:s.type)&&"%"!==(null==s?void 0:s.type)&&"em"!==(null==s?void 0:s.type)||(i=null==s?void 0:s.type,n=Number(s.value))}return{cx:$n(e,r),cy:$n(n,i)}})),Ii=On((function(e){if(e.indexOf("linear")>-1||e.indexOf("radial")>-1)return Or(e).map((function(e){var n=e.type,r=e.orientation,i=e.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,o=Number(t[0].length.value),a=1;r>a;a++){var s,u=null===(s=t[a].length)||void 0===s?void 0:s.value;if(!$t(u)&&!$t(o)){for(var c=1;a-i>c;c++)t[i+c].length={type:"%",value:""+(o+(Number(u)-o)*c/(a-i))};i=a,o=Number(u)}}}(i);var o=i.map((function(t){return{offset:$n(Number(t.length.value),"%"),color:Cr(t)}}));if("linear-gradient"===n)return new Cn(t.GradientType.LinearGradient,{angle:r?Ri(r):zn,steps:o});if("radial-gradient"===n&&(r||(r=[{type:"shape",value:"circle"}]),"shape"===r[0].type&&"circle"===r[0].value)){var a,s=_i(r[0].at),u=s.cx,c=s.cy;if(r[0].style){var l=r[0].style,h=l.type,f=l.value;a="extent-keyword"===h?qn(f):$n(f,h)}return new Cn(t.GradientType.RadialGradient,{cx:u,cy:c,size:a,steps:o})}}));var n=e[0];if("("===e[1]||"("===e[2])if("l"===n){var r=Ni.exec(e);if(r){var i,o=(null===(i=r[2].match(Oi))||void 0===i?void 0:i.map((function(t){return t.split(":")})))||[];return[new Cn(t.GradientType.LinearGradient,{angle:$n(parseFloat(r[1]),"deg"),steps:o.map((function(t){var e=t[1];return{offset:$n(100*Number(t[0]),"%"),color:e}}))})]}}else if("r"===n){var a=function(t){var e=Ci.exec(t);if(e){var n,r=(null===(n=e[4].match(Oi))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[];return{cx:$n(50,"%"),cy:$n(50,"%"),steps:r.map((function(t){var e=t[1];return{offset:$n(100*Number(t[0]),"%"),color:e}}))}}return null}(e);if(a){if(!oe(a))return[new Cn(t.GradientType.RadialGradient,a)];e=a}}else if("p"===n)return function(t){var e=Ai.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}(e)}));function Di(t){return t&&!!t.image}function Fi(t){return t&&!$t(t.r)&&!$t(t.g)&&!$t(t.b)}var Gi=On((function(t){if(Di(t))return pn({repetition:"repeat"},t);if($t(t)&&(t=""),"transparent"===t)return Zn;"currentColor"===t&&(t="black");var e=Ii(t);if(e)return e;var n=Ce(t),r=[0,0,0,0];return null!==n&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),Qn.apply(void 0,r)}));function Bi(t,e){if(Fi(t)&&Fi(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(ae(e[n],0,255));return e[3]=ae(e[3],0,1),"rgba("+e.join(",")+")"}]}function Ui(t,e){if($t(e))return $n(0,"px");if(e=(""+e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return $n(Number(e),"px");if("deg".search(t)>=0)return $n(Number(e),"deg")}var n=[];e=e.replace(t,(function(t){return n.push(t),"U"+t}));var r="U("+t.source+")";return n.map((function(t){return $n(Number(e.replace(RegExp("U"+t,"g"),"").replace(RegExp(r,"g"),"*0")),t)}))[0]}var zi=On((function(t){return Ui(/px/g,t)})),ji=(On((function(t){return Ui(RegExp("%","g"),t)})),function(t){return se(t)||isFinite(Number(t))?$n(Number(t)||0,"px"):Ui(RegExp("px|%|em|rem","g"),t)}),Vi=On((function(t){return Ui(/deg|rad|grad|turn/g,t)}));function Hi(t,e,n,r,i){void 0===i&&(i=0);var o="",a=t.value||0,s=e.value||0,u=Gn(t.unit),c=t.convertTo(u),l=e.convertTo(u);return c&&l?(a=c.value,s=l.value,o=Mn(t.unit)):(Bn.isLength(t.unit)||Bn.isLength(e.unit))&&(a=qi(t,i,n),s=qi(e,i,n),o="px"),[a,s,function(t){return r&&(t=Math.max(t,0)),t+o}]}function Wi(e){var n=0;return e.unit===t.UnitType.kDegrees?n=e.value:e.unit===t.UnitType.kRadians?n=mr(Number(e.value)):e.unit===t.UnitType.kTurns&&(n=yr(Number(e.value))),n}function Yi(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):oe(t)?n=t.split(" ").map((function(t){return Number(t)})):se(t)&&(n=[t]),2===e?1===n.length?[n[0],n[0]]:[n[0],n[1]]:1===n.length?[n[0],n[0],n[0],n[0]]:2===n.length?[n[0],n[1],n[0],n[1]]:3===n.length?[n[0],n[1],n[2],n[1]]:[n[0],n[1],n[2],n[3]]}function Xi(t){return oe(t)?t.split(" ").map((function(t){return ji(t)})):t.map((function(t){return ji(""+t)}))}function qi(e,n,r){if(0===e.value)return 0;if(e.unit===t.UnitType.kPixels)return Number(e.value);if(e.unit===t.UnitType.kPercentage&&r){var i=r.nodeName===t.Shape.GROUP?r.getLocalBounds():r.geometry.contentBounds;return e.value/100*i.halfExtents[n]*2}return 0}var Ki=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Zi(t){if(void 0===t&&(t=""),"none"===(t=t.toLowerCase().trim()))return[];for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];if(i=e.index+e[0].length,Ki.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)||Gi(t)}))}),n.lastIndex===t.length)return r}return[]}function Qi(t){return""+t}var $i=On((function(t){return $n("number"==typeof t?t:/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Number(t):0)}));On((function(t){return oe(t)?t.split(" ").map($i):t.map($i)}));function Ji(t,e){return[t,e,Qi]}function to(t,e){return function(n,r){return[n,r,function(n){return Qi(ae(n,t,e))}]}}function eo(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}var no=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=Lt(t)}catch(n){e=Lt(""),console.error("[g]: Invalid SVG Path definition: "+t)}var n=function(t){for(var e=!1,n=t.length,r=0;n>r;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e}(e),r=function(t){for(var e=[],n=[],r=[],i=0;t.length>i;i++){var o=t[i],a=o[0];"M"===a?(r.length&&(n.push(r),r=[]),r.push([o[1],o[2]])):"Z"===a?r.length&&(e.push(r),r=[]):r.push([o[1],o[2]])}return r.length>0&&n.push(r),{polygons:e,polylines:n}}(e),i=r.polygons,o=r.polylines,a=function(t){for(var e=[],n=null,r=null,i=null,o=0,a=t.length,s=0;a>s;s++){var u=t[s];r=t[s+1];var c=u[0],l={command:c,prePoint:n,params:u,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(c){case"M":i=[u[1],u[2]],o=s;break;case"A":var h=jr(n,u);l.arcParams=h}if("Z"===c)n=i,r=t[o+1];else{var f=u.length;n=[u[f-2],u[f-1]]}r&&"Z"===r[0]&&(r=t[o],e[o]&&(e[o].prePoint=n)),l.currentPoint=n,e[o]&&Rr(n,e[o].currentPoint)&&(e[o].prePoint=l.prePoint),l.nextPoint=r?[r[r.length-2],r[r.length-1]]:null;var d=l.prePoint;if(["L","H","V"].includes(c))l.startTangent=[d[0]-n[0],d[1]-n[1]],l.endTangent=[n[0]-d[0],n[1]-d[1]];else if("Q"===c){var p=[u[1],u[2]];l.startTangent=[d[0]-p[0],d[1]-p[1]],l.endTangent=[n[0]-p[0],n[1]-p[1]]}else if("T"===c){var v=e[s-1],m=Ir(v.currentPoint,d);"Q"===v.command?(l.command="Q",l.startTangent=[d[0]-m[0],d[1]-m[1]],l.endTangent=[n[0]-m[0],n[1]-m[1]]):(l.command="TL",l.startTangent=[d[0]-n[0],d[1]-n[1]],l.endTangent=[n[0]-d[0],n[1]-d[1]])}else if("C"===c){var y=[u[1],u[2]],g=[u[3],u[4]];l.startTangent=[d[0]-y[0],d[1]-y[1]],l.endTangent=[n[0]-g[0],n[1]-g[1]],0===l.startTangent[0]&&0===l.startTangent[1]&&(l.startTangent=[y[0]-g[0],y[1]-g[1]]),0===l.endTangent[0]&&0===l.endTangent[1]&&(l.endTangent=[g[0]-y[0],g[1]-y[1]])}else if("S"===c){var x=e[s-1],E=Ir(x.currentPoint,d),b=[u[1],u[2]];"C"===x.command?(l.command="C",l.startTangent=[d[0]-E[0],d[1]-E[1]],l.endTangent=[n[0]-b[0],n[1]-b[1]]):(l.command="SQ",l.startTangent=[d[0]-b[0],d[1]-b[1]],l.endTangent=[n[0]-b[0],n[1]-b[1]])}else if("A"===c){var T=Gr(l,0),S=T.x,P=T.y,w=Gr(l,1,!1),M=w.x,k=w.y;l.startTangent=[S,P],l.endTangent=[M,k]}e.push(l)}return e}(e),s=function(t,e){for(var n=[],r=[],i=[],o=0;t.length>o;o++){var a=t[o],s=a.currentPoint,u=a.params,c=a.prePoint,l=void 0;switch(a.command){case"Q":l=Xe(c[0],c[1],u[1],u[2],u[3],u[4]);break;case"C":l=Ze(c[0],c[1],u[1],u[2],u[3],u[4],u[5],u[6]);break;case"A":var h=a.arcParams;l=Je(h.cx,h.cy,h.rx,h.ry,h.xRotation,h.startAngle,h.endAngle);break;default:n.push(s[0]),r.push(s[1])}l&&(a.box=l,n.push(l.x,l.x+l.width),r.push(l.y,l.y+l.height)),e&&("L"===a.command||"M"===a.command)&&a.prePoint&&a.nextPoint&&i.push(a)}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=ie(n),d=ie(r),p=re(n),v=re(r);if(0===i.length)return{x:f,y:d,width:p-f,height:v-d};for(var m=0;i.length>m;m++){var y=i[m],g=y.currentPoint;g[0]===f?f-=_r(y,e).xExtra:g[0]===p&&(p+=_r(y,e).xExtra),g[1]===d?d-=_r(y,e).yExtra:g[1]===v&&(v+=_r(y,e).yExtra)}return{x:f,y:d,width:p-f,height:v-d}}(a,0),u=s.x,c=s.y,l=s.width,h=s.height;return{absolutePath:e,hasArc:n,segments:a,polygons:i,polylines:o,totalLength:0,rect:{x:Number.isFinite(u)?u:0,y:Number.isFinite(c)?c:0,width:Number.isFinite(l)?l:0,height:Number.isFinite(h)?h:0}}},ro=On(no);function io(t,e){var n=oe(t)?ro(t):no(t);return e&&(e.parsedStyle.defX=n.rect.x,e.parsedStyle.defY=n.rect.y),n}function oo(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=Ut(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=Ut(e.absolutePath,!1),e.curve=i);var o=[r,i];r.length!==i.length&&(o=Qt(r,i));var a,s,u,c,l,h,f,d,p=Kt(o[0])!==Kt(o[1])?(s=(a=o[0]).slice(1).map((function(t,e,n){return e?n[e-1].slice(-2).concat(t.slice(1)):a[0].slice(1).concat(t.slice(1))})).map((function(t){return t.map((function(e,n){return t[t.length-n-2*(1-n%2)]}))})).reverse(),[["M"].concat(s[0].slice(0,2))].concat(s.map((function(t){return["C"].concat(t.slice(2))})))):pt(o[0]);return[p,(u=o[1],c=p,l=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,o){var a=i+o;return 0===o||t[a]&&"M"===t[a][0]?["M"].concat(t[a].slice(-2)):(e>a||(a-=n),t[a])}))}))}(u),d.forEach((function(t,e){u.slice(1).forEach((function(t,n){f+=Dt(u[(e+n)%l].slice(-2),c[n%l].slice(-2))})),h[e]=f,f=0})),d[h.indexOf(Math.min.apply(null,h))]),function(t){return t}]}function ao(t,e){var n;n=oe(t)?t.split(" ").map((function(t){var e=t.split(","),n=e[1];return[Number(e[0]),Number(n)]})):t;var r,i,o=[],a=0,s=sn(n);n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=a/s,i=He.length(t[0],t[1],n[e+1][0],n[e+1][1]),r[1]=(a+=i)/s,o.push(r))}));var u=Math.min.apply(Math,n.map((function(t){return t[0]}))),c=Math.min.apply(Math,n.map((function(t){return t[1]})));return e&&(e.parsedStyle.defX=u,e.parsedStyle.defY=c),{points:n,totalLength:s,segments:o}}function so(t,e){return[t.points,e.points,function(t){return t}]}var uo=null;function co(t){return function(e){var n=0;return t.map((function(t){return t===uo?e[n++]:t}))}}function lo(t){return t}var ho={matrix:["NNNNNN",[uo,uo,0,0,uo,uo,0,0,0,0,1,0,uo,uo,0,1],lo],matrix3d:["NNNNNNNNNNNNNNNN",lo],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",co([uo,uo,new Bn(1)]),lo],scalex:["N",co([uo,new Bn(1),new Bn(1)]),co([uo,new Bn(1)])],scaley:["N",co([new Bn(1),uo,new Bn(1)]),co([new Bn(1),uo])],scalez:["N",co([new Bn(1),new Bn(1),uo])],scale3d:["NNN",lo],skew:["Aa",null,lo],skewx:["A",null,co([uo,zn])],skewy:["A",null,co([zn,uo])],translate:["Tt",co([uo,uo,Un]),lo],translatex:["T",co([uo,Un,Un]),co([uo,Un])],translatey:["T",co([Un,uo,Un]),co([Un,uo])],translatez:["L",co([Un,Un,uo])],translate3d:["TTL",lo]};function fo(t){if("none"===(t=(t||"none").toLowerCase().trim()))return[];for(var e,n=/\s*(\w+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];i=e.index+e[0].length;var o=e[1],a=ho[o];if(!a)return[];var s=e[2].split(","),u=a[0];if(s.length>u.length)return[];for(var c=[],l=0;u.length>l;l++){var h=s[l],f=u[l],d=void 0;if(void 0===(d=h?{A:function(t){return"0"===t.trim()?zn:Vi(t)},N:$i,T:ji,L:zi}[f.toUpperCase()](h):{a:zn,n:c[0],t:Un}[f]))return[];c.push(d)}if(r.push({t:o,d:c}),n.lastIndex===t.length)return r}return[]}function po(t){var e,n,r,i;switch(t.t){case"rotatex":return i=vr(Wi(t.d[0])),[1,0,0,0,0,Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1];case"rotatey":return i=vr(Wi(t.d[0])),[Math.cos(i),0,-Math.sin(i),0,0,1,0,0,Math.sin(i),0,Math.cos(i),0,0,0,0,1];case"rotate":case"rotatez":return i=vr(Wi(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=vr(Wi(t.d[3]));var o=e*e+n*n+r*r;if(0===o)e=1,n=0,r=0;else if(1!==o){var a=Math.sqrt(o);e/=a,n/=a,r/=a}var s=Math.sin(i/2),u=s*Math.cos(i/2),c=s*s;return[1-2*(n*n+r*r)*c,2*(e*n*c+r*u),2*(e*r*c-n*u),0,2*(e*n*c-r*u),1-2*(e*e+r*r)*c,2*(n*r*c+e*u),0,2*(e*r*c+n*u),2*(n*r*c-e*u),1-2*(e*e+n*n)*c,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 l=vr(Wi(t.d[0])),h=vr(Wi(t.d[1]));return[1,Math.tan(h),0,0,Math.tan(l),1,0,0,0,0,1,0,0,0,0,1];case"skewx":return i=vr(Wi(t.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewy":return i=vr(Wi(t.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return[1,0,0,0,0,1,0,0,0,0,1,0,e=qi(t.d[0],0,null)||0,n=qi(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=qi(t.d[0],0,null)||0,0,0,1];case"translatey":return[1,0,0,0,0,1,0,0,0,0,1,0,0,n=qi(t.d[0],0,null)||0,0,1];case"translatez":return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,r=qi(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=qi(t.d[0],0,null)||0,n=qi(t.d[1],0,null)||0,r=qi(t.d[2],0,null)||0,1];case"perspective":var f=qi(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 vo(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 mo(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],o=[0,0,0,1];return function(t,e,n,r,i,o){if(!function(t,e){var n=e[15];if(0===n)return!1;for(var r=1/n,i=0;16>i;i++)t[i]=e[i]*r;return!0}(br,t))return!1;if(u(Tr,br),Tr[3]=0,Tr[7]=0,Tr[11]=0,Tr[15]=1,1e-8>Math.abs(d(Tr)))return!1;var a,s,c=br[3],l=br[7],p=br[11],v=br[12],m=br[13],y=br[14],g=br[15];if(0!==c||0!==l||0!==p){if(Sr[0]=c,Sr[1]=l,Sr[2]=p,Sr[3]=g,!f(Tr,Tr))return!1;h(Tr,Tr),Q(i,Sr,Tr)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=v,e[1]=m,e[2]=y,(a=Pr)[0][0]=(s=br)[0],a[0][1]=s[1],a[0][2]=s[2],a[1][0]=s[4],a[1][1]=s[5],a[1][2]=s[6],a[2][0]=s[8],a[2][1]=s[9],a[2][2]=s[10],n[0]=_(Pr[0]),z(Pr[0],Pr[0]),r[0]=j(Pr[0],Pr[1]),Mr(Pr[1],Pr[1],Pr[0],1,-r[0]),n[1]=_(Pr[1]),z(Pr[1],Pr[1]),r[0]/=n[1],r[1]=j(Pr[0],Pr[2]),Mr(Pr[2],Pr[2],Pr[0],1,-r[1]),r[2]=j(Pr[1],Pr[2]),Mr(Pr[2],Pr[2],Pr[1],1,-r[2]),n[2]=_(Pr[2]),z(Pr[2],Pr[2]),r[1]/=n[2],r[2]/=n[2],V(wr,Pr[1],Pr[2]),0>j(Pr[0],wr))for(var x=0;3>x;x++)n[x]*=-1,Pr[x][0]*=-1,Pr[x][1]*=-1,Pr[x][2]*=-1;o[0]=.5*Math.sqrt(Math.max(1+Pr[0][0]-Pr[1][1]-Pr[2][2],0)),o[1]=.5*Math.sqrt(Math.max(1-Pr[0][0]+Pr[1][1]-Pr[2][2],0)),o[2]=.5*Math.sqrt(Math.max(1-Pr[0][0]-Pr[1][1]+Pr[2][2],0)),o[3]=.5*Math.sqrt(Math.max(1+Pr[0][0]+Pr[1][1]+Pr[2][2],0)),Pr[2][1]>Pr[1][2]&&(o[0]=-o[0]),Pr[0][2]>Pr[2][0]&&(o[1]=-o[1]),Pr[1][0]>Pr[0][1]&&(o[2]=-o[2])}(function(t){return 0===t.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(po).reduce(vo)}(t),e,n,r,i,o),[[e,n,r,o,i]]}var yo=function(){function t(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],r=0;4>r;r++)for(var i=0;4>i;i++)for(var o=0;4>o;o++)n[r][i]+=e[r][o]*t[o][i];return n}return function(e,n,r,i,o){for(var a=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;4>s;s++)a[s][3]=o[s];for(var u=0;3>u;u++)for(var c=0;3>c;c++)a[3][u]+=e[c]*a[c][u];var l=i[0],h=i[1],f=i[2],d=i[3],p=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];p[0][0]=1-2*(h*h+f*f),p[0][1]=2*(l*h-f*d),p[0][2]=2*(l*f+h*d),p[1][0]=2*(l*h+f*d),p[1][1]=1-2*(l*l+f*f),p[1][2]=2*(h*f-l*d),p[2][0]=2*(l*f-h*d),p[2][1]=2*(h*f+l*d),p[2][2]=1-2*(l*l+h*h),a=t(a,p);var v,m=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];r[2]&&(m[2][1]=r[2],a=t(a,m)),r[1]&&(m[2][1]=0,m[2][0]=r[0],a=t(a,m)),r[0]&&(m[2][0]=0,m[1][0]=r[0],a=t(a,m));for(var y=0;3>y;y++)for(var g=0;3>g;g++)a[y][g]*=n[y];return 0==(v=a)[0][2]&&0==v[0][3]&&0==v[1][2]&&0==v[1][3]&&0==v[2][0]&&0==v[2][1]&&1==v[2][2]&&0==v[2][3]&&0==v[3][2]&&1==v[3][3]?[a[0][0],a[0][1],a[1][0],a[1][1],a[3][0],a[3][1]]:a[0].concat(a[1],a[2],a[3])}}();function go(t){return t.toFixed(6).replace(".000000","")}function xo(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=mo(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=mo(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=ae(r,-1,1);var i=[];if(1===r)i=t;else for(var o=Math.acos(r),a=1*Math.sin(n*o)/Math.sqrt(1-r*r),s=0;4>s;s++)i.push(t[s]*(Math.cos(n*o)-r*a)+e[s]*a);return i}(n[0][3],r[0][3],t[5]);return yo(t[0],t[1],t[2],e,t[4]).map(go).join(",")}])}function Eo(t){return t.replace(/[xy]/,"")}function bo(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function To(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(n){var r=t[n],i=r.t,o=r.d,a="scale"===i.substring(0,5)?1:0;e.push({t:i,d:o.map((function(t){return"number"==typeof t?$n(a):$n(a,t.unit)}))})},o=0;t.length>o;o++)i(o)}var a,s,u=[],c=[],l=[];if(t.length!==e.length){var h=xo(t,e);u=[h[0]],c=[h[1]],l=[["matrix",[h[2]]]]}else for(var f=0;t.length>f;f++){var d=t[f].t,p=e[f].t,v=t[f].d,m=e[f].d,y=ho[d],g=ho[p],x=void 0;if(s=p,"perspective"===(a=d)&&"perspective"===s||!("matrix"!==a&&"matrix3d"!==a||"matrix"!==s&&"matrix3d"!==s)){var E=xo([t[f]],[e[f]]);u.push(E[0]),c.push(E[1]),l.push(["matrix",[E[2]]])}else{if(d===p)x=d;else if(y[2]&&g[2]&&Eo(d)===Eo(p))x=Eo(d),v=y[2](v),m=g[2](m);else{if(!y[1]||!g[1]||bo(d)!==bo(p)){var b=xo(t,e);u=[b[0]],c=[b[1]],l=[["matrix",[b[2]]]];break}x=bo(d),v=y[1](v),m=g[1](m)}for(var T=[],S=[],P=[],w=0;v.length>w;w++){var M=Hi(v[w],m[w],n,!1,w);T[w]=M[0],S[w]=M[1],P.push(M[2])}u.push(T),c.push(S),l.push([x,P])}}if(r){var k=u;u=c,c=k}return[u,c,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return l[e][1][n](t)})).join(",");return"matrix"===l[e][0]&&16===n.split(",").length&&(l[e][0]="matrix3d"),"matrix3d"===l[e][0]&&6===n.split(",").length&&(l[e][0]="matrix"),l[e][0]+"("+n+")"})).join(" ")}]}var So=On((function(t){if(oe(t)){if("text-anchor"===t)return[$n(0,"px"),$n(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:[ji(Po(e[0])),ji(Po(e[1]))]}return[$n(t[0]||0,"px"),$n(t[1]||0,"px")]}));function Po(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var wo=function(){function t(){this.parser=Vi,this.parserWithCSSDisabled=null,this.mixer=Ji}return t.prototype.calculator=function(t,e,n,r){return Wi(n)},t}(),Mo=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){return n instanceof An&&(n=null),Ls.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach((function(t){0===t.childNodes.length&&Ls.sceneGraphService.dirtifyToRoot(t)})),n},t}(),ko=function(){function t(){this.parser=Gi,this.parserWithCSSDisabled=Gi,this.mixer=Bi}return t.prototype.calculator=function(t,e,n,r){return n instanceof An?"none"===n.value?Kn:Zn:n},t}(),No=function(){function t(){this.parser=Zi}return t.prototype.calculator=function(t,e,n){return n instanceof An?[]:n},t}();function Co(t){var e=t.parsedStyle.fontSize;return $t(e)?null:e}var Ao,Oo=function(){function e(){this.parser=ji,this.parserWithCSSDisabled=null,this.mixer=Ji}return e.prototype.calculator=function(e,n,r,i,o){if(se(r))return r;if(!Bn.isRelativeUnit(r.unit))return r.value;if(r.unit===t.UnitType.kPercentage)return 0;if(r.unit===t.UnitType.kEms){if(i.parentNode){var a=Co(i.parentNode);if(a)return a*=r.value;o.addUnresolveProperty(i,e)}else o.addUnresolveProperty(i,e);return 0}if(r.unit===t.UnitType.kRems){var s;if(null==i||null===(s=i.ownerDocument)||void 0===s?void 0:s.documentElement){var u=Co(i.ownerDocument.documentElement);if(u)return u*=r.value;o.addUnresolveProperty(i,e)}else o.addUnresolveProperty(i,e);return 0}},e}(),Lo=function(){function t(){this.mixer=eo}var e=t.prototype;return e.parser=function(t){var e=Xi(se(t)?[t]:t);return 1===e.length?[e[0],e[0]]:[e[0],e[1]]},e.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),Ro=function(){function t(){this.mixer=eo}var e=t.prototype;return e.parser=function(t){var e=Xi(se(t)?[t]:t);return 1===e.length?[e[0],e[0],e[0],e[0]]:2===e.length?[e[0],e[1],e[0],e[1]]:3===e.length?[e[0],e[1],e[2],e[1]]:[e[0],e[1],e[2],e[3]]},e.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),_o=function(e){function n(){return e.apply(this,arguments)||this}return vn(n,e),n.prototype.postProcessor=function(e,n){var r,i,o;switch(e.nodeName){case t.Shape.CIRCLE:case t.Shape.ELLIPSE:var a=e.parsedStyle,s=a.cx,u=a.cy;$t(s)||(r=s),$t(u)||(i=u);break;case t.Shape.LINE:var c=e.parsedStyle,l=c.y1,h=c.y2;r=Math.min(c.x1,c.x2),i=Math.min(l,h),o=0;break;case t.Shape.RECT:case t.Shape.IMAGE:case t.Shape.GROUP:case t.Shape.HTML:case t.Shape.TEXT:case t.Shape.MESH:$t(e.parsedStyle.x)||(r=e.parsedStyle.x),$t(e.parsedStyle.y)||(i=e.parsedStyle.y)}if(e.nodeName!==t.Shape.PATH&&e.nodeName!==t.Shape.POLYLINE&&e.nodeName!==t.Shape.POLYGON&&(e.parsedStyle.defX=r||0,e.parsedStyle.defY=i||0),(!$t(r)||!$t(i)||!$t(o))&&-1===n.indexOf("transform")){var f=e.parsedStyle.transform;if(f&&f.length)Nr(f,e);else{var d=e.getLocalPosition(),p=d[0],v=d[1],m=d[2];e.setLocalPosition($t(r)?p:r,$t(i)?v:i,$t(o)?m:o)}}},n}(Oo),Io=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){var i;n instanceof An&&(n=null);var o=null===(i=n)||void 0===i?void 0:i.cloneNode(!0);return o&&(o.style.isMarker=!0),o},t}(),Do=function(){function t(){this.mixer=Ji,this.parser=$i,this.parserWithCSSDisabled=null}return t.prototype.calculator=function(t,e,n){return n.value},t}(),Fo=function(){function e(){this.parser=$i,this.parserWithCSSDisabled=null,this.mixer=to(0,1)}var n=e.prototype;return n.calculator=function(t,e,n){return n.value},n.postProcessor=function(e){var n=e.parsedStyle,r=n.offsetPath;if(r){var i=r.nodeName;if(i===t.Shape.LINE||i===t.Shape.PATH||i===t.Shape.POLYLINE){var o=r.getPoint(n.offsetDistance);o&&(e.parsedStyle.defX=o.x,e.parsedStyle.defY=o.y,e.setLocalPosition(o.x,o.y))}}},e}(),Go=function(){function t(){this.parser=$i,this.parserWithCSSDisabled=null,this.mixer=to(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t}(),Bo=function(){function t(){this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}t.isEmpty=function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]};var e=t.prototype;return e.update=function(t,e){cr(this.center,t),cr(this.halfExtents,e),lr(this.min,this.center,this.halfExtents),hr(this.max,this.center,this.halfExtents)},e.setMinMax=function(t,e){hr(this.center,e,t),fr(this.center,this.center,.5),lr(this.halfExtents,e,t),fr(this.halfExtents,this.halfExtents,.5),cr(this.min,t),cr(this.max,e)},e.getMin=function(){return this.min},e.getMax=function(){return this.max},e.add=function(e){if(!t.isEmpty(e))if(t.isEmpty(this))this.setMinMax(e.getMin(),e.getMax());else{var n=this.center,r=n[0],i=n[1],o=n[2],a=this.halfExtents,s=a[0],u=a[1],c=a[2],l=r-s,h=r+s,f=i-u,d=i+u,p=o-c,v=o+c,m=e.center,y=m[0],g=m[1],x=m[2],E=e.halfExtents,b=E[0],T=E[1],S=E[2],P=y-b,w=y+b,M=g-T,k=g+T,N=x-S,C=x+S;l>P&&(l=P),w>h&&(h=w),f>M&&(f=M),k>d&&(d=k),p>N&&(p=N),C>v&&(v=C),n[0]=.5*(l+h),n[1]=.5*(f+d),n[2]=.5*(p+v),a[0]=.5*(h-l),a[1]=.5*(d-f),a[2]=.5*(v-p),this.min[0]=l,this.min[1]=f,this.min[2]=p,this.max[0]=h,this.max[1]=d,this.max[2]=v}},e.setFromTransformedAABB=function(t,e){var n=this.center,r=this.halfExtents,i=t.center,o=t.halfExtents,a=e[0],s=e[4],u=e[8],c=e[1],l=e[5],h=e[9],f=e[2],d=e[6],p=e[10],v=Math.abs(a),m=Math.abs(s),y=Math.abs(u),g=Math.abs(c),x=Math.abs(l),E=Math.abs(h),b=Math.abs(f),T=Math.abs(d),S=Math.abs(p);n[0]=e[12]+a*i[0]+s*i[1]+u*i[2],n[1]=e[13]+c*i[0]+l*i[1]+h*i[2],n[2]=e[14]+f*i[0]+d*i[1]+p*i[2],r[0]=v*o[0]+m*o[1]+y*o[2],r[1]=g*o[0]+x*o[1]+E*o[2],r[2]=b*o[0]+T*o[1]+S*o[2],lr(this.min,n,r),hr(this.max,n,r)},e.intersects=function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return!(n[0]>r[0]||i[0]>e[0]||n[1]>r[1]||i[1]>e[1]||n[2]>r[2]||i[2]>e[2])},e.intersection=function(e){if(!this.intersects(e))return null;var n,r,i,o=new t,a=(n=[0,0,0],r=this.getMin(),i=e.getMin(),n[0]=Math.max(r[0],i[0]),n[1]=Math.max(r[1],i[1]),n[2]=Math.max(r[2],i[2]),n),s=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t}([0,0,0],this.getMax(),e.getMax());return o.setMinMax(a,s),o},e.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?cr([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]]},e.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?cr([0,0,0],this.max):272===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:257===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:256===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:17===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:16===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:1===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]},t}(),Uo=function(){function t(t,e){this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=t||0,this.normal=e||I(0,1,0),this.updatePNVertexFlag()}var e=t.prototype;return e.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)},e.distanceToPoint=function(t){return j(t,this.normal)-this.distance},e.normalize=function(){var t=1/K(this.normal);U(this.normal,this.normal,t),this.distance*=t},e.intersectsLine=function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),o=i>=0&&1>=i;return o&&n&&H(n,t,e,i),o},t}();(Ao=t.Mask||(t.Mask={}))[Ao.OUTSIDE=4294967295]="OUTSIDE",Ao[Ao.INSIDE=0]="INSIDE",Ao[Ao.INDETERMINATE=2147483647]="INDETERMINATE";var zo=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;6>e;e++)this.planes.push(new Uo)}return t.prototype.extractFromVPMatrix=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],h=t[10],f=t[11],d=t[12],p=t[13],v=t[14],m=t[15];F(this.planes[0].normal,i-e,u-o,f-c),this.planes[0].distance=m-d,F(this.planes[1].normal,i+e,u+o,f+c),this.planes[1].distance=m+d,F(this.planes[2].normal,i+n,u+a,f+l),this.planes[2].distance=m+p,F(this.planes[3].normal,i-n,u-a,f-l),this.planes[3].distance=m-p,F(this.planes[4].normal,i-r,u-s,f-h),this.planes[4].distance=m-v,F(this.planes[5].normal,i+r,u+s,f+h),this.planes[5].distance=m+v,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))},t}(),jo=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}var e=t.prototype;return e.clone=function(){return new t(this.x,this.y)},e.copyFrom=function(t){this.x=t.x,this.y=t.y},t}(),Vo=function(){function t(t,e,n,r){this.x=void 0,this.y=void 0,this.width=void 0,this.height=void 0,this.left=void 0,this.right=void 0,this.top=void 0,this.bottom=void 0,this.x=t,this.y=e,this.width=n,this.height=r,this.left=t,this.right=t+n,this.top=e,this.bottom=e+r}return t.prototype.toJSON=function(){},t}(),Ho=function(){function e(){this.parser=io,this.parserWithCSSDisabled=io,this.mixer=oo}var n=e.prototype;return n.calculator=function(t,e,n){return n instanceof An&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Vo(0,0,0,0)}:n},n.postProcessor=function(e,n){if(e.nodeName===t.Shape.PATH&&-1===n.indexOf("transform")){var r=e.parsedStyle,i=r.defX,o=r.defY;e.setLocalPosition(void 0===i?0:i,void 0===o?0:o)}},e}(),Wo=function(){function e(){this.parser=ao,this.mixer=so}return e.prototype.postProcessor=function(e,n){if((e.nodeName===t.Shape.POLYGON||e.nodeName===t.Shape.POLYLINE)&&-1===n.indexOf("transform")){var r=e.parsedStyle;e.setLocalPosition(r.defX,r.defY)}},e}(),Yo=function(t){function e(){for(var e,n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).mixer=to(0,1/0),e}return vn(e,t),e}(Oo),Xo=function(){function t(){}var e=t.prototype;return e.calculator=function(t,e,n,r){return n instanceof An?"unset"===n.value?"":n.value:""+n},e.postProcessor=function(t){t.nodeValue=""+t.parsedStyle.text||""},t}(),qo=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){var i=r.getAttribute("text");if(i){var o=i;"capitalize"===n.value?o=i.charAt(0).toUpperCase()+i.slice(1):"lowercase"===n.value?o=i.toLowerCase():"uppercase"===n.value&&(o=i.toUpperCase()),r.parsedStyle.text=o}return n.value},t}(),Ko=function(){function t(){this.parser=fo,this.parserWithCSSDisabled=fo,this.mixer=To}var e=t.prototype;return e.calculator=function(t,e,n,r){return n instanceof An?[]:n},e.postProcessor=function(t){Nr(t.parsedStyle.transform,t)},t}(),Zo=function(){this.parser=So},Qo=function(){function t(){this.parser=$i}var e=t.prototype;return e.calculator=function(t,e,n,r){return n.value},e.postProcessor=function(t){if(t.parentNode){var e=t.parentNode,n=e.renderable,r=e.sortable;n&&(n.dirty=!0),r&&(r.dirty=!0)}},t}(),$o=function(){function e(){this.registry={},this.define(t.Shape.CIRCLE,ka),this.define(t.Shape.ELLIPSE,_a),this.define(t.Shape.RECT,Qa),this.define(t.Shape.IMAGE,Ua),this.define(t.Shape.LINE,ja),this.define(t.Shape.GROUP,Da),this.define(t.Shape.PATH,Wa),this.define(t.Shape.POLYGON,Xa),this.define(t.Shape.POLYLINE,Ka),this.define(t.Shape.TEXT,Ja),this.define(t.Shape.HTML,Ga)}var n=e.prototype;return n.define=function(t,e){this.registry[t]=e},n.get=function(t){return this.registry[t]},e}();function Jo(t){return!!t.type}var ta=function(){function t(e){this.type=void 0,this.eventPhase=t.prototype.NONE,this.target=void 0,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.currentTarget=void 0,this.defaultPrevented=!1,this.timeStamp=void 0,this.nativeEvent=void 0,this.originalEvent=void 0,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.manager=void 0,this.detail=void 0,this.layer=new jo,this.page=new jo,this.canvas=new jo,this.viewport=new jo,this.path=void 0,this.view=void 0,this.which=void 0,this.returnValue=void 0,this.srcElement=void 0,this.composed=!1,this.isTrusted=void 0,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}var e=t.prototype;return e.composedPath=function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},e.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},e.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},e.stopPropagation=function(){this.propagationStopped=!0},e.initEvent=function(){},e.initUIEvent=function(){},e.clone=function(){throw Error(ar)},dn(t,[{key:"name",get:function(){return this.type}},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"propagationPath",get:function(){return this.composedPath()}}]),t}(),ea=function(t){function e(e,n){var r;return(r=t.call(this,null)||this).type=e,r.detail=n,Object.assign(gn(r),n),r}return vn(e,t),e}(ta),na=function(){function t(){this.emitter=new un}var e=t.prototype;return e.on=function(t,e,n){return this.addEventListener(t,e,n),this},e.addEventListener=function(t,e,n){var r=ce(n)&&n||ne(n)&&n.capture,i=ne(n)&&n.once,o=_n(e)?void 0:e,a=!1,s="";if(t.indexOf(":")>-1){var u=t.split(":");t=u[1],s=u[0],a=!0}if(t=r?t+"capture":t,e=_n(e)?e:e.handleEvent,a){var c=e;e=function(){for(var t,e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];(null===(t=n[0].target)||void 0===t?void 0:t.name)===s&&c.apply(void 0,n)}}return i?this.emitter.once(t,e,o):this.emitter.on(t,e,o),this},e.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},e.removeAllEventListeners=function(){this.emitter.removeAllListeners()},e.removeEventListener=function(t,e,n){var r,i=ce(n)&&n||ne(n)&&n.capture,o=_n(e)?void 0:e;return t=i?t+"capture":t,e=_n(e)?e:null===(r=e)||void 0===r?void 0:r.handleEvent,this.emitter.off(t,e,o),this},e.emit=function(t,e){this.dispatchEvent(new ea(t,e))},e.dispatchEvent=function(t,e){if(void 0===e&&(e=!1),!Jo(t))throw Error("DisplayObject cannot propagate events outside of the Federated Events API");var n;if(this.document)n=this;else if(this.defaultView)n=this.defaultView;else{var r;n=null===(r=this.ownerDocument)||void 0===r?void 0:r.defaultView}if(n){var i;if(t.manager=n.getEventService()||null,!t.manager)return!1;t.defaultPrevented=!1,t.path=[],e||(t.target=this),null===(i=t.manager)||void 0===i||i.dispatchEvent(t,t.type,e)}return!t.defaultPrevented},t}(),ra=function(e){function n(){for(var t,n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t}vn(n,e),n.isNode=function(t){return!!t.childNodes};var r=n.prototype;return r.getRootNode=function(t){return void 0===t&&(t={}),this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this},r.hasChildNodes=function(){return this.childNodes.length>0},r.isDefaultNamespace=function(t){throw Error(ar)},r.lookupNamespaceURI=function(t){throw Error(ar)},r.lookupPrefix=function(t){throw Error(ar)},r.normalize=function(){throw Error(ar)},r.isEqualNode=function(t){return this===t},r.isSameNode=function(t){return this.isEqualNode(t)},r.compareDocumentPosition=function(t){if(t===this)return 0;if(!(t instanceof n))throw new TypeError("Node.compareDocumentPosition: Argument 1 does not implement interface Node.");for(var e=t,r=this,i=[e],o=[r];null!==(a=e.parentNode)&&void 0!==a?a:r.parentNode;){var a;e=e.parentNode?(i.push(e.parentNode),e.parentNode):e,r=r.parentNode?(o.push(r.parentNode),r.parentNode):r}if(e!==r)return n.DOCUMENT_POSITION_DISCONNECTED|n.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|n.DOCUMENT_POSITION_PRECEDING;var s=i.length>o.length?i:o,u=s===i?o:i;if(s[s.length-u.length]===u[0])return s===i?n.DOCUMENT_POSITION_CONTAINED_BY|n.DOCUMENT_POSITION_FOLLOWING:n.DOCUMENT_POSITION_CONTAINS|n.DOCUMENT_POSITION_PRECEDING;for(var c=s.length-u.length,l=u.length-1;l>=0;l--){var h=u[l],f=s[c+l];if(f!==h){var d=h.parentNode.childNodes;return d.indexOf(h)<d.indexOf(f)?u===i?n.DOCUMENT_POSITION_PRECEDING:n.DOCUMENT_POSITION_FOLLOWING:s===i?n.DOCUMENT_POSITION_PRECEDING:n.DOCUMENT_POSITION_FOLLOWING}}return n.DOCUMENT_POSITION_FOLLOWING},r.contain=function(t){return this.contains(t)},r.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},r.getAncestor=function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e},r.forEach=function(t,e){void 0===e&&(e=!1),t(this)||(e?this.childNodes.slice():this.childNodes).forEach((function(e){e.forEach(t)}))},dn(n,[{key:"textContent",get:function(){var e="";this.nodeName===t.Shape.TEXT&&(e+=this.style.text);for(var n,r=En(this.childNodes);!(n=r()).done;){var i=n.value;e+=i.nodeName===t.Shape.TEXT?i.nodeValue:i.textContent}return e},set:function(e){var n=this;this.childNodes.slice().forEach((function(t){n.removeChild(t)})),this.nodeName===t.Shape.TEXT&&(this.style.text=""+e)}},{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}}]),n}(na);ra.DOCUMENT_POSITION_DISCONNECTED=1,ra.DOCUMENT_POSITION_PRECEDING=2,ra.DOCUMENT_POSITION_FOLLOWING=4,ra.DOCUMENT_POSITION_CONTAINS=8,ra.DOCUMENT_POSITION_CONTAINED_BY=16,ra.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var ia,oa,aa=function(e){function n(){var n;(n=e.call(this)||this).defaultView=null,n.documentElement=void 0,n.timeline=void 0,n.ownerDocument=null,n.nodeName="document";try{n.timeline=new Ls.AnimationTimeline(gn(n))}catch(t){}var r={};return ts.forEach((function(e){var n=e.d;e.inh&&n&&(r[e.n]=_n(n)?n(t.Shape.GROUP):n)})),n.documentElement=new Da({id:"g-root",style:r}),n.documentElement.ownerDocument=gn(n),n.documentElement.parentNode=gn(n),n.childNodes=[n.documentElement],n}vn(n,e);var r=n.prototype;return r.createElement=function(t,e){if("svg"===t)return this.documentElement;var n=this.defaultView.customElements.get(t);n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?Ja:Da);var r=new n(e);return r.ownerDocument=this,r},r.createElementNS=function(t,e,n){return this.createElement(e,n)},r.cloneNode=function(t){throw Error(ar)},r.destroy=function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}},r.elementsFromBBox=function(t,e,n,r){var i=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),o=[];return i.forEach((function(t){var e=Ls.displayObjectPool.getByEntity(t.id),n=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(e.parsedStyle.pointerEvents);(!n||n&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&o.push(e)})),o.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),o},r.elementFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig();if(0>r||0>i||r>o.width||i>o.height)return null;var a=this.defaultView.viewport2Client({x:r,y:i}),s=a.x,u=a.y,c=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return c&&c[0]||this.documentElement},r.elementFromPoint=function(){var t=hn(cn().mark((function t(e,n){var r,i,o,a,s,u,c,l,h,f;return cn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,o=r.y,a=this.defaultView.getConfig(),s=a.width,u=a.height,!(0>i||0>o||i>s||o>u)){t.next=4;break}return t.abrupt("return",null);case 4:return c=this.defaultView.viewport2Client({x:i,y:o}),l=c.x,h=c.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:i,viewportY:o,clientX:l,clientY:h},picked:[]});case 7:return t.abrupt("return",(f=t.sent.picked)&&f[0]||this.documentElement);case 10:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),r.elementsFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig();if(0>r||0>i||r>o.width||i>o.height)return[];var a=this.defaultView.viewport2Client({x:r,y:i}),s=a.x,u=a.y,c=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return c[c.length-1]!==this.documentElement&&c.push(this.documentElement),c},r.elementsFromPoint=function(){var t=hn(cn().mark((function t(e,n){var r,i,o,a,s,u,c,l,h,f;return cn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,o=r.y,a=this.defaultView.getConfig(),s=a.width,u=a.height,!(0>i||0>o||i>s||o>u)){t.next=4;break}return t.abrupt("return",[]);case 4:return c=this.defaultView.viewport2Client({x:i,y:o}),l=c.x,h=c.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:i,viewportY:o,clientX:l,clientY:h},picked:[]});case 7:return(f=t.sent.picked)[f.length-1]!==this.documentElement&&f.push(this.documentElement),t.abrupt("return",f);case 11:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),r.appendChild=function(t,e){throw Error(sr)},r.insertBefore=function(t,e){throw Error(sr)},r.removeChild=function(t,e){throw Error(sr)},r.replaceChild=function(t,e,n){throw Error(sr)},r.append=function(){throw Error(sr)},r.prepend=function(){throw Error(sr)},r.getElementById=function(t){return this.documentElement.getElementById(t)},r.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},r.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},r.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},r.querySelector=function(t){return this.documentElement.querySelector(t)},r.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},r.find=function(t){return this.documentElement.find(t)},r.findAll=function(t){return this.documentElement.findAll(t)},dn(n,[{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}}]),n}(ra);(ia=t.Strategy||(t.Strategy={}))[ia.Standard=0]="Standard",(oa=t.ElementEvent||(t.ElementEvent={})).REPARENT="reparent",oa.DESTROY="destroy",oa.ATTR_MODIFIED="DOMAttrModified",oa.INSERTED="DOMNodeInserted",oa.REMOVED="removed",oa.MOUNTED="DOMNodeInsertedIntoDocument",oa.UNMOUNTED="DOMNodeRemovedFromDocument",oa.BOUNDS_CHANGED="bounds-changed",oa.RENDER_ORDER_CHANGED="render-order-changed",oa.CULLED="culled";var sa=function(t){function e(e,n,r,i,o,a,s,u){var c;return(c=t.call(this,null)||this).relatedNode=void 0,c.prevValue=void 0,c.newValue=void 0,c.attrName=void 0,c.attrChange=void 0,c.prevParsedValue=void 0,c.newParsedValue=void 0,c.relatedNode=n,c.prevValue=r,c.newValue=i,c.attrName=o,c.attrChange=a,c.prevParsedValue=s,c.newParsedValue=u,c.type=e,c}return vn(e,t),e}(ta);sa.ADDITION=2,sa.MODIFICATION=1,sa.REMOVAL=3;var ua=0;var ca=new sa(t.ElementEvent.INSERTED,null,"","","",0,"",""),la=new sa(t.ElementEvent.REMOVED,null,"","","",0,"",""),ha=new ea(t.ElementEvent.DESTROY),fa=function(e){function n(){for(var n,r=arguments.length,i=Array(r),o=0;r>o;o++)i[o]=arguments[o];return(n=e.call.apply(e,[this].concat(i))||this).entity=ua++,n.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1,proxyNodeName:void 0},n.cullable={strategy:t.Strategy.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},n.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},n.sortable={dirty:!1,sorted:void 0,lastSortedIndex:void 0,renderOrder:0},n.geometry={contentBounds:void 0,renderBounds:void 0},n.rBushNode={aabb:void 0},n.id=void 0,n.name=void 0,n.namespaceURI="g",n.scrollLeft=0,n.scrollTop=0,n.clientTop=0,n.clientLeft=0,n.destroyed=!1,n.style={},n.computedStyle=Ls.enableCSSParsing?{anchor:Hn,opacity:Hn,fillOpacity:Hn,strokeOpacity:Hn,fill:Hn,stroke:Hn,transform:Hn,transformOrigin:Hn,visibility:Hn,pointerEvents:Hn,lineWidth:Hn,lineCap:Hn,lineJoin:Hn,increasedLineWidthForHitTesting:Hn,fontSize:Hn,fontFamily:Hn,fontStyle:Hn,fontWeight:Hn,fontVariant:Hn,textAlign:Hn,textBaseline:Hn,textTransform:Hn,zIndex:Hn,filter:Hn,shadowType:Hn}:null,n.parsedStyle={},n.attributes={},n}vn(n,e),n.isElement=function(t){return!!t.getAttribute};var r=n.prototype;return r.cloneNode=function(t){throw Error(ar)},r.appendChild=function(t,e){var n;if(t.destroyed)throw Error("Cannot append a destroyed element.");return Ls.sceneGraphService.attach(t,this,e),(null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView)&&this.ownerDocument.defaultView.mountChildren(t),ca.relatedNode=this,t.dispatchEvent(ca),t},r.insertBefore=function(t,e){if(e){var n=this.childNodes.indexOf(e);this.appendChild(t,n-1)}else this.appendChild(t);return t},r.replaceChild=function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e},r.removeChild=function(t){var e;return la.relatedNode=this,t.dispatchEvent(la),(null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)&&t.ownerDocument.defaultView.unmountChildren(t),Ls.sceneGraphService.detach(t),t},r.removeChildren=function(){for(var t=this.childNodes.length-1;t>=0;t--){this.removeChild(this.childNodes[t])}},r.destroyChildren=function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length&&e.destroyChildren(),e.destroy()}},r.matches=function(t){return Ls.sceneGraphService.matches(t,this)},r.getElementById=function(t){return Ls.sceneGraphService.querySelector("#"+t,this)},r.getElementsByName=function(t){return Ls.sceneGraphService.querySelectorAll('[name="'+t+'"]',this)},r.getElementsByClassName=function(t){return Ls.sceneGraphService.querySelectorAll("."+t,this)},r.getElementsByTagName=function(t){return Ls.sceneGraphService.querySelectorAll(t,this)},r.querySelector=function(t){return Ls.sceneGraphService.querySelector(t,this)},r.querySelectorAll=function(t){return Ls.sceneGraphService.querySelectorAll(t,this)},r.closest=function(t){var e=this;do{if(Ls.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null},r.find=function(t){var e=this,n=null;return this.forEach((function(r){return!(r===e||!t(r))&&(n=r,!0)})),n},r.findAll=function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n},r.after=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)}))}},r.before=function(){if(this.parentNode){for(var t=this.parentNode.childNodes.indexOf(this),e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=n[0],o=n.slice(1);this.parentNode.appendChild(i,t),i.after.apply(i,o)}},r.replaceWith=function(){this.after.apply(this,arguments),this.remove()},r.append=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)}))},r.prepend=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)}))},r.replaceChildren=function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)},r.remove=function(){return this.parentNode?this.parentNode.removeChild(this):this},r.destroy=function(){this.dispatchEvent(ha),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},r.getGeometryBounds=function(){return Ls.sceneGraphService.getGeometryBounds(this)},r.getRenderBounds=function(){return Ls.sceneGraphService.getBounds(this,!0)},r.getBounds=function(){return Ls.sceneGraphService.getBounds(this)},r.getLocalBounds=function(){return Ls.sceneGraphService.getLocalBounds(this)},r.getBoundingClientRect=function(){return Ls.sceneGraphService.getBoundingClientRect(this)},r.getClientRects=function(){return[this.getBoundingClientRect()]},r.computedStyleMap=function(){return new Map(Object.entries(this.computedStyle))},r.getAttributeNames=function(){return Object.keys(this.attributes)},r.getAttribute=function(t){if(function(t){return"symbol"==typeof t}(t))return Ls.enableCSSParsing?null:void 0;var e=this.attributes[t];if(void 0===e){var n=Dn(t);return e=this.attributes[n],Ls.enableCSSParsing&&$t(e)?null:e}return e},r.hasAttribute=function(t){return this.getAttributeNames().includes(t)},r.hasAttributes=function(){return!!this.getAttributeNames().length},r.removeAttribute=function(t){this.setAttribute(t,null),delete this.attributes[t]},r.setAttribute=function(t,e,n){this.attributes[t]=e},r.getAttributeNS=function(t,e){throw Error(ar)},r.getAttributeNode=function(t){throw Error(ar)},r.getAttributeNodeNS=function(t,e){throw Error(ar)},r.hasAttributeNS=function(t,e){throw Error(ar)},r.removeAttributeNS=function(t,e){throw Error(ar)},r.removeAttributeNode=function(t){throw Error(ar)},r.setAttributeNS=function(t,e,n){throw Error(ar)},r.setAttributeNode=function(t){throw Error(ar)},r.setAttributeNodeNS=function(t){throw Error(ar)},r.toggleAttribute=function(t,e){throw Error(ar)},dn(n,[{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}}]),n}(ra),da=function(t){function e(){for(var e,n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).altKey=void 0,e.button=void 0,e.buttons=void 0,e.ctrlKey=void 0,e.metaKey=void 0,e.relatedTarget=void 0,e.shiftKey=void 0,e.client=new jo,e.movement=new jo,e.offset=new jo,e.global=new jo,e.screen=new jo,e}vn(e,t);var n=e.prototype;return n.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},n.initMouseEvent=function(){throw Error(ar)},dn(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}}]),e}(ta),pa=function(t){function e(){for(var e,n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).pointerId=void 0,e.width=0,e.height=0,e.isPrimary=!1,e.pointerType=void 0,e.pressure=void 0,e.tangentialPressure=void 0,e.tiltX=void 0,e.tiltY=void 0,e.twist=void 0,e}vn(e,t);var n=e.prototype;return n.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},n.getPredictedEvents=function(){throw Error("getPredictedEvents is not supported!")},n.clone=function(){return this.manager.clonePointerEvent(this)},e}(da),va=function(t){function e(){for(var e,n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).deltaMode=void 0,e.deltaX=void 0,e.deltaY=void 0,e.deltaZ=void 0,e.DOM_DELTA_LINE=0,e.DOM_DELTA_PAGE=1,e.DOM_DELTA_PIXEL=2,e}return vn(e,t),e.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},e}(da);function ma(t){return!!(null==t?void 0:t.nodeName)}var ya,ga,xa,Ea=new sa(t.ElementEvent.ATTR_MODIFIED,null,null,null,null,sa.MODIFICATION,null,null),ba={anchor:"",opacity:"",fillOpacity:"",strokeOpacity:"",fill:"",stroke:"",transform:"",transformOrigin:"",visibility:"",pointerEvents:"",lineWidth:"",lineCap:"",lineJoin:"",increasedLineWidthForHitTesting:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",zIndex:"",filter:"",shadowType:""},Ta={anchor:[0,0],fill:Kn,stroke:Kn,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},Sa=pn({},Ta,{opacity:1,fillOpacity:1,strokeOpacity:1,visibility:"visible",pointerEvents:"auto",lineWidth:1,lineCap:"butt",lineJoin:"miter",increasedLineWidthForHitTesting:0,fillRule:"nonzero"}),Pa=[].concat(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"],["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"]),wa=function(e){function n(n){var r,i;(i=e.call(this)||this).config=void 0,i.isCustomElement=!1,i.isMutationObserved=!1,i.activeAnimations=[],i.dataset=void 0,i.getClip=function(){return this.style.clipPath||null},i.config=n,i.config.interactive=null!==(r=i.config.capture)&&void 0!==r?r:i.config.interactive,i.id=i.config.id||"",i.name=i.config.name||"",(i.config.className||i.config.class)&&(i.className=i.config.className||i.config.class),i.nodeName=i.config.type||t.Shape.GROUP,i.config.style=i.config.style||i.config.attrs||{},Object.assign(i.config.style,i.config.attrs),null!=i.config.visible&&(i.config.style.visibility=!1===i.config.visible?"hidden":"visible"),null!=i.config.interactive&&(i.config.style.pointerEvents=!1===i.config.interactive?"none":"auto"),Object.assign(i.parsedStyle,Ls.enableCSSParsing?Ta:Sa,i.config.initialParsedStyle),Ls.enableCSSParsing&&Object.assign(i.attributes,ba),i.initAttributes(i.config.style);var o=Ls.globalThis.Proxy?Ls.globalThis.Proxy:function(){};return i.dataset=new o({},{get:function(t,e){var n="data-"+Rn(e);return void 0!==t[n]?t[n]:i.getAttribute(n)},set:function(t,e,n){return i.setAttribute("data-"+Rn(e),n),!0}}),i.style=new o({setProperty:function(t,e){i.setAttribute(t,e)},getPropertyValue:function(t){return i.getAttribute(t)},removeProperty:function(t){i.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:i.getAttribute(e)},set:function(t,e,n){return i.setAttribute(e,n),!0}}),Ls.displayObjectPool.add(i.entity,gn(i)),i}vn(n,e);var r=n.prototype;return r.destroy=function(){e.prototype.destroy.call(this),Ls.displayObjectPool.remove(this.entity),this.getAnimations().forEach((function(t){t.cancel()}))},r.cloneNode=function(t,e){var n=pn({},this.attributes);for(var r in n){var i=n[r];ma(i)&&"clipPath"!==r&&"offsetPath"!==r&&"textPath"!==r&&(n[r]=i.cloneNode(t)),e&&(n[r]=e(r,i))}var o=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,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},r.initAttributes=function(t){void 0===t&&(t={});var e=this.renderable,n={forceUpdateGeometry:!0};Ls.enableCSSParsing&&(n.usedAttributes=Pa),Ls.styleValueRegistry.processProperties(this,t,n),e.dirty=!0},r.setAttribute=function(t,n,r){void 0===r&&(r=!1);var i=Dn(t);le(n)||(r||n!==this.attributes[i])&&(this.internalSetAttribute(i,n),e.prototype.setAttribute.call(this,i,n))},r.internalSetAttribute=function(t,e,n){var r;void 0===n&&(n={});var i=this.renderable,o=this.attributes[t],a=this.parsedStyle[t];Ls.styleValueRegistry.processProperties(this,((r={})[t]=e,r),n),i.dirty=!0;var s=this.parsedStyle[t];this.isConnected&&(Ea.relatedNode=this,Ea.prevValue=o,Ea.newValue=e,Ea.attrName=t,Ea.prevParsedValue=a,Ea.newParsedValue=s,this.isMutationObserved?this.dispatchEvent(Ea):(Ea.target=this,this.ownerDocument.defaultView.dispatchEvent(Ea,!0))),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(t,o,e,a,s)},r.getBBox=function(){var t=this.getBounds(),e=t.getMin(),n=e[0],r=e[1],i=t.getMax();return new Vo(n,r,i[0]-n,i[1]-r)},r.setOrigin=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Ls.sceneGraphService.setOrigin(this,pr(t,e,n)),this},r.getOrigin=function(){return Ls.sceneGraphService.getOrigin(this)},r.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Ls.sceneGraphService.setPosition(this,pr(t,e,n)),this},r.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Ls.sceneGraphService.setLocalPosition(this,pr(t,e,n)),this},r.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Ls.sceneGraphService.translate(this,pr(t,e,n)),this},r.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Ls.sceneGraphService.translateLocal(this,pr(t,e,n)),this},r.getPosition=function(){return Ls.sceneGraphService.getPosition(this)},r.getLocalPosition=function(){return Ls.sceneGraphService.getLocalPosition(this)},r.scale=function(t,e,n){return this.scaleLocal(t,e,n)},r.scaleLocal=function(t,e,n){return"number"==typeof t&&(t=pr(t,e=e||t,n=n||t)),Ls.sceneGraphService.scaleLocal(this,t),this},r.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=pr(t,e=e||t,n=n||t)),Ls.sceneGraphService.setLocalScale(this,t),this},r.getLocalScale=function(){return Ls.sceneGraphService.getLocalScale(this)},r.getScale=function(){return Ls.sceneGraphService.getScale(this)},r.getEulerAngles=function(){return mr(gr(L(),Ls.sceneGraphService.getWorldTransform(this))[2])},r.getLocalEulerAngles=function(){return mr(gr(L(),Ls.sceneGraphService.getLocalRotation(this))[2])},r.setEulerAngles=function(t){return Ls.sceneGraphService.setEulerAngles(this,0,0,t),this},r.setLocalEulerAngles=function(t){return Ls.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},r.rotateLocal=function(t,e,n){return $t(e)&&$t(n)?Ls.sceneGraphService.rotateLocal(this,0,0,t):Ls.sceneGraphService.rotateLocal(this,t,e,n),this},r.rotate=function(t,e,n){return $t(e)&&$t(n)?Ls.sceneGraphService.rotate(this,0,0,t):Ls.sceneGraphService.rotate(this,t,e,n),this},r.setRotation=function(t,e,n,r){return Ls.sceneGraphService.setRotation(this,t,e,n,r),this},r.setLocalRotation=function(t,e,n,r){return Ls.sceneGraphService.setLocalRotation(this,t,e,n,r),this},r.setLocalSkew=function(t,e){return Ls.sceneGraphService.setLocalSkew(this,t,e),this},r.getRotation=function(){return Ls.sceneGraphService.getRotation(this)},r.getLocalRotation=function(){return Ls.sceneGraphService.getLocalRotation(this)},r.getLocalSkew=function(){return Ls.sceneGraphService.getLocalSkew(this)},r.getLocalTransform=function(){return Ls.sceneGraphService.getLocalTransform(this)},r.getWorldTransform=function(){return Ls.sceneGraphService.getWorldTransform(this)},r.setLocalTransform=function(t){return Ls.sceneGraphService.setLocalTransform(this,t),this},r.resetLocalTransform=function(){Ls.sceneGraphService.resetLocalTransform(this)},r.getAnimations=function(){return this.activeAnimations},r.animate=function(t,e){var n,r=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;return r?r.play(this,t,e):null},r.isVisible=function(){var t;return"visible"===(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)},r.isInteractive=function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)},r.isCulled=function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)},r.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,this.parentNode.children.map((function(t){return Number(t.style.zIndex)})))+1),this},r.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,this.parentNode.children.map((function(t){return Number(t.style.zIndex)})))-1),this},r.getConfig=function(){return this.config},r.attr=function(){for(var t=this,e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=n[0],o=n[1];return i?ne(i)?(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),this):2===n.length?(this.setAttribute(i,o),this):this.attributes[i]:this.attributes},r.getMatrix=function(t){var e=t||this.getWorldTransform(),n=b(L(),e),r=n[0],i=n[1],o=T(L(),e),a=o[0],s=o[1],u=S($(),e),c=gr(L(),u);return xr(c[0]||c[2],r,i,a,s)},r.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},r.setMatrix=function(t){var e=Er(t),n=e[0],r=e[1],i=e[2],o=e[3];this.setEulerAngles(e[4]).setPosition(n,r).setLocalScale(i,o)},r.setLocalMatrix=function(t){var e=Er(t),n=e[0],r=e[1],i=e[2],o=e[3];this.setLocalEulerAngles(e[4]).setLocalPosition(n,r).setLocalScale(i,o)},r.show=function(){Ls.enableCSSParsing?this.style.visibility="visible":this.forEach((function(t){t.style.visibility="visible"}))},r.hide=function(){Ls.enableCSSParsing?this.style.visibility="hidden":this.forEach((function(t){t.style.visibility="hidden"}))},r.getCount=function(){return this.childElementCount},r.getParent=function(){return this.parentElement},r.getChildren=function(){return this.children},r.getFirst=function(){return this.firstElementChild},r.getLast=function(){return this.lastElementChild},r.getChildByIndex=function(t){return this.children[t]||null},r.add=function(t,e){return this.appendChild(t,e)},r.setClip=function(t){this.style.clipPath=t},r.set=function(t,e){this.config[t]=e},r.get=function(t){return this.config[t]},r.moveTo=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},r.move=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},r.setZIndex=function(t){return this.style.zIndex=t,this},dn(n,[{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}}]),n}(fa),Ma=["style"],ka=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=yn(r,Ma);return e.call(this,pn({type:t.Shape.CIRCLE,style:pn(Ls.enableCSSParsing?{cx:"",cy:"",r:""}:{},i),initialParsedStyle:{anchor:[.5,.5],transformOrigin:Ls.enableCSSParsing?null:[Jn,Jn]}},o))||this}return vn(n,e),n}(wa),Na=["style"],Ca=function(t){function e(e){var n,r=void 0===e?{}:e,i=r.style,o=yn(r,Na);return(n=t.call(this,pn({style:pn(Ls.enableCSSParsing?{x:"",y:""}:{},i)},o))||this).isCustomElement=!0,n}return vn(e,t),e}(wa),Aa={},Oa=[],La=function(){function e(){}var n=e.prototype;return n.getByEntity=function(t){return Aa[t]},n.getAll=function(){return Object.keys(Aa).map((function(t){return Aa[t]}))},n.add=function(e,n){Aa[e]=n,n.nodeName===t.Shape.HTML&&Oa.push(n)},n.remove=function(e){var n=Aa[e];if(n&&(delete Aa[e],n.nodeName===t.Shape.HTML)){var r=Oa.indexOf(n);Oa.splice(r,1)}},n.getHTMLs=function(){return Oa},e}(),Ra=["style"],_a=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=yn(r,Ra);return e.call(this,pn({type:t.Shape.ELLIPSE,style:pn(Ls.enableCSSParsing?{cx:"",cy:"",rx:"",ry:""}:{},i),initialParsedStyle:{anchor:[.5,.5],transformOrigin:Ls.enableCSSParsing?null:[Jn,Jn]}},o))||this}return vn(n,e),n}(wa),Ia=["style"],Da=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=yn(r,Ia);return e.call(this,pn({type:t.Shape.GROUP,style:pn(Ls.enableCSSParsing?{x:"",y:"",width:"",height:""}:{},i)},o))||this}return vn(n,e),n}(wa),Fa=["style"],Ga=function(e){function n(n){var r,i=void 0===n?{}:n,o=i.style,a=yn(i,Fa);return(r=e.call(this,pn({type:t.Shape.HTML,style:pn(Ls.enableCSSParsing?{x:"",y:"",width:"auto",height:"auto",innerHTML:""}:{},o)},a))||this).cullable.enable=!1,r}vn(n,e);var r=n.prototype;return r.getDomElement=function(){return this.parsedStyle.$el},r.getBoundingClientRect=function(){return this.parsedStyle.$el.getBoundingClientRect()},r.getClientRects=function(){return[this.getBoundingClientRect()]},r.getBounds=function(){var t,e,n=this.getBoundingClientRect(),r=null===(t=this.ownerDocument)||void 0===t||null===(e=t.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect();if(r){var i=n.left-r.left,o=n.top-r.top,a=new Bo;return a.setMinMax([i,o,0],[i+n.width,o+n.height,0]),a}return null},r.getLocalBounds=function(){if(this.parentNode){var t=f(a(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!Bo.isEmpty(e)){var n=new Bo;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},n}(wa),Ba=["style"],Ua=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=yn(r,Ba);return e.call(this,pn({type:t.Shape.IMAGE,style:pn(Ls.enableCSSParsing?{x:"",y:"",img:"",width:"",height:""}:{},i)},o))||this}return vn(n,e),n}(wa),za=["style"],ja=function(e){function n(n){var r,i=void 0===n?{}:n,o=i.style,a=yn(i,za);(r=e.call(this,pn({type:t.Shape.LINE,style:pn({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0,isBillboard:!1},o)},a))||this).markerStartAngle=0,r.markerEndAngle=0;var s=r.parsedStyle,u=s.markerStart,c=s.markerEnd;return u&&ma(u)&&(r.markerStartAngle=u.getLocalEulerAngles(),r.appendChild(u)),c&&ma(c)&&(r.markerEndAngle=c.getLocalEulerAngles(),r.appendChild(c)),r.transformMarker(!0),r.transformMarker(!1),r}vn(n,e);var r=n.prototype;return r.attributeChangedCallback=function(t,e,n,r,i){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&ma(r)&&(this.markerStartAngle=0,r.remove()),i&&ma(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&ma(r)&&(this.markerEndAngle=0,r.remove()),i&&ma(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))},r.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=e.x1,o=e.x2,a=e.y1,s=e.y2,u=e.defX,c=e.defY,l=t?e.markerStart:e.markerEnd;if(l&&ma(l)){var h,f,d,p,v,m,y;t?(p=i-u,v=a-c,f=o-i,d=s-a,m=n||0,y=this.markerStartAngle):(p=o-u,v=s-c,f=i-o,d=a-s,m=r||0,y=this.markerEndAngle),l.setLocalEulerAngles(180*(h=Math.atan2(d,f))/Math.PI+y),l.setLocalPosition(p+Math.cos(h)*m,v+Math.sin(h)*m)}},r.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,o=He.pointAt(n.x1,n.y1,n.x2,n.y2,t),a=o.x,s=o.y,u=W(L(),I(a-r,s-i,0),e?this.getWorldTransform():this.getLocalTransform());return new jo(u[0],u[1])},r.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},r.getTotalLength=function(){var t=this.parsedStyle;return He.length(t.x1,t.y1,t.x2,t.y2)},n}(wa),Va=["style"],Ha={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Vo(0,0,0,0)},Wa=function(e){function n(n){var r,i=void 0===n?{}:n,o=i.style,a=yn(i,Va);(r=e.call(this,pn({type:t.Shape.PATH,style:pn(Ls.enableCSSParsing?{path:"",miterLimit:""}:{},o),initialParsedStyle:Ls.enableCSSParsing?null:{miterLimit:4,path:pn({},Ha)}},a))||this).markerStartAngle=0,r.markerEndAngle=0,r.markerMidList=[];var s=r.parsedStyle,u=s.markerStart,c=s.markerEnd,l=s.markerMid;return u&&ma(u)&&(r.markerStartAngle=u.getLocalEulerAngles(),r.appendChild(u)),l&&ma(l)&&r.placeMarkerMid(l),c&&ma(c)&&(r.markerEndAngle=c.getLocalEulerAngles(),r.appendChild(c)),r.transformMarker(!0),r.transformMarker(!1),r}vn(n,e);var r=n.prototype;return r.attributeChangedCallback=function(t,e,n,r,i){"path"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&ma(r)&&(this.markerStartAngle=0,r.remove()),i&&ma(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&ma(r)&&(this.markerEndAngle=0,r.remove()),i&&ma(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},r.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=e.defX,o=e.defY,a=t?e.markerStart:e.markerEnd;if(a&&ma(a)){var s,u,c,l,h,f,d;if(t){var p=this.getStartTangent(),v=p[0],m=p[1];l=m[0]-i,h=m[1]-o,u=v[0]-m[0],c=v[1]-m[1],f=n||0,d=this.markerStartAngle}else{var y=this.getEndTangent(),g=y[0],x=y[1];l=x[0]-i,h=x[1]-o,u=g[0]-x[0],c=g[1]-x[1],f=r||0,d=this.markerEndAngle}a.setLocalEulerAngles(180*(s=Math.atan2(c,u))/Math.PI+d),a.setLocalPosition(l+Math.cos(s)*f,h+Math.sin(s)*f)}},r.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.path.segments,r=e.defX,i=e.defY;if(this.markerMidList.forEach((function(t){t.remove()})),t&&ma(t))for(var o=1;n.length-1>o;o++){var a=n[o].currentPoint,s=a[0],u=a[1],c=1===o?t:t.cloneNode(!0);this.markerMidList.push(c),this.appendChild(c),c.setLocalPosition(s-r,u-i)}},r.getTotalLength=function(){return Lr(this)},r.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,o=function(t,e,n){return qt(t,e,vt(vt({},n),{bbox:!1,length:!0})).point}(n.path.absolutePath,t),a=o.x,s=o.y,u=W(L(),I(a-r,s-i,0),e?this.getWorldTransform():this.getLocalTransform());return new jo(u[0],u[1])},r.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*Lr(this),e)},r.getStartTangent=function(){var t=this.parsedStyle.path.segments,e=[];if(t.length>1){var n=t[0].currentPoint,r=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([n[0]-i[0],n[1]-i[1]]),e.push([n[0],n[1]])):(e.push([r[0],r[1]]),e.push([n[0],n[1]]))}return e},r.getEndTangent=function(){var t=this.parsedStyle.path.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,o=t[e-1].endTangent;n=[],o?(n.push([i[0]-o[0],i[1]-o[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n},n}(wa),Ya=["style"],Xa=function(e){function n(n){var r,i=void 0===n?{}:n,o=i.style,a=yn(i,Ya);(r=e.call(this,pn({type:t.Shape.POLYGON,style:pn(Ls.enableCSSParsing?{points:"",miterLimit:"",isClosed:!0}:{},o),initialParsedStyle:Ls.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},a))||this).markerStartAngle=0,r.markerEndAngle=0,r.markerMidList=[];var s=r.parsedStyle,u=s.markerStart,c=s.markerEnd,l=s.markerMid;return u&&ma(u)&&(r.markerStartAngle=u.getLocalEulerAngles(),r.appendChild(u)),l&&ma(l)&&r.placeMarkerMid(l),c&&ma(c)&&(r.markerEndAngle=c.getLocalEulerAngles(),r.appendChild(c)),r.transformMarker(!0),r.transformMarker(!1),r}vn(n,e);var r=n.prototype;return r.attributeChangedCallback=function(t,e,n,r,i){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&ma(r)&&(this.markerStartAngle=0,r.remove()),i&&ma(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&ma(r)&&(this.markerEndAngle=0,r.remove()),i&&ma(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},r.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=e.points.points,o=e.defX,a=e.defY,s=t?e.markerStart:e.markerEnd;if(s&&ma(s)){var u,c,l,h,f,d,p;if(h=i[0][0]-o,f=i[0][1]-a,t)c=i[1][0]-i[0][0],l=i[1][1]-i[0][1],d=n||0,p=this.markerStartAngle;else{var v=i.length;this.parsedStyle.isClosed?(c=i[v-1][0]-i[0][0],l=i[v-1][1]-i[0][1]):(h=i[v-1][0]-o,f=i[v-1][1]-a,c=i[v-2][0]-i[v-1][0],l=i[v-2][1]-i[v-1][1]),d=r||0,p=this.markerEndAngle}s.setLocalEulerAngles(180*(u=Math.atan2(l,c))/Math.PI+p),s.setLocalPosition(h+Math.cos(u)*d,f+Math.sin(u)*d)}},r.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.points.points,r=e.defX,i=e.defY;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&ma(t))for(var o=1;(this.parsedStyle.isClosed?n.length:n.length-1)>o;o++){var a=n[o][0]-r,s=n[o][1]-i,u=1===o?t:t.cloneNode(!0);this.markerMidList.push(u),this.appendChild(u),u.setLocalPosition(a,s)}},n}(wa),qa=["style"],Ka=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=yn(r,qa);return e.call(this,pn({type:t.Shape.POLYLINE,style:pn(Ls.enableCSSParsing?{points:"",miterLimit:"",isClosed:!1}:{},i),initialParsedStyle:Ls.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},o))||this}vn(n,e);var r=n.prototype;return r.getTotalLength=function(){return this.parsedStyle.points.totalLength},r.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},r.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,o=n.points,a=o.points,s=0,u=0;o.segments.forEach((function(e,n){e[0]>t||t>e[1]||(s=(t-e[0])/(e[1]-e[0]),u=n)}));var c=He.pointAt(a[u][0],a[u][1],a[u+1][0],a[u+1][1],s),l=c.x,h=c.y,f=W(L(),I(l-r,h-i,0),e?this.getWorldTransform():this.getLocalTransform());return new jo(f[0],f[1])},r.getStartTangent=function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},r.getEndTangent=function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},n}(Xa),Za=["style"],Qa=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=yn(r,Za);return e.call(this,pn({type:t.Shape.RECT,style:pn(Ls.enableCSSParsing?{x:"",y:"",width:"",height:"",radius:""}:{},i)},o))||this}return vn(n,e),n}(wa),$a=["style"],Ja=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=yn(r,$a);return e.call(this,pn({type:t.Shape.TEXT,style:pn(Ls.enableCSSParsing?{x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""}:{fill:"black"},i),initialParsedStyle:Ls.enableCSSParsing?{}:{x:0,y:0,fontSize:16,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",lineHeight:0,letterSpacing:0,textBaseline:"alphabetic",textAlign:"start",wordWrap:!1,wordWrapWidth:0,leading:0,dx:0,dy:0}},o))||this}vn(n,e);var r=n.prototype;return r.getComputedTextLength=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0},r.getLineBoundingRects=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]},r.isOverflowing=function(){return!!this.parsedStyle.isOverflowing},n}(wa),ts=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.PAINT},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:t.PropertySyntax.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:t.PropertySyntax.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:t.PropertySyntax.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:t.PropertySyntax.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:t.PropertySyntax.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:t.PropertySyntax.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:t.PropertySyntax.FILTER},{n:"clipPath",syntax:t.PropertySyntax.DEFINED_PATH},{n:"textPath",syntax:t.PropertySyntax.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.TRANSFORM},{n:"transformOrigin",p:100,d:function(e){return e===t.Shape.CIRCLE||e===t.Shape.ELLIPSE?"center":e===t.Shape.TEXT?"text-anchor":"left top"},l:!0,syntax:t.PropertySyntax.TRANSFORM_ORIGIN},{n:"anchor",p:99,d:function(e){return e===t.Shape.CIRCLE||e===t.Shape.ELLIPSE?"0.5 0.5":"0 0"},l:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE_12},{n:"cx",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"cy",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"x",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"y",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"z",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"y1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"z1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"x2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"y2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"z2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"path",int:!0,l:!0,d:"",a:["d"],syntax:t.PropertySyntax.PATH,p:50},{n:"points",int:!0,l:!0,syntax:t.PropertySyntax.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:t.PropertySyntax.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:t.PropertySyntax.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:t.PropertySyntax.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:t.PropertySyntax.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:t.PropertySyntax.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:t.PropertySyntax.NUMBER,d:function(e){return e===t.Shape.PATH||e===t.Shape.POLYGON||e===t.Shape.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:t.PropertySyntax.MARKER},{n:"markerEnd",syntax:t.PropertySyntax.MARKER},{n:"markerMid",syntax:t.PropertySyntax.MARKER},{n:"markerStartOffset",syntax:t.PropertySyntax.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:t.PropertySyntax.LENGTH,l:!0,int:!0,d:"0"}],es=ts.filter((function(t){return!!t.l})).map((function(t){return t.n})),ns={},rs=new WeakMap,is=function(){function e(){var t=this;ts.forEach((function(e){t.registerMetadata(e)}))}var n=e.prototype;return n.registerMetadata=function(t){[t.n].concat(t.a||[]).forEach((function(e){ns[e]=t}))},n.unregisterMetadata=function(t){delete ns[t]},n.getPropertySyntax=function(t){return Ls.CSSPropertySyntaxFactory[t]},n.processProperties=function(e,n,r){var i=this;if(void 0===r&&(r={skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[]}),!Ls.enableCSSParsing){n.src&&(n.img=n.src),n.d&&(n.path=n.d),n.strokeDasharray&&(n.lineDash=n.strokeDasharray),n.strokeWidth&&(n.lineWidth=n.strokeWidth),n.textAnchor&&(n.textAlign=n.textAnchor),Object.assign(e.attributes,n);var o=Object.keys(n),a=e.parsedStyle.clipPath,s=e.parsedStyle.offsetPath;e.parsedStyle=Object.assign(e.parsedStyle,n);var u=!!r.forceUpdateGeometry;if(!u)for(var c=0;es.length>c;c++)if(es[c]in n){u=!0;break}return n.fill&&(e.parsedStyle.fill=Gi(n.fill)),n.stroke&&(e.parsedStyle.stroke=Gi(n.stroke)),n.shadowColor&&(e.parsedStyle.shadowColor=Gi(n.shadowColor)),n.filter&&(e.parsedStyle.filter=Zi(n.filter)),$t(n.radius)||(e.parsedStyle.radius=Yi(n.radius,4)),$t(n.lineDash)||(e.parsedStyle.lineDash=Yi(n.lineDash,2)),n.points&&(e.parsedStyle.points=ao(n.points,e)),""===n.path&&(e.parsedStyle.path=pn({},Ha)),n.path&&(e.parsedStyle.path=io(n.path,e)),n.textTransform&&Ls.CSSPropertySyntaxFactory["<text-transform>"].calculator(null,null,{value:n.textTransform},e,null),n.clipPath&&Ls.CSSPropertySyntaxFactory["<defined-path>"].calculator("clipPath",a,n.clipPath,e,this),n.offsetPath&&Ls.CSSPropertySyntaxFactory["<defined-path>"].calculator("offsetPath",s,n.offsetPath,e,this),n.anchor&&(e.parsedStyle.anchor=Yi(n.anchor,2)),n.transform&&(e.parsedStyle.transform=fo(n.transform)),n.transformOrigin&&(e.parsedStyle.transformOrigin=So(n.transformOrigin)),n.markerStart&&(e.parsedStyle.markerStart=Ls.CSSPropertySyntaxFactory["<marker>"].calculator(null,n.markerStart,n.markerStart,null,null)),n.markerEnd&&(e.parsedStyle.markerEnd=Ls.CSSPropertySyntaxFactory["<marker>"].calculator(null,n.markerEnd,n.markerEnd,null,null)),n.markerMid&&(e.parsedStyle.markerMid=Ls.CSSPropertySyntaxFactory["<marker>"].calculator("",n.markerMid,n.markerMid,null,null)),(e.nodeName!==t.Shape.CIRCLE&&e.nodeName!==t.Shape.ELLIPSE||$t(n.cx)&&$t(n.cy))&&(e.nodeName!==t.Shape.RECT&&e.nodeName!==t.Shape.IMAGE&&e.nodeName!==t.Shape.GROUP&&e.nodeName!==t.Shape.HTML&&e.nodeName!==t.Shape.TEXT&&e.nodeName!==t.Shape.MESH||$t(n.x)&&$t(n.y)&&$t(n.z))&&(e.nodeName!==t.Shape.LINE||$t(n.x1)&&$t(n.y1)&&$t(n.z1)&&$t(n.x2)&&$t(n.y2)&&$t(n.z2))||Ls.CSSPropertySyntaxFactory["<coordinate>"].postProcessor(e,o),$t(n.zIndex)||Ls.CSSPropertySyntaxFactory["<z-index>"].postProcessor(e,o),n.path&&Ls.CSSPropertySyntaxFactory["<path>"].postProcessor(e,o),n.points&&Ls.CSSPropertySyntaxFactory["<list-of-points>"].postProcessor(e,o),$t(n.offsetDistance)||Ls.CSSPropertySyntaxFactory["<offset-distance>"].postProcessor(e,o),n.transform&&Ls.CSSPropertySyntaxFactory["<transform>"].postProcessor(e,o),void(u&&this.updateGeometry(e))}var l=r.skipUpdateAttribute,h=r.skipParse,f=r.usedAttributes,d=r.forceUpdateGeometry,p=Object.keys(n);p.forEach((function(t){var r,i=Dn(t);l||(e.attributes[i]=n[t]),!d&&(null===(r=ns[i])||void 0===r?void 0:r.l)&&(d=!0)})),h||p.forEach((function(t){e.computedStyle[t]=i.parseProperty(t,e.attributes[t],e)})),(null==f?void 0:f.length)&&(p=Array.from(new Set(p.concat(f)))),p.forEach((function(t){t in e.computedStyle&&(e.parsedStyle[t]=i.computeProperty(t,e.computedStyle[t],e))})),d&&this.updateGeometry(e),p.forEach((function(t){t in e.parsedStyle&&i.postProcessProperty(t,e,p)})),Ls.enableCSSParsing&&e.children.length&&p.forEach((function(t){t in e.parsedStyle&&i.isPropertyInheritable(t)&&e.children.forEach((function(e){e.internalSetAttribute(t,null,{skipUpdateAttribute:!0,skipParse:!0})}))}))},n.parseProperty=function(t,e,n){var r=ns[t],i=e;if((""===e||$t(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)i=qn(e);else if(r){var o=r.k,a=r.syntax,s=a&&this.getPropertySyntax(a);o&&o.indexOf(e)>-1?i=qn(e):s&&s.parser&&(i=s.parser(e,n))}return i},n.computeProperty=function(t,e,n){var r=ns[t],i=e;if(r){var o=r.syntax,a=r.d;if(e instanceof An){var s=e.value;if("unset"===s&&(s=r.inh&&!("g-root"===n.id)?"inherit":"initial"),"initial"===s)$t(a)||(e=this.parseProperty(t,_n(a)?a(n.nodeName):a,n));else if("inherit"===s){var u=this.tryToResolveProperty(n,t,{inherited:!0});return $t(u)?void this.addUnresolveProperty(n,t):u}}var c=o&&this.getPropertySyntax(o);if(c&&c.calculator)i=c.calculator(t,n.parsedStyle[t],e,n,this);else i=e instanceof An?e.value:e}return i},n.postProcessProperty=function(t,e,n){var r=ns[t];if(r&&r.syntax){var i=r.syntax&&this.getPropertySyntax(r.syntax);i&&i.postProcessor&&i.postProcessor(e,n)}},n.addUnresolveProperty=function(t,e){var n=rs.get(t);n||(rs.set(t,[]),n=rs.get(t)),-1===n.indexOf(e)&&n.push(e)},n.tryToResolveProperty=function(t,e,n){if(void 0===n&&(n={}),n.inherited&&t.parentElement&&function(t,e){var n=rs.get(t);return!n||0===n.length||n.includes(e)}(t.parentElement,e)){var r=t.parentElement.parsedStyle[e];if("unset"===r||"initial"===r||"inherit"===r)return;return r}},n.recalc=function(t){var e=rs.get(t);if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),rs.delete(t)}},n.updateGeometry=function(e){var n=e.nodeName,r=Ls.geometryUpdaterFactory[n];if(r){var i=e.geometry;i.contentBounds||(i.contentBounds=new Bo),i.renderBounds||(i.renderBounds=new Bo);var o=e.parsedStyle,a=r.update(o,e),s=a.width,u=a.height,c=a.depth,l=void 0===c?0:c,h=a.offsetX,f=void 0===h?0:h,d=a.offsetY,p=void 0===d?0:d,v=a.offsetZ,m=void 0===v?0:v,y=[Math.abs(s)/2,Math.abs(u)/2,l/2],g=o.stroke,x=o.lineWidth,E=o.increasedLineWidthForHitTesting,b=o.shadowType,T=o.shadowColor,S=o.filter,P=void 0===S?[]:S,w=o.transformOrigin,M=o.anchor;n===t.Shape.TEXT&&delete o.anchor;var k=[(1-2*(M&&M[0]||0))*s/2+f,(1-2*(M&&M[1]||0))*u/2+p,(1-2*(M&&M[2]||0))*y[2]+m];if(i.contentBounds.update(k,y),g&&!g.isNone){var N=((x||0)+(E||0))*(n===t.Shape.POLYLINE||n===t.Shape.POLYGON||n===t.Shape.PATH?Math.SQRT2:.5);y[0]+=N,y[1]+=N}if(i.renderBounds.update(k,y),T&&b&&"inner"!==b){var C=i.renderBounds,A=C.min,O=C.max,L=o.shadowBlur||0,R=o.shadowOffsetX||0,_=o.shadowOffsetY||0,I=O[0]+L+R,D=A[1]-L+_,F=O[1]+L+_;A[0]=Math.min(A[0],A[0]-L+R),O[0]=Math.max(O[0],I),A[1]=Math.min(A[1],D),O[1]=Math.max(O[1],F),i.renderBounds.setMinMax(A,O)}P.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var r=n[0].value;i.renderBounds.update(i.renderBounds.center,hr(i.renderBounds.halfExtents,i.renderBounds.halfExtents,[r,r,0]))}else if("drop-shadow"===e){var o=n[0].value,a=n[1].value,s=n[2].value,u=i.renderBounds,c=u.min,l=u.max,h=l[0]+s+o,f=c[1]-s+a,d=l[1]+s+a;c[0]=Math.min(c[0],c[0]-s+o),l[0]=Math.max(l[0],h),c[1]=Math.min(c[1],f),l[1]=Math.max(l[1],d),i.renderBounds.setMinMax(c,l)}})),M=o.anchor;var G=0>s,B=0>u,U=(G?-1:1)*(w?qi(w[0],0,e):0),z=(B?-1:1)*(w?qi(w[1],1,e):0);e.setOrigin(U-=(G?-1:1)*(M&&M[0]||0)*i.contentBounds.halfExtents[0]*2,z-=(B?-1:1)*(M&&M[1]||0)*i.contentBounds.halfExtents[1]*2),Ls.sceneGraphService.dirtifyToRoot(e)}},n.isPropertyInheritable=function(t){var e=ns[t];return!!e&&e.inh},e}();(ya=t.CameraType||(t.CameraType={}))[ya.ORBITING=0]="ORBITING",ya[ya.EXPLORING=1]="EXPLORING",ya[ya.TRACKING=2]="TRACKING",(ga=t.CameraTrackingMode||(t.CameraTrackingMode={}))[ga.DEFAULT=0]="DEFAULT",ga[ga.ROTATIONAL=1]="ROTATIONAL",ga[ga.TRANSLATIONAL=2]="TRANSLATIONAL",ga[ga.CINEMATIC=3]="CINEMATIC",(xa=t.CameraProjectionMode||(t.CameraProjectionMode={}))[xa.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",xa[xa.PERSPECTIVE=1]="PERSPECTIVE";var os,as={UPDATED:"updated"},ss=2e-4,us=function(){function e(){this.canvas=void 0,this.eventEmitter=new un,this.matrix=a(),this.right=I(1,0,0),this.up=I(0,1,0),this.forward=I(0,0,1),this.position=I(0,0,1),this.focalPoint=I(0,0,0),this.distanceVector=I(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.left=void 0,this.rright=void 0,this.top=void 0,this.bottom=void 0,this.projectionMatrix=a(),this.projectionMatrixInverse=a(),this.jitteredProjectionMatrix=void 0,this.view=void 0,this.enableUpdate=!0,this.type=t.CameraType.EXPLORING,this.trackingMode=t.CameraTrackingMode.DEFAULT,this.projectionMode=t.CameraProjectionMode.PERSPECTIVE,this.frustum=new zo,this.orthoMatrix=a()}var n=e.prototype;return n.isOrtho=function(){return this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC},n.getProjectionMode=function(){return this.projectionMode},n.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},n.getPerspectiveInverse=function(){return this.projectionMatrixInverse},n.getFrustum=function(){return this.frustum},n.getPosition=function(){return this.position},n.getFocalPoint=function(){return this.focalPoint},n.getDollyingStep=function(){return this.dollyingStep},n.getNear=function(){return this.near},n.getFar=function(){return this.far},n.getZoom=function(){return this.zoom},n.getOrthoMatrix=function(){return this.orthoMatrix},n.getView=function(){return this.view},n.setEnableUpdate=function(t){this.enableUpdate=t},n.setType=function(e,n){return this.type=e,this.setWorldRotation(this.type===t.CameraType.EXPLORING),this._getAngles(),this.type===t.CameraType.TRACKING&&void 0!==n&&this.setTrackingMode(n),this},n.setProjectionMode=function(t){return this.projectionMode=t,this},n.setTrackingMode=function(e){if(this.type!==t.CameraType.TRACKING)throw Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=e,this},n.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},n.getViewTransform=function(){return f(a(),this.matrix)},n.getWorldTransform=function(){return this.matrix},n.jitterProjectionMatrix=function(t,e){var n=x(a(),[t,e,0]);this.jitteredProjectionMatrix=p(a(),n,this.projectionMatrix)},n.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},n.setMatrix=function(t){return this.matrix=t,this._update(),this},n.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},n.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},n.setNear=function(e){return this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(e,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,e,this.far),this},n.setFar=function(e){return this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,e,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,e),this},n.setViewOffset=function(e,n,r,i,o,a){return this.aspect=e/n,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=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.projectionMode===t.CameraProjectionMode.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},n.clearViewOffset=function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===t.CameraProjectionMode.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},n.setZoom=function(e){return this.zoom=e,this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===t.CameraProjectionMode.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},n.setZoomByViewportPoint=function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),r=n.x,i=n.y,o=this.roll;this.rotate(0,0,-o),this.setPosition(r,i),this.setFocalPoint(r,i),this.setZoom(t),this.rotate(0,0,o);var a=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),s=I(a.x-r,a.y-i,0),u=j(s,this.right)/_(this.right),c=j(s,this.up)/_(this.up);return this.pan(-u,-c),this},n.setPerspective=function(e,n,r,i){var o;this.projectionMode=t.CameraProjectionMode.PERSPECTIVE,this.fov=r,this.near=e,this.far=n,this.aspect=i;var a=this.near*Math.tan(vr(.5*this.fov))/this.zoom,s=2*a,u=this.aspect*s,c=-.5*u;if(null===(o=this.view)||void 0===o?void 0:o.enabled){var l=this.view.fullWidth,h=this.view.fullHeight;c+=this.view.offsetX*u/l,a-=this.view.offsetY*s/h,u*=this.view.width/l,s*=this.view.height/h}return function(t,e,n,r,i,o,a){var s=2*o/(r-i),u=(n+e)/(n-e),c=(r+i)/(r-i),l=-(a+o)/(a-o),h=-2*a*o/(a-o);t[0]=2*o/(n-e),t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=u,t[9]=c,t[10]=l,t[11]=-1,t[12]=0,t[13]=0,t[14]=h,t[15]=0}(this.projectionMatrix,c,c+u,a,a-s,e,this.far),m(this.projectionMatrix,this.projectionMatrix,I(1,-1,1)),f(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},n.setOrthographic=function(e,n,r,i,o,a){var s;this.projectionMode=t.CameraProjectionMode.ORTHOGRAPHIC,this.rright=n,this.left=e,this.top=r,this.bottom=i,this.near=o,this.far=a;var u=(this.rright-this.left)/(2*this.zoom),c=(this.top-this.bottom)/(2*this.zoom),l=(this.rright+this.left)/2,h=(this.top+this.bottom)/2,d=l-u,p=l+u,v=h+c,y=h-c;if(null===(s=this.view)||void 0===s?void 0:s.enabled){var g=(this.rright-this.left)/this.view.fullWidth/this.zoom,x=(this.top-this.bottom)/this.view.fullHeight/this.zoom;p=(d+=g*this.view.offsetX)+g*this.view.width,y=(v-=x*this.view.offsetY)-x*this.view.height}return N(this.projectionMatrix,d,p,y,v,o,a),m(this.projectionMatrix,this.projectionMatrix,I(1,-1,1)),f(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},n.setPosition=function(t,e,n){void 0===e&&(e=this.position[1]),void 0===n&&(n=this.position[2]);var r=pr(t,e,n);return this._setPosition(r),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},n.setFocalPoint=function(e,n,r){void 0===n&&(n=this.focalPoint[1]),void 0===r&&(r=this.focalPoint[2]);var i=I(0,1,0);if(this.focalPoint=pr(e,n,r),this.trackingMode===t.CameraTrackingMode.CINEMATIC){var o=B(L(),this.focalPoint,this.position);e=o[0],n=o[1],r=o[2];var s=_(o),u=mr(Math.asin(n/s)),c=90+mr(Math.atan2(r,e)),l=a();g(l,l,vr(c)),y(l,l,vr(u)),i=W(L(),[0,1,0],l)}return f(this.matrix,C(a(),this.position,this.focalPoint,i)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},n.getDistance=function(){return this.distance},n.getDistanceVector=function(){return this.distanceVector},n.setDistance=function(t){if(this.distance===t||0>t)return this;this.distance=t,ss>this.distance&&(this.distance=ss),this.dollyingStep=this.distance/100;var e=L(),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},n.setMaxDistance=function(t){return this.maxDistance=t,this},n.setMinDistance=function(t){return this.minDistance=t,this},n.setAzimuth=function(e){return this.azimuth=dr(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},n.getAzimuth=function(){return this.azimuth},n.setElevation=function(e){return this.elevation=dr(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},n.getElevation=function(){return this.elevation},n.setRoll=function(e){return this.roll=dr(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},n.getRoll=function(){return this.roll},n._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},n.computeMatrix=function(){var e=J($(),[0,0,1],vr(this.roll));l(this.matrix);var n=J($(),[1,0,0],vr((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.elevation)),r=J($(),[0,1,0],vr((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.azimuth)),i=tt($(),r,n);i=tt($(),i,e);var o=w(a(),i);this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?(v(this.matrix,this.matrix,this.focalPoint),p(this.matrix,this.matrix,o),v(this.matrix,this.matrix,[0,0,this.distance])):this.type===t.CameraType.TRACKING&&(v(this.matrix,this.matrix,this.position),p(this.matrix,this.matrix,o))},n._setPosition=function(t,e,n){this.position=pr(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()},n._getAxes=function(){D(this.right,pr(Q(Z(),[1,0,0,0],this.matrix))),D(this.up,pr(Q(Z(),[0,1,0,0],this.matrix))),D(this.forward,pr(Q(Z(),[0,0,1,0],this.matrix))),z(this.right,this.right),z(this.up,this.up),z(this.forward,this.forward)},n._getAngles=function(){var e=this.distanceVector[0],n=this.distanceVector[1],r=this.distanceVector[2],i=_(this.distanceVector);if(0===i)return this.elevation=0,void(this.azimuth=0);this.type===t.CameraType.TRACKING||this.rotateWorld?(this.elevation=mr(Math.asin(n/i)),this.azimuth=mr(Math.atan2(-e,-r))):(this.elevation=-mr(Math.asin(n/i)),this.azimuth=-mr(Math.atan2(-e,-r)))},n._getPosition=function(){D(this.position,pr(Q(Z(),[0,0,0,1],this.matrix))),this._getDistance()},n._getFocalPoint=function(){var t,e;!function(t,e,n){var r=e[0],i=e[1],o=e[2];t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8]}(this.distanceVector,[0,0,-this.distance],(t=o(),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)),G(this.focalPoint,this.position,this.distanceVector),this._getDistance()},n._getDistance=function(){this.distanceVector=B(L(),this.focalPoint,this.position),this.distance=_(this.distanceVector),this.dollyingStep=this.distance/100},n._getOrthoMatrix=function(){if(this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC){var e=this.position,n=J($(),[0,0,1],-this.roll*Math.PI/180);P(this.orthoMatrix,n,I((this.rright-this.left)/2-e[0],(this.top-this.bottom)/2-e[1],0),I(this.zoom,this.zoom,1),e)}},n.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),e=p(a(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(as.UPDATED)}},n.rotate=function(t,e,n){throw Error(ar)},n.pan=function(t,e){throw Error(ar)},n.dolly=function(t){throw Error(ar)},n.createLandmark=function(t,e){throw Error(ar)},n.gotoLandmark=function(t,e){throw Error(ar)},n.cancelLandmarkAnimation=function(){throw Error(ar)},e}(),cs=function(){function t(){}return t.prototype.update=function(t,e){var n=t.r;return{width:2*n,height:2*n}},t}(),ls=function(){function t(){}return t.prototype.update=function(t,e){return{width:2*t.rx,height:2*t.ry}},t}(),hs=function(){function t(){}return t.prototype.update=function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,o=Math.min(e,r),a=Math.max(e,r),s=Math.min(n,i);return{width:a-o,height:Math.max(n,i)-s}},t}(),fs=function(){function t(){}return t.prototype.update=function(t){var e=t.path.rect;return{width:e.width,height:e.height}},t}(),ds=function(){function t(){}return t.prototype.update=function(t){var e=t.points.points,n=Math.min.apply(Math,e.map((function(t){return t[0]}))),r=Math.max.apply(Math,e.map((function(t){return t[0]}))),i=Math.min.apply(Math,e.map((function(t){return t[1]})));return{width:r-n,height:Math.max.apply(Math,e.map((function(t){return t[1]})))-i}},t}(),ps=function(){function t(){}return t.prototype.update=function(t,e){var n=t.img,r=t.width,i=t.height,o=void 0===r?0:r,a=void 0===i?0:i;return n&&!oe(n)&&(o||(t.width=o=n.width),a||(t.height=a=n.height)),{width:o,height:a}},t}(),vs=function(){function t(t){this.globalRuntime=void 0,this.globalRuntime=t}var e=t.prototype;return e.isReadyToMeasure=function(t,e){return t.text&&t.fontSize&&t.fontStyle&&t.fontWeight&&t.fontVariant&&t.textAlign&&t.textBaseline&&!$t(t.lineWidth)},e.update=function(t,e){var n,r,i=t.text,o=t.textAlign,a=t.lineWidth,s=t.textBaseline,u=t.dx,c=t.dy,l=((null==e||null===(n=e.ownerDocument)||void 0===n||null===(r=n.defaultView)||void 0===r?void 0:r.getConfig())||{}).offscreenCanvas;if(!this.isReadyToMeasure(t,e))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{width:0,height:0,x:0,y:0,offsetX:0,offsetY:0};var h=this.globalRuntime.textService.measureText(i,t,l);t.metrics=h;var f=[h.width/2,h.height/2,0],d=[0,1],p=0;"center"===o||"middle"===o?(p=a/2,d=[.5,1]):"right"!==o&&"end"!==o||(p=a,d=[1,1]);var v=0;return"middle"===s?v=f[1]:"top"===s||"hanging"===s?v=2*f[1]:"alphabetic"===s?v=Ls.enableCSSParsing?h.lineHeight-h.fontProperties.ascent:0:"bottom"!==s&&"ideographic"!==s||(v=0),u&&(p+=u),c&&(v+=c),t.anchor=[d[0],d[1],0],{width:2*f[0],height:2*f[1],offsetX:p,offsetY:v}},t}(),ms=function(){function t(t,e){var n=this;this.globalRuntime=void 0,this.context=void 0,this.rootTarget=void 0,this.emitter=new un,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.pickHandler=void 0,this.tmpMatrix=a(),this.tmpVec3=L(),this.onPointerDown=function(){var t=hn(cn().mark((function t(e){var r;return cn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.createPointerEvent(e);case 2:n.dispatchEvent(r=t.sent,"pointerdown"),"touch"===r.pointerType?n.dispatchEvent(r,"touchstart"):"mouse"!==r.pointerType&&"pen"!==r.pointerType||n.dispatchEvent(r,2===r.button?"rightdown":"mousedown"),n.trackingData(e.pointerId).pressTargetsByButton[e.button]=r.composedPath(),n.freeEvent(r);case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerUp=function(){var t=hn(cn().mark((function t(e){var r,i,o,a,s,u,c,l,h;return cn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=performance.now(),t.next=3,n.createPointerEvent(e);case 3:if(n.dispatchEvent(i=t.sent,"pointerup"),"touch"===i.pointerType?n.dispatchEvent(i,"touchend"):"mouse"!==i.pointerType&&"pen"!==i.pointerType||n.dispatchEvent(i,2===i.button?"rightup":"mouseup"),o=n.trackingData(e.pointerId),a=n.findMountedTarget(o.pressTargetsByButton[e.button]),s=a,a&&!i.composedPath().includes(a)){for(u=a;u&&!i.composedPath().includes(u);)i.currentTarget=u,n.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType?n.notifyTarget(i,"touchendoutside"):"mouse"!==i.pointerType&&"pen"!==i.pointerType||n.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),ra.isNode(u)&&(u=u.parentNode);delete o.pressTargetsByButton[e.button],s=u}s&&((l=n.clonePointerEvent(i,"click")).target=s,l.path=[],o.clicksByButton[e.button]||(o.clicksByButton[e.button]={clickCount:0,target:l.target,timeStamp:r}),(h=o.clicksByButton[e.button]).target===l.target&&200>r-h.timeStamp?++h.clickCount:h.clickCount=1,h.target=l.target,h.timeStamp=r,l.detail=h.clickCount,(null===(c=i.detail)||void 0===c?void 0:c.preventClick)||("mouse"!==l.pointerType&&"touch"!==l.pointerType||n.dispatchEvent(l,"click"),n.dispatchEvent(l,"pointertap")),n.freeEvent(l)),n.freeEvent(i);case 12:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerMove=function(){var t=hn(cn().mark((function t(e){var r,i,o,a,s,u,c,l,h,f;return cn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.createPointerEvent(e);case 2:if(i="mouse"===(r=t.sent).pointerType||"pen"===r.pointerType,o=n.trackingData(e.pointerId),a=n.findMountedTarget(o.overTargets),!o.overTargets||a===r.target){t.next=21;break}return s="mousemove"===e.type?"mouseout":"pointerout",t.next=10,n.createPointerEvent(e,s,a||void 0);case 10:if(n.dispatchEvent(u=t.sent,"pointerout"),i&&n.dispatchEvent(u,"mouseout"),r.composedPath().includes(a)){t.next=20;break}return t.next=16,n.createPointerEvent(e,"pointerleave",a||void 0);case 16:for((c=t.sent).eventPhase=c.AT_TARGET;c.target&&!r.composedPath().includes(c.target);)c.currentTarget=c.target,n.notifyTarget(c),i&&n.notifyTarget(c,"mouseleave"),ra.isNode(c.target)&&(c.target=c.target.parentNode);n.freeEvent(c);case 20:n.freeEvent(u);case 21:if(a===r.target){t.next=36;break}l=n.clonePointerEvent(r,"mousemove"===e.type?"mouseover":"pointerover"),n.dispatchEvent(l,"pointerover"),i&&n.dispatchEvent(l,"mouseover"),h=a&&ra.isNode(a)&&a.parentNode;case 27:if(!h||h===(ra.isNode(n.rootTarget)&&n.rootTarget.parentNode)){t.next=33;break}if(h!==r.target){t.next=30;break}return t.abrupt("break",33);case 30:h=h.parentNode,t.next=27;break;case 33:if(!h||h===(ra.isNode(n.rootTarget)&&n.rootTarget.parentNode)){for((f=n.clonePointerEvent(r,"pointerenter")).eventPhase=f.AT_TARGET;f.target&&f.target!==a&&f.target!==(ra.isNode(n.rootTarget)&&n.rootTarget.parentNode);)f.currentTarget=f.target,n.notifyTarget(f),i&&n.notifyTarget(f,"mouseenter"),ra.isNode(f.target)&&(f.target=f.target.parentNode);n.freeEvent(f)}n.freeEvent(l);case 36:n.dispatchEvent(r,"pointermove"),"touch"===r.pointerType&&n.dispatchEvent(r,"touchmove"),i&&(n.dispatchEvent(r,"mousemove"),n.cursor=n.getCursor(r.target)),o.overTargets=r.composedPath(),n.freeEvent(r);case 41:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerOut=function(){var t=hn(cn().mark((function t(e){var r,i,o,a,s;return cn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r=n.trackingData(e.pointerId)).overTargets){t.next=17;break}return i="mouse"===e.pointerType||"pen"===e.pointerType,o=n.findMountedTarget(r.overTargets),t.next=6,n.createPointerEvent(e,"pointerout",o||void 0);case 6:return n.dispatchEvent(a=t.sent),i&&n.dispatchEvent(a,"mouseout"),t.next=11,n.createPointerEvent(e,"pointerleave",o||void 0);case 11:for((s=t.sent).eventPhase=s.AT_TARGET;s.target&&s.target!==(ra.isNode(n.rootTarget)&&n.rootTarget.parentNode);)s.currentTarget=s.target,n.notifyTarget(s),i&&n.notifyTarget(s,"mouseleave"),ra.isNode(s.target)&&(s.target=s.target.parentNode);r.overTargets=null,n.freeEvent(a),n.freeEvent(s);case 17:n.cursor=null;case 18:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerOver=function(){var t=hn(cn().mark((function t(e){var r,i,o,a;return cn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.trackingData(e.pointerId),t.next=3,n.createPointerEvent(e);case 3:for(o="mouse"===(i=t.sent).pointerType||"pen"===i.pointerType,n.dispatchEvent(i,"pointerover"),o&&n.dispatchEvent(i,"mouseover"),"mouse"===i.pointerType&&(n.cursor=n.getCursor(i.target)),(a=n.clonePointerEvent(i,"pointerenter")).eventPhase=a.AT_TARGET;a.target&&a.target!==(ra.isNode(n.rootTarget)&&n.rootTarget.parentNode);)a.currentTarget=a.target,n.notifyTarget(a),o&&n.notifyTarget(a,"mouseenter"),ra.isNode(a.target)&&(a.target=a.target.parentNode);r.overTargets=i.composedPath(),n.freeEvent(i),n.freeEvent(a);case 14:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerUpOutside=function(){var t=hn(cn().mark((function t(e){var r,i,o,a;return cn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.trackingData(e.pointerId),i=n.findMountedTarget(r.pressTargetsByButton[e.button]),t.next=4,n.createPointerEvent(e);case 4:if(o=t.sent,i){for(a=i;a;)o.currentTarget=a,n.notifyTarget(o,"pointerupoutside"),"touch"===o.pointerType||"mouse"!==o.pointerType&&"pen"!==o.pointerType||n.notifyTarget(o,2===o.button?"rightupoutside":"mouseupoutside"),ra.isNode(a)&&(a=a.parentNode);delete r.pressTargetsByButton[e.button]}n.freeEvent(o);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onWheel=function(){var t=hn(cn().mark((function t(e){var r;return cn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.createWheelEvent(e);case 2:n.dispatchEvent(r=t.sent),n.freeEvent(r);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.globalRuntime=t,this.context=e}var e=t.prototype;return e.init=function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)},e.destroy=function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()},e.client2Viewport=function(t){var e=this.context.contextService.getBoundingClientRect();return new jo(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))},e.viewport2Client=function(t){var e=this.context.contextService.getBoundingClientRect();return new jo(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))},e.viewport2Canvas=function(t){var e=t.x,n=t.y,r=this.rootTarget.defaultView.getCamera(),i=this.context.config,o=i.width,a=i.height,s=r.getPerspectiveInverse(),u=r.getWorldTransform(),c=p(this.tmpMatrix,u,s),l=F(this.tmpVec3,e/o*2-1,2*(1-n/a)-1,0);return W(l,l,c),new jo(l[0],l[1])},e.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=p(this.tmpMatrix,n,r),o=F(this.tmpVec3,t.x,t.y,0);W(this.tmpVec3,this.tmpVec3,i);var a=this.context.config;return new jo((o[0]+1)/2*a.width,(1-(o[1]+1)/2)*a.height)},e.setPickHandler=function(t){this.pickHandler=t},e.addEventMapping=function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((function(t,e){return t.priority-e.priority}))},e.mapEvent=function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,r=e.length;r>n;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for "+t.type)}},e.dispatchEvent=function(t,e,n){n?(t.eventPhase=t.AT_TARGET,t.currentTarget=this.rootTarget.defaultView||null,this.notifyListeners(t,e)):(t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e));this.emitter.emit(e||t.type,t)},e.propagate=function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;r>=1;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var i=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var o=i+1;n.length>o;o++)if(t.currentTarget=n[o],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}},e.propagationPath=function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)return e.unshift(n.document),e;for(var r=0;2048>r&&t!==this.rootTarget;r++)ra.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e},e.hitTest=function(){var t=hn(cn().mark((function t(e){var n,r,i,o,a;return cn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.viewportY,o=(i=this.context.config).width,a=i.height,!(0>(n=e.viewportX)||0>r||n>o||r>a)){t.next=4;break}return t.abrupt("return",null);case 4:return t.next=6,this.pickHandler(e);case 6:if(t.t1=t.sent,t.t1){t.next=9;break}t.t1=this.rootTarget;case 9:if(t.t0=t.t1,t.t0){t.next=12;break}t.t0=null;case 12:return t.abrupt("return",t.t0);case 13:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.isNativeEventFromCanvas=function(t){var e,n=this.context.contextService.getDomElement(),r=null===(e=t.nativeEvent)||void 0===e?void 0:e.target;if(r){if(r===n)return!0;if(n&&n.contains)return n.contains(r)}return!!t.nativeEvent.composedPath&&t.nativeEvent.composedPath().indexOf(n)>-1},e.getExistedHTML=function(t){if(t.nativeEvent.composedPath)for(var e,n=En(this.globalRuntime.displayObjectPool.getHTMLs());!(e=n()).done;){var r=e.value;if(t.nativeEvent.composedPath().indexOf(r)>-1)return r}return null},e.pickTarget=function(){var t=hn(cn().mark((function t(e){return cn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.hitTest({clientX:e.clientX,clientY:e.clientY,viewportX:e.viewportX,viewportY:e.viewportY,x:e.canvasX,y:e.canvasY}));case 1:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.createPointerEvent=function(){var t=hn(cn().mark((function t(e,n,r){var i,o;return cn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this.allocateEvent(pa),this.copyPointerData(e,i),this.copyMouseData(e,i),this.copyData(e,i),i.nativeEvent=e.nativeEvent,i.originalEvent=e,o=this.getExistedHTML(i),null==r){t.next=11;break}t.t0=r,t.next=20;break;case 11:if(t.t1=o,t.t1){t.next=19;break}if(t.t2=this.isNativeEventFromCanvas(i),!t.t2){t.next=18;break}return t.next=17,this.pickTarget(i);case 17:t.t2=t.sent;case 18:t.t1=t.t2;case 19:t.t0=t.t1;case 20:return i.target=t.t0,"string"==typeof n&&(i.type=n),t.abrupt("return",i);case 23:case"end":return t.stop()}}),t,this)})));return function(e,n,r){return t.apply(this,arguments)}}(),e.createWheelEvent=function(){var t=hn(cn().mark((function t(e){var n,r;return cn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this.allocateEvent(va),this.copyWheelData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.nativeEvent=e.nativeEvent,n.originalEvent=e,r=this.getExistedHTML(n),t.t0=r,t.t0){t.next=15;break}if(t.t1=this.isNativeEventFromCanvas(n),!t.t1){t.next=14;break}return t.next=13,this.pickTarget(n);case 13:t.t1=t.sent;case 14:t.t0=t.t1;case 15:return n.target=t.t0,t.abrupt("return",n);case 17:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},e.cloneWheelEvent=function(t){var e=this.allocateEvent(va);return e.nativeEvent=t.nativeEvent,e.originalEvent=t.originalEvent,this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.target=t.target,e.path=t.composedPath().slice(),e.type=t.type,e},e.clonePointerEvent=function(t,e){var n=this.allocateEvent(pa);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n},e.copyPointerData=function(t,e){e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist},e.copyMouseData=function(t,e){e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset)},e.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},e.copyData=function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=performance.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)},e.allocateEvent=function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e},e.freeEvent=function(t){if(t.manager!==this)throw Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)},e.notifyTarget=function(t,e){var n;e=null!==(n=e)&&void 0!==n?n:t.type,this.notifyListeners(t,t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?e+"capture":e),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)},e.notifyListeners=function(t,e){var n=t.currentTarget.emitter,r=n._events[e];if(r)if("fn"in r)r.once&&n.removeListener(e,r.fn,void 0,!0),r.fn.call(t.currentTarget||r.context,t);else for(var i=0;r.length>i&&!t.propagationImmediatelyStopped;i++)r[i].once&&n.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(t.currentTarget||r[i].context,t)},e.findMountedTarget=function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;n>=0;n--){var r=t[n];if(!(r===this.rootTarget||ra.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},e.getCursor=function(t){for(var e=t;e;){var n=fa.isElement(e)&&e.getAttribute("cursor");if(n)return n;e=ra.isNode(e)&&e.parentNode}},t}(),ys=function(){function t(){this.canvas=void 0,this.context=void 0}var e=t.prototype;return e.getOrCreateCanvas=function(t,e){if(this.canvas)return this.canvas;if(t)this.canvas=t,this.context=this.canvas.getContext("2d",e);else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",e),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",e)}return this.canvas.width=10,this.canvas.height=10,this.canvas},e.getOrCreateContext=function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context},t}();(os=t.RenderReason||(t.RenderReason={}))[os.CAMERA_CHANGED=0]="CAMERA_CHANGED",os[os.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",os[os.NONE=2]="NONE";var gs=function(){function e(e,n){this.globalRuntime=void 0,this.context=void 0,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.renderOrderChangedEvent=new ea(t.ElementEvent.RENDER_ORDER_CHANGED),this.hooks={init:new $r,dirtycheck:new pi(["object"]),cull:new pi(["object","camera"]),beginFrame:new ui([]),beforeRender:new ui(["objectToRender"]),render:new ui(["objectToRender"]),afterRender:new ui(["objectToRender"]),endFrame:new ui([]),destroy:new ui([]),pick:new ni(["result"]),pickSync:new pi(["result"]),pointerDown:new ui(["event"]),pointerUp:new ui(["event"]),pointerMove:new ui(["event"]),pointerOut:new ui(["event"]),pointerOver:new ui(["event"]),pointerWheel:new ui(["event"]),pointerCancel:new ui(["event"])},this.globalRuntime=e,this.context=n}var n=e.prototype;return n.init=function(){var t=hn(cn().mark((function t(){var e;return cn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=pn({},this.globalRuntime,this.context),this.context.renderingPlugins.forEach((function(t){t.apply(e,Ls)})),t.next=4,this.hooks.init.promise();case 4:this.inited=!0;case 5:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),n.getStats=function(){return this.stats},n.disableDirtyRectangleRendering=function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(t.RenderReason.CAMERA_CHANGED)},n.render=function(t,e){var n=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var r=this.context.renderingContext;this.globalRuntime.sceneGraphService.syncHierarchy(r.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),r.renderReasons.size&&this.inited&&(this.renderDisplayObject(r.root,t,r),this.hooks.beginFrame.call(),r.renderListCurrentFrame.forEach((function(t){n.hooks.beforeRender.call(t),n.hooks.render.call(t),n.hooks.afterRender.call(t)})),this.hooks.endFrame.call(),r.renderListCurrentFrame=[],r.renderReasons.clear(),e())},n.renderDisplayObject=function(t,e,n){var r=this,i=e.renderer.getConfig(),o=i.enableDirtyCheck,a=i.enableCulling;this.globalRuntime.enableCSSParsing&&this.globalRuntime.styleValueRegistry.recalc(t);var s=o?this.hooks.dirtycheck.call(t):t;if(s){var u=a?this.hooks.cull.call(s,this.context.camera):s;u&&(this.stats.rendered++,n.renderListCurrentFrame.push(u))}t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var c=t.sortable,l=!1;c.dirty&&(c.sorted=t.childNodes.slice().sort(rr),l=!0,c.dirty=!1),(c.sorted||t.childNodes).forEach((function(t){r.renderDisplayObject(t,e,n)})),l&&t.forEach((function(t){r.renderOrderChangedEvent.target=t,r.renderOrderChangedEvent.detail={renderOrder:t.sortable.renderOrder},t.ownerDocument.defaultView.dispatchEvent(r.renderOrderChangedEvent,!0)}))},n.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},n.dirtify=function(){this.context.renderingContext.renderReasons.add(t.RenderReason.DISPLAY_OBJECT_CHANGED)},e}(),xs=/\[\s*(.*)=(.*)\s*\]/,Es=function(){function t(){}var e=t.prototype;return e.selectOne=function(t,e){var n=this;if(t.startsWith("."))return e.find((function(e){return((null==e?void 0:e.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.find((function(e){return e.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.find((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):null}return e.find((function(n){return e!==n&&n.nodeName===t}))},e.selectAll=function(t,e){var n=this;if(t.startsWith("."))return e.findAll((function(r){return e!==r&&((null==r?void 0:r.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.findAll((function(r){return e!==r&&r.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.findAll((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):[]}return e.findAll((function(n){return e!==n&&n.nodeName===t}))},e.is=function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var n=this.getAttribute(t),r=n.name,i=n.value;return"name"===r?e.name===i:this.attributeToString(e,r)===i}return e.nodeName===t},e.getIdOrClassname=function(t){return t.substring(1)},e.getAttribute=function(t){var e=t.match(xs),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}},e.attributeToString=function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return $t(n)?"":n.toString?""+n:""},t}();function bs(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}var Ts,Ss,Ps,ws=new sa(t.ElementEvent.REPARENT,null,"","","",0,"",""),Ms=function(){function e(e){var n,r,i,o,s,c,h,d,v=this;this.runtime=void 0,this.pendingEvents=[],this.boundsChangedEvent=new ea(t.ElementEvent.BOUNDS_CHANGED),this.rotate=(n=$(),function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof e&&(e=I(e,r,i));var o=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var a=$();rt(a,e[0],e[1],e[2]);var s=v.getRotation(t),u=v.getRotation(t.parentNode);ht(n,u),nt(n,n),tt(a,n,a),tt(o.localRotation,a,s),dt(o.localRotation,o.localRotation),v.dirtifyLocal(t,o)}else v.rotateLocal(t,e)}),this.rotateLocal=(r=$(),function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=0),"number"==typeof e&&(e=I(e,n,i));var o=t.transformable;rt(r,e[0],e[1],e[2]),ft(o.localRotation,o.localRotation,r),v.dirtifyLocal(t,o)}),this.setEulerAngles=(i=$(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=I(e,n,r));var o=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){rt(o.localRotation,e[0],e[1],e[2]);var a=v.getRotation(t.parentNode);ht(i,nt($(),a)),ft(o.localRotation,o.localRotation,i),v.dirtifyLocal(t,o)}else v.setLocalEulerAngles(t,e)}),this.translateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=I(e,n,r));var i=t.transformable;Y(e,L())||(function(t,e,n){var r=n[0],i=n[1],o=n[2],a=e[0],s=e[1],u=e[2],c=i*u-o*s,l=o*a-r*u,h=r*s-i*a,f=i*h-o*l,d=o*c-r*h,p=r*l-i*c,v=2*n[3];l*=v,h*=v,d*=2,p*=2,t[0]=a+(c*=v)+(f*=2),t[1]=s+l+d,t[2]=u+h+p}(e,e,i.localRotation),G(i.localPosition,i.localPosition,e),v.dirtifyLocal(t,i))},this.setPosition=(o=a(),s=L(),function(t,e){var n=t.transformable;s[0]=e[0],s[1]=e[1],s[2]=e[2]||0,Y(v.getPosition(t),s)||(D(n.position,s),null!==t.parentNode&&t.parentNode.transformable?(u(o,t.parentNode.transformable.worldTransform),f(o,o),W(n.localPosition,s,o)):D(n.localPosition,s),v.dirtifyLocal(t,n))}),this.setLocalPosition=function(){var t=L();return function(e,n){var r=e.transformable;t[0]=n[0],t[1]=n[1],t[2]=n[2]||0,Y(r.localPosition,t)||(D(r.localPosition,t),v.dirtifyLocal(e,r))}}(),this.translate=(c=L(),h=L(),d=L(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=F(h,e,n,r)),Y(e,c)||(G(d,v.getPosition(t),e),v.setPosition(t,d))}),this.setRotation=function(){var t=$();return function(e,n,r,i,o){var a=e.transformable;if("number"==typeof n&&(n=lt(n,r,i,o)),null!==e.parentNode&&e.parentNode.transformable){var s=v.getRotation(e.parentNode);ht(t,s),nt(t,t),tt(a.localRotation,t,n),dt(a.localRotation,a.localRotation),v.dirtifyLocal(e,a)}else v.setLocalRotation(e,n)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=function(){var t=a(),e=L(),n=lt(0,0,0,1);return function(r){if(0!==r.localSkew[0]||0!==r.localSkew[1]){if(P(r.localTransform,r.localRotation,r.localPosition,I(1,1,1),r.origin),0!==r.localSkew[0]||0!==r.localSkew[1]){var i=l(t);i[4]=Math.tan(r.localSkew[0]),i[1]=Math.tan(r.localSkew[1]),p(r.localTransform,r.localTransform,i)}var o=P(t,n,e,r.localScale,r.origin);p(r.localTransform,r.localTransform,o)}else P(r.localTransform,r.localRotation,r.localPosition,r.localScale,r.origin)}}(),this.runtime=e}var n=e.prototype;return n.matches=function(t,e){return this.runtime.sceneGraphSelector.is(t,e)},n.querySelector=function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)},n.querySelectorAll=function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)},n.attach=function(t,e,n){var r,i,o=!1;t.parentNode&&(o=t.parentNode!==e,this.detach(t)),t.parentNode=e,$t(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t);var a=e.sortable;((null==a||null===(r=a.sorted)||void 0===r?void 0:r.length)||(null===(i=t.style)||void 0===i?void 0:i.zIndex))&&(a.dirty=!0);var s=t.transformable;s&&this.dirtifyWorld(t,s),s.frozen&&this.unfreezeParentToRoot(t),o&&t.dispatchEvent(ws)},n.detach=function(t){if(t.parentNode){var e,n,r=t.transformable,i=t.parentNode.sortable;((null==i||null===(e=i.sorted)||void 0===e?void 0:e.length)||(null===(n=t.style)||void 0===n?void 0:n.zIndex))&&(i.dirty=!0);var o=t.parentNode.childNodes.indexOf(t);o>-1&&t.parentNode.childNodes.splice(o,1),r&&this.dirtifyWorld(t,r),t.parentNode=null}},n.getOrigin=function(t){return t.transformable.origin},n.setOrigin=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=[e,n,r]);var i=t.transformable;if(e[0]!==i.origin[0]||e[1]!==i.origin[1]||e[2]!==i.origin[2]){var o=i.origin;o[0]=e[0],o[1]=e[1],o[2]=e[2]||0,this.dirtifyLocal(t,i)}},n.setLocalEulerAngles=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=I(e,n,r));var i=t.transformable;rt(i.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,i)},n.scaleLocal=function(t,e){var n,r,i,o=t.transformable;n=o.localScale,r=o.localScale,i=I(e[0],e[1],e[2]||1),n[0]=r[0]*i[0],n[1]=r[1]*i[1],n[2]=r[2]*i[2],this.dirtifyLocal(t,o)},n.setLocalScale=function(t,e){var n=t.transformable,r=I(e[0],e[1],e[2]||n.localScale[2]);Y(r,n.localScale)||(D(n.localScale,r),this.dirtifyLocal(t,n))},n.setLocalRotation=function(t,e,n,r,i){"number"==typeof e&&(e=lt(e,n,r,i));var o=t.transformable;ht(o.localRotation,e),this.dirtifyLocal(t,o)},n.setLocalSkew=function(t,e,n){"number"==typeof e&&(e=function(t,e){var n=new i(2);return n[0]=t,n[1]=e,n}(e,n));var r,o,a=t.transformable;(r=a.localSkew)[0]=(o=e)[0],r[1]=o[1],this.dirtifyLocal(t,a)},n.dirtifyLocal=function(t,e){e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))},n.dirtifyWorld=function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)},n.triggerPendingEvents=function(){var t=this,e=new Set,n=function(n,r){n.isConnected&&!e.has(n.entity)&&(t.boundsChangedEvent.detail=r,t.boundsChangedEvent.target=n,n.isMutationObserved?n.dispatchEvent(t.boundsChangedEvent):n.ownerDocument.defaultView.dispatchEvent(t.boundsChangedEvent,!0),e.add(n.entity))};this.pendingEvents.forEach((function(t){var e=t[0],r=t[1];r.affectChildren?e.forEach((function(t){n(t,r)})):n(e,r)})),this.clearPendingEvents(),e.clear()},n.clearPendingEvents=function(){this.pendingEvents=[]},n.dirtifyToRoot=function(t,e){void 0===e&&(e=!1);var n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)bs(n),n=n.parentNode;e&&t.forEach((function(t){bs(t)})),this.informDependentDisplayObjects(t),this.pendingEvents.push([t,{affectChildren:e}])},n.updateDisplayObjectDependency=function(t,e,n,r){if(e&&e!==n){var i=this.displayObjectDependencyMap.get(e);if(i&&i[t]){var o=i[t].indexOf(r);i[t].splice(o,1)}}if(n){var a=this.displayObjectDependencyMap.get(n);a||(this.displayObjectDependencyMap.set(n,{}),a=this.displayObjectDependencyMap.get(n)),a[t]||(a[t]=[]),a[t].push(r)}},n.informDependentDisplayObjects=function(e){var n=this,r=this.displayObjectDependencyMap.get(e);r&&Object.keys(r).forEach((function(e){r[e].forEach((function(r){n.dirtifyToRoot(r,!0),r.dispatchEvent(new sa(t.ElementEvent.ATTR_MODIFIED,r,n,n,e,sa.MODIFICATION,n,n)),r.isCustomElement&&r.isConnected&&r.attributeChangedCallback&&r.attributeChangedCallback(e,n,n)}))}))},n.getPosition=function(t){var e=t.transformable;return b(e.position,this.getWorldTransform(t,e))},n.getRotation=function(t){var e=t.transformable;return S(e.rotation,this.getWorldTransform(t,e))},n.getScale=function(t){var e=t.transformable;return T(e.scaling,this.getWorldTransform(t,e))},n.getWorldTransform=function(t,e){return void 0===e&&(e=t.transformable),e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform},n.getLocalPosition=function(t){return t.transformable.localPosition},n.getLocalRotation=function(t){return t.transformable.localRotation},n.getLocalScale=function(t){return t.transformable.localScale},n.getLocalSkew=function(t){return t.transformable.localSkew},n.getLocalTransform=function(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform},n.setLocalTransform=function(t,e){var n=b(L(),e),r=S($(),e),i=T(L(),e);this.setLocalScale(t,i),this.setLocalPosition(t,n),this.setLocalRotation(t,r)},n.resetLocalTransform=function(t){this.setLocalScale(t,[1,1,1]),this.setLocalPosition(t,[0,0,0]),this.setLocalEulerAngles(t,[0,0,0]),this.setLocalSkew(t,[0,0])},n.getTransformedGeometryBounds=function(t,e,n){void 0===e&&(e=!1);var r=this.getGeometryBounds(t,e);if(Bo.isEmpty(r))return null;var i=n||new Bo;return i.setFromTransformedAABB(r,this.getWorldTransform(t)),i},n.getGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=t.geometry;return(e?n.renderBounds:n.contentBounds||null)||new Bo},n.getBounds=function(t,e){var n=this;void 0===e&&(e=!1);var r=t.renderable;if(!r.boundsDirty&&!e&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&e&&r.renderBounds)return r.renderBounds;var i=e?r.renderBounds:r.bounds,o=this.getTransformedGeometryBounds(t,e,i);if(t.childNodes.forEach((function(t){var r=n.getBounds(t,e);r&&(o?o.add(r):(o=i||new Bo).update(r.center,r.halfExtents))})),e){var a=ir(t);if(a){var s=a.parsedStyle.clipPath.getBounds(e);o?s&&(o=s.intersection(o)):o=s}}return o||(o=new Bo),o&&(e?r.renderBounds=o:r.bounds=o),e?r.renderBoundsDirty=!1:r.boundsDirty=!1,o},n.getLocalBounds=function(t){if(t.parentNode){var e=a();t.parentNode.transformable&&(e=f(a(),this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!Bo.isEmpty(n)){var r=new Bo;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)},n.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t);Bo.isEmpty(i)||(r=new Bo).setFromTransformedAABB(i,this.getWorldTransform(t));var o=null===(e=t.ownerDocument)||void 0===e||null===(n=e.defaultView)||void 0===n?void 0:n.getContextService().getBoundingClientRect();if(r){var a=r.getMin(),s=a[0],u=a[1],c=r.getMax();return new Vo(s+((null==o?void 0:o.left)||0),u+((null==o?void 0:o.top)||0),c[0]-s,c[1]-u)}return new Vo((null==o?void 0:o.left)||0,(null==o?void 0:o.top)||0,0,0)},n.dirtifyWorldInternal=function(t,e){var n=this;if(!e.dirtyFlag){e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach((function(t){var e=t.transformable;e.dirtyFlag||n.dirtifyWorldInternal(t,e)}));var r=t.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0)}},n.syncHierarchy=function(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,r=0;n.length>r;r++)this.syncHierarchy(n[r])}},n.sync=function(t,e){if(e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.dirtyFlag){var n=t.parentNode,r=n&&n.transformable;null!==n&&r?p(e.worldTransform,r.worldTransform,e.localTransform):u(e.worldTransform,e.localTransform),e.dirtyFlag=!1}},n.unfreezeParentToRoot=function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}},e}(),ks={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]},Ns=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,Cs=RegExp(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source+"|"+/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source+"|"+/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source+"|"+/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source),As=RegExp(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source+"|"+/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source+"|"+/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source+"|"+/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source),Os=function(){function t(t){var e=this;this.runtime=void 0,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,n){return!e.isBreakingSpace(n)&&!(!t||!As.exec(n)&&!Cs.exec(t))},this.trimByKinsokuShorui=function(t){var e=[].concat(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=t}var e=t.prototype;return e.measureFont=function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvas.getOrCreateCanvas(e),i=this.runtime.offscreenCanvas.getOrCreateContext(e);i.font=t;var o=ks.MetricsString+ks.BaselineSymbol,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText(ks.BaselineSymbol).width),u=ks.HeightMultiplier*s;s=s*ks.BaselineMultiplier|0,r.width=a,r.height=u,i.fillStyle="#f00",i.fillRect(0,0,a,u),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(o,0,s);var c=i.getImageData(0,0,a||1,u||1).data,l=c.length,h=4*a,f=0,d=0,p=!1;for(f=0;s>f;++f){for(var v=0;h>v;v+=4)if(255!==c[d+v]){p=!0;break}if(p)break;d+=h}for(n.ascent=s-f,d=l-h,p=!1,f=u;f>s;--f){for(var m=0;h>m;m+=4)if(255!==c[d+m]){p=!0;break}if(p)break;d-=h}return n.descent=f-s,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n,n},e.measureText=function(t,e,n){var r,i=e.fontSize,o=e.wordWrap,a=e.lineHeight,s=e.lineWidth,u=e.textBaseline,c=e.textAlign,l=e.letterSpacing,h=e.textPath,f=e.leading,d=void 0===f?0:f,p=function(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,o=t.fontWeight,a=se(e)&&e+"px"||"16px",s=n.split(","),u=s.length-1;u>=0;u--){var c=s[u].trim();!mi.test(c)&&0>vi.indexOf(c)&&(c='"'+c+'"'),s[u]=c}return r+" "+i+" "+o+" "+a+" "+s.join(",")}(e);0===(r=this.measureFont(p,n)).fontSize&&(r.fontSize=i,r.ascent=i);var v=this.runtime.offscreenCanvas.getOrCreateContext(n);v.font=p,e.isOverflowing=!1;var m=(o?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),y=Array(m.length),g=0;if(!h){for(var x=0;m.length>x;x++){var E=v.measureText(m[x]).width+(m[x].length-1)*l;y[x]=E,g=Math.max(g,E)}var b=g+s,T=a||r.fontSize+s,S=Math.max(T,r.fontSize+s)+(m.length-1)*(T+d),P=0;return"middle"===u?P=-S/2:"bottom"===u||"alphabetic"===u||"ideographic"===u?P=-S:"top"!==u&&"hanging"!==u||(P=0),{font:p,width:b,height:S,lines:m,lineWidths:y,lineHeight:T+=d,maxLineWidth:g,fontProperties:r,lineMetrics:y.map((function(t,e){var n=0;return"center"===c||"middle"===c?n-=t/2:"right"!==c&&"end"!==c||(n-=t),new Vo(n-s/2,P+e*T,t+s,T)}))}}h.getTotalLength();for(var w=0;m.length>w;w++)v.measureText(m[w])},e.setGraphemeOnPath=function(){},e.wordWrap=function(t,e,n){var r=this,i=e.wordWrapWidth,o=void 0===i?0:i,a=e.letterSpacing,s=e.maxLines,u=void 0===s?1/0:s,c=e.textOverflow,l=this.runtime.offscreenCanvas.getOrCreateContext(n),h=o+a,f="";"ellipsis"===c?f="...":c&&"clip"!==c&&(f=c);for(var d=[],p=0,v=0,m={},y=function(t){return r.getFromCache(t,a,m,l)},g=Array.from(f).reduce((function(t,e){return t+y(e)}),0),x=Array.from(t),E=0;x.length>E;E++){var b=x[E],T=t[E-1],S=t[E+1],P=y(b);if(this.isNewline(b)){if(++p>=u){e.isOverflowing=!0;break}v=0,d[p]=""}else{if(v>0&&v+P>h){if(p+1>=u){if(e.isOverflowing=!0,g>0&&h>=g){for(var w=d[p].length,M=0,k=w,N=0;w>N;N++){var C=y(d[p][N]);if(M+C+g>h){k=N;break}M+=C}d[p]=(d[p]||"").slice(0,k)+f}break}if(v=0,d[++p]="",this.isBreakingSpace(b))continue;this.canBreakInLastChar(b)||(d=this.trimToBreakable(d),v=this.sumTextWidthByCache(d[p]||"",m)),this.shouldBreakByKinsokuShorui(b,S)&&(d=this.trimByKinsokuShorui(d),v+=y(T||""))}v+=P,d[p]=(d[p]||"")+b}}return d.join("\n")},e.isBreakingSpace=function(t){return"string"==typeof t&&ks.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},e.isNewline=function(t){return"string"==typeof t&&ks.Newlines.indexOf(t.charCodeAt(0))>=0},e.trimToBreakable=function(t){var e=[].concat(t),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),o=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(r+1,n.length),e[e.length-2]=n.slice(0,o),e},e.canBreakInLastChar=function(t){return!t||!Ns.test(t)},e.sumTextWidthByCache=function(t,e){return t.split("").reduce((function(t,n){if(!e[n])throw Error("cannot count the word without cache");return t+e[n]}),0)},e.findBreakableIndex=function(t){for(var e=t.length-1;e>=0;e--)if(!Ns.test(t[e]))return e;return-1},e.getFromCache=function(t,e,n,r){var i=n[t];if("number"!=typeof i){var o=t.length*e;i=r.measureText(t).width+o,n[t]=i}return i},t}(),Ls={},Rs=(Ss=new ps,Ps=new ds,(Ts={})[t.Shape.CIRCLE]=new cs,Ts[t.Shape.ELLIPSE]=new ls,Ts[t.Shape.RECT]=Ss,Ts[t.Shape.IMAGE]=Ss,Ts[t.Shape.GROUP]=Ss,Ts[t.Shape.LINE]=new hs,Ts[t.Shape.TEXT]=new vs(Ls),Ts[t.Shape.POLYLINE]=Ps,Ts[t.Shape.POLYGON]=Ps,Ts[t.Shape.PATH]=new fs,Ts[t.Shape.HTML]=null,Ts[t.Shape.MESH]=null,Ts),_s=function(){var e,n=new ko,r=new Oo;return(e={})[t.PropertySyntax.PERCENTAGE]=null,e[t.PropertySyntax.NUMBER]=new Do,e[t.PropertySyntax.ANGLE]=new wo,e[t.PropertySyntax.DEFINED_PATH]=new Mo,e[t.PropertySyntax.PAINT]=n,e[t.PropertySyntax.COLOR]=n,e[t.PropertySyntax.FILTER]=new No,e[t.PropertySyntax.LENGTH]=r,e[t.PropertySyntax.LENGTH_PERCENTAGE]=r,e[t.PropertySyntax.LENGTH_PERCENTAGE_12]=new Lo,e[t.PropertySyntax.LENGTH_PERCENTAGE_14]=new Ro,e[t.PropertySyntax.COORDINATE]=new _o,e[t.PropertySyntax.OFFSET_DISTANCE]=new Fo,e[t.PropertySyntax.OPACITY_VALUE]=new Go,e[t.PropertySyntax.PATH]=new Ho,e[t.PropertySyntax.LIST_OF_POINTS]=new Wo,e[t.PropertySyntax.SHADOW_BLUR]=new Yo,e[t.PropertySyntax.TEXT]=new Xo,e[t.PropertySyntax.TEXT_TRANSFORM]=new qo,e[t.PropertySyntax.TRANSFORM]=new Ko,e[t.PropertySyntax.TRANSFORM_ORIGIN]=new Zo,e[t.PropertySyntax.Z_INDEX]=new Qo,e[t.PropertySyntax.MARKER]=new Io,e}();Ls.CameraContribution=us,Ls.AnimationTimeline=null,Ls.EasingFunction=null,Ls.offscreenCanvas=new ys,Ls.displayObjectPool=new La,Ls.sceneGraphSelector=new Es,Ls.sceneGraphService=new Ms(Ls),Ls.textService=new Os(Ls),Ls.geometryUpdaterFactory=Rs,Ls.CSSPropertySyntaxFactory=_s,Ls.styleValueRegistry=new is,Ls.layoutRegistry=null,Ls.globalThis=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw Error("Unable to locate global `this`")}(),Ls.enableCSSParsing=!0;var Is=function(){function t(){this.context=void 0,this.plugins=[]}var e=t.prototype;return e.addRenderingPlugin=function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)},e.removeAllRenderingPlugins=function(){var t=this;this.plugins.forEach((function(e){var n=t.context.renderingPlugins.indexOf(e);0>n||t.context.renderingPlugins.splice(n,1)}))},t}(),Ds=function(){function t(t){this.plugins=[],this.config=void 0,this.config=pn({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1},t)}var e=t.prototype;return e.registerPlugin=function(t){-1===this.plugins.findIndex((function(e){return e===t}))&&this.plugins.push(t)},e.unregisterPlugin=function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)},e.getPlugins=function(){return this.plugins},e.getPlugin=function(t){return this.plugins.find((function(e){return e.name===t}))},e.getConfig=function(){return this.config},e.setConfig=function(t){Object.assign(this.config,t)},t}(),Fs=function(){function e(t){this.strategies=void 0,this.strategies=t}return e.prototype.apply=function(n){var r=n.camera,i=n.renderingService,o=n.renderingContext,a=this.strategies;i.hooks.cull.tap(e.tag,(function(e){if(e){var n=e.cullable;return n.visible=0===a.length?o.unculledEntities.indexOf(e.entity)>-1:a.every((function(t){return t.isVisible(r,e)})),!e.isCulled()&&e.isVisible()?e:(e.dispatchEvent(new ea(t.ElementEvent.CULLED)),null)}return e})),i.hooks.afterRender.tap(e.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},e}();Fs.tag="Culling";var Gs=function(){function t(){}return t.prototype.apply=function(e){var n=e.renderingService;n.hooks.dirtycheck.tap(t.tag,(function(t){return t?t.renderable.dirty||n.disableDirtyRectangleRendering()?t:null:t}))},t}();Gs.tag="DirtyCheck";var Bs=function(){function t(){var t=this;this.autoPreventDefault=!1,this.rootPointerEvent=new pa(null),this.rootWheelEvent=new va(null),this.context=void 0,this.onPointerMove=function(e){var n,r,i=null===(n=t.context.renderingContext.root)||void 0===n||null===(r=n.ownerDocument)||void 0===r?void 0:r.defaultView;if(!i.supportsTouchEvents||"touch"!==e.pointerType){for(var o,a=En(t.normalizeToPointerEvent(e,i));!(o=a()).done;){var s=t.bootstrapEvent(t.rootPointerEvent,o.value,i,e);t.context.eventService.mapEvent(s)}t.setCursor(t.context.eventService.cursor)}}}var e=t.prototype;return e.apply=function(e){var n=this;this.context=e;var r=e.renderingService,i=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler(function(){var t=hn(cn().mark((function t(e){return cn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.context.renderingService.hooks.pick.promise({position:e,picked:[],topmost:!0});case 2:return t.abrupt("return",t.sent.picked[0]||null);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),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();for(var r,o=En(e);!(r=o()).done;){var a=n.bootstrapEvent(n.rootPointerEvent,r.value,i,t);n.context.eventService.mapEvent(a)}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerUp.tap(t.tag,(function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e=n.context.contextService.getDomElement(),r="outside";try{r=e&&t.target&&t.target!==e&&e.contains&&!e.contains(t.target)?"outside":""}catch(t){}for(var o,a=En(n.normalizeToPointerEvent(t,i));!(o=a()).done;){var s=n.bootstrapEvent(n.rootPointerEvent,o.value,i,t);s.type+=r,n.context.eventService.mapEvent(s)}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)},e.getViewportXY=function(t){var e,n,r=t.offsetX,i=t.offsetY,o=t.clientX,a=t.clientY;if(!this.context.config.supportsCSSTransform||$t(r)||$t(i)){var s=this.context.eventService.client2Viewport(new jo(o,a));e=s.x,n=s.y}else e=r,n=i;return{x:e,y:n}},e.bootstrapEvent=function(t,e,n,r){t.view=n,t.originalEvent=null,t.nativeEvent=r,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var i=this.getViewportXY(e),o=i.y;t.viewport.x=i.x,t.viewport.y=o;var a=this.context.eventService.viewport2Canvas(t.viewport),s=a.y;return t.canvas.x=a.x,t.canvas.y=s,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=r.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=ur[t.type]||t.type),t},e.normalizeWheelEvent=function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.getViewportXY(t),r=n.y;e.viewport.x=n.x,e.viewport.y=r;var i=this.context.eventService.viewport2Canvas(e.viewport),o=i.y;return e.canvas.x=i.x,e.canvas.y=o,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e},e.transferMouseData=function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null},e.setCursor=function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")},e.normalizeToPointerEvent=function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;t.changedTouches.length>r;r++){var i=t.changedTouches[r];le(i.button)&&(i.button=0),le(i.buttons)&&(i.buttons=1),le(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),le(i.width)&&(i.width=i.radiusX||1),le(i.height)&&(i.height=i.radiusY||1),le(i.tiltX)&&(i.tiltX=0),le(i.tiltY)&&(i.tiltY=0),le(i.pointerType)&&(i.pointerType="touch"),le(i.pointerId)&&(i.pointerId=i.identifier||0),le(i.pressure)&&(i.pressure=i.force||.5),le(i.twist)&&(i.twist=0),le(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var o=t;le(o.isPrimary)&&(o.isPrimary=!0),le(o.width)&&(o.width=1),le(o.height)&&(o.height=1),le(o.tiltX)&&(o.tiltX=0),le(o.tiltY)&&(o.tiltY=0),le(o.pointerType)&&(o.pointerType="mouse"),le(o.pointerId)&&(o.pointerId=1),le(o.pressure)&&(o.pressure=.5),le(o.twist)&&(o.twist=0),le(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n},t}();Bs.tag="Event";var Us,zs=[t.Shape.CIRCLE,t.Shape.ELLIPSE,t.Shape.IMAGE,t.Shape.RECT,t.Shape.LINE,t.Shape.POLYLINE,t.Shape.POLYGON,t.Shape.TEXT,t.Shape.PATH,t.Shape.HTML],js=function(){function e(){}var n=e.prototype;return n.isVisible=function(e,n){var r,i,o=n.cullable;if(!o.enable)return!0;var a=n.getRenderBounds();if(Bo.isEmpty(a))return!1;var s=e.getFrustum(),u=null===(r=n.parentNode)||void 0===r||null===(i=r.cullable)||void 0===i?void 0:i.visibilityPlaneMask;return o.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(n,a,u||t.Mask.INDETERMINATE,s.planes),o.visible=o.visibilityPlaneMask!==t.Mask.OUTSIDE,o.visible},n.computeVisibilityWithPlaneMask=function(e,n,r,i){if(r===t.Mask.OUTSIDE||r===t.Mask.INSIDE)return r;for(var o=t.Mask.INSIDE,a=zs.indexOf(e.nodeName)>-1,s=0,u=i.length;u>s;++s){var c=1<<s;if(0!=(r&c)&&(!a||4!==s&&5!==s)){var l=i[s],h=l.normal,f=l.distance;if(0>j(h,n.getPositiveFarPoint(i[s]))+f)return t.Mask.OUTSIDE;0>j(h,n.getNegativeFarPoint(i[s]))+f&&(o|=c)}}return o},e}(),Vs=function(){function e(){this.rBush=void 0,this.toSync=new Set}var n=e.prototype;return n.apply=function(n){var r=this,i=n.renderingService,o=n.renderingContext.root.ownerDocument.defaultView;this.rBush=n.rBushRoot;var a=function(t){t.target.renderable.dirty=!0,i.dirtify()},s=function(t){var e=t.target;t.detail.affectChildren&&e.forEach((function(t){r.toSync.add(t)}));for(var n=e;n;)n.renderable&&r.toSync.add(n),n=n.parentElement;i.dirtify()},u=function(t){var e=t.target;Ls.enableCSSParsing&&Ls.styleValueRegistry.recalc(e),Ls.sceneGraphService.dirtifyToRoot(e),i.dirtify()},c=function(t){var e=t.target,n=e.rBushNode;n.aabb&&r.rBush.remove(n.aabb),r.toSync.delete(e),Ls.sceneGraphService.dirtifyToRoot(e),i.dirtify()};i.hooks.init.tapPromise(e.tag,hn(cn().mark((function e(){return cn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o.addEventListener(t.ElementEvent.MOUNTED,u),o.addEventListener(t.ElementEvent.UNMOUNTED,c),o.addEventListener(t.ElementEvent.ATTR_MODIFIED,a),o.addEventListener(t.ElementEvent.BOUNDS_CHANGED,s);case 4:case"end":return e.stop()}}),e)})))),i.hooks.destroy.tap(e.tag,(function(){o.removeEventListener(t.ElementEvent.MOUNTED,u),o.removeEventListener(t.ElementEvent.UNMOUNTED,c),o.removeEventListener(t.ElementEvent.ATTR_MODIFIED,a),o.removeEventListener(t.ElementEvent.BOUNDS_CHANGED,s),r.toSync.clear()})),i.hooks.endFrame.tap(e.tag,(function(){r.syncRTree()}))},n.syncRTree=function(){var t=this,e=[];Array.from(this.toSync).filter((function(t){return t.isConnected})).forEach((function(n){var r=n.rBushNode;r&&r.aabb&&t.rBush.remove(r.aabb);var i=n.getRenderBounds();if(i){var o=i.getMin(),a=o[0],s=o[1],u=i.getMax(),c=u[0],l=u[1];r.aabb||(r.aabb={}),r.aabb.id=n.entity,r.aabb.minX=a,r.aabb.minY=s,r.aabb.maxX=c,r.aabb.maxY=l}r.aabb&&(isNaN(r.aabb.maxX)||isNaN(r.aabb.maxX)||isNaN(r.aabb.minX)||isNaN(r.aabb.minY)||e.push(r.aabb))})),this.rBush.load(e),e.length=0,this.toSync.clear()},e}();Vs.tag="Prepare",(Us=t.CanvasEvent||(t.CanvasEvent={})).READY="ready",Us.BEFORE_RENDER="beforerender",Us.RERENDER="rerender",Us.AFTER_RENDER="afterrender",Us.BEFORE_DESTROY="beforedestroy",Us.AFTER_DESTROY="afterdestroy",Us.RESIZE="resize",Us.DIRTY_RECTANGLE="dirtyrectangle";var Hs=new ea(t.ElementEvent.MOUNTED),Ws=new ea(t.ElementEvent.UNMOUNTED),Ys=new ea(t.CanvasEvent.BEFORE_RENDER),Xs=new ea(t.CanvasEvent.RERENDER),qs=new ea(t.CanvasEvent.AFTER_RENDER),Ks=function(e){function r(n){var r;(r=e.call(this)||this).document=void 0,r.customElements=void 0,r.requestAnimationFrame=void 0,r.cancelAnimationFrame=void 0,r.devicePixelRatio=void 0,r.supportsPointerEvents=void 0,r.supportsTouchEvents=void 0,r.isTouchEvent=void 0,r.isMouseEvent=void 0,r.Element=wa,r.frameId=void 0,r.inited=!1,r.readyPromise=void 0,r.resolveReadyPromise=void 0,r.context={},r.document=new aa,r.document.defaultView=gn(r),r.customElements=new $o;var i=n.container,o=n.canvas,a=n.offscreenCanvas,s=n.width,u=n.height,c=n.devicePixelRatio,l=n.renderer,h=n.background,f=n.cursor,d=n.document,p=n.requestAnimationFrame,v=n.cancelAnimationFrame,m=n.createImage,y=n.supportsPointerEvents,g=n.supportsTouchEvents,x=n.supportsCSSTransform,E=n.isTouchEvent,b=n.isMouseEvent;!function(t,e){if(t){var n="string"==typeof t?t:t.id||er++;tr[n]&&tr[n].destroy(),tr[n]=e}}(i,gn(r));var T=s,S=u,P=c;return o&&(P=1>(P=c||nr&&window.devicePixelRatio||1)?1:Math.ceil(P),T=s||function(t){var e=or(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(o)||o.width/P,S=u||function(t){var e=or(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(o)||o.height/P),r.devicePixelRatio=P,r.requestAnimationFrame=null!=p?p:Mi.bind(Ls.globalThis),r.cancelAnimationFrame=null!=v?v:ki.bind(Ls.globalThis),r.supportsTouchEvents=null!=g?g:"ontouchstart"in Ls.globalThis,r.supportsPointerEvents=null!=y?y:!!Ls.globalThis.PointerEvent,r.isTouchEvent=null!=E?E:function(t){return r.supportsTouchEvents&&t instanceof Ls.globalThis.TouchEvent},r.isMouseEvent=null!=b?b:function(t){return!Ls.globalThis.MouseEvent||t instanceof Ls.globalThis.MouseEvent&&(!r.supportsPointerEvents||!(t instanceof Ls.globalThis.PointerEvent))},r.initRenderingContext({container:i,canvas:o,width:T,height:S,renderer:l,offscreenCanvas:a,devicePixelRatio:P,cursor:f||"default",background:h||"transparent",createImage:m,document:d,supportsCSSTransform:x}),r.initDefaultCamera(T,S),hn(cn().mark((function e(){return cn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.initRenderer(l);case 2:r.dispatchEvent(new ea(t.CanvasEvent.READY)),r.readyPromise&&r.resolveReadyPromise();case 4:case"end":return e.stop()}}),e)})))(),r}vn(r,e);var i=r.prototype;return i.initRenderingContext=function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},i.initDefaultCamera=function(e,n){var r=this,i=new Ls.CameraContribution;i.setType(t.CameraType.EXPLORING,t.CameraTrackingMode.DEFAULT).setPosition(e/2,n/2,500).setFocalPoint(e/2,n/2,0).setOrthographic(e/-2,e/2,n/2,n/-2,.1,1e3),i.canvas=this,i.eventEmitter.on(as.UPDATED,(function(){r.context.renderingContext.renderReasons.add(t.RenderReason.CAMERA_CHANGED)})),this.context.camera=i},i.getConfig=function(){return this.context.config},i.getRoot=function(){return this.document.documentElement},i.getCamera=function(){return this.context.camera},i.getContextService=function(){return this.context.contextService},i.getEventService=function(){return this.context.eventService},i.getRenderingService=function(){return this.context.renderingService},i.getRenderingContext=function(){return this.context.renderingContext},i.getStats=function(){return this.getRenderingService().getStats()},i.destroy=function(e,n){(void 0===e&&(e=!0),void 0===n&&(n=!1),n||this.dispatchEvent(new ea(t.CanvasEvent.BEFORE_DESTROY)),this.frameId)&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var r=this.getRoot();this.unmountChildren(r),e&&(this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),e&&this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),n||this.dispatchEvent(new ea(t.CanvasEvent.AFTER_DESTROY))},i.changeSize=function(t,e){this.resize(t,e)},i.resize=function(e,n){var r=this.context.config;r.width=e,r.height=n,this.getContextService().resize(e,n);var i=this.context.camera,o=i.getProjectionMode();i.setPosition(e/2,n/2,500).setFocalPoint(e/2,n/2,0),o===t.CameraProjectionMode.ORTHOGRAPHIC?i.setOrthographic(e/-2,e/2,n/2,n/-2,i.getNear(),i.getFar()):i.setAspect(e/n),this.dispatchEvent(new ea(t.CanvasEvent.RESIZE,{width:e,height:n}))},i.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},i.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},i.removeChild=function(t){return this.document.documentElement.removeChild(t)},i.removeChildren=function(){this.document.documentElement.removeChildren()},i.destroyChildren=function(){this.document.documentElement.destroyChildren()},i.render=function(){var t=this;this.dispatchEvent(Ys),this.getRenderingService().render(this.getConfig(),(function(){t.dispatchEvent(Xs)})),this.dispatchEvent(qs)},i.run=function(){var t=this;!function e(){t.render(),t.frameId=requestAnimationFrame(e)}()},i.initRenderer=function(){var t=hn(cn().mark((function t(e){return cn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}throw Error("Renderer is required.");case 2:return this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new n,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new Bs,new Vs,new Gs,new Fs([new js])),this.loadRendererContainerModule(e),this.context.contextService=new this.context.ContextService(pn({},Ls,this.context)),this.context.renderingService=new gs(Ls,this.context),this.context.eventService=new ms(Ls,this.context),this.context.eventService.init(),t.next=14,this.context.contextService.init();case 14:return t.next=16,this.context.renderingService.init();case 16:this.inited=!0,this.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),this.mountChildren(this.getRoot()),e.getConfig().enableAutoRendering&&this.run();case 20:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),i.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init(Ls)}))},i.setRenderer=function(){var t=hn(cn().mark((function t(e){var n,r;return cn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((n=this.getConfig()).renderer!==e){t.next=3;break}return t.abrupt("return");case 3:return r=n.renderer,n.renderer=e,this.destroy(!1,!0),[].concat(null==r?void 0:r.getPlugins()).reverse().forEach((function(t){t.destroy(Ls)})),t.next=9,this.initRenderer(e);case 9:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),i.setCursor=function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)},i.unmountChildren=function(t){var e=this;t.childNodes.forEach((function(t){e.unmountChildren(t)})),this.inited&&(t.isMutationObserved?t.dispatchEvent(Ws):(Ws.target=t,this.dispatchEvent(Ws,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()},i.mountChildren=function(t){var e=this;this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,t.isMutationObserved?t.dispatchEvent(Hs):(Hs.target=t,this.dispatchEvent(Hs,!0))):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",t.nodeName),t.childNodes.forEach((function(t){e.mountChildren(t)})),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()},i.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},i.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},i.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},i.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},i.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},i.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},dn(r,[{key:"ready",get:function(){var t=this;return this.readyPromise||(this.readyPromise=new Promise((function(e){t.resolveReadyPromise=function(){e(t)}})),this.inited&&this.resolveReadyPromise()),this.readyPromise}}]),r}(na);function Zs(t,e){return Zs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Zs(t,e)}var Qs=function(e){var n,r;function i(){for(var t,n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).landmarks=[],t.landmarkAnimationID=void 0,t}(n=i).prototype=Object.create((r=e).prototype),n.prototype.constructor=n,Zs(n,r);var o=i.prototype;return o.rotate=function(e,n,r){if(this.relElevation=dr(n),this.relAzimuth=dr(e),this.relRoll=dr(r),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===t.CameraType.EXPLORING){var i=J($(),[1,0,0],vr((this.rotateWorld?1:-1)*this.relElevation)),o=J($(),[0,1,0],vr((this.rotateWorld?1:-1)*this.relAzimuth)),s=J($(),[0,0,1],vr(this.relRoll)),u=tt($(),o,i);u=tt($(),u,s);var c=w(a(),u);v(this.matrix,this.matrix,[0,0,-this.distance]),p(this.matrix,this.matrix,c),v(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this._update(),this},o.pan=function(t,e){var n=pr(t,e,0),r=R(this.position);return G(r,r,U(L(),this.right,n[0])),G(r,r,U(L(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this},o.dolly=function(e){var n,r=this.forward,i=R(this.position);return i[0]+=(n=Math.max(Math.min(this.distance+e*this.dollyingStep,this.maxDistance),this.minDistance)-this.distance)*r[0],i[1]+=n*r[1],i[2]+=n*r[2],this._setPosition(i),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getDistance():this.type===t.CameraType.TRACKING&&G(this.focalPoint,i,this.distanceVector),this.triggerUpdate(),this},o.cancelLandmarkAnimation=function(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)},o.createLandmark=function(t,e){var n,r,i,o;void 0===e&&(e={});var a=e.position,u=void 0===a?this.position:a,c=e.focalPoint,l=void 0===c?this.focalPoint:c,h=e.roll,f=e.zoom,d=new Ls.CameraContribution;d.setType(this.type,void 0),d.setPosition(u[0],null!==(n=u[1])&&void 0!==n?n:this.position[1],null!==(r=u[2])&&void 0!==r?r:this.position[2]),d.setFocalPoint(l[0],null!==(i=l[1])&&void 0!==i?i:this.focalPoint[1],null!==(o=l[2])&&void 0!==o?o:this.focalPoint[2]),d.setRoll(null!=h?h:this.roll),d.setZoom(null!=f?f:this.zoom);var p={name:t,matrix:s(d.getWorldTransform()),right:R(d.right),up:R(d.up),forward:R(d.forward),position:R(d.getPosition()),focalPoint:R(d.getFocalPoint()),distanceVector:R(d.getDistanceVector()),distance:d.getDistance(),dollyingStep:d.getDollyingStep(),azimuth:d.getAzimuth(),elevation:d.getElevation(),roll:d.getRoll(),relAzimuth:d.relAzimuth,relElevation:d.relElevation,relRoll:d.relRoll,zoom:d.getZoom()};return this.landmarks.push(p),p},o.gotoLandmark=function(t,e){var n=this;void 0===e&&(e={});var r=oe(t)?this.landmarks.find((function(e){return e.name===t})):t;if(r){var i=se(e)?{duration:e}:e,o=i.easing,a=void 0===o?"linear":o,s=i.duration,u=void 0===s?100:s,c=i.easingFunction,l=void 0===c?void 0:c,h=i.onfinish,f=void 0===h?void 0:h;if(0===u)return this.syncFromLandmark(r),void(f&&f());this.cancelLandmarkAnimation();var d,p=r.position,v=r.focalPoint,m=r.zoom,y=r.roll,g=l||Ls.EasingFunction(a),x=function(){n.setFocalPoint(v),n.setPosition(p),n.setRoll(y),n.setZoom(m),n.computeMatrix(),n.triggerUpdate(),f&&f()};this.canvas.requestAnimationFrame((function t(e){void 0===d&&(d=e);var r=e-d;if(u<r)x();else{var i,o,a=g(r/u),s=L(),c=L();H(s,n.focalPoint,v,a),H(c,n.position,p,a),o=n.roll*(1-a)+y*a,i=n.zoom*(1-a)+m*a,n.setFocalPoint(s),n.setPosition(c),n.setRoll(o),n.setZoom(i),q(s,v)+q(c,p)>.01?(n.computeMatrix(),n.triggerUpdate(),u>r&&(n.landmarkAnimationID=n.canvas.requestAnimationFrame(t))):x()}}))}},o.syncFromLandmark=function(t){this.matrix=u(this.matrix,t.matrix),this.right=D(this.right,t.right),this.up=D(this.up,t.up),this.forward=D(this.forward,t.forward),this.position=D(this.position,t.position),this.focalPoint=D(this.focalPoint,t.focalPoint),this.distanceVector=D(this.distanceVector,t.distanceVector),this.azimuth=t.azimuth,this.elevation=t.elevation,this.roll=t.roll,this.relAzimuth=t.relAzimuth,this.relElevation=t.relElevation,this.relRoll=t.relRoll,this.dollyingStep=t.dollyingStep,this.distance=t.distance,this.zoom=t.zoom},i}(us);Ls.CameraContribution=Qs;var $s,Js,tu,eu,nu=function(t,e,n){this._layoutContext=void 0,this._node=void 0,this.options=void 0,this.layoutContext=void 0,this.inlineSize=void 0,this.blockSize=void 0,this.node=void 0,this.childFragments=void 0,this.data=void 0,this._layoutContext=t,this._node=e,this.options=n,this.layoutContext=t,this.inlineSize=null==n?void 0:n.inlineSize,this.blockSize=null==n?void 0:n.blockSize,this.childFragments=null==n?void 0:n.childFragments,this.data=n.data,this.node=e};function ru(){ru=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function c(t,e,n,i){var o=Object.create((e&&e.prototype instanceof f?e:f).prototype),a=new w(i||[]);return r(o,"_invoke",{value:b(t,n,a)}),o}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var h={};function f(){}function d(){}function p(){}var v={};u(v,o,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(M([])));y&&y!==e&&n.call(y,o)&&(v=y);var g=p.prototype=f.prototype=Object.create(v);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function i(r,o,a,s){var u=l(t[r],t,o);if("throw"!==u.type){var c=u.arg,h=c.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){i("next",t,a,s)}),(function(t){i("throw",t,a,s)})):e.resolve(h).then((function(t){c.value=t,a(c)}),(function(t){return i("throw",t,a,s)}))}s(u.arg)}var o;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){i(t,n,e,r)}))}return o=o?o.then(r,r):r()}})}function b(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return k()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=T(a,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=l(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function T(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,T(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var i=l(r,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,h;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function M(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,r(g,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:d,configurable:!0}),d.displayName=u(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,u(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},x(E.prototype),u(E.prototype,a,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new E(c(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(g),u(g,s,"Generator"),u(g,o,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=M,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(this.prev>=o.tryLoc){var s=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(s&&u){if(o.catchLoc>this.prev)return r(o.catchLoc,!0);if(o.finallyLoc>this.prev)return r(o.finallyLoc)}else if(s){if(o.catchLoc>this.prev)return r(o.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(this.prev>=i.tryLoc&&n.call(i,"finallyLoc")&&i.finallyLoc>this.prev){var o=i;break}}o&&("break"===t||"continue"===t)&&e>=o.tryLoc&&o.finallyLoc>=e&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),P(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;P(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:M(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}function iu(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function ou(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){iu(o,r,i,a,s,"next",t)}function s(t){iu(o,r,i,a,s,"throw",t)}a(void 0)}))}}function au(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(i=void 0,"symbol"==typeof(i=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(r.key,"string"))?i:i+""),r)}var i}function su(t,e,n){return e&&au(t.prototype,e),n&&au(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}($s=t.LayoutTaskType||(t.LayoutTaskType={})).Layout="layout",$s.IntrinsicSizes="intrinsic-sizes",function(t){t[t.block=0]="block",t[t.normal=1]="normal"}(Js||(Js={})),function(t){t[t["block-like"]=0]="block-like",t[t.manual=1]="manual"}(tu||(tu={})),(eu=t.PropertyName||(t.PropertyName={})).LAYOUT="display",eu.LEFT="left",eu.TOP="top",eu.BOTTOM="bottom",eu.RIGHT="right",eu.WIDTH="width",eu.HEIGHT="height",eu.MIN_WIDTH="minWidth",eu.MAX_WIDTH="maxWidth",eu.MIN_HEIGHT="minHeight",eu.MAX_HEIGHT="maxHeight",eu.BOX_SIZING="boxSizing",eu.PADDING="padding",eu.PADDING_TOP="paddingTop",eu.PADDING_BOTTOM="paddingBottom",eu.PADDING_START="paddingLeft",eu.PADDING_END="paddingRight",eu.MARGIN="margin",eu.MARGIN_TOP="marginTop",eu.MARGIN_BOTTOM="marginBottom",eu.MARGIN_START="marginLeft",eu.MARGIN_END="marginRight",eu.BORDER="border",eu.BORDER_TOP="borderTop",eu.BORDER_BOTTOM="borderBottom",eu.BORDER_START="borderLeft",eu.BORDER_END="borderRight",eu.FLEX_DIRECTION="flexDirection",eu.FLEX_WRAP="flexWrap",eu.FLEX_FLOW="flexFlow",eu.ALIGN_ITEMS="alignItems",eu.ALIGN_CONTENT="alignContent",eu.JUSTIFY_CONTENT="justifyContent",eu.FLEX="flex",eu.ALIGN_SELF="alignSelf",eu.FLEX_SHRINK="flexShrink",eu.FLEX_BASIS="flexBasis",eu.FLEX_GROW="flexGrow",eu.OFFSET_WIDTH="offsetWidth",eu.OFFSET_HEIGHT="offsetHeight",eu.ORDER="order";var uu=function(t){if(t.isRejected||t.isFulfilled)return t;var e,n=!0,r=!1,i=!1,o=t.then((function(t){return i=!0,n=!1,e=t,t}),(function(t){throw r=!0,n=!1,t}));return o.isFulfilled=function(){return i},o.isPending=function(){return n},o.isRejected=function(){return r},o.getFullFilledValue=function(){return e},o},cu=function(){var t=this;this.resolve=void 0,this.reject=void 0,this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))},lu=function(){function e(t,e){this._layoutContext=void 0,this.options=void 0,this.node=void 0,this.styleMap=void 0,this.layoutContext=void 0,this._layoutContext=t,this.options=e,this.layoutContext=t,this.node=e.node,this.styleMap=e.node.getAllStyle()}var n=e.prototype;return n.intrinsicSizes=function(){var e=new cu;return this.layoutContext.appendWorkTask({layoutChild:this,taskType:t.LayoutTaskType.IntrinsicSizes,deferred:e}),e.promise},n.layoutNextFragment=function(e){if(this.layoutContext.mode===t.LayoutTaskType.IntrinsicSizes)throw Error("Not Supported: cant call layoutNextFragment in intrinsicSizes");var n=new cu;return this.layoutContext.appendWorkTask({layoutConstraints:e,layoutChild:this,taskType:t.LayoutTaskType.Layout,deferred:n}),n.promise},e}(),hu=0,fu=function(){function t(t){this.options=void 0,this.contextId=void 0,this.workQueue=[],this.mode=void 0,this.layoutChildrenFactory=void 0,this.fragmentResultFactory=void 0,this.layoutFragmentFactory=void 0,this.options=t,this.contextId=""+hu++,this.mode=t.mode,this.layoutChildrenFactory=t.layoutChildrenFactory,this.fragmentResultFactory=t.fragmentResultFactory,this.layoutFragmentFactory=t.layoutFragmentFactory}var e=t.prototype;return e.appendWorkTask=function(t){this.workQueue.push(t)},e.clearWorkQueue=function(){this.workQueue=[]},t}(),du=function(){};du.inputProperties=void 0,du.childrenInputProperties=void 0,du.layoutOptions=void 0;var pu=function(t){return void 0===t&&(t=0),new Promise((function(e){setTimeout((function(){e()}),t)}))},vu=function(){function e(t,e,n){this._layoutRegistry=void 0,this._layoutContextFactory=void 0,this._layoutEdgesFactory=void 0,this.layoutRegistry=void 0,this.layoutContextFactory=void 0,this.layoutEdgesFactory=void 0,this._layoutRegistry=t,this._layoutContextFactory=e,this._layoutEdgesFactory=n,this.layoutRegistry=t,this.layoutContextFactory=e,this.layoutEdgesFactory=n}var n=e.prototype;return n.computeLayout=function(){var t=ou(ru().mark((function t(e,n){return ru().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.determineIntrinsicSizes(e,e.children);case 2:return t.next=4,this.calculateLayout(e,e.children,n);case 4:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.determineAllIntrinsicSizes=function(){var t=ou(ru().mark((function t(e){return ru().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),n.getLayoutDefinitionName=function(e){var n=e.getAllStyle().get(t.PropertyName.LAYOUT);if(!n)throw Error("layout property not found");return n.value},n.determineIntrinsicSizes=function(){var t=ou(ru().mark((function t(e,n){var r;return ru().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.getLayoutDefinitionName(e),t.next=3,this.invokeIntrinsicSizesCallback(r,e,n);case 3:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.invokeIntrinsicSizesCallback=function(){var e=ou(ru().mark((function e(n,r,i){var o,a,s,u,c,l,h,f,d,p,v;return ru().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=this.layoutRegistry.getLayout(n),a=new o,s=this.layoutContextFactory({mode:t.LayoutTaskType.IntrinsicSizes}),c=void 0===(u=o.inputProperties)?[]:u,l=[],i.forEach((function(t){var e=s.layoutChildrenFactory({node:t});l.push(e)})),h=this.layoutEdgesFactory({node:r}),f=r.getStyle.apply(r,c),d=a.intrinsicSizes(l,h,f),(p=this.runWorkQueue(d,s.workQueue)).next(),e.next=13,pu();case 13:v=p.next().value,s.clearWorkQueue(),r.setIntrisicSizes(v);case 16:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}(),n.calculateLayout=function(){var t=ou(ru().mark((function t(e,n,r){var i;return ru().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=this.getLayoutDefinitionName(e),t.next=3,this.invokeLayoutCallback(i,e,n,r);case 3:case"end":return t.stop()}}),t,this)})));return function(e,n,r){return t.apply(this,arguments)}}(),n.invokeLayoutCallback=function(){var e=ou(ru().mark((function e(n,r,i,o){var a,s,u,c,l,h,f,d,p,v,m,y,g;return ru().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=this.layoutRegistry.getLayout(n),s=new a,u=this.layoutContextFactory({mode:t.LayoutTaskType.Layout}),l=void 0===(c=a.inputProperties)?[]:c,h=[],i.forEach((function(t){var e=u.layoutChildrenFactory({node:t});h.push(e)})),f=this.layoutEdgesFactory({node:r}),d=r.getStyle.apply(r,l),p=s.layout(h,f,o,d),(v=this.runWorkQueue(p,u.workQueue)).next(),e.next=13,pu();case 13:m=v.next().value,u.clearWorkQueue(),y=m instanceof nu?m:u.fragmentResultFactory(m),g=u.layoutFragmentFactory({inlineSize:y.inlineSize,blockSize:y.blockSize,data:y.data}),r.setComputedLayout(g),i.forEach((function(t,e){t.setComputedLayout(y.childFragments[e])}));case 19:case"end":return e.stop()}}),e,this)})));return function(t,n,r,i){return e.apply(this,arguments)}}(),n.runWorkQueue=ru().mark((function e(n,r){var i,o=this;return ru().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=uu(n),r.length>0&&i.isPending()&&r.forEach((function(e){e.taskType===t.LayoutTaskType.IntrinsicSizes&&e.deferred.resolve(o.getNodeIntrisicSizes(e.layoutChild.node));if(e.taskType===t.LayoutTaskType.Layout){var n=e.layoutChild,r=e.deferred,i=n.layoutContext,a=o.getNodeFragment(n.node,e.layoutConstraints);r.resolve(i.layoutFragmentFactory(a))}})),void(e.next=4);case 4:if(i.isFulfilled()){e.next=6;break}throw Error("promise not fullfilled!");case 6:return e.abrupt("return",i.getFullFilledValue());case 7:case"end":return e.stop()}}),e)})),n.getNodeIntrisicSizes=function(e){var n,r,i,o,a,s,u,c,l,h,f,d,p=e.getAllStyle();return{minContentInlineSize:(null===(n=p.get(t.PropertyName.MIN_WIDTH))||void 0===n?void 0:n.value)||(null===(r=e.intrisicSizes)||void 0===r?void 0:r.minContentInlineSize)||(null===(i=p.get(t.PropertyName.WIDTH))||void 0===i?void 0:i.value)||0,maxContentInlineSize:(null===(o=p.get(t.PropertyName.MAX_WIDTH))||void 0===o?void 0:o.value)||(null===(a=e.intrisicSizes)||void 0===a?void 0:a.maxContentInlineSize)||(null===(s=p.get(t.PropertyName.WIDTH))||void 0===s?void 0:s.value)||0,minContentBlockSize:(null===(u=p.get(t.PropertyName.MIN_HEIGHT))||void 0===u?void 0:u.value)||(null===(c=e.intrisicSizes)||void 0===c?void 0:c.minContentBlockSize)||(null===(l=p.get(t.PropertyName.HEIGHT))||void 0===l?void 0:l.value)||0,maxContentBlockSize:(null===(h=p.get(t.PropertyName.MAX_HEIGHT))||void 0===h?void 0:h.value)||(null===(f=e.intrisicSizes)||void 0===f?void 0:f.maxContentBlockSize)||(null===(d=p.get(t.PropertyName.HEIGHT))||void 0===d?void 0:d.value)||0}},n.getNodeFragment=function(e,n){var r,i,o,a,s,u;return{inlineSize:(null===(r=e.getComputedLayout())||void 0===r?void 0:r.inlineSize)||(null===(i=e.getAllStyle().get(t.PropertyName.MIN_WIDTH))||void 0===i?void 0:i.value)||(null===(o=e.getAllStyle().get(t.PropertyName.WIDTH))||void 0===o?void 0:o.value)||0,blockSize:(null===(a=e.getComputedLayout())||void 0===a?void 0:a.blockSize)||(null===(s=e.getAllStyle().get(t.PropertyName.MIN_HEIGHT))||void 0===s?void 0:s.value)||(null===(u=e.getAllStyle().get(t.PropertyName.HEIGHT))||void 0===u?void 0:u.value)||0,data:n.data}},e}(),mu=1,yu=function(){function e(t){void 0===t&&(t=new Map),this.id=void 0,this.style=void 0,this.dirty=void 0,this.parent=void 0,this.children=void 0,this.internalIntrisicSizes=void 0,this.computedLayout=void 0,this.measureFn=void 0,this.id=mu++,this.style=t,this.parent=void 0,this.children=[],this.dirty=!1}var n=e.prototype;return n.setMeasure=function(t){this.measureFn=t},n.setIntrisicSizes=function(t){this.internalIntrisicSizes=t},n.addChild=function(t){var e;null===(e=this.children)||void 0===e||e.push(t)},n.insertChild=function(t,e){this.children.splice(t,0,e)},n.removeChild=function(t){var e,n=null===(e=this.children)||void 0===e?void 0:e.findIndex((function(e){return e.id===t.id}));this.removeChildAtIndex(n)},n.removeChildAtIndex=function(t){this.children.splice(t,1)},n.replaceChildAtIndex=function(t,e){this.children.splice(t,1,e)},n.setStyle=function(t,e){this.style.set(t,e)},n.getStyle=function(){for(var t=this,e=new Map,n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return r.forEach((function(n){var r=t.style.get(n);r&&e.set(n,r)})),e},n.getAllStyle=function(){return this.style},n.markDirty=function(){this.dirty=!0},n.idDirty=function(){return this.dirty},n.getSize=function(){var e,n,r,i;return{width:null!==(e=null===(n=this.style.get(t.PropertyName.WIDTH))||void 0===n?void 0:n.value)&&void 0!==e?e:0,height:null!==(r=null===(i=this.style.get(t.PropertyName.HEIGHT))||void 0===i?void 0:i.value)&&void 0!==r?r:0}},n.computeLayout=function(){var t=ou(ru().mark((function t(){var e;return ru().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.getSize(),t.next=3,bu.computeLayout(this,{availableInlineSize:e.width,availableBlockSize:e.height,fixedInlineSize:e.width,fixedBlockSize:e.height,percentageInlineSize:e.width,percentageBlockSize:e.height,data:void 0});case 3:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),n.setComputedLayout=function(t){this.computedLayout=t},n.getComputedLayout=function(){return this.computedLayout},n.getAllComputedLayout=function(){},n.toString=function(){return"LayoutObject "+this.id},su(e,[{key:"intrisicSizes",get:function(){return this.internalIntrisicSizes}},{key:"childCount",get:function(){return this.children.length}}]),e}(),gu=function(){function t(){this.registry=new Map}var e=t.prototype;return e.hasLayout=function(t){return this.registry.has(t)},e.getLayout=function(t){if(void 0===t&&(t="absolute"),!this.hasLayout(t))throw Error("invalid layout property: "+t);return this.registry.get(t)},e.updateLayout=function(t,e){this.registry.set(t,e)},e.registerLayout=function(e,n){if(""===e)throw new TypeError("layout name cant't be empty");if(t.reservedLayout.includes(e))throw Error("layout name '"+e+"' is a system reserved layout name, please use another name");if(this.hasLayout(e))throw Error("layout '"+e+"' already exist.");this.registry.set(e,n)},e.deleteLayout=function(t){this.registry.delete(t)},su(t,[{key:"size",get:function(){return this.registry.size}}]),t}();gu.reservedLayout=[];var xu,Eu,bu=null,Tu=function(){function t(t,e){this.type=void 0,this.target=void 0,this.addedNodes=[],this.attributeName=null,this.attributeNamespace=null,this.nextSibling=null,this.oldValue=null,this.previousSibling=null,this.removedNodes=[],this.type=t,this.target=e}return t.copy=function(e){var n=new t(e.type,e.target);return n.addedNodes=e.addedNodes.slice(),n.removedNodes=e.removedNodes.slice(),n.previousSibling=e.previousSibling,n.nextSibling=e.nextSibling,n.attributeName=e.attributeName,n.attributeNamespace=e.attributeNamespace,n.oldValue=e.oldValue,n},t}(),Su=0,Pu=new WeakMap,wu=function(){function e(t,e,n){this.observer=void 0,this.target=void 0,this.options=void 0,this.transientObservedNodes=[],this.observer=t,this.target=e,this.options=n}var n=e.prototype;return n.enqueue=function(t){var e=this.observer.records,n=e.length;if(e.length>0){var r=function(t,e){return t===e?t:Eu&&function(t){return t===Eu||t===xu}(t)?Eu:null}(e[n-1],t);if(r)return void(e[n-1]=r)}else Au.push(this.observer),Cu||(Cu=!0,void 0!==Ls.globalThis?Ls.globalThis.setTimeout(Ou):Ou());e[n]=t},n.addListeners=function(){this.addListeners_(this.target)},n.addListeners_=function(e){var n=this.options;n.attributes&&e.addEventListener(t.ElementEvent.ATTR_MODIFIED,this,!0),n.childList&&e.addEventListener(t.ElementEvent.INSERTED,this,!0),(n.childList||n.subtree)&&e.addEventListener(t.ElementEvent.REMOVED,this,!0)},n.removeListeners=function(){this.removeListeners_(this.target)},n.removeListeners_=function(e){var n=this.options;n.attributes&&e.removeEventListener(t.ElementEvent.ATTR_MODIFIED,this,!0),n.childList&&e.removeEventListener(t.ElementEvent.INSERTED,this,!0),(n.childList||n.subtree)&&e.removeEventListener(t.ElementEvent.REMOVED,this,!0)},n.removeTransientObservers=function(){var t=this.transientObservedNodes;this.transientObservedNodes=[],t.forEach((function(t){this.removeListeners_(t);for(var e=Pu.get(t),n=0;e.length>n;n++)if(e[n]===this){e.splice(n,1);break}}),this)},n.handleEvent=function(e){var n,r;switch(e.stopImmediatePropagation(),e.type){case t.ElementEvent.ATTR_MODIFIED:var i=e.attrName,o=e.relatedNode.namespaceURI;(n=ku("attributes",r=e.target)).attributeName=i,n.attributeNamespace=o;var a=e.attrChange===sa.ADDITION?null:e.prevValue;Nu(r,(function(t){if(t.attributes&&(!t.attributeFilter||!t.attributeFilter.length||-1!==t.attributeFilter.indexOf(i)||-1!==t.attributeFilter.indexOf(o)))return t.attributeOldValue?function(t){return Eu||((Eu=Tu.copy(xu)).oldValue=t,Eu)}(a):n}));break;case t.ElementEvent.REMOVED:case t.ElementEvent.INSERTED:var s,u,c=e.target;e.type===t.ElementEvent.INSERTED?(s=[c],u=[]):(s=[],u=[c]);var l=c.previousSibling,h=c.nextSibling;(n=ku("childList",r=e.relatedNode)).addedNodes=s,n.removedNodes=u,n.previousSibling=l,n.nextSibling=h,Nu(r,(function(t){if(t.childList)return n}))}xu=Eu=void 0},e}(),Mu=function(){function t(t){this.callback=void 0,this.nodes=[],this.records=[],this.uid=Su++,this.callback=t}var e=t.prototype;return e.observe=function(t,e){if(!e.childList&&!e.attributes&&!e.characterData||e.attributeOldValue&&!e.attributes||e.attributeFilter&&e.attributeFilter.length&&!e.attributes||e.characterDataOldValue&&!e.characterData)throw new SyntaxError;var n,r=Pu.get(t);r||Pu.set(t,r=[]);for(var i=0;r.length>i;i++)if(r[i].observer===this){(n=r[i]).removeListeners(),n.options=e;break}n||(n=new wu(this,t,e),r.push(n),this.nodes.push(t)),n.addListeners()},e.disconnect=function(){var t=this;this.nodes.forEach((function(e){for(var n=Pu.get(e),r=0;n.length>r;r++){var i=n[r];if(i.observer===t){i.removeListeners(),n.splice(r,1);break}}}),this),this.records=[]},e.takeRecords=function(){var t=this.records;return this.records=[],t},t}();function ku(t,e){return xu=new Tu(t,e)}function Nu(t,e){for(var n=t;n;n=n.parentNode){var r=Pu.get(n);if(r)for(var i=0;r.length>i;i++){var o=r[i],a=o.options;if(n===t||a.subtree){var s=e(a);s&&o.enqueue(s)}}}}var Cu=!1,Au=[];function Ou(){Cu=!1;var t=Au;Au=[],t.sort((function(t,e){return t.uid-e.uid}));var e=!1;t.forEach((function(t){var n=t.takeRecords();!function(t){t.nodes.forEach((function(e){var n=Pu.get(e);n&&n.forEach((function(e){e.observer===t&&e.removeTransientObservers()}))}))}(t),n.length&&(t.callback(n,t),e=!0)})),e&&Ou()}function Lu(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(i=void 0,"symbol"==typeof(i=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(r.key,"string"))?i:i+""),r)}var i}function Ru(t,e,n){return e&&Lu(t.prototype,e),n&&Lu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function _u(t,e){return _u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_u(t,e)}var Iu=function(t){var e,n;function r(e,n,r,i){var o;return(o=t.call(this,e)||this).currentTime=void 0,o.timelineTime=void 0,o.currentTime=r,o.timelineTime=i,o.target=n,o.type="finish",o.bubbles=!1,o.currentTarget=n,o.defaultPrevented=!1,o.eventPhase=o.AT_TARGET,o.timeStamp=Date.now(),o.currentTime=r,o.timelineTime=i,o}return(e=r).prototype=Object.create((n=t).prototype),e.prototype.constructor=e,_u(e,n),r}(ta),Du=0,Fu=function(){function t(t,e){var n;this.effect=void 0,this.timeline=void 0,this.id=void 0,this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this.oldPlayState=void 0,this._holdTime=void 0,this.readyPromise=void 0,this.finishedPromise=void 0,this.resolveReadyPromise=void 0,this.rejectReadyPromise=void 0,this.resolveFinishedPromise=void 0,this.rejectFinishedPromise=void 0,this.onfinish=void 0,this.oncancel=void 0,this.onframe=void 0,this._currentTime=0,this._startTime=void 0,this._playbackRate=1,this._totalDuration=void 0,this._inEffect=void 0,this._inTimeline=!0,this.onremove=void 0,this.effect=t,t.animation=this,this.timeline=e,this.id=""+Du++,this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null===(n=this.effect)||void 0===n?void 0:n.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}var e=t.prototype;return e.updatePromises=function(){var t=this.oldPlayState,e=this.pending?"pending":this.playState;return this.readyPromise&&e!==t&&("idle"===e?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===t?this.resolveReadyPromise():"pending"===e&&(this.readyPromise=void 0)),this.finishedPromise&&e!==t&&("idle"===e?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===e?this.resolveFinishedPromise():"finished"===t&&(this.finishedPromise=void 0)),this.oldPlayState=e,this.readyPromise||this.finishedPromise},e.play=function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()},e.pause=function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()},e.finish=function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())},e.cancel=function(){this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises())},e.reverse=function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()},e.updatePlaybackRate=function(t){this.playbackRate=t},e.targetAnimations=function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()},e.markTarget=function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)},e.unmarkTarget=function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)},e.tick=function(t,e){this._idle||this._paused||(null===this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))},e.rewind=function(){if(this.playbackRate<0){if(this._totalDuration>=1/0)throw Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this._totalDuration}else this.currentTime=0},e.persist=function(){throw Error(ar)},e.addEventListener=function(t,e,n){throw Error(ar)},e.removeEventListener=function(t,e,n){throw Error(ar)},e.dispatchEvent=function(t){throw Error(ar)},e.commitStyles=function(){throw Error(ar)},e.ensureAlive=function(){var t,e;0>this.playbackRate&&0===this.currentTime?this._inEffect=!!(null===(t=this.effect)||void 0===t?void 0:t.update(-1)):this._inEffect=!!(null===(e=this.effect)||void 0===e?void 0:e.update(this.currentTime));this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))},e.tickCurrentTime=function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())},e.fireEvents=function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new Iu(null,this,this.currentTime,t);setTimeout((function(){e.onfinish&&e.onfinish(n)}))}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var r=new Iu(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}},Ru(t,[{key:"pending",get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending}},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"ready",get:function(){var t=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise((function(e,n){t.resolveReadyPromise=function(){e(t)},t.rejectReadyPromise=function(){n(Error())}})),this.pending||this.resolveReadyPromise()),this.readyPromise}},{key:"finished",get:function(){var t=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise((function(e,n){t.resolveFinishedPromise=function(){e(t)},t.rejectFinishedPromise=function(){n(Error())}})),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){if(!isNaN(t=Number(t))){var e;if(this.timeline.restart(),!this._paused&&null!==this._startTime)this._startTime=Number(null===(e=this.timeline)||void 0===e?void 0:e.currentTime)-t/this.playbackRate;this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this))}}},{key:"startTime",get:function(){return this._startTime},set:function(t){if(null!==t){if(this.updatePromises(),isNaN(t=Number(t)))return;if(this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}}},{key:"playbackRate",get:function(){return this._playbackRate},set:function(t){if(t!==this._playbackRate){this.updatePromises();var e=this.currentTime;this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==e&&(this.currentTime=e),this.updatePromises()}}},{key:"_isFinished",get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||0>this._playbackRate&&0>=Number(this._currentTime))}},{key:"totalDuration",get:function(){return this._totalDuration}},{key:"_needsTick",get:function(){return this.pending||"running"===this.playState||!this._finishedFlag}}]),t}(),Gu=.1,Bu="function"==typeof Float32Array,Uu=function(t,e){return 1-3*e+3*t},zu=function(t,e){return 3*e-6*t},ju=function(t){return 3*t},Vu=function(t,e,n){return((Uu(e,n)*t+zu(e,n))*t+ju(e))*t},Hu=function(t,e,n){return 3*Uu(e,n)*t*t+2*zu(e,n)*t+ju(e)},Wu=function(t,e,n,r){if(0>t||t>1||0>n||n>1)throw Error("bezier x values must be in [0, 1] range");if(t===e&&n===r)return function(t){return t};for(var i=Bu?new Float32Array(11):[,,,,,,,,,,,],o=0;11>o;++o)i[o]=Vu(o*Gu,t,n);var a=function(e){for(var r=0,o=1;10!==o&&e>=i[o];++o)r+=Gu;--o;var a=r+(e-i[o])/(i[o+1]-i[o])*Gu,s=Hu(a,t,n);return.001>s?0===s?a:function(t,e,n,r,i){var o,a,s=0;do{(o=Vu(a=e+(n-e)/2,r,i)-t)>0?n=a:e=a}while(Math.abs(o)>1e-7&&10>++s);return a}(e,r,r+Gu,t,n):function(t,e,n,r){for(var i=0;4>i;++i){var o=Hu(e,n,r);if(0===o)return e;e-=(Vu(e,n,r)-t)/o}return e}(e,a,t,n)};return function(t){return 0===t||1===t?t:Vu(a(t),e,r)}},Yu=function(t){return Math.pow(t,2)},Xu=function(t){return Math.pow(t,3)},qu=function(t){return Math.pow(t,4)},Ku=function(t){return Math.pow(t,5)},Zu=function(t){return Math.pow(t,6)},Qu=function(t){return 1-Math.cos(t*Math.PI/2)},$u=function(t){return 1-Math.sqrt(1-t*t)},Ju=function(t){return t*t*(3*t-2)},tc=function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)},ec=function(t,e){void 0===e&&(e=[]);var n=e[0],r=e[1],i=void 0===r?.5:r,o=ae(Number(void 0===n?1:n),1,10),a=ae(Number(i),.1,2);return 0===t||1===t?t:-o*Math.pow(2,10*(t-1))*Math.sin(2*Math.PI*(t-1-a/(2*Math.PI)*Math.asin(1/o))/a)},nc=function(t,e,n){void 0===e&&(e=[]);var r=e[0],i=void 0===r?1:r,o=e[1],a=void 0===o?100:o,s=e[2],u=void 0===s?10:s,c=e[3],l=void 0===c?0:c;i=ae(i,.1,1e3),a=ae(a,.1,1e3),u=ae(u,.1,1e3),l=ae(l,.1,1e3);var h=Math.sqrt(a/i),f=u/(2*Math.sqrt(a*i)),d=1>f?h*Math.sqrt(1-f*f):0,p=1>f?(f*h-l)/d:-l+h,v=n?n*t/1e3:t;return v=1>f?Math.exp(-v*f*h)*(1*Math.cos(d*v)+p*Math.sin(d*v)):(1+p*v)*Math.exp(-v*h),0===t||1===t?t:1-v},rc=function(t,e){void 0===e&&(e=[]);var n=e[0],r=void 0===n?10:n;return("start"==e[1]?Math.ceil:Math.floor)(ae(t,0,1)*r)/r},ic=function(t,e){void 0===e&&(e=[]);return Wu(e[0],e[1],e[2],e[3])(t)},oc=Wu(.42,0,1,1),ac=function(t){return function(e,n,r){return void 0===n&&(n=[]),1-t(1-e,n,r)}},sc=function(t){return function(e,n,r){return void 0===n&&(n=[]),.5>e?t(2*e,n,r)/2:1-t(-2*e+2,n,r)/2}},uc=function(t){return function(e,n,r){return void 0===n&&(n=[]),.5>e?(1-t(1-2*e,n,r))/2:(t(2*e-1,n,r)+1)/2}},cc={steps:rc,"step-start":function(t){return rc(t,[1,"start"])},"step-end":function(t){return rc(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":ic,ease:function(t){return ic(t,[.25,.1,.25,1])},in:oc,out:ac(oc),"in-out":sc(oc),"out-in":uc(oc),"in-quad":Yu,"out-quad":ac(Yu),"in-out-quad":sc(Yu),"out-in-quad":uc(Yu),"in-cubic":Xu,"out-cubic":ac(Xu),"in-out-cubic":sc(Xu),"out-in-cubic":uc(Xu),"in-quart":qu,"out-quart":ac(qu),"in-out-quart":sc(qu),"out-in-quart":uc(qu),"in-quint":Ku,"out-quint":ac(Ku),"in-out-quint":sc(Ku),"out-in-quint":uc(Ku),"in-expo":Zu,"out-expo":ac(Zu),"in-out-expo":sc(Zu),"out-in-expo":uc(Zu),"in-sine":Qu,"out-sine":ac(Qu),"in-out-sine":sc(Qu),"out-in-sine":uc(Qu),"in-circ":$u,"out-circ":ac($u),"in-out-circ":sc($u),"out-in-circ":uc($u),"in-back":Ju,"out-back":ac(Ju),"in-out-back":sc(Ju),"out-in-back":uc(Ju),"in-bounce":tc,"out-bounce":ac(tc),"in-out-bounce":sc(tc),"out-in-bounce":uc(tc),"in-elastic":ec,"out-elastic":ac(ec),"in-out-elastic":sc(ec),"out-in-elastic":uc(ec),spring:nc,"spring-in":nc,"spring-out":ac(nc),"spring-in-out":sc(nc),"spring-out-in":uc(nc)},lc=function(t){return t};function hc(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var fc="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",dc=RegExp("cubic-bezier\\("+fc+","+fc+","+fc+","+fc+"\\)"),pc=/steps\(\s*(\d+)\s*\)/,vc=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function mc(t){var e=dc.exec(t);if(e)return Wu.apply(void 0,e.slice(1).map(Number));var n=pc.exec(t);if(n)return hc(Number(n[1]),0);var r=vc.exec(t);return r?hc(Number(r[1]),{start:1,middle:.5,end:0}[r[2]]):cc[function(t){return function(t){return"-"===(t=t.replace(/([A-Z])/g,(function(t){return"-"+t.toLowerCase()}))).charAt(0)?t.substring(1):t}(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()}(t)]||cc.linear}function yc(t){return Math.abs(function(t){var e;if(0===t.duration||0===t.iterations)return 0;return("auto"===t.duration?0:Number(t.duration))*(null!==(e=t.iterations)&&void 0!==e?e:1)}(t)/(t.playbackRate||1))}function gc(t,e,n){var r=function(t,e,n){if(null===e)return 0;var r=n.endTime;return Math.min(n.delay,r)>e?1:Math.min(n.delay+t+n.endDelay,r)>e?3:2}(t,e,n),i=function(t,e,n,r,i){switch(r){case 1:return"backwards"===e||"both"===e?0:null;case 3:return n-i;case 2:return"forwards"===e||"both"===e?t:null;case 0:return null}}(t,n.fill,e,r,n.delay);if(null===i)return null;var o="auto"===n.duration?0:n.duration,a=function(t,e,n,r,i){var o=i;return 0===t?1!==e&&(o+=n):o+=r/t,o}(o,r,n.iterations,i,n.iterationStart),s=function(t,e,n,r,i,o){var a=t===1/0?e%1:t%1;return 0!==a||2!==n||0===r||0===i&&0!==o||(a=1),a}(a,n.iterationStart,r,n.iterations,i,o),u=function(t,e,n,r){return 2===t&&e===1/0?1/0:1===n?Math.floor(r)-1:Math.floor(r)}(r,n.iterations,s,a),c=function(t,e,n){var r=t;if("normal"!==t&&"reverse"!==t){var i=e;"alternate-reverse"===t&&(i+=1),r="normal",i!==1/0&&i%2!=0&&(r="reverse")}return"normal"===r?n:1-n}(n.direction,u,s);return n.currentIteration=u,n.progress=c,n.easingFunction(c)}function xc(t,e,n){var r=function(t,e){for(var n={},r=0;t.length>r;r++)for(var i in t[r])if(Ec(i)){var o={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:mc(t[r].easing)||e.easingFunction,value:t[r][i]};n[i]=n[i]||[],n[i].push(o)}return n}(t,e),i=function(t,e){var n=[];for(var r in t)for(var i=t[r],o=0;i.length-1>o;o++){var a=o,s=o+1,u=i[a].computedOffset,c=i[s].computedOffset,l=u,h=c;0===o&&(l=-1/0,0===c&&(s=a)),o===i.length-2&&(h=1/0,1===u&&(a=s)),n.push({applyFrom:l,applyTo:h,startOffset:i[a].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[a].easingFunction,property:r,interpolation:Tc(r,i[a].value,i[s].value,e)})}return n.sort((function(t,e){return t.startOffset-e.startOffset})),n}(r,n);return function(t,e){if(null!==e)i.filter((function(t){return e>=t.applyFrom&&t.applyTo>e})).forEach((function(n){var r=n.endOffset-n.startOffset,i=0===r?0:n.easingFunction((e-n.startOffset)/r);t.setAttribute(n.property,n.interpolation(i))}));else for(var n in r)Ec(n)&&t.setAttribute(n,null)}}function Ec(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var bc=function(t,e,n){return function(r){var i=Sc(t,e,r);return!Ls.enableCSSParsing&&se(i)?i:n(i)}};function Tc(t,e,n,r){var i=ns[t];if(i&&i.syntax&&i.int){var o=Ls.styleValueRegistry.getPropertySyntax(i.syntax);if(o){var a,s;if(Ls.enableCSSParsing){var u=Ls.styleValueRegistry.parseProperty(t,e,r),c=Ls.styleValueRegistry.parseProperty(t,n,r);a=Ls.styleValueRegistry.computeProperty(t,u,r),s=Ls.styleValueRegistry.computeProperty(t,c,r)}else{var l=o.parserWithCSSDisabled;a=l?l(e,r):e,s=l?l(n,r):n}var h=o.mixer(a,s,r);if(h){var f=bc.apply(void 0,h);return function(t){return 0===t?e:1===t?n:f(t)}}}}return bc(!1,!0,(function(t){return t?n:e}))}function Sc(t,e,n){if("number"==typeof t&&"number"==typeof e)return t*(1-n)+e*n;if("boolean"==typeof t&&"boolean"==typeof e||"string"==typeof t&&"string"==typeof e)return.5>n?t:e;if(Array.isArray(t)&&Array.isArray(e)){for(var r=t.length,i=e.length,o=Math.max(r,i),a=[],s=0;o>s;s++)a.push(Sc(t[r>s?s:r-1],e[i>s?s:i-1],n));return a}throw Error("Mismatched interpolation arguments "+t+":"+e)}var Pc=function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=lc,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.playbackRate=void 0,this.effect=void 0,this.composite=void 0,this.activeDuration=void 0,this.endTime=void 0,this.currentIteration=null,this.progress=null}return Ru(t,[{key:"easing",get:function(){return this._easing},set:function(t){this.easingFunction=mc(t),this._easing=t}}]),t}();function wc(t,e){if(null===t)return[];Array.isArray(t)||(t=function(t){var e=[];for(var n in t)if(!(n in["easing","offset","composite"])){var r=t[n];Array.isArray(r)||(r=[r]);for(var i=r.length,o=0;i>o;o++){if(!e[o]){var a={};"offset"in t&&(a.offset=Number(t.offset)),"easing"in t&&(a.easing=t.easing),"composite"in t&&(a.composite=t.composite),e[o]=a}null!=r[o]&&(e[o][n]=r[o])}}return e.sort((function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)})),e}(t));for(var n=t.map((function(t){var n={};for(var r in(null==e?void 0:e.composite)&&(n.composite="auto"),t){var i=t[r];if("offset"===r){if(null!==i){if(!isFinite(i=Number(i)))throw Error("Keyframe offsets must be numbers.");if(0>i||i>1)throw Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=i}}else if("composite"===r&&-1===["replace","add","accumulate","auto"].indexOf(i))throw Error(i+" compositing is not supported");n[r]=i}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==e?void 0:e.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n})),r=!0,i=-1/0,o=0;n.length>o;o++){var a=n[o].offset;if($t(a))r=!1;else{if(i>a)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=a}}return n=n.filter((function(t){return Number(t.offset)>=0&&1>=Number(t.offset)})),r||function(){var t,e,r=n.length;n[r-1].computedOffset=Number(null!==(t=n[r-1].offset)&&void 0!==t?t:1),r>1&&(n[0].computedOffset=Number(null!==(e=n[0].offset)&&void 0!==e?e:0));for(var i=0,o=Number(n[0].computedOffset),a=1;r>a;a++){var s=n[a].computedOffset;if(!$t(s)&&!$t(o)){for(var u=1;a-i>u;u++)n[i+u].computedOffset=o+(Number(s)-o)*u/(a-i);i=a,o=Number(s)}}}(),n}var Mc="backwards|forwards|both|none".split("|"),kc="reverse|alternate|alternate-reverse".split("|");function Nc(t,e){var n=new Pc;return e&&(n.fill="both",n.duration="auto"),"number"!=typeof t||isNaN(t)?void 0!==t&&Object.keys(t).forEach((function(e){if(null!=t[e]&&"auto"!==t[e]){if(("number"==typeof n[e]||"duration"===e)&&("number"!=typeof t[e]||isNaN(t[e])))return;if("fill"===e&&-1===Mc.indexOf(t[e]))return;if("direction"===e&&-1===kc.indexOf(t[e]))return;n[e]=t[e]}})):n.duration=t,n}function Cc(t,e){var n;return Nc(t=Ac(null!==(n=t)&&void 0!==n?n:{duration:"auto"}),e)}function Ac(t){return"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t}),t}var Oc=function(){function t(t,e,n){var r=this;this.composite="replace",this.iterationComposite="replace",this.target=void 0,this.animation=void 0,this.timing=void 0,this.computedTiming=void 0,this.normalizedKeyframes=void 0,this.timeFraction=void 0,this.interpolations=void 0,this.target=t,this.timing=Cc(n,!1),this.timing.effect=this,this.timing.activeDuration=yc(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=wc(e,this.timing),this.interpolations=xc(this.normalizedKeyframes,this.timing,this.target);var i=Ls.globalThis.Proxy;this.computedTiming=i?new i(this.timing,{get:function(t,e){return"duration"===e?"auto"===t.duration?0:t.duration:"fill"===e?"auto"===t.fill?"none":t.fill:"localTime"===e?r.animation&&r.animation.currentTime||null:"currentIteration"===e?r.animation&&"running"===r.animation.playState?t.currentIteration||0:null:"progress"===e?r.animation&&"running"===r.animation.playState?t.progress||0:null:t[e]},set:function(){return!0}}):this.timing}var e=t.prototype;return e.applyInterpolations=function(){this.interpolations(this.target,Number(this.timeFraction))},e.update=function(t){return null!==t&&(this.timeFraction=gc(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},e.getKeyframes=function(){return this.normalizedKeyframes},e.setKeyframes=function(t){this.normalizedKeyframes=wc(t)},e.getComputedTiming=function(){return this.computedTiming},e.getTiming=function(){return this.timing},e.updateTiming=function(t){var e=this;Object.keys(t||{}).forEach((function(n){e.timing[n]=t[n]}))},t}();function Lc(t,e){return Number(t.id)-Number(e.id)}var Rc=function(){function t(t){var e=this;this.document=void 0,this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.frameId=void 0,this.webAnimationsNextTick=function(t){e.currentTime=t,e.discardAnimations(),0===e.animations.length?e.timelineTicking=!1:e.requestAnimationFrame(e.webAnimationsNextTick)},this.processRafCallbacks=function(t){var n=e.rafCallbacks;e.rafCallbacks=[],Number(e.currentTime)>t&&(t=Number(e.currentTime)),e.animations.sort(Lc),e.animations=e.tick(t,!0,e.animations)[0],n.forEach((function(e){e[1](t)})),e.applyPendingEffects()},this.document=t}var e=t.prototype;return e.getAnimations=function(){return this.discardAnimations(),this.animations.slice()},e.isTicking=function(){return this.inTick},e.play=function(t,e,n){var r=new Oc(t,e,n),i=new Fu(r,this);return this.animations.push(i),this.restartWebAnimationsNextTick(),i.updatePromises(),i.play(),i.updatePromises(),i},e.applyDirtiedAnimation=function(t){var e=this;if(!this.inTick){t.markTarget();var n=t.targetAnimations();n.sort(Lc),this.tick(Number(this.currentTime),!1,n.slice())[1].forEach((function(t){var n=e.animations.indexOf(t);-1!==n&&e.animations.splice(n,1)})),this.applyPendingEffects()}},e.restart=function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame((function(){})),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame},e.destroy=function(){this.document.defaultView.cancelAnimationFrame(this.frameId)},e.applyPendingEffects=function(){this.pendingEffects.forEach((function(t){null==t||t.applyInterpolations()})),this.pendingEffects=[]},e.updateAnimationsPromises=function(){this.animationsWithPromises=this.animationsWithPromises.filter((function(t){return t.updatePromises()}))},e.discardAnimations=function(){this.updateAnimationsPromises(),this.animations=this.animations.filter((function(t){return"finished"!==t.playState&&"idle"!==t.playState}))},e.restartWebAnimationsNextTick=function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))},e.rAF=function(t){var e=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([e,t]),e},e.requestAnimationFrame=function(t){var e=this;return this.rAF((function(n){e.updateAnimationsPromises(),t(n),e.updateAnimationsPromises()}))},e.tick=function(t,e,n){var r,i,o=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var a=[],s=[],u=[],c=[];return n.forEach((function(n){n.tick(t,e),n._inEffect?(s.push(n.effect),n.markTarget()):(a.push(n.effect),n.unmarkTarget()),n._needsTick&&(o.ticking=!0);var r=n._inEffect||n._needsTick;n._inTimeline=r,r?u.push(n):c.push(n)})),(r=this.pendingEffects).push.apply(r,a),(i=this.pendingEffects).push.apply(i,s),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[u,c]},t}();Ls.EasingFunction=mc,Ls.AnimationTimeline=Rc,t.AABB=Bo,t.AbstractLayoutDefinition=du,t.AbstractRenderer=Ds,t.AbstractRendererPlugin=Is,t.AdvancedCamera=Qs,t.Animation=Fu,t.AnimationEvent=Iu,t.AnimationTimeline=Rc,t.BUILT_IN_PROPERTIES=ts,t.CSS=Vn,t.CSSGradientValue=Cn,t.CSSKeywordValue=An,t.CSSRGB=jn,t.CSSStyleValue=kn,t.CSSUnitValue=Bn,t.Camera=us,t.CameraEvent=as,t.Canvas=Ks,t.Circle=ka,t.CircleUpdater=cs,t.CustomElement=Ca,t.CustomElementRegistry=$o,t.CustomEvent=ea,t.DefaultLayoutRegistry=gu,t.DefaultSceneGraphSelector=Es,t.DefaultSceneGraphService=Ms,t.DisplayObject=wa,t.DisplayObjectPool=La,t.Document=aa,t.EMPTY_PARSED_PATH=Ha,t.ERROR_MSG_METHOD_NOT_IMPLEMENTED=ar,t.Element=fa,t.Ellipse=_a,t.EllipseUpdater=ls,t.EventService=ms,t.EventTarget=na,t.FederatedEvent=ta,t.FederatedMouseEvent=da,t.FederatedPointerEvent=pa,t.FederatedWheelEvent=va,t.FragmentResult=nu,t.Frustum=zo,t.Group=Da,t.HTML=Ga,t.Image=Ua,t.KeyframeEffect=Oc,t.LayoutChildren=lu,t.LayoutContext=fu,t.LayoutEdges=function(e){var n,r,i,o,a,s,u,c,l,h,f,d,p,v,m,y;this.options=void 0,this.inlineStart=void 0,this.inlineEnd=void 0,this.blockStart=void 0,this.blockEnd=void 0,this.inline=void 0,this.block=void 0,this.options=e;var g=e.node.getAllStyle(),x=null!==(n=null===(r=g.get(t.PropertyName.PADDING_TOP))||void 0===r?void 0:r.value)&&void 0!==n?n:0,E=null!==(i=null===(o=g.get(t.PropertyName.PADDING_END))||void 0===o?void 0:o.value)&&void 0!==i?i:0,b=null!==(a=null===(s=g.get(t.PropertyName.PADDING_BOTTOM))||void 0===s?void 0:s.value)&&void 0!==a?a:0,T=null!==(u=null===(c=g.get(t.PropertyName.PADDING_START))||void 0===c?void 0:c.value)&&void 0!==u?u:0,S=null!==(l=null===(h=g.get(t.PropertyName.PADDING_TOP))||void 0===h?void 0:h.value)&&void 0!==l?l:0,P=null!==(f=null===(d=g.get(t.PropertyName.PADDING_END))||void 0===d?void 0:d.value)&&void 0!==f?f:0,w=null!==(p=null===(v=g.get(t.PropertyName.PADDING_BOTTOM))||void 0===v?void 0:v.value)&&void 0!==p?p:0,M=null!==(m=null===(y=g.get(t.PropertyName.PADDING_START))||void 0===y?void 0:y.value)&&void 0!==m?m:0;this.blockStart=x+0+S,this.inlineStart=E+0+P,this.blockEnd=b+0+w,this.inlineEnd=T+0+M,this.block=this.blockStart+this.blockEnd,this.inline=this.inlineStart+this.inlineEnd},t.LayoutEngine=vu,t.LayoutFragment=function(t,e){this._layoutContext=void 0,this.options=void 0,this.layoutContext=void 0,this.inlineSize=void 0,this.blockSize=void 0,this.inlineOffset=void 0,this.blockOffset=void 0,this.data=void 0,this._layoutContext=t,this.options=e,this.layoutContext=t,this.inlineSize=e.inlineSize,this.blockSize=e.blockSize,this.inlineOffset=0,this.blockOffset=0,this.data=e.data},t.LayoutObject=yu,t.Line=ja,t.LineUpdater=hs,t.MutationEvent=sa,t.MutationObserver=Mu,t.MutationRecord=Tu,t.Node=ra,t.OffscreenCanvasCreator=ys,t.Path=Wa,t.PathUpdater=fs,t.Plane=Uo,t.Point=jo,t.Polygon=Xa,t.Polyline=Ka,t.PolylineUpdater=ds,t.RBush=n,t.Rect=Qa,t.RectUpdater=ps,t.Rectangle=Vo,t.Registration=wu,t.RenderingService=gs,t.Text=Ja,t.TextService=Os,t.TextUpdater=vs,t.compareAnimations=Lc,t.computeLinearGradient=function(t,e,n){var r=vr(n.value),i=0+t/2,o=0+e/2,a=Math.abs(t*Math.cos(r))+Math.abs(e*Math.sin(r));return{x1:i-Math.cos(r)*a/2,y1:o-Math.sin(r)*a/2,x2:i+Math.cos(r)*a/2,y2:o+Math.sin(r)*a/2}},t.computeRadialGradient=function(e,n,r,i,o){var a=r.value,s=i.value;r.unit===t.UnitType.kPercentage&&(a=r.value/100*e),i.unit===t.UnitType.kPercentage&&(s=i.value/100*n);var u=Math.max(Dt([0,0],[a,s]),Dt([0,n],[a,s]),Dt([e,n],[a,s]),Dt([e,0],[a,s]));return o&&(o instanceof Bn?u=o.value:o instanceof An&&("closest-side"===o.value?u=Math.min(a,e-a,s,n-s):"farthest-side"===o.value?u=Math.max(a,e-a,s,n-s):"closest-corner"===o.value&&(u=Math.min(Dt([0,0],[a,s]),Dt([0,n],[a,s]),Dt([e,n],[a,s]),Dt([e,0],[a,s]))))),{x:a,y:s,r:u}},t.convertToPath=function(e,n){void 0===n&&(n=e.getLocalTransform());var r=[];switch(e.nodeName){case t.Shape.LINE:var i=e.parsedStyle;r=function(t,e,n,r){return[["M",t,e],["L",n,r]]}(i.x1,i.y1,i.x2,i.y2);break;case t.Shape.CIRCLE:var o=e.parsedStyle,a=o.r;r=Vr(a,a,o.cx,o.cy);break;case t.Shape.ELLIPSE:var s=e.parsedStyle;r=Vr(s.rx,s.ry,s.cx,s.cy);break;case t.Shape.POLYLINE:case t.Shape.POLYGON:r=function(t,e){var n=t.map((function(t,e){return[0===e?"M":"L",t[0],t[1]]}));return e&&n.push(["Z"]),n}(e.parsedStyle.points.points,e.nodeName===t.Shape.POLYGON);break;case t.Shape.RECT:var u=e.parsedStyle,c=u.width,l=u.height,h=u.x,f=u.y,d=u.radius,p=d&&d.some((function(t){return 0!==t}));r=function(t,e,n,r,i){if(i){var o=i[0],a=i[1],s=i[2],u=i[3],c=t>0?1:-1,l=e>0?1:-1,h=c+l!==0?1:0;return[["M",c*o+n,r],["L",t-c*a+n,r],a?["A",a,a,0,0,h,t+n,l*a+r]:null,["L",t+n,e-l*s+r],s?["A",s,s,0,0,h,t+n-c*s,e+r]:null,["L",n+c*u,e+r],u?["A",u,u,0,0,h,n,e+r-l*u]:null,["L",n,l*o+r],o?["A",o,o,0,0,h,c*o+n,r]:null,["Z"]].filter((function(t){return t}))}return[["M",n,r],["L",n+t,r],["L",n+t,r+e],["L",n,r+e],["Z"]]}(c,l,h,f,p&&d.map((function(t){return ae(t,0,Math.min(Math.abs(c)/2,Math.abs(l)/2))})));break;case t.Shape.PATH:r=[].concat(e.parsedStyle.path.absolutePath)}if(r.length)return function(t,e,n){var r=e.parsedStyle,i=r.defX,o=void 0===i?0:i,a=r.defY,s=void 0===a?0:a;return t.reduce((function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=I(e[1]-o,e[2]-s,0);n&&W(i,i,n),r=""+e[0]+i[0]+","+i[1]}else if("Z"===e[0])r=e[0];else if("C"===e[0]){var a=I(e[1]-o,e[2]-s,0),u=I(e[3]-o,e[4]-s,0),c=I(e[5]-o,e[6]-s,0);n&&(W(a,a,n),W(u,u,n),W(c,c,n)),r=""+e[0]+a[0]+","+a[1]+","+u[0]+","+u[1]+","+c[0]+","+c[1]}else if("A"===e[0]){var l=I(e[6]-o,e[7]-s,0);n&&W(l,l,n),r=""+e[0]+e[1]+","+e[2]+","+e[3]+","+e[4]+","+e[5]+","+l[0]+","+l[1]}else if("Q"===e[0]){var h=I(e[1]-o,e[2]-s,0),f=I(e[3]-o,e[4]-s,0);n&&(W(h,h,n),W(f,f,n)),r=""+e[0]+e[1]+","+e[2]+","+e[3]+","+e[4]+"}"}return t+r}),"")}(r,e,n)},t.createVec3=pr,t.decompose=Er,t.definedProps=function(t){return Object.fromEntries(Object.entries(t).filter((function(t){return void 0!==t[1]})))},t.deg2rad=vr,t.deg2turn=function(t){return t/360},t.findClosestClipPathTarget=ir,t.fromRotationTranslationScale=xr,t.getAngle=dr,t.getEuler=gr,t.getOrCalculatePathTotalLength=Lr,t.grad2deg=function(t){return 0>(t%=400)&&(t+=400),t/400*360},t.isBrowser=nr,t.isCSSGradientValue=function(t){return!!t.type&&!!t.value},t.isCSSRGB=Fi,t.isCanvas=function(t){return!!t.document},t.isDisplayObject=ma,t.isFederatedEvent=Jo,t.isFillOrStrokeAffected=function(t,e,n){var r=!1,i=!1;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=!!e&&!e.isNone,i=!!n&&!n.isNone):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(r=!0,i=!0),[r,i]},t.isPattern=Di,t.layoutEngine=bu,t.makeTiming=Nc,t.mergeColors=Bi,t.normalizeKeyframes=wc,t.normalizeTimingInput=Cc,t.numericTimingToObject=Ac,t.parseColor=Gi,t.parseLength=zi,t.parsePath=io,t.parseTransform=fo,t.parsedTransformToMat4=Nr,t.propertyMetadataCache=ns,t.rad2deg=mr,t.resetEntityCounter=function(){ua=0},t.runtime=Ls,t.setDOMSize=function(t,e,n){nr&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")},t.translatePathToString=function(t,e,n,r,i,o,a){void 0===r&&(r=0),void 0===i&&(i=0),void 0===o&&(o=0),void 0===a&&(a=0);var s=t.map((function(s,u){var c=t[u+1],l=0===u&&(0!==r||0!==i),h=(u===t.length-1||c&&("M"===c[0]||"Z"===c[0]))&&0!==o&&0!==a;switch(s[0]){case"M":return l?"M "+(s[1]-e+r)+","+(s[2]-n+i)+" L "+(s[1]-e)+","+(s[2]-n):"M "+(s[1]-e)+","+(s[2]-n);case"L":return"L "+(s[1]-e+(h?o:0))+","+(s[2]-n+(h?a:0));case"Q":return"Q "+(s[1]-e)+" "+(s[2]-n)+","+(s[3]-e)+" "+(s[4]-n)+(h?" L "+(s[3]-e+o)+","+(s[4]-n+a):"");case"C":return"C "+(s[1]-e)+" "+(s[2]-n)+","+(s[3]-e)+" "+(s[4]-n)+","+(s[5]-e)+" "+(s[6]-n)+(h?" L "+(s[5]-e+o)+","+(s[6]-n+a):"");case"A":return"A "+s[1]+" "+s[2]+" "+s[3]+" "+s[4]+" "+s[5]+" "+(s[6]-e)+" "+(s[7]-n)+(h?" L "+(s[6]-e+o)+","+(s[7]-n+a):"");case"Z":return"Z"}})).join(" ");return~s.indexOf("NaN")?"":s},t.turn2deg=yr,Object.defineProperty(t,"__esModule",{value:!0})}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G={})}(this,(function(t){"use strict";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function e(t,e,n){return t(n={path:e,exports:{},require:function(t,e){return function(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},n.exports),n.exports}var n=e((function(t,e){t.exports=function(){function t(t,n,i,o,a){e(t,n,i||0,o||t.length-1,a||r)}function e(t,r,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=r-i+1,c=Math.log(s),l=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*l*(s-l)/s)*(0>u-s/2?-1:1);e(t,r,Math.max(i,Math.floor(r-u*l/s+h)),Math.min(o,Math.floor(r+(s-u)*l/s+h)),a)}var f=t[r],d=i,p=o;for(n(t,i,r),a(t[o],f)>0&&n(t,i,o);p>d;){for(n(t,d,p),d++,p--;0>a(t[d],f);)d++;for(;a(t[p],f)>0;)p--}0===a(t[i],f)?n(t,i,p):n(t,++p,o),p>r||(i=p+1),r>p||(o=p-1)}}function n(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function r(t,e){return e>t?-1:t>e?1:0}var i=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(t,e,n){if(!n)return e.indexOf(t);for(var r=0;e.length>r;r++)if(n(t,e[r]))return r;return-1}function a(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,r,i){i||(i=y(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=e;n>o;o++){var a=t.children[o];u(i,t.leaf?r(a):a)}return i}function u(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function c(t,e){return t.minX-e.minX}function l(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 p(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function v(t,e){return!(t.minX>e.minX||t.minY>e.minY||e.maxX>t.maxX||e.maxY>t.maxY)}function m(t,e){return!(e.minX>t.maxX||e.minY>t.maxY||t.minX>e.maxX||t.minY>e.maxY)}function y(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(e,n,r,i,o){for(var a=[n,r];a.length;)if((r=a.pop())-(n=a.pop())>i){var s=n+Math.ceil((r-n)/i/2)*i;t(e,s,n,r,o),a.push(n,s,s,r)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,n=[];if(!m(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;e.children.length>o;o++){var a=e.children[o],s=e.leaf?r(a):a;m(t,s)&&(e.leaf?n.push(a):v(t,s)?this._all(a,n):i.push(a))}e=i.pop()}return n},i.prototype.collides=function(t){var e=this.data;if(!m(t,e))return!1;for(var n=[];e;){for(var r=0;e.children.length>r;r++){var i=e.children[r],o=e.leaf?this.toBBox(i):i;if(m(t,o)){if(e.leaf||v(t,o))return!0;n.push(i)}}e=n.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(this._minEntries>t.length){for(var e=0;t.length>e;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(n.height>this.data.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=y([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,r,i,a=this.data,s=this.toBBox(t),u=[],c=[];a||u.length;){if(a||(a=u.pop(),r=u[u.length-1],n=c.pop(),i=!0),a.leaf){var l=o(t,a.children,e);if(-1!==l)return a.children.splice(l,1),u.push(a),this._condense(u),this}i||a.leaf||!v(a,s)?r?(n++,a=r.children[n],i=!1):a=null:(u.push(a),c.push(n),n=0,r=a,a=a.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},i.prototype._build=function(t,e,n,r){var i,o=n-e+1,s=this._maxEntries;if(s>=o)return a(i=y(t.slice(e,n+1)),this.toBBox),i;r||(s=Math.ceil(o/Math.pow(s,(r=Math.ceil(Math.log(o)/Math.log(s)))-1))),(i=y([])).leaf=!1,i.height=r;var u=Math.ceil(o/s),c=u*Math.ceil(Math.sqrt(s));g(t,e,n,c,this.compareMinX);for(var l=e;n>=l;l+=c){var h=Math.min(l+c-1,n);g(t,l,h,u,this.compareMinY);for(var f=l;h>=f;f+=u)i.children.push(this._build(t,f,Math.min(f+u-1,h),r-1))}return a(i,this.toBBox),i},i.prototype._chooseSubtree=function(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){for(var i=1/0,o=1/0,a=void 0,s=0;e.children.length>s;s++){var u=e.children[s],c=h(u),l=d(t,u)-c;o>l?(o=l,i=i>c?c:i,a=u):l===o&&i>c&&(i=c,a=u)}e=a||e.children[0]}return e},i.prototype._insert=function(t,e,n){var r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),u(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)},i.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=y(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,a(n,this.toBBox),a(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},i.prototype._splitRoot=function(t,e){this.data=y([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,n){for(var r,i=1/0,o=1/0,a=e;n-e>=a;a++){var u=s(t,0,a,this.toBBox),c=s(t,a,n,this.toBBox),l=p(u,c),f=h(u)+h(c);i>l?(i=l,r=a,o=o>f?f:o):l===i&&o>f&&(o=f,r=a)}return r||n-e},i.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:c,i=t.leaf?this.compareMinY:l,o=this._allDistMargin(t,e,n,r);this._allDistMargin(t,e,n,i)>o&&t.children.sort(r)},i.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,o=s(t,0,e,i),a=s(t,n-e,n,i),c=f(o)+f(a),l=e;n-e>l;l++){var h=t.children[l];u(o,t.leaf?i(h):h),c+=f(o)}for(var d=n-e-1;d>=e;d--){var p=t.children[d];u(a,t.leaf?i(p):p),c+=f(a)}return c},i.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)u(e[r],t)},i.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():a(t[e],this.toBBox)},i}()})),r=1e-6,i="undefined"!=typeof Float32Array?Float32Array:Array;function o(){var t=new i(9);return i!=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 a(){var t=new i(16);return i!=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 s(t){var e=new i(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 u(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 c(t,e,n,r,i,o,a,s,u,c,l,h,f,d,p,v,m){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=c,t[9]=l,t[10]=h,t[11]=f,t[12]=d,t[13]=p,t[14]=v,t[15]=m,t}function l(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 h(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function f(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],f=e[10],d=e[11],p=e[12],v=e[13],m=e[14],y=e[15],g=n*s-r*a,x=n*u-i*a,E=n*c-o*a,b=r*u-i*s,T=r*c-o*s,S=i*c-o*u,P=l*v-h*p,M=l*m-f*p,w=l*y-d*p,k=h*m-f*v,N=h*y-d*v,C=f*y-d*m,A=g*C-x*N+E*k+b*w-T*M+S*P;return A?(t[0]=(s*C-u*N+c*k)*(A=1/A),t[1]=(i*N-r*C-o*k)*A,t[2]=(v*S-m*T+y*b)*A,t[3]=(f*T-h*S-d*b)*A,t[4]=(u*w-a*C-c*M)*A,t[5]=(n*C-i*w+o*M)*A,t[6]=(m*E-p*S-y*x)*A,t[7]=(l*S-f*E+d*x)*A,t[8]=(a*N-s*w+c*P)*A,t[9]=(r*w-n*N-o*P)*A,t[10]=(p*T-v*E+y*g)*A,t[11]=(h*E-l*T-d*g)*A,t[12]=(s*M-a*k-u*P)*A,t[13]=(n*k-r*M+i*P)*A,t[14]=(v*x-p*b-m*g)*A,t[15]=(l*b-h*x+f*g)*A,t):null}function d(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],h=t[10],f=t[11],d=t[12],p=t[13],v=t[14],m=t[15];return(e*a-n*o)*(h*m-f*v)-(e*s-r*o)*(l*m-f*p)+(e*u-i*o)*(l*v-h*p)+(n*s-r*a)*(c*m-f*d)-(n*u-i*a)*(c*v-h*d)+(r*u-i*s)*(c*p-l*d)}function p(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=e[9],d=e[10],p=e[11],v=e[12],m=e[13],y=e[14],g=e[15],x=n[0],E=n[1],b=n[2],T=n[3];return t[0]=x*r+E*s+b*h+T*v,t[1]=x*i+E*u+b*f+T*m,t[2]=x*o+E*c+b*d+T*y,t[3]=x*a+E*l+b*p+T*g,t[4]=(x=n[4])*r+(E=n[5])*s+(b=n[6])*h+(T=n[7])*v,t[5]=x*i+E*u+b*f+T*m,t[6]=x*o+E*c+b*d+T*y,t[7]=x*a+E*l+b*p+T*g,t[8]=(x=n[8])*r+(E=n[9])*s+(b=n[10])*h+(T=n[11])*v,t[9]=x*i+E*u+b*f+T*m,t[10]=x*o+E*c+b*d+T*y,t[11]=x*a+E*l+b*p+T*g,t[12]=(x=n[12])*r+(E=n[13])*s+(b=n[14])*h+(T=n[15])*v,t[13]=x*i+E*u+b*f+T*m,t[14]=x*o+E*c+b*d+T*y,t[15]=x*a+E*l+b*p+T*g,t}function v(t,e,n){var r,i,o,a,s,u,c,l,h,f,d,p,v=n[0],m=n[1],y=n[2];return e===t?(t[12]=e[0]*v+e[4]*m+e[8]*y+e[12],t[13]=e[1]*v+e[5]*m+e[9]*y+e[13],t[14]=e[2]*v+e[6]*m+e[10]*y+e[14],t[15]=e[3]*v+e[7]*m+e[11]*y+e[15]):(i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=e[9],d=e[10],p=e[11],t[0]=r=e[0],t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=c,t[7]=l,t[8]=h,t[9]=f,t[10]=d,t[11]=p,t[12]=r*v+s*m+h*y+e[12],t[13]=i*v+u*m+f*y+e[13],t[14]=o*v+c*m+d*y+e[14],t[15]=a*v+l*m+p*y+e[15]),t}function m(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function y(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=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]=o*i+c*r,t[5]=a*i+l*r,t[6]=s*i+h*r,t[7]=u*i+f*r,t[8]=c*i-o*r,t[9]=l*i-a*r,t[10]=h*i-s*r,t[11]=f*i-u*r,t}function g(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],c=e[8],l=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]=o*i-c*r,t[1]=a*i-l*r,t[2]=s*i-h*r,t[3]=u*i-f*r,t[8]=o*r+c*i,t[9]=a*r+l*i,t[10]=s*r+h*i,t[11]=u*r+f*i,t}function x(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 E(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=r+r,u=i+i,c=o+o,l=r*s,h=r*u,f=r*c,d=i*u,p=i*c,v=o*c,m=a*s,y=a*u,g=a*c;return t[0]=1-(d+v),t[1]=h+g,t[2]=f-y,t[3]=0,t[4]=h-g,t[5]=1-(l+v),t[6]=p+m,t[7]=0,t[8]=f+y,t[9]=p-m,t[10]=1-(l+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function b(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function T(t,e){var n=e[4],r=e[5],i=e[6],o=e[8],a=e[9],s=e[10];return t[0]=Math.hypot(e[0],e[1],e[2]),t[1]=Math.hypot(n,r,i),t[2]=Math.hypot(o,a,s),t}function S(t,e){var n=new i(3);T(n,e);var r=1/n[0],o=1/n[1],a=1/n[2],s=e[0]*r,u=e[1]*o,c=e[2]*a,l=e[4]*r,h=e[5]*o,f=e[6]*a,d=e[8]*r,p=e[9]*o,v=e[10]*a,m=s+h+v,y=0;return m>0?(t[3]=.25*(y=2*Math.sqrt(m+1)),t[0]=(f-p)/y,t[1]=(d-c)/y,t[2]=(u-l)/y):s>h&&s>v?(t[3]=(f-p)/(y=2*Math.sqrt(1+s-h-v)),t[0]=.25*y,t[1]=(u+l)/y,t[2]=(d+c)/y):h>v?(t[3]=(d-c)/(y=2*Math.sqrt(1+h-s-v)),t[0]=(u+l)/y,t[1]=.25*y,t[2]=(f+p)/y):(t[3]=(u-l)/(y=2*Math.sqrt(1+v-s-h)),t[0]=(d+c)/y,t[1]=(f+p)/y,t[2]=.25*y),t}function P(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],u=e[3],c=o+o,l=a+a,h=s+s,f=o*c,d=o*l,p=o*h,v=a*l,m=a*h,y=s*h,g=u*c,x=u*l,E=u*h,b=r[0],T=r[1],S=r[2],P=i[0],M=i[1],w=i[2],k=(1-(v+y))*b,N=(d+E)*b,C=(p-x)*b,A=(d-E)*T,O=(1-(f+y))*T,L=(m+g)*T,R=(p+x)*S,_=(m-g)*S,I=(1-(f+v))*S;return t[0]=k,t[1]=N,t[2]=C,t[3]=0,t[4]=A,t[5]=O,t[6]=L,t[7]=0,t[8]=R,t[9]=_,t[10]=I,t[11]=0,t[12]=n[0]+P-(k*P+A*M+R*w),t[13]=n[1]+M-(N*P+O*M+_*w),t[14]=n[2]+w-(C*P+L*M+I*w),t[15]=1,t}function M(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,c=n*a,l=r*a,h=r*s,f=i*a,d=i*s,p=i*u,v=o*a,m=o*s,y=o*u;return t[0]=1-h-p,t[1]=l+y,t[2]=f-m,t[3]=0,t[4]=l-y,t[5]=1-c-p,t[6]=d+v,t[7]=0,t[8]=f+m,t[9]=d-v,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function w(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=(i+r)*(o=1/(r-i)),t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t}function k(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=(a+o)*c,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 N=k;function C(t,e,n,i){var o,a,s,u,c,h,f,d,p,v,m=e[0],y=e[1],g=e[2],x=i[0],E=i[1],b=i[2],T=n[0],S=n[1],P=n[2];return r>Math.abs(m-T)&&r>Math.abs(y-S)&&r>Math.abs(g-P)?l(t):(v=1/Math.hypot(f=m-T,d=y-S,p=g-P),(v=Math.hypot(o=E*(p*=v)-b*(d*=v),a=b*(f*=v)-x*p,s=x*d-E*f))?(o*=v=1/v,a*=v,s*=v):(o=0,a=0,s=0),(v=Math.hypot(u=d*s-p*a,c=p*o-f*s,h=f*a-d*o))?(u*=v=1/v,c*=v,h*=v):(u=0,c=0,h=0),t[0]=o,t[1]=u,t[2]=f,t[3]=0,t[4]=a,t[5]=c,t[6]=d,t[7]=0,t[8]=s,t[9]=h,t[10]=p,t[11]=0,t[12]=-(o*m+a*y+s*g),t[13]=-(u*m+c*y+h*g),t[14]=-(f*m+d*y+p*g),t[15]=1,t)}function A(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 O=Object.freeze({__proto__:null,create:a,clone:s,copy:u,fromValues:function(t,e,n,r,o,a,s,u,c,l,h,f,d,p,v,m){var y=new i(16);return y[0]=t,y[1]=e,y[2]=n,y[3]=r,y[4]=o,y[5]=a,y[6]=s,y[7]=u,y[8]=c,y[9]=l,y[10]=h,y[11]=f,y[12]=d,y[13]=p,y[14]=v,y[15]=m,y},set:c,identity:l,transpose:h,invert:f,adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],f=e[10],d=e[11],p=e[12],v=e[13],m=e[14],y=e[15];return t[0]=s*(f*y-d*m)-h*(u*y-c*m)+v*(u*d-c*f),t[1]=-(r*(f*y-d*m)-h*(i*y-o*m)+v*(i*d-o*f)),t[2]=r*(u*y-c*m)-s*(i*y-o*m)+v*(i*c-o*u),t[3]=-(r*(u*d-c*f)-s*(i*d-o*f)+h*(i*c-o*u)),t[4]=-(a*(f*y-d*m)-l*(u*y-c*m)+p*(u*d-c*f)),t[5]=n*(f*y-d*m)-l*(i*y-o*m)+p*(i*d-o*f),t[6]=-(n*(u*y-c*m)-a*(i*y-o*m)+p*(i*c-o*u)),t[7]=n*(u*d-c*f)-a*(i*d-o*f)+l*(i*c-o*u),t[8]=a*(h*y-d*v)-l*(s*y-c*v)+p*(s*d-c*h),t[9]=-(n*(h*y-d*v)-l*(r*y-o*v)+p*(r*d-o*h)),t[10]=n*(s*y-c*v)-a*(r*y-o*v)+p*(r*c-o*s),t[11]=-(n*(s*d-c*h)-a*(r*d-o*h)+l*(r*c-o*s)),t[12]=-(a*(h*m-f*v)-l*(s*m-u*v)+p*(s*f-u*h)),t[13]=n*(h*m-f*v)-l*(r*m-i*v)+p*(r*f-i*h),t[14]=-(n*(s*m-u*v)-a*(r*m-i*v)+p*(r*u-i*s)),t[15]=n*(s*f-u*h)-a*(r*f-i*h)+l*(r*u-i*s),t},determinant:d,multiply:p,translate:v,scale:m,rotate:function(t,e,n,i){var o,a,s,u,c,l,h,f,d,p,v,m,y,g,x,E,b,T,S,P,M,w,k,N,C=i[0],A=i[1],O=i[2],L=Math.hypot(C,A,O);return r>L?null:(C*=L=1/L,A*=L,O*=L,o=Math.sin(n),c=e[1],l=e[2],h=e[3],d=e[5],p=e[6],v=e[7],y=e[9],g=e[10],x=e[11],S=C*A*(s=1-(a=Math.cos(n)))-O*o,P=A*A*s+a,M=O*A*s+C*o,w=C*O*s+A*o,k=A*O*s-C*o,N=O*O*s+a,t[0]=(u=e[0])*(E=C*C*s+a)+(f=e[4])*(b=A*C*s+O*o)+(m=e[8])*(T=O*C*s-A*o),t[1]=c*E+d*b+y*T,t[2]=l*E+p*b+g*T,t[3]=h*E+v*b+x*T,t[4]=u*S+f*P+m*M,t[5]=c*S+d*P+y*M,t[6]=l*S+p*P+g*M,t[7]=h*S+v*P+x*M,t[8]=u*w+f*k+m*N,t[9]=c*w+d*k+y*N,t[10]=l*w+p*k+g*N,t[11]=h*w+v*k+x*N,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:y,rotateY:g,rotateZ:function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],c=e[4],l=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]=o*i+c*r,t[1]=a*i+l*r,t[2]=s*i+h*r,t[3]=u*i+f*r,t[4]=c*i-o*r,t[5]=l*i-a*r,t[6]=h*i-s*r,t[7]=f*i-u*r,t},fromTranslation:x,fromScaling:function(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},fromRotation:function(t,e,n){var i,o,a,s=n[0],u=n[1],c=n[2],l=Math.hypot(s,u,c);return r>l?null:(s*=l=1/l,u*=l,c*=l,i=Math.sin(e),t[0]=s*s*(a=1-(o=Math.cos(e)))+o,t[1]=u*s*a+c*i,t[2]=c*s*a-u*i,t[3]=0,t[4]=s*u*a-c*i,t[5]=u*u*a+o,t[6]=c*u*a+s*i,t[7]=0,t[8]=s*c*a+u*i,t[9]=u*c*a-s*i,t[10]=c*c*a+o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},fromXRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromYRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromZRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromRotationTranslation:E,fromQuat2:function(t,e){var n=new i(3),r=-e[0],o=-e[1],a=-e[2],s=e[3],u=e[4],c=e[5],l=e[6],h=e[7],f=r*r+o*o+a*a+s*s;return f>0?(n[0]=2*(u*s+h*r+c*a-l*o)/f,n[1]=2*(c*s+h*o+l*r-u*a)/f,n[2]=2*(l*s+h*a+u*o-c*r)/f):(n[0]=2*(u*s+h*r+c*a-l*o),n[1]=2*(c*s+h*o+l*r-u*a),n[2]=2*(l*s+h*a+u*o-c*r)),E(t,e,n),t},getTranslation:b,getScaling:T,getRotation:S,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],u=i+i,c=o+o,l=a+a,h=i*u,f=i*c,d=i*l,p=o*c,v=o*l,m=a*l,y=s*u,g=s*c,x=s*l,E=r[0],b=r[1],T=r[2];return t[0]=(1-(p+m))*E,t[1]=(f+x)*E,t[2]=(d-g)*E,t[3]=0,t[4]=(f-x)*b,t[5]=(1-(h+m))*b,t[6]=(v+y)*b,t[7]=0,t[8]=(d+g)*T,t[9]=(v-y)*T,t[10]=(1-(h+p))*T,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:P,fromQuat:M,frustum:function(t,e,n,r,i,o,a){var s=1/(n-e),u=1/(i-r),c=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*u,t[10]=(a+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*c,t[15]=0,t},perspectiveNO:w,perspective:w,perspectiveZO:function(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=i*(o=1/(r-i)),t[14]=i*r*o):(t[10]=-1,t[14]=-r),t},perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+s),c=2/(i+o);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(a-s)*u*.5,t[9]=(i-o)*c*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},orthoNO:k,ortho:N,orthoZO:function(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=o*c,t[15]=1,t},lookAt:C,targetTo:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=r[0],u=r[1],c=r[2],l=i-n[0],h=o-n[1],f=a-n[2],d=l*l+h*h+f*f;d>0&&(l*=d=1/Math.sqrt(d),h*=d,f*=d);var p=u*f-c*h,v=c*l-s*f,m=s*h-u*l;return(d=p*p+v*v+m*m)>0&&(p*=d=1/Math.sqrt(d),v*=d,m*=d),t[0]=p,t[1]=v,t[2]=m,t[3]=0,t[4]=h*m-f*v,t[5]=f*p-l*m,t[6]=l*v-h*p,t[7]=0,t[8]=l,t[9]=h,t[10]=f,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t},str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},subtract:A,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},equals:function(t,e){var n=t[0],i=t[1],o=t[2],a=t[3],s=t[4],u=t[5],c=t[6],l=t[7],h=t[8],f=t[9],d=t[10],p=t[11],v=t[12],m=t[13],y=t[14],g=t[15],x=e[0],E=e[1],b=e[2],T=e[3],S=e[4],P=e[5],M=e[6],w=e[7],k=e[8],N=e[9],C=e[10],A=e[11],O=e[12],L=e[13],R=e[14],_=e[15];return!(Math.abs(n-x)>r*Math.max(1,Math.abs(n),Math.abs(x))||Math.abs(i-E)>r*Math.max(1,Math.abs(i),Math.abs(E))||Math.abs(o-b)>r*Math.max(1,Math.abs(o),Math.abs(b))||Math.abs(a-T)>r*Math.max(1,Math.abs(a),Math.abs(T))||Math.abs(s-S)>r*Math.max(1,Math.abs(s),Math.abs(S))||Math.abs(u-P)>r*Math.max(1,Math.abs(u),Math.abs(P))||Math.abs(c-M)>r*Math.max(1,Math.abs(c),Math.abs(M))||Math.abs(l-w)>r*Math.max(1,Math.abs(l),Math.abs(w))||Math.abs(h-k)>r*Math.max(1,Math.abs(h),Math.abs(k))||Math.abs(f-N)>r*Math.max(1,Math.abs(f),Math.abs(N))||Math.abs(d-C)>r*Math.max(1,Math.abs(d),Math.abs(C))||Math.abs(p-A)>r*Math.max(1,Math.abs(p),Math.abs(A))||Math.abs(v-O)>r*Math.max(1,Math.abs(v),Math.abs(O))||Math.abs(m-L)>r*Math.max(1,Math.abs(m),Math.abs(L))||Math.abs(y-R)>r*Math.max(1,Math.abs(y),Math.abs(R))||Math.abs(g-_)>r*Math.max(1,Math.abs(g),Math.abs(_)))},mul:p,sub:A});function L(){var t=new i(3);return i!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function R(t){var e=new i(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function _(t){return Math.hypot(t[0],t[1],t[2])}function I(t,e,n){var r=new i(3);return r[0]=t,r[1]=e,r[2]=n,r}function D(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function F(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function G(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function B(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function U(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function z(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function V(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function j(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=i*u-o*s,t[1]=o*a-r*u,t[2]=r*s-i*a,t}function H(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}function W(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/(a=a||1),t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function Y(t,e){var n=t[0],i=t[1],o=t[2],a=e[0],s=e[1],u=e[2];return r*Math.max(1,Math.abs(n),Math.abs(a))>=Math.abs(n-a)&&r*Math.max(1,Math.abs(i),Math.abs(s))>=Math.abs(i-s)&&r*Math.max(1,Math.abs(o),Math.abs(u))>=Math.abs(o-u)}var X,q=function(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1],e[2]-t[2])},K=_;X=L();function Z(){var t=new i(4);return i!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Q(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}!function(){var t=Z()}();function $(){var t=new i(4);return i!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function J(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 tt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],u=n[1],c=n[2],l=n[3];return t[0]=r*l+a*s+i*c-o*u,t[1]=i*l+a*u+o*s-r*c,t[2]=o*l+a*c+r*u-i*s,t[3]=a*l-r*s-i*u-o*c,t}function et(t,e,n,i){var o,a,s,u,c,l=e[0],h=e[1],f=e[2],d=e[3],p=n[0],v=n[1],m=n[2],y=n[3];return 0>(a=l*p+h*v+f*m+d*y)&&(a=-a,p=-p,v=-v,m=-m,y=-y),1-a>r?(s=Math.sin(o=Math.acos(a)),u=Math.sin((1-i)*o)/s,c=Math.sin(i*o)/s):(u=1-i,c=i),t[0]=u*l+c*p,t[1]=u*h+c*v,t[2]=u*f+c*m,t[3]=u*d+c*y,t}function nt(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,t}function rt(t,e,n,r){var i=.5*Math.PI/180;n*=i,r*=i;var o=Math.sin(e*=i),a=Math.cos(e),s=Math.sin(n),u=Math.cos(n),c=Math.sin(r),l=Math.cos(r);return t[0]=o*u*l-a*s*c,t[1]=a*s*l+o*u*c,t[2]=a*u*c-o*s*l,t[3]=a*u*l+o*s*c,t}var it,ot,at,st,ut,ct,lt=function(t,e,n,r){var o=new i(4);return o[0]=t,o[1]=e,o[2]=n,o[3]=r,o},ht=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},ft=tt,dt=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t};it=L(),ot=I(1,0,0),at=I(0,1,0),st=$(),ut=$(),ct=o();!function(){var t,e=(t=new i(2),i!=Float32Array&&(t[0]=0,t[1]=0),t)}();function pt(t){return t.map((function(t){return Array.isArray(t)?[].concat(t):t}))}var vt=function(){return vt=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},vt.apply(this,arguments)},mt={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function yt(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 gt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function xt(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return gt[e]===t.length-1&&"achlmqstvz".includes(e)}))}function Et(t){return xt(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function bt(t){return Et(t)&&t.every((function(t){return"ACLMQZ".includes(t[0])}))}function Tt(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=gt[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,gt[n]))),gt[n]););}function St(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'+n[e]+'", expecting 0 or 1 at index '+e)}function Pt(t){return t>=48&&57>=t||43===t||45===t||46===t}function Mt(t){return t>=48&&57>=t}function wt(t){var e,n=t.max,r=t.pathValue,i=t.index,o=i,a=!1,s=!1,u=!1,c=!1;if(n>o)if(43!==(e=r.charCodeAt(o))&&45!==e||(e=r.charCodeAt(o+=1)),Mt(e)||46===e){if(46!==e){if(a=48===e,e=r.charCodeAt(o+=1),a&&n>o&&e&&Mt(e))return void(t.err="[path-util]: Invalid path value at index "+i+', "'+r[i]+'" illegal number');for(;n>o&&Mt(r.charCodeAt(o));)o+=1,s=!0;e=r.charCodeAt(o)}if(46===e){for(c=!0,o+=1;Mt(r.charCodeAt(o));)o+=1,u=!0;e=r.charCodeAt(o)}if(101===e||69===e){if(c&&!s&&!u)return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid float exponent');if(43!==(e=r.charCodeAt(o+=1))&&45!==e||(o+=1),o>=n||!Mt(r.charCodeAt(o)))return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid integer exponent');for(;n>o&&Mt(r.charCodeAt(o));)o+=1}t.index=o,t.param=+t.pathValue.slice(i,o)}else t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" is not a number';else t.err="[path-util]: Invalid path value at index "+o+', "pathValue" is missing param'}function kt(t){for(var e,n=t.pathValue,r=t.max;r>t.index&&(10===(e=n.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function Nt(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),o=gt[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,kt(t),t.data=[],o){for(;;){for(var a=o;a>0;a-=1){if(97!=(32|i)||3!==a&&4!==a?wt(t):St(t),t.err.length)return;t.data.push(t.param),kt(t),e>t.index&&44===n.charCodeAt(t.index)&&(t.index+=1,kt(t))}if(t.index>=t.max)break;if(!Pt(n.charCodeAt(t.index)))break}Tt(t)}else Tt(t);else t.err='[path-util]: Invalid path value "'+n[r]+'" is not a path command'}var Ct=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 At(t){if(Et(t))return pt(t);var e=function(t){if(xt(t))return pt(t);var e=new Ct(t);for(kt(e);e.max>e.index&&!e.err.length;)Nt(e);return e.err?e.err:e.segments}(t),n=0,r=0,i=0,o=0;return e.map((function(t){var e,a=t.slice(1).map(Number),s=t[0],u=s.toUpperCase();if("M"===s)return i=n=a[0],o=r=a[1],["M",n,r];if(s!==u)switch(u){case"A":e=[u,a[0],a[1],a[2],a[3],a[4],a[5]+n,a[6]+r];break;case"V":e=[u,a[0]+r];break;case"H":e=[u,a[0]+n];break;default:var c=a.map((function(t,e){return t+(e%2?r:n)}));e=[u].concat(c)}else e=[u].concat(a);var l=e.length;switch(u){case"Z":n=i,r=o;break;case"H":n=e[1];break;case"V":r=e[1];break;default:n=e[l-2],r=e[l-1],"M"===u&&(i=n,o=r)}return e}))}function Ot(t,e){var n=t[0],r=e.x1,i=e.y1,o=e.x2,a=e.y2,s=t.slice(1).map(Number),u=t;if("TQ".includes(n)||(e.qx=null,e.qy=null),"H"===n)u=["L",t[1],i];else if("V"===n)u=["L",r,t[1]];else if("S"===n){var c=2*r-o,l=2*i-a;e.x1=c,e.y1=l,u=["C",c,l].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 Lt(t){if(bt(t))return pt(t);for(var e=At(t),n=vt({},mt),r=0;e.length>r;r+=1){e[r]=Ot(e[r],n);var i=e[r],o=i.length;n.x1=+i[o-2],n.y1=+i[o-1],n.x2=+i[o-4]||n.x1,n.y2=+i[o-3]||n.y1}return e}function Rt(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function _t(t,e,n,r,i,o,a,s,u,c){var l,h,f,d,p,v=t,m=e,y=n,g=r,x=s,E=u,b=120*Math.PI/180,T=Math.PI/180*(+i||0),S=[];if(c)h=c[0],f=c[1],d=c[2],p=c[3];else{m=(l=Rt(v,m,-T)).y;var P=((v=l.x)-(x=(l=Rt(x,E,-T)).x))/2,M=(m-(E=l.y))/2,w=P*P/(y*y)+M*M/(g*g);w>1&&(y*=w=Math.sqrt(w),g*=w);var k=y*y,N=g*g,C=(o===a?-1:1)*Math.sqrt(Math.abs((k*N-k*M*M-N*P*P)/(k*M*M+N*P*P)));d=C*y*M/g+(v+x)/2,h=Math.asin(((m-(p=C*-g*P/y+(m+E)/2))/g*1e9>>0)/1e9),f=Math.asin(((E-p)/g*1e9>>0)/1e9),0>(h=d>v?Math.PI-h:h)&&(h=2*Math.PI+h),0>(f=d>x?Math.PI-f:f)&&(f=2*Math.PI+f),a&&h>f&&(h-=2*Math.PI),!a&&f>h&&(f-=2*Math.PI)}var A=f-h;if(Math.abs(A)>b){var O=f,L=x,R=E;S=_t(x=d+y*Math.cos(f=h+b*(a&&f>h?1:-1)),E=p+g*Math.sin(f),y,g,i,0,a,L,R,[f,O,d,p])}A=f-h;var _=Math.cos(h),I=Math.sin(h),D=Math.cos(f),F=Math.sin(f),G=Math.tan(A/4),B=4/3*y*G,U=4/3*g*G,z=[v,m],V=[v+B*I,m-U*_],j=[x+B*F,E-U*D],H=[x,E];if(V[0]=2*z[0]-V[0],V[1]=2*z[1]-V[1],c)return V.concat(j,H,S);for(var W=[],Y=0,X=(S=V.concat(j,H,S)).length;X>Y;Y+=1)W[Y]=Y%2?Rt(S[Y-1],S[Y],T).y:Rt(S[Y],S[Y+1],T).x;return W}function It(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}function Dt(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function Ft(t,e,n,r,i){var o=Dt([t,e],[n,r]),a={x:0,y:0};if("number"==typeof i)if(0<i)if(i<o){var s=It([t,e],[n,r],i/o);a={x:s[0],y:s[1]}}else a={x:n,y:r};else a={x:t,y:e};return{length:o,point:a,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function Gt(t,e,n,r){var i=.5,o=[t,e],a=[n,r],s=It(o,a,i),u=It(a,s,i),c=It(s,u,i),l=It(u,c,i),h=It(c,l,i),f=Ft(o[0],o[1],s[0],s[1],c[0]).point,d=Ft(h[0],h[1],l[0],l[1],u[0]).point;return[f.x,f.y,d.x,d.y,n,r]}function Bt(t,e){var n,r,i,o,a,s,u,c=t[0],l=t.slice(1).map(Number),h=l[0],f=l[1],d=e.x1,p=e.y1,v=e.x,m=e.y;switch("TQ".includes(c)||(e.qx=null,e.qy=null),c){case"M":return e.x=h,e.y=f,t;case"A":return n=[d,p].concat(l),["C"].concat(_t(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,p].concat(l),["C"].concat([(s=1/3)*n[0]+(u=2/3)*(r=n[2]),s*n[1]+u*(i=n[3]),s*(o=n[4])+u*r,s*(a=n[5])+u*i,o,a]);case"L":return["C"].concat(Gt(d,p,h,f));case"Z":return d===v&&p===m?["C",d,p,v,m,v,m]:["C"].concat(Gt(d,p,v,m))}return t}function Ut(t,e){if(void 0===e&&(e=!1),function(t){return bt(t)&&t.every((function(t){return"MC".includes(t[0])}))}(t)){var n=pt(t);return e?[n,[]]:n}for(var r,i,o=Lt(t),a=vt({},mt),s=[],u="",c=o.length,l=[],h=0;c>h;h+=1){o[h]&&(u=o[h][0]),s[h]=u;var f=Bt(o[h],a);o[h]=f,yt(o,s,h),c=o.length,"Z"===u&&l.push(h),a.x1=+(r=o[h])[(i=r.length)-2],a.y1=+r[i-1],a.x2=+r[i-4]||a.x1,a.y2=+r[i-3]||a.y1}return e?[o,l]:o}function zt(t,e){var n=t.x,r=t.y,i=e.x,o=e.y;return(0>n*o-r*i?-1:1)*Math.acos((n*i+r*o)/Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(o,2))))}function Vt(t,e,n,r,i,o,a,s,u,c){var l=Math.abs,h=Math.sin,f=Math.cos,d=Math.sqrt,p=Math.PI,v=l(n),m=l(r),y=(i%360+360)%360*(p/180);if(t===s&&e===u)return{x:t,y:e};if(0===v||0===m)return Ft(t,e,s,u,c).point;var g=(t-s)/2,x=(e-u)/2,E={x:f(y)*g+h(y)*x,y:-h(y)*g+f(y)*x},b=Math.pow(E.x,2)/Math.pow(v,2)+Math.pow(E.y,2)/Math.pow(m,2);b>1&&(v*=d(b),m*=d(b));var T=(Math.pow(v,2)*Math.pow(m,2)-Math.pow(v,2)*Math.pow(E.y,2)-Math.pow(m,2)*Math.pow(E.x,2))/(Math.pow(v,2)*Math.pow(E.y,2)+Math.pow(m,2)*Math.pow(E.x,2)),S=(o!==a?1:-1)*d(T=0>T?0:T),P=S*(v*E.y/m),M=S*(-m*E.x/v),w=f(y)*P-h(y)*M+(t+s)/2,k=h(y)*P+f(y)*M+(e+u)/2,N={x:(E.x-P)/v,y:(E.y-M)/m},C=zt({x:1,y:0},N),A=zt(N,{x:(-E.x-P)/v,y:(-E.y-M)/m});!a&&A>0?A-=2*p:a&&0>A&&(A+=2*p);var O=C+(A%=2*p)*c,L=v*f(O),R=m*h(O);return{x:f(y)*L-h(y)*R+w,y:h(y)*L+f(y)*R+k}}function jt(t,e,n,r,i,o,a,s,u,c,l){var h,f=l.bbox,d=void 0===f||f,p=l.length,v=void 0===p||p,m=l.sampleSize,y=void 0===m?30:m,g="number"==typeof c,x=t,E=e,b=0,T=[x,E,b],S=[x,E],P={x:0,y:0},M=[{x:x,y:E}];g&&0>=c&&(P={x:x,y:E});for(var w=0;y>=w;w+=1){if(x=(h=Vt(t,e,n,r,i,o,a,s,u,w/y)).x,E=h.y,d&&M.push({x:x,y:E}),v&&(b+=Dt(S,[x,E])),S=[x,E],g&&b>=c&&c>T[2]){var k=(b-c)/(b-T[2]);P={x:S[0]*(1-k)+T[0]*k,y:S[1]*(1-k)+T[1]*k}}T=[x,E,b]}return g&&c>=b&&(P={x:s,y:u}),{length:b,point:P,min:{x:Math.min.apply(null,M.map((function(t){return t.x}))),y:Math.min.apply(null,M.map((function(t){return t.y})))},max:{x:Math.max.apply(null,M.map((function(t){return t.x}))),y:Math.max.apply(null,M.map((function(t){return t.y})))}}}function Ht(t,e,n,r,i,o,a,s,u){var c=1-u;return{x:Math.pow(c,3)*t+3*Math.pow(c,2)*u*n+3*c*Math.pow(u,2)*i+Math.pow(u,3)*a,y:Math.pow(c,3)*e+3*Math.pow(c,2)*u*r+3*c*Math.pow(u,2)*o+Math.pow(u,3)*s}}function Wt(t,e,n,r,i,o,a,s,u,c){var l,h=c.bbox,f=void 0===h||h,d=c.length,p=void 0===d||d,v=c.sampleSize,m=void 0===v?10:v,y="number"==typeof u,g=t,x=e,E=0,b=[g,x,E],T=[g,x],S={x:0,y:0},P=[{x:g,y:x}];y&&0>=u&&(S={x:g,y:x});for(var M=0;m>=M;M+=1){if(g=(l=Ht(t,e,n,r,i,o,a,s,M/m)).x,x=l.y,f&&P.push({x:g,y:x}),p&&(E+=Dt(T,[g,x])),T=[g,x],y&&E>=u&&u>b[2]){var w=(E-u)/(E-b[2]);S={x:T[0]*(1-w)+b[0]*w,y:T[1]*(1-w)+b[1]*w}}b=[g,x,E]}return y&&u>=E&&(S={x:a,y:s}),{length:E,point:S,min:{x:Math.min.apply(null,P.map((function(t){return t.x}))),y:Math.min.apply(null,P.map((function(t){return t.y})))},max:{x:Math.max.apply(null,P.map((function(t){return t.x}))),y:Math.max.apply(null,P.map((function(t){return t.y})))}}}function Yt(t,e,n,r,i,o,a){var s=1-a;return{x:Math.pow(s,2)*t+2*s*a*n+Math.pow(a,2)*i,y:Math.pow(s,2)*e+2*s*a*r+Math.pow(a,2)*o}}function Xt(t,e,n,r,i,o,a,s){var u,c=s.bbox,l=void 0===c||c,h=s.length,f=void 0===h||h,d=s.sampleSize,p=void 0===d?10:d,v="number"==typeof a,m=t,y=e,g=0,x=[m,y,g],E=[m,y],b={x:0,y:0},T=[{x:m,y:y}];v&&0>=a&&(b={x:m,y:y});for(var S=0;p>=S;S+=1){if(m=(u=Yt(t,e,n,r,i,o,S/p)).x,y=u.y,l&&T.push({x:m,y:y}),f&&(g+=Dt(E,[m,y])),E=[m,y],v&&g>=a&&a>x[2]){var P=(g-a)/(g-x[2]);b={x:E[0]*(1-P)+x[0]*P,y:E[1]*(1-P)+x[1]*P}}x=[m,y,g]}return v&&a>=g&&(b={x:i,y:o}),{length:g,point:b,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 qt(t,e,n){for(var r,i,o,a,s,u,c,l,h,f=Lt(t),d="number"==typeof e,p=[],v=0,m=0,y=0,g=0,x=[],E=[],b=0,T={x:0,y:0},S=T,P=T,M=T,w=0,k=0,N=f.length;N>k;k+=1)p=(c="M"===(l=(h=f[k])[0]))?p:[v,m].concat(h.slice(1)),c?(S=T={x:y=h[1],y:g=h[2]},b=0,d&&.001>e&&(M=T)):"L"===l?(b=(r=Ft(p[0],p[1],p[2],p[3],(e||0)-w)).length,T=r.min,S=r.max,P=r.point):"A"===l?(b=(i=jt(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8],(e||0)-w,n||{})).length,T=i.min,S=i.max,P=i.point):"C"===l?(b=(o=Wt(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],(e||0)-w,n||{})).length,T=o.min,S=o.max,P=o.point):"Q"===l?(b=(a=Xt(p[0],p[1],p[2],p[3],p[4],p[5],(e||0)-w,n||{})).length,T=a.min,S=a.max,P=a.point):"Z"===l&&(b=(s=Ft((p=[v,m,y,g])[0],p[1],p[2],p[3],(e||0)-w)).length,T=s.min,S=s.max,P=s.point),d&&e>w&&w+b>=e&&(M=P),E.push(S),x.push(T),w+=b,v=(u="Z"!==l?h.slice(-2):[y,g])[0],m=u[1];return d&&e>=w&&(M={x:v,y:m}),{length:w,point:M,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,E.map((function(t){return t.x}))),y:Math.max.apply(null,E.map((function(t){return t.y})))}}}function Kt(t){return function(t){var e=0,n=0,r=0;return Ut(t).map((function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var o,a,s,u,c,l,h,f,d=t.slice(1);return r=3*(((f=d[5])-(a=n))*((s=d[0])+(c=d[2]))-((h=d[4])-(o=e))*((u=d[1])+(l=d[3]))+u*(o-c)-s*(a-l)+f*(c+o/3)-h*(l+a/3))/20,i=t.slice(-2),e=i[0],n=i[1],r})).reduce((function(t,e){return t+e}),0)}(t)>=0}function Zt(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?Wt(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),a=It(n,r,e),s=It(r,i,e),u=It(i,o,e),c=It(a,s,e),l=It(s,u,e),h=It(c,l,e);return[["C"].concat(a,c,h),["C"].concat(l,u,o)]}(r):[t,t]:[t],l:i}}))}function Qt(t,e,n){var r=Zt(t),i=Zt(e),o=r.length,a=i.length,s=r.filter((function(t){return t.l})).length,u=i.filter((function(t){return t.l})).length,c=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,l=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/u||0,h=n||Math.max(o,a),f=[c,l],d=[h-o,h-a],p=0,v=[r,i].map((function(t,e){return t.l===h?t.map((function(t){return t.s})):t.map((function(t,n){return d[e]-=(p=n&&d[e]&&t.l>=f[e])?1:0,p?t.ss:[t.s]})).flat()}));return v[0].length===v[1].length?v:Qt(v[0],v[1],h)}var $t=function(t){return null==t},Jt={}.toString,te=function(t,e){return Jt.call(t)==="[object "+e+"]"},ee=function(t){return Array.isArray?Array.isArray(t):te(t,"Array")},ne=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e},re=function(t){if(ee(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},ie=function(t){if(ee(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},oe=function(t){return te(t,"String")},ae=function(t,e,n){return e>t?e:t>n?n:t},se=function(t){return te(t,"Number")},ue=1e-5;var ce=function(t,e){return(t%e+e)%e},le=function(t){return te(t,"Boolean")},he=function(t){return void 0===t};function fe(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function de(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function pe(){}var ve=.7,me=1/ve,ye="\\s*([+-]?\\d+)\\s*",ge="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",xe="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ee=/^#([0-9a-f]{3,8})$/,be=RegExp("^rgb\\("+[ye,ye,ye]+"\\)$"),Te=RegExp("^rgb\\("+[xe,xe,xe]+"\\)$"),Se=RegExp("^rgba\\("+[ye,ye,ye,ge]+"\\)$"),Pe=RegExp("^rgba\\("+[xe,xe,xe,ge]+"\\)$"),Me=RegExp("^hsl\\("+[ge,xe,xe]+"\\)$"),we=RegExp("^hsla\\("+[ge,xe,xe,ge]+"\\)$"),ke={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 Ne(){return this.rgb().formatHex()}function Ce(){return this.rgb().formatRgb()}function Ae(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Ee.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Oe(e):3===n?new Re(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Le(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Le(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=be.exec(t))?new Re(e[1],e[2],e[3],1):(e=Te.exec(t))?new Re(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Se.exec(t))?Le(e[1],e[2],e[3],e[4]):(e=Pe.exec(t))?Le(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Me.exec(t))?Fe(e[1],e[2]/100,e[3]/100,1):(e=we.exec(t))?Fe(e[1],e[2]/100,e[3]/100,e[4]):ke.hasOwnProperty(t)?Oe(ke[t]):"transparent"===t?new Re(NaN,NaN,NaN,0):null}function Oe(t){return new Re(t>>16&255,t>>8&255,255&t,1)}function Le(t,e,n,r){return r>0||(t=e=n=NaN),new Re(t,e,n,r)}function Re(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function _e(){return"#"+De(this.r)+De(this.g)+De(this.b)}function Ie(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function De(t){return(16>(t=Math.max(0,Math.min(255,Math.round(t)||0)))?"0":"")+t.toString(16)}function Fe(t,e,n,r){return r>0?n>0&&1>n?e>0||(t=NaN):t=e=NaN:t=e=n=NaN,new Be(t,e,n,r)}function Ge(t){if(t instanceof Be)return new Be(t.h,t.s,t.l,t.opacity);if(t instanceof pe||(t=Ae(t)),!t)return new Be;if(t instanceof Be)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(r>n):n===o?(r-e)/s+2:(e-n)/s+4,s/=.5>u?o+i:2-o-i,a*=60):s=u>0&&1>u?0:a,new Be(a,s,u,t.opacity)}function Be(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Ue(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 ze(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function Ve(t,e){return.001>Math.abs(t-e)}function je(t,e){var n=Math.min.apply(Math,t),r=Math.min.apply(Math,e);return{x:n,y:r,width:Math.max.apply(Math,t)-n,height:Math.max.apply(Math,e)-r}}function He(t){return(t+2*Math.PI)%(2*Math.PI)}fe(pe,Ae,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Ne,formatHex:Ne,formatHsl:function(){return Ge(this).formatHsl()},formatRgb:Ce,toString:Ce}),fe(Re,(function(t,e,n,r){return 1===arguments.length?((i=t)instanceof pe||(i=Ae(i)),i?new Re((i=i.rgb()).r,i.g,i.b,i.opacity):new Re):new Re(t,e,n,null==r?1:r);var i}),de(pe,{brighter:function(t){return new Re(this.r*(t=null==t?me:Math.pow(me,t)),this.g*t,this.b*t,this.opacity)},darker:function(t){return new Re(this.r*(t=null==t?ve:Math.pow(ve,t)),this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return this.r>=-.5&&255.5>this.r&&this.g>=-.5&&255.5>this.g&&this.b>=-.5&&255.5>this.b&&this.opacity>=0&&1>=this.opacity},hex:_e,formatHex:_e,formatRgb:Ie,toString:Ie})),fe(Be,(function(t,e,n,r){return 1===arguments.length?Ge(t):new Be(t,e,n,null==r?1:r)}),de(pe,{brighter:function(t){return new Be(this.h,this.s,this.l*(t=null==t?me:Math.pow(me,t)),this.opacity)},darker:function(t){return new Be(this.h,this.s,this.l*(t=null==t?ve:Math.pow(ve,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 Re(Ue(240>t?t+120:t-240,r,n),Ue(t,r,n),Ue(120>t?t+240:t-120,r,n),this.opacity)},displayable:function(){return(this.s>=0&&1>=this.s||isNaN(this.s))&&this.l>=0&&1>=this.l&&this.opacity>=0&&1>=this.opacity},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var We={box:function(t,e,n,r){return je([t,n],[e,r])},length:function(t,e,n,r){return ze(t,e,n,r)},pointAt:function(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}},pointDistance:function(t,e,n,r,i,o){var a=(n-t)*(i-t)+(r-e)*(o-e);return 0>a?ze(t,e,i,o):a>(n-t)*(n-t)+(r-e)*(r-e)?ze(n,r,i,o):this.pointToLine(t,e,n,r,i,o)},pointToLine:function(t,e,n,r,i,o){var a=[n-t,r-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var s=[-a[1],a[0]];return function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i}(s,s),Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}([i-t,o-e],s))},tangentAngle:function(t,e,n,r){return Math.atan2(r-e,n-t)}},Ye=1e-4;function Xe(t,e,n,r,i,o){var a=-1,s=1/0,u=[n,r],c=20;o&&o>200&&(c=o/10);for(var l=1/c,h=l/10,f=0;c>=f;f++){var d=f*l,p=[i.apply(void 0,t.concat([d])),i.apply(void 0,e.concat([d]))],v=ze(u[0],u[1],p[0],p[1]);s>v&&(a=d,s=v)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var m=t.length;return{x:t[m-1],y:e[m-1]}}s=1/0;for(var y=0;32>y&&Ye<=h;y++){var g=a-h,x=a+h,E=[i.apply(void 0,t.concat([g])),i.apply(void 0,e.concat([g]))],b=ze(u[0],u[1],E[0],E[1]);if(g>=0&&s>b)a=g,s=b;else{var T=[i.apply(void 0,t.concat([x])),i.apply(void 0,e.concat([x]))],S=ze(u[0],u[1],T[0],T[1]);1>=x&&s>S?(a=x,s=S):h*=.5}}return{x:i.apply(void 0,t.concat([a])),y:i.apply(void 0,e.concat([a]))}}function qe(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function Ke(t,e,n){var r=t+n-2*e;if(Ve(r,0))return[.5];var i=(t-e)/r;return i>1||0>i?[]:[i]}function Ze(t,e,n,r){return 2*(1-r)*(e-t)+2*r*(n-e)}function Qe(t,e,n,r,i,o,a){var s=qe(t,n,i,a),u=qe(e,r,o,a),c=We.pointAt(t,e,n,r,a),l=We.pointAt(n,r,i,o,a);return[[t,e,c.x,c.y,s,u],[s,u,l.x,l.y,i,o]]}function $e(t,e,n,r,i,o,a){if(0===a)return(ze(t,e,n,r)+ze(n,r,i,o)+ze(t,e,i,o))/2;var s=Qe(t,e,n,r,i,o,.5),u=s[0],c=s[1];return u.push(a-1),c.push(a-1),$e.apply(void 0,u)+$e.apply(void 0,c)}var Je={box:function(t,e,n,r,i,o){var a=Ke(t,n,i)[0],s=Ke(e,r,o)[0],u=[t,i],c=[e,o];return void 0!==a&&u.push(qe(t,n,i,a)),void 0!==s&&c.push(qe(e,r,o,s)),je(u,c)},length:function(t,e,n,r,i,o){return $e(t,e,n,r,i,o,3)},nearestPoint:function(t,e,n,r,i,o,a,s){return Xe([t,n,i],[e,r,o],a,s,qe)},pointDistance:function(t,e,n,r,i,o,a,s){var u=this.nearestPoint(t,e,n,r,i,o,a,s);return ze(u.x,u.y,a,s)},interpolationAt:qe,pointAt:function(t,e,n,r,i,o,a){return{x:qe(t,n,i,a),y:qe(e,r,o,a)}},divide:function(t,e,n,r,i,o,a){return Qe(t,e,n,r,i,o,a)},tangentAngle:function(t,e,n,r,i,o,a){var s=Ze(t,n,i,a),u=Ze(e,r,o,a);return He(Math.atan2(u,s))}};function tn(t,e,n,r,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*n*i*i*o+r*i*i*i}function en(t,e,n,r,i){var o=1-i;return 3*(o*o*(e-t)+2*o*i*(n-e)+i*i*(r-n))}function nn(t,e,n,r){var i,o,a,s=-3*t+9*e-9*n+3*r,u=6*t-12*e+6*n,c=3*e-3*t,l=[];if(Ve(s,0))Ve(u,0)||0>(i=-c/u)||i>1||l.push(i);else{var h=u*u-4*s*c;Ve(h,0)?l.push(-u/(2*s)):h>0&&(o=(-u-(a=Math.sqrt(h)))/(2*s),0>(i=(-u+a)/(2*s))||i>1||l.push(i),0>o||o>1||l.push(o))}return l}function rn(t,e,n,r,i,o,a,s,u){var c=tn(t,n,i,a,u),l=tn(e,r,o,s,u),h=We.pointAt(t,e,n,r,u),f=We.pointAt(n,r,i,o,u),d=We.pointAt(i,o,a,s,u),p=We.pointAt(h.x,h.y,f.x,f.y,u),v=We.pointAt(f.x,f.y,d.x,d.y,u);return[[t,e,h.x,h.y,p.x,p.y,c,l],[c,l,v.x,v.y,d.x,d.y,a,s]]}function on(t,e,n,r,i,o,a,s,u){if(0===u)return function(t,e){for(var n=0,r=t.length,i=0;r>i;i++)n+=ze(t[i],e[i],t[(i+1)%r],e[(i+1)%r]);return n/2}([t,n,i,a],[e,r,o,s]);var c=rn(t,e,n,r,i,o,a,s,.5),l=[].concat(c[0],[u-1]),h=[].concat(c[1],[u-1]);return on.apply(void 0,l)+on.apply(void 0,h)}var an={extrema:nn,box:function(t,e,n,r,i,o,a,s){for(var u=[t,a],c=[e,s],l=nn(t,n,i,a),h=nn(e,r,o,s),f=0;l.length>f;f++)u.push(tn(t,n,i,a,l[f]));for(var d=0;h.length>d;d++)c.push(tn(e,r,o,s,h[d]));return je(u,c)},length:function(t,e,n,r,i,o,a,s){return on(t,e,n,r,i,o,a,s,3)},nearestPoint:function(t,e,n,r,i,o,a,s,u,c,l){return Xe([t,n,i,a],[e,r,o,s],u,c,tn,l)},pointDistance:function(t,e,n,r,i,o,a,s,u,c,l){var h=this.nearestPoint(t,e,n,r,i,o,a,s,u,c,l);return ze(h.x,h.y,u,c)},interpolationAt:tn,pointAt:function(t,e,n,r,i,o,a,s,u){return{x:tn(t,n,i,a,u),y:tn(e,r,o,s,u)}},divide:function(t,e,n,r,i,o,a,s,u){return rn(t,e,n,r,i,o,a,s,u)},tangentAngle:function(t,e,n,r,i,o,a,s,u){var c=en(t,n,i,a,u),l=en(e,r,o,s,u);return He(Math.atan2(l,c))}};function sn(t,e){var n=Math.abs(t);return e>0?n:-1*n}var un=function(t,e,n,r,i,o){var a=n,s=r;if(0===a||0===s)return{x:t,y:e};for(var u=i-t,c=o-e,l=Math.abs(u),h=Math.abs(c),f=a*a,d=s*s,p=Math.PI/4,v=0,m=0,y=0;4>y;y++){v=a*Math.cos(p),m=s*Math.sin(p);var g=(f-d)*Math.pow(Math.cos(p),3)/a,x=(d-f)*Math.pow(Math.sin(p),3)/s,E=v-g,b=m-x,T=l-g,S=h-x,P=Math.hypot(b,E),M=Math.hypot(S,T);p=Math.min(Math.PI/2,Math.max(0,p+=P*Math.asin((E*S-b*T)/(P*M))/Math.sqrt(f+d-v*v-m*m)))}return{x:t+sn(v,u),y:e+sn(m,c)}};function cn(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function ln(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}function hn(t,e,n){return{x:t*Math.cos(n),y:e*Math.sin(n)}}function fn(t,e,n){var r=Math.cos(n),i=Math.sin(n);return[t*r-e*i,t*i+e*r]}var dn={box:function(t,e,n,r,i,o,a){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),u=1/0,c=-1/0,l=[o,a],h=2*-Math.PI;2*Math.PI>=h;h+=Math.PI){var f=s+h;a>o?f>o&&a>f&&l.push(f):f>a&&o>f&&l.push(f)}for(var d=0;l.length>d;d++){var p=cn(t,0,n,r,i,l[d]);u>p&&(u=p),p>c&&(c=p)}for(var v=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),m=1/0,y=-1/0,g=[o,a],x=2*-Math.PI;2*Math.PI>=x;x+=Math.PI){var E=v+x;a>o?E>o&&a>E&&g.push(E):E>a&&o>E&&g.push(E)}for(var b=0;g.length>b;b++){var T=ln(0,e,n,r,i,g[b]);m>T&&(m=T),T>y&&(y=T)}return{x:u,y:m,width:c-u,height:y-m}},length:function(t,e,n,r,i,o,a){},nearestPoint:function(t,e,n,r,i,o,a,s,u){var c=fn(s-t,u-e,-i),l=un(0,0,n,r,c[0],c[1]),h=function(t,e,n,r){return(Math.atan2(r*t,n*e)+2*Math.PI)%(2*Math.PI)}(n,r,l.x,l.y);o>h?l=hn(n,r,o):h>a&&(l=hn(n,r,a));var f=fn(l.x,l.y,i);return{x:f[0]+t,y:f[1]+e}},pointDistance:function(t,e,n,r,i,o,a,s,u){var c=this.nearestPoint(t,e,n,r,i,o,a,s,u);return ze(c.x,c.y,s,u)},pointAt:function(t,e,n,r,i,o,a,s){var u=(a-o)*s+o;return{x:cn(t,0,n,r,i,u),y:ln(0,e,n,r,i,u)}},tangentAngle:function(t,e,n,r,i,o,a,s){var u=(a-o)*s+o,c=function(t,e,n,r,i,o,a,s){return-1*n*Math.cos(i)*Math.sin(s)-r*Math.sin(i)*Math.cos(s)}(0,0,n,r,i,0,0,u),l=function(t,e,n,r,i,o,a,s){return-1*n*Math.sin(i)*Math.sin(s)+r*Math.cos(i)*Math.cos(s)}(0,0,n,r,i,0,0,u);return He(Math.atan2(l,c))}};function pn(t){for(var e=0,n=[],r=0;t.length-1>r;r++){var i=t[r],o=t[r+1],a=ze(i[0],i[1],o[0],o[1]);n.push({from:i,to:o,length:a}),e+=a}return{segments:n,totalLength:e}}var vn,mn,yn,gn,xn,En,bn={box:function(t){for(var e=[],n=[],r=0;t.length>r;r++){var i=t[r];e.push(i[0]),n.push(i[1])}return je(e,n)},length:function(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+=ze(r[0],r[1],i[0],i[1])}return e}(t)},pointAt:function(t,e){return function(t,e){if(e>1||0>e||2>t.length)return null;var n=pn(t),r=n.segments,i=n.totalLength;if(0===i)return{x:t[0][0],y:t[0][1]};for(var o=0,a=null,s=0;r.length>s;s++){var u=r[s],c=u.from,l=u.to,h=u.length/i;if(e>=o&&o+h>=e){a=We.pointAt(c[0],c[1],l[0],l[1],(e-o)/h);break}o+=h}return a}(t,e)},pointDistance:function(t,e,n){return function(t,e,n){for(var r=1/0,i=0;t.length-1>i;i++){var o=t[i],a=t[i+1],s=We.pointDistance(o[0],o[1],a[0],a[1],e,n);r>s&&(r=s)}return r}(t,e,n)},tangentAngle:function(t,e){return function(t,e){if(e>1||0>e||2>t.length)return 0;for(var n=pn(t),r=n.segments,i=n.totalLength,o=0,a=0,s=0;r.length>s;s++){var u=r[s],c=u.from,l=u.to,h=u.length/i;if(e>=o&&o+h>=e){a=Math.atan2(l[1]-c[1],l[0]-c[0]);break}o+=h}return a}(t,e)}},Tn=e((function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||t,a),u=n?n+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},s.prototype.listeners=function(t){var e=this._events[n?n+t:t];if(!e)return[];if(e.fn)return[e.fn];for(var r=0,i=e.length,o=Array(i);i>r;r++)o[r]=e[r].fn;return o},s.prototype.listenerCount=function(t){var e=this._events[n?n+t:t];return e?e.fn?1:e.length:0},s.prototype.emit=function(t,e,r,i,o,a){var s=n?n+t:t;if(!this._events[s])return!1;var u,c,l=this._events[s],h=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),h){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,r),!0;case 4:return l.fn.call(l.context,e,r,i),!0;case 5:return l.fn.call(l.context,e,r,i,o),!0;case 6:return l.fn.call(l.context,e,r,i,o,a),!0}for(c=1,u=Array(h-1);h>c;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var f,d=l.length;for(c=0;d>c;c++)switch(l[c].once&&this.removeListener(t,l[c].fn,void 0,!0),h){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,e);break;case 3:l[c].fn.call(l[c].context,e,r);break;case 4:l[c].fn.call(l[c].context,e,r,i);break;default:if(!u)for(f=1,u=Array(h-1);h>f;f++)u[f-1]=arguments[f];l[c].fn.apply(l[c].context,u)}}return!0},s.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,r,i){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var u=0,c=[],l=s.length;l>u;u++)(s[u].fn!==e||i&&!s[u].once||r&&s[u].context!==r)&&c.push(s[u]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(t){var e;return t?this._events[e=n?n+t:t]&&a(this,e):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s}));function Sn(){Sn=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function c(t,e,n,i){var o=Object.create((e&&e.prototype instanceof f?e:f).prototype),a=new M(i||[]);return r(o,"_invoke",{value:b(t,n,a)}),o}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var h={};function f(){}function d(){}function p(){}var v={};u(v,o,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(w([])));y&&y!==e&&n.call(y,o)&&(v=y);var g=p.prototype=f.prototype=Object.create(v);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function i(r,o,a,s){var u=l(t[r],t,o);if("throw"!==u.type){var c=u.arg,h=c.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){i("next",t,a,s)}),(function(t){i("throw",t,a,s)})):e.resolve(h).then((function(t){c.value=t,a(c)}),(function(t){return i("throw",t,a,s)}))}s(u.arg)}var o;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){i(t,n,e,r)}))}return o=o?o.then(r,r):r()}})}function b(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return k()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=T(a,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=l(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function T(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,T(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var i=l(r,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,h;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function w(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,r(g,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:d,configurable:!0}),d.displayName=u(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,u(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},x(E.prototype),u(E.prototype,a,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new E(c(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(g),u(g,s,"Generator"),u(g,o,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=w,M.prototype={constructor:M,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(this.prev>=o.tryLoc){var s=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(s&&u){if(o.catchLoc>this.prev)return r(o.catchLoc,!0);if(o.finallyLoc>this.prev)return r(o.finallyLoc)}else if(s){if(o.catchLoc>this.prev)return r(o.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(this.prev>=i.tryLoc&&n.call(i,"finallyLoc")&&i.finallyLoc>this.prev){var o=i;break}}o&&("break"===t||"continue"===t)&&e>=o.tryLoc&&o.finallyLoc>=e&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),P(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;P(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:w(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}function Pn(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function Mn(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){Pn(o,r,i,a,s,"next",t)}function s(t){Pn(o,r,i,a,s,"throw",t)}a(void 0)}))}}function wn(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(i=void 0,"symbol"==typeof(i=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(r.key,"string"))?i:i+""),r)}var i}function kn(t,e,n){return e&&wn(t.prototype,e),n&&wn(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Nn(){return Nn=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Nn.apply(this,arguments)}function Cn(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,An(t,e)}function An(t,e){return An=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},An(t,e)}function On(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;o.length>r;r++)0>e.indexOf(n=o[r])&&(i[n]=t[n]);return i}function Ln(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Rn(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 _n(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Rn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Rn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0;return function(){return t.length>r?{done:!1,value:t[r++]}:{done:!0}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(vn=t.PropertySyntax||(t.PropertySyntax={})).COORDINATE="<coordinate>",vn.COLOR="<color>",vn.PAINT="<paint>",vn.NUMBER="<number>",vn.ANGLE="<angle>",vn.OPACITY_VALUE="<opacity-value>",vn.SHADOW_BLUR="<shadow-blur>",vn.LENGTH="<length>",vn.PERCENTAGE="<percentage>",vn.LENGTH_PERCENTAGE="<length> | <percentage>",vn.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",vn.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",vn.LIST_OF_POINTS="<list-of-points>",vn.PATH="<path>",vn.FILTER="<filter>",vn.Z_INDEX="<z-index>",vn.OFFSET_DISTANCE="<offset-distance>",vn.DEFINED_PATH="<defined-path>",vn.MARKER="<marker>",vn.TRANSFORM="<transform>",vn.TRANSFORM_ORIGIN="<transform-origin>",vn.TEXT="<text>",vn.TEXT_TRANSFORM="<text-transform>",(mn=t.UnitType||(t.UnitType={}))[mn.kUnknown=0]="kUnknown",mn[mn.kNumber=1]="kNumber",mn[mn.kPercentage=2]="kPercentage",mn[mn.kEms=3]="kEms",mn[mn.kPixels=4]="kPixels",mn[mn.kRems=5]="kRems",mn[mn.kDegrees=6]="kDegrees",mn[mn.kRadians=7]="kRadians",mn[mn.kGradians=8]="kGradians",mn[mn.kTurns=9]="kTurns",mn[mn.kMilliseconds=10]="kMilliseconds",mn[mn.kSeconds=11]="kSeconds",mn[mn.kInteger=12]="kInteger",function(t){t[t.kUNumber=0]="kUNumber",t[t.kUPercent=1]="kUPercent",t[t.kULength=2]="kULength",t[t.kUAngle=3]="kUAngle",t[t.kUTime=4]="kUTime",t[t.kUOther=5]="kUOther"}(yn||(yn={})),function(t){t[t.kAll=0]="kAll",t[t.kNonNegative=1]="kNonNegative",t[t.kInteger=2]="kInteger",t[t.kNonNegativeInteger=3]="kNonNegativeInteger",t[t.kPositiveInteger=4]="kPositiveInteger"}(gn||(gn={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(xn||(xn={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(En||(En={}));var In,Dn=[{name:"em",unit_type:t.UnitType.kEms},{name:"px",unit_type:t.UnitType.kPixels},{name:"deg",unit_type:t.UnitType.kDegrees},{name:"rad",unit_type:t.UnitType.kRadians},{name:"grad",unit_type:t.UnitType.kGradians},{name:"ms",unit_type:t.UnitType.kMilliseconds},{name:"s",unit_type:t.UnitType.kSeconds},{name:"rem",unit_type:t.UnitType.kRems},{name:"turn",unit_type:t.UnitType.kTurns}];!function(t){t[t.kUnknownType=0]="kUnknownType",t[t.kUnparsedType=1]="kUnparsedType",t[t.kKeywordType=2]="kKeywordType",t[t.kUnitType=3]="kUnitType",t[t.kSumType=4]="kSumType",t[t.kProductType=5]="kProductType",t[t.kNegateType=6]="kNegateType",t[t.kInvertType=7]="kInvertType",t[t.kMinType=8]="kMinType",t[t.kMaxType=9]="kMaxType",t[t.kClampType=10]="kClampType",t[t.kTransformType=11]="kTransformType",t[t.kPositionType=12]="kPositionType",t[t.kURLImageType=13]="kURLImageType",t[t.kColorType=14]="kColorType",t[t.kUnsupportedColorType=15]="kUnsupportedColorType"}(In||(In={}));var Fn,Gn=function(e){return e?"number"===e?t.UnitType.kNumber:"percent"===e||"%"===e?t.UnitType.kPercentage:function(t){return Dn.find((function(e){return e.name===t})).unit_type}(e):t.UnitType.kUnknown},Bn=function(e){var n=1;switch(e){case t.UnitType.kPixels:case t.UnitType.kDegrees:case t.UnitType.kSeconds:break;case t.UnitType.kMilliseconds:n=.001;break;case t.UnitType.kRadians:n=180/Math.PI;break;case t.UnitType.kGradians:n=.9;break;case t.UnitType.kTurns:n=360}return n},Un=function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return"";case t.UnitType.kPercentage:return"%";case t.UnitType.kEms:return"em";case t.UnitType.kRems:return"rem";case t.UnitType.kPixels:return"px";case t.UnitType.kDegrees:return"deg";case t.UnitType.kRadians:return"rad";case t.UnitType.kGradians:return"grad";case t.UnitType.kMilliseconds:return"ms";case t.UnitType.kSeconds:return"s";case t.UnitType.kTurns:return"turn"}return""},zn=function(){function e(){}e.isAngle=function(e){return e===t.UnitType.kDegrees||e===t.UnitType.kRadians||e===t.UnitType.kGradians||e===t.UnitType.kTurns},e.isLength=function(e){return e>=t.UnitType.kEms&&t.UnitType.kDegrees>e},e.isRelativeUnit=function(e){return e===t.UnitType.kPercentage||e===t.UnitType.kEms||e===t.UnitType.kRems},e.isTime=function(e){return e===t.UnitType.kSeconds||e===t.UnitType.kMilliseconds};var n=e.prototype;return n.toString=function(){return this.buildCSSText(xn.kNo,En.kNo,"")},n.isNumericValue=function(){return this.getType()>=In.kUnitType&&this.getType()<=In.kClampType},e}(),Vn=function(t){function e(e){var n;return(n=t.call(this)||this).colorSpace=void 0,n.colorSpace=e,n}Cn(e,t);var n=e.prototype;return n.getType=function(){return In.kColorType},n.to=function(t){return this},e}(zn);(Fn=t.GradientType||(t.GradientType={}))[Fn.Constant=0]="Constant",Fn[Fn.LinearGradient=1]="LinearGradient",Fn[Fn.RadialGradient=2]="RadialGradient";var jn=function(t){function e(e,n){var r;return(r=t.call(this)||this).type=void 0,r.value=void 0,r.type=e,r.value=n,r}Cn(e,t);var n=e.prototype;return n.clone=function(){return new e(this.type,this.value)},n.buildCSSText=function(t,e,n){return n},n.getType=function(){return In.kColorType},e}(zn),Hn=function(t){function e(e){var n;return(n=t.call(this)||this).value=void 0,n.value=e,n}Cn(e,t);var n=e.prototype;return n.clone=function(){return new e(this.value)},n.getType=function(){return In.kKeywordType},n.buildCSSText=function(t,e,n){return n+this.value},e}(zn);function Wn(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function n(){for(var r=arguments.length,i=Array(r),o=0;r>o;o++)i[o]=arguments[o];var a=e?e.apply(this,i):i[0],s=n.cache;if(s.has(a))return s.get(a);var u=t.apply(this,i);return n.cache=s.set(a,u)||s,u};return n.cache=new(Wn.Cache||Map),n}Wn.Cache=Map;var Yn=Wn((function(t){return void 0===t&&(t=""),t.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))})),Xn=function(t){return t.split("").map((function(t,e){return t.toUpperCase()===t?(0!==e?"-":"")+t.toLowerCase():t})).join("")};function qn(t){return"function"==typeof t}var Kn={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},Zn=Wn((function(t){var e=Yn(t),n=Kn[e];return e=(null==n?void 0:n.alias)||e})),Qn=function(t,e){void 0===e&&(e="");var n="";return Number.isFinite(t)?(!function(t){if(!t)throw Error()}(Number.isNaN(t)),n="NaN"):n=t>0?"infinity":"-infinity",n+e},$n=function(e){return function(e){switch(e){case yn.kUNumber:return t.UnitType.kNumber;case yn.kULength:return t.UnitType.kPixels;case yn.kUPercent:return t.UnitType.kPercentage;case yn.kUTime:return t.UnitType.kSeconds;case yn.kUAngle:return t.UnitType.kDegrees;default:return t.UnitType.kUnknown}}(function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return yn.kUNumber;case t.UnitType.kPercentage:return yn.kUPercent;case t.UnitType.kPixels:return yn.kULength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return yn.kUTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return yn.kUAngle;default:return yn.kUOther}}(e))},Jn=function(e){function n(n,r){var i,o;return void 0===r&&(r=t.UnitType.kNumber),(i=e.call(this)||this).unit=void 0,i.value=void 0,o="string"==typeof r?Gn(r):r,i.unit=o,i.value=n,i}Cn(n,e);var r=n.prototype;return r.clone=function(){return new n(this.value,this.unit)},r.equals=function(t){return this.value===t.value&&this.unit===t.unit},r.getType=function(){return In.kUnitType},r.convertTo=function(e){if(this.unit===e)return new n(this.value,this.unit);var r=$n(this.unit);if(r!==$n(e)||r===t.UnitType.kUnknown)return null;var i=Bn(this.unit)/Bn(e);return new n(this.value*i,e)},r.buildCSSText=function(e,n,r){var i;switch(this.unit){case t.UnitType.kUnknown:break;case t.UnitType.kInteger:i=Number(this.value).toFixed(0);break;case t.UnitType.kNumber:case t.UnitType.kPercentage:case t.UnitType.kEms:case t.UnitType.kRems:case t.UnitType.kPixels:case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:case t.UnitType.kTurns:var o=this.value,a=Un(this.unit);if(-999999>o||o>999999){var s=Un(this.unit);i=!Number.isFinite(o)||Number.isNaN(o)?Qn(o,s):o+(s||"")}else i=""+o+a}return r+=i},n}(zn),tr=new Jn(0,"px"),er=(new Jn(1,"px"),new Jn(0,"deg")),nr=function(t){function e(e,n,r,i,o){var a;return void 0===i&&(i=1),void 0===o&&(o=!1),(a=t.call(this,"rgb")||this).r=void 0,a.g=void 0,a.b=void 0,a.alpha=void 0,a.isNone=void 0,a.r=e,a.g=n,a.b=r,a.alpha=i,a.isNone=o,a}Cn(e,t);var n=e.prototype;return n.clone=function(){return new e(this.r,this.g,this.b,this.alpha)},n.buildCSSText=function(t,e,n){return n+"rgba("+this.r+","+this.g+","+this.b+","+this.alpha+")"},e}(Vn),rr={number:function(t){return new Jn(t)},percent:function(t){return new Jn(t,"%")},px:function(t){return new Jn(t,"px")},em:function(t){return new Jn(t,"em")},rem:function(t){return new Jn(t,"rem")},deg:function(t){return new Jn(t,"deg")},grad:function(t){return new Jn(t,"grad")},rad:function(t){return new Jn(t,"rad")},turn:function(t){return new Jn(t,"turn")},s:function(t){return new Jn(t,"s")},ms:function(t){return new Jn(t,"ms")},registerProperty:function(t){Zs.styleValueRegistry.registerMetadata({n:t.name,inh:t.inherits,int:t.interpolable,d:t.initialValue,syntax:t.syntax})},registerLayout:function(t,e){Zs.layoutRegistry.registerLayout(t,e)}},ir=new Hn("unset"),or=new Hn("initial"),ar=new Hn("inherit"),sr={"":ir,unset:ir,initial:or,inherit:ar},ur=function(t){return sr[t]||(sr[t]=new Hn(t)),sr[t]},cr=new nr(0,0,0,0,!0),lr=new nr(0,0,0,0),hr=Wn((function(t,e,n,r){return new nr(t,e,n,r)}),(function(t,e,n,r){return"rgba("+t+","+e+","+n+","+r+")"})),fr=function(e,n){return void 0===n&&(n=t.UnitType.kNumber),new Jn(e,n)},dr=new Jn(50,"%"),pr={},vr=0;var mr="undefined"!=typeof window&&void 0!==window.document;function yr(t,e){var n=Number(t.parsedStyle.zIndex),r=Number(e.parsedStyle.zIndex);if(n===r){var i=t.parentNode;if(i){var o=i.childNodes||[];return o.indexOf(t)-o.indexOf(e)}}return n-r}function gr(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}var xr="px";function Er(t,e){if(mr)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var br="Method not implemented.",Tr="Use document.documentElement instead.",Sr={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};function Pr(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Mr(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function wr(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function kr(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function Nr(t){return void 0===t?0:t>360||-360>t?t%360:t}function Cr(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Array.isArray(t)&&3===t.length?R(t):se(t)?I(t,e,n):I(t[0],t[1]||e,t[2]||n)}function Ar(t){return t*(Math.PI/180)}function Or(t){return t*(180/Math.PI)}function Lr(t){return 360*t}function Rr(t,e){return 16===e.length?function(t,e){var n,r,i=.5*Math.PI,o=T(L(),e),a=o[0],s=o[1],u=o[2],c=Math.asin(-e[2]/a);return i>c?c>-i?(n=Math.atan2(e[6]/s,e[10]/u),r=Math.atan2(e[1]/a,e[0]/a)):(r=0,n=-Math.atan2(e[4]/s,e[5]/s)):(r=0,n=Math.atan2(e[4]/s,e[5]/s)),t[0]=n,t[1]=c,t[2]=r,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=r*r,s=i*i,u=o*o,c=n*n+a+s+u,l=n*o-r*i;return l>.499995*c?(t[0]=Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):-.499995*c>l?(t[0]=-Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-o*r)),t[1]=Math.atan2(2*(n*o+r*i),1-2*(s+u)),t[2]=Math.atan2(2*(n*r+i*o),1-2*(a+s))),t}(t,e)}function _r(t,e,n,r,o){var a,s,u,c,l,h,f,d,p,v,m=Math.cos(t),y=Math.sin(t);return a=r*m,s=o*y,u=0,c=-r*y,l=o*m,h=0,f=e,d=n,p=1,(v=new i(9))[0]=a,v[1]=s,v[2]=u,v[3]=c,v[4]=l,v[5]=h,v[6]=f,v[7]=d,v[8]=p,v}function Ir(t){var e=t[0],n=t[1],r=t[3],i=t[4],o=Math.sqrt(e*e+n*n),a=Math.sqrt(r*r+i*i);0>e*i-n*r&&(i>e?o=-o:a=-a),o&&(e*=1/o,n*=1/o),a&&(r*=1/a,i*=1/a);var s=Or(Math.atan2(n,e));return[t[6],t[7],o,a,s]}var Dr=a(),Fr=a(),Gr=Z(),Br=[L(),L(),L()],Ur=L();function zr(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 Vr=a();function jr(t,e){if(t&&t.length){var n=0,r=0;e?(n=e.parsedStyle.defX||0,r=e.parsedStyle.defY||0,e.resetLocalTransform(),e.setLocalPosition(n,r)):e=new ja({}),t.forEach((function(t){var i=t.t,o=t.d;if("scale"===i){var a=(null==o?void 0:o.map((function(t){return t.value})))||[1,1];e.scaleLocal(a[0],a[1],1)}else if("scalex"===i){var s=(null==o?void 0:o.map((function(t){return t.value})))||[1];e.scaleLocal(s[0],1,1)}else if("scaley"===i){var u=(null==o?void 0:o.map((function(t){return t.value})))||[1];e.scaleLocal(1,u[0],1)}else if("scalez"===i){var l=(null==o?void 0:o.map((function(t){return t.value})))||[1];e.scaleLocal(1,1,l[0])}else if("scale3d"===i){var h=(null==o?void 0:o.map((function(t){return t.value})))||[1,1,1];e.scaleLocal(h[0],h[1],h[2])}else if("translate"===i){var f=o||[tr,tr];e.translateLocal(f[0].value,f[1].value,0)}else if("translatex"===i){e.translateLocal((o||[tr])[0].value,0,0)}else if("translatey"===i){e.translateLocal(0,(o||[tr])[0].value,0)}else if("translatez"===i){e.translateLocal(0,0,(o||[tr])[0].value)}else if("translate3d"===i){var d=o||[tr,tr,tr];e.translateLocal(d[0].value,d[1].value,d[2].value)}else if("rotate"===i){e.rotateLocal(0,0,ao((o||[er])[0]))}else if("rotatex"===i){e.rotateLocal(ao((o||[er])[0]),0,0)}else if("rotatey"===i){e.rotateLocal(0,ao((o||[er])[0]),0)}else if("rotatez"===i){e.rotateLocal(0,0,ao((o||[er])[0]))}else if("rotate3d"===i);else if("skew"===i){var p=(null==o?void 0:o.map((function(t){return t.value})))||[0,0];e.setLocalSkew(Ar(p[0]),Ar(p[1]))}else if("skewx"===i){var v=(null==o?void 0:o.map((function(t){return t.value})))||[0];e.setLocalSkew(Ar(v[0]),e.getLocalSkew()[1])}else if("skewy"===i){var m=(null==o?void 0:o.map((function(t){return t.value})))||[0];e.setLocalSkew(e.getLocalSkew()[0],Ar(m[0]))}else if("matrix"===i){var y=o.map((function(t){return t.value}));e.setLocalTransform(c(Vr,y[0],y[1],0,0,y[2],y[3],0,0,0,0,1,0,y[4]+n,y[5]+r,0,1))}else"matrix3d"===i&&(c.apply(O,[Vr].concat(o.map((function(t){return t.value})))),Vr[12]+=n,Vr[13]+=r,e.setLocalTransform(Vr))}))}return e.getLocalTransform()}function Hr(t){var e=t.type,n=t.value;return"hex"===e?"#"+n:"literal"===e?n:"rgb"===e?"rgb("+n.join(",")+")":"rgba("+n.join(",")+")"}var Wr,Yr=function(){var t={linearGradient:/^(linear\-gradient)/i,repeatingLinearGradient:/^(repeating\-linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,repeatingRadialGradient:/^(repeating\-radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},e="";function n(t){throw Error(e+": "+t)}function r(){var t=d(i);return e.length>0&&n("Invalid input not EOF"),t}function i(){return o("linear-gradient",t.linearGradient,s)||o("repeating-linear-gradient",t.repeatingLinearGradient,s)||o("radial-gradient",t.radialGradient,u)||o("repeating-radial-gradient",t.repeatingRadialGradient,u)||o("conic-gradient",t.conicGradient,u)}function o(e,r,i){return a(r,(function(r){var o=i();return o&&(x(t.comma)||n("Missing comma before color stops")),{type:e,orientation:o,colorStops:d(p)}}))}function a(e,r){var i=x(e);if(i){x(t.startCall)||n("Missing (");var o=r(i);return x(t.endCall)||n("Missing )"),o}}function s(){return g("directional",t.sideOrCorner,1)||g("angular",t.angleValue,1)}function u(){var n,r,i=c();return i&&((n=[]).push(i),r=e,x(t.comma)&&((i=c())?n.push(i):e=r)),n}function c(){var t=function(){var t=g("shape",/^(circle)/i,0);t&&(t.style=y()||l());return t}()||function(){var t=g("shape",/^(ellipse)/i,0);t&&(t.style=m()||l());return t}();if(t)t.at=h();else{var e=l();if(e){t=e;var n=h();n&&(t.at=n)}else{var r=f();r&&(t={type:"default-radial",at:r})}}return t}function l(){return g("extent-keyword",t.extentKeywords,1)}function h(){if(g("position",/^at/,0)){var t=f();return t||n("Missing positioning value"),t}}function f(){var t={x:m(),y:m()};if(t.x||t.y)return{type:"position",value:t}}function d(e){var r=e(),i=[];if(r)for(i.push(r);x(t.comma);)(r=e())?i.push(r):n("One extra comma");return i}function p(){var e=g("hex",t.hexColor,1)||a(t.rgbaColor,(function(){return{type:"rgba",value:d(v)}}))||a(t.rgbColor,(function(){return{type:"rgb",value:d(v)}}))||g("literal",t.literalColor,0);return e||n("Expected color definition"),e.length=m(),e}function v(){return x(t.number)[1]}function m(){return g("%",t.percentageValue,1)||g("position-keyword",t.positionKeywords,1)||y()}function y(){return g("px",t.pixelValue,1)||g("em",t.emValue,1)}function g(t,e,n){var r=x(e);if(r)return{type:t,value:r[n]}}function x(t){var n=/^[\n\r\t\s]+/.exec(e);n&&E(n[0].length);var r=t.exec(e);return r&&E(r[0].length),r}function E(t){e=e.substring(t)}return function(t){return e=t,r()}}();function Xr(t){var e;return 0===t.parsedStyle.path.totalLength&&(t.parsedStyle.path.totalLength=qt(t.parsedStyle.path.absolutePath,void 0,vt(vt({},e),{bbox:!1,length:!0})).length),t.parsedStyle.path.totalLength}function qr(t,e){return t[0]===e[0]&&t[1]===e[1]}function Kr(t,e){var n,r=t.prePoint,i=t.currentPoint,o=t.nextPoint,a=Math.pow(i[0]-r[0],2)+Math.pow(i[1]-r[1],2),s=Math.pow(i[0]-o[0],2)+Math.pow(i[1]-o[1],2),u=Math.acos((a+s-(Math.pow(r[0]-o[0],2)+Math.pow(r[1]-o[1],2)))/(2*Math.sqrt(a)*Math.sqrt(s)));if(!u||0===Math.sin(u)||(void 0===n&&(n=ue),n>Math.abs(u-0)))return{xExtra:0,yExtra:0};var c=Math.abs(Math.atan2(o[1]-i[1],o[0]-i[0])),l=Math.abs(Math.atan2(o[0]-i[0],o[1]-i[1]));return l=l>Math.PI/2?Math.PI-l:l,{xExtra:Math.cos(u/2-(c=c>Math.PI/2?Math.PI-c:c))*(e/2*(1/Math.sin(u/2)))-e/2||0,yExtra:Math.cos(l-u/2)*(e/2*(1/Math.sin(u/2)))-e/2||0}}function Zr(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}(Wr=t.Shape||(t.Shape={})).GROUP="g",Wr.CIRCLE="circle",Wr.ELLIPSE="ellipse",Wr.IMAGE="image",Wr.RECT="rect",Wr.LINE="line",Wr.POLYLINE="polyline",Wr.POLYGON="polygon",Wr.TEXT="text",Wr.PATH="path",Wr.HTML="html",Wr.MESH="mesh";var Qr=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))))},$r=function(t,e,n,r,i,o,a,s){e=Math.abs(e),n=Math.abs(n);var u=Ar(r=ce(r,360));if(t.x===a.x&&t.y===a.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===e||0===n)return{x:0,y:0,ellipticalArcAngle:0};var c=(t.x-a.x)/2,l=(t.y-a.y)/2,h={x:Math.cos(u)*c+Math.sin(u)*l,y:-Math.sin(u)*c+Math.cos(u)*l},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)),p=(i!==o?1:-1)*Math.sqrt(d=0>d?0:d),v=p*(e*h.y/n),m=p*(-n*h.x/e),y={x:Math.cos(u)*v-Math.sin(u)*m+(t.x+a.x)/2,y:Math.sin(u)*v+Math.cos(u)*m+(t.y+a.y)/2},g={x:(h.x-v)/e,y:(h.y-m)/n},x=Qr({x:1,y:0},g),E=Qr(g,{x:(-h.x-v)/e,y:(-h.y-m)/n});!o&&E>0?E-=2*Math.PI:o&&0>E&&(E+=2*Math.PI);var b=x+(E%=2*Math.PI)*s,T=e*Math.cos(b),S=n*Math.sin(b);return{x:Math.cos(u)*T-Math.sin(u)*S+y.x,y:Math.sin(u)*T+Math.cos(u)*S+y.y,ellipticalArcStartAngle:x,ellipticalArcEndAngle:x+E,ellipticalArcAngle:b,ellipticalArcCenter:y,resultantRx:e,resultantRy:n}};function Jr(t,e,n){void 0===n&&(n=!0);var r=t.arcParams,i=r.rx,o=void 0===i?0:i,a=r.ry,s=void 0===a?0:a,u=r.xRotation,c=r.arcFlag,l=r.sweepFlag,h=$r({x:t.prePoint[0],y:t.prePoint[1]},o,s,u,!!c,!!l,{x:t.currentPoint[0],y:t.currentPoint[1]},e),f=$r({x:t.prePoint[0],y:t.prePoint[1]},o,s,u,!!c,!!l,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),d=f.x-h.x,p=f.y-h.y,v=Math.sqrt(d*d+p*p);return{x:-d/v,y:-p/v}}function ti(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function ei(t,e){return ti(t)*ti(e)?(t[0]*e[0]+t[1]*e[1])/(ti(t)*ti(e)):1}function ni(t,e){return(t[1]*e[0]>t[0]*e[1]?-1:1)*Math.acos(ei(t,e))}function ri(t,e){var n=e[1],r=e[2],i=ce(Ar(e[3]),2*Math.PI),o=e[4],a=e[5],s=t[0],u=t[1],c=e[6],l=e[7],h=Math.cos(i)*(s-c)/2+Math.sin(i)*(u-l)/2,f=-1*Math.sin(i)*(s-c)/2+Math.cos(i)*(u-l)/2,d=h*h/(n*n)+f*f/(r*r);d>1&&(n*=Math.sqrt(d),r*=Math.sqrt(d));var p=n*n*(f*f)+r*r*(h*h),v=p?Math.sqrt((n*n*(r*r)-p)/p):1;o===a&&(v*=-1),isNaN(v)&&(v=0);var m=r?v*n*f/r:0,y=n?v*-r*h/n:0,g=(s+c)/2+Math.cos(i)*m-Math.sin(i)*y,x=(u+l)/2+Math.sin(i)*m+Math.cos(i)*y,E=[(h-m)/n,(f-y)/r],b=[(-1*h-m)/n,(-1*f-y)/r],T=ni([1,0],E),S=ni(E,b);return ei(E,b)>-1||(S=Math.PI),1>ei(E,b)||(S=0),0===a&&S>0&&(S-=2*Math.PI),1===a&&0>S&&(S+=2*Math.PI),{cx:g,cy:x,rx:qr(t,[c,l])?0:n,ry:qr(t,[c,l])?0:r,startAngle:T,endAngle:T+S,xRotation:i,arcFlag:o,sweepFlag:a}}function ii(t,e,n,r){var i=.5522847498307936,o=t*i,a=e*i,s=n-t,u=n+t,c=r-e,l=r+e;return[["M",s,r],["C",s,r-a,n-o,c,n,c],["C",n+o,c,u,r-a,u,r],["C",u,r+a,n+o,l,n,l],["C",n-o,l,s,r+a,s,r],["Z"]]}var oi=function(){return this.call=this._createCall("sync"),this.call.apply(this,arguments)},ai=function(){return this.callAsync=this._createCall("async"),this.callAsync.apply(this,arguments)},si=function(){return this.promise=this._createCall("promise"),this.promise.apply(this,arguments)},ui=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e=void 0),this.name=void 0,this.taps=void 0,this.promise=void 0,this._promise=void 0,this._args=t,this.name=e,this.taps=[],this.interceptors=[],this._call=oi,this.call=oi,this._callAsync=ai,this.callAsync=ai,this._promise=si,this.promise=si,this._x=void 0}var e=t.prototype;return e.compile=function(t){throw Error("Abstract: should be overridden")},e._createCall=function(t){return this.compile({taps:this.taps,interceptors:this.interceptors,args:this._args,type:t})},e._tap=function(t,e,n){if("string"==typeof e)e={name:e.trim()};else if("object"!=typeof e||null===e)throw Error("Invalid tap options");if("string"!=typeof e.name||""===e.name)throw Error("Missing name for tap");e=Object.assign({type:t,fn:n},e),e=this._runRegisterInterceptors(e),this._insert(e)},e.tap=function(t,e){this._tap("sync",t,e)},e.tapAsync=function(t,e){this._tap("async",t,e)},e.tapPromise=function(t,e){this._tap("promise",t,e)},e._runRegisterInterceptors=function(t){for(var e,n=_n(this.interceptors);!(e=n()).done;){var r=e.value;if(r.register){var i=r.register(t);void 0!==i&&(t=i)}}return t},e.withOptions=function(t){var e=this,n=function(e){return Object.assign({},t,"string"==typeof e?{name:e}:e)};return{name:this.name,tap:function(t,r){return e.tap(n(t),r)},tapAsync:function(t,r){return e.tapAsync(n(t),r)},tapPromise:function(t,r){return e.tapPromise(n(t),r)},isUsed:function(){return e.isUsed()},withOptions:function(t){return e.withOptions(n(t))}}},e.isUsed=function(){return this.taps.length>0||this.interceptors.length>0},e._resetCompilation=function(){this.call=this._call,this.callAsync=this._callAsync,this.promise=this._promise},e._insert=function(t){var e;this._resetCompilation(),"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));var n=0;"number"==typeof t.stage&&(n=t.stage);for(var r=this.taps.length;r>0;){r--;var i=this.taps[r];this.taps[r+1]=i;var o=i.stage||0;if(e){if(e.has(i.name)){e.delete(i.name);continue}if(e.size>0)continue}if(n>=o){r++;break}}this.taps[r]=t},t}(),ci=function(){function t(t){this.config=t,this.options=void 0,this._args=void 0}var e=t.prototype;return e.create=function(t){var e;switch(this.init(t),this.options.type){case"sync":e=Function(this.args(),'"use strict";\n'+this.header()+this.contentWithInterceptors({onError:function(t){return"throw "+t+";\n"},onResult:function(t){return"return "+t+";\n"},resultReturns:!0,onDone:function(){return""},rethrowIfPossible:!0}));break;case"async":e=Function(this.args({after:"_callback"}),'"use strict";\n'+this.header()+this.contentWithInterceptors({onError:function(t){return"_callback("+t+");\n"},onResult:function(t){return"_callback(null, "+t+");\n"},onDone:function(){return"_callback();\n"}}));break;case"promise":var n=!1,r=this.contentWithInterceptors({onError:function(t){return n=!0,"_error("+t+");\n"},onResult:function(t){return"_resolve("+t+");\n"},onDone:function(){return"_resolve();\n"}}),i="";i+='"use strict";\n',i+=this.header(),i+="return new Promise((function(_resolve, _reject) {\n",n&&(i+="var _sync = true;\n",i+="function _error(_err) {\n",i+="if(_sync)\n",i+="_resolve(Promise.resolve().then((function() { throw _err; })));\n",i+="else\n",i+="_reject(_err);\n",i+="};\n"),i+=r,n&&(i+="_sync = false;\n"),i+="}));\n",e=Function(this.args(),i)}return this.deinit(),e},e.setup=function(t,e){t._x=e.taps.map((function(t){return t.fn}))},e.init=function(t){this.options=t,this._args=t.args.slice()},e.deinit=function(){this.options=void 0,this._args=void 0},e.contentWithInterceptors=function(t){var e=this;if(this.options.interceptors.length>0){for(var n=t.onError,r=t.onResult,i=t.onDone,o="",a=0;this.options.interceptors.length>a;a++){var s=this.options.interceptors[a];s.call&&(o+=this.getInterceptor(a)+".call("+this.args({before:s.context?"_context":void 0})+");\n")}return o+=this.content(Object.assign(t,{onError:n&&function(t){for(var r="",i=0;e.options.interceptors.length>i;i++){e.options.interceptors[i].error&&(r+=e.getInterceptor(i)+".error("+t+");\n")}return r+=n(t)},onResult:r&&function(t){for(var n="",i=0;e.options.interceptors.length>i;i++){e.options.interceptors[i].result&&(n+=e.getInterceptor(i)+".result("+t+");\n")}return n+=r(t)},onDone:i&&function(){for(var t="",n=0;e.options.interceptors.length>n;n++){e.options.interceptors[n].done&&(t+=e.getInterceptor(n)+".done();\n")}return t+=i()}}))}return this.content(t)},e.header=function(){var t="";return this.needContext()?t+="var _context = {};\n":t+="var _context;\n",t+="var _x = this._x;\n",this.options.interceptors.length>0&&(t+="var _taps = this.taps;\n",t+="var _interceptors = this.interceptors;\n"),t},e.needContext=function(){for(var t,e=_n(this.options.taps);!(t=e()).done;){if(t.value.context)return!0}return!1},e.callTap=function(t,e){for(var n=e.onError,r=e.onResult,i=e.onDone,o=e.rethrowIfPossible,a="",s=!1,u=0;this.options.interceptors.length>u;u++){var c=this.options.interceptors[u];c.tap&&(s||(a+="var _tap"+t+" = "+this.getTap(t)+";\n",s=!0),a+=this.getInterceptor(u)+".tap("+(c.context?"_context, ":"")+"_tap"+t+");\n")}a+="var _fn"+t+" = "+this.getTapFn(t)+";\n";var l=this.options.taps[t];switch(l.type){case"sync":o||(a+="var _hasError"+t+" = false;\n",a+="try {\n"),a+=r?"var _result"+t+" = _fn"+t+"("+this.args({before:l.context?"_context":void 0})+");\n":"_fn"+t+"("+this.args({before:l.context?"_context":void 0})+");\n",o||(a+="} catch(_err) {\n",a+="_hasError"+t+" = true;\n",a+=n("_err"),a+="}\n",a+="if(!_hasError"+t+") {\n"),r&&(a+=r("_result"+t)),i&&(a+=i()),o||(a+="}\n");break;case"async":var h="";h+=r?"(function(_err"+t+", _result"+t+") {\n":"(function(_err"+t+") {\n",h+="if(_err"+t+") {\n",h+=n("_err"+t),h+="} else {\n",r&&(h+=r("_result"+t)),i&&(h+=i()),h+="}\n",a+="_fn"+t+"("+this.args({before:l.context?"_context":void 0,after:h+="})"})+");\n";break;case"promise":a+="var _hasResult"+t+" = false;\n",a+="var _promise"+t+" = _fn"+t+"("+this.args({before:l.context?"_context":void 0})+");\n",a+="if (!_promise"+t+" || !_promise"+t+".then)\n",a+=" throw new Error('Tap function (tapPromise) did not return promise (returned ' + _promise"+t+" + ')');\n",a+="_promise"+t+".then((function(_result"+t+") {\n",a+="_hasResult"+t+" = true;\n",r&&(a+=r("_result"+t)),i&&(a+=i()),a+="}), function(_err"+t+") {\n",a+="if(_hasResult"+t+") throw _err"+t+";\n",a+=n("_err"+t),a+="});\n"}return a},e.callTapsSeries=function(t){var e=this,n=t.onError,r=t.onResult,i=t.resultReturns,o=t.onDone,a=t.doneReturns,s=t.rethrowIfPossible;if(0===this.options.taps.length)return o();for(var u=this.options.taps.findIndex((function(t){return"sync"!==t.type})),c=i||a,l="",h=o,f=0,d=function(){var t=p;h!==o&&("sync"!==e.options.taps[t].type||f++>20)&&(f=0,l+="function _next"+t+"() {\n",l+=h(),l+="}\n",h=function(){return(c?"return ":"")+"_next"+t+"();\n"});var i=h,a=function(t){return t?"":o()},d=e.callTap(t,{onError:function(e){return n(t,e,i,a)},onResult:r&&function(e){return r(t,e,i,a)},onDone:!r&&i,rethrowIfPossible:s&&(0>u||u>t)});h=function(){return d}},p=this.options.taps.length-1;p>=0;p--)d();return l+=h()},e.callTapsLooping=function(t){var e=t.onError,n=t.onDone,r=t.rethrowIfPossible;if(0===this.options.taps.length)return n();var i=this.options.taps.every((function(t){return"sync"===t.type})),o="";i||(o+="var _looper = (function() {\n",o+="var _loopAsync = false;\n"),o+="var _loop;\n",o+="do {\n",o+="_loop = false;\n";for(var a=0;this.options.interceptors.length>a;a++){var s=this.options.interceptors[a];s.loop&&(o+=this.getInterceptor(a)+".loop("+this.args({before:s.context?"_context":void 0})+");\n")}return o+=this.callTapsSeries({onError:e,onResult:function(t,e,n,r){var o="";return o+="if("+e+" !== undefined) {\n",o+="_loop = true;\n",i||(o+="if(_loopAsync) _looper();\n"),o+=r(!0),o+="} else {\n",o+=n(),o+="}\n"},onDone:n&&function(){var t="";return t+="if(!_loop) {\n",t+=n(),t+="}\n"},rethrowIfPossible:r&&i}),o+="} while(_loop);\n",i||(o+="_loopAsync = true;\n",o+="});\n",o+="_looper();\n"),o},e.callTapsParallel=function(t){var e=this,n=t.onError,r=t.onResult,i=t.onDone,o=t.rethrowIfPossible,a=t.onTap,s=void 0===a?function(t,e){return e()}:a;if(1>=this.options.taps.length)return this.callTapsSeries({onError:n,onResult:r,onDone:i,rethrowIfPossible:o});var u="";u+="do {\n",u+="var _counter = "+this.options.taps.length+";\n",i&&(u+="var _done = (function() {\n",u+=i(),u+="});\n");for(var c=function(t){var a=function(){return i?"if(--_counter === 0) _done();\n":"--_counter;"},c=function(t){return t||!i?"_counter = 0;\n":"_counter = 0;\n_done();\n"};u+="if(_counter <= 0) break;\n",u+=s(t,(function(){return e.callTap(t,{onError:function(e){var r="";return r+="if(_counter > 0) {\n",r+=n(t,e,a,c),r+="}\n"},onResult:r&&function(e){var n="";return n+="if(_counter > 0) {\n",n+=r(t,e,a,c),n+="}\n"},onDone:!r&&function(){return a()},rethrowIfPossible:o})}),a,c)},l=0;this.options.taps.length>l;l++)c(l);return u+="} while(false);\n"},e.args=function(t){var e=void 0===t?{}:t,n=e.before,r=e.after,i=this._args;return n&&(i=[n].concat(i)),r&&(i=i.concat(r)),0===i.length?"":i.join(", ")},e.getTapFn=function(t){return"_x["+t+"]"},e.getTap=function(t){return"_taps["+t+"]"},e.getInterceptor=function(t){return"_interceptors["+t+"]"},t}(),li=function(t){function e(){return t.apply(this,arguments)||this}return Cn(e,t),e.prototype.content=function(t){var e=t.onError;return this.callTapsParallel({onError:function(t,n,r,i){return e(n)+i(!0)},onDone:t.onDone})},e}(ci),hi=new li,fi=function(t){return hi.setup(this,t),hi.create(t)},di=function(t){function e(e,n){var r;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(r=t.call(this,e,n)||this).compile=fi,r._call=void 0,r.call=void 0,r}return Cn(e,t),e}(ui),pi=function(t){function e(){return t.apply(this,arguments)||this}return Cn(e,t),e.prototype.content=function(t){var e=this,n=t.onError,r=t.onResult;return this.callTapsSeries({onError:function(t,e,r,i){return n(e)+i(!0)},onResult:function(t,n,r){var i="";return i+="if("+n+" !== undefined) {\n",i+=e._args[0]+" = "+n+";\n",i+="}\n",i+=r()},onDone:function(){return r(e._args[0])}})},e}(ci),vi=new pi,mi=function(t){return vi.setup(this,t),vi.create(t)},yi=function(t){function e(e,n){var r;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(r=t.call(this,e,n)||this).compile=mi,r._call=void 0,r.call=void 0,r}return Cn(e,t),e}(ui),gi=function(t){function e(){return t.apply(this,arguments)||this}return Cn(e,t),e.prototype.content=function(t){var e=t.onError;return this.callTapsSeries({onError:function(t,n){return e(n)},onDone:t.onDone,rethrowIfPossible:t.rethrowIfPossible})},e}(ci),xi=new gi,Ei=function(){throw Error("tapAsync is not supported on a SyncHook")},bi=function(){throw Error("tapPromise is not supported on a SyncHook")},Ti=function(t){return xi.setup(this,t),xi.create(t)},Si=function(t){function e(e,n){var r;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(r=t.call(this,e,n)||this).tapAsync=Ei,r.tapPromise=bi,r.compile=Ti,r}return Cn(e,t),e}(ui),Pi=function(t){function e(){return t.apply(this,arguments)||this}return Cn(e,t),e.prototype.content=function(t){var e=this,n=t.onError,r=t.onResult;return this.callTapsSeries({onError:function(t,e){return n(e)},onResult:function(t,n,r){var i="";return i+="if("+n+" !== undefined) {\n",i+=e._args[0]+" = "+n+";\n",i+="}\n",i+=r()},onDone:function(){return r(e._args[0])},doneReturns:t.resultReturns,rethrowIfPossible:t.rethrowIfPossible})},e}(ci),Mi=new Pi,wi=function(){throw Error("tapAsync is not supported on a SyncWaterfallHook")},ki=function(){throw Error("tapPromise is not supported on a SyncWaterfallHook")},Ni=function(t){return Mi.setup(this,t),Mi.create(t)},Ci=function(t){function e(e,n){var r;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(r=t.call(this,e,n)||this).tapAsync=wi,r.tapPromise=ki,r.compile=Ni,r}return Cn(e,t),e}(Si),Ai=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Oi=/([\"\'])[^\'\"]+\1/;var Li=1,Ri="object"==typeof self&&self.self==self?self:"object"==typeof global&&global.global==global?global:{},_i=Date.now(),Ii={},Di=Date.now(),Fi=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var e=Date.now(),n=e-Di,r=n>16?0:16-n,i=Li++;return Ii[i]=t,Object.keys(Ii).length>1||setTimeout((function(){Di=e;var t=Ii;Ii={},Object.keys(t).forEach((function(e){return t[e](Ri.performance&&"function"==typeof Ri.performance.now?Ri.performance.now():Date.now()-_i)}))}),r),i},Gi=function(t){delete Ii[t]},Bi=function(t){return"string"!=typeof t?Fi:""===t?Ri.requestAnimationFrame:Ri[t+"RequestAnimationFrame"]},Ui=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!!Bi(t)})),zi=Bi(Ui),Vi=function(t){return"string"!=typeof t?Gi:""===t?Ri.cancelAnimationFrame:Ri[t+"CancelAnimationFrame"]||Ri[t+"CancelRequestAnimationFrame"]}(Ui);Ri.requestAnimationFrame=zi,Ri.cancelAnimationFrame=Vi;var ji=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,Hi=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Wi=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Yi=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var Xi={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},qi=Wn((function(t){return fr("angular"===t.type?Number(t.value):Xi[t.value]||0,"deg")})),Ki=Wn((function(t){var e=50,n=50,r="%",i="%";if("position"===(null==t?void 0:t.type)){var o=t.value,a=o.x,s=o.y;"position-keyword"===(null==a?void 0:a.type)&&("left"===a.value?e=0:"center"===a.value?e=50:"right"===a.value?e=100:"top"===a.value?n=0:"bottom"===a.value&&(n=100)),"position-keyword"===(null==s?void 0:s.type)&&("left"===s.value?e=0:"center"===s.value?n=50:"right"===s.value?e=100:"top"===s.value?n=0:"bottom"===s.value&&(n=100)),"px"!==(null==a?void 0:a.type)&&"%"!==(null==a?void 0:a.type)&&"em"!==(null==a?void 0:a.type)||(r=null==a?void 0:a.type,e=Number(a.value)),"px"!==(null==s?void 0:s.type)&&"%"!==(null==s?void 0:s.type)&&"em"!==(null==s?void 0:s.type)||(i=null==s?void 0:s.type,n=Number(s.value))}return{cx:fr(e,r),cy:fr(n,i)}})),Zi=Wn((function(e){if(e.indexOf("linear")>-1||e.indexOf("radial")>-1)return Yr(e).map((function(e){var n=e.type,r=e.orientation,i=e.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,o=Number(t[0].length.value),a=1;r>a;a++){var s,u=null===(s=t[a].length)||void 0===s?void 0:s.value;if(!$t(u)&&!$t(o)){for(var c=1;a-i>c;c++)t[i+c].length={type:"%",value:""+(o+(Number(u)-o)*c/(a-i))};i=a,o=Number(u)}}}(i);var o=i.map((function(t){return{offset:fr(Number(t.length.value),"%"),color:Hr(t)}}));if("linear-gradient"===n)return new jn(t.GradientType.LinearGradient,{angle:r?qi(r):er,steps:o});if("radial-gradient"===n&&(r||(r=[{type:"shape",value:"circle"}]),"shape"===r[0].type&&"circle"===r[0].value)){var a,s=Ki(r[0].at),u=s.cx,c=s.cy;if(r[0].style){var l=r[0].style,h=l.type,f=l.value;a="extent-keyword"===h?ur(f):fr(f,h)}return new jn(t.GradientType.RadialGradient,{cx:u,cy:c,size:a,steps:o})}}));var n=e[0];if("("===e[1]||"("===e[2])if("l"===n){var r=ji.exec(e);if(r){var i,o=(null===(i=r[2].match(Yi))||void 0===i?void 0:i.map((function(t){return t.split(":")})))||[];return[new jn(t.GradientType.LinearGradient,{angle:fr(parseFloat(r[1]),"deg"),steps:o.map((function(t){var e=t[1];return{offset:fr(100*Number(t[0]),"%"),color:e}}))})]}}else if("r"===n){var a=function(t){var e=Hi.exec(t);if(e){var n,r=(null===(n=e[4].match(Yi))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[];return{cx:fr(50,"%"),cy:fr(50,"%"),steps:r.map((function(t){var e=t[1];return{offset:fr(100*Number(t[0]),"%"),color:e}}))}}return null}(e);if(a){if(!oe(a))return[new jn(t.GradientType.RadialGradient,a)];e=a}}else if("p"===n)return function(t){var e=Wi.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}(e)}));function Qi(t){return t&&!!t.image}function $i(t){return t&&!$t(t.r)&&!$t(t.g)&&!$t(t.b)}var Ji=Wn((function(t){if(Qi(t))return Nn({repetition:"repeat"},t);if($t(t)&&(t=""),"transparent"===t)return lr;"currentColor"===t&&(t="black");var e=Zi(t);if(e)return e;var n=Ae(t),r=[0,0,0,0];return null!==n&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),hr.apply(void 0,r)}));function to(t,e){if($i(t)&&$i(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(ae(e[n],0,255));return e[3]=ae(e[3],0,1),"rgba("+e.join(",")+")"}]}function eo(t,e){if($t(e))return fr(0,"px");if(e=(""+e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return fr(Number(e),"px");if("deg".search(t)>=0)return fr(Number(e),"deg")}var n=[];e=e.replace(t,(function(t){return n.push(t),"U"+t}));var r="U("+t.source+")";return n.map((function(t){return fr(Number(e.replace(RegExp("U"+t,"g"),"").replace(RegExp(r,"g"),"*0")),t)}))[0]}var no=Wn((function(t){return eo(/px/g,t)})),ro=(Wn((function(t){return eo(RegExp("%","g"),t)})),function(t){return se(t)||isFinite(Number(t))?fr(Number(t)||0,"px"):eo(RegExp("px|%|em|rem","g"),t)}),io=Wn((function(t){return eo(/deg|rad|grad|turn/g,t)}));function oo(t,e,n,r,i){void 0===i&&(i=0);var o="",a=t.value||0,s=e.value||0,u=$n(t.unit),c=t.convertTo(u),l=e.convertTo(u);return c&&l?(a=c.value,s=l.value,o=Un(t.unit)):(Jn.isLength(t.unit)||Jn.isLength(e.unit))&&(a=co(t,i,n),s=co(e,i,n),o="px"),[a,s,function(t){return r&&(t=Math.max(t,0)),t+o}]}function ao(e){var n=0;return e.unit===t.UnitType.kDegrees?n=e.value:e.unit===t.UnitType.kRadians?n=Or(Number(e.value)):e.unit===t.UnitType.kTurns&&(n=Lr(Number(e.value))),n}function so(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):oe(t)?n=t.split(" ").map((function(t){return Number(t)})):se(t)&&(n=[t]),2===e?1===n.length?[n[0],n[0]]:[n[0],n[1]]:1===n.length?[n[0],n[0],n[0],n[0]]:2===n.length?[n[0],n[1],n[0],n[1]]:3===n.length?[n[0],n[1],n[2],n[1]]:[n[0],n[1],n[2],n[3]]}function uo(t){return oe(t)?t.split(" ").map((function(t){return ro(t)})):t.map((function(t){return ro(""+t)}))}function co(e,n,r){if(0===e.value)return 0;if(e.unit===t.UnitType.kPixels)return Number(e.value);if(e.unit===t.UnitType.kPercentage&&r){var i=r.nodeName===t.Shape.GROUP?r.getLocalBounds():r.geometry.contentBounds;return e.value/100*i.halfExtents[n]*2}return 0}var lo=function(t){return eo(/deg|rad|grad|turn|px|%/g,t)},ho=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function fo(t){if(void 0===t&&(t=""),"none"===(t=t.toLowerCase().trim()))return[];for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];if(i=e.index+e[0].length,ho.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return lo(t)||Ji(t)}))}),n.lastIndex===t.length)return r}return[]}function po(t){return""+t}var vo=Wn((function(t){return fr("number"==typeof t?t:/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Number(t):0)}));Wn((function(t){return oe(t)?t.split(" ").map(vo):t.map(vo)}));function mo(t,e){return[t,e,po]}function yo(t,e){return function(n,r){return[n,r,function(n){return po(ae(n,t,e))}]}}function go(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}var xo=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=Lt(t)}catch(n){e=Lt(""),console.error("[g]: Invalid SVG Path definition: "+t)}var n=function(t){for(var e=!1,n=t.length,r=0;n>r;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e}(e),r=function(t){for(var e=[],n=[],r=[],i=0;t.length>i;i++){var o=t[i],a=o[0];"M"===a?(r.length&&(n.push(r),r=[]),r.push([o[1],o[2]])):"Z"===a?r.length&&(e.push(r),r=[]):r.push([o[1],o[2]])}return r.length>0&&n.push(r),{polygons:e,polylines:n}}(e),i=r.polygons,o=r.polylines,a=function(t){for(var e=[],n=null,r=null,i=null,o=0,a=t.length,s=0;a>s;s++){var u=t[s];r=t[s+1];var c=u[0],l={command:c,prePoint:n,params:u,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(c){case"M":i=[u[1],u[2]],o=s;break;case"A":var h=ri(n,u);l.arcParams=h}if("Z"===c)n=i,r=t[o+1];else{var f=u.length;n=[u[f-2],u[f-1]]}r&&"Z"===r[0]&&(r=t[o],e[o]&&(e[o].prePoint=n)),l.currentPoint=n,e[o]&&qr(n,e[o].currentPoint)&&(e[o].prePoint=l.prePoint),l.nextPoint=r?[r[r.length-2],r[r.length-1]]:null;var d=l.prePoint;if(["L","H","V"].includes(c))l.startTangent=[d[0]-n[0],d[1]-n[1]],l.endTangent=[n[0]-d[0],n[1]-d[1]];else if("Q"===c){var p=[u[1],u[2]];l.startTangent=[d[0]-p[0],d[1]-p[1]],l.endTangent=[n[0]-p[0],n[1]-p[1]]}else if("T"===c){var v=e[s-1],m=Zr(v.currentPoint,d);"Q"===v.command?(l.command="Q",l.startTangent=[d[0]-m[0],d[1]-m[1]],l.endTangent=[n[0]-m[0],n[1]-m[1]]):(l.command="TL",l.startTangent=[d[0]-n[0],d[1]-n[1]],l.endTangent=[n[0]-d[0],n[1]-d[1]])}else if("C"===c){var y=[u[1],u[2]],g=[u[3],u[4]];l.startTangent=[d[0]-y[0],d[1]-y[1]],l.endTangent=[n[0]-g[0],n[1]-g[1]],0===l.startTangent[0]&&0===l.startTangent[1]&&(l.startTangent=[y[0]-g[0],y[1]-g[1]]),0===l.endTangent[0]&&0===l.endTangent[1]&&(l.endTangent=[g[0]-y[0],g[1]-y[1]])}else if("S"===c){var x=e[s-1],E=Zr(x.currentPoint,d),b=[u[1],u[2]];"C"===x.command?(l.command="C",l.startTangent=[d[0]-E[0],d[1]-E[1]],l.endTangent=[n[0]-b[0],n[1]-b[1]]):(l.command="SQ",l.startTangent=[d[0]-b[0],d[1]-b[1]],l.endTangent=[n[0]-b[0],n[1]-b[1]])}else if("A"===c){var T=Jr(l,0),S=T.x,P=T.y,M=Jr(l,1,!1),w=M.x,k=M.y;l.startTangent=[S,P],l.endTangent=[w,k]}e.push(l)}return e}(e),s=function(t,e){for(var n=[],r=[],i=[],o=0;t.length>o;o++){var a=t[o],s=a.currentPoint,u=a.params,c=a.prePoint,l=void 0;switch(a.command){case"Q":l=Je.box(c[0],c[1],u[1],u[2],u[3],u[4]);break;case"C":l=an.box(c[0],c[1],u[1],u[2],u[3],u[4],u[5],u[6]);break;case"A":var h=a.arcParams;l=dn.box(h.cx,h.cy,h.rx,h.ry,h.xRotation,h.startAngle,h.endAngle);break;default:n.push(s[0]),r.push(s[1])}l&&(a.box=l,n.push(l.x,l.x+l.width),r.push(l.y,l.y+l.height)),e&&("L"===a.command||"M"===a.command)&&a.prePoint&&a.nextPoint&&i.push(a)}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=ie(n),d=ie(r),p=re(n),v=re(r);if(0===i.length)return{x:f,y:d,width:p-f,height:v-d};for(var m=0;i.length>m;m++){var y=i[m],g=y.currentPoint;g[0]===f?f-=Kr(y,e).xExtra:g[0]===p&&(p+=Kr(y,e).xExtra),g[1]===d?d-=Kr(y,e).yExtra:g[1]===v&&(v+=Kr(y,e).yExtra)}return{x:f,y:d,width:p-f,height:v-d}}(a,0),u=s.x,c=s.y,l=s.width,h=s.height;return{absolutePath:e,hasArc:n,segments:a,polygons:i,polylines:o,totalLength:0,rect:{x:Number.isFinite(u)?u:0,y:Number.isFinite(c)?c:0,width:Number.isFinite(l)?l:0,height:Number.isFinite(h)?h:0}}},Eo=Wn(xo);function bo(t,e){var n=oe(t)?Eo(t):xo(t);return e&&(e.parsedStyle.defX=n.rect.x,e.parsedStyle.defY=n.rect.y),n}function To(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=Ut(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=Ut(e.absolutePath,!1),e.curve=i);var o=[r,i];r.length!==i.length&&(o=Qt(r,i));var a,s,u,c,l,h,f,d,p=Kt(o[0])!==Kt(o[1])?(s=(a=o[0]).slice(1).map((function(t,e,n){return e?n[e-1].slice(-2).concat(t.slice(1)):a[0].slice(1).concat(t.slice(1))})).map((function(t){return t.map((function(e,n){return t[t.length-n-2*(1-n%2)]}))})).reverse(),[["M"].concat(s[0].slice(0,2))].concat(s.map((function(t){return["C"].concat(t.slice(2))})))):pt(o[0]);return[p,(u=o[1],c=p,l=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,o){var a=i+o;return 0===o||t[a]&&"M"===t[a][0]?["M"].concat(t[a].slice(-2)):(e>a||(a-=n),t[a])}))}))}(u),d.forEach((function(t,e){u.slice(1).forEach((function(t,n){f+=Dt(u[(e+n)%l].slice(-2),c[n%l].slice(-2))})),h[e]=f,f=0})),d[h.indexOf(Math.min.apply(null,h))]),function(t){return t}]}function So(t,e){var n;n=oe(t)?t.split(" ").map((function(t){var e=t.split(","),n=e[1];return[Number(e[0]),Number(n)]})):t;var r,i,o=[],a=0,s=bn.length(n);n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=a/s,i=We.length(t[0],t[1],n[e+1][0],n[e+1][1]),r[1]=(a+=i)/s,o.push(r))}));var u=Math.min.apply(Math,n.map((function(t){return t[0]}))),c=Math.min.apply(Math,n.map((function(t){return t[1]})));return e&&(e.parsedStyle.defX=u,e.parsedStyle.defY=c),{points:n,totalLength:s,segments:o}}function Po(t,e){return[t.points,e.points,function(t){return t}]}var Mo=null;function wo(t){return function(e){var n=0;return t.map((function(t){return t===Mo?e[n++]:t}))}}function ko(t){return t}var No={matrix:["NNNNNN",[Mo,Mo,0,0,Mo,Mo,0,0,0,0,1,0,Mo,Mo,0,1],ko],matrix3d:["NNNNNNNNNNNNNNNN",ko],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",wo([Mo,Mo,new Jn(1)]),ko],scalex:["N",wo([Mo,new Jn(1),new Jn(1)]),wo([Mo,new Jn(1)])],scaley:["N",wo([new Jn(1),Mo,new Jn(1)]),wo([new Jn(1),Mo])],scalez:["N",wo([new Jn(1),new Jn(1),Mo])],scale3d:["NNN",ko],skew:["Aa",null,ko],skewx:["A",null,wo([Mo,er])],skewy:["A",null,wo([er,Mo])],translate:["Tt",wo([Mo,Mo,tr]),ko],translatex:["T",wo([Mo,tr,tr]),wo([Mo,tr])],translatey:["T",wo([tr,Mo,tr]),wo([tr,Mo])],translatez:["L",wo([tr,tr,Mo])],translate3d:["TTL",ko]};function Co(t){if("none"===(t=(t||"none").toLowerCase().trim()))return[];for(var e,n=/\s*(\w+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];i=e.index+e[0].length;var o=e[1],a=No[o];if(!a)return[];var s=e[2].split(","),u=a[0];if(s.length>u.length)return[];for(var c=[],l=0;u.length>l;l++){var h=s[l],f=u[l],d=void 0;if(void 0===(d=h?{A:function(t){return"0"===t.trim()?er:io(t)},N:vo,T:ro,L:no}[f.toUpperCase()](h):{a:er,n:c[0],t:tr}[f]))return[];c.push(d)}if(r.push({t:o,d:c}),n.lastIndex===t.length)return r}return[]}function Ao(t){var e,n,r,i;switch(t.t){case"rotatex":return i=Ar(ao(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=Ar(ao(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=Ar(ao(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=Ar(ao(t.d[3]));var o=e*e+n*n+r*r;if(0===o)e=1,n=0,r=0;else if(1!==o){var a=Math.sqrt(o);e/=a,n/=a,r/=a}var s=Math.sin(i/2),u=s*Math.cos(i/2),c=s*s;return[1-2*(n*n+r*r)*c,2*(e*n*c+r*u),2*(e*r*c-n*u),0,2*(e*n*c-r*u),1-2*(e*e+r*r)*c,2*(n*r*c+e*u),0,2*(e*r*c+n*u),2*(n*r*c-e*u),1-2*(e*e+n*n)*c,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 l=Ar(ao(t.d[0])),h=Ar(ao(t.d[1]));return[1,Math.tan(h),0,0,Math.tan(l),1,0,0,0,0,1,0,0,0,0,1];case"skewx":return i=Ar(ao(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=Ar(ao(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=co(t.d[0],0,null)||0,n=co(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=co(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=co(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=co(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=co(t.d[0],0,null)||0,n=co(t.d[1],0,null)||0,r=co(t.d[2],0,null)||0,1];case"perspective":var f=co(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 Oo(t,e){return[t[0]*e[0]+t[4]*e[1]+t[8]*e[2]+t[12]*e[3],t[1]*e[0]+t[5]*e[1]+t[9]*e[2]+t[13]*e[3],t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]*e[3],t[3]*e[0]+t[7]*e[1]+t[11]*e[2]+t[15]*e[3],t[0]*e[4]+t[4]*e[5]+t[8]*e[6]+t[12]*e[7],t[1]*e[4]+t[5]*e[5]+t[9]*e[6]+t[13]*e[7],t[2]*e[4]+t[6]*e[5]+t[10]*e[6]+t[14]*e[7],t[3]*e[4]+t[7]*e[5]+t[11]*e[6]+t[15]*e[7],t[0]*e[8]+t[4]*e[9]+t[8]*e[10]+t[12]*e[11],t[1]*e[8]+t[5]*e[9]+t[9]*e[10]+t[13]*e[11],t[2]*e[8]+t[6]*e[9]+t[10]*e[10]+t[14]*e[11],t[3]*e[8]+t[7]*e[9]+t[11]*e[10]+t[15]*e[11],t[0]*e[12]+t[4]*e[13]+t[8]*e[14]+t[12]*e[15],t[1]*e[12]+t[5]*e[13]+t[9]*e[14]+t[13]*e[15],t[2]*e[12]+t[6]*e[13]+t[10]*e[14]+t[14]*e[15],t[3]*e[12]+t[7]*e[13]+t[11]*e[14]+t[15]*e[15]]}function Lo(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],o=[0,0,0,1];return function(t,e,n,r,i,o){if(!function(t,e){var n=e[15];if(0===n)return!1;for(var r=1/n,i=0;16>i;i++)t[i]=e[i]*r;return!0}(Dr,t))return!1;if(u(Fr,Dr),Fr[3]=0,Fr[7]=0,Fr[11]=0,Fr[15]=1,1e-8>Math.abs(d(Fr)))return!1;var a,s,c=Dr[3],l=Dr[7],p=Dr[11],v=Dr[12],m=Dr[13],y=Dr[14],g=Dr[15];if(0!==c||0!==l||0!==p){if(Gr[0]=c,Gr[1]=l,Gr[2]=p,Gr[3]=g,!f(Fr,Fr))return!1;h(Fr,Fr),Q(i,Gr,Fr)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=v,e[1]=m,e[2]=y,(a=Br)[0][0]=(s=Dr)[0],a[0][1]=s[1],a[0][2]=s[2],a[1][0]=s[4],a[1][1]=s[5],a[1][2]=s[6],a[2][0]=s[8],a[2][1]=s[9],a[2][2]=s[10],n[0]=_(Br[0]),z(Br[0],Br[0]),r[0]=V(Br[0],Br[1]),zr(Br[1],Br[1],Br[0],1,-r[0]),n[1]=_(Br[1]),z(Br[1],Br[1]),r[0]/=n[1],r[1]=V(Br[0],Br[2]),zr(Br[2],Br[2],Br[0],1,-r[1]),r[2]=V(Br[1],Br[2]),zr(Br[2],Br[2],Br[1],1,-r[2]),n[2]=_(Br[2]),z(Br[2],Br[2]),r[1]/=n[2],r[2]/=n[2],j(Ur,Br[1],Br[2]),0>V(Br[0],Ur))for(var x=0;3>x;x++)n[x]*=-1,Br[x][0]*=-1,Br[x][1]*=-1,Br[x][2]*=-1;o[0]=.5*Math.sqrt(Math.max(1+Br[0][0]-Br[1][1]-Br[2][2],0)),o[1]=.5*Math.sqrt(Math.max(1-Br[0][0]+Br[1][1]-Br[2][2],0)),o[2]=.5*Math.sqrt(Math.max(1-Br[0][0]-Br[1][1]+Br[2][2],0)),o[3]=.5*Math.sqrt(Math.max(1+Br[0][0]+Br[1][1]+Br[2][2],0)),Br[2][1]>Br[1][2]&&(o[0]=-o[0]),Br[0][2]>Br[2][0]&&(o[1]=-o[1]),Br[1][0]>Br[0][1]&&(o[2]=-o[2])}(function(t){return 0===t.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(Ao).reduce(Oo)}(t),e,n,r,i,o),[[e,n,r,o,i]]}var Ro=function(){function t(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],r=0;4>r;r++)for(var i=0;4>i;i++)for(var o=0;4>o;o++)n[r][i]+=e[r][o]*t[o][i];return n}return function(e,n,r,i,o){for(var a=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;4>s;s++)a[s][3]=o[s];for(var u=0;3>u;u++)for(var c=0;3>c;c++)a[3][u]+=e[c]*a[c][u];var l=i[0],h=i[1],f=i[2],d=i[3],p=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];p[0][0]=1-2*(h*h+f*f),p[0][1]=2*(l*h-f*d),p[0][2]=2*(l*f+h*d),p[1][0]=2*(l*h+f*d),p[1][1]=1-2*(l*l+f*f),p[1][2]=2*(h*f-l*d),p[2][0]=2*(l*f-h*d),p[2][1]=2*(h*f+l*d),p[2][2]=1-2*(l*l+h*h),a=t(a,p);var v,m=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];r[2]&&(m[2][1]=r[2],a=t(a,m)),r[1]&&(m[2][1]=0,m[2][0]=r[0],a=t(a,m)),r[0]&&(m[2][0]=0,m[1][0]=r[0],a=t(a,m));for(var y=0;3>y;y++)for(var g=0;3>g;g++)a[y][g]*=n[y];return 0==(v=a)[0][2]&&0==v[0][3]&&0==v[1][2]&&0==v[1][3]&&0==v[2][0]&&0==v[2][1]&&1==v[2][2]&&0==v[2][3]&&0==v[3][2]&&1==v[3][3]?[a[0][0],a[0][1],a[1][0],a[1][1],a[3][0],a[3][1]]:a[0].concat(a[1],a[2],a[3])}}();function _o(t){return t.toFixed(6).replace(".000000","")}function Io(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=Lo(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=Lo(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=ae(r,-1,1);var i=[];if(1===r)i=t;else for(var o=Math.acos(r),a=1*Math.sin(n*o)/Math.sqrt(1-r*r),s=0;4>s;s++)i.push(t[s]*(Math.cos(n*o)-r*a)+e[s]*a);return i}(n[0][3],r[0][3],t[5]);return Ro(t[0],t[1],t[2],e,t[4]).map(_o).join(",")}])}function Do(t){return t.replace(/[xy]/,"")}function Fo(t){return t.replace(/(x|y|z|3d)?$/,"3d")}var Go=function(t,e){return"perspective"===t&&"perspective"===e||("matrix"===t||"matrix3d"===t)&&("matrix"===e||"matrix3d"===e)};function Bo(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[o],r=n.t,i=n.d,a="scale"===r.substring(0,5)?1:0;e.push({t:r,d:i.map((function(t){return"number"==typeof t?fr(a):fr(a,t.unit)}))})},o=0;t.length>o;o++)i()}var a=[],s=[],u=[];if(t.length!==e.length){var c=Io(t,e);a=[c[0]],s=[c[1]],u=[["matrix",[c[2]]]]}else for(var l=0;t.length>l;l++){var h=t[l].t,f=e[l].t,d=t[l].d,p=e[l].d,v=No[h],m=No[f],y=void 0;if(Go(h,f)){var g=Io([t[l]],[e[l]]);a.push(g[0]),s.push(g[1]),u.push(["matrix",[g[2]]])}else{if(h===f)y=h;else if(v[2]&&m[2]&&Do(h)===Do(f))y=Do(h),d=v[2](d),p=m[2](p);else{if(!v[1]||!m[1]||Fo(h)!==Fo(f)){var x=Io(t,e);a=[x[0]],s=[x[1]],u=[["matrix",[x[2]]]];break}y=Fo(h),d=v[1](d),p=m[1](p)}for(var E=[],b=[],T=[],S=0;d.length>S;S++){var P=oo(d[S],p[S],n,!1,S);E[S]=P[0],b[S]=P[1],T.push(P[2])}a.push(E),s.push(b),u.push([y,T])}}if(r){var M=a;a=s,s=M}return[a,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"),u[e][0]+"("+n+")"})).join(" ")}]}var Uo=Wn((function(t){if(oe(t)){if("text-anchor"===t)return[fr(0,"px"),fr(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:[ro(zo(e[0])),ro(zo(e[1]))]}return[fr(t[0]||0,"px"),fr(t[1]||0,"px")]}));function zo(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var Vo=function(){function t(){this.parser=io,this.parserWithCSSDisabled=null,this.mixer=mo}return t.prototype.calculator=function(t,e,n,r){return ao(n)},t}(),jo=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){return n instanceof Hn&&(n=null),Zs.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach((function(t){0===t.childNodes.length&&Zs.sceneGraphService.dirtifyToRoot(t)})),n},t}(),Ho=function(){function t(){this.parser=Ji,this.parserWithCSSDisabled=Ji,this.mixer=to}return t.prototype.calculator=function(t,e,n,r){return n instanceof Hn?"none"===n.value?cr:lr:n},t}(),Wo=function(){function t(){this.parser=fo}return t.prototype.calculator=function(t,e,n){return n instanceof Hn?[]:n},t}();function Yo(t){var e=t.parsedStyle.fontSize;return $t(e)?null:e}var Xo,qo=function(){function e(){this.parser=ro,this.parserWithCSSDisabled=null,this.mixer=mo}return e.prototype.calculator=function(e,n,r,i,o){if(se(r))return r;if(!Jn.isRelativeUnit(r.unit))return r.value;if(r.unit===t.UnitType.kPercentage)return 0;if(r.unit===t.UnitType.kEms){if(i.parentNode){var a=Yo(i.parentNode);if(a)return a*=r.value;o.addUnresolveProperty(i,e)}else o.addUnresolveProperty(i,e);return 0}if(r.unit===t.UnitType.kRems){var s;if(null==i||null===(s=i.ownerDocument)||void 0===s?void 0:s.documentElement){var u=Yo(i.ownerDocument.documentElement);if(u)return u*=r.value;o.addUnresolveProperty(i,e)}else o.addUnresolveProperty(i,e);return 0}},e}(),Ko=function(){function t(){this.mixer=go}var e=t.prototype;return e.parser=function(t){var e=uo(se(t)?[t]:t);return 1===e.length?[e[0],e[0]]:[e[0],e[1]]},e.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),Zo=function(){function t(){this.mixer=go}var e=t.prototype;return e.parser=function(t){var e=uo(se(t)?[t]:t);return 1===e.length?[e[0],e[0],e[0],e[0]]:2===e.length?[e[0],e[1],e[0],e[1]]:3===e.length?[e[0],e[1],e[2],e[1]]:[e[0],e[1],e[2],e[3]]},e.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),Qo=function(e){function n(){return e.apply(this,arguments)||this}return Cn(n,e),n.prototype.postProcessor=function(e,n){var r,i,o;switch(e.nodeName){case t.Shape.CIRCLE:case t.Shape.ELLIPSE:var a=e.parsedStyle,s=a.cx,u=a.cy;$t(s)||(r=s),$t(u)||(i=u);break;case t.Shape.LINE:var c=e.parsedStyle,l=c.y1,h=c.y2;r=Math.min(c.x1,c.x2),i=Math.min(l,h),o=0;break;case t.Shape.RECT:case t.Shape.IMAGE:case t.Shape.GROUP:case t.Shape.HTML:case t.Shape.TEXT:case t.Shape.MESH:$t(e.parsedStyle.x)||(r=e.parsedStyle.x),$t(e.parsedStyle.y)||(i=e.parsedStyle.y)}if(e.nodeName!==t.Shape.PATH&&e.nodeName!==t.Shape.POLYLINE&&e.nodeName!==t.Shape.POLYGON&&(e.parsedStyle.defX=r||0,e.parsedStyle.defY=i||0),(!$t(r)||!$t(i)||!$t(o))&&-1===n.indexOf("transform")){var f=e.parsedStyle.transform;if(f&&f.length)jr(f,e);else{var d=e.getLocalPosition(),p=d[0],v=d[1],m=d[2];e.setLocalPosition($t(r)?p:r,$t(i)?v:i,$t(o)?m:o)}}},n}(qo),$o=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){var i;n instanceof Hn&&(n=null);var o=null===(i=n)||void 0===i?void 0:i.cloneNode(!0);return o&&(o.style.isMarker=!0),o},t}(),Jo=function(){function t(){this.mixer=mo,this.parser=vo,this.parserWithCSSDisabled=null}return t.prototype.calculator=function(t,e,n){return n.value},t}(),ta=function(){function e(){this.parser=vo,this.parserWithCSSDisabled=null,this.mixer=yo(0,1)}var n=e.prototype;return n.calculator=function(t,e,n){return n.value},n.postProcessor=function(e){var n=e.parsedStyle,r=n.offsetPath;if(r){var i=r.nodeName;if(i===t.Shape.LINE||i===t.Shape.PATH||i===t.Shape.POLYLINE){var o=r.getPoint(n.offsetDistance);o&&(e.parsedStyle.defX=o.x,e.parsedStyle.defY=o.y,e.setLocalPosition(o.x,o.y))}}},e}(),ea=function(){function t(){this.parser=vo,this.parserWithCSSDisabled=null,this.mixer=yo(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t}(),na=function(){function t(){this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}t.isEmpty=function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]};var e=t.prototype;return e.update=function(t,e){Pr(this.center,t),Pr(this.halfExtents,e),Mr(this.min,this.center,this.halfExtents),wr(this.max,this.center,this.halfExtents)},e.setMinMax=function(t,e){wr(this.center,e,t),kr(this.center,this.center,.5),Mr(this.halfExtents,e,t),kr(this.halfExtents,this.halfExtents,.5),Pr(this.min,t),Pr(this.max,e)},e.getMin=function(){return this.min},e.getMax=function(){return this.max},e.add=function(e){if(!t.isEmpty(e))if(t.isEmpty(this))this.setMinMax(e.getMin(),e.getMax());else{var n=this.center,r=n[0],i=n[1],o=n[2],a=this.halfExtents,s=a[0],u=a[1],c=a[2],l=r-s,h=r+s,f=i-u,d=i+u,p=o-c,v=o+c,m=e.center,y=m[0],g=m[1],x=m[2],E=e.halfExtents,b=E[0],T=E[1],S=E[2],P=y-b,M=y+b,w=g-T,k=g+T,N=x-S,C=x+S;l>P&&(l=P),M>h&&(h=M),f>w&&(f=w),k>d&&(d=k),p>N&&(p=N),C>v&&(v=C),n[0]=.5*(l+h),n[1]=.5*(f+d),n[2]=.5*(p+v),a[0]=.5*(h-l),a[1]=.5*(d-f),a[2]=.5*(v-p),this.min[0]=l,this.min[1]=f,this.min[2]=p,this.max[0]=h,this.max[1]=d,this.max[2]=v}},e.setFromTransformedAABB=function(t,e){var n=this.center,r=this.halfExtents,i=t.center,o=t.halfExtents,a=e[0],s=e[4],u=e[8],c=e[1],l=e[5],h=e[9],f=e[2],d=e[6],p=e[10],v=Math.abs(a),m=Math.abs(s),y=Math.abs(u),g=Math.abs(c),x=Math.abs(l),E=Math.abs(h),b=Math.abs(f),T=Math.abs(d),S=Math.abs(p);n[0]=e[12]+a*i[0]+s*i[1]+u*i[2],n[1]=e[13]+c*i[0]+l*i[1]+h*i[2],n[2]=e[14]+f*i[0]+d*i[1]+p*i[2],r[0]=v*o[0]+m*o[1]+y*o[2],r[1]=g*o[0]+x*o[1]+E*o[2],r[2]=b*o[0]+T*o[1]+S*o[2],Mr(this.min,n,r),wr(this.max,n,r)},e.intersects=function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return!(n[0]>r[0]||i[0]>e[0]||n[1]>r[1]||i[1]>e[1]||n[2]>r[2]||i[2]>e[2])},e.intersection=function(e){if(!this.intersects(e))return null;var n,r,i,o=new t,a=(n=[0,0,0],r=this.getMin(),i=e.getMin(),n[0]=Math.max(r[0],i[0]),n[1]=Math.max(r[1],i[1]),n[2]=Math.max(r[2],i[2]),n),s=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t}([0,0,0],this.getMax(),e.getMax());return o.setMinMax(a,s),o},e.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?Pr([0,0,0],this.min):272===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:257===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:256===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:17===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:16===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:1===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]},e.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?Pr([0,0,0],this.max):272===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:257===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:256===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:17===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:16===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:1===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]},t}(),ra=function(){function t(t,e){this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=t||0,this.normal=e||I(0,1,0),this.updatePNVertexFlag()}var e=t.prototype;return e.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)},e.distanceToPoint=function(t){return V(t,this.normal)-this.distance},e.normalize=function(){var t=1/K(this.normal);U(this.normal,this.normal,t),this.distance*=t},e.intersectsLine=function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),o=i>=0&&1>=i;return o&&n&&H(n,t,e,i),o},t}();(Xo=t.Mask||(t.Mask={}))[Xo.OUTSIDE=4294967295]="OUTSIDE",Xo[Xo.INSIDE=0]="INSIDE",Xo[Xo.INDETERMINATE=2147483647]="INDETERMINATE";var ia=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;6>e;e++)this.planes.push(new ra)}return t.prototype.extractFromVPMatrix=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],h=t[10],f=t[11],d=t[12],p=t[13],v=t[14],m=t[15];F(this.planes[0].normal,i-e,u-o,f-c),this.planes[0].distance=m-d,F(this.planes[1].normal,i+e,u+o,f+c),this.planes[1].distance=m+d,F(this.planes[2].normal,i+n,u+a,f+l),this.planes[2].distance=m+p,F(this.planes[3].normal,i-n,u-a,f-l),this.planes[3].distance=m-p,F(this.planes[4].normal,i-r,u-s,f-h),this.planes[4].distance=m-v,F(this.planes[5].normal,i+r,u+s,f+h),this.planes[5].distance=m+v,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))},t}(),oa=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}var e=t.prototype;return e.clone=function(){return new t(this.x,this.y)},e.copyFrom=function(t){this.x=t.x,this.y=t.y},t}(),aa=function(){function t(t,e,n,r){this.x=void 0,this.y=void 0,this.width=void 0,this.height=void 0,this.left=void 0,this.right=void 0,this.top=void 0,this.bottom=void 0,this.x=t,this.y=e,this.width=n,this.height=r,this.left=t,this.right=t+n,this.top=e,this.bottom=e+r}return t.prototype.toJSON=function(){},t}(),sa=function(){function e(){this.parser=bo,this.parserWithCSSDisabled=bo,this.mixer=To}var n=e.prototype;return n.calculator=function(t,e,n){return n instanceof Hn&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new aa(0,0,0,0)}:n},n.postProcessor=function(e,n){if(e.nodeName===t.Shape.PATH&&-1===n.indexOf("transform")){var r=e.parsedStyle,i=r.defX,o=r.defY;e.setLocalPosition(void 0===i?0:i,void 0===o?0:o)}},e}(),ua=function(){function e(){this.parser=So,this.mixer=Po}return e.prototype.postProcessor=function(e,n){if((e.nodeName===t.Shape.POLYGON||e.nodeName===t.Shape.POLYLINE)&&-1===n.indexOf("transform")){var r=e.parsedStyle;e.setLocalPosition(r.defX,r.defY)}},e}(),ca=function(t){function e(){for(var e,n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).mixer=yo(0,1/0),e}return Cn(e,t),e}(qo),la=function(){function t(){}var e=t.prototype;return e.calculator=function(t,e,n,r){return n instanceof Hn?"unset"===n.value?"":n.value:""+n},e.postProcessor=function(t){t.nodeValue=""+t.parsedStyle.text||""},t}(),ha=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){var i=r.getAttribute("text");if(i){var o=i;"capitalize"===n.value?o=i.charAt(0).toUpperCase()+i.slice(1):"lowercase"===n.value?o=i.toLowerCase():"uppercase"===n.value&&(o=i.toUpperCase()),r.parsedStyle.text=o}return n.value},t}(),fa=function(){function t(){this.parser=Co,this.parserWithCSSDisabled=Co,this.mixer=Bo}var e=t.prototype;return e.calculator=function(t,e,n,r){return n instanceof Hn?[]:n},e.postProcessor=function(t){jr(t.parsedStyle.transform,t)},t}(),da=function(){this.parser=Uo},pa=function(){function t(){this.parser=vo}var e=t.prototype;return e.calculator=function(t,e,n,r){return n.value},e.postProcessor=function(t){if(t.parentNode){var e=t.parentNode,n=e.renderable,r=e.sortable;n&&(n.dirty=!0),r&&(r.dirty=!0)}},t}(),va=function(){function e(){this.registry={},this.define(t.Shape.CIRCLE,Wa),this.define(t.Shape.ELLIPSE,$a),this.define(t.Shape.RECT,vs),this.define(t.Shape.IMAGE,is),this.define(t.Shape.LINE,as),this.define(t.Shape.GROUP,ts),this.define(t.Shape.PATH,cs),this.define(t.Shape.POLYGON,hs),this.define(t.Shape.POLYLINE,ds),this.define(t.Shape.TEXT,ys),this.define(t.Shape.HTML,ns)}var n=e.prototype;return n.define=function(t,e){this.registry[t]=e},n.get=function(t){return this.registry[t]},e}();function ma(t){return!!t.type}var ya=function(){function t(e){this.type=void 0,this.eventPhase=t.prototype.NONE,this.target=void 0,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.currentTarget=void 0,this.defaultPrevented=!1,this.timeStamp=void 0,this.nativeEvent=void 0,this.originalEvent=void 0,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.manager=void 0,this.detail=void 0,this.layer=new oa,this.page=new oa,this.canvas=new oa,this.viewport=new oa,this.path=void 0,this.view=void 0,this.which=void 0,this.returnValue=void 0,this.srcElement=void 0,this.composed=!1,this.isTrusted=void 0,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}var e=t.prototype;return e.composedPath=function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},e.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},e.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},e.stopPropagation=function(){this.propagationStopped=!0},e.initEvent=function(){},e.initUIEvent=function(){},e.clone=function(){throw Error(br)},kn(t,[{key:"name",get:function(){return this.type}},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"propagationPath",get:function(){return this.composedPath()}}]),t}(),ga=function(t){function e(e,n){var r;return(r=t.call(this,null)||this).type=e,r.detail=n,Object.assign(Ln(r),n),r}return Cn(e,t),e}(ya),xa=function(){function t(){this.emitter=new Tn}var e=t.prototype;return e.on=function(t,e,n){return this.addEventListener(t,e,n),this},e.addEventListener=function(t,e,n){var r=le(n)&&n||ne(n)&&n.capture,i=ne(n)&&n.once,o=qn(e)?void 0:e,a=!1,s="";if(t.indexOf(":")>-1){var u=t.split(":");t=u[1],s=u[0],a=!0}if(t=r?t+"capture":t,e=qn(e)?e:e.handleEvent,a){var c=e;e=function(){for(var t,e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];(null===(t=n[0].target)||void 0===t?void 0:t.name)===s&&c.apply(void 0,n)}}return i?this.emitter.once(t,e,o):this.emitter.on(t,e,o),this},e.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},e.removeAllEventListeners=function(){this.emitter.removeAllListeners()},e.removeEventListener=function(t,e,n){var r,i=le(n)&&n||ne(n)&&n.capture,o=qn(e)?void 0:e;return t=i?t+"capture":t,e=qn(e)?e:null===(r=e)||void 0===r?void 0:r.handleEvent,this.emitter.off(t,e,o),this},e.emit=function(t,e){this.dispatchEvent(new ga(t,e))},e.dispatchEvent=function(t,e){if(void 0===e&&(e=!1),!ma(t))throw Error("DisplayObject cannot propagate events outside of the Federated Events API");var n;if(this.document)n=this;else if(this.defaultView)n=this.defaultView;else{var r;n=null===(r=this.ownerDocument)||void 0===r?void 0:r.defaultView}if(n){var i;if(t.manager=n.getEventService()||null,!t.manager)return!1;t.defaultPrevented=!1,t.path=[],e||(t.target=this),null===(i=t.manager)||void 0===i||i.dispatchEvent(t,t.type,e)}return!t.defaultPrevented},t}(),Ea=function(e){function n(){for(var t,n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t}Cn(n,e),n.isNode=function(t){return!!t.childNodes};var r=n.prototype;return r.getRootNode=function(t){return void 0===t&&(t={}),this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this},r.hasChildNodes=function(){return this.childNodes.length>0},r.isDefaultNamespace=function(t){throw Error(br)},r.lookupNamespaceURI=function(t){throw Error(br)},r.lookupPrefix=function(t){throw Error(br)},r.normalize=function(){throw Error(br)},r.isEqualNode=function(t){return this===t},r.isSameNode=function(t){return this.isEqualNode(t)},r.compareDocumentPosition=function(t){if(t===this)return 0;if(!(t instanceof n))throw new TypeError("Node.compareDocumentPosition: Argument 1 does not implement interface Node.");for(var e=t,r=this,i=[e],o=[r];null!==(a=e.parentNode)&&void 0!==a?a:r.parentNode;){var a;e=e.parentNode?(i.push(e.parentNode),e.parentNode):e,r=r.parentNode?(o.push(r.parentNode),r.parentNode):r}if(e!==r)return n.DOCUMENT_POSITION_DISCONNECTED|n.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|n.DOCUMENT_POSITION_PRECEDING;var s=i.length>o.length?i:o,u=s===i?o:i;if(s[s.length-u.length]===u[0])return s===i?n.DOCUMENT_POSITION_CONTAINED_BY|n.DOCUMENT_POSITION_FOLLOWING:n.DOCUMENT_POSITION_CONTAINS|n.DOCUMENT_POSITION_PRECEDING;for(var c=s.length-u.length,l=u.length-1;l>=0;l--){var h=u[l],f=s[c+l];if(f!==h){var d=h.parentNode.childNodes;return d.indexOf(h)<d.indexOf(f)?u===i?n.DOCUMENT_POSITION_PRECEDING:n.DOCUMENT_POSITION_FOLLOWING:s===i?n.DOCUMENT_POSITION_PRECEDING:n.DOCUMENT_POSITION_FOLLOWING}}return n.DOCUMENT_POSITION_FOLLOWING},r.contain=function(t){return this.contains(t)},r.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},r.getAncestor=function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e},r.forEach=function(t,e){void 0===e&&(e=!1),t(this)||(e?this.childNodes.slice():this.childNodes).forEach((function(e){e.forEach(t)}))},kn(n,[{key:"textContent",get:function(){var e="";this.nodeName===t.Shape.TEXT&&(e+=this.style.text);for(var n,r=_n(this.childNodes);!(n=r()).done;){var i=n.value;e+=i.nodeName===t.Shape.TEXT?i.nodeValue:i.textContent}return e},set:function(e){var n=this;this.childNodes.slice().forEach((function(t){n.removeChild(t)})),this.nodeName===t.Shape.TEXT&&(this.style.text=""+e)}},{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}}]),n}(xa);Ea.DOCUMENT_POSITION_DISCONNECTED=1,Ea.DOCUMENT_POSITION_PRECEDING=2,Ea.DOCUMENT_POSITION_FOLLOWING=4,Ea.DOCUMENT_POSITION_CONTAINS=8,Ea.DOCUMENT_POSITION_CONTAINED_BY=16,Ea.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var ba,Ta,Sa=function(e){function n(){var n;(n=e.call(this)||this).defaultView=null,n.documentElement=void 0,n.timeline=void 0,n.ownerDocument=null,n.nodeName="document";try{n.timeline=new Zs.AnimationTimeline(Ln(n))}catch(t){}var r={};return gs.forEach((function(e){var n=e.d;e.inh&&n&&(r[e.n]=qn(n)?n(t.Shape.GROUP):n)})),n.documentElement=new ts({id:"g-root",style:r}),n.documentElement.ownerDocument=Ln(n),n.documentElement.parentNode=Ln(n),n.childNodes=[n.documentElement],n}Cn(n,e);var r=n.prototype;return r.createElement=function(t,e){if("svg"===t)return this.documentElement;var n=this.defaultView.customElements.get(t);n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?ys:ts);var r=new n(e);return r.ownerDocument=this,r},r.createElementNS=function(t,e,n){return this.createElement(e,n)},r.cloneNode=function(t){throw Error(br)},r.destroy=function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}},r.elementsFromBBox=function(t,e,n,r){var i=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),o=[];return i.forEach((function(t){var e=Zs.displayObjectPool.getByEntity(t.id),n=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(e.parsedStyle.pointerEvents);(!n||n&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&o.push(e)})),o.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),o},r.elementFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig();if(0>r||0>i||r>o.width||i>o.height)return null;var a=this.defaultView.viewport2Client({x:r,y:i}),s=a.x,u=a.y,c=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return c&&c[0]||this.documentElement},r.elementFromPoint=function(){var t=Mn(Sn().mark((function t(e,n){var r,i,o,a,s,u,c,l,h,f;return Sn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,o=r.y,a=this.defaultView.getConfig(),s=a.width,u=a.height,!(0>i||0>o||i>s||o>u)){t.next=4;break}return t.abrupt("return",null);case 4:return c=this.defaultView.viewport2Client({x:i,y:o}),l=c.x,h=c.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:i,viewportY:o,clientX:l,clientY:h},picked:[]});case 7:return t.abrupt("return",(f=t.sent.picked)&&f[0]||this.documentElement);case 10:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),r.elementsFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig();if(0>r||0>i||r>o.width||i>o.height)return[];var a=this.defaultView.viewport2Client({x:r,y:i}),s=a.x,u=a.y,c=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return c[c.length-1]!==this.documentElement&&c.push(this.documentElement),c},r.elementsFromPoint=function(){var t=Mn(Sn().mark((function t(e,n){var r,i,o,a,s,u,c,l,h,f;return Sn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,o=r.y,a=this.defaultView.getConfig(),s=a.width,u=a.height,!(0>i||0>o||i>s||o>u)){t.next=4;break}return t.abrupt("return",[]);case 4:return c=this.defaultView.viewport2Client({x:i,y:o}),l=c.x,h=c.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:i,viewportY:o,clientX:l,clientY:h},picked:[]});case 7:return(f=t.sent.picked)[f.length-1]!==this.documentElement&&f.push(this.documentElement),t.abrupt("return",f);case 11:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),r.appendChild=function(t,e){throw Error(Tr)},r.insertBefore=function(t,e){throw Error(Tr)},r.removeChild=function(t,e){throw Error(Tr)},r.replaceChild=function(t,e,n){throw Error(Tr)},r.append=function(){throw Error(Tr)},r.prepend=function(){throw Error(Tr)},r.getElementById=function(t){return this.documentElement.getElementById(t)},r.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},r.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},r.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},r.querySelector=function(t){return this.documentElement.querySelector(t)},r.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},r.find=function(t){return this.documentElement.find(t)},r.findAll=function(t){return this.documentElement.findAll(t)},kn(n,[{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}}]),n}(Ea);(ba=t.Strategy||(t.Strategy={}))[ba.Standard=0]="Standard",(Ta=t.ElementEvent||(t.ElementEvent={})).REPARENT="reparent",Ta.DESTROY="destroy",Ta.ATTR_MODIFIED="DOMAttrModified",Ta.INSERTED="DOMNodeInserted",Ta.REMOVED="removed",Ta.MOUNTED="DOMNodeInsertedIntoDocument",Ta.UNMOUNTED="DOMNodeRemovedFromDocument",Ta.BOUNDS_CHANGED="bounds-changed",Ta.RENDER_ORDER_CHANGED="render-order-changed",Ta.CULLED="culled";var Pa=function(t){function e(e,n,r,i,o,a,s,u){var c;return(c=t.call(this,null)||this).relatedNode=void 0,c.prevValue=void 0,c.newValue=void 0,c.attrName=void 0,c.attrChange=void 0,c.prevParsedValue=void 0,c.newParsedValue=void 0,c.relatedNode=n,c.prevValue=r,c.newValue=i,c.attrName=o,c.attrChange=a,c.prevParsedValue=s,c.newParsedValue=u,c.type=e,c}return Cn(e,t),e}(ya);Pa.ADDITION=2,Pa.MODIFICATION=1,Pa.REMOVAL=3;var Ma=0;var wa=new Pa(t.ElementEvent.INSERTED,null,"","","",0,"",""),ka=new Pa(t.ElementEvent.REMOVED,null,"","","",0,"",""),Na=new ga(t.ElementEvent.DESTROY),Ca=function(e){function n(){for(var n,r=arguments.length,i=Array(r),o=0;r>o;o++)i[o]=arguments[o];return(n=e.call.apply(e,[this].concat(i))||this).entity=Ma++,n.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1,proxyNodeName:void 0},n.cullable={strategy:t.Strategy.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},n.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},n.sortable={dirty:!1,sorted:void 0,lastSortedIndex:void 0,renderOrder:0},n.geometry={contentBounds:void 0,renderBounds:void 0},n.rBushNode={aabb:void 0},n.id=void 0,n.name=void 0,n.namespaceURI="g",n.scrollLeft=0,n.scrollTop=0,n.clientTop=0,n.clientLeft=0,n.destroyed=!1,n.style={},n.computedStyle=Zs.enableCSSParsing?{anchor:ir,opacity:ir,fillOpacity:ir,strokeOpacity:ir,fill:ir,stroke:ir,transform:ir,transformOrigin:ir,visibility:ir,pointerEvents:ir,lineWidth:ir,lineCap:ir,lineJoin:ir,increasedLineWidthForHitTesting:ir,fontSize:ir,fontFamily:ir,fontStyle:ir,fontWeight:ir,fontVariant:ir,textAlign:ir,textBaseline:ir,textTransform:ir,zIndex:ir,filter:ir,shadowType:ir}:null,n.parsedStyle={},n.attributes={},n}Cn(n,e),n.isElement=function(t){return!!t.getAttribute};var r=n.prototype;return r.cloneNode=function(t){throw Error(br)},r.appendChild=function(t,e){var n;if(t.destroyed)throw Error("Cannot append a destroyed element.");return Zs.sceneGraphService.attach(t,this,e),(null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView)&&this.ownerDocument.defaultView.mountChildren(t),wa.relatedNode=this,t.dispatchEvent(wa),t},r.insertBefore=function(t,e){if(e){var n=this.childNodes.indexOf(e);this.appendChild(t,n-1)}else this.appendChild(t);return t},r.replaceChild=function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e},r.removeChild=function(t){var e;return ka.relatedNode=this,t.dispatchEvent(ka),(null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)&&t.ownerDocument.defaultView.unmountChildren(t),Zs.sceneGraphService.detach(t),t},r.removeChildren=function(){for(var t=this.childNodes.length-1;t>=0;t--){this.removeChild(this.childNodes[t])}},r.destroyChildren=function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length&&e.destroyChildren(),e.destroy()}},r.matches=function(t){return Zs.sceneGraphService.matches(t,this)},r.getElementById=function(t){return Zs.sceneGraphService.querySelector("#"+t,this)},r.getElementsByName=function(t){return Zs.sceneGraphService.querySelectorAll('[name="'+t+'"]',this)},r.getElementsByClassName=function(t){return Zs.sceneGraphService.querySelectorAll("."+t,this)},r.getElementsByTagName=function(t){return Zs.sceneGraphService.querySelectorAll(t,this)},r.querySelector=function(t){return Zs.sceneGraphService.querySelector(t,this)},r.querySelectorAll=function(t){return Zs.sceneGraphService.querySelectorAll(t,this)},r.closest=function(t){var e=this;do{if(Zs.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null},r.find=function(t){var e=this,n=null;return this.forEach((function(r){return!(r===e||!t(r))&&(n=r,!0)})),n},r.findAll=function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n},r.after=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)}))}},r.before=function(){if(this.parentNode){for(var t=this.parentNode.childNodes.indexOf(this),e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=n[0],o=n.slice(1);this.parentNode.appendChild(i,t),i.after.apply(i,o)}},r.replaceWith=function(){this.after.apply(this,arguments),this.remove()},r.append=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)}))},r.prepend=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)}))},r.replaceChildren=function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)},r.remove=function(){return this.parentNode?this.parentNode.removeChild(this):this},r.destroy=function(){this.dispatchEvent(Na),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},r.getGeometryBounds=function(){return Zs.sceneGraphService.getGeometryBounds(this)},r.getRenderBounds=function(){return Zs.sceneGraphService.getBounds(this,!0)},r.getBounds=function(){return Zs.sceneGraphService.getBounds(this)},r.getLocalBounds=function(){return Zs.sceneGraphService.getLocalBounds(this)},r.getBoundingClientRect=function(){return Zs.sceneGraphService.getBoundingClientRect(this)},r.getClientRects=function(){return[this.getBoundingClientRect()]},r.computedStyleMap=function(){return new Map(Object.entries(this.computedStyle))},r.getAttributeNames=function(){return Object.keys(this.attributes)},r.getAttribute=function(t){if(function(t){return"symbol"==typeof t}(t))return Zs.enableCSSParsing?null:void 0;var e=this.attributes[t];if(void 0===e){var n=Zn(t);return e=this.attributes[n],Zs.enableCSSParsing&&$t(e)?null:e}return e},r.hasAttribute=function(t){return this.getAttributeNames().includes(t)},r.hasAttributes=function(){return!!this.getAttributeNames().length},r.removeAttribute=function(t){this.setAttribute(t,null),delete this.attributes[t]},r.setAttribute=function(t,e,n){this.attributes[t]=e},r.getAttributeNS=function(t,e){throw Error(br)},r.getAttributeNode=function(t){throw Error(br)},r.getAttributeNodeNS=function(t,e){throw Error(br)},r.hasAttributeNS=function(t,e){throw Error(br)},r.removeAttributeNS=function(t,e){throw Error(br)},r.removeAttributeNode=function(t){throw Error(br)},r.setAttributeNS=function(t,e,n){throw Error(br)},r.setAttributeNode=function(t){throw Error(br)},r.setAttributeNodeNS=function(t){throw Error(br)},r.toggleAttribute=function(t,e){throw Error(br)},kn(n,[{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}}]),n}(Ea),Aa=function(t){function e(){for(var e,n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).altKey=void 0,e.button=void 0,e.buttons=void 0,e.ctrlKey=void 0,e.metaKey=void 0,e.relatedTarget=void 0,e.shiftKey=void 0,e.client=new oa,e.movement=new oa,e.offset=new oa,e.global=new oa,e.screen=new oa,e}Cn(e,t);var n=e.prototype;return n.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},n.initMouseEvent=function(){throw Error(br)},kn(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}}]),e}(ya),Oa=function(t){function e(){for(var e,n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).pointerId=void 0,e.width=0,e.height=0,e.isPrimary=!1,e.pointerType=void 0,e.pressure=void 0,e.tangentialPressure=void 0,e.tiltX=void 0,e.tiltY=void 0,e.twist=void 0,e}Cn(e,t);var n=e.prototype;return n.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},n.getPredictedEvents=function(){throw Error("getPredictedEvents is not supported!")},n.clone=function(){return this.manager.clonePointerEvent(this)},e}(Aa),La=function(t){function e(){for(var e,n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).deltaMode=void 0,e.deltaX=void 0,e.deltaY=void 0,e.deltaZ=void 0,e.DOM_DELTA_LINE=0,e.DOM_DELTA_PAGE=1,e.DOM_DELTA_PIXEL=2,e}return Cn(e,t),e.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},e}(Aa);function Ra(t){return!!(null==t?void 0:t.nodeName)}var _a,Ia,Da,Fa=new Pa(t.ElementEvent.ATTR_MODIFIED,null,null,null,null,Pa.MODIFICATION,null,null),Ga={anchor:"",opacity:"",fillOpacity:"",strokeOpacity:"",fill:"",stroke:"",transform:"",transformOrigin:"",visibility:"",pointerEvents:"",lineWidth:"",lineCap:"",lineJoin:"",increasedLineWidthForHitTesting:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",zIndex:"",filter:"",shadowType:""},Ba={anchor:[0,0],fill:cr,stroke:cr,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},Ua=Nn({},Ba,{opacity:1,fillOpacity:1,strokeOpacity:1,visibility:"visible",pointerEvents:"auto",lineWidth:1,lineCap:"butt",lineJoin:"miter",increasedLineWidthForHitTesting:0,fillRule:"nonzero"}),za=[].concat(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"],["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"]),Va="data-",ja=function(e){function n(n){var r,i;(i=e.call(this)||this).config=void 0,i.isCustomElement=!1,i.isMutationObserved=!1,i.activeAnimations=[],i.dataset=void 0,i.getClip=function(){return this.style.clipPath||null},i.config=n,i.config.interactive=null!==(r=i.config.capture)&&void 0!==r?r:i.config.interactive,i.id=i.config.id||"",i.name=i.config.name||"",(i.config.className||i.config.class)&&(i.className=i.config.className||i.config.class),i.nodeName=i.config.type||t.Shape.GROUP,i.config.style=i.config.style||i.config.attrs||{},Object.assign(i.config.style,i.config.attrs),null!=i.config.visible&&(i.config.style.visibility=!1===i.config.visible?"hidden":"visible"),null!=i.config.interactive&&(i.config.style.pointerEvents=!1===i.config.interactive?"none":"auto"),Object.assign(i.parsedStyle,Zs.enableCSSParsing?Ba:Ua,i.config.initialParsedStyle),Zs.enableCSSParsing&&Object.assign(i.attributes,Ga),i.initAttributes(i.config.style);var o=Zs.globalThis.Proxy?Zs.globalThis.Proxy:function(){};return i.dataset=new o({},{get:function(t,e){var n=""+Va+Xn(e);return void 0!==t[n]?t[n]:i.getAttribute(n)},set:function(t,e,n){return i.setAttribute(""+Va+Xn(e),n),!0}}),i.style=new o({setProperty:function(t,e){i.setAttribute(t,e)},getPropertyValue:function(t){return i.getAttribute(t)},removeProperty:function(t){i.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:i.getAttribute(e)},set:function(t,e,n){return i.setAttribute(e,n),!0}}),Zs.displayObjectPool.add(i.entity,Ln(i)),i}Cn(n,e);var r=n.prototype;return r.destroy=function(){e.prototype.destroy.call(this),Zs.displayObjectPool.remove(this.entity),this.getAnimations().forEach((function(t){t.cancel()}))},r.cloneNode=function(t,e){var n=Nn({},this.attributes);for(var r in n){var i=n[r];Ra(i)&&"clipPath"!==r&&"offsetPath"!==r&&"textPath"!==r&&(n[r]=i.cloneNode(t)),e&&(n[r]=e(r,i))}var o=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,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},r.initAttributes=function(t){void 0===t&&(t={});var e=this.renderable,n={forceUpdateGeometry:!0};Zs.enableCSSParsing&&(n.usedAttributes=za),Zs.styleValueRegistry.processProperties(this,t,n),e.dirty=!0},r.setAttribute=function(t,n,r){void 0===r&&(r=!1);var i=Zn(t);he(n)||(r||n!==this.attributes[i])&&(this.internalSetAttribute(i,n),e.prototype.setAttribute.call(this,i,n))},r.internalSetAttribute=function(t,e,n){var r;void 0===n&&(n={});var i=this.renderable,o=this.attributes[t],a=this.parsedStyle[t];Zs.styleValueRegistry.processProperties(this,((r={})[t]=e,r),n),i.dirty=!0;var s=this.parsedStyle[t];this.isConnected&&(Fa.relatedNode=this,Fa.prevValue=o,Fa.newValue=e,Fa.attrName=t,Fa.prevParsedValue=a,Fa.newParsedValue=s,this.isMutationObserved?this.dispatchEvent(Fa):(Fa.target=this,this.ownerDocument.defaultView.dispatchEvent(Fa,!0))),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(t,o,e,a,s)},r.getBBox=function(){var t=this.getBounds(),e=t.getMin(),n=e[0],r=e[1],i=t.getMax();return new aa(n,r,i[0]-n,i[1]-r)},r.setOrigin=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Zs.sceneGraphService.setOrigin(this,Cr(t,e,n)),this},r.getOrigin=function(){return Zs.sceneGraphService.getOrigin(this)},r.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Zs.sceneGraphService.setPosition(this,Cr(t,e,n)),this},r.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Zs.sceneGraphService.setLocalPosition(this,Cr(t,e,n)),this},r.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Zs.sceneGraphService.translate(this,Cr(t,e,n)),this},r.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Zs.sceneGraphService.translateLocal(this,Cr(t,e,n)),this},r.getPosition=function(){return Zs.sceneGraphService.getPosition(this)},r.getLocalPosition=function(){return Zs.sceneGraphService.getLocalPosition(this)},r.scale=function(t,e,n){return this.scaleLocal(t,e,n)},r.scaleLocal=function(t,e,n){return"number"==typeof t&&(t=Cr(t,e=e||t,n=n||t)),Zs.sceneGraphService.scaleLocal(this,t),this},r.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=Cr(t,e=e||t,n=n||t)),Zs.sceneGraphService.setLocalScale(this,t),this},r.getLocalScale=function(){return Zs.sceneGraphService.getLocalScale(this)},r.getScale=function(){return Zs.sceneGraphService.getScale(this)},r.getEulerAngles=function(){return Or(Rr(L(),Zs.sceneGraphService.getWorldTransform(this))[2])},r.getLocalEulerAngles=function(){return Or(Rr(L(),Zs.sceneGraphService.getLocalRotation(this))[2])},r.setEulerAngles=function(t){return Zs.sceneGraphService.setEulerAngles(this,0,0,t),this},r.setLocalEulerAngles=function(t){return Zs.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},r.rotateLocal=function(t,e,n){return $t(e)&&$t(n)?Zs.sceneGraphService.rotateLocal(this,0,0,t):Zs.sceneGraphService.rotateLocal(this,t,e,n),this},r.rotate=function(t,e,n){return $t(e)&&$t(n)?Zs.sceneGraphService.rotate(this,0,0,t):Zs.sceneGraphService.rotate(this,t,e,n),this},r.setRotation=function(t,e,n,r){return Zs.sceneGraphService.setRotation(this,t,e,n,r),this},r.setLocalRotation=function(t,e,n,r){return Zs.sceneGraphService.setLocalRotation(this,t,e,n,r),this},r.setLocalSkew=function(t,e){return Zs.sceneGraphService.setLocalSkew(this,t,e),this},r.getRotation=function(){return Zs.sceneGraphService.getRotation(this)},r.getLocalRotation=function(){return Zs.sceneGraphService.getLocalRotation(this)},r.getLocalSkew=function(){return Zs.sceneGraphService.getLocalSkew(this)},r.getLocalTransform=function(){return Zs.sceneGraphService.getLocalTransform(this)},r.getWorldTransform=function(){return Zs.sceneGraphService.getWorldTransform(this)},r.setLocalTransform=function(t){return Zs.sceneGraphService.setLocalTransform(this,t),this},r.resetLocalTransform=function(){Zs.sceneGraphService.resetLocalTransform(this)},r.getAnimations=function(){return this.activeAnimations},r.animate=function(t,e){var n,r=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;return r?r.play(this,t,e):null},r.isVisible=function(){var t;return"visible"===(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)},r.isInteractive=function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)},r.isCulled=function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)},r.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,this.parentNode.children.map((function(t){return Number(t.style.zIndex)})))+1),this},r.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,this.parentNode.children.map((function(t){return Number(t.style.zIndex)})))-1),this},r.getConfig=function(){return this.config},r.attr=function(){for(var t=this,e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=n[0],o=n[1];return i?ne(i)?(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),this):2===n.length?(this.setAttribute(i,o),this):this.attributes[i]:this.attributes},r.getMatrix=function(t){var e=t||this.getWorldTransform(),n=b(L(),e),r=n[0],i=n[1],o=T(L(),e),a=o[0],s=o[1],u=S($(),e),c=Rr(L(),u);return _r(c[0]||c[2],r,i,a,s)},r.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},r.setMatrix=function(t){var e=Ir(t),n=e[0],r=e[1],i=e[2],o=e[3];this.setEulerAngles(e[4]).setPosition(n,r).setLocalScale(i,o)},r.setLocalMatrix=function(t){var e=Ir(t),n=e[0],r=e[1],i=e[2],o=e[3];this.setLocalEulerAngles(e[4]).setLocalPosition(n,r).setLocalScale(i,o)},r.show=function(){Zs.enableCSSParsing?this.style.visibility="visible":this.forEach((function(t){t.style.visibility="visible"}))},r.hide=function(){Zs.enableCSSParsing?this.style.visibility="hidden":this.forEach((function(t){t.style.visibility="hidden"}))},r.getCount=function(){return this.childElementCount},r.getParent=function(){return this.parentElement},r.getChildren=function(){return this.children},r.getFirst=function(){return this.firstElementChild},r.getLast=function(){return this.lastElementChild},r.getChildByIndex=function(t){return this.children[t]||null},r.add=function(t,e){return this.appendChild(t,e)},r.setClip=function(t){this.style.clipPath=t},r.set=function(t,e){this.config[t]=e},r.get=function(t){return this.config[t]},r.moveTo=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},r.move=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},r.setZIndex=function(t){return this.style.zIndex=t,this},kn(n,[{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}}]),n}(Ca),Ha=["style"],Wa=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=On(r,Ha);return e.call(this,Nn({type:t.Shape.CIRCLE,style:Nn(Zs.enableCSSParsing?{cx:"",cy:"",r:""}:{},i),initialParsedStyle:{anchor:[.5,.5],transformOrigin:Zs.enableCSSParsing?null:[dr,dr]}},o))||this}return Cn(n,e),n}(ja),Ya=["style"],Xa=function(t){function e(e){var n,r=void 0===e?{}:e,i=r.style,o=On(r,Ya);return(n=t.call(this,Nn({style:Nn(Zs.enableCSSParsing?{x:"",y:""}:{},i)},o))||this).isCustomElement=!0,n}return Cn(e,t),e}(ja),qa={},Ka=[],Za=function(){function e(){}var n=e.prototype;return n.getByEntity=function(t){return qa[t]},n.getAll=function(){return Object.keys(qa).map((function(t){return qa[t]}))},n.add=function(e,n){qa[e]=n,n.nodeName===t.Shape.HTML&&Ka.push(n)},n.remove=function(e){var n=qa[e];if(n&&(delete qa[e],n.nodeName===t.Shape.HTML)){var r=Ka.indexOf(n);Ka.splice(r,1)}},n.getHTMLs=function(){return Ka},e}(),Qa=["style"],$a=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=On(r,Qa);return e.call(this,Nn({type:t.Shape.ELLIPSE,style:Nn(Zs.enableCSSParsing?{cx:"",cy:"",rx:"",ry:""}:{},i),initialParsedStyle:{anchor:[.5,.5],transformOrigin:Zs.enableCSSParsing?null:[dr,dr]}},o))||this}return Cn(n,e),n}(ja),Ja=["style"],ts=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=On(r,Ja);return e.call(this,Nn({type:t.Shape.GROUP,style:Nn(Zs.enableCSSParsing?{x:"",y:"",width:"",height:""}:{},i)},o))||this}return Cn(n,e),n}(ja),es=["style"],ns=function(e){function n(n){var r,i=void 0===n?{}:n,o=i.style,a=On(i,es);return(r=e.call(this,Nn({type:t.Shape.HTML,style:Nn(Zs.enableCSSParsing?{x:"",y:"",width:"auto",height:"auto",innerHTML:""}:{},o)},a))||this).cullable.enable=!1,r}Cn(n,e);var r=n.prototype;return r.getDomElement=function(){return this.parsedStyle.$el},r.getBoundingClientRect=function(){return this.parsedStyle.$el.getBoundingClientRect()},r.getClientRects=function(){return[this.getBoundingClientRect()]},r.getBounds=function(){var t,e,n=this.getBoundingClientRect(),r=null===(t=this.ownerDocument)||void 0===t||null===(e=t.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect();if(r){var i=n.left-r.left,o=n.top-r.top,a=new na;return a.setMinMax([i,o,0],[i+n.width,o+n.height,0]),a}return null},r.getLocalBounds=function(){if(this.parentNode){var t=f(a(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!na.isEmpty(e)){var n=new na;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},n}(ja),rs=["style"],is=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=On(r,rs);return e.call(this,Nn({type:t.Shape.IMAGE,style:Nn(Zs.enableCSSParsing?{x:"",y:"",img:"",width:"",height:""}:{},i)},o))||this}return Cn(n,e),n}(ja),os=["style"],as=function(e){function n(n){var r,i=void 0===n?{}:n,o=i.style,a=On(i,os);(r=e.call(this,Nn({type:t.Shape.LINE,style:Nn({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0,isBillboard:!1},o)},a))||this).markerStartAngle=0,r.markerEndAngle=0;var s=r.parsedStyle,u=s.markerStart,c=s.markerEnd;return u&&Ra(u)&&(r.markerStartAngle=u.getLocalEulerAngles(),r.appendChild(u)),c&&Ra(c)&&(r.markerEndAngle=c.getLocalEulerAngles(),r.appendChild(c)),r.transformMarker(!0),r.transformMarker(!1),r}Cn(n,e);var r=n.prototype;return r.attributeChangedCallback=function(t,e,n,r,i){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Ra(r)&&(this.markerStartAngle=0,r.remove()),i&&Ra(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&Ra(r)&&(this.markerEndAngle=0,r.remove()),i&&Ra(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))},r.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=e.x1,o=e.x2,a=e.y1,s=e.y2,u=e.defX,c=e.defY,l=t?e.markerStart:e.markerEnd;if(l&&Ra(l)){var h,f,d,p,v,m,y;t?(p=i-u,v=a-c,f=o-i,d=s-a,m=n||0,y=this.markerStartAngle):(p=o-u,v=s-c,f=i-o,d=a-s,m=r||0,y=this.markerEndAngle),l.setLocalEulerAngles(180*(h=Math.atan2(d,f))/Math.PI+y),l.setLocalPosition(p+Math.cos(h)*m,v+Math.sin(h)*m)}},r.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,o=We.pointAt(n.x1,n.y1,n.x2,n.y2,t),a=o.x,s=o.y,u=W(L(),I(a-r,s-i,0),e?this.getWorldTransform():this.getLocalTransform());return new oa(u[0],u[1])},r.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},r.getTotalLength=function(){var t=this.parsedStyle;return We.length(t.x1,t.y1,t.x2,t.y2)},n}(ja),ss=["style"],us={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new aa(0,0,0,0)},cs=function(e){function n(n){var r,i=void 0===n?{}:n,o=i.style,a=On(i,ss);(r=e.call(this,Nn({type:t.Shape.PATH,style:Nn(Zs.enableCSSParsing?{path:"",miterLimit:""}:{},o),initialParsedStyle:Zs.enableCSSParsing?null:{miterLimit:4,path:Nn({},us)}},a))||this).markerStartAngle=0,r.markerEndAngle=0,r.markerMidList=[];var s=r.parsedStyle,u=s.markerStart,c=s.markerEnd,l=s.markerMid;return u&&Ra(u)&&(r.markerStartAngle=u.getLocalEulerAngles(),r.appendChild(u)),l&&Ra(l)&&r.placeMarkerMid(l),c&&Ra(c)&&(r.markerEndAngle=c.getLocalEulerAngles(),r.appendChild(c)),r.transformMarker(!0),r.transformMarker(!1),r}Cn(n,e);var r=n.prototype;return r.attributeChangedCallback=function(t,e,n,r,i){"path"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Ra(r)&&(this.markerStartAngle=0,r.remove()),i&&Ra(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Ra(r)&&(this.markerEndAngle=0,r.remove()),i&&Ra(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},r.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=e.defX,o=e.defY,a=t?e.markerStart:e.markerEnd;if(a&&Ra(a)){var s,u,c,l,h,f,d;if(t){var p=this.getStartTangent(),v=p[0],m=p[1];l=m[0]-i,h=m[1]-o,u=v[0]-m[0],c=v[1]-m[1],f=n||0,d=this.markerStartAngle}else{var y=this.getEndTangent(),g=y[0],x=y[1];l=x[0]-i,h=x[1]-o,u=g[0]-x[0],c=g[1]-x[1],f=r||0,d=this.markerEndAngle}a.setLocalEulerAngles(180*(s=Math.atan2(c,u))/Math.PI+d),a.setLocalPosition(l+Math.cos(s)*f,h+Math.sin(s)*f)}},r.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.path.segments,r=e.defX,i=e.defY;if(this.markerMidList.forEach((function(t){t.remove()})),t&&Ra(t))for(var o=1;n.length-1>o;o++){var a=n[o].currentPoint,s=a[0],u=a[1],c=1===o?t:t.cloneNode(!0);this.markerMidList.push(c),this.appendChild(c),c.setLocalPosition(s-r,u-i)}},r.getTotalLength=function(){return Xr(this)},r.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,o=function(t,e,n){return qt(t,e,vt(vt({},n),{bbox:!1,length:!0})).point}(n.path.absolutePath,t),a=o.x,s=o.y,u=W(L(),I(a-r,s-i,0),e?this.getWorldTransform():this.getLocalTransform());return new oa(u[0],u[1])},r.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*Xr(this),e)},r.getStartTangent=function(){var t=this.parsedStyle.path.segments,e=[];if(t.length>1){var n=t[0].currentPoint,r=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([n[0]-i[0],n[1]-i[1]]),e.push([n[0],n[1]])):(e.push([r[0],r[1]]),e.push([n[0],n[1]]))}return e},r.getEndTangent=function(){var t=this.parsedStyle.path.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,o=t[e-1].endTangent;n=[],o?(n.push([i[0]-o[0],i[1]-o[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n},n}(ja),ls=["style"],hs=function(e){function n(n){var r,i=void 0===n?{}:n,o=i.style,a=On(i,ls);(r=e.call(this,Nn({type:t.Shape.POLYGON,style:Nn(Zs.enableCSSParsing?{points:"",miterLimit:"",isClosed:!0}:{},o),initialParsedStyle:Zs.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},a))||this).markerStartAngle=0,r.markerEndAngle=0,r.markerMidList=[];var s=r.parsedStyle,u=s.markerStart,c=s.markerEnd,l=s.markerMid;return u&&Ra(u)&&(r.markerStartAngle=u.getLocalEulerAngles(),r.appendChild(u)),l&&Ra(l)&&r.placeMarkerMid(l),c&&Ra(c)&&(r.markerEndAngle=c.getLocalEulerAngles(),r.appendChild(c)),r.transformMarker(!0),r.transformMarker(!1),r}Cn(n,e);var r=n.prototype;return r.attributeChangedCallback=function(t,e,n,r,i){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Ra(r)&&(this.markerStartAngle=0,r.remove()),i&&Ra(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Ra(r)&&(this.markerEndAngle=0,r.remove()),i&&Ra(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},r.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=e.points.points,o=e.defX,a=e.defY,s=t?e.markerStart:e.markerEnd;if(s&&Ra(s)){var u,c,l,h,f,d,p;if(h=i[0][0]-o,f=i[0][1]-a,t)c=i[1][0]-i[0][0],l=i[1][1]-i[0][1],d=n||0,p=this.markerStartAngle;else{var v=i.length;this.parsedStyle.isClosed?(c=i[v-1][0]-i[0][0],l=i[v-1][1]-i[0][1]):(h=i[v-1][0]-o,f=i[v-1][1]-a,c=i[v-2][0]-i[v-1][0],l=i[v-2][1]-i[v-1][1]),d=r||0,p=this.markerEndAngle}s.setLocalEulerAngles(180*(u=Math.atan2(l,c))/Math.PI+p),s.setLocalPosition(h+Math.cos(u)*d,f+Math.sin(u)*d)}},r.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.points.points,r=e.defX,i=e.defY;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&Ra(t))for(var o=1;(this.parsedStyle.isClosed?n.length:n.length-1)>o;o++){var a=n[o][0]-r,s=n[o][1]-i,u=1===o?t:t.cloneNode(!0);this.markerMidList.push(u),this.appendChild(u),u.setLocalPosition(a,s)}},n}(ja),fs=["style"],ds=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=On(r,fs);return e.call(this,Nn({type:t.Shape.POLYLINE,style:Nn(Zs.enableCSSParsing?{points:"",miterLimit:"",isClosed:!1}:{},i),initialParsedStyle:Zs.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},o))||this}Cn(n,e);var r=n.prototype;return r.getTotalLength=function(){return this.parsedStyle.points.totalLength},r.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},r.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,o=n.points,a=o.points,s=0,u=0;o.segments.forEach((function(e,n){e[0]>t||t>e[1]||(s=(t-e[0])/(e[1]-e[0]),u=n)}));var c=We.pointAt(a[u][0],a[u][1],a[u+1][0],a[u+1][1],s),l=c.x,h=c.y,f=W(L(),I(l-r,h-i,0),e?this.getWorldTransform():this.getLocalTransform());return new oa(f[0],f[1])},r.getStartTangent=function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},r.getEndTangent=function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},n}(hs),ps=["style"],vs=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=On(r,ps);return e.call(this,Nn({type:t.Shape.RECT,style:Nn(Zs.enableCSSParsing?{x:"",y:"",width:"",height:"",radius:""}:{},i)},o))||this}return Cn(n,e),n}(ja),ms=["style"],ys=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=On(r,ms);return e.call(this,Nn({type:t.Shape.TEXT,style:Nn(Zs.enableCSSParsing?{x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""}:{fill:"black"},i),initialParsedStyle:Zs.enableCSSParsing?{}:{x:0,y:0,fontSize:16,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",lineHeight:0,letterSpacing:0,textBaseline:"alphabetic",textAlign:"start",wordWrap:!1,wordWrapWidth:0,leading:0,dx:0,dy:0}},o))||this}Cn(n,e);var r=n.prototype;return r.getComputedTextLength=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0},r.getLineBoundingRects=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]},r.isOverflowing=function(){return!!this.parsedStyle.isOverflowing},n}(ja),gs=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.PAINT},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:t.PropertySyntax.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:t.PropertySyntax.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:t.PropertySyntax.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:t.PropertySyntax.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:t.PropertySyntax.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:t.PropertySyntax.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:t.PropertySyntax.FILTER},{n:"clipPath",syntax:t.PropertySyntax.DEFINED_PATH},{n:"textPath",syntax:t.PropertySyntax.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.TRANSFORM},{n:"transformOrigin",p:100,d:function(e){return e===t.Shape.CIRCLE||e===t.Shape.ELLIPSE?"center":e===t.Shape.TEXT?"text-anchor":"left top"},l:!0,syntax:t.PropertySyntax.TRANSFORM_ORIGIN},{n:"anchor",p:99,d:function(e){return e===t.Shape.CIRCLE||e===t.Shape.ELLIPSE?"0.5 0.5":"0 0"},l:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE_12},{n:"cx",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"cy",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"x",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"y",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"z",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"y1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"z1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"x2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"y2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"z2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"path",int:!0,l:!0,d:"",a:["d"],syntax:t.PropertySyntax.PATH,p:50},{n:"points",int:!0,l:!0,syntax:t.PropertySyntax.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:t.PropertySyntax.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:t.PropertySyntax.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:t.PropertySyntax.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:t.PropertySyntax.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:t.PropertySyntax.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:t.PropertySyntax.NUMBER,d:function(e){return e===t.Shape.PATH||e===t.Shape.POLYGON||e===t.Shape.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:t.PropertySyntax.MARKER},{n:"markerEnd",syntax:t.PropertySyntax.MARKER},{n:"markerMid",syntax:t.PropertySyntax.MARKER},{n:"markerStartOffset",syntax:t.PropertySyntax.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:t.PropertySyntax.LENGTH,l:!0,int:!0,d:"0"}],xs=gs.filter((function(t){return!!t.l})).map((function(t){return t.n})),Es={},bs=new WeakMap,Ts=function(){function e(){var t=this;gs.forEach((function(e){t.registerMetadata(e)}))}var n=e.prototype;return n.registerMetadata=function(t){[t.n].concat(t.a||[]).forEach((function(e){Es[e]=t}))},n.unregisterMetadata=function(t){delete Es[t]},n.getPropertySyntax=function(t){return Zs.CSSPropertySyntaxFactory[t]},n.processProperties=function(e,n,r){var i=this;if(void 0===r&&(r={skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[]}),!Zs.enableCSSParsing){n.src&&(n.img=n.src),n.d&&(n.path=n.d),n.strokeDasharray&&(n.lineDash=n.strokeDasharray),n.strokeWidth&&(n.lineWidth=n.strokeWidth),n.textAnchor&&(n.textAlign=n.textAnchor),Object.assign(e.attributes,n);var o=Object.keys(n),a=e.parsedStyle.clipPath,s=e.parsedStyle.offsetPath;e.parsedStyle=Object.assign(e.parsedStyle,n);var u=!!r.forceUpdateGeometry;if(!u)for(var c=0;xs.length>c;c++)if(xs[c]in n){u=!0;break}return n.fill&&(e.parsedStyle.fill=Ji(n.fill)),n.stroke&&(e.parsedStyle.stroke=Ji(n.stroke)),n.shadowColor&&(e.parsedStyle.shadowColor=Ji(n.shadowColor)),n.filter&&(e.parsedStyle.filter=fo(n.filter)),$t(n.radius)||(e.parsedStyle.radius=so(n.radius,4)),$t(n.lineDash)||(e.parsedStyle.lineDash=so(n.lineDash,2)),n.points&&(e.parsedStyle.points=So(n.points,e)),""===n.path&&(e.parsedStyle.path=Nn({},us)),n.path&&(e.parsedStyle.path=bo(n.path,e)),n.textTransform&&Zs.CSSPropertySyntaxFactory["<text-transform>"].calculator(null,null,{value:n.textTransform},e,null),n.clipPath&&Zs.CSSPropertySyntaxFactory["<defined-path>"].calculator("clipPath",a,n.clipPath,e,this),n.offsetPath&&Zs.CSSPropertySyntaxFactory["<defined-path>"].calculator("offsetPath",s,n.offsetPath,e,this),n.anchor&&(e.parsedStyle.anchor=so(n.anchor,2)),n.transform&&(e.parsedStyle.transform=Co(n.transform)),n.transformOrigin&&(e.parsedStyle.transformOrigin=Uo(n.transformOrigin)),n.markerStart&&(e.parsedStyle.markerStart=Zs.CSSPropertySyntaxFactory["<marker>"].calculator(null,n.markerStart,n.markerStart,null,null)),n.markerEnd&&(e.parsedStyle.markerEnd=Zs.CSSPropertySyntaxFactory["<marker>"].calculator(null,n.markerEnd,n.markerEnd,null,null)),n.markerMid&&(e.parsedStyle.markerMid=Zs.CSSPropertySyntaxFactory["<marker>"].calculator("",n.markerMid,n.markerMid,null,null)),(e.nodeName!==t.Shape.CIRCLE&&e.nodeName!==t.Shape.ELLIPSE||$t(n.cx)&&$t(n.cy))&&(e.nodeName!==t.Shape.RECT&&e.nodeName!==t.Shape.IMAGE&&e.nodeName!==t.Shape.GROUP&&e.nodeName!==t.Shape.HTML&&e.nodeName!==t.Shape.TEXT&&e.nodeName!==t.Shape.MESH||$t(n.x)&&$t(n.y)&&$t(n.z))&&(e.nodeName!==t.Shape.LINE||$t(n.x1)&&$t(n.y1)&&$t(n.z1)&&$t(n.x2)&&$t(n.y2)&&$t(n.z2))||Zs.CSSPropertySyntaxFactory["<coordinate>"].postProcessor(e,o),$t(n.zIndex)||Zs.CSSPropertySyntaxFactory["<z-index>"].postProcessor(e,o),n.path&&Zs.CSSPropertySyntaxFactory["<path>"].postProcessor(e,o),n.points&&Zs.CSSPropertySyntaxFactory["<list-of-points>"].postProcessor(e,o),$t(n.offsetDistance)||Zs.CSSPropertySyntaxFactory["<offset-distance>"].postProcessor(e,o),n.transform&&Zs.CSSPropertySyntaxFactory["<transform>"].postProcessor(e,o),void(u&&this.updateGeometry(e))}var l=r.skipUpdateAttribute,h=r.skipParse,f=r.usedAttributes,d=r.forceUpdateGeometry,p=Object.keys(n);p.forEach((function(t){var r,i=Zn(t);l||(e.attributes[i]=n[t]),!d&&(null===(r=Es[i])||void 0===r?void 0:r.l)&&(d=!0)})),h||p.forEach((function(t){e.computedStyle[t]=i.parseProperty(t,e.attributes[t],e)})),(null==f?void 0:f.length)&&(p=Array.from(new Set(p.concat(f)))),p.forEach((function(t){t in e.computedStyle&&(e.parsedStyle[t]=i.computeProperty(t,e.computedStyle[t],e))})),d&&this.updateGeometry(e),p.forEach((function(t){t in e.parsedStyle&&i.postProcessProperty(t,e,p)})),Zs.enableCSSParsing&&e.children.length&&p.forEach((function(t){t in e.parsedStyle&&i.isPropertyInheritable(t)&&e.children.forEach((function(e){e.internalSetAttribute(t,null,{skipUpdateAttribute:!0,skipParse:!0})}))}))},n.parseProperty=function(t,e,n){var r=Es[t],i=e;if((""===e||$t(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)i=ur(e);else if(r){var o=r.k,a=r.syntax,s=a&&this.getPropertySyntax(a);o&&o.indexOf(e)>-1?i=ur(e):s&&s.parser&&(i=s.parser(e,n))}return i},n.computeProperty=function(t,e,n){var r=Es[t],i=e;if(r){var o=r.syntax,a=r.d;if(e instanceof Hn){var s=e.value;if("unset"===s&&(s=r.inh&&!("g-root"===n.id)?"inherit":"initial"),"initial"===s)$t(a)||(e=this.parseProperty(t,qn(a)?a(n.nodeName):a,n));else if("inherit"===s){var u=this.tryToResolveProperty(n,t,{inherited:!0});return $t(u)?void this.addUnresolveProperty(n,t):u}}var c=o&&this.getPropertySyntax(o);if(c&&c.calculator)i=c.calculator(t,n.parsedStyle[t],e,n,this);else i=e instanceof Hn?e.value:e}return i},n.postProcessProperty=function(t,e,n){var r=Es[t];if(r&&r.syntax){var i=r.syntax&&this.getPropertySyntax(r.syntax);i&&i.postProcessor&&i.postProcessor(e,n)}},n.addUnresolveProperty=function(t,e){var n=bs.get(t);n||(bs.set(t,[]),n=bs.get(t)),-1===n.indexOf(e)&&n.push(e)},n.tryToResolveProperty=function(t,e,n){if(void 0===n&&(n={}),n.inherited&&t.parentElement&&function(t,e){var n=bs.get(t);return!n||0===n.length||n.includes(e)}(t.parentElement,e)){var r=t.parentElement.parsedStyle[e];if("unset"===r||"initial"===r||"inherit"===r)return;return r}},n.recalc=function(t){var e=bs.get(t);if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),bs.delete(t)}},n.updateGeometry=function(e){var n=e.nodeName,r=Zs.geometryUpdaterFactory[n];if(r){var i=e.geometry;i.contentBounds||(i.contentBounds=new na),i.renderBounds||(i.renderBounds=new na);var o=e.parsedStyle,a=r.update(o,e),s=a.width,u=a.height,c=a.depth,l=void 0===c?0:c,h=a.offsetX,f=void 0===h?0:h,d=a.offsetY,p=void 0===d?0:d,v=a.offsetZ,m=void 0===v?0:v,y=[Math.abs(s)/2,Math.abs(u)/2,l/2],g=o.stroke,x=o.lineWidth,E=o.increasedLineWidthForHitTesting,b=o.shadowType,T=o.shadowColor,S=o.filter,P=void 0===S?[]:S,M=o.transformOrigin,w=o.anchor;n===t.Shape.TEXT&&delete o.anchor;var k=[(1-2*(w&&w[0]||0))*s/2+f,(1-2*(w&&w[1]||0))*u/2+p,(1-2*(w&&w[2]||0))*y[2]+m];if(i.contentBounds.update(k,y),g&&!g.isNone){var N=((x||0)+(E||0))*(n===t.Shape.POLYLINE||n===t.Shape.POLYGON||n===t.Shape.PATH?Math.SQRT2:.5);y[0]+=N,y[1]+=N}if(i.renderBounds.update(k,y),T&&b&&"inner"!==b){var C=i.renderBounds,A=C.min,O=C.max,L=o.shadowBlur||0,R=o.shadowOffsetX||0,_=o.shadowOffsetY||0,I=O[0]+L+R,D=A[1]-L+_,F=O[1]+L+_;A[0]=Math.min(A[0],A[0]-L+R),O[0]=Math.max(O[0],I),A[1]=Math.min(A[1],D),O[1]=Math.max(O[1],F),i.renderBounds.setMinMax(A,O)}P.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var r=n[0].value;i.renderBounds.update(i.renderBounds.center,wr(i.renderBounds.halfExtents,i.renderBounds.halfExtents,[r,r,0]))}else if("drop-shadow"===e){var o=n[0].value,a=n[1].value,s=n[2].value,u=i.renderBounds,c=u.min,l=u.max,h=l[0]+s+o,f=c[1]-s+a,d=l[1]+s+a;c[0]=Math.min(c[0],c[0]-s+o),l[0]=Math.max(l[0],h),c[1]=Math.min(c[1],f),l[1]=Math.max(l[1],d),i.renderBounds.setMinMax(c,l)}})),w=o.anchor;var G=0>s,B=0>u,U=(G?-1:1)*(M?co(M[0],0,e):0),z=(B?-1:1)*(M?co(M[1],1,e):0);e.setOrigin(U-=(G?-1:1)*(w&&w[0]||0)*i.contentBounds.halfExtents[0]*2,z-=(B?-1:1)*(w&&w[1]||0)*i.contentBounds.halfExtents[1]*2),Zs.sceneGraphService.dirtifyToRoot(e)}},n.isPropertyInheritable=function(t){var e=Es[t];return!!e&&e.inh},e}();(_a=t.CameraType||(t.CameraType={}))[_a.ORBITING=0]="ORBITING",_a[_a.EXPLORING=1]="EXPLORING",_a[_a.TRACKING=2]="TRACKING",(Ia=t.CameraTrackingMode||(t.CameraTrackingMode={}))[Ia.DEFAULT=0]="DEFAULT",Ia[Ia.ROTATIONAL=1]="ROTATIONAL",Ia[Ia.TRANSLATIONAL=2]="TRANSLATIONAL",Ia[Ia.CINEMATIC=3]="CINEMATIC",(Da=t.CameraProjectionMode||(t.CameraProjectionMode={}))[Da.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",Da[Da.PERSPECTIVE=1]="PERSPECTIVE";var Ss,Ps={UPDATED:"updated"},Ms=2e-4,ws=function(){function e(){this.canvas=void 0,this.eventEmitter=new Tn,this.matrix=a(),this.right=I(1,0,0),this.up=I(0,1,0),this.forward=I(0,0,1),this.position=I(0,0,1),this.focalPoint=I(0,0,0),this.distanceVector=I(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.left=void 0,this.rright=void 0,this.top=void 0,this.bottom=void 0,this.projectionMatrix=a(),this.projectionMatrixInverse=a(),this.jitteredProjectionMatrix=void 0,this.view=void 0,this.enableUpdate=!0,this.type=t.CameraType.EXPLORING,this.trackingMode=t.CameraTrackingMode.DEFAULT,this.projectionMode=t.CameraProjectionMode.PERSPECTIVE,this.frustum=new ia,this.orthoMatrix=a()}var n=e.prototype;return n.isOrtho=function(){return this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC},n.getProjectionMode=function(){return this.projectionMode},n.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},n.getPerspectiveInverse=function(){return this.projectionMatrixInverse},n.getFrustum=function(){return this.frustum},n.getPosition=function(){return this.position},n.getFocalPoint=function(){return this.focalPoint},n.getDollyingStep=function(){return this.dollyingStep},n.getNear=function(){return this.near},n.getFar=function(){return this.far},n.getZoom=function(){return this.zoom},n.getOrthoMatrix=function(){return this.orthoMatrix},n.getView=function(){return this.view},n.setEnableUpdate=function(t){this.enableUpdate=t},n.setType=function(e,n){return this.type=e,this.setWorldRotation(this.type===t.CameraType.EXPLORING),this._getAngles(),this.type===t.CameraType.TRACKING&&void 0!==n&&this.setTrackingMode(n),this},n.setProjectionMode=function(t){return this.projectionMode=t,this},n.setTrackingMode=function(e){if(this.type!==t.CameraType.TRACKING)throw Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=e,this},n.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},n.getViewTransform=function(){return f(a(),this.matrix)},n.getWorldTransform=function(){return this.matrix},n.jitterProjectionMatrix=function(t,e){var n=x(a(),[t,e,0]);this.jitteredProjectionMatrix=p(a(),n,this.projectionMatrix)},n.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},n.setMatrix=function(t){return this.matrix=t,this._update(),this},n.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},n.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},n.setNear=function(e){return this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(e,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,e,this.far),this},n.setFar=function(e){return this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,e,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,e),this},n.setViewOffset=function(e,n,r,i,o,a){return this.aspect=e/n,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=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.projectionMode===t.CameraProjectionMode.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},n.clearViewOffset=function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===t.CameraProjectionMode.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},n.setZoom=function(e){return this.zoom=e,this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===t.CameraProjectionMode.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},n.setZoomByViewportPoint=function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),r=n.x,i=n.y,o=this.roll;this.rotate(0,0,-o),this.setPosition(r,i),this.setFocalPoint(r,i),this.setZoom(t),this.rotate(0,0,o);var a=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),s=I(a.x-r,a.y-i,0),u=V(s,this.right)/_(this.right),c=V(s,this.up)/_(this.up);return this.pan(-u,-c),this},n.setPerspective=function(e,n,r,i){var o;this.projectionMode=t.CameraProjectionMode.PERSPECTIVE,this.fov=r,this.near=e,this.far=n,this.aspect=i;var a=this.near*Math.tan(Ar(.5*this.fov))/this.zoom,s=2*a,u=this.aspect*s,c=-.5*u;if(null===(o=this.view)||void 0===o?void 0:o.enabled){var l=this.view.fullWidth,h=this.view.fullHeight;c+=this.view.offsetX*u/l,a-=this.view.offsetY*s/h,u*=this.view.width/l,s*=this.view.height/h}return function(t,e,n,r,i,o,a){var s=2*o/(r-i),u=(n+e)/(n-e),c=(r+i)/(r-i),l=-(a+o)/(a-o),h=-2*a*o/(a-o);t[0]=2*o/(n-e),t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=u,t[9]=c,t[10]=l,t[11]=-1,t[12]=0,t[13]=0,t[14]=h,t[15]=0}(this.projectionMatrix,c,c+u,a,a-s,e,this.far),m(this.projectionMatrix,this.projectionMatrix,I(1,-1,1)),f(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},n.setOrthographic=function(e,n,r,i,o,a){var s;this.projectionMode=t.CameraProjectionMode.ORTHOGRAPHIC,this.rright=n,this.left=e,this.top=r,this.bottom=i,this.near=o,this.far=a;var u=(this.rright-this.left)/(2*this.zoom),c=(this.top-this.bottom)/(2*this.zoom),l=(this.rright+this.left)/2,h=(this.top+this.bottom)/2,d=l-u,p=l+u,v=h+c,y=h-c;if(null===(s=this.view)||void 0===s?void 0:s.enabled){var g=(this.rright-this.left)/this.view.fullWidth/this.zoom,x=(this.top-this.bottom)/this.view.fullHeight/this.zoom;p=(d+=g*this.view.offsetX)+g*this.view.width,y=(v-=x*this.view.offsetY)-x*this.view.height}return N(this.projectionMatrix,d,p,y,v,o,a),m(this.projectionMatrix,this.projectionMatrix,I(1,-1,1)),f(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},n.setPosition=function(t,e,n){void 0===e&&(e=this.position[1]),void 0===n&&(n=this.position[2]);var r=Cr(t,e,n);return this._setPosition(r),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},n.setFocalPoint=function(e,n,r){void 0===n&&(n=this.focalPoint[1]),void 0===r&&(r=this.focalPoint[2]);var i=I(0,1,0);if(this.focalPoint=Cr(e,n,r),this.trackingMode===t.CameraTrackingMode.CINEMATIC){var o=B(L(),this.focalPoint,this.position);e=o[0],n=o[1],r=o[2];var s=_(o),u=Or(Math.asin(n/s)),c=90+Or(Math.atan2(r,e)),l=a();g(l,l,Ar(c)),y(l,l,Ar(u)),i=W(L(),[0,1,0],l)}return f(this.matrix,C(a(),this.position,this.focalPoint,i)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},n.getDistance=function(){return this.distance},n.getDistanceVector=function(){return this.distanceVector},n.setDistance=function(t){if(this.distance===t||0>t)return this;this.distance=t,Ms>this.distance&&(this.distance=Ms),this.dollyingStep=this.distance/100;var e=L(),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},n.setMaxDistance=function(t){return this.maxDistance=t,this},n.setMinDistance=function(t){return this.minDistance=t,this},n.setAzimuth=function(e){return this.azimuth=Nr(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},n.getAzimuth=function(){return this.azimuth},n.setElevation=function(e){return this.elevation=Nr(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},n.getElevation=function(){return this.elevation},n.setRoll=function(e){return this.roll=Nr(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},n.getRoll=function(){return this.roll},n._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},n.computeMatrix=function(){var e=J($(),[0,0,1],Ar(this.roll));l(this.matrix);var n=J($(),[1,0,0],Ar((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.elevation)),r=J($(),[0,1,0],Ar((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.azimuth)),i=tt($(),r,n);i=tt($(),i,e);var o=M(a(),i);this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?(v(this.matrix,this.matrix,this.focalPoint),p(this.matrix,this.matrix,o),v(this.matrix,this.matrix,[0,0,this.distance])):this.type===t.CameraType.TRACKING&&(v(this.matrix,this.matrix,this.position),p(this.matrix,this.matrix,o))},n._setPosition=function(t,e,n){this.position=Cr(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()},n._getAxes=function(){D(this.right,Cr(Q(Z(),[1,0,0,0],this.matrix))),D(this.up,Cr(Q(Z(),[0,1,0,0],this.matrix))),D(this.forward,Cr(Q(Z(),[0,0,1,0],this.matrix))),z(this.right,this.right),z(this.up,this.up),z(this.forward,this.forward)},n._getAngles=function(){var e=this.distanceVector[0],n=this.distanceVector[1],r=this.distanceVector[2],i=_(this.distanceVector);if(0===i)return this.elevation=0,void(this.azimuth=0);this.type===t.CameraType.TRACKING||this.rotateWorld?(this.elevation=Or(Math.asin(n/i)),this.azimuth=Or(Math.atan2(-e,-r))):(this.elevation=-Or(Math.asin(n/i)),this.azimuth=-Or(Math.atan2(-e,-r)))},n._getPosition=function(){D(this.position,Cr(Q(Z(),[0,0,0,1],this.matrix))),this._getDistance()},n._getFocalPoint=function(){var t,e;!function(t,e,n){var r=e[0],i=e[1],o=e[2];t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8]}(this.distanceVector,[0,0,-this.distance],(t=o(),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)),G(this.focalPoint,this.position,this.distanceVector),this._getDistance()},n._getDistance=function(){this.distanceVector=B(L(),this.focalPoint,this.position),this.distance=_(this.distanceVector),this.dollyingStep=this.distance/100},n._getOrthoMatrix=function(){if(this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC){var e=this.position,n=J($(),[0,0,1],-this.roll*Math.PI/180);P(this.orthoMatrix,n,I((this.rright-this.left)/2-e[0],(this.top-this.bottom)/2-e[1],0),I(this.zoom,this.zoom,1),e)}},n.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),e=p(a(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(Ps.UPDATED)}},n.rotate=function(t,e,n){throw Error(br)},n.pan=function(t,e){throw Error(br)},n.dolly=function(t){throw Error(br)},n.createLandmark=function(t,e){throw Error(br)},n.gotoLandmark=function(t,e){throw Error(br)},n.cancelLandmarkAnimation=function(){throw Error(br)},e}(),ks=function(){function t(){}return t.prototype.update=function(t,e){var n=t.r;return{width:2*n,height:2*n}},t}(),Ns=function(){function t(){}return t.prototype.update=function(t,e){return{width:2*t.rx,height:2*t.ry}},t}(),Cs=function(){function t(){}return t.prototype.update=function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,o=Math.min(e,r),a=Math.max(e,r),s=Math.min(n,i);return{width:a-o,height:Math.max(n,i)-s}},t}(),As=function(){function t(){}return t.prototype.update=function(t){var e=t.path.rect;return{width:e.width,height:e.height}},t}(),Os=function(){function t(){}return t.prototype.update=function(t){var e=t.points.points,n=Math.min.apply(Math,e.map((function(t){return t[0]}))),r=Math.max.apply(Math,e.map((function(t){return t[0]}))),i=Math.min.apply(Math,e.map((function(t){return t[1]})));return{width:r-n,height:Math.max.apply(Math,e.map((function(t){return t[1]})))-i}},t}(),Ls=function(){function t(){}return t.prototype.update=function(t,e){var n=t.img,r=t.width,i=t.height,o=void 0===r?0:r,a=void 0===i?0:i;return n&&!oe(n)&&(o||(t.width=o=n.width),a||(t.height=a=n.height)),{width:o,height:a}},t}(),Rs=function(){function t(t){this.globalRuntime=void 0,this.globalRuntime=t}var e=t.prototype;return e.isReadyToMeasure=function(t,e){return t.text&&t.fontSize&&t.fontStyle&&t.fontWeight&&t.fontVariant&&t.textAlign&&t.textBaseline&&!$t(t.lineWidth)},e.update=function(t,e){var n,r,i=t.text,o=t.textAlign,a=t.lineWidth,s=t.textBaseline,u=t.dx,c=t.dy,l=((null==e||null===(n=e.ownerDocument)||void 0===n||null===(r=n.defaultView)||void 0===r?void 0:r.getConfig())||{}).offscreenCanvas;if(!this.isReadyToMeasure(t,e))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{width:0,height:0,x:0,y:0,offsetX:0,offsetY:0};var h=this.globalRuntime.textService.measureText(i,t,l);t.metrics=h;var f=[h.width/2,h.height/2,0],d=[0,1],p=0;"center"===o||"middle"===o?(p=a/2,d=[.5,1]):"right"!==o&&"end"!==o||(p=a,d=[1,1]);var v=0;return"middle"===s?v=f[1]:"top"===s||"hanging"===s?v=2*f[1]:"alphabetic"===s?v=Zs.enableCSSParsing?h.lineHeight-h.fontProperties.ascent:0:"bottom"!==s&&"ideographic"!==s||(v=0),u&&(p+=u),c&&(v+=c),t.anchor=[d[0],d[1],0],{width:2*f[0],height:2*f[1],offsetX:p,offsetY:v}},t}(),_s=function(){function t(t,e){var n=this;this.globalRuntime=void 0,this.context=void 0,this.rootTarget=void 0,this.emitter=new Tn,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.pickHandler=void 0,this.tmpMatrix=a(),this.tmpVec3=L(),this.onPointerDown=function(t){var e=n.createPointerEvent(t);if(n.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)n.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){n.dispatchEvent(e,2===e.button?"rightdown":"mousedown")}n.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),n.freeEvent(e)},this.onPointerUp=function(t){var e=performance.now(),r=n.createPointerEvent(t);if(n.dispatchEvent(r,"pointerup"),"touch"===r.pointerType)n.dispatchEvent(r,"touchend");else if("mouse"===r.pointerType||"pen"===r.pointerType){n.dispatchEvent(r,2===r.button?"rightup":"mouseup")}var i=n.trackingData(t.pointerId),o=n.findMountedTarget(i.pressTargetsByButton[t.button]),a=o;if(o&&!r.composedPath().includes(o)){for(var s=o;s&&!r.composedPath().includes(s);){if(r.currentTarget=s,n.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType)n.notifyTarget(r,"touchendoutside");else if("mouse"===r.pointerType||"pen"===r.pointerType){n.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside")}Ea.isNode(s)&&(s=s.parentNode)}delete i.pressTargetsByButton[t.button],a=s}if(a){var u,c=n.clonePointerEvent(r,"click");c.target=a,c.path=[],i.clicksByButton[t.button]||(i.clicksByButton[t.button]={clickCount:0,target:c.target,timeStamp:e});var l=i.clicksByButton[t.button];l.target===c.target&&200>e-l.timeStamp?++l.clickCount:l.clickCount=1,l.target=c.target,l.timeStamp=e,c.detail=l.clickCount,(null===(u=r.detail)||void 0===u?void 0:u.preventClick)||(n.context.config.useNativeClickEvent||"mouse"!==c.pointerType&&"touch"!==c.pointerType||n.dispatchEvent(c,"click"),n.dispatchEvent(c,"pointertap")),n.freeEvent(c)}n.freeEvent(r)},this.onPointerMove=function(t){var e=n.createPointerEvent(t),r="mouse"===e.pointerType||"pen"===e.pointerType,i=n.trackingData(t.pointerId),o=n.findMountedTarget(i.overTargets);if(i.overTargets&&o!==e.target){var a=n.createPointerEvent(t,"mousemove"===t.type?"mouseout":"pointerout",o||void 0);if(n.dispatchEvent(a,"pointerout"),r&&n.dispatchEvent(a,"mouseout"),!e.composedPath().includes(o)){var s=n.createPointerEvent(t,"pointerleave",o||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&!e.composedPath().includes(s.target);)s.currentTarget=s.target,n.notifyTarget(s),r&&n.notifyTarget(s,"mouseleave"),Ea.isNode(s.target)&&(s.target=s.target.parentNode);n.freeEvent(s)}n.freeEvent(a)}if(o!==e.target){var u=n.clonePointerEvent(e,"mousemove"===t.type?"mouseover":"pointerover");n.dispatchEvent(u,"pointerover"),r&&n.dispatchEvent(u,"mouseover");for(var c=o&&Ea.isNode(o)&&o.parentNode;c&&c!==(Ea.isNode(n.rootTarget)&&n.rootTarget.parentNode)&&c!==e.target;)c=c.parentNode;if(!c||c===(Ea.isNode(n.rootTarget)&&n.rootTarget.parentNode)){var l=n.clonePointerEvent(e,"pointerenter");for(l.eventPhase=l.AT_TARGET;l.target&&l.target!==o&&l.target!==(Ea.isNode(n.rootTarget)&&n.rootTarget.parentNode);)l.currentTarget=l.target,n.notifyTarget(l),r&&n.notifyTarget(l,"mouseenter"),Ea.isNode(l.target)&&(l.target=l.target.parentNode);n.freeEvent(l)}n.freeEvent(u)}n.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&n.dispatchEvent(e,"touchmove"),r&&(n.dispatchEvent(e,"mousemove"),n.cursor=n.getCursor(e.target)),i.overTargets=e.composedPath(),n.freeEvent(e)},this.onPointerOut=function(t){var e=n.trackingData(t.pointerId);if(e.overTargets){var r="mouse"===t.pointerType||"pen"===t.pointerType,i=n.findMountedTarget(e.overTargets),o=n.createPointerEvent(t,"pointerout",i||void 0);n.dispatchEvent(o),r&&n.dispatchEvent(o,"mouseout");var a=n.createPointerEvent(t,"pointerleave",i||void 0);for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(Ea.isNode(n.rootTarget)&&n.rootTarget.parentNode);)a.currentTarget=a.target,n.notifyTarget(a),r&&n.notifyTarget(a,"mouseleave"),Ea.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=null,n.freeEvent(o),n.freeEvent(a)}n.cursor=null},this.onPointerOver=function(t){var e=n.trackingData(t.pointerId),r=n.createPointerEvent(t),i="mouse"===r.pointerType||"pen"===r.pointerType;n.dispatchEvent(r,"pointerover"),i&&n.dispatchEvent(r,"mouseover"),"mouse"===r.pointerType&&(n.cursor=n.getCursor(r.target));var o=n.clonePointerEvent(r,"pointerenter");for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==(Ea.isNode(n.rootTarget)&&n.rootTarget.parentNode);)o.currentTarget=o.target,n.notifyTarget(o),i&&n.notifyTarget(o,"mouseenter"),Ea.isNode(o.target)&&(o.target=o.target.parentNode);e.overTargets=r.composedPath(),n.freeEvent(r),n.freeEvent(o)},this.onPointerUpOutside=function(t){var e=n.trackingData(t.pointerId),r=n.findMountedTarget(e.pressTargetsByButton[t.button]),i=n.createPointerEvent(t);if(r){for(var o=r;o;)i.currentTarget=o,n.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType||"mouse"!==i.pointerType&&"pen"!==i.pointerType||n.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),Ea.isNode(o)&&(o=o.parentNode);delete e.pressTargetsByButton[t.button]}n.freeEvent(i)},this.onWheel=function(t){var e=n.createWheelEvent(t);n.dispatchEvent(e),n.freeEvent(e)},this.onClick=function(t){if(n.context.config.useNativeClickEvent){var e=n.createPointerEvent(t);n.dispatchEvent(e),n.freeEvent(e)}},this.onPointerCancel=function(t){var e=n.createPointerEvent(t);n.dispatchEvent(e),n.freeEvent(e)},this.globalRuntime=t,this.context=e}var e=t.prototype;return e.init=function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)},e.destroy=function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()},e.client2Viewport=function(t){var e=this.context.contextService.getBoundingClientRect();return new oa(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))},e.viewport2Client=function(t){var e=this.context.contextService.getBoundingClientRect();return new oa(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))},e.viewport2Canvas=function(t){var e=t.x,n=t.y,r=this.rootTarget.defaultView.getCamera(),i=this.context.config,o=i.width,a=i.height,s=r.getPerspectiveInverse(),u=r.getWorldTransform(),c=p(this.tmpMatrix,u,s),l=F(this.tmpVec3,e/o*2-1,2*(1-n/a)-1,0);return W(l,l,c),new oa(l[0],l[1])},e.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=p(this.tmpMatrix,n,r),o=F(this.tmpVec3,t.x,t.y,0);W(this.tmpVec3,this.tmpVec3,i);var a=this.context.config;return new oa((o[0]+1)/2*a.width,(1-(o[1]+1)/2)*a.height)},e.setPickHandler=function(t){this.pickHandler=t},e.addEventMapping=function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((function(t,e){return t.priority-e.priority}))},e.mapEvent=function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,r=e.length;r>n;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for "+t.type)}},e.dispatchEvent=function(t,e,n){n?(t.eventPhase=t.AT_TARGET,t.currentTarget=this.rootTarget.defaultView||null,this.notifyListeners(t,e)):(t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e));this.emitter.emit(e||t.type,t)},e.propagate=function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;r>=1;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var i=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var o=i+1;n.length>o;o++)if(t.currentTarget=n[o],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}},e.propagationPath=function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)return e.unshift(n.document),e;for(var r=0;2048>r&&t!==this.rootTarget;r++)Ea.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e},e.hitTest=function(t){var e=t.viewportX,n=t.viewportY,r=this.context.config;return 0>e||0>n||e>r.width||n>r.height?null:this.pickHandler(t)||this.rootTarget||null},e.isNativeEventFromCanvas=function(t){var e,n=this.context.contextService.getDomElement(),r=null===(e=t.nativeEvent)||void 0===e?void 0:e.target;if(r){if(r===n)return!0;if(n&&n.contains)return n.contains(r)}return!!t.nativeEvent.composedPath&&t.nativeEvent.composedPath().indexOf(n)>-1},e.getExistedHTML=function(t){if(t.nativeEvent.composedPath)for(var e,n=_n(this.globalRuntime.displayObjectPool.getHTMLs());!(e=n()).done;){var r=e.value;if(t.nativeEvent.composedPath().indexOf(r)>-1)return r}return null},e.pickTarget=function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})},e.createPointerEvent=function(t,e,n){var r=this.allocateEvent(Oa);this.copyPointerData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.nativeEvent=t.nativeEvent,r.originalEvent=t;var i=this.getExistedHTML(r);return r.target=null!=n?n:i||this.isNativeEventFromCanvas(r)&&this.pickTarget(r),"string"==typeof e&&(r.type=e),r},e.createWheelEvent=function(t){var e=this.allocateEvent(La);this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t;var n=this.getExistedHTML(e);return e.target=n||this.isNativeEventFromCanvas(e)&&this.pickTarget(e),e},e.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},e.cloneWheelEvent=function(t){var e=this.allocateEvent(La);return e.nativeEvent=t.nativeEvent,e.originalEvent=t.originalEvent,this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.target=t.target,e.path=t.composedPath().slice(),e.type=t.type,e},e.clonePointerEvent=function(t,e){var n=this.allocateEvent(Oa);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n},e.copyPointerData=function(t,e){e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist},e.copyMouseData=function(t,e){e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset)},e.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},e.copyData=function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=performance.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)},e.allocateEvent=function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e},e.freeEvent=function(t){if(t.manager!==this)throw Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)},e.notifyTarget=function(t,e){var n;e=null!==(n=e)&&void 0!==n?n:t.type,this.notifyListeners(t,t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?e+"capture":e),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)},e.notifyListeners=function(t,e){var n=t.currentTarget.emitter,r=n._events[e];if(r)if("fn"in r)r.once&&n.removeListener(e,r.fn,void 0,!0),r.fn.call(t.currentTarget||r.context,t);else for(var i=0;r.length>i&&!t.propagationImmediatelyStopped;i++)r[i].once&&n.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(t.currentTarget||r[i].context,t)},e.findMountedTarget=function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;n>=0;n--){var r=t[n];if(!(r===this.rootTarget||Ea.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},e.getCursor=function(t){for(var e=t;e;){var n=Ca.isElement(e)&&e.getAttribute("cursor");if(n)return n;e=Ea.isNode(e)&&e.parentNode}},t}(),Is=function(){function t(){this.canvas=void 0,this.context=void 0}var e=t.prototype;return e.getOrCreateCanvas=function(t,e){if(this.canvas)return this.canvas;if(t)this.canvas=t,this.context=this.canvas.getContext("2d",e);else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",e),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",e)}return this.canvas.width=10,this.canvas.height=10,this.canvas},e.getOrCreateContext=function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context},t}();(Ss=t.RenderReason||(t.RenderReason={}))[Ss.CAMERA_CHANGED=0]="CAMERA_CHANGED",Ss[Ss.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",Ss[Ss.NONE=2]="NONE";var Ds=function(){function e(e,n){this.globalRuntime=void 0,this.context=void 0,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.renderOrderChangedEvent=new ga(t.ElementEvent.RENDER_ORDER_CHANGED),this.hooks={init:new di,dirtycheck:new Ci(["object"]),cull:new Ci(["object","camera"]),beginFrame:new Si([]),beforeRender:new Si(["objectToRender"]),render:new Si(["objectToRender"]),afterRender:new Si(["objectToRender"]),endFrame:new Si([]),destroy:new Si([]),pick:new yi(["result"]),pickSync:new Ci(["result"]),pointerDown:new Si(["event"]),pointerUp:new Si(["event"]),pointerMove:new Si(["event"]),pointerOut:new Si(["event"]),pointerOver:new Si(["event"]),pointerWheel:new Si(["event"]),pointerCancel:new Si(["event"]),click:new Si(["event"])},this.globalRuntime=e,this.context=n}var n=e.prototype;return n.init=function(){var t=Mn(Sn().mark((function t(){var e;return Sn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=Nn({},this.globalRuntime,this.context),this.context.renderingPlugins.forEach((function(t){t.apply(e,Zs)})),t.next=4,this.hooks.init.promise();case 4:this.inited=!0;case 5:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),n.getStats=function(){return this.stats},n.disableDirtyRectangleRendering=function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(t.RenderReason.CAMERA_CHANGED)},n.render=function(t,e){var n=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var r=this.context.renderingContext;this.globalRuntime.sceneGraphService.syncHierarchy(r.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),r.renderReasons.size&&this.inited&&(this.renderDisplayObject(r.root,t,r),this.hooks.beginFrame.call(),r.renderListCurrentFrame.forEach((function(t){n.hooks.beforeRender.call(t),n.hooks.render.call(t),n.hooks.afterRender.call(t)})),this.hooks.endFrame.call(),r.renderListCurrentFrame=[],r.renderReasons.clear(),e())},n.renderDisplayObject=function(t,e,n){var r=this,i=e.renderer.getConfig(),o=i.enableDirtyCheck,a=i.enableCulling;this.globalRuntime.enableCSSParsing&&this.globalRuntime.styleValueRegistry.recalc(t);var s=o?this.hooks.dirtycheck.call(t):t;if(s){var u=a?this.hooks.cull.call(s,this.context.camera):s;u&&(this.stats.rendered++,n.renderListCurrentFrame.push(u))}t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var c=t.sortable,l=!1;c.dirty&&(c.sorted=t.childNodes.slice().sort(yr),l=!0,c.dirty=!1),(c.sorted||t.childNodes).forEach((function(t){r.renderDisplayObject(t,e,n)})),l&&t.forEach((function(t){r.renderOrderChangedEvent.target=t,r.renderOrderChangedEvent.detail={renderOrder:t.sortable.renderOrder},t.ownerDocument.defaultView.dispatchEvent(r.renderOrderChangedEvent,!0)}))},n.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},n.dirtify=function(){this.context.renderingContext.renderReasons.add(t.RenderReason.DISPLAY_OBJECT_CHANGED)},e}(),Fs=/\[\s*(.*)=(.*)\s*\]/,Gs=function(){function t(){}var e=t.prototype;return e.selectOne=function(t,e){var n=this;if(t.startsWith("."))return e.find((function(e){return((null==e?void 0:e.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.find((function(e){return e.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.find((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):null}return e.find((function(n){return e!==n&&n.nodeName===t}))},e.selectAll=function(t,e){var n=this;if(t.startsWith("."))return e.findAll((function(r){return e!==r&&((null==r?void 0:r.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.findAll((function(r){return e!==r&&r.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.findAll((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):[]}return e.findAll((function(n){return e!==n&&n.nodeName===t}))},e.is=function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var n=this.getAttribute(t),r=n.name,i=n.value;return"name"===r?e.name===i:this.attributeToString(e,r)===i}return e.nodeName===t},e.getIdOrClassname=function(t){return t.substring(1)},e.getAttribute=function(t){var e=t.match(Fs),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}},e.attributeToString=function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return $t(n)?"":n.toString?""+n:""},t}();function Bs(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}var Us,zs,Vs,js=new Pa(t.ElementEvent.REPARENT,null,"","","",0,"",""),Hs=function(){function e(e){var n,r,i,o,s,c,h,d,v=this;this.runtime=void 0,this.pendingEvents=[],this.boundsChangedEvent=new ga(t.ElementEvent.BOUNDS_CHANGED),this.rotate=(n=$(),function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof e&&(e=I(e,r,i));var o=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var a=$();rt(a,e[0],e[1],e[2]);var s=v.getRotation(t),u=v.getRotation(t.parentNode);ht(n,u),nt(n,n),tt(a,n,a),tt(o.localRotation,a,s),dt(o.localRotation,o.localRotation),v.dirtifyLocal(t,o)}else v.rotateLocal(t,e)}),this.rotateLocal=(r=$(),function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=0),"number"==typeof e&&(e=I(e,n,i));var o=t.transformable;rt(r,e[0],e[1],e[2]),ft(o.localRotation,o.localRotation,r),v.dirtifyLocal(t,o)}),this.setEulerAngles=(i=$(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=I(e,n,r));var o=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){rt(o.localRotation,e[0],e[1],e[2]);var a=v.getRotation(t.parentNode);ht(i,nt($(),a)),ft(o.localRotation,o.localRotation,i),v.dirtifyLocal(t,o)}else v.setLocalEulerAngles(t,e)}),this.translateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=I(e,n,r));var i=t.transformable;Y(e,L())||(function(t,e,n){var r=n[0],i=n[1],o=n[2],a=e[0],s=e[1],u=e[2],c=i*u-o*s,l=o*a-r*u,h=r*s-i*a,f=i*h-o*l,d=o*c-r*h,p=r*l-i*c,v=2*n[3];l*=v,h*=v,d*=2,p*=2,t[0]=a+(c*=v)+(f*=2),t[1]=s+l+d,t[2]=u+h+p}(e,e,i.localRotation),G(i.localPosition,i.localPosition,e),v.dirtifyLocal(t,i))},this.setPosition=(o=a(),s=L(),function(t,e){var n=t.transformable;s[0]=e[0],s[1]=e[1],s[2]=e[2]||0,Y(v.getPosition(t),s)||(D(n.position,s),null!==t.parentNode&&t.parentNode.transformable?(u(o,t.parentNode.transformable.worldTransform),f(o,o),W(n.localPosition,s,o)):D(n.localPosition,s),v.dirtifyLocal(t,n))}),this.setLocalPosition=function(){var t=L();return function(e,n){var r=e.transformable;t[0]=n[0],t[1]=n[1],t[2]=n[2]||0,Y(r.localPosition,t)||(D(r.localPosition,t),v.dirtifyLocal(e,r))}}(),this.translate=(c=L(),h=L(),d=L(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=F(h,e,n,r)),Y(e,c)||(G(d,v.getPosition(t),e),v.setPosition(t,d))}),this.setRotation=function(){var t=$();return function(e,n,r,i,o){var a=e.transformable;if("number"==typeof n&&(n=lt(n,r,i,o)),null!==e.parentNode&&e.parentNode.transformable){var s=v.getRotation(e.parentNode);ht(t,s),nt(t,t),tt(a.localRotation,t,n),dt(a.localRotation,a.localRotation),v.dirtifyLocal(e,a)}else v.setLocalRotation(e,n)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=function(){var t=a(),e=L(),n=lt(0,0,0,1);return function(r){if(0!==r.localSkew[0]||0!==r.localSkew[1]){if(P(r.localTransform,r.localRotation,r.localPosition,I(1,1,1),r.origin),0!==r.localSkew[0]||0!==r.localSkew[1]){var i=l(t);i[4]=Math.tan(r.localSkew[0]),i[1]=Math.tan(r.localSkew[1]),p(r.localTransform,r.localTransform,i)}var o=P(t,n,e,r.localScale,r.origin);p(r.localTransform,r.localTransform,o)}else P(r.localTransform,r.localRotation,r.localPosition,r.localScale,r.origin)}}(),this.runtime=e}var n=e.prototype;return n.matches=function(t,e){return this.runtime.sceneGraphSelector.is(t,e)},n.querySelector=function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)},n.querySelectorAll=function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)},n.attach=function(t,e,n){var r,i,o=!1;t.parentNode&&(o=t.parentNode!==e,this.detach(t)),t.parentNode=e,$t(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t);var a=e.sortable;((null==a||null===(r=a.sorted)||void 0===r?void 0:r.length)||(null===(i=t.style)||void 0===i?void 0:i.zIndex))&&(a.dirty=!0);var s=t.transformable;s&&this.dirtifyWorld(t,s),s.frozen&&this.unfreezeParentToRoot(t),o&&t.dispatchEvent(js)},n.detach=function(t){if(t.parentNode){var e,n,r=t.transformable,i=t.parentNode.sortable;((null==i||null===(e=i.sorted)||void 0===e?void 0:e.length)||(null===(n=t.style)||void 0===n?void 0:n.zIndex))&&(i.dirty=!0);var o=t.parentNode.childNodes.indexOf(t);o>-1&&t.parentNode.childNodes.splice(o,1),r&&this.dirtifyWorld(t,r),t.parentNode=null}},n.getOrigin=function(t){return t.transformable.origin},n.setOrigin=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=[e,n,r]);var i=t.transformable;if(e[0]!==i.origin[0]||e[1]!==i.origin[1]||e[2]!==i.origin[2]){var o=i.origin;o[0]=e[0],o[1]=e[1],o[2]=e[2]||0,this.dirtifyLocal(t,i)}},n.setLocalEulerAngles=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=I(e,n,r));var i=t.transformable;rt(i.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,i)},n.scaleLocal=function(t,e){var n,r,i,o=t.transformable;n=o.localScale,r=o.localScale,i=I(e[0],e[1],e[2]||1),n[0]=r[0]*i[0],n[1]=r[1]*i[1],n[2]=r[2]*i[2],this.dirtifyLocal(t,o)},n.setLocalScale=function(t,e){var n=t.transformable,r=I(e[0],e[1],e[2]||n.localScale[2]);Y(r,n.localScale)||(D(n.localScale,r),this.dirtifyLocal(t,n))},n.setLocalRotation=function(t,e,n,r,i){"number"==typeof e&&(e=lt(e,n,r,i));var o=t.transformable;ht(o.localRotation,e),this.dirtifyLocal(t,o)},n.setLocalSkew=function(t,e,n){"number"==typeof e&&(e=function(t,e){var n=new i(2);return n[0]=t,n[1]=e,n}(e,n));var r,o,a=t.transformable;(r=a.localSkew)[0]=(o=e)[0],r[1]=o[1],this.dirtifyLocal(t,a)},n.dirtifyLocal=function(t,e){e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))},n.dirtifyWorld=function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)},n.triggerPendingEvents=function(){var t=this,e=new Set,n=function(n,r){n.isConnected&&!e.has(n.entity)&&(t.boundsChangedEvent.detail=r,t.boundsChangedEvent.target=n,n.isMutationObserved?n.dispatchEvent(t.boundsChangedEvent):n.ownerDocument.defaultView.dispatchEvent(t.boundsChangedEvent,!0),e.add(n.entity))};this.pendingEvents.forEach((function(t){var e=t[0],r=t[1];r.affectChildren?e.forEach((function(t){n(t,r)})):n(e,r)})),this.clearPendingEvents(),e.clear()},n.clearPendingEvents=function(){this.pendingEvents=[]},n.dirtifyToRoot=function(t,e){void 0===e&&(e=!1);var n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)Bs(n),n=n.parentNode;e&&t.forEach((function(t){Bs(t)})),this.informDependentDisplayObjects(t),this.pendingEvents.push([t,{affectChildren:e}])},n.updateDisplayObjectDependency=function(t,e,n,r){if(e&&e!==n){var i=this.displayObjectDependencyMap.get(e);if(i&&i[t]){var o=i[t].indexOf(r);i[t].splice(o,1)}}if(n){var a=this.displayObjectDependencyMap.get(n);a||(this.displayObjectDependencyMap.set(n,{}),a=this.displayObjectDependencyMap.get(n)),a[t]||(a[t]=[]),a[t].push(r)}},n.informDependentDisplayObjects=function(e){var n=this,r=this.displayObjectDependencyMap.get(e);r&&Object.keys(r).forEach((function(e){r[e].forEach((function(r){n.dirtifyToRoot(r,!0),r.dispatchEvent(new Pa(t.ElementEvent.ATTR_MODIFIED,r,n,n,e,Pa.MODIFICATION,n,n)),r.isCustomElement&&r.isConnected&&r.attributeChangedCallback&&r.attributeChangedCallback(e,n,n)}))}))},n.getPosition=function(t){var e=t.transformable;return b(e.position,this.getWorldTransform(t,e))},n.getRotation=function(t){var e=t.transformable;return S(e.rotation,this.getWorldTransform(t,e))},n.getScale=function(t){var e=t.transformable;return T(e.scaling,this.getWorldTransform(t,e))},n.getWorldTransform=function(t,e){return void 0===e&&(e=t.transformable),e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform},n.getLocalPosition=function(t){return t.transformable.localPosition},n.getLocalRotation=function(t){return t.transformable.localRotation},n.getLocalScale=function(t){return t.transformable.localScale},n.getLocalSkew=function(t){return t.transformable.localSkew},n.getLocalTransform=function(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform},n.setLocalTransform=function(t,e){var n=b(L(),e),r=S($(),e),i=T(L(),e);this.setLocalScale(t,i),this.setLocalPosition(t,n),this.setLocalRotation(t,r)},n.resetLocalTransform=function(t){this.setLocalScale(t,[1,1,1]),this.setLocalPosition(t,[0,0,0]),this.setLocalEulerAngles(t,[0,0,0]),this.setLocalSkew(t,[0,0])},n.getTransformedGeometryBounds=function(t,e,n){void 0===e&&(e=!1);var r=this.getGeometryBounds(t,e);if(na.isEmpty(r))return null;var i=n||new na;return i.setFromTransformedAABB(r,this.getWorldTransform(t)),i},n.getGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=t.geometry;return(e?n.renderBounds:n.contentBounds||null)||new na},n.getBounds=function(t,e){var n=this;void 0===e&&(e=!1);var r=t.renderable;if(!r.boundsDirty&&!e&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&e&&r.renderBounds)return r.renderBounds;var i=e?r.renderBounds:r.bounds,o=this.getTransformedGeometryBounds(t,e,i);if(t.childNodes.forEach((function(t){var r=n.getBounds(t,e);r&&(o?o.add(r):(o=i||new na).update(r.center,r.halfExtents))})),e){var a=gr(t);if(a){var s=a.parsedStyle.clipPath.getBounds(e);o?s&&(o=s.intersection(o)):o=s}}return o||(o=new na),o&&(e?r.renderBounds=o:r.bounds=o),e?r.renderBoundsDirty=!1:r.boundsDirty=!1,o},n.getLocalBounds=function(t){if(t.parentNode){var e=a();t.parentNode.transformable&&(e=f(a(),this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!na.isEmpty(n)){var r=new na;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)},n.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t);na.isEmpty(i)||(r=new na).setFromTransformedAABB(i,this.getWorldTransform(t));var o=null===(e=t.ownerDocument)||void 0===e||null===(n=e.defaultView)||void 0===n?void 0:n.getContextService().getBoundingClientRect();if(r){var a=r.getMin(),s=a[0],u=a[1],c=r.getMax();return new aa(s+((null==o?void 0:o.left)||0),u+((null==o?void 0:o.top)||0),c[0]-s,c[1]-u)}return new aa((null==o?void 0:o.left)||0,(null==o?void 0:o.top)||0,0,0)},n.dirtifyWorldInternal=function(t,e){var n=this;if(!e.dirtyFlag){e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach((function(t){var e=t.transformable;e.dirtyFlag||n.dirtifyWorldInternal(t,e)}));var r=t.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0)}},n.syncHierarchy=function(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,r=0;n.length>r;r++)this.syncHierarchy(n[r])}},n.sync=function(t,e){if(e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.dirtyFlag){var n=t.parentNode,r=n&&n.transformable;null!==n&&r?p(e.worldTransform,r.worldTransform,e.localTransform):u(e.worldTransform,e.localTransform),e.dirtyFlag=!1}},n.unfreezeParentToRoot=function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}},e}(),Ws={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]},Ys=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,Xs=RegExp(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source+"|"+/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source+"|"+/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source+"|"+/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source),qs=RegExp(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source+"|"+/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source+"|"+/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source+"|"+/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source),Ks=function(){function t(t){var e=this;this.runtime=void 0,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,n){return!e.isBreakingSpace(n)&&!(!t||!qs.exec(n)&&!Xs.exec(t))},this.trimByKinsokuShorui=function(t){var e=[].concat(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=t}var e=t.prototype;return e.measureFont=function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvas.getOrCreateCanvas(e),i=this.runtime.offscreenCanvas.getOrCreateContext(e);i.font=t;var o=Ws.MetricsString+Ws.BaselineSymbol,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText(Ws.BaselineSymbol).width),u=Ws.HeightMultiplier*s;s=s*Ws.BaselineMultiplier|0,r.width=a,r.height=u,i.fillStyle="#f00",i.fillRect(0,0,a,u),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(o,0,s);var c=i.getImageData(0,0,a||1,u||1).data,l=c.length,h=4*a,f=0,d=0,p=!1;for(f=0;s>f;++f){for(var v=0;h>v;v+=4)if(255!==c[d+v]){p=!0;break}if(p)break;d+=h}for(n.ascent=s-f,d=l-h,p=!1,f=u;f>s;--f){for(var m=0;h>m;m+=4)if(255!==c[d+m]){p=!0;break}if(p)break;d-=h}return n.descent=f-s,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n,n},e.measureText=function(t,e,n){var r=e.fontSize,i=e.wordWrap,o=e.lineHeight,a=e.lineWidth,s=e.textBaseline,u=e.textAlign,c=e.letterSpacing,l=e.textPath,h=e.leading,f=void 0===h?0:h,d=function(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,o=t.fontWeight,a=se(e)&&e+"px"||"16px",s=n.split(","),u=s.length-1;u>=0;u--){var c=s[u].trim();!Oi.test(c)&&0>Ai.indexOf(c)&&(c='"'+c+'"'),s[u]=c}return r+" "+i+" "+o+" "+a+" "+s.join(",")}(e),p=this.measureFont(d,n);0===p.fontSize&&(p.fontSize=r,p.ascent=r);var v=this.runtime.offscreenCanvas.getOrCreateContext(n);v.font=d,e.isOverflowing=!1;var m=(i?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),y=Array(m.length),g=0;if(!l){for(var x=0;m.length>x;x++){var E=v.measureText(m[x]).width+(m[x].length-1)*c;y[x]=E,g=Math.max(g,E)}var b=g+a,T=o||p.fontSize+a,S=Math.max(T,p.fontSize+a)+(m.length-1)*(T+f),P=0;return"middle"===s?P=-S/2:"bottom"===s||"alphabetic"===s||"ideographic"===s?P=-S:"top"!==s&&"hanging"!==s||(P=0),{font:d,width:b,height:S,lines:m,lineWidths:y,lineHeight:T+=f,maxLineWidth:g,fontProperties:p,lineMetrics:y.map((function(t,e){var n=0;return"center"===u||"middle"===u?n-=t/2:"right"!==u&&"end"!==u||(n-=t),new aa(n-a/2,P+e*T,t+a,T)}))}}l.getTotalLength();for(var M=0;m.length>M;M++)v.measureText(m[M])},e.setGraphemeOnPath=function(){},e.wordWrap=function(t,e,n){var r=this,i=e.wordWrapWidth,o=void 0===i?0:i,a=e.letterSpacing,s=e.maxLines,u=void 0===s?1/0:s,c=e.textOverflow,l=this.runtime.offscreenCanvas.getOrCreateContext(n),h=o+a,f="";"ellipsis"===c?f="...":c&&"clip"!==c&&(f=c);for(var d=[],p=0,v=0,m={},y=function(t){return r.getFromCache(t,a,m,l)},g=Array.from(f).reduce((function(t,e){return t+y(e)}),0),x=Array.from(t),E=0;x.length>E;E++){var b=x[E],T=t[E-1],S=t[E+1],P=y(b);if(this.isNewline(b)){if(++p>=u){e.isOverflowing=!0;break}v=0,d[p]=""}else{if(v>0&&v+P>h){if(p+1>=u){if(e.isOverflowing=!0,g>0&&h>=g){for(var M=d[p].length,w=0,k=M,N=0;M>N;N++){var C=y(d[p][N]);if(w+C+g>h){k=N;break}w+=C}d[p]=(d[p]||"").slice(0,k)+f}break}if(v=0,d[++p]="",this.isBreakingSpace(b))continue;this.canBreakInLastChar(b)||(d=this.trimToBreakable(d),v=this.sumTextWidthByCache(d[p]||"",m)),this.shouldBreakByKinsokuShorui(b,S)&&(d=this.trimByKinsokuShorui(d),v+=y(T||""))}v+=P,d[p]=(d[p]||"")+b}}return d.join("\n")},e.isBreakingSpace=function(t){return"string"==typeof t&&Ws.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},e.isNewline=function(t){return"string"==typeof t&&Ws.Newlines.indexOf(t.charCodeAt(0))>=0},e.trimToBreakable=function(t){var e=[].concat(t),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),o=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(r+1,n.length),e[e.length-2]=n.slice(0,o),e},e.canBreakInLastChar=function(t){return!t||!Ys.test(t)},e.sumTextWidthByCache=function(t,e){return t.split("").reduce((function(t,n){if(!e[n])throw Error("cannot count the word without cache");return t+e[n]}),0)},e.findBreakableIndex=function(t){for(var e=t.length-1;e>=0;e--)if(!Ys.test(t[e]))return e;return-1},e.getFromCache=function(t,e,n,r){var i=n[t];if("number"!=typeof i){var o=t.length*e;i=r.measureText(t).width+o,n[t]=i}return i},t}(),Zs={},Qs=(zs=new Ls,Vs=new Os,(Us={})[t.Shape.CIRCLE]=new ks,Us[t.Shape.ELLIPSE]=new Ns,Us[t.Shape.RECT]=zs,Us[t.Shape.IMAGE]=zs,Us[t.Shape.GROUP]=zs,Us[t.Shape.LINE]=new Cs,Us[t.Shape.TEXT]=new Rs(Zs),Us[t.Shape.POLYLINE]=Vs,Us[t.Shape.POLYGON]=Vs,Us[t.Shape.PATH]=new As,Us[t.Shape.HTML]=null,Us[t.Shape.MESH]=null,Us),$s=function(){var e,n=new Ho,r=new qo;return(e={})[t.PropertySyntax.PERCENTAGE]=null,e[t.PropertySyntax.NUMBER]=new Jo,e[t.PropertySyntax.ANGLE]=new Vo,e[t.PropertySyntax.DEFINED_PATH]=new jo,e[t.PropertySyntax.PAINT]=n,e[t.PropertySyntax.COLOR]=n,e[t.PropertySyntax.FILTER]=new Wo,e[t.PropertySyntax.LENGTH]=r,e[t.PropertySyntax.LENGTH_PERCENTAGE]=r,e[t.PropertySyntax.LENGTH_PERCENTAGE_12]=new Ko,e[t.PropertySyntax.LENGTH_PERCENTAGE_14]=new Zo,e[t.PropertySyntax.COORDINATE]=new Qo,e[t.PropertySyntax.OFFSET_DISTANCE]=new ta,e[t.PropertySyntax.OPACITY_VALUE]=new ea,e[t.PropertySyntax.PATH]=new sa,e[t.PropertySyntax.LIST_OF_POINTS]=new ua,e[t.PropertySyntax.SHADOW_BLUR]=new ca,e[t.PropertySyntax.TEXT]=new la,e[t.PropertySyntax.TEXT_TRANSFORM]=new ha,e[t.PropertySyntax.TRANSFORM]=new fa,e[t.PropertySyntax.TRANSFORM_ORIGIN]=new da,e[t.PropertySyntax.Z_INDEX]=new pa,e[t.PropertySyntax.MARKER]=new $o,e}();Zs.CameraContribution=ws,Zs.AnimationTimeline=null,Zs.EasingFunction=null,Zs.offscreenCanvas=new Is,Zs.displayObjectPool=new Za,Zs.sceneGraphSelector=new Gs,Zs.sceneGraphService=new Hs(Zs),Zs.textService=new Ks(Zs),Zs.geometryUpdaterFactory=Qs,Zs.CSSPropertySyntaxFactory=$s,Zs.styleValueRegistry=new Ts,Zs.layoutRegistry=null,Zs.globalThis=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw Error("Unable to locate global `this`")}(),Zs.enableCSSParsing=!0;var Js=function(){function t(){this.context=void 0,this.plugins=[]}var e=t.prototype;return e.addRenderingPlugin=function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)},e.removeAllRenderingPlugins=function(){var t=this;this.plugins.forEach((function(e){var n=t.context.renderingPlugins.indexOf(e);0>n||t.context.renderingPlugins.splice(n,1)}))},t}(),tu=function(){function t(t){this.plugins=[],this.config=void 0,this.config=Nn({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1},t)}var e=t.prototype;return e.registerPlugin=function(t){-1===this.plugins.findIndex((function(e){return e===t}))&&this.plugins.push(t)},e.unregisterPlugin=function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)},e.getPlugins=function(){return this.plugins},e.getPlugin=function(t){return this.plugins.find((function(e){return e.name===t}))},e.getConfig=function(){return this.config},e.setConfig=function(t){Object.assign(this.config,t)},t}(),eu=function(){function e(t){this.strategies=void 0,this.strategies=t}return e.prototype.apply=function(n){var r=n.camera,i=n.renderingService,o=n.renderingContext,a=this.strategies;i.hooks.cull.tap(e.tag,(function(e){if(e){var n=e.cullable;return n.visible=0===a.length?o.unculledEntities.indexOf(e.entity)>-1:a.every((function(t){return t.isVisible(r,e)})),!e.isCulled()&&e.isVisible()?e:(e.dispatchEvent(new ga(t.ElementEvent.CULLED)),null)}return e})),i.hooks.afterRender.tap(e.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},e}();eu.tag="Culling";var nu=function(){function t(){}return t.prototype.apply=function(e){var n=e.renderingService;n.hooks.dirtycheck.tap(t.tag,(function(t){return t?t.renderable.dirty||n.disableDirtyRectangleRendering()?t:null:t}))},t}();nu.tag="DirtyCheck";var ru=function(){function t(){var t=this;this.autoPreventDefault=!1,this.rootPointerEvent=new Oa(null),this.rootWheelEvent=new La(null),this.context=void 0,this.onPointerMove=function(e){var n,r,i=null===(n=t.context.renderingContext.root)||void 0===n||null===(r=n.ownerDocument)||void 0===r?void 0:r.defaultView;if(!i.supportsTouchEvents||"touch"!==e.pointerType){for(var o,a=_n(t.normalizeToPointerEvent(e,i));!(o=a()).done;){var s=t.bootstrapEvent(t.rootPointerEvent,o.value,i,e);t.context.eventService.mapEvent(s)}t.setCursor(t.context.eventService.cursor)}}}var e=t.prototype;return e.apply=function(e){var n=this;this.context=e;var r=e.renderingService,i=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler((function(t){return n.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null})),r.hooks.pointerWheel.tap(t.tag,(function(t){var e=n.normalizeWheelEvent(t);n.context.eventService.mapEvent(e)})),r.hooks.pointerDown.tap(t.tag,(function(t){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();for(var r,o=_n(e);!(r=o()).done;){var a=n.bootstrapEvent(n.rootPointerEvent,r.value,i,t);n.context.eventService.mapEvent(a)}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerUp.tap(t.tag,(function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e=n.context.contextService.getDomElement(),r="outside";try{r=e&&t.target&&t.target!==e&&e.contains&&!e.contains(t.target)?"outside":""}catch(t){}for(var o,a=_n(n.normalizeToPointerEvent(t,i));!(o=a()).done;){var s=n.bootstrapEvent(n.rootPointerEvent,o.value,i,t);s.type+=r,n.context.eventService.mapEvent(s)}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.onPointerMove),r.hooks.pointerCancel.tap(t.tag,(function(t){for(var e,r=_n(n.normalizeToPointerEvent(t,i));!(e=r()).done;){var o=n.bootstrapEvent(n.rootPointerEvent,e.value,i,t);n.context.eventService.mapEvent(o)}n.setCursor(n.context.eventService.cursor)}))},e.getViewportXY=function(t){var e,n,r=t.offsetX,i=t.offsetY,o=t.clientX,a=t.clientY;if(!this.context.config.supportsCSSTransform||$t(r)||$t(i)){var s=this.context.eventService.client2Viewport(new oa(o,a));e=s.x,n=s.y}else e=r,n=i;return{x:e,y:n}},e.bootstrapEvent=function(t,e,n,r){t.view=n,t.originalEvent=null,t.nativeEvent=r,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var i=this.getViewportXY(e),o=i.y;t.viewport.x=i.x,t.viewport.y=o;var a=this.context.eventService.viewport2Canvas(t.viewport),s=a.y;return t.canvas.x=a.x,t.canvas.y=s,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=r.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=Sr[t.type]||t.type),t},e.normalizeWheelEvent=function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.getViewportXY(t),r=n.y;e.viewport.x=n.x,e.viewport.y=r;var i=this.context.eventService.viewport2Canvas(e.viewport),o=i.y;return e.canvas.x=i.x,e.canvas.y=o,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e},e.transferMouseData=function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null},e.setCursor=function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")},e.normalizeToPointerEvent=function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;t.changedTouches.length>r;r++){var i=t.changedTouches[r];he(i.button)&&(i.button=0),he(i.buttons)&&(i.buttons=1),he(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),he(i.width)&&(i.width=i.radiusX||1),he(i.height)&&(i.height=i.radiusY||1),he(i.tiltX)&&(i.tiltX=0),he(i.tiltY)&&(i.tiltY=0),he(i.pointerType)&&(i.pointerType="touch"),he(i.pointerId)&&(i.pointerId=i.identifier||0),he(i.pressure)&&(i.pressure=i.force||.5),he(i.twist)&&(i.twist=0),he(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var o=t;he(o.isPrimary)&&(o.isPrimary=!0),he(o.width)&&(o.width=1),he(o.height)&&(o.height=1),he(o.tiltX)&&(o.tiltX=0),he(o.tiltY)&&(o.tiltY=0),he(o.pointerType)&&(o.pointerType="mouse"),he(o.pointerId)&&(o.pointerId=1),he(o.pressure)&&(o.pressure=.5),he(o.twist)&&(o.twist=0),he(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n},t}();ru.tag="Event";var iu,ou=[t.Shape.CIRCLE,t.Shape.ELLIPSE,t.Shape.IMAGE,t.Shape.RECT,t.Shape.LINE,t.Shape.POLYLINE,t.Shape.POLYGON,t.Shape.TEXT,t.Shape.PATH,t.Shape.HTML],au=function(){function e(){}var n=e.prototype;return n.isVisible=function(e,n){var r,i,o=n.cullable;if(!o.enable)return!0;var a=n.getRenderBounds();if(na.isEmpty(a))return!1;var s=e.getFrustum(),u=null===(r=n.parentNode)||void 0===r||null===(i=r.cullable)||void 0===i?void 0:i.visibilityPlaneMask;return o.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(n,a,u||t.Mask.INDETERMINATE,s.planes),o.visible=o.visibilityPlaneMask!==t.Mask.OUTSIDE,o.visible},n.computeVisibilityWithPlaneMask=function(e,n,r,i){if(r===t.Mask.OUTSIDE||r===t.Mask.INSIDE)return r;for(var o=t.Mask.INSIDE,a=ou.indexOf(e.nodeName)>-1,s=0,u=i.length;u>s;++s){var c=1<<s;if(0!=(r&c)&&(!a||4!==s&&5!==s)){var l=i[s],h=l.normal,f=l.distance;if(0>V(h,n.getPositiveFarPoint(i[s]))+f)return t.Mask.OUTSIDE;0>V(h,n.getNegativeFarPoint(i[s]))+f&&(o|=c)}}return o},e}(),su=function(){function e(){this.rBush=void 0,this.toSync=new Set}var n=e.prototype;return n.apply=function(n){var r=this,i=n.renderingService,o=n.renderingContext.root.ownerDocument.defaultView;this.rBush=n.rBushRoot;var a=function(t){t.target.renderable.dirty=!0,i.dirtify()},s=function(t){var e=t.target;t.detail.affectChildren&&e.forEach((function(t){r.toSync.add(t)}));for(var n=e;n;)n.renderable&&r.toSync.add(n),n=n.parentElement;i.dirtify()},u=function(t){var e=t.target;Zs.enableCSSParsing&&Zs.styleValueRegistry.recalc(e),Zs.sceneGraphService.dirtifyToRoot(e),i.dirtify()},c=function(t){var e=t.target,n=e.rBushNode;n.aabb&&r.rBush.remove(n.aabb),r.toSync.delete(e),Zs.sceneGraphService.dirtifyToRoot(e),i.dirtify()};i.hooks.init.tapPromise(e.tag,Mn(Sn().mark((function e(){return Sn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o.addEventListener(t.ElementEvent.MOUNTED,u),o.addEventListener(t.ElementEvent.UNMOUNTED,c),o.addEventListener(t.ElementEvent.ATTR_MODIFIED,a),o.addEventListener(t.ElementEvent.BOUNDS_CHANGED,s);case 4:case"end":return e.stop()}}),e)})))),i.hooks.destroy.tap(e.tag,(function(){o.removeEventListener(t.ElementEvent.MOUNTED,u),o.removeEventListener(t.ElementEvent.UNMOUNTED,c),o.removeEventListener(t.ElementEvent.ATTR_MODIFIED,a),o.removeEventListener(t.ElementEvent.BOUNDS_CHANGED,s),r.toSync.clear()})),i.hooks.endFrame.tap(e.tag,(function(){r.syncRTree()}))},n.syncRTree=function(){var t=this,e=[];Array.from(this.toSync).filter((function(t){return t.isConnected})).forEach((function(n){var r=n.rBushNode;r&&r.aabb&&t.rBush.remove(r.aabb);var i=n.getRenderBounds();if(i){var o=i.getMin(),a=o[0],s=o[1],u=i.getMax(),c=u[0],l=u[1];r.aabb||(r.aabb={}),r.aabb.id=n.entity,r.aabb.minX=a,r.aabb.minY=s,r.aabb.maxX=c,r.aabb.maxY=l}r.aabb&&(isNaN(r.aabb.maxX)||isNaN(r.aabb.maxX)||isNaN(r.aabb.minX)||isNaN(r.aabb.minY)||e.push(r.aabb))})),this.rBush.load(e),e.length=0,this.toSync.clear()},e}();su.tag="Prepare",(iu=t.CanvasEvent||(t.CanvasEvent={})).READY="ready",iu.BEFORE_RENDER="beforerender",iu.RERENDER="rerender",iu.AFTER_RENDER="afterrender",iu.BEFORE_DESTROY="beforedestroy",iu.AFTER_DESTROY="afterdestroy",iu.RESIZE="resize",iu.DIRTY_RECTANGLE="dirtyrectangle";var uu=new ga(t.ElementEvent.MOUNTED),cu=new ga(t.ElementEvent.UNMOUNTED),lu=new ga(t.CanvasEvent.BEFORE_RENDER),hu=new ga(t.CanvasEvent.RERENDER),fu=new ga(t.CanvasEvent.AFTER_RENDER),du=function(e){function r(n){var r;(r=e.call(this)||this).document=void 0,r.customElements=void 0,r.requestAnimationFrame=void 0,r.cancelAnimationFrame=void 0,r.devicePixelRatio=void 0,r.supportsPointerEvents=void 0,r.supportsTouchEvents=void 0,r.isTouchEvent=void 0,r.isMouseEvent=void 0,r.Element=ja,r.frameId=void 0,r.inited=!1,r.readyPromise=void 0,r.resolveReadyPromise=void 0,r.context={},r.document=new Sa,r.document.defaultView=Ln(r),r.customElements=new va;var i=n.container,o=n.canvas,a=n.offscreenCanvas,s=n.width,u=n.height,c=n.devicePixelRatio,l=n.renderer,h=n.background,f=n.cursor,d=n.document,p=n.requestAnimationFrame,v=n.cancelAnimationFrame,m=n.createImage,y=n.supportsPointerEvents,g=n.supportsTouchEvents,x=n.supportsCSSTransform,E=n.useNativeClickEvent,b=n.isTouchEvent,T=n.isMouseEvent;!function(t,e){if(t){var n="string"==typeof t?t:t.id||vr++;pr[n]&&pr[n].destroy(),pr[n]=e}}(i,Ln(r));var S=s,P=u,M=c;return o&&(M=1>(M=c||mr&&window.devicePixelRatio||1)?1:Math.ceil(M),S=s||function(t){var e=Er(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(o)||o.width/M,P=u||function(t){var e=Er(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(o)||o.height/M),r.devicePixelRatio=M,r.requestAnimationFrame=null!=p?p:zi.bind(Zs.globalThis),r.cancelAnimationFrame=null!=v?v:Vi.bind(Zs.globalThis),r.supportsTouchEvents=null!=g?g:"ontouchstart"in Zs.globalThis,r.supportsPointerEvents=null!=y?y:!!Zs.globalThis.PointerEvent,r.isTouchEvent=null!=b?b:function(t){return r.supportsTouchEvents&&t instanceof Zs.globalThis.TouchEvent},r.isMouseEvent=null!=T?T:function(t){return!Zs.globalThis.MouseEvent||t instanceof Zs.globalThis.MouseEvent&&(!r.supportsPointerEvents||!(t instanceof Zs.globalThis.PointerEvent))},r.initRenderingContext({container:i,canvas:o,width:S,height:P,renderer:l,offscreenCanvas:a,devicePixelRatio:M,cursor:f||"default",background:h||"transparent",createImage:m,document:d,supportsCSSTransform:x,useNativeClickEvent:E}),r.initDefaultCamera(S,P),Mn(Sn().mark((function e(){return Sn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.initRenderer(l);case 2:r.dispatchEvent(new ga(t.CanvasEvent.READY)),r.readyPromise&&r.resolveReadyPromise();case 4:case"end":return e.stop()}}),e)})))(),r}Cn(r,e);var i=r.prototype;return i.initRenderingContext=function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},i.initDefaultCamera=function(e,n){var r=this,i=new Zs.CameraContribution;i.setType(t.CameraType.EXPLORING,t.CameraTrackingMode.DEFAULT).setPosition(e/2,n/2,500).setFocalPoint(e/2,n/2,0).setOrthographic(e/-2,e/2,n/2,n/-2,.1,1e3),i.canvas=this,i.eventEmitter.on(Ps.UPDATED,(function(){r.context.renderingContext.renderReasons.add(t.RenderReason.CAMERA_CHANGED)})),this.context.camera=i},i.getConfig=function(){return this.context.config},i.getRoot=function(){return this.document.documentElement},i.getCamera=function(){return this.context.camera},i.getContextService=function(){return this.context.contextService},i.getEventService=function(){return this.context.eventService},i.getRenderingService=function(){return this.context.renderingService},i.getRenderingContext=function(){return this.context.renderingContext},i.getStats=function(){return this.getRenderingService().getStats()},i.destroy=function(e,n){(void 0===e&&(e=!0),void 0===n&&(n=!1),n||this.dispatchEvent(new ga(t.CanvasEvent.BEFORE_DESTROY)),this.frameId)&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var r=this.getRoot();this.unmountChildren(r),e&&(this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),e&&this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),n||this.dispatchEvent(new ga(t.CanvasEvent.AFTER_DESTROY))},i.changeSize=function(t,e){this.resize(t,e)},i.resize=function(e,n){var r=this.context.config;r.width=e,r.height=n,this.getContextService().resize(e,n);var i=this.context.camera,o=i.getProjectionMode();i.setPosition(e/2,n/2,500).setFocalPoint(e/2,n/2,0),o===t.CameraProjectionMode.ORTHOGRAPHIC?i.setOrthographic(e/-2,e/2,n/2,n/-2,i.getNear(),i.getFar()):i.setAspect(e/n),this.dispatchEvent(new ga(t.CanvasEvent.RESIZE,{width:e,height:n}))},i.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},i.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},i.removeChild=function(t){return this.document.documentElement.removeChild(t)},i.removeChildren=function(){this.document.documentElement.removeChildren()},i.destroyChildren=function(){this.document.documentElement.destroyChildren()},i.render=function(){var t=this;this.dispatchEvent(lu),this.getRenderingService().render(this.getConfig(),(function(){t.dispatchEvent(hu)})),this.dispatchEvent(fu)},i.run=function(){var t=this;!function e(){t.render(),t.frameId=requestAnimationFrame(e)}()},i.initRenderer=function(){var t=Mn(Sn().mark((function t(e){return Sn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}throw Error("Renderer is required.");case 2:return this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new n,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new ru,new su,new nu,new eu([new au])),this.loadRendererContainerModule(e),this.context.contextService=new this.context.ContextService(Nn({},Zs,this.context)),this.context.renderingService=new Ds(Zs,this.context),this.context.eventService=new _s(Zs,this.context),this.context.eventService.init(),t.next=14,this.context.contextService.init();case 14:return t.next=16,this.context.renderingService.init();case 16:this.inited=!0,this.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),this.mountChildren(this.getRoot()),e.getConfig().enableAutoRendering&&this.run();case 20:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),i.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init(Zs)}))},i.setRenderer=function(){var t=Mn(Sn().mark((function t(e){var n,r;return Sn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((n=this.getConfig()).renderer!==e){t.next=3;break}return t.abrupt("return");case 3:return r=n.renderer,n.renderer=e,this.destroy(!1,!0),[].concat(null==r?void 0:r.getPlugins()).reverse().forEach((function(t){t.destroy(Zs)})),t.next=9,this.initRenderer(e);case 9:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),i.setCursor=function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)},i.unmountChildren=function(t){var e=this;t.childNodes.forEach((function(t){e.unmountChildren(t)})),this.inited&&(t.isMutationObserved?t.dispatchEvent(cu):(cu.target=t,this.dispatchEvent(cu,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()},i.mountChildren=function(t){var e=this;this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,t.isMutationObserved?t.dispatchEvent(uu):(uu.target=t,this.dispatchEvent(uu,!0))):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",t.nodeName),t.childNodes.forEach((function(t){e.mountChildren(t)})),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()},i.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},i.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},i.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},i.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},i.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},i.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},kn(r,[{key:"ready",get:function(){var t=this;return this.readyPromise||(this.readyPromise=new Promise((function(e){t.resolveReadyPromise=function(){e(t)}})),this.inited&&this.resolveReadyPromise()),this.readyPromise}}]),r}(xa);function pu(t,e){return pu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},pu(t,e)}var vu=function(e){var n,r;function i(){for(var t,n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).landmarks=[],t.landmarkAnimationID=void 0,t}(n=i).prototype=Object.create((r=e).prototype),n.prototype.constructor=n,pu(n,r);var o=i.prototype;return o.rotate=function(e,n,r){if(this.relElevation=Nr(n),this.relAzimuth=Nr(e),this.relRoll=Nr(r),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===t.CameraType.EXPLORING){var i=J($(),[1,0,0],Ar((this.rotateWorld?1:-1)*this.relElevation)),o=J($(),[0,1,0],Ar((this.rotateWorld?1:-1)*this.relAzimuth)),s=J($(),[0,0,1],Ar(this.relRoll)),u=tt($(),o,i);u=tt($(),u,s);var c=M(a(),u);v(this.matrix,this.matrix,[0,0,-this.distance]),p(this.matrix,this.matrix,c),v(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this._update(),this},o.pan=function(t,e){var n=Cr(t,e,0),r=R(this.position);return G(r,r,U(L(),this.right,n[0])),G(r,r,U(L(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this},o.dolly=function(e){var n,r=this.forward,i=R(this.position);return i[0]+=(n=Math.max(Math.min(this.distance+e*this.dollyingStep,this.maxDistance),this.minDistance)-this.distance)*r[0],i[1]+=n*r[1],i[2]+=n*r[2],this._setPosition(i),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getDistance():this.type===t.CameraType.TRACKING&&G(this.focalPoint,i,this.distanceVector),this.triggerUpdate(),this},o.cancelLandmarkAnimation=function(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)},o.createLandmark=function(t,e){var n,r,i,o;void 0===e&&(e={});var a=e.position,u=void 0===a?this.position:a,c=e.focalPoint,l=void 0===c?this.focalPoint:c,h=e.roll,f=e.zoom,d=new Zs.CameraContribution;d.setType(this.type,void 0),d.setPosition(u[0],null!==(n=u[1])&&void 0!==n?n:this.position[1],null!==(r=u[2])&&void 0!==r?r:this.position[2]),d.setFocalPoint(l[0],null!==(i=l[1])&&void 0!==i?i:this.focalPoint[1],null!==(o=l[2])&&void 0!==o?o:this.focalPoint[2]),d.setRoll(null!=h?h:this.roll),d.setZoom(null!=f?f:this.zoom);var p={name:t,matrix:s(d.getWorldTransform()),right:R(d.right),up:R(d.up),forward:R(d.forward),position:R(d.getPosition()),focalPoint:R(d.getFocalPoint()),distanceVector:R(d.getDistanceVector()),distance:d.getDistance(),dollyingStep:d.getDollyingStep(),azimuth:d.getAzimuth(),elevation:d.getElevation(),roll:d.getRoll(),relAzimuth:d.relAzimuth,relElevation:d.relElevation,relRoll:d.relRoll,zoom:d.getZoom()};return this.landmarks.push(p),p},o.gotoLandmark=function(t,e){var n=this;void 0===e&&(e={});var r=oe(t)?this.landmarks.find((function(e){return e.name===t})):t;if(r){var i=se(e)?{duration:e}:e,o=i.easing,a=void 0===o?"linear":o,s=i.duration,u=void 0===s?100:s,c=i.easingFunction,l=void 0===c?void 0:c,h=i.onfinish,f=void 0===h?void 0:h;if(0===u)return this.syncFromLandmark(r),void(f&&f());this.cancelLandmarkAnimation();var d,p=r.position,v=r.focalPoint,m=r.zoom,y=r.roll,g=l||Zs.EasingFunction(a),x=function(){n.setFocalPoint(v),n.setPosition(p),n.setRoll(y),n.setZoom(m),n.computeMatrix(),n.triggerUpdate(),f&&f()};this.canvas.requestAnimationFrame((function t(e){void 0===d&&(d=e);var r=e-d;if(u<r)x();else{var i,o,a=g(r/u),s=L(),c=L();H(s,n.focalPoint,v,a),H(c,n.position,p,a),o=n.roll*(1-a)+y*a,i=n.zoom*(1-a)+m*a,n.setFocalPoint(s),n.setPosition(c),n.setRoll(o),n.setZoom(i),q(s,v)+q(c,p)>.01?(n.computeMatrix(),n.triggerUpdate(),u>r&&(n.landmarkAnimationID=n.canvas.requestAnimationFrame(t))):x()}}))}},o.syncFromLandmark=function(t){this.matrix=u(this.matrix,t.matrix),this.right=D(this.right,t.right),this.up=D(this.up,t.up),this.forward=D(this.forward,t.forward),this.position=D(this.position,t.position),this.focalPoint=D(this.focalPoint,t.focalPoint),this.distanceVector=D(this.distanceVector,t.distanceVector),this.azimuth=t.azimuth,this.elevation=t.elevation,this.roll=t.roll,this.relAzimuth=t.relAzimuth,this.relElevation=t.relElevation,this.relRoll=t.relRoll,this.dollyingStep=t.dollyingStep,this.distance=t.distance,this.zoom=t.zoom},i}(ws);Zs.CameraContribution=vu;var mu,yu,gu,xu,Eu=function(t,e,n){this._layoutContext=void 0,this._node=void 0,this.options=void 0,this.layoutContext=void 0,this.inlineSize=void 0,this.blockSize=void 0,this.node=void 0,this.childFragments=void 0,this.data=void 0,this._layoutContext=t,this._node=e,this.options=n,this.layoutContext=t,this.inlineSize=null==n?void 0:n.inlineSize,this.blockSize=null==n?void 0:n.blockSize,this.childFragments=null==n?void 0:n.childFragments,this.data=n.data,this.node=e};function bu(){bu=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function c(t,e,n,i){var o=Object.create((e&&e.prototype instanceof f?e:f).prototype),a=new M(i||[]);return r(o,"_invoke",{value:b(t,n,a)}),o}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var h={};function f(){}function d(){}function p(){}var v={};u(v,o,(function(){return this}));var m=Object.getPrototypeOf,y=m&&m(m(w([])));y&&y!==e&&n.call(y,o)&&(v=y);var g=p.prototype=f.prototype=Object.create(v);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function i(r,o,a,s){var u=l(t[r],t,o);if("throw"!==u.type){var c=u.arg,h=c.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){i("next",t,a,s)}),(function(t){i("throw",t,a,s)})):e.resolve(h).then((function(t){c.value=t,a(c)}),(function(t){return i("throw",t,a,s)}))}s(u.arg)}var o;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){i(t,n,e,r)}))}return o=o?o.then(r,r):r()}})}function b(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return k()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=T(a,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=l(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function T(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,T(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var i=l(r,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,h;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function w(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,r(g,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:d,configurable:!0}),d.displayName=u(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,u(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},x(E.prototype),u(E.prototype,a,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new E(c(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(g),u(g,s,"Generator"),u(g,o,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=w,M.prototype={constructor:M,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(this.prev>=o.tryLoc){var s=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(s&&u){if(o.catchLoc>this.prev)return r(o.catchLoc,!0);if(o.finallyLoc>this.prev)return r(o.finallyLoc)}else if(s){if(o.catchLoc>this.prev)return r(o.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(this.prev>=i.tryLoc&&n.call(i,"finallyLoc")&&i.finallyLoc>this.prev){var o=i;break}}o&&("break"===t||"continue"===t)&&e>=o.tryLoc&&o.finallyLoc>=e&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),P(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;P(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:w(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}function Tu(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function Su(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){Tu(o,r,i,a,s,"next",t)}function s(t){Tu(o,r,i,a,s,"throw",t)}a(void 0)}))}}function Pu(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(i=void 0,"symbol"==typeof(i=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(r.key,"string"))?i:i+""),r)}var i}function Mu(t,e,n){return e&&Pu(t.prototype,e),n&&Pu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(mu=t.LayoutTaskType||(t.LayoutTaskType={})).Layout="layout",mu.IntrinsicSizes="intrinsic-sizes",function(t){t[t.block=0]="block",t[t.normal=1]="normal"}(yu||(yu={})),function(t){t[t["block-like"]=0]="block-like",t[t.manual=1]="manual"}(gu||(gu={})),(xu=t.PropertyName||(t.PropertyName={})).LAYOUT="display",xu.LEFT="left",xu.TOP="top",xu.BOTTOM="bottom",xu.RIGHT="right",xu.WIDTH="width",xu.HEIGHT="height",xu.MIN_WIDTH="minWidth",xu.MAX_WIDTH="maxWidth",xu.MIN_HEIGHT="minHeight",xu.MAX_HEIGHT="maxHeight",xu.BOX_SIZING="boxSizing",xu.PADDING="padding",xu.PADDING_TOP="paddingTop",xu.PADDING_BOTTOM="paddingBottom",xu.PADDING_START="paddingLeft",xu.PADDING_END="paddingRight",xu.MARGIN="margin",xu.MARGIN_TOP="marginTop",xu.MARGIN_BOTTOM="marginBottom",xu.MARGIN_START="marginLeft",xu.MARGIN_END="marginRight",xu.BORDER="border",xu.BORDER_TOP="borderTop",xu.BORDER_BOTTOM="borderBottom",xu.BORDER_START="borderLeft",xu.BORDER_END="borderRight",xu.FLEX_DIRECTION="flexDirection",xu.FLEX_WRAP="flexWrap",xu.FLEX_FLOW="flexFlow",xu.ALIGN_ITEMS="alignItems",xu.ALIGN_CONTENT="alignContent",xu.JUSTIFY_CONTENT="justifyContent",xu.FLEX="flex",xu.ALIGN_SELF="alignSelf",xu.FLEX_SHRINK="flexShrink",xu.FLEX_BASIS="flexBasis",xu.FLEX_GROW="flexGrow",xu.OFFSET_WIDTH="offsetWidth",xu.OFFSET_HEIGHT="offsetHeight",xu.ORDER="order";var wu=function(t){if(t.isRejected||t.isFulfilled)return t;var e,n=!0,r=!1,i=!1,o=t.then((function(t){return i=!0,n=!1,e=t,t}),(function(t){throw r=!0,n=!1,t}));return o.isFulfilled=function(){return i},o.isPending=function(){return n},o.isRejected=function(){return r},o.getFullFilledValue=function(){return e},o},ku=function(){var t=this;this.resolve=void 0,this.reject=void 0,this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))},Nu=function(){function e(t,e){this._layoutContext=void 0,this.options=void 0,this.node=void 0,this.styleMap=void 0,this.layoutContext=void 0,this._layoutContext=t,this.options=e,this.layoutContext=t,this.node=e.node,this.styleMap=e.node.getAllStyle()}var n=e.prototype;return n.intrinsicSizes=function(){var e=new ku;return this.layoutContext.appendWorkTask({layoutChild:this,taskType:t.LayoutTaskType.IntrinsicSizes,deferred:e}),e.promise},n.layoutNextFragment=function(e){if(this.layoutContext.mode===t.LayoutTaskType.IntrinsicSizes)throw Error("Not Supported: cant call layoutNextFragment in intrinsicSizes");var n=new ku;return this.layoutContext.appendWorkTask({layoutConstraints:e,layoutChild:this,taskType:t.LayoutTaskType.Layout,deferred:n}),n.promise},e}(),Cu=0,Au=function(){function t(t){this.options=void 0,this.contextId=void 0,this.workQueue=[],this.mode=void 0,this.layoutChildrenFactory=void 0,this.fragmentResultFactory=void 0,this.layoutFragmentFactory=void 0,this.options=t,this.contextId=""+Cu++,this.mode=t.mode,this.layoutChildrenFactory=t.layoutChildrenFactory,this.fragmentResultFactory=t.fragmentResultFactory,this.layoutFragmentFactory=t.layoutFragmentFactory}var e=t.prototype;return e.appendWorkTask=function(t){this.workQueue.push(t)},e.clearWorkQueue=function(){this.workQueue=[]},t}(),Ou=function(){};Ou.inputProperties=void 0,Ou.childrenInputProperties=void 0,Ou.layoutOptions=void 0;var Lu=function(t){return void 0===t&&(t=0),new Promise((function(e){setTimeout((function(){e()}),t)}))},Ru=function(){function e(t,e,n){this._layoutRegistry=void 0,this._layoutContextFactory=void 0,this._layoutEdgesFactory=void 0,this.layoutRegistry=void 0,this.layoutContextFactory=void 0,this.layoutEdgesFactory=void 0,this._layoutRegistry=t,this._layoutContextFactory=e,this._layoutEdgesFactory=n,this.layoutRegistry=t,this.layoutContextFactory=e,this.layoutEdgesFactory=n}var n=e.prototype;return n.computeLayout=function(){var t=Su(bu().mark((function t(e,n){return bu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.determineIntrinsicSizes(e,e.children);case 2:return t.next=4,this.calculateLayout(e,e.children,n);case 4:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.determineAllIntrinsicSizes=function(){var t=Su(bu().mark((function t(e){return bu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),n.getLayoutDefinitionName=function(e){var n=e.getAllStyle().get(t.PropertyName.LAYOUT);if(!n)throw Error("layout property not found");return n.value},n.determineIntrinsicSizes=function(){var t=Su(bu().mark((function t(e,n){var r;return bu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.getLayoutDefinitionName(e),t.next=3,this.invokeIntrinsicSizesCallback(r,e,n);case 3:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.invokeIntrinsicSizesCallback=function(){var e=Su(bu().mark((function e(n,r,i){var o,a,s,u,c,l,h,f,d,p,v;return bu().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=this.layoutRegistry.getLayout(n),a=new o,s=this.layoutContextFactory({mode:t.LayoutTaskType.IntrinsicSizes}),c=void 0===(u=o.inputProperties)?[]:u,l=[],i.forEach((function(t){var e=s.layoutChildrenFactory({node:t});l.push(e)})),h=this.layoutEdgesFactory({node:r}),f=r.getStyle.apply(r,c),d=a.intrinsicSizes(l,h,f),(p=this.runWorkQueue(d,s.workQueue)).next(),e.next=13,Lu();case 13:v=p.next().value,s.clearWorkQueue(),r.setIntrisicSizes(v);case 16:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}(),n.calculateLayout=function(){var t=Su(bu().mark((function t(e,n,r){var i;return bu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=this.getLayoutDefinitionName(e),t.next=3,this.invokeLayoutCallback(i,e,n,r);case 3:case"end":return t.stop()}}),t,this)})));return function(e,n,r){return t.apply(this,arguments)}}(),n.invokeLayoutCallback=function(){var e=Su(bu().mark((function e(n,r,i,o){var a,s,u,c,l,h,f,d,p,v,m,y,g;return bu().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=this.layoutRegistry.getLayout(n),s=new a,u=this.layoutContextFactory({mode:t.LayoutTaskType.Layout}),l=void 0===(c=a.inputProperties)?[]:c,h=[],i.forEach((function(t){var e=u.layoutChildrenFactory({node:t});h.push(e)})),f=this.layoutEdgesFactory({node:r}),d=r.getStyle.apply(r,l),p=s.layout(h,f,o,d),(v=this.runWorkQueue(p,u.workQueue)).next(),e.next=13,Lu();case 13:m=v.next().value,u.clearWorkQueue(),y=m instanceof Eu?m:u.fragmentResultFactory(m),g=u.layoutFragmentFactory({inlineSize:y.inlineSize,blockSize:y.blockSize,data:y.data}),r.setComputedLayout(g),i.forEach((function(t,e){t.setComputedLayout(y.childFragments[e])}));case 19:case"end":return e.stop()}}),e,this)})));return function(t,n,r,i){return e.apply(this,arguments)}}(),n.runWorkQueue=bu().mark((function e(n,r){var i,o=this;return bu().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=wu(n),r.length>0&&i.isPending()&&r.forEach((function(e){e.taskType===t.LayoutTaskType.IntrinsicSizes&&e.deferred.resolve(o.getNodeIntrisicSizes(e.layoutChild.node));if(e.taskType===t.LayoutTaskType.Layout){var n=e.layoutChild,r=e.deferred,i=n.layoutContext,a=o.getNodeFragment(n.node,e.layoutConstraints);r.resolve(i.layoutFragmentFactory(a))}})),void(e.next=4);case 4:if(i.isFulfilled()){e.next=6;break}throw Error("promise not fullfilled!");case 6:return e.abrupt("return",i.getFullFilledValue());case 7:case"end":return e.stop()}}),e)})),n.getNodeIntrisicSizes=function(e){var n,r,i,o,a,s,u,c,l,h,f,d,p=e.getAllStyle();return{minContentInlineSize:(null===(n=p.get(t.PropertyName.MIN_WIDTH))||void 0===n?void 0:n.value)||(null===(r=e.intrisicSizes)||void 0===r?void 0:r.minContentInlineSize)||(null===(i=p.get(t.PropertyName.WIDTH))||void 0===i?void 0:i.value)||0,maxContentInlineSize:(null===(o=p.get(t.PropertyName.MAX_WIDTH))||void 0===o?void 0:o.value)||(null===(a=e.intrisicSizes)||void 0===a?void 0:a.maxContentInlineSize)||(null===(s=p.get(t.PropertyName.WIDTH))||void 0===s?void 0:s.value)||0,minContentBlockSize:(null===(u=p.get(t.PropertyName.MIN_HEIGHT))||void 0===u?void 0:u.value)||(null===(c=e.intrisicSizes)||void 0===c?void 0:c.minContentBlockSize)||(null===(l=p.get(t.PropertyName.HEIGHT))||void 0===l?void 0:l.value)||0,maxContentBlockSize:(null===(h=p.get(t.PropertyName.MAX_HEIGHT))||void 0===h?void 0:h.value)||(null===(f=e.intrisicSizes)||void 0===f?void 0:f.maxContentBlockSize)||(null===(d=p.get(t.PropertyName.HEIGHT))||void 0===d?void 0:d.value)||0}},n.getNodeFragment=function(e,n){var r,i,o,a,s,u;return{inlineSize:(null===(r=e.getComputedLayout())||void 0===r?void 0:r.inlineSize)||(null===(i=e.getAllStyle().get(t.PropertyName.MIN_WIDTH))||void 0===i?void 0:i.value)||(null===(o=e.getAllStyle().get(t.PropertyName.WIDTH))||void 0===o?void 0:o.value)||0,blockSize:(null===(a=e.getComputedLayout())||void 0===a?void 0:a.blockSize)||(null===(s=e.getAllStyle().get(t.PropertyName.MIN_HEIGHT))||void 0===s?void 0:s.value)||(null===(u=e.getAllStyle().get(t.PropertyName.HEIGHT))||void 0===u?void 0:u.value)||0,data:n.data}},e}(),_u=1,Iu=function(){function e(t){void 0===t&&(t=new Map),this.id=void 0,this.style=void 0,this.dirty=void 0,this.parent=void 0,this.children=void 0,this.internalIntrisicSizes=void 0,this.computedLayout=void 0,this.measureFn=void 0,this.id=_u++,this.style=t,this.parent=void 0,this.children=[],this.dirty=!1}var n=e.prototype;return n.setMeasure=function(t){this.measureFn=t},n.setIntrisicSizes=function(t){this.internalIntrisicSizes=t},n.addChild=function(t){var e;null===(e=this.children)||void 0===e||e.push(t)},n.insertChild=function(t,e){this.children.splice(t,0,e)},n.removeChild=function(t){var e,n=null===(e=this.children)||void 0===e?void 0:e.findIndex((function(e){return e.id===t.id}));this.removeChildAtIndex(n)},n.removeChildAtIndex=function(t){this.children.splice(t,1)},n.replaceChildAtIndex=function(t,e){this.children.splice(t,1,e)},n.setStyle=function(t,e){this.style.set(t,e)},n.getStyle=function(){for(var t=this,e=new Map,n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return r.forEach((function(n){var r=t.style.get(n);r&&e.set(n,r)})),e},n.getAllStyle=function(){return this.style},n.markDirty=function(){this.dirty=!0},n.idDirty=function(){return this.dirty},n.getSize=function(){var e,n,r,i;return{width:null!==(e=null===(n=this.style.get(t.PropertyName.WIDTH))||void 0===n?void 0:n.value)&&void 0!==e?e:0,height:null!==(r=null===(i=this.style.get(t.PropertyName.HEIGHT))||void 0===i?void 0:i.value)&&void 0!==r?r:0}},n.computeLayout=function(){var t=Su(bu().mark((function t(){var e;return bu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.getSize(),t.next=3,Bu.computeLayout(this,{availableInlineSize:e.width,availableBlockSize:e.height,fixedInlineSize:e.width,fixedBlockSize:e.height,percentageInlineSize:e.width,percentageBlockSize:e.height,data:void 0});case 3:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),n.setComputedLayout=function(t){this.computedLayout=t},n.getComputedLayout=function(){return this.computedLayout},n.getAllComputedLayout=function(){},n.toString=function(){return"LayoutObject "+this.id},Mu(e,[{key:"intrisicSizes",get:function(){return this.internalIntrisicSizes}},{key:"childCount",get:function(){return this.children.length}}]),e}(),Du=function(){function t(){this.registry=new Map}var e=t.prototype;return e.hasLayout=function(t){return this.registry.has(t)},e.getLayout=function(t){if(void 0===t&&(t="absolute"),!this.hasLayout(t))throw Error("invalid layout property: "+t);return this.registry.get(t)},e.updateLayout=function(t,e){this.registry.set(t,e)},e.registerLayout=function(e,n){if(""===e)throw new TypeError("layout name cant't be empty");if(t.reservedLayout.includes(e))throw Error("layout name '"+e+"' is a system reserved layout name, please use another name");if(this.hasLayout(e))throw Error("layout '"+e+"' already exist.");this.registry.set(e,n)},e.deleteLayout=function(t){this.registry.delete(t)},Mu(t,[{key:"size",get:function(){return this.registry.size}}]),t}();Du.reservedLayout=[];var Fu,Gu,Bu=null,Uu=function(){function t(t,e){this.type=void 0,this.target=void 0,this.addedNodes=[],this.attributeName=null,this.attributeNamespace=null,this.nextSibling=null,this.oldValue=null,this.previousSibling=null,this.removedNodes=[],this.type=t,this.target=e}return t.copy=function(e){var n=new t(e.type,e.target);return n.addedNodes=e.addedNodes.slice(),n.removedNodes=e.removedNodes.slice(),n.previousSibling=e.previousSibling,n.nextSibling=e.nextSibling,n.attributeName=e.attributeName,n.attributeNamespace=e.attributeNamespace,n.oldValue=e.oldValue,n},t}(),zu=0,Vu=new WeakMap,ju=function(){function e(t,e,n){this.observer=void 0,this.target=void 0,this.options=void 0,this.transientObservedNodes=[],this.observer=t,this.target=e,this.options=n}var n=e.prototype;return n.enqueue=function(t){var e=this.observer.records,n=e.length;if(e.length>0){var r=function(t,e){return t===e?t:Gu&&function(t){return t===Gu||t===Fu}(t)?Gu:null}(e[n-1],t);if(r)return void(e[n-1]=r)}else qu.push(this.observer),Xu||(Xu=!0,void 0!==Zs.globalThis?Zs.globalThis.setTimeout(Ku):Ku());e[n]=t},n.addListeners=function(){this.addListeners_(this.target)},n.addListeners_=function(e){var n=this.options;n.attributes&&e.addEventListener(t.ElementEvent.ATTR_MODIFIED,this,!0),n.childList&&e.addEventListener(t.ElementEvent.INSERTED,this,!0),(n.childList||n.subtree)&&e.addEventListener(t.ElementEvent.REMOVED,this,!0)},n.removeListeners=function(){this.removeListeners_(this.target)},n.removeListeners_=function(e){var n=this.options;n.attributes&&e.removeEventListener(t.ElementEvent.ATTR_MODIFIED,this,!0),n.childList&&e.removeEventListener(t.ElementEvent.INSERTED,this,!0),(n.childList||n.subtree)&&e.removeEventListener(t.ElementEvent.REMOVED,this,!0)},n.removeTransientObservers=function(){var t=this.transientObservedNodes;this.transientObservedNodes=[],t.forEach((function(t){this.removeListeners_(t);for(var e=Vu.get(t),n=0;e.length>n;n++)if(e[n]===this){e.splice(n,1);break}}),this)},n.handleEvent=function(e){var n,r;switch(e.stopImmediatePropagation(),e.type){case t.ElementEvent.ATTR_MODIFIED:var i=e.attrName,o=e.relatedNode.namespaceURI;(n=Wu("attributes",r=e.target)).attributeName=i,n.attributeNamespace=o;var a=e.attrChange===Pa.ADDITION?null:e.prevValue;Yu(r,(function(t){if(t.attributes&&(!t.attributeFilter||!t.attributeFilter.length||-1!==t.attributeFilter.indexOf(i)||-1!==t.attributeFilter.indexOf(o)))return t.attributeOldValue?function(t){return Gu||((Gu=Uu.copy(Fu)).oldValue=t,Gu)}(a):n}));break;case t.ElementEvent.REMOVED:case t.ElementEvent.INSERTED:var s,u,c=e.target;e.type===t.ElementEvent.INSERTED?(s=[c],u=[]):(s=[],u=[c]);var l=c.previousSibling,h=c.nextSibling;(n=Wu("childList",r=e.relatedNode)).addedNodes=s,n.removedNodes=u,n.previousSibling=l,n.nextSibling=h,Yu(r,(function(t){if(t.childList)return n}))}Fu=Gu=void 0},e}(),Hu=function(){function t(t){this.callback=void 0,this.nodes=[],this.records=[],this.uid=zu++,this.callback=t}var e=t.prototype;return e.observe=function(t,e){if(!e.childList&&!e.attributes&&!e.characterData||e.attributeOldValue&&!e.attributes||e.attributeFilter&&e.attributeFilter.length&&!e.attributes||e.characterDataOldValue&&!e.characterData)throw new SyntaxError;var n,r=Vu.get(t);r||Vu.set(t,r=[]);for(var i=0;r.length>i;i++)if(r[i].observer===this){(n=r[i]).removeListeners(),n.options=e;break}n||(n=new ju(this,t,e),r.push(n),this.nodes.push(t)),n.addListeners()},e.disconnect=function(){var t=this;this.nodes.forEach((function(e){for(var n=Vu.get(e),r=0;n.length>r;r++){var i=n[r];if(i.observer===t){i.removeListeners(),n.splice(r,1);break}}}),this),this.records=[]},e.takeRecords=function(){var t=this.records;return this.records=[],t},t}();function Wu(t,e){return Fu=new Uu(t,e)}function Yu(t,e){for(var n=t;n;n=n.parentNode){var r=Vu.get(n);if(r)for(var i=0;r.length>i;i++){var o=r[i],a=o.options;if(n===t||a.subtree){var s=e(a);s&&o.enqueue(s)}}}}var Xu=!1,qu=[];function Ku(){Xu=!1;var t=qu;qu=[],t.sort((function(t,e){return t.uid-e.uid}));var e=!1;t.forEach((function(t){var n=t.takeRecords();!function(t){t.nodes.forEach((function(e){var n=Vu.get(e);n&&n.forEach((function(e){e.observer===t&&e.removeTransientObservers()}))}))}(t),n.length&&(t.callback(n,t),e=!0)})),e&&Ku()}function Zu(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(i=void 0,"symbol"==typeof(i=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(r.key,"string"))?i:i+""),r)}var i}function Qu(t,e,n){return e&&Zu(t.prototype,e),n&&Zu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function $u(t,e){return $u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},$u(t,e)}var Ju=function(t){var e,n;function r(e,n,r,i){var o;return(o=t.call(this,e)||this).currentTime=void 0,o.timelineTime=void 0,o.currentTime=r,o.timelineTime=i,o.target=n,o.type="finish",o.bubbles=!1,o.currentTarget=n,o.defaultPrevented=!1,o.eventPhase=o.AT_TARGET,o.timeStamp=Date.now(),o.currentTime=r,o.timelineTime=i,o}return(e=r).prototype=Object.create((n=t).prototype),e.prototype.constructor=e,$u(e,n),r}(ya),tc=0,ec=function(){function t(t,e){var n;this.effect=void 0,this.timeline=void 0,this.id=void 0,this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this.oldPlayState=void 0,this._holdTime=void 0,this.readyPromise=void 0,this.finishedPromise=void 0,this.resolveReadyPromise=void 0,this.rejectReadyPromise=void 0,this.resolveFinishedPromise=void 0,this.rejectFinishedPromise=void 0,this.onfinish=void 0,this.oncancel=void 0,this.onframe=void 0,this._currentTime=0,this._startTime=void 0,this._playbackRate=1,this._totalDuration=void 0,this._inEffect=void 0,this._inTimeline=!0,this.onremove=void 0,this.effect=t,t.animation=this,this.timeline=e,this.id=""+tc++,this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null===(n=this.effect)||void 0===n?void 0:n.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}var e=t.prototype;return e.updatePromises=function(){var t=this.oldPlayState,e=this.pending?"pending":this.playState;return this.readyPromise&&e!==t&&("idle"===e?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===t?this.resolveReadyPromise():"pending"===e&&(this.readyPromise=void 0)),this.finishedPromise&&e!==t&&("idle"===e?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===e?this.resolveFinishedPromise():"finished"===t&&(this.finishedPromise=void 0)),this.oldPlayState=e,this.readyPromise||this.finishedPromise},e.play=function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()},e.pause=function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()},e.finish=function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())},e.cancel=function(){this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises())},e.reverse=function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()},e.updatePlaybackRate=function(t){this.playbackRate=t},e.targetAnimations=function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()},e.markTarget=function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)},e.unmarkTarget=function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)},e.tick=function(t,e){this._idle||this._paused||(null===this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))},e.rewind=function(){if(this.playbackRate<0){if(this._totalDuration>=1/0)throw Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this._totalDuration}else this.currentTime=0},e.persist=function(){throw Error(br)},e.addEventListener=function(t,e,n){throw Error(br)},e.removeEventListener=function(t,e,n){throw Error(br)},e.dispatchEvent=function(t){throw Error(br)},e.commitStyles=function(){throw Error(br)},e.ensureAlive=function(){var t,e;0>this.playbackRate&&0===this.currentTime?this._inEffect=!!(null===(t=this.effect)||void 0===t?void 0:t.update(-1)):this._inEffect=!!(null===(e=this.effect)||void 0===e?void 0:e.update(this.currentTime));this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))},e.tickCurrentTime=function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())},e.fireEvents=function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new Ju(null,this,this.currentTime,t);setTimeout((function(){e.onfinish&&e.onfinish(n)}))}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var r=new Ju(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}},Qu(t,[{key:"pending",get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending}},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"ready",get:function(){var t=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise((function(e,n){t.resolveReadyPromise=function(){e(t)},t.rejectReadyPromise=function(){n(Error())}})),this.pending||this.resolveReadyPromise()),this.readyPromise}},{key:"finished",get:function(){var t=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise((function(e,n){t.resolveFinishedPromise=function(){e(t)},t.rejectFinishedPromise=function(){n(Error())}})),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){if(!isNaN(t=Number(t))){var e;if(this.timeline.restart(),!this._paused&&null!==this._startTime)this._startTime=Number(null===(e=this.timeline)||void 0===e?void 0:e.currentTime)-t/this.playbackRate;this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this))}}},{key:"startTime",get:function(){return this._startTime},set:function(t){if(null!==t){if(this.updatePromises(),isNaN(t=Number(t)))return;if(this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}}},{key:"playbackRate",get:function(){return this._playbackRate},set:function(t){if(t!==this._playbackRate){this.updatePromises();var e=this.currentTime;this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==e&&(this.currentTime=e),this.updatePromises()}}},{key:"_isFinished",get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||0>this._playbackRate&&0>=Number(this._currentTime))}},{key:"totalDuration",get:function(){return this._totalDuration}},{key:"_needsTick",get:function(){return this.pending||"running"===this.playState||!this._finishedFlag}}]),t}(),nc=.1,rc="function"==typeof Float32Array,ic=function(t,e){return 1-3*e+3*t},oc=function(t,e){return 3*e-6*t},ac=function(t){return 3*t},sc=function(t,e,n){return((ic(e,n)*t+oc(e,n))*t+ac(e))*t},uc=function(t,e,n){return 3*ic(e,n)*t*t+2*oc(e,n)*t+ac(e)},cc=function(t,e,n,r){if(0>t||t>1||0>n||n>1)throw Error("bezier x values must be in [0, 1] range");if(t===e&&n===r)return function(t){return t};for(var i=rc?new Float32Array(11):[,,,,,,,,,,,],o=0;11>o;++o)i[o]=sc(o*nc,t,n);var a=function(e){for(var r=0,o=1;10!==o&&e>=i[o];++o)r+=nc;--o;var a=r+(e-i[o])/(i[o+1]-i[o])*nc,s=uc(a,t,n);return.001>s?0===s?a:function(t,e,n,r,i){var o,a,s=0;do{(o=sc(a=e+(n-e)/2,r,i)-t)>0?n=a:e=a}while(Math.abs(o)>1e-7&&10>++s);return a}(e,r,r+nc,t,n):function(t,e,n,r){for(var i=0;4>i;++i){var o=uc(e,n,r);if(0===o)return e;e-=(sc(e,n,r)-t)/o}return e}(e,a,t,n)};return function(t){return 0===t||1===t?t:sc(a(t),e,r)}},lc=function(t){return Math.pow(t,2)},hc=function(t){return Math.pow(t,3)},fc=function(t){return Math.pow(t,4)},dc=function(t){return Math.pow(t,5)},pc=function(t){return Math.pow(t,6)},vc=function(t){return 1-Math.cos(t*Math.PI/2)},mc=function(t){return 1-Math.sqrt(1-t*t)},yc=function(t){return t*t*(3*t-2)},gc=function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)},xc=function(t,e){void 0===e&&(e=[]);var n=e[0],r=e[1],i=void 0===r?.5:r,o=ae(Number(void 0===n?1:n),1,10),a=ae(Number(i),.1,2);return 0===t||1===t?t:-o*Math.pow(2,10*(t-1))*Math.sin(2*Math.PI*(t-1-a/(2*Math.PI)*Math.asin(1/o))/a)},Ec=function(t,e,n){void 0===e&&(e=[]);var r=e[0],i=void 0===r?1:r,o=e[1],a=void 0===o?100:o,s=e[2],u=void 0===s?10:s,c=e[3],l=void 0===c?0:c;i=ae(i,.1,1e3),a=ae(a,.1,1e3),u=ae(u,.1,1e3),l=ae(l,.1,1e3);var h=Math.sqrt(a/i),f=u/(2*Math.sqrt(a*i)),d=1>f?h*Math.sqrt(1-f*f):0,p=1>f?(f*h-l)/d:-l+h,v=n?n*t/1e3:t;return v=1>f?Math.exp(-v*f*h)*(1*Math.cos(d*v)+p*Math.sin(d*v)):(1+p*v)*Math.exp(-v*h),0===t||1===t?t:1-v},bc=function(t,e){void 0===e&&(e=[]);var n=e[0],r=void 0===n?10:n;return("start"==e[1]?Math.ceil:Math.floor)(ae(t,0,1)*r)/r},Tc=function(t,e){void 0===e&&(e=[]);return cc(e[0],e[1],e[2],e[3])(t)},Sc=cc(.42,0,1,1),Pc=function(t){return function(e,n,r){return void 0===n&&(n=[]),1-t(1-e,n,r)}},Mc=function(t){return function(e,n,r){return void 0===n&&(n=[]),.5>e?t(2*e,n,r)/2:1-t(-2*e+2,n,r)/2}},wc=function(t){return function(e,n,r){return void 0===n&&(n=[]),.5>e?(1-t(1-2*e,n,r))/2:(t(2*e-1,n,r)+1)/2}},kc={steps:bc,"step-start":function(t){return bc(t,[1,"start"])},"step-end":function(t){return bc(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":Tc,ease:function(t){return Tc(t,[.25,.1,.25,1])},in:Sc,out:Pc(Sc),"in-out":Mc(Sc),"out-in":wc(Sc),"in-quad":lc,"out-quad":Pc(lc),"in-out-quad":Mc(lc),"out-in-quad":wc(lc),"in-cubic":hc,"out-cubic":Pc(hc),"in-out-cubic":Mc(hc),"out-in-cubic":wc(hc),"in-quart":fc,"out-quart":Pc(fc),"in-out-quart":Mc(fc),"out-in-quart":wc(fc),"in-quint":dc,"out-quint":Pc(dc),"in-out-quint":Mc(dc),"out-in-quint":wc(dc),"in-expo":pc,"out-expo":Pc(pc),"in-out-expo":Mc(pc),"out-in-expo":wc(pc),"in-sine":vc,"out-sine":Pc(vc),"in-out-sine":Mc(vc),"out-in-sine":wc(vc),"in-circ":mc,"out-circ":Pc(mc),"in-out-circ":Mc(mc),"out-in-circ":wc(mc),"in-back":yc,"out-back":Pc(yc),"in-out-back":Mc(yc),"out-in-back":wc(yc),"in-bounce":gc,"out-bounce":Pc(gc),"in-out-bounce":Mc(gc),"out-in-bounce":wc(gc),"in-elastic":xc,"out-elastic":Pc(xc),"in-out-elastic":Mc(xc),"out-in-elastic":wc(xc),spring:Ec,"spring-in":Ec,"spring-out":Pc(Ec),"spring-in-out":Mc(Ec),"spring-out-in":wc(Ec)},Nc=function(t){return kc[function(t){return function(t){return"-"===(t=t.replace(/([A-Z])/g,(function(t){return"-"+t.toLowerCase()}))).charAt(0)?t.substring(1):t}(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()}(t)]||kc.linear},Cc=function(t){return t},Ac=1,Oc=.5,Lc=0;function Rc(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var _c="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",Ic=RegExp("cubic-bezier\\("+_c+","+_c+","+_c+","+_c+"\\)"),Dc=/steps\(\s*(\d+)\s*\)/,Fc=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Gc(t){var e=Ic.exec(t);if(e)return cc.apply(void 0,e.slice(1).map(Number));var n=Dc.exec(t);if(n)return Rc(Number(n[1]),Lc);var r=Fc.exec(t);return r?Rc(Number(r[1]),{start:Ac,middle:Oc,end:Lc}[r[2]]):Nc(t)}function Bc(t){return Math.abs(function(t){var e;if(0===t.duration||0===t.iterations)return 0;return("auto"===t.duration?0:Number(t.duration))*(null!==(e=t.iterations)&&void 0!==e?e:1)}(t)/(t.playbackRate||1))}var Uc=0,zc=1,Vc=2,jc=3;function Hc(t,e,n){var r=function(t,e,n){if(null===e)return Uc;var r=n.endTime;return Math.min(n.delay,r)>e?zc:Math.min(n.delay+t+n.endDelay,r)>e?jc:Vc}(t,e,n),i=function(t,e,n,r,i){switch(r){case zc:return"backwards"===e||"both"===e?0:null;case jc:return n-i;case Vc:return"forwards"===e||"both"===e?t:null;case Uc:return null}}(t,n.fill,e,r,n.delay);if(null===i)return null;var o="auto"===n.duration?0:n.duration,a=function(t,e,n,r,i){var o=i;return 0===t?e!==zc&&(o+=n):o+=r/t,o}(o,r,n.iterations,i,n.iterationStart),s=function(t,e,n,r,i,o){var a=t===1/0?e%1:t%1;return 0!==a||n!==Vc||0===r||0===i&&0!==o||(a=1),a}(a,n.iterationStart,r,n.iterations,i,o),u=function(t,e,n,r){return t===Vc&&e===1/0?1/0:1===n?Math.floor(r)-1:Math.floor(r)}(r,n.iterations,s,a),c=function(t,e,n){var r=t;if("normal"!==t&&"reverse"!==t){var i=e;"alternate-reverse"===t&&(i+=1),r="normal",i!==1/0&&i%2!=0&&(r="reverse")}return"normal"===r?n:1-n}(n.direction,u,s);return n.currentIteration=u,n.progress=c,n.easingFunction(c)}function Wc(t,e,n){var r=function(t,e){for(var n={},r=0;t.length>r;r++)for(var i in t[r])if(Yc(i)){var o={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:Gc(t[r].easing)||e.easingFunction,value:t[r][i]};n[i]=n[i]||[],n[i].push(o)}return n}(t,e),i=function(t,e){var n=[];for(var r in t)for(var i=t[r],o=0;i.length-1>o;o++){var a=o,s=o+1,u=i[a].computedOffset,c=i[s].computedOffset,l=u,h=c;0===o&&(l=-1/0,0===c&&(s=a)),o===i.length-2&&(h=1/0,1===u&&(a=s)),n.push({applyFrom:l,applyTo:h,startOffset:i[a].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[a].easingFunction,property:r,interpolation:qc(r,i[a].value,i[s].value,e)})}return n.sort((function(t,e){return t.startOffset-e.startOffset})),n}(r,n);return function(t,e){if(null!==e)i.filter((function(t){return e>=t.applyFrom&&t.applyTo>e})).forEach((function(n){var r=n.endOffset-n.startOffset,i=0===r?0:n.easingFunction((e-n.startOffset)/r);t.setAttribute(n.property,n.interpolation(i))}));else for(var n in r)Yc(n)&&t.setAttribute(n,null)}}function Yc(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var Xc=function(t,e,n){return function(r){var i=Kc(t,e,r);return!Zs.enableCSSParsing&&se(i)?i:n(i)}};function qc(t,e,n,r){var i=Es[t];if(i&&i.syntax&&i.int){var o=Zs.styleValueRegistry.getPropertySyntax(i.syntax);if(o){var a,s;if(Zs.enableCSSParsing){var u=Zs.styleValueRegistry.parseProperty(t,e,r),c=Zs.styleValueRegistry.parseProperty(t,n,r);a=Zs.styleValueRegistry.computeProperty(t,u,r),s=Zs.styleValueRegistry.computeProperty(t,c,r)}else{var l=o.parserWithCSSDisabled;a=l?l(e,r):e,s=l?l(n,r):n}var h=o.mixer(a,s,r);if(h){var f=Xc.apply(void 0,h);return function(t){return 0===t?e:1===t?n:f(t)}}}}return Xc(!1,!0,(function(t){return t?n:e}))}function Kc(t,e,n){if("number"==typeof t&&"number"==typeof e)return t*(1-n)+e*n;if("boolean"==typeof t&&"boolean"==typeof e||"string"==typeof t&&"string"==typeof e)return.5>n?t:e;if(Array.isArray(t)&&Array.isArray(e)){for(var r=t.length,i=e.length,o=Math.max(r,i),a=[],s=0;o>s;s++)a.push(Kc(t[r>s?s:r-1],e[i>s?s:i-1],n));return a}throw Error("Mismatched interpolation arguments "+t+":"+e)}var Zc=function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=Cc,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.playbackRate=void 0,this.effect=void 0,this.composite=void 0,this.activeDuration=void 0,this.endTime=void 0,this.currentIteration=null,this.progress=null}return Qu(t,[{key:"easing",get:function(){return this._easing},set:function(t){this.easingFunction=Gc(t),this._easing=t}}]),t}();function Qc(t,e){if(null===t)return[];Array.isArray(t)||(t=function(t){var e=[];for(var n in t)if(!(n in["easing","offset","composite"])){var r=t[n];Array.isArray(r)||(r=[r]);for(var i=r.length,o=0;i>o;o++){if(!e[o]){var a={};"offset"in t&&(a.offset=Number(t.offset)),"easing"in t&&(a.easing=t.easing),"composite"in t&&(a.composite=t.composite),e[o]=a}null!=r[o]&&(e[o][n]=r[o])}}return e.sort((function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)})),e}(t));for(var n=t.map((function(t){var n={};for(var r in(null==e?void 0:e.composite)&&(n.composite="auto"),t){var i=t[r];if("offset"===r){if(null!==i){if(!isFinite(i=Number(i)))throw Error("Keyframe offsets must be numbers.");if(0>i||i>1)throw Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=i}}else if("composite"===r&&-1===["replace","add","accumulate","auto"].indexOf(i))throw Error(i+" compositing is not supported");n[r]=i}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==e?void 0:e.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n})),r=!0,i=-1/0,o=0;n.length>o;o++){var a=n[o].offset;if($t(a))r=!1;else{if(i>a)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=a}}return n=n.filter((function(t){return Number(t.offset)>=0&&1>=Number(t.offset)})),r||function(){var t,e,r=n.length;n[r-1].computedOffset=Number(null!==(t=n[r-1].offset)&&void 0!==t?t:1),r>1&&(n[0].computedOffset=Number(null!==(e=n[0].offset)&&void 0!==e?e:0));for(var i=0,o=Number(n[0].computedOffset),a=1;r>a;a++){var s=n[a].computedOffset;if(!$t(s)&&!$t(o)){for(var u=1;a-i>u;u++)n[i+u].computedOffset=o+(Number(s)-o)*u/(a-i);i=a,o=Number(s)}}}(),n}var $c="backwards|forwards|both|none".split("|"),Jc="reverse|alternate|alternate-reverse".split("|");function tl(t,e){var n=new Zc;return e&&(n.fill="both",n.duration="auto"),"number"!=typeof t||isNaN(t)?void 0!==t&&Object.keys(t).forEach((function(e){if(null!=t[e]&&"auto"!==t[e]){if(("number"==typeof n[e]||"duration"===e)&&("number"!=typeof t[e]||isNaN(t[e])))return;if("fill"===e&&-1===$c.indexOf(t[e]))return;if("direction"===e&&-1===Jc.indexOf(t[e]))return;n[e]=t[e]}})):n.duration=t,n}function el(t,e){var n;return tl(t=nl(null!==(n=t)&&void 0!==n?n:{duration:"auto"}),e)}function nl(t){return"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t}),t}var rl=function(){function t(t,e,n){var r=this;this.composite="replace",this.iterationComposite="replace",this.target=void 0,this.animation=void 0,this.timing=void 0,this.computedTiming=void 0,this.normalizedKeyframes=void 0,this.timeFraction=void 0,this.interpolations=void 0,this.target=t,this.timing=el(n,!1),this.timing.effect=this,this.timing.activeDuration=Bc(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=Qc(e,this.timing),this.interpolations=Wc(this.normalizedKeyframes,this.timing,this.target);var i=Zs.globalThis.Proxy;this.computedTiming=i?new i(this.timing,{get:function(t,e){return"duration"===e?"auto"===t.duration?0:t.duration:"fill"===e?"auto"===t.fill?"none":t.fill:"localTime"===e?r.animation&&r.animation.currentTime||null:"currentIteration"===e?r.animation&&"running"===r.animation.playState?t.currentIteration||0:null:"progress"===e?r.animation&&"running"===r.animation.playState?t.progress||0:null:t[e]},set:function(){return!0}}):this.timing}var e=t.prototype;return e.applyInterpolations=function(){this.interpolations(this.target,Number(this.timeFraction))},e.update=function(t){return null!==t&&(this.timeFraction=Hc(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},e.getKeyframes=function(){return this.normalizedKeyframes},e.setKeyframes=function(t){this.normalizedKeyframes=Qc(t)},e.getComputedTiming=function(){return this.computedTiming},e.getTiming=function(){return this.timing},e.updateTiming=function(t){var e=this;Object.keys(t||{}).forEach((function(n){e.timing[n]=t[n]}))},t}();function il(t,e){return Number(t.id)-Number(e.id)}var ol=function(){function t(t){var e=this;this.document=void 0,this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.frameId=void 0,this.webAnimationsNextTick=function(t){e.currentTime=t,e.discardAnimations(),0===e.animations.length?e.timelineTicking=!1:e.requestAnimationFrame(e.webAnimationsNextTick)},this.processRafCallbacks=function(t){var n=e.rafCallbacks;e.rafCallbacks=[],Number(e.currentTime)>t&&(t=Number(e.currentTime)),e.animations.sort(il),e.animations=e.tick(t,!0,e.animations)[0],n.forEach((function(e){e[1](t)})),e.applyPendingEffects()},this.document=t}var e=t.prototype;return e.getAnimations=function(){return this.discardAnimations(),this.animations.slice()},e.isTicking=function(){return this.inTick},e.play=function(t,e,n){var r=new rl(t,e,n),i=new ec(r,this);return this.animations.push(i),this.restartWebAnimationsNextTick(),i.updatePromises(),i.play(),i.updatePromises(),i},e.applyDirtiedAnimation=function(t){var e=this;if(!this.inTick){t.markTarget();var n=t.targetAnimations();n.sort(il),this.tick(Number(this.currentTime),!1,n.slice())[1].forEach((function(t){var n=e.animations.indexOf(t);-1!==n&&e.animations.splice(n,1)})),this.applyPendingEffects()}},e.restart=function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame((function(){})),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame},e.destroy=function(){this.document.defaultView.cancelAnimationFrame(this.frameId)},e.applyPendingEffects=function(){this.pendingEffects.forEach((function(t){null==t||t.applyInterpolations()})),this.pendingEffects=[]},e.updateAnimationsPromises=function(){this.animationsWithPromises=this.animationsWithPromises.filter((function(t){return t.updatePromises()}))},e.discardAnimations=function(){this.updateAnimationsPromises(),this.animations=this.animations.filter((function(t){return"finished"!==t.playState&&"idle"!==t.playState}))},e.restartWebAnimationsNextTick=function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))},e.rAF=function(t){var e=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([e,t]),e},e.requestAnimationFrame=function(t){var e=this;return this.rAF((function(n){e.updateAnimationsPromises(),t(n),e.updateAnimationsPromises()}))},e.tick=function(t,e,n){var r,i,o=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var a=[],s=[],u=[],c=[];return n.forEach((function(n){n.tick(t,e),n._inEffect?(s.push(n.effect),n.markTarget()):(a.push(n.effect),n.unmarkTarget()),n._needsTick&&(o.ticking=!0);var r=n._inEffect||n._needsTick;n._inTimeline=r,r?u.push(n):c.push(n)})),(r=this.pendingEffects).push.apply(r,a),(i=this.pendingEffects).push.apply(i,s),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[u,c]},t}();Zs.EasingFunction=Gc,Zs.AnimationTimeline=ol,t.AABB=na,t.AbstractLayoutDefinition=Ou,t.AbstractRenderer=tu,t.AbstractRendererPlugin=Js,t.AdvancedCamera=vu,t.Animation=ec,t.AnimationEvent=Ju,t.AnimationTimeline=ol,t.BUILT_IN_PROPERTIES=gs,t.CSS=rr,t.CSSGradientValue=jn,t.CSSKeywordValue=Hn,t.CSSRGB=nr,t.CSSStyleValue=zn,t.CSSUnitValue=Jn,t.Camera=ws,t.CameraEvent=Ps,t.Canvas=du,t.Circle=Wa,t.CircleUpdater=ks,t.CustomElement=Xa,t.CustomElementRegistry=va,t.CustomEvent=ga,t.DefaultLayoutRegistry=Du,t.DefaultSceneGraphSelector=Gs,t.DefaultSceneGraphService=Hs,t.DisplayObject=ja,t.DisplayObjectPool=Za,t.Document=Sa,t.EMPTY_PARSED_PATH=us,t.ERROR_MSG_METHOD_NOT_IMPLEMENTED=br,t.Element=Ca,t.Ellipse=$a,t.EllipseUpdater=Ns,t.EventService=_s,t.EventTarget=xa,t.FederatedEvent=ya,t.FederatedMouseEvent=Aa,t.FederatedPointerEvent=Oa,t.FederatedWheelEvent=La,t.FragmentResult=Eu,t.Frustum=ia,t.Group=ts,t.HTML=ns,t.Image=is,t.KeyframeEffect=rl,t.LayoutChildren=Nu,t.LayoutContext=Au,t.LayoutEdges=function(e){var n,r,i,o,a,s,u,c,l,h,f,d,p,v,m,y;this.options=void 0,this.inlineStart=void 0,this.inlineEnd=void 0,this.blockStart=void 0,this.blockEnd=void 0,this.inline=void 0,this.block=void 0,this.options=e;var g=e.node.getAllStyle(),x=null!==(n=null===(r=g.get(t.PropertyName.PADDING_TOP))||void 0===r?void 0:r.value)&&void 0!==n?n:0,E=null!==(i=null===(o=g.get(t.PropertyName.PADDING_END))||void 0===o?void 0:o.value)&&void 0!==i?i:0,b=null!==(a=null===(s=g.get(t.PropertyName.PADDING_BOTTOM))||void 0===s?void 0:s.value)&&void 0!==a?a:0,T=null!==(u=null===(c=g.get(t.PropertyName.PADDING_START))||void 0===c?void 0:c.value)&&void 0!==u?u:0,S=null!==(l=null===(h=g.get(t.PropertyName.PADDING_TOP))||void 0===h?void 0:h.value)&&void 0!==l?l:0,P=null!==(f=null===(d=g.get(t.PropertyName.PADDING_END))||void 0===d?void 0:d.value)&&void 0!==f?f:0,M=null!==(p=null===(v=g.get(t.PropertyName.PADDING_BOTTOM))||void 0===v?void 0:v.value)&&void 0!==p?p:0,w=null!==(m=null===(y=g.get(t.PropertyName.PADDING_START))||void 0===y?void 0:y.value)&&void 0!==m?m:0;this.blockStart=x+0+S,this.inlineStart=E+0+P,this.blockEnd=b+0+M,this.inlineEnd=T+0+w,this.block=this.blockStart+this.blockEnd,this.inline=this.inlineStart+this.inlineEnd},t.LayoutEngine=Ru,t.LayoutFragment=function(t,e){this._layoutContext=void 0,this.options=void 0,this.layoutContext=void 0,this.inlineSize=void 0,this.blockSize=void 0,this.inlineOffset=void 0,this.blockOffset=void 0,this.data=void 0,this._layoutContext=t,this.options=e,this.layoutContext=t,this.inlineSize=e.inlineSize,this.blockSize=e.blockSize,this.inlineOffset=0,this.blockOffset=0,this.data=e.data},t.LayoutObject=Iu,t.Line=as,t.LineUpdater=Cs,t.MutationEvent=Pa,t.MutationObserver=Hu,t.MutationRecord=Uu,t.Node=Ea,t.OffscreenCanvasCreator=Is,t.Path=cs,t.PathUpdater=As,t.Plane=ra,t.Point=oa,t.Polygon=hs,t.Polyline=ds,t.PolylineUpdater=Os,t.RBush=n,t.Rect=vs,t.RectUpdater=Ls,t.Rectangle=aa,t.Registration=ju,t.RenderingService=Ds,t.Text=ys,t.TextService=Ks,t.TextUpdater=Rs,t.compareAnimations=il,t.computeLinearGradient=function(t,e,n){var r=Ar(n.value),i=0+t/2,o=0+e/2,a=Math.abs(t*Math.cos(r))+Math.abs(e*Math.sin(r));return{x1:i-Math.cos(r)*a/2,y1:o-Math.sin(r)*a/2,x2:i+Math.cos(r)*a/2,y2:o+Math.sin(r)*a/2}},t.computeRadialGradient=function(e,n,r,i,o){var a=r.value,s=i.value;r.unit===t.UnitType.kPercentage&&(a=r.value/100*e),i.unit===t.UnitType.kPercentage&&(s=i.value/100*n);var u=Math.max(Dt([0,0],[a,s]),Dt([0,n],[a,s]),Dt([e,n],[a,s]),Dt([e,0],[a,s]));return o&&(o instanceof Jn?u=o.value:o instanceof Hn&&("closest-side"===o.value?u=Math.min(a,e-a,s,n-s):"farthest-side"===o.value?u=Math.max(a,e-a,s,n-s):"closest-corner"===o.value&&(u=Math.min(Dt([0,0],[a,s]),Dt([0,n],[a,s]),Dt([e,n],[a,s]),Dt([e,0],[a,s]))))),{x:a,y:s,r:u}},t.convertToPath=function(e,n){void 0===n&&(n=e.getLocalTransform());var r=[];switch(e.nodeName){case t.Shape.LINE:var i=e.parsedStyle;r=function(t,e,n,r){return[["M",t,e],["L",n,r]]}(i.x1,i.y1,i.x2,i.y2);break;case t.Shape.CIRCLE:var o=e.parsedStyle,a=o.r;r=ii(a,a,o.cx,o.cy);break;case t.Shape.ELLIPSE:var s=e.parsedStyle;r=ii(s.rx,s.ry,s.cx,s.cy);break;case t.Shape.POLYLINE:case t.Shape.POLYGON:r=function(t,e){var n=t.map((function(t,e){return[0===e?"M":"L",t[0],t[1]]}));return e&&n.push(["Z"]),n}(e.parsedStyle.points.points,e.nodeName===t.Shape.POLYGON);break;case t.Shape.RECT:var u=e.parsedStyle,c=u.width,l=u.height,h=u.x,f=u.y,d=u.radius,p=d&&d.some((function(t){return 0!==t}));r=function(t,e,n,r,i){if(i){var o=i[0],a=i[1],s=i[2],u=i[3],c=t>0?1:-1,l=e>0?1:-1,h=c+l!==0?1:0;return[["M",c*o+n,r],["L",t-c*a+n,r],a?["A",a,a,0,0,h,t+n,l*a+r]:null,["L",t+n,e-l*s+r],s?["A",s,s,0,0,h,t+n-c*s,e+r]:null,["L",n+c*u,e+r],u?["A",u,u,0,0,h,n,e+r-l*u]:null,["L",n,l*o+r],o?["A",o,o,0,0,h,c*o+n,r]:null,["Z"]].filter((function(t){return t}))}return[["M",n,r],["L",n+t,r],["L",n+t,r+e],["L",n,r+e],["Z"]]}(c,l,h,f,p&&d.map((function(t){return ae(t,0,Math.min(Math.abs(c)/2,Math.abs(l)/2))})));break;case t.Shape.PATH:r=[].concat(e.parsedStyle.path.absolutePath)}if(r.length)return function(t,e,n){var r=e.parsedStyle,i=r.defX,o=void 0===i?0:i,a=r.defY,s=void 0===a?0:a;return t.reduce((function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=I(e[1]-o,e[2]-s,0);n&&W(i,i,n),r=""+e[0]+i[0]+","+i[1]}else if("Z"===e[0])r=e[0];else if("C"===e[0]){var a=I(e[1]-o,e[2]-s,0),u=I(e[3]-o,e[4]-s,0),c=I(e[5]-o,e[6]-s,0);n&&(W(a,a,n),W(u,u,n),W(c,c,n)),r=""+e[0]+a[0]+","+a[1]+","+u[0]+","+u[1]+","+c[0]+","+c[1]}else if("A"===e[0]){var l=I(e[6]-o,e[7]-s,0);n&&W(l,l,n),r=""+e[0]+e[1]+","+e[2]+","+e[3]+","+e[4]+","+e[5]+","+l[0]+","+l[1]}else if("Q"===e[0]){var h=I(e[1]-o,e[2]-s,0),f=I(e[3]-o,e[4]-s,0);n&&(W(h,h,n),W(f,f,n)),r=""+e[0]+e[1]+","+e[2]+","+e[3]+","+e[4]+"}"}return t+r}),"")}(r,e,n)},t.createVec3=Cr,t.decompose=Ir,t.definedProps=function(t){return Object.fromEntries(Object.entries(t).filter((function(t){return void 0!==t[1]})))},t.deg2rad=Ar,t.deg2turn=function(t){return t/360},t.findClosestClipPathTarget=gr,t.fromRotationTranslationScale=_r,t.getAngle=Nr,t.getEuler=Rr,t.getOrCalculatePathTotalLength=Xr,t.grad2deg=function(t){return 0>(t%=400)&&(t+=400),t/400*360},t.isBrowser=mr,t.isCSSGradientValue=function(t){return!!t.type&&!!t.value},t.isCSSRGB=$i,t.isCanvas=function(t){return!!t.document},t.isDisplayObject=Ra,t.isFederatedEvent=ma,t.isFillOrStrokeAffected=function(t,e,n){var r=!1,i=!1;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=!!e&&!e.isNone,i=!!n&&!n.isNone):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(r=!0,i=!0),[r,i]},t.isPattern=Qi,t.layoutEngine=Bu,t.makeTiming=tl,t.mergeColors=to,t.normalizeKeyframes=Qc,t.normalizeTimingInput=el,t.numericTimingToObject=nl,t.parseColor=Ji,t.parseLength=no,t.parsePath=bo,t.parseTransform=Co,t.parsedTransformToMat4=jr,t.propertyMetadataCache=Es,t.rad2deg=Or,t.resetEntityCounter=function(){Ma=0},t.runtime=Zs,t.setDOMSize=function(t,e,n){mr&&t.style&&(t.style.width=e+xr,t.style.height=n+xr)},t.translatePathToString=function(t,e,n,r,i,o,a){void 0===r&&(r=0),void 0===i&&(i=0),void 0===o&&(o=0),void 0===a&&(a=0);var s=t.map((function(s,u){var c=t[u+1],l=0===u&&(0!==r||0!==i),h=(u===t.length-1||c&&("M"===c[0]||"Z"===c[0]))&&0!==o&&0!==a;switch(s[0]){case"M":return l?"M "+(s[1]-e+r)+","+(s[2]-n+i)+" L "+(s[1]-e)+","+(s[2]-n):"M "+(s[1]-e)+","+(s[2]-n);case"L":return"L "+(s[1]-e+(h?o:0))+","+(s[2]-n+(h?a:0));case"Q":return"Q "+(s[1]-e)+" "+(s[2]-n)+","+(s[3]-e)+" "+(s[4]-n)+(h?" L "+(s[3]-e+o)+","+(s[4]-n+a):"");case"C":return"C "+(s[1]-e)+" "+(s[2]-n)+","+(s[3]-e)+" "+(s[4]-n)+","+(s[5]-e)+" "+(s[6]-n)+(h?" L "+(s[5]-e+o)+","+(s[6]-n+a):"");case"A":return"A "+s[1]+" "+s[2]+" "+s[3]+" "+s[4]+" "+s[5]+" "+(s[6]-e)+" "+(s[7]-n)+(h?" L "+(s[6]-e+o)+","+(s[7]-n+a):"");case"Z":return"Z"}})).join(" ");return~s.indexOf("NaN")?"":s},t.turn2deg=Lr,Object.defineProperty(t,"__esModule",{value:!0})}));