irr-gh 0.1.0

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.
@@ -0,0 +1,141 @@
1
+ (function(Ne,dt){typeof exports=="object"&&typeof module<"u"?dt(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],dt):(Ne=typeof globalThis<"u"?globalThis:Ne||self,dt(Ne.IrrGh={},Ne.Vue))})(this,(function(Ne,dt){"use strict";var Nf=typeof document<"u"?document.currentScript:null;function ps(r){"@babel/helpers - typeof";return ps=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ps(r)}function gP(r,e){if(ps(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(ps(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function kb(r){var e=gP(r,"string");return ps(e)=="symbol"?e:e+""}function be(r,e,t){return(e=kb(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Nb(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function De(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Nb(Object(t),!0).forEach(function(n){be(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Nb(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function le(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function Lb(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,kb(n.key),n)}}function ce(r,e,t){return e&&Lb(r.prototype,e),t&&Lb(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}function nc(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function pP(r){if(Array.isArray(r))return nc(r)}function vP(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function Lf(r,e){if(r){if(typeof r=="string")return nc(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?nc(r,e):void 0}}function yP(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tt(r){return pP(r)||vP(r)||Lf(r)||yP()}function uo(r){return uo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},uo(r)}function Qb(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Qb=function(){return!!r})()}function mP(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function wP(r,e){if(e&&(ps(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mP(r)}function We(r,e,t){return e=uo(e),wP(r,Qb()?Reflect.construct(e,t||[],uo(r).constructor):e.apply(r,t))}function Qf(r,e){return Qf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},Qf(r,e)}function qe(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&Qf(r,e)}function BP(r){if(Array.isArray(r))return r}function bP(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,a,s,o=[],A=!0,l=!1;try{if(a=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;A=!1}else for(;!(A=(n=a.call(t)).done)&&(o.push(n.value),o.length!==e);A=!0);}catch(c){l=!0,i=c}finally{try{if(!A&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(l)throw i}}return o}}function EP(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $e(r,e){return BP(r)||bP(r,e)||Lf(r,e)||EP()}var rc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ic(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Ub(r){if(Object.prototype.hasOwnProperty.call(r,"__esModule"))return r;var e=r.default;if(typeof e=="function"){var t=function n(){var i=!1;try{i=this instanceof n}catch{}return i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}),t}var Uf={exports:{}},Pb;function xP(){return Pb||(Pb=1,(function(r){var e=Object.prototype.hasOwnProperty,t="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(t=!1));function i(A,l,c){this.fn=A,this.context=l,this.once=c||!1}function a(A,l,c,u,h){if(typeof c!="function")throw new TypeError("The listener must be a function");var d=new i(c,u||A,h),f=t?t+l:l;return A._events[f]?A._events[f].fn?A._events[f]=[A._events[f],d]:A._events[f].push(d):(A._events[f]=d,A._eventsCount++),A}function s(A,l){--A._eventsCount===0?A._events=new n:delete A._events[l]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var l=[],c,u;if(this._eventsCount===0)return l;for(u in c=this._events)e.call(c,u)&&l.push(t?u.slice(1):u);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},o.prototype.listeners=function(l){var c=t?t+l:l,u=this._events[c];if(!u)return[];if(u.fn)return[u.fn];for(var h=0,d=u.length,f=new Array(d);h<d;h++)f[h]=u[h].fn;return f},o.prototype.listenerCount=function(l){var c=t?t+l:l,u=this._events[c];return u?u.fn?1:u.length:0},o.prototype.emit=function(l,c,u,h,d,f){var g=t?t+l:l;if(!this._events[g])return!1;var p=this._events[g],v=arguments.length,y,m;if(p.fn){switch(p.once&&this.removeListener(l,p.fn,void 0,!0),v){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,c),!0;case 3:return p.fn.call(p.context,c,u),!0;case 4:return p.fn.call(p.context,c,u,h),!0;case 5:return p.fn.call(p.context,c,u,h,d),!0;case 6:return p.fn.call(p.context,c,u,h,d,f),!0}for(m=1,y=new Array(v-1);m<v;m++)y[m-1]=arguments[m];p.fn.apply(p.context,y)}else{var B=p.length,C;for(m=0;m<B;m++)switch(p[m].once&&this.removeListener(l,p[m].fn,void 0,!0),v){case 1:p[m].fn.call(p[m].context);break;case 2:p[m].fn.call(p[m].context,c);break;case 3:p[m].fn.call(p[m].context,c,u);break;case 4:p[m].fn.call(p[m].context,c,u,h);break;default:if(!y)for(C=1,y=new Array(v-1);C<v;C++)y[C-1]=arguments[C];p[m].fn.apply(p[m].context,y)}}return!0},o.prototype.on=function(l,c,u){return a(this,l,c,u,!1)},o.prototype.once=function(l,c,u){return a(this,l,c,u,!0)},o.prototype.removeListener=function(l,c,u,h){var d=t?t+l:l;if(!this._events[d])return this;if(!c)return s(this,d),this;var f=this._events[d];if(f.fn)f.fn===c&&(!h||f.once)&&(!u||f.context===u)&&s(this,d);else{for(var g=0,p=[],v=f.length;g<v;g++)(f[g].fn!==c||h&&!f[g].once||u&&f[g].context!==u)&&p.push(f[g]);p.length?this._events[d]=p.length===1?p[0]:p:s(this,d)}return this},o.prototype.removeAllListeners=function(l){var c;return l?(c=t?t+l:l,this._events[c]&&s(this,c)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=t,o.EventEmitter=o,r.exports=o})(Uf)),Uf.exports}var CP=xP();const Rb=ic(CP);var Ut=1e-6,pn=typeof Float32Array<"u"?Float32Array:Array,SP="zyx";function Db(){var r=new pn(9);return pn!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}function FP(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[4],r[4]=e[5],r[5]=e[6],r[6]=e[8],r[7]=e[9],r[8]=e[10],r}function TP(r,e,t,n,i,a,s,o,A){var l=new pn(9);return l[0]=r,l[1]=e,l[2]=t,l[3]=n,l[4]=i,l[5]=a,l[6]=s,l[7]=o,l[8]=A,l}function Ct(){var r=new pn(16);return pn!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=0,r[12]=0,r[13]=0,r[14]=0),r[0]=1,r[5]=1,r[10]=1,r[15]=1,r}function Hb(r){var e=new pn(16);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e}function ho(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r}function Gb(r,e,t,n,i,a,s,o,A,l,c,u,h,d,f,g){var p=new pn(16);return p[0]=r,p[1]=e,p[2]=t,p[3]=n,p[4]=i,p[5]=a,p[6]=s,p[7]=o,p[8]=A,p[9]=l,p[10]=c,p[11]=u,p[12]=h,p[13]=d,p[14]=f,p[15]=g,p}function Pf(r,e,t,n,i,a,s,o,A,l,c,u,h,d,f,g,p){return r[0]=e,r[1]=t,r[2]=n,r[3]=i,r[4]=a,r[5]=s,r[6]=o,r[7]=A,r[8]=l,r[9]=c,r[10]=u,r[11]=h,r[12]=d,r[13]=f,r[14]=g,r[15]=p,r}function Ta(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function Kb(r,e){if(r===e){var t=e[1],n=e[2],i=e[3],a=e[6],s=e[7],o=e[11];r[1]=e[4],r[2]=e[8],r[3]=e[12],r[4]=t,r[6]=e[9],r[7]=e[13],r[8]=n,r[9]=a,r[11]=e[14],r[12]=i,r[13]=s,r[14]=o}else r[0]=e[0],r[1]=e[4],r[2]=e[8],r[3]=e[12],r[4]=e[1],r[5]=e[5],r[6]=e[9],r[7]=e[13],r[8]=e[2],r[9]=e[6],r[10]=e[10],r[11]=e[14],r[12]=e[3],r[13]=e[7],r[14]=e[11],r[15]=e[15];return r}function ki(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],s=e[4],o=e[5],A=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11],f=e[12],g=e[13],p=e[14],v=e[15],y=t*o-n*s,m=t*A-i*s,B=t*l-a*s,C=n*A-i*o,S=n*l-a*o,F=i*l-a*A,T=c*g-u*f,O=c*p-h*f,I=c*v-d*f,k=u*p-h*g,N=u*v-d*g,U=h*v-d*p,D=y*U-m*N+B*k+C*I-S*O+F*T;return D?(D=1/D,r[0]=(o*U-A*N+l*k)*D,r[1]=(i*N-n*U-a*k)*D,r[2]=(g*F-p*S+v*C)*D,r[3]=(h*S-u*F-d*C)*D,r[4]=(A*I-s*U-l*O)*D,r[5]=(t*U-i*I+a*O)*D,r[6]=(p*B-f*F-v*m)*D,r[7]=(c*F-h*B+d*m)*D,r[8]=(s*N-o*I+l*T)*D,r[9]=(n*I-t*N-a*T)*D,r[10]=(f*S-g*B+v*y)*D,r[11]=(u*B-c*S-d*y)*D,r[12]=(o*O-s*k-A*T)*D,r[13]=(t*k-n*O+i*T)*D,r[14]=(g*m-f*C-p*y)*D,r[15]=(c*C-u*m+h*y)*D,r):null}function MP(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],s=e[4],o=e[5],A=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11],f=e[12],g=e[13],p=e[14],v=e[15],y=t*o-n*s,m=t*A-i*s,B=t*l-a*s,C=n*A-i*o,S=n*l-a*o,F=i*l-a*A,T=c*g-u*f,O=c*p-h*f,I=c*v-d*f,k=u*p-h*g,N=u*v-d*g,U=h*v-d*p;return r[0]=o*U-A*N+l*k,r[1]=i*N-n*U-a*k,r[2]=g*F-p*S+v*C,r[3]=h*S-u*F-d*C,r[4]=A*I-s*U-l*O,r[5]=t*U-i*I+a*O,r[6]=p*B-f*F-v*m,r[7]=c*F-h*B+d*m,r[8]=s*N-o*I+l*T,r[9]=n*I-t*N-a*T,r[10]=f*S-g*B+v*y,r[11]=u*B-c*S-d*y,r[12]=o*O-s*k-A*T,r[13]=t*k-n*O+i*T,r[14]=g*m-f*C-p*y,r[15]=c*C-u*m+h*y,r}function zb(r){var e=r[0],t=r[1],n=r[2],i=r[3],a=r[4],s=r[5],o=r[6],A=r[7],l=r[8],c=r[9],u=r[10],h=r[11],d=r[12],f=r[13],g=r[14],p=r[15],v=e*s-t*a,y=e*o-n*a,m=t*o-n*s,B=l*f-c*d,C=l*g-u*d,S=c*g-u*f,F=e*S-t*C+n*B,T=a*S-s*C+o*B,O=l*m-c*y+u*v,I=d*m-f*y+g*v;return A*F-i*T+p*O-h*I}function Xn(r,e,t){var n=e[0],i=e[1],a=e[2],s=e[3],o=e[4],A=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],f=e[11],g=e[12],p=e[13],v=e[14],y=e[15],m=t[0],B=t[1],C=t[2],S=t[3];return r[0]=m*n+B*o+C*u+S*g,r[1]=m*i+B*A+C*h+S*p,r[2]=m*a+B*l+C*d+S*v,r[3]=m*s+B*c+C*f+S*y,m=t[4],B=t[5],C=t[6],S=t[7],r[4]=m*n+B*o+C*u+S*g,r[5]=m*i+B*A+C*h+S*p,r[6]=m*a+B*l+C*d+S*v,r[7]=m*s+B*c+C*f+S*y,m=t[8],B=t[9],C=t[10],S=t[11],r[8]=m*n+B*o+C*u+S*g,r[9]=m*i+B*A+C*h+S*p,r[10]=m*a+B*l+C*d+S*v,r[11]=m*s+B*c+C*f+S*y,m=t[12],B=t[13],C=t[14],S=t[15],r[12]=m*n+B*o+C*u+S*g,r[13]=m*i+B*A+C*h+S*p,r[14]=m*a+B*l+C*d+S*v,r[15]=m*s+B*c+C*f+S*y,r}function fo(r,e,t){var n=t[0],i=t[1],a=t[2],s,o,A,l,c,u,h,d,f,g,p,v;return e===r?(r[12]=e[0]*n+e[4]*i+e[8]*a+e[12],r[13]=e[1]*n+e[5]*i+e[9]*a+e[13],r[14]=e[2]*n+e[6]*i+e[10]*a+e[14],r[15]=e[3]*n+e[7]*i+e[11]*a+e[15]):(s=e[0],o=e[1],A=e[2],l=e[3],c=e[4],u=e[5],h=e[6],d=e[7],f=e[8],g=e[9],p=e[10],v=e[11],r[0]=s,r[1]=o,r[2]=A,r[3]=l,r[4]=c,r[5]=u,r[6]=h,r[7]=d,r[8]=f,r[9]=g,r[10]=p,r[11]=v,r[12]=s*n+c*i+f*a+e[12],r[13]=o*n+u*i+g*a+e[13],r[14]=A*n+h*i+p*a+e[14],r[15]=l*n+d*i+v*a+e[15]),r}function Vb(r,e,t){var n=t[0],i=t[1],a=t[2];return r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=e[3]*n,r[4]=e[4]*i,r[5]=e[5]*i,r[6]=e[6]*i,r[7]=e[7]*i,r[8]=e[8]*a,r[9]=e[9]*a,r[10]=e[10]*a,r[11]=e[11]*a,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r}function OP(r,e,t,n){var i=n[0],a=n[1],s=n[2],o=Math.sqrt(i*i+a*a+s*s),A,l,c,u,h,d,f,g,p,v,y,m,B,C,S,F,T,O,I,k,N,U,D,G;return o<Ut?null:(o=1/o,i*=o,a*=o,s*=o,A=Math.sin(t),l=Math.cos(t),c=1-l,u=e[0],h=e[1],d=e[2],f=e[3],g=e[4],p=e[5],v=e[6],y=e[7],m=e[8],B=e[9],C=e[10],S=e[11],F=i*i*c+l,T=a*i*c+s*A,O=s*i*c-a*A,I=i*a*c-s*A,k=a*a*c+l,N=s*a*c+i*A,U=i*s*c+a*A,D=a*s*c-i*A,G=s*s*c+l,r[0]=u*F+g*T+m*O,r[1]=h*F+p*T+B*O,r[2]=d*F+v*T+C*O,r[3]=f*F+y*T+S*O,r[4]=u*I+g*k+m*N,r[5]=h*I+p*k+B*N,r[6]=d*I+v*k+C*N,r[7]=f*I+y*k+S*N,r[8]=u*U+g*D+m*G,r[9]=h*U+p*D+B*G,r[10]=d*U+v*D+C*G,r[11]=f*U+y*D+S*G,e!==r&&(r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r)}function jb(r,e,t){var n=Math.sin(t),i=Math.cos(t),a=e[4],s=e[5],o=e[6],A=e[7],l=e[8],c=e[9],u=e[10],h=e[11];return e!==r&&(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[4]=a*i+l*n,r[5]=s*i+c*n,r[6]=o*i+u*n,r[7]=A*i+h*n,r[8]=l*i-a*n,r[9]=c*i-s*n,r[10]=u*i-o*n,r[11]=h*i-A*n,r}function Wb(r,e,t){var n=Math.sin(t),i=Math.cos(t),a=e[0],s=e[1],o=e[2],A=e[3],l=e[8],c=e[9],u=e[10],h=e[11];return e!==r&&(r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[0]=a*i-l*n,r[1]=s*i-c*n,r[2]=o*i-u*n,r[3]=A*i-h*n,r[8]=a*n+l*i,r[9]=s*n+c*i,r[10]=o*n+u*i,r[11]=A*n+h*i,r}function IP(r,e,t){var n=Math.sin(t),i=Math.cos(t),a=e[0],s=e[1],o=e[2],A=e[3],l=e[4],c=e[5],u=e[6],h=e[7];return e!==r&&(r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[0]=a*i+l*n,r[1]=s*i+c*n,r[2]=o*i+u*n,r[3]=A*i+h*n,r[4]=l*i-a*n,r[5]=c*i-s*n,r[6]=u*i-o*n,r[7]=h*i-A*n,r}function Ma(r,e){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=e[0],r[13]=e[1],r[14]=e[2],r[15]=1,r}function vs(r,e){return r[0]=e[0],r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=e[1],r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=e[2],r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function qb(r,e,t){var n=t[0],i=t[1],a=t[2],s=Math.sqrt(n*n+i*i+a*a),o,A,l;return s<Ut?null:(s=1/s,n*=s,i*=s,a*=s,o=Math.sin(e),A=Math.cos(e),l=1-A,r[0]=n*n*l+A,r[1]=i*n*l+a*o,r[2]=a*n*l-i*o,r[3]=0,r[4]=n*i*l-a*o,r[5]=i*i*l+A,r[6]=a*i*l+n*o,r[7]=0,r[8]=n*a*l+i*o,r[9]=i*a*l-n*o,r[10]=a*a*l+A,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r)}function $b(r,e){var t=Math.sin(e),n=Math.cos(e);return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=n,r[6]=t,r[7]=0,r[8]=0,r[9]=-t,r[10]=n,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function Yb(r,e){var t=Math.sin(e),n=Math.cos(e);return r[0]=n,r[1]=0,r[2]=-t,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=t,r[9]=0,r[10]=n,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function Rf(r,e){var t=Math.sin(e),n=Math.cos(e);return r[0]=n,r[1]=t,r[2]=0,r[3]=0,r[4]=-t,r[5]=n,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function Xb(r,e,t){var n=e[0],i=e[1],a=e[2],s=e[3],o=n+n,A=i+i,l=a+a,c=n*o,u=n*A,h=n*l,d=i*A,f=i*l,g=a*l,p=s*o,v=s*A,y=s*l;return r[0]=1-(d+g),r[1]=u+y,r[2]=h-v,r[3]=0,r[4]=u-y,r[5]=1-(c+g),r[6]=f+p,r[7]=0,r[8]=h+v,r[9]=f-p,r[10]=1-(c+d),r[11]=0,r[12]=t[0],r[13]=t[1],r[14]=t[2],r[15]=1,r}function _P(r,e){var t=new pn(3),n=-e[0],i=-e[1],a=-e[2],s=e[3],o=e[4],A=e[5],l=e[6],c=e[7],u=n*n+i*i+a*a+s*s;return u>0?(t[0]=(o*s+c*n+A*a-l*i)*2/u,t[1]=(A*s+c*i+l*n-o*a)*2/u,t[2]=(l*s+c*a+o*i-A*n)*2/u):(t[0]=(o*s+c*n+A*a-l*i)*2,t[1]=(A*s+c*i+l*n-o*a)*2,t[2]=(l*s+c*a+o*i-A*n)*2),Xb(r,e,t),r}function ac(r,e){return r[0]=e[12],r[1]=e[13],r[2]=e[14],r}function go(r,e){var t=e[0],n=e[1],i=e[2],a=e[4],s=e[5],o=e[6],A=e[8],l=e[9],c=e[10];return r[0]=Math.sqrt(t*t+n*n+i*i),r[1]=Math.sqrt(a*a+s*s+o*o),r[2]=Math.sqrt(A*A+l*l+c*c),r}function sc(r,e){var t=new pn(3);go(t,e);var n=1/t[0],i=1/t[1],a=1/t[2],s=e[0]*n,o=e[1]*i,A=e[2]*a,l=e[4]*n,c=e[5]*i,u=e[6]*a,h=e[8]*n,d=e[9]*i,f=e[10]*a,g=s+c+f,p=0;return g>0?(p=Math.sqrt(g+1)*2,r[3]=.25*p,r[0]=(u-d)/p,r[1]=(h-A)/p,r[2]=(o-l)/p):s>c&&s>f?(p=Math.sqrt(1+s-c-f)*2,r[3]=(u-d)/p,r[0]=.25*p,r[1]=(o+l)/p,r[2]=(h+A)/p):c>f?(p=Math.sqrt(1+c-s-f)*2,r[3]=(h-A)/p,r[0]=(o+l)/p,r[1]=.25*p,r[2]=(u+d)/p):(p=Math.sqrt(1+f-s-c)*2,r[3]=(o-l)/p,r[0]=(h+A)/p,r[1]=(u+d)/p,r[2]=.25*p),r}function kP(r,e,t,n){e[0]=n[12],e[1]=n[13],e[2]=n[14];var i=n[0],a=n[1],s=n[2],o=n[4],A=n[5],l=n[6],c=n[8],u=n[9],h=n[10];t[0]=Math.sqrt(i*i+a*a+s*s),t[1]=Math.sqrt(o*o+A*A+l*l),t[2]=Math.sqrt(c*c+u*u+h*h);var d=1/t[0],f=1/t[1],g=1/t[2],p=i*d,v=a*f,y=s*g,m=o*d,B=A*f,C=l*g,S=c*d,F=u*f,T=h*g,O=p+B+T,I=0;return O>0?(I=Math.sqrt(O+1)*2,r[3]=.25*I,r[0]=(C-F)/I,r[1]=(S-y)/I,r[2]=(v-m)/I):p>B&&p>T?(I=Math.sqrt(1+p-B-T)*2,r[3]=(C-F)/I,r[0]=.25*I,r[1]=(v+m)/I,r[2]=(S+y)/I):B>T?(I=Math.sqrt(1+B-p-T)*2,r[3]=(S-y)/I,r[0]=(v+m)/I,r[1]=.25*I,r[2]=(C+F)/I):(I=Math.sqrt(1+T-p-B)*2,r[3]=(v-m)/I,r[0]=(S+y)/I,r[1]=(C+F)/I,r[2]=.25*I),r}function NP(r,e,t,n){var i=e[0],a=e[1],s=e[2],o=e[3],A=i+i,l=a+a,c=s+s,u=i*A,h=i*l,d=i*c,f=a*l,g=a*c,p=s*c,v=o*A,y=o*l,m=o*c,B=n[0],C=n[1],S=n[2];return r[0]=(1-(f+p))*B,r[1]=(h+m)*B,r[2]=(d-y)*B,r[3]=0,r[4]=(h-m)*C,r[5]=(1-(u+p))*C,r[6]=(g+v)*C,r[7]=0,r[8]=(d+y)*S,r[9]=(g-v)*S,r[10]=(1-(u+f))*S,r[11]=0,r[12]=t[0],r[13]=t[1],r[14]=t[2],r[15]=1,r}function gA(r,e,t,n,i){var a=e[0],s=e[1],o=e[2],A=e[3],l=a+a,c=s+s,u=o+o,h=a*l,d=a*c,f=a*u,g=s*c,p=s*u,v=o*u,y=A*l,m=A*c,B=A*u,C=n[0],S=n[1],F=n[2],T=i[0],O=i[1],I=i[2],k=(1-(g+v))*C,N=(d+B)*C,U=(f-m)*C,D=(d-B)*S,G=(1-(h+v))*S,Z=(p+y)*S,q=(f+m)*F,j=(p-y)*F,te=(1-(h+g))*F;return r[0]=k,r[1]=N,r[2]=U,r[3]=0,r[4]=D,r[5]=G,r[6]=Z,r[7]=0,r[8]=q,r[9]=j,r[10]=te,r[11]=0,r[12]=t[0]+T-(k*T+D*O+q*I),r[13]=t[1]+O-(N*T+G*O+j*I),r[14]=t[2]+I-(U*T+Z*O+te*I),r[15]=1,r}function Df(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],s=t+t,o=n+n,A=i+i,l=t*s,c=n*s,u=n*o,h=i*s,d=i*o,f=i*A,g=a*s,p=a*o,v=a*A;return r[0]=1-u-f,r[1]=c+v,r[2]=h-p,r[3]=0,r[4]=c-v,r[5]=1-l-f,r[6]=d+g,r[7]=0,r[8]=h+p,r[9]=d-g,r[10]=1-l-u,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function LP(r,e,t,n,i,a,s){var o=1/(t-e),A=1/(i-n),l=1/(a-s);return r[0]=a*2*o,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a*2*A,r[6]=0,r[7]=0,r[8]=(t+e)*o,r[9]=(i+n)*A,r[10]=(s+a)*l,r[11]=-1,r[12]=0,r[13]=0,r[14]=s*a*2*l,r[15]=0,r}function Zb(r,e,t,n,i){var a=1/Math.tan(e/2);if(r[0]=a/t,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,i!=null&&i!==1/0){var s=1/(n-i);r[10]=(i+n)*s,r[14]=2*i*n*s}else r[10]=-1,r[14]=-2*n;return r}var QP=Zb;function UP(r,e,t,n,i){var a=1/Math.tan(e/2);if(r[0]=a/t,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,i!=null&&i!==1/0){var s=1/(n-i);r[10]=i*s,r[14]=i*n*s}else r[10]=-1,r[14]=-n;return r}function PP(r,e,t,n){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),s=Math.tan(e.leftDegrees*Math.PI/180),o=Math.tan(e.rightDegrees*Math.PI/180),A=2/(s+o),l=2/(i+a);return r[0]=A,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=l,r[6]=0,r[7]=0,r[8]=-((s-o)*A*.5),r[9]=(i-a)*l*.5,r[10]=n/(t-n),r[11]=-1,r[12]=0,r[13]=0,r[14]=n*t/(t-n),r[15]=0,r}function Jb(r,e,t,n,i,a,s){var o=1/(e-t),A=1/(n-i),l=1/(a-s);return r[0]=-2*o,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*A,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*l,r[11]=0,r[12]=(e+t)*o,r[13]=(i+n)*A,r[14]=(s+a)*l,r[15]=1,r}var eE=Jb;function tE(r,e,t,n,i,a,s){var o=1/(e-t),A=1/(n-i),l=1/(a-s);return r[0]=-2*o,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*A,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=l,r[11]=0,r[12]=(e+t)*o,r[13]=(i+n)*A,r[14]=a*l,r[15]=1,r}function nE(r,e,t,n){var i,a,s,o,A,l,c,u,h,d,f=e[0],g=e[1],p=e[2],v=n[0],y=n[1],m=n[2],B=t[0],C=t[1],S=t[2];return Math.abs(f-B)<Ut&&Math.abs(g-C)<Ut&&Math.abs(p-S)<Ut?Ta(r):(c=f-B,u=g-C,h=p-S,d=1/Math.sqrt(c*c+u*u+h*h),c*=d,u*=d,h*=d,i=y*h-m*u,a=m*c-v*h,s=v*u-y*c,d=Math.sqrt(i*i+a*a+s*s),d?(d=1/d,i*=d,a*=d,s*=d):(i=0,a=0,s=0),o=u*s-h*a,A=h*i-c*s,l=c*a-u*i,d=Math.sqrt(o*o+A*A+l*l),d?(d=1/d,o*=d,A*=d,l*=d):(o=0,A=0,l=0),r[0]=i,r[1]=o,r[2]=c,r[3]=0,r[4]=a,r[5]=A,r[6]=u,r[7]=0,r[8]=s,r[9]=l,r[10]=h,r[11]=0,r[12]=-(i*f+a*g+s*p),r[13]=-(o*f+A*g+l*p),r[14]=-(c*f+u*g+h*p),r[15]=1,r)}function RP(r,e,t,n){var i=e[0],a=e[1],s=e[2],o=n[0],A=n[1],l=n[2],c=i-t[0],u=a-t[1],h=s-t[2],d=c*c+u*u+h*h;d>0&&(d=1/Math.sqrt(d),c*=d,u*=d,h*=d);var f=A*h-l*u,g=l*c-o*h,p=o*u-A*c;return d=f*f+g*g+p*p,d>0&&(d=1/Math.sqrt(d),f*=d,g*=d,p*=d),r[0]=f,r[1]=g,r[2]=p,r[3]=0,r[4]=u*p-h*g,r[5]=h*f-c*p,r[6]=c*g-u*f,r[7]=0,r[8]=c,r[9]=u,r[10]=h,r[11]=0,r[12]=i,r[13]=a,r[14]=s,r[15]=1,r}function DP(r){return"mat4("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+", "+r[8]+", "+r[9]+", "+r[10]+", "+r[11]+", "+r[12]+", "+r[13]+", "+r[14]+", "+r[15]+")"}function HP(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]+r[3]*r[3]+r[4]*r[4]+r[5]*r[5]+r[6]*r[6]+r[7]*r[7]+r[8]*r[8]+r[9]*r[9]+r[10]*r[10]+r[11]*r[11]+r[12]*r[12]+r[13]*r[13]+r[14]*r[14]+r[15]*r[15])}function GP(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r[9]=e[9]+t[9],r[10]=e[10]+t[10],r[11]=e[11]+t[11],r[12]=e[12]+t[12],r[13]=e[13]+t[13],r[14]=e[14]+t[14],r[15]=e[15]+t[15],r}function rE(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r[9]=e[9]-t[9],r[10]=e[10]-t[10],r[11]=e[11]-t[11],r[12]=e[12]-t[12],r[13]=e[13]-t[13],r[14]=e[14]-t[14],r[15]=e[15]-t[15],r}function KP(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r[9]=e[9]*t,r[10]=e[10]*t,r[11]=e[11]*t,r[12]=e[12]*t,r[13]=e[13]*t,r[14]=e[14]*t,r[15]=e[15]*t,r}function zP(r,e,t,n){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r[2]=e[2]+t[2]*n,r[3]=e[3]+t[3]*n,r[4]=e[4]+t[4]*n,r[5]=e[5]+t[5]*n,r[6]=e[6]+t[6]*n,r[7]=e[7]+t[7]*n,r[8]=e[8]+t[8]*n,r[9]=e[9]+t[9]*n,r[10]=e[10]+t[10]*n,r[11]=e[11]+t[11]*n,r[12]=e[12]+t[12]*n,r[13]=e[13]+t[13]*n,r[14]=e[14]+t[14]*n,r[15]=e[15]+t[15]*n,r}function Hf(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]&&r[3]===e[3]&&r[4]===e[4]&&r[5]===e[5]&&r[6]===e[6]&&r[7]===e[7]&&r[8]===e[8]&&r[9]===e[9]&&r[10]===e[10]&&r[11]===e[11]&&r[12]===e[12]&&r[13]===e[13]&&r[14]===e[14]&&r[15]===e[15]}function VP(r,e){var t=r[0],n=r[1],i=r[2],a=r[3],s=r[4],o=r[5],A=r[6],l=r[7],c=r[8],u=r[9],h=r[10],d=r[11],f=r[12],g=r[13],p=r[14],v=r[15],y=e[0],m=e[1],B=e[2],C=e[3],S=e[4],F=e[5],T=e[6],O=e[7],I=e[8],k=e[9],N=e[10],U=e[11],D=e[12],G=e[13],Z=e[14],q=e[15];return Math.abs(t-y)<=Ut*Math.max(1,Math.abs(t),Math.abs(y))&&Math.abs(n-m)<=Ut*Math.max(1,Math.abs(n),Math.abs(m))&&Math.abs(i-B)<=Ut*Math.max(1,Math.abs(i),Math.abs(B))&&Math.abs(a-C)<=Ut*Math.max(1,Math.abs(a),Math.abs(C))&&Math.abs(s-S)<=Ut*Math.max(1,Math.abs(s),Math.abs(S))&&Math.abs(o-F)<=Ut*Math.max(1,Math.abs(o),Math.abs(F))&&Math.abs(A-T)<=Ut*Math.max(1,Math.abs(A),Math.abs(T))&&Math.abs(l-O)<=Ut*Math.max(1,Math.abs(l),Math.abs(O))&&Math.abs(c-I)<=Ut*Math.max(1,Math.abs(c),Math.abs(I))&&Math.abs(u-k)<=Ut*Math.max(1,Math.abs(u),Math.abs(k))&&Math.abs(h-N)<=Ut*Math.max(1,Math.abs(h),Math.abs(N))&&Math.abs(d-U)<=Ut*Math.max(1,Math.abs(d),Math.abs(U))&&Math.abs(f-D)<=Ut*Math.max(1,Math.abs(f),Math.abs(D))&&Math.abs(g-G)<=Ut*Math.max(1,Math.abs(g),Math.abs(G))&&Math.abs(p-Z)<=Ut*Math.max(1,Math.abs(p),Math.abs(Z))&&Math.abs(v-q)<=Ut*Math.max(1,Math.abs(v),Math.abs(q))}var iE=Xn,jP=rE;const WP=Object.freeze(Object.defineProperty({__proto__:null,add:GP,adjoint:MP,clone:Hb,copy:ho,create:Ct,decompose:kP,determinant:zb,equals:VP,exactEquals:Hf,frob:HP,fromQuat:Df,fromQuat2:_P,fromRotation:qb,fromRotationTranslation:Xb,fromRotationTranslationScale:NP,fromRotationTranslationScaleOrigin:gA,fromScaling:vs,fromTranslation:Ma,fromValues:Gb,fromXRotation:$b,fromYRotation:Yb,fromZRotation:Rf,frustum:LP,getRotation:sc,getScaling:go,getTranslation:ac,identity:Ta,invert:ki,lookAt:nE,mul:iE,multiply:Xn,multiplyScalar:KP,multiplyScalarAndAdd:zP,ortho:eE,orthoNO:Jb,orthoZO:tE,perspective:QP,perspectiveFromFieldOfView:PP,perspectiveNO:Zb,perspectiveZO:UP,rotate:OP,rotateX:jb,rotateY:Wb,rotateZ:IP,scale:Vb,set:Pf,str:DP,sub:jP,subtract:rE,targetTo:RP,translate:fo,transpose:Kb},Symbol.toStringTag,{value:"Module"}));function Je(){var r=new pn(3);return pn!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r}function ia(r){var e=new pn(3);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e}function aa(r){var e=r[0],t=r[1],n=r[2];return Math.sqrt(e*e+t*t+n*n)}function St(r,e,t){var n=new pn(3);return n[0]=r,n[1]=e,n[2]=t,n}function Ni(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r}function Zn(r,e,t,n){return r[0]=e,r[1]=t,r[2]=n,r}function Oa(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r}function Gf(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r}function qP(r,e,t){return r[0]=e[0]*t[0],r[1]=e[1]*t[1],r[2]=e[2]*t[2],r}function $P(r,e,t){return r[0]=Math.min(e[0],t[0]),r[1]=Math.min(e[1],t[1]),r[2]=Math.min(e[2],t[2]),r}function YP(r,e,t){return r[0]=Math.max(e[0],t[0]),r[1]=Math.max(e[1],t[1]),r[2]=Math.max(e[2],t[2]),r}function oc(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r}function XP(r,e){var t=e[0]-r[0],n=e[1]-r[1],i=e[2]-r[2];return Math.sqrt(t*t+n*n+i*i)}function ys(r,e){var t=e[0],n=e[1],i=e[2],a=t*t+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),r[0]=e[0]*a,r[1]=e[1]*a,r[2]=e[2]*a,r}function Li(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]}function Ac(r,e,t){var n=e[0],i=e[1],a=e[2],s=t[0],o=t[1],A=t[2];return r[0]=i*A-a*o,r[1]=a*s-n*A,r[2]=n*o-i*s,r}function Kf(r,e,t,n){var i=e[0],a=e[1],s=e[2];return r[0]=i+n*(t[0]-i),r[1]=a+n*(t[1]-a),r[2]=s+n*(t[2]-s),r}function Jn(r,e,t){var n=e[0],i=e[1],a=e[2],s=t[3]*n+t[7]*i+t[11]*a+t[15];return s=s||1,r[0]=(t[0]*n+t[4]*i+t[8]*a+t[12])/s,r[1]=(t[1]*n+t[5]*i+t[9]*a+t[13])/s,r[2]=(t[2]*n+t[6]*i+t[10]*a+t[14])/s,r}function ZP(r,e,t){var n=e[0],i=e[1],a=e[2];return r[0]=n*t[0]+i*t[3]+a*t[6],r[1]=n*t[1]+i*t[4]+a*t[7],r[2]=n*t[2]+i*t[5]+a*t[8],r}function JP(r,e,t){var n=t[0],i=t[1],a=t[2],s=t[3],o=e[0],A=e[1],l=e[2],c=i*l-a*A,u=a*o-n*l,h=n*A-i*o;return c=c+c,u=u+u,h=h+h,r[0]=o+s*c+i*h-a*u,r[1]=A+s*u+a*c-n*h,r[2]=l+s*h+n*u-i*c,r}function pA(r,e){var t=r[0],n=r[1],i=r[2],a=e[0],s=e[1],o=e[2];return Math.abs(t-a)<=Ut*Math.max(1,Math.abs(t),Math.abs(a))&&Math.abs(n-s)<=Ut*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-o)<=Ut*Math.max(1,Math.abs(i),Math.abs(o))}var aE=Gf,sE=XP,oE=aa;(function(){var r=Je();return function(e,t,n,i,a,s){var o,A;for(t||(t=3),n||(n=0),i?A=Math.min(i*t+n,e.length):A=e.length,o=n;o<A;o+=t)r[0]=e[o],r[1]=e[o+1],r[2]=e[o+2],a(r,r,s),e[o]=r[0],e[o+1]=r[1],e[o+2]=r[2];return e}})();function Qi(){var r=new pn(4);return pn!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0,r[3]=0),r}function vA(r,e,t,n){var i=new pn(4);return i[0]=r,i[1]=e,i[2]=t,i[3]=n,i}function eR(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r}function tR(r,e,t,n,i){return r[0]=e,r[1]=t,r[2]=n,r[3]=i,r}function nR(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],s=t*t+n*n+i*i+a*a;return s>0&&(s=1/Math.sqrt(s)),r[0]=t*s,r[1]=n*s,r[2]=i*s,r[3]=a*s,r}function sa(r,e,t){var n=e[0],i=e[1],a=e[2],s=e[3];return r[0]=t[0]*n+t[4]*i+t[8]*a+t[12]*s,r[1]=t[1]*n+t[5]*i+t[9]*a+t[13]*s,r[2]=t[2]*n+t[6]*i+t[10]*a+t[14]*s,r[3]=t[3]*n+t[7]*i+t[11]*a+t[15]*s,r}(function(){var r=Qi();return function(e,t,n,i,a,s){var o,A;for(t||(t=4),n||(n=0),i?A=Math.min(i*t+n,e.length):A=e.length,o=n;o<A;o+=t)r[0]=e[o],r[1]=e[o+1],r[2]=e[o+2],r[3]=e[o+3],a(r,r,s),e[o]=r[0],e[o+1]=r[1],e[o+2]=r[2],e[o+3]=r[3];return e}})();function vn(){var r=new pn(4);return pn!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r[3]=1,r}function Ia(r,e,t){t=t*.5;var n=Math.sin(t);return r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=Math.cos(t),r}function _a(r,e,t){var n=e[0],i=e[1],a=e[2],s=e[3],o=t[0],A=t[1],l=t[2],c=t[3];return r[0]=n*c+s*o+i*l-a*A,r[1]=i*c+s*A+a*o-n*l,r[2]=a*c+s*l+n*A-i*o,r[3]=s*c-n*o-i*A-a*l,r}function zf(r,e,t,n){var i=e[0],a=e[1],s=e[2],o=e[3],A=t[0],l=t[1],c=t[2],u=t[3],h,d,f,g,p;return d=i*A+a*l+s*c+o*u,d<0&&(d=-d,A=-A,l=-l,c=-c,u=-u),1-d>Ut?(h=Math.acos(d),f=Math.sin(h),g=Math.sin((1-n)*h)/f,p=Math.sin(n*h)/f):(g=1-n,p=n),r[0]=g*i+p*A,r[1]=g*a+p*l,r[2]=g*s+p*c,r[3]=g*o+p*u,r}function Vf(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],s=t*t+n*n+i*i+a*a,o=s?1/s:0;return r[0]=-t*o,r[1]=-n*o,r[2]=-i*o,r[3]=a*o,r}function rR(r,e){var t=e[0]+e[4]+e[8],n;if(t>0)n=Math.sqrt(t+1),r[3]=.5*n,n=.5/n,r[0]=(e[5]-e[7])*n,r[1]=(e[6]-e[2])*n,r[2]=(e[1]-e[3])*n;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[i*3+i]&&(i=2);var a=(i+1)%3,s=(i+2)%3;n=Math.sqrt(e[i*3+i]-e[a*3+a]-e[s*3+s]+1),r[i]=.5*n,n=.5/n,r[3]=(e[a*3+s]-e[s*3+a])*n,r[a]=(e[a*3+i]+e[i*3+a])*n,r[s]=(e[s*3+i]+e[i*3+s])*n}return r}function lc(r,e,t,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:SP,a=Math.PI/360;e*=a,n*=a,t*=a;var s=Math.sin(e),o=Math.cos(e),A=Math.sin(t),l=Math.cos(t),c=Math.sin(n),u=Math.cos(n);switch(i){case"xyz":r[0]=s*l*u+o*A*c,r[1]=o*A*u-s*l*c,r[2]=o*l*c+s*A*u,r[3]=o*l*u-s*A*c;break;case"xzy":r[0]=s*l*u-o*A*c,r[1]=o*A*u-s*l*c,r[2]=o*l*c+s*A*u,r[3]=o*l*u+s*A*c;break;case"yxz":r[0]=s*l*u+o*A*c,r[1]=o*A*u-s*l*c,r[2]=o*l*c-s*A*u,r[3]=o*l*u+s*A*c;break;case"yzx":r[0]=s*l*u+o*A*c,r[1]=o*A*u+s*l*c,r[2]=o*l*c-s*A*u,r[3]=o*l*u-s*A*c;break;case"zxy":r[0]=s*l*u-o*A*c,r[1]=o*A*u+s*l*c,r[2]=o*l*c+s*A*u,r[3]=o*l*u-s*A*c;break;case"zyx":r[0]=s*l*u-o*A*c,r[1]=o*A*u+s*l*c,r[2]=o*l*c-s*A*u,r[3]=o*l*u+s*A*c;break;default:throw new Error("Unknown angle order "+i)}return r}var iR=vA,cc=eR,AE=tR,lE=_a,uc=nR;(function(){var r=Je(),e=St(1,0,0),t=St(0,1,0);return function(n,i,a){var s=Li(i,a);return s<-.999999?(Ac(r,e,i),oE(r)<1e-6&&Ac(r,t,i),ys(r,r),Ia(n,r,Math.PI),n):s>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Ac(r,i,a),n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=1+s,uc(n,n))}})(),(function(){var r=vn(),e=vn();return function(t,n,i,a,s,o){return zf(r,n,s,o),zf(e,i,a,o),zf(t,r,e,2*o*(1-o)),t}})(),(function(){var r=Db();return function(e,t,n,i){return r[0]=n[0],r[3]=n[1],r[6]=n[2],r[1]=i[0],r[4]=i[1],r[7]=i[2],r[2]=-t[0],r[5]=-t[1],r[8]=-t[2],uc(e,rR(e,r))}})();function jf(){var r=new pn(2);return pn!=Float32Array&&(r[0]=0,r[1]=0),r}function aR(r,e){return r[0]=e[0],r[1]=e[1],r}function sR(r,e,t){return r[0]=e,r[1]=t,r}function oR(r,e){var t=e[0],n=e[1],i=t*t+n*n;return i>0&&(i=1/Math.sqrt(i)),r[0]=e[0]*i,r[1]=e[1]*i,r}function AR(r,e){return r[0]*e[0]+r[1]*e[1]}function lR(r,e){return r[0]===e[0]&&r[1]===e[1]}(function(){var r=jf();return function(e,t,n,i,a,s){var o,A;for(t||(t=2),n||(n=0),i?A=Math.min(i*t+n,e.length):A=e.length,o=n;o<A;o+=t)r[0]=e[o],r[1]=e[o+1],a(r,r,s),e[o]=r[0],e[o+1]=r[1];return e}})();var yA=function(r){return r!==null&&typeof r!="function"&&isFinite(r.length)},cR=function(r,e){return yA(r)?r.indexOf(e)>-1:!1},uR=function(r,e){if(!yA(r))return r;for(var t=[],n=0;n<r.length;n++){var i=r[n];e(i,n)&&t.push(i)}return t},hR=function(r,e){return e===void 0&&(e=[]),uR(r,function(t){return!cR(e,t)})};function Te(r){return typeof r=="function"}function ke(r){return r==null}function mr(r){return Array.isArray(r)}const on=(function(r){var e=typeof r;return r!==null&&e==="object"||e==="function"});function cE(r,e){if(r){var t;if(mr(r))for(var n=0,i=r.length;n<i&&(t=e(r[n],n),t!==!1);n++);else if(on(r)){for(var a in r)if(r.hasOwnProperty(a)&&(t=e(r[a],a),t===!1))break}}}var Wf=function(r){return typeof r=="object"&&r!==null},dR={}.toString,uE=function(r,e){return dR.call(r)==="[object "+e+"]"},po=function(r){if(!Wf(r)||!uE(r,"Object"))return!1;if(Object.getPrototypeOf(r)===null)return!0;for(var e=r;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(r)===e},fR=function(r){if(!mr(r))return[];for(var e=[],t=0;t<r.length;t++)e=e.concat(r[t]);return e};function hc(r){if(!Array.isArray(r))return-1/0;var e=r.length;if(!e)return-1/0;for(var t=r[0],n=1;n<e;n++)t=Math.max(t,r[n]);return t}const dc=(function(r){if(mr(r))return r.reduce(function(e,t){return Math.min(e,t)},r[0])});var gR=function(r,e,t){if(!mr(r)&&!po(r))return r;var n=t;return cE(r,function(i,a){n=e(n,i,a)}),n};function ot(r){return typeof r=="string"}function pR(r,e){e===void 0&&(e=new Map);var t=[];if(Array.isArray(r))for(var n=0,i=r.length;n<i;n++){var a=r[n];e.has(a)||(t.push(a),e.set(a,!0))}return t}var vR=Object.prototype.hasOwnProperty;function fc(r,e){if(!e||!mr(r))return{};for(var t={},n=Te(e)?e:function(o){return o[e]},i,a=0;a<r.length;a++){var s=r[a];i=n(s),vR.call(t,i)?t[i].push(s):t[i]=[s]}return t}var Yt=function(r,e,t){return r<e?e:r>t?t:r};function Be(r){return typeof r=="number"}var yR=1e-5;function vo(r,e,t){return t===void 0&&(t=yR),r===e||Math.abs(r-e)<t}const mR=(function(r,e){if(mr(r)){for(var t,n=-1/0,i=0;i<r.length;i++){var a=r[i],s=Te(e)?e(a):a[e];s>n&&(t=a,n=s)}return t}}),wR=(function(r,e){if(mr(r)){for(var t,n=1/0,i=0;i<r.length;i++){var a=r[i],s=Te(e)?e(a):a[e];s<n&&(t=a,n=s)}return t}});var hE=function(r,e){return(r%e+e)%e};const dE=(function(r){return ke(r)?"":r.toString()});var BR=function(r){var e=dE(r);return e.charAt(0).toLowerCase()+e.substring(1)};function bR(r,e){return!r||!e?r:r.replace(/\\?\{([^{}]+)\}/g,function(t,n){return t.charAt(0)==="\\"?t.slice(1):e[n]===void 0?"":e[n]})}var gc=function(r){var e=dE(r);return e.charAt(0).toUpperCase()+e.substring(1)},ER={}.toString,xR=function(r){return ER.call(r).replace(/^\[object /,"").replace(/]$/,"")},mA=function(r){return uE(r,"Boolean")};function CR(r){return r instanceof Date}function SR(r){return r===null}var FR=Object.prototype,TR=function(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||FR;return r===t},Ge=function(r){return r===void 0};function MR(r){return r instanceof Element||r instanceof Document}function fE(r,e){for(var t in e)e.hasOwnProperty(t)&&t!=="constructor"&&e[t]!==void 0&&(r[t]=e[t])}function OR(r,e,t,n){return e&&fE(r,e),t&&fE(r,t),r}var ka=function(r){if(typeof r!="object"||r===null)return r;var e;if(mr(r)){e=[];for(var t=0,n=r.length;t<n;t++)typeof r[t]=="object"&&r[t]!=null?e[t]=ka(r[t]):e[t]=r[t]}else{e={};for(var i in r)typeof r[i]=="object"&&r[i]!=null?e[i]=ka(r[i]):e[i]=r[i]}return e};function wA(r,e,t){var n;return function(){var i=this,a=arguments,s=function(){n=null,r.apply(i,a)};clearTimeout(n),n=setTimeout(s,e)}}function IR(r){var e,t,n,i=r||1;function a(o,A){++e>i&&(n=t,s(1),++e),t[o]=A}function s(o){e=0,t=Object.create(null),o||(n=Object.create(null))}return s(),{clear:s,has:function(o){return t[o]!==void 0||n[o]!==void 0},get:function(o){var A=t[o];if(A!==void 0)return A;if((A=n[o])!==void 0)return a(o,A),A},set:function(o,A){t[o]!==void 0?t[o]=A:a(o,A)}}}var qf=new Map;function $f(r,e,t){t===void 0&&(t=128);var n=function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];var s=e?e.apply(this,i):i[0];qf.has(r)||qf.set(r,IR(t));var o=qf.get(r);if(o.has(s))return o.get(s);var A=r.apply(this,i);return o.set(s,A),A};return n}var _R=5;function kR(r,e){if(Object.hasOwn)return Object.hasOwn(r,e);if(r==null)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(r),e)}function gE(r,e,t,n){t=t||0,n=n||_R;for(var i in e)if(kR(e,i)){var a=e[i];a!==null&&po(a)?(po(r[i])||(r[i]={}),t<n?gE(r[i],a,t+1,n):r[i]=e[i]):mr(a)?(r[i]=[],r[i]=r[i].concat(a)):a!==void 0&&(r[i]=a)}}var Rn=function(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var n=0;n<e.length;n+=1)gE(r,e[n]);return r},NR=Object.prototype.hasOwnProperty;function Ui(r){if(ke(r))return!0;if(yA(r))return!r.length;var e=xR(r);if(e==="Map"||e==="Set")return!r.size;if(TR(r))return!Object.keys(r).length;for(var t in r)if(NR.call(r,t))return!1;return!0}var Xt=function(r,e){if(r===e)return!0;if(!r||!e||ot(r)||ot(e))return!1;if(yA(r)||yA(e)){if(r.length!==e.length)return!1;for(var t=!0,n=0;n<r.length&&(t=Xt(r[n],e[n]),!!t);n++);return t}if(Wf(r)||Wf(e)){var i=Object.keys(r),a=Object.keys(e);if(i.length!==a.length)return!1;for(var t=!0,n=0;n<i.length&&(t=Xt(r[i[n]],e[i[n]]),!!t);n++);return t}return!1};const Dn=(function(r,e,t){for(var n=0,i=ot(e)?e.split("."):e;r&&n<i.length;)r=r[i[n++]];return r===void 0||n<i.length?t:r}),BA=(function(r,e,t){var n=r,i=ot(e)?e.split("."):e;return i.forEach(function(a,s){s<i.length-1?(on(n[a])||(n[a]=Be(i[s+1])?[]:{}),n=n[a]):n[a]=t}),r});var LR=Object.prototype.hasOwnProperty;const ms=(function(r,e){if(r===null||!po(r))return{};var t={};return cE(e,function(n){LR.call(r,n)&&(t[n]=r[n])}),t}),Yf=(function(r,e){return gR(r,function(t,n,i){return e.includes(i)||(t[i]=n),t},{})}),pE=(function(r,e,t){var n,i,a,s,o=0;t||(t={});var A=function(){o=t.leading===!1?0:Date.now(),n=null,s=r.apply(i,a),n||(i=a=null)},l=function(){var c=Date.now();!o&&t.leading===!1&&(o=c);var u=e-(c-o);return i=this,a=arguments,u<=0||u>e?(n&&(clearTimeout(n),n=null),o=c,s=r.apply(i,a),n||(i=a=null)):!n&&t.trailing!==!1&&(n=setTimeout(A,u)),s};return l.cancel=function(){clearTimeout(n),o=0,n=i=a=null},l});var pc={};const QR=(function(r){return r=r||"g",pc[r]?pc[r]+=1:pc[r]=1,r+pc[r]}),Xf=(function(){}),Zf=(function(r){return r});var Jf=function(r,e){return Jf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},Jf(r,e)};function Xe(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Jf(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var se=function(){return se=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},se.apply(this,arguments)};function Pt(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}function et(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{l(n.next(c))}catch(u){s(u)}}function A(c){try{l(n.throw(c))}catch(u){s(u)}}function l(c){c.done?a(c.value):i(c.value).then(o,A)}l((n=n.apply(r,e||[])).next())})}function bA(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function H(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(s)throw s.error}}return a}function UR(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),i=0,e=0;e<t;e++)for(var a=arguments[e],s=0,o=a.length;s<o;s++,i++)n[i]=a[s];return n}function Ie(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return r.concat(a||Array.prototype.slice.call(e))}function eg(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)}typeof SuppressedError=="function"&&SuppressedError;var vE={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function PR(r,e,t){if(r[t].length>7){r[t].shift();for(var n=r[t],i=t;n.length;)e[t]="A",r.splice(i+=1,0,["C"].concat(n.splice(0,6)));r.splice(t,1)}}var EA={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function yE(r){return Array.isArray(r)&&r.every(function(e){var t=e[0].toLowerCase();return EA[t]===e.length-1&&"achlmqstvz".includes(t)})}function mE(r){return yE(r)&&r.every(function(e){var t=e[0];return t===t.toUpperCase()})}function wE(r){return mE(r)&&r.every(function(e){var t=e[0];return"ACLMQZ".includes(t)})}function BE(r){for(var e=r.pathValue[r.segmentStart],t=e.toLowerCase(),n=r.data;n.length>=EA[t]&&(t==="m"&&n.length>2?(r.segments.push([e].concat(n.splice(0,2))),t="l",e=e==="m"?"l":"L"):r.segments.push([e].concat(n.splice(0,EA[t]))),!!EA[t]););}function RR(r){var e=r.index,t=r.pathValue,n=t.charCodeAt(e);if(n===48){r.param=0,r.index+=1;return}if(n===49){r.param=1,r.index+=1;return}r.err='[path-util]: invalid Arc flag "'.concat(t[e],'", expecting 0 or 1 at index ').concat(e)}function DR(r){return r>=48&&r<=57||r===43||r===45||r===46}function yo(r){return r>=48&&r<=57}function HR(r){var e=r.max,t=r.pathValue,n=r.index,i=n,a=!1,s=!1,o=!1,A=!1,l;if(i>=e){r.err="[path-util]: Invalid path value at index ".concat(i,', "pathValue" is missing param');return}if(l=t.charCodeAt(i),(l===43||l===45)&&(i+=1,l=t.charCodeAt(i)),!yo(l)&&l!==46){r.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(t[i],'" is not a number');return}if(l!==46){if(a=l===48,i+=1,l=t.charCodeAt(i),a&&i<e&&l&&yo(l)){r.err="[path-util]: Invalid path value at index ".concat(n,', "').concat(t[n],'" illegal number');return}for(;i<e&&yo(t.charCodeAt(i));)i+=1,s=!0;l=t.charCodeAt(i)}if(l===46){for(A=!0,i+=1;yo(t.charCodeAt(i));)i+=1,o=!0;l=t.charCodeAt(i)}if(l===101||l===69){if(A&&!s&&!o){r.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(t[i],'" invalid float exponent');return}if(i+=1,l=t.charCodeAt(i),(l===43||l===45)&&(i+=1),i<e&&yo(t.charCodeAt(i)))for(;i<e&&yo(t.charCodeAt(i));)i+=1;else{r.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(t[i],'" invalid integer exponent');return}}r.index=i,r.param=+r.pathValue.slice(n,i)}function GR(r){var e=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];return r===10||r===13||r===8232||r===8233||r===32||r===9||r===11||r===12||r===160||r>=5760&&e.includes(r)}function vc(r){for(var e=r.pathValue,t=r.max;r.index<t&&GR(e.charCodeAt(r.index));)r.index+=1}function KR(r){switch(r|32){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}}function zR(r){return(r|32)===97}function VR(r){var e=r.max,t=r.pathValue,n=r.index,i=t.charCodeAt(n),a=EA[t[n].toLowerCase()];if(r.segmentStart=n,!KR(i)){r.err='[path-util]: Invalid path value "'.concat(t[n],'" is not a path command');return}if(r.index+=1,vc(r),r.data=[],!a){BE(r);return}for(;;){for(var s=a;s>0;s-=1){if(zR(i)&&(s===3||s===4)?RR(r):HR(r),r.err.length)return;r.data.push(r.param),vc(r),r.index<e&&t.charCodeAt(r.index)===44&&(r.index+=1,vc(r))}if(r.index>=r.max||!DR(t.charCodeAt(r.index)))break}BE(r)}var jR=(function(){function r(e){this.pathValue=e,this.segments=[],this.max=e.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""}return r})();function WR(r){if(yE(r))return[].concat(r);var e=new jR(r);for(vc(e);e.index<e.max&&!e.err.length;)VR(e);return e.err?e.err:e.segments}function qR(r){if(mE(r))return[].concat(r);var e=WR(r),t=0,n=0,i=0,a=0;return e.map(function(s){var o=s.slice(1).map(Number),A=s[0],l=A.toUpperCase();if(A==="M")return t=o[0],n=o[1],i=t,a=n,["M",t,n];var c;if(A!==l)switch(l){case"A":c=[l,o[0],o[1],o[2],o[3],o[4],o[5]+t,o[6]+n];break;case"V":c=[l,o[0]+n];break;case"H":c=[l,o[0]+t];break;default:{var u=o.map(function(d,f){return d+(f%2?n:t)});c=[l].concat(u)}}else c=[l].concat(o);var h=c.length;switch(l){case"Z":t=i,n=a;break;case"H":t=c[1];break;case"V":n=c[1];break;default:t=c[h-2],n=c[h-1],l==="M"&&(i=t,a=n)}return c})}function $R(r,e){var t=r[0],n=e.x1,i=e.y1,a=e.x2,s=e.y2,o=r.slice(1).map(Number),A=r;if("TQ".includes(t)||(e.qx=null,e.qy=null),t==="H")A=["L",r[1],i];else if(t==="V")A=["L",n,r[1]];else if(t==="S"){var l=n*2-a,c=i*2-s;e.x1=l,e.y1=c,A=["C",l,c].concat(o)}else if(t==="T"){var u=n*2-e.qx,h=i*2-e.qy;e.qx=u,e.qy=h,A=["Q",u,h].concat(o)}else if(t==="Q"){var d=o[0],f=o[1];e.qx=d,e.qy=f}return A}function yc(r){if(wE(r))return[].concat(r);for(var e=qR(r),t=se({},vE),n=0;n<e.length;n+=1){e[n]=$R(e[n],t);var i=e[n],a=i.length;t.x1=+i[a-2],t.y1=+i[a-1],t.x2=+i[a-4]||t.x1,t.y2=+i[a-3]||t.y1}return e}function YR(r){return wE(r)&&r.every(function(e){var t=e[0];return"MC".includes(t)})}function mc(r,e,t){var n=r*Math.cos(t)-e*Math.sin(t),i=r*Math.sin(t)+e*Math.cos(t);return{x:n,y:i}}function tg(r,e,t,n,i,a,s,o,A,l){var c=r,u=e,h=t,d=n,f=o,g=A,p=Math.PI*120/180,v=Math.PI/180*(+i||0),y=[],m,B,C,S,F;if(l)B=l[0],C=l[1],S=l[2],F=l[3];else{m=mc(c,u,-v),c=m.x,u=m.y,m=mc(f,g,-v),f=m.x,g=m.y;var T=(c-f)/2,O=(u-g)/2,I=T*T/(h*h)+O*O/(d*d);I>1&&(I=Math.sqrt(I),h*=I,d*=I);var k=h*h,N=d*d,U=(a===s?-1:1)*Math.sqrt(Math.abs((k*N-k*O*O-N*T*T)/(k*O*O+N*T*T)));S=U*h*O/d+(c+f)/2,F=U*-d*T/h+(u+g)/2,B=Math.asin(((u-F)/d*Math.pow(10,9)>>0)/Math.pow(10,9)),C=Math.asin(((g-F)/d*Math.pow(10,9)>>0)/Math.pow(10,9)),B=c<S?Math.PI-B:B,C=f<S?Math.PI-C:C,B<0&&(B=Math.PI*2+B),C<0&&(C=Math.PI*2+C),s&&B>C&&(B-=Math.PI*2),!s&&C>B&&(C-=Math.PI*2)}var D=C-B;if(Math.abs(D)>p){var G=C,Z=f,q=g;C=B+p*(s&&C>B?1:-1),f=S+h*Math.cos(C),g=F+d*Math.sin(C),y=tg(f,g,h,d,i,0,s,Z,q,[C,G,S,F])}D=C-B;var j=Math.cos(B),te=Math.sin(B),ue=Math.cos(C),ge=Math.sin(C),Y=Math.tan(D/4),xe=4/3*h*Y,$=4/3*d*Y,K=[c,u],ee=[c+xe*te,u-$*j],oe=[f+xe*ge,g-$*ue],Ee=[f,g];if(ee[0]=2*K[0]-ee[0],ee[1]=2*K[1]-ee[1],l)return ee.concat(oe,Ee,y);y=ee.concat(oe,Ee,y);for(var Le=[],Pe=0,st=y.length;Pe<st;Pe+=1)Le[Pe]=Pe%2?mc(y[Pe-1],y[Pe],v).y:mc(y[Pe],y[Pe+1],v).x;return Le}function XR(r,e,t,n,i,a){var s=.3333333333333333,o=2/3;return[s*r+o*t,s*e+o*n,s*i+o*t,s*a+o*n,i,a]}function Na(r,e,t){var n=r[0],i=r[1],a=e[0],s=e[1];return[n+(a-n)*t,i+(s-i)*t]}var bE=function(r,e,t,n){var i=.5,a=Na([r,e],[t,n],i);return Ie(Ie([],a,!0),[t,n,t,n],!1)};function ZR(r,e){var t=r[0],n=r.slice(1).map(Number),i=n[0],a=n[1],s,o=e.x1,A=e.y1,l=e.x,c=e.y;switch("TQ".includes(t)||(e.qx=null,e.qy=null),t){case"M":return e.x=i,e.y=a,r;case"A":return s=[o,A].concat(n),["C"].concat(tg(s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7],s[8],s[9]));case"Q":return e.qx=i,e.qy=a,s=[o,A].concat(n),["C"].concat(XR(s[0],s[1],s[2],s[3],s[4],s[5]));case"L":return["C"].concat(bE(o,A,i,a));case"Z":return o===l&&A===c?["C",o,A,l,c,l,c]:["C"].concat(bE(o,A,l,c))}return r}function ng(r,e){if(e===void 0&&(e=!1),YR(r)){var t=[].concat(r);return e?[t,[]]:t}for(var n=yc(r),i=se({},vE),a=[],s="",o=n.length,A,l,c=[],u=0;u<o;u+=1){n[u]&&(s=n[u][0]),a[u]=s;var h=ZR(n[u],i);n[u]=h,PR(n,a,u),o=n.length,s==="Z"&&c.push(u),A=n[u],l=A.length,i.x1=+A[l-2],i.y1=+A[l-1],i.x2=+A[l-4]||i.x1,i.y2=+A[l-3]||i.y1}return e?[n,c]:n}function JR(r){return r.map(function(e){return Array.isArray(e)?[].concat(e):e})}function eD(r){var e=r.slice(1).map(function(t,n,i){return n?i[n-1].slice(-2).concat(t.slice(1)):r[0].slice(1).concat(t.slice(1))}).map(function(t){return t.map(function(n,i){return t[t.length-i-2*(1-i%2)]})}).reverse();return[["M"].concat(e[0].slice(0,2))].concat(e.map(function(t){return["C"].concat(t.slice(2))}))}function wr(r,e){return Math.sqrt((r[0]-e[0])*(r[0]-e[0])+(r[1]-e[1])*(r[1]-e[1]))}function rg(r,e,t,n,i){var a=wr([r,e],[t,n]),s={x:0,y:0};if(typeof i=="number")if(i<=0)s={x:r,y:e};else if(i>=a)s={x:t,y:n};else{var o=Na([r,e],[t,n],i/a),A=o[0],l=o[1];s={x:A,y:l}}return{length:a,point:s,min:{x:Math.min(r,t),y:Math.min(e,n)},max:{x:Math.max(r,t),y:Math.max(e,n)}}}function EE(r,e){var t=r.x,n=r.y,i=e.x,a=e.y,s=t*i+n*a,o=Math.sqrt((Math.pow(t,2)+Math.pow(n,2))*(Math.pow(i,2)+Math.pow(a,2))),A=t*a-n*i<0?-1:1,l=A*Math.acos(s/o);return l}function tD(r,e,t,n,i,a,s,o,A,l){var c=Math.abs,u=Math.sin,h=Math.cos,d=Math.sqrt,f=Math.PI,g=c(t),p=c(n),v=(i%360+360)%360,y=v*(f/180);if(r===o&&e===A)return{x:r,y:e};if(g===0||p===0)return rg(r,e,o,A,l).point;var m=(r-o)/2,B=(e-A)/2,C={x:h(y)*m+u(y)*B,y:-u(y)*m+h(y)*B},S=Math.pow(C.x,2)/Math.pow(g,2)+Math.pow(C.y,2)/Math.pow(p,2);S>1&&(g*=d(S),p*=d(S));var F=Math.pow(g,2)*Math.pow(p,2)-Math.pow(g,2)*Math.pow(C.y,2)-Math.pow(p,2)*Math.pow(C.x,2),T=Math.pow(g,2)*Math.pow(C.y,2)+Math.pow(p,2)*Math.pow(C.x,2),O=F/T;O=O<0?0:O;var I=(a!==s?1:-1)*d(O),k={x:I*(g*C.y/p),y:I*(-(p*C.x)/g)},N={x:h(y)*k.x-u(y)*k.y+(r+o)/2,y:u(y)*k.x+h(y)*k.y+(e+A)/2},U={x:(C.x-k.x)/g,y:(C.y-k.y)/p},D=EE({x:1,y:0},U),G={x:(-C.x-k.x)/g,y:(-C.y-k.y)/p},Z=EE(U,G);!s&&Z>0?Z-=2*f:s&&Z<0&&(Z+=2*f),Z%=2*f;var q=D+Z*l,j=g*h(q),te=p*u(q),ue={x:h(y)*j-u(y)*te+N.x,y:u(y)*j+h(y)*te+N.y};return ue}function nD(r,e,t,n,i,a,s,o,A,l,c){var u,h=c.bbox,d=h===void 0?!0:h,f=c.length,g=f===void 0?!0:f,p=c.sampleSize,v=p===void 0?30:p,y=typeof l=="number",m=r,B=e,C=0,S=[m,B,C],F=[m,B],T=0,O={x:0,y:0},I=[{x:m,y:B}];y&&l<=0&&(O={x:m,y:B});for(var k=0;k<=v;k+=1){if(T=k/v,u=tD(r,e,t,n,i,a,s,o,A,T),m=u.x,B=u.y,d&&I.push({x:m,y:B}),g&&(C+=wr(F,[m,B])),F=[m,B],y&&C>=l&&l>S[2]){var N=(C-l)/(C-S[2]);O={x:F[0]*(1-N)+S[0]*N,y:F[1]*(1-N)+S[1]*N}}S=[m,B,C]}return y&&l>=C&&(O={x:o,y:A}),{length:C,point:O,min:{x:Math.min.apply(null,I.map(function(U){return U.x})),y:Math.min.apply(null,I.map(function(U){return U.y}))},max:{x:Math.max.apply(null,I.map(function(U){return U.x})),y:Math.max.apply(null,I.map(function(U){return U.y}))}}}function rD(r,e,t,n,i,a,s,o,A){var l=1-A;return{x:Math.pow(l,3)*r+3*Math.pow(l,2)*A*t+3*l*Math.pow(A,2)*i+Math.pow(A,3)*s,y:Math.pow(l,3)*e+3*Math.pow(l,2)*A*n+3*l*Math.pow(A,2)*a+Math.pow(A,3)*o}}function xE(r,e,t,n,i,a,s,o,A,l){var c,u=l.bbox,h=u===void 0?!0:u,d=l.length,f=d===void 0?!0:d,g=l.sampleSize,p=g===void 0?10:g,v=typeof A=="number",y=r,m=e,B=0,C=[y,m,B],S=[y,m],F=0,T={x:0,y:0},O=[{x:y,y:m}];v&&A<=0&&(T={x:y,y:m});for(var I=0;I<=p;I+=1){if(F=I/p,c=rD(r,e,t,n,i,a,s,o,F),y=c.x,m=c.y,h&&O.push({x:y,y:m}),f&&(B+=wr(S,[y,m])),S=[y,m],v&&B>=A&&A>C[2]){var k=(B-A)/(B-C[2]);T={x:S[0]*(1-k)+C[0]*k,y:S[1]*(1-k)+C[1]*k}}C=[y,m,B]}return v&&A>=B&&(T={x:s,y:o}),{length:B,point:T,min:{x:Math.min.apply(null,O.map(function(N){return N.x})),y:Math.min.apply(null,O.map(function(N){return N.y}))},max:{x:Math.max.apply(null,O.map(function(N){return N.x})),y:Math.max.apply(null,O.map(function(N){return N.y}))}}}function iD(r,e,t,n,i,a,s){var o=1-s;return{x:Math.pow(o,2)*r+2*o*s*t+Math.pow(s,2)*i,y:Math.pow(o,2)*e+2*o*s*n+Math.pow(s,2)*a}}function aD(r,e,t,n,i,a,s,o){var A,l=o.bbox,c=l===void 0?!0:l,u=o.length,h=u===void 0?!0:u,d=o.sampleSize,f=d===void 0?10:d,g=typeof s=="number",p=r,v=e,y=0,m=[p,v,y],B=[p,v],C=0,S={x:0,y:0},F=[{x:p,y:v}];g&&s<=0&&(S={x:p,y:v});for(var T=0;T<=f;T+=1){if(C=T/f,A=iD(r,e,t,n,i,a,C),p=A.x,v=A.y,c&&F.push({x:p,y:v}),h&&(y+=wr(B,[p,v])),B=[p,v],g&&y>=s&&s>m[2]){var O=(y-s)/(y-m[2]);S={x:B[0]*(1-O)+m[0]*O,y:B[1]*(1-O)+m[1]*O}}m=[p,v,y]}return g&&s>=y&&(S={x:i,y:a}),{length:y,point:S,min:{x:Math.min.apply(null,F.map(function(I){return I.x})),y:Math.min.apply(null,F.map(function(I){return I.y}))},max:{x:Math.max.apply(null,F.map(function(I){return I.x})),y:Math.max.apply(null,F.map(function(I){return I.y}))}}}function CE(r,e,t){for(var n,i,a,s,o,A,l=yc(r),c=typeof e=="number",u,h=[],d,f=0,g=0,p=0,v=0,y,m=[],B=[],C=0,S={x:0,y:0},F=S,T=S,O=S,I=0,k=0,N=l.length;k<N;k+=1)y=l[k],d=y[0],u=d==="M",h=u?h:[f,g].concat(y.slice(1)),u?(p=y[1],v=y[2],S={x:p,y:v},F=S,C=0,c&&e<.001&&(O=S)):d==="L"?(n=rg(h[0],h[1],h[2],h[3],(e||0)-I),C=n.length,S=n.min,F=n.max,T=n.point):d==="A"?(i=nD(h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],h[8],(e||0)-I,t||{}),C=i.length,S=i.min,F=i.max,T=i.point):d==="C"?(a=xE(h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],(e||0)-I,t||{}),C=a.length,S=a.min,F=a.max,T=a.point):d==="Q"?(s=aD(h[0],h[1],h[2],h[3],h[4],h[5],(e||0)-I,t||{}),C=s.length,S=s.min,F=s.max,T=s.point):d==="Z"&&(h=[f,g,p,v],o=rg(h[0],h[1],h[2],h[3],(e||0)-I),C=o.length,S=o.min,F=o.max,T=o.point),c&&I<e&&I+C>=e&&(O=T),B.push(F),m.push(S),I+=C,A=d!=="Z"?y.slice(-2):[p,v],f=A[0],g=A[1];return c&&e>=I&&(O={x:f,y:g}),{length:I,point:O,min:{x:Math.min.apply(null,m.map(function(U){return U.x})),y:Math.min.apply(null,m.map(function(U){return U.y}))},max:{x:Math.max.apply(null,B.map(function(U){return U.x})),y:Math.max.apply(null,B.map(function(U){return U.y}))}}}function sD(r,e){return CE(r,void 0,se(se({},e),{bbox:!1,length:!0})).length}function oD(r){var e=r.length,t=e-1;return r.map(function(n,i){return r.map(function(a,s){var o=i+s,A;return s===0||r[o]&&r[o][0]==="M"?(A=r[o],["M"].concat(A.slice(-2))):(o>=e&&(o-=t),r[o])})})}function AD(r,e){var t=r.length-1,n=[],i=0,a=0,s=oD(r);return s.forEach(function(o,A){r.slice(1).forEach(function(l,c){a+=wr(r[(A+c)%t].slice(-2),e[c%t].slice(-2))}),n[A]=a,a=0}),i=n.indexOf(Math.min.apply(null,n)),s[i]}function lD(r,e,t,n,i,a,s,o){return 3*((o-e)*(t+i)-(s-r)*(n+a)+n*(r-i)-t*(e-a)+o*(i+r/3)-s*(a+e/3))/20}function cD(r){var e=0,t=0,n=0;return ng(r).map(function(i){var a;if(i[0]==="M")return e=i[1],t=i[2],0;var s=i.slice(1),o=s[0],A=s[1],l=s[2],c=s[3],u=s[4],h=s[5];return n=lD(e,t,o,A,l,c,u,h),a=i.slice(-2),e=a[0],t=a[1],n}).reduce(function(i,a){return i+a},0)}function SE(r){return cD(r)>=0}function uD(r,e,t){return CE(r,e,se(se({},t),{bbox:!1,length:!0})).point}var hD=50;function dD(r,e){e===void 0&&(e=.5);var t=r.slice(0,2),n=r.slice(2,4),i=r.slice(4,6),a=r.slice(6,8),s=Na(t,n,e),o=Na(n,i,e),A=Na(i,a,e),l=Na(s,o,e),c=Na(o,A,e),u=Na(l,c,e);return[["C"].concat(s,l,u),["C"].concat(c,A,a)]}function FE(r){return r.map(function(e,t,n){var i=t&&n[t-1].slice(-2).concat(e.slice(1)),a=t?xE(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8],{bbox:!1}).length:0,s;return t?s=a?dD(i):[e,e]:s=[e],{s:e,ss:s,l:a}})}function TE(r,e,t,n){if(n===void 0&&(n=0),n>hD)return console.warn("Maximum recursion depth reached in equalizeSegments"),[r,e];var i=FE(r),a=FE(e),s=i.length,o=a.length,A=i.filter(function(v){return v.l}).length,l=a.filter(function(v){return v.l}).length,c=i.filter(function(v){return v.l}).reduce(function(v,y){var m=y.l;return v+m},0)/A||0,u=a.filter(function(v){return v.l}).reduce(function(v,y){var m=y.l;return v+m},0)/l||0,h=t||Math.max(s,o),d=[c,u],f=[h-s,h-o],g=0,p=[i,a].map(function(v,y){return v.l===h?v.map(function(m){return m.s}):v.map(function(m,B){return g=B&&f[y]&&m.l>=d[y],f[y]-=g?1:0,g?m.ss:[m.s]}).flat()});return p[0].length===p[1].length?p:TE(p[0],p[1],h,n+1)}function ig(r){var e=document.createElement("div");e.innerHTML=r;var t=e.childNodes[0];return t&&e.contains(t)&&e.removeChild(t),t}function fD(r,e){for(;!{}.hasOwnProperty.call(r,e)&&(r=uo(r))!==null;);return r}function ag(){return ag=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(r,e,t){var n=fD(r,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?r:t):i.value}},ag.apply(null,arguments)}function wc(r,e,t,n){var i=ag(uo(r.prototype),e,t);return typeof i=="function"?function(a){return i.apply(t,a)}:i}function oa(r,e,t,n){var i=r-t,a=e-n;return Math.sqrt(i*i+a*a)}function ME(r,e){var t=Math.min.apply(Math,tt(r)),n=Math.min.apply(Math,tt(e)),i=Math.max.apply(Math,tt(r)),a=Math.max.apply(Math,tt(e));return{x:t,y:n,width:i-t,height:a-n}}function gD(r,e,t){return Math.atan(-e/r*Math.tan(t))}function pD(r,e,t){return Math.atan(e/(r*Math.tan(t)))}function vD(r,e,t,n,i,a){return t*Math.cos(i)*Math.cos(a)-n*Math.sin(i)*Math.sin(a)+r}function yD(r,e,t,n,i,a){return t*Math.sin(i)*Math.cos(a)+n*Math.cos(i)*Math.sin(a)+e}function mD(r,e,t,n,i,a,s){for(var o=gD(t,n,i),A=1/0,l=-1/0,c=[a,s],u=-Math.PI*2;u<=Math.PI*2;u+=Math.PI){var h=o+u;a<s?a<h&&h<s&&c.push(h):s<h&&h<a&&c.push(h)}for(var d=0;d<c.length;d++){var f=vD(r,e,t,n,i,c[d]);f<A&&(A=f),f>l&&(l=f)}for(var g=pD(t,n,i),p=1/0,v=-1/0,y=[a,s],m=-Math.PI*2;m<=Math.PI*2;m+=Math.PI){var B=g+m;a<s?a<B&&B<s&&y.push(B):s<B&&B<a&&y.push(B)}for(var C=0;C<y.length;C++){var S=yD(r,e,t,n,i,y[C]);S<p&&(p=S),S>v&&(v=S)}return{x:A,y:p,width:l-A,height:v-p}}var wD=1e-4;function OE(r,e,t,n,i,a){var s=-1,o=1/0,A=[t,n],l=20;a&&a>200&&(l=a/10);for(var c=1/l,u=c/10,h=0;h<=l;h++){var d=h*c,f=[i.apply(void 0,tt(r.concat([d]))),i.apply(void 0,tt(e.concat([d])))],g=oa(A[0],A[1],f[0],f[1]);g<o&&(s=d,o=g)}if(s===0)return{x:r[0],y:e[0]};if(s===1){var p=r.length;return{x:r[p-1],y:e[p-1]}}o=1/0;for(var v=0;v<32&&!(u<wD);v++){var y=s-u,m=s+u,B=[i.apply(void 0,tt(r.concat([y]))),i.apply(void 0,tt(e.concat([y])))],C=oa(A[0],A[1],B[0],B[1]);if(y>=0&&C<o)s=y,o=C;else{var S=[i.apply(void 0,tt(r.concat([m]))),i.apply(void 0,tt(e.concat([m])))],F=oa(A[0],A[1],S[0],S[1]);m<=1&&F<o?(s=m,o=F):u*=.5}}return{x:i.apply(void 0,tt(r.concat([s]))),y:i.apply(void 0,tt(e.concat([s])))}}function IE(r,e,t,n){return oa(r,e,t,n)}function _E(r,e,t,n,i){return{x:(1-i)*r+i*t,y:(1-i)*e+i*n}}function BD(r,e,t,n,i,a){var s=[t-r,n-e];if(lR(s,[0,0]))return Math.sqrt((i-r)*(i-r)+(a-e)*(a-e));var o=[-s[1],s[0]];oR(o,o);var A=[i-r,a-e];return Math.abs(AR(A,o))}function sg(r,e,t,n,i){var a=1-i;return a*a*a*r+3*e*i*a*a+3*t*i*i*a+n*i*i*i}function kE(r,e,t,n){var i=-3*r+9*e-9*t+3*n,a=6*r-12*e+6*t,s=3*e-3*r,o=[],A,l,c;if(vo(i,0))vo(a,0)||(A=-s/a,A>=0&&A<=1&&o.push(A));else{var u=a*a-4*i*s;vo(u,0)?o.push(-a/(2*i)):u>0&&(c=Math.sqrt(u),A=(-a+c)/(2*i),l=(-a-c)/(2*i),A>=0&&A<=1&&o.push(A),l>=0&&l<=1&&o.push(l))}return o}function bD(r,e,t,n,i,a,s,o){for(var A=[r,s],l=[e,o],c=kE(r,t,i,s),u=kE(e,n,a,o),h=0;h<c.length;h++)A.push(sg(r,t,i,s,c[h]));for(var d=0;d<u.length;d++)l.push(sg(e,n,a,o,u[d]));return ME(A,l)}function ED(r,e,t,n,i,a,s,o,A,l,c){return OE([r,t,i,s],[e,n,a,o],A,l,sg,c)}function NE(r,e,t,n,i,a,s,o,A,l,c){var u=ED(r,e,t,n,i,a,s,o,A,l,c);return oa(u.x,u.y,A,l)}function xD(r){if(r.length<2)return 0;for(var e=0,t=0;t<r.length-1;t++){var n=r[t],i=r[t+1];e+=oa(n[0],n[1],i[0],i[1])}return e}function CD(r){return xD(r)}function og(r,e,t,n){var i=1-n;return i*i*r+2*n*i*e+n*n*t}function LE(r,e,t){var n=r+t-2*e;if(vo(n,0))return[.5];var i=(r-e)/n;return i<=1&&i>=0?[i]:[]}function SD(r,e,t,n,i,a){var s=LE(r,t,i)[0],o=LE(e,n,a)[0],A=[r,i],l=[e,a];return s!==void 0&&A.push(og(r,t,i,s)),o!==void 0&&l.push(og(e,n,a,o)),ME(A,l)}function FD(r,e,t,n,i,a,s,o){return OE([r,t,i],[e,n,a],s,o,og)}function TD(r,e,t,n,i,a,s,o){var A=FD(r,e,t,n,i,a,s,o);return oa(A.x,A.y,s,o)}function QE(r,e){this.v=r,this.k=e}function er(r,e,t,n){var i=Object.defineProperty;try{i({},"",{})}catch{i=0}er=function(s,o,A,l){function c(u,h){er(s,u,function(d){return this._invoke(u,h,d)})}o?i?i(s,o,{value:A,enumerable:!l,configurable:!l,writable:!l}):s[o]=A:(c("next",0),c("throw",1),c("return",2))},er(r,e,t,n)}function Ag(){var r,e,t=typeof Symbol=="function"?Symbol:{},n=t.iterator||"@@iterator",i=t.toStringTag||"@@toStringTag";function a(d,f,g,p){var v=f&&f.prototype instanceof o?f:o,y=Object.create(v.prototype);return er(y,"_invoke",(function(m,B,C){var S,F,T,O=0,I=C||[],k=!1,N={p:0,n:0,v:r,a:U,f:U.bind(r,4),d:function(G,Z){return S=G,F=0,T=r,N.n=Z,s}};function U(D,G){for(F=D,T=G,e=0;!k&&O&&!Z&&e<I.length;e++){var Z,q=I[e],j=N.p,te=q[2];D>3?(Z=te===G)&&(T=q[(F=q[4])?5:(F=3,3)],q[4]=q[5]=r):q[0]<=j&&((Z=D<2&&j<q[1])?(F=0,N.v=G,N.n=q[1]):j<te&&(Z=D<3||q[0]>G||G>te)&&(q[4]=D,q[5]=G,N.n=te,F=0))}if(Z||D>1)return s;throw k=!0,G}return function(D,G,Z){if(O>1)throw TypeError("Generator is already running");for(k&&G===1&&U(G,Z),F=G,T=Z;(e=F<2?r:T)||!k;){S||(F?F<3?(F>1&&(N.n=-1),U(F,T)):N.n=T:N.v=T);try{if(O=2,S){if(F||(D="next"),e=S[D]){if(!(e=e.call(S,T)))throw TypeError("iterator result is not an object");if(!e.done)return e;T=e.value,F<2&&(F=0)}else F===1&&(e=S.return)&&e.call(S),F<2&&(T=TypeError("The iterator does not provide a '"+D+"' method"),F=1);S=r}else if((e=(k=N.n<0)?T:m.call(B,N))!==s)break}catch(q){S=r,F=1,T=q}finally{O=1}}return{value:e,done:k}}})(d,g,p),!0),y}var s={};function o(){}function A(){}function l(){}e=Object.getPrototypeOf;var c=[][n]?e(e([][n]())):(er(e={},n,function(){return this}),e),u=l.prototype=o.prototype=Object.create(c);function h(d){return Object.setPrototypeOf?Object.setPrototypeOf(d,l):(d.__proto__=l,er(d,i,"GeneratorFunction")),d.prototype=Object.create(u),d}return A.prototype=l,er(u,"constructor",l),er(l,"constructor",A),A.displayName="GeneratorFunction",er(l,i,"GeneratorFunction"),er(u),er(u,i,"Generator"),er(u,n,function(){return this}),er(u,"toString",function(){return"[object Generator]"}),(Ag=function(){return{w:a,m:h}})()}function Bc(r,e){function t(i,a,s,o){try{var A=r[i](a),l=A.value;return l instanceof QE?e.resolve(l.v).then(function(c){t("next",c,s,o)},function(c){t("throw",c,s,o)}):e.resolve(l).then(function(c){A.value=c,s(A)},function(c){return t("throw",c,s,o)})}catch(c){o(c)}}var n;this.next||(er(Bc.prototype),er(Bc.prototype,typeof Symbol=="function"&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),er(this,"_invoke",function(i,a,s){function o(){return new e(function(A,l){t(i,s,A,l)})}return n=n?n.then(o,o):o()},!0)}function UE(r,e,t,n,i){return new Bc(Ag().w(r,e,t,n),i||Promise)}function MD(r,e,t,n,i){var a=UE(r,e,t,n,i);return a.next().then(function(s){return s.done?s.value:a.next()})}function OD(r){var e=Object(r),t=[];for(var n in e)t.unshift(n);return function i(){for(;t.length;)if((n=t.pop())in e)return i.value=n,i.done=!1,i;return i.done=!0,i}}function PE(r){if(r!=null){var e=r[typeof Symbol=="function"&&Symbol.iterator||"@@iterator"],t=0;if(e)return e.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length))return{next:function(){return r&&t>=r.length&&(r=void 0),{value:r&&r[t++],done:!r}}}}throw new TypeError(ps(r)+" is not iterable")}function kn(){var r=Ag(),e=r.m(kn),t=(Object.getPrototypeOf?Object.getPrototypeOf(e):e.__proto__).constructor;function n(s){var o=typeof s=="function"&&s.constructor;return!!o&&(o===t||(o.displayName||o.name)==="GeneratorFunction")}var i={throw:1,return:2,break:3,continue:3};function a(s){var o,A;return function(l){o||(o={stop:function(){return A(l.a,2)},catch:function(){return l.v},abrupt:function(u,h){return A(l.a,i[u],h)},delegateYield:function(u,h,d){return o.resultName=h,A(l.d,PE(u),d)},finish:function(u){return A(l.f,u)}},A=function(u,h,d){l.p=o.prev,l.n=o.next;try{return u(h,d)}finally{o.next=l.n}}),o.resultName&&(o[o.resultName]=l.v,o.resultName=void 0),o.sent=l.v,o.next=l.n;try{return s.call(this,o)}finally{l.p=o.prev,l.n=o.next}}}return(kn=function(){return{wrap:function(A,l,c,u){return r.w(a(A),l,c,u&&u.reverse())},isGeneratorFunction:n,mark:r.m,awrap:function(A,l){return new QE(A,l)},AsyncIterator:Bc,async:function(A,l,c,u,h){return(n(l)?UE:MD)(a(A),l,c,u,h)},keys:OD,values:PE}})()}function RE(r,e,t,n,i,a,s){try{var o=r[a](s),A=o.value}catch(l){return void t(l)}o.done?e(A):Promise.resolve(A).then(n,i)}function La(r){return function(){var e=this,t=arguments;return new Promise(function(n,i){var a=r.apply(e,t);function s(A){RE(a,n,i,s,o,"next",A)}function o(A){RE(a,n,i,s,o,"throw",A)}s(void 0)})}}function Qa(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=Lf(r))||e){t&&(r=t);var n=0,i=function(){};return{s:i,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
4
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,s=!0,o=!1;return{s:function(){t=t.call(r)},n:function(){var l=t.next();return s=l.done,l},e:function(l){o=!0,a=l},f:function(){try{s||t.return==null||t.return()}finally{if(o)throw a}}}}function ID(r,e){if(r==null)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(e.indexOf(n)!==-1)continue;t[n]=r[n]}return t}function Pi(r,e){if(r==null)return{};var t,n,i=ID(r,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);for(n=0;n<a.length;n++)t=a[n],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(r,t)&&(i[t]=r[t])}return i}var re=(function(r){return r.GROUP="g",r.FRAGMENT="fragment",r.CIRCLE="circle",r.ELLIPSE="ellipse",r.IMAGE="image",r.RECT="rect",r.LINE="line",r.POLYLINE="polyline",r.POLYGON="polygon",r.TEXT="text",r.PATH="path",r.HTML="html",r.MESH="mesh",r})({}),bc=(function(r){return r[r.ZERO=0]="ZERO",r[r.NEGATIVE_ONE=1]="NEGATIVE_ONE",r})({}),Ua=(function(){function r(){le(this,r),this.plugins=[]}return ce(r,[{key:"addRenderingPlugin",value:function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)}},{key:"removeAllRenderingPlugins",value:function(){var t=this;this.plugins.forEach(function(n){var i=t.context.renderingPlugins.indexOf(n);i>=0&&t.context.renderingPlugins.splice(i,1)})}}])})(),_D=(function(){function r(e){le(this,r),this.clipSpaceNearZ=bc.NEGATIVE_ONE,this.plugins=[],this.config=De({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0,enableRenderingOptimization:!1},e)}return ce(r,[{key:"registerPlugin",value:function(t){var n=this.plugins.findIndex(function(i){return i===t});n===-1&&this.plugins.push(t)}},{key:"unregisterPlugin",value:function(t){var n=this.plugins.findIndex(function(i){return i===t});n>-1&&this.plugins.splice(n,1)}},{key:"getPlugins",value:function(){return this.plugins}},{key:"getPlugin",value:function(t){return this.plugins.find(function(n){return n.name===t})}},{key:"getConfig",value:function(){return this.config}},{key:"setConfig",value:function(t){Object.assign(this.config,t)}}])})(),lg=Oa,mo=Ni,kD=YP,ND=$P,DE=oc,cg=aE,kt=(function(){function r(){le(this,r),this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return ce(r,[{key:"update",value:function(t,n){mo(this.center,t),mo(this.halfExtents,n),cg(this.min,this.center,this.halfExtents),lg(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,n){lg(this.center,n,t),DE(this.center,this.center,.5),cg(this.halfExtents,n,t),DE(this.halfExtents,this.halfExtents,.5),mo(this.min,t),mo(this.max,n)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(t){if(!r.isEmpty(t)){if(r.isEmpty(this)){this.setMinMax(t.getMin(),t.getMax());return}var n=this.center,i=n[0],a=n[1],s=n[2],o=this.halfExtents,A=o[0],l=o[1],c=o[2],u=i-A,h=i+A,d=a-l,f=a+l,g=s-c,p=s+c,v=t.center,y=v[0],m=v[1],B=v[2],C=t.halfExtents,S=C[0],F=C[1],T=C[2],O=y-S,I=y+S,k=m-F,N=m+F,U=B-T,D=B+T;O<u&&(u=O),I>h&&(h=I),k<d&&(d=k),N>f&&(f=N),U<g&&(g=U),D>p&&(p=D),n[0]=(u+h)*.5,n[1]=(d+f)*.5,n[2]=(g+p)*.5,o[0]=(h-u)*.5,o[1]=(f-d)*.5,o[2]=(p-g)*.5,this.min[0]=u,this.min[1]=d,this.min[2]=g,this.max[0]=h,this.max[1]=f,this.max[2]=p}}},{key:"setFromTransformedAABB",value:function(t,n){var i=this.center,a=this.halfExtents,s=t.center,o=t.halfExtents,A=n[0],l=n[4],c=n[8],u=n[1],h=n[5],d=n[9],f=n[2],g=n[6],p=n[10],v=Math.abs(A),y=Math.abs(l),m=Math.abs(c),B=Math.abs(u),C=Math.abs(h),S=Math.abs(d),F=Math.abs(f),T=Math.abs(g),O=Math.abs(p);i[0]=n[12]+A*s[0]+l*s[1]+c*s[2],i[1]=n[13]+u*s[0]+h*s[1]+d*s[2],i[2]=n[14]+f*s[0]+g*s[1]+p*s[2],a[0]=v*o[0]+y*o[1]+m*o[2],a[1]=B*o[0]+C*o[1]+S*o[2],a[2]=F*o[0]+T*o[1]+O*o[2],cg(this.min,i,a),lg(this.max,i,a)}},{key:"intersects",value:function(t){var n=this.getMax(),i=this.getMin(),a=t.getMax(),s=t.getMin();return i[0]<=a[0]&&n[0]>=s[0]&&i[1]<=a[1]&&n[1]>=s[1]&&i[2]<=a[2]&&n[2]>=s[2]}},{key:"intersection",value:function(t){if(!this.intersects(t))return null;var n=new r,i=kD([0,0,0],this.getMin(),t.getMin()),a=ND([0,0,0],this.getMax(),t.getMax());return n.setMinMax(i,a),n}},{key:"getNegativeFarPoint",value:function(t){return t.pnVertexFlag===273?mo([0,0,0],this.min):t.pnVertexFlag===272?[this.min[0],this.min[1],this.max[2]]:t.pnVertexFlag===257?[this.min[0],this.max[1],this.min[2]]:t.pnVertexFlag===256?[this.min[0],this.max[1],this.max[2]]:t.pnVertexFlag===17?[this.max[0],this.min[1],this.min[2]]:t.pnVertexFlag===16?[this.max[0],this.min[1],this.max[2]]:t.pnVertexFlag===1?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]}},{key:"getPositiveFarPoint",value:function(t){return t.pnVertexFlag===273?mo([0,0,0],this.max):t.pnVertexFlag===272?[this.max[0],this.max[1],this.min[2]]:t.pnVertexFlag===257?[this.max[0],this.min[1],this.max[2]]:t.pnVertexFlag===256?[this.max[0],this.min[1],this.min[2]]:t.pnVertexFlag===17?[this.min[0],this.max[1],this.max[2]]:t.pnVertexFlag===16?[this.min[0],this.max[1],this.min[2]]:t.pnVertexFlag===1?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]}}],[{key:"isEmpty",value:function(t){return!t||t.halfExtents[0]===0&&t.halfExtents[1]===0&&t.halfExtents[2]===0}}])})(),LD=(function(){function r(e,t){le(this,r),this.distance=e||0,this.normal=t||St(0,1,0),this.updatePNVertexFlag()}return ce(r,[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(+(this.normal[0]>=0)<<8)+(+(this.normal[1]>=0)<<4)+ +(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(t){return Li(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t=1/oE(this.normal);oc(this.normal,this.normal,t),this.distance*=t}},{key:"intersectsLine",value:function(t,n,i){var a=this.distanceToPoint(t),s=this.distanceToPoint(n),o=a/(a-s),A=o>=0&&o<=1;return A&&i&&Kf(i,t,n,o),A}}])})(),wo=(function(r){return r[r.OUTSIDE=4294967295]="OUTSIDE",r[r.INSIDE=0]="INSIDE",r[r.INDETERMINATE=2147483647]="INDETERMINATE",r})({}),QD=(function(){function r(e){if(le(this,r),this.planes=[],e)this.planes=e;else for(var t=0;t<6;t++)this.planes.push(new LD)}return ce(r,[{key:"extractFromVPMatrix",value:function(t){var n=$e(t,16),i=n[0],a=n[1],s=n[2],o=n[3],A=n[4],l=n[5],c=n[6],u=n[7],h=n[8],d=n[9],f=n[10],g=n[11],p=n[12],v=n[13],y=n[14],m=n[15];Zn(this.planes[0].normal,o-i,u-A,g-h),this.planes[0].distance=m-p,Zn(this.planes[1].normal,o+i,u+A,g+h),this.planes[1].distance=m+p,Zn(this.planes[2].normal,o+a,u+l,g+d),this.planes[2].distance=m+v,Zn(this.planes[3].normal,o-a,u-l,g-d),this.planes[3].distance=m-v,Zn(this.planes[4].normal,o-s,u-c,g-f),this.planes[4].distance=m-y,Zn(this.planes[5].normal,o+s,u+c,g+f),this.planes[5].distance=m+y,this.planes.forEach(function(B){B.normalize(),B.updatePNVertexFlag()})}}])})(),Hn=(function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;le(this,r),this.x=0,this.y=0,this.x=e,this.y=t}return ce(r,[{key:"clone",value:function(){return new r(this.x,this.y)}},{key:"copyFrom",value:function(t){this.x=t.x,this.y=t.y}}])})(),Bo=(function(){function r(e,t,n,i){le(this,r),this.x=e,this.y=t,this.width=n,this.height=i,this.left=e,this.right=e+n,this.top=t,this.bottom=t+i}return ce(r,[{key:"toJSON",value:function(){}}],[{key:"fromRect",value:function(t){return new r(t.x,t.y,t.width,t.height)}},{key:"applyTransform",value:function(t,n){var i=vA(t.x,t.y,0,1),a=vA(t.x+t.width,t.y,0,1),s=vA(t.x,t.y+t.height,0,1),o=vA(t.x+t.width,t.y+t.height,0,1),A=Qi(),l=Qi(),c=Qi(),u=Qi();sa(A,i,n),sa(l,a,n),sa(c,s,n),sa(u,o,n);var h=Math.min(A[0],l[0],c[0],u[0]),d=Math.min(A[1],l[1],c[1],u[1]),f=Math.max(A[0],l[0],c[0],u[0]),g=Math.max(A[1],l[1],c[1],u[1]);return r.fromRect({x:h,y:d,width:f-h,height:g-d})}}])})(),mt="Method not implemented.",bo="Use document.documentElement instead.",UD="Cannot append a destroyed element.";function Eo(r){return r===void 0?0:r>360||r<-360?r%360:r}var ug=Je();function Ar(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;return Array.isArray(r)&&r.length===3?n?ia(r):Ni(ug,r):Be(r)?n?St(r,e,t):Zn(ug,r,e,t):n?St(r[0],r[1]||e,r[2]||t):Zn(ug,r[0],r[1]||e,r[2]||t)}var PD=Math.PI/180;function ft(r){return r*PD}var RD=180/Math.PI;function Br(r){return r*RD}function DD(r){return 360*r}var Ec=Math.PI/2;function HD(r,e){var t=e[0],n=e[1],i=e[2],a=e[3],s=t*t,o=n*n,A=i*i,l=a*a,c=s+o+A+l,u=t*a-n*i;return u>.499995*c?(r[0]=Ec,r[1]=2*Math.atan2(n,t),r[2]=0):u<-.499995*c?(r[0]=-Ec,r[1]=2*Math.atan2(n,t),r[2]=0):(r[0]=Math.asin(2*(t*i-a*n)),r[1]=Math.atan2(2*(t*a+n*i),1-2*(A+l)),r[2]=Math.atan2(2*(t*n+i*a),1-2*(o+A))),r}function GD(r,e){var t,n,i=go(Je(),e),a=$e(i,3),s=a[0],o=a[1],A=a[2],l=Math.asin(-e[2]/s);return l<Ec?l>-Ec?(t=Math.atan2(e[6]/o,e[10]/A),n=Math.atan2(e[1]/s,e[0]/s)):(n=0,t=-Math.atan2(e[4]/o,e[5]/o)):(n=0,t=Math.atan2(e[4]/o,e[5]/o)),r[0]=t,r[1]=l,r[2]=n,r}function hg(r,e){return e.length===16?GD(r,e):HD(r,e)}function KD(r,e,t,n,i){var a=Math.cos(r),s=Math.sin(r);return TP(n*a,i*s,0,-n*s,i*a,0,e,t,1)}function zD(r,e,t,n,i,a,s){var o=arguments.length>7&&arguments[7]!==void 0?arguments[7]:!1,A=2*a,l=t-e,c=n-i,u=A/l,h=A/c,d=(t+e)/l,f=(n+i)/c,g,p,v=s-a,y=s*a;return o?(g=-s/v,p=-y/v):(g=-(s+a)/v,p=-2*y/v),r[0]=u,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=h,r[6]=0,r[7]=0,r[8]=d,r[9]=f,r[10]=g,r[11]=-1,r[12]=0,r[13]=0,r[14]=p,r[15]=0,r}function HE(r){var e=r[0],t=r[1],n=r[3],i=r[4],a=Math.sqrt(e*e+t*t),s=Math.sqrt(n*n+i*i),o=e*i-t*n;if(o<0&&(e<i?a=-a:s=-s),a){var A=1/a;e*=A,t*=A}if(s){var l=1/s;n*=l,i*=l}var c=Math.atan2(t,e),u=Br(c);return[r[6],r[7],a,s,u]}var Ri=Ct(),di=Ct(),xA=Qi(),He=[Je(),Je(),Je()],GE=Je();function VD(r,e,t,n,i,a){if(!jD(Ri,r)||(ho(di,Ri),di[3]=0,di[7]=0,di[11]=0,di[15]=1,Math.abs(zb(di))<1e-8))return!1;var s=Ri[3],o=Ri[7],A=Ri[11],l=Ri[12],c=Ri[13],u=Ri[14],h=Ri[15];if(s!==0||o!==0||A!==0){xA[0]=s,xA[1]=o,xA[2]=A,xA[3]=h;var d=ki(di,di);if(!d)return!1;Kb(di,di),sa(i,xA,di)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=l,e[1]=c,e[2]=u,WD(He,Ri),t[0]=aa(He[0]),ys(He[0],He[0]),n[0]=Li(He[0],He[1]),dg(He[1],He[1],He[0],1,-n[0]),t[1]=aa(He[1]),ys(He[1],He[1]),n[0]/=t[1],n[1]=Li(He[0],He[2]),dg(He[2],He[2],He[0],1,-n[1]),n[2]=Li(He[1],He[2]),dg(He[2],He[2],He[1],1,-n[2]),t[2]=aa(He[2]),ys(He[2],He[2]),n[1]/=t[2],n[2]/=t[2],Ac(GE,He[1],He[2]),Li(He[0],GE)<0)for(var f=0;f<3;f++)t[f]*=-1,He[f][0]*=-1,He[f][1]*=-1,He[f][2]*=-1;return a[0]=.5*Math.sqrt(Math.max(1+He[0][0]-He[1][1]-He[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-He[0][0]+He[1][1]-He[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-He[0][0]-He[1][1]+He[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+He[0][0]+He[1][1]+He[2][2],0)),He[2][1]>He[1][2]&&(a[0]=-a[0]),He[0][2]>He[2][0]&&(a[1]=-a[1]),He[1][0]>He[0][1]&&(a[2]=-a[2]),!0}function jD(r,e){var t=e[15];if(t===0)return!1;for(var n=1/t,i=0;i<16;i++)r[i]=e[i]*n;return!0}function WD(r,e){r[0][0]=e[0],r[0][1]=e[1],r[0][2]=e[2],r[1][0]=e[4],r[1][1]=e[5],r[1][2]=e[6],r[2][0]=e[8],r[2][1]=e[9],r[2][2]=e[10]}function dg(r,e,t,n,i){r[0]=e[0]*n+t[0]*i,r[1]=e[1]*n+t[1]*i,r[2]=e[2]*n+t[2]*i}var wt=(function(r){return r[r.ORBITING=0]="ORBITING",r[r.EXPLORING=1]="EXPLORING",r[r.TRACKING=2]="TRACKING",r})({}),fg=(function(r){return r[r.DEFAULT=0]="DEFAULT",r[r.ROTATIONAL=1]="ROTATIONAL",r[r.TRANSLATIONAL=2]="TRANSLATIONAL",r[r.CINEMATIC=3]="CINEMATIC",r})({}),$r=(function(r){return r[r.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",r[r.PERSPECTIVE=1]="PERSPECTIVE",r})({}),KE={UPDATED:"updated"},zE=2e-4,VE=(function(){function r(){le(this,r),this.clipSpaceNearZ=bc.NEGATIVE_ONE,this.eventEmitter=new Rb,this.matrix=Ct(),this.right=St(1,0,0),this.up=St(0,1,0),this.forward=St(0,0,1),this.position=St(0,0,1),this.focalPoint=St(0,0,0),this.distanceVector=St(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.projectionMatrix=Ct(),this.projectionMatrixInverse=Ct(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=wt.EXPLORING,this.trackingMode=fg.DEFAULT,this.projectionMode=$r.PERSPECTIVE,this.frustum=new QD,this.orthoMatrix=Ct()}return ce(r,[{key:"isOrtho",value:function(){return this.projectionMode===$r.ORTHOGRAPHIC}},{key:"getProjectionMode",value:function(){return this.projectionMode}},{key:"getPerspective",value:function(){return this.jitteredProjectionMatrix||this.projectionMatrix}},{key:"getPerspectiveInverse",value:function(){return this.projectionMatrixInverse}},{key:"getFrustum",value:function(){return this.frustum}},{key:"getPosition",value:function(){return this.position}},{key:"getFocalPoint",value:function(){return this.focalPoint}},{key:"getDollyingStep",value:function(){return this.dollyingStep}},{key:"getNear",value:function(){return this.near}},{key:"getFar",value:function(){return this.far}},{key:"getZoom",value:function(){return this.zoom}},{key:"getOrthoMatrix",value:function(){return this.orthoMatrix}},{key:"getView",value:function(){return this.view}},{key:"setEnableUpdate",value:function(t){this.enableUpdate=t}},{key:"setType",value:function(t,n){return this.type=t,this.type===wt.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===wt.TRACKING&&n!==void 0&&this.setTrackingMode(n),this}},{key:"setProjectionMode",value:function(t){return this.projectionMode=t,this}},{key:"setTrackingMode",value:function(t){if(this.type!==wt.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this}},{key:"setWorldRotation",value:function(t){return this.rotateWorld=t,this._getAngles(),this}},{key:"getViewTransform",value:function(){return ki(Ct(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"jitterProjectionMatrix",value:function(t,n){var i=Ma(Ct(),[t,n,0]);this.jitteredProjectionMatrix=Xn(Ct(),i,this.projectionMatrix)}},{key:"clearJitterProjectionMatrix",value:function(){this.jitteredProjectionMatrix=void 0}},{key:"setMatrix",value:function(t){return this.matrix=t,this._update(),this}},{key:"setProjectionMatrix",value:function(t){this.projectionMatrix=t}},{key:"setFov",value:function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this}},{key:"setAspect",value:function(t){return this.setPerspective(this.near,this.far,this.fov,t),this}},{key:"setNear",value:function(t){return this.projectionMode===$r.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this}},{key:"setFar",value:function(t){return this.projectionMode===$r.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this}},{key:"setViewOffset",value:function(t,n,i,a,s,o){return this.aspect=t/n,this.view===void 0&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=n,this.view.offsetX=i,this.view.offsetY=a,this.view.width=s,this.view.height=o,this.projectionMode===$r.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"clearViewOffset",value:function(){return this.view!==void 0&&(this.view.enabled=!1),this.projectionMode===$r.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"setZoom",value:function(t){return this.zoom=t,this.projectionMode===$r.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===$r.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this}},{key:"setZoomByViewportPoint",value:function(t,n){var i=this.canvas.viewport2Canvas({x:n[0],y:n[1]}),a=i.x,s=i.y,o=this.roll;this.rotate(0,0,-o),this.setPosition(a,s),this.setFocalPoint(a,s),this.setZoom(t),this.rotate(0,0,o);var A=this.canvas.viewport2Canvas({x:n[0],y:n[1]}),l=A.x,c=A.y,u=St(l-a,c-s,0),h=Li(u,this.right)/aa(this.right),d=Li(u,this.up)/aa(this.up),f=this.getPosition(),g=$e(f,2),p=g[0],v=g[1],y=this.getFocalPoint(),m=$e(y,2),B=m[0],C=m[1];return this.setPosition(p-h,v-d),this.setFocalPoint(B-h,C-d),this}},{key:"setPerspective",value:function(t,n,i,a){var s;this.projectionMode=$r.PERSPECTIVE,this.fov=i,this.near=t,this.far=n,this.aspect=a;var o=this.near*Math.tan(ft(.5*this.fov))/this.zoom,A=2*o,l=this.aspect*A,c=-.5*l;if((s=this.view)!==null&&s!==void 0&&s.enabled){var u=this.view.fullWidth,h=this.view.fullHeight;c+=this.view.offsetX*l/u,o-=this.view.offsetY*A/h,l*=this.view.width/u,A*=this.view.height/h}return zD(this.projectionMatrix,c,c+l,o-A,o,t,this.far,this.clipSpaceNearZ===bc.ZERO),ki(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this}},{key:"setOrthographic",value:function(t,n,i,a,s,o){var A;this.projectionMode=$r.ORTHOGRAPHIC,this.rright=n,this.left=t,this.top=i,this.bottom=a,this.near=s,this.far=o;var l=(this.rright-this.left)/(2*this.zoom),c=(this.top-this.bottom)/(2*this.zoom),u=(this.rright+this.left)/2,h=(this.top+this.bottom)/2,d=u-l,f=u+l,g=h+c,p=h-c;if((A=this.view)!==null&&A!==void 0&&A.enabled){var v=(this.rright-this.left)/this.view.fullWidth/this.zoom,y=(this.top-this.bottom)/this.view.fullHeight/this.zoom;d+=v*this.view.offsetX,f=d+v*this.view.width,g-=y*this.view.offsetY,p=g-y*this.view.height}return this.clipSpaceNearZ===bc.NEGATIVE_ONE?eE(this.projectionMatrix,d,f,g,p,s,o):tE(this.projectionMatrix,d,f,g,p,s,o),ki(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this}},{key:"setPosition",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.position[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.position[2],a=Ar(t,n,i);return this._setPosition(a),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this}},{key:"setFocalPoint",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.focalPoint[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.focalPoint[2],a=St(0,1,0);if(this.focalPoint=Ar(t,n,i),this.trackingMode===fg.CINEMATIC){var s=Gf(Je(),this.focalPoint,this.position);t=s[0],n=s[1],i=s[2];var o=aa(s),A=Br(Math.asin(n/o)),l=90+Br(Math.atan2(i,t)),c=Ct();Wb(c,c,ft(l)),jb(c,c,ft(A)),a=Jn(Je(),[0,1,0],c)}return ki(this.matrix,nE(Ct(),this.position,this.focalPoint,a)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this}},{key:"getDistance",value:function(){return this.distance}},{key:"getDistanceVector",value:function(){return this.distanceVector}},{key:"setDistance",value:function(t){if(this.distance===t||t<0)return this;this.distance=t,this.distance<zE&&(this.distance=zE),this.dollyingStep=this.distance/100;var n=Je();t=this.distance;var i=this.forward,a=this.focalPoint;return n[0]=t*i[0]+a[0],n[1]=t*i[1]+a[1],n[2]=t*i[2]+a[2],this._setPosition(n),this.triggerUpdate(),this}},{key:"setMaxDistance",value:function(t){return this.maxDistance=t,this}},{key:"setMinDistance",value:function(t){return this.minDistance=t,this}},{key:"setAzimuth",value:function(t){return this.azimuth=Eo(t),this.computeMatrix(),this._getAxes(),this.type===wt.ORBITING||this.type===wt.EXPLORING?this._getPosition():this.type===wt.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(t){return this.elevation=Eo(t),this.computeMatrix(),this._getAxes(),this.type===wt.ORBITING||this.type===wt.EXPLORING?this._getPosition():this.type===wt.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getElevation",value:function(){return this.elevation}},{key:"setRoll",value:function(t){return this.roll=Eo(t),this.computeMatrix(),this._getAxes(),this.type===wt.ORBITING||this.type===wt.EXPLORING?this._getPosition():this.type===wt.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getRoll",value:function(){return this.roll}},{key:"_update",value:function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()}},{key:"computeMatrix",value:function(){var t=Ia(vn(),[0,0,1],ft(this.roll));Ta(this.matrix);var n=Ia(vn(),[1,0,0],ft((this.rotateWorld&&this.type!==wt.TRACKING||this.type===wt.TRACKING?1:-1)*this.elevation)),i=Ia(vn(),[0,1,0],ft((this.rotateWorld&&this.type!==wt.TRACKING||this.type===wt.TRACKING?1:-1)*this.azimuth)),a=_a(vn(),i,n);a=_a(vn(),a,t);var s=Df(Ct(),a);this.type===wt.ORBITING||this.type===wt.EXPLORING?(fo(this.matrix,this.matrix,this.focalPoint),Xn(this.matrix,this.matrix,s),fo(this.matrix,this.matrix,[0,0,this.distance])):this.type===wt.TRACKING&&(fo(this.matrix,this.matrix,this.position),Xn(this.matrix,this.matrix,s))}},{key:"_setPosition",value:function(t,n,i){this.position=Ar(t,n,i);var a=this.matrix;a[12]=this.position[0],a[13]=this.position[1],a[14]=this.position[2],a[15]=1,this._getOrthoMatrix()}},{key:"_getAxes",value:function(){Ni(this.right,Ar(sa(Qi(),[1,0,0,0],this.matrix))),Ni(this.up,Ar(sa(Qi(),[0,1,0,0],this.matrix))),Ni(this.forward,Ar(sa(Qi(),[0,0,1,0],this.matrix))),ys(this.right,this.right),ys(this.up,this.up),ys(this.forward,this.forward)}},{key:"_getAngles",value:function(){var t=this.distanceVector[0],n=this.distanceVector[1],i=this.distanceVector[2],a=aa(this.distanceVector);if(a===0){this.elevation=0,this.azimuth=0;return}this.type===wt.TRACKING?(this.elevation=Br(Math.asin(n/a)),this.azimuth=Br(Math.atan2(-t,-i))):this.rotateWorld?(this.elevation=Br(Math.asin(n/a)),this.azimuth=Br(Math.atan2(-t,-i))):(this.elevation=-Br(Math.asin(n/a)),this.azimuth=-Br(Math.atan2(-t,-i)))}},{key:"_getPosition",value:function(){Ni(this.position,Ar(sa(Qi(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){ZP(this.distanceVector,[0,0,-this.distance],FP(Db(),this.matrix)),Oa(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=Gf(Je(),this.focalPoint,this.position),this.distance=aa(this.distanceVector),this.dollyingStep=this.distance/100}},{key:"_getOrthoMatrix",value:function(){if(this.projectionMode===$r.ORTHOGRAPHIC){var t=this.position,n=Ia(vn(),[0,0,1],-this.roll*Math.PI/180);gA(this.orthoMatrix,n,St((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),St(this.zoom,this.zoom,1),t)}}},{key:"triggerUpdate",value:function(){if(this.enableUpdate){var t=this.getViewTransform(),n=Xn(Ct(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(n),this.eventEmitter.emit(KE.UPDATED)}}},{key:"rotate",value:function(t,n,i){throw new Error(mt)}},{key:"pan",value:function(t,n){throw new Error(mt)}},{key:"dolly",value:function(t){throw new Error(mt)}},{key:"createLandmark",value:function(t,n){throw new Error(mt)}},{key:"gotoLandmark",value:function(t,n){throw new Error(mt)}},{key:"cancelLandmarkAnimation",value:function(){throw new Error(mt)}}])})(),qD=(function(r){return r[r.Standard=0]="Standard",r})({}),xc=(function(r){return r[r.ADDED=0]="ADDED",r[r.REMOVED=1]="REMOVED",r[r.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED",r})({}),$D=Je(),CA=Ct(),YD=vn();function jE(r){if(r.localDirtyFlag){var e=r.localSkew[0]!==0||r.localSkew[1]!==0;if(e){gA(r.localTransform,r.localRotation,r.localPosition,St(1,1,1),r.origin),(r.localSkew[0]!==0||r.localSkew[1]!==0)&&(Ta(CA),CA[4]=Math.tan(r.localSkew[0]),CA[1]=Math.tan(r.localSkew[1]),Xn(r.localTransform,r.localTransform,CA));var t=gA(CA,AE(YD,0,0,0,1),Zn($D,1,1,1),r.localScale,r.origin);Xn(r.localTransform,r.localTransform,t)}else{var n=r.localTransform,i=r.localPosition,a=r.localRotation,s=r.localScale,o=r.origin,A=i[0]!==0||i[1]!==0||i[2]!==0,l=a[3]!==1||a[0]!==0||a[1]!==0||a[2]!==0,c=s[0]!==1||s[1]!==1||s[2]!==1,u=o[0]!==0||o[1]!==0||o[2]!==0;!l&&!c&&!u?A?Ma(n,i):Ta(n):gA(n,a,i,s,o)}r.localDirtyFlag=!1}}function XD(r,e){r.dirtyFlag&&(e?Xn(r.worldTransform,e.worldTransform,r.localTransform):ho(r.worldTransform,r.localTransform),r.dirtyFlag=!1)}var WE={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Bo(0,0,0,0)},ve=(function(r){return r.COORDINATE="<coordinate>",r.COLOR="<color>",r.PAINT="<paint>",r.NUMBER="<number>",r.ANGLE="<angle>",r.OPACITY_VALUE="<opacity-value>",r.SHADOW_BLUR="<shadow-blur>",r.LENGTH="<length>",r.PERCENTAGE="<percentage>",r.LENGTH_PERCENTAGE="<length> | <percentage>",r.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",r.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",r.LIST_OF_POINTS="<list-of-points>",r.PATH="<path>",r.FILTER="<filter>",r.Z_INDEX="<z-index>",r.OFFSET_DISTANCE="<offset-distance>",r.DEFINED_PATH="<defined-path>",r.MARKER="<marker>",r.TRANSFORM="<transform>",r.TRANSFORM_ORIGIN="<transform-origin>",r.TEXT="<text>",r.TEXT_TRANSFORM="<text-transform>",r})({});function gg(r,e,t){r.prototype=e.prototype=t,t.constructor=r}function qE(r,e){var t=Object.create(r.prototype);for(var n in e)t[n]=e[n];return t}function SA(){}var FA=.7,Cc=1/FA,xo="\\s*([+-]?\\d+)\\s*",TA="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Di="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ZD=/^#([0-9a-f]{3,8})$/,JD=new RegExp(`^rgb\\(${xo},${xo},${xo}\\)$`),e3=new RegExp(`^rgb\\(${Di},${Di},${Di}\\)$`),t3=new RegExp(`^rgba\\(${xo},${xo},${xo},${TA}\\)$`),n3=new RegExp(`^rgba\\(${Di},${Di},${Di},${TA}\\)$`),r3=new RegExp(`^hsl\\(${TA},${Di},${Di}\\)$`),i3=new RegExp(`^hsla\\(${TA},${Di},${Di},${TA}\\)$`),$E={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};gg(SA,Sc,{copy(r){return Object.assign(new this.constructor,this,r)},displayable(){return this.rgb().displayable()},hex:YE,formatHex:YE,formatHex8:a3,formatHsl:s3,formatRgb:XE,toString:XE});function YE(){return this.rgb().formatHex()}function a3(){return this.rgb().formatHex8()}function s3(){return nx(this).formatHsl()}function XE(){return this.rgb().formatRgb()}function Sc(r){var e,t;return r=(r+"").trim().toLowerCase(),(e=ZD.exec(r))?(t=e[1].length,e=parseInt(e[1],16),t===6?ZE(e):t===3?new br(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?Fc(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?Fc(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=JD.exec(r))?new br(e[1],e[2],e[3],1):(e=e3.exec(r))?new br(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=t3.exec(r))?Fc(e[1],e[2],e[3],e[4]):(e=n3.exec(r))?Fc(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=r3.exec(r))?tx(e[1],e[2]/100,e[3]/100,1):(e=i3.exec(r))?tx(e[1],e[2]/100,e[3]/100,e[4]):$E.hasOwnProperty(r)?ZE($E[r]):r==="transparent"?new br(NaN,NaN,NaN,0):null}function ZE(r){return new br(r>>16&255,r>>8&255,r&255,1)}function Fc(r,e,t,n){return n<=0&&(r=e=t=NaN),new br(r,e,t,n)}function o3(r){return r instanceof SA||(r=Sc(r)),r?(r=r.rgb(),new br(r.r,r.g,r.b,r.opacity)):new br}function A3(r,e,t,n){return arguments.length===1?o3(r):new br(r,e,t,n??1)}function br(r,e,t,n){this.r=+r,this.g=+e,this.b=+t,this.opacity=+n}gg(br,A3,qE(SA,{brighter(r){return r=r==null?Cc:Math.pow(Cc,r),new br(this.r*r,this.g*r,this.b*r,this.opacity)},darker(r){return r=r==null?FA:Math.pow(FA,r),new br(this.r*r,this.g*r,this.b*r,this.opacity)},rgb(){return this},clamp(){return new br(ws(this.r),ws(this.g),ws(this.b),Tc(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:JE,formatHex:JE,formatHex8:l3,formatRgb:ex,toString:ex}));function JE(){return`#${Bs(this.r)}${Bs(this.g)}${Bs(this.b)}`}function l3(){return`#${Bs(this.r)}${Bs(this.g)}${Bs(this.b)}${Bs((isNaN(this.opacity)?1:this.opacity)*255)}`}function ex(){const r=Tc(this.opacity);return`${r===1?"rgb(":"rgba("}${ws(this.r)}, ${ws(this.g)}, ${ws(this.b)}${r===1?")":`, ${r})`}`}function Tc(r){return isNaN(r)?1:Math.max(0,Math.min(1,r))}function ws(r){return Math.max(0,Math.min(255,Math.round(r)||0))}function Bs(r){return r=ws(r),(r<16?"0":"")+r.toString(16)}function tx(r,e,t,n){return n<=0?r=e=t=NaN:t<=0||t>=1?r=e=NaN:e<=0&&(r=NaN),new fi(r,e,t,n)}function nx(r){if(r instanceof fi)return new fi(r.h,r.s,r.l,r.opacity);if(r instanceof SA||(r=Sc(r)),!r)return new fi;if(r instanceof fi)return r;r=r.rgb();var e=r.r/255,t=r.g/255,n=r.b/255,i=Math.min(e,t,n),a=Math.max(e,t,n),s=NaN,o=a-i,A=(a+i)/2;return o?(e===a?s=(t-n)/o+(t<n)*6:t===a?s=(n-e)/o+2:s=(e-t)/o+4,o/=A<.5?a+i:2-a-i,s*=60):o=A>0&&A<1?0:s,new fi(s,o,A,r.opacity)}function c3(r,e,t,n){return arguments.length===1?nx(r):new fi(r,e,t,n??1)}function fi(r,e,t,n){this.h=+r,this.s=+e,this.l=+t,this.opacity=+n}gg(fi,c3,qE(SA,{brighter(r){return r=r==null?Cc:Math.pow(Cc,r),new fi(this.h,this.s,this.l*r,this.opacity)},darker(r){return r=r==null?FA:Math.pow(FA,r),new fi(this.h,this.s,this.l*r,this.opacity)},rgb(){var r=this.h%360+(this.h<0)*360,e=isNaN(r)||isNaN(this.s)?0:this.s,t=this.l,n=t+(t<.5?t:1-t)*e,i=2*t-n;return new br(pg(r>=240?r-240:r+120,i,n),pg(r,i,n),pg(r<120?r+240:r-120,i,n),this.opacity)},clamp(){return new fi(rx(this.h),Mc(this.s),Mc(this.l),Tc(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const r=Tc(this.opacity);return`${r===1?"hsl(":"hsla("}${rx(this.h)}, ${Mc(this.s)*100}%, ${Mc(this.l)*100}%${r===1?")":`, ${r})`}`}}));function rx(r){return r=(r||0)%360,r<0?r+360:r}function Mc(r){return Math.max(0,Math.min(1,r||0))}function pg(r,e,t){return(r<60?e+(t-e)*r/60:r<180?t:r<240?e+(t-e)*(240-r)/60:e)*255}function An(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError("Expected a function");var t=function(){for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];var o=e?e.apply(this,a):a[0],A=t.cache;if(A.has(o))return A.get(o);var l=r.apply(this,a);return t.cache=A.set(o,l)||A,l};return t.cache=new(An.Cache||Map),An.cacheList.push(t.cache),t}An.Cache=Map,An.cacheList=[],An.clearCache=function(){An.cacheList.forEach(function(r){return r.clear()})};var we=(function(r){return r[r.kUnknown=0]="kUnknown",r[r.kNumber=1]="kNumber",r[r.kPercentage=2]="kPercentage",r[r.kEms=3]="kEms",r[r.kPixels=4]="kPixels",r[r.kRems=5]="kRems",r[r.kDegrees=6]="kDegrees",r[r.kRadians=7]="kRadians",r[r.kGradians=8]="kGradians",r[r.kTurns=9]="kTurns",r[r.kMilliseconds=10]="kMilliseconds",r[r.kSeconds=11]="kSeconds",r[r.kInteger=12]="kInteger",r})({}),gi=(function(r){return r[r.kUNumber=0]="kUNumber",r[r.kUPercent=1]="kUPercent",r[r.kULength=2]="kULength",r[r.kUAngle=3]="kUAngle",r[r.kUTime=4]="kUTime",r[r.kUOther=5]="kUOther",r})({}),u3=(function(r){return r[r.kYes=0]="kYes",r[r.kNo=1]="kNo",r})({}),h3=(function(r){return r[r.kYes=0]="kYes",r[r.kNo=1]="kNo",r})({}),d3=[{name:"em",unit_type:we.kEms},{name:"px",unit_type:we.kPixels},{name:"deg",unit_type:we.kDegrees},{name:"rad",unit_type:we.kRadians},{name:"grad",unit_type:we.kGradians},{name:"ms",unit_type:we.kMilliseconds},{name:"s",unit_type:we.kSeconds},{name:"rem",unit_type:we.kRems},{name:"turn",unit_type:we.kTurns}],Co=(function(r){return r[r.kUnknownType=0]="kUnknownType",r[r.kUnparsedType=1]="kUnparsedType",r[r.kKeywordType=2]="kKeywordType",r[r.kUnitType=3]="kUnitType",r[r.kSumType=4]="kSumType",r[r.kProductType=5]="kProductType",r[r.kNegateType=6]="kNegateType",r[r.kInvertType=7]="kInvertType",r[r.kMinType=8]="kMinType",r[r.kMaxType=9]="kMaxType",r[r.kClampType=10]="kClampType",r[r.kTransformType=11]="kTransformType",r[r.kPositionType=12]="kPositionType",r[r.kURLImageType=13]="kURLImageType",r[r.kColorType=14]="kColorType",r[r.kUnsupportedColorType=15]="kUnsupportedColorType",r})({}),f3=function(e){return d3.find(function(t){return t.name===e}).unit_type},g3=function(e){return e?e==="number"?we.kNumber:e==="percent"||e==="%"?we.kPercentage:f3(e):we.kUnknown},p3=function(e){switch(e){case we.kNumber:case we.kInteger:return gi.kUNumber;case we.kPercentage:return gi.kUPercent;case we.kPixels:return gi.kULength;case we.kMilliseconds:case we.kSeconds:return gi.kUTime;case we.kDegrees:case we.kRadians:case we.kGradians:case we.kTurns:return gi.kUAngle;default:return gi.kUOther}},v3=function(e){switch(e){case gi.kUNumber:return we.kNumber;case gi.kULength:return we.kPixels;case gi.kUPercent:return we.kPercentage;case gi.kUTime:return we.kSeconds;case gi.kUAngle:return we.kDegrees;default:return we.kUnknown}},ix=function(e){var t=1;switch(e){case we.kPixels:case we.kDegrees:case we.kSeconds:break;case we.kMilliseconds:t=.001;break;case we.kRadians:t=180/Math.PI;break;case we.kGradians:t=.9;break;case we.kTurns:t=360;break}return t},vg=function(e){switch(e){case we.kNumber:case we.kInteger:return"";case we.kPercentage:return"%";case we.kEms:return"em";case we.kRems:return"rem";case we.kPixels:return"px";case we.kDegrees:return"deg";case we.kRadians:return"rad";case we.kGradians:return"grad";case we.kMilliseconds:return"ms";case we.kSeconds:return"s";case we.kTurns:return"turn"}return""},Oc=(function(){function r(){le(this,r)}return ce(r,[{key:"toString",value:function(){return this.buildCSSText(u3.kNo,h3.kNo,"")}},{key:"isNumericValue",value:function(){return this.getType()>=Co.kUnitType&&this.getType()<=Co.kClampType}}],[{key:"isAngle",value:function(t){return t===we.kDegrees||t===we.kRadians||t===we.kGradians||t===we.kTurns}},{key:"isLength",value:function(t){return t>=we.kEms&&t<we.kDegrees}},{key:"isRelativeUnit",value:function(t){return t===we.kPercentage||t===we.kEms||t===we.kRems}},{key:"isTime",value:function(t){return t===we.kSeconds||t===we.kMilliseconds}}])})(),y3=(function(r){function e(t){var n;return le(this,e),n=We(this,e),n.colorSpace=t,n}return qe(e,r),ce(e,[{key:"getType",value:function(){return Co.kColorType}},{key:"to",value:function(n){return this}}])})(Oc),Pa=(function(r){return r[r.Constant=0]="Constant",r[r.LinearGradient=1]="LinearGradient",r[r.RadialGradient=2]="RadialGradient",r})({}),Ic=(function(r){function e(t,n){var i;return le(this,e),i=We(this,e),i.type=t,i.value=n,i}return qe(e,r),ce(e,[{key:"clone",value:function(){return new e(this.type,this.value)}},{key:"buildCSSText",value:function(n,i,a){return a}},{key:"getType",value:function(){return Co.kColorType}}])})(Oc),Yr=(function(r){function e(t){var n;return le(this,e),n=We(this,e),n.value=t,n}return qe(e,r),ce(e,[{key:"clone",value:function(){return new e(this.value)}},{key:"getType",value:function(){return Co.kKeywordType}},{key:"buildCSSText",value:function(n,i,a){return a+this.value}}])})(Oc),m3=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",n="";return Number.isFinite(e)?n="NaN":e>0?n="infinity":n="-infinity",n+=t},yg=function(e){return v3(p3(e))},Bt=(function(r){function e(t){var n,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:we.kNumber;le(this,e),n=We(this,e);var a;return typeof i=="string"?a=g3(i):a=i,n.unit=a,n.value=t,n}return qe(e,r),ce(e,[{key:"clone",value:function(){return new e(this.value,this.unit)}},{key:"equals",value:function(n){var i=n;return this.value===i.value&&this.unit===i.unit}},{key:"getType",value:function(){return Co.kUnitType}},{key:"convertTo",value:function(n){if(this.unit===n)return new e(this.value,this.unit);var i=yg(this.unit);if(i!==yg(n)||i===we.kUnknown)return null;var a=ix(this.unit)/ix(n);return new e(this.value*a,n)}},{key:"buildCSSText",value:function(n,i,a){var s;switch(this.unit){case we.kUnknown:break;case we.kInteger:s=Number(this.value).toFixed(0);break;case we.kNumber:case we.kPercentage:case we.kEms:case we.kRems:case we.kPixels:case we.kDegrees:case we.kRadians:case we.kGradians:case we.kMilliseconds:case we.kSeconds:case we.kTurns:{var o=-999999,A=999999,l=this.value,c=vg(this.unit);if(l<o||l>A){var u=vg(this.unit);!Number.isFinite(l)||Number.isNaN(l)?s=m3(l,u):s=l+(u||"")}else s="".concat(l).concat(c)}}return a+=s,a}}])})(Oc),pi=new Bt(0,"px");new Bt(1,"px");var bs=new Bt(0,"deg"),mg=(function(r){function e(t,n,i){var a,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;return le(this,e),a=We(this,e,["rgb"]),a.r=t,a.g=n,a.b=i,a.alpha=s,a.isNone=o,a}return qe(e,r),ce(e,[{key:"clone",value:function(){return new e(this.r,this.g,this.b,this.alpha)}},{key:"buildCSSText",value:function(n,i,a){return"".concat(a,"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")}}])})(y3),ax=new Yr("unset"),w3=new Yr("initial"),B3=new Yr("inherit"),wg={"":ax,unset:ax,initial:w3,inherit:B3},b3=function(e){return wg[e]||(wg[e]=new Yr(e)),wg[e]},sx=new mg(0,0,0,0,!0),ox=new mg(0,0,0,0),E3=An(function(r,e,t,n){return new mg(r,e,t,n)},function(r,e,t,n){return"rgba(".concat(r,",").concat(e,",").concat(t,",").concat(n,")")}),Rt=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:we.kNumber;return new Bt(e,t)};new Bt(50,"%");function x3(r){var e=r.type,t=r.value;return e==="hex"?"#".concat(t):e==="literal"?t:e==="rgb"?"rgb(".concat(t.join(","),")"):"rgba(".concat(t.join(","),")")}var C3=(function(){var r={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 t(q){throw new Error("".concat(e,": ").concat(q))}function n(){var q=i();return e.length>0&&t("Invalid input not EOF"),q}function i(){return m(a)}function a(){return s("linear-gradient",r.linearGradient,A)||s("repeating-linear-gradient",r.repeatingLinearGradient,A)||s("radial-gradient",r.radialGradient,u)||s("repeating-radial-gradient",r.repeatingRadialGradient,u)||s("conic-gradient",r.conicGradient,u)}function s(q,j,te){return o(j,function(ue){var ge=te();return ge&&(G(r.comma)||t("Missing comma before color stops")),{type:q,orientation:ge,colorStops:m(B)}})}function o(q,j){var te=G(q);if(te){G(r.startCall)||t("Missing (");var ue=j(te);return G(r.endCall)||t("Missing )"),ue}}function A(){return l()||c()}function l(){return D("directional",r.sideOrCorner,1)}function c(){return D("angular",r.angleValue,1)}function u(){var q,j=h(),te;return j&&(q=[],q.push(j),te=e,G(r.comma)&&(j=h(),j?q.push(j):e=te)),q}function h(){var q=d()||f();if(q)q.at=p();else{var j=g();if(j){q=j;var te=p();te&&(q.at=te)}else{var ue=v();ue&&(q={type:"default-radial",at:ue})}}return q}function d(){var q=D("shape",/^(circle)/i,0);return q&&(q.style=U()||g()),q}function f(){var q=D("shape",/^(ellipse)/i,0);return q&&(q.style=k()||g()),q}function g(){return D("extent-keyword",r.extentKeywords,1)}function p(){if(D("position",/^at/,0)){var q=v();return q||t("Missing positioning value"),q}}function v(){var q=y();if(q.x||q.y)return{type:"position",value:q}}function y(){return{x:k(),y:k()}}function m(q){var j=q(),te=[];if(j)for(te.push(j);G(r.comma);)j=q(),j?te.push(j):t("One extra comma");return te}function B(){var q=C();return q||t("Expected color definition"),q.length=k(),q}function C(){return F()||O()||T()||S()}function S(){return D("literal",r.literalColor,0)}function F(){return D("hex",r.hexColor,1)}function T(){return o(r.rgbColor,function(){return{type:"rgb",value:m(I)}})}function O(){return o(r.rgbaColor,function(){return{type:"rgba",value:m(I)}})}function I(){return G(r.number)[1]}function k(){return D("%",r.percentageValue,1)||N()||U()}function N(){return D("position-keyword",r.positionKeywords,1)}function U(){return D("px",r.pixelValue,1)||D("em",r.emValue,1)}function D(q,j,te){var ue=G(j);if(ue)return{type:q,value:ue[te]}}function G(q){var j=/^[\n\r\t\s]+/.exec(e);j&&Z(j[0].length);var te=q.exec(e);return te&&Z(te[0].length),te}function Z(q){e=e.substring(q)}return function(q){return e=q,n()}})();function S3(r,e,t,n){var i=ft(n.value),a=0,s=0,o=a+e/2,A=s+t/2,l=Math.abs(e*Math.cos(i))+Math.abs(t*Math.sin(i)),c=r[0]+o-Math.cos(i)*l/2,u=r[1]+A-Math.sin(i)*l/2,h=r[0]+o+Math.cos(i)*l/2,d=r[1]+A+Math.sin(i)*l/2;return{x1:c,y1:u,x2:h,y2:d}}function F3(r,e,t,n,i,a){var s=n.value,o=i.value;n.unit===we.kPercentage&&(s=n.value/100*e),i.unit===we.kPercentage&&(o=i.value/100*t);var A=Math.max(wr([0,0],[s,o]),wr([0,t],[s,o]),wr([e,t],[s,o]),wr([e,0],[s,o]));return a&&(a instanceof Bt?A=a.value:a instanceof Yr&&(a.value==="closest-side"?A=Math.min(s,e-s,o,t-o):a.value==="farthest-side"?A=Math.max(s,e-s,o,t-o):a.value==="closest-corner"&&(A=Math.min(wr([0,0],[s,o]),wr([0,t],[s,o]),wr([e,t],[s,o]),wr([e,0],[s,o]))))),{x:s+r[0],y:o+r[1],r:A}}var T3=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,M3=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,O3=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Ax=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function I3(r){var e,t=r.length;if(r[t-1].length=(e=r[t-1].length)!==null&&e!==void 0?e:{type:"%",value:"100"},t>1){var n;r[0].length=(n=r[0].length)!==null&&n!==void 0?n:{type:"%",value:"0"}}for(var i=0,a=Number(r[0].length.value),s=1;s<t;s++){var o,A=(o=r[s].length)===null||o===void 0?void 0:o.value;if(!ke(A)&&!ke(a)){for(var l=1;l<s-i;l++)r[i+l].length={type:"%",value:"".concat(a+(Number(A)-a)*l/(s-i))};i=s,a=Number(A)}}}var _3={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},k3=An(function(r){var e;return r.type==="angular"?e=Number(r.value):e=_3[r.value]||0,Rt(e,"deg")}),N3=An(function(r){var e=50,t=50,n="%",i="%";if(r?.type==="position"){var a=r.value,s=a.x,o=a.y;s?.type==="position-keyword"&&(s.value==="left"?e=0:s.value==="center"?e=50:s.value==="right"?e=100:s.value==="top"?t=0:s.value==="bottom"&&(t=100)),o?.type==="position-keyword"&&(o.value==="left"?e=0:o.value==="center"?t=50:o.value==="right"?e=100:o.value==="top"?t=0:o.value==="bottom"&&(t=100)),(s?.type==="px"||s?.type==="%"||s?.type==="em")&&(n=s?.type,e=Number(s.value)),(o?.type==="px"||o?.type==="%"||o?.type==="em")&&(i=o?.type,t=Number(o.value))}return{cx:Rt(e,n),cy:Rt(t,i)}}),L3=An(function(r){if(r.indexOf("linear")>-1||r.indexOf("radial")>-1){var e=C3(r);return e.map(function(o){var A=o.type,l=o.orientation,c=o.colorStops;I3(c);var u=c.map(function(m){return{offset:Rt(Number(m.length.value),"%"),color:x3(m)}});if(A==="linear-gradient")return new Ic(Pa.LinearGradient,{angle:l?k3(l):bs,steps:u});if(A==="radial-gradient"&&(l||(l=[{type:"shape",value:"circle"}]),l[0].type==="shape"&&l[0].value==="circle")){var h=N3(l[0].at),d=h.cx,f=h.cy,g;if(l[0].style){var p=l[0].style,v=p.type,y=p.value;v==="extent-keyword"?g=b3(y):g=Rt(y,v)}return new Ic(Pa.RadialGradient,{cx:d,cy:f,size:g,steps:u})}})}var t=r[0];if(r[1]==="("||r[2]==="("){if(t==="l"){var n=T3.exec(r);if(n){var i,a=((i=n[2].match(Ax))===null||i===void 0?void 0:i.map(function(o){return o.split(":")}))||[];return[new Ic(Pa.LinearGradient,{angle:Rt(parseFloat(n[1]),"deg"),steps:a.map(function(o){var A=$e(o,2),l=A[0],c=A[1];return{offset:Rt(Number(l)*100,"%"),color:c}})})]}}else if(t==="r"){var s=Q3(r);if(s)if(ot(s))r=s;else return[new Ic(Pa.RadialGradient,s)]}else if(t==="p")return U3(r)}});function Q3(r){var e=M3.exec(r);if(e){var t,n=((t=e[4].match(Ax))===null||t===void 0?void 0:t.map(function(i){return i.split(":")}))||[];return{cx:Rt(50,"%"),cy:Rt(50,"%"),steps:n.map(function(i){var a=$e(i,2),s=a[0],o=a[1];return{offset:Rt(Number(s)*100,"%"),color:o}})}}return null}function U3(r){var e=O3.exec(r);if(e){var t=e[1],n=e[2];switch(t){case"a":t="repeat";break;case"x":t="repeat-x";break;case"y":t="repeat-y";break;case"n":t="no-repeat";break;default:t="no-repeat"}return{image:n,repetition:t}}return null}function Es(r){return r&&!!r.image}function _c(r){return r&&!ke(r.r)&&!ke(r.g)&&!ke(r.b)}var MA=An(function(r){if(Es(r))return De({repetition:"repeat"},r);if(ke(r)&&(r=""),r==="transparent")return ox;if(r==="currentColor")r="black";else if(r==="none")return sx;var e=L3(r);if(e)return e;var t=Sc(r),n=[0,0,0,0];return t!==null&&(n[0]=t.r||0,n[1]=t.g||0,n[2]=t.b||0,n[3]=t.opacity),E3.apply(void 0,n)});function P3(r,e){if(!(!_c(r)||!_c(e)))return[[Number(r.r),Number(r.g),Number(r.b),Number(r.alpha)],[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],function(t){var n=t.slice();if(n[3])for(var i=0;i<3;i++)n[i]=Math.round(Yt(n[i],0,255));return n[3]=Yt(n[3],0,1),"rgba(".concat(n.join(","),")")}]}function OA(r,e){if(ke(e))return Rt(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(r)>=0)return Rt(Number(e),"px");if("deg".search(r)>=0)return Rt(Number(e),"deg")}var t=[];e=e.replace(r,function(i){return t.push(i),"U".concat(i)});var n="U(".concat(r.source,")");return t.map(function(i){return Rt(Number(e.replace(new RegExp("U".concat(i),"g"),"").replace(new RegExp(n,"g"),"*0")),i)})[0]}var lx=function(e){return OA(new RegExp("px","g"),e)},R3=An(lx),D3=function(e){return OA(new RegExp("%","g"),e)};An(D3);var cx=function(e){return Be(e)||isFinite(Number(e))?Rt(Number(e)||0,"px"):OA(new RegExp("px|%|em|rem","g"),e)},Bg=An(cx),ux=function(e){return OA(new RegExp("deg|rad|grad|turn","g"),e)},H3=An(ux);function G3(r,e,t,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,a="",s=r.value||0,o=e.value||0,A=yg(r.unit),l=r.convertTo(A),c=e.convertTo(A);return l&&c?(s=l.value,o=c.value,a=vg(r.unit)):(Bt.isLength(r.unit)||Bt.isLength(e.unit))&&(s=Nr(r,i,t),o=Nr(e,i,t),a="px"),[s,o,function(u){return u+a}]}function Er(r){var e=0;return r.unit===we.kDegrees?e=r.value:r.unit===we.kRadians?e=Br(Number(r.value)):r.unit===we.kTurns?e=DD(Number(r.value)):r.value&&(e=r.value),e}function hx(r,e){var t;return Array.isArray(r)?t=r.map(function(n){return Number(n)}):ot(r)?t=r.split(" ").map(function(n){return Number(n)}):Be(r)&&(t=[r]),e===2?t.length===1?[t[0],t[0]]:[t[0],t[1]]:e===4?t.length===1?[t[0],t[0],t[0],t[0]]:t.length===2?[t[0],t[1],t[0],t[1]]:t.length===3?[t[0],t[1],t[2],t[1]]:[t[0],t[1],t[2],t[3]]:e==="even"&&t.length%2===1?[].concat(tt(t),tt(t)):t}function Nr(r,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(r.unit===we.kPixels)return Number(r.value);if(r.unit===we.kPercentage&&t){var i=t.nodeName===re.GROUP?t.getLocalBounds():t.getGeometryBounds();return(n?i.min[e]:0)+r.value/100*i.halfExtents[e]*2}return 0}var K3=function(e){return OA(/deg|rad|grad|turn|px|%/g,e)},z3=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function V3(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";if(r=r.toLowerCase().trim(),r==="none")return[];for(var e=/\s*([\w-]+)\(([^)]*)\)/g,t=[],n,i=0;n=e.exec(r);){if(n.index!==i)return[];if(i=n.index+n[0].length,z3.indexOf(n[1])>-1&&t.push({name:n[1],params:n[2].split(" ").map(function(a){return K3(a)||MA(a)})}),e.lastIndex===r.length)return t}return[]}function dx(r){return r.toString()}var fx=function(e){return typeof e=="number"?Rt(e):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(e)?Rt(Number(e)):Rt(0)},bg=An(fx);An(function(r){return ot(r)?r.split(" ").map(bg):r.map(bg)});function Eg(r,e){return[r,e,dx]}function xg(r,e){return function(t,n){return[t,n,function(i){return dx(Yt(i,r,e))}]}}function gx(r,e){if(r.length===e.length)return[r,e,function(t){return t}]}function Cg(r){return r.parsedStyle.d.totalLength===0&&(r.parsedStyle.d.totalLength=sD(r.parsedStyle.d.absolutePath)),r.parsedStyle.d.totalLength}function j3(r){return r.parsedStyle.points.totalLength===0&&(r.parsedStyle.points.totalLength=CD(r.parsedStyle.points.points)),r.parsedStyle.points.totalLength}function W3(r){for(var e=0;e<r.length;e++){var t=r[e-1],n=r[e],i=n[0];if(i==="M"&&t){var a=t[0],s=[n[1],n[2]],o=void 0;a==="L"||a==="M"?o=[t[1],t[2]]:(a==="C"||a==="A"||a==="Q")&&(o=[t[t.length-2],t[t.length-1]]),o&&kc(s,o)&&(r.splice(e,1),e--)}}}function q3(r){for(var e=!1,t=r.length,n=0;n<t;n++){var i=r[n],a=i[0];if(a==="C"||a==="A"||a==="Q"){e=!0;break}}return e}function $3(r){for(var e=[],t=[],n=[],i=0;i<r.length;i++){var a=r[i],s=a[0];s==="M"?(n.length&&(t.push(n),n=[]),n.push([a[1],a[2]])):s==="Z"?n.length&&(e.push(n),n=[]):n.push([a[1],a[2]])}return n.length>0&&t.push(n),{polygons:e,polylines:t}}function kc(r,e){return r[0]===e[0]&&r[1]===e[1]}function Y3(r,e){for(var t=[],n=[],i=[],a=0;a<r.length;a++){var s=r[a],o=s.currentPoint,A=s.params,l=s.prePoint,c=void 0;switch(s.command){case"Q":c=SD(l[0],l[1],A[1],A[2],A[3],A[4]);break;case"C":c=bD(l[0],l[1],A[1],A[2],A[3],A[4],A[5],A[6]);break;case"A":var u=s.arcParams;c=mD(u.cx,u.cy,u.rx,u.ry,u.xRotation,u.startAngle,u.endAngle);break;default:t.push(o[0]),n.push(o[1]);break}c&&(s.box=c,t.push(c.x,c.x+c.width),n.push(c.y,c.y+c.height))}t=t.filter(function(B){return!Number.isNaN(B)&&B!==1/0&&B!==-1/0}),n=n.filter(function(B){return!Number.isNaN(B)&&B!==1/0&&B!==-1/0});var h=dc(t),d=dc(n),f=hc(t),g=hc(n);if(i.length===0)return{x:h,y:d,width:f-h,height:g-d};for(var p=0;p<i.length;p++){var v=i[p],y=v.currentPoint,m=void 0;y[0]===h?(m=Nc(v,e),h-=m.xExtra):y[0]===f&&(m=Nc(v,e),f+=m.xExtra),y[1]===d?(m=Nc(v,e),d-=m.yExtra):y[1]===g&&(m=Nc(v,e),g+=m.yExtra)}return{x:h,y:d,width:f-h,height:g-d}}function Nc(r,e){var t=r.prePoint,n=r.currentPoint,i=r.nextPoint,a=Math.pow(n[0]-t[0],2)+Math.pow(n[1]-t[1],2),s=Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2),o=Math.pow(t[0]-i[0],2)+Math.pow(t[1]-i[1],2),A=Math.acos((a+s-o)/(2*Math.sqrt(a)*Math.sqrt(s)));if(!A||Math.sin(A)===0||vo(A,0))return{xExtra:0,yExtra:0};var l=Math.abs(Math.atan2(i[1]-n[1],i[0]-n[0])),c=Math.abs(Math.atan2(i[0]-n[0],i[1]-n[1]));l=l>Math.PI/2?Math.PI-l:l,c=c>Math.PI/2?Math.PI-c:c;var u={xExtra:Math.cos(A/2-l)*(e/2*(1/Math.sin(A/2)))-e/2||0,yExtra:Math.cos(c-A/2)*(e/2*(1/Math.sin(A/2)))-e/2||0};return u}function px(r,e){return[e[0]+(e[0]-r[0]),e[1]+(e[1]-r[1])]}var vx=function(e,t){var n=e.x*t.x+e.y*t.y,i=Math.sqrt((Math.pow(e.x,2)+Math.pow(e.y,2))*(Math.pow(t.x,2)+Math.pow(t.y,2))),a=e.x*t.y-e.y*t.x<0?-1:1,s=a*Math.acos(n/i);return s},yx=function(e,t,n,i,a,s,o,A){t=Math.abs(t),n=Math.abs(n),i=hE(i,360);var l=ft(i);if(e.x===o.x&&e.y===o.y)return{x:e.x,y:e.y,ellipticalArcAngle:0};if(t===0||n===0)return{x:0,y:0,ellipticalArcAngle:0};var c=(e.x-o.x)/2,u=(e.y-o.y)/2,h={x:Math.cos(l)*c+Math.sin(l)*u,y:-Math.sin(l)*c+Math.cos(l)*u},d=Math.pow(h.x,2)/Math.pow(t,2)+Math.pow(h.y,2)/Math.pow(n,2);d>1&&(t*=Math.sqrt(d),n*=Math.sqrt(d));var f=Math.pow(t,2)*Math.pow(n,2)-Math.pow(t,2)*Math.pow(h.y,2)-Math.pow(n,2)*Math.pow(h.x,2),g=Math.pow(t,2)*Math.pow(h.y,2)+Math.pow(n,2)*Math.pow(h.x,2),p=f/g;p=p<0?0:p;var v=(a!==s?1:-1)*Math.sqrt(p),y={x:v*(t*h.y/n),y:v*(-(n*h.x)/t)},m={x:Math.cos(l)*y.x-Math.sin(l)*y.y+(e.x+o.x)/2,y:Math.sin(l)*y.x+Math.cos(l)*y.y+(e.y+o.y)/2},B={x:(h.x-y.x)/t,y:(h.y-y.y)/n},C=vx({x:1,y:0},B),S={x:(-h.x-y.x)/t,y:(-h.y-y.y)/n},F=vx(B,S);!s&&F>0?F-=2*Math.PI:s&&F<0&&(F+=2*Math.PI),F%=2*Math.PI;var T=C+F*A,O=t*Math.cos(T),I=n*Math.sin(T),k={x:Math.cos(l)*O-Math.sin(l)*I+m.x,y:Math.sin(l)*O+Math.cos(l)*I+m.y,ellipticalArcStartAngle:C,ellipticalArcEndAngle:C+F,ellipticalArcAngle:T,ellipticalArcCenter:m,resultantRx:t,resultantRy:n};return k};function X3(r){for(var e=[],t=null,n=null,i=null,a=0,s=r.length,o=0;o<s;o++){var A=r[o];n=r[o+1];var l=A[0],c={command:l,prePoint:t,params:A,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(l){case"M":i=[A[1],A[2]],a=o;break;case"A":var u=Z3(t,A);c.arcParams=u;break}if(l==="Z")t=i,n=r[a+1];else{var h=A.length;t=[A[h-2],A[h-1]]}n&&n[0]==="Z"&&(n=r[a],e[a]&&(e[a].prePoint=t)),c.currentPoint=t,e[a]&&kc(t,e[a].currentPoint)&&(e[a].prePoint=c.prePoint);var d=n?[n[n.length-2],n[n.length-1]]:null;c.nextPoint=d;var f=c.prePoint;if(["L","H","V"].includes(l))c.startTangent=[f[0]-t[0],f[1]-t[1]],c.endTangent=[t[0]-f[0],t[1]-f[1]];else if(l==="Q"){var g=[A[1],A[2]];c.startTangent=[f[0]-g[0],f[1]-g[1]],c.endTangent=[t[0]-g[0],t[1]-g[1]]}else if(l==="T"){var p=e[o-1],v=px(p.currentPoint,f);p.command==="Q"?(c.command="Q",c.startTangent=[f[0]-v[0],f[1]-v[1]],c.endTangent=[t[0]-v[0],t[1]-v[1]]):(c.command="TL",c.startTangent=[f[0]-t[0],f[1]-t[1]],c.endTangent=[t[0]-f[0],t[1]-f[1]])}else if(l==="C"){var y=[A[1],A[2]],m=[A[3],A[4]];c.startTangent=[f[0]-y[0],f[1]-y[1]],c.endTangent=[t[0]-m[0],t[1]-m[1]],c.startTangent[0]===0&&c.startTangent[1]===0&&(c.startTangent=[y[0]-m[0],y[1]-m[1]]),c.endTangent[0]===0&&c.endTangent[1]===0&&(c.endTangent=[m[0]-y[0],m[1]-y[1]])}else if(l==="S"){var B=e[o-1],C=px(B.currentPoint,f),S=[A[1],A[2]];B.command==="C"?(c.command="C",c.startTangent=[f[0]-C[0],f[1]-C[1]],c.endTangent=[t[0]-S[0],t[1]-S[1]]):(c.command="SQ",c.startTangent=[f[0]-S[0],f[1]-S[1]],c.endTangent=[t[0]-S[0],t[1]-S[1]])}else if(l==="A"){var F=mx(c,0),T=F.x,O=F.y,I=mx(c,1,!1),k=I.x,N=I.y;c.startTangent=[T,O],c.endTangent=[k,N]}e.push(c)}return e}function mx(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=r.arcParams,i=n.rx,a=i===void 0?0:i,s=n.ry,o=s===void 0?0:s,A=n.xRotation,l=n.arcFlag,c=n.sweepFlag,u=yx({x:r.prePoint[0],y:r.prePoint[1]},a,o,A,!!l,!!c,{x:r.currentPoint[0],y:r.currentPoint[1]},e),h=yx({x:r.prePoint[0],y:r.prePoint[1]},a,o,A,!!l,!!c,{x:r.currentPoint[0],y:r.currentPoint[1]},t?e+.005:e-.005),d=h.x-u.x,f=h.y-u.y,g=Math.sqrt(d*d+f*f);return{x:-d/g,y:-f/g}}function Lc(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1])}function Sg(r,e){return Lc(r)*Lc(e)?(r[0]*e[0]+r[1]*e[1])/(Lc(r)*Lc(e)):1}function wx(r,e){return(r[0]*e[1]<r[1]*e[0]?-1:1)*Math.acos(Sg(r,e))}function Z3(r,e){var t=e[1],n=e[2],i=hE(ft(e[3]),Math.PI*2),a=e[4],s=e[5],o=r[0],A=r[1],l=e[6],c=e[7],u=Math.cos(i)*(o-l)/2+Math.sin(i)*(A-c)/2,h=-1*Math.sin(i)*(o-l)/2+Math.cos(i)*(A-c)/2,d=u*u/(t*t)+h*h/(n*n);d>1&&(t*=Math.sqrt(d),n*=Math.sqrt(d));var f=t*t*(h*h)+n*n*(u*u),g=f?Math.sqrt((t*t*(n*n)-f)/f):1;a===s&&(g*=-1),isNaN(g)&&(g=0);var p=n?g*t*h/n:0,v=t?g*-n*u/t:0,y=(o+l)/2+Math.cos(i)*p-Math.sin(i)*v,m=(A+c)/2+Math.sin(i)*p+Math.cos(i)*v,B=[(u-p)/t,(h-v)/n],C=[(-1*u-p)/t,(-1*h-v)/n],S=wx([1,0],B),F=wx(B,C);return Sg(B,C)<=-1&&(F=Math.PI),Sg(B,C)>=1&&(F=0),s===0&&F>0&&(F-=2*Math.PI),s===1&&F<0&&(F+=2*Math.PI),{cx:y,cy:m,rx:kc(r,[l,c])?0:t,ry:kc(r,[l,c])?0:n,startAngle:S,endAngle:S+F,xRotation:i,arcFlag:a,sweepFlag:s}}var Bx=function(e){if(e===""||Array.isArray(e)&&e.length===0)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var t;try{t=yc(e)}catch{t=yc(""),console.error("[g]: Invalid SVG Path definition: ".concat(e))}W3(t);var n=q3(t),i=$3(t),a=i.polygons,s=i.polylines,o=X3(t),A=Y3(o,0),l=A.x,c=A.y,u=A.width,h=A.height;return{absolutePath:t,hasArc:n,segments:o,polygons:a,polylines:s,totalLength:0,rect:{x:Number.isFinite(l)?l:0,y:Number.isFinite(c)?c:0,width:Number.isFinite(u)?u:0,height:Number.isFinite(h)?h:0}}},J3=An(Bx);function bx(r){return ot(r)?J3(r):Bx(r)}function e4(r,e,t){var n=r.curve,i=e.curve;(!n||n.length===0)&&(n=ng(r.absolutePath,!1),r.curve=n),(!i||i.length===0)&&(i=ng(e.absolutePath,!1),e.curve=i);var a=[n,i];n.length!==i.length&&(a=TE(n,i));var s=SE(a[0])!==SE(a[1])?eD(a[0]):JR(a[0]);return[s,AD(a[1],s),function(o){return o}]}function t4(r,e){var t;return ot(r)?t=r.split(" ").map(function(n){var i=n.split(","),a=$e(i,2),s=a[0],o=a[1];return[Number(s),Number(o)]}):t=r,{points:t,totalLength:0,segments:[]}}function n4(r,e){return[r.points,e.points,function(t){return t}]}var Zt=null,So=/\s*(\w+)\(([^)]*)\)/g;function xr(r){return function(e){var t=0;return r.map(function(n){return n===Zt?e[t++]:n})}}function xs(r){return r}var IA={matrix:["NNNNNN",[Zt,Zt,0,0,Zt,Zt,0,0,0,0,1,0,Zt,Zt,0,1],xs],matrix3d:["NNNNNNNNNNNNNNNN",xs],rotate:["A"],rotateX:["A"],rotateY:["A"],rotateZ:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",xr([Zt,Zt,new Bt(1)]),xs],scaleX:["N",xr([Zt,new Bt(1),new Bt(1)]),xr([Zt,new Bt(1)])],scaleY:["N",xr([new Bt(1),Zt,new Bt(1)]),xr([new Bt(1),Zt])],scaleZ:["N",xr([new Bt(1),new Bt(1),Zt])],scale3d:["NNN",xs],skew:["Aa",null,xs],skewX:["A",null,xr([Zt,bs])],skewY:["A",null,xr([bs,Zt])],translate:["Tt",xr([Zt,Zt,pi]),xs],translateX:["T",xr([Zt,pi,pi]),xr([Zt,pi])],translateY:["T",xr([pi,Zt,pi]),xr([pi,Zt])],translateZ:["L",xr([pi,pi,Zt])],translate3d:["TTL",xs]};function Ex(r){for(var e=[],t=r.length,n=0;n<t;n++){var i=r[n],a=i[0],s=i.slice(1);a==="translate"||a==="skew"?s.length===1&&s.push(0):a==="scale"&&s.length===1&&s.push(s[0]);var o=IA[a];if(!o)return[];var A=s.map(function(l){return Rt(l)});e.push({t:a,d:A})}return e}function xx(r){if(Array.isArray(r))return Ex(r);if(r=(r||"none").trim(),r==="none")return[];var e=[],t,n=0;for(So.lastIndex=0;t=So.exec(r);){if(t.index!==n)return[];n=t.index+t[0].length;var i=t[1],a=IA[i];if(!a)return[];var s=t[2].split(","),o=a[0];if(o.length<s.length)return[];for(var A=[],l=0;l<o.length;l++){var c=s[l],u=o[l],h=void 0;if(c?h={A:function(f){return f.trim()==="0"?bs:H3(f)},N:bg,T:Bg,L:R3}[u.toUpperCase()](c):h={a:bs,n:A[0],t:pi}[u],h===void 0)return[];A.push(h)}if(e.push({t:i,d:A}),So.lastIndex===r.length)return e}return[]}function r4(r){if(Array.isArray(r))return Ex(r);if(r=(r||"none").trim(),r==="none")return[];var e=[],t,n=0;for(So.lastIndex=0;t=So.exec(r);){if(t.index!==n)return[];n=t.index+t[0].length;var i=t[1],a=IA[i];if(!a)return[];var s=t[2].split(","),o=a[0];if(o.length<s.length)return[];for(var A=[],l=0;l<o.length;l++){var c=s[l],u=o[l],h=void 0;if(c?h={A:function(f){return f.trim()==="0"?bs:ux(f)},N:fx,T:cx,L:lx}[u.toUpperCase()](c):h={a:bs,n:A[0],t:pi}[u],h===void 0)return[];A.push(h)}if(e.push({t:i,d:A}),So.lastIndex===r.length)return e}return[]}function i4(r){var e,t,n,i;switch(r.t){case"rotateX":return i=ft(Er(r.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=ft(Er(r.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=ft(Er(r.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=r.d[0].value,t=r.d[1].value,n=r.d[2].value,i=ft(Er(r.d[3]));var a=e*e+t*t+n*n;if(a===0)e=1,t=0,n=0;else if(a!==1){var s=Math.sqrt(a);e/=s,t/=s,n/=s}var o=Math.sin(i/2),A=o*Math.cos(i/2),l=o*o;return[1-2*(t*t+n*n)*l,2*(e*t*l+n*A),2*(e*n*l-t*A),0,2*(e*t*l-n*A),1-2*(e*e+n*n)*l,2*(t*n*l+e*A),0,2*(e*n*l+t*A),2*(t*n*l-e*A),1-2*(e*e+t*t)*l,0,0,0,0,1];case"scale":return[r.d[0].value,0,0,0,0,r.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scaleX":return[r.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,r.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,r.d[0].value,0,0,0,0,1];case"scale3d":return[r.d[0].value,0,0,0,0,r.d[1].value,0,0,0,0,r.d[2].value,0,0,0,0,1];case"skew":var c=ft(Er(r.d[0])),u=ft(Er(r.d[1]));return[1,Math.tan(u),0,0,Math.tan(c),1,0,0,0,0,1,0,0,0,0,1];case"skewX":return i=ft(Er(r.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewY":return i=ft(Er(r.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return e=Nr(r.d[0],0,null)||0,t=Nr(r.d[1],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,e,t,0,1];case"translateX":return e=Nr(r.d[0],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,e,0,0,1];case"translateY":return t=Nr(r.d[0],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,0,t,0,1];case"translateZ":return n=Nr(r.d[0],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,n,1];case"translate3d":return e=Nr(r.d[0],0,null)||0,t=Nr(r.d[1],0,null)||0,n=Nr(r.d[2],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,e,t,n,1];case"perspective":var h=Nr(r.d[0],0,null)||0,d=h?-1/h:0;return[1,0,0,0,0,1,0,0,0,0,1,d,0,0,0,1];case"matrix":return[r.d[0].value,r.d[1].value,0,0,r.d[2].value,r.d[3].value,0,0,0,0,1,0,r.d[4].value,r.d[5].value,0,1];case"matrix3d":return r.d.map(function(f){return f.value})}}function a4(r,e){return[r[0]*e[0]+r[4]*e[1]+r[8]*e[2]+r[12]*e[3],r[1]*e[0]+r[5]*e[1]+r[9]*e[2]+r[13]*e[3],r[2]*e[0]+r[6]*e[1]+r[10]*e[2]+r[14]*e[3],r[3]*e[0]+r[7]*e[1]+r[11]*e[2]+r[15]*e[3],r[0]*e[4]+r[4]*e[5]+r[8]*e[6]+r[12]*e[7],r[1]*e[4]+r[5]*e[5]+r[9]*e[6]+r[13]*e[7],r[2]*e[4]+r[6]*e[5]+r[10]*e[6]+r[14]*e[7],r[3]*e[4]+r[7]*e[5]+r[11]*e[6]+r[15]*e[7],r[0]*e[8]+r[4]*e[9]+r[8]*e[10]+r[12]*e[11],r[1]*e[8]+r[5]*e[9]+r[9]*e[10]+r[13]*e[11],r[2]*e[8]+r[6]*e[9]+r[10]*e[10]+r[14]*e[11],r[3]*e[8]+r[7]*e[9]+r[11]*e[10]+r[15]*e[11],r[0]*e[12]+r[4]*e[13]+r[8]*e[14]+r[12]*e[15],r[1]*e[12]+r[5]*e[13]+r[9]*e[14]+r[13]*e[15],r[2]*e[12]+r[6]*e[13]+r[10]*e[14]+r[14]*e[15],r[3]*e[12]+r[7]*e[13]+r[11]*e[14]+r[15]*e[15]]}function s4(r){return r.length===0?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:r.map(i4).reduce(a4)}function Cx(r){var e=[0,0,0],t=[1,1,1],n=[0,0,0],i=[0,0,0,1],a=[0,0,0,1];return VD(s4(r),e,t,n,i,a),[[e,t,n,a,i]]}var o4=(function(){function r(n,i){for(var a=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],s=0;s<4;s++)for(var o=0;o<4;o++)for(var A=0;A<4;A++)a[s][o]+=i[s][A]*n[A][o];return a}function e(n){return n[0][2]===0&&n[0][3]===0&&n[1][2]===0&&n[1][3]===0&&n[2][0]===0&&n[2][1]===0&&n[2][2]===1&&n[2][3]===0&&n[3][2]===0&&n[3][3]===1}function t(n,i,a,s,o){for(var A=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],l=0;l<4;l++)A[l][3]=o[l];for(var c=0;c<3;c++)for(var u=0;u<3;u++)A[3][c]+=n[u]*A[u][c];var h=s[0],d=s[1],f=s[2],g=s[3],p=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];p[0][0]=1-2*(d*d+f*f),p[0][1]=2*(h*d-f*g),p[0][2]=2*(h*f+d*g),p[1][0]=2*(h*d+f*g),p[1][1]=1-2*(h*h+f*f),p[1][2]=2*(d*f-h*g),p[2][0]=2*(h*f-d*g),p[2][1]=2*(d*f+h*g),p[2][2]=1-2*(h*h+d*d),A=r(A,p);var v=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];a[2]&&(v[2][1]=a[2],A=r(A,v)),a[1]&&(v[2][1]=0,v[2][0]=a[0],A=r(A,v)),a[0]&&(v[2][0]=0,v[1][0]=a[0],A=r(A,v));for(var y=0;y<3;y++)for(var m=0;m<3;m++)A[y][m]*=i[y];return e(A)?[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])}return t})();function A4(r){return r.toFixed(6).replace(".000000","")}function Fg(r,e){var t,n;return r.decompositionPair!==e&&(r.decompositionPair=e,t=Cx(r)),e.decompositionPair!==r&&(e.decompositionPair=r,n=Cx(e)),t[0]===null||n[0]===null?[[!1],[!0],function(i){return i?e[0].d:r[0].d}]:(t[0].push(0),n[0].push(1),[t,n,function(i){var a=c4(t[0][3],n[0][3],i[5]),s=o4(i[0],i[1],i[2],a,i[4]),o=s.map(A4).join(",");return o}])}function l4(r,e){for(var t=0,n=0;n<r.length;n++)t+=r[n]*e[n];return t}function c4(r,e,t){var n=l4(r,e);n=Yt(n,-1,1);var i=[];if(n===1)i=r;else for(var a=Math.acos(n),s=Math.sin(t*a)*1/Math.sqrt(1-n*n),o=0;o<4;o++)i.push(r[o]*(Math.cos(t*a)-n*s)+e[o]*s);return i}function Tg(r){return r.replace(/[XY]/,"")}function Mg(r){return r.replace(/(X|Y|Z|3d)?$/,"3d")}var u4=function(e,t){return e==="perspective"&&t==="perspective"||(e==="matrix"||e==="matrix3d")&&(t==="matrix"||t==="matrix3d")};function h4(r,e,t){var n=!1;if(!r.length||!e.length){r.length||(n=!0,r=e,e=[]);for(var i=function(){var k=r[a],N=k.t,U=k.d,D=N.substring(0,5)==="scale"?1:0;e.push({t:N,d:U.map(function(G){return typeof G=="number"?Rt(D):Rt(D,G.unit)})})},a=0;a<r.length;a++)i()}var s=[],o=[],A=[];if(r.length!==e.length){var l=Fg(r,e);s=[l[0]],o=[l[1]],A=[["matrix",[l[2]]]]}else for(var c=0;c<r.length;c++){var u=r[c].t,h=e[c].t,d=r[c].d,f=e[c].d,g=IA[u],p=IA[h],v=void 0;if(u4(u,h)){var y=Fg([r[c]],[e[c]]);s.push(y[0]),o.push(y[1]),A.push(["matrix",[y[2]]]);continue}else if(u===h)v=u;else if(g[2]&&p[2]&&Tg(u)===Tg(h))v=Tg(u),d=g[2](d),f=p[2](f);else if(g[1]&&p[1]&&Mg(u)===Mg(h))v=Mg(u),d=g[1](d),f=p[1](f);else{var m=Fg(r,e);s=[m[0]],o=[m[1]],A=[["matrix",[m[2]]]];break}for(var B=[],C=[],S=[],F=0;F<d.length;F++){var T=G3(d[F],f[F],t,!1,F);B[F]=T[0],C[F]=T[1],S.push(T[2])}s.push(B),o.push(C),A.push([v,S])}if(n){var O=s;s=o,o=O}return[s,o,function(I){return I.map(function(k,N){var U=k.map(function(D,G){return A[N][1][G](D)}).join(",");return A[N][0]==="matrix"&&U.split(",").length===16&&(A[N][0]="matrix3d"),A[N][0]==="matrix3d"&&U.split(",").length===6&&(A[N][0]="matrix"),"".concat(A[N][0],"(").concat(U,")")}).join(" ")}]}var d4=An(function(r){if(ot(r)){if(r==="text-anchor")return[Rt(0,"px"),Rt(0,"px")];var e=r.split(" ");return e.length===1&&(e[0]==="top"||e[0]==="bottom"?(e[1]=e[0],e[0]="center"):e[1]="center"),e.length!==2?null:[Bg(Sx(e[0])),Bg(Sx(e[1]))]}return[Rt(r[0]||0,"px"),Rt(r[1]||0,"px")]});function Sx(r){return r==="center"?"50%":r==="left"||r==="top"?"0%":r==="right"||r==="bottom"?"100%":r}var Og=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:ve.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:ve.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:ve.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:ve.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:ve.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:ve.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:ve.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:ve.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:ve.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:ve.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:ve.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:ve.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:ve.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:ve.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:ve.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:ve.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:ve.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:ve.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:ve.FILTER},{n:"clipPath",syntax:ve.DEFINED_PATH},{n:"textPath",syntax:ve.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:ve.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:ve.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:ve.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:ve.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:ve.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:ve.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:ve.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:ve.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:ve.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:ve.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:ve.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:ve.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:ve.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:ve.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:ve.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:ve.COORDINATE},{n:"y1",int:!0,l:!0,syntax:ve.COORDINATE},{n:"z1",int:!0,l:!0,syntax:ve.COORDINATE},{n:"x2",int:!0,l:!0,syntax:ve.COORDINATE},{n:"y2",int:!0,l:!0,syntax:ve.COORDINATE},{n:"z2",int:!0,l:!0,syntax:ve.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:ve.PATH,p:50},{n:"points",int:!0,l:!0,syntax:ve.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:ve.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:ve.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:ve.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:ve.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:ve.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:ve.NUMBER,d:function(e){return e===re.PATH||e===re.POLYGON||e===re.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:ve.MARKER},{n:"markerEnd",syntax:ve.MARKER},{n:"markerMid",syntax:ve.MARKER},{n:"markerStartOffset",syntax:ve.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:ve.LENGTH,l:!0,int:!0,d:"0"}],f4=new Set(Og.filter(function(r){return!!r.l}).map(function(r){return r.n})),Fx={},g4=(function(){function r(e){var t=this;le(this,r),this.runtime=e,Og.forEach(function(n){t.registerMetadata(n)})}return ce(r,[{key:"registerMetadata",value:function(t){[t.n].concat(tt(t.a||[])).forEach(function(n){Fx[n]=t})}},{key:"getPropertySyntax",value:function(t){return this.runtime.CSSPropertySyntaxFactory[t]}},{key:"processProperties",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{forceUpdateGeometry:!1};Object.assign(t.attributes,n);var a=t.parsedStyle.clipPath,s=t.parsedStyle.offsetPath;p4(t,n);var o=!!i.forceUpdateGeometry;if(!o){for(var A in n)if(f4.has(A)){o=!0;break}}var l=Tx(t);l.has("fill")&&n.fill&&(t.parsedStyle.fill=MA(n.fill)),l.has("stroke")&&n.stroke&&(t.parsedStyle.stroke=MA(n.stroke)),l.has("shadowColor")&&n.shadowColor&&(t.parsedStyle.shadowColor=MA(n.shadowColor)),l.has("filter")&&n.filter&&(t.parsedStyle.filter=V3(n.filter)),l.has("radius")&&!ke(n.radius)&&(t.parsedStyle.radius=hx(n.radius,4)),l.has("lineDash")&&!ke(n.lineDash)&&(t.parsedStyle.lineDash=hx(n.lineDash,"even")),l.has("points")&&n.points&&(t.parsedStyle.points=t4(n.points)),l.has("d")&&n.d===""&&(t.parsedStyle.d=De({},WE)),l.has("d")&&n.d&&(t.parsedStyle.d=bx(n.d)),l.has("textTransform")&&n.textTransform&&this.runtime.CSSPropertySyntaxFactory[ve.TEXT_TRANSFORM].calculator(null,null,{value:n.textTransform},t,null),l.has("clipPath")&&!Ge(n.clipPath)&&this.runtime.CSSPropertySyntaxFactory[ve.DEFINED_PATH].calculator("clipPath",a,n.clipPath,t,this.runtime),l.has("offsetPath")&&n.offsetPath&&this.runtime.CSSPropertySyntaxFactory[ve.DEFINED_PATH].calculator("offsetPath",s,n.offsetPath,t,this.runtime),l.has("transform")&&n.transform&&(t.parsedStyle.transform=xx(n.transform)),l.has("transformOrigin")&&n.transformOrigin&&(t.parsedStyle.transformOrigin=d4(n.transformOrigin)),l.has("markerStart")&&n.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[ve.MARKER].calculator(null,n.markerStart,n.markerStart,null,null)),l.has("markerEnd")&&n.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[ve.MARKER].calculator(null,n.markerEnd,n.markerEnd,null,null)),l.has("markerMid")&&n.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[ve.MARKER].calculator("",n.markerMid,n.markerMid,null,null)),l.has("zIndex")&&!ke(n.zIndex)&&this.runtime.CSSPropertySyntaxFactory[ve.Z_INDEX].postProcessor(t),l.has("offsetDistance")&&!ke(n.offsetDistance)&&this.runtime.CSSPropertySyntaxFactory[ve.OFFSET_DISTANCE].postProcessor(t),l.has("transform")&&n.transform&&this.runtime.CSSPropertySyntaxFactory[ve.TRANSFORM].postProcessor(t),l.has("transformOrigin")&&n.transformOrigin&&this.runtime.CSSPropertySyntaxFactory[ve.TRANSFORM_ORIGIN].postProcessor(t),o&&(t.dirty(!0,!0),i.forceUpdateGeometry||this.runtime.sceneGraphService.dirtyToRoot(t))}},{key:"updateGeometry",value:function(t){var n=t.nodeName,i=this.runtime.geometryUpdaterFactory[n];if(i){var a=t.geometry;a.contentBounds||(a.contentBounds=new kt),a.renderBounds||(a.renderBounds=new kt);var s=t.parsedStyle,o=i.update(s,t),A=o.cx,l=A===void 0?0:A,c=o.cy,u=c===void 0?0:c,h=o.cz,d=h===void 0?0:h,f=o.hwidth,g=f===void 0?0:f,p=o.hheight,v=p===void 0?0:p,y=o.hdepth,m=y===void 0?0:y,B=[Math.abs(g),Math.abs(v),m],C=s.stroke,S=s.lineWidth,F=S===void 0?1:S,T=s.increasedLineWidthForHitTesting,O=T===void 0?0:T,I=s.shadowType,k=I===void 0?"outer":I,N=s.shadowColor,U=s.filter,D=U===void 0?[]:U,G=s.transformOrigin,Z=[l,u,d];a.contentBounds.update(Z,B);var q=n===re.POLYLINE||n===re.POLYGON||n===re.PATH?Math.SQRT2:.5,j=C&&!C.isNone;if(j){var te=((F||0)+(O||0))*q;B[0]+=te,B[1]+=te}if(a.renderBounds.update(Z,B),N&&k&&k!=="inner"){var ue=a.renderBounds,ge=ue.min,Y=ue.max,xe=s.shadowBlur,$=s.shadowOffsetX,K=s.shadowOffsetY,ee=xe||0,oe=$||0,Ee=K||0,Le=ge[0]-ee+oe,Pe=Y[0]+ee+oe,st=ge[1]-ee+Ee,ut=Y[1]+ee+Ee;ge[0]=Math.min(ge[0],Le),Y[0]=Math.max(Y[0],Pe),ge[1]=Math.min(ge[1],st),Y[1]=Math.max(Y[1],ut),a.renderBounds.setMinMax(ge,Y)}D.forEach(function(it){var _r=it.name,It=it.params;if(_r==="blur"){var Ca=It[0].value;a.renderBounds.update(a.renderBounds.center,Oa(a.renderBounds.halfExtents,a.renderBounds.halfExtents,[Ca,Ca,0]))}else if(_r==="drop-shadow"){var vr=It[0].value,tn=It[1].value,Qt=It[2].value,qn=a.renderBounds,sr=qn.min,kr=qn.max,yr=sr[0]-Qt+vr,or=kr[0]+Qt+vr,fn=sr[1]-Qt+tn,gn=kr[1]+Qt+tn;sr[0]=Math.min(sr[0],yr),kr[0]=Math.max(kr[0],or),sr[1]=Math.min(sr[1],fn),kr[1]=Math.max(kr[1],gn),a.renderBounds.setMinMax(sr,kr)}}),t.geometry.dirty=!1;var ht=g<0,Et=v<0,Ue=(ht?-1:1)*(G?Nr(G[0],0,t,!0):0),vt=(Et?-1:1)*(G?Nr(G[1],1,t,!0):0);(Ue||vt)&&t.setOrigin(Ue,vt)}}},{key:"updateSizeAttenuation",value:function(t,n){t.style.isSizeAttenuation?(t.style.rawLineWidth||(t.style.rawLineWidth=t.style.lineWidth),t.style.lineWidth=(t.style.rawLineWidth||1)/n,t.nodeName===re.CIRCLE&&(t.style.rawR||(t.style.rawR=t.style.r),t.style.r=(t.style.rawR||1)/n)):(t.style.rawLineWidth&&(t.style.lineWidth=t.style.rawLineWidth,delete t.style.rawLineWidth),t.nodeName===re.CIRCLE&&t.style.rawR&&(t.style.r=t.style.rawR,delete t.style.rawR))}}])})();function p4(r,e){var t=Tx(r);for(var n in e)t.has(n)&&(r.parsedStyle[n]=e[n])}function Tx(r){return r.constructor.PARSED_STYLE_LIST}var v4=(function(){function r(){le(this,r),this.mixer=Eg}return ce(r,[{key:"calculator",value:function(t,n,i,a){return Er(i)}}])})(),y4=(function(){function r(){le(this,r)}return ce(r,[{key:"calculator",value:function(t,n,i,a,s){return i instanceof Yr&&(i=null),s.sceneGraphService.updateDisplayObjectDependency(t,n,i,a),t==="clipPath"&&a.forEach(function(o){o.childNodes.length===0&&s.sceneGraphService.dirtyToRoot(o)}),i}}])})(),m4=(function(){function r(){le(this,r),this.parser=MA,this.mixer=P3}return ce(r,[{key:"calculator",value:function(t,n,i,a){return i instanceof Yr?i.value==="none"?sx:ox:i}}])})(),w4=(function(){function r(){le(this,r)}return ce(r,[{key:"calculator",value:function(t,n,i){return i instanceof Yr?[]:i}}])})();function Mx(r){var e=r.parsedStyle,t=e.fontSize;return ke(t)?null:t}var Ig=(function(){function r(){le(this,r),this.mixer=Eg}return ce(r,[{key:"calculator",value:function(t,n,i,a,s){if(Be(i))return i;if(Bt.isRelativeUnit(i.unit)){if(i.unit===we.kPercentage)return 0;if(i.unit===we.kEms){if(a.parentNode){var o=Mx(a.parentNode);if(o)return o*=i.value,o}return 0}if(i.unit===we.kRems){var A;if(a!=null&&(A=a.ownerDocument)!==null&&A!==void 0&&A.documentElement){var l=Mx(a.ownerDocument.documentElement);if(l)return l*=i.value,l}return 0}}else return i.value}}])})(),B4=(function(){function r(){le(this,r),this.mixer=gx}return ce(r,[{key:"calculator",value:function(t,n,i){return i.map(function(a){return a.value})}}])})(),b4=(function(){function r(){le(this,r),this.mixer=gx}return ce(r,[{key:"calculator",value:function(t,n,i){return i.map(function(a){return a.value})}}])})(),E4=(function(){function r(){le(this,r)}return ce(r,[{key:"calculator",value:function(t,n,i,a){var s;i instanceof Yr&&(i=null);var o=(s=i)===null||s===void 0?void 0:s.cloneNode(!0);return o&&(o.style.isMarker=!0),o}}])})(),x4=(function(){function r(){le(this,r),this.mixer=Eg}return ce(r,[{key:"calculator",value:function(t,n,i){return i.value}}])})(),C4=(function(){function r(){le(this,r),this.mixer=xg(0,1)}return ce(r,[{key:"calculator",value:function(t,n,i){return i.value}},{key:"postProcessor",value:function(t){var n=t.parsedStyle,i=n.offsetPath,a=n.offsetDistance;if(i){var s=i.nodeName;if(s===re.LINE||s===re.PATH||s===re.POLYLINE){var o=i.getPoint(a);o&&t.setLocalPosition(o.x,o.y)}}}}])})(),S4=(function(){function r(){le(this,r),this.mixer=xg(0,1)}return ce(r,[{key:"calculator",value:function(t,n,i){return i.value}}])})(),F4=(function(){function r(){le(this,r),this.parser=bx,this.mixer=e4}return ce(r,[{key:"calculator",value:function(t,n,i){return i instanceof Yr&&i.value==="unset"?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Bo(0,0,0,0)}:i}}])})(),T4=ce(function r(){le(this,r),this.mixer=n4}),M4=(function(r){function e(){var t;le(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t=We(this,e,[].concat(i)),t.mixer=xg(0,1/0),t}return qe(e,r),ce(e)})(Ig),O4=(function(){function r(){le(this,r)}return ce(r,[{key:"calculator",value:function(t,n,i,a){return i instanceof Yr?i.value==="unset"?"":i.value:"".concat(i)}},{key:"postProcessor",value:function(t){t.nodeValue="".concat(t.parsedStyle.text)||""}}])})(),I4=(function(){function r(){le(this,r)}return ce(r,[{key:"calculator",value:function(t,n,i,a){var s=a.getAttribute("text");if(s){var o=s;i.value==="capitalize"?o=s.charAt(0).toUpperCase()+s.slice(1):i.value==="lowercase"?o=s.toLowerCase():i.value==="uppercase"&&(o=s.toUpperCase()),a.parsedStyle.text=o}return i.value}}])})(),_g=new WeakMap;function _4(r,e,t){if(r){var n=typeof r=="string"?document.getElementById(r):r;_g.has(n)&&_g.get(n).destroy(t),_g.set(n,e)}}var kg=typeof window<"u"&&typeof window.document<"u";function k4(r){return!!r.getAttribute}function N4(r,e){for(var t=0,n=r.length;t<n;){var i=t+n>>>1;Ox(r[i],e)<0?t=i+1:n=i}return t}function Ox(r,e){var t=Number(r.parsedStyle.zIndex||0),n=Number(e.parsedStyle.zIndex||0);if(t===n){var i=r.parentNode;if(i){var a=i.childNodes||[];return a.indexOf(r)-a.indexOf(e)}}return t-n}function Ix(r){var e=r;do{var t,n=(t=e.parsedStyle)===null||t===void 0?void 0:t.clipPath;if(n)return e;e=e.parentElement}while(e!==null);return null}var _x="px";function L4(r,e,t){kg&&r.style&&(r.style.width=e+_x,r.style.height=t+_x)}function kx(r,e){if(kg)return document.defaultView.getComputedStyle(r,null).getPropertyValue(e)}function Q4(r){var e=kx(r,"width");return e==="auto"?r.offsetWidth:parseFloat(e)}function U4(r){var e=kx(r,"height");return e==="auto"?r.offsetHeight:parseFloat(e)}var P4=1,R4={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},Ng=typeof performance=="object"&&performance.now?performance:Date;function Qc(r){return r.nodeName===re.FRAGMENT?!0:r.getRootNode().nodeName===re.FRAGMENT}function Cs(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"auto",e=arguments.length>1?arguments[1]:void 0,t=arguments.length>2?arguments[2]:void 0,n=!1,i=!1,a=!!e&&!e.isNone,s=!!t&&!t.isNone;return r==="visiblepainted"||r==="painted"||r==="auto"?(n=a,i=s):r==="visiblefill"||r==="fill"?n=!0:r==="visiblestroke"||r==="stroke"?i=!0:(r==="visible"||r==="all")&&(n=!0,i=!0),[n,i]}var D4=1,H4=function(){return D4++},Hi=typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:{},G4=Date.now(),K4=function(){return Hi.performance&&typeof Hi.performance.now=="function"?Hi.performance.now():Date.now()-G4},_A={},Nx=Date.now(),z4=function(e){if(typeof e!="function")throw new TypeError("".concat(e," is not a function"));var t=Date.now(),n=t-Nx,i=n>16?0:16-n,a=H4();return _A[a]=e,Object.keys(_A).length>1||setTimeout(function(){Nx=t;var s=_A;_A={},Object.keys(s).forEach(function(o){return s[o](K4())})},i),a},V4=function(e){delete _A[e]},j4=["","webkit","moz","ms","o"],Lx=function(e){return typeof e!="string"?z4:e===""?Hi.requestAnimationFrame:Hi["".concat(e,"RequestAnimationFrame")]},W4=function(e){return typeof e!="string"?V4:e===""?Hi.cancelAnimationFrame:Hi["".concat(e,"CancelAnimationFrame")]||Hi["".concat(e,"CancelRequestAnimationFrame")]},q4=function(e,t){for(var n=0;e[n]!==void 0;){if(t(e[n]))return e[n];n+=1}},Qx=q4(j4,function(r){return!!Lx(r)}),Lg=Lx(Qx),Ux=W4(Qx);Hi.requestAnimationFrame=Lg,Hi.cancelAnimationFrame=Ux;var $4=(function(){function r(){le(this,r),this.callbacks=[]}return ce(r,[{key:"getCallbacksNum",value:function(){return this.callbacks.length}},{key:"tapPromise",value:function(t,n){this.callbacks.push(n)}},{key:"promise",value:function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return Promise.all(this.callbacks.map(function(a){return a.apply(void 0,n)}))}}])})(),Y4=(function(){function r(){le(this,r),this.callbacks=[]}return ce(r,[{key:"tapPromise",value:function(t,n){this.callbacks.push(n)}},{key:"promise",value:(function(){var e=La(kn().mark(function n(){var i,a,s,o,A=arguments;return kn().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(!this.callbacks.length){l.next=6;break}return l.next=1,(i=this.callbacks)[0].apply(i,A);case 1:a=l.sent,s=1;case 2:if(!(s<this.callbacks.length)){l.next=5;break}return o=this.callbacks[s],l.next=3,o(a);case 3:a=l.sent;case 4:s++,l.next=2;break;case 5:return l.abrupt("return",a);case 6:return l.abrupt("return",null);case 7:case"end":return l.stop()}},n,this)}));function t(){return e.apply(this,arguments)}return t})()}])})(),lr=(function(){function r(){le(this,r),this.callbacks=[]}return ce(r,[{key:"tap",value:function(t,n){this.callbacks.push(n)}},{key:"call",value:function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var a=arguments;this.callbacks.forEach(function(s){s.apply(void 0,a)})}}])})(),Qg=(function(){function r(){le(this,r),this.callbacks=[]}return ce(r,[{key:"tap",value:function(t,n){this.callbacks.push(n)}},{key:"call",value:function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];if(this.callbacks.length){for(var a=arguments,s=this.callbacks[0].apply(void 0,a),o=1;o<this.callbacks.length;o++){var A=this.callbacks[o];s=A(s)}return s}return null}}])})(),X4=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Z4=/([\"\'])[^\'\"]+\1/;function Px(r){var e=r.fontSize,t=e===void 0?16:e,n=r.fontFamily,i=n===void 0?"sans-serif":n,a=r.fontStyle,s=a===void 0?"normal":a,o=r.fontVariant,A=o===void 0?"normal":o,l=r.fontWeight,c=l===void 0?"normal":l;return{fontSize:t,fontFamily:i,fontStyle:s,fontVariant:A,fontWeight:c}}var Rx=An(function(e){for(var t=Px(e),n=t.fontSize,i=t.fontFamily,a=t.fontStyle,s=t.fontVariant,o=t.fontWeight,A=Be(n)&&"".concat(n,"px")||"16px",l=i.split(","),c=l.length-1;c>=0;c--){var u=l[c].trim();!Z4.test(u)&&X4.indexOf(u)<0&&(u='"'.concat(u,'"')),l[c]=u}return"".concat(a," ").concat(s," ").concat(o," ").concat(A," ").concat(l.join(","))},function(r){var e=Px(r),t=e.fontSize,n=e.fontFamily,i=e.fontStyle,a=e.fontVariant,s=e.fontWeight;return"".concat(i,"_").concat(a,"_").concat(s,"_").concat(t,"_").concat(n)}),J4=1e-6,kA=function(e){return Math.max(e,J4)};function Ug(r,e,t){return Ta(r),r[4]=Math.tan(e),r[1]=Math.tan(t),r}var ln=Ct(),eH=Ct(),tH={scale:function(e){vs(ln,[e[0].value,e[1].value,1].map(function(t){return kA(t)}))},scaleX:function(e){vs(ln,[e[0].value,1,1].map(function(t){return kA(t)}))},scaleY:function(e){vs(ln,[1,e[0].value,1].map(function(t){return kA(t)}))},scaleZ:function(e){vs(ln,[1,1,e[0].value].map(function(t){return kA(t)}))},scale3d:function(e){vs(ln,[e[0].value,e[1].value,e[2].value].map(function(t){return kA(t)}))},translate:function(e){Ma(ln,[e[0].value,e[1].value,0])},translateX:function(e){Ma(ln,[e[0].value,0,0])},translateY:function(e){Ma(ln,[0,e[0].value,0])},translateZ:function(e){Ma(ln,[0,0,e[0].value])},translate3d:function(e){Ma(ln,[e[0].value,e[1].value,e[2].value])},rotate:function(e){Rf(ln,ft(Er(e[0])))},rotateX:function(e){$b(ln,ft(Er(e[0])))},rotateY:function(e){Yb(ln,ft(Er(e[0])))},rotateZ:function(e){Rf(ln,ft(Er(e[0])))},rotate3d:function(e){qb(ln,ft(Er(e[3])),[e[0].value,e[1].value,e[2].value])},skew:function(e){Ug(ln,ft(e[0].value),ft(e[1].value))},skewX:function(e){Ug(ln,ft(e[0].value),0)},skewY:function(e){Ug(ln,0,ft(e[0].value))},matrix:function(e){Pf(ln,e[0].value,e[1].value,0,0,e[2].value,e[3].value,0,0,0,0,1,0,e[4].value,e[5].value,0,1)},matrix3d:function(e){Pf.apply(WP,[ln].concat(tt(e.map(function(t){return t.value}))))}},nH=St(1,1,1),rH=Je(),Dx={translate:function(e,t){he.sceneGraphService.setLocalScale(e,nH,!1),he.sceneGraphService.setLocalEulerAngles(e,rH,void 0,void 0,!1),he.sceneGraphService.setLocalPosition(e,[t[0].value,t[1].value,0],!1),he.sceneGraphService.dirtyLocalTransform(e,e.transformable)}};function Hx(r,e){if(r.length){if(r.length===1&&Dx[r[0].t]){Dx[r[0].t](e,r[0].d);return}for(var t=Ta(eH),n=0;n<r.length;n++){var i=r[n],a=i.t,s=i.d,o=tH[a];o&&(o(s),iE(t,t,ln))}e.setLocalTransform(t)}else e.resetLocalTransform();return e.getLocalTransform()}var iH=(function(){function r(){le(this,r),this.parser=r4,this.mixer=h4}return ce(r,[{key:"calculator",value:function(t,n,i,a){return i instanceof Yr?[]:i}},{key:"postProcessor",value:function(t){Hx(t.parsedStyle.transform,t)}}])})(),aH=(function(){function r(){le(this,r)}return ce(r,[{key:"postProcessor",value:function(t){var n=t.parsedStyle.transformOrigin;n[0].unit===we.kPixels&&n[1].unit===we.kPixels?t.setOrigin(n[0].value,n[1].value):t.getGeometryBounds()}}])})(),sH=(function(){function r(){le(this,r)}return ce(r,[{key:"calculator",value:function(t,n,i,a){return i.value}},{key:"postProcessor",value:function(t){if(t.parentNode){var n=t.parentNode,i=n.renderable,a=n.sortable;i&&n.dirty(),a&&(a.dirty=!0,a.dirtyReason=xc.Z_INDEX_CHANGED)}}}])})(),oH=(function(){function r(){le(this,r)}return ce(r,[{key:"update",value:function(t,n){var i=t.cx,a=i===void 0?0:i,s=t.cy,o=s===void 0?0:s,A=t.r,l=A===void 0?0:A;return{cx:a,cy:o,hwidth:l,hheight:l}}}])})(),AH=(function(){function r(){le(this,r)}return ce(r,[{key:"update",value:function(t,n){var i=t.cx,a=i===void 0?0:i,s=t.cy,o=s===void 0?0:s,A=t.rx,l=A===void 0?0:A,c=t.ry,u=c===void 0?0:c;return{cx:a,cy:o,hwidth:l,hheight:u}}}])})(),lH=(function(){function r(){le(this,r)}return ce(r,[{key:"update",value:function(t){var n=t.x1,i=t.y1,a=t.x2,s=t.y2,o=Math.min(n,a),A=Math.max(n,a),l=Math.min(i,s),c=Math.max(i,s),u=A-o,h=c-l,d=u/2,f=h/2;return{cx:o+d,cy:l+f,hwidth:d,hheight:f}}}])})(),cH=(function(){function r(){le(this,r)}return ce(r,[{key:"update",value:function(t){var n=t.d,i=n.rect,a=i.x,s=i.y,o=i.width,A=i.height,l=o/2,c=A/2;return{cx:a+l,cy:s+c,hwidth:l,hheight:c}}}])})(),uH=(function(){function r(){le(this,r)}return ce(r,[{key:"update",value:function(t){if(t.points&&mr(t.points.points)){var n=t.points.points,i=Math.min.apply(Math,tt(n.map(function(h){return h[0]}))),a=Math.max.apply(Math,tt(n.map(function(h){return h[0]}))),s=Math.min.apply(Math,tt(n.map(function(h){return h[1]}))),o=Math.max.apply(Math,tt(n.map(function(h){return h[1]}))),A=a-i,l=o-s,c=A/2,u=l/2;return{cx:i+c,cy:s+u,hwidth:c,hheight:u}}return{cx:0,cy:0,hwidth:0,hheight:0}}}])})(),hH=(function(){function r(){le(this,r)}return ce(r,[{key:"update",value:function(t,n){var i=t.x,a=i===void 0?0:i,s=t.y,o=s===void 0?0:s,A=t.src,l=t.width,c=l===void 0?0:l,u=t.height,h=u===void 0?0:u,d=c,f=h;return A&&!ot(A)&&(d||(d=A.width,t.width=d),f||(f=A.height,t.height=f)),{cx:a+d/2,cy:o+f/2,hwidth:d/2,hheight:f/2}}}])})(),dH=(function(){function r(e){le(this,r),this.globalRuntime=e}return ce(r,[{key:"isReadyToMeasure",value:function(t,n){var i=t.text;return i}},{key:"update",value:function(t,n){var i,a=t.text,s=t.textAlign,o=s===void 0?"start":s,A=t.lineWidth,l=A===void 0?1:A,c=t.textBaseline,u=c===void 0?"alphabetic":c,h=t.dx,d=h===void 0?0:h,f=t.dy,g=f===void 0?0:f,p=t.x,v=p===void 0?0:p,y=t.y,m=y===void 0?0:y;if(!this.isReadyToMeasure(t,n))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{hwidth:0,hheight:0,cx:0,cy:0};var B=(n==null||(i=n.ownerDocument)===null||i===void 0||(i=i.defaultView)===null||i===void 0?void 0:i.getConfig())||{},C=B.offscreenCanvas,S=this.globalRuntime.textService.measureText(a,t,C);t.metrics=S;var F=S.width,T=S.height,O=F/2,I=T/2,k=v+O;o==="center"||o==="middle"?k+=l/2-O:(o==="right"||o==="end")&&(k+=l-O*2);var N=m-I;return u==="middle"?N+=I:u==="top"||u==="hanging"?N+=I*2:u==="alphabetic"||(u==="bottom"||u==="ideographic")&&(N+=0),d&&(k+=d),g&&(N+=g),{cx:k,cy:N,hwidth:O,hheight:I}}}])})(),fH=(function(){function r(){le(this,r)}return ce(r,[{key:"update",value:function(t,n){return{cx:0,cy:0,hwidth:0,hheight:0}}}])})(),gH=(function(){function r(){le(this,r)}return ce(r,[{key:"update",value:function(t,n){var i=t.x,a=i===void 0?0:i,s=t.y,o=s===void 0?0:s,A=t.width,l=A===void 0?0:A,c=t.height,u=c===void 0?0:c;return{cx:a+l/2,cy:o+u/2,hwidth:l/2,hheight:u/2}}}])})(),Uc=(function(){function r(e){le(this,r),this.eventPhase=r.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Hn,this.page=new Hn,this.canvas=new Hn,this.viewport=new Hn,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}return ce(r,[{key:"name",get:function(){return this.type}},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"composedPath",value:function(){return this.manager&&(!this.path||this.path[0]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}},{key:"propagationPath",get:function(){return this.composedPath()}},{key:"preventDefault",value:function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}},{key:"stopImmediatePropagation",value:function(){this.propagationImmediatelyStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"initEvent",value:function(){}},{key:"initUIEvent",value:function(){}},{key:"clone",value:function(){throw new Error(mt)}}])})(),Gx=(function(r){function e(){var t;le(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t=We(this,e,[].concat(i)),t.client=new Hn,t.movement=new Hn,t.offset=new Hn,t.global=new Hn,t.screen=new Hn,t}return qe(e,r),ce(e,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}},{key:"getModifierState",value:function(n){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(n)}},{key:"initMouseEvent",value:function(){throw new Error(mt)}}])})(Uc),Pc=(function(r){function e(){var t;le(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t=We(this,e,[].concat(i)),t.width=0,t.height=0,t.isPrimary=!1,t}return qe(e,r),ce(e,[{key:"getCoalescedEvents",value:function(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]}},{key:"getPredictedEvents",value:function(){throw new Error("getPredictedEvents is not supported!")}},{key:"clone",value:function(){return this.manager.clonePointerEvent(this)}}])})(Gx),Pg=(function(r){function e(){return le(this,e),We(this,e,arguments)}return qe(e,r),ce(e,[{key:"clone",value:function(){return this.manager.cloneWheelEvent(this)}}])})(Gx),yn=(function(r){function e(t,n){var i;return le(this,e),i=We(this,e,[null]),i.type=t,i.detail=n?.detail,n&&!("detail"in n)&&(i.detail=n),Object.assign(i,n),i}return qe(e,r),ce(e)})(Uc),Kx=(function(){function r(){le(this,r),this.emitter=new Rb}return ce(r,[{key:"on",value:function(t,n,i){return this.addEventListener(t,n,i),this}},{key:"addEventListener",value:function(t,n,i){var a=!1,s=!1;if(mA(i))a=i;else if(i){var o=i.capture;a=o===void 0?!1:o;var A=i.once;s=A===void 0?!1:A}a&&(t+="capture"),n=Te(n)?n:n.handleEvent;var l=Te(n)?void 0:n;return s?this.emitter.once(t,n,l):this.emitter.on(t,n,l),this}},{key:"off",value:function(t,n,i){return t?this.removeEventListener(t,n,i):this.removeAllEventListeners(),this}},{key:"removeAllEventListeners",value:function(){var t;(t=this.emitter)===null||t===void 0||t.removeAllListeners()}},{key:"removeEventListener",value:function(t,n,i){var a;if(!this.emitter)return this;var s=mA(i)?i:i?.capture;s&&(t+="capture"),n=Te(n)?n:(a=n)===null||a===void 0?void 0:a.handleEvent;var o=Te(n)?void 0:n;return this.emitter.off(t,n,o),this}},{key:"emit",value:function(t,n){this.dispatchEvent(new yn(t,n))}},{key:"dispatchEventToSelf",value:function(t){t.target||(t.target=this),t.currentTarget=this,this.emitter.emit(t.type,t)}},{key:"dispatchEvent",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2?arguments[2]:void 0;if(i)return this.dispatchEventToSelf(t),!0;var a;if(this.document)a=this;else if(this.defaultView)a=this.defaultView;else{var s;a=(s=this.ownerDocument)===null||s===void 0?void 0:s.defaultView}if(a){if(t.manager=a.getEventService(),!t.manager)return!1;t.defaultPrevented=!1,t.path?t.path.length=0:t.page=[],n||(t.target=this),t.manager.dispatchEvent(t,t.type,n)}else this.dispatchEventToSelf(t);return!t.defaultPrevented}}])})(),Kt=(function(r){function e(){var t;le(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t=We(this,e,[].concat(i)),t.shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.mutations=void 0,t.parentNode=null,t.destroyed=!1,t}return qe(e,r),ce(e,[{key:"textContent",get:function(){var n="";this.nodeName===re.TEXT&&(n+=this.style.text);var i=Qa(this.childNodes),a;try{for(i.s();!(a=i.n()).done;){var s=a.value;s.nodeName===re.TEXT?n+=s.nodeValue:n+=s.textContent}}catch(o){i.e(o)}finally{i.f()}return n},set:function(n){var i=this;this.childNodes.slice().forEach(function(a){i.removeChild(a)}),this.nodeName===re.TEXT&&(this.style.text="".concat(n))}},{key:"getRootNode",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.parentNode?this.parentNode.getRootNode(n):n.composed&&this.host?this.host.getRootNode(n):this}},{key:"hasChildNodes",value:function(){return this.childNodes.length>0}},{key:"isDefaultNamespace",value:function(n){throw new Error(mt)}},{key:"lookupNamespaceURI",value:function(n){throw new Error(mt)}},{key:"lookupPrefix",value:function(n){throw new Error(mt)}},{key:"normalize",value:function(){throw new Error(mt)}},{key:"isEqualNode",value:function(n){return this===n}},{key:"isSameNode",value:function(n){return this.isEqualNode(n)}},{key:"parent",get:function(){return this.parentNode}},{key:"parentElement",get:function(){return null}},{key:"nextSibling",get:function(){return null}},{key:"previousSibling",get:function(){return null}},{key:"firstChild",get:function(){return this.childNodes.length>0?this.childNodes[0]:null}},{key:"lastChild",get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}},{key:"compareDocumentPosition",value:function(n){if(n===this)return 0;for(var i=n,a=this,s=[i],o=[a];(A=i.parentNode)!==null&&A!==void 0?A:a.parentNode;){var A;i=i.parentNode?(s.push(i.parentNode),i.parentNode):i,a=a.parentNode?(o.push(a.parentNode),a.parentNode):a}if(i!==a)return e.DOCUMENT_POSITION_DISCONNECTED|e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|e.DOCUMENT_POSITION_PRECEDING;var l=s.length>o.length?s:o,c=l===s?o:s;if(l[l.length-c.length]===c[0])return l===s?e.DOCUMENT_POSITION_CONTAINED_BY|e.DOCUMENT_POSITION_FOLLOWING:e.DOCUMENT_POSITION_CONTAINS|e.DOCUMENT_POSITION_PRECEDING;for(var u=l.length-c.length,h=c.length-1;h>=0;h--){var d=c[h],f=l[u+h];if(f!==d){var g=d.parentNode.childNodes;return g.indexOf(d)<g.indexOf(f)?c===s?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING:l===s?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING}}return e.DOCUMENT_POSITION_FOLLOWING}},{key:"contain",value:function(n){return this.contains(n)}},{key:"contains",value:function(n){for(var i=n;i&&this!==i;)i=i.parentNode;return!!i}},{key:"getAncestor",value:function(n){for(var i=this;n>0&&i;)i=i.parentNode,n--;return i}},{key:"forEach",value:function(n){for(var i=[this];i.length>0;){var a=i.pop(),s=n(a);if(s===!1)break;for(var o=a.childNodes.length-1;o>=0;o--)i.push(a.childNodes[o])}}}],[{key:"isNode",value:function(n){return!!n.childNodes}}])})(Kx);Kt.DOCUMENT_POSITION_DISCONNECTED=1,Kt.DOCUMENT_POSITION_PRECEDING=2,Kt.DOCUMENT_POSITION_FOLLOWING=4,Kt.DOCUMENT_POSITION_CONTAINS=8,Kt.DOCUMENT_POSITION_CONTAINED_BY=16,Kt.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var pH=2048,vH=(function(){function r(e,t){var n=this;le(this,r),this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=Ct(),this.tmpVec3=Je(),this.onPointerDown=function(i){var a=n.createPointerEvent(i);if(n.dispatchEvent(a,"pointerdown"),a.pointerType==="touch")n.dispatchEvent(a,"touchstart");else if(a.pointerType==="mouse"||a.pointerType==="pen"){var s=a.button===2;n.dispatchEvent(a,s?"rightdown":"mousedown")}var o=n.trackingData(i.pointerId);o.pressTargetsByButton[i.button]=a.composedPath(),n.freeEvent(a)},this.onPointerUp=function(i){var a=Ng.now(),s=n.createPointerEvent(i,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);if(n.dispatchEvent(s,"pointerup"),s.pointerType==="touch")n.dispatchEvent(s,"touchend");else if(s.pointerType==="mouse"||s.pointerType==="pen"){var o=s.button===2;n.dispatchEvent(s,o?"rightup":"mouseup")}var A=n.trackingData(i.pointerId),l=n.findMountedTarget(A.pressTargetsByButton[i.button]),c=l;if(l&&!s.composedPath().includes(l)){for(var u=l;u&&!s.composedPath().includes(u);){if(s.currentTarget=u,n.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch")n.notifyTarget(s,"touchendoutside");else if(s.pointerType==="mouse"||s.pointerType==="pen"){var h=s.button===2;n.notifyTarget(s,h?"rightupoutside":"mouseupoutside")}Kt.isNode(u)&&(u=u.parentNode)}delete A.pressTargetsByButton[i.button],c=u}if(c){var d,f=n.clonePointerEvent(s,"click");f.target=c,f.path=[],A.clicksByButton[i.button]||(A.clicksByButton[i.button]={clickCount:0,target:f.target,timeStamp:a});var g=n.context.renderingContext.root.ownerDocument.defaultView,p=A.clicksByButton[i.button];p.target===f.target&&a-p.timeStamp<g.getConfig().dblClickSpeed?++p.clickCount:p.clickCount=1,p.target=f.target,p.timeStamp=a,f.detail=p.clickCount,(d=s.detail)!==null&&d!==void 0&&d.preventClick||(!n.context.config.useNativeClickEvent&&(f.pointerType==="mouse"||f.pointerType==="touch")&&n.dispatchEvent(f,"click"),n.dispatchEvent(f,"pointertap")),n.freeEvent(f)}n.freeEvent(s)},this.onPointerMove=function(i){var a=n.createPointerEvent(i,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0),s=a.pointerType==="mouse"||a.pointerType==="pen",o=n.trackingData(i.pointerId),A=n.findMountedTarget(o.overTargets);if(o.overTargets&&A!==a.target){var l=i.type==="mousemove"?"mouseout":"pointerout",c=n.createPointerEvent(i,l,A||void 0);if(n.dispatchEvent(c,"pointerout"),s&&n.dispatchEvent(c,"mouseout"),!a.composedPath().includes(A)){var u=n.createPointerEvent(i,"pointerleave",A||void 0);for(u.eventPhase=u.AT_TARGET;u.target&&!a.composedPath().includes(u.target);)u.currentTarget=u.target,n.notifyTarget(u),s&&n.notifyTarget(u,"mouseleave"),Kt.isNode(u.target)&&(u.target=u.target.parentNode);n.freeEvent(u)}n.freeEvent(c)}if(A!==a.target){var h=i.type==="mousemove"?"mouseover":"pointerover",d=n.clonePointerEvent(a,h);n.dispatchEvent(d,"pointerover"),s&&n.dispatchEvent(d,"mouseover");for(var f=A&&Kt.isNode(A)&&A.parentNode;f&&f!==(Kt.isNode(n.rootTarget)&&n.rootTarget.parentNode)&&f!==a.target;)f=f.parentNode;var g=!f||f===(Kt.isNode(n.rootTarget)&&n.rootTarget.parentNode);if(g){var p=n.clonePointerEvent(a,"pointerenter");for(p.eventPhase=p.AT_TARGET;p.target&&p.target!==A&&p.target!==(Kt.isNode(n.rootTarget)&&n.rootTarget.parentNode);)p.currentTarget=p.target,n.notifyTarget(p),s&&n.notifyTarget(p,"mouseenter"),Kt.isNode(p.target)&&(p.target=p.target.parentNode);n.freeEvent(p)}n.freeEvent(d)}n.dispatchEvent(a,"pointermove"),a.pointerType==="touch"&&n.dispatchEvent(a,"touchmove"),s&&(n.dispatchEvent(a,"mousemove"),n.cursor=n.getCursor(a.target)),o.overTargets=a.composedPath(),n.freeEvent(a)},this.onPointerOut=function(i){var a=n.trackingData(i.pointerId);if(a.overTargets){var s=i.pointerType==="mouse"||i.pointerType==="pen",o=n.findMountedTarget(a.overTargets),A=n.createPointerEvent(i,"pointerout",o||void 0);n.dispatchEvent(A),s&&n.dispatchEvent(A,"mouseout");var l=n.createPointerEvent(i,"pointerleave",o||void 0);for(l.eventPhase=l.AT_TARGET;l.target&&l.target!==(Kt.isNode(n.rootTarget)&&n.rootTarget.parentNode);)l.currentTarget=l.target,n.notifyTarget(l),s&&n.notifyTarget(l,"mouseleave"),Kt.isNode(l.target)&&(l.target=l.target.parentNode);a.overTargets=null,n.freeEvent(A),n.freeEvent(l)}n.cursor=null},this.onPointerOver=function(i){var a=n.trackingData(i.pointerId),s=n.createPointerEvent(i),o=s.pointerType==="mouse"||s.pointerType==="pen";n.dispatchEvent(s,"pointerover"),o&&n.dispatchEvent(s,"mouseover"),s.pointerType==="mouse"&&(n.cursor=n.getCursor(s.target));var A=n.clonePointerEvent(s,"pointerenter");for(A.eventPhase=A.AT_TARGET;A.target&&A.target!==(Kt.isNode(n.rootTarget)&&n.rootTarget.parentNode);)A.currentTarget=A.target,n.notifyTarget(A),o&&n.notifyTarget(A,"mouseenter"),Kt.isNode(A.target)&&(A.target=A.target.parentNode);a.overTargets=s.composedPath(),n.freeEvent(s),n.freeEvent(A)},this.onPointerUpOutside=function(i){var a=n.trackingData(i.pointerId),s=n.findMountedTarget(a.pressTargetsByButton[i.button]),o=n.createPointerEvent(i);if(s){for(var A=s;A;)o.currentTarget=A,n.notifyTarget(o,"pointerupoutside"),o.pointerType==="touch"||(o.pointerType==="mouse"||o.pointerType==="pen")&&n.notifyTarget(o,o.button===2?"rightupoutside":"mouseupoutside"),Kt.isNode(A)&&(A=A.parentNode);delete a.pressTargetsByButton[i.button]}n.freeEvent(o)},this.onWheel=function(i){var a=n.createWheelEvent(i);n.dispatchEvent(a),n.freeEvent(a)},this.onClick=function(i){if(n.context.config.useNativeClickEvent){var a=n.createPointerEvent(i);n.dispatchEvent(a),n.freeEvent(a)}},this.onPointerCancel=function(i){var a=n.createPointerEvent(i,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);n.dispatchEvent(a),n.freeEvent(a)},this.globalRuntime=e,this.context=t}return ce(r,[{key:"init",value:function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)}},{key:"destroy",value:function(){this.mappingTable={},this.mappingState={},this.eventPool.clear()}},{key:"getScale",value:function(){var t=this.context.contextService.getBoundingClientRect(),n=1,i=1,a=this.context.contextService.getDomElement();if(a&&t){var s=a.offsetWidth,o=a.offsetHeight;s&&o&&(n=t.width/s,i=t.height/o)}return{scaleX:n,scaleY:i,bbox:t}}},{key:"client2Viewport",value:function(t){var n=this.getScale(),i=n.scaleX,a=n.scaleY,s=n.bbox;return new Hn((t.x-(s?.left||0))/i,(t.y-(s?.top||0))/a)}},{key:"viewport2Client",value:function(t){var n=this.getScale(),i=n.scaleX,a=n.scaleY,s=n.bbox;return new Hn((t.x+(s?.left||0))*i,(t.y+(s?.top||0))*a)}},{key:"viewport2Canvas",value:function(t){var n=t.x,i=t.y,a=this.rootTarget.defaultView,s=a.getCamera(),o=this.context.config,A=o.width,l=o.height,c=s.getPerspectiveInverse(),u=s.getWorldTransform(),h=Xn(this.tmpMatrix,u,c),d=Zn(this.tmpVec3,n/A*2-1,(1-i/l)*2-1,0);return Jn(d,d,h),new Hn(d[0],d[1])}},{key:"canvas2Viewport",value:function(t){var n=this.rootTarget.defaultView,i=n.getCamera(),a=i.getPerspective(),s=i.getViewTransform(),o=Xn(this.tmpMatrix,a,s),A=Zn(this.tmpVec3,t.x,t.y,0);Jn(this.tmpVec3,this.tmpVec3,o);var l=this.context.config,c=l.width,u=l.height;return new Hn((A[0]+1)/2*c,(1-(A[1]+1)/2)*u)}},{key:"setPickHandler",value:function(t){this.pickHandler=t}},{key:"addEventMapping",value:function(t,n){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:n,priority:0}),this.mappingTable[t].sort(function(i,a){return i.priority-a.priority})}},{key:"mapEvent",value:function(t){if(this.rootTarget){var n=this.mappingTable[t.type];if(n)for(var i=0,a=n.length;i<a;i++)n[i].fn(t);else console.warn("[EventService]: Event mapping not defined for ".concat(t.type))}}},{key:"dispatchEvent",value:function(t,n,i){if(!i)t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,n);else{t.eventPhase=t.AT_TARGET;var a=this.rootTarget.defaultView||null;t.currentTarget=a,this.notifyListeners(t,n)}}},{key:"propagate",value:function(t,n){if(t.target){var i=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var a=i.length-1;a>=1;a--)if(t.currentTarget=i[a],this.notifyTarget(t,n),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,n),!(t.propagationStopped||t.propagationImmediatelyStopped)){var s=i.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var o=s+1;o<i.length;o++)if(t.currentTarget=i[o],this.notifyTarget(t,n),t.propagationStopped||t.propagationImmediatelyStopped)return}}}},{key:"propagationPath",value:function(t){var n=[t],i=this.rootTarget.defaultView||null;if(i&&i===t)return n.unshift(i.document),n;for(var a=0;a<pH&&t!==this.rootTarget;a++)Kt.isNode(t)&&t.parentNode&&(n.push(t.parentNode),t=t.parentNode);return i&&n.push(i),n}},{key:"hitTest",value:function(t){var n=t.viewportX,i=t.viewportY,a=this.context.config,s=a.width,o=a.height,A=a.disableHitTesting;return n<0||i<0||n>s||i>o?null:!A&&this.pickHandler(t)||this.rootTarget||null}},{key:"isNativeEventFromCanvas",value:function(t,n){var i,a=n?.target;if((i=a)!==null&&i!==void 0&&i.shadowRoot&&(a=n.composedPath()[0]),a){if(a===t)return!0;if(t&&t.contains)return t.contains(a)}return n!=null&&n.composedPath?n.composedPath().indexOf(t)>-1:!1}},{key:"getExistedHTML",value:function(t){if(t.nativeEvent.composedPath)for(var n=0,i=t.nativeEvent.composedPath();n<i.length;n++){var a=i[n],s=this.nativeHTMLMap.get(a);if(s)return s}return null}},{key:"pickTarget",value:function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})}},{key:"createPointerEvent",value:function(t,n,i,a){var s=this.allocateEvent(Pc);this.copyPointerData(t,s),this.copyMouseData(t,s),this.copyData(t,s),s.nativeEvent=t.nativeEvent,s.originalEvent=t;var o=this.getExistedHTML(s),A=this.context.contextService.getDomElement();return s.target=i??(o||this.isNativeEventFromCanvas(A,s.nativeEvent)&&this.pickTarget(s)||a),typeof n=="string"&&(s.type=n),s}},{key:"createWheelEvent",value:function(t){var n=this.allocateEvent(Pg);this.copyWheelData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.nativeEvent=t.nativeEvent,n.originalEvent=t;var i=this.getExistedHTML(n),a=this.context.contextService.getDomElement();return n.target=i||this.isNativeEventFromCanvas(a,n.nativeEvent)&&this.pickTarget(n),n}},{key:"trackingData",value:function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}},{key:"cloneWheelEvent",value:function(t){var n=this.allocateEvent(Pg);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyWheelData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=t.type,n}},{key:"clonePointerEvent",value:function(t,n){var i=this.allocateEvent(Pc);return i.nativeEvent=t.nativeEvent,i.originalEvent=t.originalEvent,this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.target=t.target,i.path=t.composedPath().slice(),i.type=n??i.type,i}},{key:"copyPointerData",value:function(t,n){n.pointerId=t.pointerId,n.width=t.width,n.height=t.height,n.isPrimary=t.isPrimary,n.pointerType=t.pointerType,n.pressure=t.pressure,n.tangentialPressure=t.tangentialPressure,n.tiltX=t.tiltX,n.tiltY=t.tiltY,n.twist=t.twist}},{key:"copyMouseData",value:function(t,n){n.altKey=t.altKey,n.button=t.button,n.buttons=t.buttons,n.ctrlKey=t.ctrlKey,n.metaKey=t.metaKey,n.shiftKey=t.shiftKey,n.client.copyFrom(t.client),n.movement.copyFrom(t.movement),n.canvas.copyFrom(t.canvas),n.screen.copyFrom(t.screen),n.global.copyFrom(t.global),n.offset.copyFrom(t.offset)}},{key:"copyWheelData",value:function(t,n){n.deltaMode=t.deltaMode,n.deltaX=t.deltaX,n.deltaY=t.deltaY,n.deltaZ=t.deltaZ}},{key:"copyData",value:function(t,n){n.isTrusted=t.isTrusted,n.timeStamp=Ng.now(),n.type=t.type,n.detail=t.detail,n.view=t.view,n.page.copyFrom(t.page),n.viewport.copyFrom(t.viewport)}},{key:"allocateEvent",value:function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var n=this.eventPool.get(t).pop()||new t(this);return n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.target=null,n}},{key:"freeEvent",value:function(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var n=t.constructor;this.eventPool.has(n)||this.eventPool.set(n,[]),this.eventPool.get(n).push(t)}},{key:"notifyTarget",value:function(t,n){n=n??t.type;var i=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(n,"capture"):n;this.notifyListeners(t,i),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,n)}},{key:"notifyListeners",value:function(t,n){var i=t.currentTarget.emitter,a=i._events[n];if(a)if("fn"in a)a.once&&i.removeListener(n,a.fn,void 0,!0),a.fn.call(t.currentTarget||a.context,t);else for(var s=0;s<a.length&&!t.propagationImmediatelyStopped;s++)a[s].once&&i.removeListener(n,a[s].fn,void 0,!0),a[s].fn.call(t.currentTarget||a[s].context,t)}},{key:"findMountedTarget",value:function(t){if(!t)return null;for(var n=t[t.length-1],i=t.length-2;i>=0;i--){var a=t[i];if(a===this.rootTarget||Kt.isNode(a)&&a.parentNode===n)n=t[i];else break}return n}},{key:"getCursor",value:function(t){for(var n=t;n;){var i=k4(n)&&n.getAttribute("cursor");if(i)return i;n=Kt.isNode(n)&&n.parentNode}}}])})(),Rg=(function(){function r(){le(this,r)}return ce(r,[{key:"getOrCreateCanvas",value:function(t,n){if(this.canvas)return this.canvas;if(t||he.offscreenCanvas)this.canvas=t||he.offscreenCanvas,this.context=this.canvas.getContext("2d",De({willReadFrequently:!0},n));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",De({willReadFrequently:!0},n)),(!this.context||!this.context.measureText)&&(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch{this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",De({willReadFrequently:!0},n))}return this.canvas.width=10,this.canvas.height=10,this.canvas}},{key:"getOrCreateContext",value:function(t,n){return this.context?this.context:(this.getOrCreateCanvas(t,n),this.context)}}],[{key:"createCanvas",value:function(){try{return new window.OffscreenCanvas(0,0)}catch{}try{return document.createElement("canvas")}catch{}return null}}])})(),Fo=(function(r){return r[r.CAMERA_CHANGED=0]="CAMERA_CHANGED",r[r.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",r[r.NONE=2]="NONE",r})({}),yH=(function(){function r(e,t){le(this,r),this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new lr,initAsync:new $4,dirtycheck:new Qg,cull:new Qg,beginFrame:new lr,beforeRender:new lr,render:new lr,afterRender:new lr,endFrame:new lr,destroy:new lr,pick:new Y4,pickSync:new Qg,pointerDown:new lr,pointerUp:new lr,pointerMove:new lr,pointerOut:new lr,pointerOver:new lr,pointerWheel:new lr,pointerCancel:new lr,click:new lr},this.globalRuntime=e,this.context=t}return ce(r,[{key:"init",value:function(t){var n=this,i=De(De({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach(function(a){a.apply(i,n.globalRuntime)}),this.hooks.init.call(),this.hooks.initAsync.getCallbacksNum()===0?(this.inited=!0,t()):this.hooks.initAsync.promise().then(function(){n.inited=!0,t()}).catch(function(a){})}},{key:"getStats",value:function(){return this.stats}},{key:"disableDirtyRectangleRendering",value:function(){var t=this.context.config.renderer,n=t.getConfig(),i=n.enableDirtyRectangleRendering;return!i||this.context.renderingContext.renderReasons.has(Fo.CAMERA_CHANGED)}},{key:"render",value:function(t,n,i){var a=this,s=t.getConfig(),o=this.context.renderingContext;if(this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0,this.globalRuntime.sceneGraphService.syncHierarchy(o.root),this.globalRuntime.sceneGraphService.notifyMutationObservers(t),o.renderReasons.size&&this.inited){o.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var A=o.renderReasons.size===1&&o.renderReasons.has(Fo.CAMERA_CHANGED),l=!s.disableRenderHooks||!A;l&&this.renderDisplayObject(o.root,s,o),this.hooks.beginFrame.call(n),l&&o.renderListCurrentFrame.forEach(function(c){a.hooks.beforeRender.call(c),a.hooks.render.call(c),a.hooks.afterRender.call(c)}),this.hooks.endFrame.call(n),o.renderListCurrentFrame=[],o.renderReasons.clear(),i()}}},{key:"renderDisplayObject",value:function(t,n,i){var a=this,s=n.renderer.getConfig(),o=s.enableDirtyCheck,A=s.enableCulling;function l(g){var p=g.renderable,v=g.sortable,y=o?p.dirty||i.dirtyRectangleRenderingDisabled?g:null:g,m=null;y&&(m=A?a.hooks.cull.call(y,a.context.camera):y,m&&(a.stats.rendered+=1,i.renderListCurrentFrame.push(m))),g.dirty(!1),v.renderOrder=a.zIndexCounter,a.zIndexCounter+=1,a.stats.total+=1,v.dirty&&(a.sort(g,v),v.dirty=!1,v.dirtyChildren=[],v.dirtyReason=void 0)}for(var c=[t];c.length>0;){var u,h=c.pop();l(h);for(var d=((u=h.sortable)===null||u===void 0||(u=u.sorted)===null||u===void 0?void 0:u.length)>0?h.sortable.sorted:h.childNodes,f=d.length-1;f>=0;f--)c.push(d[f])}}},{key:"sort",value:function(t,n){var i,a;(n==null||(i=n.sorted)===null||i===void 0?void 0:i.length)>0&&n.dirtyReason!==xc.Z_INDEX_CHANGED?n.dirtyChildren.forEach(function(s){var o=n.sorted.indexOf(s);o>-1&&n.sorted.splice(o,1);var A=t.childNodes.indexOf(s);if(A>-1)if(n.sorted.length===0)n.sorted.push(s);else{var l=N4(n.sorted,s);n.sorted.splice(l,0,s)}}):n.sorted=t.childNodes.slice().sort(Ox),((a=n.sorted)===null||a===void 0?void 0:a.length)>0&&t.childNodes.filter(function(s){return s.parsedStyle.zIndex}).length===0&&(n.sorted=[])}},{key:"destroy",value:function(){this.inited=!1,this.hooks.destroy.call()}},{key:"dirty",value:function(){this.context.renderingContext.renderReasons.add(Fo.DISPLAY_OBJECT_CHANGED)}}])})(),mH=/\[\s*(.*)=(.*)\s*\]/,wH=(function(){function r(){le(this,r)}return ce(r,[{key:"selectOne",value:function(t,n){var i=this;if(t.startsWith("."))return n.find(function(A){return(A?.classList||[]).indexOf(i.getIdOrClassname(t))>-1});if(t.startsWith("#"))return n.find(function(A){return A.id===i.getIdOrClassname(t)});if(t.startsWith("[")){var a=this.getAttribute(t),s=a.name,o=a.value;return s?n.find(function(A){return n!==A&&(s==="name"?A.name===o:i.attributeToString(A,s)===o)}):null}return n.find(function(A){return n!==A&&A.nodeName===t})}},{key:"selectAll",value:function(t,n){var i=this;if(t.startsWith("."))return n.findAll(function(A){return n!==A&&(A?.classList||[]).indexOf(i.getIdOrClassname(t))>-1});if(t.startsWith("#"))return n.findAll(function(A){return n!==A&&A.id===i.getIdOrClassname(t)});if(t.startsWith("[")){var a=this.getAttribute(t),s=a.name,o=a.value;return s?n.findAll(function(A){return n!==A&&(s==="name"?A.name===o:i.attributeToString(A,s)===o)}):[]}return n.findAll(function(A){return n!==A&&A.nodeName===t})}},{key:"is",value:function(t,n){if(t.startsWith("."))return n.className===this.getIdOrClassname(t);if(t.startsWith("#"))return n.id===this.getIdOrClassname(t);if(t.startsWith("[")){var i=this.getAttribute(t),a=i.name,s=i.value;return a==="name"?n.name===s:this.attributeToString(n,a)===s}return n.nodeName===t}},{key:"getIdOrClassname",value:function(t){return t.substring(1)}},{key:"getAttribute",value:function(t){var n=t.match(mH),i="",a="";return n&&n.length>2&&(i=n[1].replace(/"/g,""),a=n[2].replace(/"/g,"")),{name:i,value:a}}},{key:"attributeToString",value:function(t,n){if(!t.getAttribute)return"";var i=t.getAttribute(n);return ke(i)?"":i.toString?i.toString():""}}])})(),at=(function(r){return r.ATTR_MODIFIED="DOMAttrModified",r.INSERTED="DOMNodeInserted",r.MOUNTED="DOMNodeInsertedIntoDocument",r.REMOVED="removed",r.UNMOUNTED="DOMNodeRemovedFromDocument",r.REPARENT="reparent",r.DESTROY="destroy",r.BOUNDS_CHANGED="bounds-changed",r.CULLED="culled",r})({}),Gi=(function(r){function e(t,n,i,a,s,o,A,l){var c;return le(this,e),c=We(this,e,[null]),c.relatedNode=n,c.prevValue=i,c.newValue=a,c.attrName=s,c.attrChange=o,c.prevParsedValue=A,c.newParsedValue=l,c.type=t,c}return qe(e,r),ce(e)})(Uc);Gi.ADDITION=2,Gi.MODIFICATION=1,Gi.REMOVAL=3;var BH=new Gi(at.REPARENT,null,"","","",0,"",""),bH=jf(),Rc=Je(),EH=St(1,1,1),xH=Ct(),CH=jf(),Ss=Je(),SH=Ct(),Fs=vn(),FH=Je(),TH=vn(),MH=Je(),NA=Je(),Ts=Je(),Dc=Ct(),zx=vn(),Vx=vn(),Hc=vn(),OH=(function(){function r(e){le(this,r),this.displayObjectDependencyMap=new WeakMap,this.runtime=e}return ce(r,[{key:"matches",value:function(t,n){return this.runtime.sceneGraphSelector.is(t,n)}},{key:"querySelector",value:function(t,n){return this.runtime.sceneGraphSelector.selectOne(t,n)}},{key:"querySelectorAll",value:function(t,n){return this.runtime.sceneGraphSelector.selectAll(t,n)}},{key:"attach",value:function(t,n,i){var a,s=!1;t.parentNode&&(s=t.parentNode!==n,this.detach(t));var o=t.nodeName===re.FRAGMENT,A=Qc(n);t.parentNode=n;var l=o?t.childNodes:[t];Be(i)?l.forEach(function(g){n.childNodes.splice(i,0,g),g.parentNode=n}):l.forEach(function(g){n.childNodes.push(g),g.parentNode=n});var c=n,u=c.sortable;if((u!=null&&(a=u.sorted)!==null&&a!==void 0&&a.length||u.dirty||t.parsedStyle.zIndex)&&(u.dirtyChildren.indexOf(t)===-1&&u.dirtyChildren.push(t),u.dirty=!0,u.dirtyReason=xc.ADDED),!A){if(o)this.dirtyFragment(t);else{var h=t.transformable;h&&this.dirtyWorldTransform(t,h)}if(s){var d,f=((d=n.ownerDocument)===null||d===void 0||(d=d.defaultView)===null||d===void 0||(d=d.getConfig())===null||d===void 0||(d=d.future)===null||d===void 0?void 0:d.experimentalCancelEventPropagation)===!0;t.dispatchEvent(BH,f,f)}}}},{key:"detach",value:function(t){var n,i;if(t.parentNode){var a=t.transformable,s=t.parentNode,o=s.sortable;(o!=null&&(n=o.sorted)!==null&&n!==void 0&&n.length||(i=t.style)!==null&&i!==void 0&&i.zIndex)&&(o.dirtyChildren.indexOf(t)===-1&&o.dirtyChildren.push(t),o.dirty=!0,o.dirtyReason=xc.REMOVED);var A=t.parentNode.childNodes.indexOf(t);A>-1&&t.parentNode.childNodes.splice(A,1),a&&this.dirtyWorldTransform(t,a),t.parentNode=null}}},{key:"getLocalPosition",value:function(t){return t.transformable.localPosition}},{key:"getLocalRotation",value:function(t){return t.transformable.localRotation}},{key:"getLocalScale",value:function(t){return t.transformable.localScale}},{key:"getLocalSkew",value:function(t){return t.transformable.localSkew}},{key:"getLocalTransform",value:function(t){var n=t.transformable;return jE(n),n.localTransform}},{key:"setLocalPosition",value:function(t,n){var i,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=t.transformable;NA[0]=n[0],NA[1]=n[1],NA[2]=(i=n[2])!==null&&i!==void 0?i:0,!pA(s.localPosition,NA)&&(Ni(s.localPosition,NA),a&&this.dirtyLocalTransform(t,s))}},{key:"translateLocal",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof n=="number"&&(n=St(n,i,a));var s=t.transformable;pA(n,Rc)||(JP(n,n,s.localRotation),Oa(s.localPosition,s.localPosition,n),this.dirtyLocalTransform(t,s))}},{key:"setLocalRotation",value:function(t,n,i,a,s){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;typeof n=="number"&&(n=AE(Fs,n,i,a,s));var A=t.transformable;cc(A.localRotation,n),o&&this.dirtyLocalTransform(t,A)}},{key:"rotateLocal",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof n=="number"&&(n=St(n,i,a));var s=t.transformable;lc(Vx,n[0],n[1],n[2]),lE(s.localRotation,s.localRotation,Vx),this.dirtyLocalTransform(t,s)}},{key:"setLocalScale",value:function(t,n){var i,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=t.transformable;Zn(Ss,n[0],n[1],(i=n[2])!==null&&i!==void 0?i:s.localScale[2]),!pA(Ss,s.localScale)&&(Ni(s.localScale,Ss),a&&this.dirtyLocalTransform(t,s))}},{key:"scaleLocal",value:function(t,n){var i,a=t.transformable;qP(a.localScale,a.localScale,Zn(Ss,n[0],n[1],(i=n[2])!==null&&i!==void 0?i:1)),this.dirtyLocalTransform(t,a)}},{key:"setLocalSkew",value:function(t,n,i){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;typeof n=="number"&&(n=sR(CH,n,i));var s=t.transformable;aR(s.localSkew,n),a&&this.dirtyLocalTransform(t,s)}},{key:"setLocalEulerAngles",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;typeof n=="number"&&(n=St(n,i,a));var o=t.transformable;lc(o.localRotation,n[0],n[1],n[2]),s&&this.dirtyLocalTransform(t,o)}},{key:"setLocalTransform",value:function(t,n){var i=ac(FH,n),a=sc(TH,n),s=go(MH,n);this.setLocalScale(t,s,!1),this.setLocalPosition(t,i,!1),this.setLocalRotation(t,a,void 0,void 0,void 0,!1),this.dirtyLocalTransform(t,t.transformable)}},{key:"resetLocalTransform",value:function(t){this.setLocalScale(t,EH,!1),this.setLocalPosition(t,Rc,!1),this.setLocalEulerAngles(t,Rc,void 0,void 0,!1),this.setLocalSkew(t,bH,void 0,!1),this.dirtyLocalTransform(t,t.transformable)}},{key:"getPosition",value:function(t){var n=t.transformable;return ac(n.position,this.getWorldTransform(t,n))}},{key:"getRotation",value:function(t){var n=t.transformable;return sc(n.rotation,this.getWorldTransform(t,n))}},{key:"getScale",value:function(t){var n=t.transformable;return go(n.scaling,this.getWorldTransform(t,n))}},{key:"getOrigin",value:function(t){return t.getGeometryBounds(),t.transformable.origin}},{key:"getWorldTransform",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t.transformable;return!n.localDirtyFlag&&!n.dirtyFlag||(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.internalUpdateTransform(t)),n.worldTransform}},{key:"setPosition",value:function(t,n){var i,a=t.transformable;if(Ts[0]=n[0],Ts[1]=n[1],Ts[2]=(i=n[2])!==null&&i!==void 0?i:0,!pA(this.getPosition(t),Ts)){if(Ni(a.position,Ts),t.parentNode===null||!t.parentNode.transformable)Ni(a.localPosition,Ts);else{var s=t.parentNode.transformable;ho(Dc,s.worldTransform),ki(Dc,Dc),Jn(a.localPosition,Ts,Dc)}this.dirtyLocalTransform(t,a)}}},{key:"translate",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof n=="number"&&(n=Zn(Ss,n,i,a)),!pA(n,Rc)&&(Oa(Ss,this.getPosition(t),n),this.setPosition(t,Ss))}},{key:"setRotation",value:function(t,n,i,a,s){var o=t.transformable;if(typeof n=="number"&&(n=iR(n,i,a,s)),t.parentNode===null||!t.parentNode.transformable)this.setLocalRotation(t,n);else{var A=this.getRotation(t.parentNode);cc(Fs,A),Vf(Fs,Fs),_a(o.localRotation,Fs,n),uc(o.localRotation,o.localRotation),this.dirtyLocalTransform(t,o)}}},{key:"rotate",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof n=="number"&&(n=St(n,i,a));var s=t.transformable;if(t.parentNode===null||!t.parentNode.transformable)this.rotateLocal(t,n);else{var o=Fs;lc(o,n[0],n[1],n[2]);var A=this.getRotation(t),l=this.getRotation(t.parentNode);cc(Hc,l),Vf(Hc,Hc),_a(o,Hc,o),_a(s.localRotation,o,A),uc(s.localRotation,s.localRotation),this.dirtyLocalTransform(t,s)}}},{key:"setOrigin",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof n=="number"&&(n=[n,i,a]);var s=t.transformable;if(!(n[0]===s.origin[0]&&n[1]===s.origin[1]&&n[2]===s.origin[2])){var o=s.origin;o[0]=n[0],o[1]=n[1],o[2]=n[2]||0,this.dirtyLocalTransform(t,s)}}},{key:"setEulerAngles",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof n=="number"&&(n=St(n,i,a));var s=t.transformable;if(t.parentNode===null||!t.parentNode.transformable)this.setLocalEulerAngles(t,n);else{lc(s.localRotation,n[0],n[1],n[2]);var o=this.getRotation(t.parentNode);cc(zx,Vf(Fs,o)),lE(s.localRotation,s.localRotation,zx),this.dirtyLocalTransform(t,s)}}},{key:"getGeometryBounds",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=t,a=i.geometry;a.dirty&&he.styleValueRegistry.updateGeometry(t);var s=n?a.renderBounds:a.contentBounds||null;return s||new kt}},{key:"getTransformedGeometryBounds",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2?arguments[2]:void 0,a=this.getGeometryBounds(t,n);if(!kt.isEmpty(a)){var s=i||new kt;return s.setFromTransformedAABB(a,this.getWorldTransform(t)),s}return null}},{key:"getBounds",value:function(t){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=t,s=a.renderable;if(!s.boundsDirty&&!i&&s.bounds)return s.bounds;if(!s.renderBoundsDirty&&i&&s.renderBounds)return s.renderBounds;var o=i?s.renderBounds:s.bounds,A=this.getTransformedGeometryBounds(t,i,o),l=t.childNodes;if(l.forEach(function(h){var d=n.getBounds(h,i);d&&(A?A.add(d):(A=o||new kt,A.update(d.center,d.halfExtents)))}),A||(A=new kt),i){var c=Ix(t);if(c){var u=c.parsedStyle.clipPath.getBounds(i);A?u&&(A=u.intersection(A)):A.update(u.center,u.halfExtents)}}return i?(s.renderBounds=A,s.renderBoundsDirty=!1):(s.bounds=A,s.boundsDirty=!1),A}},{key:"getLocalBounds",value:function(t){if(t.parentNode){var n=xH;t.parentNode.transformable&&(n=ki(SH,this.getWorldTransform(t.parentNode)));var i=this.getBounds(t);if(!kt.isEmpty(i)){var a=new kt;return a.setFromTransformedAABB(i,n),a}}return this.getBounds(t)}},{key:"getBoundingClientRect",value:function(t){var n,i,a=this.getGeometryBounds(t);kt.isEmpty(a)||(i=new kt,i.setFromTransformedAABB(a,this.getWorldTransform(t)));var s=(n=t.ownerDocument)===null||n===void 0||(n=n.defaultView)===null||n===void 0?void 0:n.getContextService().getBoundingClientRect();if(i){var o=i.getMin(),A=$e(o,2),l=A[0],c=A[1],u=i.getMax(),h=$e(u,2),d=h[0],f=h[1];return new Bo(l+(s?.left||0),c+(s?.top||0),d-l,f-c)}return new Bo(s?.left||0,s?.top||0,0,0)}},{key:"internalUpdateTransform",value:function(t){var n,i=(n=t.parentNode)===null||n===void 0?void 0:n.transformable;jE(t.transformable),XD(t.transformable,i)}},{key:"internalUpdateElement",value:function(t,n){var i,a,s,o,A=((i=t.ownerDocument)===null||i===void 0||(i=i.defaultView)===null||i===void 0||(i=i.getConfig())===null||i===void 0||(i=i.future)===null||i===void 0?void 0:i.experimentalAttributeUpdateOptimization)===!0,l=n[n.length-1],c=l?.transformDirty||((a=t.transformable)===null||a===void 0?void 0:a.localDirtyFlag);if(t.transformable){var u;(u=t.transformable).dirtyFlag||(u.dirtyFlag=c)}if(this.internalUpdateTransform(t),c){var h;(h=t.dirty)===null||h===void 0||h.call(t,!0,!0)}var d=((s=t.renderable)===null||s===void 0?void 0:s.boundsDirty)||((o=t.renderable)===null||o===void 0?void 0:o.renderBoundsDirty);if((c||d)&&l?.shapeUpdated===!1&&A)for(var f=n.length-1;f>=0;){var g,p,v=n[f];if(v.shapeUpdated)break;(g=(p=v.node).dirty)===null||g===void 0||g.call(p,!0,!0),v.shapeUpdated=!0,f-=1}return c}},{key:"syncHierarchy",value:function(t){for(var n,i,a=[t],s=t.parentNode?[{node:t.parentNode,transformDirty:((n=t.parentNode.transformable)===null||n===void 0?void 0:n.localDirtyFlag)||((i=t.parentNode.transformable)===null||i===void 0?void 0:i.dirtyFlag),shapeUpdated:!1}]:[];a.length>0;){for(var o=a.pop(),A=s[s.length-1];s.length>0&&o.parentNode!==A.node;)A=s.pop();var l=this.internalUpdateElement(o,s);if(o.childNodes.length>0){for(var c=o.childNodes.length-1;c>=0;c--)a.push(o.childNodes[c]);s.push({node:o,transformDirty:l,shapeUpdated:!1})}}}},{key:"dirtyLocalTransform",value:function(t,n){Qc(t)||n.localDirtyFlag||(n.localDirtyFlag=!0,n.dirtyFlag||this.dirtyWorldTransform(t,n))}},{key:"dirtyWorldTransform",value:function(t,n){this.dirtyWorldInternal(t,n),this.dirtyToRoot(t,!0)}},{key:"dirtyWorldInternal",value:function(t,n){var i,a=this,s=((i=t.ownerDocument)===null||i===void 0||(i=i.defaultView)===null||i===void 0||(i=i.getConfig())===null||i===void 0||(i=i.future)===null||i===void 0?void 0:i.experimentalAttributeUpdateOptimization)===!0;n.dirtyFlag||(n.dirtyFlag=!0,t.dirty(!0,!0),s||t.childNodes.forEach(function(o){var A=o.transformable;a.dirtyWorldInternal(o,A)}))}},{key:"dirtyToRoot",value:function(t){for(var n,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=t,s=((n=t.ownerDocument)===null||n===void 0||(n=n.defaultView)===null||n===void 0||(n=n.getConfig())===null||n===void 0||(n=n.future)===null||n===void 0?void 0:n.experimentalAttributeUpdateOptimization)===!0;a;){var o,A;if((o=(A=a).dirty)===null||o===void 0||o.call(A,!0,!0),s)break;a=a.parentNode}i&&t.forEach(function(u){var h;(h=u.dirty)===null||h===void 0||h.call(u,!0,!0)}),this.informDependentDisplayObjects(t);var l=t.mutations||[],c=l.find(function(u){return u.type==="attributes"&&u._boundsChangeData});c?c._boundsChangeData={affectChildren:c._boundsChangeData.affectChildren||i}:(c={type:"attributes",target:t,_boundsChangeData:{affectChildren:i}},l.push(c)),t.mutations=l}},{key:"dirtyFragment",value:function(t){var n,i,a=t.transformable;a&&(a.dirtyFlag=!0,a.localDirtyFlag=!0),(n=(i=t).dirty)===null||n===void 0||n.call(i,!0,!0);for(var s=t.childNodes.length,o=0;o<s;o++)this.dirtyFragment(t.childNodes[o])}},{key:"notifyMutationObservers",value:function(t){var n=new Set;if(t.getRoot().forEach(function(a){(a.mutations||[]).forEach(function(s){s.type==="attributes"&&s._boundsChangeData&&(s._boundsChangeData.affectChildren?a.forEach(function(o){var A=De({},s);A.target=o,n.add(A)}):n.add(s))}),a.mutations=void 0}),n.size>0){var i=new yn(at.BOUNDS_CHANGED,{detail:Array.from(n)});t.dispatchEvent(i,!0,!0)}}},{key:"updateDisplayObjectDependency",value:function(t,n,i,a){if(n&&n!==i){var s=this.displayObjectDependencyMap.get(n);if(s&&s[t]){var o=s[t].indexOf(a);s[t].splice(o,1)}}if(i){var A=this.displayObjectDependencyMap.get(i);A||(this.displayObjectDependencyMap.set(i,{}),A=this.displayObjectDependencyMap.get(i)),A[t]||(A[t]=[]),A[t].push(a)}}},{key:"informDependentDisplayObjects",value:function(t){var n,i=this,a=this.displayObjectDependencyMap.get(t);if(a){var s=(n=t.ownerDocument)===null||n===void 0||(n=n.defaultView)===null||n===void 0||(n=n.getConfig())===null||n===void 0||(n=n.future)===null||n===void 0?void 0:n.experimentalCancelEventPropagation;Object.keys(a).forEach(function(o){a[o].forEach(function(A){i.dirtyToRoot(A,!0),A.dispatchEvent(new Gi(at.ATTR_MODIFIED,A,i,i,o,Gi.MODIFICATION,i,i),s,s),A.isCustomElement&&A.isConnected&&A.attributeChangedCallback&&A.attributeChangedCallback(o,i,i)})})}}}])})(),jx=(function(){function r(e){if(le(this,r),e<=0)throw new Error("LRU capacity must be a positive number.");this.capacity=e,this.cache=new Map}return ce(r,[{key:"get",value:function(t){if(this.cache.has(t)){var n=this.cache.get(t);return this.cache.delete(t),this.cache.set(t,n),n}}},{key:"put",value:function(t,n){if(this.cache.has(t)&&this.cache.delete(t),this.cache.set(t,n),this.cache.size>this.capacity){var i=this.cache.keys().next().value;this.cache.delete(i)}}},{key:"len",value:function(){return this.cache.size}},{key:"clear",value:function(){this.cache.clear()}}])})(),Ms={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},Wx=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,IH=/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/,_H=/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/,kH=/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/,NH=/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/,LH=/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/,QH=/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/,UH=/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/,PH=/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/,RH=new RegExp("".concat(IH.source,"|").concat(kH.source,"|").concat(LH.source,"|").concat(UH.source)),DH=new RegExp("".concat(_H.source,"|").concat(NH.source,"|").concat(QH.source,"|").concat(PH.source)),HH=(function(){function r(e){var t=this;le(this,r),this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(n,i){return t.isBreakingSpace(i)?!1:!!(n&&(DH.exec(i)||RH.exec(n)))},this.trimByKinsokuShorui=function(n){var i=tt(n),a=i[i.length-2];if(!a)return n;var s=a[a.length-1];return i[i.length-2]=a.slice(0,-1),i[i.length-1]=s+i[i.length-1],i},this.runtime=e,this.charWidthCache=new jx(100)}return ce(r,[{key:"measureFont",value:function(t,n){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var i={ascent:0,descent:0,fontSize:0},a=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(n),s=this.runtime.offscreenCanvasCreator.getOrCreateContext(n,{willReadFrequently:!0});s.font=t;var o=Ms.MetricsString+Ms.BaselineSymbol,A=Math.ceil(s.measureText(o).width),l=Math.ceil(s.measureText(Ms.BaselineSymbol).width),c=Ms.HeightMultiplier*l;l=l*Ms.BaselineMultiplier|0,a.width=A,a.height=c,s.fillStyle="#f00",s.fillRect(0,0,A,c),s.font=t,s.textBaseline="alphabetic",s.fillStyle="#000",s.fillText(o,0,l);var u=s.getImageData(0,0,A||1,c||1).data,h=u.length,d=A*4,f=0,g=0,p=!1;for(f=0;f<l;++f){for(var v=0;v<d;v+=4)if(u[g+v]!==255){p=!0;break}if(!p)g+=d;else break}for(i.ascent=l-f,g=h-d,p=!1,f=c;f>l;--f){for(var y=0;y<d;y+=4)if(u[g+y]!==255){p=!0;break}if(!p)g-=d;else break}return i.descent=f-l,i.fontSize=i.ascent+i.descent,this.fontMetricsCache[t]=i,i}},{key:"measureText",value:function(t,n,i){var a=n.fontSize,s=a===void 0?16:a,o=n.wordWrap,A=o===void 0?!1:o,l=n.lineHeight,c=n.lineWidth,u=c===void 0?1:c,h=n.textBaseline,d=h===void 0?"alphabetic":h,f=n.textAlign,g=f===void 0?"start":f,p=n.letterSpacing,v=p===void 0?0:p,y=n.textPath;n.textPathSide,n.textPathStartOffset;var m=n.leading,B=m===void 0?0:m,C=Rx(n),S=this.measureFont(C,i);S.fontSize===0&&(S.fontSize=s,S.ascent=s);var F=this.runtime.offscreenCanvasCreator.getOrCreateContext(i);F.font=C,n.isOverflowing=!1;var T=A?this.wordWrap(t,n,i):t,O=T.split(/(?:\r\n|\r|\n)/),I=new Array(O.length),k=0;if(y){y.getTotalLength();for(var N=0;N<O.length;N++)F.measureText(O[N]).width+(O[N].length-1)*v}else{for(var U=0;U<O.length;U++){var D=F.measureText(O[U]).width+(O[U].length-1)*v;I[U]=D,k=Math.max(k,D)}var G=k+u,Z=l||S.fontSize+u,q=Math.max(Z,S.fontSize+u)+(O.length-1)*(Z+B);Z+=B;var j=0;return d==="middle"?j=-q/2:d==="bottom"||d==="alphabetic"||d==="ideographic"?j=-q:(d==="top"||d==="hanging")&&(j=0),{font:C,width:G,height:q,lines:O,lineWidths:I,lineHeight:Z,maxLineWidth:k,fontProperties:S,lineMetrics:I.map(function(te,ue){var ge=0;return g==="center"||g==="middle"?ge-=te/2:(g==="right"||g==="end")&&(ge-=te),new Bo(ge-u/2,j+ue*Z,te+u,Z)})}}}},{key:"wordWrap",value:function(t,n,i){var a=this,s=Array.from(t);if(s.length===0)return"";var o=this,A=n.wordWrapWidth,l=A===void 0?0:A,c=n.letterSpacing,u=c===void 0?0:c,h=n.maxLines,d=h===void 0?1/0:h,f=n.textOverflow,g=this.runtime.offscreenCanvasCreator.getOrCreateContext(i),p=l+u,v="";f==="ellipsis"?v="...":f&&f!=="clip"&&(v=f);var y=[""],m=0,B=0,C=-1,S=Rx(n),F=this.charWidthCache.get(S);F||(F=new jx(500),this.charWidthCache.put(S,F));var T=function(te){return a.getFromCache(te,u,F,g)},O=T(v);function I(j,te,ue,ge){for(;T(j)<ge&&te<s.length-1&&!o.isNewline(s[te+1]);)te+=1,j+=s[te];for(;T(j)>ge&&te>=ue;)te-=1,j=j.slice(0,-1);return{lineTxt:j,txtLastCharIndex:te}}function k(j,te){if(!(O<=0||O>p)){if(!y[j]){y[j]=v;return}var ue=I(y[j],te,C+1,p-O);y[j]=ue.lineTxt+v}}for(var N=0;N<s.length;N++){var U=s[N],D=s[N-1],G=s[N+1],Z=T(U);if(this.isNewline(U)){if(m+1>=d){N<s.length-1&&k(m,N-1),n.isOverflowing=!0;break}C=N-1,m+=1,B=0,y[m]="";continue}if(Z>p){k(m,N-1),n.isOverflowing=!0;break}if(B>0&&B+Z>p){var q=I(y[m],N-1,C+1,p);if(q.txtLastCharIndex!==N-1){if(y[m]=q.lineTxt,q.txtLastCharIndex===s.length-1)break;N=q.txtLastCharIndex+1,U=s[N],D=s[N-1],G=s[N+1],Z=T(U)}if(m+1>=d){k(m,N-1),n.isOverflowing=!0;break}if(C=N-1,m+=1,B=0,y[m]="",this.isBreakingSpace(U))continue;this.canBreakInLastChar(U)||(y=this.trimToBreakable(y),B=this.sumTextWidthByCache(y[m]||"",T)),this.shouldBreakByKinsokuShorui(U,G)&&(y=this.trimByKinsokuShorui(y),B+=T(D||""))}B+=Z,y[m]+=U}return y.join(`
5
+ `)}},{key:"isBreakingSpace",value:function(t){return typeof t!="string"?!1:Ms.BreakingSpaces.indexOf(t.charCodeAt(0))>=0}},{key:"isNewline",value:function(t){return typeof t!="string"?!1:Ms.Newlines.indexOf(t.charCodeAt(0))>=0}},{key:"trimToBreakable",value:function(t){var n=tt(t),i=n[n.length-2],a=this.findBreakableIndex(i);if(a===-1||!i)return n;var s=i.slice(a,a+1),o=this.isBreakingSpace(s),A=a+1,l=a+(o?0:1);return n[n.length-1]+=i.slice(A,i.length),n[n.length-2]=i.slice(0,l),n}},{key:"canBreakInLastChar",value:function(t){return!(t&&Wx.test(t))}},{key:"sumTextWidthByCache",value:function(t,n){return t.split("").reduce(function(i,a){return i+n(a)},0)}},{key:"findBreakableIndex",value:function(t){for(var n=t.length-1;n>=0;n--)if(!Wx.test(t[n]))return n;return-1}},{key:"getFromCache",value:function(t,n,i,a){var s=i.get(t);if(typeof s!="number"){var o=t.length*n,A=a.measureText(t);s=A.width+o,i.put(t,s)}return s}},{key:"clearCache",value:function(){this.fontMetricsCache={},this.charWidthCache.clear()}}])})(),he={},GH=(function(r){var e=new hH,t=new uH;return r={},be(be(be(be(be(be(be(be(be(be(r,re.FRAGMENT,null),re.CIRCLE,new oH),re.ELLIPSE,new AH),re.RECT,e),re.IMAGE,e),re.GROUP,new fH),re.LINE,new lH),re.TEXT,new dH(he)),re.POLYLINE,t),re.POLYGON,t),be(be(be(r,re.PATH,new cH),re.HTML,new gH),re.MESH,null)})(),KH=(function(r){var e=new m4,t=new Ig;return r={},be(be(be(be(be(be(be(be(be(be(r,ve.PERCENTAGE,null),ve.NUMBER,new x4),ve.ANGLE,new v4),ve.DEFINED_PATH,new y4),ve.PAINT,e),ve.COLOR,e),ve.FILTER,new w4),ve.LENGTH,t),ve.LENGTH_PERCENTAGE,t),ve.LENGTH_PERCENTAGE_12,new B4),be(be(be(be(be(be(be(be(be(be(r,ve.LENGTH_PERCENTAGE_14,new b4),ve.COORDINATE,new Ig),ve.OFFSET_DISTANCE,new C4),ve.OPACITY_VALUE,new S4),ve.PATH,new F4),ve.LIST_OF_POINTS,new T4),ve.SHADOW_BLUR,new M4),ve.TEXT,new O4),ve.TEXT_TRANSFORM,new I4),ve.TRANSFORM,new iH),be(be(be(r,ve.TRANSFORM_ORIGIN,new aH),ve.Z_INDEX,new sH),ve.MARKER,new E4)})(),zH=function(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}};he.CameraContribution=VE,he.AnimationTimeline=null,he.EasingFunction=null,he.offscreenCanvasCreator=new Rg,he.sceneGraphSelector=new wH,he.sceneGraphService=new OH(he),he.textService=new HH(he),he.geometryUpdaterFactory=GH,he.CSSPropertySyntaxFactory=KH,he.styleValueRegistry=new g4(he),he.layoutRegistry=null,he.globalThis=zH(),he.enableStyleSyntax=!0,he.enableSizeAttenuation=!1;var VH=0,Dg=new Gi(at.INSERTED,null,"","","",0,"",""),Hg=new Gi(at.REMOVED,null,"","","",0,"",""),qx=new yn(at.DESTROY),jH=(function(r){function e(){var t;le(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t=We(this,e,[].concat(i)),t.entity=VH++,t.transformable={dirtyFlag:!1,localDirtyFlag:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},t.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},t.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},t.cullable={strategy:qD.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},t.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},t.namespaceURI="g",t.scrollLeft=0,t.scrollTop=0,t.clientTop=0,t.clientLeft=0,t.style={},t.computedStyle={},t.parsedStyle={},t.attributes={},t}return qe(e,r),ce(e,[{key:"dirty",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,i=arguments.length>1?arguments[1]:void 0;this.renderable.dirty=n,i!==void 0&&(this.renderable.boundsDirty=i,this.renderable.renderBoundsDirty=i,this.geometry.dirty=i)}},{key:"className",get:function(){return this.getAttribute("class")||""},set:function(n){this.setAttribute("class",n)}},{key:"classList",get:function(){return this.className.split(" ").filter(function(n){return n!==""})}},{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 n=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[n+1]||null}return null}},{key:"previousSibling",get:function(){if(this.parentNode){var n=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[n-1]||null}return null}},{key:"cloneNode",value:function(n){throw new Error(mt)}},{key:"appendChild",value:function(n,i){var a;if(n.destroyed)throw new Error(UD);return he.sceneGraphService.attach(n,this,i),(a=this.ownerDocument)!==null&&a!==void 0&&a.defaultView&&(!Qc(this)&&n.nodeName===re.FRAGMENT?this.ownerDocument.defaultView.mountFragment(n):this.ownerDocument.defaultView.mountChildren(n)),this.isMutationObserved&&(Dg.relatedNode=this,n.dispatchEvent(Dg)),n}},{key:"insertBefore",value:function(n,i){if(!i)this.appendChild(n);else{n.parentElement&&n.parentElement.removeChild(n);var a=this.childNodes.indexOf(i);a===-1?this.appendChild(n):this.appendChild(n,a)}return n}},{key:"replaceChild",value:function(n,i){var a=this.childNodes.indexOf(i);return this.removeChild(i),this.appendChild(n,a),i}},{key:"removeChild",value:function(n){var i,a,s=((i=this.ownerDocument)===null||i===void 0||(i=i.defaultView)===null||i===void 0||(i=i.getConfig().future)===null||i===void 0?void 0:i.experimentalCancelEventPropagation)===!0;return Hg.relatedNode=this,n.dispatchEvent(Hg,s,s),(a=n.ownerDocument)!==null&&a!==void 0&&a.defaultView&&n.ownerDocument.defaultView.unmountChildren(n),he.sceneGraphService.detach(n),n}},{key:"removeChildren",value:function(){for(var n=this.childNodes.length-1;n>=0;n--){var i=this.childNodes[n];this.removeChild(i)}}},{key:"destroyChildren",value:function(){for(var n=this.childNodes.length-1;n>=0;n--){var i=this.childNodes[n];i.childNodes.length>0&&i.destroyChildren(),i.destroy()}}},{key:"matches",value:function(n){return he.sceneGraphService.matches(n,this)}},{key:"getElementById",value:function(n){return he.sceneGraphService.querySelector("#".concat(n),this)}},{key:"getElementsByName",value:function(n){return he.sceneGraphService.querySelectorAll('[name="'.concat(n,'"]'),this)}},{key:"getElementsByClassName",value:function(n){return he.sceneGraphService.querySelectorAll(".".concat(n),this)}},{key:"getElementsByTagName",value:function(n){return he.sceneGraphService.querySelectorAll(n,this)}},{key:"querySelector",value:function(n){return he.sceneGraphService.querySelector(n,this)}},{key:"querySelectorAll",value:function(n){return he.sceneGraphService.querySelectorAll(n,this)}},{key:"closest",value:function(n){var i=this;do{if(he.sceneGraphService.matches(n,i))return i;i=i.parentElement}while(i!==null);return null}},{key:"find",value:function(n){var i=this,a=null;return this.forEach(function(s){return s!==i&&n(s)?(a=s,!1):!0}),a}},{key:"findAll",value:function(n){var i=this,a=[];return this.forEach(function(s){s!==i&&n(s)&&a.push(s)}),a}},{key:"after",value:function(){var n=this;if(this.parentNode){for(var i=this.parentNode.childNodes.indexOf(this),a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];s.forEach(function(A,l){var c;return(c=n.parentNode)===null||c===void 0?void 0:c.appendChild(A,i+l+1)})}}},{key:"before",value:function(){if(this.parentNode){for(var n,i=this.parentNode.childNodes.indexOf(this),a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];var A=s[0],l=nc(s).slice(1);this.parentNode.appendChild(A,i),(n=A).after.apply(n,tt(l))}}},{key:"replaceWith",value:function(){this.after.apply(this,arguments),this.remove()}},{key:"append",value:function(){for(var n=this,i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];a.forEach(function(o){return n.appendChild(o)})}},{key:"prepend",value:function(){for(var n=this,i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];a.forEach(function(o,A){return n.appendChild(o,A)})}},{key:"replaceChildren",value:function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)}},{key:"remove",value:function(){return this.parentNode?this.parentNode.removeChild(this):this}},{key:"destroy",value:function(){var n,i=((n=this.ownerDocument)===null||n===void 0||(n=n.defaultView)===null||n===void 0||(n=n.getConfig().future)===null||n===void 0?void 0:n.experimentalCancelEventPropagation)===!0;this.destroyChildren(),this.dispatchEvent(qx,i,i),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0}},{key:"getGeometryBounds",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return he.sceneGraphService.getGeometryBounds(this,n)}},{key:"getTransformedGeometryBounds",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return he.sceneGraphService.getTransformedGeometryBounds(this,n)}},{key:"getBounds",value:function(){return he.sceneGraphService.getBounds(this)}},{key:"getRenderBounds",value:function(){return he.sceneGraphService.getBounds(this,!0)}},{key:"getLocalBounds",value:function(){return he.sceneGraphService.getLocalBounds(this)}},{key:"getBoundingClientRect",value:function(){return he.sceneGraphService.getBoundingClientRect(this)}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"computedStyleMap",value:function(){return new Map(Object.entries(this.computedStyle))}},{key:"getAttributeNames",value:function(){return Object.keys(this.attributes)}},{key:"getAttribute",value:function(n){if(typeof n!="symbol"){var i=this.attributes[n];return i}}},{key:"hasAttribute",value:function(n){return this.getAttributeNames().includes(n)}},{key:"hasAttributes",value:function(){return!!this.getAttributeNames().length}},{key:"removeAttribute",value:function(n){this.setAttribute(n,null),delete this.attributes[n]}},{key:"setAttribute",value:function(n,i){this.attributes[n]=i}},{key:"getAttributeNS",value:function(n,i){throw new Error(mt)}},{key:"getAttributeNode",value:function(n){throw new Error(mt)}},{key:"getAttributeNodeNS",value:function(n,i){throw new Error(mt)}},{key:"hasAttributeNS",value:function(n,i){throw new Error(mt)}},{key:"removeAttributeNS",value:function(n,i){throw new Error(mt)}},{key:"removeAttributeNode",value:function(n){throw new Error(mt)}},{key:"setAttributeNS",value:function(n,i,a){throw new Error(mt)}},{key:"setAttributeNode",value:function(n){throw new Error(mt)}},{key:"setAttributeNodeNS",value:function(n){throw new Error(mt)}},{key:"toggleAttribute",value:function(n,i){throw new Error(mt)}}])})(Kt);function ct(r){return!!(r!=null&&r.nodeName)}var WH=he.globalThis.Proxy?he.globalThis.Proxy:function(){},Ki=new Gi(at.ATTR_MODIFIED,null,null,null,null,Gi.MODIFICATION,null,null),LA=Je(),qH=vn(),Tt=(function(r){function e(t){var n;return le(this,e),n=We(this,e),n.isCustomElement=!1,n.isMutationObserved=!1,n.activeAnimations=[],n.config=t,n.id=t.id||"",n.name=t.name||"",(t.className||t.class)&&(n.className=t.className||t.class),n.nodeName=t.type||re.GROUP,t.initialParsedStyle&&Object.assign(n.parsedStyle,t.initialParsedStyle),n.initAttributes(t.style),he.enableStyleSyntax&&(n.style=new WH({setProperty:function(a,s){n.setAttribute(a,s)},getPropertyValue:function(a){return n.getAttribute(a)},removeProperty:function(a){n.removeAttribute(a)},item:function(){return""}},{get:function(a,s){return a[s]!==void 0?a[s]:n.getAttribute(s)},set:function(a,s,o){return n.setAttribute(s,o),!0}})),n}return qe(e,r),ce(e,[{key:"destroy",value:function(){wc(e,"destroy",this)([]),this.getAnimations().forEach(function(n){n.cancel()})}},{key:"cloneNode",value:function(n,i){var a=De({},this.attributes);for(var s in a){var o=a[s];ct(o)&&s!=="clipPath"&&s!=="offsetPath"&&s!=="textPath"&&(a[s]=o.cloneNode(n)),i&&(a[s]=i(s,o))}var A=new this.constructor(De(De({},this.config),{},{style:a}));return A.setLocalTransform(this.getLocalTransform()),n&&this.children.forEach(function(l){if(!l.style.isMarker){var c=l.cloneNode(n);A.appendChild(c)}}),A}},{key:"initAttributes",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i={forceUpdateGeometry:!0};he.styleValueRegistry.processProperties(this,n,i),this.dirty()}},{key:"setAttribute",value:function(n,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;Ge(i)||(a||i!==this.attributes[n])&&(this.internalSetAttribute(n,i,{memoize:s}),wc(e,"setAttribute",this)([n,i]))}},{key:"setAttributes",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=i.skipDispatchAttrModifiedEvent,s=a===void 0?!1:a,o,A;if(s||(o=De({},this.attributes),A=De({},this.parsedStyle)),he.styleValueRegistry.processProperties(this,n,i),this.dirty(),!s)for(var l in n)this.dispatchAttrModifiedEvent(l,o[l],n[l],A[l])}},{key:"internalSetAttribute",value:function(n,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=this.attributes[n],o=this.parsedStyle[n];he.styleValueRegistry.processProperties(this,be({},n,i),a),this.dirty(),this.dispatchAttrModifiedEvent(n,s,i,o)}},{key:"dispatchAttrModifiedEvent",value:function(n,i,a,s){var o=this.parsedStyle[n];if(this.isConnected)if(Ki.relatedNode=this,Ki.prevValue=i,Ki.newValue=a,Ki.attrName=n,Ki.prevParsedValue=s,Ki.newParsedValue=o,this.isMutationObserved)this.dispatchEvent(Ki);else{var A,l=((A=this.ownerDocument.defaultView.getConfig().future)===null||A===void 0?void 0:A.experimentalCancelEventPropagation)===!0;Ki.target=this,this.ownerDocument.defaultView.dispatchEvent(Ki,!0,l)}if(this.isCustomElement&&this.isConnected||!this.isCustomElement){var c,u;(c=(u=this).attributeChangedCallback)===null||c===void 0||c.call(u,n,i,a,s,o)}}},{key:"getBBox",value:function(){var n=this.getBounds(),i=n.getMin(),a=$e(i,2),s=a[0],o=a[1],A=n.getMax(),l=$e(A,2),c=l[0],u=l[1];return new Bo(s,o,c-s,u-o)}},{key:"setOrigin",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return he.sceneGraphService.setOrigin(this,Ar(n,i,a,!1)),this}},{key:"getOrigin",value:function(){return he.sceneGraphService.getOrigin(this)}},{key:"setPosition",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return he.sceneGraphService.setPosition(this,Ar(n,i,a,!1)),this}},{key:"setLocalPosition",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return he.sceneGraphService.setLocalPosition(this,Ar(n,i,a,!1)),this}},{key:"translate",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return he.sceneGraphService.translate(this,Ar(n,i,a,!1)),this}},{key:"translateLocal",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return he.sceneGraphService.translateLocal(this,Ar(n,i,a,!1)),this}},{key:"getPosition",value:function(){return he.sceneGraphService.getPosition(this)}},{key:"getLocalPosition",value:function(){return he.sceneGraphService.getLocalPosition(this)}},{key:"scale",value:function(n,i,a){return this.scaleLocal(n,i,a)}},{key:"scaleLocal",value:function(n,i,a){return typeof n=="number"&&(i=i||n,a=a||n,n=Ar(n,i,a,!1)),he.sceneGraphService.scaleLocal(this,n),this}},{key:"setLocalScale",value:function(n,i,a){return typeof n=="number"&&(i=i||n,a=a||n,n=Ar(n,i,a,!1)),he.sceneGraphService.setLocalScale(this,n),this}},{key:"getLocalScale",value:function(){return he.sceneGraphService.getLocalScale(this)}},{key:"getScale",value:function(){return he.sceneGraphService.getScale(this)}},{key:"getEulerAngles",value:function(){var n=hg(LA,he.sceneGraphService.getWorldTransform(this)),i=$e(n,3),a=i[2];return Br(a)}},{key:"getLocalEulerAngles",value:function(){var n=hg(LA,he.sceneGraphService.getLocalRotation(this)),i=$e(n,3),a=i[2];return Br(a)}},{key:"setEulerAngles",value:function(n){return he.sceneGraphService.setEulerAngles(this,0,0,n),this}},{key:"setLocalEulerAngles",value:function(n){return he.sceneGraphService.setLocalEulerAngles(this,0,0,n),this}},{key:"rotateLocal",value:function(n,i,a){return ke(i)&&ke(a)?he.sceneGraphService.rotateLocal(this,0,0,n):he.sceneGraphService.rotateLocal(this,n,i,a),this}},{key:"rotate",value:function(n,i,a){return ke(i)&&ke(a)?he.sceneGraphService.rotate(this,0,0,n):he.sceneGraphService.rotate(this,n,i,a),this}},{key:"setRotation",value:function(n,i,a,s){return he.sceneGraphService.setRotation(this,n,i,a,s),this}},{key:"setLocalRotation",value:function(n,i,a,s){return he.sceneGraphService.setLocalRotation(this,n,i,a,s),this}},{key:"setLocalSkew",value:function(n,i){return he.sceneGraphService.setLocalSkew(this,n,i),this}},{key:"getRotation",value:function(){return he.sceneGraphService.getRotation(this)}},{key:"getLocalRotation",value:function(){return he.sceneGraphService.getLocalRotation(this)}},{key:"getLocalSkew",value:function(){return he.sceneGraphService.getLocalSkew(this)}},{key:"getLocalTransform",value:function(){return he.sceneGraphService.getLocalTransform(this)}},{key:"getWorldTransform",value:function(){return he.sceneGraphService.getWorldTransform(this)}},{key:"setLocalTransform",value:function(n){return he.sceneGraphService.setLocalTransform(this,n),this}},{key:"resetLocalTransform",value:function(){he.sceneGraphService.resetLocalTransform(this)}},{key:"getAnimations",value:function(){return this.activeAnimations}},{key:"animate",value:function(n,i){var a,s=(a=this.ownerDocument)===null||a===void 0?void 0:a.timeline;return s?s.play(this,n,i):null}},{key:"isVisible",value:function(){var n;return((n=this.parsedStyle)===null||n===void 0?void 0:n.visibility)!=="hidden"}},{key:"interactive",get:function(){return this.isInteractive()},set:function(n){this.style.pointerEvents=n?"auto":"none"}},{key:"isInteractive",value:function(){var n;return((n=this.parsedStyle)===null||n===void 0?void 0:n.pointerEvents)!=="none"}},{key:"isCulled",value:function(){return!!(this.cullable&&this.cullable.enable&&!this.cullable.visible)}},{key:"toFront",value:function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,tt(this.parentNode.children.map(function(n){return Number(n.style.zIndex)})))+1),this}},{key:"toBack",value:function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,tt(this.parentNode.children.map(function(n){return Number(n.style.zIndex)})))-1),this}},{key:"getConfig",value:function(){return this.config}},{key:"attr",value:function(){for(var n=this,i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];var o=a[0],A=a[1];return o?on(o)?(Object.keys(o).forEach(function(l){n.setAttribute(l,o[l])}),this):a.length===2?(this.setAttribute(o,A),this):this.attributes[o]:this.attributes}},{key:"getMatrix",value:function(n){var i=n||this.getWorldTransform(),a=ac(LA,i),s=$e(a,2),o=s[0],A=s[1],l=go(LA,i),c=$e(l,2),u=c[0],h=c[1],d=sc(qH,i),f=hg(LA,d),g=$e(f,3),p=g[0],v=g[2];return KD(p||v,o,A,u,h)}},{key:"getLocalMatrix",value:function(){return this.getMatrix(this.getLocalTransform())}},{key:"setMatrix",value:function(n){var i=HE(n),a=$e(i,5),s=a[0],o=a[1],A=a[2],l=a[3],c=a[4];this.setEulerAngles(c).setPosition(s,o).setLocalScale(A,l)}},{key:"setLocalMatrix",value:function(n){var i=HE(n),a=$e(i,5),s=a[0],o=a[1],A=a[2],l=a[3],c=a[4];this.setLocalEulerAngles(c).setLocalPosition(s,o).setLocalScale(A,l)}},{key:"show",value:function(){this.forEach(function(n){n.style.visibility="visible"})}},{key:"hide",value:function(){this.forEach(function(n){n.style.visibility="hidden"})}},{key:"getCount",value:function(){return this.childElementCount}},{key:"getParent",value:function(){return this.parentElement}},{key:"getChildren",value:function(){return this.children}},{key:"getFirst",value:function(){return this.firstElementChild}},{key:"getLast",value:function(){return this.lastElementChild}},{key:"getChildByIndex",value:function(n){return this.children[n]||null}},{key:"add",value:function(n,i){return this.appendChild(n,i)}},{key:"set",value:function(n,i){this.config[n]=i}},{key:"get",value:function(n){return this.config[n]}},{key:"moveTo",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return this.setPosition(n,i,a),this}},{key:"move",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return this.setPosition(n,i,a),this}},{key:"setZIndex",value:function(n){return this.style.zIndex=n,this}}])})(jH);Tt.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","display","draggable","droppable","fill","fillOpacity","fillRule","filter","increasedLineWidthForHitTesting","lineCap","lineDash","lineDashOffset","lineJoin","lineWidth","miterLimit","hitArea","offsetDistance","offsetPath","offsetX","offsetY","opacity","pointerEvents","shadowColor","shadowType","shadowBlur","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","strokeWidth","strokeLinecap","strokeLineJoin","strokeDasharray","strokeDashoffset","transform","transformOrigin","textTransform","visibility","zIndex"]);var zi=(function(r){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return le(this,e),We(this,e,[De({type:re.CIRCLE},t)])}return qe(e,r),ce(e)})(Tt);zi.PARSED_STYLE_LIST=new Set([].concat(tt(Tt.PARSED_STYLE_LIST),["cx","cy","cz","r","isBillboard","isSizeAttenuation"]));var $H=["style"],QA=(function(r){function e(){var t,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.style,a=Pi(n,$H);return le(this,e),t=We(this,e,[De({style:i},a)]),t.isCustomElement=!0,t}return qe(e,r),ce(e)})(Tt);QA.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var UA=(function(r){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return le(this,e),We(this,e,[De({type:re.ELLIPSE},t)])}return qe(e,r),ce(e)})(Tt);UA.PARSED_STYLE_LIST=new Set([].concat(tt(Tt.PARSED_STYLE_LIST),["cx","cy","cz","rx","ry","isBillboard","isSizeAttenuation"]));var YH=(function(r){function e(){return le(this,e),We(this,e,[{type:re.FRAGMENT}])}return qe(e,r),ce(e)})(Tt);YH.PARSED_STYLE_LIST=new Set(["class","className"]);var Cn=(function(r){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return le(this,e),We(this,e,[De({type:re.GROUP},t)])}return qe(e,r),ce(e)})(Tt);Cn.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var XH=["style"],Os=(function(r){function e(){var t,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.style,a=Pi(n,XH);return le(this,e),t=We(this,e,[De({type:re.HTML,style:i},a)]),t.cullable.enable=!1,t}return qe(e,r),ce(e,[{key:"getDomElement",value:function(){return this.parsedStyle.$el}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"getLocalBounds",value:function(){if(this.parentNode){var n=ki(Ct(),this.parentNode.getWorldTransform()),i=this.getBounds();if(!kt.isEmpty(i)){var a=new kt;return a.setFromTransformedAABB(i,n),a}}return this.getBounds()}}])})(Tt);Os.PARSED_STYLE_LIST=new Set([].concat(tt(Tt.PARSED_STYLE_LIST),["x","y","$el","innerHTML","width","height"]));var PA=(function(r){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return le(this,e),We(this,e,[De({type:re.IMAGE},t)])}return qe(e,r),ce(e)})(Tt);PA.PARSED_STYLE_LIST=new Set([].concat(tt(Tt.PARSED_STYLE_LIST),["x","y","z","src","width","height","isBillboard","billboardRotation","isSizeAttenuation","keepAspectRatio"]));var ZH=["style"],Is=(function(r){function e(){var t,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.style,a=Pi(n,ZH);le(this,e),t=We(this,e,[De({type:re.LINE,style:De({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},i)},a)]),t.markerStartAngle=0,t.markerEndAngle=0;var s=t.parsedStyle,o=s.markerStart,A=s.markerEnd;return o&&ct(o)&&(t.markerStartAngle=o.getLocalEulerAngles(),t.appendChild(o)),A&&ct(A)&&(t.markerEndAngle=A.getLocalEulerAngles(),t.appendChild(A)),t.transformMarker(!0),t.transformMarker(!1),t}return qe(e,r),ce(e,[{key:"attributeChangedCallback",value:function(n,i,a,s,o){n==="x1"||n==="y1"||n==="x2"||n==="y2"||n==="markerStartOffset"||n==="markerEndOffset"?(this.transformMarker(!0),this.transformMarker(!1)):n==="markerStart"?(s&&ct(s)&&(this.markerStartAngle=0,s.remove()),o&&ct(o)&&(this.markerStartAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!0))):n==="markerEnd"&&(s&&ct(s)&&(this.markerEndAngle=0,s.remove()),o&&ct(o)&&(this.markerEndAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!1)))}},{key:"transformMarker",value:function(n){var i=this.parsedStyle,a=i.markerStart,s=i.markerEnd,o=i.markerStartOffset,A=i.markerEndOffset,l=i.x1,c=i.x2,u=i.y1,h=i.y2,d=n?a:s;if(!(!d||!ct(d))){var f=0,g,p,v,y,m,B;n?(v=l,y=u,g=c-l,p=h-u,m=o||0,B=this.markerStartAngle):(v=c,y=h,g=l-c,p=u-h,m=A||0,B=this.markerEndAngle),f=Math.atan2(p,g),d.setLocalEulerAngles(f*180/Math.PI+B),d.setLocalPosition(v+Math.cos(f)*m,y+Math.sin(f)*m)}}},{key:"getPoint",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=this.parsedStyle,s=a.x1,o=a.y1,A=a.x2,l=a.y2,c=_E(s,o,A,l,n),u=c.x,h=c.y,d=Jn(Je(),St(u,h,0),i?this.getWorldTransform():this.getLocalTransform());return new Hn(d[0],d[1])}},{key:"getPointAtLength",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.getPoint(n/this.getTotalLength(),i)}},{key:"getTotalLength",value:function(){var n=this.parsedStyle,i=n.x1,a=n.y1,s=n.x2,o=n.y2;return IE(i,a,s,o)}}])})(Tt);Is.PARSED_STYLE_LIST=new Set([].concat(tt(Tt.PARSED_STYLE_LIST),["x1","y1","x2","y2","z1","z2","isBillboard","isSizeAttenuation","markerStart","markerEnd","markerStartOffset","markerEndOffset"]));var JH=["style"],tr=(function(r){function e(){var t,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.style,a=Pi(n,JH);le(this,e),t=We(this,e,[De({type:re.PATH,style:i,initialParsedStyle:{miterLimit:4,d:De({},WE)}},a)]),t.markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var s=t.parsedStyle,o=s.markerStart,A=s.markerEnd,l=s.markerMid;return o&&ct(o)&&(t.markerStartAngle=o.getLocalEulerAngles(),t.appendChild(o)),l&&ct(l)&&t.placeMarkerMid(l),A&&ct(A)&&(t.markerEndAngle=A.getLocalEulerAngles(),t.appendChild(A)),t.transformMarker(!0),t.transformMarker(!1),t}return qe(e,r),ce(e,[{key:"attributeChangedCallback",value:function(n,i,a,s,o){n==="d"?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):n==="markerStartOffset"||n==="markerEndOffset"?(this.transformMarker(!0),this.transformMarker(!1)):n==="markerStart"?(s&&ct(s)&&(this.markerStartAngle=0,s.remove()),o&&ct(o)&&(this.markerStartAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!0))):n==="markerEnd"?(s&&ct(s)&&(this.markerEndAngle=0,s.remove()),o&&ct(o)&&(this.markerEndAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!1))):n==="markerMid"&&this.placeMarkerMid(o)}},{key:"transformMarker",value:function(n){var i=this.parsedStyle,a=i.markerStart,s=i.markerEnd,o=i.markerStartOffset,A=i.markerEndOffset,l=n?a:s;if(!(!l||!ct(l))){var c=0,u,h,d,f,g,p;if(n){var v=this.getStartTangent(),y=$e(v,2),m=y[0],B=y[1];d=B[0],f=B[1],u=m[0]-B[0],h=m[1]-B[1],g=o||0,p=this.markerStartAngle}else{var C=this.getEndTangent(),S=$e(C,2),F=S[0],T=S[1];d=T[0],f=T[1],u=F[0]-T[0],h=F[1]-T[1],g=A||0,p=this.markerEndAngle}c=Math.atan2(h,u),l.setLocalEulerAngles(c*180/Math.PI+p),l.setLocalPosition(d+Math.cos(c)*g,f+Math.sin(c)*g)}}},{key:"placeMarkerMid",value:function(n){var i=this.parsedStyle.d.segments;if(this.markerMidList.forEach(function(c){c.remove()}),n&&ct(n))for(var a=1;a<i.length-1;a++){var s=$e(i[a].currentPoint,2),o=s[0],A=s[1],l=a===1?n:n.cloneNode(!0);this.markerMidList.push(l),this.appendChild(l),l.setLocalPosition(o,A)}}},{key:"getTotalLength",value:function(){return Cg(this)}},{key:"getPointAtLength",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=this.parsedStyle.d.absolutePath,s=uD(a,n),o=s.x,A=s.y,l=Jn(Je(),St(o,A,0),i?this.getWorldTransform():this.getLocalTransform());return new Hn(l[0],l[1])}},{key:"getPoint",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.getPointAtLength(n*Cg(this),i)}},{key:"getStartTangent",value:function(){var n=this.parsedStyle.d.segments,i=[];if(n.length>1){var a=n[0].currentPoint,s=n[1].currentPoint,o=n[1].startTangent;i=[],o?(i.push([a[0]-o[0],a[1]-o[1]]),i.push([a[0],a[1]])):(i.push([s[0],s[1]]),i.push([a[0],a[1]]))}return i}},{key:"getEndTangent",value:function(){var n=this.parsedStyle.d.segments,i=n.length,a=[];if(i>1){var s=n[i-2].currentPoint,o=n[i-1].currentPoint,A=n[i-1].endTangent;a=[],A?(a.push([o[0]-A[0],o[1]-A[1]]),a.push([o[0],o[1]])):(a.push([s[0],s[1]]),a.push([o[0],o[1]]))}return a}}])})(Tt);tr.PARSED_STYLE_LIST=new Set([].concat(tt(Tt.PARSED_STYLE_LIST),["d","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard","isSizeAttenuation"]));var e6=["style"],_s=(function(r){function e(){var t,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.style,a=Pi(n,e6);le(this,e),t=We(this,e,[De({type:re.POLYGON,style:i,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},a)]),t.markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var s=t.parsedStyle,o=s.markerStart,A=s.markerEnd,l=s.markerMid;return o&&ct(o)&&(t.markerStartAngle=o.getLocalEulerAngles(),t.appendChild(o)),l&&ct(l)&&t.placeMarkerMid(l),A&&ct(A)&&(t.markerEndAngle=A.getLocalEulerAngles(),t.appendChild(A)),t.transformMarker(!0),t.transformMarker(!1),t}return qe(e,r),ce(e,[{key:"attributeChangedCallback",value:function(n,i,a,s,o){n==="points"?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):n==="markerStartOffset"||n==="markerEndOffset"?(this.transformMarker(!0),this.transformMarker(!1)):n==="markerStart"?(s&&ct(s)&&(this.markerStartAngle=0,s.remove()),o&&ct(o)&&(this.markerStartAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!0))):n==="markerEnd"?(s&&ct(s)&&(this.markerEndAngle=0,s.remove()),o&&ct(o)&&(this.markerEndAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!1))):n==="markerMid"&&this.placeMarkerMid(o)}},{key:"transformMarker",value:function(n){var i=this.parsedStyle,a=i.markerStart,s=i.markerEnd,o=i.markerStartOffset,A=i.markerEndOffset,l=i.points,c=l||{},u=c.points,h=n?a:s;if(!(!h||!ct(h)||!u)){var d=0,f,g,p,v,y,m;if(p=u[0][0],v=u[0][1],n)f=u[1][0]-u[0][0],g=u[1][1]-u[0][1],y=o||0,m=this.markerStartAngle;else{var B=u.length;this.parsedStyle.isClosed?(f=u[B-1][0]-u[0][0],g=u[B-1][1]-u[0][1]):(p=u[B-1][0],v=u[B-1][1],f=u[B-2][0]-u[B-1][0],g=u[B-2][1]-u[B-1][1]),y=A||0,m=this.markerEndAngle}d=Math.atan2(g,f),h.setLocalEulerAngles(d*180/Math.PI+m),h.setLocalPosition(p+Math.cos(d)*y,v+Math.sin(d)*y)}}},{key:"placeMarkerMid",value:function(n){var i=this.parsedStyle.points,a=i||{},s=a.points;if(this.markerMidList.forEach(function(u){u.remove()}),this.markerMidList=[],n&&ct(n)&&s)for(var o=1;o<(this.parsedStyle.isClosed?s.length:s.length-1);o++){var A=s[o][0],l=s[o][1],c=o===1?n:n.cloneNode(!0);this.markerMidList.push(c),this.appendChild(c),c.setLocalPosition(A,l)}}}])})(Tt);_s.PARSED_STYLE_LIST=new Set([].concat(tt(Tt.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isClosed","isBillboard","isSizeAttenuation"]));var t6=["style"],Gc=(function(r){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.style,i=Pi(t,t6);return le(this,e),We(this,e,[De({type:re.POLYLINE,style:n,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},i)])}return qe(e,r),ce(e,[{key:"getTotalLength",value:function(){return j3(this)}},{key:"getPointAtLength",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.getPoint(n/this.getTotalLength(),i)}},{key:"getPoint",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=this.parsedStyle.points.points;if(this.parsedStyle.points.segments.length===0){var s=[],o=0,A,l,c=this.getTotalLength();a.forEach(function(v,y){a[y+1]&&(A=[0,0],A[0]=o/c,l=IE(v[0],v[1],a[y+1][0],a[y+1][1]),o+=l,A[1]=o/c,s.push(A))}),this.parsedStyle.points.segments=s}var u=0,h=0;this.parsedStyle.points.segments.forEach(function(v,y){n>=v[0]&&n<=v[1]&&(u=(n-v[0])/(v[1]-v[0]),h=y)});var d=_E(a[h][0],a[h][1],a[h+1][0],a[h+1][1],u),f=d.x,g=d.y,p=Jn(Je(),St(f,g,0),i?this.getWorldTransform():this.getLocalTransform());return new Hn(p[0],p[1])}},{key:"getStartTangent",value:function(){var n=this.parsedStyle.points.points,i=[];return i.push([n[1][0],n[1][1]]),i.push([n[0][0],n[0][1]]),i}},{key:"getEndTangent",value:function(){var n=this.parsedStyle.points.points,i=n.length-1,a=[];return a.push([n[i-1][0],n[i-1][1]]),a.push([n[i][0],n[i][1]]),a}}])})(_s);Gc.PARSED_STYLE_LIST=new Set([].concat(tt(_s.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard"]));var Gn=(function(r){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return le(this,e),We(this,e,[De({type:re.RECT},t)])}return qe(e,r),ce(e)})(Tt);Gn.PARSED_STYLE_LIST=new Set([].concat(tt(Tt.PARSED_STYLE_LIST),["x","y","z","width","height","isBillboard","isSizeAttenuation","radius"]));var n6=["style"],ks=(function(r){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.style,i=Pi(t,n6);return le(this,e),We(this,e,[De({type:re.TEXT,style:De({fill:"black"},n)},i)])}return qe(e,r),ce(e,[{key:"getComputedTextLength",value:function(){var n;return this.getGeometryBounds(),((n=this.parsedStyle.metrics)===null||n===void 0?void 0:n.maxLineWidth)||0}},{key:"getLineBoundingRects",value:function(){var n;return this.getGeometryBounds(),((n=this.parsedStyle.metrics)===null||n===void 0?void 0:n.lineMetrics)||[]}},{key:"isOverflowing",value:function(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing}}])})(Tt);ks.PARSED_STYLE_LIST=new Set([].concat(tt(Tt.PARSED_STYLE_LIST),["x","y","z","isBillboard","billboardRotation","isSizeAttenuation","text","textAlign","textBaseline","fontStyle","fontSize","fontFamily","fontWeight","fontVariant","lineHeight","letterSpacing","leading","wordWrap","wordWrapWidth","maxLines","textOverflow","isOverflowing","textPath","textDecorationLine","textDecorationColor","textDecorationStyle","textDecorationThickness","textPathSide","textPathStartOffset","metrics","dx","dy"]));var r6=(function(){function r(){le(this,r),this.registry={},this.define(re.CIRCLE,zi),this.define(re.ELLIPSE,UA),this.define(re.RECT,Gn),this.define(re.IMAGE,PA),this.define(re.LINE,Is),this.define(re.GROUP,Cn),this.define(re.PATH,tr),this.define(re.POLYGON,_s),this.define(re.POLYLINE,Gc),this.define(re.TEXT,ks),this.define(re.HTML,Os)}return ce(r,[{key:"define",value:function(t,n){this.registry[t]=n}},{key:"get",value:function(t){return this.registry[t]}}])})(),i6={number:function(e){return new Bt(e)},percent:function(e){return new Bt(e,"%")},px:function(e){return new Bt(e,"px")},em:function(e){return new Bt(e,"em")},rem:function(e){return new Bt(e,"rem")},deg:function(e){return new Bt(e,"deg")},grad:function(e){return new Bt(e,"grad")},rad:function(e){return new Bt(e,"rad")},turn:function(e){return new Bt(e,"turn")},s:function(e){return new Bt(e,"s")},ms:function(e){return new Bt(e,"ms")},registerProperty:function(e){var t=e.name,n=e.inherits,i=e.interpolable,a=e.initialValue,s=e.syntax;he.styleValueRegistry.registerMetadata({n:t,inh:n,int:i,d:a,syntax:s})},registerLayout:function(e,t){he.layoutRegistry.registerLayout(e,t)}},$x=(function(r){function e(){var t;le(this,e),t=We(this,e),t.defaultView=null,t.ownerDocument=null,t.nodeName="document";try{t.timeline=new he.AnimationTimeline(t)}catch{}var n={};return Og.forEach(function(i){var a=i.n,s=i.inh,o=i.d;s&&o&&(n[a]=Te(o)?o(re.GROUP):o)}),t.documentElement=new Cn({id:"g-root",style:n}),t.documentElement.ownerDocument=t,t.documentElement.parentNode=t,t.childNodes=[t.documentElement],t}return qe(e,r),ce(e,[{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"createElement",value:function(n,i){if(n==="svg")return this.documentElement;var a=this.defaultView.customElements.get(n);a||(console.warn("Unsupported tagName: ",n),a=n==="tspan"?ks:Cn);var s=new a(i);return s.ownerDocument=this,s}},{key:"createElementNS",value:function(n,i,a){return this.createElement(i,a)}},{key:"cloneNode",value:function(n){throw new Error(mt)}},{key:"destroy",value:function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch{}}},{key:"elementsFromBBox",value:function(n,i,a,s){var o=[],A=function(c){if(!(!c.isInteractive()||c.isCulled())){var u=c.parsedStyle.pointerEvents,h=u===void 0?"auto":u,d=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(h);if(!d||c.isVisible()){var f=c.getTransformedGeometryBounds(!0);f&&!kt.isEmpty(f)&&f.max[0]>=n&&f.min[0]<=a&&f.max[1]>=i&&f.min[1]<=s&&o.push(c)}c.childNodes&&c.childNodes.forEach(function(g){g instanceof Tt&&A(g)})}};return A(this.documentElement),o.sort(function(l,c){return c.sortable.renderOrder-l.sortable.renderOrder}),o}},{key:"elementFromPointSync",value:function(n,i){var a=this.defaultView.canvas2Viewport({x:n,y:i}),s=a.x,o=a.y,A=this.defaultView.getConfig(),l=A.width,c=A.height;if(s<0||o<0||s>l||o>c)return null;var u=this.defaultView.viewport2Client({x:s,y:o}),h=u.x,d=u.y,f=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:n,y:i,viewportX:s,viewportY:o,clientX:h,clientY:d},picked:[]}),g=f.picked;return g&&g[0]||this.documentElement}},{key:"elementFromPoint",value:(function(){var t=La(kn().mark(function i(a,s){var o,A,l,c,u,h,d,f,g,p,v;return kn().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(o=this.defaultView.canvas2Viewport({x:a,y:s}),A=o.x,l=o.y,c=this.defaultView.getConfig(),u=c.width,h=c.height,!(A<0||l<0||A>u||l>h)){y.next=1;break}return y.abrupt("return",null);case 1:return d=this.defaultView.viewport2Client({x:A,y:l}),f=d.x,g=d.y,y.next=2,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:a,y:s,viewportX:A,viewportY:l,clientX:f,clientY:g},picked:[]});case 2:return p=y.sent,v=p.picked,y.abrupt("return",v&&v[0]||this.documentElement);case 3:case"end":return y.stop()}},i,this)}));function n(i,a){return t.apply(this,arguments)}return n})()},{key:"elementsFromPointSync",value:function(n,i){var a=this.defaultView.canvas2Viewport({x:n,y:i}),s=a.x,o=a.y,A=this.defaultView.getConfig(),l=A.width,c=A.height;if(s<0||o<0||s>l||o>c)return[];var u=this.defaultView.viewport2Client({x:s,y:o}),h=u.x,d=u.y,f=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:n,y:i,viewportX:s,viewportY:o,clientX:h,clientY:d},picked:[]}),g=f.picked;return g[g.length-1]!==this.documentElement&&g.push(this.documentElement),g}},{key:"elementsFromPoint",value:(function(){var t=La(kn().mark(function i(a,s){var o,A,l,c,u,h,d,f,g,p,v;return kn().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(o=this.defaultView.canvas2Viewport({x:a,y:s}),A=o.x,l=o.y,c=this.defaultView.getConfig(),u=c.width,h=c.height,!(A<0||l<0||A>u||l>h)){y.next=1;break}return y.abrupt("return",[]);case 1:return d=this.defaultView.viewport2Client({x:A,y:l}),f=d.x,g=d.y,y.next=2,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:a,y:s,viewportX:A,viewportY:l,clientX:f,clientY:g},picked:[]});case 2:return p=y.sent,v=p.picked,v[v.length-1]!==this.documentElement&&v.push(this.documentElement),y.abrupt("return",v);case 3:case"end":return y.stop()}},i,this)}));function n(i,a){return t.apply(this,arguments)}return n})()},{key:"appendChild",value:function(n,i){throw new Error(bo)}},{key:"insertBefore",value:function(n,i){throw new Error(bo)}},{key:"removeChild",value:function(n,i){throw new Error(bo)}},{key:"replaceChild",value:function(n,i,a){throw new Error(bo)}},{key:"append",value:function(){throw new Error(bo)}},{key:"prepend",value:function(){throw new Error(bo)}},{key:"getElementById",value:function(n){return this.documentElement.getElementById(n)}},{key:"getElementsByName",value:function(n){return this.documentElement.getElementsByName(n)}},{key:"getElementsByTagName",value:function(n){return this.documentElement.getElementsByTagName(n)}},{key:"getElementsByClassName",value:function(n){return this.documentElement.getElementsByClassName(n)}},{key:"querySelector",value:function(n){return this.documentElement.querySelector(n)}},{key:"querySelectorAll",value:function(n){return this.documentElement.querySelectorAll(n)}},{key:"find",value:function(n){return this.documentElement.find(n)}},{key:"findAll",value:function(n){return this.documentElement.findAll(n)}}])})(Kt),Yx=(function(){function r(e){le(this,r),this.strategies=e}return ce(r,[{key:"apply",value:function(t){var n=t.config,i=t.camera,a=t.renderingService,s=t.renderingContext,o=this.strategies;a.hooks.cull.tap(r.tag,function(A){if(A){var l,c=A.cullable;if(o.length===0?c.visible=s.unculledEntities.indexOf(A.entity)>-1:c.visible=o.every(function(h){return h.isVisible(i,A)}),!A.isCulled()&&A.isVisible())return A;var u=((l=n.future)===null||l===void 0?void 0:l.experimentalCancelEventPropagation)===!0;return A.dispatchEvent(new yn(at.CULLED),u,u),null}return A}),a.hooks.afterRender.tap(r.tag,function(A){A.cullable.visibilityPlaneMask=-1})}}])})();Yx.tag="Culling";var Xx=(function(){function r(){var e=this;le(this,r),this.autoPreventDefault=!1,this.rootPointerEvent=new Pc(null),this.rootWheelEvent=new Pg(null),this.onPointerMove=function(t){var n,i=(n=e.context.renderingContext.root)===null||n===void 0||(n=n.ownerDocument)===null||n===void 0?void 0:n.defaultView;if(!(i.supportsTouchEvents&&t.pointerType==="touch")){var a=e.normalizeToPointerEvent(t,i),s=Qa(a),o;try{for(s.s();!(o=s.n()).done;){var A=o.value,l=e.bootstrapEvent(e.rootPointerEvent,A,i,t);e.context.eventService.mapEvent(l)}}catch(c){s.e(c)}finally{s.f()}e.setCursor(e.context.eventService.cursor)}},this.onClick=function(t){var n,i=(n=e.context.renderingContext.root)===null||n===void 0||(n=n.ownerDocument)===null||n===void 0?void 0:n.defaultView,a=e.normalizeToPointerEvent(t,i),s=Qa(a),o;try{for(s.s();!(o=s.n()).done;){var A=o.value,l=e.bootstrapEvent(e.rootPointerEvent,A,i,t);e.context.eventService.mapEvent(l)}}catch(c){s.e(c)}finally{s.f()}e.setCursor(e.context.eventService.cursor)}}return ce(r,[{key:"apply",value:function(t){var n=this;this.context=t;var i=t.renderingService,a=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler(function(s){var o=n.context.renderingService.hooks.pickSync.call({position:s,picked:[],topmost:!0}),A=o.picked;return A[0]||null}),i.hooks.pointerWheel.tap(r.tag,function(s){var o=n.normalizeWheelEvent(s);n.context.eventService.mapEvent(o)}),i.hooks.pointerDown.tap(r.tag,function(s){if(!(a.supportsTouchEvents&&s.pointerType==="touch")){var o=n.normalizeToPointerEvent(s,a);if(n.autoPreventDefault&&o[0].isNormalized){var A=s.cancelable||!("cancelable"in s);A&&s.preventDefault()}var l=Qa(o),c;try{for(l.s();!(c=l.n()).done;){var u=c.value,h=n.bootstrapEvent(n.rootPointerEvent,u,a,s);n.context.eventService.mapEvent(h)}}catch(d){l.e(d)}finally{l.f()}n.setCursor(n.context.eventService.cursor)}}),i.hooks.pointerUp.tap(r.tag,function(s){if(!(a.supportsTouchEvents&&s.pointerType==="touch")){var o=n.context.contextService.getDomElement(),A=n.context.eventService.isNativeEventFromCanvas(o,s),l=A?"":"outside",c=n.normalizeToPointerEvent(s,a),u=Qa(c),h;try{for(u.s();!(h=u.n()).done;){var d=h.value,f=n.bootstrapEvent(n.rootPointerEvent,d,a,s);f.type+=l,n.context.eventService.mapEvent(f)}}catch(g){u.e(g)}finally{u.f()}n.setCursor(n.context.eventService.cursor)}}),i.hooks.pointerMove.tap(r.tag,this.onPointerMove),i.hooks.pointerOver.tap(r.tag,this.onPointerMove),i.hooks.pointerOut.tap(r.tag,this.onPointerMove),i.hooks.click.tap(r.tag,this.onClick),i.hooks.pointerCancel.tap(r.tag,function(s){var o=n.normalizeToPointerEvent(s,a),A=Qa(o),l;try{for(A.s();!(l=A.n()).done;){var c=l.value,u=n.bootstrapEvent(n.rootPointerEvent,c,a,s);n.context.eventService.mapEvent(u)}}catch(h){A.e(h)}finally{A.f()}n.setCursor(n.context.eventService.cursor)})}},{key:"bootstrapEvent",value:function(t,n,i,a){t.view=i,t.originalEvent=null,t.nativeEvent=a,t.pointerId=n.pointerId,t.width=n.width,t.height=n.height,t.isPrimary=n.isPrimary,t.pointerType=n.pointerType,t.pressure=n.pressure,t.tangentialPressure=n.tangentialPressure,t.tiltX=n.tiltX,t.tiltY=n.tiltY,t.twist=n.twist,this.transferMouseData(t,n);var s=this.context.eventService.client2Viewport({x:n.clientX,y:n.clientY}),o=s.x,A=s.y;t.viewport.x=o,t.viewport.y=A;var l=this.context.eventService.viewport2Canvas(t.viewport),c=l.x,u=l.y;return t.canvas.x=c,t.canvas.y=u,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=a.isTrusted,t.type==="pointerleave"&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=R4[t.type]||t.type),t}},{key:"normalizeWheelEvent",value:function(t){var n=this.rootWheelEvent;this.transferMouseData(n,t),n.deltaMode=t.deltaMode,n.deltaX=t.deltaX,n.deltaY=t.deltaY,n.deltaZ=t.deltaZ;var i=this.context.eventService.client2Viewport({x:t.clientX,y:t.clientY}),a=i.x,s=i.y;n.viewport.x=a,n.viewport.y=s;var o=this.context.eventService.viewport2Canvas(n.viewport),A=o.x,l=o.y;return n.canvas.x=A,n.canvas.y=l,n.global.copyFrom(n.canvas),n.offset.copyFrom(n.canvas),n.nativeEvent=t,n.type=t.type,n}},{key:"transferMouseData",value:function(t,n){t.isTrusted=n.isTrusted,t.srcElement=n.srcElement,t.timeStamp=Ng.now(),t.type=n.type,t.altKey=n.altKey,t.metaKey=n.metaKey,t.shiftKey=n.shiftKey,t.ctrlKey=n.ctrlKey,t.button=n.button,t.buttons=n.buttons,t.client.x=n.clientX,t.client.y=n.clientY,t.movement.x=n.movementX,t.movement.y=n.movementY,t.page.x=n.pageX,t.page.y=n.pageY,t.screen.x=n.screenX,t.screen.y=n.screenY,t.relatedTarget=null}},{key:"setCursor",value:function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")}},{key:"normalizeToPointerEvent",value:function(t,n){var i=[];if(n.isTouchEvent(t))for(var a=0;a<t.changedTouches.length;a++){var s=t.changedTouches[a];Ge(s.button)&&(s.button=0),Ge(s.buttons)&&(s.buttons=1),Ge(s.isPrimary)&&(s.isPrimary=t.touches.length===1&&t.type==="touchstart"),Ge(s.width)&&(s.width=s.radiusX||1),Ge(s.height)&&(s.height=s.radiusY||1),Ge(s.tiltX)&&(s.tiltX=0),Ge(s.tiltY)&&(s.tiltY=0),Ge(s.pointerType)&&(s.pointerType="touch"),Ge(s.pointerId)&&(s.pointerId=s.identifier||0),Ge(s.pressure)&&(s.pressure=s.force||.5),Ge(s.twist)&&(s.twist=0),Ge(s.tangentialPressure)&&(s.tangentialPressure=0),s.isNormalized=!0,s.type=t.type,i.push(s)}else if(n.isMouseEvent(t)){var o=t;Ge(o.isPrimary)&&(o.isPrimary=!0),Ge(o.width)&&(o.width=1),Ge(o.height)&&(o.height=1),Ge(o.tiltX)&&(o.tiltX=0),Ge(o.tiltY)&&(o.tiltY=0),Ge(o.pointerType)&&(o.pointerType="mouse"),Ge(o.pointerId)&&(o.pointerId=P4),Ge(o.pressure)&&(o.pressure=.5),Ge(o.twist)&&(o.twist=0),Ge(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,i.push(o)}else i.push(t);return i}}])})();Xx.tag="Event";var a6=[re.CIRCLE,re.ELLIPSE,re.IMAGE,re.RECT,re.LINE,re.POLYLINE,re.POLYGON,re.TEXT,re.PATH,re.HTML],s6=(function(){function r(){le(this,r)}return ce(r,[{key:"isVisible",value:function(t,n){var i,a=n.cullable;if(!a.enable)return!0;var s=n.getRenderBounds();if(kt.isEmpty(s))return!1;var o=t.getFrustum(),A=(i=n.parentNode)===null||i===void 0||(i=i.cullable)===null||i===void 0?void 0:i.visibilityPlaneMask;return a.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(n,s,A||wo.INDETERMINATE,o.planes),a.visible=a.visibilityPlaneMask!==wo.OUTSIDE,a.visible}},{key:"computeVisibilityWithPlaneMask",value:function(t,n,i,a){if(i===wo.OUTSIDE||i===wo.INSIDE)return i;for(var s=wo.INSIDE,o=a6.indexOf(t.nodeName)>-1,A=0,l=a.length;A<l;++A){var c=1<<A;if((i&c)!==0&&!(o&&(A===4||A===5))){var u=a[A],h=u.normal,d=u.distance;if(Li(h,n.getPositiveFarPoint(a[A]))+d<0)return wo.OUTSIDE;Li(h,n.getNegativeFarPoint(a[A]))+d<0&&(s|=c)}}return s}}])})(),Zx=(function(){function r(){le(this,r),this.mutationRecords=[],this.isFirstTimeRendering=!0,this.isFirstTimeRenderingFinished=!1}return ce(r,[{key:"apply",value:function(t){var n=this,i,a=t.renderingService,s=t.renderingContext,o=s.root.ownerDocument.defaultView,A=function(f){a.dirty()},l=function(f){var g,p=f.detail;(g=n.mutationRecords).push.apply(g,tt(p)),a.dirty()},c=function(f){var g=f.target;he.enableSizeAttenuation&&he.styleValueRegistry.updateSizeAttenuation(g,o.getCamera().getZoom())},u=function(f){var g=f.target;he.sceneGraphService.dirtyToRoot(g),a.dirty()};a.hooks.init.tap(r.tag,function(){o.addEventListener(at.MOUNTED,c),o.addEventListener(at.UNMOUNTED,u),o.addEventListener(at.ATTR_MODIFIED,A),o.addEventListener(at.BOUNDS_CHANGED,l)}),a.hooks.destroy.tap(r.tag,function(){o.removeEventListener(at.MOUNTED,c),o.removeEventListener(at.UNMOUNTED,u),o.removeEventListener(at.ATTR_MODIFIED,A),o.removeEventListener(at.BOUNDS_CHANGED,l),n.mutationRecords=[]});var h=(i=he.globalThis.requestIdleCallback)!==null&&i!==void 0?i:Lg.bind(he.globalThis);a.hooks.endFrame.tap(r.tag,function(){n.isFirstTimeRendering&&(n.isFirstTimeRendering=!1,h(function(){n.isFirstTimeRenderingFinished=!0})),n.mutationRecords=[]})}}])})();Zx.tag="Prepare";var Lr=(function(r){return r.READY="ready",r.BEFORE_RENDER="beforerender",r.RERENDER="rerender",r.AFTER_RENDER="afterrender",r.BEFORE_DESTROY="beforedestroy",r.AFTER_DESTROY="afterdestroy",r.RESIZE="resize",r.DIRTY_RECTANGLE="dirtyrectangle",r.RENDERER_CHANGED="rendererchanged",r})({}),Jx=500,o6=.1,A6=1e3,Kc=new yn(at.MOUNTED),zc=new yn(at.UNMOUNTED),Gg=new yn(Lr.BEFORE_RENDER),eC=new yn(Lr.RERENDER),Kg=new yn(Lr.AFTER_RENDER),zg=(function(r){function e(t){var n;le(this,e),n=We(this,e),n.Element=Tt,n.inited=!1,n.context={};var i=t.container,a=t.canvas,s=t.renderer,o=t.width,A=t.height,l=t.background,c=t.cursor,u=t.supportsMutipleCanvasesInOneContainer,h=t.cleanUpOnDestroy,d=h===void 0?!0:h,f=t.offscreenCanvas,g=t.devicePixelRatio,p=t.requestAnimationFrame,v=t.cancelAnimationFrame,y=t.createImage,m=t.supportsTouchEvents,B=t.supportsPointerEvents,C=t.isTouchEvent,S=t.isMouseEvent,F=t.dblClickSpeed,T=o,O=A,I=g||kg&&window.devicePixelRatio||1;return I=I>=1?Math.ceil(I):1,a&&(T=o||Q4(a)||a.width/I,O=A||U4(a)||a.height/I),n.customElements=new r6,n.devicePixelRatio=I,n.requestAnimationFrame=p??Lg.bind(he.globalThis),n.cancelAnimationFrame=v??Ux.bind(he.globalThis),n.createImage=y??function(){return new window.Image},n.supportsTouchEvents=m??"ontouchstart"in he.globalThis,n.supportsPointerEvents=B??!!he.globalThis.PointerEvent,n.isTouchEvent=C??function(k){return n.supportsTouchEvents&&k instanceof he.globalThis.TouchEvent},n.isMouseEvent=S??function(k){return!he.globalThis.MouseEvent||k instanceof he.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(k instanceof he.globalThis.PointerEvent))},f&&(he.offscreenCanvas=f),n.document=new $x,n.document.defaultView=n,u||_4(i,n,d),n.initRenderingContext(De(De({},t),{},{width:T,height:O,background:l??"transparent",cursor:c??"default",cleanUpOnDestroy:d,devicePixelRatio:I,requestAnimationFrame:n.requestAnimationFrame,cancelAnimationFrame:n.cancelAnimationFrame,createImage:n.createImage,supportsTouchEvents:n.supportsTouchEvents,supportsPointerEvents:n.supportsPointerEvents,isTouchEvent:n.isTouchEvent,isMouseEvent:n.isMouseEvent,dblClickSpeed:F??200})),n.initDefaultCamera(T,O,s.clipSpaceNearZ),n.initRenderer(s,!0),n}return qe(e,r),ce(e,[{key:"initRenderingContext",value:function(n){this.context.config=n,this.context.renderingContext={root:this.document.documentElement,unculledEntities:[],renderListCurrentFrame:[],renderReasons:new Set,force:!1,dirty:!1}}},{key:"initDefaultCamera",value:function(n,i,a){var s=this,o=new he.CameraContribution;o.clipSpaceNearZ=a,o.setType(wt.EXPLORING,fg.DEFAULT).setPosition(n/2,i/2,Jx).setFocalPoint(n/2,i/2,0).setOrthographic(n/-2,n/2,i/2,i/-2,o6,A6),o.canvas=this,o.eventEmitter.on(KE.UPDATED,function(){s.context.renderingContext.renderReasons.add(Fo.CAMERA_CHANGED),he.enableSizeAttenuation&&s.getConfig().renderer.getConfig().enableSizeAttenuation&&s.updateSizeAttenuation()}),this.context.camera=o}},{key:"updateSizeAttenuation",value:function(){var n=this.getCamera().getZoom();this.document.documentElement.forEach(function(i){he.styleValueRegistry.updateSizeAttenuation(i,n)})}},{key:"getConfig",value:function(){return this.context.config}},{key:"getRoot",value:function(){return this.document.documentElement}},{key:"getCamera",value:function(){return this.context.camera}},{key:"getContextService",value:function(){return this.context.contextService}},{key:"getEventService",value:function(){return this.context.eventService}},{key:"getRenderingService",value:function(){return this.context.renderingService}},{key:"getRenderingContext",value:function(){return this.context.renderingContext}},{key:"getStats",value:function(){return this.getRenderingService().getStats()}},{key:"ready",get:function(){var n=this;return this.readyPromise||(this.readyPromise=new Promise(function(i){n.resolveReadyPromise=function(){i(n)}}),this.inited&&this.resolveReadyPromise()),this.readyPromise}},{key:"destroy",value:function(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,a=arguments.length>1?arguments[1]:void 0;An.clearCache();var s=((n=this.getConfig().future)===null||n===void 0?void 0:n.experimentalCancelEventPropagation)===!0;a||this.dispatchEvent(new yn(Lr.BEFORE_DESTROY),s,s),this.frameId&&this.cancelAnimationFrame(this.frameId);var o=this.getRoot();i&&(this.unmountChildren(o),this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),a||this.dispatchEvent(new yn(Lr.AFTER_DESTROY),s,s);var A=function(c){c.currentTarget=null,c.manager=null,c.target=null,c.relatedNode=null};A(Kc),A(zc),A(Gg),A(eC),A(Kg),A(Ki),A(Dg),A(Hg),A(qx),he.textService.clearCache()}},{key:"changeSize",value:function(n,i){this.resize(n,i)}},{key:"resize",value:function(n,i){var a,s=this.context.config;s.width=n,s.height=i,this.getContextService().resize(n,i);var o=this.context.camera,A=o.getProjectionMode();o.setPosition(n/2,i/2,Jx).setFocalPoint(n/2,i/2,0),A===$r.ORTHOGRAPHIC?o.setOrthographic(n/-2,n/2,i/2,i/-2,o.getNear(),o.getFar()):o.setAspect(n/i);var l=((a=s.future)===null||a===void 0?void 0:a.experimentalCancelEventPropagation)===!0;this.dispatchEvent(new yn(Lr.RESIZE,{width:n,height:i}),l,l)}},{key:"appendChild",value:function(n,i){return this.document.documentElement.appendChild(n,i)}},{key:"insertBefore",value:function(n,i){return this.document.documentElement.insertBefore(n,i)}},{key:"removeChild",value:function(n){return this.document.documentElement.removeChild(n)}},{key:"removeChildren",value:function(){this.document.documentElement.removeChildren()}},{key:"destroyChildren",value:function(){this.document.documentElement.destroyChildren()}},{key:"render",value:function(n){var i,a=this;n&&(Gg.detail=n,Kg.detail=n);var s=((i=this.getConfig().future)===null||i===void 0?void 0:i.experimentalCancelEventPropagation)===!0;this.dispatchEvent(Gg,s,s);var o=this.getRenderingService();o.render(this,n,function(){a.dispatchEvent(eC,s,s)}),this.dispatchEvent(Kg,s,s)}},{key:"run",value:function(){var n=this,i=function(s,o){n.render(o),n.frameId=n.requestAnimationFrame(i)};i()}},{key:"initRenderer",value:function(n){var i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!n)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new Xx,new Zx,new Yx([new s6])),this.loadRendererContainerModule(n),this.context.contextService=new this.context.ContextService(De(De({},he),this.context)),this.context.renderingService=new yH(he,this.context),this.context.eventService=new vH(he,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(n,a,!0)):this.context.contextService.initAsync().then(function(){i.initRenderingService(n,a)}).catch(function(s){console.error(s)})}},{key:"initRenderingService",value:function(n){var i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.context.renderingService.init(function(){var o;i.inited=!0;var A=((o=i.getConfig().future)===null||o===void 0?void 0:o.experimentalCancelEventPropagation)===!0;a?s?i.requestAnimationFrame(function(){i.dispatchEvent(new yn(Lr.READY),A,A)}):i.dispatchEvent(new yn(Lr.READY),A,A):i.dispatchEvent(new yn(Lr.RENDERER_CHANGED),A,A),i.readyPromise&&i.resolveReadyPromise(),a||i.getRoot().forEach(function(l){var c,u;(c=(u=l).dirty)===null||c===void 0||c.call(u,!0,!0)}),i.mountChildren(i.getRoot()),n.getConfig().enableAutoRendering&&i.run()})}},{key:"loadRendererContainerModule",value:function(n){var i=this,a=n.getPlugins();a.forEach(function(s){s.context=i.context,s.init(he)})}},{key:"setRenderer",value:function(n){var i=this.getConfig();if(i.renderer!==n){var a=i.renderer;i.renderer=n,this.destroy(!1,!0),tt(a?.getPlugins()||[]).reverse().forEach(function(s){s.destroy(he)}),this.initRenderer(n)}}},{key:"setCursor",value:function(n){var i=this.getConfig();i.cursor=n,this.getContextService().applyCursorStyle(n)}},{key:"unmountChildren",value:function(n){var i=this;if(n.childNodes.forEach(function(o){i.unmountChildren(o)}),this.inited){if(n.isMutationObserved)n.dispatchEvent(zc);else{var a,s=((a=this.getConfig().future)===null||a===void 0?void 0:a.experimentalCancelEventPropagation)===!0;zc.target=n,this.dispatchEvent(zc,!0,s)}n!==this.document.documentElement&&(n.ownerDocument=null),n.isConnected=!1}n.isCustomElement&&n.disconnectedCallback&&n.disconnectedCallback()}},{key:"mountChildren",value:function(n){var i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Qc(n);if(this.inited){if(!n.isConnected&&(n.ownerDocument=this.document,n.isConnected=!0,!a))if(n.isMutationObserved)n.dispatchEvent(Kc);else{var s,o=((s=this.getConfig().future)===null||s===void 0?void 0:s.experimentalCancelEventPropagation)===!0;Kc.target=n,this.dispatchEvent(Kc,!0,o)}}else console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",n.nodeName);n.childNodes.forEach(function(A){i.mountChildren(A,a)}),n.isCustomElement&&n.connectedCallback&&n.connectedCallback()}},{key:"mountFragment",value:function(n){this.mountChildren(n,!1)}},{key:"client2Viewport",value:function(n){return this.getEventService().client2Viewport(n)}},{key:"viewport2Client",value:function(n){return this.getEventService().viewport2Client(n)}},{key:"viewport2Canvas",value:function(n){return this.getEventService().viewport2Canvas(n)}},{key:"canvas2Viewport",value:function(n){return this.getEventService().canvas2Viewport(n)}},{key:"getPointByClient",value:function(n,i){return this.client2Viewport({x:n,y:i})}},{key:"getClientByPoint",value:function(n,i){return this.viewport2Client({x:n,y:i})}}])})(Kx),l6=(function(){function r(){le(this,r),this.cacheStore=new Map}return ce(r,[{key:"onRefAdded",value:function(t){}},{key:"has",value:function(t){return this.cacheStore.has(t)}},{key:"put",value:function(t,n,i){return this.cacheStore.has(t)?!1:(this.cacheStore.set(t,{value:n,counter:new Set([i.entity])}),this.onRefAdded(i),!0)}},{key:"get",value:function(t,n){var i=this.cacheStore.get(t);return i?(i.counter.has(n.entity)||(i.counter.add(n.entity),this.onRefAdded(n)),i.value):null}},{key:"update",value:function(t,n,i){var a=this.cacheStore.get(t);return a?(a.value=De(De({},a.value),n),a.counter.has(i.entity)||(a.counter.add(i.entity),this.onRefAdded(i)),!0):!1}},{key:"release",value:function(t,n){var i=this.cacheStore.get(t);return i?(i.counter.delete(n.entity),i.counter.size<=0&&this.cacheStore.delete(t),!0):!1}},{key:"releaseRef",value:function(t){var n=this;Array.from(this.cacheStore.keys()).forEach(function(i){n.release(i,t)})}},{key:"getSize",value:function(){return this.cacheStore.size}},{key:"clear",value:function(){this.cacheStore.clear()}}])})(),Vg=[],jg=[],Wg=(function(){function r(){le(this,r)}return ce(r,null,[{key:"stop",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:r.api;r.rafId&&(t.cancelAnimationFrame(r.rafId),r.rafId=null)}},{key:"executeTask",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:r.api;Vg.length<=0&&jg.length<=0||(jg.forEach(function(n){return n()}),jg=Vg.splice(0,r.TASK_NUM_PER_FRAME),r.rafId=t.requestAnimationFrame(function(){r.executeTask(t)}))}},{key:"sliceImage",value:function(t,n,i,a){for(var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:r.api,A=t.naturalWidth||t.width,l=t.naturalHeight||t.height,c=n-s,u=i-s,h=Math.ceil(A/c),d=Math.ceil(l/u),f={tileSize:[n,i],gridSize:[d,h],tiles:Array(d).fill(null).map(function(){return Array(h).fill(null)})},g=function(y){for(var m=function(S){Vg.push(function(){var F=S*c,T=y*u,O=[Math.min(n,A-F),Math.min(i,l-T)],I=O[0],k=O[1],N=o.createCanvas();N.width=n,N.height=i;var U=N.getContext("2d");U.drawImage(t,F,T,I,k,0,0,I,k),f.tiles[y][S]={x:F,y:T,tileX:S,tileY:y,data:N},a()})},B=0;B<h;B++)m(B)},p=0;p<d;p++)g(p);return r.stop(),r.executeTask(),f}}])})();Wg.TASK_NUM_PER_FRAME=10;var Qr=new l6;Qr.onRefAdded=function(e){var t=this;e.addEventListener(at.DESTROY,function(){t.releaseRef(e)},{once:!0})};var qg=(function(){function r(e,t){le(this,r),this.gradientCache={},this.patternCache={},this.context=e,this.runtime=t}return ce(r,[{key:"getImageSync",value:function(t,n,i){var a=ot(t)?t:t.src;if(Qr.has(a)){var s=Qr.get(a,n);if(s.img.complete)return i?.(s),s}return this.getOrCreateImage(t,n).then(function(o){i?.(o)}).catch(function(o){console.error(o)}),null}},{key:"getOrCreateImage",value:function(t,n){var i=this,a=ot(t)?t:t.src;if(!ot(t)&&!Qr.has(a)){var s={img:t,size:[t.naturalWidth||t.width,t.naturalHeight||t.height],tileSize:Vc(t)};Qr.put(a,s,n)}if(Qr.has(a)){var o=Qr.get(a,n);return o.img.complete?Promise.resolve(o):new Promise(function(A,l){o.img.addEventListener("load",function(){o.size=[o.img.naturalWidth||o.img.width,o.img.naturalHeight||o.img.height],o.tileSize=Vc(o.img),A(o)}),o.img.addEventListener("error",function(c){l(c)})})}return new Promise(function(A,l){var c=i.context.config.createImage();if(c){var u={img:c,size:[0,0],tileSize:Vc(c)};Qr.put(a,u,n),c.onload=function(){u.size=[c.naturalWidth||c.width,c.naturalHeight||c.height],u.tileSize=Vc(u.img),A(u)},c.onerror=function(h){l(h)},c.crossOrigin="Anonymous",c.src=a}})}},{key:"createDownSampledImage",value:(function(){var e=La(kn().mark(function n(i,a){var s,o,A,l,c,u,h,d,f,g,p,v,y,m;return kn().wrap(function(B){for(;;)switch(B.prev=B.next){case 0:return B.next=1,this.getOrCreateImage(i,a);case 1:if(s=B.sent,!(typeof s.downSamplingRate<"u")){B.next=2;break}return B.abrupt("return",s);case 2:if(o=this.context.config.enableLargeImageOptimization,A=typeof o=="boolean"?{}:o,l=A.maxDownSampledImageSize,c=l===void 0?2048:l,u=A.downSamplingRateThreshold,h=u===void 0?.5:u,d=this.runtime.globalThis.createImageBitmap,f=$e(s.size,2),g=f[0],p=f[1],v=s.img,y=Math.min((c+c)/(g+p),Math.max(.01,Math.min(h,.5))),m=De(De({},s),{},{downSamplingRate:y}),Qr.update(s.img.src,m,a),!d){B.next=7;break}return B.prev=3,B.next=4,d(s.img,{resizeWidth:g*y,resizeHeight:p*y});case 4:v=B.sent,B.next=6;break;case 5:B.prev=5,B.catch(3),y=1;case 6:B.next=8;break;case 7:y=1;case 8:return m=De(De({},this.getImageSync(i,a)),{},{downSampled:v,downSamplingRate:y}),Qr.update(s.img.src,m,a),B.abrupt("return",m);case 9:case"end":return B.stop()}},n,this,[[3,5]])}));function t(n,i){return e.apply(this,arguments)}return t})()},{key:"createImageTiles",value:(function(){var e=La(kn().mark(function n(i,a,s,o){var A,l,c,u,h;return kn().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=1,this.getOrCreateImage(i,o);case 1:return A=d.sent,l=o.ownerDocument.defaultView,c=l.requestAnimationFrame,u=l.cancelAnimationFrame,Wg.api={requestAnimationFrame:c,cancelAnimationFrame:u,createCanvas:function(){return Rg.createCanvas()}},h=De(De({},A),Wg.sliceImage(A.img,A.tileSize[0],A.tileSize[0],s)),Qr.update(A.img.src,h,o),d.abrupt("return",h);case 2:case"end":return d.stop()}},n,this)}));function t(n,i,a,s){return e.apply(this,arguments)}return t})()},{key:"releaseImage",value:function(t,n){Qr.release(ot(t)?t:t.src,n)}},{key:"releaseImageRef",value:function(t){Qr.releaseRef(t)}},{key:"getOrCreatePatternSync",value:function(t,n,i,a,s,o,A){var l=this.generatePatternKey(n);if(l&&this.patternCache[l])return this.patternCache[l];var c=n.image,u=n.repetition,h=n.transform,d,f=!1;if(ot(c)){var g=this.getImageSync(c,t,A);d=g?.img}else a?(d=a,f=!0):d=c;var p=d&&i.createPattern(d,u);if(p){var v;h?v=Hx(xx(h),new Tt({})):v=Ta(Ct()),f&&Vb(v,v,[1/s,1/s,1]),p.setTransform({a:v[0],b:v[1],c:v[4],d:v[5],e:v[12]+o[0],f:v[13]+o[1]})}return l&&p&&(this.patternCache[l]=p),p}},{key:"getOrCreateGradient",value:function(t,n){var i=this.generateGradientKey(t),a=t.type,s=t.steps,o=t.min,A=t.width,l=t.height,c=t.angle,u=t.cx,h=t.cy,d=t.size;if(this.gradientCache[i])return this.gradientCache[i];var f=null;if(a===Pa.LinearGradient){var g=S3(o,A,l,c),p=g.x1,v=g.y1,y=g.x2,m=g.y2;f=n.createLinearGradient(p,v,y,m)}else if(a===Pa.RadialGradient){var B=F3(o,A,l,u,h,d),C=B.x,S=B.y,F=B.r;f=n.createRadialGradient(C,S,0,C,S,F)}return f&&(s.forEach(function(T){var O=T.offset,I=T.color;if(O.unit===we.kPercentage){var k;(k=f)===null||k===void 0||k.addColorStop(O.value/100,I.toString())}}),this.gradientCache[i]=f),this.gradientCache[i]}},{key:"generateGradientKey",value:function(t){var n=t.type,i=t.min,a=t.width,s=t.height,o=t.steps,A=t.angle,l=t.cx,c=t.cy,u=t.size;return"gradient-".concat(n,"-").concat(A?.toString()||0,"-").concat(l?.toString()||0,"-").concat(c?.toString()||0,"-").concat(u?.toString()||0,"-").concat(i[0],"-").concat(i[1],"-").concat(a,"-").concat(s,"-").concat(o.map(function(h){var d=h.offset,f=h.color;return"".concat(d).concat(f)}).join("-"))}},{key:"generatePatternKey",value:function(t){var n=t.image,i=t.repetition;if(ot(n))return"pattern-".concat(n,"-").concat(i);if(n.nodeName==="rect")return"pattern-".concat(n.entity,"-").concat(i)}}])})();qg.isSupportTile=!!Rg.createCanvas();function Vc(r){if(!r.complete)return[0,0];var e=r.naturalWidth||r.width,t=r.naturalHeight||r.height,n=256;return[256,512].forEach(function(i){var a=Math.ceil(t/i),s=Math.ceil(e/i);a*s<1e3&&(n=i)}),[n,n]}var tC=(function(){function r(){le(this,r)}return ce(r,[{key:"apply",value:function(t){var n=t.renderingService,i=t.renderingContext,a=t.imagePool,s=i.root.ownerDocument.defaultView,o=function(u,h,d){var f=u.parsedStyle,g=f.width,p=f.height;g&&!p?u.setAttribute("height",d/h*g):!g&&p&&u.setAttribute("width",h/d*p)},A=function(u){var h=u.target,d=h.nodeName,f=h.attributes;if(d===re.IMAGE){var g=f.src,p=f.keepAspectRatio;a.getImageSync(g,h,function(v){var y=v.img,m=y.width,B=y.height;p&&o(h,m,B),h.dirty(),n.dirty()})}},l=function(u){var h=u.target,d=u.attrName,f=u.prevValue,g=u.newValue;h.nodeName!==re.IMAGE||d!=="src"||(f!==g&&a.releaseImage(f,h),ot(g)&&a.getOrCreateImage(g,h).then(function(p){var v=p.img,y=v.width,m=v.height;h.attributes.keepAspectRatio&&o(h,y,m),h.dirty(),n.dirty()}).catch(function(){}))};n.hooks.init.tap(r.tag,function(){s.addEventListener(at.MOUNTED,A),s.addEventListener(at.ATTR_MODIFIED,l)}),n.hooks.destroy.tap(r.tag,function(){s.removeEventListener(at.MOUNTED,A),s.removeEventListener(at.ATTR_MODIFIED,l)})}}])})();tC.tag="LoadImage";var c6=(function(r){function e(){var t;le(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t=We(this,e,[].concat(i)),t.name="image-loader",t}return qe(e,r),ce(e,[{key:"init",value:function(n){this.context.imagePool=new qg(this.context,n),this.addRenderingPlugin(new tC)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])})(Ua),u6=Object.freeze({__proto__:null,ImagePool:qg,Plugin:c6}),h6="g-canvas-camera",nC=(function(){function r(){le(this,r),this.displayObjectHTMLElementMap=new WeakMap}return ce(r,[{key:"joinTransformMatrix",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return"matrix(".concat([t[0],t[1],t[4],t[5],t[12]+n[0],t[13]+n[1]].join(","),")")}},{key:"apply",value:function(t,n){var i=this,a=t.camera,s=t.renderingContext,o=t.renderingService;this.context=t;var A=s.root.ownerDocument.defaultView,l=A.context.eventService.nativeHTMLMap,c=function(v,y){y.style.transform=i.joinTransformMatrix(v.getWorldTransform(),v.getOrigin())},u=function(v){var y=v.target;if(y.nodeName===re.HTML){i.$camera||(i.$camera=i.createCamera(a));var m=i.getOrCreateEl(y);i.$camera.appendChild(m),Object.keys(y.attributes).forEach(function(B){i.updateAttribute(B,y)}),c(y,m),l.set(m,y)}},h=function(v){var y=v.target;if(y.nodeName===re.HTML&&i.$camera){var m=i.getOrCreateEl(y);m&&(m.remove(),l.delete(m))}},d=function(v){var y=v.target;if(y.nodeName===re.HTML){var m=v.attrName;i.updateAttribute(m,y)}},f=function(v){for(var y=v.detail,m=0;m<y.length;m++){var B=y[m],C=B.target,S=C.nodeName===re.FRAGMENT?C.childNodes:[C];S.forEach(function(F){if(F.nodeName===re.HTML){var T=i.getOrCreateEl(F);c(F,T)}})}},g=function(){if(i.$camera){var v=i.context.config,y=v.width,m=v.height;i.$camera.parentElement.style.width="".concat(y||0,"px"),i.$camera.parentElement.style.height="".concat(m||0,"px")}};o.hooks.init.tap(r.tag,function(){A.addEventListener(Lr.RESIZE,g),A.addEventListener(at.MOUNTED,u),A.addEventListener(at.UNMOUNTED,h),A.addEventListener(at.ATTR_MODIFIED,d),A.addEventListener(at.BOUNDS_CHANGED,f)}),o.hooks.endFrame.tap(r.tag,function(){i.$camera&&s.renderReasons.has(Fo.CAMERA_CHANGED)&&(i.$camera.style.transform=i.joinTransformMatrix(a.getOrthoMatrix()))}),o.hooks.destroy.tap(r.tag,function(){i.$camera&&i.$camera.remove(),A.removeEventListener(Lr.RESIZE,g),A.removeEventListener(at.MOUNTED,u),A.removeEventListener(at.UNMOUNTED,h),A.removeEventListener(at.ATTR_MODIFIED,d),A.removeEventListener(at.BOUNDS_CHANGED,f)})}},{key:"createCamera",value:function(t){var n=this.context.config,i=n.document,a=n.width,s=n.height,o=this.context.contextService.getDomElement(),A=o.parentNode;if(A){var l=h6,c=A.querySelector("#".concat(l));if(!c){var u=(i||document).createElement("div");u.style.overflow="hidden",u.style.pointerEvents="none",u.style.position="absolute",u.style.left="0px",u.style.top="0px",u.style.width="".concat(a||0,"px"),u.style.height="".concat(s||0,"px");var h=(i||document).createElement("div");c=h,h.id=l,h.style.position="absolute",h.style.left="".concat(o.offsetLeft||0,"px"),h.style.top="".concat(o.offsetTop||0,"px"),h.style.transformOrigin="left top",h.style.transform=this.joinTransformMatrix(t.getOrthoMatrix()),h.style.pointerEvents="none",h.style.width="100%",h.style.height="100%",u.appendChild(h),A.appendChild(u)}return c}return null}},{key:"getOrCreateEl",value:function(t){var n=this.context.config.document,i=this.displayObjectHTMLElementMap.get(t);return i||(i=(n||document).createElement("div"),t.parsedStyle.$el=i,this.displayObjectHTMLElementMap.set(t,i),t.id&&(i.id=t.id),t.name&&i.setAttribute("name",t.name),t.className&&(i.className=t.className),i.style.position="absolute",i.style["will-change"]="transform",i.style.transform=this.joinTransformMatrix(t.getWorldTransform(),t.getOrigin())),i}},{key:"updateAttribute",value:function(t,n){var i=this.getOrCreateEl(n);switch(t){case"innerHTML":var a=n.parsedStyle.innerHTML;ot(a)?i.innerHTML=a:(i.innerHTML="",i.appendChild(a));break;case"x":i.style.left="".concat(n.parsedStyle.x,"px");break;case"y":i.style.top="".concat(n.parsedStyle.y,"px");break;case"transformOrigin":var s=n.parsedStyle.transformOrigin;i.style["transform-origin"]="".concat(s[0].buildCSSText(null,null,"")," ").concat(s[1].buildCSSText(null,null,""));break;case"width":var o=n.parsedStyle.width;i.style.width=Be(o)?"".concat(o,"px"):o.toString();break;case"height":var A=n.parsedStyle.height;i.style.height=Be(A)?"".concat(A,"px"):A.toString();break;case"zIndex":var l=n.parsedStyle.zIndex;i.style["z-index"]="".concat(l);break;case"visibility":var c=n.parsedStyle.visibility;i.style.visibility=c;break;case"pointerEvents":var u=n.parsedStyle.pointerEvents,h=u===void 0?"auto":u;i.style.pointerEvents=h;break;case"opacity":var d=n.parsedStyle.opacity;i.style.opacity="".concat(d);break;case"fill":var f=n.parsedStyle.fill,g="";_c(f)?f.isNone?g="transparent":g=n.getAttribute("fill"):Array.isArray(f)?g=n.getAttribute("fill"):Es(f),i.style.background=g;break;case"stroke":var p=n.parsedStyle.stroke,v="";_c(p)?p.isNone?v="transparent":v=n.getAttribute("stroke"):Array.isArray(p)?v=n.getAttribute("stroke"):Es(p),i.style["border-color"]=v,i.style["border-style"]="solid";break;case"lineWidth":var y=n.parsedStyle.lineWidth;i.style["border-width"]="".concat(y||0,"px");break;case"lineDash":i.style["border-style"]="dashed";break;case"filter":var m=n.style.filter;i.style.filter=m;break;default:!ke(n.style[t])&&n.style[t]!==""&&(i.style[t]=n.style[t])}}}])})();nC.tag="HTMLRendering";var d6=(function(r){function e(){var t;le(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t=We(this,e,[].concat(i)),t.name="html-renderer",t}return qe(e,r),ce(e,[{key:"init",value:function(){this.addRenderingPlugin(new nC)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])})(Ua),f6=Object.freeze({__proto__:null,Plugin:d6}),rC=(function(){function r(){le(this,r)}return ce(r,[{key:"apply",value:function(t,n){var i=this,a=t.renderingService,s=t.renderingContext,o=t.config;this.context=t;var A=s.root.ownerDocument.defaultView,l=function(T){a.hooks.pointerMove.call(T)},c=function(T){a.hooks.pointerUp.call(T)},u=function(T){a.hooks.pointerDown.call(T)},h=function(T){a.hooks.pointerOver.call(T)},d=function(T){a.hooks.pointerOut.call(T)},f=function(T){a.hooks.pointerCancel.call(T)},g=function(T){a.hooks.pointerWheel.call(T)},p=function(T){a.hooks.click.call(T)},v=function(T){n.globalThis.document.addEventListener("pointermove",l,!0),T.addEventListener("pointerdown",u,!0),T.addEventListener("pointerleave",d,!0),T.addEventListener("pointerover",h,!0),n.globalThis.addEventListener("pointerup",c,!0),n.globalThis.addEventListener("pointercancel",f,!0)},y=function(T){T.addEventListener("touchstart",u,!0),T.addEventListener("touchend",c,!0),T.addEventListener("touchmove",l,!0),T.addEventListener("touchcancel",f,!0)},m=function(T){n.globalThis.document.addEventListener("mousemove",l,!0),T.addEventListener("mousedown",u,!0),T.addEventListener("mouseout",d,!0),T.addEventListener("mouseover",h,!0),n.globalThis.addEventListener("mouseup",c,!0)},B=function(T){n.globalThis.document.removeEventListener("pointermove",l,!0),T.removeEventListener("pointerdown",u,!0),T.removeEventListener("pointerleave",d,!0),T.removeEventListener("pointerover",h,!0),n.globalThis.removeEventListener("pointerup",c,!0),n.globalThis.removeEventListener("pointercancel",f,!0)},C=function(T){T.removeEventListener("touchstart",u,!0),T.removeEventListener("touchend",c,!0),T.removeEventListener("touchmove",l,!0),T.removeEventListener("touchcancel",f,!0)},S=function(T){n.globalThis.document.removeEventListener("mousemove",l,!0),T.removeEventListener("mousedown",u,!0),T.removeEventListener("mouseout",d,!0),T.removeEventListener("mouseover",h,!0),n.globalThis.removeEventListener("mouseup",c,!0)};a.hooks.init.tap(r.tag,function(){var F=i.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(F.style.msContentZooming="none",F.style.msTouchAction="none"):A.supportsPointerEvents&&(F.style.touchAction="none"),A.supportsPointerEvents?v(F):m(F),A.supportsTouchEvents&&y(F),o.useNativeClickEvent&&F.addEventListener("click",p,!0),F.addEventListener("wheel",g,{passive:!0,capture:!0})}),a.hooks.destroy.tap(r.tag,function(){var F=i.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(F.style.msContentZooming="",F.style.msTouchAction=""):A.supportsPointerEvents&&(F.style.touchAction=""),A.supportsPointerEvents?B(F):S(F),A.supportsTouchEvents&&C(F),o.useNativeClickEvent&&F.removeEventListener("click",p,!0),F.removeEventListener("wheel",g,!0)})}}])})();rC.tag="DOMInteraction";var g6=(function(r){function e(){var t;le(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t=We(this,e,[].concat(i)),t.name="dom-interaction",t}return qe(e,r),ce(e,[{key:"init",value:function(){this.addRenderingPlugin(new rC)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])})(Ua),p6=Object.freeze({__proto__:null,Plugin:g6}),v6=(function(){function r(){le(this,r)}return ce(r,[{key:"apply",value:function(t){var n=t.renderingService,i=t.contextService,a=t.config,s=i.getDomElement(),o=function(g){n.hooks.pointerDown.call(g)},A=function(g){n.hooks.pointerUp.call(g)},l=function(g){n.hooks.pointerMove.call(g)},c=function(g){n.hooks.pointerOver.call(g)},u=function(g){n.hooks.pointerOut.call(g)},h=function(g){n.hooks.click.call(g)},d=function(g){n.hooks.pointerCancel.call(g)};n.hooks.init.tap(r.tag,function(){s.addEventListener("touchstart",o,!0),s.addEventListener("touchend",A,!0),s.addEventListener("touchmove",l,!0),s.addEventListener("touchcancel",d,!0),s.addEventListener("mouseout",u,!0),s.addEventListener("mouseover",c,!0),a.useNativeClickEvent&&s.addEventListener("click",h,!0)}),n.hooks.destroy.tap(r.tag,function(){s.removeEventListener("touchstart",o,!0),s.removeEventListener("touchend",A,!0),s.removeEventListener("touchmove",l,!0),s.removeEventListener("touchcancel",d,!0),s.removeEventListener("mouseout",u,!0),s.removeEventListener("mouseover",c,!0),a.useNativeClickEvent&&s.removeEventListener("click",h,!0)})}}])})();v6.tag="MobileInteraction";var $g=function(r,e){return $g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},$g(r,e)};function vi(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");$g(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Xr(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{l(n.next(c))}catch(u){s(u)}}function A(c){try{l(n.throw(c))}catch(u){s(u)}}function l(c){c.done?a(c.value):i(c.value).then(o,A)}l((n=n.apply(r,[])).next())})}function Ur(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(l){return function(c){return A([l,c])}}function A(l){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,i=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){t.label=l[1];break}if(l[0]===6&&t.label<a[1]){t.label=a[1],a=l;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(l);break}a[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(r,t)}catch(c){l=[6,c],i=0}finally{n=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}for(var Ns=(function(){function r(e,t,n,i){this.left=e,this.top=t,this.width=n,this.height=i}return r.prototype.add=function(e,t,n,i){return new r(this.left+e,this.top+t,this.width+n,this.height+i)},r.fromClientRect=function(e,t){return new r(t.left+e.windowBounds.left,t.top+e.windowBounds.top,t.width,t.height)},r.fromDOMRectList=function(e,t){var n=Array.from(t).find(function(i){return i.width!==0});return n?new r(n.left+e.windowBounds.left,n.top+e.windowBounds.top,n.width,n.height):r.EMPTY},r.EMPTY=new r(0,0,0,0),r})(),Yg=function(r,e){return Ns.fromClientRect(r,e.getBoundingClientRect())},jc=function(r){for(var e=[],t=0,n=r.length;t<n;){var i=r.charCodeAt(t++);if(i>=55296&&i<=56319&&t<n){var a=r.charCodeAt(t++);(a&64512)===56320?e.push(((i&1023)<<10)+(a&1023)+65536):(e.push(i),t--)}else e.push(i)}return e},cn=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,r);var t=r.length;if(!t)return"";for(var n=[],i=-1,a="";++i<t;){var s=r[i];s<=65535?n.push(s):(s-=65536,n.push((s>>10)+55296,s%1024+56320)),(i+1===t||n.length>16384)&&(a+=String.fromCharCode.apply(String,n),n.length=0)}return a},iC="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",y6=typeof Uint8Array>"u"?[]:new Uint8Array(256),Wc=0;Wc<iC.length;Wc++)y6[iC.charCodeAt(Wc)]=Wc;for(var aC="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",RA=typeof Uint8Array>"u"?[]:new Uint8Array(256),qc=0;qc<aC.length;qc++)RA[aC.charCodeAt(qc)]=qc;for(var m6=function(r){var e=r.length*.75,t=r.length,n,i=0,a,s,o,A;r[r.length-1]==="="&&(e--,r[r.length-2]==="="&&e--);var l=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(e):new Array(e),c=Array.isArray(l)?l:new Uint8Array(l);for(n=0;n<t;n+=4)a=RA[r.charCodeAt(n)],s=RA[r.charCodeAt(n+1)],o=RA[r.charCodeAt(n+2)],A=RA[r.charCodeAt(n+3)],c[i++]=a<<2|s>>4,c[i++]=(s&15)<<4|o>>2,c[i++]=(o&3)<<6|A&63;return l},w6=function(r){for(var e=r.length,t=[],n=0;n<e;n+=2)t.push(r[n+1]<<8|r[n]);return t},B6=function(r){for(var e=r.length,t=[],n=0;n<e;n+=4)t.push(r[n+3]<<24|r[n+2]<<16|r[n+1]<<8|r[n]);return t},Ls=5,Xg=11,Zg=2,b6=Xg-Ls,sC=65536>>Ls,E6=1<<Ls,Jg=E6-1,x6=1024>>Ls,C6=sC+x6,S6=C6,F6=32,T6=S6+F6,M6=65536>>Xg,O6=1<<b6,I6=O6-1,oC=function(r,e,t){return r.slice?r.slice(e,t):new Uint16Array(Array.prototype.slice.call(r,e,t))},_6=function(r,e,t){return r.slice?r.slice(e,t):new Uint32Array(Array.prototype.slice.call(r,e,t))},k6=function(r,e){var t=m6(r),n=Array.isArray(t)?B6(t):new Uint32Array(t),i=Array.isArray(t)?w6(t):new Uint16Array(t),a=24,s=oC(i,a/2,n[4]/2),o=n[5]===2?oC(i,(a+n[4])/2):_6(n,Math.ceil((a+n[4])/4));return new N6(n[0],n[1],n[2],n[3],s,o)},N6=(function(){function r(e,t,n,i,a,s){this.initialValue=e,this.errorValue=t,this.highStart=n,this.highValueIndex=i,this.index=a,this.data=s}return r.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=this.index[e>>Ls],t=(t<<Zg)+(e&Jg),this.data[t];if(e<=65535)return t=this.index[sC+(e-55296>>Ls)],t=(t<<Zg)+(e&Jg),this.data[t];if(e<this.highStart)return t=T6-M6+(e>>Xg),t=this.index[t],t+=e>>Ls&I6,t=this.index[t],t=(t<<Zg)+(e&Jg),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},r})(),AC="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",L6=typeof Uint8Array>"u"?[]:new Uint8Array(256),$c=0;$c<AC.length;$c++)L6[AC.charCodeAt($c)]=$c;var Q6="KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBcDLQg1CD0IRQhNCEEDUwh1AHUAdQBbCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDMAAwADAAMAAwADAAMAAwAL4LwwvLC9IL1wvdCzAAMADlC+kL8Qv5C/8LSQswADAAMAAwADAAMAAwADAAMAAHDDAAMAAwADAAMAAODBYMHgx1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1ACYMMAAwADAAdQB1AHUALgx1AHUAdQB1AHUAdQA2DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AD4MdQBGDHUAdQB1AHUAdQB1AEkMdQB1AHUAdQB1AFAMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA1w11ANwNMAAwAD0B5A0wADAAMAAwADAAMADsDfQN/A0EDgwOFA4wABsOMAAwADAAMAAwADAAMAAwANIG0gbSBtIG0gbSBtIG0gYjDigOwQUuDsEFMw7SBjoO0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGQg5KDlIOVg7SBtIGXg5lDm0OdQ7SBtIGfQ6EDooOjQ6UDtIGmg6hDtIG0gaoDqwO0ga0DrwO0gZgAGAAYADEDmAAYAAkBtIGzA5gANIOYADaDokO0gbSBt8O5w7SBu8O0gb1DvwO0gZgAGAAxA7SBtIG0gbSBtIGYABgAGAAYAAED2AAsAUMD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHJA8sBywHLAcsBywHLAccDywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywPLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc0D9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQAVABUAHgAeAB4AHgAeAB4AGAAWABEAFQAVABUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ADQAeAA0ADQANAA0AHgANAA0ADQAHAB4AHgAeAB4AKwAEAAQABAAEAAQABAAEAAQABAAEAFAAUAArACsATwBQAFAAUABQAFAAHgAeAB4AFgARAE8AUABPAE8ATwBPAFAAUABQAFAAUAAeAB4AHgAWABEAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArABsAGwAbABsAGwAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAbABsAGwAbABoAGwAbABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAFAAGgAeAB0AHgBQAB4AGgAeAB4AHgAeAB4AHgAeAB4AHgBPAB4AUAAbAB4AHgBQAFAAUABQAFAAHgAeAB4AHQAdAB4AUAAeAFAAHgBQAB4AUABPAFAAUAAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgBQAFAAUABQAE8ATwBQAFAAUABQAFAATwBQAFAATwBQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABPAB4AHgArACsAKwArAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAdAB4AHgAeAB0AHQAeAB4AHQAeAB4AHgAdAB4AHQAbABsAHgAdAB4AHgAeAB4AHQAeAB4AHQAdAB0AHQAeAB4AHQAeAB0AHgAdAB0AHQAdAB0AHQAeAB0AHgAeAB4AHgAeAB0AHQAdAB0AHgAeAB4AHgAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB0AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAdAB0AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHQAdAB0AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHQAdAB4AHgAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AJQAlAB0AHQAlAB4AJQAlACUAIAAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAeAB0AJQAdAB0AHgAdAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAdAB0AHQAdACUAHgAlACUAJQAdACUAJQAdAB0AHQAlACUAHQAdACUAHQAdACUAJQAlAB4AHQAeAB4AHgAeAB0AHQAlAB0AHQAdAB0AHQAdACUAJQAlACUAJQAdACUAJQAgACUAHQAdACUAJQAlACUAJQAlACUAJQAeAB4AHgAlACUAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AFwAXABcAFwAXABcAHgATABMAJQAeAB4AHgAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARABYAEQAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwAlACUAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACsAKwArACsAKwArACsAKwArACsAKwArAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBPAE8ATwBPAE8ATwBPAE8AJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA==",lC=50,U6=1,cC=2,uC=3,P6=4,R6=5,hC=7,dC=8,fC=9,Ra=10,ep=11,gC=12,tp=13,D6=14,DA=15,np=16,Yc=17,HA=18,H6=19,pC=20,rp=21,GA=22,ip=23,To=24,Pr=25,KA=26,zA=27,Mo=28,G6=29,Qs=30,K6=31,Xc=32,Zc=33,ap=34,sp=35,op=36,VA=37,Ap=38,Jc=39,eu=40,lp=41,vC=42,z6=43,V6=[9001,65288],yC="!",At="×",tu="÷",cp=k6(Q6),Aa=[Qs,op],up=[U6,cC,uC,R6],mC=[Ra,dC],wC=[zA,KA],j6=up.concat(mC),BC=[Ap,Jc,eu,ap,sp],W6=[DA,tp],q6=function(r,e){e===void 0&&(e="strict");var t=[],n=[],i=[];return r.forEach(function(a,s){var o=cp.get(a);if(o>lC?(i.push(!0),o-=lC):i.push(!1),["normal","auto","loose"].indexOf(e)!==-1&&[8208,8211,12316,12448].indexOf(a)!==-1)return n.push(s),t.push(np);if(o===P6||o===ep){if(s===0)return n.push(s),t.push(Qs);var A=t[s-1];return j6.indexOf(A)===-1?(n.push(n[s-1]),t.push(A)):(n.push(s),t.push(Qs))}if(n.push(s),o===K6)return t.push(e==="strict"?rp:VA);if(o===vC||o===G6)return t.push(Qs);if(o===z6)return a>=131072&&a<=196605||a>=196608&&a<=262141?t.push(VA):t.push(Qs);t.push(o)}),[n,t,i]},hp=function(r,e,t,n){var i=n[t];if(Array.isArray(r)?r.indexOf(i)!==-1:r===i)for(var a=t;a<=n.length;){a++;var s=n[a];if(s===e)return!0;if(s!==Ra)break}if(i===Ra)for(var a=t;a>0;){a--;var o=n[a];if(Array.isArray(r)?r.indexOf(o)!==-1:r===o)for(var A=t;A<=n.length;){A++;var s=n[A];if(s===e)return!0;if(s!==Ra)break}if(o!==Ra)break}return!1},bC=function(r,e){for(var t=r;t>=0;){var n=e[t];if(n===Ra)t--;else return n}return 0},$6=function(r,e,t,n,i){if(t[n]===0)return At;var a=n-1;if(Array.isArray(i)&&i[a]===!0)return At;var s=a-1,o=a+1,A=e[a],l=s>=0?e[s]:0,c=e[o];if(A===cC&&c===uC)return At;if(up.indexOf(A)!==-1)return yC;if(up.indexOf(c)!==-1||mC.indexOf(c)!==-1)return At;if(bC(a,e)===dC)return tu;if(cp.get(r[a])===ep||(A===Xc||A===Zc)&&cp.get(r[o])===ep||A===hC||c===hC||A===fC||[Ra,tp,DA].indexOf(A)===-1&&c===fC||[Yc,HA,H6,To,Mo].indexOf(c)!==-1||bC(a,e)===GA||hp(ip,GA,a,e)||hp([Yc,HA],rp,a,e)||hp(gC,gC,a,e))return At;if(A===Ra)return tu;if(A===ip||c===ip)return At;if(c===np||A===np)return tu;if([tp,DA,rp].indexOf(c)!==-1||A===D6||l===op&&W6.indexOf(A)!==-1||A===Mo&&c===op||c===pC||Aa.indexOf(c)!==-1&&A===Pr||Aa.indexOf(A)!==-1&&c===Pr||A===zA&&[VA,Xc,Zc].indexOf(c)!==-1||[VA,Xc,Zc].indexOf(A)!==-1&&c===KA||Aa.indexOf(A)!==-1&&wC.indexOf(c)!==-1||wC.indexOf(A)!==-1&&Aa.indexOf(c)!==-1||[zA,KA].indexOf(A)!==-1&&(c===Pr||[GA,DA].indexOf(c)!==-1&&e[o+1]===Pr)||[GA,DA].indexOf(A)!==-1&&c===Pr||A===Pr&&[Pr,Mo,To].indexOf(c)!==-1)return At;if([Pr,Mo,To,Yc,HA].indexOf(c)!==-1)for(var u=a;u>=0;){var h=e[u];if(h===Pr)return At;if([Mo,To].indexOf(h)!==-1)u--;else break}if([zA,KA].indexOf(c)!==-1)for(var u=[Yc,HA].indexOf(A)!==-1?s:a;u>=0;){var h=e[u];if(h===Pr)return At;if([Mo,To].indexOf(h)!==-1)u--;else break}if(Ap===A&&[Ap,Jc,ap,sp].indexOf(c)!==-1||[Jc,ap].indexOf(A)!==-1&&[Jc,eu].indexOf(c)!==-1||[eu,sp].indexOf(A)!==-1&&c===eu||BC.indexOf(A)!==-1&&[pC,KA].indexOf(c)!==-1||BC.indexOf(c)!==-1&&A===zA||Aa.indexOf(A)!==-1&&Aa.indexOf(c)!==-1||A===To&&Aa.indexOf(c)!==-1||Aa.concat(Pr).indexOf(A)!==-1&&c===GA&&V6.indexOf(r[o])===-1||Aa.concat(Pr).indexOf(c)!==-1&&A===HA)return At;if(A===lp&&c===lp){for(var d=t[a],f=1;d>0&&(d--,e[d]===lp);)f++;if(f%2!==0)return At}return A===Xc&&c===Zc?At:tu},Y6=function(r,e){e||(e={lineBreak:"normal",wordBreak:"normal"});var t=q6(r,e.lineBreak),n=t[0],i=t[1],a=t[2];(e.wordBreak==="break-all"||e.wordBreak==="break-word")&&(i=i.map(function(o){return[Pr,Qs,vC].indexOf(o)!==-1?VA:o}));var s=e.wordBreak==="keep-all"?a.map(function(o,A){return o&&r[A]>=19968&&r[A]<=40959}):void 0;return[n,i,s]},X6=(function(){function r(e,t,n,i){this.codePoints=e,this.required=t===yC,this.start=n,this.end=i}return r.prototype.slice=function(){return cn.apply(void 0,this.codePoints.slice(this.start,this.end))},r})(),Z6=function(r,e){var t=jc(r),n=Y6(t,e),i=n[0],a=n[1],s=n[2],o=t.length,A=0,l=0;return{next:function(){if(l>=o)return{done:!0,value:null};for(var c=At;l<o&&(c=$6(t,a,i,++l,s))===At;);if(c!==At||l===o){var u=new X6(t,c,A,l);return A=l,{value:u,done:!1}}return{done:!0,value:null}}}},J6=1,e5=2,jA=4,EC=8,nu=10,xC=47,WA=92,t5=9,n5=32,ru=34,qA=61,r5=35,i5=36,a5=37,iu=39,au=40,$A=41,s5=95,Cr=45,o5=33,A5=60,l5=62,c5=64,u5=91,h5=93,d5=61,f5=123,su=63,g5=125,CC=124,p5=126,v5=128,SC=65533,dp=42,Us=43,y5=44,m5=58,w5=59,YA=46,B5=0,b5=8,E5=11,x5=14,C5=31,S5=127,Vi=-1,FC=48,TC=97,MC=101,F5=102,T5=117,M5=122,OC=65,IC=69,_C=70,O5=85,I5=90,nr=function(r){return r>=FC&&r<=57},_5=function(r){return r>=55296&&r<=57343},Oo=function(r){return nr(r)||r>=OC&&r<=_C||r>=TC&&r<=F5},k5=function(r){return r>=TC&&r<=M5},N5=function(r){return r>=OC&&r<=I5},L5=function(r){return k5(r)||N5(r)},Q5=function(r){return r>=v5},ou=function(r){return r===nu||r===t5||r===n5},Au=function(r){return L5(r)||Q5(r)||r===s5},kC=function(r){return Au(r)||nr(r)||r===Cr},U5=function(r){return r>=B5&&r<=b5||r===E5||r>=x5&&r<=C5||r===S5},Da=function(r,e){return r!==WA?!1:e!==nu},lu=function(r,e,t){return r===Cr?Au(e)||Da(e,t):Au(r)?!0:!!(r===WA&&Da(r,e))},fp=function(r,e,t){return r===Us||r===Cr?nr(e)?!0:e===YA&&nr(t):nr(r===YA?e:r)},P5=function(r){var e=0,t=1;(r[e]===Us||r[e]===Cr)&&(r[e]===Cr&&(t=-1),e++);for(var n=[];nr(r[e]);)n.push(r[e++]);var i=n.length?parseInt(cn.apply(void 0,n),10):0;r[e]===YA&&e++;for(var a=[];nr(r[e]);)a.push(r[e++]);var s=a.length,o=s?parseInt(cn.apply(void 0,a),10):0;(r[e]===IC||r[e]===MC)&&e++;var A=1;(r[e]===Us||r[e]===Cr)&&(r[e]===Cr&&(A=-1),e++);for(var l=[];nr(r[e]);)l.push(r[e++]);var c=l.length?parseInt(cn.apply(void 0,l),10):0;return t*(i+o*Math.pow(10,-s))*Math.pow(10,A*c)},R5={type:2},D5={type:3},H5={type:4},G5={type:13},K5={type:8},z5={type:21},V5={type:9},j5={type:10},W5={type:11},q5={type:12},$5={type:14},cu={type:23},Y5={type:1},X5={type:25},Z5={type:24},J5={type:26},eG={type:27},tG={type:28},nG={type:29},rG={type:31},gp={type:32},NC=(function(){function r(){this._value=[]}return r.prototype.write=function(e){this._value=this._value.concat(jc(e))},r.prototype.read=function(){for(var e=[],t=this.consumeToken();t!==gp;)e.push(t),t=this.consumeToken();return e},r.prototype.consumeToken=function(){var e=this.consumeCodePoint();switch(e){case ru:return this.consumeStringToken(ru);case r5:var t=this.peekCodePoint(0),n=this.peekCodePoint(1),i=this.peekCodePoint(2);if(kC(t)||Da(n,i)){var a=lu(t,n,i)?e5:J6,s=this.consumeName();return{type:5,value:s,flags:a}}break;case i5:if(this.peekCodePoint(0)===qA)return this.consumeCodePoint(),G5;break;case iu:return this.consumeStringToken(iu);case au:return R5;case $A:return D5;case dp:if(this.peekCodePoint(0)===qA)return this.consumeCodePoint(),$5;break;case Us:if(fp(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case y5:return H5;case Cr:var o=e,A=this.peekCodePoint(0),l=this.peekCodePoint(1);if(fp(o,A,l))return this.reconsumeCodePoint(e),this.consumeNumericToken();if(lu(o,A,l))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();if(A===Cr&&l===l5)return this.consumeCodePoint(),this.consumeCodePoint(),Z5;break;case YA:if(fp(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case xC:if(this.peekCodePoint(0)===dp)for(this.consumeCodePoint();;){var c=this.consumeCodePoint();if(c===dp&&(c=this.consumeCodePoint(),c===xC))return this.consumeToken();if(c===Vi)return this.consumeToken()}break;case m5:return J5;case w5:return eG;case A5:if(this.peekCodePoint(0)===o5&&this.peekCodePoint(1)===Cr&&this.peekCodePoint(2)===Cr)return this.consumeCodePoint(),this.consumeCodePoint(),X5;break;case c5:var u=this.peekCodePoint(0),h=this.peekCodePoint(1),d=this.peekCodePoint(2);if(lu(u,h,d)){var s=this.consumeName();return{type:7,value:s}}break;case u5:return tG;case WA:if(Da(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();break;case h5:return nG;case d5:if(this.peekCodePoint(0)===qA)return this.consumeCodePoint(),K5;break;case f5:return W5;case g5:return q5;case T5:case O5:var f=this.peekCodePoint(0),g=this.peekCodePoint(1);return f===Us&&(Oo(g)||g===su)&&(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(e),this.consumeIdentLikeToken();case CC:if(this.peekCodePoint(0)===qA)return this.consumeCodePoint(),V5;if(this.peekCodePoint(0)===CC)return this.consumeCodePoint(),z5;break;case p5:if(this.peekCodePoint(0)===qA)return this.consumeCodePoint(),j5;break;case Vi:return gp}return ou(e)?(this.consumeWhiteSpace(),rG):nr(e)?(this.reconsumeCodePoint(e),this.consumeNumericToken()):Au(e)?(this.reconsumeCodePoint(e),this.consumeIdentLikeToken()):{type:6,value:cn(e)}},r.prototype.consumeCodePoint=function(){var e=this._value.shift();return typeof e>"u"?-1:e},r.prototype.reconsumeCodePoint=function(e){this._value.unshift(e)},r.prototype.peekCodePoint=function(e){return e>=this._value.length?-1:this._value[e]},r.prototype.consumeUnicodeRangeToken=function(){for(var e=[],t=this.consumeCodePoint();Oo(t)&&e.length<6;)e.push(t),t=this.consumeCodePoint();for(var n=!1;t===su&&e.length<6;)e.push(t),t=this.consumeCodePoint(),n=!0;if(n){var i=parseInt(cn.apply(void 0,e.map(function(A){return A===su?FC:A})),16),a=parseInt(cn.apply(void 0,e.map(function(A){return A===su?_C:A})),16);return{type:30,start:i,end:a}}var s=parseInt(cn.apply(void 0,e),16);if(this.peekCodePoint(0)===Cr&&Oo(this.peekCodePoint(1))){this.consumeCodePoint(),t=this.consumeCodePoint();for(var o=[];Oo(t)&&o.length<6;)o.push(t),t=this.consumeCodePoint();var a=parseInt(cn.apply(void 0,o),16);return{type:30,start:s,end:a}}else return{type:30,start:s,end:s}},r.prototype.consumeIdentLikeToken=function(){var e=this.consumeName();return e.toLowerCase()==="url"&&this.peekCodePoint(0)===au?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===au?(this.consumeCodePoint(),{type:19,value:e}):{type:20,value:e}},r.prototype.consumeUrlToken=function(){var e=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===Vi)return{type:22,value:""};var t=this.peekCodePoint(0);if(t===iu||t===ru){var n=this.consumeStringToken(this.consumeCodePoint());return n.type===0&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===Vi||this.peekCodePoint(0)===$A)?(this.consumeCodePoint(),{type:22,value:n.value}):(this.consumeBadUrlRemnants(),cu)}for(;;){var i=this.consumeCodePoint();if(i===Vi||i===$A)return{type:22,value:cn.apply(void 0,e)};if(ou(i))return this.consumeWhiteSpace(),this.peekCodePoint(0)===Vi||this.peekCodePoint(0)===$A?(this.consumeCodePoint(),{type:22,value:cn.apply(void 0,e)}):(this.consumeBadUrlRemnants(),cu);if(i===ru||i===iu||i===au||U5(i))return this.consumeBadUrlRemnants(),cu;if(i===WA)if(Da(i,this.peekCodePoint(0)))e.push(this.consumeEscapedCodePoint());else return this.consumeBadUrlRemnants(),cu;else e.push(i)}},r.prototype.consumeWhiteSpace=function(){for(;ou(this.peekCodePoint(0));)this.consumeCodePoint()},r.prototype.consumeBadUrlRemnants=function(){for(;;){var e=this.consumeCodePoint();if(e===$A||e===Vi)return;Da(e,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},r.prototype.consumeStringSlice=function(e){for(var t=5e4,n="";e>0;){var i=Math.min(t,e);n+=cn.apply(void 0,this._value.splice(0,i)),e-=i}return this._value.shift(),n},r.prototype.consumeStringToken=function(e){var t="",n=0;do{var i=this._value[n];if(i===Vi||i===void 0||i===e)return t+=this.consumeStringSlice(n),{type:0,value:t};if(i===nu)return this._value.splice(0,n),Y5;if(i===WA){var a=this._value[n+1];a!==Vi&&a!==void 0&&(a===nu?(t+=this.consumeStringSlice(n),n=-1,this._value.shift()):Da(i,a)&&(t+=this.consumeStringSlice(n),t+=cn(this.consumeEscapedCodePoint()),n=-1))}n++}while(!0)},r.prototype.consumeNumber=function(){var e=[],t=jA,n=this.peekCodePoint(0);for((n===Us||n===Cr)&&e.push(this.consumeCodePoint());nr(this.peekCodePoint(0));)e.push(this.consumeCodePoint());n=this.peekCodePoint(0);var i=this.peekCodePoint(1);if(n===YA&&nr(i))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=EC;nr(this.peekCodePoint(0));)e.push(this.consumeCodePoint());n=this.peekCodePoint(0),i=this.peekCodePoint(1);var a=this.peekCodePoint(2);if((n===IC||n===MC)&&((i===Us||i===Cr)&&nr(a)||nr(i)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=EC;nr(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[P5(e),t]},r.prototype.consumeNumericToken=function(){var e=this.consumeNumber(),t=e[0],n=e[1],i=this.peekCodePoint(0),a=this.peekCodePoint(1),s=this.peekCodePoint(2);if(lu(i,a,s)){var o=this.consumeName();return{type:15,number:t,flags:n,unit:o}}return i===a5?(this.consumeCodePoint(),{type:16,number:t,flags:n}):{type:17,number:t,flags:n}},r.prototype.consumeEscapedCodePoint=function(){var e=this.consumeCodePoint();if(Oo(e)){for(var t=cn(e);Oo(this.peekCodePoint(0))&&t.length<6;)t+=cn(this.consumeCodePoint());ou(this.peekCodePoint(0))&&this.consumeCodePoint();var n=parseInt(t,16);return n===0||_5(n)||n>1114111?SC:n}return e===Vi?SC:e},r.prototype.consumeName=function(){for(var e="";;){var t=this.consumeCodePoint();if(kC(t))e+=cn(t);else if(Da(t,this.peekCodePoint(0)))e+=cn(this.consumeEscapedCodePoint());else return this.reconsumeCodePoint(t),e}},r})(),LC=(function(){function r(e){this._tokens=e}return r.create=function(e){var t=new NC;return t.write(e),new r(t.read())},r.parseValue=function(e){return r.create(e).parseComponentValue()},r.parseValues=function(e){return r.create(e).parseComponentValues()},r.prototype.parseComponentValue=function(){for(var e=this.consumeToken();e.type===31;)e=this.consumeToken();if(e.type===32)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(e);var t=this.consumeComponentValue();do e=this.consumeToken();while(e.type===31);if(e.type===32)return t;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},r.prototype.parseComponentValues=function(){for(var e=[];;){var t=this.consumeComponentValue();if(t.type===32)return e;e.push(t),e.push()}},r.prototype.consumeComponentValue=function(){var e=this.consumeToken();switch(e.type){case 11:case 28:case 2:return this.consumeSimpleBlock(e.type);case 19:return this.consumeFunction(e)}return e},r.prototype.consumeSimpleBlock=function(e){for(var t={type:e,values:[]},n=this.consumeToken();;){if(n.type===32||iG(n,e))return t;this.reconsumeToken(n),t.values.push(this.consumeComponentValue()),n=this.consumeToken()}},r.prototype.consumeFunction=function(e){for(var t={name:e.value,values:[],type:18};;){var n=this.consumeToken();if(n.type===32||n.type===3)return t;this.reconsumeToken(n),t.values.push(this.consumeComponentValue())}},r.prototype.consumeToken=function(){var e=this._tokens.shift();return typeof e>"u"?gp:e},r.prototype.reconsumeToken=function(e){this._tokens.unshift(e)},r})(),XA=function(r){return r.type===15},uu=function(r){return r.type===17},nn=function(r){return r.type===20},pp=function(r,e){return nn(r)&&r.value===e},hu=function(r){return r.type!==31&&r.type!==4},ji=function(r){var e=[],t=[];return r.forEach(function(n){if(n.type===4){if(t.length===0)throw new Error("Error parsing function args, zero tokens for arg");e.push(t),t=[];return}n.type!==31&&t.push(n)}),t.length&&e.push(t),e},iG=function(r,e){return e===11&&r.type===12||e===28&&r.type===29?!0:e===2&&r.type===3},Ha=function(r){return r.type===17||r.type===15},mn=function(r){return r.type===16||Ha(r)},QC=function(r){return r.length>1?[r[0],r[1]]:[r[0]]},Kn={type:17,number:0,flags:jA},vp={type:16,number:50,flags:jA},Ga={type:16,number:100,flags:jA},ZA=function(r,e,t){var n=r[0],i=r[1];return[Nt(n,e),Nt(typeof i<"u"?i:n,t)]},Nt=function(r,e){if(r.type===16)return r.number/100*e;if(XA(r))switch(r.unit){case"rem":case"em":return 16*r.number;default:return r.number}return r.number},UC="deg",PC="grad",RC="rad",DC="turn",du={name:"angle",parse:function(r,e){if(e.type===15)switch(e.unit){case UC:return Math.PI*e.number/180;case PC:return Math.PI/200*e.number;case RC:return e.number;case DC:return Math.PI*2*e.number}throw new Error("Unsupported angle type")}},HC=function(r){return r.type===15&&(r.unit===UC||r.unit===PC||r.unit===RC||r.unit===DC)},GC=function(r){var e=r.filter(nn).map(function(t){return t.value}).join(" ");switch(e){case"to bottom right":case"to right bottom":case"left top":case"top left":return[Kn,Kn];case"to top":case"bottom":return Zr(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[Kn,Ga];case"to right":case"left":return Zr(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[Ga,Ga];case"to bottom":case"top":return Zr(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[Ga,Kn];case"to left":case"right":return Zr(270)}return 0},Zr=function(r){return Math.PI*r/180},Ka={name:"color",parse:function(r,e){if(e.type===18){var t=aG[e.name];if(typeof t>"u")throw new Error('Attempting to parse an unsupported color function "'+e.name+'"');return t(r,e.values)}if(e.type===5){if(e.value.length===3){var n=e.value.substring(0,1),i=e.value.substring(1,2),a=e.value.substring(2,3);return za(parseInt(n+n,16),parseInt(i+i,16),parseInt(a+a,16),1)}if(e.value.length===4){var n=e.value.substring(0,1),i=e.value.substring(1,2),a=e.value.substring(2,3),s=e.value.substring(3,4);return za(parseInt(n+n,16),parseInt(i+i,16),parseInt(a+a,16),parseInt(s+s,16)/255)}if(e.value.length===6){var n=e.value.substring(0,2),i=e.value.substring(2,4),a=e.value.substring(4,6);return za(parseInt(n,16),parseInt(i,16),parseInt(a,16),1)}if(e.value.length===8){var n=e.value.substring(0,2),i=e.value.substring(2,4),a=e.value.substring(4,6),s=e.value.substring(6,8);return za(parseInt(n,16),parseInt(i,16),parseInt(a,16),parseInt(s,16)/255)}}if(e.type===20){var o=JA[e.value.toUpperCase()];if(typeof o<"u")return o}return JA.TRANSPARENT}},Io=function(r){return(255&r)===0},Nn=function(r){var e=255&r,t=255&r>>8,n=255&r>>16,i=255&r>>24;return e<255?"rgba("+i+","+n+","+t+","+e/255+")":"rgb("+i+","+n+","+t+")"},za=function(r,e,t,n){return(r<<24|e<<16|t<<8|Math.round(n*255)<<0)>>>0},KC=function(r,e){if(r.type===17)return r.number;if(r.type===16){var t=e===3?1:255;return e===3?r.number/100*t:Math.round(r.number/100*t)}return 0},zC=function(r,e){var t=e.filter(hu);if(t.length===3){var n=t.map(KC),i=n[0],a=n[1],s=n[2];return za(i,a,s,1)}if(t.length===4){var o=t.map(KC),i=o[0],a=o[1],s=o[2],A=o[3];return za(i,a,s,A)}return 0};function yp(r,e,t){return t<0&&(t+=1),t>=1&&(t-=1),t<1/6?(e-r)*t*6+r:t<1/2?e:t<2/3?(e-r)*6*(2/3-t)+r:r}var VC=function(r,e){var t=e.filter(hu),n=t[0],i=t[1],a=t[2],s=t[3],o=(n.type===17?Zr(n.number):du.parse(r,n))/(Math.PI*2),A=mn(i)?i.number/100:0,l=mn(a)?a.number/100:0,c=typeof s<"u"&&mn(s)?Nt(s,1):1;if(A===0)return za(l*255,l*255,l*255,1);var u=l<=.5?l*(A+1):l+A-l*A,h=l*2-u,d=yp(h,u,o+1/3),f=yp(h,u,o),g=yp(h,u,o-1/3);return za(d*255,f*255,g*255,c)},aG={hsl:VC,hsla:VC,rgb:zC,rgba:zC},jC=function(r,e){return Ka.parse(r,LC.create(e).parseComponentValue())},JA={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},sG={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(r,e){return e.map(function(t){if(nn(t))switch(t.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},oG={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},fu=function(r,e){var t=Ka.parse(r,e[0]),n=e[1];return n&&mn(n)?{color:t,stop:n}:{color:t,stop:null}},WC=function(r,e){var t=r[0],n=r[r.length-1];t.stop===null&&(t.stop=Kn),n.stop===null&&(n.stop=Ga);for(var i=[],a=0,s=0;s<r.length;s++){var o=r[s].stop;if(o!==null){var A=Nt(o,e);A>a?i.push(A):i.push(a),a=A}else i.push(null)}for(var l=null,s=0;s<i.length;s++){var c=i[s];if(c===null)l===null&&(l=s);else if(l!==null){for(var u=s-l,h=i[l-1],d=(c-h)/(u+1),f=1;f<=u;f++)i[l+f-1]=d*f;l=null}}return r.map(function(g,p){var v=g.color;return{color:v,stop:Math.max(Math.min(1,i[p]/e),0)}})},AG=function(r,e,t){var n=e/2,i=t/2,a=Nt(r[0],e)-n,s=i-Nt(r[1],t);return(Math.atan2(s,a)+Math.PI*2)%(Math.PI*2)},lG=function(r,e,t){var n=typeof r=="number"?r:AG(r,e,t),i=Math.abs(e*Math.sin(n))+Math.abs(t*Math.cos(n)),a=e/2,s=t/2,o=i/2,A=Math.sin(n-Math.PI/2)*o,l=Math.cos(n-Math.PI/2)*o;return[i,a-l,a+l,s-A,s+A]},yi=function(r,e){return Math.sqrt(r*r+e*e)},qC=function(r,e,t,n,i){var a=[[0,0],[0,e],[r,0],[r,e]];return a.reduce(function(s,o){var A=o[0],l=o[1],c=yi(t-A,n-l);return(i?c<s.optimumDistance:c>s.optimumDistance)?{optimumCorner:o,optimumDistance:c}:s},{optimumDistance:i?1/0:-1/0,optimumCorner:null}).optimumCorner},cG=function(r,e,t,n,i){var a=0,s=0;switch(r.size){case 0:r.shape===0?a=s=Math.min(Math.abs(e),Math.abs(e-n),Math.abs(t),Math.abs(t-i)):r.shape===1&&(a=Math.min(Math.abs(e),Math.abs(e-n)),s=Math.min(Math.abs(t),Math.abs(t-i)));break;case 2:if(r.shape===0)a=s=Math.min(yi(e,t),yi(e,t-i),yi(e-n,t),yi(e-n,t-i));else if(r.shape===1){var o=Math.min(Math.abs(t),Math.abs(t-i))/Math.min(Math.abs(e),Math.abs(e-n)),A=qC(n,i,e,t,!0),l=A[0],c=A[1];a=yi(l-e,(c-t)/o),s=o*a}break;case 1:r.shape===0?a=s=Math.max(Math.abs(e),Math.abs(e-n),Math.abs(t),Math.abs(t-i)):r.shape===1&&(a=Math.max(Math.abs(e),Math.abs(e-n)),s=Math.max(Math.abs(t),Math.abs(t-i)));break;case 3:if(r.shape===0)a=s=Math.max(yi(e,t),yi(e,t-i),yi(e-n,t),yi(e-n,t-i));else if(r.shape===1){var o=Math.max(Math.abs(t),Math.abs(t-i))/Math.max(Math.abs(e),Math.abs(e-n)),u=qC(n,i,e,t,!1),l=u[0],c=u[1];a=yi(l-e,(c-t)/o),s=o*a}break}return Array.isArray(r.size)&&(a=Nt(r.size[0],n),s=r.size.length===2?Nt(r.size[1],i):a),[a,s]},uG=function(r,e){var t=Zr(180),n=[];return ji(e).forEach(function(i,a){if(a===0){var s=i[0];if(s.type===20&&s.value==="to"){t=GC(i);return}else if(HC(s)){t=du.parse(r,s);return}}var o=fu(r,i);n.push(o)}),{angle:t,stops:n,type:1}},gu=function(r,e){var t=Zr(180),n=[];return ji(e).forEach(function(i,a){if(a===0){var s=i[0];if(s.type===20&&["top","left","right","bottom"].indexOf(s.value)!==-1){t=GC(i);return}else if(HC(s)){t=(du.parse(r,s)+Zr(270))%Zr(360);return}}var o=fu(r,i);n.push(o)}),{angle:t,stops:n,type:1}},hG=function(r,e){var t=Zr(180),n=[],i=1,a=0,s=3,o=[];return ji(e).forEach(function(A,l){var c=A[0];if(l===0){if(nn(c)&&c.value==="linear"){i=1;return}else if(nn(c)&&c.value==="radial"){i=2;return}}if(c.type===18){if(c.name==="from"){var u=Ka.parse(r,c.values[0]);n.push({stop:Kn,color:u})}else if(c.name==="to"){var u=Ka.parse(r,c.values[0]);n.push({stop:Ga,color:u})}else if(c.name==="color-stop"){var h=c.values.filter(hu);if(h.length===2){var u=Ka.parse(r,h[1]),d=h[0];uu(d)&&n.push({stop:{type:16,number:d.number*100,flags:d.flags},color:u})}}}}),i===1?{angle:(t+Zr(180))%Zr(360),stops:n,type:i}:{size:s,shape:a,stops:n,position:o,type:i}},$C="closest-side",YC="farthest-side",XC="closest-corner",ZC="farthest-corner",JC="circle",e2="ellipse",t2="cover",n2="contain",dG=function(r,e){var t=0,n=3,i=[],a=[];return ji(e).forEach(function(s,o){var A=!0;if(o===0){var l=!1;A=s.reduce(function(u,h){if(l)if(nn(h))switch(h.value){case"center":return a.push(vp),u;case"top":case"left":return a.push(Kn),u;case"right":case"bottom":return a.push(Ga),u}else(mn(h)||Ha(h))&&a.push(h);else if(nn(h))switch(h.value){case JC:return t=0,!1;case e2:return t=1,!1;case"at":return l=!0,!1;case $C:return n=0,!1;case t2:case YC:return n=1,!1;case n2:case XC:return n=2,!1;case ZC:return n=3,!1}else if(Ha(h)||mn(h))return Array.isArray(n)||(n=[]),n.push(h),!1;return u},A)}if(A){var c=fu(r,s);i.push(c)}}),{size:n,shape:t,stops:i,position:a,type:2}},pu=function(r,e){var t=0,n=3,i=[],a=[];return ji(e).forEach(function(s,o){var A=!0;if(o===0?A=s.reduce(function(c,u){if(nn(u))switch(u.value){case"center":return a.push(vp),!1;case"top":case"left":return a.push(Kn),!1;case"right":case"bottom":return a.push(Ga),!1}else if(mn(u)||Ha(u))return a.push(u),!1;return c},A):o===1&&(A=s.reduce(function(c,u){if(nn(u))switch(u.value){case JC:return t=0,!1;case e2:return t=1,!1;case n2:case $C:return n=0,!1;case YC:return n=1,!1;case XC:return n=2,!1;case t2:case ZC:return n=3,!1}else if(Ha(u)||mn(u))return Array.isArray(n)||(n=[]),n.push(u),!1;return c},A)),A){var l=fu(r,s);i.push(l)}}),{size:n,shape:t,stops:i,position:a,type:2}},fG=function(r){return r.type===1},gG=function(r){return r.type===2},mp={name:"image",parse:function(r,e){if(e.type===22){var t={url:e.value,type:0};return r.cache.addImage(e.value),t}if(e.type===18){var n=r2[e.name];if(typeof n>"u")throw new Error('Attempting to parse an unsupported image function "'+e.name+'"');return n(r,e.values)}throw new Error("Unsupported image type "+e.type)}};function pG(r){return!(r.type===20&&r.value==="none")&&(r.type!==18||!!r2[r.name])}var r2={"linear-gradient":uG,"-moz-linear-gradient":gu,"-ms-linear-gradient":gu,"-o-linear-gradient":gu,"-webkit-linear-gradient":gu,"radial-gradient":dG,"-moz-radial-gradient":pu,"-ms-radial-gradient":pu,"-o-radial-gradient":pu,"-webkit-radial-gradient":pu,"-webkit-gradient":hG},vG={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(r,e){if(e.length===0)return[];var t=e[0];return t.type===20&&t.value==="none"?[]:e.filter(function(n){return hu(n)&&pG(n)}).map(function(n){return mp.parse(r,n)})}},yG={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(r,e){return e.map(function(t){if(nn(t))switch(t.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},mG={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(r,e){return ji(e).map(function(t){return t.filter(mn)}).map(QC)}},wG={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(r,e){return ji(e).map(function(t){return t.filter(nn).map(function(n){return n.value}).join(" ")}).map(BG)}},BG=function(r){switch(r){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;default:return 0}},_o;(function(r){r.AUTO="auto",r.CONTAIN="contain",r.COVER="cover"})(_o||(_o={}));var bG={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(r,e){return ji(e).map(function(t){return t.filter(EG)})}},EG=function(r){return nn(r)||mn(r)},vu=function(r){return{name:"border-"+r+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},xG=vu("top"),CG=vu("right"),SG=vu("bottom"),FG=vu("left"),yu=function(r){return{name:"border-radius-"+r,initialValue:"0 0",prefix:!1,type:1,parse:function(e,t){return QC(t.filter(mn))}}},TG=yu("top-left"),MG=yu("top-right"),OG=yu("bottom-right"),IG=yu("bottom-left"),mu=function(r){return{name:"border-"+r+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(e,t){switch(t){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},_G=mu("top"),kG=mu("right"),NG=mu("bottom"),LG=mu("left"),wu=function(r){return{name:"border-"+r+"-width",initialValue:"0",type:0,prefix:!1,parse:function(e,t){return XA(t)?t.number:0}}},QG=wu("top"),UG=wu("right"),PG=wu("bottom"),RG=wu("left"),DG={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},HG={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(r,e){return e==="rtl"?1:0}},GG={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(r,e){return e.filter(nn).reduce(function(t,n){return t|KG(n.value)},0)}},KG=function(r){switch(r){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},zG={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(r,e){switch(e){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},VG={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(r,e){return e.type===20&&e.value==="normal"?0:e.type===17||e.type===15?e.number:0}},Bu;(function(r){r.NORMAL="normal",r.STRICT="strict"})(Bu||(Bu={}));var jG={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(r,e){return e==="strict"?Bu.STRICT:Bu.NORMAL}},WG={name:"line-height",initialValue:"normal",prefix:!1,type:4},i2=function(r,e){return nn(r)&&r.value==="normal"?1.2*e:r.type===17?e*r.number:mn(r)?Nt(r,e):e},qG={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(r,e){return e.type===20&&e.value==="none"?null:mp.parse(r,e)}},$G={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(r,e){return e==="inside"?0:1}},YG={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(r,e){switch(e){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":return 22;case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;default:return-1}}},bu=function(r){return{name:"margin-"+r,initialValue:"0",prefix:!1,type:4}},XG=bu("top"),ZG=bu("right"),JG=bu("bottom"),eK=bu("left"),tK={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(r,e){return e.filter(nn).map(function(t){switch(t.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;default:return 0}})}},nK={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(r,e){return e==="break-word"?"break-word":"normal"}},Eu=function(r){return{name:"padding-"+r,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},rK=Eu("top"),iK=Eu("right"),aK=Eu("bottom"),sK=Eu("left"),oK={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(r,e){switch(e){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},AK={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(r,e){switch(e){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},lK={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(r,e){return e.length===1&&pp(e[0],"none")?[]:ji(e).map(function(t){for(var n={color:JA.TRANSPARENT,offsetX:Kn,offsetY:Kn,blur:Kn},i=0,a=0;a<t.length;a++){var s=t[a];Ha(s)?(i===0?n.offsetX=s:i===1?n.offsetY=s:n.blur=s,i++):n.color=Ka.parse(r,s)}return n})}},cK={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(r,e){switch(e){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},uK={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(r,e){if(e.type===20&&e.value==="none")return null;if(e.type===18){var t=fK[e.name];if(typeof t>"u")throw new Error('Attempting to parse an unsupported transform function "'+e.name+'"');return t(e.values)}return null}},hK=function(r){var e=r.filter(function(t){return t.type===17}).map(function(t){return t.number});return e.length===6?e:null},dK=function(r){var e=r.filter(function(A){return A.type===17}).map(function(A){return A.number}),t=e[0],n=e[1];e[2],e[3];var i=e[4],a=e[5];e[6],e[7],e[8],e[9],e[10],e[11];var s=e[12],o=e[13];return e[14],e[15],e.length===16?[t,n,i,a,s,o]:null},fK={matrix:hK,matrix3d:dK},a2={type:16,number:50,flags:jA},gK=[a2,a2],pK={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(r,e){var t=e.filter(mn);return t.length!==2?gK:[t[0],t[1]]}},vK={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(r,e){switch(e){case"hidden":return 1;case"collapse":return 2;default:return 0}}},el;(function(r){r.NORMAL="normal",r.BREAK_ALL="break-all",r.KEEP_ALL="keep-all"})(el||(el={}));for(var yK={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(r,e){switch(e){case"break-all":return el.BREAK_ALL;case"keep-all":return el.KEEP_ALL;default:return el.NORMAL}}},mK={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(r,e){if(e.type===20)return{auto:!0,order:0};if(uu(e))return{auto:!1,order:e.number};throw new Error("Invalid z-index number parsed")}},s2={name:"time",parse:function(r,e){if(e.type===15)switch(e.unit.toLowerCase()){case"s":return 1e3*e.number;case"ms":return e.number}throw new Error("Unsupported time type")}},wK={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(r,e){return uu(e)?e.number:1}},BK={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},bK={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(r,e){return e.filter(nn).map(function(t){switch(t.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(t){return t!==0})}},EK={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(r,e){var t=[],n=[];return e.forEach(function(i){switch(i.type){case 20:case 0:t.push(i.value);break;case 17:t.push(i.number.toString());break;case 4:n.push(t.join(" ")),t.length=0;break}}),t.length&&n.push(t.join(" ")),n.map(function(i){return i.indexOf(" ")===-1?i:"'"+i+"'"})}},xK={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},CK={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(r,e){return uu(e)?e.number:nn(e)&&e.value==="bold"?700:400}},SK={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(r,e){return e.filter(nn).map(function(t){return t.value})}},FK={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(r,e){switch(e){case"oblique":return"oblique";case"italic":return"italic";default:return"normal"}}},Sn=function(r,e){return(r&e)!==0},TK={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(r,e){return e.filter(XA).map(function(t){return s2.parse(r,t)})}},MK={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(r,e){return e.length===1&&pp(e[0],"none")?[]:ji(e).map(function(t){for(var n={color:255,offsetX:Kn,offsetY:Kn,blur:Kn,spread:Kn,inset:!1},i=0,a=0;a<t.length;a++){var s=t[a];pp(s,"inset")?n.inset=!0:Ha(s)?(i===0?n.offsetX=s:i===1?n.offsetY=s:i===2?n.blur=s:n.spread=s,i++):n.color=Ka.parse(r,s)}return n})}},OK={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(r,e){var t=[0,1,2],n=[];return e.filter(nn).forEach(function(i){switch(i.value){case"stroke":n.push(1);break;case"fill":n.push(0);break;case"markers":n.push(2);break}}),t.forEach(function(i){n.indexOf(i)===-1&&n.push(i)}),n}},IK={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},_K={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(r,e){return XA(e)?e.number:0}},kK=(function(){function r(e,t){var n,i;this.animationDuration=_e(e,TK,t.animationDuration),this.backgroundClip=_e(e,sG,t.backgroundClip),this.backgroundColor=_e(e,oG,t.backgroundColor),this.backgroundImage=_e(e,vG,t.backgroundImage),this.backgroundOrigin=_e(e,yG,t.backgroundOrigin),this.backgroundPosition=_e(e,mG,t.backgroundPosition),this.backgroundRepeat=_e(e,wG,t.backgroundRepeat),this.backgroundSize=_e(e,bG,t.backgroundSize),this.borderTopColor=_e(e,xG,t.borderTopColor),this.borderRightColor=_e(e,CG,t.borderRightColor),this.borderBottomColor=_e(e,SG,t.borderBottomColor),this.borderLeftColor=_e(e,FG,t.borderLeftColor),this.borderTopLeftRadius=_e(e,TG,t.borderTopLeftRadius),this.borderTopRightRadius=_e(e,MG,t.borderTopRightRadius),this.borderBottomRightRadius=_e(e,OG,t.borderBottomRightRadius),this.borderBottomLeftRadius=_e(e,IG,t.borderBottomLeftRadius),this.borderTopStyle=_e(e,_G,t.borderTopStyle),this.borderRightStyle=_e(e,kG,t.borderRightStyle),this.borderBottomStyle=_e(e,NG,t.borderBottomStyle),this.borderLeftStyle=_e(e,LG,t.borderLeftStyle),this.borderTopWidth=_e(e,QG,t.borderTopWidth),this.borderRightWidth=_e(e,UG,t.borderRightWidth),this.borderBottomWidth=_e(e,PG,t.borderBottomWidth),this.borderLeftWidth=_e(e,RG,t.borderLeftWidth),this.boxShadow=_e(e,MK,t.boxShadow),this.color=_e(e,DG,t.color),this.direction=_e(e,HG,t.direction),this.display=_e(e,GG,t.display),this.float=_e(e,zG,t.cssFloat),this.fontFamily=_e(e,EK,t.fontFamily),this.fontSize=_e(e,xK,t.fontSize),this.fontStyle=_e(e,FK,t.fontStyle),this.fontVariant=_e(e,SK,t.fontVariant),this.fontWeight=_e(e,CK,t.fontWeight),this.letterSpacing=_e(e,VG,t.letterSpacing),this.lineBreak=_e(e,jG,t.lineBreak),this.lineHeight=_e(e,WG,t.lineHeight),this.listStyleImage=_e(e,qG,t.listStyleImage),this.listStylePosition=_e(e,$G,t.listStylePosition),this.listStyleType=_e(e,YG,t.listStyleType),this.marginTop=_e(e,XG,t.marginTop),this.marginRight=_e(e,ZG,t.marginRight),this.marginBottom=_e(e,JG,t.marginBottom),this.marginLeft=_e(e,eK,t.marginLeft),this.opacity=_e(e,wK,t.opacity);var a=_e(e,tK,t.overflow);this.overflowX=a[0],this.overflowY=a[a.length>1?1:0],this.overflowWrap=_e(e,nK,t.overflowWrap),this.paddingTop=_e(e,rK,t.paddingTop),this.paddingRight=_e(e,iK,t.paddingRight),this.paddingBottom=_e(e,aK,t.paddingBottom),this.paddingLeft=_e(e,sK,t.paddingLeft),this.paintOrder=_e(e,OK,t.paintOrder),this.position=_e(e,AK,t.position),this.textAlign=_e(e,oK,t.textAlign),this.textDecorationColor=_e(e,BK,(n=t.textDecorationColor)!==null&&n!==void 0?n:t.color),this.textDecorationLine=_e(e,bK,(i=t.textDecorationLine)!==null&&i!==void 0?i:t.textDecoration),this.textShadow=_e(e,lK,t.textShadow),this.textTransform=_e(e,cK,t.textTransform),this.transform=_e(e,uK,t.transform),this.transformOrigin=_e(e,pK,t.transformOrigin),this.visibility=_e(e,vK,t.visibility),this.webkitTextStrokeColor=_e(e,IK,t.webkitTextStrokeColor),this.webkitTextStrokeWidth=_e(e,_K,t.webkitTextStrokeWidth),this.wordBreak=_e(e,yK,t.wordBreak),this.zIndex=_e(e,mK,t.zIndex)}return r.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&this.visibility===0},r.prototype.isTransparent=function(){return Io(this.backgroundColor)},r.prototype.isTransformed=function(){return this.transform!==null},r.prototype.isPositioned=function(){return this.position!==0},r.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},r.prototype.isFloating=function(){return this.float!==0},r.prototype.isInlineLevel=function(){return Sn(this.display,4)||Sn(this.display,33554432)||Sn(this.display,268435456)||Sn(this.display,536870912)||Sn(this.display,67108864)||Sn(this.display,134217728)},r})(),_e=function(r,e,t){var n=new NC,i=t!==null&&typeof t<"u"?t.toString():e.initialValue;n.write(i);var a=new LC(n.read());switch(e.type){case 2:var s=a.parseComponentValue();return e.parse(r,nn(s)?s.value:e.initialValue);case 0:return e.parse(r,a.parseComponentValue());case 1:return e.parse(r,a.parseComponentValues());case 4:return a.parseComponentValue();case 3:switch(e.format){case"angle":return du.parse(r,a.parseComponentValue());case"color":return Ka.parse(r,a.parseComponentValue());case"image":return mp.parse(r,a.parseComponentValue());case"length":var o=a.parseComponentValue();return Ha(o)?o:Kn;case"length-percentage":var A=a.parseComponentValue();return mn(A)?A:Kn;case"time":return s2.parse(r,a.parseComponentValue())}break}},NK="data-html2canvas-debug",LK=function(r){var e=r.getAttribute(NK);switch(e){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},o2=function(r,e){var t=LK(r);return t===1||e===t},Wi=(function(){function r(e,t){if(this.context=e,this.textNodes=[],this.elements=[],this.flags=0,o2(t,3))debugger;this.styles=new kK(e,window.getComputedStyle(t,null)),Lz(t)&&(this.styles.animationDuration.some(function(n){return n>0})&&(t.style.animationDuration="0s"),this.styles.transform!==null&&(t.style.transform="none")),this.bounds=Yg(this.context,t),o2(t,4)&&(this.flags|=16)}return r})(),QK="AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=",A2="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",tl=typeof Uint8Array>"u"?[]:new Uint8Array(256),xu=0;xu<A2.length;xu++)tl[A2.charCodeAt(xu)]=xu;for(var UK=function(r){var e=r.length*.75,t=r.length,n,i=0,a,s,o,A;r[r.length-1]==="="&&(e--,r[r.length-2]==="="&&e--);var l=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(e):new Array(e),c=Array.isArray(l)?l:new Uint8Array(l);for(n=0;n<t;n+=4)a=tl[r.charCodeAt(n)],s=tl[r.charCodeAt(n+1)],o=tl[r.charCodeAt(n+2)],A=tl[r.charCodeAt(n+3)],c[i++]=a<<2|s>>4,c[i++]=(s&15)<<4|o>>2,c[i++]=(o&3)<<6|A&63;return l},PK=function(r){for(var e=r.length,t=[],n=0;n<e;n+=2)t.push(r[n+1]<<8|r[n]);return t},RK=function(r){for(var e=r.length,t=[],n=0;n<e;n+=4)t.push(r[n+3]<<24|r[n+2]<<16|r[n+1]<<8|r[n]);return t},Ps=5,wp=11,Bp=2,DK=wp-Ps,l2=65536>>Ps,HK=1<<Ps,bp=HK-1,GK=1024>>Ps,KK=l2+GK,zK=KK,VK=32,jK=zK+VK,WK=65536>>wp,qK=1<<DK,$K=qK-1,c2=function(r,e,t){return r.slice?r.slice(e,t):new Uint16Array(Array.prototype.slice.call(r,e,t))},YK=function(r,e,t){return r.slice?r.slice(e,t):new Uint32Array(Array.prototype.slice.call(r,e,t))},XK=function(r,e){var t=UK(r),n=Array.isArray(t)?RK(t):new Uint32Array(t),i=Array.isArray(t)?PK(t):new Uint16Array(t),a=24,s=c2(i,a/2,n[4]/2),o=n[5]===2?c2(i,(a+n[4])/2):YK(n,Math.ceil((a+n[4])/4));return new ZK(n[0],n[1],n[2],n[3],s,o)},ZK=(function(){function r(e,t,n,i,a,s){this.initialValue=e,this.errorValue=t,this.highStart=n,this.highValueIndex=i,this.index=a,this.data=s}return r.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=this.index[e>>Ps],t=(t<<Bp)+(e&bp),this.data[t];if(e<=65535)return t=this.index[l2+(e-55296>>Ps)],t=(t<<Bp)+(e&bp),this.data[t];if(e<this.highStart)return t=jK-WK+(e>>wp),t=this.index[t],t+=e>>Ps&$K,t=this.index[t],t=(t<<Bp)+(e&bp),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},r})(),u2="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",JK=typeof Uint8Array>"u"?[]:new Uint8Array(256),Cu=0;Cu<u2.length;Cu++)JK[u2.charCodeAt(Cu)]=Cu;var ez=1,Ep=2,xp=3,h2=4,d2=5,tz=7,f2=8,Cp=9,Sp=10,g2=11,p2=12,v2=13,y2=14,Fp=15,nz=function(r){for(var e=[],t=0,n=r.length;t<n;){var i=r.charCodeAt(t++);if(i>=55296&&i<=56319&&t<n){var a=r.charCodeAt(t++);(a&64512)===56320?e.push(((i&1023)<<10)+(a&1023)+65536):(e.push(i),t--)}else e.push(i)}return e},rz=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,r);var t=r.length;if(!t)return"";for(var n=[],i=-1,a="";++i<t;){var s=r[i];s<=65535?n.push(s):(s-=65536,n.push((s>>10)+55296,s%1024+56320)),(i+1===t||n.length>16384)&&(a+=String.fromCharCode.apply(String,n),n.length=0)}return a},iz=XK(QK),Jr="×",Tp="÷",az=function(r){return iz.get(r)},sz=function(r,e,t){var n=t-2,i=e[n],a=e[t-1],s=e[t];if(a===Ep&&s===xp)return Jr;if(a===Ep||a===xp||a===h2||s===Ep||s===xp||s===h2)return Tp;if(a===f2&&[f2,Cp,g2,p2].indexOf(s)!==-1||(a===g2||a===Cp)&&(s===Cp||s===Sp)||(a===p2||a===Sp)&&s===Sp||s===v2||s===d2||s===tz||a===ez)return Jr;if(a===v2&&s===y2){for(;i===d2;)i=e[--n];if(i===y2)return Jr}if(a===Fp&&s===Fp){for(var o=0;i===Fp;)o++,i=e[--n];if(o%2===0)return Jr}return Tp},oz=function(r){var e=nz(r),t=e.length,n=0,i=0,a=e.map(az);return{next:function(){if(n>=t)return{done:!0,value:null};for(var s=Jr;n<t&&(s=sz(e,a,++n))===Jr;);if(s!==Jr||n===t){var o=rz.apply(null,e.slice(i,n));return i=n,{value:o,done:!1}}return{done:!0,value:null}}}},Az=function(r){for(var e=oz(r),t=[],n;!(n=e.next()).done;)n.value&&t.push(n.value.slice());return t},lz=function(r){var e=123;if(r.createRange){var t=r.createRange();if(t.getBoundingClientRect){var n=r.createElement("boundtest");n.style.height=e+"px",n.style.display="block",r.body.appendChild(n),t.selectNode(n);var i=t.getBoundingClientRect(),a=Math.round(i.height);if(r.body.removeChild(n),a===e)return!0}}return!1},cz=function(r){var e=r.createElement("boundtest");e.style.width="50px",e.style.display="block",e.style.fontSize="12px",e.style.letterSpacing="0px",e.style.wordSpacing="0px",r.body.appendChild(e);var t=r.createRange();e.innerHTML=typeof"".repeat=="function"?"&#128104;".repeat(10):"";var n=e.firstChild,i=jc(n.data).map(function(A){return cn(A)}),a=0,s={},o=i.every(function(A,l){t.setStart(n,a),t.setEnd(n,a+A.length);var c=t.getBoundingClientRect();a+=A.length;var u=c.x>s.x||c.y>s.y;return s=c,l===0?!0:u});return r.body.removeChild(e),o},uz=function(){return typeof new Image().crossOrigin<"u"},hz=function(){return typeof new XMLHttpRequest().responseType=="string"},dz=function(r){var e=new Image,t=r.createElement("canvas"),n=t.getContext("2d");if(!n)return!1;e.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{n.drawImage(e,0,0),t.toDataURL()}catch{return!1}return!0},m2=function(r){return r[0]===0&&r[1]===255&&r[2]===0&&r[3]===255},fz=function(r){var e=r.createElement("canvas"),t=100;e.width=t,e.height=t;var n=e.getContext("2d");if(!n)return Promise.reject(!1);n.fillStyle="rgb(0, 255, 0)",n.fillRect(0,0,t,t);var i=new Image,a=e.toDataURL();i.src=a;var s=Mp(t,t,0,0,i);return n.fillStyle="red",n.fillRect(0,0,t,t),w2(s).then(function(o){n.drawImage(o,0,0);var A=n.getImageData(0,0,t,t).data;n.fillStyle="red",n.fillRect(0,0,t,t);var l=r.createElement("div");return l.style.backgroundImage="url("+a+")",l.style.height=t+"px",m2(A)?w2(Mp(t,t,0,0,l)):Promise.reject(!1)}).then(function(o){return n.drawImage(o,0,0),m2(n.getImageData(0,0,t,t).data)}).catch(function(){return!1})},Mp=function(r,e,t,n,i){var a="http://www.w3.org/2000/svg",s=document.createElementNS(a,"svg"),o=document.createElementNS(a,"foreignObject");return s.setAttributeNS(null,"width",r.toString()),s.setAttributeNS(null,"height",e.toString()),o.setAttributeNS(null,"width","100%"),o.setAttributeNS(null,"height","100%"),o.setAttributeNS(null,"x",t.toString()),o.setAttributeNS(null,"y",n.toString()),o.setAttributeNS(null,"externalResourcesRequired","true"),s.appendChild(o),o.appendChild(i),s},w2=function(r){return new Promise(function(e,t){var n=new Image;n.onload=function(){return e(n)},n.onerror=t,n.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(r))})},Rr={get SUPPORT_RANGE_BOUNDS(){var r=lz(document);return Object.defineProperty(Rr,"SUPPORT_RANGE_BOUNDS",{value:r}),r},get SUPPORT_WORD_BREAKING(){var r=Rr.SUPPORT_RANGE_BOUNDS&&cz(document);return Object.defineProperty(Rr,"SUPPORT_WORD_BREAKING",{value:r}),r},get SUPPORT_SVG_DRAWING(){var r=dz(document);return Object.defineProperty(Rr,"SUPPORT_SVG_DRAWING",{value:r}),r},get SUPPORT_FOREIGNOBJECT_DRAWING(){var r=typeof Array.from=="function"&&typeof window.fetch=="function"?fz(document):Promise.resolve(!1);return Object.defineProperty(Rr,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:r}),r},get SUPPORT_CORS_IMAGES(){var r=uz();return Object.defineProperty(Rr,"SUPPORT_CORS_IMAGES",{value:r}),r},get SUPPORT_RESPONSE_TYPE(){var r=hz();return Object.defineProperty(Rr,"SUPPORT_RESPONSE_TYPE",{value:r}),r},get SUPPORT_CORS_XHR(){var r="withCredentials"in new XMLHttpRequest;return Object.defineProperty(Rr,"SUPPORT_CORS_XHR",{value:r}),r},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var r=!!(typeof Intl<"u"&&Intl.Segmenter);return Object.defineProperty(Rr,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:r}),r}},nl=(function(){function r(e,t){this.text=e,this.bounds=t}return r})(),gz=function(r,e,t,n){var i=yz(e,t),a=[],s=0;return i.forEach(function(o){if(t.textDecorationLine.length||o.trim().length>0)if(Rr.SUPPORT_RANGE_BOUNDS){var A=B2(n,s,o.length).getClientRects();if(A.length>1){var l=Op(o),c=0;l.forEach(function(h){a.push(new nl(h,Ns.fromDOMRectList(r,B2(n,c+s,h.length).getClientRects()))),c+=h.length})}else a.push(new nl(o,Ns.fromDOMRectList(r,A)))}else{var u=n.splitText(o.length);a.push(new nl(o,pz(r,n))),n=u}else Rr.SUPPORT_RANGE_BOUNDS||(n=n.splitText(o.length));s+=o.length}),a},pz=function(r,e){var t=e.ownerDocument;if(t){var n=t.createElement("html2canvaswrapper");n.appendChild(e.cloneNode(!0));var i=e.parentNode;if(i){i.replaceChild(n,e);var a=Yg(r,n);return n.firstChild&&i.replaceChild(n.firstChild,n),a}}return Ns.EMPTY},B2=function(r,e,t){var n=r.ownerDocument;if(!n)throw new Error("Node has no owner document");var i=n.createRange();return i.setStart(r,e),i.setEnd(r,e+t),i},Op=function(r){if(Rr.SUPPORT_NATIVE_TEXT_SEGMENTATION){var e=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(e.segment(r)).map(function(t){return t.segment})}return Az(r)},vz=function(r,e){if(Rr.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(t.segment(r)).map(function(n){return n.segment})}return wz(r,e)},yz=function(r,e){return e.letterSpacing!==0?Op(r):vz(r,e)},mz=[32,160,4961,65792,65793,4153,4241],wz=function(r,e){for(var t=Z6(r,{lineBreak:e.lineBreak,wordBreak:e.overflowWrap==="break-word"?"break-word":e.wordBreak}),n=[],i,a=function(){if(i.value){var s=i.value.slice(),o=jc(s),A="";o.forEach(function(l){mz.indexOf(l)===-1?A+=cn(l):(A.length&&n.push(A),n.push(cn(l)),A="")}),A.length&&n.push(A)}};!(i=t.next()).done;)a();return n},Bz=(function(){function r(e,t,n){this.text=bz(t.data,n.textTransform),this.textBounds=gz(e,this.text,n,t)}return r})(),bz=function(r,e){switch(e){case 1:return r.toLowerCase();case 3:return r.replace(Ez,xz);case 2:return r.toUpperCase();default:return r}},Ez=/(^|\s|:|-|\(|\))([a-z])/g,xz=function(r,e,t){return r.length>0?e+t.toUpperCase():r},b2=(function(r){vi(e,r);function e(t,n){var i=r.call(this,t,n)||this;return i.src=n.currentSrc||n.src,i.intrinsicWidth=n.naturalWidth,i.intrinsicHeight=n.naturalHeight,i.context.cache.addImage(i.src),i}return e})(Wi),E2=(function(r){vi(e,r);function e(t,n){var i=r.call(this,t,n)||this;return i.canvas=n,i.intrinsicWidth=n.width,i.intrinsicHeight=n.height,i}return e})(Wi),x2=(function(r){vi(e,r);function e(t,n){var i=r.call(this,t,n)||this,a=new XMLSerializer,s=Yg(t,n);return n.setAttribute("width",s.width+"px"),n.setAttribute("height",s.height+"px"),i.svg="data:image/svg+xml,"+encodeURIComponent(a.serializeToString(n)),i.intrinsicWidth=n.width.baseVal.value,i.intrinsicHeight=n.height.baseVal.value,i.context.cache.addImage(i.svg),i}return e})(Wi),C2=(function(r){vi(e,r);function e(t,n){var i=r.call(this,t,n)||this;return i.value=n.value,i}return e})(Wi),Ip=(function(r){vi(e,r);function e(t,n){var i=r.call(this,t,n)||this;return i.start=n.start,i.reversed=typeof n.reversed=="boolean"&&n.reversed===!0,i}return e})(Wi),Cz=[{type:15,flags:0,unit:"px",number:3}],Sz=[{type:16,flags:0,number:50}],Fz=function(r){return r.width>r.height?new Ns(r.left+(r.width-r.height)/2,r.top,r.height,r.height):r.width<r.height?new Ns(r.left,r.top+(r.height-r.width)/2,r.width,r.width):r},Tz=function(r){var e=r.type===Mz?new Array(r.value.length+1).join("•"):r.value;return e.length===0?r.placeholder||"":e},Su="checkbox",Fu="radio",Mz="password",S2=707406591,_p=(function(r){vi(e,r);function e(t,n){var i=r.call(this,t,n)||this;switch(i.type=n.type.toLowerCase(),i.checked=n.checked,i.value=Tz(n),(i.type===Su||i.type===Fu)&&(i.styles.backgroundColor=3739148031,i.styles.borderTopColor=i.styles.borderRightColor=i.styles.borderBottomColor=i.styles.borderLeftColor=2779096575,i.styles.borderTopWidth=i.styles.borderRightWidth=i.styles.borderBottomWidth=i.styles.borderLeftWidth=1,i.styles.borderTopStyle=i.styles.borderRightStyle=i.styles.borderBottomStyle=i.styles.borderLeftStyle=1,i.styles.backgroundClip=[0],i.styles.backgroundOrigin=[0],i.bounds=Fz(i.bounds)),i.type){case Su:i.styles.borderTopRightRadius=i.styles.borderTopLeftRadius=i.styles.borderBottomRightRadius=i.styles.borderBottomLeftRadius=Cz;break;case Fu:i.styles.borderTopRightRadius=i.styles.borderTopLeftRadius=i.styles.borderBottomRightRadius=i.styles.borderBottomLeftRadius=Sz;break}return i}return e})(Wi),F2=(function(r){vi(e,r);function e(t,n){var i=r.call(this,t,n)||this,a=n.options[n.selectedIndex||0];return i.value=a&&a.text||"",i}return e})(Wi),T2=(function(r){vi(e,r);function e(t,n){var i=r.call(this,t,n)||this;return i.value=n.value,i}return e})(Wi),M2=(function(r){vi(e,r);function e(t,n){var i=r.call(this,t,n)||this;i.src=n.src,i.width=parseInt(n.width,10)||0,i.height=parseInt(n.height,10)||0,i.backgroundColor=i.styles.backgroundColor;try{if(n.contentWindow&&n.contentWindow.document&&n.contentWindow.document.documentElement){i.tree=Iz(t,n.contentWindow.document.documentElement);var a=n.contentWindow.document.documentElement?jC(t,getComputedStyle(n.contentWindow.document.documentElement).backgroundColor):JA.TRANSPARENT,s=n.contentWindow.document.body?jC(t,getComputedStyle(n.contentWindow.document.body).backgroundColor):JA.TRANSPARENT;i.backgroundColor=Io(a)?Io(s)?i.styles.backgroundColor:s:a}}catch{}return i}return e})(Wi),Oz=["OL","UL","MENU"],Tu=function(r,e,t,n){for(var i=e.firstChild,a=void 0;i;i=a)if(a=i.nextSibling,Nz(i)&&i.data.trim().length>0)t.textNodes.push(new Bz(r,i,t.styles));else if(I2(i))if(zz(i)&&i.assignedNodes)i.assignedNodes().forEach(function(o){return Tu(r,o,t,n)});else{var s=O2(r,i);s.styles.isVisible()&&(_z(i,s,n)?s.flags|=4:kz(s.styles)&&(s.flags|=2),Oz.indexOf(i.tagName)!==-1&&(s.flags|=8),t.elements.push(s),i.slot,i.shadowRoot?Tu(r,i.shadowRoot,s,n):!k2(i)&&!_2(i)&&!N2(i)&&Tu(r,i,s,n))}},O2=function(r,e){return Gz(e)?new b2(r,e):Hz(e)?new E2(r,e):_2(e)?new x2(r,e):Uz(e)?new C2(r,e):Pz(e)?new Ip(r,e):Rz(e)?new _p(r,e):N2(e)?new F2(r,e):k2(e)?new T2(r,e):Kz(e)?new M2(r,e):new Wi(r,e)},Iz=function(r,e){var t=O2(r,e);return t.flags|=4,Tu(r,e,t,t),t},_z=function(r,e,t){return e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||Dz(r)&&t.styles.isTransparent()},kz=function(r){return r.isPositioned()||r.isFloating()},Nz=function(r){return r.nodeType===Node.TEXT_NODE},I2=function(r){return r.nodeType===Node.ELEMENT_NODE},Lz=function(r){return I2(r)&&typeof r.style<"u"&&!Qz(r)},Qz=function(r){return typeof r.className=="object"},Uz=function(r){return r.tagName==="LI"},Pz=function(r){return r.tagName==="OL"},Rz=function(r){return r.tagName==="INPUT"},_2=function(r){return r.tagName==="svg"},Dz=function(r){return r.tagName==="BODY"},Hz=function(r){return r.tagName==="CANVAS"},Gz=function(r){return r.tagName==="IMG"},Kz=function(r){return r.tagName==="IFRAME"},k2=function(r){return r.tagName==="TEXTAREA"},N2=function(r){return r.tagName==="SELECT"},zz=function(r){return r.tagName==="SLOT"},L2={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},Q2={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},Vz={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},jz={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},ko=function(r,e,t,n,i,a){return r<e||r>t?Np(r,i,a.length>0):n.integers.reduce(function(s,o,A){for(;r>=o;)r-=o,s+=n.values[A];return s},"")+a},U2=function(r,e,t,n){var i="";do t||r--,i=n(r)+i,r/=e;while(r*e>=e);return i},un=function(r,e,t,n,i){var a=t-e+1;return(r<0?"-":"")+(U2(Math.abs(r),a,n,function(s){return cn(Math.floor(s%a)+e)})+i)},Rs=function(r,e,t){t===void 0&&(t=". ");var n=e.length;return U2(Math.abs(r),n,!1,function(i){return e[Math.floor(i%n)]})+t},No=1,Va=2,ja=4,rl=8,la=function(r,e,t,n,i,a){if(r<-9999||r>9999)return Np(r,4,i.length>0);var s=Math.abs(r),o=i;if(s===0)return e[0]+o;for(var A=0;s>0&&A<=4;A++){var l=s%10;l===0&&Sn(a,No)&&o!==""?o=e[l]+o:l>1||l===1&&A===0||l===1&&A===1&&Sn(a,Va)||l===1&&A===1&&Sn(a,ja)&&r>100||l===1&&A>1&&Sn(a,rl)?o=e[l]+(A>0?t[A-1]:"")+o:l===1&&A>0&&(o=t[A-1]+o),s=Math.floor(s/10)}return(r<0?n:"")+o},P2="十百千萬",R2="拾佰仟萬",D2="マイナス",kp="마이너스",Np=function(r,e,t){var n=t?". ":"",i=t?"、":"",a=t?", ":"",s=t?" ":"";switch(e){case 0:return"•"+s;case 1:return"◦"+s;case 2:return"◾"+s;case 5:var o=un(r,48,57,!0,n);return o.length<4?"0"+o:o;case 4:return Rs(r,"〇一二三四五六七八九",i);case 6:return ko(r,1,3999,L2,3,n).toLowerCase();case 7:return ko(r,1,3999,L2,3,n);case 8:return un(r,945,969,!1,n);case 9:return un(r,97,122,!1,n);case 10:return un(r,65,90,!1,n);case 11:return un(r,1632,1641,!0,n);case 12:case 49:return ko(r,1,9999,Q2,3,n);case 35:return ko(r,1,9999,Q2,3,n).toLowerCase();case 13:return un(r,2534,2543,!0,n);case 14:case 30:return un(r,6112,6121,!0,n);case 15:return Rs(r,"子丑寅卯辰巳午未申酉戌亥",i);case 16:return Rs(r,"甲乙丙丁戊己庚辛壬癸",i);case 17:case 48:return la(r,"零一二三四五六七八九",P2,"負",i,Va|ja|rl);case 47:return la(r,"零壹貳參肆伍陸柒捌玖",R2,"負",i,No|Va|ja|rl);case 42:return la(r,"零一二三四五六七八九",P2,"负",i,Va|ja|rl);case 41:return la(r,"零壹贰叁肆伍陆柒捌玖",R2,"负",i,No|Va|ja|rl);case 26:return la(r,"〇一二三四五六七八九","十百千万",D2,i,0);case 25:return la(r,"零壱弐参四伍六七八九","拾百千万",D2,i,No|Va|ja);case 31:return la(r,"영일이삼사오육칠팔구","십백천만",kp,a,No|Va|ja);case 33:return la(r,"零一二三四五六七八九","十百千萬",kp,a,0);case 32:return la(r,"零壹貳參四五六七八九","拾百千",kp,a,No|Va|ja);case 18:return un(r,2406,2415,!0,n);case 20:return ko(r,1,19999,jz,3,n);case 21:return un(r,2790,2799,!0,n);case 22:return un(r,2662,2671,!0,n);case 22:return ko(r,1,10999,Vz,3,n);case 23:return Rs(r,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return Rs(r,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return un(r,3302,3311,!0,n);case 28:return Rs(r,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",i);case 29:return Rs(r,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",i);case 34:return un(r,3792,3801,!0,n);case 37:return un(r,6160,6169,!0,n);case 38:return un(r,4160,4169,!0,n);case 39:return un(r,2918,2927,!0,n);case 40:return un(r,1776,1785,!0,n);case 43:return un(r,3046,3055,!0,n);case 44:return un(r,3174,3183,!0,n);case 45:return un(r,3664,3673,!0,n);case 46:return un(r,3872,3881,!0,n);default:return un(r,48,57,!0,n)}},H2;(function(r){r[r.BEFORE=0]="BEFORE",r[r.AFTER=1]="AFTER"})(H2||(H2={}));var Wz=(function(){function r(){}return r.getOrigin=function(e){var t=r._link;return t?(t.href=e,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},r.isSameOrigin=function(e){return r.getOrigin(e)===r._origin},r.setContext=function(e){r._link=e.document.createElement("a"),r._origin=r.getOrigin(e.location.href)},r._origin="about:blank",r})(),Fe=(function(){function r(e,t){this.type=0,this.x=e,this.y=t}return r.prototype.add=function(e,t){return new r(this.x+e,this.y+t)},r})(),Lo=function(r,e,t){return new Fe(r.x+(e.x-r.x)*t,r.y+(e.y-r.y)*t)},Mu=(function(){function r(e,t,n,i){this.type=1,this.start=e,this.startControl=t,this.endControl=n,this.end=i}return r.prototype.subdivide=function(e,t){var n=Lo(this.start,this.startControl,e),i=Lo(this.startControl,this.endControl,e),a=Lo(this.endControl,this.end,e),s=Lo(n,i,e),o=Lo(i,a,e),A=Lo(s,o,e);return t?new r(this.start,n,s,A):new r(A,o,a,this.end)},r.prototype.add=function(e,t){return new r(this.start.add(e,t),this.startControl.add(e,t),this.endControl.add(e,t),this.end.add(e,t))},r.prototype.reverse=function(){return new r(this.end,this.endControl,this.startControl,this.start)},r})(),ei=function(r){return r.type===1},qz=(function(){function r(e){var t=e.styles,n=e.bounds,i=ZA(t.borderTopLeftRadius,n.width,n.height),a=i[0],s=i[1],o=ZA(t.borderTopRightRadius,n.width,n.height),A=o[0],l=o[1],c=ZA(t.borderBottomRightRadius,n.width,n.height),u=c[0],h=c[1],d=ZA(t.borderBottomLeftRadius,n.width,n.height),f=d[0],g=d[1],p=[];p.push((a+A)/n.width),p.push((f+u)/n.width),p.push((s+g)/n.height),p.push((l+h)/n.height);var v=Math.max.apply(Math,p);v>1&&(a/=v,s/=v,A/=v,l/=v,u/=v,h/=v,f/=v,g/=v);var y=n.width-A,m=n.height-h,B=n.width-u,C=n.height-g,S=t.borderTopWidth,F=t.borderRightWidth,T=t.borderBottomWidth,O=t.borderLeftWidth,I=Nt(t.paddingTop,e.bounds.width),k=Nt(t.paddingRight,e.bounds.width),N=Nt(t.paddingBottom,e.bounds.width),U=Nt(t.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=a>0||s>0?zt(n.left+O/3,n.top+S/3,a-O/3,s-S/3,yt.TOP_LEFT):new Fe(n.left+O/3,n.top+S/3),this.topRightBorderDoubleOuterBox=a>0||s>0?zt(n.left+y,n.top+S/3,A-F/3,l-S/3,yt.TOP_RIGHT):new Fe(n.left+n.width-F/3,n.top+S/3),this.bottomRightBorderDoubleOuterBox=u>0||h>0?zt(n.left+B,n.top+m,u-F/3,h-T/3,yt.BOTTOM_RIGHT):new Fe(n.left+n.width-F/3,n.top+n.height-T/3),this.bottomLeftBorderDoubleOuterBox=f>0||g>0?zt(n.left+O/3,n.top+C,f-O/3,g-T/3,yt.BOTTOM_LEFT):new Fe(n.left+O/3,n.top+n.height-T/3),this.topLeftBorderDoubleInnerBox=a>0||s>0?zt(n.left+O*2/3,n.top+S*2/3,a-O*2/3,s-S*2/3,yt.TOP_LEFT):new Fe(n.left+O*2/3,n.top+S*2/3),this.topRightBorderDoubleInnerBox=a>0||s>0?zt(n.left+y,n.top+S*2/3,A-F*2/3,l-S*2/3,yt.TOP_RIGHT):new Fe(n.left+n.width-F*2/3,n.top+S*2/3),this.bottomRightBorderDoubleInnerBox=u>0||h>0?zt(n.left+B,n.top+m,u-F*2/3,h-T*2/3,yt.BOTTOM_RIGHT):new Fe(n.left+n.width-F*2/3,n.top+n.height-T*2/3),this.bottomLeftBorderDoubleInnerBox=f>0||g>0?zt(n.left+O*2/3,n.top+C,f-O*2/3,g-T*2/3,yt.BOTTOM_LEFT):new Fe(n.left+O*2/3,n.top+n.height-T*2/3),this.topLeftBorderStroke=a>0||s>0?zt(n.left+O/2,n.top+S/2,a-O/2,s-S/2,yt.TOP_LEFT):new Fe(n.left+O/2,n.top+S/2),this.topRightBorderStroke=a>0||s>0?zt(n.left+y,n.top+S/2,A-F/2,l-S/2,yt.TOP_RIGHT):new Fe(n.left+n.width-F/2,n.top+S/2),this.bottomRightBorderStroke=u>0||h>0?zt(n.left+B,n.top+m,u-F/2,h-T/2,yt.BOTTOM_RIGHT):new Fe(n.left+n.width-F/2,n.top+n.height-T/2),this.bottomLeftBorderStroke=f>0||g>0?zt(n.left+O/2,n.top+C,f-O/2,g-T/2,yt.BOTTOM_LEFT):new Fe(n.left+O/2,n.top+n.height-T/2),this.topLeftBorderBox=a>0||s>0?zt(n.left,n.top,a,s,yt.TOP_LEFT):new Fe(n.left,n.top),this.topRightBorderBox=A>0||l>0?zt(n.left+y,n.top,A,l,yt.TOP_RIGHT):new Fe(n.left+n.width,n.top),this.bottomRightBorderBox=u>0||h>0?zt(n.left+B,n.top+m,u,h,yt.BOTTOM_RIGHT):new Fe(n.left+n.width,n.top+n.height),this.bottomLeftBorderBox=f>0||g>0?zt(n.left,n.top+C,f,g,yt.BOTTOM_LEFT):new Fe(n.left,n.top+n.height),this.topLeftPaddingBox=a>0||s>0?zt(n.left+O,n.top+S,Math.max(0,a-O),Math.max(0,s-S),yt.TOP_LEFT):new Fe(n.left+O,n.top+S),this.topRightPaddingBox=A>0||l>0?zt(n.left+Math.min(y,n.width-F),n.top+S,y>n.width+F?0:Math.max(0,A-F),Math.max(0,l-S),yt.TOP_RIGHT):new Fe(n.left+n.width-F,n.top+S),this.bottomRightPaddingBox=u>0||h>0?zt(n.left+Math.min(B,n.width-O),n.top+Math.min(m,n.height-T),Math.max(0,u-F),Math.max(0,h-T),yt.BOTTOM_RIGHT):new Fe(n.left+n.width-F,n.top+n.height-T),this.bottomLeftPaddingBox=f>0||g>0?zt(n.left+O,n.top+Math.min(C,n.height-T),Math.max(0,f-O),Math.max(0,g-T),yt.BOTTOM_LEFT):new Fe(n.left+O,n.top+n.height-T),this.topLeftContentBox=a>0||s>0?zt(n.left+O+U,n.top+S+I,Math.max(0,a-(O+U)),Math.max(0,s-(S+I)),yt.TOP_LEFT):new Fe(n.left+O+U,n.top+S+I),this.topRightContentBox=A>0||l>0?zt(n.left+Math.min(y,n.width+O+U),n.top+S+I,y>n.width+O+U?0:A-O+U,l-(S+I),yt.TOP_RIGHT):new Fe(n.left+n.width-(F+k),n.top+S+I),this.bottomRightContentBox=u>0||h>0?zt(n.left+Math.min(B,n.width-(O+U)),n.top+Math.min(m,n.height+S+I),Math.max(0,u-(F+k)),h-(T+N),yt.BOTTOM_RIGHT):new Fe(n.left+n.width-(F+k),n.top+n.height-(T+N)),this.bottomLeftContentBox=f>0||g>0?zt(n.left+O+U,n.top+C,Math.max(0,f-(O+U)),g-(T+N),yt.BOTTOM_LEFT):new Fe(n.left+O+U,n.top+n.height-(T+N))}return r})(),yt;(function(r){r[r.TOP_LEFT=0]="TOP_LEFT",r[r.TOP_RIGHT=1]="TOP_RIGHT",r[r.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",r[r.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(yt||(yt={}));var zt=function(r,e,t,n,i){var a=4*((Math.sqrt(2)-1)/3),s=t*a,o=n*a,A=r+t,l=e+n;switch(i){case yt.TOP_LEFT:return new Mu(new Fe(r,l),new Fe(r,l-o),new Fe(A-s,e),new Fe(A,e));case yt.TOP_RIGHT:return new Mu(new Fe(r,e),new Fe(r+s,e),new Fe(A,l-o),new Fe(A,l));case yt.BOTTOM_RIGHT:return new Mu(new Fe(A,e),new Fe(A,e+o),new Fe(r+s,l),new Fe(r,l));case yt.BOTTOM_LEFT:default:return new Mu(new Fe(A,l),new Fe(A-s,l),new Fe(r,e+o),new Fe(r,e))}},Ou=function(r){return[r.topLeftBorderBox,r.topRightBorderBox,r.bottomRightBorderBox,r.bottomLeftBorderBox]},$z=function(r){return[r.topLeftContentBox,r.topRightContentBox,r.bottomRightContentBox,r.bottomLeftContentBox]},Iu=function(r){return[r.topLeftPaddingBox,r.topRightPaddingBox,r.bottomRightPaddingBox,r.bottomLeftPaddingBox]},Yz=(function(){function r(e,t,n){this.offsetX=e,this.offsetY=t,this.matrix=n,this.type=0,this.target=6}return r})(),_u=(function(){function r(e,t){this.path=e,this.target=t,this.type=1}return r})(),Xz=(function(){function r(e){this.opacity=e,this.type=2,this.target=6}return r})(),Zz=function(r){return r.type===0},G2=function(r){return r.type===1},Jz=function(r){return r.type===2},K2=function(r,e){return r.length===e.length?r.some(function(t,n){return t===e[n]}):!1},e8=function(r,e,t,n,i){return r.map(function(a,s){switch(s){case 0:return a.add(e,t);case 1:return a.add(e+n,t);case 2:return a.add(e+n,t+i);case 3:return a.add(e,t+i)}return a})},z2=(function(){function r(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return r})(),V2=(function(){function r(e,t){if(this.container=e,this.parent=t,this.effects=[],this.curves=new qz(this.container),this.container.styles.opacity<1&&this.effects.push(new Xz(this.container.styles.opacity)),this.container.styles.transform!==null){var n=this.container.bounds.left+this.container.styles.transformOrigin[0].number,i=this.container.bounds.top+this.container.styles.transformOrigin[1].number,a=this.container.styles.transform;this.effects.push(new Yz(n,i,a))}if(this.container.styles.overflowX!==0){var s=Ou(this.curves),o=Iu(this.curves);K2(s,o)?this.effects.push(new _u(s,6)):(this.effects.push(new _u(s,2)),this.effects.push(new _u(o,4)))}}return r.prototype.getEffects=function(e){for(var t=[2,3].indexOf(this.container.styles.position)===-1,n=this.parent,i=this.effects.slice(0);n;){var a=n.effects.filter(function(A){return!G2(A)});if(t||n.container.styles.position!==0||!n.parent){if(i.unshift.apply(i,a),t=[2,3].indexOf(n.container.styles.position)===-1,n.container.styles.overflowX!==0){var s=Ou(n.curves),o=Iu(n.curves);K2(s,o)||i.unshift(new _u(o,6))}}else i.unshift.apply(i,a);n=n.parent}return i.filter(function(A){return Sn(A.target,e)})},r})(),Lp=function(r,e,t,n){r.container.elements.forEach(function(i){var a=Sn(i.flags,4),s=Sn(i.flags,2),o=new V2(i,r);Sn(i.styles.display,2048)&&n.push(o);var A=Sn(i.flags,8)?[]:n;if(a||s){var l=a||i.styles.isPositioned()?t:e,c=new z2(o);if(i.styles.isPositioned()||i.styles.opacity<1||i.styles.isTransformed()){var u=i.styles.zIndex.order;if(u<0){var h=0;l.negativeZIndex.some(function(f,g){return u>f.element.container.styles.zIndex.order?(h=g,!1):h>0}),l.negativeZIndex.splice(h,0,c)}else if(u>0){var d=0;l.positiveZIndex.some(function(f,g){return u>=f.element.container.styles.zIndex.order?(d=g+1,!1):d>0}),l.positiveZIndex.splice(d,0,c)}else l.zeroOrAutoZIndexOrTransformedOrOpacity.push(c)}else i.styles.isFloating()?l.nonPositionedFloats.push(c):l.nonPositionedInlineLevel.push(c);Lp(o,c,a?c:t,A)}else i.styles.isInlineLevel()?e.inlineLevel.push(o):e.nonInlineLevel.push(o),Lp(o,e,t,A);Sn(i.flags,8)&&j2(i,A)})},j2=function(r,e){for(var t=r instanceof Ip?r.start:1,n=r instanceof Ip?r.reversed:!1,i=0;i<e.length;i++){var a=e[i];a.container instanceof C2&&typeof a.container.value=="number"&&a.container.value!==0&&(t=a.container.value),a.listValue=Np(t,a.container.styles.listStyleType,!0),t+=n?-1:1}},t8=function(r){var e=new V2(r,null),t=new z2(e),n=[];return Lp(e,t,t,n),j2(e.container,n),t},W2=function(r,e){switch(e){case 0:return ti(r.topLeftBorderBox,r.topLeftPaddingBox,r.topRightBorderBox,r.topRightPaddingBox);case 1:return ti(r.topRightBorderBox,r.topRightPaddingBox,r.bottomRightBorderBox,r.bottomRightPaddingBox);case 2:return ti(r.bottomRightBorderBox,r.bottomRightPaddingBox,r.bottomLeftBorderBox,r.bottomLeftPaddingBox);default:return ti(r.bottomLeftBorderBox,r.bottomLeftPaddingBox,r.topLeftBorderBox,r.topLeftPaddingBox)}},n8=function(r,e){switch(e){case 0:return ti(r.topLeftBorderBox,r.topLeftBorderDoubleOuterBox,r.topRightBorderBox,r.topRightBorderDoubleOuterBox);case 1:return ti(r.topRightBorderBox,r.topRightBorderDoubleOuterBox,r.bottomRightBorderBox,r.bottomRightBorderDoubleOuterBox);case 2:return ti(r.bottomRightBorderBox,r.bottomRightBorderDoubleOuterBox,r.bottomLeftBorderBox,r.bottomLeftBorderDoubleOuterBox);default:return ti(r.bottomLeftBorderBox,r.bottomLeftBorderDoubleOuterBox,r.topLeftBorderBox,r.topLeftBorderDoubleOuterBox)}},r8=function(r,e){switch(e){case 0:return ti(r.topLeftBorderDoubleInnerBox,r.topLeftPaddingBox,r.topRightBorderDoubleInnerBox,r.topRightPaddingBox);case 1:return ti(r.topRightBorderDoubleInnerBox,r.topRightPaddingBox,r.bottomRightBorderDoubleInnerBox,r.bottomRightPaddingBox);case 2:return ti(r.bottomRightBorderDoubleInnerBox,r.bottomRightPaddingBox,r.bottomLeftBorderDoubleInnerBox,r.bottomLeftPaddingBox);default:return ti(r.bottomLeftBorderDoubleInnerBox,r.bottomLeftPaddingBox,r.topLeftBorderDoubleInnerBox,r.topLeftPaddingBox)}},i8=function(r,e){switch(e){case 0:return ku(r.topLeftBorderStroke,r.topRightBorderStroke);case 1:return ku(r.topRightBorderStroke,r.bottomRightBorderStroke);case 2:return ku(r.bottomRightBorderStroke,r.bottomLeftBorderStroke);default:return ku(r.bottomLeftBorderStroke,r.topLeftBorderStroke)}},ku=function(r,e){var t=[];return ei(r)?t.push(r.subdivide(.5,!1)):t.push(r),ei(e)?t.push(e.subdivide(.5,!0)):t.push(e),t},ti=function(r,e,t,n){var i=[];return ei(r)?i.push(r.subdivide(.5,!1)):i.push(r),ei(t)?i.push(t.subdivide(.5,!0)):i.push(t),ei(n)?i.push(n.subdivide(.5,!0).reverse()):i.push(n),ei(e)?i.push(e.subdivide(.5,!1).reverse()):i.push(e),i},q2=function(r){var e=r.bounds,t=r.styles;return e.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},Nu=function(r){var e=r.styles,t=r.bounds,n=Nt(e.paddingLeft,t.width),i=Nt(e.paddingRight,t.width),a=Nt(e.paddingTop,t.width),s=Nt(e.paddingBottom,t.width);return t.add(n+e.borderLeftWidth,a+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+n+i),-(e.borderTopWidth+e.borderBottomWidth+a+s))},a8=function(r,e){return r===0?e.bounds:r===2?Nu(e):q2(e)},s8=function(r,e){return r===0?e.bounds:r===2?Nu(e):q2(e)},Qp=function(r,e,t){var n=a8(Uo(r.styles.backgroundOrigin,e),r),i=s8(Uo(r.styles.backgroundClip,e),r),a=o8(Uo(r.styles.backgroundSize,e),t,n),s=a[0],o=a[1],A=ZA(Uo(r.styles.backgroundPosition,e),n.width-s,n.height-o),l=A8(Uo(r.styles.backgroundRepeat,e),A,a,n,i),c=Math.round(n.left+A[0]),u=Math.round(n.top+A[1]);return[l,c,u,s,o]},Qo=function(r){return nn(r)&&r.value===_o.AUTO},Lu=function(r){return typeof r=="number"},o8=function(r,e,t){var n=e[0],i=e[1],a=e[2],s=r[0],o=r[1];if(!s)return[0,0];if(mn(s)&&o&&mn(o))return[Nt(s,t.width),Nt(o,t.height)];var A=Lu(a);if(nn(s)&&(s.value===_o.CONTAIN||s.value===_o.COVER)){if(Lu(a)){var l=t.width/t.height;return l<a!=(s.value===_o.COVER)?[t.width,t.width/a]:[t.height*a,t.height]}return[t.width,t.height]}var c=Lu(n),u=Lu(i),h=c||u;if(Qo(s)&&(!o||Qo(o))){if(c&&u)return[n,i];if(!A&&!h)return[t.width,t.height];if(h&&A){var d=c?n:i*a,f=u?i:n/a;return[d,f]}var g=c?n:t.width,p=u?i:t.height;return[g,p]}if(A){var v=0,y=0;return mn(s)?v=Nt(s,t.width):mn(o)&&(y=Nt(o,t.height)),Qo(s)?v=y*a:(!o||Qo(o))&&(y=v/a),[v,y]}var m=null,B=null;if(mn(s)?m=Nt(s,t.width):o&&mn(o)&&(B=Nt(o,t.height)),m!==null&&(!o||Qo(o))&&(B=c&&u?m/n*i:t.height),B!==null&&Qo(s)&&(m=c&&u?B/i*n:t.width),m!==null&&B!==null)return[m,B];throw new Error("Unable to calculate background-size for element")},Uo=function(r,e){var t=r[e];return typeof t>"u"?r[0]:t},A8=function(r,e,t,n,i){var a=e[0],s=e[1],o=t[0],A=t[1];switch(r){case 2:return[new Fe(Math.round(n.left),Math.round(n.top+s)),new Fe(Math.round(n.left+n.width),Math.round(n.top+s)),new Fe(Math.round(n.left+n.width),Math.round(A+n.top+s)),new Fe(Math.round(n.left),Math.round(A+n.top+s))];case 3:return[new Fe(Math.round(n.left+a),Math.round(n.top)),new Fe(Math.round(n.left+a+o),Math.round(n.top)),new Fe(Math.round(n.left+a+o),Math.round(n.height+n.top)),new Fe(Math.round(n.left+a),Math.round(n.height+n.top))];case 1:return[new Fe(Math.round(n.left+a),Math.round(n.top+s)),new Fe(Math.round(n.left+a+o),Math.round(n.top+s)),new Fe(Math.round(n.left+a+o),Math.round(n.top+s+A)),new Fe(Math.round(n.left+a),Math.round(n.top+s+A))];default:return[new Fe(Math.round(i.left),Math.round(i.top)),new Fe(Math.round(i.left+i.width),Math.round(i.top)),new Fe(Math.round(i.left+i.width),Math.round(i.height+i.top)),new Fe(Math.round(i.left),Math.round(i.height+i.top))]}},l8="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",$2="Hidden Text",c8=(function(){function r(e){this._data={},this._document=e}return r.prototype.parseMetrics=function(e,t){var n=this._document.createElement("div"),i=this._document.createElement("img"),a=this._document.createElement("span"),s=this._document.body;n.style.visibility="hidden",n.style.fontFamily=e,n.style.fontSize=t,n.style.margin="0",n.style.padding="0",n.style.whiteSpace="nowrap",s.appendChild(n),i.src=l8,i.width=1,i.height=1,i.style.margin="0",i.style.padding="0",i.style.verticalAlign="baseline",a.style.fontFamily=e,a.style.fontSize=t,a.style.margin="0",a.style.padding="0",a.appendChild(this._document.createTextNode($2)),n.appendChild(a),n.appendChild(i);var o=i.offsetTop-a.offsetTop+2;n.removeChild(a),n.appendChild(this._document.createTextNode($2)),n.style.lineHeight="normal",i.style.verticalAlign="super";var A=i.offsetTop-n.offsetTop+2;return s.removeChild(n),{baseline:o,middle:A}},r.prototype.getMetrics=function(e,t){var n=e+" "+t;return typeof this._data[n]>"u"&&(this._data[n]=this.parseMetrics(e,t)),this._data[n]},r})(),Y2=(function(){function r(e,t){this.context=e,this.options=t}return r})(),u8=1e4;(function(r){vi(e,r);function e(t,n){var i=r.call(this,t,n)||this;return i._activeEffects=[],i.canvas=n.canvas?n.canvas:document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),n.canvas||(i.canvas.width=Math.floor(n.width*n.scale),i.canvas.height=Math.floor(n.height*n.scale),i.canvas.style.width=n.width+"px",i.canvas.style.height=n.height+"px"),i.fontMetrics=new c8(document),i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-n.x,-n.y),i.ctx.textBaseline="bottom",i._activeEffects=[],i.context.logger.debug("Canvas renderer initialized ("+n.width+"x"+n.height+") with scale "+n.scale),i}return e.prototype.applyEffects=function(t){for(var n=this;this._activeEffects.length;)this.popEffect();t.forEach(function(i){return n.applyEffect(i)})},e.prototype.applyEffect=function(t){this.ctx.save(),Jz(t)&&(this.ctx.globalAlpha=t.opacity),Zz(t)&&(this.ctx.translate(t.offsetX,t.offsetY),this.ctx.transform(t.matrix[0],t.matrix[1],t.matrix[2],t.matrix[3],t.matrix[4],t.matrix[5]),this.ctx.translate(-t.offsetX,-t.offsetY)),G2(t)&&(this.path(t.path),this.ctx.clip()),this._activeEffects.push(t)},e.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},e.prototype.renderStack=function(t){return Xr(this,void 0,void 0,function(){var n;return Ur(this,function(i){switch(i.label){case 0:return n=t.element.container.styles,n.isVisible()?[4,this.renderStackContent(t)]:[3,2];case 1:i.sent(),i.label=2;case 2:return[2]}})})},e.prototype.renderNode=function(t){return Xr(this,void 0,void 0,function(){return Ur(this,function(n){switch(n.label){case 0:if(Sn(t.container.flags,16))debugger;return t.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(t)]:[3,3];case 1:return n.sent(),[4,this.renderNodeContent(t)];case 2:n.sent(),n.label=3;case 3:return[2]}})})},e.prototype.renderTextWithLetterSpacing=function(t,n,i){var a=this;if(n===0)this.ctx.fillText(t.text,t.bounds.left,t.bounds.top+i);else{var s=Op(t.text);s.reduce(function(o,A){return a.ctx.fillText(A,o,t.bounds.top+i),o+a.ctx.measureText(A).width},t.bounds.left)}},e.prototype.createFontStyle=function(t){var n=t.fontVariant.filter(function(s){return s==="normal"||s==="small-caps"}).join(""),i=p8(t.fontFamily).join(", "),a=XA(t.fontSize)?""+t.fontSize.number+t.fontSize.unit:t.fontSize.number+"px";return[[t.fontStyle,n,t.fontWeight,a,i].join(" "),i,a]},e.prototype.renderTextNode=function(t,n){return Xr(this,void 0,void 0,function(){var i,a,s,o,A,l,c,u,h=this;return Ur(this,function(d){return i=this.createFontStyle(n),a=i[0],s=i[1],o=i[2],this.ctx.font=a,this.ctx.direction=n.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",A=this.fontMetrics.getMetrics(s,o),l=A.baseline,c=A.middle,u=n.paintOrder,t.textBounds.forEach(function(f){u.forEach(function(g){switch(g){case 0:h.ctx.fillStyle=Nn(n.color),h.renderTextWithLetterSpacing(f,n.letterSpacing,l);var p=n.textShadow;p.length&&f.text.trim().length&&(p.slice(0).reverse().forEach(function(v){h.ctx.shadowColor=Nn(v.color),h.ctx.shadowOffsetX=v.offsetX.number*h.options.scale,h.ctx.shadowOffsetY=v.offsetY.number*h.options.scale,h.ctx.shadowBlur=v.blur.number,h.renderTextWithLetterSpacing(f,n.letterSpacing,l)}),h.ctx.shadowColor="",h.ctx.shadowOffsetX=0,h.ctx.shadowOffsetY=0,h.ctx.shadowBlur=0),n.textDecorationLine.length&&(h.ctx.fillStyle=Nn(n.textDecorationColor||n.color),n.textDecorationLine.forEach(function(v){switch(v){case 1:h.ctx.fillRect(f.bounds.left,Math.round(f.bounds.top+l),f.bounds.width,1);break;case 2:h.ctx.fillRect(f.bounds.left,Math.round(f.bounds.top),f.bounds.width,1);break;case 3:h.ctx.fillRect(f.bounds.left,Math.ceil(f.bounds.top+c),f.bounds.width,1);break}}));break;case 1:n.webkitTextStrokeWidth&&f.text.trim().length&&(h.ctx.strokeStyle=Nn(n.webkitTextStrokeColor),h.ctx.lineWidth=n.webkitTextStrokeWidth,h.ctx.lineJoin=window.chrome?"miter":"round",h.ctx.strokeText(f.text,f.bounds.left,f.bounds.top+l)),h.ctx.strokeStyle="",h.ctx.lineWidth=0,h.ctx.lineJoin="miter";break}})}),[2]})})},e.prototype.renderReplacedElement=function(t,n,i){if(i&&t.intrinsicWidth>0&&t.intrinsicHeight>0){var a=Nu(t),s=Iu(n);this.path(s),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(i,0,0,t.intrinsicWidth,t.intrinsicHeight,a.left,a.top,a.width,a.height),this.ctx.restore()}},e.prototype.renderNodeContent=function(t){return Xr(this,void 0,void 0,function(){var n,i,a,s,o,A,y,y,l,c,u,h,B,d,f,C,g,p,v,y,m,B,C;return Ur(this,function(S){switch(S.label){case 0:this.applyEffects(t.getEffects(4)),n=t.container,i=t.curves,a=n.styles,s=0,o=n.textNodes,S.label=1;case 1:return s<o.length?(A=o[s],[4,this.renderTextNode(A,a)]):[3,4];case 2:S.sent(),S.label=3;case 3:return s++,[3,1];case 4:if(!(n instanceof b2))return[3,8];S.label=5;case 5:return S.trys.push([5,7,,8]),[4,this.context.cache.match(n.src)];case 6:return y=S.sent(),this.renderReplacedElement(n,i,y),[3,8];case 7:return S.sent(),this.context.logger.error("Error loading image "+n.src),[3,8];case 8:if(n instanceof E2&&this.renderReplacedElement(n,i,n.canvas),!(n instanceof x2))return[3,12];S.label=9;case 9:return S.trys.push([9,11,,12]),[4,this.context.cache.match(n.svg)];case 10:return y=S.sent(),this.renderReplacedElement(n,i,y),[3,12];case 11:return S.sent(),this.context.logger.error("Error loading svg "+n.svg.substring(0,255)),[3,12];case 12:return n instanceof M2&&n.tree?(l=new e(this.context,{scale:this.options.scale,backgroundColor:n.backgroundColor,x:0,y:0,width:n.width,height:n.height}),[4,l.render(n.tree)]):[3,14];case 13:c=S.sent(),n.width&&n.height&&this.ctx.drawImage(c,0,0,n.width,n.height,n.bounds.left,n.bounds.top,n.bounds.width,n.bounds.height),S.label=14;case 14:if(n instanceof _p&&(u=Math.min(n.bounds.width,n.bounds.height),n.type===Su?n.checked&&(this.ctx.save(),this.path([new Fe(n.bounds.left+u*.39363,n.bounds.top+u*.79),new Fe(n.bounds.left+u*.16,n.bounds.top+u*.5549),new Fe(n.bounds.left+u*.27347,n.bounds.top+u*.44071),new Fe(n.bounds.left+u*.39694,n.bounds.top+u*.5649),new Fe(n.bounds.left+u*.72983,n.bounds.top+u*.23),new Fe(n.bounds.left+u*.84,n.bounds.top+u*.34085),new Fe(n.bounds.left+u*.39363,n.bounds.top+u*.79)]),this.ctx.fillStyle=Nn(S2),this.ctx.fill(),this.ctx.restore()):n.type===Fu&&n.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.bounds.left+u/2,n.bounds.top+u/2,u/4,0,Math.PI*2,!0),this.ctx.fillStyle=Nn(S2),this.ctx.fill(),this.ctx.restore())),h8(n)&&n.value.length){switch(h=this.createFontStyle(a),B=h[0],d=h[1],f=this.fontMetrics.getMetrics(B,d).baseline,this.ctx.font=B,this.ctx.fillStyle=Nn(a.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=f8(n.styles.textAlign),C=Nu(n),g=0,n.styles.textAlign){case 1:g+=C.width/2;break;case 2:g+=C.width;break}p=C.add(g,0,0,-C.height/2+1),this.ctx.save(),this.path([new Fe(C.left,C.top),new Fe(C.left+C.width,C.top),new Fe(C.left+C.width,C.top+C.height),new Fe(C.left,C.top+C.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new nl(n.value,p),a.letterSpacing,f),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!Sn(n.styles.display,2048))return[3,20];if(n.styles.listStyleImage===null)return[3,19];if(v=n.styles.listStyleImage,v.type!==0)return[3,18];y=void 0,m=v.url,S.label=15;case 15:return S.trys.push([15,17,,18]),[4,this.context.cache.match(m)];case 16:return y=S.sent(),this.ctx.drawImage(y,n.bounds.left-(y.width+10),n.bounds.top),[3,18];case 17:return S.sent(),this.context.logger.error("Error loading list-style-image "+m),[3,18];case 18:return[3,20];case 19:t.listValue&&n.styles.listStyleType!==-1&&(B=this.createFontStyle(a)[0],this.ctx.font=B,this.ctx.fillStyle=Nn(a.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",C=new Ns(n.bounds.left,n.bounds.top+Nt(n.styles.paddingTop,n.bounds.width),n.bounds.width,i2(a.lineHeight,a.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new nl(t.listValue,C),a.letterSpacing,i2(a.lineHeight,a.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),S.label=20;case 20:return[2]}})})},e.prototype.renderStackContent=function(t){return Xr(this,void 0,void 0,function(){var n,i,v,a,s,v,o,A,v,l,c,v,u,h,v,d,f,v,g,p,v;return Ur(this,function(y){switch(y.label){case 0:if(Sn(t.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(t.element)];case 1:y.sent(),n=0,i=t.negativeZIndex,y.label=2;case 2:return n<i.length?(v=i[n],[4,this.renderStack(v)]):[3,5];case 3:y.sent(),y.label=4;case 4:return n++,[3,2];case 5:return[4,this.renderNodeContent(t.element)];case 6:y.sent(),a=0,s=t.nonInlineLevel,y.label=7;case 7:return a<s.length?(v=s[a],[4,this.renderNode(v)]):[3,10];case 8:y.sent(),y.label=9;case 9:return a++,[3,7];case 10:o=0,A=t.nonPositionedFloats,y.label=11;case 11:return o<A.length?(v=A[o],[4,this.renderStack(v)]):[3,14];case 12:y.sent(),y.label=13;case 13:return o++,[3,11];case 14:l=0,c=t.nonPositionedInlineLevel,y.label=15;case 15:return l<c.length?(v=c[l],[4,this.renderStack(v)]):[3,18];case 16:y.sent(),y.label=17;case 17:return l++,[3,15];case 18:u=0,h=t.inlineLevel,y.label=19;case 19:return u<h.length?(v=h[u],[4,this.renderNode(v)]):[3,22];case 20:y.sent(),y.label=21;case 21:return u++,[3,19];case 22:d=0,f=t.zeroOrAutoZIndexOrTransformedOrOpacity,y.label=23;case 23:return d<f.length?(v=f[d],[4,this.renderStack(v)]):[3,26];case 24:y.sent(),y.label=25;case 25:return d++,[3,23];case 26:g=0,p=t.positiveZIndex,y.label=27;case 27:return g<p.length?(v=p[g],[4,this.renderStack(v)]):[3,30];case 28:y.sent(),y.label=29;case 29:return g++,[3,27];case 30:return[2]}})})},e.prototype.mask=function(t){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(t.slice(0).reverse()),this.ctx.closePath()},e.prototype.path=function(t){this.ctx.beginPath(),this.formatPath(t),this.ctx.closePath()},e.prototype.formatPath=function(t){var n=this;t.forEach(function(i,a){var s=ei(i)?i.start:i;a===0?n.ctx.moveTo(s.x,s.y):n.ctx.lineTo(s.x,s.y),ei(i)&&n.ctx.bezierCurveTo(i.startControl.x,i.startControl.y,i.endControl.x,i.endControl.y,i.end.x,i.end.y)})},e.prototype.renderRepeat=function(t,n,i,a){this.path(t),this.ctx.fillStyle=n,this.ctx.translate(i,a),this.ctx.fill(),this.ctx.translate(-i,-a)},e.prototype.resizeImage=function(t,n,i){var a;if(t.width===n&&t.height===i)return t;var s=(a=this.canvas.ownerDocument)!==null&&a!==void 0?a:document,o=s.createElement("canvas");o.width=Math.max(1,n),o.height=Math.max(1,i);var A=o.getContext("2d");return A.drawImage(t,0,0,t.width,t.height,0,0,n,i),o},e.prototype.renderBackgroundImage=function(t){return Xr(this,void 0,void 0,function(){var n,i,a,s,o,A;return Ur(this,function(l){switch(l.label){case 0:n=t.styles.backgroundImage.length-1,i=function(c){var u,h,d,I,Z,q,U,D,T,f,I,Z,q,U,D,g,p,v,y,m,B,C,S,F,T,O,I,k,N,U,D,G,Z,q,j,te,ue,ge,Y,xe,$,K;return Ur(this,function(ee){switch(ee.label){case 0:if(c.type!==0)return[3,5];u=void 0,h=c.url,ee.label=1;case 1:return ee.trys.push([1,3,,4]),[4,a.context.cache.match(h)];case 2:return u=ee.sent(),[3,4];case 3:return ee.sent(),a.context.logger.error("Error loading background-image "+h),[3,4];case 4:return u&&(d=Qp(t,n,[u.width,u.height,u.width/u.height]),I=d[0],Z=d[1],q=d[2],U=d[3],D=d[4],T=a.ctx.createPattern(a.resizeImage(u,U,D),"repeat"),a.renderRepeat(I,T,Z,q)),[3,6];case 5:fG(c)?(f=Qp(t,n,[null,null,null]),I=f[0],Z=f[1],q=f[2],U=f[3],D=f[4],g=lG(c.angle,U,D),p=g[0],v=g[1],y=g[2],m=g[3],B=g[4],C=document.createElement("canvas"),C.width=U,C.height=D,S=C.getContext("2d"),F=S.createLinearGradient(v,m,y,B),WC(c.stops,p).forEach(function(oe){return F.addColorStop(oe.stop,Nn(oe.color))}),S.fillStyle=F,S.fillRect(0,0,U,D),U>0&&D>0&&(T=a.ctx.createPattern(C,"repeat"),a.renderRepeat(I,T,Z,q))):gG(c)&&(O=Qp(t,n,[null,null,null]),I=O[0],k=O[1],N=O[2],U=O[3],D=O[4],G=c.position.length===0?[vp]:c.position,Z=Nt(G[0],U),q=Nt(G[G.length-1],D),j=cG(c,Z,q,U,D),te=j[0],ue=j[1],te>0&&ue>0&&(ge=a.ctx.createRadialGradient(k+Z,N+q,0,k+Z,N+q,te),WC(c.stops,te*2).forEach(function(oe){return ge.addColorStop(oe.stop,Nn(oe.color))}),a.path(I),a.ctx.fillStyle=ge,te!==ue?(Y=t.bounds.left+.5*t.bounds.width,xe=t.bounds.top+.5*t.bounds.height,$=ue/te,K=1/$,a.ctx.save(),a.ctx.translate(Y,xe),a.ctx.transform(1,0,0,$,0,0),a.ctx.translate(-Y,-xe),a.ctx.fillRect(k,K*(N-xe)+xe,U,D*K),a.ctx.restore()):a.ctx.fill())),ee.label=6;case 6:return n--,[2]}})},a=this,s=0,o=t.styles.backgroundImage.slice(0).reverse(),l.label=1;case 1:return s<o.length?(A=o[s],[5,i(A)]):[3,4];case 2:l.sent(),l.label=3;case 3:return s++,[3,1];case 4:return[2]}})})},e.prototype.renderSolidBorder=function(t,n,i){return Xr(this,void 0,void 0,function(){return Ur(this,function(a){return this.path(W2(i,n)),this.ctx.fillStyle=Nn(t),this.ctx.fill(),[2]})})},e.prototype.renderDoubleBorder=function(t,n,i,a){return Xr(this,void 0,void 0,function(){var s,o;return Ur(this,function(A){switch(A.label){case 0:return n<3?[4,this.renderSolidBorder(t,i,a)]:[3,2];case 1:return A.sent(),[2];case 2:return s=n8(a,i),this.path(s),this.ctx.fillStyle=Nn(t),this.ctx.fill(),o=r8(a,i),this.path(o),this.ctx.fill(),[2]}})})},e.prototype.renderNodeBackgroundAndBorders=function(t){return Xr(this,void 0,void 0,function(){var n,i,a,s,o,A,l,c,u=this;return Ur(this,function(h){switch(h.label){case 0:return this.applyEffects(t.getEffects(2)),n=t.container.styles,i=!Io(n.backgroundColor)||n.backgroundImage.length,a=[{style:n.borderTopStyle,color:n.borderTopColor,width:n.borderTopWidth},{style:n.borderRightStyle,color:n.borderRightColor,width:n.borderRightWidth},{style:n.borderBottomStyle,color:n.borderBottomColor,width:n.borderBottomWidth},{style:n.borderLeftStyle,color:n.borderLeftColor,width:n.borderLeftWidth}],s=d8(Uo(n.backgroundClip,0),t.curves),i||n.boxShadow.length?(this.ctx.save(),this.path(s),this.ctx.clip(),Io(n.backgroundColor)||(this.ctx.fillStyle=Nn(n.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(t.container)]):[3,2];case 1:h.sent(),this.ctx.restore(),n.boxShadow.slice(0).reverse().forEach(function(d){u.ctx.save();var f=Ou(t.curves),g=d.inset?0:u8,p=e8(f,-g+(d.inset?1:-1)*d.spread.number,(d.inset?1:-1)*d.spread.number,d.spread.number*(d.inset?-2:2),d.spread.number*(d.inset?-2:2));d.inset?(u.path(f),u.ctx.clip(),u.mask(p)):(u.mask(f),u.ctx.clip(),u.path(p)),u.ctx.shadowOffsetX=d.offsetX.number+g,u.ctx.shadowOffsetY=d.offsetY.number,u.ctx.shadowColor=Nn(d.color),u.ctx.shadowBlur=d.blur.number,u.ctx.fillStyle=d.inset?Nn(d.color):"rgba(0,0,0,1)",u.ctx.fill(),u.ctx.restore()}),h.label=2;case 2:o=0,A=0,l=a,h.label=3;case 3:return A<l.length?(c=l[A],c.style!==0&&!Io(c.color)&&c.width>0?c.style!==2?[3,5]:[4,this.renderDashedDottedBorder(c.color,c.width,o,t.curves,2)]:[3,11]):[3,13];case 4:return h.sent(),[3,11];case 5:return c.style!==3?[3,7]:[4,this.renderDashedDottedBorder(c.color,c.width,o,t.curves,3)];case 6:return h.sent(),[3,11];case 7:return c.style!==4?[3,9]:[4,this.renderDoubleBorder(c.color,c.width,o,t.curves)];case 8:return h.sent(),[3,11];case 9:return[4,this.renderSolidBorder(c.color,o,t.curves)];case 10:h.sent(),h.label=11;case 11:o++,h.label=12;case 12:return A++,[3,3];case 13:return[2]}})})},e.prototype.renderDashedDottedBorder=function(t,n,i,a,s){return Xr(this,void 0,void 0,function(){var o,A,l,c,u,h,d,f,g,p,v,y,m,B,C,S,C,S;return Ur(this,function(F){return this.ctx.save(),o=i8(a,i),A=W2(a,i),s===2&&(this.path(A),this.ctx.clip()),ei(A[0])?(l=A[0].start.x,c=A[0].start.y):(l=A[0].x,c=A[0].y),ei(A[1])?(u=A[1].end.x,h=A[1].end.y):(u=A[1].x,h=A[1].y),i===0||i===2?d=Math.abs(l-u):d=Math.abs(c-h),this.ctx.beginPath(),s===3?this.formatPath(o):this.formatPath(A.slice(0,2)),f=n<3?n*3:n*2,g=n<3?n*2:n,s===3&&(f=n,g=n),p=!0,d<=f*2?p=!1:d<=f*2+g?(v=d/(2*f+g),f*=v,g*=v):(y=Math.floor((d+g)/(f+g)),m=(d-y*f)/(y-1),B=(d-(y+1)*f)/y,g=B<=0||Math.abs(g-m)<Math.abs(g-B)?m:B),p&&(s===3?this.ctx.setLineDash([0,f+g]):this.ctx.setLineDash([f,g])),s===3?(this.ctx.lineCap="round",this.ctx.lineWidth=n):this.ctx.lineWidth=n*2+1.1,this.ctx.strokeStyle=Nn(t),this.ctx.stroke(),this.ctx.setLineDash([]),s===2&&(ei(A[0])&&(C=A[3],S=A[0],this.ctx.beginPath(),this.formatPath([new Fe(C.end.x,C.end.y),new Fe(S.start.x,S.start.y)]),this.ctx.stroke()),ei(A[1])&&(C=A[1],S=A[2],this.ctx.beginPath(),this.formatPath([new Fe(C.end.x,C.end.y),new Fe(S.start.x,S.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},e.prototype.render=function(t){return Xr(this,void 0,void 0,function(){var n;return Ur(this,function(i){switch(i.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=Nn(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),n=t8(t),[4,this.renderStack(n)];case 1:return i.sent(),this.applyEffects([]),[2,this.canvas]}})})},e})(Y2);var h8=function(r){return r instanceof T2||r instanceof F2?!0:r instanceof _p&&r.type!==Fu&&r.type!==Su},d8=function(r,e){switch(r){case 0:return Ou(e);case 2:return $z(e);default:return Iu(e)}},f8=function(r){switch(r){case 1:return"center";case 2:return"right";default:return"left"}},g8=["-apple-system","system-ui"],p8=function(r){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?r.filter(function(e){return g8.indexOf(e)===-1}):r};(function(r){vi(e,r);function e(t,n){var i=r.call(this,t,n)||this;return i.canvas=n.canvas?n.canvas:document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),i.options=n,i.canvas.width=Math.floor(n.width*n.scale),i.canvas.height=Math.floor(n.height*n.scale),i.canvas.style.width=n.width+"px",i.canvas.style.height=n.height+"px",i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-n.x,-n.y),i.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+n.width+"x"+n.height+" at "+n.x+","+n.y+") with scale "+n.scale),i}return e.prototype.render=function(t){return Xr(this,void 0,void 0,function(){var n,i;return Ur(this,function(a){switch(a.label){case 0:return n=Mp(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,t),[4,v8(n)];case 1:return i=a.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=Nn(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(i,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},e})(Y2);var v8=function(r){return new Promise(function(e,t){var n=new Image;n.onload=function(){e(n)},n.onerror=t,n.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(r))})};typeof window<"u"&&Wz.setContext(window);var Up=(function(r){function e(t,n,i,a){var s;return le(this,e),s=We(this,e,[t]),s.currentTime=i,s.timelineTime=a,s.target=n,s.type="finish",s.bubbles=!1,s.currentTarget=n,s.defaultPrevented=!1,s.eventPhase=s.AT_TARGET,s.timeStamp=Date.now(),s.currentTime=i,s.timelineTime=a,s}return qe(e,r),ce(e)})(Uc),y8=0,m8=(function(){function r(e,t){var n;le(this,r),this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=e,e.animation=this,this.timeline=t,this.id="".concat(y8++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number((n=this.effect)===null||n===void 0?void 0:n.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}return ce(r,[{key:"pending",get:function(){return this._startTime===null&&!this._paused&&this.playbackRate!==0||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||(this.timeline.animationsWithPromises.indexOf(this)===-1&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise(function(n,i){t.resolveReadyPromise=function(){n(t)},t.rejectReadyPromise=function(){i(new Error)}}),this.pending||this.resolveReadyPromise()),this.readyPromise}},{key:"finished",get:function(){var t=this;return this.finishedPromise||(this.timeline.animationsWithPromises.indexOf(this)===-1&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise(function(n,i){t.resolveFinishedPromise=function(){n(t)},t.rejectFinishedPromise=function(){i(new Error)}}),this.playState==="finished"&&this.resolveFinishedPromise()),this.finishedPromise}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){if(t=Number(t),!isNaN(t)){if(this.timeline.restart(),!this._paused&&this._startTime!==null){var n;this._startTime=Number((n=this.timeline)===null||n===void 0?void 0:n.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(t!==null){if(this.updatePromises(),t=Number(t),isNaN(t)||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 n=this.currentTime;this._playbackRate=t,this.startTime=null,this.playState!=="paused"&&this.playState!=="idle"&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),n!==null&&(this.currentTime=n),this.updatePromises()}}},{key:"_isFinished",get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)}},{key:"totalDuration",get:function(){return this._totalDuration}},{key:"_needsTick",get:function(){return this.pending||this.playState==="running"||!this._finishedFlag}},{key:"updatePromises",value:function(){var t;if((t=this.effect.target)!==null&&t!==void 0&&t.destroyed)return this.readyPromise=void 0,this.finishedPromise=void 0,!1;var n=this.oldPlayState,i=this.pending?"pending":this.playState;return this.readyPromise&&i!==n&&(i==="idle"?(this.rejectReadyPromise(),this.readyPromise=void 0):n==="pending"?this.resolveReadyPromise():i==="pending"&&(this.readyPromise=void 0)),this.finishedPromise&&i!==n&&(i==="idle"?(this.rejectFinishedPromise(),this.finishedPromise=void 0):i==="finished"?this.resolveFinishedPromise():n==="finished"&&(this.finishedPromise=void 0)),this.oldPlayState=i,this.readyPromise||this.finishedPromise}},{key:"play",value:function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),this.timeline.animations.indexOf(this)===-1&&this.timeline.animations.push(this),this.updatePromises()}},{key:"pause",value:function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),!this._isFinished&&!this._paused&&!this._idle?this.currentTimePending=!0:this._idle&&(this.rewind(),this._idle=!1),this._startTime=null,this._paused=!0,this.updatePromises()}},{key:"finish",value:function(){this.updatePromises(),!this._idle&&(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())}},{key:"cancel",value:function(){var t=this;if(this.updatePromises(),!!this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=null,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises(),this.oncancel)){var n=new Up(null,this,this.currentTime,null);setTimeout(function(){t.oncancel(n)})}}},{key:"reverse",value:function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),t!==null&&(this.currentTime=t),this.updatePromises()}},{key:"updatePlaybackRate",value:function(t){this.playbackRate=t}},{key:"targetAnimations",value:function(){var t,n=(t=this.effect)===null||t===void 0?void 0:t.target;return n.getAnimations()}},{key:"markTarget",value:function(){var t=this.targetAnimations();t.indexOf(this)===-1&&t.push(this)}},{key:"unmarkTarget",value:function(){var t=this.targetAnimations(),n=t.indexOf(this);n!==-1&&t.splice(n,1)}},{key:"tick",value:function(t,n){!this._idle&&!this._paused&&(this._startTime===null?n&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),n&&(this.currentTimePending=!1,this.fireEvents(t))}},{key:"rewind",value:function(){if(this.playbackRate>=0)this.currentTime=0;else if(this._totalDuration<1/0)this.currentTime=this._totalDuration;else throw new Error("Unable to rewind negative playback rate animation with infinite duration")}},{key:"persist",value:function(){throw new Error(mt)}},{key:"addEventListener",value:function(t,n,i){throw new Error(mt)}},{key:"removeEventListener",value:function(t,n,i){throw new Error(mt)}},{key:"dispatchEvent",value:function(t){throw new Error(mt)}},{key:"commitStyles",value:function(){throw new Error(mt)}},{key:"ensureAlive",value:function(){if(this.playbackRate<0&&this.currentTime===0){var t;this._inEffect=!!((t=this.effect)!==null&&t!==void 0&&t.update(-1))}else{var n;this._inEffect=!!((n=this.effect)!==null&&n!==void 0&&n.update(this.currentTime))}!this._inTimeline&&(this._inEffect||!this._finishedFlag)&&(this._inTimeline=!0,this.timeline.animations.push(this))}},{key:"tickCurrentTime",value:function(t,n){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!n&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())}},{key:"fireEvents",value:function(t){var n=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var i=new Up(null,this,this.currentTime,t);setTimeout(function(){n.onfinish&&n.onfinish(i)})}this._finishedFlag=!0}}else{if(this.onframe&&this.playState==="running"){var a=new Up(null,this,this.currentTime,t);this.onframe(a)}this._finishedFlag=!1}}}])})(),w8=4,B8=.001,b8=1e-7,E8=10,il=11,Qu=1/(il-1),x8=typeof Float32Array=="function",X2=function(e,t){return 1-3*t+3*e},Z2=function(e,t){return 3*t-6*e},J2=function(e){return 3*e},Uu=function(e,t,n){return((X2(t,n)*e+Z2(t,n))*e+J2(t))*e},eS=function(e,t,n){return 3*X2(t,n)*e*e+2*Z2(t,n)*e+J2(t)},C8=function(e,t,n,i,a){var s,o,A=0;do o=t+(n-t)/2,s=Uu(o,i,a)-e,s>0?n=o:t=o;while(Math.abs(s)>b8&&++A<E8);return o},S8=function(e,t,n,i){for(var a=0;a<w8;++a){var s=eS(t,n,i);if(s===0)return t;var o=Uu(t,n,i)-e;t-=o/s}return t},Pp=function(e,t,n,i){if(!(e>=0&&e<=1&&n>=0&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(e===t&&n===i)return function(A){return A};for(var a=x8?new Float32Array(il):new Array(il),s=0;s<il;++s)a[s]=Uu(s*Qu,e,n);var o=function(l){for(var c=0,u=1,h=il-1;u!==h&&a[u]<=l;++u)c+=Qu;--u;var d=(l-a[u])/(a[u+1]-a[u]),f=c+d*Qu,g=eS(f,e,n);return g>=B8?S8(l,f,e,n):g===0?f:C8(l,c,c+Qu,e,n)};return function(A){return A===0||A===1?A:Uu(o(A),t,i)}},F8=function(e){return e=e.replace(/([A-Z])/g,function(t){return"-".concat(t.toLowerCase())}),e.charAt(0)==="-"?e.substring(1):e},Pu=function(e){return Math.pow(e,2)},Ru=function(e){return Math.pow(e,3)},Du=function(e){return Math.pow(e,4)},Hu=function(e){return Math.pow(e,5)},Gu=function(e){return Math.pow(e,6)},Ku=function(e){return 1-Math.cos(e*Math.PI/2)},zu=function(e){return 1-Math.sqrt(1-e*e)},Vu=function(e){return e*e*(3*e-2)},ju=function(e){for(var t,n=4;e<((t=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((t*3-2)/22-e,2)},Wu=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=$e(t,2),i=n[0],a=i===void 0?1:i,s=n[1],o=s===void 0?.5:s,A=Yt(Number(a),1,10),l=Yt(Number(o),.1,2);return e===0||e===1?e:-A*Math.pow(2,10*(e-1))*Math.sin((e-1-l/(Math.PI*2)*Math.asin(1/A))*(Math.PI*2)/l)},al=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,i=$e(t,4),a=i[0],s=a===void 0?1:a,o=i[1],A=o===void 0?100:o,l=i[2],c=l===void 0?10:l,u=i[3],h=u===void 0?0:u;s=Yt(s,.1,1e3),A=Yt(A,.1,1e3),c=Yt(c,.1,1e3),h=Yt(h,.1,1e3);var d=Math.sqrt(A/s),f=c/(2*Math.sqrt(A*s)),g=f<1?d*Math.sqrt(1-f*f):0,p=1,v=f<1?(f*d+-h)/g:-h+d,y=n?n*e/1e3:e;return f<1?y=Math.exp(-y*f*d)*(p*Math.cos(g*y)+v*Math.sin(g*y)):y=(p+v*y)*Math.exp(-y*d),e===0||e===1?e:1-y},Rp=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=t,i=$e(n,2),a=i[0],s=a===void 0?10:a,o=i[1],A=o==="start"?Math.ceil:Math.floor;return A(Yt(e,0,1)*s)/s},tS=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=$e(t,4),i=n[0],a=n[1],s=n[2],o=n[3];return Pp(i,a,s,o)(e)},qu=Pp(.42,0,1,1),ni=function(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;return 1-e(1-t,n,i)}},ri=function(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;return t<.5?e(t*2,n,i)/2:1-e(t*-2+2,n,i)/2}},ii=function(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;return t<.5?(1-e(1-t*2,n,i))/2:(e(t*2-1,n,i)+1)/2}},nS={steps:Rp,"step-start":function(e){return Rp(e,[1,"start"])},"step-end":function(e){return Rp(e,[1,"end"])},linear:function(e){return e},"cubic-bezier":tS,ease:function(e){return tS(e,[.25,.1,.25,1])},in:qu,out:ni(qu),"in-out":ri(qu),"out-in":ii(qu),"in-quad":Pu,"out-quad":ni(Pu),"in-out-quad":ri(Pu),"out-in-quad":ii(Pu),"in-cubic":Ru,"out-cubic":ni(Ru),"in-out-cubic":ri(Ru),"out-in-cubic":ii(Ru),"in-quart":Du,"out-quart":ni(Du),"in-out-quart":ri(Du),"out-in-quart":ii(Du),"in-quint":Hu,"out-quint":ni(Hu),"in-out-quint":ri(Hu),"out-in-quint":ii(Hu),"in-expo":Gu,"out-expo":ni(Gu),"in-out-expo":ri(Gu),"out-in-expo":ii(Gu),"in-sine":Ku,"out-sine":ni(Ku),"in-out-sine":ri(Ku),"out-in-sine":ii(Ku),"in-circ":zu,"out-circ":ni(zu),"in-out-circ":ri(zu),"out-in-circ":ii(zu),"in-back":Vu,"out-back":ni(Vu),"in-out-back":ri(Vu),"out-in-back":ii(Vu),"in-bounce":ju,"out-bounce":ni(ju),"in-out-bounce":ri(ju),"out-in-bounce":ii(ju),"in-elastic":Wu,"out-elastic":ni(Wu),"in-out-elastic":ri(Wu),"out-in-elastic":ii(Wu),spring:al,"spring-in":al,"spring-out":ni(al),"spring-in-out":ri(al),"spring-out-in":ii(al)},T8=function(e){return F8(e).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()},M8=function(e){return nS[T8(e)]||nS.linear},O8=function(e){return e},I8=1,_8=.5,rS=0;function iS(r,e){return function(t){if(t>=1)return 1;var n=1/r;return t+=e*n,t-t%n}}var $u="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",k8=new RegExp("cubic-bezier\\(".concat($u,",").concat($u,",").concat($u,",").concat($u,"\\)")),N8=/steps\(\s*(\d+)\s*\)/,L8=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Dp(r){var e=k8.exec(r);if(e)return Pp.apply(void 0,tt(e.slice(1).map(Number)));var t=N8.exec(r);if(t)return iS(Number(t[1]),rS);var n=L8.exec(r);return n?iS(Number(n[1]),{start:I8,middle:_8,end:rS}[n[2]]):M8(r)}function Q8(r){return Math.abs(U8(r)/(r.playbackRate||1))}function U8(r){var e;return r.duration===0||r.iterations===0?0:(r.duration==="auto"?0:Number(r.duration))*((e=r.iterations)!==null&&e!==void 0?e:1)}var aS=0,Hp=1,Yu=2,sS=3;function P8(r,e,t){if(e===null)return aS;var n=t.endTime;return e<Math.min(t.delay,n)?Hp:e>=Math.min(t.delay+r+t.endDelay,n)?Yu:sS}function R8(r,e,t,n,i){switch(n){case Hp:return e==="backwards"||e==="both"?0:null;case sS:return t-i;case Yu:return e==="forwards"||e==="both"?r:null;case aS:return null}}function D8(r,e,t,n,i){var a=i;return r===0?e!==Hp&&(a+=t):a+=n/r,a}function H8(r,e,t,n,i,a){var s=r===1/0?e%1:r%1;return s===0&&t===Yu&&n!==0&&(i!==0||a===0)&&(s=1),s}function G8(r,e,t,n){return r===Yu&&e===1/0?1/0:t===1?Math.floor(n)-1:Math.floor(n)}function K8(r,e,t){var n=r;if(r!=="normal"&&r!=="reverse"){var i=e;r==="alternate-reverse"&&(i+=1),n="normal",i!==1/0&&i%2!==0&&(n="reverse")}return n==="normal"?t:1-t}function z8(r,e,t){var n=P8(r,e,t),i=R8(r,t.fill,e,n,t.delay);if(i===null)return null;var a=t.duration==="auto"?0:t.duration,s=D8(a,n,t.iterations,i,t.iterationStart),o=H8(s,t.iterationStart,n,t.iterations,i,a),A=G8(n,t.iterations,o,s),l=K8(t.direction,A,o);return t.currentIteration=A,t.progress=l,t.easingFunction(l)}function V8(r,e,t){var n=j8(r,e),i=W8(n,t);return function(a,s){if(s!==null)i.filter(function(A){return s>=A.applyFrom&&s<A.applyTo}).forEach(function(A){var l=s-A.startOffset,c=A.endOffset-A.startOffset,u=c===0?0:l/c;a.setAttribute(A.property,A.interpolation(u),!1,!1)});else for(var o in n)oS(o)&&a.setAttribute(o,null)}}function oS(r){return r!=="offset"&&r!=="easing"&&r!=="composite"&&r!=="computedOffset"}function j8(r,e){for(var t={},n=0;n<r.length;n++)for(var i in r[n])if(oS(i)){var a={offset:r[n].offset,computedOffset:r[n].computedOffset,easing:r[n].easing,easingFunction:Dp(r[n].easing)||e.easingFunction,value:r[n][i]};t[i]=t[i]||[],t[i].push(a)}return t}function W8(r,e){var t=[];for(var n in r)for(var i=r[n],a=0;a<i.length-1;a++){var s=a,o=a+1,A=i[s].computedOffset,l=i[o].computedOffset,c=A,u=l;a===0&&(c=-1/0,l===0&&(o=s)),a===i.length-2&&(u=1/0,A===1&&(s=o)),t.push({applyFrom:c,applyTo:u,startOffset:i[s].computedOffset,endOffset:i[o].computedOffset,easingFunction:i[s].easingFunction,property:n,interpolation:q8(n,i[s].value,i[o].value,e)})}return t.sort(function(h,d){return h.startOffset-d.startOffset}),t}var AS=function(e,t,n){return function(i){var a=lS(e,t,i);return Be(a)?a:n(a)}};function q8(r,e,t,n){var i=Fx[r];if(i&&i.syntax&&i.int){var a=he.styleValueRegistry.getPropertySyntax(i.syntax);if(a){var s=a.parser,o=s?s(e,n):e,A=s?s(t,n):t,l=a.mixer(o,A,n);if(l){var c=AS.apply(void 0,tt(l));return function(u){return u===0?e:u===1?t:c(u)}}}}return AS(!1,!0,function(u){return u?t:e})}function lS(r,e,t){if(typeof r=="number"&&typeof e=="number")return r*(1-t)+e*t;if(typeof r=="boolean"&&typeof e=="boolean"||typeof r=="string"&&typeof e=="string")return t<.5?r:e;if(Array.isArray(r)&&Array.isArray(e)){for(var n=r.length,i=e.length,a=Math.max(n,i),s=[],o=0;o<a;o++)s.push(lS(r[o<n?o:n-1],e[o<i?o:i-1],t));return s}throw new Error("Mismatched interpolation arguments ".concat(r,":").concat(e))}var $8=(function(){function r(){le(this,r),this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=O8,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null}return ce(r,[{key:"easing",get:function(){return this._easing},set:function(t){this.easingFunction=Dp(t),this._easing=t}}])})();function Y8(r){var e=[];for(var t in r)if(!(t in["easing","offset","composite"])){var n=r[t];Array.isArray(n)||(n=[n]);for(var i=n.length,a=0;a<i;a++){if(!e[a]){var s={};"offset"in r&&(s.offset=Number(r.offset)),"easing"in r&&(s.easing=r.easing),"composite"in r&&(s.composite=r.composite),e[a]=s}n[a]!==void 0&&n[a]!==null&&(e[a][t]=n[a])}}return e.sort(function(o,A){return(o.computedOffset||0)-(A.computedOffset||0)}),e}function cS(r,e){if(r===null)return[];Array.isArray(r)||(r=Y8(r));for(var t=r.map(function(A){var l={};e!=null&&e.composite&&(l.composite="auto");for(var c in A){var u=A[c];if(c==="offset"){if(u!==null){if(u=Number(u),!isFinite(u))throw new Error("Keyframe offsets must be numbers.");if(u<0||u>1)throw new Error("Keyframe offsets must be between 0 and 1.");l.computedOffset=u}}else if(c==="composite"&&["replace","add","accumulate","auto"].indexOf(u)===-1)throw new Error("".concat(u," compositing is not supported"));l[c]=u}return l.offset===void 0&&(l.offset=null),l.easing===void 0&&(l.easing=e?.easing||"linear"),l.composite===void 0&&(l.composite="auto"),l}),n=!0,i=-1/0,a=0;a<t.length;a++){var s=t[a].offset;if(ke(s))n=!1;else{if(s<i)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=s}}t=t.filter(function(A){return Number(A.offset)>=0&&Number(A.offset)<=1});function o(){var A,l=t,c=l.length;if(t[c-1].computedOffset=Number((A=t[c-1].offset)!==null&&A!==void 0?A:1),c>1){var u;t[0].computedOffset=Number((u=t[0].offset)!==null&&u!==void 0?u:0)}for(var h=0,d=Number(t[0].computedOffset),f=1;f<c;f++){var g=t[f].computedOffset;if(!ke(g)&&!ke(d)){for(var p=1;p<f-h;p++)t[h+p].computedOffset=d+(Number(g)-d)*p/(f-h);h=f,d=Number(g)}}}return n||o(),t}var X8="backwards|forwards|both|none".split("|"),Z8="reverse|alternate|alternate-reverse".split("|");function J8(r,e){var t=new $8;return typeof r=="number"&&!isNaN(r)?t.duration=r:r!==void 0&&Object.keys(r).forEach(function(n){if(r[n]!==void 0&&r[n]!==null&&r[n]!=="auto"){if((typeof t[n]=="number"||n==="duration")&&(typeof r[n]!="number"||isNaN(r[n]))||n==="fill"&&X8.indexOf(r[n])===-1||n==="direction"&&Z8.indexOf(r[n])===-1)return;t[n]=r[n]}}),t}function eV(r,e){return r=tV(r??{duration:"auto"}),J8(r)}function tV(r){return typeof r=="number"&&(isNaN(r)?r={duration:"auto"}:r={duration:r}),r}var nV=(function(){function r(e,t,n){var i=this;le(this,r),this.composite="replace",this.iterationComposite="replace",this.target=e,this.timing=eV(n),this.timing.effect=this,this.timing.activeDuration=Q8(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=cS(t,this.timing),this.interpolations=V8(this.normalizedKeyframes,this.timing,this.target);var a=he.globalThis.Proxy;this.computedTiming=a?new a(this.timing,{get:function(o,A){return A==="duration"?o.duration==="auto"?0:o.duration:A==="fill"?o.fill==="auto"?"none":o.fill:A==="localTime"?i.animation&&i.animation.currentTime||null:A==="currentIteration"?!i.animation||i.animation.playState!=="running"?null:o.currentIteration||0:A==="progress"?!i.animation||i.animation.playState!=="running"?null:o.progress||0:o[A]},set:function(){return!0}}):this.timing}return ce(r,[{key:"applyInterpolations",value:function(){this.interpolations(this.target,Number(this.timeFraction))}},{key:"update",value:function(t){return t===null?!1:(this.timeFraction=z8(this.timing.activeDuration,t,this.timing),this.timeFraction!==null)}},{key:"getKeyframes",value:function(){return this.normalizedKeyframes}},{key:"setKeyframes",value:function(t){this.normalizedKeyframes=cS(t)}},{key:"getComputedTiming",value:function(){return this.computedTiming}},{key:"getTiming",value:function(){return this.timing}},{key:"updateTiming",value:function(t){var n=this;Object.keys(t||{}).forEach(function(i){n.timing[i]=t[i]})}}])})();function uS(r,e){return Number(r.id)-Number(e.id)}var rV=(function(){function r(e){var t=this;le(this,r),this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.webAnimationsNextTick=function(n){t.currentTime=n,t.discardAnimations(),t.animations.length===0?t.timelineTicking=!1:t.requestAnimationFrame(t.webAnimationsNextTick)},this.processRafCallbacks=function(n){var i=t.rafCallbacks;t.rafCallbacks=[],n<Number(t.currentTime)&&(n=Number(t.currentTime)),t.animations.sort(uS),t.animations=t.tick(n,!0,t.animations)[0],i.forEach(function(a){a[1](n)}),t.applyPendingEffects()},this.document=e}return ce(r,[{key:"getAnimations",value:function(){return this.discardAnimations(),this.animations.slice()}},{key:"isTicking",value:function(){return this.inTick}},{key:"play",value:function(t,n,i){var a=new nV(t,n,i),s=new m8(a,this);return this.animations.push(s),this.restartWebAnimationsNextTick(),s.updatePromises(),s.play(),s.updatePromises(),s}},{key:"applyDirtiedAnimation",value:function(t){var n=this;if(!this.inTick){t.markTarget();var i=t.targetAnimations();i.sort(uS);var a=this.tick(Number(this.currentTime),!1,i.slice())[1];a.forEach(function(s){var o=n.animations.indexOf(s);o!==-1&&n.animations.splice(o,1)}),this.applyPendingEffects()}}},{key:"restart",value:function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame(function(){}),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame}},{key:"destroy",value:function(){this.document.defaultView.cancelAnimationFrame(this.frameId)}},{key:"applyPendingEffects",value:function(){this.pendingEffects.forEach(function(t){t?.applyInterpolations()}),this.pendingEffects=[]}},{key:"updateAnimationsPromises",value:function(){this.animationsWithPromises=this.animationsWithPromises.filter(function(t){return t.updatePromises()})}},{key:"discardAnimations",value:function(){this.updateAnimationsPromises(),this.animations=this.animations.filter(function(t){return t.playState!=="finished"&&t.playState!=="idle"})}},{key:"restartWebAnimationsNextTick",value:function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))}},{key:"rAF",value:function(t){var n=this.rafId++;return this.rafCallbacks.length===0&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([n,t]),n}},{key:"requestAnimationFrame",value:function(t){var n=this;return this.rAF(function(i){n.updateAnimationsPromises(),t(i),n.updateAnimationsPromises()})}},{key:"tick",value:function(t,n,i){var a=this,s,o;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var A=[],l=[],c=[],u=[];return i.forEach(function(h){h.tick(t,n),h._inEffect?(l.push(h.effect),h.markTarget()):(A.push(h.effect),h.unmarkTarget()),h._needsTick&&(a.ticking=!0);var d=h._inEffect||h._needsTick;h._inTimeline=d,d?c.push(h):u.push(h)}),(s=this.pendingEffects).push.apply(s,A),(o=this.pendingEffects).push.apply(o,l),this.ticking&&this.requestAnimationFrame(function(){}),this.inTick=!1,[c,u]}}])})();he.EasingFunction=Dp,he.AnimationTimeline=rV;var iV=(function(r){function e(){var t;le(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t=We(this,e,[].concat(i)),t.landmarks=[],t}return qe(e,r),ce(e,[{key:"rotate",value:function(n,i,a){if(this.relElevation=Eo(i),this.relAzimuth=Eo(n),this.relRoll=Eo(a),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===wt.EXPLORING){var s=Ia(vn(),[1,0,0],ft((this.rotateWorld?1:-1)*this.relElevation)),o=Ia(vn(),[0,1,0],ft((this.rotateWorld?1:-1)*this.relAzimuth)),A=Ia(vn(),[0,0,1],ft(this.relRoll)),l=_a(vn(),o,s);l=_a(vn(),l,A);var c=Df(Ct(),l);fo(this.matrix,this.matrix,[0,0,-this.distance]),Xn(this.matrix,this.matrix,c),fo(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===wt.ORBITING||this.type===wt.EXPLORING?this._getPosition():this.type===wt.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(n,i){var a=Ar(n,i,0),s=ia(this.position);return Oa(s,s,oc(Je(),this.right,a[0])),Oa(s,s,oc(Je(),this.up,a[1])),this._setPosition(s),this.triggerUpdate(),this}},{key:"dolly",value:function(n){var i=this.forward,a=ia(this.position),s=n*this.dollyingStep,o=this.distance+n*this.dollyingStep;return s=Math.max(Math.min(o,this.maxDistance),this.minDistance)-this.distance,a[0]+=s*i[0],a[1]+=s*i[1],a[2]+=s*i[2],this._setPosition(a),this.type===wt.ORBITING||this.type===wt.EXPLORING?this._getDistance():this.type===wt.TRACKING&&Oa(this.focalPoint,a,this.distanceVector),this.triggerUpdate(),this}},{key:"cancelLandmarkAnimation",value:function(){this.landmarkAnimationID!==void 0&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)}},{key:"createLandmark",value:function(n){var i,a,s,o,A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=A.position,c=l===void 0?this.position:l,u=A.focalPoint,h=u===void 0?this.focalPoint:u,d=A.roll,f=A.zoom,g=new he.CameraContribution;g.setType(this.type,void 0),g.setPosition(c[0],(i=c[1])!==null&&i!==void 0?i:this.position[1],(a=c[2])!==null&&a!==void 0?a:this.position[2]),g.setFocalPoint(h[0],(s=h[1])!==null&&s!==void 0?s:this.focalPoint[1],(o=h[2])!==null&&o!==void 0?o:this.focalPoint[2]),g.setRoll(d??this.roll),g.setZoom(f??this.zoom);var p={name:n,matrix:Hb(g.getWorldTransform()),right:ia(g.right),up:ia(g.up),forward:ia(g.forward),position:ia(g.getPosition()),focalPoint:ia(g.getFocalPoint()),distanceVector:ia(g.getDistanceVector()),distance:g.getDistance(),dollyingStep:g.getDollyingStep(),azimuth:g.getAzimuth(),elevation:g.getElevation(),roll:g.getRoll(),relAzimuth:g.relAzimuth,relElevation:g.relElevation,relRoll:g.relRoll,zoom:g.getZoom()};return this.landmarks.push(p),p}},{key:"gotoLandmark",value:function(n){var i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=ot(n)?this.landmarks.find(function(k){return k.name===n}):n;if(s){var o=Be(a)?{duration:a}:a,A=o.easing,l=A===void 0?"linear":A,c=o.duration,u=c===void 0?100:c,h=o.easingFunction,d=h===void 0?void 0:h,f=o.onfinish,g=f===void 0?void 0:f,p=o.onframe,v=p===void 0?void 0:p,y=.01;this.cancelLandmarkAnimation();var m=s.position,B=s.focalPoint,C=s.zoom,S=s.roll,F=d||he.EasingFunction(l),T,O=function(){i.setFocalPoint(B),i.setPosition(m),i.setRoll(S),i.setZoom(C),i.computeMatrix(),i.triggerUpdate(),g?.()};if(u===0)return O();var I=function(N){T===void 0&&(T=N);var U=N-T;if(U>=u){O();return}var D=F(U/u),G=Je(),Z=Je(),q=1,j=0;Kf(G,i.focalPoint,B,D),Kf(Z,i.position,m,D),j=i.roll*(1-D)+S*D,q=i.zoom*(1-D)+C*D,i.setFocalPoint(G),i.setPosition(Z),i.setRoll(j),i.setZoom(q);var te=sE(G,B)+sE(Z,m);if(te<=y&&C===void 0&&S===void 0)return O();i.computeMatrix(),i.triggerUpdate(),U<u&&(v?.(D),i.landmarkAnimationID=i.canvas.requestAnimationFrame(I))};this.canvas.requestAnimationFrame(I)}}}])})(VE);he.CameraContribution=iV;var aV=["body","startHead","endHead","startHeadOffset","endHeadOffset"],sV=["body","startHead","endHead","startHeadOffset","endHeadOffset"],oV=["body","startHead","endHead","startHeadOffset","endHeadOffset"],hS=(function(r){function e(t){var n;le(this,e),n=We(this,e,[De(De({},t),{},{type:e.tag})]);var i=n.attributes,a=i.body,s=i.startHead,o=i.endHead;i.startHeadOffset,i.endHeadOffset;var A=Pi(i,aV);if(!a)throw new Error("Arrow's body is required");return n.body=a,n.appendChild(n.body),n.handleBodyAttributeChanged(n.body),s&&n.appendArrowHead(n.getArrowHeadType(s),!0),o&&n.appendArrowHead(n.getArrowHeadType(o),!1),n.applyArrowStyle(A,[n.body,n.startHead,n.endHead]),n}return qe(e,r),ce(e,[{key:"handleBodyAttributeChanged",value:function(n){var i=this;n.addEventListener(at.ATTR_MODIFIED,function(a){var s=a.attrName;s==="x1"||s==="y1"?i.startHead&&i.transformArrowHead(i.startHead,!0):(s==="x2"||s==="y2")&&i.endHead&&i.transformArrowHead(i.endHead,!1)})}},{key:"getBody",value:function(){return this.body}},{key:"getStartHead",value:function(){return this.startHead}},{key:"getEndHead",value:function(){return this.endHead}},{key:"attributeChangedCallback",value:function(n,i,a){if(n==="opacity"||n==="strokeOpacity"||n==="stroke"||n==="lineWidth"||n==="increasedLineWidthForHitTesting")this.applyArrowStyle(be({},n,a),[this.body,this.startHead,this.endHead]);else if(n==="startHead"||n==="endHead"){var s=n==="startHead";if(this.destroyArrowHead(s),a){var o=this.attributes;o.body,o.startHead,o.endHead,o.startHeadOffset,o.endHeadOffset;var A=Pi(o,sV);this.appendArrowHead(this.getArrowHeadType(a),s),this.applyArrowStyle(A,[s?this.startHead:this.endHead])}}else if(n==="body"){var l=this.attributes;l.body,l.startHead,l.endHead,l.startHeadOffset,l.endHeadOffset;var c=Pi(l,oV);this.body.destroy(),this.body=a,this.appendChild(this.body),this.applyArrowStyle(c,[this.body])}else n==="startHeadOffset"?this.moveArrowHeadAlongTangent(a,!0):n==="endHeadOffset"&&this.moveArrowHeadAlongTangent(a,!1)}},{key:"getArrowHeadType",value:function(n){return typeof n=="boolean"?"default":"custom"}},{key:"appendArrowHead",value:function(n,i){var a;n==="default"?a=this.createDefaultArrowHead():a=i?this.attributes.startHead:this.attributes.endHead,this.transformArrowHead(a,i),a.setAttribute("zIndex",1),i?this.startHead=a:this.endHead=a,this.appendChild(a);var s=i?this.attributes.startHeadOffset:this.attributes.endHeadOffset;s&&this.moveArrowHeadAlongTangent(s,i)}},{key:"transformArrowHead",value:function(n,i){var a=Je(),s=0,o=0,A=0,l=0,c=0,u=this.body&&this.body.nodeName;if(u===re.LINE){var h=this.body.attributes,d=h.x1,f=h.x2,g=h.y1,p=h.y2;o=i?f:d,A=i?d:f,l=i?p:g,c=i?g:p}else if(u===re.POLYLINE){var v=this.body.attributes.points,y=v.length;o=i?v[1][0]:v[y-2][0],l=i?v[1][1]:v[y-2][1],A=i?v[0][0]:v[y-1][0],c=i?v[0][1]:v[y-1][1]}else if(u===re.PATH){var m=this.getTangent(this.body,i),B=$e(m,2),C=B[0],S=B[1];o=C[0],l=C[1],A=S[0],c=S[1]}var F=o-A,T=l-c;s=Math.atan2(T,F),a=St(A,c,0),i?(this.startHeadPosition=a,this.startHeadRad=s):(this.endHeadPosition=a,this.endHeadRad=s),n.setLocalPosition(a),n.setLocalEulerAngles(s*180/Math.PI+n.getLocalEulerAngles())}},{key:"moveArrowHeadAlongTangent",value:function(n,i){var a=i?this.startHead:this.endHead;a&&a.setLocalPosition(aE(Je(),i?this.startHeadPosition:this.endHeadPosition,St(Math.cos(i?this.startHeadRad:this.endHeadRad)*n,Math.sin(i?this.startHeadRad:this.endHeadRad)*n,0))),this.body}},{key:"destroyArrowHead",value:function(n){n&&this.startHead&&(this.startHead.destroy(),this.startHead=void 0),!n&&this.endHead&&(this.endHead.destroy(),this.endHead=void 0)}},{key:"getTangent",value:function(n,i){return i?n.getStartTangent():n.getEndTangent()}},{key:"createDefaultArrowHead",value:function(){var n=this.attributes,i=n.stroke,a=n.lineWidth,s=Math.sin,o=Math.cos,A=Math.PI,l=10*o(A/6);return new tr({style:{d:"M".concat(l/2,",").concat(10*s(A/6)," L-").concat(l/2,",0 L").concat(l/2,",-").concat(10*s(A/6)),stroke:i,lineWidth:a,transformOrigin:"center"}})}},{key:"applyArrowStyle",value:function(n,i){var a=n.opacity,s=n.stroke,o=n.strokeOpacity,A=n.lineWidth,l=n.increasedLineWidthForHitTesting;i.forEach(function(c){c&&(ke(a)||(c.style.opacity=a),ke(s)||(c.style.stroke=s),ke(o)||(c.style.strokeOpacity=o),ke(A)||(c.style.lineWidth=A),ke(l)||(c.style.increasedLineWidthForHitTesting=l))})}}])})(QA);hS.tag="arrow",hS.PARSED_STYLE_LIST=new Set([].concat(tt(QA.PARSED_STYLE_LIST),["body","startHead","endHead","startHeadOffset","endHeadOffset","stroke","lineWidth","opacity","strokeOpacity"]));var Gp=Math.PI,AV=Gp*2,sl=Math.sin,Xu=Math.cos,lV=Math.acos,rr=Math.atan2,ol=Math.sqrt,Kp=Math.max,qi=Math.min,Po=1e-4,cV=[{name:"sr",inherits:!1,interpolable:!0,syntax:ve.LENGTH_PERCENTAGE},{name:"sr0",inherits:!1,interpolable:!0,syntax:ve.LENGTH_PERCENTAGE},{name:"startAngle",inherits:!1,interpolable:!0,syntax:ve.ANGLE},{name:"endAngle",inherits:!1,interpolable:!0,syntax:ve.ANGLE}];cV.forEach(function(r){i6.registerProperty(r)});var mi=function(e,t,n,i){return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}};function uV(r,e,t,n,i,a,s,o){var A=t-r,l=n-e,c=s-i,u=o-a,h=u*A-c*l;if(!(h*h<Po))return h=(c*(e-a)-u*(r-i))/h,[r+h*A,e+h*l]}function Zu(r,e,t,n,i,a,s){var o=r-t,A=e-n,l=a/ol(o*o+A*A),c=l*A,u=-l*o,h=r+c,d=e+u,f=t+c,g=n+u,p=(h+f)/2,v=(d+g)/2,y=f-h,m=g-d,B=y*y+m*m,C=i-a,S=h*g-f*d,F=(m<0?-1:1)*ol(Kp(0,C*C*B-S*S)),T=(S*m-y*F)/B,O=(-S*y-m*F)/B,I=(S*m+y*F)/B,k=(-S*y+m*F)/B,N=T-p,U=O-v,D=I-p,G=k-v;return N*N+U*U>D*D+G*G&&(T=I,O=k),{cx:T,cy:O,x0:-c,y0:-u,x1:T*(i/C-1),y1:O*(i/C-1)}}function ca(r,e){return e=e<0&&r>=0?e+AV:e,e-r<=Gp?0:1}var hV=(function(r){function e(t){var n;return le(this,e),n=We(this,e,[t]),n.updatePath(),n}return qe(e,r),ce(e,[{key:"setAttribute",value:function(n,i,a){wc(e,"setAttribute",this)([n,i,a]),["startAngle","endAngle","sr","sr0","radius"].indexOf(n)>-1&&this.updatePath()}},{key:"updatePath",value:function(){var n=this.parsedStyle,i=n.x,a=n.y,s=n.startAngle,o=n.endAngle,A=n.sr,l=n.sr0,c=n.radius,u=this.createPath(i,a,s?ft(s):0,o?ft(o):Math.PI*2,A||0,l||0,c||[0,0,0,0]);wc(e,"setAttribute",this)(["d",u])}},{key:"createPath",value:function(n,i,a,s,o,A,l){if(!(o<=0)){var c=mi(n,i,o,a),u=mi(n,i,o,s),h=mi(n,i,A,a),d=mi(n,i,A,s);if(vo(s-a,Math.PI*2)){var f=mi(n,i,o,a+Math.PI),g=mi(n,i,A,a+Math.PI),p=[["M",c.x,c.y],["A",o,o,0,1,1,f.x,f.y],["A",o,o,0,1,1,u.x,u.y],["M",h.x,h.y]];return A&&(p.push(["A",A,A,0,1,0,g.x,g.y]),p.push(["A",A,A,0,1,0,d.x,d.y])),p.push(["M",c.x,c.y]),p.push(["Z"]),p}var v=s-a,y=o*Xu(a),m=o*sl(a),B=A*Xu(s),C=A*sl(s),S=o*Xu(s),F=o*sl(s),T=A*Xu(a),O=A*sl(a),I=$e(l,4),k=I[0],N=I[1],U=I[2],D=I[3],G=(o-A)/2,Z=qi(G,k),q=qi(G,N),j=qi(G,U),te=qi(G,D),ue=Kp(Z,q),ge=Kp(j,te),Y=ue,xe=ge;if((ue>Po||ge>Po)&&v<Gp){var $=uV(y,m,T,O,S,F,B,C);if($){var K=y-$[0],ee=m-$[1],oe=S-$[0],Ee=F-$[1],Le=1/sl(lV((K*oe+ee*Ee)/(ol(K*K+ee*ee)*ol(oe*oe+Ee*Ee)))/2),Pe=ol($[0]*$[0]+$[1]*$[1]);Y=qi(ue,(o-Pe)/(Le+1)),xe=qi(ge,(A-Pe)/(Le-1))}}var st=ca(a,s),ut=[];if(Y>Po){var ht=qi(k,Y),Et=qi(N,Y),Ue=Zu(T,O,y,m,o,ht),vt=Zu(S,F,B,C,o,Et);if(ut.push(["M",n+Ue.cx+Ue.x0,i+Ue.cy+Ue.y0]),Y<ue&&ht===Et){var it=rr(Ue.y0,Ue.x0),_r=rr(vt.y0,vt.x0);ut.push(["A",Y,Y,0,ca(it,_r),1,n+vt.cx+vt.x0,i+vt.cy+vt.y0])}else{if(ht>0){var It=rr(Ue.y0,Ue.x0),Ca=rr(Ue.y1,Ue.x1),vr=mi(n,i,o,Ca);ut.push(["A",ht,ht,0,ca(It,Ca),1,vr.x,vr.y])}var tn=rr(Ue.cy+Ue.y1,Ue.cx+Ue.x1),Qt=rr(vt.cy+vt.y1,vt.cx+vt.x1),qn=mi(n,i,o,Qt);if(ut.push(["A",o,o,0,ca(tn,Qt),1,qn.x,qn.y]),Et>0){var sr=rr(vt.y1,vt.x1),kr=rr(vt.y0,vt.x0);ut.push(["A",Et,Et,0,ca(sr,kr),1,n+vt.cx+vt.x0,i+vt.cy+vt.y0])}}}else ut.push(["M",c.x,c.y]),ut.push(["A",o,o,0,st,1,u.x,u.y]);if(A<Po)ut.push(["L",d.x,d.y]);else if(xe>Po){var yr=qi(D,xe),or=qi(U,xe),fn=Zu(B,C,0,0,A-o,or),gn=Zu(0,0,T,O,A-o,yr);if(ut.push(["L",n+fn.cx+fn.x0,i+fn.cy+fn.y0]),xe<ge&&yr===or){var tc=rr(fn.y0,fn.x0),co=rr(gn.y0,gn.x0),jr=mi(n,i,A,co);ut.push(["A",Y,Y,0,ca(tc,co),1,jr.x,jr.y])}else{if(or>0){var hi=rr(fn.y0,fn.x0),Tf=rr(fn.y1,fn.x1),Mf=mi(n,i,A-o,Tf);ut.push(["A",or,or,0,ca(hi,Tf),1,Mf.x,Mf.y])}var _b=rr(fn.cy+fn.y1,fn.cx+fn.x1),Of=rr(gn.cy+gn.y1,gn.cx+gn.x1),Sa=mi(n,i,A,Of);if(ut.push(["A",A,A,0,ca(Of,_b),0,Sa.x,Sa.y]),ut.push(["L",Sa.x,Sa.y]),yr>0){var If=rr(gn.y1,gn.x1),_f=rr(gn.y0,gn.x0);ut.push(["A",yr,yr,0,ca(If,_f),1,n+gn.cx+gn.x0,i+gn.cy+gn.y0])}}}else ut.push(["L",d.x,d.y]),ut.push(["A",A,A,0,st,0,h.x,h.y]);return ut.push(["Z"]),ut}}}])})(tr);hV.PARSED_STYLE_LIST=new Set([].concat(tt(tr.PARSED_STYLE_LIST),["x","y","sr","sr0","radius","startAngle","endAngle"]));const dV={duration:500},fV={duration:1e3,easing:"cubic-bezier(0.250, 0.460, 0.450, 0.940)",iterations:1,fill:"both"};var Dt;(function(r){r.NodeAdded="NodeAdded",r.NodeUpdated="NodeUpdated",r.NodeRemoved="NodeRemoved",r.EdgeAdded="EdgeAdded",r.EdgeUpdated="EdgeUpdated",r.EdgeRemoved="EdgeRemoved",r.ComboAdded="ComboAdded",r.ComboUpdated="ComboUpdated",r.ComboRemoved="ComboRemoved"})(Dt||(Dt={}));var Sr;(function(r){r.DRAW="draw",r.COLLAPSE="collapse",r.EXPAND="expand",r.TRANSFORM="transform"})(Sr||(Sr={}));var ua;(function(r){r.CLICK="canvas:click",r.DBLCLICK="canvas:dblclick",r.POINTER_OVER="canvas:pointerover",r.POINTER_LEAVE="canvas:pointerleave",r.POINTER_ENTER="canvas:pointerenter",r.POINTER_MOVE="canvas:pointermove",r.POINTER_OUT="canvas:pointerout",r.POINTER_DOWN="canvas:pointerdown",r.POINTER_UP="canvas:pointerup",r.CONTEXT_MENU="canvas:contextmenu",r.DRAG_START="canvas:dragstart",r.DRAG="canvas:drag",r.DRAG_END="canvas:dragend",r.DRAG_ENTER="canvas:dragenter",r.DRAG_OVER="canvas:dragover",r.DRAG_LEAVE="canvas:dragleave",r.DROP="canvas:drop",r.WHEEL="canvas:wheel"})(ua||(ua={}));var Ds;(function(r){r.CLICK="combo:click",r.DBLCLICK="combo:dblclick",r.POINTER_OVER="combo:pointerover",r.POINTER_LEAVE="combo:pointerleave",r.POINTER_ENTER="combo:pointerenter",r.POINTER_MOVE="combo:pointermove",r.POINTER_OUT="combo:pointerout",r.POINTER_DOWN="combo:pointerdown",r.POINTER_UP="combo:pointerup",r.CONTEXT_MENU="combo:contextmenu",r.DRAG_START="combo:dragstart",r.DRAG="combo:drag",r.DRAG_END="combo:dragend",r.DRAG_ENTER="combo:dragenter",r.DRAG_OVER="combo:dragover",r.DRAG_LEAVE="combo:dragleave",r.DROP="combo:drop"})(Ds||(Ds={}));var ie;(function(r){r.CLICK="click",r.DBLCLICK="dblclick",r.POINTER_OVER="pointerover",r.POINTER_LEAVE="pointerleave",r.POINTER_ENTER="pointerenter",r.POINTER_MOVE="pointermove",r.POINTER_OUT="pointerout",r.POINTER_DOWN="pointerdown",r.POINTER_UP="pointerup",r.CONTEXT_MENU="contextmenu",r.DRAG_START="dragstart",r.DRAG="drag",r.DRAG_END="dragend",r.DRAG_ENTER="dragenter",r.DRAG_OVER="dragover",r.DRAG_LEAVE="dragleave",r.DROP="drop",r.KEY_DOWN="keydown",r.KEY_UP="keyup",r.WHEEL="wheel",r.PINCH="pinch"})(ie||(ie={}));var Ro;(function(r){r.KEY_DOWN="keydown",r.KEY_UP="keyup"})(Ro||(Ro={}));var Ju;(function(r){r.CLICK="edge:click",r.DBLCLICK="edge:dblclick",r.POINTER_OVER="edge:pointerover",r.POINTER_LEAVE="edge:pointerleave",r.POINTER_ENTER="edge:pointerenter",r.POINTER_MOVE="edge:pointermove",r.POINTER_OUT="edge:pointerout",r.POINTER_DOWN="edge:pointerdown",r.POINTER_UP="edge:pointerup",r.CONTEXT_MENU="edge:contextmenu",r.DRAG_ENTER="edge:dragenter",r.DRAG_OVER="edge:dragover",r.DRAG_LEAVE="edge:dragleave",r.DROP="edge:drop"})(Ju||(Ju={}));var fe;(function(r){r.BEFORE_CANVAS_INIT="beforecanvasinit",r.AFTER_CANVAS_INIT="aftercanvasinit",r.BEFORE_SIZE_CHANGE="beforesizechange",r.AFTER_SIZE_CHANGE="aftersizechange",r.BEFORE_ELEMENT_CREATE="beforeelementcreate",r.AFTER_ELEMENT_CREATE="afterelementcreate",r.BEFORE_ELEMENT_UPDATE="beforeelementupdate",r.AFTER_ELEMENT_UPDATE="afterelementupdate",r.BEFORE_ELEMENT_DESTROY="beforeelementdestroy",r.AFTER_ELEMENT_DESTROY="afterelementdestroy",r.BEFORE_ELEMENT_TRANSLATE="beforeelementtranslate",r.AFTER_ELEMENT_TRANSLATE="afterelementtranslate",r.BEFORE_DRAW="beforedraw",r.AFTER_DRAW="afterdraw",r.BEFORE_RENDER="beforerender",r.AFTER_RENDER="afterrender",r.BEFORE_ANIMATE="beforeanimate",r.AFTER_ANIMATE="afteranimate",r.BEFORE_LAYOUT="beforelayout",r.AFTER_LAYOUT="afterlayout",r.BEFORE_STAGE_LAYOUT="beforestagelayout",r.AFTER_STAGE_LAYOUT="afterstagelayout",r.BEFORE_TRANSFORM="beforetransform",r.AFTER_TRANSFORM="aftertransform",r.BATCH_START="batchstart",r.BATCH_END="batchend",r.BEFORE_DESTROY="beforedestroy",r.AFTER_DESTROY="afterdestroy",r.BEFORE_RENDERER_CHANGE="beforerendererchange",r.AFTER_RENDERER_CHANGE="afterrendererchange"})(fe||(fe={}));var Wa;(function(r){r.UNDO="undo",r.REDO="redo",r.CANCEL="cancel",r.ADD="add",r.CLEAR="clear",r.CHANGE="change"})(Wa||(Wa={}));var ai;(function(r){r.CLICK="node:click",r.DBLCLICK="node:dblclick",r.POINTER_OVER="node:pointerover",r.POINTER_LEAVE="node:pointerleave",r.POINTER_ENTER="node:pointerenter",r.POINTER_MOVE="node:pointermove",r.POINTER_OUT="node:pointerout",r.POINTER_DOWN="node:pointerdown",r.POINTER_UP="node:pointerup",r.CONTEXT_MENU="node:contextmenu",r.DRAG_START="node:dragstart",r.DRAG="node:drag",r.DRAG_END="node:dragend",r.DRAG_ENTER="node:dragenter",r.DRAG_OVER="node:dragover",r.DRAG_LEAVE="node:dragleave",r.DROP="node:drop"})(ai||(ai={}));const Ft="combo",Dr="tree";var Al;(function(r){r.NODE="node",r.EDGE="edge",r.COMBO="combo",r.THEME="theme",r.PALETTE="palette",r.LAYOUT="layout",r.BEHAVIOR="behavior",r.PLUGIN="plugin",r.ANIMATION="animation",r.TRANSFORM="transform",r.SHAPE="shape"})(Al||(Al={}));const zp={animation:{},behavior:{},combo:{},edge:{},layout:{},node:{},palette:{},theme:{},plugin:{},transform:{},shape:{}};function ha(r,e){var t;const n=(t=zp[r])===null||t===void 0?void 0:t[e];if(n)return n}const gV="5.0.51",pV="G6";function da(r){return`[${pV} v${gV}] ${r}`}const $i={mute:!1,debug:r=>{console.debug(da(r))},info:r=>{console.info(da(r))},warn:r=>{console.warn(da(r))},error:r=>{console.error(da(r))}};function dS(r){const{theme:e}=r;if(!e)return{};const t=ha(Al.THEME,e);return t||($i.warn(`The theme of ${e} is not registered.`),{})}function Vp(r,e){if(Array.isArray(r)&&r.length===0)return null;const t=Array.isArray(r)?r[0]:r,n=Array.isArray(r)?r.slice(1):e||[];return new Proxy(t,{get(i,a){return typeof i[a]=="function"&&!["onframe","onfinish"].includes(a)?(...s)=>{i[a](...s),n.forEach(o=>{var A;return(A=o[a])===null||A===void 0?void 0:A.call(o,...s)})}:a==="finished"?Promise.all([t.finished,...n.map(s=>s.finished)]):Reflect.get(i,a)},set(i,a,s){return["onframe","onfinish"].includes(a)||n.forEach(o=>{o[a]=s}),Reflect.set(i,a,s)}})}function jp(r){const e=r.reduce((n,i)=>(Object.entries(i).forEach(([a,s])=>{n[a]===void 0?n[a]=[s]:n[a].push(s)}),n),{});Object.entries(e).forEach(([n,i])=>{(i.length!==r.length||i.some(a=>ke(a))||i.every(a=>!["sourceNode","targetNode","childrenNode"].includes(n)&&Xt(a,i[0])))&&delete e[n]});const t=Object.entries(e).reduce((n,[i,a])=>(a.forEach((s,o)=>{n[o]?n[o][i]=s:n[o]={[i]:s}}),n),[]);return r.length!==0&&t.length===0&&t.push({_:0},{_:0}),t}function ll(r){switch(r){case"opacity":return 1;case"x":case"y":case"z":case"zIndex":return 0;case"visibility":return"visible";case"collapsed":return!1;case"states":return[];default:return}}function fS(r,e){const{animation:t}=r;if(t===!1||e===!1)return!1;const n=Object.assign({},dV);return on(t)&&Object.assign(n,t),on(e)&&Object.assign(n,e),n}function vV(r){if(typeof r=="string"){const e=ha(Al.ANIMATION,r);return e||($i.warn(`The animation of ${r} is not registered.`),[])}return r}function yV(r,e,t,n){var i,a;const{animation:s}=r;if(s===!1||n===!1)return[];const o=(i=r?.[e])===null||i===void 0?void 0:i.animation;if(o===!1)return[];const A=o?.[t];if(A===!1)return[];const l=(a=dS(r)[e])===null||a===void 0?void 0:a.animation,c=(h=[])=>vV(h).map(d=>Object.assign(Object.assign(Object.assign(Object.assign({},fV),on(s)&&s),d),on(n)&&n));if(A)return c(A);if(!l)return[];const u=l[t];return u===!1?[]:c(u)}function gS(r,e,t,n=[]){if(!n&&r===0&&e===0&&t===0)return null;if(Array.isArray(n)){let a=-1;const s=[];for(let o=0;o<n.length;o++){const A=n[o];if(A[0]==="translate"){if(A[1]===r&&A[2]===e)return null;a=o,s.push(["translate",r,e])}else if(A[0]==="translate3d"){if(A[1]===r&&A[2]===e&&A[3]===t)return null;a=o,s.push(["translate3d",r,e,t??0])}else s.push(A)}return a===-1&&s.splice(0,0,Be(t)?["translate3d",r,e,t??0]:["translate",r,e]),s.length===0?null:s}const i=n?n.replace(/translate(3d)?\([^)]*\)/g,""):"";return t===0?`translate(${r}, ${e})${i}`:`translate3d(${r}, ${e}, ${t})${i}`}var mV=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};const wV=(r,e,t)=>{if(!t.length)return null;const[n,i]=e,a=l=>{var c;if(l){const u=r.getShape(l);if(!u)return null;const h=`get${gc(l)}Style`,d=((c=r?.[h])===null||c===void 0?void 0:c.bind(r))||(p=>p),f=d?.(n)||{},g=d?.(i)||{};return{shape:u,fromStyle:f,toStyle:g}}else return{shape:r,fromStyle:n,toStyle:i}};let s;const o=t.map(l=>{var{fields:c,shape:u,states:h}=l,d=mV(l,["fields","shape","states"]);const f=a(u);if(!f)return null;const{shape:g,fromStyle:p,toStyle:v}=f,y=[{},{}];if(c.forEach(B=>{var C,S;Object.assign(y[0],{[B]:(C=p[B])!==null&&C!==void 0?C:ll(B)}),Object.assign(y[1],{[B]:(S=v[B])!==null&&S!==void 0?S:ll(B)})}),y.some(B=>Object.keys(B).some(C=>["x","y","z"].includes(C)))){const{x:B=0,y:C=0,z:S,transform:F=""}=g.attributes||{};y.forEach(T=>{var O,I,k;T.transform=gS((O=T.x)!==null&&O!==void 0?O:B,(I=T.y)!==null&&I!==void 0?I:C,(k=T.z)!==null&&k!==void 0?k:S,F)})}const m=g.animate(jp(y),d);return u===void 0&&(s=m),m}).filter(Boolean),A=s||o?.[0];return A?Vp(A,o.filter(l=>l!==l)):null},BV=[{fields:["opacity"]}],bV=[{fields:["x","y"]}],pS=[{fields:["x","y"]}],EV=pS,vS=[{fields:["sourceNode","targetNode"]}],xV=vS,yS=[{fields:["childrenNode","x","y"]}],CV=yS;function SV(r){return"source"in r&&"target"in r}function FV(r){return r.length===2}function Do(r){return r instanceof Float32Array?!0:Array.isArray(r)&&(r.length===2||r.length===3)?r.every(e=>typeof e=="number"):!1}function Yi(r,e,t){return r>=e&&r<=t}function si(r=0){if(Array.isArray(r)){const[e=0,t=e,n=e,i=t]=r;return[e,t,n,i]}return[r,r,r,r]}function TV(r=0){const e=si(r);return e[0]+e[2]}function Xi(r){return r.max[0]-r.min[0]}function Zi(r){return r.max[1]-r.min[1]}function qa(r){return[Xi(r),Zi(r)]}function $a(r,e){const t=Do(r)?Wp(r):r.getShape("key").getBounds();return e?Ya(t,e):t}function Wp(r){const[e,t,n=0]=r,i=new kt;return i.setMinMax([e,t,n],[e,t,n]),i}function Ya(r,e){const[t,n,i,a]=si(e),[s,o,A]=r.min,[l,c,u]=r.max,h=new kt;return h.setMinMax([s-a,o-t,A],[l+n,c+i,u]),h}function cl(r){if(r.length===0)return new kt;if(r.length===1)return r[0];const e=new kt;e.setMinMax(r[0].min,r[0].max);for(let t=1;t<r.length;t++){const n=r[t];e.setMinMax([Math.min(e.min[0],n.min[0]),Math.min(e.min[1],n.min[1]),Math.min(e.min[2],n.min[2])],[Math.max(e.max[0],n.max[0]),Math.max(e.max[1],n.max[1]),Math.max(e.max[2],n.max[2])])}return e}function MV(r,e){const[t,n]=r.min,[i,a]=r.max,[s,o]=e.min,[A,l]=e.max;return t>=s&&i<=A&&n>=o&&a<=l}function wi(r,e){return Yi(r[0],e.min[0],e.max[0])&&Yi(r[1],e.min[1],e.max[1])}function mS(r,e,t=!1){const{min:[n,i],max:[a,s]}=e,o=(r[1]===i||r[1]===s)&&(t||Yi(r[0],n,a)),A=(r[0]===n||r[0]===a)&&(t||Yi(r[1],i,s));return o||A}function OV(r,e){return!wi(r,e)}function eh(r,e){const{center:t}=e;return r[0]===t[0]&&r[1]===t[1]}function ul(r,e){const[t,n]=r,[i,a]=e.min,[s,o]=e.max,A=t-i,l=s-t,c=n-a,u=o-n,h=Math.min(A,l,c,u);return h===A?"left":h===l?"right":h===c?"top":h===u?"bottom":"left"}function Hs(r,e){const t=ka(r);if(wi(r,e))switch(ul(r,e)){case"left":t[0]=e.min[0];break;case"right":t[0]=e.max[0];break;case"top":t[1]=e.min[1];break;case"bottom":t[1]=e.max[1];break}else{const[n,i]=r,[a,s]=e.min,[o,A]=e.max;t[0]=Yi(n,a,o)?n:n<a?a:o,t[1]=Yi(i,s,A)?i:i<s?s:A}return t}function IV(r,e){const{center:t}=r,[n,i]=qa(r),a=e==="up"||e==="down"?t[0]:e==="right"?t[0]-n/6:t[0]+n/6,s=e==="left"||e==="right"?t[1]:e==="down"?t[1]-i/6:t[1]+i/6;return[a,s]}function _V(r,e){let[t,n]=qa(r);return[t,n]=e==="up"||e==="down"?[t,n]:[n,t],(Math.pow(n,2)-Math.pow(Math.sqrt(Math.pow(t/2,2)+Math.pow(n,2))-t/2,2))/(2*n)}function kV(r){const{min:[e,t],max:[n,i]}=r,a=[e,i],s=[n,i],o=[n,t],A=[e,t];return[[a,s],[s,o],[o,A],[A,a]]}var NV=function(e,t){return e===t},wS=(function(){function r(e,t){t===void 0&&(t=null),this.value=e,this.next=t}return r.prototype.toString=function(e){return e?e(this.value):"".concat(this.value)},r})(),LV=(function(){function r(e){e===void 0&&(e=NV),this.head=null,this.tail=null,this.compare=e}return r.prototype.prepend=function(e){var t=new wS(e,this.head);return this.head=t,this.tail||(this.tail=t),this},r.prototype.append=function(e){var t=new wS(e);return this.head?(this.tail.next=t,this.tail=t,this):(this.head=t,this.tail=t,this)},r.prototype.delete=function(e){if(!this.head)return null;for(var t=null;this.head&&this.compare(this.head.value,e);)t=this.head,this.head=this.head.next;var n=this.head;if(n!==null)for(;n.next;)this.compare(n.next.value,e)?(t=n.next,n.next=n.next.next):n=n.next;return this.compare(this.tail.value,e)&&(this.tail=n),t},r.prototype.find=function(e){var t=e.value,n=t===void 0?void 0:t,i=e.callback,a=i===void 0?void 0:i;if(!this.head)return null;for(var s=this.head;s;){if(a&&a(s.value)||n!==void 0&&this.compare(s.value,n))return s;s=s.next}return null},r.prototype.deleteTail=function(){var e=this.tail;if(this.head===this.tail)return this.head=null,this.tail=null,e;for(var t=this.head;t.next;)t.next.next?t=t.next:t.next=null;return this.tail=t,e},r.prototype.deleteHead=function(){if(!this.head)return null;var e=this.head;return this.head.next?this.head=this.head.next:(this.head=null,this.tail=null),e},r.prototype.fromArray=function(e){var t=this;return e.forEach(function(n){return t.append(n)}),this},r.prototype.toArray=function(){for(var e=[],t=this.head;t;)e.push(t),t=t.next;return e},r.prototype.reverse=function(){for(var e=this.head,t=null,n=null;e;)n=e.next,e.next=t,t=e,e=n;this.tail=this.head,this.head=t},r.prototype.toString=function(e){return e===void 0&&(e=void 0),this.toArray().map(function(t){return t.toString(e)}).toString()},r})(),QV=function(e,t,n){t===void 0&&(t=[]);var i=t.filter(function(A){return A.source===e||A.target===e});if(n==="target"){var a=function(l){return l.source===e};return i.filter(a).map(function(A){return A.target})}if(n==="source"){var s=function(l){return l.target===e};return i.filter(s).map(function(A){return A.source})}var o=function(l){return l.source===e?l.target:l.source};return i.map(o)},UV=function(e,t){return t.filter(function(n){return n.source===e})},PV=function(e,t){return t.filter(function(n){return n.source===e||n.target===e})},RV=function(e){var t={},n=e.nodes,i=n===void 0?[]:n,a=e.edges,s=a===void 0?[]:a;return i.forEach(function(o){t[o.id]={degree:0,inDegree:0,outDegree:0}}),s.forEach(function(o){t[o.source].degree++,t[o.source].outDegree++,t[o.target].degree++,t[o.target].inDegree++}),t},DV={}.toString,qp=function(r,e){return DV.call(r)==="[object "+e+"]"};const BS=(function(r){return qp(r,"Function")}),bS=(function(r){return Array.isArray?Array.isArray(r):qp(r,"Array")}),HV=(function(r){var e=typeof r;return r!==null&&e==="object"||e==="function"});function GV(r,e){if(r){var t;if(bS(r))for(var n=0,i=r.length;n<i&&(t=e(r[n],n),t!==!1);n++);else if(HV(r)){for(var a in r)if(r.hasOwnProperty(a)&&(t=e(r[a],a),t===!1))break}}}const KV=(function(r){return qp(r,"String")});var zV=Object.values?function(r){return Object.values(r)}:function(r){var e=[];return GV(r,function(t,n){BS(r)&&n==="prototype"||e.push(t)}),e};const VV=(function(r,e){if(!BS(r))throw new TypeError("Expected a function");var t=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var a=e?e.apply(this,n):n[0],s=t.cache;if(s.has(a))return s.get(a);var o=r.apply(this,n);return s.set(a,o),o};return t.cache=new Map,t});var th;VV(function(r,e){e===void 0&&(e={});var t=e.fontSize,n=e.fontFamily,i=e.fontWeight,a=e.fontStyle,s=e.fontVariant;return th||(th=document.createElement("canvas").getContext("2d")),th.font=[a,s,i,t+"px",n].join(" "),th.measureText(KV(r)?r:"").width},function(r,e){return e===void 0&&(e={}),UR([r],zV(e)).join("")});var jV=function(e,t,n){for(var i=1/0,a,s=0;s<t.length;s++){var o=t[s].id;!n[o]&&e[o]<=i&&(i=e[o],a=t[s])}return a},WV=function(e,t,n,i){var a=e.nodes,s=a===void 0?[]:a,o=e.edges,A=o===void 0?[]:o,l={},c={},u={};s.forEach(function(y,m){var B=y.id;c[B]=1/0,B===t&&(c[B]=0)});for(var h=s.length,d=function(m){var B=jV(c,s,l),C=B.id;if(l[C]=!0,c[C]===1/0)return"continue";var S=[];n?S=UV(C,A):S=PV(C,A),S.forEach(function(F){var T=F.target,O=F.source,I=T===C?O:T,k=i&&F[i]?F[i]:1;c[I]>c[B.id]+k?(c[I]=c[B.id]+k,u[I]=[B.id]):c[I]===c[B.id]+k&&u[I].push(B.id)})},f=0;f<h;f++)d();u[t]=[t];var g={};for(var p in c)c[p]!==1/0&&ES(t,p,u,g);var v={};for(var p in g)v[p]=g[p][0];return{length:c,path:v,allPath:g}};function ES(r,e,t,n){if(r===e)return[r];if(n[e])return n[e];for(var i=[],a=0,s=t[e];a<s.length;a++){var o=s[a],A=ES(r,o,t,n);if(!A)return;for(var l=0,c=A;l<c.length;l++){var u=c[l];bS(u)?i.push(Ie(Ie([],u,!0),[e],!1)):i.push([u,e])}}return n[e]=i,n[e]}var xS=function(e,t,n,i,a){var s=WV(e,t,i,a),o=s.length,A=s.path,l=s.allPath;return{length:o[n],path:A[n],allPath:l[n]}},CS;(function(r){r.EuclideanDistance="euclideanDistance"})(CS||(CS={}));var qV=function(e,t,n){typeof t!="number"&&(t=1e-6),typeof n!="number"&&(n=.85);for(var i=1,a=0,s=1e3,o=e.nodes,A=o===void 0?[]:o,l=e.edges,c=l===void 0?[]:l,u=A.length,h,d={},f={},g=0;g<u;++g){var p=A[g],v=p.id;d[v]=1/u,f[v]=1/u}for(var y=RV(e);s>0&&i>t;){a=0;for(var g=0;g<u;++g){var p=A[g],v=p.id;if(h=0,y[p.id].inDegree===0)d[v]=0;else{for(var m=QV(v,c,"source"),B=0;B<m.length;++B){var C=m[B],S=y[C].outDegree;S>0&&(h+=f[C]/S)}d[v]=n*h,a+=d[v]}}a=(1-a)/u,i=0;for(var g=0;g<u;++g){var p=A[g],v=p.id;h=d[v]+a,i+=Math.abs(h-f[v]),f[v]=h}s-=1}return f};(function(){function r(e){e===void 0&&(e=10),this.linkedList=new LV,this.maxStep=e}return Object.defineProperty(r.prototype,"length",{get:function(){return this.linkedList.toArray().length},enumerable:!1,configurable:!0}),r.prototype.isEmpty=function(){return!this.linkedList.head},r.prototype.isMaxStack=function(){return this.toArray().length>=this.maxStep},r.prototype.peek=function(){return this.isEmpty()?null:this.linkedList.head.value},r.prototype.push=function(e){this.linkedList.prepend(e),this.length>this.maxStep&&this.linkedList.deleteTail()},r.prototype.pop=function(){var e=this.linkedList.deleteHead();return e?e.value:null},r.prototype.toArray=function(){return this.linkedList.toArray().map(function(e){return e.value})},r.prototype.clear=function(){for(;!this.isEmpty();)this.pop()},r})();function X(r){if(r.id!==void 0)return r.id;if(r.source!==void 0&&r.target!==void 0)return`${r.source}-${r.target}`;throw new Error(da("The datum does not have available id."))}function nh(r){return r.combo}function SS(r,e){const t={nodes:(r.nodes||[]).map(X),edges:(r.edges||[]).map(X),combos:(r.combos||[]).map(X)};return e?Object.values(t).flat():t}const FS=(r,e,t)=>{var n;switch(t.type){case"degree":{const i=new Map;return(n=r.nodes)===null||n===void 0||n.forEach(a=>{const s=e(X(a),t.direction).length;i.set(X(a),s)}),i}case"betweenness":return $V(r,t.directed,t.weightPropertyName);case"closeness":return YV(r,t.directed,t.weightPropertyName);case"eigenvector":return ZV(r,t.directed);case"pagerank":return XV(r,t.epsilon,t.linkProb);default:return TS(r)}},TS=r=>{var e;const t=new Map;return(e=r.nodes)===null||e===void 0||e.forEach(n=>{t.set(X(n),0)}),t},$V=(r,e,t)=>{const n=TS(r),{nodes:i=[]}=r;return i.forEach(a=>{i.forEach(s=>{if(a!==s){const{allPath:o}=xS(r,X(a),X(s),e,t),A=o.length;o.flat().forEach(l=>{l!==X(a)&&l!==X(s)&&n.set(l,n.get(l)+1/A)})}})}),n},YV=(r,e,t)=>{const n=new Map,{nodes:i=[]}=r;return i.forEach(a=>{const s=i.reduce((o,A)=>{if(a!==A){const{length:l}=xS(r,X(a),X(A),e,t);o+=l}return o},0);n.set(X(a),1/s)}),n},XV=(r,e,t)=>{var n;const i=new Map,a=qV(r,e,t);return(n=r.nodes)===null||n===void 0||n.forEach(s=>{i.set(X(s),a[X(s)])}),i},ZV=(r,e)=>{const{nodes:t=[]}=r,n=JV(r,e),i=ej(n,t.length),a=new Map;return t.forEach((s,o)=>{a.set(X(s),i[o])}),a},JV=(r,e)=>{const{nodes:t=[],edges:n=[]}=r,i=Array(t.length).fill(null).map(()=>Array(t.length).fill(0));return n.forEach(({source:a,target:s})=>{const o=t.findIndex(l=>X(l)===a),A=t.findIndex(l=>X(l)===s);e?i[o][A]=1:(i[o][A]=1,i[A][o]=1)}),i},ej=(r,e,t=100,n=1e-6)=>{let i=Array(e).fill(1),a=1/0;for(let s=0;s<t&&a>n;s++){const o=Array(e).fill(0);for(let l=0;l<e;l++)for(let c=0;c<e;c++)o[l]+=r[l][c]*i[c];const A=Math.sqrt(o.reduce((l,c)=>l+c*c,0));for(let l=0;l<e;l++)o[l]/=A;a=Math.sqrt(o.reduce((l,c,u)=>l+(c-i[u])*c,0)),i=o}return i};function Xa(r,e,t,n=Xt){const i=new Map(r.map(h=>[t(h),h])),a=new Map(e.map(h=>[t(h),h])),s=new Set(i.keys()),o=new Set(a.keys()),A=[],l=[],c=[],u=[];return o.forEach(h=>{s.has(h)?n(i.get(h),a.get(h))?u.push(a.get(h)):l.push(a.get(h)):A.push(a.get(h))}),s.forEach(h=>{o.has(h)||c.push(i.get(h))}),{enter:A,exit:c,keep:u,update:l}}function Gs(r,e,t){const n=i=>{t&&!t(i)||(i.style.visibility=e)};r.forEach(i=>{n(i)})}function tj(r,e,t){const n={},i=a=>(a in n||(n[a]=0),`${e}-${a}-${n[a]++}`);return t.map(a=>typeof a=="string"?{type:a,key:i(a)}:typeof a=="function"?a.call(r):a.key?a:Object.assign(Object.assign({},a),{key:i(a.type)}))}class $p{constructor(e){this.extensions=[],this.extensionMap={},this.context=e}setExtensions(e){const t=tj(this.context.graph,this.category,e),{enter:n,update:i,exit:a,keep:s}=Xa(this.extensions,t,o=>o.key);this.createExtensions(n),this.updateExtensions([...i,...s]),this.destroyExtensions(a),this.extensions=t}createExtension(e){const{category:t}=this,{key:n,type:i}=e,a=ha(t,i);if(!a)return $i.warn(`The extension ${i} of ${t} is not registered.`);const s=new a(this.context,e);s.initialized=!0,this.extensionMap[n]=s}createExtensions(e){e.forEach(t=>this.createExtension(t))}updateExtension(e){const{key:t}=e,n=this.extensionMap[t];n&&n.update(e)}updateExtensions(e){e.forEach(t=>this.updateExtension(t))}destroyExtension(e){const t=this.extensionMap[e];t&&(t.initialized&&!t.destroyed&&t.destroy(),delete this.extensionMap[e])}destroyExtensions(e){e.forEach(({key:t})=>this.destroyExtension(t))}destroy(){this.destroyExtensions(this.extensions),this.context={},this.extensions=[],this.extensionMap={}}}class Yp{constructor(e,t){this.events=[],this.initialized=!1,this.destroyed=!1,this.context=e,this.options=t}update(e){this.options=Object.assign(this.options,e)}destroy(){this.context={},this.options={},this.destroyed=!0}}class Hr extends Yp{}class rh extends Hr{constructor(e,t){super(e,Object.assign({},rh.defaultOptions,t)),this.isOverlapping=(n,i)=>i.some(a=>n.intersects(a)),this.occupiedBounds=[],this.detectLabelCollision=n=>{const i=this.context.viewport,a={show:[],hide:[]};return this.occupiedBounds=[],n.forEach(s=>{const o=s.getShape("label").getRenderBounds();i.isInViewport(o,!0)&&!this.isOverlapping(o,this.occupiedBounds)?(a.show.push(s),this.occupiedBounds.push(Ya(o,this.options.padding))):a.hide.push(s)}),a},this.hideLabelIfExceedViewport=(n,i)=>{const{exit:a}=Xa(n,i,s=>s.id);a?.forEach(this.hideLabel)},this.nodeCentralities=new Map,this.sortNodesByCentrality=(n,i)=>{const{model:a}=this.context,s=a.getData(),o=a.getRelatedEdgesData.bind(a);return n.map(l=>(this.nodeCentralities.has(l.id)||(this.nodeCentralities=FS(s,o,i)),{node:l,centrality:this.nodeCentralities.get(l.id)})).sort((l,c)=>c.centrality-l.centrality).map(l=>l.node)},this.sortLabelElementsInView=n=>{const{sort:i,sortNode:a,sortCombo:s,sortEdge:o}=this.options,{model:A}=this.context;if(Te(i))return n.sort((g,p)=>i(A.getElementDataById(g.id),A.getElementDataById(p.id)));const{node:l=[],edge:c=[],combo:u=[]}=fc(n,g=>g.type),h=Te(s)?u.sort((g,p)=>s(...A.getComboData([g.id,p.id]))):u,d=Te(a)?l.sort((g,p)=>a(...A.getNodeData([g.id,p.id]))):this.sortNodesByCentrality(l,a),f=Te(o)?c.sort((g,p)=>o(...A.getEdgeData([g.id,p.id]))):c;return[...h,...d,...f]},this.labelElementsInView=[],this.isFirstRender=!0,this.onToggleVisibility=n=>{var i;if(((i=n.data)===null||i===void 0?void 0:i.stage)==="zIndex")return;if(!this.validate(n)){this.hiddenElements.size>0&&(this.hiddenElements.forEach(this.showLabel),this.hiddenElements.clear());return}const a=this.isFirstRender?this.getLabelElements():this.getLabelElementsInView();this.hideLabelIfExceedViewport(this.labelElementsInView,a),this.labelElementsInView=a;const s=this.sortLabelElementsInView(this.labelElementsInView),{show:o,hide:A}=this.detectLabelCollision(s);for(let l=o.length-1;l>=0;l--)this.showLabel(o[l]);A.forEach(this.hideLabel)},this.hiddenElements=new Map,this.hideLabel=n=>{const i=n.getShape("label");i&&Gs(i,"hidden"),this.hiddenElements.set(n.id,n)},this.showLabel=n=>{const i=n.getShape("label");i&&Gs(i,"visible"),n.toFront(),this.hiddenElements.delete(n.id)},this.onTransform=pE(this.onToggleVisibility,this.options.throttle,{leading:!0}),this.enableToggle=!0,this.toggle=n=>{this.enableToggle&&this.onToggleVisibility(n)},this.onBeforeRender=()=>{this.enableToggle=!1},this.onAfterRender=n=>{this.onToggleVisibility(n),this.enableToggle=!0},this.bindEvents()}update(e){this.unbindEvents(),super.update(e),this.bindEvents(),this.onToggleVisibility({})}getLabelElements(){const{elementMap:e}=this.context.element,t=[];for(const n in e){const i=e[n];i.isVisible()&&i.getShape("label")&&t.push(i)}return t}getLabelElementsInView(){const e=this.context.viewport;return this.getLabelElements().filter(t=>e.isInViewport(t.getShape("key").getRenderBounds()))}bindEvents(){const{graph:e}=this.context;e.on(fe.BEFORE_RENDER,this.onBeforeRender),e.on(fe.AFTER_RENDER,this.onAfterRender),e.on(fe.AFTER_DRAW,this.toggle),e.on(fe.AFTER_LAYOUT,this.toggle),e.on(fe.AFTER_TRANSFORM,this.onTransform)}unbindEvents(){const{graph:e}=this.context;e.off(fe.BEFORE_RENDER,this.onBeforeRender),e.off(fe.AFTER_RENDER,this.onAfterRender),e.off(fe.AFTER_DRAW,this.toggle),e.off(fe.AFTER_LAYOUT,this.toggle),e.off(fe.AFTER_TRANSFORM,this.onTransform)}validate(e){if(this.destroyed)return!1;const{enable:t}=this.options;return Te(t)?t(e):!!t}destroy(){this.unbindEvents(),super.destroy()}}rh.defaultOptions={enable:!0,throttle:100,padding:0,sortNode:{type:"degree"}};const MS=[0,0,0];function Ve(r,e){return r.map((t,n)=>t+e[n])}function bt(r,e){return r.map((t,n)=>t-e[n])}function Bi(r,e){return typeof e=="number"?r.map(t=>t*e):r.map((t,n)=>t*e[n])}function bi(r,e){return typeof e=="number"?r.map(t=>t/e):r.map((t,n)=>t/e[n])}function nj(r,e){return r.reduce((t,n,i)=>t+n*e[i],0)}function rj(r,e){const t=hl(r),n=hl(e);return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function Za(r,e){return r.map(t=>t*e)}function Lt(r,e){return Math.sqrt(r.reduce((t,n,i)=>t+Math.pow(n-e[i]||0,2),0))}function ih(r,e){return r.reduce((t,n,i)=>t+Math.abs(n-e[i]),0)}function fa(r){const e=r.reduce((t,n)=>t+Math.pow(n,2),0);return r.map(t=>t/Math.sqrt(e))}function Xp(r,e,t=!1){const n=r[0]*e[1]-r[1]*e[0];let i=Math.acos(Bi(r,e).reduce((a,s)=>a+s,0)/(Lt(r,MS)*Lt(e,MS)));return t&&n<0&&(i=2*Math.PI-i),i}function ah(r,e=!0){return e?[-r[1],r[0]]:[r[1],-r[0]]}function Zp(r,e){return r.map(t=>t%e)}function Ks(r){return[r[0],r[1]]}function hl(r){return FV(r)?[r[0],r[1],0]:r}function OS(r){const[e,t]=r;return!e&&!t?0:Math.atan2(t,e)}function IS(r,e){const[t,n]=r;if(e%360===0)return[t,n];const i=e*Math.PI/180,a=Math.cos(i),s=Math.sin(i);return[t*a-n*s,t*s+n*a]}function _S(r,e){const[t,n]=r,[i,a]=e,s=bt(t,n),o=bt(i,a);return rj(s,o).every(A=>A===0)}function Jp(r,e,t=!1){if(_S(r,e))return;const[n,i]=r,[a,s]=e,o=((n[0]-a[0])*(a[1]-s[1])-(n[1]-a[1])*(a[0]-s[0]))/((n[0]-i[0])*(a[1]-s[1])-(n[1]-i[1])*(a[0]-s[0])),A=s[0]-a[0]?(n[0]-a[0]+o*(i[0]-n[0]))/(s[0]-a[0]):(n[1]-a[1]+o*(i[1]-n[1]))/(s[1]-a[1]);if(!(!t&&(!Yi(o,0,1)||!Yi(A,0,1))))return[n[0]+o*(i[0]-n[0]),n[1]+o*(i[1]-n[1])]}function kS(r){if(Array.isArray(r))return Yi(r[0],0,1)&&Yi(r[1],0,1)?r:[.5,.5];const e=r.split("-"),t=e.includes("left")?0:e.includes("right")?1:.5,n=e.includes("top")?0:e.includes("bottom")?1:.5;return[t,n]}function Fn(r){const{x:e=0,y:t=0,z:n=0}=r.style||{};return[+e,+t,+n]}function ij(r){const{x:e,y:t,z:n}=r.style||{};return e!==void 0||t!==void 0||n!==void 0}function aj(r,e){const[t,n]=e,{min:i,max:a}=r;return[i[0]+t*(a[0]-i[0]),i[1]+n*(a[1]-i[1])]}function ga(r,e="center"){const t=kS(e);return aj(r,t)}function zn(r){var e;return[r.x,r.y,(e=r.z)!==null&&e!==void 0?e:0]}function Ei(r){var e;return{x:r[0],y:r[1],z:(e=r[2])!==null&&e!==void 0?e:0}}function dl(r,e=0){return r.map(t=>parseFloat(t.toFixed(e)))}function Ja(r,e,t,n=!1){if(Xt(r,e))return r;const i=n?bt(r,e):bt(e,r),a=fa(i),s=[a[0]*t,a[1]*t];return Ve(Ks(r),s)}function NS(r,e){return r[1]===e[1]}function sj(r,e){return r[0]===e[0]}function oj(r,e){return NS(r,e)||sj(r,e)}function LS(r,e,t){return _S([r,e],[e,t])}function QS(r,e){return[2*e[0]-r[0],2*e[1]-r[1]]}function US(r,e,t,n=!0,i=!1){for(let a=0;a<t.length;a++){let s=t[a],o=t[(a+1)%t.length];n&&(s=Ve(e,s),o=Ve(e,o));const A=i?QS(r,e):r,l=Jp([e,A],[s,o]);if(l)return{point:l,line:[s,o]}}return{point:e,line:void 0}}function Aj(r,e,t,n){const i=r[0],a=r[1];let s=!1;t===void 0&&(t=0),n===void 0&&(n=e.length);const o=n-t;for(let A=0,l=o-1;A<o;l=A++){const c=e[A+t][0],u=e[A+t][1],h=e[l+t][0],d=e[l+t][1];u>a!=d>a&&i<(h-c)*(a-u)/(d-u)+c&&(s=!s)}return s}function lj(r,e,t=!1){const n=ga(e,"center"),i=[ga(e,"left-top"),ga(e,"right-top"),ga(e,"right-bottom"),ga(e,"left-bottom")];return US(r,n,i,!1,t).point}function sh(r,e,t=!1){const n=e.center,i=t?QS(r,n):r,a=bt(i,e.center),s=Math.atan2(a[1],a[0]);if(isNaN(s))return n;const o=Xi(e)/2,A=Zi(e)/2,l=n[0]+o*Math.cos(s),c=n[1]+A*Math.sin(s);return[l,c]}function cj(r,e){let t=1/0,n=[r[0],e[0]];return r.forEach(i=>{e.forEach(a=>{const s=Lt(i,a);s<t&&(t=s,n=[i,a])})}),n}function uj(r,e){let t=1/0,n=[[0,0],[0,0]];return e.forEach(i=>{const a=hj(r,i);a<t&&(t=a,n=i)}),n}function hj(r,e){const t=PS(r,e);return Lt(r,t)}function PS(r,e){const[t,n]=e[0],[i,a]=e[1],[s,o]=r,A=i-t,l=a-n;if(A===0&&l===0)return[t,n];let c=((s-t)*A+(o-n)*l)/(A*A+l*l);c>1?c=1:c<0&&(c=0);const u=t+c*A,h=n+c*l;return[u,h]}function dj(r){const e=r.reduce((t,n)=>Ve(t,n),[0,0]);return bi(e,r.length)}function ev(r,e=!0){const t=dj(r);return r.sort(([n,i],[a,s])=>{const o=Math.atan2(i-t[1],n-t[0]),A=Math.atan2(s-t[1],a-t[0]);return e?A-o:o-A})}function RS(r,e){return[r,[r[0],e[1]],e,[e[0],r[1]]]}class hn{constructor(e,t,n){if(this.phase=t,this.pointerByTouch=[],this.initialDistance=null,this.emitter=e,hn.instance)return hn.callbacks[this.phase].push(n),hn.instance;this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.bindEvents(),hn.instance=this,hn.callbacks[this.phase].push(n)}bindEvents(){const{emitter:e}=this;e.on(ie.POINTER_DOWN,this.onPointerDown),e.on(ie.POINTER_MOVE,this.onPointerMove),e.on(ie.POINTER_UP,this.onPointerUp)}updatePointerPosition(e,t,n){const i=this.pointerByTouch.findIndex(a=>a.pointerId===e);i>=0&&(this.pointerByTouch[i]={x:t,y:n,pointerId:e})}onPointerDown(e){const{x:t,y:n}=e.client||{};if(!(t===void 0||n===void 0)&&(this.pointerByTouch.push({x:t,y:n,pointerId:e.pointerId}),e.pointerType==="touch"&&this.pointerByTouch.length===2)){hn.isPinching=!0;const i=this.pointerByTouch[0].x-this.pointerByTouch[1].x,a=this.pointerByTouch[0].y-this.pointerByTouch[1].y;this.initialDistance=Math.sqrt(i*i+a*a),hn.callbacks.pinchstart.forEach(s=>s(e,{scale:0}))}}onPointerMove(e){if(this.pointerByTouch.length!==2||this.initialDistance===null)return;const{x:t,y:n}=e.client||{};if(t===void 0||n===void 0)return;this.updatePointerPosition(e.pointerId,t,n);const i=this.pointerByTouch[0].x-this.pointerByTouch[1].x,a=this.pointerByTouch[0].y-this.pointerByTouch[1].y,o=Math.sqrt(i*i+a*a)/this.initialDistance;hn.callbacks.pinchmove.forEach(A=>A(e,{scale:(o-1)*5}))}onPointerUp(e){var t;hn.callbacks.pinchend.forEach(n=>n(e,{scale:0})),hn.isPinching=!1,this.initialDistance=null,this.pointerByTouch=[],(t=hn.instance)===null||t===void 0||t.tryDestroy()}destroy(){this.emitter.off(ie.POINTER_DOWN,this.onPointerDown),this.emitter.off(ie.POINTER_MOVE,this.onPointerMove),this.emitter.off(ie.POINTER_UP,this.onPointerUp),hn.instance=null}off(e,t){const n=hn.callbacks[e].indexOf(t);n>-1&&hn.callbacks[e].splice(n,1),this.tryDestroy()}tryDestroy(){Object.values(hn.callbacks).every(e=>e.length===0)&&this.destroy()}}hn.isPinching=!1,hn.instance=null,hn.callbacks={pinchstart:[],pinchmove:[],pinchend:[]};const DS=r=>r.map(e=>ot(e)?e.toLocaleLowerCase():e);class es{constructor(e){this.map=new Map,this.boundHandlePinch=()=>{},this.recordKey=new Set,this.onKeyDown=t=>{t?.key&&(this.recordKey.add(t.key),this.trigger(t))},this.onKeyUp=t=>{t?.key&&this.recordKey.delete(t.key)},this.onWheel=t=>{this.triggerExtendKey(ie.WHEEL,t)},this.onDrag=t=>{this.triggerExtendKey(ie.DRAG,t)},this.handlePinch=(t,n)=>{this.triggerExtendKey(ie.PINCH,Object.assign(Object.assign({},t),n))},this.onFocus=()=>{this.recordKey.clear()},this.emitter=e,this.bindEvents()}bind(e,t){e.length!==0&&(e.includes(ie.PINCH)&&!this.pinchHandler&&(this.boundHandlePinch=this.handlePinch.bind(this),this.pinchHandler=new hn(this.emitter,"pinchmove",this.boundHandlePinch)),this.map.set(e,t))}unbind(e,t){this.map.forEach((n,i)=>{Xt(i,e)&&(!t||t===n)&&this.map.delete(i)})}unbindAll(){this.map.clear()}match(e){const t=DS(Array.from(this.recordKey)).sort(),n=DS(e).sort();return Xt(t,n)}bindEvents(){var e;const{emitter:t}=this;t.on(ie.KEY_DOWN,this.onKeyDown),t.on(ie.KEY_UP,this.onKeyUp),t.on(ie.WHEEL,this.onWheel),t.on(ie.DRAG,this.onDrag),(e=globalThis.addEventListener)===null||e===void 0||e.call(globalThis,"focus",this.onFocus)}trigger(e){this.map.forEach((t,n)=>{this.match(n)&&t(e)})}triggerExtendKey(e,t){this.map.forEach((n,i)=>{i.includes(e)&&Xt(Array.from(this.recordKey),i.filter(a=>a!==e))&&n(t)})}destroy(){var e,t;this.unbindAll(),this.emitter.off(ie.KEY_DOWN,this.onKeyDown),this.emitter.off(ie.KEY_UP,this.onKeyUp),this.emitter.off(ie.WHEEL,this.onWheel),this.emitter.off(ie.DRAG,this.onDrag),(e=this.pinchHandler)===null||e===void 0||e.off("pinchmove",this.boundHandlePinch),(t=globalThis.removeEventListener)===null||t===void 0||t.call(globalThis,"focus",this.onFocus)}}class fl extends Hr{constructor(e,t){super(e,Rn({},fl.defaultOptions,t)),this.shortcut=new es(e.graph),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.clearStates=this.clearStates.bind(this),this.bindEvents()}onPointerDown(e){if(!this.validate(e)||!this.isKeydown()||this.startPoint)return;const{canvas:t,graph:n}=this.context,i=Object.assign({},this.options.style);this.options.style.lineWidth&&(i.lineWidth=+this.options.style.lineWidth/n.getZoom()),this.rectShape=new Gn({id:"g6-brush-select",style:i}),t.appendChild(this.rectShape),this.startPoint=[e.canvas.x,e.canvas.y]}onPointerMove(e){var t;if(!this.startPoint)return;const{immediately:n,mode:i}=this.options;this.endPoint=oh(e,this.context.graph),(t=this.rectShape)===null||t===void 0||t.attr({x:Math.min(this.endPoint[0],this.startPoint[0]),y:Math.min(this.endPoint[1],this.startPoint[1]),width:Math.abs(this.endPoint[0]-this.startPoint[0]),height:Math.abs(this.endPoint[1]-this.startPoint[1])}),n&&i==="default"&&this.updateElementsStates(RS(this.startPoint,this.endPoint))}onPointerUp(e){if(this.startPoint){if(!this.endPoint){this.clearBrush();return}this.endPoint=oh(e,this.context.graph),this.updateElementsStates(RS(this.startPoint,this.endPoint)),this.clearBrush()}}clearStates(){this.endPoint||this.clearElementsStates()}clearElementsStates(){const{graph:e}=this.context,t=Object.values(e.getData()).reduce((n,i)=>Object.assign({},n,i.reduce((a,s)=>{var o;const A=(o=s.states||[])===null||o===void 0?void 0:o.filter(l=>l!==this.options.state);return a[X(s)]=A,a},{})),{});e.setElementState(t,this.options.animation)}updateElementsStates(e){const{graph:t}=this.context,{enableElements:n,state:i,mode:a,onSelect:s}=this.options,o=this.selector(t,e,n),A={};switch(a){case"union":o.forEach(l=>{A[l]=[...t.getElementState(l),i]});break;case"diff":o.forEach(l=>{const c=t.getElementState(l);A[l]=c.includes(i)?c.filter(u=>u!==i):[...c,i]});break;case"intersect":o.forEach(l=>{const c=t.getElementState(l);A[l]=c.includes(i)?[i]:[]});break;default:o.forEach(l=>{A[l]=[i]});break}Te(s)&&s(A),t.setElementState(A,this.options.animation)}selector(e,t,n){if(!n||n.length===0)return[];const i=[],a=e.getData();if(n.forEach(s=>{a[`${s}s`].forEach(o=>{const A=X(o);e.getElementVisibility(A)!=="hidden"&&Aj(e.getElementPosition(A),t)&&i.push(A)})}),n.includes("edge")){const s=a.edges;s?.forEach(o=>{const{source:A,target:l}=o;i.includes(A)&&i.includes(l)&&i.push(X(o))})}return i}clearBrush(){var e;(e=this.rectShape)===null||e===void 0||e.remove(),this.rectShape=void 0,this.startPoint=void 0,this.endPoint=void 0}isKeydown(){const{trigger:e}=this.options,t=Array.isArray(e)?e:[e];return this.shortcut.match(t.filter(n=>n!=="drag"))}validate(e){if(this.destroyed)return!1;const{enable:t}=this.options;return Te(t)?t(e):!!t}bindEvents(){const{graph:e}=this.context;e.on(ie.POINTER_DOWN,this.onPointerDown),e.on(ie.POINTER_MOVE,this.onPointerMove),e.on(ie.POINTER_UP,this.onPointerUp),e.on(ua.CLICK,this.clearStates)}unbindEvents(){const{graph:e}=this.context;e.off(ie.POINTER_DOWN,this.onPointerDown),e.off(ie.POINTER_MOVE,this.onPointerMove),e.off(ie.POINTER_UP,this.onPointerUp),e.off(ua.CLICK,this.clearStates)}update(e){this.unbindEvents(),this.options=Rn(this.options,e),this.bindEvents()}destroy(){this.unbindEvents(),super.destroy()}}fl.defaultOptions={animation:!1,enable:!0,enableElements:["node","combo","edge"],immediately:!1,mode:"default",state:"selected",trigger:["shift"],style:{width:0,height:0,lineWidth:1,fill:"#1677FF",stroke:"#1677FF",fillOpacity:.1,zIndex:2,pointerEvents:"none"}};const oh=(r,e)=>{if((r.targetType==="node"||r.targetType==="combo")&&!(r.nativeEvent.target instanceof HTMLCanvasElement)){const[t,n]=e.getCanvasByClient([r.client.x,r.client.y]);return[t,n]}return[r.canvas.x,r.canvas.y]},pa=.8,zs=["node","edge","combo"];function Ho(r,e,t,n,i=0){n==="TB"&&e(r,i);const a=t(r);if(a)for(const s of a)Ho(s,e,t,n,i+1);n==="BT"&&e(r,i)}function fj(r,e,t){const n=[[r,0]];for(;n.length;){const[i,a]=n.shift();e(i,a);const s=t(i);if(s)for(const o of s)n.push([o,a+1])}}function HS(r,e,t,n,i="both"){if(e==="combo"||e==="node")return tv(r,t,n,i);const a=r.getEdgeData(t);if(!a)return[];const s=tv(r,a.source,n-1,i),o=tv(r,a.target,n-1,i);return Array.from(new Set([...s,...o,t]))}function tv(r,e,t,n="both"){const i=new Set,a=new Set,s=new Set;return fj(e,(o,A)=>{A>t||(s.add(o),r.getRelatedEdgesData(o,n).forEach(l=>{const c=X(l);!a.has(c)&&A<t&&(s.add(c),a.add(c))}))},o=>r.getRelatedEdgesData(o,n).map(A=>A.source===o?A.target:A.source).filter(A=>i.has(A)?!1:(i.add(A),!0))),Array.from(s)}function nv(r){return r.states||[]}var Ah=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{l(n.next(c))}catch(u){s(u)}}function A(c){try{l(n.throw(c))}catch(u){s(u)}}function l(c){c.done?a(c.value):i(c.value).then(o,A)}l((n=n.apply(r,e||[])).next())})};class lh extends Hr{constructor(e,t){super(e,Object.assign({},lh.defaultOptions,t)),this.onClickSelect=n=>Ah(this,void 0,void 0,function*(){var i,a;this.validate(n)&&(yield this.updateState(n),(a=(i=this.options).onClick)===null||a===void 0||a.call(i,n))}),this.onClickCanvas=n=>Ah(this,void 0,void 0,function*(){var i,a;this.validate(n)&&(yield this.clearState(),(a=(i=this.options).onClick)===null||a===void 0||a.call(i,n))}),this.shortcut=new es(e.graph),this.bindEvents()}bindEvents(){const{graph:e}=this.context;this.unbindEvents(),zs.forEach(t=>{e.on(`${t}:${ie.CLICK}`,this.onClickSelect)}),e.on(ua.CLICK,this.onClickCanvas)}get isMultipleSelect(){const{multiple:e,trigger:t}=this.options;return e&&this.shortcut.match(t)}getNeighborIds(e){const{target:t,targetType:n}=e,{graph:i}=this.context,{degree:a}=this.options;return HS(i,n,t.id,typeof a=="function"?a(e):a).filter(s=>s!==t.id)}updateState(e){return Ah(this,void 0,void 0,function*(){const{state:t,unselectedState:n,neighborState:i,animation:a}=this.options;if(!t&&!i&&!n)return;const{target:s}=e,{graph:o}=this.context,A=o.getElementData(s.id),l=nv(A).includes(t)?"unselect":"select",c={},u=this.isMultipleSelect,h=[s.id],d=this.getNeighborIds(e);if(u)if(Object.assign(c,this.getDataStates()),l==="select"){const f=(g,p)=>{g.forEach(v=>{const y=new Set(o.getElementState(v));y.add(p),y.delete(n),c[v]=Array.from(y)})};f(h,t),f(d,i),n&&Object.keys(c).forEach(g=>{const p=c[g];!p.includes(t)&&!p.includes(i)&&!p.includes(n)&&c[g].push(n)})}else{const f=c[s.id];c[s.id]=f.filter(g=>g!==t&&g!==i),f.includes(n)||c[s.id].push(n),d.forEach(g=>{c[g]=c[g].filter(p=>p!==i),c[g].includes(t)||c[g].push(n)})}else if(l==="select"){Object.assign(c,this.getClearStates(!!n));const f=(g,p)=>{g.forEach(v=>{c[v]||(c[v]=o.getElementState(v)),c[v].push(p)})};f(h,t),f(d,i),n&&Object.keys(c).forEach(g=>{!h.includes(g)&&!d.includes(g)&&c[g].push(n)})}else Object.assign(c,this.getClearStates());yield o.setElementState(c,a)})}getDataStates(){const{graph:e}=this.context,{nodes:t,edges:n,combos:i}=e.getData(),a={};return[...t,...n,...i].forEach(s=>{a[X(s)]=nv(s)}),a}getClearStates(e=!1){const{graph:t}=this.context,{state:n,unselectedState:i,neighborState:a}=this.options,s=new Set([n,i,a]),{nodes:o,edges:A,combos:l}=t.getData(),c={};return[...o,...A,...l].forEach(u=>{const h=nv(u),d=h.filter(f=>!s.has(f));(e||d.length!==h.length)&&(c[X(u)]=d)}),c}clearState(){return Ah(this,void 0,void 0,function*(){const{graph:e}=this.context;yield e.setElementState(this.getClearStates(),this.options.animation)})}validate(e){if(this.destroyed)return!1;const{enable:t}=this.options;return Te(t)?t(e):!!t}unbindEvents(){const{graph:e}=this.context;zs.forEach(t=>{e.off(`${t}:${ie.CLICK}`,this.onClickSelect)}),e.off(ua.CLICK,this.onClickCanvas)}destroy(){this.unbindEvents(),super.destroy()}}lh.defaultOptions={animation:!0,enable:!0,multiple:!1,trigger:["shift"],state:"selected",neighborState:"selected",unselectedState:void 0,degree:0};function Fr(r){var e;return!!(!((e=r.style)===null||e===void 0)&&e.collapsed)}function ch(r,e){if(!r.startsWith(e))return!1;const t=r[e.length];return t>="A"&&t<="Z"}function gj(r,e){return`${e}${gc(r)}`}function pj(r,e,t=!0){if(!e||!ch(r,e))return r;const n=r.slice(e.length);return t?BR(n):n}function rn(r,e){const t=Object.entries(r).reduce((n,[i,a])=>(i==="className"||i==="class"||ch(i,e)&&Object.assign(n,{[pj(i,e)]:a}),n),{});if("opacity"in r){const n=gj("opacity",e),i=r.opacity;if(n in r){const a=r[n];Object.assign(t,{opacity:i*a})}else Object.assign(t,{opacity:i})}return t}function rv(r,e){const t=e.length;return Object.keys(r).reduce((n,i)=>{if(i.startsWith(e)){const a=i.slice(t);n[a]=r[i]}return n},{})}function GS(r,e){const t=typeof e=="string"?[e]:e,n={};return Object.keys(r).forEach(i=>{t.find(a=>i.startsWith(a))||(n[i]=r[i])}),n}function Gr(r=0){if(typeof r=="number")return[r,r,r];const[e,t=e,n=e]=r;return[e,t,n]}var vj=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};function KS(r,e){const{datum:t,graph:n}=e;return typeof r=="function"?r.call(n,t):Object.fromEntries(Object.entries(r).map(([i,a])=>typeof a=="function"?[i,a.call(n,t)]:[i,a]))}function Ln(r,e){const t=r?.style||{},n=e?.style||{};for(const i in t)i in n||(n[i]=t[i]);return Object.assign({},r,e,{style:n})}function yj(r){const{x:e,y:t,z:n,class:i,className:a,transform:s,transformOrigin:o,zIndex:A,visibility:l}=r;return vj(r,["x","y","z","class","className","transform","transformOrigin","zIndex","visibility"])}function mj(r,e){const t=Gr(r);let n={};return e.text&&!e.fontSize&&(n={fontSize:Math.min(...t)*.5}),e.src&&(!e.width||!e.height)&&(n={width:t[0]*.5,height:t[1]*.5}),n}function zS(r){if(r)return typeof r=="string"||typeof r=="function"||Array.isArray(r)?{type:"group",field:e=>e.id,color:r,invert:!1}:r}function wj(r,e){if(!e)return{};const{type:t,color:n,field:i,invert:a}=e,s=A=>{const l=typeof n=="string"?ha("palette",n):n;if(typeof l=="function"){const c={};return A.forEach(([u,h])=>{c[u]=l(a?1-h:h)}),c}else if(Array.isArray(l)){const c=a?[...l].reverse():l,u={};return A.forEach(([h,d])=>{u[h]=c[d%l.length]}),u}return{}},o=(A,l)=>{var c;return typeof A=="string"?(c=l.data)===null||c===void 0?void 0:c[A]:A?.(l)};if(t==="group"){const A=fc(r,h=>{if(!i)return"default";const d=o(i,h);return d?String(d):"default"}),l=Object.keys(A),c=s(l.map((h,d)=>[h,d])),u={};return Object.entries(A).forEach(([h,d])=>{d.forEach(f=>{u[X(f)]=c[h]})}),u}else if(t==="value"){const[A,l]=r.reduce(([u,h],d)=>{const f=o(i,d);if(typeof f!="number")throw new Error(da(`Palette field ${i} is not a number`));return[Math.min(u,f),Math.max(h,f)]},[1/0,-1/0]),c=l-A;return s(r.map(u=>[u.id,(o(i,u)-A)/c]))}}function VS(r){const e=typeof r=="string"?ha("palette",r):r;if(typeof e!="function")return e}function jS(r,e){let t=2*r;return typeof e=="string"?t=r*Number(e.replace("%",""))/100:typeof e=="number"&&(t=e),isNaN(t)&&(t=2*r),t}function WS(r,e,t=1,n=!1){const i=n?t:1,a=(r.max[0]-r.min[0])*i;return jS(a,e)}function Bj(r,e,t=1){const n=Lt(r[0],r[1])*t;return jS(n,e)}class gl extends QA{constructor(e){qS(e.style),super(e),this.shapeMap={},this.animateMap={},this.render(this.attributes,this),this.setVisibility(),this.bindEvents()}get parsedAttributes(){return this.attributes}upsert(e,t,n,i,a){var s,o,A,l,c,u,h,d;const f=this.shapeMap[e];if(n===!1){f&&((s=a?.beforeDestroy)===null||s===void 0||s.call(a,f),i.removeChild(f),delete this.shapeMap[e],(o=a?.afterDestroy)===null||o===void 0||o.call(a,f));return}const g=typeof t=="string"?ha(Al.SHAPE,t):t;if(!g)throw new Error(da(`Shape ${t} not found`));if(!f||f.destroyed||!(f instanceof g)){f&&((A=a?.beforeDestroy)===null||A===void 0||A.call(a,f),f?.destroy(),(l=a?.afterDestroy)===null||l===void 0||l.call(a,f)),(c=a?.beforeCreate)===null||c===void 0||c.call(a);const p=new g({className:e,style:n});return i.appendChild(p),this.shapeMap[e]=p,(u=a?.afterCreate)===null||u===void 0||u.call(a,p),p}return(h=a?.beforeUpdate)===null||h===void 0||h.call(a,f),Bv(f,n),(d=a?.afterUpdate)===null||d===void 0||d.call(a,f),f}update(e={}){const t=Object.assign({},this.attributes,e);qS(t),aW(this,t),this.render(t,this),this.setVisibility()}bindEvents(){}getGraphicStyle(e){return yj(e)}get compositeShapes(){return[["badges","badge-"],["ports","port-"]]}animate(e,t){if(e.length===0)return null;const n=[];if(e[0].x!==void 0||e[0].y!==void 0||e[0].z!==void 0){const{x:a=0,y:s=0,z:o=0}=this.attributes;e.forEach(A=>{const{x:l=a,y:c=s,z:u=o}=A;Object.assign(A,{transform:u?[["translate3d",l,c,u]]:[["translate",l,c]]})})}const i=super.animate(e,t);if(i&&(iv(this,i),n.push(i)),Array.isArray(e)&&e.length>0){const a=["transform","transformOrigin","x","y","z","zIndex"];if(Object.keys(e[0]).some(s=>!a.includes(s))){Object.entries(this.shapeMap).forEach(([o,A])=>{const l=`get${gc(o)}Style`,c=this[l];if(Te(c)){const u=e.map(d=>c.call(this,Object.assign(Object.assign({},this.attributes),d))),h=A.animate(jp(u),t);h&&(iv(A,h),n.push(h))}});const s=(o,A)=>{if(!Ui(o)){const l=`get${gc(A)}Style`,c=this[l];if(Te(c)){const u=e.map(h=>c.call(this,Object.assign(Object.assign({},this.attributes),h)));Object.entries(u[0]).map(([h])=>{const d=u.map(g=>g[h]),f=o[h];if(f){const g=f.animate(jp(d),t);g&&(iv(f,g),n.push(g))}})}}};this.compositeShapes.forEach(([o,A])=>{const l=rv(this.shapeMap,A);s(l,o)})}}return Vp(n)}getShape(e){return this.shapeMap[e]}setVisibility(){const{visibility:e}=this.attributes;Gs(this,e)}destroy(){this.shapeMap={},this.animateMap={},super.destroy()}}function iv(r,e){e?.finished.then(()=>{const t=r.activeAnimations.findIndex(n=>n===e);t>-1&&r.activeAnimations.splice(t,1)})}function qS(r){if(!r)return{};if("x"in r||"y"in r||"z"in r){const{x:e=0,y:t=0,z:n,transform:i}=r,a=gS(e,t,n,i);a&&(r.transform=a)}return r}var bj=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};class Ji extends gl{constructor(e){super(Ln({style:Ji.defaultStyleProps},e))}isTextStyle(e){return ch(e,"label")}isBackgroundStyle(e){return ch(e,"background")}getTextStyle(e){const t=this.getGraphicStyle(e),{padding:n}=t,i=bj(t,["padding"]);return GS(i,"background")}getBackgroundStyle(e){if(e.background===!1)return!1;const t=this.getGraphicStyle(e),{wordWrap:n,wordWrapWidth:i,padding:a}=t,s=rn(t,"background"),{min:[o,A],center:[l,c],halfExtents:[u,h]}=this.shapeMap.text.getGeometryBounds(),[d,f,g,p]=si(a),v=u*2+p+f,{width:y,height:m}=s;y&&m?Object.assign(s,{x:l-Number(y)/2,y:c-Number(m)/2}):Object.assign(s,{x:o-p,y:A-d,width:n?Math.min(v,i+p+f):v,height:h*2+d+g});const{radius:B}=s;if(typeof B=="string"&&B.endsWith("%")){const C=Number(B.replace("%",""))/100;s.radius=Math.min(+s.width,+s.height)*C}return s}render(e=this.parsedAttributes,t=this){this.upsert("text",ks,this.getTextStyle(e),t),this.upsert("background",Gn,this.getBackgroundStyle(e),t)}getGeometryBounds(){return(this.getShape("background")||this.getShape("text")).getGeometryBounds()}}Ji.defaultStyleProps={padding:0,fontSize:12,fontFamily:"system-ui, sans-serif",wordWrap:!0,maxLines:1,wordWrapWidth:128,textOverflow:"...",textBaseline:"middle",backgroundOpacity:.75,backgroundZIndex:-1,backgroundLineWidth:0};class Go extends gl{constructor(e){super(Ln({style:Go.defaultStyleProps},e))}getBadgeStyle(e){return this.getGraphicStyle(e)}render(e=this.parsedAttributes,t=this){this.upsert("label",Ji,this.getBadgeStyle(e),t)}getGeometryBounds(){const e=this.getShape("label");return(e.getShape("background")||e.getShape("text")).getGeometryBounds()}}Go.defaultStyleProps={padding:[2,4,2,4],fontSize:10,wordWrap:!1,backgroundRadius:"50%",backgroundOpacity:1};function Ej(r,e=!0){const t=[];return r.forEach((n,i)=>{t.push([i===0?"M":"L",...n])}),e&&t.push(["Z"]),t}const $S={M:["x","y"],m:["dx","dy"],H:["x"],h:["dx"],V:["y"],v:["dy"],L:["x","y"],l:["dx","dy"],Z:[],z:[],C:["x1","y1","x2","y2","x","y"],c:["dx1","dy1","dx2","dy2","dx","dy"],S:["x2","y2","x","y"],s:["dx2","dy2","dx","dy"],Q:["x1","y1","x","y"],q:["dx1","dy1","dx","dy"],T:["x","y"],t:["dx","dy"],A:["rx","ry","rotation","large-arc","sweep","x","y"],a:["rx","ry","rotation","large-arc","sweep","dx","dy"]};function xj(r){const e=r.replace(/[\n\r]/g,"").replace(/-/g," -").replace(/(\d*\.)(\d+)(?=\.)/g,"$1$2 ").trim().split(/\s*,|\s+/),t=[];let n="",i={};for(;e.length>0;){let a=e.shift();a in $S?n=a:e.unshift(a),i={type:n},$S[n].forEach(A=>{a=e.shift(),i[A]=a}),n==="M"?n="L":n==="m"&&(n="l");const[s,...o]=Object.values(i);t.push([s,...o.map(Number)])}return t}function Cj(r){const e=[];return(typeof r=="string"?xj(r):r).forEach(n=>{const i=n[0];if(i==="Z"){e.push(e[0]);return}if(i!=="A")for(let a=1;a<n.length;a=a+2)e.push([n[a],n[a+1],0]);else{const a=n.length;e.push([n[a-2],n[a-1],0])}}),e}const YS=r=>{if(r.length<2)return[["M",0,0],["L",0,0]];const e=r[0],t=r[1],n=r[r.length-1],i=r[r.length-2];r.unshift(i,n),r.push(e,t);const a=[["M",n[0],n[1]]];for(let s=1;s<r.length-2;s+=1){const[o,A]=r[s-1],[l,c]=r[s],[u,h]=r[s+1],[d,f]=s!==r.length-2?r[s+2]:[u,h],g=l+(u-o)/6,p=c+(h-A)/6,v=u-(d-l)/6,y=h-(f-c)/6;a.push(["C",g,p,v,y,u,h])}return a};function Sj(r,e,t,n,i,a,s){const[o,A]=ga(r,e),l={textAlign:e==="left"?"right":e==="right"?"left":"center",textBaseline:e==="top"?"bottom":e==="bottom"?"top":"middle",transform:[["translate",o+t,A+n]]};if(e==="center"||!i)return l;const c=Cj(a);if(!c||c.length<=3)return l;const u=c.map((f,g)=>{const p=f,v=c[(g+1)%c.length];return Xt(p,v)?null:[p,v]}).filter(Boolean),h=uj([o,A],u),d=PS([o,A],h);if(d&&h&&(l.transform=[["translate",d[0]+t,d[1]+n]],s)){const f=Math.atan((h[0][1]-h[1][1])/(h[0][0]-h[1][0]));l.transform.push(["rotate",f/Math.PI*180]),l.textAlign="center",(e==="right"||e==="left")&&(f>0?l.textBaseline=e==="right"?"bottom":"top":l.textBaseline=e==="right"?"top":"bottom")}return l}var Fj=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};class pl extends gl{constructor(e){super(Ln({style:pl.defaultStyleProps},e))}getLabelStyle(e){if(!e.label||!e.d||e.d.length===0)return!1;const t=rn(this.getGraphicStyle(e),"label"),{maxWidth:n,offsetX:i,offsetY:a,autoRotate:s,placement:o,closeToPath:A}=t,l=Fj(t,["maxWidth","offsetX","offsetY","autoRotate","placement","closeToPath"]),c=this.shapeMap.key,u=c?.getRenderBounds();return Object.assign(Sj(u,o,i,a,A,e.d,s),{wordWrapWidth:WS(u,n)},l)}getKeyStyle(e){return this.getGraphicStyle(e)}render(e,t){this.upsert("key",tr,this.getKeyStyle(e),t),this.upsert("label",Ji,this.getLabelStyle(e),t)}}pl.defaultStyleProps={label:!0,labelPlacement:"bottom",labelCloseToPath:!0,labelAutoRotate:!0,labelOffsetX:0,labelOffsetY:0};function Tj(r){const e=[],t=n=>{n?.children.length&&n.children.forEach(i=>{e.push(i),t(i)})};return t(r),e}function Mj(r){const e=[];let t=r.parentNode;for(;t;)e.push(t),t=t.parentNode;return e}let av=class extends PA{constructor(e){super(e),this.onMounted=()=>{this.handleRadius()},this.onAttrModified=()=>{this.handleRadius()},Ko=this,this.isMutationObserved=!0,this.addEventListener(at.MOUNTED,this.onMounted),this.addEventListener(at.ATTR_MODIFIED,this.onAttrModified)}handleRadius(){const{radius:e,clipPath:t,width:n=0,height:i=0}=this.attributes;if(e&&n&&i){const[a,s]=this.getBounds().min,o={x:a,y:s,radius:e,width:n,height:i};if(t)Object.assign(this.parsedStyle.clipPath.style,o);else{const A=new Gn({style:o});this.style.clipPath=A}}else t&&(this.style.clipPath=null)}};const sv=new WeakMap;let Ko=null;const ov=r=>{if(Ko&&Mj(Ko).includes(r)){const e=sv.get(r);e?e.includes(Ko)||e.push(Ko):sv.set(r,[Ko])}},Av=r=>{const e=sv.get(r);e&&e.forEach(t=>t.handleRadius())};class XS extends gl{constructor(e){super(e)}isImage(){const{src:e}=this.attributes;return!!e}getIconStyle(e=this.attributes){const{width:t=0,height:n=0}=e,i=this.getGraphicStyle(e);return this.isImage()?Object.assign({x:-t/2,y:-n/2},i):Object.assign({textBaseline:"middle",textAlign:"center"},i)}render(e=this.attributes,t=this){this.upsert("icon",this.isImage()?av:ks,this.getIconStyle(e),t)}}class ZS extends gl{get context(){return this.config.context}get parsedAttributes(){return this.attributes}onframe(){}animate(e,t){const n=super.animate(e,t);return n&&(n.onframe=()=>this.onframe(),n.finished.then(()=>this.onframe())),n}}var uh=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};class xi extends ZS{constructor(e){super(Ln({style:xi.defaultStyleProps},e)),this.type="node"}getSize(e=this.attributes){const{size:t}=e;return Gr(t)}getKeyStyle(e){const t=this.getGraphicStyle(e);return Object.assign(GS(t,["label","halo","icon","badge","port"]))}getLabelStyle(e){if(e.label===!1||!e.labelText)return!1;const t=rn(this.getGraphicStyle(e),"label"),{placement:n,maxWidth:i,offsetX:a,offsetY:s}=t,o=uh(t,["placement","maxWidth","offsetX","offsetY"]),A=this.getShape("key").getLocalBounds();return Object.assign(MF(A,n,a,s),{wordWrapWidth:WS(A,i)},o)}getHaloStyle(e){if(e.halo===!1)return!1;const t=this.getKeyStyle(e),{fill:n}=t,i=uh(t,["fill"]),a=rn(this.getGraphicStyle(e),"halo");return Object.assign(Object.assign(Object.assign({},i),{stroke:n}),a)}getIconStyle(e){if(e.icon===!1||!e.iconText&&!e.iconSrc)return!1;const t=rn(this.getGraphicStyle(e),"icon");return Object.assign(mj(e.size,t),t)}getBadgesStyle(e){var t;const n=rv(this.shapeMap,"badge-"),i={};if(Object.keys(n).forEach(u=>{i[u]=!1}),e.badge===!1||!(!((t=e.badges)===null||t===void 0)&&t.length))return i;const{badges:a=[],badgePalette:s,opacity:o=1}=e,A=uh(e,["badges","badgePalette","opacity"]),l=VS(s),c=rn(this.getGraphicStyle(A),"badge");return a.forEach((u,h)=>{i[h]=Object.assign(Object.assign({backgroundFill:l?l[h%l?.length]:void 0,opacity:o},c),this.getBadgeStyle(u))}),i}getBadgeStyle(e){const t=this.getShape("key"),{placement:n="top",offsetX:i,offsetY:a}=e,s=uh(e,["placement","offsetX","offsetY"]),o=MF(t.getLocalBounds(),n,i,a,!0);return Object.assign(Object.assign({},o),s)}getPortsStyle(e){var t;const n=this.getPorts(),i={};if(Object.keys(n).forEach(o=>{i[o]=!1}),e.port===!1||!(!((t=e.ports)===null||t===void 0)&&t.length))return i;const a=rn(this.getGraphicStyle(e),"port"),{ports:s=[]}=e;return s.forEach((o,A)=>{const l=o.key||A,c=Object.assign(Object.assign({},a),o);if(SF(c))i[l]=!1;else{const[u,h]=this.getPortXY(e,o);i[l]=Object.assign({transform:[["translate",u,h]]},c)}}),i}getPortXY(e,t){const{placement:n="left"}=t,i=this.getShape("key");return yv(Oj(this.context,i),n)}getPorts(){return rv(this.shapeMap,"port-")}getCenter(){return this.getShape("key").getBounds().center}getIntersectPoint(e,t=!1){const n=this.getShape("key").getBounds();return lj(e,n,t)}drawHaloShape(e,t){const n=this.getHaloStyle(e),i=this.getShape("key");this.upsert("halo",i.constructor,n,t)}drawIconShape(e,t){const n=this.getIconStyle(e);this.upsert("icon",XS,n,t),ov(this)}drawBadgeShapes(e,t){const n=this.getBadgesStyle(e);Object.keys(n).forEach(i=>{const a=n[i];this.upsert(`badge-${i}`,Go,a,t)})}drawPortShapes(e,t){const n=this.getPortsStyle(e);Object.keys(n).forEach(i=>{const a=n[i],s=`port-${i}`;this.upsert(s,zi,a,t)})}drawLabelShape(e,t){const n=this.getLabelStyle(e);this.upsert("label",Ji,n,t)}_drawKeyShape(e,t){return this.drawKeyShape(e,t)}render(e=this.parsedAttributes,t=this){this._drawKeyShape(e,t),this.getShape("key")&&(this.drawHaloShape(e,t),this.drawIconShape(e,t),this.drawBadgeShapes(e,t),this.drawLabelShape(e,t),this.drawPortShapes(e,t))}update(e){super.update(e),e&&("x"in e||"y"in e||"z"in e)&&Av(this)}onframe(){this.drawBadgeShapes(this.parsedAttributes,this),this.drawLabelShape(this.parsedAttributes,this)}}xi.defaultStyleProps={x:0,y:0,size:32,droppable:!0,draggable:!0,port:!0,ports:[],portZIndex:2,portLinkToCenter:!1,badge:!0,badges:[],badgeZIndex:3,halo:!1,haloDroppable:!1,haloLineDash:0,haloLineWidth:12,haloStrokeOpacity:.25,haloPointerEvents:"none",haloZIndex:-1,icon:!0,iconZIndex:1,label:!0,labelIsBillboard:!0,labelMaxWidth:"200%",labelPlacement:"bottom",labelWordWrap:!1,labelZIndex:0};function Oj(r,e){if(!r)return e.getLocalBounds();const t=r.canvas.getLayer(),n=e.cloneNode();Gs(n,"hidden"),t.appendChild(n);const i=n.getLocalBounds();return n.destroy(),i}let vl=class uP extends xi{constructor(e){super(Ln({style:uP.defaultStyleProps},e))}drawKeyShape(e,t){return this.upsert("key",zi,this.getKeyStyle(e),t)}getKeyStyle(e){const t=super.getKeyStyle(e);return Object.assign(Object.assign({},t),{r:Math.min(...this.getSize(e))/2})}getIconStyle(e){const t=super.getIconStyle(e),{r:n}=this.getShape("key").attributes,i=n*2*pa;return t?Object.assign({width:i,height:i},t):!1}getIntersectPoint(e,t=!1){const n=this.getShape("key").getBounds();return sh(e,n,t)}};vl.defaultStyleProps={size:32};class hh extends xi{constructor(e){super(e)}get parsedAttributes(){return this.attributes}drawKeyShape(e,t){return this.upsert("key",_s,this.getKeyStyle(e),t)}getKeyStyle(e){const t=super.getKeyStyle(e);return Object.assign(Object.assign({},t),{points:this.getPoints(e)})}getIntersectPoint(e,t=!1){var n,i;const{points:a}=this.getShape("key").attributes,s=[+(((n=this.attributes)===null||n===void 0?void 0:n.x)||0),+(((i=this.attributes)===null||i===void 0?void 0:i.y)||0)];return US(e,s,a,!0,t).point}}class Ij extends hh{constructor(e){super(e)}getPoints(e){const[t,n]=this.getSize(e);return iW(t,n)}}var _j=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};class dh extends vl{constructor(e){super(Ln({style:dh.defaultStyleProps},e))}parseOuterR(){const{size:e}=this.parsedAttributes;return Math.min(...Gr(e))/2}parseInnerR(){const{innerR:e}=this.parsedAttributes;return ot(e)?parseInt(e)/100*this.parseOuterR():e}drawDonutShape(e,t){const{donuts:n}=e;if(!n?.length)return;const i=n.map(u=>Be(u)?{value:u}:u),a=rn(this.getGraphicStyle(e),"donut"),s=VS(e.donutPalette);if(!s)return;const o=i.reduce((u,h)=>{var d;return u+((d=h.value)!==null&&d!==void 0?d:0)},0),A=this.parseOuterR(),l=this.parseInnerR();let c=0;i.forEach((u,h)=>{const{value:d=0,color:f=s[h%s.length]}=u,g=_j(u,["value","color"]),p=(o===0?1/i.length:d/o)*360;this.upsert(`round${h}`,tr,Object.assign(Object.assign(Object.assign({},a),{d:Lj(A,l,c,c+p),fill:f}),g),t),c+=p})}render(e,t=this){super.render(e,t),this.drawDonutShape(e,t)}}dh.defaultStyleProps={innerR:"50%",donuts:[],donutPalette:"tableau"};const fh=(r,e,t,n)=>[r+Math.sin(n)*t,e-Math.cos(n)*t],kj=(r,e,t,n)=>n<=0||t<=n?[["M",r-t,e],["A",t,t,0,1,1,r+t,e],["A",t,t,0,1,1,r-t,e],["Z"]]:[["M",r-t,e],["A",t,t,0,1,1,r+t,e],["A",t,t,0,1,1,r-t,e],["Z"],["M",r+n,e],["A",n,n,0,1,0,r-n,e],["A",n,n,0,1,0,r+n,e],["Z"]],Nj=(r,e,t,n,i,a)=>{const[s,o]=[i/360*2*Math.PI,a/360*2*Math.PI],A=[fh(r,e,n,s),fh(r,e,t,s),fh(r,e,t,o),fh(r,e,n,o)],l=o-s>Math.PI?1:0;return[["M",A[0][0],A[0][1]],["L",A[1][0],A[1][1]],["A",t,t,0,l,1,A[2][0],A[2][1]],["L",A[3][0],A[3][1]],["A",n,n,0,l,0,A[0][0],A[0][1]],["Z"]]},Lj=(r=0,e=0,t,n)=>{const[i,a]=[0,0];return Math.abs(t-n)%360<1e-6?kj(i,a,r,e):Nj(i,a,r,e,t,n)};class gh extends xi{constructor(e){super(Ln({style:gh.defaultStyleProps},e))}drawKeyShape(e,t){return this.upsert("key",UA,this.getKeyStyle(e),t)}getKeyStyle(e){const t=super.getKeyStyle(e),[n,i]=this.getSize(e);return Object.assign(Object.assign({},t),{rx:n/2,ry:i/2})}getIconStyle(e){const t=super.getIconStyle(e),{rx:n,ry:i}=this.getShape("key").attributes,a=Math.min(+n,+i)*2*pa;return t?Object.assign({width:a,height:a},t):!1}getIntersectPoint(e,t=!1){const n=this.getShape("key").getBounds();return sh(e,n,t)}}gh.defaultStyleProps={size:[45,35]};class Qj extends hh{constructor(e){super(e)}getOuterR(e){return e.outerR||Math.min(...this.getSize(e))/2}getPoints(e){return sW(this.getOuterR(e))}getIconStyle(e){const t=super.getIconStyle(e),n=this.getOuterR(e)*pa;return t?Object.assign({width:n,height:n},t):!1}}function ea(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}var Uj=0;function Pj(r){return"__private_"+Uj+++"_"+r}var dn=Pj("renderState"),JS=(function(){function r(e){le(this,r),this.renderQueue=[],Object.defineProperty(this,dn,{writable:!0,value:{restoreStack:[],prevObject:null,currentContext:new Map}}),this.clearFullScreenLastFrame=!1,this.clearFullScreen=!1,this.vpMatrix=Ct(),this.dprMatrix=Ct(),this.tmpMat4=Ct(),this.vec3a=Je(),this.vec3b=Je(),this.vec3c=Je(),this.vec3d=Je(),this.canvasRendererPluginOptions=e}return ce(r,[{key:"apply",value:function(t,n){var i=this;this.context=t;var a=this.context,s=a.config,o=a.camera,A=a.renderingService,l=a.renderingContext,c=a.pathGeneratorFactory,u=s.renderer.getConfig().enableRenderingOptimization;s.renderer.getConfig().enableDirtyCheck=!1,s.renderer.getConfig().enableDirtyRectangleRendering=!1,this.pathGeneratorFactory=c;var h=t.contextService,d=l.root.ownerDocument.defaultView;A.hooks.init.tap(r.tag,function(){var p=h.getDPR(),v=s.width,y=s.height,m=h.getContext();i.clearRect(m,0,0,v*p,y*p,s.background)}),A.hooks.destroy.tap(r.tag,function(){i.renderQueue=[],ea(i,dn)[dn]={restoreStack:[],prevObject:null,currentContext:null}});var f=function(){var v,y=h.getContext(),m=h.getDPR(),B=s.width,C=s.height,S=i.canvasRendererPluginOptions,F=S.dirtyObjectNumThreshold,T=S.dirtyObjectRatioThreshold,O=A.getStats(),I=O.total,k=O.rendered,N=k/I;i.clearFullScreen=i.clearFullScreenLastFrame||!((v=d.context.renderingPlugins[1])!==null&&v!==void 0&&v.isFirstTimeRenderingFinished)||A.disableDirtyRectangleRendering()||k>F&&N>T,y&&(typeof y.resetTransform=="function"?y.resetTransform():y.setTransform(1,0,0,1,0,0),i.clearFullScreen&&i.clearRect(y,0,0,B*m,C*m,s.background))},g=function(v,y){for(var m=[v];m.length>0;){var B,C=m.pop();C.isVisible()&&!C.isCulled()&&(u?i.renderDisplayObjectOptimized(C,y,i.context,ea(i,dn)[dn],n):i.renderDisplayObject(C,y,i.context,ea(i,dn)[dn],n));for(var S=((B=C.sortable)===null||B===void 0||(B=B.sorted)===null||B===void 0?void 0:B.length)>0?C.sortable.sorted:C.childNodes,F=S.length-1;F>=0;F--)m.push(S[F])}};A.hooks.endFrame.tap(r.tag,function(){if(f(),l.root.childNodes.length===0){i.clearFullScreenLastFrame=!0;return}u=s.renderer.getConfig().enableRenderingOptimization,ea(i,dn)[dn]={restoreStack:[],prevObject:null,currentContext:ea(i,dn)[dn].currentContext},ea(i,dn)[dn].currentContext.clear(),i.clearFullScreenLastFrame=!1;var p=h.getContext(),v=h.getDPR();if(vs(i.dprMatrix,[v,v,1]),Xn(i.vpMatrix,i.dprMatrix,o.getOrthoMatrix()),i.clearFullScreen)u?(p.save(),g(l.root,p),p.restore()):g(l.root,p);else{var y=i.safeMergeAABB(i.mergeDirtyAABBs(i.renderQueue));if(kt.isEmpty(y)){i.renderQueue=[];return}var m=i.convertAABB2Rect(y),B=m.x,C=m.y,S=m.width,F=m.height,T=Jn(i.vec3a,[B,C,0],i.vpMatrix),O=Jn(i.vec3b,[B+S,C,0],i.vpMatrix),I=Jn(i.vec3c,[B,C+F,0],i.vpMatrix),k=Jn(i.vec3d,[B+S,C+F,0],i.vpMatrix),N=Math.min(T[0],O[0],k[0],I[0]),U=Math.min(T[1],O[1],k[1],I[1]),D=Math.max(T[0],O[0],k[0],I[0]),G=Math.max(T[1],O[1],k[1],I[1]),Z=Math.floor(N),q=Math.floor(U),j=Math.ceil(D-N),te=Math.ceil(G-U);p.save(),i.clearRect(p,Z,q,j,te,s.background),p.beginPath(),p.rect(Z,q,j,te),p.clip(),p.setTransform(i.vpMatrix[0],i.vpMatrix[1],i.vpMatrix[4],i.vpMatrix[5],i.vpMatrix[12],i.vpMatrix[13]);var ue=s.renderer.getConfig(),ge=ue.enableDirtyRectangleRenderingDebug;ge&&d.dispatchEvent(new yn(Lr.DIRTY_RECTANGLE,{dirtyRect:{x:Z,y:q,width:j,height:te}}));var Y=y.getMin(),xe=$e(Y,2),$=xe[0],K=xe[1],ee=y.getMax(),oe=$e(ee,2),Ee=oe[0],Le=oe[1],Pe=l.root.ownerDocument.elementsFromBBox($,K,Ee,Le);Pe.sort(function(st,ut){return st.sortable.renderOrder-ut.sortable.renderOrder}).forEach(function(st){st&&st.isVisible()&&!st.isCulled()&&i.renderDisplayObject(st,p,i.context,ea(i,dn)[dn],n)}),p.restore(),i.renderQueue.forEach(function(st){i.saveDirtyAABB(st)}),i.renderQueue=[]}ea(i,dn)[dn].restoreStack.forEach(function(){p.restore()}),ea(i,dn)[dn].restoreStack=[]}),A.hooks.render.tap(r.tag,function(p){i.clearFullScreen||i.renderQueue.push(p)})}},{key:"clearRect",value:function(t,n,i,a,s,o){t.clearRect(n,i,a,s),o&&(t.fillStyle=o,t.fillRect(n,i,a,s))}},{key:"renderDisplayObjectOptimized",value:function(t,n,i,a,s){var o=t.nodeName,A=!1,l=!1,c=this.context.styleRendererFactory[o],u=this.pathGeneratorFactory[o],h=t.parsedStyle.clipPath;if(h){A=!a.prevObject||!Hf(h.getWorldTransform(),a.prevObject.getWorldTransform()),A&&(this.applyWorldTransform(n,h),a.prevObject=null);var d=this.pathGeneratorFactory[h.nodeName];d&&(n.save(),l=!0,n.beginPath(),d(n,h.parsedStyle),n.closePath(),n.clip())}if(c){A=!a.prevObject||!Hf(t.getWorldTransform(),a.prevObject.getWorldTransform()),A&&this.applyWorldTransform(n,t);var f=!a.prevObject;if(!f){var g=a.prevObject.nodeName;o===re.TEXT?f=g!==re.TEXT:o===re.IMAGE?f=g!==re.IMAGE:f=g===re.TEXT||g===re.IMAGE}c.applyStyleToContext(n,t,f,a),a.prevObject=t}u&&(n.beginPath(),u(n,t.parsedStyle),o!==re.LINE&&o!==re.PATH&&o!==re.POLYLINE&&n.closePath()),c&&c.drawToContext(n,t,ea(this,dn)[dn],this,s),l&&n.restore(),t.dirty(!1)}},{key:"renderDisplayObject",value:function(t,n,i,a,s){var o=t.nodeName,A=a.restoreStack[a.restoreStack.length-1];A&&!(t.compareDocumentPosition(A)&Kt.DOCUMENT_POSITION_CONTAINS)&&(n.restore(),a.restoreStack.pop());var l=this.context.styleRendererFactory[o],c=this.pathGeneratorFactory[o],u=t.parsedStyle.clipPath;if(u){this.applyWorldTransform(n,u);var h=this.pathGeneratorFactory[u.nodeName];h&&(n.save(),a.restoreStack.push(t),n.beginPath(),h(n,u.parsedStyle),n.closePath(),n.clip())}l&&(this.applyWorldTransform(n,t),n.save(),this.applyAttributesToContext(n,t)),c&&(n.beginPath(),c(n,t.parsedStyle),o!==re.LINE&&o!==re.PATH&&o!==re.POLYLINE&&n.closePath()),l&&(l.render(n,t.parsedStyle,t,i,this,s),n.restore()),t.dirty(!1)}},{key:"applyAttributesToContext",value:function(t,n){var i=n.parsedStyle,a=i.stroke,s=i.fill,o=i.opacity,A=i.lineDash,l=i.lineDashOffset;A&&t.setLineDash(A),ke(l)||(t.lineDashOffset=l),ke(o)||(t.globalAlpha*=o),!ke(a)&&!Array.isArray(a)&&!a.isNone&&(t.strokeStyle=n.attributes.stroke),!ke(s)&&!Array.isArray(s)&&!s.isNone&&(t.fillStyle=n.attributes.fill)}},{key:"convertAABB2Rect",value:function(t){var n=t.getMin(),i=t.getMax(),a=Math.floor(n[0]),s=Math.floor(n[1]),o=Math.ceil(i[0]),A=Math.ceil(i[1]),l=o-a,c=A-s;return{x:a,y:s,width:l,height:c}}},{key:"mergeDirtyAABBs",value:function(t){var n=new kt;return t.forEach(function(i){var a=i.getRenderBounds();n.add(a);var s=i.renderable.dirtyRenderBounds;s&&n.add(s)}),n}},{key:"saveDirtyAABB",value:function(t){var n=t.renderable;n.dirtyRenderBounds||(n.dirtyRenderBounds=new kt);var i=t.getRenderBounds();i&&n.dirtyRenderBounds.update(i.center,i.halfExtents)}},{key:"applyWorldTransform",value:function(t,n,i){i?(ho(this.tmpMat4,n.getLocalTransform()),Xn(this.tmpMat4,i,this.tmpMat4),Xn(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(ho(this.tmpMat4,n.getWorldTransform()),Xn(this.tmpMat4,this.vpMatrix,this.tmpMat4)),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])}},{key:"safeMergeAABB",value:function(){for(var t=new kt,n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return i.forEach(function(s){t.add(s)}),t}}])})();JS.tag="CanvasRenderer";function ph(r,e,t,n,i,a,s){var o,A;if(r.image.nodeName==="rect"){var l=r.image.parsedStyle,c=l.width,u=l.height;A=n.contextService.getDPR();var h=n.config.offscreenCanvas;o=a.offscreenCanvasCreator.getOrCreateCanvas(h),o.width=c*A,o.height=u*A;var d=a.offscreenCanvasCreator.getOrCreateContext(h),f={restoreStack:[],prevObject:null,currentContext:new Map};r.image.forEach(function(p){i.renderDisplayObject(p,d,n,f,a)}),f.restoreStack.forEach(function(){d.restore()})}var g=s.getOrCreatePatternSync(e,r,t,o,A,e.getGeometryBounds().min,function(){e.dirty(),n.renderingService.dirty()});return g}function vh(r,e,t,n){var i;if(r.type===Pa.LinearGradient||r.type===Pa.RadialGradient){var a=e.getGeometryBounds(),s=a&&a.halfExtents[0]*2||1,o=a&&a.halfExtents[1]*2||1,A=a&&a.min||[0,0];i=n.getOrCreateGradient(De(De({type:r.type},r.value),{},{min:A,width:s,height:o}),t)}return i}var yh=["shadowBlur","shadowOffsetX","shadowOffsetY"],eF=["lineCap","lineJoin","miterLimit"],wn={globalAlpha:1,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",filter:"none",globalCompositeOperation:"source-over",strokeStyle:"#000",strokeOpacity:1,lineWidth:1,lineDash:[],lineDashOffset:0,lineCap:"butt",lineJoin:"miter",miterLimit:10,fillStyle:"#000",fillOpacity:1},tF={};function Jt(r,e,t,n){var i=n.has(e)?n.get(e):wn[e];return i!==t&&(e==="lineDash"?r.setLineDash(t):r[e]=t,n.set(e,t)),i}var Rj=(function(){function r(e){le(this,r),this.imagePool=e}return ce(r,[{key:"applyAttributesToContext",value:function(t,n){}},{key:"render",value:function(t,n,i,a,s,o){}},{key:"applyCommonStyleToContext",value:function(t,n,i,a){var s=i?tF:a.prevObject.parsedStyle,o=n.parsedStyle;(i||o.opacity!==s.opacity)&&Jt(t,"globalAlpha",ke(o.opacity)?wn.globalAlpha:o.opacity,a.currentContext),(i||o.blend!==s.blend)&&Jt(t,"globalCompositeOperation",ke(o.blend)?wn.globalCompositeOperation:o.blend,a.currentContext)}},{key:"applyStrokeFillStyleToContext",value:function(t,n,i,a){var s=i?tF:a.prevObject.parsedStyle,o=n.parsedStyle,A=o.lineWidth,l=A===void 0?wn.lineWidth:A,c=o.fill&&!o.fill.isNone,u=o.stroke&&!o.stroke.isNone&&l>0;if(u){if(i||n.attributes.stroke!==a.prevObject.attributes.stroke){var h=!ke(o.stroke)&&!Array.isArray(o.stroke)&&!o.stroke.isNone?n.attributes.stroke:wn.strokeStyle;Jt(t,"strokeStyle",h,a.currentContext)}(i||o.lineWidth!==s.lineWidth)&&Jt(t,"lineWidth",ke(o.lineWidth)?wn.lineWidth:o.lineWidth,a.currentContext),(i||o.lineDash!==s.lineDash)&&Jt(t,"lineDash",o.lineDash||wn.lineDash,a.currentContext),(i||o.lineDashOffset!==s.lineDashOffset)&&Jt(t,"lineDashOffset",ke(o.lineDashOffset)?wn.lineDashOffset:o.lineDashOffset,a.currentContext);for(var d=0;d<eF.length;d++){var f=eF[d];(i||o[f]!==s[f])&&Jt(t,f,ke(o[f])?wn[f]:o[f],a.currentContext)}}if(c&&(i||n.attributes.fill!==a.prevObject.attributes.fill)){var g=!ke(o.fill)&&!Array.isArray(o.fill)&&!o.fill.isNone?n.attributes.fill:wn.fillStyle;Jt(t,"fillStyle",g,a.currentContext)}}},{key:"applyStyleToContext",value:function(t,n,i,a){var s=n.nodeName;this.applyCommonStyleToContext(t,n,i,a),s===re.IMAGE||this.applyStrokeFillStyleToContext(t,n,i,a)}},{key:"applyShadowAndFilterStyleToContext",value:function(t,n,i,a){var s=n.parsedStyle;if(i){Jt(t,"shadowColor",s.shadowColor.toString(),a.currentContext);for(var o=0;o<yh.length;o++){var A=yh[o];Jt(t,A,s[A]||wn[A],a.currentContext)}}s.filter&&s.filter.length&&Jt(t,"filter",n.attributes.filter,a.currentContext)}},{key:"clearShadowAndFilterStyleForContext",value:function(t,n,i,a){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(n){Jt(t,"shadowColor",wn.shadowColor,a.currentContext);for(var o=0;o<yh.length;o++){var A=yh[o];Jt(t,A,wn[A],a.currentContext)}}if(i)if(n&&s){var l=t.filter;!ke(l)&&l.indexOf("drop-shadow")>-1&&Jt(t,"filter",l.replace(/drop-shadow\([^)]*\)/,"").trim()||wn.filter,a.currentContext)}else Jt(t,"filter",wn.filter,a.currentContext)}},{key:"fillToContext",value:function(t,n,i,a,s){var o=this,A=n.parsedStyle,l=A.fill,c=A.fillRule,u=null;if(Array.isArray(l)&&l.length>0)l.forEach(function(d){var f=Jt(t,"fillStyle",vh(d,n,t,o.imagePool),i.currentContext);u=u??f,c?t.fill(c):t.fill()});else{if(Es(l)){var h=ph(l,n,t,n.ownerDocument.defaultView.context,a,s,this.imagePool);h&&(t.fillStyle=h,u=!0)}c?t.fill(c):t.fill()}u!==null&&Jt(t,"fillStyle",u,i.currentContext)}},{key:"strokeToContext",value:function(t,n,i,a,s){var o=this,A=n.parsedStyle.stroke,l=null;if(Array.isArray(A)&&A.length>0)A.forEach(function(h){var d=Jt(t,"strokeStyle",vh(h,n,t,o.imagePool),i.currentContext);l=l??d,t.stroke()});else{if(Es(A)){var c=ph(A,n,t,n.ownerDocument.defaultView.context,a,s,this.imagePool);if(c){var u=Jt(t,"strokeStyle",c,i.currentContext);l=l??u}}t.stroke()}l!==null&&Jt(t,"strokeStyle",l,i.currentContext)}},{key:"drawToContext",value:function(t,n,i,a,s){var o,A=n.nodeName,l=n.parsedStyle,c=l.opacity,u=c===void 0?wn.globalAlpha:c,h=l.fillOpacity,d=h===void 0?wn.fillOpacity:h,f=l.strokeOpacity,g=f===void 0?wn.strokeOpacity:f,p=l.lineWidth,v=p===void 0?wn.lineWidth:p,y=l.fill&&!l.fill.isNone,m=l.stroke&&!l.stroke.isNone&&v>0;if(!(!y&&!m)){var B=!ke(l.shadowColor)&&l.shadowBlur>0,C=l.shadowType==="inner",S=((o=l.fill)===null||o===void 0?void 0:o.alpha)===0,F=!!(l.filter&&l.filter.length),T=B&&m&&(A===re.PATH||A===re.LINE||A===re.POLYLINE||S||C),O=null;if(y){T||this.applyShadowAndFilterStyleToContext(t,n,B,i);var I=u*d;O=Jt(t,"globalAlpha",I,i.currentContext),this.fillToContext(t,n,i,a,s),T||this.clearShadowAndFilterStyleForContext(t,B,F,i)}if(m){var k=!1,N=u*g,U=Jt(t,"globalAlpha",N,i.currentContext);if(O=y?O:U,T&&(this.applyShadowAndFilterStyleToContext(t,n,B,i),k=!0,C)){var D=t.globalCompositeOperation;t.globalCompositeOperation="source-atop",this.strokeToContext(t,n,i,a,s),t.globalCompositeOperation=D,this.clearShadowAndFilterStyleForContext(t,B,F,i,!0)}this.strokeToContext(t,n,i,a,s),k&&this.clearShadowAndFilterStyleForContext(t,B,F,i)}O!==null&&Jt(t,"globalAlpha",O,i.currentContext)}}}])})(),lv=(function(r){function e(){return le(this,e),We(this,e,arguments)}return qe(e,r),ce(e,[{key:"render",value:function(n,i,a,s,o,A){var l=i.fill,c=i.fillRule,u=i.opacity,h=u===void 0?1:u,d=i.fillOpacity,f=d===void 0?1:d,g=i.stroke,p=i.strokeOpacity,v=p===void 0?1:p,y=i.lineWidth,m=y===void 0?1:y,B=i.lineCap,C=i.lineJoin,S=i.shadowType,F=i.shadowColor,T=i.shadowBlur,O=i.filter,I=i.miterLimit,k=l&&!l.isNone,N=g&&!g.isNone&&m>0,U=l?.alpha===0,D=!!(O&&O.length),G=!ke(F)&&T>0,Z=a.nodeName,q=S==="inner",j=N&&G&&(Z===re.PATH||Z===re.LINE||Z===re.POLYLINE||U||q);k&&(n.globalAlpha=h*f,j||mh(a,n,G),nF(n,a,l,c,s,o,A,this.imagePool),j||this.clearShadowAndFilter(n,D,G)),N&&(n.globalAlpha=h*v,n.lineWidth=m,ke(I)||(n.miterLimit=I),ke(B)||(n.lineCap=B),ke(C)||(n.lineJoin=C),j&&(q&&(n.globalCompositeOperation="source-atop"),mh(a,n,!0),q&&(cv(n,a,g,s,o,A,this.imagePool),n.globalCompositeOperation=wn.globalCompositeOperation,this.clearShadowAndFilter(n,D,!0))),cv(n,a,g,s,o,A,this.imagePool))}},{key:"clearShadowAndFilter",value:function(n,i,a){if(a&&(n.shadowColor="transparent",n.shadowBlur=0),i){var s=n.filter;!ke(s)&&s.indexOf("drop-shadow")>-1&&(n.filter=s.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}}}])})(Rj);function mh(r,e,t){var n=r.parsedStyle,i=n.filter,a=n.shadowColor,s=n.shadowBlur,o=n.shadowOffsetX,A=n.shadowOffsetY;i&&i.length&&(e.filter=r.style.filter),t&&(e.shadowColor=a.toString(),e.shadowBlur=s||0,e.shadowOffsetX=o||0,e.shadowOffsetY=A||0)}function nF(r,e,t,n,i,a,s,o){var A=arguments.length>8&&arguments[8]!==void 0?arguments[8]:!1;Array.isArray(t)?t.forEach(function(l){r.fillStyle=vh(l,e,r,o),A||(n?r.fill(n):r.fill())}):(Es(t)&&(r.fillStyle=ph(t,e,r,i,a,s,o)),A||(n?r.fill(n):r.fill()))}function cv(r,e,t,n,i,a,s){var o=arguments.length>7&&arguments[7]!==void 0?arguments[7]:!1;Array.isArray(t)?t.forEach(function(A){r.strokeStyle=vh(A,e,r,s),o||r.stroke()}):(Es(t)&&(r.strokeStyle=ph(t,e,r,n,i,a,s)),o||r.stroke())}function Dj(r,e){var t=$e(r,4),n=t[0],i=t[1],a=t[2],s=t[3],o=$e(e,4),A=o[0],l=o[1],c=o[2],u=o[3],h=Math.max(n,A),d=Math.max(i,l),f=Math.min(n+a,A+c),g=Math.min(i+s,l+u);return f<=h||g<=d?null:[h,d,f-h,g-d]}function Hj(r,e){var t=Jn(Je(),[r[0],r[1],0],e),n=Jn(Je(),[r[0]+r[2],r[1],0],e),i=Jn(Je(),[r[0],r[1]+r[3],0],e),a=Jn(Je(),[r[0]+r[2],r[1]+r[3],0],e);return[Math.min(t[0],n[0],i[0],a[0]),Math.min(t[1],n[1],i[1],a[1]),Math.max(t[0],n[0],i[0],a[0])-Math.min(t[0],n[0],i[0],a[0]),Math.max(t[1],n[1],i[1],a[1])-Math.min(t[1],n[1],i[1],a[1])]}var Gj=(function(r){function e(){return le(this,e),We(this,e,arguments)}return qe(e,r),ce(e,[{key:"renderDownSampled",value:function(n,i,a,s){var o=s.src,A=s.imageCache;if(!A.downSampled){this.imagePool.createDownSampledImage(o,a).then(function(){a.ownerDocument&&(a.dirty(),a.ownerDocument.defaultView.context.renderingService.dirty())}).catch(function(l){console.error(l)});return}n.drawImage(A.downSampled,Math.floor(s.drawRect[0]),Math.floor(s.drawRect[1]),Math.ceil(s.drawRect[2]),Math.ceil(s.drawRect[3]))}},{key:"renderTile",value:function(n,i,a,s){var o=s.src,A=s.imageCache,l=s.imageRect,c=s.drawRect,u=A.size,h=n.getTransform(),d=h.a,f=h.b,g=h.c,p=h.d,v=h.e,y=h.f;if(n.resetTransform(),!(A!=null&&A.gridSize)){this.imagePool.createImageTiles(o,[],function(){a.ownerDocument&&(a.dirty(),a.ownerDocument.defaultView.context.renderingService.dirty())},a).catch(function(G){console.error(G)});return}for(var m=[u[0]/l[2],u[1]/l[3]],B=[A.tileSize[0]/m[0],A.tileSize[1]/m[1]],C=[Math.floor((c[0]-l[0])/B[0]),Math.ceil((c[0]+c[2]-l[0])/B[0])],S=C[0],F=C[1],T=[Math.floor((c[1]-l[1])/B[1]),Math.ceil((c[1]+c[3]-l[1])/B[1])],O=T[0],I=T[1],k=O;k<=I;k++)for(var N=S;N<=F;N++){var U=A.tiles[k][N];if(U){var D=[Math.floor(l[0]+U.tileX*B[0]),Math.floor(l[1]+U.tileY*B[1]),Math.ceil(B[0]),Math.ceil(B[1])];n.drawImage(U.data,D[0],D[1],D[2],D[3])}}n.setTransform(d,f,g,p,v,y)}},{key:"render",value:function(n,i,a){var s=i.x,o=s===void 0?0:s,A=i.y,l=A===void 0?0:A,c=i.width,u=i.height,h=i.src,d=i.shadowColor,f=i.shadowBlur,g=this.imagePool.getImageSync(h,a),p=g?.img,v=c,y=u;if(p){v||(v=p.width),y||(y=p.height);var m=!ke(d)&&f>0;mh(a,n,m);try{var B=a.ownerDocument.defaultView.getContextService().getDomElement(),C=B.width,S=B.height,F=n.getTransform(),T=F.a,O=F.b,I=F.c,k=F.d,N=F.e,U=F.f,D=Gb(T,I,0,0,O,k,0,0,0,0,1,0,N,U,0,1),G=Hj([o,l,v,y],D),Z=Dj([0,0,C,S],G);if(!Z)return;if(!a.ownerDocument.defaultView.getConfig().enableLargeImageOptimization){e.renderFull(n,i,a,{image:p,drawRect:[o,l,v,y]});return}var q=G[2]/g.size[0];if(q<(g.downSamplingRate||.5)){this.renderDownSampled(n,i,a,{src:h,imageCache:g,drawRect:[o,l,v,y]});return}if(!ImagePool.isSupportTile){e.renderFull(n,i,a,{image:p,drawRect:[o,l,v,y]});return}this.renderTile(n,i,a,{src:h,imageCache:g,imageRect:G,drawRect:Z})}catch{}}}},{key:"drawToContext",value:function(n,i,a,s,o){this.render(n,i.parsedStyle,i)}}],[{key:"renderFull",value:function(n,i,a,s){n.drawImage(s.image,Math.floor(s.drawRect[0]),Math.floor(s.drawRect[1]),Math.ceil(s.drawRect[2]),Math.ceil(s.drawRect[3]))}}])})(lv),Kj=(function(r){function e(){return le(this,e),We(this,e,arguments)}return qe(e,r),ce(e,[{key:"render",value:function(n,i,a,s,o,A){a.getBounds();var l=i.lineWidth,c=l===void 0?1:l,u=i.textAlign,h=u===void 0?"start":u,d=i.textBaseline,f=d===void 0?"alphabetic":d,g=i.lineJoin,p=g===void 0?"miter":g,v=i.miterLimit,y=v===void 0?10:v,m=i.letterSpacing,B=m===void 0?0:m,C=i.stroke,S=i.fill,F=i.fillRule,T=i.fillOpacity,O=T===void 0?1:T,I=i.strokeOpacity,k=I===void 0?1:I,N=i.opacity,U=N===void 0?1:N,D=i.metrics,G=i.x,Z=G===void 0?0:G,q=i.y,j=q===void 0?0:q,te=i.dx,ue=i.dy,ge=i.shadowColor,Y=i.shadowBlur,xe=i.textDecorationLine,$=D.font,K=D.lines,ee=D.height,oe=D.lineHeight,Ee=D.lineMetrics;n.font=$,n.lineWidth=c,n.textAlign=h==="middle"?"center":h;var Le=f;Le==="alphabetic"&&(Le="bottom"),n.lineJoin=p,ke(y)||(n.miterLimit=y);var Pe=j;f==="middle"?Pe+=-ee/2-oe/2:f==="bottom"||f==="alphabetic"||f==="ideographic"?Pe+=-ee:(f==="top"||f==="hanging")&&(Pe+=-oe);var st=Z+(te||0);Pe+=ue||0,K.length===1&&(Le==="bottom"?(Le="middle",Pe-=.5*ee):Le==="top"&&(Le="middle",Pe+=.5*ee)),n.textBaseline=Le;var ut=!ke(ge)&&Y>0;mh(a,n,ut);for(var ht=0;ht<K.length;ht++){var Et=c/2+st;Pe+=oe,!ke(C)&&!C.isNone&&c&&this.drawLetterSpacing(n,a,K[ht],Ee[ht],h,Et,Pe,B,S,F,O,C,k,U,!0,s,o,A),ke(S)||this.drawLetterSpacing(n,a,K[ht],Ee[ht],h,Et,Pe,B,S,F,O,C,k,U,!1,s,o,A)}xe&&xe!=="none"&&this.drawTextDecorations(n,i,a,K,oe,st,j+(ue||0),s,o,A)}},{key:"drawLetterSpacing",value:function(n,i,a,s,o,A,l,c,u,h,d,f,g,p,v,y,m,B){if(c===0){v?this.strokeText(n,i,a,A,l,f,g,y,m,B):this.fillText(n,i,a,A,l,u,h,d,p,y,m,B);return}var C=n.textAlign;n.textAlign="left";var S=A;o==="center"||o==="middle"?S=A-s.width/2:(o==="right"||o==="end")&&(S=A-s.width);for(var F=Array.from(a),T=n.measureText(a).width,O=0,I=0;I<F.length;++I){var k=F[I];v?this.strokeText(n,i,k,S,l,f,g,y,m,B):this.fillText(n,i,k,S,l,u,h,d,p,y,m,B),O=n.measureText(a.substring(I+1)).width,S+=T-O+c,T=O}n.textAlign=C}},{key:"fillText",value:function(n,i,a,s,o,A,l,c,u,h,d,f){nF(n,i,A,l,h,d,f,this.imagePool,!0);var g,p=!ke(c)&&c!==1;p&&(g=n.globalAlpha,n.globalAlpha=c*u),n.fillText(a,s,o),p&&(n.globalAlpha=g)}},{key:"strokeText",value:function(n,i,a,s,o,A,l,c,u,h){cv(n,i,A,c,u,h,this.imagePool,!0);var d,f=!ke(l)&&l!==1;f&&(d=n.globalAlpha,n.globalAlpha=l),n.strokeText(a,s,o),f&&(n.globalAlpha=d)}},{key:"drawTextDecorations",value:function(n,i,a,s,o,A,l,c,u,h){var d=i.textDecorationLine,f=i.textDecorationColor,g=i.textDecorationStyle,p=i.textDecorationThickness,v=p===void 0?1:p,y=i.textAlign,m=y===void 0?"start":y,B=i.lineWidth,C=B===void 0?1:B,S=i.metrics;if(!(!d||d==="none")){var F=S.lineMetrics,T=d.split(" ");switch(n.lineWidth=v,f&&(n.strokeStyle="rgba(".concat(f.r,", ").concat(f.g,", ").concat(f.b,", ").concat(f.alpha,")")),g){case"dashed":n.setLineDash([5,5]);break;case"dotted":n.setLineDash([2,2]);break;case"wavy":n.setLineDash([]);break;default:n.setLineDash([]);break}var O=l,I=i.textBaseline,k=I===void 0?"alphabetic":I;k==="middle"?O+=-S.height/2-o/2:k==="bottom"||k==="alphabetic"||k==="ideographic"?O+=-S.height:(k==="top"||k==="hanging")&&(O+=-o);for(var N=0;N<s.length;N++){O+=o;var U=F[N];if(U){var D=C/2,G=A,Z=A+U.width;m==="center"||m==="middle"?(G=A-U.width/2,Z=A+U.width/2):(m==="right"||m==="end")&&(G=A-U.width,Z=A),G+=D,Z+=D;var q=Qa(T),j;try{for(q.s();!(j=q.n()).done;){var te=j.value,ue=O;switch(te){case"underline":ue+=2;break;case"overline":ue-=o-2;break;case"line-through":ue-=o/2;break;default:continue}g==="wavy"?this.drawWavyLine(n,G,Z,ue):(n.beginPath(),n.moveTo(G,ue),n.lineTo(Z,ue),n.stroke())}}catch(ge){q.e(ge)}finally{q.f()}}}n.setLineDash([])}}},{key:"drawWavyLine",value:function(n,i,a,s){var o=2,A=10,l=Math.floor((a-i)/A);n.beginPath(),n.moveTo(i,s);for(var c=0;c<l;c++){var u=i+c*A+A/4,h=s+o,d=i+c*A+A/2,f=s;n.quadraticCurveTo(u,h,d,f);var g=i+c*A+A*3/4,p=s-o,v=i+(c+1)*A,y=s;n.quadraticCurveTo(g,p,v,y)}n.stroke()}},{key:"drawToContext",value:function(n,i,a,s,o){this.render(n,i.parsedStyle,i,i.ownerDocument.defaultView.context,s,o)}}])})(lv),zj=(function(r){function e(){var t,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return le(this,e),t=We(this,e),t.name="canvas-renderer",t.options=n,t}return qe(e,r),ce(e,[{key:"init",value:function(){var n,i=De({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),a=this.context.imagePool,s=new lv(a),o=(n={},be(be(be(be(be(be(be(be(be(be(n,re.CIRCLE,s),re.ELLIPSE,s),re.RECT,s),re.IMAGE,new Gj(a)),re.TEXT,new Kj(a)),re.LINE,s),re.POLYLINE,s),re.POLYGON,s),re.PATH,s),re.GROUP,void 0),be(be(be(n,re.HTML,void 0),re.MESH,void 0),re.FRAGMENT,void 0));this.context.defaultStyleRendererFactory=o,this.context.styleRendererFactory=o,this.addRenderingPlugin(new JS(i))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory}}])})(Ua),Vj=Je(),jj=Je(),Wj=Je(),qj=Ct(),rF=(function(){function r(){var e=this;le(this,r),this.isHit=function(t,n,i,a){var s=e.context.pointInPathPickerFactory[t.nodeName];if(s){var o=ki(qj,i),A=Jn(jj,Zn(Wj,n[0],n[1],0),o);if(s(t,new Hn(A[0],A[1]),a,e.isPointInPath,e.context,e.runtime))return!0}return!1},this.isPointInPath=function(t,n){var i=e.runtime.offscreenCanvasCreator.getOrCreateContext(e.context.config.offscreenCanvas),a=e.context.pathGeneratorFactory[t.nodeName];return a&&(i.beginPath(),a(i,t.parsedStyle),i.closePath()),i.isPointInPath(n.x,n.y)}}return ce(r,[{key:"apply",value:function(t,n){var i,a=this,s=t.renderingService,o=t.renderingContext;this.context=t,this.runtime=n;var A=(i=o.root)===null||i===void 0?void 0:i.ownerDocument;s.hooks.pick.tapPromise(r.tag,(function(){var l=La(kn().mark(function c(u){return kn().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.abrupt("return",a.pick(A,u));case 1:case"end":return h.stop()}},c)}));return function(c){return l.apply(this,arguments)}})()),s.hooks.pickSync.tap(r.tag,function(l){return a.pick(A,l)})}},{key:"pick",value:function(t,n){var i=n.topmost,a=n.position,s=a.x,o=a.y,A=Zn(Vj,s,o,0),l=t.elementsFromBBox(A[0],A[1],A[0],A[1]),c=[],u=Qa(l),h;try{for(u.s();!(h=u.n()).done;){var d=h.value,f=d.getWorldTransform(),g=this.isHit(d,A,f,!1);if(g){var p=Ix(d);if(p){var v=p.parsedStyle.clipPath,y=this.isHit(v,A,v.getWorldTransform(),!0);if(y){if(i)return n.picked=[d],n;c.push(d)}}else{if(i)return n.picked=[d],n;c.push(d)}}}}catch(m){u.e(m)}finally{u.f()}return n.picked=c,n}}])})();rF.tag="CanvasPicker";function $j(r,e,t){var n=r.parsedStyle,i=n.cx,a=i===void 0?0:i,s=n.cy,o=s===void 0?0:s,A=n.r,l=n.fill,c=n.stroke,u=n.lineWidth,h=u===void 0?1:u,d=n.increasedLineWidthForHitTesting,f=d===void 0?0:d,g=n.pointerEvents,p=g===void 0?"auto":g,v=(h+f)/2,y=oa(a,o,e.x,e.y),m=Cs(p,l,c),B=$e(m,2),C=B[0],S=B[1];return C&&S||t?y<=A+v:C?y<=A:S?y>=A-v&&y<=A+v:!1}function wh(r,e,t,n){return r/(t*t)+e/(n*n)}function Yj(r,e,t){var n=r.parsedStyle,i=n.cx,a=i===void 0?0:i,s=n.cy,o=s===void 0?0:s,A=n.rx,l=n.ry,c=n.fill,u=n.stroke,h=n.lineWidth,d=h===void 0?1:h,f=n.increasedLineWidthForHitTesting,g=f===void 0?0:f,p=n.pointerEvents,v=p===void 0?"auto":p,y=e.x,m=e.y,B=Cs(v,c,u),C=$e(B,2),S=C[0],F=C[1],T=(d+g)/2,O=(y-a)*(y-a),I=(m-o)*(m-o);return S&&F||t?wh(O,I,A+T,l+T)<=1:S?wh(O,I,A,l)<=1:F?wh(O,I,A-T,l-T)>=1&&wh(O,I,A+T,l+T)<=1:!1}function Vs(r,e,t,n,i,a){return i>=r&&i<=r+t&&a>=e&&a<=e+n}function Xj(r,e,t,n,i,a,s){var o=i/2;return Vs(r-o,e-o,t,i,a,s)||Vs(r+t-o,e-o,i,n,a,s)||Vs(r+o,e+n-o,t,i,a,s)||Vs(r-o,e+o,i,n,a,s)}function Bh(r,e,t,n,i,a,s,o){var A=(Math.atan2(o-e,s-r)+Math.PI*2)%(Math.PI*2),l={x:r+t*Math.cos(A),y:e+t*Math.sin(A)};return oa(l.x,l.y,s,o)<=a/2}function ts(r,e,t,n,i,a,s){var o=Math.min(r,t),A=Math.max(r,t),l=Math.min(e,n),c=Math.max(e,n),u=i/2;return a>=o-u&&a<=A+u&&s>=l-u&&s<=c+u?BD(r,e,t,n,a,s)<=i/2:!1}function iF(r,e,t,n,i){var a=r.length;if(a<2)return!1;for(var s=0;s<a-1;s++){var o=r[s][0],A=r[s][1],l=r[s+1][0],c=r[s+1][1];if(ts(o,A,l,c,e,t,n))return!0}if(i){var u=r[0],h=r[a-1];if(ts(u[0],u[1],h[0],h[1],e,t,n))return!0}return!1}var Zj=1e-6;function uv(r){return Math.abs(r)<Zj?0:r<0?-1:1}function Jj(r,e,t){return(t[0]-r[0])*(e[1]-r[1])===(e[0]-r[0])*(t[1]-r[1])&&Math.min(r[0],e[0])<=t[0]&&t[0]<=Math.max(r[0],e[0])&&Math.min(r[1],e[1])<=t[1]&&t[1]<=Math.max(r[1],e[1])}function aF(r,e,t){var n=!1,i=r.length;if(i<=2)return!1;for(var a=0;a<i;a++){var s=r[a],o=r[(a+1)%i];if(Jj(s,o,[e,t]))return!0;uv(s[1]-t)>0!=uv(o[1]-t)>0&&uv(e-(t-s[1])*(s[0]-o[0])/(s[1]-o[1])-s[0])<0&&(n=!n)}return n}function sF(r,e,t){for(var n=!1,i=0;i<r.length;i++){var a=r[i];if(n=aF(a,e,t),n)break}return n}function e9(r,e,t){var n=r.parsedStyle,i=n.x1,a=n.y1,s=n.x2,o=n.y2,A=n.lineWidth,l=A===void 0?1:A,c=n.increasedLineWidthForHitTesting,u=c===void 0?0:c,h=n.pointerEvents,d=h===void 0?"auto":h,f=n.fill,g=n.stroke,p=Cs(d,f,g),v=$e(p,2),y=v[1];return!y&&!t||!l?!1:ts(i,a,s,o,l+u,e.x,e.y)}function t9(r,e,t,n,i){for(var a=!1,s=e/2,o=0;o<r.length;o++){var A=r[o],l=A.currentPoint,c=A.params,u=A.prePoint,h=A.box;if(!(h&&!Vs(h.x-s,h.y-s,h.width+e,h.height+e,t,n)))switch(A.command){case"L":case"Z":if(a=ts(u[0],u[1],l[0],l[1],e,t,n),a)return!0;break;case"Q":var d=TD(u[0],u[1],c[1],c[2],c[3],c[4],t,n);if(a=d<=e/2,a)return!0;break;case"C":var f=NE(u[0],u[1],c[1],c[2],c[3],c[4],c[5],c[6],t,n,i);if(a=f<=e/2,a)return!0;break;case"A":A.cubicParams||(A.cubicParams=tg(u[0],u[1],c[1],c[2],c[3],c[4],c[5],c[6],c[7],void 0));for(var g=A.cubicParams,p=u,v=0;v<g.length;v+=6){var y=NE(p[0],p[1],g[v],g[v+1],g[v+2],g[v+3],g[v+4],g[v+5],t,n,i);if(p=[g[v+4],g[v+5]],a=y<=e/2,a)return!0}break}}return a}function n9(r,e,t,n,i,a){var s=r.parsedStyle,o=s.lineWidth,A=o===void 0?1:o,l=s.increasedLineWidthForHitTesting,c=l===void 0?0:l,u=s.stroke,h=s.fill,d=s.d,f=s.pointerEvents,g=f===void 0?"auto":f,p=d.segments,v=d.hasArc,y=d.polylines,m=d.polygons,B=Cs(g,m?.length&&h,u),C=$e(B,2),S=C[0],F=C[1],T=Cg(r),O=!1;return S||t?(v?O=n(r,e):O=sF(m,e.x,e.y)||sF(y,e.x,e.y),O):((F||t)&&(O=t9(p,A+c,e.x,e.y,T)),O)}function r9(r,e,t){var n=r.parsedStyle,i=n.stroke,a=n.fill,s=n.lineWidth,o=s===void 0?1:s,A=n.increasedLineWidthForHitTesting,l=A===void 0?0:A,c=n.points,u=n.pointerEvents,h=u===void 0?"auto":u,d=Cs(h,a,i),f=$e(d,2),g=f[0],p=f[1],v=!1;return(p||t)&&(v=iF(c.points,o+l,e.x,e.y,!0)),!v&&(g||t)&&(v=aF(c.points,e.x,e.y)),v}function i9(r,e,t){var n=r.parsedStyle,i=n.lineWidth,a=i===void 0?1:i,s=n.increasedLineWidthForHitTesting,o=s===void 0?0:s,A=n.points,l=n.pointerEvents,c=l===void 0?"auto":l,u=n.fill,h=n.stroke,d=Cs(c,u,h),f=$e(d,2),g=f[1];return!g&&!t||!a?!1:iF(A.points,a+o,e.x,e.y,!1)}function a9(r,e,t,n,i){var a=r.parsedStyle,s=a.radius,o=a.fill,A=a.stroke,l=a.lineWidth,c=l===void 0?1:l,u=a.increasedLineWidthForHitTesting,h=u===void 0?0:u,d=a.x,f=d===void 0?0:d,g=a.y,p=g===void 0?0:g,v=a.width,y=a.height,m=a.pointerEvents,B=m===void 0?"auto":m,C=Cs(B,o,A),S=$e(C,2),F=S[0],T=S[1],O=s&&s.some(function(U){return U!==0}),I=c+h;if(O){var N=!1;return(T||t)&&(N=s9(f,p,v,y,s.map(function(U){return Yt(U,0,Math.min(Math.abs(v)/2,Math.abs(y)/2))}),I,e.x,e.y)),!N&&(F||t)&&(N=n(r,e)),N}else{var k=I/2;if(F&&T||t)return Vs(f-k,p-k,v+k,y+k,e.x,e.y);if(F)return Vs(f,p,v,y,e.x,e.y);if(T)return Xj(f,p,v,y,I,e.x,e.y)}return!1}function s9(r,e,t,n,i,a,s,o){var A=$e(i,4),l=A[0],c=A[1],u=A[2],h=A[3];return ts(r+l,e,r+t-c,e,a,s,o)||ts(r+t,e+c,r+t,e+n-u,a,s,o)||ts(r+t-u,e+n,r+h,e+n,a,s,o)||ts(r,e+n-h,r,e+l,a,s,o)||Bh(r+t-c,e+c,c,1.5*Math.PI,2*Math.PI,a,s,o)||Bh(r+t-u,e+n-u,u,0,.5*Math.PI,a,s,o)||Bh(r+h,e+n-h,h,.5*Math.PI,Math.PI,a,s,o)||Bh(r+l,e+l,l,Math.PI,1.5*Math.PI,a,s,o)}function o9(r,e,t,n,i,a){var s=r.parsedStyle,o=s.pointerEvents,A=o===void 0?"auto":o,l=s.x,c=l===void 0?0:l,u=s.y,h=u===void 0?0:u,d=s.width,f=s.height;if(A==="non-transparent-pixel"){var g=i.config.offscreenCanvas,p=a.offscreenCanvasCreator.getOrCreateCanvas(g),v=a.offscreenCanvasCreator.getOrCreateContext(g,{willReadFrequently:!0});p.width=d,p.height=f,i.defaultStyleRendererFactory[re.IMAGE].render(v,De(De({},r.parsedStyle),{},{x:0,y:0}),r,void 0,void 0,void 0);var y=v.getImageData(e.x-c,e.y-h,1,1).data;return y.every(function(m){return m!==0})}return!0}function A9(r,e,t,n){var i=r.getGeometryBounds();return e.x>=i.min[0]&&e.y>=i.min[1]&&e.x<=i.max[0]&&e.y<=i.max[1]}var l9=(function(r){function e(){var t;le(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t=We(this,e,[].concat(i)),t.name="canvas-picker",t}return qe(e,r),ce(e,[{key:"init",value:function(){var n,i=(n={},be(be(be(be(be(be(be(be(be(be(n,re.CIRCLE,$j),re.ELLIPSE,Yj),re.RECT,a9),re.LINE,e9),re.POLYLINE,i9),re.POLYGON,r9),re.PATH,n9),re.TEXT,A9),re.GROUP,null),re.IMAGE,o9),be(be(n,re.HTML,null),re.MESH,null));this.context.pointInPathPickerFactory=i,this.addRenderingPlugin(new rF)}},{key:"destroy",value:function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()}}])})(Ua);function c9(r,e){var t=e.cx,n=t===void 0?0:t,i=e.cy,a=i===void 0?0:i,s=e.r;r.arc(n,a,s,0,Math.PI*2,!1)}function u9(r,e){var t=e.cx,n=t===void 0?0:t,i=e.cy,a=i===void 0?0:i,s=e.rx,o=e.ry;if(r.ellipse)r.ellipse(n,a,s,o,0,0,Math.PI*2,!1);else{var A=s>o?s:o,l=s>o?1:s/o,c=s>o?o/s:1;r.save(),r.scale(l,c),r.arc(n,a,A,0,Math.PI*2)}}function h9(r,e){var t=e.x1,n=e.y1,i=e.x2,a=e.y2,s=e.markerStart,o=e.markerEnd,A=e.markerStartOffset,l=e.markerEndOffset,c=0,u=0,h=0,d=0,f=0,g,p;s&&ct(s)&&A&&(g=i-t,p=a-n,f=Math.atan2(p,g),c=Math.cos(f)*(A||0),u=Math.sin(f)*(A||0)),o&&ct(o)&&l&&(g=t-i,p=n-a,f=Math.atan2(p,g),h=Math.cos(f)*(l||0),d=Math.sin(f)*(l||0)),r.moveTo(t+c,n+u),r.lineTo(i+h,a+d)}function d9(r,e){var t=e.markerStart,n=e.markerEnd,i=e.markerStartOffset,a=e.markerEndOffset,s=e.d,o=s.absolutePath,A=s.segments,l=0,c=0,u=0,h=0,d=0,f,g;if(t&&ct(t)&&i){var p=t.parentNode.getStartTangent(),v=$e(p,2),y=v[0],m=v[1];f=y[0]-m[0],g=y[1]-m[1],d=Math.atan2(g,f),l=Math.cos(d)*(i||0),c=Math.sin(d)*(i||0)}if(n&&ct(n)&&a){var B=n.parentNode.getEndTangent(),C=$e(B,2),S=C[0],F=C[1];f=S[0]-F[0],g=S[1]-F[1],d=Math.atan2(g,f),u=Math.cos(d)*(a||0),h=Math.sin(d)*(a||0)}for(var T=0;T<o.length;T++){var O=o[T],I=O[0],k=o[T+1],N=T===0&&(l!==0||c!==0),U=(T===o.length-1||k&&(k[0]==="M"||k[0]==="Z"))&&u!==0&&h!==0,D=N?[l,c]:[0,0],G=$e(D,2),Z=G[0],q=G[1],j=U?[u,h]:[0,0],te=$e(j,2),ue=te[0],ge=te[1];switch(I){case"M":r.moveTo(O[1]+Z,O[2]+q);break;case"L":r.lineTo(O[1]+ue,O[2]+ge);break;case"Q":r.quadraticCurveTo(O[1],O[2],O[3]+ue,O[4]+ge);break;case"C":r.bezierCurveTo(O[1],O[2],O[3],O[4],O[5]+ue,O[6]+ge);break;case"A":{var Y=A[T].arcParams,xe=Y.cx,$=Y.cy,K=Y.rx,ee=Y.ry,oe=Y.startAngle,Ee=Y.endAngle,Le=Y.xRotation,Pe=Y.sweepFlag;if(r.ellipse)r.ellipse(xe,$,K,ee,Le,oe,Ee,!!(1-Pe));else{var st=K>ee?K:ee,ut=K>ee?1:K/ee,ht=K>ee?ee/K:1;r.translate(xe,$),r.rotate(Le),r.scale(ut,ht),r.arc(0,0,st,oe,Ee,!!(1-Pe)),r.scale(1/ut,1/ht),r.rotate(-Le),r.translate(-xe,-$)}U&&r.lineTo(O[6]+u,O[7]+h);break}case"Z":r.closePath();break}}}function f9(r,e){var t=e.markerStart,n=e.markerEnd,i=e.markerStartOffset,a=e.markerEndOffset,s=e.points.points,o=s.length,A=s[0][0],l=s[0][1],c=s[o-1][0],u=s[o-1][1],h=0,d=0,f=0,g=0,p=0,v,y;t&&ct(t)&&i&&(v=s[1][0]-s[0][0],y=s[1][1]-s[0][1],p=Math.atan2(y,v),h=Math.cos(p)*(i||0),d=Math.sin(p)*(i||0)),n&&ct(n)&&a&&(v=s[o-1][0]-s[0][0],y=s[o-1][1]-s[0][1],p=Math.atan2(y,v),f=Math.cos(p)*(a||0),g=Math.sin(p)*(a||0)),r.moveTo(A+(h||f),l+(d||g));for(var m=1;m<o-1;m++){var B=s[m];r.lineTo(B[0],B[1])}r.lineTo(c,u)}function g9(r,e){var t=e.markerStart,n=e.markerEnd,i=e.markerStartOffset,a=e.markerEndOffset,s=e.points.points,o=s.length,A=s[0][0],l=s[0][1],c=s[o-1][0],u=s[o-1][1],h=0,d=0,f=0,g=0,p=0,v,y;t&&ct(t)&&i&&(v=s[1][0]-s[0][0],y=s[1][1]-s[0][1],p=Math.atan2(y,v),h=Math.cos(p)*(i||0),d=Math.sin(p)*(i||0)),n&&ct(n)&&a&&(v=s[o-2][0]-s[o-1][0],y=s[o-2][1]-s[o-1][1],p=Math.atan2(y,v),f=Math.cos(p)*(a||0),g=Math.sin(p)*(a||0)),r.moveTo(A+h,l+d);for(var m=1;m<o-1;m++){var B=s[m];r.lineTo(B[0],B[1])}r.lineTo(c+f,u+g)}function p9(r,e){var t=e.x,n=t===void 0?0:t,i=e.y,a=i===void 0?0:i,s=e.radius,o=e.width,A=e.height,l=o,c=A,u=s&&s.some(function(C){return C!==0});if(!u)r.rect(n,a,l,c);else{var h=o>0?1:-1,d=A>0?1:-1,f=h+d===0,g=s.map(function(C){return Yt(C,0,Math.min(Math.abs(l)/2,Math.abs(c)/2))}),p=$e(g,4),v=p[0],y=p[1],m=p[2],B=p[3];r.moveTo(h*v+n,a),r.lineTo(l-h*y+n,a),y!==0&&r.arc(l-h*y+n,d*y+a,y,-d*Math.PI/2,h>0?0:Math.PI,f),r.lineTo(l+n,c-d*m+a),m!==0&&r.arc(l-h*m+n,c-d*m+a,m,h>0?0:Math.PI,d>0?Math.PI/2:1.5*Math.PI,f),r.lineTo(h*B+n,c+a),B!==0&&r.arc(h*B+n,c-d*B+a,B,d>0?Math.PI/2:-Math.PI/2,h>0?Math.PI:0,f),r.lineTo(n,d*v+a),v!==0&&r.arc(h*v+n,d*v+a,v,h>0?Math.PI:0,d>0?Math.PI*1.5:Math.PI/2,f)}}var v9=(function(r){function e(){var t;le(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t=We(this,e,[].concat(i)),t.name="canvas-path-generator",t}return qe(e,r),ce(e,[{key:"init",value:function(){var n,i=(n={},be(be(be(be(be(be(be(be(be(be(n,re.CIRCLE,c9),re.ELLIPSE,u9),re.RECT,p9),re.LINE,h9),re.POLYLINE,g9),re.POLYGON,f9),re.PATH,d9),re.TEXT,void 0),re.GROUP,void 0),re.IMAGE,void 0),be(be(be(n,re.HTML,void 0),re.MESH,void 0),re.FRAGMENT,void 0));this.context.pathGeneratorFactory=i}},{key:"destroy",value:function(){delete this.context.pathGeneratorFactory}}])})(Ua),y9=(function(){function r(e){le(this,r),this.renderingContext=e.renderingContext,this.canvasConfig=e.config}return ce(r,[{key:"init",value:function(){var t=this.canvasConfig,n=t.container,i=t.canvas;if(i)this.$canvas=i,n&&i.parentElement!==n&&n.appendChild(i),this.$container=i.parentElement,this.canvasConfig.container=this.$container;else if(n&&(this.$container=ot(n)?document.getElementById(n):n,this.$container)){var a=document.createElement("canvas");this.$container.appendChild(a),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=a}this.context=this.$canvas.getContext("2d"),this.resize(this.canvasConfig.width,this.canvasConfig.height)}},{key:"getContext",value:function(){return this.context}},{key:"getDomElement",value:function(){return this.$canvas}},{key:"getDPR",value:function(){return this.dpr}},{key:"getBoundingClientRect",value:function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()}},{key:"destroy",value:function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)}},{key:"resize",value:function(t,n){var i=this.canvasConfig.devicePixelRatio;this.dpr=i,this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*n,L4(this.$canvas,t,n)),this.renderingContext.renderReasons.add(Fo.CAMERA_CHANGED)}},{key:"applyCursorStyle",value:function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)}},{key:"toDataURL",value:(function(){var e=La(kn().mark(function n(){var i,a,s,o=arguments;return kn().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return i=o.length>0&&o[0]!==void 0?o[0]:{},a=i.type,s=i.encoderOptions,A.abrupt("return",this.context.canvas.toDataURL(a,s));case 1:case"end":return A.stop()}},n,this)}));function t(){return e.apply(this,arguments)}return t})()}])})(),m9=(function(r){function e(){var t;le(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t=We(this,e,[].concat(i)),t.name="canvas-context-register",t}return qe(e,r),ce(e,[{key:"init",value:function(){this.context.ContextService=y9}},{key:"destroy",value:function(){delete this.context.ContextService}}])})(Ua),yl=(function(r){function e(t){var n;return le(this,e),n=We(this,e,[t]),n.registerPlugin(new m9),n.registerPlugin(new u6.Plugin),n.registerPlugin(new v9),n.registerPlugin(new zj),n.registerPlugin(new p6.Plugin),n.registerPlugin(new l9),n.registerPlugin(new f6.Plugin),n}return qe(e,r),ce(e)})(_D),w9=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};class bh extends xi{constructor(e){super(Object.assign(Object.assign({},e),{style:Object.assign({},bh.defaultStyleProps,e.style)})),this.rootPointerEvent=new Pc(null),this.forwardEvents=t=>{const n=this.context.canvas,i=n.context.renderingContext.root.ownerDocument.defaultView;this.normalizeToPointerEvent(t,i).forEach(s=>{const o=this.bootstrapEvent(this.rootPointerEvent,s,i,t);BA(n.context.eventService,"mappingTable.pointerupoutside",[]),n.context.eventService.mapEvent(o)})}}get eventService(){return this.context.canvas.context.eventService}get events(){return[ie.CLICK,ie.POINTER_DOWN,ie.POINTER_MOVE,ie.POINTER_UP,ie.POINTER_OVER,ie.POINTER_LEAVE]}getDomElement(){return this.getShape("key").getDomElement()}render(e=this.parsedAttributes,t=this){this.drawKeyShape(e,t),this.drawPortShapes(e,t)}getKeyStyle(e){const t=ms(e,["dx","dy","innerHTML","pointerEvents","cursor"]),{dx:n=0,dy:i=0}=t,a=w9(t,["dx","dy"]),[s,o]=this.getSize(e);return Object.assign(Object.assign({x:n,y:i},a),{width:s,height:o})}drawKeyShape(e,t){const n=this.getKeyStyle(e),{x:i,y:a,width:s=0,height:o=0}=n,A=this.upsert("key-container",Gn,{x:i,y:a,width:s,height:o,opacity:0},t);return this.upsert("key",Os,n,A)}connectedCallback(){if(!(this.context.canvas.getRenderer("main")instanceof yl))return;const n=this.getDomElement();this.events.forEach(i=>{n.addEventListener(i,this.forwardEvents)})}attributeChangedCallback(e,t,n){e==="zIndex"&&t!==n&&(this.getDomElement().style.zIndex=n)}destroy(){const e=this.getDomElement();this.events.forEach(t=>{e.removeEventListener(t,this.forwardEvents)}),super.destroy()}normalizeToPointerEvent(e,t){const n=[];if(t.isTouchEvent(e))for(let i=0;i<e.changedTouches.length;i++){const a=e.changedTouches[i];Ge(a.button)&&(a.button=0),Ge(a.buttons)&&(a.buttons=1),Ge(a.isPrimary)&&(a.isPrimary=e.touches.length===1&&e.type==="touchstart"),Ge(a.width)&&(a.width=a.radiusX||1),Ge(a.height)&&(a.height=a.radiusY||1),Ge(a.tiltX)&&(a.tiltX=0),Ge(a.tiltY)&&(a.tiltY=0),Ge(a.pointerType)&&(a.pointerType="touch"),Ge(a.pointerId)&&(a.pointerId=a.identifier||0),Ge(a.pressure)&&(a.pressure=a.force||.5),Ge(a.twist)&&(a.twist=0),Ge(a.tangentialPressure)&&(a.tangentialPressure=0),a.isNormalized=!0,a.type=e.type,n.push(a)}else if(t.isMouseEvent(e)){const i=e;Ge(i.isPrimary)&&(i.isPrimary=!0),Ge(i.width)&&(i.width=1),Ge(i.height)&&(i.height=1),Ge(i.tiltX)&&(i.tiltX=0),Ge(i.tiltY)&&(i.tiltY=0),Ge(i.pointerType)&&(i.pointerType="mouse"),Ge(i.pointerId)&&(i.pointerId=1),Ge(i.pressure)&&(i.pressure=.5),Ge(i.twist)&&(i.twist=0),Ge(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,n.push(i)}else n.push(e);return n}transferMouseData(e,t){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.altKey=t.altKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.ctrlKey=t.ctrlKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.screen.x=t.screenX,e.screen.y=t.screenY,e.relatedTarget=null}bootstrapEvent(e,t,n,i){e.view=n,e.originalEvent=null,e.nativeEvent=i,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,this.transferMouseData(e,t);const{x:a,y:s}=this.getViewportXY(t);e.viewport.x=a,e.viewport.y=s;const[o,A]=this.context.canvas.getCanvasByViewport([a,s]);return e.canvas.x=o,e.canvas.y=A,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.isTrusted=i.isTrusted,e.type==="pointerleave"&&(e.type="pointerout"),e}getViewportXY(e){let t,n;const{offsetX:i,offsetY:a,clientX:s,clientY:o}=e;if(!ke(i)&&!ke(a))t=i,n=a;else{const A=this.eventService.client2Viewport({x:s,y:o});t=A.x,n=A.y}return{x:t,y:n}}onframe(){super.onframe();const{opacity:e}=this.attributes;this.getDomElement().style.opacity=`${e}`}}bh.defaultStyleProps={size:[160,80],halo:!1,icon:!1,label:!1,pointerEvents:"auto"};var oF=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};let AF=class hP extends xi{constructor(e){super(Ln({style:hP.defaultStyleProps},e))}getKeyStyle(e){const[t,n]=this.getSize(e),i=super.getKeyStyle(e),{fillOpacity:a,opacity:s=a}=i,o=oF(i,["fillOpacity","opacity"]);return Object.assign(Object.assign({opacity:s},o),{width:t,height:n,x:-t/2,y:-n/2})}getBounds(){return this.getShape("key").getBounds()}getHaloStyle(e){if(e.halo===!1)return!1;const t=this.getShape("key").attributes,{fill:n,stroke:i}=t;oF(t,["fill","stroke"]);const a=rn(this.getGraphicStyle(e),"halo"),s=Number(a.lineWidth),[o,A]=Ve(this.getSize(e),[s,s]),{lineWidth:l}=a,c={fill:"transparent",lineWidth:l/2,width:o-l/2,height:A-l/2,x:-(o-l/2)/2,y:-(A-l/2)/2};return Object.assign(Object.assign({},a),c)}getIconStyle(e){const t=super.getIconStyle(e),[n,i]=this.getSize(e);return t?Object.assign({width:n*pa,height:i*pa},t):!1}drawKeyShape(e,t){const n=this.upsert("key",av,this.getKeyStyle(e),t);return ov(this),n}drawHaloShape(e,t){this.upsert("halo",Gn,this.getHaloStyle(e),t)}update(e){super.update(e),e&&("x"in e||"y"in e||"z"in e)&&Av(this)}};AF.defaultStyleProps={size:32};class B9 extends xi{constructor(e){super(e)}getKeyStyle(e){const[t,n]=this.getSize(e);return Object.assign(Object.assign({},super.getKeyStyle(e)),{width:t,height:n,x:-t/2,y:-n/2})}getIconStyle(e){const t=super.getIconStyle(e),{width:n,height:i}=this.getShape("key").attributes;return t?Object.assign({width:n*pa,height:i*pa},t):!1}drawKeyShape(e,t){return this.upsert("key",Gn,this.getKeyStyle(e),t)}}class b9 extends hh{constructor(e){super(e)}getInnerR(e){return e.innerR||this.getOuterR(e)*3/8}getOuterR(e){return Math.min(...this.getSize(e))/2}getPoints(e){return eW(this.getOuterR(e),this.getInnerR(e))}getIconStyle(e){const t=super.getIconStyle(e),n=this.getInnerR(e)*2*pa;return t?Object.assign({width:n,height:n},t):!1}getPortXY(e,t){const{placement:n="top"}=t,i=this.getShape("key").getLocalBounds(),a=tW(this.getOuterR(e),this.getInnerR(e));return yv(i,n,a,!1)}}class Eh extends hh{constructor(e){super(Ln({style:Eh.defaultStyleProps},e))}getPoints(e){const{direction:t}=e,[n,i]=this.getSize(e);return nW(n,i,t)}getPortXY(e,t){const{direction:n}=e,{placement:i="top"}=t,a=this.getShape("key").getLocalBounds(),[s,o]=this.getSize(e),A=rW(s,o,n);return yv(a,i,A,!1)}getIconStyle(e){const{icon:t,iconText:n,iconSrc:i,direction:a}=e;if(t===!1||Ui(n||i))return!1;const s=rn(this.getGraphicStyle(e),"icon"),o=this.getShape("key").getLocalBounds(),[A,l]=IV(o,a),c=_V(o,a)*2*pa;return Object.assign({x:A,y:l,width:c,height:c},s)}}Eh.defaultStyleProps={size:40,direction:"up"};var lF=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};class zo extends xi{constructor(e){super(Ln({style:zo.defaultStyleProps},e)),this.type="combo",this.updateComboPosition(this.parsedAttributes)}getKeySize(e){const{collapsed:t,childrenNode:n=[]}=e;return n.length===0?this.getEmptyKeySize(e):t?this.getCollapsedKeySize(e):this.getExpandedKeySize(e)}getEmptyKeySize(e){const{padding:t,collapsedSize:n}=e,[i,a,s,o]=si(t);return Ve(Gr(n),[o+a,i+s,0])}getCollapsedKeySize(e){return Gr(e.collapsedSize)}getExpandedKeySize(e){const t=this.getContentBBox(e);return[Xi(t),Zi(t),0]}getContentBBox(e){const{childrenNode:t=[],padding:n}=e,i=t.map(s=>this.context.element.getElement(s)).filter(Boolean);if(i.length===0){const s=new kt,{x:o=0,y:A=0,size:l}=e,[c,u]=Gr(l);return s.setMinMax([o-c/2,A-u/2,0],[o+c/2,A+u/2,0]),s}const a=cl(i.map(s=>s.getBounds()));return n?Ya(a,n):a}drawCollapsedMarkerShape(e,t){const n=this.getCollapsedMarkerStyle(e);this.upsert("collapsed-marker",XS,n,t),ov(this)}getCollapsedMarkerStyle(e){if(!e.collapsed||!e.collapsedMarker)return!1;const t=rn(this.getGraphicStyle(e),"collapsedMarker"),{type:n}=t,i=lF(t,["type"]),a=this.getShape("key"),[s,o]=ga(a.getLocalBounds(),"center"),A=Object.assign(Object.assign({},i),{x:s,y:o});if(n){const l=this.getCollapsedMarkerText(n,e);Object.assign(A,{text:l})}return A}getCollapsedMarkerText(e,t){const{childrenData:n=[]}=t,{model:i}=this.context;return e==="descendant-count"?i.getDescendantsData(this.id).length.toString():e==="child-count"?n.length.toString():e==="node-count"?i.getDescendantsData(this.id).filter(a=>i.getElementType(X(a))==="node").length.toString():Te(e)?e(n):""}getComboPosition(e){const{x:t=0,y:n=0,collapsed:i,childrenData:a=[]}=e;if(a.length===0)return[+t,+n,0];if(i){const{model:s}=this.context,o=s.getDescendantsData(this.id).filter(A=>!s.isCombo(X(A)));if(o.length>0&&o.some(ij)){const A=o.reduce((l,c)=>Ve(l,Fn(c)),[0,0,0]);return bi(A,o.length)}return[+t,+n,0]}return this.getContentBBox(e).center}getComboStyle(e){const[t,n]=this.getComboPosition(e);return{x:t,y:n,transform:[["translate",t,n]]}}updateComboPosition(e){const t=this.getComboStyle(e);Object.assign(this.style,t);const{x:n,y:i}=t;this.context.model.syncNodeLikeDatum({id:this.id,style:{x:n,y:i}}),Av(this)}render(e,t=this){super.render(e,t),this.drawCollapsedMarkerShape(e,t)}update(e={}){super.update(e),this.updateComboPosition(this.parsedAttributes)}onframe(){super.onframe(),this.attributes.collapsed||this.updateComboPosition(this.parsedAttributes),this.drawKeyShape(this.parsedAttributes,this)}animate(e,t){const n=super.animate(this.attributes.collapsed?e:e.map(i=>{var{x:a,y:s,z:o,transform:A}=i,l=lF(i,["x","y","z","transform"]);return l}),t);return n&&new Proxy(n,{set:(i,a,s)=>(a==="currentTime"&&Promise.resolve().then(()=>this.onframe()),Reflect.set(i,a,s))})}}zo.defaultStyleProps={childrenNode:[],droppable:!0,draggable:!0,collapsed:!1,collapsedSize:32,collapsedMarker:!0,collapsedMarkerZIndex:1,collapsedMarkerFontSize:12,collapsedMarkerTextAlign:"center",collapsedMarkerTextBaseline:"middle",collapsedMarkerType:"child-count"};class E9 extends zo{constructor(e){super(e)}drawKeyShape(e,t){return this.upsert("key",zi,this.getKeyStyle(e),t)}getKeyStyle(e){const{collapsed:t}=e,n=super.getKeyStyle(e),[i]=this.getKeySize(e);return Object.assign(Object.assign(Object.assign({},n),t&&rn(n,"collapsed")),{r:i/2})}getCollapsedKeySize(e){const[t,n]=Gr(e.collapsedSize),i=Math.max(t,n)/2;return[i*2,i*2,0]}getExpandedKeySize(e){const t=this.getContentBBox(e),[n,i]=qa(t),a=Math.sqrt(Math.pow(n,2)+Math.pow(i,2))/2;return[a*2,a*2,0]}getIntersectPoint(e,t=!1){const n=this.getShape("key").getBounds();return sh(e,n,t)}}class x9 extends zo{constructor(e){super(e)}drawKeyShape(e,t){return this.upsert("key",Gn,this.getKeyStyle(e),t)}getKeyStyle(e){const t=super.getKeyStyle(e),[n,i]=this.getKeySize(e);return Object.assign(Object.assign(Object.assign({},t),e.collapsed&&rn(t,"collapsed")),{width:n,height:i,x:-n/2,y:-i/2})}}const C9={padding:10};function cF(r,e,t,n,i,a){const{padding:s}=Object.assign(C9,a),o=$a(t,s),A=$a(n,s),l=[r,...i,e];let c=null;const u=[];for(let h=0,d=l.length;h<d-1;h++){const f=h+1,g=l[h],p=l[f],v=oj(g,p);let y=null;if(h===0)if(f===d-1)if(o.intersects(A))y=dv(g,p,o,A);else if(!eh(g,o)&&!eh(p,A)){const m=Hs(g,o),B=Hs(p,A);y=hF(m,B,cr(m,B)),y.points.unshift(m),y.points.push(B)}else v||(y=F9(g,p,o,A));else wi(p,o)?y=dv(g,p,o,$a(p,s),c):v||(y=xh(g,p,o));else f===d-1?wi(g,A)?y=dv(g,p,$a(g,s),A,c):v||(y=dF(g,p,A,c)):v||(y=hF(g,p,c));y?(u.push(...y.points),c=y.direction):c=cr(g,p),f<d-1&&u.push(p)}return u.map(Ks)}const S9={N:"S",S:"N",W:"E",E:"W"},uF={N:-Math.PI/2,S:Math.PI/2,E:0,W:Math.PI};function cr(r,e){const[t,n]=r,[i,a]=e;return t===i?n>a?"N":"S":n===a?t>i?"W":"E":null}function hv(r,e){return e==="N"||e==="S"?Zi(r):Xi(r)}function hF(r,e,t){const n=[r[0],e[1]],i=[e[0],r[1]],a=cr(r,n),s=cr(r,i),o=t?S9[t]:null,A=a===t||a!==o&&s!==t?n:i;return{points:[A],direction:cr(A,e)}}function xh(r,e,t){if(eh(r,t)){const n=ml(r,e,t);return{points:[n],direction:cr(n,e)}}else{const n=Hs(r,t),a=["left","right"].includes(ul(r,t))?[e[0],n[1]]:[n[0],e[1]];return{points:[a],direction:cr(a,e)}}}function dF(r,e,t,n){const i=eh(e,t)?e:Hs(e,t),a=[[i[0],r[1]],[r[0],i[1]]],s=a.filter(A=>OV(A,t)&&!mS(A,t,!0)),o=s.filter(A=>cr(A,r)!==n);if(o.length>0){const A=o.find(l=>cr(r,l)===n)||o[0];return{points:[A],direction:cr(A,e)}}else{const A=hR(a,s)[0],l=Ja(e,A,hv(t,n)/2);return{points:[ml(l,r,t),l],direction:cr(l,e)}}}function F9(r,e,t,n){let i=xh(r,e,t);const a=hl(i.points[0]);if(wi(a,n)){i=xh(e,r,n);const s=hl(i.points[0]);if(wi(s,t)){const o=Ja(r,a,hv(t,cr(r,a))/2),A=Ja(e,s,hv(n,cr(e,s))/2),l=[(o[0]+A[0])/2,(o[1]+A[1])/2],c=xh(r,l,t),u=dF(l,e,n,c.direction);i.points=[c.points[0],u.points[0]],i.direction=u.direction}}return i}function dv(r,e,t,n,i){const s=cl([t,n]),o=Lt(e,s.center)>Lt(r,s.center),[A,l]=o?[e,r]:[r,e],c=Zi(s)+Xi(s);let u;if(i){const f=[A[0]+c*Math.cos(uF[i]),A[1]+c*Math.sin(uF[i])];u=Ja(Hs(f,s),f,.01)}else u=Ja(Hs(A,s),A,-.01);let h=ml(u,l,s),d=[dl(u,2),dl(h,2)];if(Xt(dl(u),dl(h))){const f=Xp(bt(u,A),[1,0,0])+Math.PI/2;h=[l[0]+c*Math.cos(f),l[1]+c*Math.sin(f),0],h=dl(Ja(Hs(h,s),l,-.01),2);const g=ml(u,h,s);d=[u,g,h]}return{points:o?d.reverse():d,direction:cr(o?u:h,e)}}function ml(r,e,t){let n=[r[0],e[1]];return wi(n,t)&&(n=[e[0],r[1]]),n}function fF(r,e,t,n,i){let A=typeof e=="number"?e:.5;e==="start"&&(A=0),e==="end"&&(A=.99);const l=zn(r.getPoint(A)),c=zn(r.getPoint(A+.01));let u=e==="start"?"left":e==="end"?"right":"center";if(NS(l,c)||!t){const[v,y]=gF(r,A,n,i);return{transform:[["translate",v,y]],textAlign:u}}let h=Math.atan2(c[1]-l[1],c[0]-l[0]);c[0]<l[0]&&(u=u==="center"?u:u==="left"?"right":"left",n*=-1,h+=Math.PI);const[f,g]=gF(r,A,n,i,h),p=[["translate",f,g],["rotate",h/Math.PI*180]];return{textAlign:u,transform:p}}function T9(r,e,t,n,i){var a,s;const o=((a=r.badge)===null||a===void 0?void 0:a.getGeometryBounds().halfExtents[0])*2||0,A=((s=r.label)===null||s===void 0?void 0:s.getGeometryBounds().halfExtents[0])*2||0;return fF(r.key,t,!0,(A?(A/2+o/2)*(e==="suffix"?1:-1):0)+n,i)}function gF(r,e,t,n,i){const[a,s]=zn(r.getPoint(e));let o=t,A=n;return i&&(o=t*Math.cos(i)-n*Math.sin(i),A=t*Math.sin(i)+n*Math.cos(i)),[a+o,s+A]}function fv(r,e,t,n){if(Xt(r,e))return r;const i=bt(e,r),a=[r[0]+t*i[0],r[1]+t*i[1]],s=fa(ah(i,!1));return a[0]+=n*s[0],a[1]+=n*s[1],a}function M9(r){return Be(r)?[r,-r]:r}function O9(r){return Be(r)?[r,1-r]:r}function I9(r,e,t){return[["M",r[0],r[1]],["Q",t[0],t[1],e[0],e[1]]]}function pF(r,e,t){return[["M",r[0],r[1]],["C",t[0][0],t[0][1],t[1][0],t[1][1],e[0],e[1]]]}function gv(r,e=0,t=!1){const n=r.length-1,i=r[0],a=r[n],s=r.slice(1,n),o=[["M",i[0],i[1]]];return s.forEach((A,l)=>{const c=s[l-1]||i,u=s[l+1]||a;if(!LS(c,A,u)&&e){const[h,d]=_9(c,A,u,e);o.push(["L",h[0],h[1]],["Q",A[0],A[1],d[0],d[1]],["L",d[0],d[1]])}else o.push(["L",A[0],A[1]])}),o.push(["L",a[0],a[1]]),t&&o.push(["Z"]),o}function _9(r,e,t,n){const i=ih(r,e),a=ih(t,e),s=Math.min(n,Math.min(i,a)/2),o=[e[0]-s/i*(e[0]-r[0]),e[1]-s/i*(e[1]-r[1])],A=[e[0]-s/a*(e[0]-t[0]),e[1]-s/a*(e[1]-t[1])];return[o,A]}const k9=r=>{const e=Math.PI/2,t=Zi(r)/2,n=Xi(r)/2,i=Math.atan2(t,n)/2,a=Math.atan2(n,t)/2;return{top:[-e-a,-e+a],"top-right":[-e+a,-i],"right-top":[-e+a,-i],right:[-i,i],"bottom-right":[i,e-a],"right-bottom":[i,e-a],bottom:[e-a,e+a],"bottom-left":[e+a,Math.PI-i],"left-bottom":[e+a,Math.PI-i],left:[Math.PI-i,Math.PI+i],"top-left":[Math.PI+i,-e-a],"left-top":[Math.PI+i,-e-a]}};function vF(r,e,t,n,i){const a=$a(r),s=r.getCenter();let o=n&&rs(n),A=i&&rs(i);if(!o||!A){const l=k9(a),c=l[e][0],u=l[e][1],[h,d]=qa(a),f=Math.max(h,d),g=Ve(s,[f*Math.cos(c),f*Math.sin(c),0]),p=Ve(s,[f*Math.cos(u),f*Math.sin(u),0]);o=wv(r,g),A=wv(r,p),t||([o,A]=[A,o])}return[o,A]}function N9(r,e,t,n,i,a){const s=r.getPorts()[i||a],o=r.getPorts()[a||i];let[A,l]=vF(r,e,t,s,o);const c=L9(r,A,l,n);return s&&(A=Bl(s,c[0])),o&&(l=Bl(o,c.at(-1))),pF(A,l,c)}function L9(r,e,t,n){const i=r.getCenter();if(Xt(e,t)){const a=bt(e,i),s=[n*Math.sign(a[0])||n/2,n*Math.sign(a[1])||-n/2,0];return[Ve(e,s),Ve(t,Bi(s,[1,-1,1]))]}return[Ja(i,e,Lt(i,e)+n),Ja(i,t,Lt(i,t)+n)]}function Q9(r,e,t,n,i,a,s){const o=mv(r),A=o[a||s],l=o[s||a];let[c,u]=vF(r,t,n,A,l);const h=U9(r,c,u,i);return A&&(c=Bl(A,h[0])),l&&(u=Bl(l,h.at(-1))),gv([c,...h,u],e)}function U9(r,e,t,n){const i=[],a=$a(r);if(Xt(e,t))switch(ul(e,a)){case"left":i.push([e[0]-n,e[1]]),i.push([e[0]-n,e[1]+n]),i.push([e[0],e[1]+n]);break;case"right":i.push([e[0]+n,e[1]]),i.push([e[0]+n,e[1]+n]),i.push([e[0],e[1]+n]);break;case"top":i.push([e[0],e[1]-n]),i.push([e[0]+n,e[1]-n]),i.push([e[0]+n,e[1]]);break;case"bottom":i.push([e[0],e[1]+n]),i.push([e[0]+n,e[1]+n]),i.push([e[0]+n,e[1]]);break}else{const s=ul(e,a),o=ul(t,a);if(s===o){const A=s;let l,c;switch(A){case"left":l=Math.min(e[0],t[0])-n,i.push([l,e[1]]),i.push([l,t[1]]);break;case"right":l=Math.max(e[0],t[0])+n,i.push([l,e[1]]),i.push([l,t[1]]);break;case"top":c=Math.min(e[1],t[1])-n,i.push([e[0],c]),i.push([t[0],c]);break;case"bottom":c=Math.max(e[1],t[1])+n,i.push([e[0],c]),i.push([t[0],c]);break}}else{const A=(h,d)=>({left:[d[0]-n,d[1]],right:[d[0]+n,d[1]],top:[d[0],d[1]-n],bottom:[d[0],d[1]+n]})[h],l=A(s,e),c=A(o,t),u=ml(l,c,a);i.push(l,u,c)}}return i}function pv(r,e){const t=new Set,n=new Set,i=new Set;return r.forEach(a=>{e(a).forEach(o=>{t.add(o),r.includes(o.source)&&r.includes(o.target)?n.add(o):i.add(o)})}),{edges:Array.from(t),internal:Array.from(n),external:Array.from(i)}}function yF(r,e){const t=[];let n=r;for(;n;){t.push(n);const i=e(X(n));if(i)n=i;else break}if(t.some(i=>{var a;return(a=i.style)===null||a===void 0?void 0:a.collapsed})){const i=t.reverse().findIndex(Fr);return t[i]||t.at(-1)}return r}function P9(r,e){return e||(r<4?10:r===4?12:r*2.5)}const R9=(r,e)=>{const t=Math.max(r,e)/2;return[["M",-r/2,0],["A",t,t,0,1,0,2*t-r/2,0],["A",t,t,0,1,0,-r/2,0],["Z"]]},mF=(r,e)=>[["M",-r/2,0],["L",r/2,-e/2],["L",r/2,e/2],["Z"]],D9=Object.freeze(Object.defineProperty({__proto__:null,circle:R9,diamond:(r,e)=>[["M",-r/2,0],["L",0,-e/2],["L",r/2,0],["L",0,e/2],["Z"]],rect:(r,e)=>[["M",-r/2,-e/2],["L",r/2,-e/2],["L",r/2,e/2],["L",-r/2,e/2],["Z"]],simple:(r,e)=>[["M",r/2,-e/2],["L",-r/2,0],["L",r/2,0],["L",-r/2,0],["L",r/2,e/2]],triangle:mF,triangleRect:(r,e)=>{const t=r/2,n=r/7,i=r-n;return[["M",-t,0],["L",0,-e/2],["L",0,e/2],["Z"],["M",i-t,-e/2],["L",i+n-t,-e/2],["L",i+n-t,e/2],["L",i-t,e/2],["Z"]]},vee:(r,e)=>[["M",-r/2,0],["L",r/2,-e/2],["L",4*r/5-r/2,0],["L",r/2,e/2],["Z"]]},Symbol.toStringTag,{value:"Module"}));var Ch=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};class ns extends ZS{constructor(e){super(Ln({style:ns.defaultStyleProps},e)),this.type="edge"}get sourceNode(){const{sourceNode:e}=this.parsedAttributes;return this.context.element.getElement(e)}get targetNode(){const{targetNode:e}=this.parsedAttributes;return this.context.element.getElement(e)}getKeyStyle(e){const t=this.getGraphicStyle(e),{loop:n}=t,i=Ch(t,["loop"]),{sourceNode:a,targetNode:s}=this,A={d:n&&Y9(a,s)?this.getLoopPath(e):this.getKeyPath(e)};return tr.PARSED_STYLE_LIST.forEach(l=>{l in i&&(A[l]=i[l])}),A}getLoopPath(e){const{sourcePort:t,targetPort:n}=e,i=this.sourceNode,a=$a(i),s=Math.max(Xi(a),Zi(a)),{placement:o,clockwise:A,dist:l=s}=rn(this.getGraphicStyle(e),"loop");return N9(i,o,A,l,t,n)}getEndpoints(e,t=!0,n=[]){const{sourcePort:i,targetPort:a}=e,{sourceNode:s,targetNode:o}=this,[A,l]=Z9(s,o,i,a);if(!t){const d=A?rs(A):s.getCenter(),f=l?rs(l):o.getCenter();return[d,f]}const c=typeof n=="function"?n():n,u=TF(A||s,c[0]||l||o),h=TF(l||o,c[c.length-1]||A||s);return[u,h]}getHaloStyle(e){if(e.halo===!1)return!1;const t=this.getKeyStyle(e),n=rn(this.getGraphicStyle(e),"halo");return Object.assign(Object.assign({},t),n)}getLabelStyle(e){if(e.label===!1||!e.labelText)return!1;const t=rn(this.getGraphicStyle(e),"label"),{placement:n,offsetX:i,offsetY:a,autoRotate:s,maxWidth:o}=t,A=Ch(t,["placement","offsetX","offsetY","autoRotate","maxWidth"]),l=fF(this.shapeMap.key,n,s,i,a),c=this.shapeMap.key.getLocalBounds(),u=Bj([c.min,c.max],o);return Object.assign({wordWrapWidth:u},l,A)}getBadgeStyle(e){if(e.badge===!1||!e.badgeText)return!1;const t=rn(e,"badge"),{offsetX:n,offsetY:i,placement:a}=t,s=Ch(t,["offsetX","offsetY","placement"]);return Object.assign(s,T9(this.shapeMap,a,e.labelPlacement,n,i))}drawArrow(e,t){var n;const i=t==="start",s=e[t==="start"?"startArrow":"endArrow"],o=this.shapeMap.key;if(s){const A=this.getArrowStyle(e,i),[l,c,u]=i?["markerStart","markerStartOffset","startArrowOffset"]:["markerEnd","markerEndOffset","endArrowOffset"],h=o.parsedStyle[l];if(h)h.attr(A);else{const d=A.src?PA:tr,f=new d({style:A});o.style[l]=f}o.style[c]=e[u]||A.width/2+ +A.lineWidth}else{const A=i?"markerStart":"markerEnd";(n=o.style[A])===null||n===void 0||n.destroy(),o.style[A]=null}}getArrowStyle(e,t){const n=this.getShape("key").attributes,i=t?"startArrow":"endArrow",a=rn(this.getGraphicStyle(e),i),{size:s,type:o}=a,A=Ch(a,["size","type"]),[l,c]=Gr(P9(n.lineWidth,s)),h=(Te(o)?o:D9[o]||mF)(l,c);return Object.assign(ms(n,["stroke","strokeOpacity","fillOpacity"]),{width:l,height:c},Object.assign({},h&&{d:h,fill:o==="simple"?"":n.stroke}),A)}drawLabelShape(e,t){const n=this.getLabelStyle(e);this.upsert("label",Ji,n,t)}drawHaloShape(e,t){const n=this.getHaloStyle(e);this.upsert("halo",tr,n,t)}drawBadgeShape(e,t){const n=this.getBadgeStyle(e);this.upsert("badge",Go,n,t)}drawSourceArrow(e){this.drawArrow(e,"start")}drawTargetArrow(e){this.drawArrow(e,"end")}drawKeyShape(e,t){const n=this.getKeyStyle(e);return this.upsert("key",tr,n,t)}render(e=this.parsedAttributes,t=this){this.drawKeyShape(e,t),this.getShape("key")&&(this.drawSourceArrow(e),this.drawTargetArrow(e),this.drawLabelShape(e,t),this.drawHaloShape(e,t),this.drawBadgeShape(e,t))}onframe(){this.drawKeyShape(this.parsedAttributes,this),this.drawSourceArrow(this.parsedAttributes),this.drawTargetArrow(this.parsedAttributes),this.drawHaloShape(this.parsedAttributes,this),this.drawLabelShape(this.parsedAttributes,this),this.drawBadgeShape(this.parsedAttributes,this)}animate(e,t){const n=super.animate(e,t);return n&&new Proxy(n,{set:(i,a,s)=>(a==="currentTime"&&Promise.resolve().then(()=>this.onframe()),Reflect.set(i,a,s))})}}ns.defaultStyleProps={badge:!0,badgeOffsetX:0,badgeOffsetY:0,badgePlacement:"suffix",isBillboard:!0,label:!0,labelAutoRotate:!0,labelIsBillboard:!0,labelMaxWidth:"80%",labelOffsetX:4,labelOffsetY:0,labelPlacement:"center",labelTextBaseline:"middle",labelWordWrap:!1,halo:!1,haloDroppable:!1,haloLineDash:0,haloLineWidth:12,haloPointerEvents:"none",haloStrokeOpacity:.25,haloZIndex:-1,loop:!0,startArrow:!1,startArrowLineDash:0,startArrowLineJoin:"round",startArrowLineWidth:1,startArrowTransformOrigin:"center",startArrowType:"vee",endArrow:!1,endArrowLineDash:0,endArrowLineJoin:"round",endArrowLineWidth:1,endArrowTransformOrigin:"center",endArrowType:"vee",loopPlacement:"top",loopClockwise:!0};class js extends ns{constructor(e){super(Ln({style:js.defaultStyleProps},e))}getKeyPath(e){const[t,n]=this.getEndpoints(e),{controlPoints:i,curvePosition:a,curveOffset:s}=e,o=this.getControlPoints(t,n,O9(a),M9(s),i);return pF(t,n,o)}getControlPoints(e,t,n,i,a){return a?.length===2?a:[fv(e,t,n[0],i[0]),fv(e,t,n[1],i[1])]}}js.defaultStyleProps={curvePosition:.5,curveOffset:20};class Sh extends js{constructor(e){super(Ln({style:Sh.defaultStyleProps},e))}getControlPoints(e,t,n,i){const a=t[0]-e[0];return[[e[0]+a*n[0]+i[0],e[1]],[t[0]-a*n[1]+i[1],t[1]]]}}Sh.defaultStyleProps={curvePosition:[.5,.5],curveOffset:[0,0]};class Fh extends js{constructor(e){super(Ln({style:Fh.defaultStyleProps},e))}get ref(){return this.context.model.getRootsData()[0]}getEndpoints(e){if(this.sourceNode.id===this.ref.id)return super.getEndpoints(e);const t=Fn(this.ref),n=this.sourceNode.getIntersectPoint(t,!0),i=this.targetNode.getIntersectPoint(t);return[n,i]}toRadialCoordinate(e){const t=Fn(this.ref),n=Lt(e,t),i=OS(bt(e,t));return[n,i]}getControlPoints(e,t,n,i){const[a,s]=this.toRadialCoordinate(e),[o]=this.toRadialCoordinate(t),A=o-a;return[[e[0]+(A*n[0]+i[0])*Math.cos(s),e[1]+(A*n[0]+i[0])*Math.sin(s)],[t[0]-(A*n[1]-i[0])*Math.cos(s),t[1]-(A*n[1]-i[0])*Math.sin(s)]]}}Fh.defaultStyleProps={curvePosition:.5,curveOffset:20};class Th extends js{constructor(e){super(Ln({style:Th.defaultStyleProps},e))}getControlPoints(e,t,n,i){const a=t[1]-e[1];return[[e[0],e[1]+a*n[0]+i[0]],[t[0],t[1]-a*n[1]+i[1]]]}}Th.defaultStyleProps={curvePosition:[.5,.5],curveOffset:[0,0]};let wF=class dP extends ns{constructor(e){super(Ln({style:dP.defaultStyleProps},e))}getKeyPath(e){const[t,n]=this.getEndpoints(e);return[["M",t[0],t[1]],["L",n[0],n[1]]]}};wF.defaultStyleProps={};const H9={enableObstacleAvoidance:!1,offset:10,maxAllowedDirectionChange:Math.PI/2,maximumLoops:3e3,gridSize:5,startDirections:["top","right","bottom","left"],endDirections:["top","right","bottom","left"],directionMap:{right:{stepX:1,stepY:0},left:{stepX:-1,stepY:0},bottom:{stepX:0,stepY:1},top:{stepX:0,stepY:-1}},penalties:{0:0,90:0},distFunc:ih},va=r=>`${Math.round(r[0])}|||${Math.round(r[1])}`;function Ws(r,e){const t=n=>Math.round(n/e);return Be(r)?t(r):r.map(t)}function G9(r,e){const t=Math.abs(r-e);return t>Math.PI?2*Math.PI-t:t}function BF(r,e){const t=e[0]-r[0],n=e[1]-r[1];return!t&&!n?0:Math.atan2(n,t)}function bF(r,e,t,n){const i=BF(r,e),a=t[va(r)],o=BF(a||n,r);return G9(o,i)}const K9=(r,e)=>{const{offset:t,gridSize:n}=e,i={};return r.forEach(a=>{if(!a||a.destroyed||!a.isVisible())return;const s=Ya(a.getRenderBounds(),t);for(let o=Ws(s.min[0],n);o<=Ws(s.max[0],n);o+=1)for(let A=Ws(s.min[1],n);A<=Ws(s.max[1],n);A+=1)i[`${o}|||${A}`]=!0}),i};function EF(r,e,t){return Math.min(...e.map(n=>t(r,n)))}function z9(r,e,t){let n=r[0],i=t(r[0],e);for(let a=0;a<r.length;a++){const s=r[a],o=t(s,e);o<i&&(n=s,i=o)}return n}const xF=(r,e,t,n)=>{if(!e)return[r];const{directionMap:i,offset:a}=n,s=Ya(e.getRenderBounds(),a),o=Object.keys(i).reduce((A,l)=>{if(t.includes(l)){const c=i[l],[u,h]=qa(s),d=[r[0]+c.stepX*u,r[1]+c.stepY*h],f=kV(s);for(let g=0;g<f.length;g++){const p=Jp([r,d],f[g]);p&&mS(p,s)&&A.push(p)}}return A},[]);return wi(r,s)||o.push(r),o.map(A=>Ws(A,n.gridSize))},V9=(r,e,t,n,i,a,s)=>{const o=[];let A=[a[0]===n[0]?n[0]:r[0]*s,a[1]===n[1]?n[1]:r[1]*s];o.unshift(A);let l=r,c=e[va(l)];for(;c;){const d=c,f=l;bF(d,f,e,t)&&(A=[d[0]===f[0]?A[0]:d[0]*s,d[1]===f[1]?A[1]:d[1]*s],o.unshift(A)),c=e[va(d)],l=d}const u=i.map(d=>[d[0]*s,d[1]*s]),h=z9(u,A,ih);return o.unshift(h),o};function j9(r,e,t,n){const i=Ks(r.getCenter()),a=Ks(e.getCenter()),s=Object.assign(H9,n),{gridSize:o}=s,A=s.enableObstacleAvoidance?t:[r,e],l=K9(A,s),c=Ws(i,o),u=Ws(a,o),h=xF(i,r,s.startDirections,s),d=xF(a,e,s.endDirections,s);h.forEach(T=>delete l[va(T)]),d.forEach(T=>delete l[va(T)]);const f={},g={},p={},v={},y={},m=new W9;for(let T=0;T<h.length;T++){const O=h[T],I=va(O);f[I]=O,v[I]=0,y[I]=EF(O,d,s.distFunc),m.add({id:I,value:y[I]})}const B=d.map(T=>va(T));let C=s.maximumLoops,S,F=1/0;for(const[T,O]of Object.entries(f))y[T]<=F&&(F=y[T],S=O);for(;Object.keys(f).length>0&&C>0;){const T=m.minId(!1);if(T)S=f[T];else break;const O=va(S);if(B.includes(O))return V9(S,p,c,a,h,u,o);delete f[O],m.remove(O),g[O]=!0;for(const I of Object.values(s.directionMap)){const k=Ve(S,[I.stepX,I.stepY]),N=va(k);if(g[N])continue;const U=bF(S,k,p,c);if(U>s.maxAllowedDirectionChange||l[N])continue;f[N]||(f[N]=k);const D=s.penalties[U],G=s.distFunc(S,k)+(isNaN(D)?o:D),Z=v[O]+G,q=v[N];q&&Z>=q||(p[N]=S,v[N]=Z,y[N]=Z+EF(k,d,s.distFunc),m.add({id:N,value:y[N]}))}C-=1}return[]}class W9{constructor(){this.arr=[],this.map={},this.arr=[],this.map={}}_innerAdd(e,t){let n=0,i=t-1;for(;i-n>1;){const a=Math.floor((n+i)/2);if(this.arr[a].value>e.value)i=a;else if(this.arr[a].value<e.value)n=a;else{this.arr.splice(a,0,e),this.map[e.id]=!0;return}}this.arr.splice(i,0,e),this.map[e.id]=!0}add(e){delete this.map[e.id];const t=this.arr.length;if(!t||this.arr[t-1].value<e.value){this.arr.push(e),this.map[e.id]=!0;return}this._innerAdd(e,t)}remove(e){this.map[e]&&delete this.map[e]}_clearAndGetMinId(){let e;for(let t=this.arr.length-1;t>=0;t--)this.map[this.arr[t].id]?e=this.arr[t].id:this.arr.splice(t,1);return e}_findFirstId(){for(;this.arr.length;){const e=this.arr.shift();if(this.map[e.id])return e.id}}minId(e){return e?this._clearAndGetMinId():this._findFirstId()}}class Mh extends ns{constructor(e){super(Ln({style:Mh.defaultStyleProps},e))}getControlPoints(e){const{router:t}=e,{sourceNode:n,targetNode:i}=this,[a,s]=this.getEndpoints(e,!1);let o=[];if(!t)o=e.controlPoints;else if(t.type==="shortest-path"){const A=this.context.element.getNodes();o=j9(n,i,A,t),o.length||(o=cF(a,s,n,i,e.controlPoints,{padding:t.offset}))}else t.type==="orth"&&(o=cF(a,s,n,i,e.controlPoints,t));return o}getPoints(e){const t=this.getControlPoints(e),[n,i]=this.getEndpoints(e,!0,t);return[n,...t,i]}getKeyPath(e){const t=this.getPoints(e);return gv(t,e.radius)}getLoopPath(e){const{sourcePort:t,targetPort:n,radius:i}=e,a=this.sourceNode,s=$a(a),o=Math.max(Xi(s),Zi(s))/4,{placement:A,clockwise:l,dist:c=o}=rn(this.getGraphicStyle(e),"loop");return Q9(a,i,A,l,c,t,n)}}Mh.defaultStyleProps={radius:0,controlPoints:[],router:!1};class Oh extends ns{constructor(e){super(Ln({style:Oh.defaultStyleProps},e))}getKeyPath(e){const{curvePosition:t,curveOffset:n}=e,[i,a]=this.getEndpoints(e),s=e.controlPoint||fv(i,a,t,n);return I9(i,a,s)}}Oh.defaultStyleProps={curvePosition:.5,curveOffset:30};var q9=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};function wl(r){return r instanceof xi&&r.type==="node"}function CF(r){return r instanceof ns}function vv(r){return r instanceof zo}function $9(r){return wl(r)||CF(r)||vv(r)}function Y9(r,e){return!r||!e?!1:r===e}const X9={top:[.5,0],right:[1,.5],bottom:[.5,1],left:[0,.5],"left-top":[0,0],"top-left":[0,0],"left-bottom":[0,1],"bottom-left":[0,1],"right-top":[1,0],"top-right":[1,0],"right-bottom":[1,1],"bottom-right":[1,1],default:[.5,.5]};function yv(r,e,t=X9,n=!0){const i=[.5,.5],a=ot(e)?Dn(t,e.toLocaleLowerCase(),i):e;if(!n&&ot(e))return a;const[s,o]=a||i;return[r.min[0]+Xi(r)*s,r.min[1]+Zi(r)*o]}function mv(r){if(!r)return{};const e=r.getPorts();return(r.attributes.ports||[]).forEach((n,i)=>{var a;const{key:s,placement:o}=n;SF(n)&&(e[a=s||i]||(e[a]=ga(r.getShape("key").getBounds(),o)))}),e}function SF(r){const{r:e}=r;return!e||Number(e)===0}function rs(r){return Do(r)?r:r.getPosition()}function Z9(r,e,t,n){const i=FF(r,e,t,n),a=FF(e,r,n,t);return[i,a]}function FF(r,e,t,n){const i=mv(r);if(t)return i[t];const a=Object.values(i);if(a.length===0)return;const s=a.map(l=>rs(l)),o=J9(e,n),[A]=cj(s,o);return a.find(l=>rs(l)===A)}function J9(r,e){const t=mv(r);if(e)return[rs(t[e])];const n=Object.values(t);return n.length>0?n.map(i=>rs(i)):[r.getCenter()]}function TF(r,e){return vv(r)||wl(r)?wv(r,e):Bl(r,e)}function Bl(r,e){if(!r||!e)return[0,0,0];if(Do(r))return r;if(r.attributes.linkToCenter)return r.getPosition();const t=Do(e)?e:wl(e)?e.getCenter():e.getPosition();return sh(t,r.getBounds())}function wv(r,e){if(!r||!e)return[0,0,0];const t=Do(e)?e:wl(e)?e.getCenter():e.getPosition();return r.getIntersectPoint(t)||r.getCenter()}function MF(r,e="bottom",t=0,n=0,i=!1){const a=e.split("-"),[s,o]=ga(r,e),[A,l]=i?["bottom","top"]:["top","bottom"],c=a.includes("top")?l:a.includes("bottom")?A:"middle",u=a.includes("left")?"right":a.includes("right")?"left":"center";return{transform:[["translate",s+t,o+n]],textBaseline:c,textAlign:u}}function eW(r,e){return[[0,-r],[e*Math.cos(3*Math.PI/10),-e*Math.sin(3*Math.PI/10)],[r*Math.cos(Math.PI/10),-r*Math.sin(Math.PI/10)],[e*Math.cos(Math.PI/10),e*Math.sin(Math.PI/10)],[r*Math.cos(3*Math.PI/10),r*Math.sin(3*Math.PI/10)],[0,e],[-r*Math.cos(3*Math.PI/10),r*Math.sin(3*Math.PI/10)],[-e*Math.cos(Math.PI/10),e*Math.sin(Math.PI/10)],[-r*Math.cos(Math.PI/10),-r*Math.sin(Math.PI/10)],[-e*Math.cos(3*Math.PI/10),-e*Math.sin(3*Math.PI/10)]]}function tW(r,e){const t={};return t.top=[0,-r],t.left=[-r*Math.cos(Math.PI/10),-r*Math.sin(Math.PI/10)],t["left-bottom"]=[-r*Math.cos(3*Math.PI/10),r*Math.sin(3*Math.PI/10)],t.bottom=[0,e],t["right-bottom"]=[r*Math.cos(3*Math.PI/10),r*Math.sin(3*Math.PI/10)],t.right=t.default=[r*Math.cos(Math.PI/10),-r*Math.sin(Math.PI/10)],t}function nW(r,e,t){const n=e/2,i=r/2,a={up:[[-i,n],[i,n],[0,-n]],left:[[-i,0],[i,n],[i,-n]],right:[[-i,n],[-i,-n],[i,0]],down:[[-i,-n],[i,-n],[0,n]]};return a[t]||a.up}function rW(r,e,t){const n=e/2,i=r/2,a={};return t==="down"?(a.bottom=a.default=[0,n],a.right=[i,-n],a.left=[-i,-n]):t==="left"?(a.top=[i,-n],a.bottom=[i,n],a.left=a.default=[-i,0]):t==="right"?(a.top=[-i,-n],a.bottom=[-i,n],a.right=a.default=[i,0]):(a.left=[-i,n],a.top=a.default=[0,-n],a.right=[i,n]),a}function iW(r,e){return[[0,-e/2],[r/2,0],[0,e/2],[-r/2,0]]}function OF(r){return Dn(r,["style","visibility"])!=="hidden"}function aW(r,e){const{zIndex:t,transform:n,transformOrigin:i,visibility:a,cursor:s,clipPath:o,component:A}=e,l=q9(e,["zIndex","transform","transformOrigin","visibility","cursor","clipPath","component"]);Object.assign(r.attributes,l),n&&r.setAttribute("transform",n),Be(t)&&r.setAttribute("zIndex",t),i&&r.setAttribute("transformOrigin",i),a&&r.setAttribute("visibility",a),s&&r.setAttribute("cursor",s),o&&r.setAttribute("clipPath",o),A&&r.setAttribute("component",A)}function Bv(r,e){"update"in r?r.update(e):r.attr(e)}function sW(r){return[[0,r],[r*Math.sqrt(3)/2,r/2],[r*Math.sqrt(3)/2,-r/2],[0,-r],[-r*Math.sqrt(3)/2,-r/2],[-r*Math.sqrt(3)/2,r/2]]}function oW(r){BA(r,"__to_be_destroyed__",!0)}function bl(r){return Dn(r,"__to_be_destroyed__",!1)}var AW=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{l(n.next(c))}catch(u){s(u)}}function A(c){try{l(n.throw(c))}catch(u){s(u)}}function l(c){c.done?a(c.value):i(c.value).then(o,A)}l((n=n.apply(r,e||[])).next())})};class Ih extends Hr{constructor(e,t){super(e,Object.assign({},Ih.defaultOptions,t)),this.onCollapseExpand=n=>AW(this,void 0,void 0,function*(){if(!this.validate(n))return;const{target:i}=n;if(!$9(i))return;const a=i.id,{model:s,graph:o}=this.context,A=s.getElementDataById(a);if(!A)return!1;const{onCollapse:l,onExpand:c,animation:u,align:h}=this.options;Fr(A)?(yield o.expandElement(a,{animation:u,align:h}),c?.(a)):(yield o.collapseElement(a,{animation:u,align:h}),l?.(a))}),this.bindEvents()}update(e){this.unbindEvents(),super.update(e),this.bindEvents()}bindEvents(){const{graph:e}=this.context,{trigger:t}=this.options;e.on(`node:${t}`,this.onCollapseExpand),e.on(`combo:${t}`,this.onCollapseExpand)}unbindEvents(){const{graph:e}=this.context,{trigger:t}=this.options;e.off(`node:${t}`,this.onCollapseExpand),e.off(`combo:${t}`,this.onCollapseExpand)}validate(e){if(this.destroyed)return!1;const{enable:t}=this.options;return Te(t)?t(e):!!t}destroy(){this.unbindEvents(),super.destroy()}}Ih.defaultOptions={enable:!0,animation:!0,trigger:ie.DBLCLICK,align:!0};var El=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};function is(r,e){const{data:t,style:n}=r,i=El(r,["data","style"]),{data:a,style:s}=e,o=El(e,["data","style"]),A=Object.assign(Object.assign({},i),o);return(t||a)&&Object.assign(A,{data:Object.assign(Object.assign({},t),a)}),(n||s)&&Object.assign(A,{style:Object.assign(Object.assign({},n),s)}),A}function bv(r){const{data:e,style:t}=r,i=El(r,["data","style"]);return e&&(i.data=Object.assign({},e)),t&&(i.style=Object.assign({},t)),i}function Vo(r={},e={}){const{states:t=[],data:n={},style:i={},children:a=[]}=r,s=El(r,["states","data","style","children"]),{states:o=[],data:A={},style:l={},children:c=[]}=e,u=El(e,["states","data","style","children"]),h=(f,g)=>f.length!==g.length?!1:f.every((p,v)=>p===g[v]),d=(f,g)=>{const p=Object.keys(f),v=Object.keys(g);return p.length!==v.length?!1:p.every(y=>f[y]===g[y])};return!(!d(s,u)||!h(a,c)||!h(t,o)||!d(n,A)||!d(i,l))}const IF="__internal_override__";function _F(r){return r[IF]!==!1}var _h=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{l(n.next(c))}catch(u){s(u)}}function A(c){try{l(n.throw(c))}catch(u){s(u)}}function l(c){c.done?a(c.value):i(c.value).then(o,A)}l((n=n.apply(r,e||[])).next())})};const lW="g6-create-edge-assist-edge-id",kh="g6-create-edge-assist-node-id";class Nh extends Hr{constructor(e,t){super(e,Object.assign({},Nh.defaultOptions,t)),this.drop=n=>_h(this,void 0,void 0,function*(){const{targetType:i}=n;["combo","node"].includes(i)&&this.source?yield this.handleCreateEdge(n):yield this.cancelEdge()}),this.handleCreateEdge=n=>_h(this,void 0,void 0,function*(){var i,a,s;if(!this.validate(n))return;const{graph:o,canvas:A,batch:l,element:c}=this.context,{style:u}=this.options;if(this.source){this.createEdge(n),yield this.cancelEdge();return}l.startBatch(),A.setCursor("crosshair"),this.source=this.getSelectedNodeIDs([n.target.id])[0];const h=o.getElementData(this.source);o.addNodeData([{id:kh,type:"circle",[IF]:!1,style:{size:1,visibility:"hidden",ports:[{key:"port-1",placement:[.5,.5]}],x:(i=h.style)===null||i===void 0?void 0:i.x,y:(a=h.style)===null||a===void 0?void 0:a.y}}]),o.addEdgeData([{id:lW,source:this.source,target:kh,style:Object.assign({pointerEvents:"none"},u)}]),yield(s=c.draw({animation:!1}))===null||s===void 0?void 0:s.finished}),this.updateAssistEdge=n=>_h(this,void 0,void 0,function*(){var i;if(!this.source)return;const{model:a,element:s}=this.context;a.translateNodeTo(kh,[n.client.x,n.client.y]),yield(i=s.draw({animation:!1,silence:!0}))===null||i===void 0?void 0:i.finished}),this.createEdge=n=>{var i,a;const{graph:s}=this.context,{style:o,onFinish:A,onCreate:l}=this.options;if(((i=n.target)===null||i===void 0?void 0:i.id)===void 0||this.source===void 0)return;const u=(a=this.getSelectedNodeIDs([n.target.id]))===null||a===void 0?void 0:a[0],h=`${this.source}-${u}-${QR()}`,d=l({id:h,source:this.source,target:u,style:o});d&&(s.addEdgeData([d]),A(d))},this.cancelEdge=()=>_h(this,void 0,void 0,function*(){var n;if(!this.source)return;const{graph:i,element:a,batch:s}=this.context;i.removeNodeData([kh]),this.source=void 0,yield(n=a.draw({animation:!1}))===null||n===void 0?void 0:n.finished,s.endBatch()}),this.bindEvents()}update(e){super.update(e),this.bindEvents()}bindEvents(){const{graph:e}=this.context,{trigger:t}=this.options;this.unbindEvents(),t==="click"?(e.on(ai.CLICK,this.handleCreateEdge),e.on(Ds.CLICK,this.handleCreateEdge),e.on(ua.CLICK,this.cancelEdge),e.on(Ju.CLICK,this.cancelEdge)):(e.on(ai.DRAG_START,this.handleCreateEdge),e.on(Ds.DRAG_START,this.handleCreateEdge),e.on(ie.POINTER_UP,this.drop)),e.on(ie.POINTER_MOVE,this.updateAssistEdge)}getSelectedNodeIDs(e){return Array.from(new Set(this.context.graph.getElementDataByState("node",this.options.state).map(t=>t.id).concat(e)))}validate(e){if(this.destroyed)return!1;const{enable:t}=this.options;return Te(t)?t(e):!!t}unbindEvents(){const{graph:e}=this.context;e.off(ai.CLICK,this.handleCreateEdge),e.off(Ds.CLICK,this.handleCreateEdge),e.off(ua.CLICK,this.cancelEdge),e.off(Ju.CLICK,this.cancelEdge),e.off(ai.DRAG_START,this.handleCreateEdge),e.off(Ds.DRAG_START,this.handleCreateEdge),e.off(ie.POINTER_UP,this.drop),e.off(ie.POINTER_MOVE,this.updateAssistEdge)}destroy(){this.unbindEvents(),super.destroy()}}Nh.defaultOptions={animation:!0,enable:!0,style:{},trigger:"drag",onCreate:r=>r,onFinish:()=>{}};var kF=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{l(n.next(c))}catch(u){s(u)}}function A(c){try{l(n.throw(c))}catch(u){s(u)}}function l(c){c.done?a(c.value):i(c.value).then(o,A)}l((n=n.apply(r,e||[])).next())})};class Lh extends Hr{constructor(e,t){super(e,Object.assign({},Lh.defaultOptions,t)),this.isDragging=!1,this.onDragStart=n=>{this.validate(n)&&(this.isDragging=!0,this.context.canvas.setCursor("grabbing"))},this.onDrag=n=>{var i,a,s,o;if(!this.isDragging||hn.isPinching)return;const A=(a=(i=n.movement)===null||i===void 0?void 0:i.x)!==null&&a!==void 0?a:n.dx,l=(o=(s=n.movement)===null||s===void 0?void 0:s.y)!==null&&o!==void 0?o:n.dy;(A|l)!==0&&this.translate([A,l],!1)},this.onDragEnd=()=>{var n,i;this.isDragging=!1,this.context.canvas.setCursor(this.defaultCursor),(i=(n=this.options).onFinish)===null||i===void 0||i.call(n)},this.invokeOnFinish=wA(()=>{var n,i;(i=(n=this.options).onFinish)===null||i===void 0||i.call(n)},300),this.shortcut=new es(e.graph),this.bindEvents(),this.defaultCursor=this.context.canvas.getConfig().cursor||"default"}update(e){this.unbindEvents(),super.update(e),this.bindEvents()}bindEvents(){const{trigger:e}=this.options;if(on(e)){const{up:t=[],down:n=[],left:i=[],right:a=[]}=e;this.shortcut.bind(t,s=>this.onTranslate([0,1],s)),this.shortcut.bind(n,s=>this.onTranslate([0,-1],s)),this.shortcut.bind(i,s=>this.onTranslate([1,0],s)),this.shortcut.bind(a,s=>this.onTranslate([-1,0],s))}else{const{graph:t}=this.context;t.on(ie.DRAG_START,this.onDragStart),t.on(ie.DRAG,this.onDrag),t.on(ie.DRAG_END,this.onDragEnd)}}onTranslate(e,t){return kF(this,void 0,void 0,function*(){if(!this.validate(t))return;const{sensitivity:n}=this.options,i=n*-1;yield this.translate(Bi(e,i),this.options.animation),this.invokeOnFinish()})}translate(e,t){return kF(this,void 0,void 0,function*(){e=this.clampByDirection(e),e=this.clampByRange(e),e=this.clampByRotation(e),yield this.context.graph.translateBy(e,t)})}clampByRotation([e,t]){const n=this.context.graph.getRotation();return IS([e,t],n)}clampByDirection([e,t]){const{direction:n}=this.options;return n==="x"?t=0:n==="y"&&(e=0),[e,t]}clampByRange([e,t]){const{viewport:n,canvas:i}=this.context,[a,s]=i.getSize(),[o,A,l,c]=si(this.options.range),u=[s*o,a*A,s*l,a*c],h=Ya(Wp(n.getCanvasCenter()),u),d=bt(n.getViewportCenter(),[e,t,0]);if(!wi(d,h)){const{min:[f,g],max:[p,v]}=h;(d[0]<f&&e>0||d[0]>p&&e<0)&&(e=0),(d[1]<g&&t>0||d[1]>v&&t<0)&&(t=0)}return[e,t]}validate(e){if(this.destroyed)return!1;const{enable:t}=this.options;return typeof t=="function"?t(e):!!t}unbindEvents(){this.shortcut.unbindAll();const{graph:e}=this.context;e.off(ie.DRAG_START,this.onDragStart),e.off(ie.DRAG,this.onDrag),e.off(ie.DRAG_END,this.onDragEnd)}destroy(){this.shortcut.destroy(),this.unbindEvents(),this.context.canvas.setCursor(this.defaultCursor),super.destroy()}}Lh.defaultOptions={enable:r=>"targetType"in r?r.targetType==="canvas":!0,sensitivity:10,direction:"both",range:1/0};var NF=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{l(n.next(c))}catch(u){s(u)}}function A(c){try{l(n.throw(c))}catch(u){s(u)}}function l(c){c.done?a(c.value):i(c.value).then(o,A)}l((n=n.apply(r,e||[])).next())})};class xl extends Hr{constructor(e,t){super(e,Object.assign({},xl.defaultOptions,t)),this.enable=!1,this.enableElements=["node","combo"],this.target=[],this.shadowOrigin=[0,0],this.hiddenEdges=[],this.isDragging=!1,this.onDrop=n=>NF(this,void 0,void 0,function*(){var i;if(this.options.dropEffect!=="link")return;const{model:a,element:s}=this.context,o=n.target.id;this.target.forEach(A=>{const l=a.getParentData(A,Ft);l&&X(l)===o&&a.refreshComboData(o),a.setParent(A,o,Ft)}),yield(i=s?.draw({animation:!0}))===null||i===void 0?void 0:i.finished}),this.setCursor=n=>{if(this.isDragging)return;const{type:i}=n,{canvas:a}=this.context,{cursor:s}=this.options;i===ie.POINTER_ENTER?a.setCursor(s?.grab||"grab"):a.setCursor(s?.default||"default")},this.shortcut=new es(e.graph),this.onDragStart=this.onDragStart.bind(this),this.onDrag=this.onDrag.bind(this),this.onDragEnd=this.onDragEnd.bind(this),this.onDrop=this.onDrop.bind(this),this.bindEvents()}update(e){this.unbindEvents(),super.update(e),this.bindEvents()}bindEvents(){const{graph:e,canvas:t}=this.context,n=t.getLayer().getContextService().$canvas;n&&(n.addEventListener("blur",this.onDragEnd),n.addEventListener("contextmenu",this.onDragEnd)),this.enableElements.forEach(i=>{e.on(`${i}:${ie.DRAG_START}`,this.onDragStart),e.on(`${i}:${ie.DRAG}`,this.onDrag),e.on(`${i}:${ie.DRAG_END}`,this.onDragEnd),e.on(`${i}:${ie.POINTER_ENTER}`,this.setCursor),e.on(`${i}:${ie.POINTER_LEAVE}`,this.setCursor)}),["link"].includes(this.options.dropEffect)&&(e.on(Ds.DROP,this.onDrop),e.on(ua.DROP,this.onDrop))}getSelectedNodeIDs(e){return Array.from(new Set(this.context.graph.getElementDataByState("node",this.options.state).map(t=>t.id).concat(e)))}getDelta(e){const t=this.context.graph.getZoom();return bi([e.dx,e.dy],t)}onDragStart(e){var t;if(this.enable=this.validate(e),!this.enable)return;const{batch:n,canvas:i,graph:a}=this.context;i.setCursor(((t=this.options.cursor)===null||t===void 0?void 0:t.grabbing)||"grabbing"),this.isDragging=!0,n.startBatch();const s=e.target.id;a.getElementState(s).includes(this.options.state)?this.target=this.getSelectedNodeIDs([s]):this.target=[s],this.hideEdge(),this.context.graph.frontElement(this.target),this.options.shadow&&this.createShadow(this.target)}onDrag(e){if(!this.enable)return;const t=this.getDelta(e);this.options.shadow?this.moveShadow(t):this.moveElement(this.target,t)}onDragEnd(){var e,t,n;if(!this.enable)return;if(this.enable=!1,this.options.shadow){if(!this.shadow)return;this.shadow.style.visibility="hidden";const{x:s=0,y:o=0}=this.shadow.attributes,[A,l]=bt([+s,+o],this.shadowOrigin);this.moveElement(this.target,[A,l])}this.showEdges(),(t=(e=this.options).onFinish)===null||t===void 0||t.call(e,this.target);const{batch:i,canvas:a}=this.context;i.endBatch(),a.setCursor(((n=this.options.cursor)===null||n===void 0?void 0:n.grab)||"grab"),this.isDragging=!1,this.target=[]}isKeydown(){const{trigger:e}=this.options;return e?.length?this.shortcut.match(e):!0}validate(e){if(this.destroyed||bl(e.target)||this.context.graph.isCollapsingExpanding||!this.isKeydown())return!1;const{enable:t}=this.options;return Te(t)?t(e):!!t}clampByRotation([e,t]){const n=this.context.graph.getRotation();return IS([e,t],n)}moveElement(e,t){return NF(this,void 0,void 0,function*(){const{graph:n,model:i}=this.context,{dropEffect:a}=this.options;a==="move"&&e.forEach(s=>i.refreshComboData(s)),n.translateElementBy(Object.fromEntries(e.map(s=>[s,this.clampByRotation(t)])),!1)})}moveShadow(e){if(!this.shadow)return;const{x:t=0,y:n=0}=this.shadow.attributes,[i,a]=e;this.shadow.attr({x:+t+i,y:+n+a})}createShadow(e){const t=rn(this.options,"shadow"),n=cl(e.map(l=>this.context.element.getElement(l).getBounds())),[i,a]=n.min;this.shadowOrigin=[i,a];const[s,o]=qa(n),A={width:s,height:o,x:i,y:a};this.shadow?this.shadow.attr(Object.assign(Object.assign(Object.assign({},t),A),{visibility:"visible"})):(this.shadow=new Gn({style:Object.assign(Object.assign(Object.assign({$layer:"transient"},t),A),{pointerEvents:"none"})}),this.context.canvas.appendChild(this.shadow))}showEdges(){this.options.shadow||this.hiddenEdges.length===0||(this.context.graph.showElement(this.hiddenEdges),this.hiddenEdges=[])}hideEdge(){const{hideEdge:e,shadow:t}=this.options;if(e==="none"||t)return;const{graph:n}=this.context;e==="all"?this.hiddenEdges=n.getEdgeData().map(X):this.hiddenEdges=Array.from(new Set(this.target.map(i=>n.getRelatedEdgesData(i,e).map(X)).flat())),n.hideElement(this.hiddenEdges)}unbindEvents(){const{graph:e,canvas:t}=this.context,n=t.getLayer().getContextService().$canvas;n&&(n.removeEventListener("blur",this.onDragEnd),n.removeEventListener("contextmenu",this.onDragEnd)),this.enableElements.forEach(i=>{e.off(`${i}:${ie.DRAG_START}`,this.onDragStart),e.off(`${i}:${ie.DRAG}`,this.onDrag),e.off(`${i}:${ie.DRAG_END}`,this.onDragEnd),e.off(`${i}:${ie.POINTER_ENTER}`,this.setCursor),e.off(`${i}:${ie.POINTER_LEAVE}`,this.setCursor)}),e.off(`combo:${ie.DROP}`,this.onDrop),e.off(`canvas:${ie.DROP}`,this.onDrop)}destroy(){var e;this.unbindEvents(),(e=this.shadow)===null||e===void 0||e.destroy(),super.destroy()}}xl.defaultOptions={animation:!0,enable:r=>["node","combo"].includes(r.targetType),trigger:[],dropEffect:"move",state:"selected",hideEdge:"none",shadow:!1,shadowZIndex:100,shadowFill:"#F3F9FF",shadowFillOpacity:.5,shadowStroke:"#1890FF",shadowStrokeOpacity:.9,shadowLineDash:[5,5],cursor:{default:"default",grab:"grab",grabbing:"grabbing"}};var cW="*",Qh=(function(){function r(){this._events={}}return r.prototype.on=function(e,t,n){return this._events[e]||(this._events[e]=[]),this._events[e].push({callback:t,once:!!n}),this},r.prototype.once=function(e,t){return this.on(e,t,!0)},r.prototype.emit=function(e){for(var t=this,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var a=this._events[e]||[],s=this._events[cW]||[],o=function(A){for(var l=A.length,c=0;c<l;c++)if(A[c]){var u=A[c],h=u.callback,d=u.once;d&&(A.splice(c,1),A.length===0&&delete t._events[e],l--,c--),h.apply(t,n)}};o(a),o(s)},r.prototype.off=function(e,t){if(!e)this._events={};else if(!t)delete this._events[e];else{for(var n=this._events[e]||[],i=n.length,a=0;a<i;a++)n[a].callback===t&&(n.splice(a,1),i--,a--);n.length===0&&delete this._events[e]}return this},r.prototype.getEvents=function(){return this._events},r})();function Ev(r,e,t,n){for(;r.length;){const i=r.shift();if(t(i))return!0;e.add(i.id),n(i.id).forEach(s=>{e.has(s.id)||(e.add(s.id),r.push(s))})}return!1}function Uh(r,e,t,n){if(t(r))return!0;e.add(r.id);for(const a of n(r.id))if(!e.has(a.id)&&Uh(a,e,t,n))return!0;return!1}const LF=()=>!0;class uW{graph;nodeFilter;edgeFilter;cacheEnabled;inEdgesMap=new Map;outEdgesMap=new Map;bothEdgesMap=new Map;allNodesMap=new Map;allEdgesMap=new Map;constructor(e){this.graph=e.graph;const t=e.nodeFilter||LF,n=e.edgeFilter||LF;this.nodeFilter=t,this.edgeFilter=i=>{const{source:a,target:s}=this.graph.getEdgeDetail(i.id);return!t(a)||!t(s)?!1:n(i,a,s)},e.cache==="auto"?(this.cacheEnabled=!0,this.startAutoCache()):e.cache==="manual"?this.cacheEnabled=!0:this.cacheEnabled=!1}clearCache=()=>{this.inEdgesMap.clear(),this.outEdgesMap.clear(),this.bothEdgesMap.clear(),this.allNodesMap.clear(),this.allEdgesMap.clear()};refreshCache=()=>{this.clearCache(),this.updateCache(this.graph.getAllNodes().map(e=>e.id))};updateCache=e=>{const t=new Set;e.forEach(n=>{const i=this.bothEdgesMap.get(n);if(i&&i.forEach(a=>t.add(a.id)),!this.hasNode(n))this.inEdgesMap.delete(n),this.outEdgesMap.delete(n),this.bothEdgesMap.delete(n),this.allNodesMap.delete(n);else{const a=this.graph.getRelatedEdges(n,"in").filter(this.edgeFilter),s=this.graph.getRelatedEdges(n,"out").filter(this.edgeFilter),o=Array.from(new Set([...a,...s]));o.forEach(A=>t.add(A.id)),this.inEdgesMap.set(n,a),this.outEdgesMap.set(n,s),this.bothEdgesMap.set(n,o),this.allNodesMap.set(n,this.graph.getNode(n))}}),t.forEach(n=>{this.hasEdge(n)?this.allEdgesMap.set(n,this.graph.getEdge(n)):this.allEdgesMap.delete(n)})};startAutoCache(){this.refreshCache(),this.graph.on("changed",this.handleGraphChanged)}stopAutoCache(){this.graph.off("changed",this.handleGraphChanged)}handleGraphChanged=e=>{const t=new Set;e.changes.forEach(n=>{switch(n.type){case"NodeAdded":t.add(n.value.id);break;case"NodeDataUpdated":t.add(n.id);break;case"EdgeAdded":t.add(n.value.source),t.add(n.value.target);break;case"EdgeUpdated":(n.propertyName==="source"||n.propertyName==="target")&&(t.add(n.oldValue),t.add(n.newValue));break;case"EdgeDataUpdated":if(e.graph.hasEdge(n.id)){const i=e.graph.getEdge(n.id);t.add(i.source),t.add(i.target)}break;case"EdgeRemoved":t.add(n.value.source),t.add(n.value.target);break;case"NodeRemoved":t.add(n.value.id);break}}),this.updateCache(t)};checkNodeExistence(e){this.getNode(e)}hasNode(e){if(!this.graph.hasNode(e))return!1;const t=this.graph.getNode(e);return this.nodeFilter(t)}areNeighbors(e,t){return this.checkNodeExistence(e),this.getNeighbors(t).some(n=>n.id===e)}getNode(e){const t=this.graph.getNode(e);if(!this.nodeFilter(t))throw new Error("Node not found for id: "+e);return t}getRelatedEdges(e,t){return this.checkNodeExistence(e),this.cacheEnabled?t==="in"?this.inEdgesMap.get(e):t==="out"?this.outEdgesMap.get(e):this.bothEdgesMap.get(e):this.graph.getRelatedEdges(e,t).filter(this.edgeFilter)}getDegree(e,t){return this.getRelatedEdges(e,t).length}getSuccessors(e){const n=this.getRelatedEdges(e,"out").map(i=>this.getNode(i.target));return Array.from(new Set(n))}getPredecessors(e){const n=this.getRelatedEdges(e,"in").map(i=>this.getNode(i.source));return Array.from(new Set(n))}getNeighbors(e){const t=this.getPredecessors(e),n=this.getSuccessors(e);return Array.from(new Set([...t,...n]))}hasEdge(e){if(!this.graph.hasEdge(e))return!1;const t=this.graph.getEdge(e);return this.edgeFilter(t)}getEdge(e){const t=this.graph.getEdge(e);if(!this.edgeFilter(t))throw new Error("Edge not found for id: "+e);return t}getEdgeDetail(e){const t=this.getEdge(e);return{edge:t,source:this.getNode(t.source),target:this.getNode(t.target)}}hasTreeStructure(e){return this.graph.hasTreeStructure(e)}getRoots(e){return this.graph.getRoots(e).filter(this.nodeFilter)}getChildren(e,t){return this.checkNodeExistence(e),this.graph.getChildren(e,t).filter(this.nodeFilter)}getParent(e,t){this.checkNodeExistence(e);const n=this.graph.getParent(e,t);return!n||!this.nodeFilter(n)?null:n}getAllNodes(){return this.cacheEnabled?Array.from(this.allNodesMap.values()):this.graph.getAllNodes().filter(this.nodeFilter)}getAllEdges(){return this.cacheEnabled?Array.from(this.allEdgesMap.values()):this.graph.getAllEdges().filter(this.edgeFilter)}bfs(e,t,n="out"){const i={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[n];Ev([this.getNode(e)],new Set,t,i)}dfs(e,t,n="out"){const i={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[n];Uh(this.getNode(e),new Set,t,i)}}let Tn=class fP extends Qh{nodeMap=new Map;edgeMap=new Map;inEdgesMap=new Map;outEdgesMap=new Map;bothEdgesMap=new Map;treeIndices=new Map;changes=[];batchCount=0;onChanged=()=>{};constructor(e){super(),e&&(e.nodes&&this.addNodes(e.nodes),e.edges&&this.addEdges(e.edges),e.tree&&this.addTree(e.tree),e.onChanged&&(this.onChanged=e.onChanged))}batch=e=>{this.batchCount+=1,e(),this.batchCount-=1,this.batchCount||this.commit()};commit(){const e=this.changes;this.changes=[];const t={graph:this,changes:e};this.emit("changed",t),this.onChanged(t)}reduceChanges(e){let t=[];return e.forEach(n=>{switch(n.type){case"NodeRemoved":{let i=!1;t=t.filter(a=>{if(a.type==="NodeAdded"){const s=a.value.id===n.value.id;return s&&(i=!0),!s}else{if(a.type==="NodeDataUpdated")return a.id!==n.value.id;if(a.type==="TreeStructureChanged")return a.nodeId!==n.value.id}return!0}),i||t.push(n);break}case"EdgeRemoved":{let i=!1;t=t.filter(a=>{if(a.type==="EdgeAdded"){const s=a.value.id===n.value.id;return s&&(i=!0),!s}else if(a.type==="EdgeDataUpdated"||a.type==="EdgeUpdated")return a.id!==n.value.id;return!0}),i||t.push(n);break}case"NodeDataUpdated":case"EdgeDataUpdated":case"EdgeUpdated":{const i=t.findIndex(s=>s.type===n.type&&s.id===n.id&&(n.propertyName===void 0||s.propertyName===n.propertyName)),a=t[i];a?n.propertyName!==void 0?a.newValue=n.newValue:(t.splice(i,1),t.push(n)):t.push(n);break}case"TreeStructureDetached":{t=t.filter(i=>i.type==="TreeStructureAttached"||i.type==="TreeStructureChanged"?i.treeKey!==n.treeKey:!0),t.push(n);break}case"TreeStructureChanged":{const i=t.find(a=>a.type==="TreeStructureChanged"&&a.treeKey===n.treeKey&&a.nodeId===n.nodeId);i?i.newParentId=n.newParentId:t.push(n);break}default:t.push(n);break}}),t}checkNodeExistence(e){this.getNode(e)}hasNode(e){return this.nodeMap.has(e)}areNeighbors(e,t){return this.getNeighbors(t).some(n=>n.id===e)}getNode(e){const t=this.nodeMap.get(e);if(!t)throw new Error("Node not found for id: "+e);return t}getRelatedEdges(e,t){if(this.checkNodeExistence(e),t==="in"){const n=this.inEdgesMap.get(e);return Array.from(n)}else if(t==="out"){const n=this.outEdgesMap.get(e);return Array.from(n)}else{const n=this.bothEdgesMap.get(e);return Array.from(n)}}getDegree(e,t){return this.getRelatedEdges(e,t).length}getSuccessors(e){const n=this.getRelatedEdges(e,"out").map(i=>this.getNode(i.target));return Array.from(new Set(n))}getPredecessors(e){const n=this.getRelatedEdges(e,"in").map(i=>this.getNode(i.source));return Array.from(new Set(n))}getNeighbors(e){const t=this.getPredecessors(e),n=this.getSuccessors(e);return Array.from(new Set([...t,...n]))}doAddNode(e){if(this.hasNode(e.id))throw new Error("Node already exists: "+e.id);this.nodeMap.set(e.id,e),this.inEdgesMap.set(e.id,new Set),this.outEdgesMap.set(e.id,new Set),this.bothEdgesMap.set(e.id,new Set),this.treeIndices.forEach(t=>{t.childrenMap.set(e.id,new Set)}),this.changes.push({type:"NodeAdded",value:e})}addNodes(e){this.batch(()=>{for(const t of e)this.doAddNode(t)})}addNode(e){this.addNodes([e])}doRemoveNode(e){const t=this.getNode(e);this.bothEdgesMap.get(e)?.forEach(i=>this.doRemoveEdge(i.id)),this.nodeMap.delete(e),this.treeIndices.forEach(i=>{i.childrenMap.get(e)?.forEach(s=>{i.parentMap.delete(s.id)});const a=i.parentMap.get(e);a&&i.childrenMap.get(a.id)?.delete(t),i.parentMap.delete(e),i.childrenMap.delete(e)}),this.bothEdgesMap.delete(e),this.inEdgesMap.delete(e),this.outEdgesMap.delete(e),this.changes.push({type:"NodeRemoved",value:t})}removeNodes(e){this.batch(()=>{e.forEach(t=>this.doRemoveNode(t))})}removeNode(e){this.removeNodes([e])}updateNodeDataProperty(e,t,n){const i=this.getNode(e);this.batch(()=>{const a=i.data[t],s=n;i.data[t]=s,this.changes.push({type:"NodeDataUpdated",id:e,propertyName:t,oldValue:a,newValue:s})})}mergeNodeData(e,t){this.batch(()=>{Object.entries(t).forEach(([n,i])=>{this.updateNodeDataProperty(e,n,i)})})}updateNodeData(...e){const t=e[0],n=this.getNode(t);if(typeof e[1]=="string"){this.updateNodeDataProperty(t,e[1],e[2]);return}let i;if(typeof e[1]=="function"){const a=e[1];i=a(n.data)}else typeof e[1]=="object"&&(i=e[1]);this.batch(()=>{const a=n.data,s=i;n.data=i,this.changes.push({type:"NodeDataUpdated",id:t,oldValue:a,newValue:s})})}checkEdgeExistence(e){if(!this.hasEdge(e))throw new Error("Edge not found for id: "+e)}hasEdge(e){return this.edgeMap.has(e)}getEdge(e){return this.checkEdgeExistence(e),this.edgeMap.get(e)}getEdgeDetail(e){const t=this.getEdge(e);return{edge:t,source:this.getNode(t.source),target:this.getNode(t.target)}}doAddEdge(e){if(this.hasEdge(e.id))throw new Error("Edge already exists: "+e.id);this.checkNodeExistence(e.source),this.checkNodeExistence(e.target),this.edgeMap.set(e.id,e);const t=this.inEdgesMap.get(e.target),n=this.outEdgesMap.get(e.source),i=this.bothEdgesMap.get(e.source),a=this.bothEdgesMap.get(e.target);t.add(e),n.add(e),i.add(e),a.add(e),this.changes.push({type:"EdgeAdded",value:e})}addEdges(e){this.batch(()=>{for(const t of e)this.doAddEdge(t)})}addEdge(e){this.addEdges([e])}doRemoveEdge(e){const t=this.getEdge(e),n=this.outEdgesMap.get(t.source),i=this.inEdgesMap.get(t.target),a=this.bothEdgesMap.get(t.source),s=this.bothEdgesMap.get(t.target);n.delete(t),i.delete(t),a.delete(t),s.delete(t),this.edgeMap.delete(e),this.changes.push({type:"EdgeRemoved",value:t})}removeEdges(e){this.batch(()=>{e.forEach(t=>this.doRemoveEdge(t))})}removeEdge(e){this.removeEdges([e])}updateEdgeSource(e,t){const n=this.getEdge(e);this.checkNodeExistence(t);const i=n.source,a=t;this.outEdgesMap.get(i).delete(n),this.bothEdgesMap.get(i).delete(n),this.outEdgesMap.get(a).add(n),this.bothEdgesMap.get(a).add(n),n.source=t,this.batch(()=>{this.changes.push({type:"EdgeUpdated",id:e,propertyName:"source",oldValue:i,newValue:a})})}updateEdgeTarget(e,t){const n=this.getEdge(e);this.checkNodeExistence(t);const i=n.target,a=t;this.inEdgesMap.get(i).delete(n),this.bothEdgesMap.get(i).delete(n),this.inEdgesMap.get(a).add(n),this.bothEdgesMap.get(a).add(n),n.target=t,this.batch(()=>{this.changes.push({type:"EdgeUpdated",id:e,propertyName:"target",oldValue:i,newValue:a})})}updateEdgeDataProperty(e,t,n){const i=this.getEdge(e);this.batch(()=>{const a=i.data[t],s=n;i.data[t]=s,this.changes.push({type:"EdgeDataUpdated",id:e,propertyName:t,oldValue:a,newValue:s})})}updateEdgeData(...e){const t=e[0],n=this.getEdge(t);if(typeof e[1]=="string"){this.updateEdgeDataProperty(t,e[1],e[2]);return}let i;if(typeof e[1]=="function"){const a=e[1];i=a(n.data)}else typeof e[1]=="object"&&(i=e[1]);this.batch(()=>{const a=n.data,s=i;n.data=i,this.changes.push({type:"EdgeDataUpdated",id:t,oldValue:a,newValue:s})})}mergeEdgeData(e,t){this.batch(()=>{Object.entries(t).forEach(([n,i])=>{this.updateEdgeDataProperty(e,n,i)})})}checkTreeExistence(e){if(!this.hasTreeStructure(e))throw new Error("Tree structure not found for treeKey: "+e)}hasTreeStructure(e){return this.treeIndices.has(e)}attachTreeStructure(e){this.treeIndices.has(e)||(this.treeIndices.set(e,{parentMap:new Map,childrenMap:new Map}),this.batch(()=>{this.changes.push({type:"TreeStructureAttached",treeKey:e})}))}detachTreeStructure(e){this.checkTreeExistence(e),this.treeIndices.delete(e),this.batch(()=>{this.changes.push({type:"TreeStructureDetached",treeKey:e})})}addTree(e,t){this.batch(()=>{this.attachTreeStructure(t);const n=[],i=Array.isArray(e)?e:[e];for(;i.length;){const a=i.shift();n.push(a),a.children&&i.push(...a.children)}this.addNodes(n),n.forEach(a=>{a.children?.forEach(s=>{this.setParent(s.id,a.id,t)})})})}getRoots(e){return this.checkTreeExistence(e),this.getAllNodes().filter(t=>!this.getParent(t.id,e))}getChildren(e,t){this.checkNodeExistence(e),this.checkTreeExistence(t);const i=this.treeIndices.get(t).childrenMap.get(e);return Array.from(i||[])}getParent(e,t){return this.checkNodeExistence(e),this.checkTreeExistence(t),this.treeIndices.get(t).parentMap.get(e)||null}getAncestors(e,t){const n=[];let i=this.getNode(e),a;for(;a=this.getParent(i.id,t);)n.push(a),i=a;return n}setParent(e,t,n){this.checkTreeExistence(n);const i=this.treeIndices.get(n);if(!i)return;const a=this.getNode(e),s=i.parentMap.get(e);if(s?.id===t)return;if(t==null){s&&i.childrenMap.get(s.id)?.delete(a),i.parentMap.delete(e);return}const o=this.getNode(t);i.parentMap.set(e,o),s&&i.childrenMap.get(s.id)?.delete(a);let A=i.childrenMap.get(o.id);A||(A=new Set,i.childrenMap.set(o.id,A)),A.add(a),this.batch(()=>{this.changes.push({type:"TreeStructureChanged",treeKey:n,nodeId:e,oldParentId:s?.id,newParentId:o.id})})}dfsTree(e,t,n){const i=a=>this.getChildren(a,n);return Uh(this.getNode(e),new Set,t,i)}bfsTree(e,t,n){const i=a=>this.getChildren(a,n);return Ev([this.getNode(e)],new Set,t,i)}getAllNodes(){return Array.from(this.nodeMap.values())}getAllEdges(){return Array.from(this.edgeMap.values())}bfs(e,t,n="out"){const i={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[n];return Ev([this.getNode(e)],new Set,t,i)}dfs(e,t,n="out"){const i={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[n];return Uh(this.getNode(e),new Set,t,i)}clone(){const e=this.getAllNodes().map(i=>({...i,data:{...i.data}})),t=this.getAllEdges().map(i=>({...i,data:{...i.data}})),n=new fP({nodes:e,edges:t});return this.treeIndices.forEach(({parentMap:i,childrenMap:a},s)=>{const o=new Map;i.forEach((l,c)=>{o.set(c,n.getNode(l.id))});const A=new Map;a.forEach((l,c)=>{A.set(c,new Set(Array.from(l).map(u=>n.getNode(u.id))))}),n.treeIndices.set(s,{parentMap:o,childrenMap:A})}),n}toJSON(){return JSON.stringify({nodes:this.getAllNodes(),edges:this.getAllEdges()})}createView(e){return new uW({graph:this,...e})}};class Ph{constructor(e,t){this.context=e,this.options=t||{}}}var hW=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{l(n.next(c))}catch(u){s(u)}}function A(c){try{l(n.throw(c))}catch(u){s(u)}}function l(c){c.done?a(c.value):i(c.value).then(o,A)}l((n=n.apply(r,e||[])).next())})},dW=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};function fW(r){const{type:e}=r;return["compact-box","mindmap","dendrogram","indented"].includes(e)}function gW(r){return!Array.isArray(r)&&r?.preLayout}function Rh(r){const{nodes:e,edges:t}=r,n={nodes:[],edges:[],combos:[]};return e.forEach(i=>{const a=i.data._isCombo?n.combos:n.nodes,{x:s,y:o,z:A=0}=i.data;a?.push({id:i.id,style:{x:s,y:o,z:A}})}),t.forEach(i=>{const{id:a,source:s,target:o,data:{points:A=[],controlPoints:l=A.slice(1,A.length-1)}}=i;n.edges.push({id:a,source:s,target:o,style:Object.assign({},l?.length?{controlPoints:l.map(zn)}:{})})}),n}function pW(r,e){class t extends Ph{constructor(i,a){if(super(i,a),this.instance=new r({}),this.id=this.instance.id,"stop"in this.instance&&"tick"in this.instance){const s=this.instance;this.stop=s.stop.bind(s),this.tick=o=>{const A=s.tick(o);return Rh(A)}}}execute(i,a){return hW(this,void 0,void 0,function*(){return Rh(yield this.instance.execute(this.graphData2LayoutModel(i),this.transformOptions(Rn({},this.options,a))))})}transformOptions(i){if(!("onTick"in i))return i;const a=i.onTick;return i.onTick=s=>a(Rh(s)),i}graphData2LayoutModel(i){const{nodes:a=[],edges:s=[],combos:o=[]}=i,A=a.map(d=>{const f=X(d),{data:g,style:p,combo:v}=d,y=dW(d,["data","style","combo"]),m={id:f,data:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},g),{data:g}),v?{parentId:v}:{}),{style:p}),y)};return p?.x&&Object.assign(m.data,{x:p.x}),p?.y&&Object.assign(m.data,{y:p.y}),p?.z&&Object.assign(m.data,{z:p.z}),m}),l=new Map(A.map(d=>[d.id,d])),c=s.filter(d=>{const{source:f,target:g}=d;return l.has(f)&&l.has(g)}).map(d=>{const{source:f,target:g,data:p,style:v}=d;return{id:X(d),source:f,target:g,data:Object.assign({},p),style:Object.assign({},v)}}),u=o.map(d=>({id:X(d),data:Object.assign({_isCombo:!0},d.data),style:Object.assign({},d.style)})),h=new Tn({nodes:[...A,...u],edges:c});return e.model.model.hasTreeStructure(Ft)&&(h.attachTreeStructure(Ft),A.forEach(d=>{const f=e.model.model.getParent(d.id,Ft);f&&h.hasNode(f.id)&&h.setParent(d.id,f.id,Ft)})),h}}return t}function xv(r,e,...t){if(e in r)return r[e](...t);if("instance"in r){const n=r.instance;if(e in n)return n[e](...t)}return null}function QF(r,e){if(e in r)return r[e];if("instance"in r){const t=r.instance;if(e in t)return t[e]}return null}var vW=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{l(n.next(c))}catch(u){s(u)}}function A(c){try{l(n.throw(c))}catch(u){s(u)}}function l(c){c.done?a(c.value):i(c.value).then(o,A)}l((n=n.apply(r,e||[])).next())})};class yW extends xl{get forceLayoutInstance(){return this.context.layout.getLayoutInstance().find(e=>["d3-force","d3-force-3d"].includes(e?.id))}validate(e){return this.context.layout?this.forceLayoutInstance?super.validate(e):($i.warn("DragElementForce only works with d3-force or d3-force-3d layout"),!1):!1}moveElement(e,t){return vW(this,void 0,void 0,function*(){const n=this.forceLayoutInstance;this.context.graph.getNodeData(e).forEach((i,a)=>{const{x:s=0,y:o=0}=i.style||{};n&&xv(n,"setFixedPosition",e[a],[...Ve([+s,+o],this.clampByRotation(t))])})})}onDragStart(e){if(this.enable=this.validate(e),!this.enable)return;this.target=this.getSelectedNodeIDs([e.target.id]),this.hideEdge(),this.context.graph.frontElement(this.target);const t=this.forceLayoutInstance;t&&QF(t,"simulation").alphaTarget(.3).restart(),this.context.graph.getNodeData(this.target).forEach(n=>{const{x:i=0,y:a=0}=n.style||{};t&&xv(t,"setFixedPosition",X(n),[+i,+a])})}onDrag(e){if(!this.enable)return;const t=this.getDelta(e);this.moveElement(this.target,t)}onDragEnd(){const e=this.forceLayoutInstance;e&&QF(e,"simulation").alphaTarget(0),!this.options.fixed&&this.context.graph.getNodeData(this.target).forEach(t=>{e&&xv(e,"setFixedPosition",X(t),[null,null,null])})}}var UF=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{l(n.next(c))}catch(u){s(u)}}function A(c){try{l(n.throw(c))}catch(u){s(u)}}function l(c){c.done?a(c.value):i(c.value).then(o,A)}l((n=n.apply(r,e||[])).next())})};class Dh extends Hr{constructor(e,t){super(e,Object.assign({},Dh.defaultOptions,t)),this.isZoomEvent=n=>!!(n.data&&"scale"in n.data),this.relatedEdgeToUpdate=new Set,this.zoom=this.context.graph.getZoom(),this.fixElementSize=n=>UF(this,void 0,void 0,function*(){if(!this.validate(n))return;const{graph:i}=this.context,{state:a,nodeFilter:s,edgeFilter:o,comboFilter:A}=this.options,l=(a?i.getElementDataByState("node",a):i.getNodeData()).filter(s),c=(a?i.getElementDataByState("edge",a):i.getEdgeData()).filter(o),u=(a?i.getElementDataByState("combo",a):i.getComboData()).filter(A),h=this.isZoomEvent(n)?this.zoom=Math.max(.01,Math.min(n.data.scale,10)):this.zoom,d=[...l,...u];d.length>0&&d.forEach(f=>this.fixNodeLike(f,h)),this.updateRelatedEdges(),c.length>0&&c.forEach(f=>this.fixEdge(f,h))}),this.cachedStyles=new Map,this.getOriginalFieldValue=(n,i,a)=>{var s;const o=this.cachedStyles.get(n)||[],A=((s=o.find(l=>l.shape===i))===null||s===void 0?void 0:s.style)||{};return a in A||(A[a]=i.attributes[a],this.cachedStyles.set(n,[...o.filter(l=>l.shape!==i),{shape:i,style:A}])),A[a]},this.scaleEntireElement=(n,i,a)=>{i.setLocalScale(1/a);const s=this.cachedStyles.get(n)||[];s.push({shape:i}),this.cachedStyles.set(n,s)},this.scaleSpecificShapes=(n,i,a)=>{const s=Tj(n);(Array.isArray(a)?a:[a]).forEach(A=>{const{shape:l,fields:c}=A,u=typeof l=="function"?l(s):n.getShape(l);if(u){if(!c){this.scaleEntireElement(n.id,u,i);return}c.forEach(h=>{const d=this.getOriginalFieldValue(n.id,u,h);Be(d)&&(u.style[h]=d/i)})}})},this.skipIfExceedViewport=n=>{const{viewport:i}=this.context;return!i?.isInViewport(n.getRenderBounds(),!1,30)},this.fixNodeLike=(n,i)=>{const a=X(n),{element:s,model:o}=this.context,A=s.getElement(a);if(!A||this.skipIfExceedViewport(A))return;o.getRelatedEdgesData(a).forEach(u=>this.relatedEdgeToUpdate.add(X(u)));const c=this.options[A.type];if(!c){this.scaleEntireElement(a,A,i);return}this.scaleSpecificShapes(A,i,c)},this.fixEdge=(n,i)=>{const a=X(n),s=this.context.element.getElement(a);if(!s||this.skipIfExceedViewport(s))return;const o=this.options.edge;if(!o){s.style.transformOrigin="center",this.scaleEntireElement(a,s,i);return}this.scaleSpecificShapes(s,i,o)},this.updateRelatedEdges=()=>{const{element:n}=this.context;this.relatedEdgeToUpdate.size>0&&this.relatedEdgeToUpdate.forEach(i=>{const a=n.getElement(i);a?.update({})}),this.relatedEdgeToUpdate.clear()},this.resetTransform=n=>UF(this,void 0,void 0,function*(){var i;!((i=n.data)===null||i===void 0)&&i.firstRender||(this.options.reset?this.restoreCachedStyles():this.fixElementSize({data:{scale:this.zoom}}))}),this.bindEvents()}restoreCachedStyles(){if(this.cachedStyles.size>0){this.cachedStyles.forEach(i=>{i.forEach(({shape:a,style:s})=>{if(Ui(s))a.setLocalScale(1);else{if(this.options.state)return;Object.entries(s).forEach(([o,A])=>a.style[o]=A)}})});const{graph:e,element:t}=this.context,n=Object.keys(Object.fromEntries(this.cachedStyles)).filter(i=>i&&e.getElementType(i)==="node");if(n.length>0){const i=new Set;n.forEach(a=>{e.getRelatedEdgesData(a).forEach(s=>i.add(X(s)))}),i.forEach(a=>{const s=t?.getElement(a);s?.update({})})}}}bindEvents(){const{graph:e}=this.context;e.on(fe.AFTER_DRAW,this.resetTransform),e.on(fe.AFTER_TRANSFORM,this.fixElementSize)}unbindEvents(){const{graph:e}=this.context;e.off(fe.AFTER_DRAW,this.resetTransform),e.off(fe.AFTER_TRANSFORM,this.fixElementSize)}validate(e){if(this.destroyed)return!1;const{enable:t}=this.options;return Te(t)?t(e):!!t}destroy(){this.unbindEvents(),super.destroy()}}Dh.defaultOptions={enable:r=>r.data.scale<1,nodeFilter:()=>!0,edgeFilter:()=>!0,comboFilter:()=>!0,edge:[{shape:"key",fields:["lineWidth"]},{shape:"halo",fields:["lineWidth"]},{shape:"label"}],reset:!1};var mW=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{l(n.next(c))}catch(u){s(u)}}function A(c){try{l(n.throw(c))}catch(u){s(u)}}function l(c){c.done?a(c.value):i(c.value).then(o,A)}l((n=n.apply(r,e||[])).next())})};class Hh extends Hr{constructor(e,t){super(e,Object.assign({},Hh.defaultOptions,t)),this.focus=n=>mW(this,void 0,void 0,function*(){if(!this.validate(n))return;const{graph:i}=this.context;yield i.focusElement(n.target.id,this.options.animation)}),this.shortcut=new es(e.graph),this.bindEvents()}bindEvents(){const{graph:e}=this.context;this.unbindEvents(),zs.forEach(t=>{e.on(`${t}:${ie.CLICK}`,this.focus)})}validate(e){if(this.destroyed||!this.isKeydown())return!1;const{enable:t}=this.options;return Te(t)?t(e):!!t}isKeydown(){const{trigger:e}=this.options;return e?.length?this.shortcut.match(e):!0}unbindEvents(){const{graph:e}=this.context;zs.forEach(t=>{e.off(`${t}:${ie.CLICK}`,this.focus)})}destroy(){this.unbindEvents(),this.shortcut.destroy(),super.destroy()}}Hh.defaultOptions={animation:{easing:"ease-in",duration:500},enable:!0,trigger:[]};class Gh extends Hr{constructor(e,t){super(e,Object.assign({},Gh.defaultOptions,t)),this.isFrozen=!1,this.toggleFrozen=n=>{this.isFrozen=n.type==="dragstart"},this.hoverElement=n=>{if(!this.validate(n))return;const i=n.type===ie.POINTER_ENTER;this.updateElementsState(n,i);const{onHover:a,onHoverEnd:s}=this.options;i?a?.(n):s?.(n)},this.updateElementsState=(n,i)=>{if(!this.options.state&&!this.options.inactiveState)return;const{graph:a}=this.context,{state:s,animation:o,inactiveState:A}=this.options,l=this.getActiveIds(n),c={};if(s&&Object.assign(c,this.getElementsState(l,s,i)),A){const u=SS(a.getData(),!0).filter(h=>!l.includes(h));Object.assign(c,this.getElementsState(u,A,i))}a.setElementState(c,o)},this.getElementsState=(n,i,a)=>{const{graph:s}=this.context,o={};return n.forEach(A=>{const l=s.getElementState(A);a?o[A]=l.includes(i)?l:[...l,i]:o[A]=l.filter(c=>c!==i)}),o},this.bindEvents()}bindEvents(){const{graph:e}=this.context;this.unbindEvents(),zs.forEach(n=>{e.on(`${n}:${ie.POINTER_ENTER}`,this.hoverElement),e.on(`${n}:${ie.POINTER_LEAVE}`,this.hoverElement)});const t=this.context.canvas.document;t.addEventListener(`${ie.DRAG_START}`,this.toggleFrozen),t.addEventListener(`${ie.DRAG_END}`,this.toggleFrozen)}getActiveIds(e){const{graph:t}=this.context,{degree:n,direction:i}=this.options,a=e.target.id;return n?HS(t,e.targetType,a,typeof n=="function"?n(e):n,i):[a]}validate(e){if(this.destroyed||this.isFrozen||bl(e.target)||this.context.graph.isCollapsingExpanding)return!1;const{enable:t}=this.options;return Te(t)?t(e):!!t}unbindEvents(){const{graph:e}=this.context;zs.forEach(n=>{e.off(`${n}:${ie.POINTER_ENTER}`,this.hoverElement),e.off(`${n}:${ie.POINTER_LEAVE}`,this.hoverElement)});const t=this.context.canvas.document;t.removeEventListener(`${ie.DRAG_START}`,this.toggleFrozen),t.removeEventListener(`${ie.DRAG_END}`,this.toggleFrozen)}destroy(){this.unbindEvents(),super.destroy()}}Gh.defaultOptions={animation:!1,enable:!0,degree:0,direction:"both",state:"active",inactiveState:void 0};class wW extends fl{onPointerDown(e){if(!super.validate(e)||!super.isKeydown()||this.points)return;const{canvas:t,graph:n}=this.context;this.pathShape=new tr({id:"g6-lasso-select",style:this.options.style}),t.appendChild(this.pathShape),this.points=[oh(e,n)]}onPointerMove(e){var t;if(!this.points)return;const{immediately:n,mode:i}=this.options;this.points.push(oh(e,this.context.graph)),(t=this.pathShape)===null||t===void 0||t.setAttribute("d",Ej(this.points)),n&&i==="default"&&this.points.length>2&&super.updateElementsStates(this.points)}onPointerUp(){if(this.points){if(this.points.length<2){this.clearLasso();return}super.updateElementsStates(this.points),this.clearLasso()}}clearLasso(){var e;(e=this.pathShape)===null||e===void 0||e.remove(),this.pathShape=void 0,this.points=void 0}}class Kh extends Hr{constructor(e,t){super(e,Object.assign({},Kh.defaultOptions,t)),this.hiddenShapes=[],this.isVisible=!0,this.setElementsVisibility=(n,i,a)=>{n.filter(Boolean).forEach(s=>{i==="hidden"&&!s.isVisible()?this.hiddenShapes.push(s):i==="visible"&&this.hiddenShapes.includes(s)?this.hiddenShapes.splice(this.hiddenShapes.indexOf(s),1):Gs(s,i,a)})},this.filterShapes=(n,i)=>{if(Te(i))return s=>!i(n,s);const a=i?.[n];return s=>s.className?!a?.includes(s.className):!0},this.hideShapes=n=>{if(!this.validate(n)||!this.isVisible)return;const{element:i}=this.context,{shapes:a={}}=this.options;this.setElementsVisibility(i.getNodes(),"hidden",this.filterShapes("node",a)),this.setElementsVisibility(i.getEdges(),"hidden",this.filterShapes("edge",a)),this.setElementsVisibility(i.getCombos(),"hidden",this.filterShapes("combo",a)),this.isVisible=!1},this.showShapes=wA(n=>{if(!this.validate(n)||this.isVisible)return;const{element:i}=this.context;this.setElementsVisibility(i.getNodes(),"visible"),this.setElementsVisibility(i.getEdges(),"visible"),this.setElementsVisibility(i.getCombos(),"visible"),this.isVisible=!0},this.options.debounce),this.bindEvents()}bindEvents(){const{graph:e}=this.context;e.on(fe.BEFORE_TRANSFORM,this.hideShapes),e.on(fe.AFTER_TRANSFORM,this.showShapes)}unbindEvents(){const{graph:e}=this.context;e.off(fe.BEFORE_TRANSFORM,this.hideShapes),e.off(fe.AFTER_TRANSFORM,this.showShapes)}validate(e){if(this.destroyed)return!1;const{enable:t}=this.options;return Te(t)?t(e):!!t}update(e){this.unbindEvents(),super.update(e),this.bindEvents()}destroy(){this.unbindEvents(),super.destroy()}}Kh.defaultOptions={enable:!0,debounce:200,shapes:r=>r==="node"};var PF=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{l(n.next(c))}catch(u){s(u)}}function A(c){try{l(n.throw(c))}catch(u){s(u)}}function l(c){c.done?a(c.value):i(c.value).then(o,A)}l((n=n.apply(r,e||[])).next())})};class zh extends Hr{constructor(e,t){super(e,Object.assign({},zh.defaultOptions,t)),this.onWheel=n=>PF(this,void 0,void 0,function*(){this.options.preventDefault&&n.preventDefault();const i=n.deltaX,a=n.deltaY;yield this.scroll([-i,-a],n)}),this.shortcut=new es(e.graph),this.bindEvents()}update(e){super.update(e),this.bindEvents()}bindEvents(){var e,t;const{trigger:n}=this.options;if(this.shortcut.unbindAll(),on(n)){(e=this.graphDom)===null||e===void 0||e.removeEventListener(ie.WHEEL,this.onWheel);const{up:i=[],down:a=[],left:s=[],right:o=[]}=n;this.shortcut.bind(i,A=>this.scroll([0,-10],A)),this.shortcut.bind(a,A=>this.scroll([0,10],A)),this.shortcut.bind(s,A=>this.scroll([-10,0],A)),this.shortcut.bind(o,A=>this.scroll([10,0],A))}else(t=this.graphDom)===null||t===void 0||t.addEventListener(ie.WHEEL,this.onWheel,{passive:!1})}get graphDom(){return this.context.graph.getCanvas().getContextService().getDomElement()}formatDisplacement(e){const{sensitivity:t}=this.options;return e=Bi(e,t),e=this.clampByDirection(e),e=this.clampByRange(e),e}clampByDirection([e,t]){const{direction:n}=this.options;return n==="x"?t=0:n==="y"&&(e=0),[e,t]}clampByRange([e,t]){const{viewport:n,canvas:i}=this.context,[a,s]=i.getSize(),[o,A,l,c]=si(this.options.range),u=[s*o,a*A,s*l,a*c],h=Ya(Wp(n.getCanvasCenter()),u),d=bt(n.getViewportCenter(),[e,t,0]);if(!wi(d,h)){const{min:[f,g],max:[p,v]}=h;(d[0]<f&&e>0||d[0]>p&&e<0)&&(e=0),(d[1]<g&&t>0||d[1]>v&&t<0)&&(t=0)}return[e,t]}scroll(e,t){return PF(this,void 0,void 0,function*(){if(!this.validate(t))return;const{onFinish:n}=this.options,i=this.context.graph,a=this.formatDisplacement(e);yield i.translateBy(a,!1),n?.()})}validate(e){if(this.destroyed)return!1;const{enable:t}=this.options;return Te(t)?t(e):!!t}destroy(){var e;this.shortcut.destroy(),(e=this.graphDom)===null||e===void 0||e.removeEventListener(ie.WHEEL,this.onWheel),super.destroy()}}zh.defaultOptions={enable:!0,sensitivity:1,preventDefault:!0,range:1/0};var RF=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{l(n.next(c))}catch(u){s(u)}}function A(c){try{l(n.throw(c))}catch(u){s(u)}}function l(c){c.done?a(c.value):i(c.value).then(o,A)}l((n=n.apply(r,e||[])).next())})};class Vh extends Hr{constructor(e,t){super(e,Object.assign({},Vh.defaultOptions,t)),this.zoom=(n,i,a)=>RF(this,void 0,void 0,function*(){if(!this.validate(i))return;const{graph:s}=this.context;let o=this.options.origin;!o&&"viewport"in i&&(o=zn(i.viewport));const{sensitivity:A,onFinish:l}=this.options,c=1+Yt(n,-50,50)*A/100,u=s.getZoom();yield s.zoomTo(u*c,a,o),l?.()}),this.onReset=()=>RF(this,void 0,void 0,function*(){yield this.context.graph.zoomTo(1,this.options.animation)}),this.preventDefault=n=>{this.options.preventDefault&&n.preventDefault()},this.shortcut=new es(e.graph),this.bindEvents()}update(e){super.update(e),this.bindEvents()}bindEvents(){const{trigger:e}=this.options;if(this.shortcut.unbindAll(),Array.isArray(e))if(e.includes(ie.PINCH))this.shortcut.bind([ie.PINCH],t=>{this.zoom(t.scale,t,!1)});else{const t=this.context.canvas.getContainer();t?.addEventListener(ie.WHEEL,this.preventDefault),this.shortcut.bind([...e,ie.WHEEL],n=>{const{deltaX:i,deltaY:a}=n;this.zoom(-(a??i),n,!1)})}if(typeof e=="object"){const{zoomIn:t=[],zoomOut:n=[],reset:i=[]}=e;this.shortcut.bind(t,a=>this.zoom(10,a,this.options.animation)),this.shortcut.bind(n,a=>this.zoom(-10,a,this.options.animation)),this.shortcut.bind(i,this.onReset)}}validate(e){if(this.destroyed)return!1;const{enable:t}=this.options;return Te(t)?t(e):!!t}destroy(){var e;this.shortcut.destroy(),(e=this.context.canvas.getContainer())===null||e===void 0||e.removeEventListener(ie.WHEEL,this.preventDefault),super.destroy()}}Vh.defaultOptions={animation:{duration:200},enable:!0,sensitivity:1,trigger:[],preventDefault:!0};function DF(r,e,t,n="height"){const i=r[n],a=e[n];return t==="center"?(i+a)/2:r.height}const qs=Object.assign,BW={getId:r=>r.id||r.name,getPreH:r=>r.preH||0,getPreV:r=>r.preV||0,getHGap:r=>r.hgap||18,getVGap:r=>r.vgap||18,getChildren:r=>r.children,getHeight:r=>r.height||36,getWidth(r){const e=r.label||" ";return r.width||18*e.split("").length}};class jh{constructor(e,t){if(this.x=0,this.y=0,this.depth=0,this.children=[],this.hgap=0,this.vgap=0,e instanceof jh||"x"in e&&"y"in e&&"children"in e){const a=e;return this.data=a.data,this.id=a.id,this.x=a.x,this.y=a.y,this.width=a.width,this.height=a.height,this.depth=a.depth,this.children=a.children,this.parent=a.parent,this.hgap=a.hgap,this.vgap=a.vgap,this.preH=a.preH,void(this.preV=a.preV)}this.data=e;const n=t.getHGap(e),i=t.getVGap(e);this.preH=t.getPreH(e),this.preV=t.getPreV(e),this.width=t.getWidth(e),this.height=t.getHeight(e),this.width+=this.preH,this.height+=this.preV,this.id=t.getId(e),this.addGap(n,i)}isRoot(){return this.depth===0}isLeaf(){return this.children.length===0}addGap(e,t){this.hgap+=e,this.vgap+=t,this.width+=2*e,this.height+=2*t}eachNode(e){let t,n=[this];for(;t=n.shift();)e(t),n=t.children.concat(n)}DFTraverse(e){this.eachNode(e)}BFTraverse(e){let t,n=[this];for(;t=n.shift();)e(t),n=n.concat(t.children)}getBoundingBox(){const e={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode(t=>{e.left=Math.min(e.left,t.x),e.top=Math.min(e.top,t.y),e.width=Math.max(e.width,t.x+t.width),e.height=Math.max(e.height,t.y+t.height)}),e}translate(e=0,t=0){this.eachNode(n=>{n.x+=e,n.y+=t,n.x+=n.preH,n.y+=n.preV})}right2left(){const e=this.getBoundingBox();this.eachNode(t=>{t.x=t.x-2*(t.x-e.left)-t.width}),this.translate(e.width,0)}bottom2top(){const e=this.getBoundingBox();this.eachNode(t=>{t.y=t.y-2*(t.y-e.top)-t.height}),this.translate(0,e.height)}}function Cv(r,e={},t){e=qs({},BW,e);const n=new jh(r,e),i=[n];let a;if(!t&&!r.collapsed){for(;a=i.shift();)if(!a.data.collapsed){const s=e.getChildren(a.data),o=s?s.length:0;if(a.children=new Array(o),s&&o)for(let A=0;A<o;A++){const l=new jh(s[A],e);a.children[A]=l,i.push(l),l.parent=a,l.depth=a.depth+1}}}return n}class Wh{constructor(e,t={}){this.options=t,this.rootNode=Cv(e,t)}execute(){throw new Error("please override this method")}}let bW=class kf{constructor(e=0,t=0,n=0,i=[]){this.x=0,this.prelim=0,this.mod=0,this.shift=0,this.change=0,this.tl=null,this.tr=null,this.el=null,this.er=null,this.msel=0,this.mser=0,this.w=e||0,this.h=t||0,this.y=n||0,this.c=i||[],this.cs=i.length}static fromNode(e,t){if(!e)return null;const n=[];return e.children.forEach(i=>{const a=kf.fromNode(i,t);a&&n.push(a)}),t?new kf(e.height,e.width,e.x,n):new kf(e.width,e.height,e.y,n)}};function HF(r,e,t){t?r.y+=e:r.x+=e,r.children.forEach(n=>{HF(n,e,t)})}function GF(r,e){let t=e?r.y:r.x;return r.children.forEach(n=>{t=Math.min(GF(n,e),t)}),t}function EW(r,e){HF(r,-GF(r,e),e)}function KF(r,e,t){t?e.y=r.x:e.x=r.x,r.c.forEach((n,i)=>{KF(n,e.children[i],t)})}function zF(r,e,t=0){e?(r.x=t,t+=r.width):(r.y=t,t+=r.height),r.children.forEach(n=>{zF(n,e,t)})}function xW(r,e={}){const t=e.isHorizontal;function n(u){u.cs===0?(u.el=u,u.er=u,u.msel=u.mser=0):(u.el=u.c[0].el,u.msel=u.c[0].msel,u.er=u.c[u.cs-1].er,u.mser=u.c[u.cs-1].mser)}function i(u,h,d){let f=u.c[h-1],g=f.mod,p=u.c[h],v=p.mod;for(;f!==null&&p!==null;){d&&A(f)>d.low&&(d=d.nxt);const y=g+f.prelim+f.w-(v+p.prelim);y>0&&(v+=y,d&&a(u,h,d.index,y));const m=A(f),B=A(p);m<=B&&(f=o(f),f!==null&&(g+=f.mod)),m>=B&&(p=s(p),p!==null&&(v+=p.mod))}!f&&p?(function(y,m,B,C){const S=y.c[0].el;S.tl=B;const F=C-B.mod-y.c[0].msel;S.mod+=F,S.prelim-=F,y.c[0].el=y.c[m].el,y.c[0].msel=y.c[m].msel})(u,h,p,v):f&&!p&&(function(y,m,B,C){const S=y.c[m].er;S.tr=B;const F=C-B.mod-y.c[m].mser;S.mod+=F,S.prelim-=F,y.c[m].er=y.c[m-1].er,y.c[m].mser=y.c[m-1].mser})(u,h,f,g)}function a(u,h,d,f){u.c[h].mod+=f,u.c[h].msel+=f,u.c[h].mser+=f,(function(g,p,v,y){if(v!==p-1){const m=p-v;g.c[v+1].shift+=y/m,g.c[p].shift-=y/m,g.c[p].change-=y-y/m}})(u,h,d,f)}function s(u){return u.cs===0?u.tl:u.c[0]}function o(u){return u.cs===0?u.tr:u.c[u.cs-1]}function A(u){return u.y+u.h}function l(u,h,d){for(;d!==null&&u>=d.low;)d=d.nxt;return{low:u,index:h,nxt:d}}zF(r,t);const c=bW.fromNode(r,t);return c&&((function u(h){if(h.cs===0)return void n(h);u(h.c[0]);let d=l(A(h.c[0].el),0,null);for(let f=1;f<h.cs;++f){u(h.c[f]);const g=A(h.c[f].er);i(h,f,d),d=l(g,f,d)}(function(f){f.prelim=(f.c[0].prelim+f.c[0].mod+f.c[f.cs-1].mod+f.c[f.cs-1].prelim+f.c[f.cs-1].w)/2-f.w/2})(h),n(h)})(c),(function u(h,d){d+=h.mod,h.x=h.prelim+d,(function(f){let g=0,p=0;for(let v=0;v<f.cs;v++)g+=f.c[v].shift,p+=g+f.c[v].change,f.c[v].mod+=p})(h);for(let f=0;f<h.cs;f++)u(h.c[f],d)})(c,0),KF(c,r,t),EW(r,t)),r}function VF(r,e){const t=Cv(r.data,e,!0),n=Cv(r.data,e,!0),i=r.children.length,a=Math.round(i/2),s=e.getSide||function(o,A){return A<a?"right":"left"};for(let o=0;o<i;o++){const A=r.children[o];s(A,o)==="right"?n.children.push(A):t.children.push(A)}return t.eachNode(o=>{o.isRoot()||(o.side="left")}),n.eachNode(o=>{o.isRoot()||(o.side="right")}),{left:t,right:n}}const as=["LR","RL","TB","BT","H","V"],CW=["LR","RL","H"],SW=as[0];function Sv(r,e,t){const n=e.direction||SW;if(e.isHorizontal=(a=>CW.indexOf(a)>-1)(n),as.indexOf(n)===-1)throw new TypeError(`Invalid direction: ${n}`);if(n===as[0])t(r,e);else if(n===as[1])t(r,e),r.right2left();else if(n===as[2])t(r,e);else if(n===as[3])t(r,e),r.bottom2top();else if(n===as[4]||n===as[5]){const{left:a,right:s}=VF(r,e);t(a,e),t(s,e),e.isHorizontal?a.right2left():a.bottom2top(),s.translate(a.x-s.x,a.y-s.y),r.x=a.x,r.y=s.y;const o=r.getBoundingBox();e.isHorizontal?o.top<0&&r.translate(0,-o.top):o.left<0&&r.translate(-o.left,0)}let i=e.fixedRoot;return i===void 0&&(i=!0),i&&r.translate(-(r.x+r.width/2+r.hgap),-(r.y+r.height/2+r.vgap)),(function(a,s){if(s.radial){const[o,A]=s.isHorizontal?["x","y"]:["y","x"],l={x:1/0,y:1/0},c={x:-1/0,y:-1/0};let u=0;a.DFTraverse(f=>{u++;const{x:g,y:p}=f;l.x=Math.min(l.x,g),l.y=Math.min(l.y,p),c.x=Math.max(c.x,g),c.y=Math.max(c.y,p)});const h=c[A]-l[A];if(h===0)return;const d=2*Math.PI/u;a.DFTraverse(f=>{const g=f[A],p=l[A],v=f[o],y=a[o],m=(g-p)/h*(2*Math.PI-d)+d,B=v-y;f.x=Math.cos(m)*B,f.y=Math.sin(m)*B})}})(r,e),r}let FW=class extends Wh{execute(){return Sv(this.rootNode,this.options,xW)}};const TW={};function MW(r,e){const t=qs({},TW,e);return new FW(r,t).execute()}let OW=class{constructor(e=0,t=[]){this.x=0,this.y=0,this.leftChild=null,this.rightChild=null,this.isLeaf=!1,this.height=e,this.children=t}};const IW={isHorizontal:!0,nodeSep:20,nodeSize:20,rankSep:200,subTreeSep:10};function jF(r,e,t){t?(e.x=r.x,e.y=r.y):(e.x=r.y,e.y=r.x),r.children.forEach((n,i)=>{jF(n,e.children[i],t)})}function _W(r,e={}){const t=qs({},IW,e);let n=0,i=null;const a=(function s(o){o.width=0,o.depth&&o.depth>n&&(n=o.depth);const A=o.children,l=A.length,c=new OW(0,[]);return A.forEach((u,h)=>{const d=s(u);c.children.push(d),h===0&&(c.leftChild=d),h===l-1&&(c.rightChild=d)}),c.originNode=o,c.isLeaf=o.isLeaf(),c})(r);return(function s(o){if(o.isLeaf||o.children.length===0)o.drawingDepth=n;else{const A=o.children.map(c=>s(c)),l=Math.min(...A);o.drawingDepth=l-1}return o.drawingDepth})(a),(function s(o){o.x=o.drawingDepth*t.rankSep,o.isLeaf?(o.y=0,i&&(o.y=i.y+i.height+t.nodeSep,o.originNode.parent!==i.originNode.parent&&(o.y+=t.subTreeSep)),i=o):(o.children.forEach(A=>{s(A)}),o.y=(o.leftChild.y+o.rightChild.y)/2)})(a),jF(a,r,t.isHorizontal),r}class kW extends Wh{execute(){return this.rootNode.width=0,Sv(this.rootNode,this.options,_W)}}const NW={};function LW(r,e){const t=qs({},NW,e);return new kW(r,t).execute()}function qh(r,e,t,n){let i=null;r.eachNode(a=>{(function(s,o,A,l,c){const u=(typeof A=="function"?A(s):A)*s.depth;if(!l)try{if(s.parent&&s.id===s.parent.children[0].id)return s.x+=u,void(s.y=o?o.y:0)}catch{}if(s.x+=u,o){if(s.y=o.y+DF(o,s,c),o.parent&&s.parent&&s.parent.id!==o.parent.id){const h=o.parent,d=h.y+DF(h,s,c);s.y=d>s.y?d:s.y}}else s.y=0})(a,i,e,t,n),i=a})}const Cl=["LR","RL","H"],QW=Cl[0];class UW extends Wh{execute(){const e=this.options,t=this.rootNode;e.isHorizontal=!0;const{indent:n=20,dropCap:i=!0,direction:a=QW,align:s}=e;if(a&&Cl.indexOf(a)===-1)throw new TypeError(`Invalid direction: ${a}`);if(a===Cl[0])qh(t,n,i,s);else if(a===Cl[1])qh(t,n,i,s),t.right2left();else if(a===Cl[2]){const{left:o,right:A}=VF(t,e);qh(o,n,i,s),o.right2left(),qh(A,n,i,s);const l=o.getBoundingBox();A.translate(l.width,0),t.x=A.x-t.width/2}return t}}const PW={};function RW(r,e){const t=qs({},PW,e);return new UW(r,t).execute()}function WF(r,e){let t=0;return r.children.length?r.children.forEach(n=>{t+=WF(n,e)}):t=r.height,r._subTreeSep=e.getSubTreeSep(r.data),r.totalHeight=Math.max(r.height,t)+2*r._subTreeSep,r.totalHeight}function qF(r){const e=r.children,t=e.length;if(t){e.forEach(o=>{qF(o)});const n=e[0],i=e[t-1],a=i.y-n.y+i.height;let s=0;if(e.forEach(o=>{s+=o.totalHeight}),a>r.height)r.y=n.y+a/2-r.height/2;else if(e.length!==1||r.height>s){const o=r.y+(r.height-a)/2-n.y;e.forEach(A=>{A.translate(0,o)})}else r.y=(n.y+n.height/2+i.y+i.height/2)/2-r.height/2}}const DW={getSubTreeSep:()=>0};function HW(r,e={}){return e=qs({},DW,e),r.parent={x:0,width:0,height:0,y:0},r.BFTraverse(t=>{t.x=t.parent.x+t.parent.width}),r.parent=void 0,WF(r,e),r.startY=0,r.y=r.totalHeight/2-r.height/2,r.eachNode(t=>{const n=t.children,i=n.length;if(i){const a=n[0];if(a.startY=t.startY+t._subTreeSep,i===1)a.y=t.y+t.height/2-a.height/2;else{a.y=a.startY+a.totalHeight/2-a.height/2;for(let s=1;s<i;s++){const o=n[s];o.startY=n[s-1].startY+n[s-1].totalHeight,o.y=o.startY+o.totalHeight/2-o.height/2}}}}),qF(r),r}class GW extends Wh{execute(){return Sv(this.rootNode,this.options,HW)}}const KW={};function zW(r,e){const t=qs({},KW,e);return new GW(r,t).execute()}const VW=(r,e)=>{if(r!=="next"&&r!=="prev")return e},$F=r=>{r.prev.next=r.next,r.next.prev=r.prev,delete r.next,delete r.prev};let jW=class{constructor(){const e={};e.prev=e,e.next=e.prev,this.shortcut=e}dequeue(){const e=this.shortcut,t=e.prev;if(t&&t!==e)return $F(t),t}enqueue(e){const t=this.shortcut;e.prev&&e.next&&$F(e),e.next=t.next,t.next.prev=e,t.next=e,e.prev=t}toString(){const e=[],t=this.shortcut;let n=t.prev;for(;n!==t;)e.push(JSON.stringify(n,VW)),n=n?.prev;return`[${e.join(", ")}]`}};class WW extends jW{}const qW=()=>1,$W=(r,e)=>{var t;if(r.getAllNodes().length<=1)return[];const n=XW(r,e||qW);return(t=YW(n.graph,n.buckets,n.zeroIdx).map(a=>r.getRelatedEdges(a.v,"out").filter(({target:s})=>s===a.w)))===null||t===void 0?void 0:t.flat()},YW=(r,e,t)=>{let n=[];const i=e[e.length-1],a=e[0];let s;for(;r.getAllNodes().length;){for(;s=a.dequeue();)Fv(r,e,t,s);for(;s=i.dequeue();)Fv(r,e,t,s);if(r.getAllNodes().length){for(let o=e.length-2;o>0;--o)if(s=e[o].dequeue(),s){n=n.concat(Fv(r,e,t,s,!0));break}}}return n},Fv=(r,e,t,n,i)=>{var a,s;const o=[];return r.hasNode(n.v)&&((a=r.getRelatedEdges(n.v,"in"))===null||a===void 0||a.forEach(A=>{const l=A.data.weight,c=r.getNode(A.source);i&&o.push({v:A.source,w:A.target,in:0,out:0}),c.data.out===void 0&&(c.data.out=0),c.data.out-=l,Tv(e,t,Object.assign({v:c.id},c.data))}),(s=r.getRelatedEdges(n.v,"out"))===null||s===void 0||s.forEach(A=>{const l=A.data.weight,c=A.target,u=r.getNode(c);u.data.in===void 0&&(u.data.in=0),u.data.in-=l,Tv(e,t,Object.assign({v:u.id},u.data))}),r.removeNode(n.v)),i?o:void 0},XW=(r,e)=>{const t=new Tn;let n=0,i=0;r.getAllNodes().forEach(A=>{t.addNode({id:A.id,data:{v:A.id,in:0,out:0}})}),r.getAllEdges().forEach(A=>{const l=t.getRelatedEdges(A.source,"out").find(u=>u.target===A.target),c=e?.(A)||1;l?t.updateEdgeData(l?.id,Object.assign(Object.assign({},l.data),{weight:l.data.weight+c})):t.addEdge({id:A.id,source:A.source,target:A.target,data:{weight:c}}),i=Math.max(i,t.getNode(A.source).data.out+=c),n=Math.max(n,t.getNode(A.target).data.in+=c)});const a=[],s=i+n+3;for(let A=0;A<s;A++)a.push(new WW);const o=n+1;return t.getAllNodes().forEach(A=>{Tv(a,o,Object.assign({v:A.id},t.getNode(A.id).data))}),{buckets:a,zeroIdx:o,graph:t}},Tv=(r,e,t)=>{t.out?t.in?r[t.out-t.in+e].enqueue(t):r[r.length-1].enqueue(t):r[0].enqueue(t)},ZW=(r,e)=>{const n=$W(r,(i=>a=>a.data.weight||1)());n?.forEach(i=>{const a=i.data;r.removeEdge(i.id),a.forwardName=i.data.name,a.reversed=!0,r.addEdge({id:i.id,source:i.target,target:i.source,data:Object.assign({},a)})})},JW=r=>{r.getAllEdges().forEach(e=>{const t=e.data;if(t.reversed){r.removeEdge(e.id);const n=t.forwardName;delete t.reversed,delete t.forwardName,r.addEdge({id:e.id,source:e.target,target:e.source,data:Object.assign(Object.assign({},t),{forwardName:n})})}})},eq=(r,e)=>Number(r)-Number(e),jo=(r,e,t,n)=>{let i;do i=`${n}${Math.random()}`;while(r.hasNode(i));return t.dummy=e,r.addNode({id:i,data:t}),i},tq=r=>{const e=new Tn;return r.getAllNodes().forEach(t=>{e.addNode(Object.assign({},t))}),r.getAllEdges().forEach(t=>{const n=e.getRelatedEdges(t.source,"out").find(i=>i.target===t.target);n?e.updateEdgeData(n?.id,Object.assign(Object.assign({},n.data),{weight:n.data.weight+t.data.weight||0,minlen:Math.max(n.data.minlen,t.data.minlen||1)})):e.addEdge({id:t.id,source:t.source,target:t.target,data:{weight:t.data.weight||0,minlen:t.data.minlen||1}})}),e},YF=r=>{const e=new Tn;return r.getAllNodes().forEach(t=>{r.getChildren(t.id).length||e.addNode(Object.assign({},t))}),r.getAllEdges().forEach(t=>{e.addEdge(t)}),e},nq=(r,e)=>r?.reduce((t,n,i)=>(t[n]=e[i],t),{}),XF=(r,e)=>{const t=Number(r.x),n=Number(r.y),i=Number(e.x)-t,a=Number(e.y)-n;let s=Number(r.width)/2,o=Number(r.height)/2;if(!i&&!a)return{x:0,y:0};let A,l;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),A=o*i/a,l=o):(i<0&&(s=-s),A=s,l=s*a/i),{x:t+A,y:n+l}},Sl=r=>{const e=[],t=JF(r)+1;for(let n=0;n<t;n++)e.push([]);r.getAllNodes().forEach(n=>{const i=n.data.rank;i!==void 0&&e[i]&&e[i].push(n.id)});for(let n=0;n<t;n++)e[n]=e[n].sort((i,a)=>eq(r.getNode(i).data.order,r.getNode(a).data.order));return e},rq=r=>{const e=r.getAllNodes().filter(n=>n.data.rank!==void 0).map(n=>n.data.rank),t=Math.min(...e);r.getAllNodes().forEach(n=>{n.data.hasOwnProperty("rank")&&t!==1/0&&(n.data.rank-=t)})},iq=(r,e=0)=>{const t=r.getAllNodes(),n=t.filter(o=>o.data.rank!==void 0).map(o=>o.data.rank),i=Math.min(...n),a=[];t.forEach(o=>{const A=(o.data.rank||0)-i;a[A]||(a[A]=[]),a[A].push(o.id)});let s=0;for(let o=0;o<a.length;o++){const A=a[o];A===void 0?o%e!==0&&(s-=1):s&&A?.forEach(l=>{const c=r.getNode(l);c&&(c.data.rank=c.data.rank||0,c.data.rank+=s)})}},ZF=(r,e,t,n)=>{const i={width:0,height:0};return Be(t)&&Be(n)&&(i.rank=t,i.order=n),jo(r,"border",i,e)},JF=r=>{let e;return r.getAllNodes().forEach(t=>{const n=t.data.rank;n!==void 0&&(e===void 0||n>e)&&(e=n)}),e||(e=0),e},aq=(r,e)=>{const t={lhs:[],rhs:[]};return r?.forEach(n=>{e(n)?t.lhs.push(n):t.rhs.push(n)}),t},Mv=(r,e)=>r.reduce((t,n)=>{const i=e(t),a=e(n);return i>a?n:t}),eT=(r,e,t,n,i,a)=>{n.includes(e.id)||(n.push(e.id),t||a.push(e.id),i(e.id).forEach(s=>eT(r,s,t,n,i,a)),t&&a.push(e.id))},tT=(r,e,t,n)=>{const i=Array.isArray(e)?e:[e],a=A=>r.getNeighbors(A),s=[],o=[];return i.forEach(A=>{if(r.hasNode(A.id))eT(r,A,t==="post",o,a,s);else throw new Error(`Graph does not have node: ${A}`)}),s},sq=r=>{const e=t=>{const n=r.getChildren(t),i=r.getNode(t);if(n?.length&&n.forEach(a=>e(a.id)),i.data.hasOwnProperty("minRank")){i.data.borderLeft=[],i.data.borderRight=[];for(let a=i.data.minRank,s=i.data.maxRank+1;a<s;a+=1)nT(r,"borderLeft","_bl",t,i,a),nT(r,"borderRight","_br",t,i,a)}};r.getRoots().forEach(t=>e(t.id))},nT=(r,e,t,n,i,a)=>{const s={rank:a,borderType:e,width:0,height:0},o=i.data[e][a-1],A=jo(r,"border",s,t);i.data[e][a]=A,r.setParent(A,n),o&&r.addEdge({id:`e${Math.random()}`,source:o,target:A,data:{weight:1}})},oq=(r,e)=>{const t=e.toLowerCase();(t==="lr"||t==="rl")&&rT(r)},Aq=(r,e)=>{const t=e.toLowerCase();(t==="bt"||t==="rl")&&lq(r),(t==="lr"||t==="rl")&&(cq(r),rT(r))},rT=r=>{r.getAllNodes().forEach(e=>{iT(e)}),r.getAllEdges().forEach(e=>{iT(e)})},iT=r=>{const e=r.data.width;r.data.width=r.data.height,r.data.height=e},lq=r=>{r.getAllNodes().forEach(e=>{Ov(e.data)}),r.getAllEdges().forEach(e=>{var t;(t=e.data.points)===null||t===void 0||t.forEach(n=>Ov(n)),e.data.hasOwnProperty("y")&&Ov(e.data)})},Ov=r=>{r?.y&&(r.y=-r.y)},cq=r=>{r.getAllNodes().forEach(e=>{Iv(e.data)}),r.getAllEdges().forEach(e=>{var t;(t=e.data.points)===null||t===void 0||t.forEach(n=>Iv(n)),e.data.hasOwnProperty("x")&&Iv(e.data)})},Iv=r=>{const e=r.x;r.x=r.y,r.y=e},uq=r=>{const e=jo(r,"root",{},"_root"),t=hq(r);let n=Math.max(...Object.values(t));Math.abs(n)===1/0&&(n=1);const i=n-1,a=2*i+1;r.getAllEdges().forEach(o=>{o.data.minlen*=a});const s=dq(r)+1;return r.getRoots().forEach(o=>{aT(r,e,a,s,i,t,o.id)}),{nestingRoot:e,nodeRankFactor:a}},aT=(r,e,t,n,i,a,s)=>{const o=r.getChildren(s);if(!o?.length){s!==e&&r.addEdge({id:`e${Math.random()}`,source:e,target:s,data:{weight:0,minlen:t}});return}const A=ZF(r,"_bt"),l=ZF(r,"_bb"),c=r.getNode(s);r.setParent(A,s),c.data.borderTop=A,r.setParent(l,s),c.data.borderBottom=l,o?.forEach(u=>{aT(r,e,t,n,i,a,u.id);const h=u.data.borderTop?u.data.borderTop:u.id,d=u.data.borderBottom?u.data.borderBottom:u.id,f=u.data.borderTop?n:2*n,g=h!==d?1:i-a[s]+1;r.addEdge({id:`e${Math.random()}`,source:A,target:h,data:{minlen:g,weight:f,nestingEdge:!0}}),r.addEdge({id:`e${Math.random()}`,source:d,target:l,data:{minlen:g,weight:f,nestingEdge:!0}})}),r.getParent(s)||r.addEdge({id:`e${Math.random()}`,source:e,target:A,data:{weight:0,minlen:i+a[s]}})},hq=r=>{const e={},t=(n,i)=>{const a=r.getChildren(n);a?.forEach(s=>t(s.id,i+1)),e[n]=i};return r.getRoots().forEach(n=>t(n.id,1)),e},dq=r=>{let e=0;return r.getAllEdges().forEach(t=>{e+=t.data.weight}),e},fq=(r,e)=>{e&&r.removeNode(e),r.getAllEdges().forEach(t=>{t.data.nestingEdge&&r.removeEdge(t.id)})},gq="edge",sT="edge-label",pq=(r,e)=>{r.getAllEdges().forEach(t=>vq(r,t,e))},vq=(r,e,t)=>{let n=e.source,i=r.getNode(n).data.rank;const a=e.target,s=r.getNode(a).data.rank,o=e.data.labelRank;if(s===i+1)return;r.removeEdge(e.id);let A,l,c;for(c=0,++i;i<s;++c,++i)e.data.points=[],l={originalEdge:e,width:0,height:0,rank:i},A=jo(r,gq,l,"_d"),i===o&&(l.width=e.data.width,l.height=e.data.height,l.dummy=sT,l.labelpos=e.data.labelpos),r.addEdge({id:`e${Math.random()}`,source:n,target:A,data:{weight:e.data.weight}}),c===0&&t.push(A),n=A;r.addEdge({id:`e${Math.random()}`,source:n,target:a,data:{weight:e.data.weight}})},yq=(r,e)=>{e.forEach(t=>{let n=r.getNode(t);const{data:i}=n,a=i.originalEdge;let s;a&&r.addEdge(a);let o=t;for(;n.data.dummy;)s=r.getSuccessors(o)[0],r.removeNode(o),a.data.points.push({x:n.data.x,y:n.data.y}),n.data.dummy===sT&&(a.data.x=n.data.x,a.data.y=n.data.y,a.data.width=n.data.width,a.data.height=n.data.height),o=s.id,n=r.getNode(o)})},mq=(r,e,t)=>{const n={};let i;t?.forEach(a=>{let s=r.getParent(a),o,A;for(;s;){if(o=r.getParent(s.id),o?(A=n[o.id],n[o.id]=s.id):(A=i,i=s.id),A&&A!==s.id){e.hasNode(A)||e.addNode({id:A,data:{}}),e.hasNode(s.id)||e.addNode({id:s.id,data:{}}),e.hasEdge(`e${A}-${s.id}`)||e.addEdge({id:`e${A}-${s.id}`,source:A,target:s.id,data:{}});return}s=o}})},wq=(r,e,t)=>{const n=Bq(r),i=new Tn({tree:[{id:n,children:[],data:{}}]});return r.getAllNodes().forEach(a=>{const s=r.getParent(a.id);(a.data.rank===e||a.data.minRank<=e&&e<=a.data.maxRank)&&(i.hasNode(a.id)||i.addNode(Object.assign({},a)),s?.id&&!i.hasNode(s?.id)&&i.addNode(Object.assign({},s)),i.setParent(a.id,s?.id||n),r.getRelatedEdges(a.id,t).forEach(o=>{const A=o.source===a.id?o.target:o.source;i.hasNode(A)||i.addNode(Object.assign({},r.getNode(A)));const l=i.getRelatedEdges(A,"out").find(({target:u})=>u===a.id),c=l!==void 0?l.data.weight:0;l?i.updateEdgeData(l.id,Object.assign(Object.assign({},l.data),{weight:o.data.weight+c})):i.addEdge({id:o.id,source:A,target:a.id,data:{weight:o.data.weight+c}})}),a.data.hasOwnProperty("minRank")&&i.updateNodeData(a.id,Object.assign(Object.assign({},a.data),{borderLeft:a.data.borderLeft[e],borderRight:a.data.borderRight[e]})))}),i},Bq=r=>{let e;for(;r.hasNode(e=`_root${Math.random()}`););return e},bq=(r,e,t)=>{const n=nq(t,t.map((c,u)=>u)),a=e.map(c=>{const u=r.getRelatedEdges(c,"out").map(h=>({pos:n[h.target]||0,weight:h.data.weight}));return u?.sort((h,d)=>h.pos-d.pos)}).flat().filter(c=>c!==void 0);let s=1;for(;s<t.length;)s<<=1;const o=2*s-1;s-=1;const A=Array(o).fill(0,0,o);let l=0;return a?.forEach(c=>{if(c){let u=c.pos+s;A[u]+=c.weight;let h=0;for(;u>0;)u%2&&(h+=A[u+1]),u=u-1>>1,A[u]+=c.weight;l+=c.weight*h}}),l},oT=(r,e)=>{let t=0;for(let n=1;n<e?.length;n+=1)t+=bq(r,e[n-1],e[n]);return t},AT=r=>{const e={},t=r.getAllNodes(),n=t.map(l=>{var c;return(c=l.data.rank)!==null&&c!==void 0?c:-1/0}),i=Math.max(...n),a=[];for(let l=0;l<i+1;l++)a.push([]);const s=t.sort((l,c)=>r.getNode(l.id).data.rank-r.getNode(c.id).data.rank),A=s.filter(l=>r.getNode(l.id).data.fixorder!==void 0).sort((l,c)=>r.getNode(l.id).data.fixorder-r.getNode(c.id).data.fixorder);return A?.forEach(l=>{isNaN(r.getNode(l.id).data.rank)||a[r.getNode(l.id).data.rank].push(l.id),e[l.id]=!0}),s?.forEach(l=>r.dfsTree(l.id,c=>{if(e.hasOwnProperty(c.id))return!0;e[c.id]=!0,isNaN(c.data.rank)||a[c.data.rank].push(c.id)})),a},Eq=(r,e)=>e.map(t=>{const n=r.getRelatedEdges(t,"in");if(!n?.length)return{v:t};const i={sum:0,weight:0};return n?.forEach(a=>{const s=r.getNode(a.source);i.sum+=a.data.weight*s.data.order,i.weight+=a.data.weight}),{v:t,barycenter:i.sum/i.weight,weight:i.weight}}),xq=(r,e)=>{var t,n,i;const a={};r?.forEach((o,A)=>{a[o.v]={i:A,indegree:0,in:[],out:[],vs:[o.v]};const l=a[o.v];o.barycenter!==void 0&&(l.barycenter=o.barycenter,l.weight=o.weight)}),(t=e.getAllEdges())===null||t===void 0||t.forEach(o=>{const A=a[o.source],l=a[o.target];A!==void 0&&l!==void 0&&(l.indegree++,A.out.push(a[o.target]))});const s=(i=(n=Object.values(a)).filter)===null||i===void 0?void 0:i.call(n,o=>!o.indegree);return Cq(s)},Cq=r=>{var e,t;const n=[],i=A=>l=>{l.merged||(l.barycenter===void 0||A.barycenter===void 0||l.barycenter>=A.barycenter)&&Sq(A,l)},a=A=>l=>{l.in.push(A),--l.indegree===0&&r.push(l)};for(;r?.length;){const A=r.pop();n.push(A),(e=A.in.reverse())===null||e===void 0||e.forEach(l=>i(A)(l)),(t=A.out)===null||t===void 0||t.forEach(l=>a(A)(l))}const s=n.filter(A=>!A.merged),o=["vs","i","barycenter","weight"];return s.map(A=>{const l={};return o?.forEach(c=>{A[c]!==void 0&&(l[c]=A[c])}),l})},Sq=(r,e)=>{var t;let n=0,i=0;r.weight&&(n+=r.barycenter*r.weight,i+=r.weight),e.weight&&(n+=e.barycenter*e.weight,i+=e.weight),r.vs=(t=e.vs)===null||t===void 0?void 0:t.concat(r.vs),r.barycenter=n/i,r.weight=i,r.i=Math.min(e.i,r.i),e.merged=!0},Fq=(r,e,t,n)=>{const i=aq(r,h=>{const d=h.hasOwnProperty("fixorder")&&!isNaN(h.fixorder);return n?!d&&h.hasOwnProperty("barycenter"):d||h.hasOwnProperty("barycenter")}),a=i.lhs,s=i.rhs.sort((h,d)=>-h.i- -d.i),o=[];let A=0,l=0,c=0;a?.sort(Tq(!!e,!!t)),c=lT(o,s,c),a?.forEach(h=>{var d;c+=(d=h.vs)===null||d===void 0?void 0:d.length,o.push(h.vs),A+=h.barycenter*h.weight,l+=h.weight,c=lT(o,s,c)});const u={vs:o.flat()};return l&&(u.barycenter=A/l,u.weight=l),u},lT=(r,e,t)=>{let n=t,i;for(;e.length&&(i=e[e.length-1]).i<=n;)e.pop(),r?.push(i.vs),n++;return n},Tq=(r,e)=>(t,n)=>{if(t.fixorder!==void 0&&n.fixorder!==void 0)return t.fixorder-n.fixorder;if(t.barycenter<n.barycenter)return-1;if(t.barycenter>n.barycenter)return 1;if(e&&t.order!==void 0&&n.order!==void 0){if(t.order<n.order)return-1;if(t.order>n.order)return 1}return r?n.i-t.i:t.i-n.i},cT=(r,e,t,n,i,a)=>{var s,o,A,l;let c=r.getChildren(e).map(y=>y.id);const u=r.getNode(e),h=u?u.data.borderLeft:void 0,d=u?u.data.borderRight:void 0,f={};h&&(c=c?.filter(y=>y!==h&&y!==d));const g=Eq(r,c||[]);g?.forEach(y=>{var m;if(!((m=r.getChildren(y.v))===null||m===void 0)&&m.length){const B=cT(r,y.v,t,n,a);f[y.v]=B,B.hasOwnProperty("barycenter")&&Oq(y,B)}});const p=xq(g,t);Mq(p,f),(s=p.filter(y=>y.vs.length>0))===null||s===void 0||s.forEach(y=>{const m=r.getNode(y.vs[0]);m&&(y.fixorder=m.data.fixorder,y.order=m.data.order)});const v=Fq(p,n,i,a);if(h&&(v.vs=[h,v.vs,d].flat(),!((o=r.getPredecessors(h))===null||o===void 0)&&o.length)){const y=r.getNode(((A=r.getPredecessors(h))===null||A===void 0?void 0:A[0].id)||""),m=r.getNode(((l=r.getPredecessors(d))===null||l===void 0?void 0:l[0].id)||"");v.hasOwnProperty("barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+y.data.order+m.data.order)/(v.weight+2),v.weight+=2}return v},Mq=(r,e)=>{r?.forEach(t=>{var n;const i=(n=t.vs)===null||n===void 0?void 0:n.map(a=>e[a]?e[a].vs:a);t.vs=i.flat()})},Oq=(r,e)=>{r.barycenter!==void 0?(r.barycenter=(r.barycenter*r.weight+e.barycenter*e.weight)/(r.weight+e.weight),r.weight+=e.weight):(r.barycenter=e.barycenter,r.weight=e.weight)},Iq=(r,e)=>{const t=JF(r),n=[],i=[];for(let c=1;c<t+1;c++)n.push(c);for(let c=t-1;c>-1;c--)i.push(c);const a=uT(r,n,"in"),s=uT(r,i,"out");let o=AT(r);_v(r,o);let A=Number.POSITIVE_INFINITY,l;for(let c=0,u=0;u<4;++c,++u){hT(c%2?a:s,c%4>=2,!1,e),o=Sl(r);const h=oT(r,o);h<A&&(u=0,l=ka(o),A=h)}o=AT(r),_v(r,o);for(let c=0,u=0;u<4;++c,++u){hT(c%2?a:s,c%4>=2,!0,e),o=Sl(r);const h=oT(r,o);h<A&&(u=0,l=ka(o),A=h)}_v(r,l)},uT=(r,e,t)=>e.map(n=>wq(r,n,t)),hT=(r,e,t,n)=>{const i=new Tn;r?.forEach(a=>{var s;const o=a.getRoots()[0].id,A=cT(a,o,i,e,t,n);for(let l=0;l<((s=A.vs)===null||s===void 0?void 0:s.length);l++){const c=a.getNode(A.vs[l]);c&&(c.data.order=l)}mq(a,i,A.vs)})},_v=(r,e)=>{e?.forEach(t=>{t?.forEach((n,i)=>{r.getNode(n).data.order=i})})},_q=(r,e)=>{const n=r.getAllNodes().filter(s=>{var o;return!(!((o=r.getChildren(s.id))===null||o===void 0)&&o.length)}).map(s=>s.data.rank),i=Math.max(...n),a=[];for(let s=0;s<i+1;s++)a[s]=[];e?.forEach(s=>{const o=r.getNode(s);!o||o.data.dummy||isNaN(o.data.rank)||(o.data.fixorder=a[o.data.rank].length,a[o.data.rank].push(s))})},kq=r=>{const e={};let t=0;const n=i=>{const a=t;r.getChildren(i).forEach(s=>n(s.id)),e[i]={low:a,lim:t++}};return r.getRoots().forEach(i=>n(i.id)),e},Nq=(r,e,t,n)=>{var i,a;const s=[],o=[],A=Math.min(e[t].low,e[n].low),l=Math.max(e[t].lim,e[n].lim);let c,u;c=t;do c=(i=r.getParent(c))===null||i===void 0?void 0:i.id,s.push(c);while(c&&(e[c].low>A||l>e[c].lim));for(u=c,c=n;c&&c!==u;)o.push(c),c=(a=r.getParent(c))===null||a===void 0?void 0:a.id;return{lca:u,path:s.concat(o.reverse())}},Lq=(r,e)=>{const t=kq(r);e.forEach(n=>{var i,a;let s=n,o=r.getNode(s);const A=o.data.originalEdge;if(!A)return;const l=Nq(r,t,A.source,A.target),c=l.path,u=l.lca;let h=0,d=c[h],f=!0;for(;s!==A.target;){if(o=r.getNode(s),f){for(;d!==u&&((i=r.getNode(d))===null||i===void 0?void 0:i.data.maxRank)<o.data.rank;)h++,d=c[h];d===u&&(f=!1)}if(!f){for(;h<c.length-1&&((a=r.getNode(c[h+1]))===null||a===void 0?void 0:a.data.minRank)<=o.data.rank;)h++;d=c[h]}r.hasNode(d)&&r.setParent(s,d),s=r.getSuccessors(s)[0].id}})},Qq=(r,e)=>{const t={},n=(i,a)=>{let s=0,o=0;const A=i.length,l=a?.[a?.length-1];return a?.forEach((c,u)=>{var h;const d=Pq(r,c),f=d?r.getNode(d.id).data.order:A;(d||c===l)&&((h=a.slice(o,u+1))===null||h===void 0||h.forEach(g=>{var p;(p=r.getPredecessors(g))===null||p===void 0||p.forEach(v=>{var y;const m=r.getNode(v.id),B=m.data.order;(B<s||f<B)&&!(m.data.dummy&&(!((y=r.getNode(g))===null||y===void 0)&&y.data.dummy))&&dT(t,v.id,g)})}),o=u+1,s=f)}),a};return e?.length&&e.reduce(n),t},Uq=(r,e)=>{const t={};function n(o,A,l,c,u){var h,d;let f;for(let g=A;g<l;g++)f=o[g],!((h=r.getNode(f))===null||h===void 0)&&h.data.dummy&&((d=r.getPredecessors(f))===null||d===void 0||d.forEach(p=>{const v=r.getNode(p.id);v.data.dummy&&(v.data.order<c||v.data.order>u)&&dT(t,p.id,f)}))}function i(o){return JSON.stringify(o.slice(1))}function a(o,A){const l=i(o);A.get(l)||(n(...o),A.set(l,!0))}const s=(o,A)=>{let l=-1,c,u=0;const h=new Map;return A?.forEach((d,f)=>{var g;if(((g=r.getNode(d))===null||g===void 0?void 0:g.data.dummy)==="border"){const p=r.getPredecessors(d)||[];p.length&&(c=r.getNode(p[0].id).data.order,a([A,u,f,l,c],h),u=f,l=c)}a([A,u,A.length,c,o.length],h)}),A};return e?.length&&e.reduce(s),t},Pq=(r,e)=>{var t,n;if(!((t=r.getNode(e))===null||t===void 0)&&t.data.dummy)return(n=r.getPredecessors(e))===null||n===void 0?void 0:n.find(i=>r.getNode(i.id).data.dummy)},dT=(r,e,t)=>{let n=e,i=t;if(n>i){const s=n;n=i,i=s}let a=r[n];a||(r[n]=a={}),a[i]=!0},Rq=(r,e,t)=>{let n=e,i=t;if(n>i){const a=e;n=i,i=a}return!!r[n]},Dq=(r,e,t,n)=>{const i={},a={},s={};return e?.forEach(o=>{o?.forEach((A,l)=>{i[A]=A,a[A]=A,s[A]=l})}),e?.forEach(o=>{let A=-1;o?.forEach(l=>{let c=n(l).map(u=>u.id);if(c.length){c=c.sort((h,d)=>s[h]-s[d]);const u=(c.length-1)/2;for(let h=Math.floor(u),d=Math.ceil(u);h<=d;++h){const f=c[h];a[l]===l&&A<s[f]&&!Rq(t,l,f)&&(a[f]=l,a[l]=i[l]=i[f],A=s[f])}}})}),{root:i,align:a}},Hq=(r,e,t,n,i,a,s)=>{var o;const A={},l=Gq(r,e,t,i,a,s),c=s?"borderLeft":"borderRight",u=(f,g)=>{let p=l.getAllNodes(),v=p.pop();const y={};for(;v;)y[v.id]?f(v.id):(y[v.id]=!0,p.push(v),p=p.concat(g(v.id))),v=p.pop()},h=f=>{A[f]=(l.getRelatedEdges(f,"in")||[]).reduce((g,p)=>Math.max(g,(A[p.source]||0)+p.data.weight),0)},d=f=>{const g=(l.getRelatedEdges(f,"out")||[]).reduce((v,y)=>Math.min(v,(A[y.target]||0)-y.data.weight),Number.POSITIVE_INFINITY),p=r.getNode(f);g!==Number.POSITIVE_INFINITY&&p.data.borderType!==c&&(A[f]=Math.max(A[f],g))};return u(h,l.getPredecessors.bind(l)),u(d,l.getSuccessors.bind(l)),(o=Object.values(n))===null||o===void 0||o.forEach(f=>{A[f]=A[t[f]]}),A},Gq=(r,e,t,n,i,a)=>{const s=new Tn,o=jq(n,i,a);return e?.forEach(A=>{let l;A?.forEach(c=>{const u=t[c];if(s.hasNode(u)||s.addNode({id:u,data:{}}),l){const h=t[l],d=s.getRelatedEdges(h,"out").find(f=>f.target===u);d?s.updateEdgeData(d.id,Object.assign(Object.assign({},d.data),{weight:Math.max(o(r,c,l),d.data.weight||0)})):s.addEdge({id:`e${Math.random()}`,source:h,target:u,data:{weight:Math.max(o(r,c,l),0)}})}l=c})}),s},Kq=(r,e)=>Mv(Object.values(e),t=>{var n;let i=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;return(n=Object.keys(t))===null||n===void 0||n.forEach(s=>{const o=t[s],A=Wq(r,s)/2;i=Math.max(o+A,i),a=Math.min(o-A,a)}),i-a});function zq(r,e){const t=Object.values(e),n=Math.min(...t),i=Math.max(...t);["u","d"].forEach(a=>{["l","r"].forEach(s=>{const o=a+s,A=r[o];let l;if(A===e)return;const c=Object.values(A);l=s==="l"?n-Math.min(...c):i-Math.max(...c),l&&(r[o]={},Object.keys(A).forEach(u=>{r[o][u]=A[u]+l}))})})}const Vq=(r,e)=>{const t={};return Object.keys(r.ul).forEach(n=>{if(e)t[n]=r[e.toLowerCase()][n];else{const i=Object.values(r).map(a=>a[n]);t[n]=(i[0]+i[1])/2}}),t},jq=(r,e,t)=>(n,i,a)=>{const s=n.getNode(i),o=n.getNode(a);let A=0,l=0;if(A+=s.data.width/2,s.data.hasOwnProperty("labelpos"))switch((s.data.labelpos||"").toLowerCase()){case"l":l=-s.data.width/2;break;case"r":l=s.data.width/2;break}if(l&&(A+=t?l:-l),l=0,A+=(s.data.dummy?e:r)/2,A+=(o.data.dummy?e:r)/2,A+=o.data.width/2,o.data.labelpos)switch((o.data.labelpos||"").toLowerCase()){case"l":l=o.data.width/2;break;case"r":l=-o.data.width/2;break}return l&&(A+=t?l:-l),l=0,A},Wq=(r,e)=>r.getNode(e).data.width||0,qq=(r,e)=>{const{ranksep:t=0}=e||{},n=Sl(r);let i=0;n?.forEach(a=>{const s=a.map(A=>r.getNode(A).data.height),o=Math.max(...s,0);a?.forEach(A=>{r.getNode(A).data.y=i+o/2}),i+=o+t})},$q=(r,e)=>{const{align:t,nodesep:n=0,edgesep:i=0}=e||{},a=Sl(r),s=Object.assign(Qq(r,a),Uq(r,a)),o={};let A=[];["u","d"].forEach(c=>{A=c==="u"?a:Object.values(a).reverse(),["l","r"].forEach(u=>{u==="r"&&(A=A.map(g=>Object.values(g).reverse()));const h=(c==="u"?r.getPredecessors:r.getSuccessors).bind(r),d=Dq(r,A,s,h),f=Hq(r,A,d.root,d.align,n,i,u==="r");u==="r"&&Object.keys(f).forEach(g=>f[g]=-f[g]),o[c+u]=f})});const l=Kq(r,o);return l&&zq(o,l),Vq(o,t)},Yq=(r,e)=>{var t;const n=YF(r);qq(n,e);const i=$q(n,e);(t=Object.keys(i))===null||t===void 0||t.forEach(a=>{n.getNode(a).data.x=i[a]})},fT=r=>{const e={},t=n=>{var i;const a=r.getNode(n);if(!a)return 0;if(e[n])return a.data.rank;e[n]=!0;let s;return(i=r.getRelatedEdges(n,"out"))===null||i===void 0||i.forEach(o=>{const A=t(o.target),l=o.data.minlen,c=A-l;c&&(s===void 0||c<s)&&(s=c)}),s||(s=0),a.data.rank=s,s};r.getAllNodes().filter(n=>r.getRelatedEdges(n.id,"in").length===0).forEach(n=>t(n.id))},Xq=r=>{const e={};let t;const n=s=>{var o;const A=r.getNode(s);if(!A)return 0;if(e[s])return A.data.rank;e[s]=!0;let l;return(o=r.getRelatedEdges(s,"out"))===null||o===void 0||o.forEach(c=>{const u=n(c.target),h=c.data.minlen,d=u-h;d&&(l===void 0||d<l)&&(l=d)}),l||(l=0),(t===void 0||l<t)&&(t=l),A.data.rank=l,l};r.getAllNodes().filter(s=>r.getRelatedEdges(s.id,"in").length===0).forEach(s=>{s&&n(s.id)}),t===void 0&&(t=0);const i={},a=(s,o)=>{var A;const l=r.getNode(s),c=isNaN(l.data.layer)?o:l.data.layer;(l.data.rank===void 0||l.data.rank<c)&&(l.data.rank=c),!i[s]&&(i[s]=!0,(A=r.getRelatedEdges(s,"out"))===null||A===void 0||A.forEach(u=>{a(u.target,c+u.data.minlen)}))};r.getAllNodes().forEach(s=>{const o=s.data;o&&(isNaN(o.layer)?o.rank-=t:a(s.id,o.layer))})},ss=(r,e)=>r.getNode(e.target).data.rank-r.getNode(e.source).data.rank-e.data.minlen,Zq=r=>{const e=new Tn({tree:[]}),t=r.getAllNodes()[0],n=r.getAllNodes().length;e.addNode(t);let i,a;for(;Jq(e,r)<n;)i=gT(e,r),a=e.hasNode(i.source)?ss(r,i):-ss(r,i),pT(e,r,a);return e},Jq=(r,e)=>{const t=n=>{e.getRelatedEdges(n,"both").forEach(i=>{const a=i.source,s=n===a?i.target:a;!r.hasNode(s)&&!ss(e,i)&&(r.addNode({id:s,data:{}}),r.addEdge({id:i.id,source:n,target:s,data:{}}),t(s))})};return r.getAllNodes().forEach(n=>t(n.id)),r.getAllNodes().length},e$=r=>{const e=new Tn({tree:[]}),t=r.getAllNodes()[0],n=r.getAllNodes().length;e.addNode(t);let i,a;for(;t$(e,r)<n;)i=gT(e,r),a=e.hasNode(i.source)?ss(r,i):-ss(r,i),pT(e,r,a);return e},t$=(r,e)=>{const t=n=>{var i;(i=e.getRelatedEdges(n,"both"))===null||i===void 0||i.forEach(a=>{const s=a.source,o=n===s?a.target:s;!r.hasNode(o)&&(e.getNode(o).data.layer!==void 0||!ss(e,a))&&(r.addNode({id:o,data:{}}),r.addEdge({id:a.id,source:n,target:o,data:{}}),t(o))})};return r.getAllNodes().forEach(n=>t(n.id)),r.getAllNodes().length},gT=(r,e)=>Mv(e.getAllEdges(),t=>r.hasNode(t.source)!==r.hasNode(t.target)?ss(e,t):1/0),pT=(r,e,t)=>{r.getAllNodes().forEach(n=>{const i=e.getNode(n.id);i.data.rank||(i.data.rank=0),i.data.rank+=t})},n$=r=>{const e=tq(r);fT(e);const t=Zq(e);yT(t),vT(t,e);let n,i;for(;n=a$(t);)i=s$(t,e,n),o$(t,e,n,i)},vT=(r,e)=>{let t=tT(r,r.getAllNodes(),"post");t=t.slice(0,t?.length-1),t.forEach(n=>{r$(r,e,n)})},r$=(r,e,t)=>{const i=r.getNode(t).data.parent,a=r.getRelatedEdges(t,"both").find(s=>s.target===i||s.source===i);a.data.cutvalue=i$(r,e,t)},i$=(r,e,t)=>{const i=r.getNode(t).data.parent;let a=!0,s=e.getRelatedEdges(t,"out").find(A=>A.target===i),o=0;return s||(a=!1,s=e.getRelatedEdges(i,"out").find(A=>A.target===t)),o=s.data.weight,e.getRelatedEdges(t,"both").forEach(A=>{const l=A.source===t,c=l?A.target:A.source;if(c!==i){const u=l===a,h=A.data.weight;if(o+=u?h:-h,l$(r,t,c)){const d=r.getRelatedEdges(t,"both").find(f=>f.source===c||f.target===c).data.cutvalue;o+=u?-d:d}}}),o},yT=(r,e=r.getAllNodes()[0].id)=>{mT(r,{},1,e)},mT=(r,e,t,n,i)=>{var a;const s=t;let o=t;const A=r.getNode(n);return e[n]=!0,(a=r.getNeighbors(n))===null||a===void 0||a.forEach(l=>{e[l.id]||(o=mT(r,e,o,l.id,n))}),A.data.low=s,A.data.lim=o++,i?A.data.parent=i:delete A.data.parent,o},a$=r=>r.getAllEdges().find(e=>e.data.cutvalue<0),s$=(r,e,t)=>{let n=t.source,i=t.target;e.getRelatedEdges(n,"out").find(c=>c.target===i)||(n=t.target,i=t.source);const a=r.getNode(n),s=r.getNode(i);let o=a,A=!1;a.data.lim>s.data.lim&&(o=s,A=!0);const l=e.getAllEdges().filter(c=>A===wT(r.getNode(c.source),o)&&A!==wT(r.getNode(c.target),o));return Mv(l,c=>ss(e,c))},o$=(r,e,t,n)=>{const i=r.getRelatedEdges(t.source,"both").find(a=>a.source===t.target||a.target===t.target);i&&r.removeEdge(i.id),r.addEdge({id:`e${Math.random()}`,source:n.source,target:n.target,data:{}}),yT(r),vT(r,e),A$(r,e)},A$=(r,e)=>{const t=r.getAllNodes().find(i=>!i.data.parent);let n=tT(r,t,"pre");n=n.slice(1),n.forEach(i=>{const a=r.getNode(i).data.parent;let s=e.getRelatedEdges(i,"out").find(A=>A.target===a),o=!1;!s&&e.hasNode(a)&&(s=e.getRelatedEdges(a,"out").find(A=>A.target===i),o=!0),e.getNode(i).data.rank=(e.hasNode(a)&&e.getNode(a).data.rank||0)+(o?s?.data.minlen:-s?.data.minlen)})},l$=(r,e,t)=>r.getRelatedEdges(e,"both").find(n=>n.source===t||n.target===t),wT=(r,e)=>e.data.low<=r.data.lim&&r.data.lim<=e.data.lim,c$=(r,e)=>{switch(e){case"network-simplex":h$(r);break;case"tight-tree":BT(r);break;case"longest-path":u$(r);break;default:BT(r)}},u$=fT,BT=r=>{Xq(r),e$(r)},h$=r=>{n$(r)},d$=(r,e)=>{const{edgeLabelSpace:t,keepNodeOrder:n,prevGraph:i,rankdir:a,ranksep:s}=e;!n&&i&&g$(r,i);const o=B$(r);t&&(e.ranksep=b$(o,{rankdir:a,ranksep:s}));let A;try{A=f$(o,e)}catch(l){if(l.message==="Not possible to find intersection inside of the rectangle"){console.error(`The following error may be caused by improper layer setting, please make sure your manual layer setting does not violate the graph's structure:
6
+ `,l);return}throw l}return p$(r,o),A},f$=(r,e)=>{const{ranker:t,rankdir:n="tb",nodeOrder:i,keepNodeOrder:a,align:s,nodesep:o=50,edgesep:A=20,ranksep:l=50}=e;I$(r),ZW(r);const{nestingRoot:c,nodeRankFactor:u}=uq(r);c$(YF(r),t),E$(r),iq(r,u),fq(r,c),rq(r),x$(r),C$(r);const h=[];pq(r,h),Lq(r,h),sq(r),a&&_q(r,i),Iq(r,a),_$(r),oq(r,n),Yq(r,{align:s,nodesep:o,edgesep:A,ranksep:l}),k$(r),O$(r),yq(r,h),T$(r),Aq(r,n);const{width:d,height:f}=S$(r);return F$(r),M$(r),JW(r),{width:d,height:f}},g$=(r,e)=>{r.getAllNodes().forEach(t=>{const n=r.getNode(t.id);if(e.hasNode(t.id)){const i=e.getNode(t.id);n.data.fixorder=i.data._order,delete i.data._order}else delete n.data.fixorder})},p$=(r,e)=>{r.getAllNodes().forEach(t=>{var n;const i=r.getNode(t.id);if(i){const a=e.getNode(t.id);i.data.x=a.data.x,i.data.y=a.data.y,i.data._order=a.data.order,i.data._rank=a.data.rank,!((n=e.getChildren(t.id))===null||n===void 0)&&n.length&&(i.data.width=a.data.width,i.data.height=a.data.height)}}),r.getAllEdges().forEach(t=>{const n=r.getEdge(t.id),i=e.getEdge(t.id);n.data.points=i?i.data.points:[],i&&i.data.hasOwnProperty("x")&&(n.data.x=i.data.x,n.data.y=i.data.y)})},v$=["width","height","layer","fixorder"],y$={width:0,height:0},m$=["minlen","weight","width","height","labeloffset"],w$={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},kv=["labelpos"],B$=r=>{const e=new Tn({tree:[]});return r.getAllNodes().forEach(t=>{const n=ET(r.getNode(t.id).data),i=Object.assign(Object.assign({},y$),n),a=bT(i,v$);e.hasNode(t.id)||e.addNode({id:t.id,data:Object.assign({},a)});const s=r.hasTreeStructure("combo")?r.getParent(t.id,"combo"):r.getParent(t.id);ke(s)||(e.hasNode(s.id)||e.addNode(Object.assign({},s)),e.setParent(t.id,s.id))}),r.getAllEdges().forEach(t=>{const n=ET(r.getEdge(t.id).data),i={};kv?.forEach(a=>{n[a]!==void 0&&(i[a]=n[a])}),e.addEdge({id:t.id,source:t.source,target:t.target,data:Object.assign({},w$,bT(n,m$),i)})}),e},b$=(r,e)=>{const{ranksep:t=0,rankdir:n}=e;return r.getAllNodes().forEach(i=>{isNaN(i.data.layer)||i.data.layer||(i.data.layer=0)}),r.getAllEdges().forEach(i=>{var a;i.data.minlen*=2,((a=i.data.labelpos)===null||a===void 0?void 0:a.toLowerCase())!=="c"&&(n==="TB"||n==="BT"?i.data.width+=i.data.labeloffset:i.data.height+=i.data.labeloffset)}),t/2},E$=r=>{r.getAllEdges().forEach(e=>{if(e.data.width&&e.data.height){const t=r.getNode(e.source),n=r.getNode(e.target),i={e,rank:(n.data.rank-t.data.rank)/2+t.data.rank};jo(r,"edge-proxy",i,"_ep")}})},x$=r=>{let e=0;return r.getAllNodes().forEach(t=>{var n,i;t.data.borderTop&&(t.data.minRank=(n=r.getNode(t.data.borderTop))===null||n===void 0?void 0:n.data.rank,t.data.maxRank=(i=r.getNode(t.data.borderBottom))===null||i===void 0?void 0:i.data.rank,e=Math.max(e,t.data.maxRank||-1/0))}),e},C$=r=>{r.getAllNodes().forEach(e=>{e.data.dummy==="edge-proxy"&&(r.getEdge(e.data.e.id).data.labelRank=e.data.rank,r.removeNode(e.id))})},S$=(r,e)=>{let t,n=0,i,a=0;const{marginx:s=0,marginy:o=0}={},A=l=>{if(!l.data)return;const c=l.data.x,u=l.data.y,h=l.data.width,d=l.data.height;!isNaN(c)&&!isNaN(h)&&(t===void 0&&(t=c-h/2),t=Math.min(t,c-h/2),n=Math.max(n,c+h/2)),!isNaN(u)&&!isNaN(d)&&(i===void 0&&(i=u-d/2),i=Math.min(i,u-d/2),a=Math.max(a,u+d/2))};return r.getAllNodes().forEach(l=>{A(l)}),r.getAllEdges().forEach(l=>{l?.data.hasOwnProperty("x")&&A(l)}),t-=s,i-=o,r.getAllNodes().forEach(l=>{l.data.x-=t,l.data.y-=i}),r.getAllEdges().forEach(l=>{var c;(c=l.data.points)===null||c===void 0||c.forEach(u=>{u.x-=t,u.y-=i}),l.data.hasOwnProperty("x")&&(l.data.x-=t),l.data.hasOwnProperty("y")&&(l.data.y-=i)}),{width:n-t+s,height:a-i+o}},F$=r=>{r.getAllEdges().forEach(e=>{const t=r.getNode(e.source),n=r.getNode(e.target);let i,a;e.data.points?(i=e.data.points[0],a=e.data.points[e.data.points.length-1]):(e.data.points=[],i={x:n.data.x,y:n.data.y},a={x:t.data.x,y:t.data.y}),e.data.points.unshift(XF(t.data,i)),e.data.points.push(XF(n.data,a))})},T$=r=>{r.getAllEdges().forEach(e=>{if(e.data.hasOwnProperty("x"))switch((e.data.labelpos==="l"||e.data.labelpos==="r")&&(e.data.width-=e.data.labeloffset),e.data.labelpos){case"l":e.data.x-=e.data.width/2+e.data.labeloffset;break;case"r":e.data.x+=e.data.width/2+e.data.labeloffset;break}})},M$=r=>{r.getAllEdges().forEach(e=>{var t;e.data.reversed&&((t=e.data.points)===null||t===void 0||t.reverse())})},O$=r=>{r.getAllNodes().forEach(e=>{var t,n,i;if(!((t=r.getChildren(e.id))===null||t===void 0)&&t.length){const a=r.getNode(e.id),s=r.getNode(a.data.borderTop),o=r.getNode(a.data.borderBottom),A=r.getNode(a.data.borderLeft[((n=a.data.borderLeft)===null||n===void 0?void 0:n.length)-1]),l=r.getNode(a.data.borderRight[((i=a.data.borderRight)===null||i===void 0?void 0:i.length)-1]);a.data.width=Math.abs(l?.data.x-A?.data.x)||10,a.data.height=Math.abs(o?.data.y-s?.data.y)||10,a.data.x=(A?.data.x||0)+a.data.width/2,a.data.y=(s?.data.y||0)+a.data.height/2}}),r.getAllNodes().forEach(e=>{e.data.dummy==="border"&&r.removeNode(e.id)})},I$=r=>{r.getAllEdges().forEach(e=>{if(e.source===e.target){const t=r.getNode(e.source);t.data.selfEdges||(t.data.selfEdges=[]),t.data.selfEdges.push(e),r.removeEdge(e.id)}})},_$=r=>{const e=Sl(r);e?.forEach(t=>{let n=0;t?.forEach((i,a)=>{var s;const o=r.getNode(i);o.data.order=a+n,(s=o.data.selfEdges)===null||s===void 0||s.forEach(A=>{jo(r,"selfedge",{width:A.data.width,height:A.data.height,rank:o.data.rank,order:a+ ++n,e:A},"_se")}),delete o.data.selfEdges})})},k$=r=>{r.getAllNodes().forEach(e=>{const t=r.getNode(e.id);if(t.data.dummy==="selfedge"){const n=r.getNode(t.data.e.source),i=n.data.x+n.data.width/2,a=n.data.y,s=t.data.x-i,o=n.data.height/2;r.hasEdge(t.data.e.id)?r.updateEdgeData(t.data.e.id,t.data.e.data):r.addEdge({id:t.data.e.id,source:t.data.e.source,target:t.data.e.target,data:t.data.e.data}),r.removeNode(e.id),t.data.e.data.points=[{x:i+2*s/3,y:a-o},{x:i+5*s/6,y:a-o},{y:a,x:i+s},{x:i+5*s/6,y:a+o},{x:i+2*s/3,y:a+o}],t.data.e.data.x=t.data.x,t.data.e.data.y=t.data.y}})},bT=(r,e)=>{const t={};return e?.forEach(n=>{r[n]!==void 0&&(t[n]=+r[n])}),t},ET=(r={})=>{const e={};return Object.keys(r).forEach(t=>{e[t.toLowerCase()]=r[t]}),e},ya=Array.isArray,xT=r=>{const e=[],t=r.length;for(let n=0;n<t;n+=1){e[n]=[];for(let i=0;i<t;i+=1)n===i?e[n][i]=0:r[n][i]===0||!r[n][i]?e[n][i]=1/0:e[n][i]=r[n][i]}for(let n=0;n<t;n+=1)for(let i=0;i<t;i+=1)for(let a=0;a<t;a+=1)e[i][a]>e[i][n]+e[n][a]&&(e[i][a]=e[i][n]+e[n][a]);return e},CT=(r,e)=>{const{nodes:t,edges:n}=r,i=[],a={};if(!t)throw new Error("invalid nodes data!");return t&&t.forEach((s,o)=>{a[s.id]=o;const A=[];i.push(A)}),n?.forEach(s=>{const{source:o,target:A}=s,l=a[o],c=a[A];l===void 0||c===void 0||(i[l][c]=1,i[c][l]=1)}),i},N$=(r,e)=>{const t=[];return r.forEach(n=>{const i=[];n.forEach(a=>{i.push(a*e)}),t.push(i)}),t},L$=r=>{let e=1/0,t=1/0,n=-1/0,i=-1/0;return r.forEach(a=>{let s=a.data.size;ya(s)?s.length===1&&(s=[s[0],s[0]]):Be(s)?s=[s,s]:(s===void 0||isNaN(s))&&(s=[30,30]);const o=[s[0]/2,s[1]/2],A=a.data.x-o[0],l=a.data.x+o[0],c=a.data.y-o[1],u=a.data.y+o[1];e>A&&(e=A),t>c&&(t=c),n<l&&(n=l),i<u&&(i=u)}),{minX:e,minY:t,maxX:n,maxY:i}},ST=(r,e)=>Math.sqrt((r.x-e.x)*(r.x-e.x)+(r.y-e.y)*(r.y-e.y)),Nv=(r,e,t,n="TB",i,a={})=>{if(!e?.length)return;const{stopBranchFn:s,stopAllFn:o}=a;for(let A=0;A<e.length;A++){const l=e[A];if(r.hasNode(l.id)&&!s?.(l)){if(o?.(l))return;n==="TB"&&t(l),Nv(r,r.getChildren(l.id,i),t,n,i,a),n!=="TB"&&t(l)}}},Lv=r=>{if(r===null)return r;if(r instanceof Date)return new Date(r.getTime());if(r instanceof Array){const e=[];return r.forEach(t=>{e.push(t)}),e.map(t=>Lv(t))}if(typeof r=="object"){const e={};return Object.keys(r).forEach(t=>{e[t]=Lv(r[t])}),e}return r},Kr=(r,e)=>{const t=Lv(r);return t.data=t.data||{},e&&(Be(t.data.x)||(t.data.x=Math.random()*e[0]),Be(t.data.y)||(t.data.y=Math.random()*e[1])),t};function Fl(r){if(!r)return[0,0,0];if(Be(r))return[r,r,r];if(r.length===0)return[0,0,0];const[e,t=e,n=e]=r;return[e,t,n]}function $s(r,e){let t;return Te(e)?t=e:Be(e)?t=()=>e:t=()=>r,t}function Qv(r,e,t=!0){return!e&&e!==0?n=>{const{size:i}=n.data||{};return i?Array.isArray(i)?t?Math.max(...i)||r:i:on(i)&&i.width&&i.height?t?Math.max(i.width,i.height)||r:[i.width,i.height]:i:r}:Te(e)?e:Be(e)?()=>e:Array.isArray(e)?()=>t?Math.max(...e)||r:e:on(e)&&e.width&&e.height?()=>t?Math.max(e.width,e.height)||r:[e.width,e.height]:()=>r}const Uv=(r,e,t=10)=>{let n;const i=typeof e=="function"?e:()=>e||0;return r?Array.isArray(r)?n=s=>r:Te(r)?n=r:n=s=>r:n=s=>{var o,A,l;if(!((o=s.data)===null||o===void 0)&&o.bboxSize)return(A=s.data)===null||A===void 0?void 0:A.bboxSize;if(!((l=s.data)===null||l===void 0)&&l.size){const c=s.data.size;return Array.isArray(c)?c:on(c)?[c.width,c.height]:c}return t},s=>{const o=n(s),A=i(s);return Math.max(...Fl(o))+A}},Q$={rankdir:"TB",nodesep:50,ranksep:50,edgeLabelSpace:!0,ranker:"tight-tree",controlPoints:!1,radial:!1,focusNode:null};class U${constructor(e={}){this.options=e,this.id="antv-dagre",this.options=Object.assign(Object.assign({},Q$),e)}execute(e,t){return et(this,void 0,void 0,function*(){return this.genericDagreLayout(!1,e,t)})}assign(e,t){return et(this,void 0,void 0,function*(){yield this.genericDagreLayout(!0,e,t)})}genericDagreLayout(e,t,n){return et(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),n),{nodeSize:a,align:s,rankdir:o="TB",ranksep:A,nodesep:l,ranksepFunc:c,nodesepFunc:u,edgeLabelSpace:h,ranker:d,nodeOrder:f,begin:g,controlPoints:p,radial:v,sortByCombo:y,preset:m}=i,B=new Tn({tree:[]}),C=$s(A||50,c),S=$s(l||50,u);let F=S,T=C;(o==="LR"||o==="RL")&&(F=C,T=S);const O=Qv(10,a,!1),I=t.getAllNodes(),k=t.getAllEdges();I.forEach(j=>{const te=Fl(O(j)),ue=T(j),ge=F(j),Y=te[0]+2*ge,xe=te[1]+2*ue,$=j.data.layer;Be($)?B.addNode({id:j.id,data:{width:Y,height:xe,layer:$}}):B.addNode({id:j.id,data:{width:Y,height:xe}})}),y&&(B.attachTreeStructure("combo"),I.forEach(j=>{const{parentId:te}=j.data;te!==void 0&&B.hasNode(te)&&B.setParent(j.id,te,"combo")})),k.forEach(j=>{B.addEdge({id:j.id,source:j.source,target:j.target,data:{weight:j.data.weight||1}})});let N;m?.length&&(N=new Tn({nodes:m})),d$(B,{prevGraph:N,edgeLabelSpace:h,keepNodeOrder:!!f,nodeOrder:f||[],acyclicer:"greedy",ranker:d,rankdir:o,nodesep:l,align:s});const U=[0,0];if(g){let j=1/0,te=1/0;B.getAllNodes().forEach(ue=>{j>ue.data.x&&(j=ue.data.x),te>ue.data.y&&(te=ue.data.y)}),B.getAllEdges().forEach(ue=>{var ge;(ge=ue.data.points)===null||ge===void 0||ge.forEach(Y=>{j>Y.x&&(j=Y.x),te>Y.y&&(te=Y.y)})}),U[0]=g[0]-j,U[1]=g[1]-te}const D=o==="LR"||o==="RL";if(!v){const j=new Set,ue=o==="BT"||o==="RL"?($,K)=>K-$:($,K)=>$-K;B.getAllNodes().forEach($=>{$.data.x=$.data.x+U[0],$.data.y=$.data.y+U[1],j.add(D?$.data.x:$.data.y)});const ge=Array.from(j).sort(ue),Y=D?($,K)=>$.x!==K.x:($,K)=>$.y!==K.y,xe=D?($,K,ee)=>{const oe=Math.max(K.y,ee.y),Ee=Math.min(K.y,ee.y);return $.filter(Le=>Le.y<=oe&&Le.y>=Ee)}:($,K,ee)=>{const oe=Math.max(K.x,ee.x),Ee=Math.min(K.x,ee.x);return $.filter(Le=>Le.x<=oe&&Le.x>=Ee)};B.getAllEdges().forEach(($,K)=>{var ee;h&&p&&$.data.type!=="loop"&&($.data.controlPoints=P$((ee=$.data.points)===null||ee===void 0?void 0:ee.map(({x:oe,y:Ee})=>({x:oe+U[0],y:Ee+U[1]})),B.getNode($.source),B.getNode($.target),ge,D,Y,xe))})}let G=[];G=B.getAllNodes().map(j=>Kr(j));const Z=B.getAllEdges();return e&&(G.forEach(j=>{t.mergeNodeData(j.id,{x:j.data.x,y:j.data.y})}),Z.forEach(j=>{t.mergeEdgeData(j.id,{controlPoints:j.data.controlPoints})})),{nodes:G,edges:Z}})}}const P$=(r,e,t,n,i,a,s)=>{let o=r?.slice(1,r.length-1)||[];if(e&&t){let{x:A,y:l}=e.data,{x:c,y:u}=t.data;if(i&&(A=e.data.y,l=e.data.x,c=t.data.y,u=t.data.x),u!==l&&A!==c){const h=n.indexOf(l),d=n[h+1];if(d){const p=o[0],v=i?{x:(l+d)/2,y:p?.y||c}:{x:p?.x||c,y:(l+d)/2};(!p||a(p,v))&&o.unshift(v)}const f=n.indexOf(u),g=Math.abs(f-h);if(g===1)o=s(o,e.data,t.data),o.length||o.push(i?{x:(l+u)/2,y:A}:{x:A,y:(l+u)/2});else if(g>1){const p=n[f-1];if(p){const v=o[o.length-1],y=i?{x:(u+p)/2,y:v?.y||c}:{x:v?.x||A,y:(u+p)/2};(!v||a(v,y))&&o.push(y)}}}}return o},Ys=(r,e,t)=>{const n=r.getAllNodes(),i=r.getAllEdges();if(!n?.length)return{nodes:[],edges:i};if(n.length===1)return e&&r.mergeNodeData(n[0].id,{x:t[0],y:t[1]}),{nodes:[Object.assign(Object.assign({},n[0]),{data:Object.assign(Object.assign({},n[0].data),{x:t[0],y:t[1]})})],edges:i}},R$={radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1};class D${constructor(e={}){this.options=e,this.id="circular",this.options=Object.assign(Object.assign({},R$),e)}execute(e,t){return et(this,void 0,void 0,function*(){return this.genericCircularLayout(!1,e,t)})}assign(e,t){return et(this,void 0,void 0,function*(){yield this.genericCircularLayout(!0,e,t)})}genericCircularLayout(e,t,n){return et(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),n),{width:a,height:s,center:o,divisions:A,startAngle:l=0,endAngle:c=2*Math.PI,angleRatio:u,ordering:h,clockwise:d,nodeSpacing:f,nodeSize:g}=i,p=t.getAllNodes(),v=t.getAllEdges(),[y,m,B]=G$(a,s,o),C=p?.length;if(!C||C===1)return Ys(t,e,B);const S=(c-l)/C;let{radius:F,startRadius:T,endRadius:O}=i;if(f){const D=$s(10,f),G=Qv(10,g);let Z=-1/0;p.forEach(j=>{const te=G(j);Z<te&&(Z=te)});let q=0;p.forEach((j,te)=>{te===0?q+=Z||10:q+=(D(j)||0)+(Z||10)}),F=q/(2*Math.PI)}else!F&&!T&&!O?F=Math.min(m,y)/2:!T&&O?T=O:T&&!O&&(O=T);const I=S*u;let k=[];h==="topology"?k=FT(t,p):h==="topology-directed"?k=FT(t,p,!0):h==="degree"?k=H$(t,p):k=p.map(D=>Kr(D));const N=Math.ceil(C/A);for(let D=0;D<C;++D){let G=F;!G&&T!==null&&O!==null&&(G=T+D*(O-T)/(C-1)),G||(G=10+D*100/(C-1));let Z=l+D%N*I+2*Math.PI/A*Math.floor(D/N);d||(Z=c-D%N*I-2*Math.PI/A*Math.floor(D/N)),k[D].data.x=B[0]+Math.cos(Z)*G,k[D].data.y=B[1]+Math.sin(Z)*G}return e&&k.forEach(D=>{t.mergeNodeData(D.id,{x:D.data.x,y:D.data.y})}),{nodes:k,edges:v}})}}const FT=(r,e,t=!1)=>{const n=[Kr(e[0])],i={},a=e.length;i[e[0].id]=!0;let s=0;return e.forEach((o,A)=>{if(A!==0)if((A===a-1||r.getDegree(o.id,"both")!==r.getDegree(e[A+1].id,"both")||r.areNeighbors(n[s].id,o.id))&&!i[o.id])n.push(Kr(o)),i[o.id]=!0,s++;else{const l=t?r.getSuccessors(n[s].id):r.getNeighbors(n[s].id);let c=!1;for(let h=0;h<l.length;h++){const d=l[h];if(r.getDegree(d.id)===r.getDegree(o.id)&&!i[d.id]){n.push(Kr(d)),i[d.id]=!0,c=!0;break}}let u=0;for(;!c&&(i[e[u].id]||(n.push(Kr(e[u])),i[e[u].id]=!0,c=!0),u++,u!==a););}}),n};function H$(r,e){const t=[];return e.forEach((n,i)=>{t.push(Kr(n))}),t.sort((n,i)=>r.getDegree(n.id,"both")-r.getDegree(i.id,"both")),t}const G$=(r,e,t)=>{let n=r,i=e,a=t;return!n&&typeof window<"u"&&(n=window.innerWidth),!i&&typeof window<"u"&&(i=window.innerHeight),a||(a=[n/2,i/2]),[n,i,a]},K$={nodeSize:30,nodeSpacing:10,preventOverlap:!1,sweep:void 0,equidistant:!1,startAngle:3/2*Math.PI,clockwise:!0,maxLevelDiff:void 0,sortBy:"degree"};class Pv{constructor(e={}){this.options=e,this.id="concentric",this.options=Object.assign(Object.assign({},K$),e)}execute(e,t){return et(this,void 0,void 0,function*(){return this.genericConcentricLayout(!1,e,t)})}assign(e,t){return et(this,void 0,void 0,function*(){yield this.genericConcentricLayout(!0,e,t)})}genericConcentricLayout(e,t,n){return et(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),n),{center:a,width:s,height:o,sortBy:A,maxLevelDiff:l,sweep:c,clockwise:u,equidistant:h,preventOverlap:d,startAngle:f=3/2*Math.PI,nodeSize:g,nodeSpacing:p}=i,v=t.getAllNodes(),y=t.getAllEdges(),m=!s&&typeof window<"u"?window.innerWidth:s,B=!o&&typeof window<"u"?window.innerHeight:o,C=a||[m/2,B/2];if(!v?.length||v.length===1)return Ys(t,e,C);const S=[];let F,T=0;ya(g)?F=Math.max(g[0],g[1]):Te(g)?(F=-1/0,v.forEach(j=>{const te=Math.max(...Fl(g(j)));te>F&&(F=te)})):F=g,ya(p)?T=Math.max(p[0],p[1]):Be(p)&&(T=p),v.forEach(j=>{const te=Kr(j);S.push(te);let ue=F;const{data:ge}=te;ya(ge.size)?ue=Math.max(ge.size[0],ge.size[1]):Be(ge.size)?ue=ge.size:on(ge.size)&&(ue=Math.max(ge.size.width,ge.size.height)),F=Math.max(F,ue),Te(p)&&(T=Math.max(p(j),T))});const O={};S.forEach((j,te)=>{O[j.id]=te});let I=A;(!ot(I)||S[0].data[I]===void 0)&&(I="degree"),I==="degree"?S.sort((j,te)=>t.getDegree(te.id,"both")-t.getDegree(j.id,"both")):S.sort((j,te)=>te.data[I]-j.data[I]);const k=S[0],N=(l||(I==="degree"?t.getDegree(k.id,"both"):k.data[I]))/4,U=[{nodes:[]}];let D=U[0];S.forEach(j=>{if(D.nodes.length>0){const te=Math.abs(I==="degree"?t.getDegree(D.nodes[0].id,"both")-t.getDegree(j.id,"both"):D.nodes[0].data[I]-j.data[I]);N&&te>=N&&(D={nodes:[]},U.push(D))}D.nodes.push(j)});let G=F+T;if(!d){const j=U.length>0&&U[0].nodes.length>1,ue=(Math.min(m,B)/2-G)/(U.length+(j?1:0));G=Math.min(G,ue)}let Z=0;if(U.forEach(j=>{const te=c===void 0?2*Math.PI-2*Math.PI/j.nodes.length:c;if(j.dTheta=te/Math.max(1,j.nodes.length-1),j.nodes.length>1&&d){const ue=Math.cos(j.dTheta)-Math.cos(0),ge=Math.sin(j.dTheta)-Math.sin(0),Y=Math.sqrt(G*G/(ue*ue+ge*ge));Z=Math.max(Y,Z)}j.r=Z,Z+=G}),h){let j=0,te=0;for(let ue=0;ue<U.length;ue++){const Y=(U[ue].r||0)-te;j=Math.max(j,Y)}te=0,U.forEach((ue,ge)=>{ge===0&&(te=ue.r||0),ue.r=te,te+=j})}return U.forEach(j=>{const te=j.dTheta||0,ue=j.r||0;j.nodes.forEach((ge,Y)=>{const xe=f+(u?1:-1)*te*Y;ge.data.x=C[0]+ue*Math.cos(xe),ge.data.y=C[1]+ue*Math.sin(xe)})}),e&&S.forEach(j=>t.mergeNodeData(j.id,{x:j.data.x,y:j.data.y})),{nodes:S,edges:y}})}}function z$(r){const e=+this._x.call(null,r),t=+this._y.call(null,r);return TT(this.cover(e,t),e,t,r)}function TT(r,e,t,n){if(isNaN(e)||isNaN(t))return r;var i,a=r._root,s={data:n},o=r._x0,A=r._y0,l=r._x1,c=r._y1,u,h,d,f,g,p,v,y;if(!a)return r._root=s,r;for(;a.length;)if((g=e>=(u=(o+l)/2))?o=u:l=u,(p=t>=(h=(A+c)/2))?A=h:c=h,i=a,!(a=a[v=p<<1|g]))return i[v]=s,r;if(d=+r._x.call(null,a.data),f=+r._y.call(null,a.data),e===d&&t===f)return s.next=a,i?i[v]=s:r._root=s,r;do i=i?i[v]=new Array(4):r._root=new Array(4),(g=e>=(u=(o+l)/2))?o=u:l=u,(p=t>=(h=(A+c)/2))?A=h:c=h;while((v=p<<1|g)===(y=(f>=h)<<1|d>=u));return i[y]=a,i[v]=s,r}function V$(r){var e,t,n=r.length,i,a,s=new Array(n),o=new Array(n),A=1/0,l=1/0,c=-1/0,u=-1/0;for(t=0;t<n;++t)isNaN(i=+this._x.call(null,e=r[t]))||isNaN(a=+this._y.call(null,e))||(s[t]=i,o[t]=a,i<A&&(A=i),i>c&&(c=i),a<l&&(l=a),a>u&&(u=a));if(A>c||l>u)return this;for(this.cover(A,l).cover(c,u),t=0;t<n;++t)TT(this,s[t],o[t],r[t]);return this}function j$(r,e){if(isNaN(r=+r)||isNaN(e=+e))return this;var t=this._x0,n=this._y0,i=this._x1,a=this._y1;if(isNaN(t))i=(t=Math.floor(r))+1,a=(n=Math.floor(e))+1;else{for(var s=i-t||1,o=this._root,A,l;t>r||r>=i||n>e||e>=a;)switch(l=(e<n)<<1|r<t,A=new Array(4),A[l]=o,o=A,s*=2,l){case 0:i=t+s,a=n+s;break;case 1:t=i-s,a=n+s;break;case 2:i=t+s,n=a-s;break;case 3:t=i-s,n=a-s;break}this._root&&this._root.length&&(this._root=o)}return this._x0=t,this._y0=n,this._x1=i,this._y1=a,this}function W$(){var r=[];return this.visit(function(e){if(!e.length)do r.push(e.data);while(e=e.next)}),r}function q$(r){return arguments.length?this.cover(+r[0][0],+r[0][1]).cover(+r[1][0],+r[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function ur(r,e,t,n,i){this.node=r,this.x0=e,this.y0=t,this.x1=n,this.y1=i}function $$(r,e,t){var n,i=this._x0,a=this._y0,s,o,A,l,c=this._x1,u=this._y1,h=[],d=this._root,f,g;for(d&&h.push(new ur(d,i,a,c,u)),t==null?t=1/0:(i=r-t,a=e-t,c=r+t,u=e+t,t*=t);f=h.pop();)if(!(!(d=f.node)||(s=f.x0)>c||(o=f.y0)>u||(A=f.x1)<i||(l=f.y1)<a))if(d.length){var p=(s+A)/2,v=(o+l)/2;h.push(new ur(d[3],p,v,A,l),new ur(d[2],s,v,p,l),new ur(d[1],p,o,A,v),new ur(d[0],s,o,p,v)),(g=(e>=v)<<1|r>=p)&&(f=h[h.length-1],h[h.length-1]=h[h.length-1-g],h[h.length-1-g]=f)}else{var y=r-+this._x.call(null,d.data),m=e-+this._y.call(null,d.data),B=y*y+m*m;if(B<t){var C=Math.sqrt(t=B);i=r-C,a=e-C,c=r+C,u=e+C,n=d.data}}return n}function Y$(r){if(isNaN(c=+this._x.call(null,r))||isNaN(u=+this._y.call(null,r)))return this;var e,t=this._root,n,i,a,s=this._x0,o=this._y0,A=this._x1,l=this._y1,c,u,h,d,f,g,p,v;if(!t)return this;if(t.length)for(;;){if((f=c>=(h=(s+A)/2))?s=h:A=h,(g=u>=(d=(o+l)/2))?o=d:l=d,e=t,!(t=t[p=g<<1|f]))return this;if(!t.length)break;(e[p+1&3]||e[p+2&3]||e[p+3&3])&&(n=e,v=p)}for(;t.data!==r;)if(i=t,!(t=t.next))return this;return(a=t.next)&&delete t.next,i?(a?i.next=a:delete i.next,this):e?(a?e[p]=a:delete e[p],(t=e[0]||e[1]||e[2]||e[3])&&t===(e[3]||e[2]||e[1]||e[0])&&!t.length&&(n?n[v]=t:this._root=t),this):(this._root=a,this)}function X$(r){for(var e=0,t=r.length;e<t;++e)this.remove(r[e]);return this}function Z$(){return this._root}function J$(){var r=0;return this.visit(function(e){if(!e.length)do++r;while(e=e.next)}),r}function e7(r){var e=[],t,n=this._root,i,a,s,o,A;for(n&&e.push(new ur(n,this._x0,this._y0,this._x1,this._y1));t=e.pop();)if(!r(n=t.node,a=t.x0,s=t.y0,o=t.x1,A=t.y1)&&n.length){var l=(a+o)/2,c=(s+A)/2;(i=n[3])&&e.push(new ur(i,l,c,o,A)),(i=n[2])&&e.push(new ur(i,a,c,l,A)),(i=n[1])&&e.push(new ur(i,l,s,o,c)),(i=n[0])&&e.push(new ur(i,a,s,l,c))}return this}function t7(r){var e=[],t=[],n;for(this._root&&e.push(new ur(this._root,this._x0,this._y0,this._x1,this._y1));n=e.pop();){var i=n.node;if(i.length){var a,s=n.x0,o=n.y0,A=n.x1,l=n.y1,c=(s+A)/2,u=(o+l)/2;(a=i[0])&&e.push(new ur(a,s,o,c,u)),(a=i[1])&&e.push(new ur(a,c,o,A,u)),(a=i[2])&&e.push(new ur(a,s,u,c,l)),(a=i[3])&&e.push(new ur(a,c,u,A,l))}t.push(n)}for(;n=t.pop();)r(n.node,n.x0,n.y0,n.x1,n.y1);return this}function n7(r){return r[0]}function r7(r){return arguments.length?(this._x=r,this):this._x}function i7(r){return r[1]}function a7(r){return arguments.length?(this._y=r,this):this._y}function $h(r,e,t){var n=new Rv(e??n7,t??i7,NaN,NaN,NaN,NaN);return r==null?n:n.addAll(r)}function Rv(r,e,t,n,i,a){this._x=r,this._y=e,this._x0=t,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function MT(r){for(var e={data:r.data},t=e;r=r.next;)t=t.next={data:r.data};return e}var hr=$h.prototype=Rv.prototype;hr.copy=function(){var r=new Rv(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,t,n;if(!e)return r;if(!e.length)return r._root=MT(e),r;for(t=[{source:e,target:r._root=new Array(4)}];e=t.pop();)for(var i=0;i<4;++i)(n=e.source[i])&&(n.length?t.push({source:n,target:e.target[i]=new Array(4)}):e.target[i]=MT(n));return r},hr.add=z$,hr.addAll=V$,hr.cover=j$,hr.data=W$,hr.extent=q$,hr.find=$$,hr.remove=Y$,hr.removeAll=X$,hr.root=Z$,hr.size=J$,hr.visit=e7,hr.visitAfter=t7,hr.x=r7,hr.y=a7;function s7(r){const e=+this._x.call(null,r),t=+this._y.call(null,r),n=+this._z.call(null,r);return OT(this.cover(e,t,n),e,t,n,r)}function OT(r,e,t,n,i){if(isNaN(e)||isNaN(t)||isNaN(n))return r;var a,s=r._root,o={data:i},A=r._x0,l=r._y0,c=r._z0,u=r._x1,h=r._y1,d=r._z1,f,g,p,v,y,m,B,C,S,F,T;if(!s)return r._root=o,r;for(;s.length;)if((B=e>=(f=(A+u)/2))?A=f:u=f,(C=t>=(g=(l+h)/2))?l=g:h=g,(S=n>=(p=(c+d)/2))?c=p:d=p,a=s,!(s=s[F=S<<2|C<<1|B]))return a[F]=o,r;if(v=+r._x.call(null,s.data),y=+r._y.call(null,s.data),m=+r._z.call(null,s.data),e===v&&t===y&&n===m)return o.next=s,a?a[F]=o:r._root=o,r;do a=a?a[F]=new Array(8):r._root=new Array(8),(B=e>=(f=(A+u)/2))?A=f:u=f,(C=t>=(g=(l+h)/2))?l=g:h=g,(S=n>=(p=(c+d)/2))?c=p:d=p;while((F=S<<2|C<<1|B)===(T=(m>=p)<<2|(y>=g)<<1|v>=f));return a[T]=s,a[F]=o,r}function o7(r){Array.isArray(r)||(r=Array.from(r));const e=r.length,t=new Float64Array(e),n=new Float64Array(e),i=new Float64Array(e);let a=1/0,s=1/0,o=1/0,A=-1/0,l=-1/0,c=-1/0;for(let u=0,h,d,f,g;u<e;++u)isNaN(d=+this._x.call(null,h=r[u]))||isNaN(f=+this._y.call(null,h))||isNaN(g=+this._z.call(null,h))||(t[u]=d,n[u]=f,i[u]=g,d<a&&(a=d),d>A&&(A=d),f<s&&(s=f),f>l&&(l=f),g<o&&(o=g),g>c&&(c=g));if(a>A||s>l||o>c)return this;this.cover(a,s,o).cover(A,l,c);for(let u=0;u<e;++u)OT(this,t[u],n[u],i[u],r[u]);return this}function A7(r,e,t){if(isNaN(r=+r)||isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,i=this._y0,a=this._z0,s=this._x1,o=this._y1,A=this._z1;if(isNaN(n))s=(n=Math.floor(r))+1,o=(i=Math.floor(e))+1,A=(a=Math.floor(t))+1;else{for(var l=s-n||1,c=this._root,u,h;n>r||r>=s||i>e||e>=o||a>t||t>=A;)switch(h=(t<a)<<2|(e<i)<<1|r<n,u=new Array(8),u[h]=c,c=u,l*=2,h){case 0:s=n+l,o=i+l,A=a+l;break;case 1:n=s-l,o=i+l,A=a+l;break;case 2:s=n+l,i=o-l,A=a+l;break;case 3:n=s-l,i=o-l,A=a+l;break;case 4:s=n+l,o=i+l,a=A-l;break;case 5:n=s-l,o=i+l,a=A-l;break;case 6:s=n+l,i=o-l,a=A-l;break;case 7:n=s-l,i=o-l,a=A-l;break}this._root&&this._root.length&&(this._root=c)}return this._x0=n,this._y0=i,this._z0=a,this._x1=s,this._y1=o,this._z1=A,this}function l7(){var r=[];return this.visit(function(e){if(!e.length)do r.push(e.data);while(e=e.next)}),r}function c7(r){return arguments.length?this.cover(+r[0][0],+r[0][1],+r[0][2]).cover(+r[1][0],+r[1][1],+r[1][2]):isNaN(this._x0)?void 0:[[this._x0,this._y0,this._z0],[this._x1,this._y1,this._z1]]}function Mt(r,e,t,n,i,a,s){this.node=r,this.x0=e,this.y0=t,this.z0=n,this.x1=i,this.y1=a,this.z1=s}function u7(r,e,t,n){var i,a=this._x0,s=this._y0,o=this._z0,A,l,c,u,h,d,f=this._x1,g=this._y1,p=this._z1,v=[],y=this._root,m,B;for(y&&v.push(new Mt(y,a,s,o,f,g,p)),n==null?n=1/0:(a=r-n,s=e-n,o=t-n,f=r+n,g=e+n,p=t+n,n*=n);m=v.pop();)if(!(!(y=m.node)||(A=m.x0)>f||(l=m.y0)>g||(c=m.z0)>p||(u=m.x1)<a||(h=m.y1)<s||(d=m.z1)<o))if(y.length){var C=(A+u)/2,S=(l+h)/2,F=(c+d)/2;v.push(new Mt(y[7],C,S,F,u,h,d),new Mt(y[6],A,S,F,C,h,d),new Mt(y[5],C,l,F,u,S,d),new Mt(y[4],A,l,F,C,S,d),new Mt(y[3],C,S,c,u,h,F),new Mt(y[2],A,S,c,C,h,F),new Mt(y[1],C,l,c,u,S,F),new Mt(y[0],A,l,c,C,S,F)),(B=(t>=F)<<2|(e>=S)<<1|r>=C)&&(m=v[v.length-1],v[v.length-1]=v[v.length-1-B],v[v.length-1-B]=m)}else{var T=r-+this._x.call(null,y.data),O=e-+this._y.call(null,y.data),I=t-+this._z.call(null,y.data),k=T*T+O*O+I*I;if(k<n){var N=Math.sqrt(n=k);a=r-N,s=e-N,o=t-N,f=r+N,g=e+N,p=t+N,i=y.data}}return i}const h7=(r,e,t,n,i,a)=>Math.sqrt((r-n)**2+(e-i)**2+(t-a)**2);function d7(r,e,t,n){const i=[],a=r-n,s=e-n,o=t-n,A=r+n,l=e+n,c=t+n;return this.visit((u,h,d,f,g,p,v)=>{if(!u.length)do{const y=u.data;h7(r,e,t,this._x(y),this._y(y),this._z(y))<=n&&i.push(y)}while(u=u.next);return h>A||d>l||f>c||g<a||p<s||v<o}),i}function f7(r){if(isNaN(h=+this._x.call(null,r))||isNaN(d=+this._y.call(null,r))||isNaN(f=+this._z.call(null,r)))return this;var e,t=this._root,n,i,a,s=this._x0,o=this._y0,A=this._z0,l=this._x1,c=this._y1,u=this._z1,h,d,f,g,p,v,y,m,B,C,S;if(!t)return this;if(t.length)for(;;){if((y=h>=(g=(s+l)/2))?s=g:l=g,(m=d>=(p=(o+c)/2))?o=p:c=p,(B=f>=(v=(A+u)/2))?A=v:u=v,e=t,!(t=t[C=B<<2|m<<1|y]))return this;if(!t.length)break;(e[C+1&7]||e[C+2&7]||e[C+3&7]||e[C+4&7]||e[C+5&7]||e[C+6&7]||e[C+7&7])&&(n=e,S=C)}for(;t.data!==r;)if(i=t,!(t=t.next))return this;return(a=t.next)&&delete t.next,i?(a?i.next=a:delete i.next,this):e?(a?e[C]=a:delete e[C],(t=e[0]||e[1]||e[2]||e[3]||e[4]||e[5]||e[6]||e[7])&&t===(e[7]||e[6]||e[5]||e[4]||e[3]||e[2]||e[1]||e[0])&&!t.length&&(n?n[S]=t:this._root=t),this):(this._root=a,this)}function g7(r){for(var e=0,t=r.length;e<t;++e)this.remove(r[e]);return this}function p7(){return this._root}function v7(){var r=0;return this.visit(function(e){if(!e.length)do++r;while(e=e.next)}),r}function y7(r){var e=[],t,n=this._root,i,a,s,o,A,l,c;for(n&&e.push(new Mt(n,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));t=e.pop();)if(!r(n=t.node,a=t.x0,s=t.y0,o=t.z0,A=t.x1,l=t.y1,c=t.z1)&&n.length){var u=(a+A)/2,h=(s+l)/2,d=(o+c)/2;(i=n[7])&&e.push(new Mt(i,u,h,d,A,l,c)),(i=n[6])&&e.push(new Mt(i,a,h,d,u,l,c)),(i=n[5])&&e.push(new Mt(i,u,s,d,A,h,c)),(i=n[4])&&e.push(new Mt(i,a,s,d,u,h,c)),(i=n[3])&&e.push(new Mt(i,u,h,o,A,l,d)),(i=n[2])&&e.push(new Mt(i,a,h,o,u,l,d)),(i=n[1])&&e.push(new Mt(i,u,s,o,A,h,d)),(i=n[0])&&e.push(new Mt(i,a,s,o,u,h,d))}return this}function m7(r){var e=[],t=[],n;for(this._root&&e.push(new Mt(this._root,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));n=e.pop();){var i=n.node;if(i.length){var a,s=n.x0,o=n.y0,A=n.z0,l=n.x1,c=n.y1,u=n.z1,h=(s+l)/2,d=(o+c)/2,f=(A+u)/2;(a=i[0])&&e.push(new Mt(a,s,o,A,h,d,f)),(a=i[1])&&e.push(new Mt(a,h,o,A,l,d,f)),(a=i[2])&&e.push(new Mt(a,s,d,A,h,c,f)),(a=i[3])&&e.push(new Mt(a,h,d,A,l,c,f)),(a=i[4])&&e.push(new Mt(a,s,o,f,h,d,u)),(a=i[5])&&e.push(new Mt(a,h,o,f,l,d,u)),(a=i[6])&&e.push(new Mt(a,s,d,f,h,c,u)),(a=i[7])&&e.push(new Mt(a,h,d,f,l,c,u))}t.push(n)}for(;n=t.pop();)r(n.node,n.x0,n.y0,n.z0,n.x1,n.y1,n.z1);return this}function w7(r){return r[0]}function B7(r){return arguments.length?(this._x=r,this):this._x}function b7(r){return r[1]}function E7(r){return arguments.length?(this._y=r,this):this._y}function x7(r){return r[2]}function C7(r){return arguments.length?(this._z=r,this):this._z}function IT(r,e,t,n){var i=new Dv(e??w7,t??b7,n??x7,NaN,NaN,NaN,NaN,NaN,NaN);return r==null?i:i.addAll(r)}function Dv(r,e,t,n,i,a,s,o,A){this._x=r,this._y=e,this._z=t,this._x0=n,this._y0=i,this._z0=a,this._x1=s,this._y1=o,this._z1=A,this._root=void 0}function _T(r){for(var e={data:r.data},t=e;r=r.next;)t=t.next={data:r.data};return e}var Vn=IT.prototype=Dv.prototype;Vn.copy=function(){var r=new Dv(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),e=this._root,t,n;if(!e)return r;if(!e.length)return r._root=_T(e),r;for(t=[{source:e,target:r._root=new Array(8)}];e=t.pop();)for(var i=0;i<8;++i)(n=e.source[i])&&(n.length?t.push({source:n,target:e.target[i]=new Array(8)}):e.target[i]=_T(n));return r},Vn.add=s7,Vn.addAll=o7,Vn.cover=A7,Vn.data=l7,Vn.extent=c7,Vn.find=u7,Vn.findAllWithinRadius=d7,Vn.remove=f7,Vn.removeAll=g7,Vn.root=p7,Vn.size=v7,Vn.visit=y7,Vn.visitAfter=m7,Vn.x=B7,Vn.y=E7,Vn.z=C7;const S7=.81,Hv=.1;function F7(r,e,t,n,i=2){const a=e/t,s=r.getAllNodes(),o=s.map((c,u)=>{const{nodeStrength:h,x:d,y:f,z:g,size:p}=c.data;return{x:d,y:f,z:g,size:p,index:u,id:c.id,vx:0,vy:0,vz:0,weight:a*h}}),A=(i===2?$h(o,c=>c.x,c=>c.y):IT(o,c=>c.x,c=>c.y,c=>c.z)).visitAfter(T7),l=new Map;return o.forEach(c=>{l.set(c.id,c),O7(c,A,i)}),o.map((c,u)=>{const{id:h,data:d}=s[u],{mass:f=1}=d;n[h]={x:c.vx/f,y:c.vy/f,z:c.vz/f}}),n}function T7(r){let e=0,t=0,n=0,i=0,a=0;const s=r.length;if(s){for(let o=0;o<s;o++){const A=r[o];A&&A.weight&&(e+=A.weight,t+=A.x*A.weight,n+=A.y*A.weight,i+=A.z*A.weight,a+=A.size*A.weight)}r.x=t/e,r.y=n/e,r.z=i/e,r.size=a/e,r.weight=e}else{const o=r;r.x=o.data.x,r.y=o.data.y,r.z=o.data.z,r.size=o.data.size,r.weight=o.data.weight}}const M7=(r,e,t,n,i,a,s)=>{var o;if(((o=r.data)===null||o===void 0?void 0:o.id)===a.id)return;const A=[t,n,i][s-1],l=a.x-r.x||Hv,c=a.y-r.y||Hv,u=a.z-r.z||Hv,h=[l,c,u],d=A-e;let f=0;for(let v=0;v<s;v++)f+=h[v]*h[v];const p=Math.sqrt(f)*f;if(d*d*S7<f){const v=r.weight/p;return a.vx+=l*v,a.vy+=c*v,a.vz+=u*v,!0}if(r.length)return!1;if(r.data!==a){const v=r.data.weight/p;a.vx+=l*v,a.vy+=c*v,a.vz+=u*v}};function O7(r,e,t){e.visit((n,i,a,s,o)=>M7(n,i,a,s,o,r,t))}const I7={dimensions:2,maxIteration:500,gravity:10,factor:1,edgeStrength:50,nodeStrength:1e3,coulombDisScale:.005,damping:.9,maxSpeed:200,minMovement:.4,interval:.02,linkDistance:200,clusterNodeStrength:20,preventOverlap:!0,distanceThresholdMode:"mean"};class kT{constructor(e={}){this.options=e,this.id="force",this.timeInterval=0,this.judgingDistance=0,this.running=!1,this.options=Object.assign(Object.assign({},I7),e)}execute(e,t){return et(this,void 0,void 0,function*(){return this.genericForceLayout(!1,e,t)})}assign(e,t){return et(this,void 0,void 0,function*(){yield this.genericForceLayout(!0,e,t)})}stop(){this.timeInterval&&typeof window<"u"&&window.clearInterval(this.timeInterval),this.running=!1}tick(e=this.options.maxIteration||1){if(this.lastResult)return this.lastResult;for(let n=0;(this.judgingDistance>this.lastOptions.minMovement||n<1)&&n<e;n++)this.runOneStep(this.lastCalcGraph,this.lastGraph,n,this.lastVelMap,this.lastOptions),this.updatePosition(this.lastGraph,this.lastCalcGraph,this.lastVelMap,this.lastOptions);const t={nodes:this.lastLayoutNodes,edges:this.lastLayoutEdges};return this.lastAssign&&t.nodes.forEach(n=>this.lastGraph.mergeNodeData(n.id,{x:n.data.x,y:n.data.y,z:this.options.dimensions===3?n.data.z:void 0})),t}genericForceLayout(e,t,n){return et(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),n),a=t.getAllNodes(),s=t.getAllEdges(),o=this.formatOptions(i,t),{dimensions:A,width:l,height:c,nodeSize:u,getMass:h,nodeStrength:d,edgeStrength:f,linkDistance:g}=o,p=a.map((T,O)=>Object.assign(Object.assign({},T),{data:Object.assign(Object.assign({},T.data),{x:Be(T.data.x)?T.data.x:Math.random()*l,y:Be(T.data.y)?T.data.y:Math.random()*c,z:Be(T.data.z)?T.data.z:Math.random()*Math.sqrt(l*c),size:u(T)||30,mass:h(T),nodeStrength:d(T)})})),v=s.map(T=>Object.assign(Object.assign({},T),{data:Object.assign(Object.assign({},T.data),{edgeStrength:f(T),linkDistance:g(T,t.getNode(T.source),t.getNode(T.target))})}));if(!a?.length)return this.lastResult={nodes:[],edges:s},{nodes:[],edges:s};const y={};a.forEach((T,O)=>{y[T.id]={x:0,y:0,z:0}});const m=new Tn({nodes:p,edges:v});this.formatCentripetal(o,m);const{maxIteration:B,minMovement:C,onTick:S}=o;if(this.lastLayoutNodes=p,this.lastLayoutEdges=v,this.lastAssign=e,this.lastGraph=t,this.lastCalcGraph=m,this.lastOptions=o,this.lastVelMap=y,typeof window>"u")return;let F=0;return new Promise(T=>{this.timeInterval=window.setInterval(()=>{(!a||!this.running)&&T({nodes:Gv(t,p),edges:s}),this.runOneStep(m,t,F,y,o),this.updatePosition(t,m,y,o),e&&p.forEach(O=>t.mergeNodeData(O.id,{x:O.data.x,y:O.data.y,z:A===3?O.data.z:void 0})),S?.({nodes:Gv(t,p),edges:s}),F++,(F>=B||this.judgingDistance<C)&&(window.clearInterval(this.timeInterval),T({nodes:Gv(t,p),edges:s}))},0),this.running=!0})})}formatOptions(e,t){const n=Object.assign({},e),{width:i,height:a,getMass:s}=e;n.width=!i&&typeof window<"u"?window.innerWidth:i,n.height=!a&&typeof window<"u"?window.innerHeight:a,e.center||(n.center=[n.width/2,n.height/2]),s||(n.getMass=A=>{let l=1;Be(A?.data.mass)&&(l=A?.data.mass);const c=t.getDegree(A.id,"both");return!c||c<5?l:c*5*l}),n.nodeSize=Uv(e.nodeSize,e.nodeSpacing);const o=e.linkDistance?$s(1,e.linkDistance):A=>1+n.nodeSize(t.getNode(A.source))+n.nodeSize(t.getNode(A.target));return n.linkDistance=o,n.nodeStrength=$s(1,e.nodeStrength),n.edgeStrength=$s(1,e.edgeStrength),n}formatCentripetal(e,t){const{dimensions:n,centripetalOptions:i,center:a,clusterNodeStrength:s,leafCluster:o,clustering:A,nodeClusterBy:l}=e,c=t.getAllNodes(),u=i||{leaf:2,single:2,others:1,center:v=>({x:a[0],y:a[1],z:n===3?a[2]:void 0})};typeof s!="function"&&(e.clusterNodeStrength=v=>s);let h,d;if(o&&l&&(h=NT(t,l),d=Array.from(new Set(c?.map(v=>v.data[l])))||[],e.centripetalOptions=Object.assign(u,{single:100,leaf:v=>{const{siblingLeaves:y,sameTypeLeaves:m}=h[v.id]||{};return m?.length===y?.length||d?.length===1?1:e.clusterNodeStrength(v)},others:1,center:v=>{const y=t.getDegree(v.id,"both");if(!y)return{x:100,y:100,z:0};let m;if(y===1){const{sameTypeLeaves:B=[]}=h[v.id]||{};B.length===1?m=void 0:B.length>1&&(m=LT(B))}else m=void 0;return{x:m?.x,y:m?.y,z:m?.z}}})),A&&l){h||(h=NT(t,l)),d||(d=Array.from(new Set(c.map(y=>y.data[l])))),d=d.filter(y=>y!==void 0);const v={};d.forEach(y=>{const m=c.filter(B=>B.data[l]===y).map(B=>t.getNode(B.id));v[y]=LT(m)}),e.centripetalOptions=Object.assign(u,{single:y=>e.clusterNodeStrength(y),leaf:y=>e.clusterNodeStrength(y),others:y=>e.clusterNodeStrength(y),center:y=>{const m=v[y.data[l]];return{x:m?.x,y:m?.y,z:m?.z}}})}const{leaf:f,single:g,others:p}=e.centripetalOptions||{};f&&typeof f!="function"&&(e.centripetalOptions.leaf=()=>f),g&&typeof g!="function"&&(e.centripetalOptions.single=()=>g),p&&typeof p!="function"&&(e.centripetalOptions.others=()=>p)}runOneStep(e,t,n,i,a){const s={},o=e.getAllNodes(),A=e.getAllEdges();if(!o?.length)return;const{monitor:l}=a;if(this.calRepulsive(e,s,a),A&&this.calAttractive(e,s,a),this.calGravity(e,t,s,a),this.updateVelocity(e,s,i,a),l){const c=this.calTotalEnergy(s,o);l({energy:c,nodes:t.getAllNodes(),edges:t.getAllEdges(),iterations:n})}}calTotalEnergy(e,t){if(!t?.length)return 0;let n=0;return t.forEach((i,a)=>{const s=e[i.id].x,o=e[i.id].y,A=this.options.dimensions===3?e[i.id].z:0,l=s*s+o*o+A*A,{mass:c=1}=i.data;n+=c*l*.5}),n}calRepulsive(e,t,n){const{dimensions:i,factor:a,coulombDisScale:s}=n;F7(e,a,s*s,t,i)}calAttractive(e,t,n){const{dimensions:i,nodeSize:a}=n;e.getAllEdges().forEach((s,o)=>{const{source:A,target:l}=s,c=e.getNode(A),u=e.getNode(l);if(!c||!u)return;let h=u.data.x-c.data.x,d=u.data.y-c.data.y,f=i===3?u.data.z-c.data.z:0;!h&&!d&&(h=Math.random()*.01,d=Math.random()*.01,i===3&&!f&&(f=Math.random()*.01));const g=Math.sqrt(h*h+d*d+f*f);if(g<a(c)+a(u))return;const p=h/g,v=d/g,y=f/g,{linkDistance:m=200,edgeStrength:B=200}=s.data||{},S=(m-g)*B,F=c.data.mass||1,T=u.data.mass||1,O=1/F,I=1/T,k=p*S,N=v*S,U=y*S;t[A].x-=k*O,t[A].y-=N*O,t[A].z-=U*O,t[l].x+=k*I,t[l].y+=N*I,t[l].z+=U*I})}calGravity(e,t,n,i){const{getCenter:a}=i,s=e.getAllNodes(),o=t.getAllNodes(),A=t.getAllEdges(),{width:l,height:c,center:u,gravity:h,centripetalOptions:d}=i;s&&s.forEach(f=>{const{id:g,data:p}=f,{mass:v,x:y,y:m,z:B}=p,C=t.getNode(g);let S=0,F=0,T=0,O=h;const I=e.getDegree(g,"in"),k=e.getDegree(g,"out"),N=e.getDegree(g,"both"),U=a?.(C,N);if(U){const[D,G,Z]=U;S=y-D,F=m-G,O=Z}else S=y-u[0],F=m-u[1],T=B-u[2];if(O&&(n[g].x-=O*S/v,n[g].y-=O*F/v,n[g].z-=O*T/v),d){const{leaf:D,single:G,others:Z,center:q}=d,{x:j,y:te,z:ue,centerStrength:ge}=q?.(C,o,A,l,c)||{x:0,y:0,z:0,centerStrength:0};if(!Be(j)||!Be(te))return;const Y=(y-j)/v,xe=(m-te)/v,$=(B-ue)/v;if(ge&&(n[g].x-=ge*Y,n[g].y-=ge*xe,n[g].z-=ge*$),N===0){const ee=G(C);if(!ee)return;n[g].x-=ee*Y,n[g].y-=ee*xe,n[g].z-=ee*$;return}if(I===0||k===0){const ee=D(C,o,A);if(!ee)return;n[g].x-=ee*Y,n[g].y-=ee*xe,n[g].z-=ee*$;return}const K=Z(C);if(!K)return;n[g].x-=K*Y,n[g].y-=K*xe,n[g].z-=K*$}})}updateVelocity(e,t,n,i){const{damping:a,maxSpeed:s,interval:o,dimensions:A}=i,l=e.getAllNodes();l?.length&&l.forEach(c=>{const{id:u}=c;let h=(n[u].x+t[u].x*o)*a||.01,d=(n[u].y+t[u].y*o)*a||.01,f=A===3?(n[u].z+t[u].z*o)*a||.01:0;const g=Math.sqrt(h*h+d*d+f*f);if(g>s){const p=s/g;h=p*h,d=p*d,f=p*f}n[u]={x:h,y:d,z:f}})}updatePosition(e,t,n,i){const{distanceThresholdMode:a,interval:s,dimensions:o}=i,A=t.getAllNodes();if(!A?.length){this.judgingDistance=0;return}let l=0;a==="max"?this.judgingDistance=-1/0:a==="min"&&(this.judgingDistance=1/0),A.forEach(c=>{const{id:u}=c,h=e.getNode(u);if(Be(h.data.fx)&&Be(h.data.fy)){t.mergeNodeData(u,{x:h.data.fx,y:h.data.fy,z:o===3?h.data.fz:void 0});return}const d=n[u].x*s,f=n[u].y*s,g=o===3?n[u].z*s:0;t.mergeNodeData(u,{x:c.data.x+d,y:c.data.y+f,z:c.data.z+g});const p=Math.sqrt(d*d+f*f+g*g);switch(a){case"max":this.judgingDistance<p&&(this.judgingDistance=p);break;case"min":this.judgingDistance>p&&(this.judgingDistance=p);break;default:l=l+p;break}}),(!a||a==="mean")&&(this.judgingDistance=l/A.length)}}const NT=(r,e)=>{const t=r.getAllNodes();if(!t?.length)return{};const n={};return t.forEach((i,a)=>{r.getDegree(i.id,"both")===1&&(n[i.id]=_7(r,"leaf",i,e))}),n},_7=(r,e,t,n)=>{const i=r.getDegree(t.id,"in"),a=r.getDegree(t.id,"out");let s=t,o=[];i===0?(s=r.getSuccessors(t.id)[0],o=r.getNeighbors(s.id)):a===0&&(s=r.getPredecessors(t.id)[0],o=r.getNeighbors(s.id)),o=o.filter(l=>r.getDegree(l.id,"in")===0||r.getDegree(l.id,"out")===0);const A=k7(r,e,n,t,o);return{coreNode:s,siblingLeaves:o,sameTypeLeaves:A}},k7=(r,e,t,n,i)=>{const a=n.data[t]||"";let s=i?.filter(o=>o.data[t]===a)||[];return s=s.filter(o=>r.getDegree(o.id,"in")===0||r.getDegree(o.id,"out")===0),s},LT=r=>{const e={x:0,y:0};r.forEach(n=>{const{x:i,y:a}=n.data;e.x+=i||0,e.y+=a||0});const t=r.length||1;return{x:e.x/t,y:e.y/t}},Gv=(r,e)=>e.map(t=>{const{id:n,data:i}=t,a=r.getNode(n);return Object.assign(Object.assign({},a),{data:Object.assign(Object.assign({},a.data),{x:i.x,y:i.y,z:i.z})})});var rt={};const N7=Object.prototype.toString;function Tl(r){const e=N7.call(r);return e.endsWith("Array]")&&!e.includes("Big")}const L7=Ub(Object.freeze(Object.defineProperty({__proto__:null,isAnyArray:Tl},Symbol.toStringTag,{value:"Module"})));function Q7(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Tl(r))throw new TypeError("input must be an array");if(r.length===0)throw new TypeError("input must not be empty");var t=e.fromIndex,n=t===void 0?0:t,i=e.toIndex,a=i===void 0?r.length:i;if(n<0||n>=r.length||!Number.isInteger(n))throw new Error("fromIndex must be a positive integer smaller than length");if(a<=n||a>r.length||!Number.isInteger(a))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var s=r[n],o=n+1;o<a;o++)r[o]>s&&(s=r[o]);return s}function U7(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Tl(r))throw new TypeError("input must be an array");if(r.length===0)throw new TypeError("input must not be empty");var t=e.fromIndex,n=t===void 0?0:t,i=e.toIndex,a=i===void 0?r.length:i;if(n<0||n>=r.length||!Number.isInteger(n))throw new Error("fromIndex must be a positive integer smaller than length");if(a<=n||a>r.length||!Number.isInteger(a))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var s=r[n],o=n+1;o<a;o++)r[o]<s&&(s=r[o]);return s}function P7(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Tl(r)){if(r.length===0)throw new TypeError("input must not be empty")}else throw new TypeError("input must be an array");var t;if(e.output!==void 0){if(!Tl(e.output))throw new TypeError("output option must be an array if specified");t=e.output}else t=new Array(r.length);var n=U7(r),i=Q7(r);if(n===i)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var a=e.min,s=a===void 0?e.autoMinMax?n:0:a,o=e.max,A=o===void 0?e.autoMinMax?i:1:o;if(s>=A)throw new RangeError("min option must be smaller than max option");for(var l=(A-s)/(i-n),c=0;c<r.length;c++)t[c]=(r[c]-n)*l+s;return t}const R7=Ub(Object.freeze(Object.defineProperty({__proto__:null,default:P7},Symbol.toStringTag,{value:"Module"})));var QT;function D7(){if(QT)return rt;QT=1,Object.defineProperty(rt,"__esModule",{value:!0});var r=L7,e=R7;const t=" ".repeat(2),n=" ".repeat(4);function i(){return a(this)}function a(_,b={}){const{maxRows:E=15,maxColumns:w=10,maxNumSize:x=8,padMinus:M="auto"}=b;return`${_.constructor.name} {
7
+ ${t}[
8
+ ${n}${s(_,E,w,x,M)}
9
+ ${t}]
10
+ ${t}rows: ${_.rows}
11
+ ${t}columns: ${_.columns}
12
+ }`}function s(_,b,E,w,x){const{rows:M,columns:L}=_,Q=Math.min(M,b),P=Math.min(L,E),R=[];if(x==="auto"){x=!1;e:for(let J=0;J<Q;J++)for(let z=0;z<P;z++)if(_.get(J,z)<0){x=!0;break e}}for(let J=0;J<Q;J++){let z=[];for(let ae=0;ae<P;ae++)z.push(o(_.get(J,ae),w,x));R.push(`${z.join(" ")}`)}return P!==L&&(R[R.length-1]+=` ... ${L-E} more columns`),Q!==M&&R.push(`... ${M-b} more rows`),R.join(`
13
+ ${n}`)}function o(_,b,E){return(_>=0&&E?` ${A(_,b-1)}`:A(_,b)).padEnd(b)}function A(_,b){let E=_.toString();if(E.length<=b)return E;let w=_.toFixed(b);if(w.length>b&&(w=_.toFixed(Math.max(0,b-(w.length-b)))),w.length<=b&&!w.startsWith("0.000")&&!w.startsWith("-0.000"))return w;let x=_.toExponential(b);return x.length>b&&(x=_.toExponential(Math.max(0,b-(x.length-b)))),x.slice(0)}function l(_,b){_.prototype.add=function(w){return typeof w=="number"?this.addS(w):this.addM(w)},_.prototype.addS=function(w){for(let x=0;x<this.rows;x++)for(let M=0;M<this.columns;M++)this.set(x,M,this.get(x,M)+w);return this},_.prototype.addM=function(w){if(w=b.checkMatrix(w),this.rows!==w.rows||this.columns!==w.columns)throw new RangeError("Matrices dimensions must be equal");for(let x=0;x<this.rows;x++)for(let M=0;M<this.columns;M++)this.set(x,M,this.get(x,M)+w.get(x,M));return this},_.add=function(w,x){return new b(w).add(x)},_.prototype.sub=function(w){return typeof w=="number"?this.subS(w):this.subM(w)},_.prototype.subS=function(w){for(let x=0;x<this.rows;x++)for(let M=0;M<this.columns;M++)this.set(x,M,this.get(x,M)-w);return this},_.prototype.subM=function(w){if(w=b.checkMatrix(w),this.rows!==w.rows||this.columns!==w.columns)throw new RangeError("Matrices dimensions must be equal");for(let x=0;x<this.rows;x++)for(let M=0;M<this.columns;M++)this.set(x,M,this.get(x,M)-w.get(x,M));return this},_.sub=function(w,x){return new b(w).sub(x)},_.prototype.subtract=_.prototype.sub,_.prototype.subtractS=_.prototype.subS,_.prototype.subtractM=_.prototype.subM,_.subtract=_.sub,_.prototype.mul=function(w){return typeof w=="number"?this.mulS(w):this.mulM(w)},_.prototype.mulS=function(w){for(let x=0;x<this.rows;x++)for(let M=0;M<this.columns;M++)this.set(x,M,this.get(x,M)*w);return this},_.prototype.mulM=function(w){if(w=b.checkMatrix(w),this.rows!==w.rows||this.columns!==w.columns)throw new RangeError("Matrices dimensions must be equal");for(let x=0;x<this.rows;x++)for(let M=0;M<this.columns;M++)this.set(x,M,this.get(x,M)*w.get(x,M));return this},_.mul=function(w,x){return new b(w).mul(x)},_.prototype.multiply=_.prototype.mul,_.prototype.multiplyS=_.prototype.mulS,_.prototype.multiplyM=_.prototype.mulM,_.multiply=_.mul,_.prototype.div=function(w){return typeof w=="number"?this.divS(w):this.divM(w)},_.prototype.divS=function(w){for(let x=0;x<this.rows;x++)for(let M=0;M<this.columns;M++)this.set(x,M,this.get(x,M)/w);return this},_.prototype.divM=function(w){if(w=b.checkMatrix(w),this.rows!==w.rows||this.columns!==w.columns)throw new RangeError("Matrices dimensions must be equal");for(let x=0;x<this.rows;x++)for(let M=0;M<this.columns;M++)this.set(x,M,this.get(x,M)/w.get(x,M));return this},_.div=function(w,x){return new b(w).div(x)},_.prototype.divide=_.prototype.div,_.prototype.divideS=_.prototype.divS,_.prototype.divideM=_.prototype.divM,_.divide=_.div,_.prototype.mod=function(w){return typeof w=="number"?this.modS(w):this.modM(w)},_.prototype.modS=function(w){for(let x=0;x<this.rows;x++)for(let M=0;M<this.columns;M++)this.set(x,M,this.get(x,M)%w);return this},_.prototype.modM=function(w){if(w=b.checkMatrix(w),this.rows!==w.rows||this.columns!==w.columns)throw new RangeError("Matrices dimensions must be equal");for(let x=0;x<this.rows;x++)for(let M=0;M<this.columns;M++)this.set(x,M,this.get(x,M)%w.get(x,M));return this},_.mod=function(w,x){return new b(w).mod(x)},_.prototype.modulus=_.prototype.mod,_.prototype.modulusS=_.prototype.modS,_.prototype.modulusM=_.prototype.modM,_.modulus=_.mod,_.prototype.and=function(w){return typeof w=="number"?this.andS(w):this.andM(w)},_.prototype.andS=function(w){for(let x=0;x<this.rows;x++)for(let M=0;M<this.columns;M++)this.set(x,M,this.get(x,M)&w);return this},_.prototype.andM=function(w){if(w=b.checkMatrix(w),this.rows!==w.rows||this.columns!==w.columns)throw new RangeError("Matrices dimensions must be equal");for(let x=0;x<this.rows;x++)for(let M=0;M<this.columns;M++)this.set(x,M,this.get(x,M)&w.get(x,M));return this},_.and=function(w,x){return new b(w).and(x)},_.prototype.or=function(w){return typeof w=="number"?this.orS(w):this.orM(w)},_.prototype.orS=function(w){for(let x=0;x<this.rows;x++)for(let M=0;M<this.columns;M++)this.set(x,M,this.get(x,M)|w);return this},_.prototype.orM=function(w){if(w=b.checkMatrix(w),this.rows!==w.rows||this.columns!==w.columns)throw new RangeError("Matrices dimensions must be equal");for(let x=0;x<this.rows;x++)for(let M=0;M<this.columns;M++)this.set(x,M,this.get(x,M)|w.get(x,M));return this},_.or=function(w,x){return new b(w).or(x)},_.prototype.xor=function(w){return typeof w=="number"?this.xorS(w):this.xorM(w)},_.prototype.xorS=function(w){for(let x=0;x<this.rows;x++)for(let M=0;M<this.columns;M++)this.set(x,M,this.get(x,M)^w);return this},_.prototype.xorM=function(w){if(w=b.checkMatrix(w),this.rows!==w.rows||this.columns!==w.columns)throw new RangeError("Matrices dimensions must be equal");for(let x=0;x<this.rows;x++)for(let M=0;M<this.columns;M++)this.set(x,M,this.get(x,M)^w.get(x,M));return this},_.xor=function(w,x){return new b(w).xor(x)},_.prototype.leftShift=function(w){return typeof w=="number"?this.leftShiftS(w):this.leftShiftM(w)},_.prototype.leftShiftS=function(w){for(let x=0;x<this.rows;x++)for(let M=0;M<this.columns;M++)this.set(x,M,this.get(x,M)<<w);return this},_.prototype.leftShiftM=function(w){if(w=b.checkMatrix(w),this.rows!==w.rows||this.columns!==w.columns)throw new RangeError("Matrices dimensions must be equal");for(let x=0;x<this.rows;x++)for(let M=0;M<this.columns;M++)this.set(x,M,this.get(x,M)<<w.get(x,M));return this},_.leftShift=function(w,x){return new b(w).leftShift(x)},_.prototype.signPropagatingRightShift=function(w){return typeof w=="number"?this.signPropagatingRightShiftS(w):this.signPropagatingRightShiftM(w)},_.prototype.signPropagatingRightShiftS=function(w){for(let x=0;x<this.rows;x++)for(let M=0;M<this.columns;M++)this.set(x,M,this.get(x,M)>>w);return this},_.prototype.signPropagatingRightShiftM=function(w){if(w=b.checkMatrix(w),this.rows!==w.rows||this.columns!==w.columns)throw new RangeError("Matrices dimensions must be equal");for(let x=0;x<this.rows;x++)for(let M=0;M<this.columns;M++)this.set(x,M,this.get(x,M)>>w.get(x,M));return this},_.signPropagatingRightShift=function(w,x){return new b(w).signPropagatingRightShift(x)},_.prototype.rightShift=function(w){return typeof w=="number"?this.rightShiftS(w):this.rightShiftM(w)},_.prototype.rightShiftS=function(w){for(let x=0;x<this.rows;x++)for(let M=0;M<this.columns;M++)this.set(x,M,this.get(x,M)>>>w);return this},_.prototype.rightShiftM=function(w){if(w=b.checkMatrix(w),this.rows!==w.rows||this.columns!==w.columns)throw new RangeError("Matrices dimensions must be equal");for(let x=0;x<this.rows;x++)for(let M=0;M<this.columns;M++)this.set(x,M,this.get(x,M)>>>w.get(x,M));return this},_.rightShift=function(w,x){return new b(w).rightShift(x)},_.prototype.zeroFillRightShift=_.prototype.rightShift,_.prototype.zeroFillRightShiftS=_.prototype.rightShiftS,_.prototype.zeroFillRightShiftM=_.prototype.rightShiftM,_.zeroFillRightShift=_.rightShift,_.prototype.not=function(){for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.set(w,x,~this.get(w,x));return this},_.not=function(w){return new b(w).not()},_.prototype.abs=function(){for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.set(w,x,Math.abs(this.get(w,x)));return this},_.abs=function(w){return new b(w).abs()},_.prototype.acos=function(){for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.set(w,x,Math.acos(this.get(w,x)));return this},_.acos=function(w){return new b(w).acos()},_.prototype.acosh=function(){for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.set(w,x,Math.acosh(this.get(w,x)));return this},_.acosh=function(w){return new b(w).acosh()},_.prototype.asin=function(){for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.set(w,x,Math.asin(this.get(w,x)));return this},_.asin=function(w){return new b(w).asin()},_.prototype.asinh=function(){for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.set(w,x,Math.asinh(this.get(w,x)));return this},_.asinh=function(w){return new b(w).asinh()},_.prototype.atan=function(){for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.set(w,x,Math.atan(this.get(w,x)));return this},_.atan=function(w){return new b(w).atan()},_.prototype.atanh=function(){for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.set(w,x,Math.atanh(this.get(w,x)));return this},_.atanh=function(w){return new b(w).atanh()},_.prototype.cbrt=function(){for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.set(w,x,Math.cbrt(this.get(w,x)));return this},_.cbrt=function(w){return new b(w).cbrt()},_.prototype.ceil=function(){for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.set(w,x,Math.ceil(this.get(w,x)));return this},_.ceil=function(w){return new b(w).ceil()},_.prototype.clz32=function(){for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.set(w,x,Math.clz32(this.get(w,x)));return this},_.clz32=function(w){return new b(w).clz32()},_.prototype.cos=function(){for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.set(w,x,Math.cos(this.get(w,x)));return this},_.cos=function(w){return new b(w).cos()},_.prototype.cosh=function(){for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.set(w,x,Math.cosh(this.get(w,x)));return this},_.cosh=function(w){return new b(w).cosh()},_.prototype.exp=function(){for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.set(w,x,Math.exp(this.get(w,x)));return this},_.exp=function(w){return new b(w).exp()},_.prototype.expm1=function(){for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.set(w,x,Math.expm1(this.get(w,x)));return this},_.expm1=function(w){return new b(w).expm1()},_.prototype.floor=function(){for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.set(w,x,Math.floor(this.get(w,x)));return this},_.floor=function(w){return new b(w).floor()},_.prototype.fround=function(){for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.set(w,x,Math.fround(this.get(w,x)));return this},_.fround=function(w){return new b(w).fround()},_.prototype.log=function(){for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.set(w,x,Math.log(this.get(w,x)));return this},_.log=function(w){return new b(w).log()},_.prototype.log1p=function(){for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.set(w,x,Math.log1p(this.get(w,x)));return this},_.log1p=function(w){return new b(w).log1p()},_.prototype.log10=function(){for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.set(w,x,Math.log10(this.get(w,x)));return this},_.log10=function(w){return new b(w).log10()},_.prototype.log2=function(){for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.set(w,x,Math.log2(this.get(w,x)));return this},_.log2=function(w){return new b(w).log2()},_.prototype.round=function(){for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.set(w,x,Math.round(this.get(w,x)));return this},_.round=function(w){return new b(w).round()},_.prototype.sign=function(){for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.set(w,x,Math.sign(this.get(w,x)));return this},_.sign=function(w){return new b(w).sign()},_.prototype.sin=function(){for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.set(w,x,Math.sin(this.get(w,x)));return this},_.sin=function(w){return new b(w).sin()},_.prototype.sinh=function(){for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.set(w,x,Math.sinh(this.get(w,x)));return this},_.sinh=function(w){return new b(w).sinh()},_.prototype.sqrt=function(){for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.set(w,x,Math.sqrt(this.get(w,x)));return this},_.sqrt=function(w){return new b(w).sqrt()},_.prototype.tan=function(){for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.set(w,x,Math.tan(this.get(w,x)));return this},_.tan=function(w){return new b(w).tan()},_.prototype.tanh=function(){for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.set(w,x,Math.tanh(this.get(w,x)));return this},_.tanh=function(w){return new b(w).tanh()},_.prototype.trunc=function(){for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.set(w,x,Math.trunc(this.get(w,x)));return this},_.trunc=function(w){return new b(w).trunc()},_.pow=function(w,x){return new b(w).pow(x)},_.prototype.pow=function(w){return typeof w=="number"?this.powS(w):this.powM(w)},_.prototype.powS=function(w){for(let x=0;x<this.rows;x++)for(let M=0;M<this.columns;M++)this.set(x,M,this.get(x,M)**w);return this},_.prototype.powM=function(w){if(w=b.checkMatrix(w),this.rows!==w.rows||this.columns!==w.columns)throw new RangeError("Matrices dimensions must be equal");for(let x=0;x<this.rows;x++)for(let M=0;M<this.columns;M++)this.set(x,M,this.get(x,M)**w.get(x,M));return this}}function c(_,b,E){let w=E?_.rows:_.rows-1;if(b<0||b>w)throw new RangeError("Row index out of range")}function u(_,b,E){let w=E?_.columns:_.columns-1;if(b<0||b>w)throw new RangeError("Column index out of range")}function h(_,b){if(b.to1DArray&&(b=b.to1DArray()),b.length!==_.columns)throw new RangeError("vector size must be the same as the number of columns");return b}function d(_,b){if(b.to1DArray&&(b=b.to1DArray()),b.length!==_.rows)throw new RangeError("vector size must be the same as the number of rows");return b}function f(_,b){if(!r.isAnyArray(b))throw new TypeError("row indices must be an array");for(let E=0;E<b.length;E++)if(b[E]<0||b[E]>=_.rows)throw new RangeError("row indices are out of range")}function g(_,b){if(!r.isAnyArray(b))throw new TypeError("column indices must be an array");for(let E=0;E<b.length;E++)if(b[E]<0||b[E]>=_.columns)throw new RangeError("column indices are out of range")}function p(_,b,E,w,x){if(arguments.length!==5)throw new RangeError("expected 4 arguments");if(y("startRow",b),y("endRow",E),y("startColumn",w),y("endColumn",x),b>E||w>x||b<0||b>=_.rows||E<0||E>=_.rows||w<0||w>=_.columns||x<0||x>=_.columns)throw new RangeError("Submatrix indices are out of range")}function v(_,b=0){let E=[];for(let w=0;w<_;w++)E.push(b);return E}function y(_,b){if(typeof b!="number")throw new TypeError(`${_} must be a number`)}function m(_){if(_.isEmpty())throw new Error("Empty matrix has no elements to index")}function B(_){let b=v(_.rows);for(let E=0;E<_.rows;++E)for(let w=0;w<_.columns;++w)b[E]+=_.get(E,w);return b}function C(_){let b=v(_.columns);for(let E=0;E<_.rows;++E)for(let w=0;w<_.columns;++w)b[w]+=_.get(E,w);return b}function S(_){let b=0;for(let E=0;E<_.rows;E++)for(let w=0;w<_.columns;w++)b+=_.get(E,w);return b}function F(_){let b=v(_.rows,1);for(let E=0;E<_.rows;++E)for(let w=0;w<_.columns;++w)b[E]*=_.get(E,w);return b}function T(_){let b=v(_.columns,1);for(let E=0;E<_.rows;++E)for(let w=0;w<_.columns;++w)b[w]*=_.get(E,w);return b}function O(_){let b=1;for(let E=0;E<_.rows;E++)for(let w=0;w<_.columns;w++)b*=_.get(E,w);return b}function I(_,b,E){const w=_.rows,x=_.columns,M=[];for(let L=0;L<w;L++){let Q=0,P=0,R=0;for(let J=0;J<x;J++)R=_.get(L,J)-E[L],Q+=R,P+=R*R;b?M.push((P-Q*Q/x)/(x-1)):M.push((P-Q*Q/x)/x)}return M}function k(_,b,E){const w=_.rows,x=_.columns,M=[];for(let L=0;L<x;L++){let Q=0,P=0,R=0;for(let J=0;J<w;J++)R=_.get(J,L)-E[L],Q+=R,P+=R*R;b?M.push((P-Q*Q/w)/(w-1)):M.push((P-Q*Q/w)/w)}return M}function N(_,b,E){const w=_.rows,x=_.columns,M=w*x;let L=0,Q=0,P=0;for(let R=0;R<w;R++)for(let J=0;J<x;J++)P=_.get(R,J)-E,L+=P,Q+=P*P;return b?(Q-L*L/M)/(M-1):(Q-L*L/M)/M}function U(_,b){for(let E=0;E<_.rows;E++)for(let w=0;w<_.columns;w++)_.set(E,w,_.get(E,w)-b[E])}function D(_,b){for(let E=0;E<_.rows;E++)for(let w=0;w<_.columns;w++)_.set(E,w,_.get(E,w)-b[w])}function G(_,b){for(let E=0;E<_.rows;E++)for(let w=0;w<_.columns;w++)_.set(E,w,_.get(E,w)-b)}function Z(_){const b=[];for(let E=0;E<_.rows;E++){let w=0;for(let x=0;x<_.columns;x++)w+=_.get(E,x)**2/(_.columns-1);b.push(Math.sqrt(w))}return b}function q(_,b){for(let E=0;E<_.rows;E++)for(let w=0;w<_.columns;w++)_.set(E,w,_.get(E,w)/b[E])}function j(_){const b=[];for(let E=0;E<_.columns;E++){let w=0;for(let x=0;x<_.rows;x++)w+=_.get(x,E)**2/(_.rows-1);b.push(Math.sqrt(w))}return b}function te(_,b){for(let E=0;E<_.rows;E++)for(let w=0;w<_.columns;w++)_.set(E,w,_.get(E,w)/b[w])}function ue(_){const b=_.size-1;let E=0;for(let w=0;w<_.columns;w++)for(let x=0;x<_.rows;x++)E+=_.get(x,w)**2/b;return Math.sqrt(E)}function ge(_,b){for(let E=0;E<_.rows;E++)for(let w=0;w<_.columns;w++)_.set(E,w,_.get(E,w)/b)}class Y{static from1DArray(b,E,w){if(b*E!==w.length)throw new RangeError("data length does not match given dimensions");let M=new K(b,E);for(let L=0;L<b;L++)for(let Q=0;Q<E;Q++)M.set(L,Q,w[L*E+Q]);return M}static rowVector(b){let E=new K(1,b.length);for(let w=0;w<b.length;w++)E.set(0,w,b[w]);return E}static columnVector(b){let E=new K(b.length,1);for(let w=0;w<b.length;w++)E.set(w,0,b[w]);return E}static zeros(b,E){return new K(b,E)}static ones(b,E){return new K(b,E).fill(1)}static rand(b,E,w={}){if(typeof w!="object")throw new TypeError("options must be an object");const{random:x=Math.random}=w;let M=new K(b,E);for(let L=0;L<b;L++)for(let Q=0;Q<E;Q++)M.set(L,Q,x());return M}static randInt(b,E,w={}){if(typeof w!="object")throw new TypeError("options must be an object");const{min:x=0,max:M=1e3,random:L=Math.random}=w;if(!Number.isInteger(x))throw new TypeError("min must be an integer");if(!Number.isInteger(M))throw new TypeError("max must be an integer");if(x>=M)throw new RangeError("min must be smaller than max");let Q=M-x,P=new K(b,E);for(let R=0;R<b;R++)for(let J=0;J<E;J++){let z=x+Math.round(L()*Q);P.set(R,J,z)}return P}static eye(b,E,w){E===void 0&&(E=b),w===void 0&&(w=1);let x=Math.min(b,E),M=this.zeros(b,E);for(let L=0;L<x;L++)M.set(L,L,w);return M}static diag(b,E,w){let x=b.length;E===void 0&&(E=x),w===void 0&&(w=E);let M=Math.min(x,E,w),L=this.zeros(E,w);for(let Q=0;Q<M;Q++)L.set(Q,Q,b[Q]);return L}static min(b,E){b=this.checkMatrix(b),E=this.checkMatrix(E);let w=b.rows,x=b.columns,M=new K(w,x);for(let L=0;L<w;L++)for(let Q=0;Q<x;Q++)M.set(L,Q,Math.min(b.get(L,Q),E.get(L,Q)));return M}static max(b,E){b=this.checkMatrix(b),E=this.checkMatrix(E);let w=b.rows,x=b.columns,M=new this(w,x);for(let L=0;L<w;L++)for(let Q=0;Q<x;Q++)M.set(L,Q,Math.max(b.get(L,Q),E.get(L,Q)));return M}static checkMatrix(b){return Y.isMatrix(b)?b:new K(b)}static isMatrix(b){return b!=null&&b.klass==="Matrix"}get size(){return this.rows*this.columns}apply(b){if(typeof b!="function")throw new TypeError("callback must be a function");for(let E=0;E<this.rows;E++)for(let w=0;w<this.columns;w++)b.call(this,E,w);return this}to1DArray(){let b=[];for(let E=0;E<this.rows;E++)for(let w=0;w<this.columns;w++)b.push(this.get(E,w));return b}to2DArray(){let b=[];for(let E=0;E<this.rows;E++){b.push([]);for(let w=0;w<this.columns;w++)b[E].push(this.get(E,w))}return b}toJSON(){return this.to2DArray()}isRowVector(){return this.rows===1}isColumnVector(){return this.columns===1}isVector(){return this.rows===1||this.columns===1}isSquare(){return this.rows===this.columns}isEmpty(){return this.rows===0||this.columns===0}isSymmetric(){if(this.isSquare()){for(let b=0;b<this.rows;b++)for(let E=0;E<=b;E++)if(this.get(b,E)!==this.get(E,b))return!1;return!0}return!1}isDistance(){if(!this.isSymmetric())return!1;for(let b=0;b<this.rows;b++)if(this.get(b,b)!==0)return!1;return!0}isEchelonForm(){let b=0,E=0,w=-1,x=!0,M=!1;for(;b<this.rows&&x;){for(E=0,M=!1;E<this.columns&&M===!1;)this.get(b,E)===0?E++:this.get(b,E)===1&&E>w?(M=!0,w=E):(x=!1,M=!0);b++}return x}isReducedEchelonForm(){let b=0,E=0,w=-1,x=!0,M=!1;for(;b<this.rows&&x;){for(E=0,M=!1;E<this.columns&&M===!1;)this.get(b,E)===0?E++:this.get(b,E)===1&&E>w?(M=!0,w=E):(x=!1,M=!0);for(let L=E+1;L<this.rows;L++)this.get(b,L)!==0&&(x=!1);b++}return x}echelonForm(){let b=this.clone(),E=0,w=0;for(;E<b.rows&&w<b.columns;){let x=E;for(let M=E;M<b.rows;M++)b.get(M,w)>b.get(x,w)&&(x=M);if(b.get(x,w)===0)w++;else{b.swapRows(E,x);let M=b.get(E,w);for(let L=w;L<b.columns;L++)b.set(E,L,b.get(E,L)/M);for(let L=E+1;L<b.rows;L++){let Q=b.get(L,w)/b.get(E,w);b.set(L,w,0);for(let P=w+1;P<b.columns;P++)b.set(L,P,b.get(L,P)-b.get(E,P)*Q)}E++,w++}}return b}reducedEchelonForm(){let b=this.echelonForm(),E=b.columns,w=b.rows,x=w-1;for(;x>=0;)if(b.maxRow(x)===0)x--;else{let M=0,L=!1;for(;M<w&&L===!1;)b.get(x,M)===1?L=!0:M++;for(let Q=0;Q<x;Q++){let P=b.get(Q,M);for(let R=M;R<E;R++){let J=b.get(Q,R)-P*b.get(x,R);b.set(Q,R,J)}}x--}return b}set(){throw new Error("set method is unimplemented")}get(){throw new Error("get method is unimplemented")}repeat(b={}){if(typeof b!="object")throw new TypeError("options must be an object");const{rows:E=1,columns:w=1}=b;if(!Number.isInteger(E)||E<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(w)||w<=0)throw new TypeError("columns must be a positive integer");let x=new K(this.rows*E,this.columns*w);for(let M=0;M<E;M++)for(let L=0;L<w;L++)x.setSubMatrix(this,this.rows*M,this.columns*L);return x}fill(b){for(let E=0;E<this.rows;E++)for(let w=0;w<this.columns;w++)this.set(E,w,b);return this}neg(){return this.mulS(-1)}getRow(b){c(this,b);let E=[];for(let w=0;w<this.columns;w++)E.push(this.get(b,w));return E}getRowVector(b){return K.rowVector(this.getRow(b))}setRow(b,E){c(this,b),E=h(this,E);for(let w=0;w<this.columns;w++)this.set(b,w,E[w]);return this}swapRows(b,E){c(this,b),c(this,E);for(let w=0;w<this.columns;w++){let x=this.get(b,w);this.set(b,w,this.get(E,w)),this.set(E,w,x)}return this}getColumn(b){u(this,b);let E=[];for(let w=0;w<this.rows;w++)E.push(this.get(w,b));return E}getColumnVector(b){return K.columnVector(this.getColumn(b))}setColumn(b,E){u(this,b),E=d(this,E);for(let w=0;w<this.rows;w++)this.set(w,b,E[w]);return this}swapColumns(b,E){u(this,b),u(this,E);for(let w=0;w<this.rows;w++){let x=this.get(w,b);this.set(w,b,this.get(w,E)),this.set(w,E,x)}return this}addRowVector(b){b=h(this,b);for(let E=0;E<this.rows;E++)for(let w=0;w<this.columns;w++)this.set(E,w,this.get(E,w)+b[w]);return this}subRowVector(b){b=h(this,b);for(let E=0;E<this.rows;E++)for(let w=0;w<this.columns;w++)this.set(E,w,this.get(E,w)-b[w]);return this}mulRowVector(b){b=h(this,b);for(let E=0;E<this.rows;E++)for(let w=0;w<this.columns;w++)this.set(E,w,this.get(E,w)*b[w]);return this}divRowVector(b){b=h(this,b);for(let E=0;E<this.rows;E++)for(let w=0;w<this.columns;w++)this.set(E,w,this.get(E,w)/b[w]);return this}addColumnVector(b){b=d(this,b);for(let E=0;E<this.rows;E++)for(let w=0;w<this.columns;w++)this.set(E,w,this.get(E,w)+b[E]);return this}subColumnVector(b){b=d(this,b);for(let E=0;E<this.rows;E++)for(let w=0;w<this.columns;w++)this.set(E,w,this.get(E,w)-b[E]);return this}mulColumnVector(b){b=d(this,b);for(let E=0;E<this.rows;E++)for(let w=0;w<this.columns;w++)this.set(E,w,this.get(E,w)*b[E]);return this}divColumnVector(b){b=d(this,b);for(let E=0;E<this.rows;E++)for(let w=0;w<this.columns;w++)this.set(E,w,this.get(E,w)/b[E]);return this}mulRow(b,E){c(this,b);for(let w=0;w<this.columns;w++)this.set(b,w,this.get(b,w)*E);return this}mulColumn(b,E){u(this,b);for(let w=0;w<this.rows;w++)this.set(w,b,this.get(w,b)*E);return this}max(b){if(this.isEmpty())return NaN;switch(b){case"row":{const E=new Array(this.rows).fill(Number.NEGATIVE_INFINITY);for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.get(w,x)>E[w]&&(E[w]=this.get(w,x));return E}case"column":{const E=new Array(this.columns).fill(Number.NEGATIVE_INFINITY);for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.get(w,x)>E[x]&&(E[x]=this.get(w,x));return E}case void 0:{let E=this.get(0,0);for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.get(w,x)>E&&(E=this.get(w,x));return E}default:throw new Error(`invalid option: ${b}`)}}maxIndex(){m(this);let b=this.get(0,0),E=[0,0];for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.get(w,x)>b&&(b=this.get(w,x),E[0]=w,E[1]=x);return E}min(b){if(this.isEmpty())return NaN;switch(b){case"row":{const E=new Array(this.rows).fill(Number.POSITIVE_INFINITY);for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.get(w,x)<E[w]&&(E[w]=this.get(w,x));return E}case"column":{const E=new Array(this.columns).fill(Number.POSITIVE_INFINITY);for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.get(w,x)<E[x]&&(E[x]=this.get(w,x));return E}case void 0:{let E=this.get(0,0);for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.get(w,x)<E&&(E=this.get(w,x));return E}default:throw new Error(`invalid option: ${b}`)}}minIndex(){m(this);let b=this.get(0,0),E=[0,0];for(let w=0;w<this.rows;w++)for(let x=0;x<this.columns;x++)this.get(w,x)<b&&(b=this.get(w,x),E[0]=w,E[1]=x);return E}maxRow(b){if(c(this,b),this.isEmpty())return NaN;let E=this.get(b,0);for(let w=1;w<this.columns;w++)this.get(b,w)>E&&(E=this.get(b,w));return E}maxRowIndex(b){c(this,b),m(this);let E=this.get(b,0),w=[b,0];for(let x=1;x<this.columns;x++)this.get(b,x)>E&&(E=this.get(b,x),w[1]=x);return w}minRow(b){if(c(this,b),this.isEmpty())return NaN;let E=this.get(b,0);for(let w=1;w<this.columns;w++)this.get(b,w)<E&&(E=this.get(b,w));return E}minRowIndex(b){c(this,b),m(this);let E=this.get(b,0),w=[b,0];for(let x=1;x<this.columns;x++)this.get(b,x)<E&&(E=this.get(b,x),w[1]=x);return w}maxColumn(b){if(u(this,b),this.isEmpty())return NaN;let E=this.get(0,b);for(let w=1;w<this.rows;w++)this.get(w,b)>E&&(E=this.get(w,b));return E}maxColumnIndex(b){u(this,b),m(this);let E=this.get(0,b),w=[0,b];for(let x=1;x<this.rows;x++)this.get(x,b)>E&&(E=this.get(x,b),w[0]=x);return w}minColumn(b){if(u(this,b),this.isEmpty())return NaN;let E=this.get(0,b);for(let w=1;w<this.rows;w++)this.get(w,b)<E&&(E=this.get(w,b));return E}minColumnIndex(b){u(this,b),m(this);let E=this.get(0,b),w=[0,b];for(let x=1;x<this.rows;x++)this.get(x,b)<E&&(E=this.get(x,b),w[0]=x);return w}diag(){let b=Math.min(this.rows,this.columns),E=[];for(let w=0;w<b;w++)E.push(this.get(w,w));return E}norm(b="frobenius"){switch(b){case"max":return this.max();case"frobenius":return Math.sqrt(this.dot(this));default:throw new RangeError(`unknown norm type: ${b}`)}}cumulativeSum(){let b=0;for(let E=0;E<this.rows;E++)for(let w=0;w<this.columns;w++)b+=this.get(E,w),this.set(E,w,b);return this}dot(b){Y.isMatrix(b)&&(b=b.to1DArray());let E=this.to1DArray();if(E.length!==b.length)throw new RangeError("vectors do not have the same size");let w=0;for(let x=0;x<E.length;x++)w+=E[x]*b[x];return w}mmul(b){b=K.checkMatrix(b);let E=this.rows,w=this.columns,x=b.columns,M=new K(E,x),L=new Float64Array(w);for(let Q=0;Q<x;Q++){for(let P=0;P<w;P++)L[P]=b.get(P,Q);for(let P=0;P<E;P++){let R=0;for(let J=0;J<w;J++)R+=this.get(P,J)*L[J];M.set(P,Q,R)}}return M}mpow(b){if(!this.isSquare())throw new RangeError("Matrix must be square");if(!Number.isInteger(b)||b<0)throw new RangeError("Exponent must be a non-negative integer");let E=K.eye(this.rows),w=this;for(let x=b;x>=1;x/=2)(x&1)!==0&&(E=E.mmul(w)),w=w.mmul(w);return E}strassen2x2(b){b=K.checkMatrix(b);let E=new K(2,2);const w=this.get(0,0),x=b.get(0,0),M=this.get(0,1),L=b.get(0,1),Q=this.get(1,0),P=b.get(1,0),R=this.get(1,1),J=b.get(1,1),z=(w+R)*(x+J),ae=(Q+R)*x,me=w*(L-J),ne=R*(P-x),Ae=(w+M)*J,Ce=(Q-w)*(x+L),V=(M-R)*(P+J),ye=z+ne-Ae+V,Oe=me+Ae,ze=ae+ne,Ye=z-ae+me+Ce;return E.set(0,0,ye),E.set(0,1,Oe),E.set(1,0,ze),E.set(1,1,Ye),E}strassen3x3(b){b=K.checkMatrix(b);let E=new K(3,3);const w=this.get(0,0),x=this.get(0,1),M=this.get(0,2),L=this.get(1,0),Q=this.get(1,1),P=this.get(1,2),R=this.get(2,0),J=this.get(2,1),z=this.get(2,2),ae=b.get(0,0),me=b.get(0,1),ne=b.get(0,2),Ae=b.get(1,0),Ce=b.get(1,1),V=b.get(1,2),ye=b.get(2,0),Oe=b.get(2,1),ze=b.get(2,2),Ye=(w+x+M-L-Q-J-z)*Ce,Wt=(w-L)*(-me+Ce),Qe=Q*(-ae+me+Ae-Ce-V-ye+ze),Re=(-w+L+Q)*(ae-me+Ce),_t=(L+Q)*(-ae+me),W=w*ae,de=(-w+R+J)*(ae-ne+V),Se=(-w+R)*(ne-V),pe=(R+J)*(-ae+ne),qt=(w+x+M-Q-P-R-J)*V,xt=J*(-ae+ne+Ae-Ce-V-ye+Oe),Gt=(-M+J+z)*(Ce+ye-Oe),$t=(M-z)*(Ce-Oe),$n=M*ye,_i=(J+z)*(-ye+Oe),In=(-M+Q+P)*(V+ye-ze),ra=(M-P)*(V-ze),Fa=(Q+P)*(-ye+ze),lt=x*Ae,Yn=P*Oe,Wr=L*ne,qr=R*me,_n=z*ze,Wse=W+$n+lt,qse=Ye+Re+_t+W+Gt+$n+_i,$se=W+de+pe+qt+$n+In+Fa,Yse=Wt+Qe+Re+W+$n+In+ra,Xse=Wt+Re+_t+W+Yn,Zse=$n+In+ra+Fa+Wr,Jse=W+de+Se+xt+Gt+$t+$n,eoe=Gt+$t+$n+_i+qr,toe=W+de+Se+pe+_n;return E.set(0,0,Wse),E.set(0,1,qse),E.set(0,2,$se),E.set(1,0,Yse),E.set(1,1,Xse),E.set(1,2,Zse),E.set(2,0,Jse),E.set(2,1,eoe),E.set(2,2,toe),E}mmulStrassen(b){b=K.checkMatrix(b);let E=this.clone(),w=E.rows,x=E.columns,M=b.rows,L=b.columns;x!==M&&console.warn(`Multiplying ${w} x ${x} and ${M} x ${L} matrix: dimensions do not match.`);function Q(z,ae,me){let ne=z.rows,Ae=z.columns;if(ne===ae&&Ae===me)return z;{let Ce=Y.zeros(ae,me);return Ce=Ce.setSubMatrix(z,0,0),Ce}}let P=Math.max(w,M),R=Math.max(x,L);E=Q(E,P,R),b=Q(b,P,R);function J(z,ae,me,ne){if(me<=512||ne<=512)return z.mmul(ae);me%2===1&&ne%2===1?(z=Q(z,me+1,ne+1),ae=Q(ae,me+1,ne+1)):me%2===1?(z=Q(z,me+1,ne),ae=Q(ae,me+1,ne)):ne%2===1&&(z=Q(z,me,ne+1),ae=Q(ae,me,ne+1));let Ae=parseInt(z.rows/2,10),Ce=parseInt(z.columns/2,10),V=z.subMatrix(0,Ae-1,0,Ce-1),ye=ae.subMatrix(0,Ae-1,0,Ce-1),Oe=z.subMatrix(0,Ae-1,Ce,z.columns-1),ze=ae.subMatrix(0,Ae-1,Ce,ae.columns-1),Ye=z.subMatrix(Ae,z.rows-1,0,Ce-1),Wt=ae.subMatrix(Ae,ae.rows-1,0,Ce-1),Qe=z.subMatrix(Ae,z.rows-1,Ce,z.columns-1),Re=ae.subMatrix(Ae,ae.rows-1,Ce,ae.columns-1),_t=J(Y.add(V,Qe),Y.add(ye,Re),Ae,Ce),W=J(Y.add(Ye,Qe),ye,Ae,Ce),de=J(V,Y.sub(ze,Re),Ae,Ce),Se=J(Qe,Y.sub(Wt,ye),Ae,Ce),pe=J(Y.add(V,Oe),Re,Ae,Ce),qt=J(Y.sub(Ye,V),Y.add(ye,ze),Ae,Ce),xt=J(Y.sub(Oe,Qe),Y.add(Wt,Re),Ae,Ce),Gt=Y.add(_t,Se);Gt.sub(pe),Gt.add(xt);let $t=Y.add(de,pe),$n=Y.add(W,Se),_i=Y.sub(_t,W);_i.add(de),_i.add(qt);let In=Y.zeros(2*Gt.rows,2*Gt.columns);return In=In.setSubMatrix(Gt,0,0),In=In.setSubMatrix($t,Gt.rows,0),In=In.setSubMatrix($n,0,Gt.columns),In=In.setSubMatrix(_i,Gt.rows,Gt.columns),In.subMatrix(0,me-1,0,ne-1)}return J(E,b,P,R)}scaleRows(b={}){if(typeof b!="object")throw new TypeError("options must be an object");const{min:E=0,max:w=1}=b;if(!Number.isFinite(E))throw new TypeError("min must be a number");if(!Number.isFinite(w))throw new TypeError("max must be a number");if(E>=w)throw new RangeError("min must be smaller than max");let x=new K(this.rows,this.columns);for(let M=0;M<this.rows;M++){const L=this.getRow(M);L.length>0&&e(L,{min:E,max:w,output:L}),x.setRow(M,L)}return x}scaleColumns(b={}){if(typeof b!="object")throw new TypeError("options must be an object");const{min:E=0,max:w=1}=b;if(!Number.isFinite(E))throw new TypeError("min must be a number");if(!Number.isFinite(w))throw new TypeError("max must be a number");if(E>=w)throw new RangeError("min must be smaller than max");let x=new K(this.rows,this.columns);for(let M=0;M<this.columns;M++){const L=this.getColumn(M);L.length&&e(L,{min:E,max:w,output:L}),x.setColumn(M,L)}return x}flipRows(){const b=Math.ceil(this.columns/2);for(let E=0;E<this.rows;E++)for(let w=0;w<b;w++){let x=this.get(E,w),M=this.get(E,this.columns-1-w);this.set(E,w,M),this.set(E,this.columns-1-w,x)}return this}flipColumns(){const b=Math.ceil(this.rows/2);for(let E=0;E<this.columns;E++)for(let w=0;w<b;w++){let x=this.get(w,E),M=this.get(this.rows-1-w,E);this.set(w,E,M),this.set(this.rows-1-w,E,x)}return this}kroneckerProduct(b){b=K.checkMatrix(b);let E=this.rows,w=this.columns,x=b.rows,M=b.columns,L=new K(E*x,w*M);for(let Q=0;Q<E;Q++)for(let P=0;P<w;P++)for(let R=0;R<x;R++)for(let J=0;J<M;J++)L.set(x*Q+R,M*P+J,this.get(Q,P)*b.get(R,J));return L}kroneckerSum(b){if(b=K.checkMatrix(b),!this.isSquare()||!b.isSquare())throw new Error("Kronecker Sum needs two Square Matrices");let E=this.rows,w=b.rows,x=this.kroneckerProduct(K.eye(w,w)),M=K.eye(E,E).kroneckerProduct(b);return x.add(M)}transpose(){let b=new K(this.columns,this.rows);for(let E=0;E<this.rows;E++)for(let w=0;w<this.columns;w++)b.set(w,E,this.get(E,w));return b}sortRows(b=xe){for(let E=0;E<this.rows;E++)this.setRow(E,this.getRow(E).sort(b));return this}sortColumns(b=xe){for(let E=0;E<this.columns;E++)this.setColumn(E,this.getColumn(E).sort(b));return this}subMatrix(b,E,w,x){p(this,b,E,w,x);let M=new K(E-b+1,x-w+1);for(let L=b;L<=E;L++)for(let Q=w;Q<=x;Q++)M.set(L-b,Q-w,this.get(L,Q));return M}subMatrixRow(b,E,w){if(E===void 0&&(E=0),w===void 0&&(w=this.columns-1),E>w||E<0||E>=this.columns||w<0||w>=this.columns)throw new RangeError("Argument out of range");let x=new K(b.length,w-E+1);for(let M=0;M<b.length;M++)for(let L=E;L<=w;L++){if(b[M]<0||b[M]>=this.rows)throw new RangeError(`Row index out of range: ${b[M]}`);x.set(M,L-E,this.get(b[M],L))}return x}subMatrixColumn(b,E,w){if(E===void 0&&(E=0),w===void 0&&(w=this.rows-1),E>w||E<0||E>=this.rows||w<0||w>=this.rows)throw new RangeError("Argument out of range");let x=new K(w-E+1,b.length);for(let M=0;M<b.length;M++)for(let L=E;L<=w;L++){if(b[M]<0||b[M]>=this.columns)throw new RangeError(`Column index out of range: ${b[M]}`);x.set(L-E,M,this.get(L,b[M]))}return x}setSubMatrix(b,E,w){if(b=K.checkMatrix(b),b.isEmpty())return this;let x=E+b.rows-1,M=w+b.columns-1;p(this,E,x,w,M);for(let L=0;L<b.rows;L++)for(let Q=0;Q<b.columns;Q++)this.set(E+L,w+Q,b.get(L,Q));return this}selection(b,E){f(this,b),g(this,E);let w=new K(b.length,E.length);for(let x=0;x<b.length;x++){let M=b[x];for(let L=0;L<E.length;L++){let Q=E[L];w.set(x,L,this.get(M,Q))}}return w}trace(){let b=Math.min(this.rows,this.columns),E=0;for(let w=0;w<b;w++)E+=this.get(w,w);return E}clone(){return this.constructor.copy(this,new K(this.rows,this.columns))}static copy(b,E){for(const[w,x,M]of b.entries())E.set(w,x,M);return E}sum(b){switch(b){case"row":return B(this);case"column":return C(this);case void 0:return S(this);default:throw new Error(`invalid option: ${b}`)}}product(b){switch(b){case"row":return F(this);case"column":return T(this);case void 0:return O(this);default:throw new Error(`invalid option: ${b}`)}}mean(b){const E=this.sum(b);switch(b){case"row":{for(let w=0;w<this.rows;w++)E[w]/=this.columns;return E}case"column":{for(let w=0;w<this.columns;w++)E[w]/=this.rows;return E}case void 0:return E/this.size;default:throw new Error(`invalid option: ${b}`)}}variance(b,E={}){if(typeof b=="object"&&(E=b,b=void 0),typeof E!="object")throw new TypeError("options must be an object");const{unbiased:w=!0,mean:x=this.mean(b)}=E;if(typeof w!="boolean")throw new TypeError("unbiased must be a boolean");switch(b){case"row":{if(!r.isAnyArray(x))throw new TypeError("mean must be an array");return I(this,w,x)}case"column":{if(!r.isAnyArray(x))throw new TypeError("mean must be an array");return k(this,w,x)}case void 0:{if(typeof x!="number")throw new TypeError("mean must be a number");return N(this,w,x)}default:throw new Error(`invalid option: ${b}`)}}standardDeviation(b,E){typeof b=="object"&&(E=b,b=void 0);const w=this.variance(b,E);if(b===void 0)return Math.sqrt(w);for(let x=0;x<w.length;x++)w[x]=Math.sqrt(w[x]);return w}center(b,E={}){if(typeof b=="object"&&(E=b,b=void 0),typeof E!="object")throw new TypeError("options must be an object");const{center:w=this.mean(b)}=E;switch(b){case"row":{if(!r.isAnyArray(w))throw new TypeError("center must be an array");return U(this,w),this}case"column":{if(!r.isAnyArray(w))throw new TypeError("center must be an array");return D(this,w),this}case void 0:{if(typeof w!="number")throw new TypeError("center must be a number");return G(this,w),this}default:throw new Error(`invalid option: ${b}`)}}scale(b,E={}){if(typeof b=="object"&&(E=b,b=void 0),typeof E!="object")throw new TypeError("options must be an object");let w=E.scale;switch(b){case"row":{if(w===void 0)w=Z(this);else if(!r.isAnyArray(w))throw new TypeError("scale must be an array");return q(this,w),this}case"column":{if(w===void 0)w=j(this);else if(!r.isAnyArray(w))throw new TypeError("scale must be an array");return te(this,w),this}case void 0:{if(w===void 0)w=ue(this);else if(typeof w!="number")throw new TypeError("scale must be a number");return ge(this,w),this}default:throw new Error(`invalid option: ${b}`)}}toString(b){return a(this,b)}[Symbol.iterator](){return this.entries()}*entries(){for(let b=0;b<this.rows;b++)for(let E=0;E<this.columns;E++)yield[b,E,this.get(b,E)]}*values(){for(let b=0;b<this.rows;b++)for(let E=0;E<this.columns;E++)yield this.get(b,E)}}Y.prototype.klass="Matrix",typeof Symbol<"u"&&(Y.prototype[Symbol.for("nodejs.util.inspect.custom")]=i);function xe(_,b){return _-b}function $(_){return _.every(b=>typeof b=="number")}Y.random=Y.rand,Y.randomInt=Y.randInt,Y.diagonal=Y.diag,Y.prototype.diagonal=Y.prototype.diag,Y.identity=Y.eye,Y.prototype.negate=Y.prototype.neg,Y.prototype.tensorProduct=Y.prototype.kroneckerProduct;class K extends Y{data;#e(b,E){if(this.data=[],Number.isInteger(E)&&E>=0)for(let w=0;w<b;w++)this.data.push(new Float64Array(E));else throw new TypeError("nColumns must be a positive integer");this.rows=b,this.columns=E}constructor(b,E){if(super(),K.isMatrix(b))this.#e(b.rows,b.columns),K.copy(b,this);else if(Number.isInteger(b)&&b>=0)this.#e(b,E);else if(r.isAnyArray(b)){const w=b;if(b=w.length,E=b?w[0].length:0,typeof E!="number")throw new TypeError("Data must be a 2D array with at least one element");this.data=[];for(let x=0;x<b;x++){if(w[x].length!==E)throw new RangeError("Inconsistent array dimensions");if(!$(w[x]))throw new TypeError("Input data contains non-numeric values");this.data.push(Float64Array.from(w[x]))}this.rows=b,this.columns=E}else throw new TypeError("First argument must be a positive number or an array")}set(b,E,w){return this.data[b][E]=w,this}get(b,E){return this.data[b][E]}removeRow(b){return c(this,b),this.data.splice(b,1),this.rows-=1,this}addRow(b,E){return E===void 0&&(E=b,b=this.rows),c(this,b,!0),E=Float64Array.from(h(this,E)),this.data.splice(b,0,E),this.rows+=1,this}removeColumn(b){u(this,b);for(let E=0;E<this.rows;E++){const w=new Float64Array(this.columns-1);for(let x=0;x<b;x++)w[x]=this.data[E][x];for(let x=b+1;x<this.columns;x++)w[x-1]=this.data[E][x];this.data[E]=w}return this.columns-=1,this}addColumn(b,E){typeof E>"u"&&(E=b,b=this.columns),u(this,b,!0),E=d(this,E);for(let w=0;w<this.rows;w++){const x=new Float64Array(this.columns+1);let M=0;for(;M<b;M++)x[M]=this.data[w][M];for(x[M++]=E[w];M<this.columns+1;M++)x[M]=this.data[w][M-1];this.data[w]=x}return this.columns+=1,this}}l(Y,K);class ee extends Y{#e;get size(){return this.#e.size}get rows(){return this.#e.rows}get columns(){return this.#e.columns}get diagonalSize(){return this.rows}static isSymmetricMatrix(b){return K.isMatrix(b)&&b.klassType==="SymmetricMatrix"}static zeros(b){return new this(b)}static ones(b){return new this(b).fill(1)}constructor(b){if(super(),K.isMatrix(b)){if(!b.isSymmetric())throw new TypeError("not symmetric data");this.#e=K.copy(b,new K(b.rows,b.rows))}else if(Number.isInteger(b)&&b>=0)this.#e=new K(b,b);else if(this.#e=new K(b),!this.isSymmetric())throw new TypeError("not symmetric data")}clone(){const b=new ee(this.diagonalSize);for(const[E,w,x]of this.upperRightEntries())b.set(E,w,x);return b}toMatrix(){return new K(this)}get(b,E){return this.#e.get(b,E)}set(b,E,w){return this.#e.set(b,E,w),this.#e.set(E,b,w),this}removeCross(b){return this.#e.removeRow(b),this.#e.removeColumn(b),this}addCross(b,E){E===void 0&&(E=b,b=this.diagonalSize);const w=E.slice();return w.splice(b,1),this.#e.addRow(b,w),this.#e.addColumn(b,E),this}applyMask(b){if(b.length!==this.diagonalSize)throw new RangeError("Mask size do not match with matrix size");const E=[];for(const[w,x]of b.entries())x||E.push(w);E.reverse();for(const w of E)this.removeCross(w);return this}toCompact(){const{diagonalSize:b}=this,E=new Array(b*(b+1)/2);for(let w=0,x=0,M=0;M<E.length;M++)E[M]=this.get(x,w),++w>=b&&(w=++x);return E}static fromCompact(b){const E=b.length,w=(Math.sqrt(8*E+1)-1)/2;if(!Number.isInteger(w))throw new TypeError(`This array is not a compact representation of a Symmetric Matrix, ${JSON.stringify(b)}`);const x=new ee(w);for(let M=0,L=0,Q=0;Q<E;Q++)x.set(M,L,b[Q]),++M>=w&&(M=++L);return x}*upperRightEntries(){for(let b=0,E=0;b<this.diagonalSize;void 0){const w=this.get(b,E);yield[b,E,w],++E>=this.diagonalSize&&(E=++b)}}*upperRightValues(){for(let b=0,E=0;b<this.diagonalSize;void 0)yield this.get(b,E),++E>=this.diagonalSize&&(E=++b)}}ee.prototype.klassType="SymmetricMatrix";class oe extends ee{static isDistanceMatrix(b){return ee.isSymmetricMatrix(b)&&b.klassSubType==="DistanceMatrix"}constructor(b){if(super(b),!this.isDistance())throw new TypeError("Provided arguments do no produce a distance matrix")}set(b,E,w){return b===E&&(w=0),super.set(b,E,w)}addCross(b,E){return E===void 0&&(E=b,b=this.diagonalSize),E=E.slice(),E[b]=0,super.addCross(b,E)}toSymmetricMatrix(){return new ee(this)}clone(){const b=new oe(this.diagonalSize);for(const[E,w,x]of this.upperRightEntries())E!==w&&b.set(E,w,x);return b}toCompact(){const{diagonalSize:b}=this,E=(b-1)*b/2,w=new Array(E);for(let x=1,M=0,L=0;L<w.length;L++)w[L]=this.get(M,x),++x>=b&&(x=++M+1);return w}static fromCompact(b){const E=b.length;if(E===0)return new this(0);const w=(Math.sqrt(8*E+1)+1)/2;if(!Number.isInteger(w))throw new TypeError(`This array is not a compact representation of a DistanceMatrix, ${JSON.stringify(b)}`);const x=new this(w);for(let M=1,L=0,Q=0;Q<E;Q++)x.set(M,L,b[Q]),++M>=w&&(M=++L+1);return x}}oe.prototype.klassSubType="DistanceMatrix";class Ee extends Y{constructor(b,E,w){super(),this.matrix=b,this.rows=E,this.columns=w}}class Le extends Ee{constructor(b,E){u(b,E),super(b,b.rows,1),this.column=E}set(b,E,w){return this.matrix.set(b,this.column,w),this}get(b){return this.matrix.get(b,this.column)}}class Pe extends Ee{constructor(b,E){g(b,E),super(b,b.rows,E.length),this.columnIndices=E}set(b,E,w){return this.matrix.set(b,this.columnIndices[E],w),this}get(b,E){return this.matrix.get(b,this.columnIndices[E])}}class st extends Ee{constructor(b){super(b,b.rows,b.columns)}set(b,E,w){return this.matrix.set(b,this.columns-E-1,w),this}get(b,E){return this.matrix.get(b,this.columns-E-1)}}class ut extends Ee{constructor(b){super(b,b.rows,b.columns)}set(b,E,w){return this.matrix.set(this.rows-b-1,E,w),this}get(b,E){return this.matrix.get(this.rows-b-1,E)}}class ht extends Ee{constructor(b,E){c(b,E),super(b,1,b.columns),this.row=E}set(b,E,w){return this.matrix.set(this.row,E,w),this}get(b,E){return this.matrix.get(this.row,E)}}class Et extends Ee{constructor(b,E){f(b,E),super(b,E.length,b.columns),this.rowIndices=E}set(b,E,w){return this.matrix.set(this.rowIndices[b],E,w),this}get(b,E){return this.matrix.get(this.rowIndices[b],E)}}class Ue extends Ee{constructor(b,E,w){f(b,E),g(b,w),super(b,E.length,w.length),this.rowIndices=E,this.columnIndices=w}set(b,E,w){return this.matrix.set(this.rowIndices[b],this.columnIndices[E],w),this}get(b,E){return this.matrix.get(this.rowIndices[b],this.columnIndices[E])}}class vt extends Ee{constructor(b,E,w,x,M){p(b,E,w,x,M),super(b,w-E+1,M-x+1),this.startRow=E,this.startColumn=x}set(b,E,w){return this.matrix.set(this.startRow+b,this.startColumn+E,w),this}get(b,E){return this.matrix.get(this.startRow+b,this.startColumn+E)}}class it extends Ee{constructor(b){super(b,b.columns,b.rows)}set(b,E,w){return this.matrix.set(E,b,w),this}get(b,E){return this.matrix.get(E,b)}}class _r extends Y{constructor(b,E={}){const{rows:w=1}=E;if(b.length%w!==0)throw new Error("the data length is not divisible by the number of rows");super(),this.rows=w,this.columns=b.length/w,this.data=b}set(b,E,w){let x=this._calculateIndex(b,E);return this.data[x]=w,this}get(b,E){let w=this._calculateIndex(b,E);return this.data[w]}_calculateIndex(b,E){return b*this.columns+E}}class It extends Y{constructor(b){super(),this.data=b,this.rows=b.length,this.columns=b[0].length}set(b,E,w){return this.data[b][E]=w,this}get(b,E){return this.data[b][E]}}function Ca(_,b){if(r.isAnyArray(_))return _[0]&&r.isAnyArray(_[0])?new It(_):new _r(_,b);throw new Error("the argument is not an array")}class vr{constructor(b){b=It.checkMatrix(b);let E=b.clone(),w=E.rows,x=E.columns,M=new Float64Array(w),L=1,Q,P,R,J,z,ae,me,ne,Ae;for(Q=0;Q<w;Q++)M[Q]=Q;for(ne=new Float64Array(w),P=0;P<x;P++){for(Q=0;Q<w;Q++)ne[Q]=E.get(Q,P);for(Q=0;Q<w;Q++){for(Ae=Math.min(Q,P),z=0,R=0;R<Ae;R++)z+=E.get(Q,R)*ne[R];ne[Q]-=z,E.set(Q,P,ne[Q])}for(J=P,Q=P+1;Q<w;Q++)Math.abs(ne[Q])>Math.abs(ne[J])&&(J=Q);if(J!==P){for(R=0;R<x;R++)ae=E.get(J,R),E.set(J,R,E.get(P,R)),E.set(P,R,ae);me=M[J],M[J]=M[P],M[P]=me,L=-L}if(P<w&&E.get(P,P)!==0)for(Q=P+1;Q<w;Q++)E.set(Q,P,E.get(Q,P)/E.get(P,P))}this.LU=E,this.pivotVector=M,this.pivotSign=L}isSingular(){let b=this.LU,E=b.columns;for(let w=0;w<E;w++)if(b.get(w,w)===0)return!0;return!1}solve(b){b=K.checkMatrix(b);let E=this.LU;if(E.rows!==b.rows)throw new Error("Invalid matrix dimensions");if(this.isSingular())throw new Error("LU matrix is singular");let x=b.columns,M=b.subMatrixRow(this.pivotVector,0,x-1),L=E.columns,Q,P,R;for(R=0;R<L;R++)for(Q=R+1;Q<L;Q++)for(P=0;P<x;P++)M.set(Q,P,M.get(Q,P)-M.get(R,P)*E.get(Q,R));for(R=L-1;R>=0;R--){for(P=0;P<x;P++)M.set(R,P,M.get(R,P)/E.get(R,R));for(Q=0;Q<R;Q++)for(P=0;P<x;P++)M.set(Q,P,M.get(Q,P)-M.get(R,P)*E.get(Q,R))}return M}get determinant(){let b=this.LU;if(!b.isSquare())throw new Error("Matrix must be square");let E=this.pivotSign,w=b.columns;for(let x=0;x<w;x++)E*=b.get(x,x);return E}get lowerTriangularMatrix(){let b=this.LU,E=b.rows,w=b.columns,x=new K(E,w);for(let M=0;M<E;M++)for(let L=0;L<w;L++)M>L?x.set(M,L,b.get(M,L)):M===L?x.set(M,L,1):x.set(M,L,0);return x}get upperTriangularMatrix(){let b=this.LU,E=b.rows,w=b.columns,x=new K(E,w);for(let M=0;M<E;M++)for(let L=0;L<w;L++)M<=L?x.set(M,L,b.get(M,L)):x.set(M,L,0);return x}get pivotPermutationVector(){return Array.from(this.pivotVector)}}function tn(_,b){let E=0;return Math.abs(_)>Math.abs(b)?(E=b/_,Math.abs(_)*Math.sqrt(1+E*E)):b!==0?(E=_/b,Math.abs(b)*Math.sqrt(1+E*E)):0}class Qt{constructor(b){b=It.checkMatrix(b);let E=b.clone(),w=b.rows,x=b.columns,M=new Float64Array(x),L,Q,P,R;for(P=0;P<x;P++){let J=0;for(L=P;L<w;L++)J=tn(J,E.get(L,P));if(J!==0){for(E.get(P,P)<0&&(J=-J),L=P;L<w;L++)E.set(L,P,E.get(L,P)/J);for(E.set(P,P,E.get(P,P)+1),Q=P+1;Q<x;Q++){for(R=0,L=P;L<w;L++)R+=E.get(L,P)*E.get(L,Q);for(R=-R/E.get(P,P),L=P;L<w;L++)E.set(L,Q,E.get(L,Q)+R*E.get(L,P))}}M[P]=-J}this.QR=E,this.Rdiag=M}solve(b){b=K.checkMatrix(b);let E=this.QR,w=E.rows;if(b.rows!==w)throw new Error("Matrix row dimensions must agree");if(!this.isFullRank())throw new Error("Matrix is rank deficient");let x=b.columns,M=b.clone(),L=E.columns,Q,P,R,J;for(R=0;R<L;R++)for(P=0;P<x;P++){for(J=0,Q=R;Q<w;Q++)J+=E.get(Q,R)*M.get(Q,P);for(J=-J/E.get(R,R),Q=R;Q<w;Q++)M.set(Q,P,M.get(Q,P)+J*E.get(Q,R))}for(R=L-1;R>=0;R--){for(P=0;P<x;P++)M.set(R,P,M.get(R,P)/this.Rdiag[R]);for(Q=0;Q<R;Q++)for(P=0;P<x;P++)M.set(Q,P,M.get(Q,P)-M.get(R,P)*E.get(Q,R))}return M.subMatrix(0,L-1,0,x-1)}isFullRank(){let b=this.QR.columns;for(let E=0;E<b;E++)if(this.Rdiag[E]===0)return!1;return!0}get upperTriangularMatrix(){let b=this.QR,E=b.columns,w=new K(E,E),x,M;for(x=0;x<E;x++)for(M=0;M<E;M++)x<M?w.set(x,M,b.get(x,M)):x===M?w.set(x,M,this.Rdiag[x]):w.set(x,M,0);return w}get orthogonalMatrix(){let b=this.QR,E=b.rows,w=b.columns,x=new K(E,w),M,L,Q,P;for(Q=w-1;Q>=0;Q--){for(M=0;M<E;M++)x.set(M,Q,0);for(x.set(Q,Q,1),L=Q;L<w;L++)if(b.get(Q,Q)!==0){for(P=0,M=Q;M<E;M++)P+=b.get(M,Q)*x.get(M,L);for(P=-P/b.get(Q,Q),M=Q;M<E;M++)x.set(M,L,x.get(M,L)+P*b.get(M,Q))}}return x}}class qn{constructor(b,E={}){if(b=It.checkMatrix(b),b.isEmpty())throw new Error("Matrix must be non-empty");let w=b.rows,x=b.columns;const{computeLeftSingularVectors:M=!0,computeRightSingularVectors:L=!0,autoTranspose:Q=!1}=E;let P=!!M,R=!!L,J=!1,z;if(w<x)if(!Q)z=b.clone(),console.warn("Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose");else{z=b.transpose(),w=z.rows,x=z.columns,J=!0;let W=P;P=R,R=W}else z=b.clone();let ae=Math.min(w,x),me=Math.min(w+1,x),ne=new Float64Array(me),Ae=new K(w,ae),Ce=new K(x,x),V=new Float64Array(x),ye=new Float64Array(w),Oe=new Float64Array(me);for(let W=0;W<me;W++)Oe[W]=W;let ze=Math.min(w-1,x),Ye=Math.max(0,Math.min(x-2,w)),Wt=Math.max(ze,Ye);for(let W=0;W<Wt;W++){if(W<ze){ne[W]=0;for(let de=W;de<w;de++)ne[W]=tn(ne[W],z.get(de,W));if(ne[W]!==0){z.get(W,W)<0&&(ne[W]=-ne[W]);for(let de=W;de<w;de++)z.set(de,W,z.get(de,W)/ne[W]);z.set(W,W,z.get(W,W)+1)}ne[W]=-ne[W]}for(let de=W+1;de<x;de++){if(W<ze&&ne[W]!==0){let Se=0;for(let pe=W;pe<w;pe++)Se+=z.get(pe,W)*z.get(pe,de);Se=-Se/z.get(W,W);for(let pe=W;pe<w;pe++)z.set(pe,de,z.get(pe,de)+Se*z.get(pe,W))}V[de]=z.get(W,de)}if(P&&W<ze)for(let de=W;de<w;de++)Ae.set(de,W,z.get(de,W));if(W<Ye){V[W]=0;for(let de=W+1;de<x;de++)V[W]=tn(V[W],V[de]);if(V[W]!==0){V[W+1]<0&&(V[W]=0-V[W]);for(let de=W+1;de<x;de++)V[de]/=V[W];V[W+1]+=1}if(V[W]=-V[W],W+1<w&&V[W]!==0){for(let de=W+1;de<w;de++)ye[de]=0;for(let de=W+1;de<w;de++)for(let Se=W+1;Se<x;Se++)ye[de]+=V[Se]*z.get(de,Se);for(let de=W+1;de<x;de++){let Se=-V[de]/V[W+1];for(let pe=W+1;pe<w;pe++)z.set(pe,de,z.get(pe,de)+Se*ye[pe])}}if(R)for(let de=W+1;de<x;de++)Ce.set(de,W,V[de])}}let Qe=Math.min(x,w+1);if(ze<x&&(ne[ze]=z.get(ze,ze)),w<Qe&&(ne[Qe-1]=0),Ye+1<Qe&&(V[Ye]=z.get(Ye,Qe-1)),V[Qe-1]=0,P){for(let W=ze;W<ae;W++){for(let de=0;de<w;de++)Ae.set(de,W,0);Ae.set(W,W,1)}for(let W=ze-1;W>=0;W--)if(ne[W]!==0){for(let de=W+1;de<ae;de++){let Se=0;for(let pe=W;pe<w;pe++)Se+=Ae.get(pe,W)*Ae.get(pe,de);Se=-Se/Ae.get(W,W);for(let pe=W;pe<w;pe++)Ae.set(pe,de,Ae.get(pe,de)+Se*Ae.get(pe,W))}for(let de=W;de<w;de++)Ae.set(de,W,-Ae.get(de,W));Ae.set(W,W,1+Ae.get(W,W));for(let de=0;de<W-1;de++)Ae.set(de,W,0)}else{for(let de=0;de<w;de++)Ae.set(de,W,0);Ae.set(W,W,1)}}if(R)for(let W=x-1;W>=0;W--){if(W<Ye&&V[W]!==0)for(let de=W+1;de<x;de++){let Se=0;for(let pe=W+1;pe<x;pe++)Se+=Ce.get(pe,W)*Ce.get(pe,de);Se=-Se/Ce.get(W+1,W);for(let pe=W+1;pe<x;pe++)Ce.set(pe,de,Ce.get(pe,de)+Se*Ce.get(pe,W))}for(let de=0;de<x;de++)Ce.set(de,W,0);Ce.set(W,W,1)}let Re=Qe-1,_t=Number.EPSILON;for(;Qe>0;){let W,de;for(W=Qe-2;W>=-1&&W!==-1;W--){const Se=Number.MIN_VALUE+_t*Math.abs(ne[W]+Math.abs(ne[W+1]));if(Math.abs(V[W])<=Se||Number.isNaN(V[W])){V[W]=0;break}}if(W===Qe-2)de=4;else{let Se;for(Se=Qe-1;Se>=W&&Se!==W;Se--){let pe=(Se!==Qe?Math.abs(V[Se]):0)+(Se!==W+1?Math.abs(V[Se-1]):0);if(Math.abs(ne[Se])<=_t*pe){ne[Se]=0;break}}Se===W?de=3:Se===Qe-1?de=1:(de=2,W=Se)}switch(W++,de){case 1:{let Se=V[Qe-2];V[Qe-2]=0;for(let pe=Qe-2;pe>=W;pe--){let qt=tn(ne[pe],Se),xt=ne[pe]/qt,Gt=Se/qt;if(ne[pe]=qt,pe!==W&&(Se=-Gt*V[pe-1],V[pe-1]=xt*V[pe-1]),R)for(let $t=0;$t<x;$t++)qt=xt*Ce.get($t,pe)+Gt*Ce.get($t,Qe-1),Ce.set($t,Qe-1,-Gt*Ce.get($t,pe)+xt*Ce.get($t,Qe-1)),Ce.set($t,pe,qt)}break}case 2:{let Se=V[W-1];V[W-1]=0;for(let pe=W;pe<Qe;pe++){let qt=tn(ne[pe],Se),xt=ne[pe]/qt,Gt=Se/qt;if(ne[pe]=qt,Se=-Gt*V[pe],V[pe]=xt*V[pe],P)for(let $t=0;$t<w;$t++)qt=xt*Ae.get($t,pe)+Gt*Ae.get($t,W-1),Ae.set($t,W-1,-Gt*Ae.get($t,pe)+xt*Ae.get($t,W-1)),Ae.set($t,pe,qt)}break}case 3:{const Se=Math.max(Math.abs(ne[Qe-1]),Math.abs(ne[Qe-2]),Math.abs(V[Qe-2]),Math.abs(ne[W]),Math.abs(V[W])),pe=ne[Qe-1]/Se,qt=ne[Qe-2]/Se,xt=V[Qe-2]/Se,Gt=ne[W]/Se,$t=V[W]/Se,$n=((qt+pe)*(qt-pe)+xt*xt)/2,_i=pe*xt*(pe*xt);let In=0;($n!==0||_i!==0)&&($n<0?In=0-Math.sqrt($n*$n+_i):In=Math.sqrt($n*$n+_i),In=_i/($n+In));let ra=(Gt+pe)*(Gt-pe)+In,Fa=Gt*$t;for(let lt=W;lt<Qe-1;lt++){let Yn=tn(ra,Fa);Yn===0&&(Yn=Number.MIN_VALUE);let Wr=ra/Yn,qr=Fa/Yn;if(lt!==W&&(V[lt-1]=Yn),ra=Wr*ne[lt]+qr*V[lt],V[lt]=Wr*V[lt]-qr*ne[lt],Fa=qr*ne[lt+1],ne[lt+1]=Wr*ne[lt+1],R)for(let _n=0;_n<x;_n++)Yn=Wr*Ce.get(_n,lt)+qr*Ce.get(_n,lt+1),Ce.set(_n,lt+1,-qr*Ce.get(_n,lt)+Wr*Ce.get(_n,lt+1)),Ce.set(_n,lt,Yn);if(Yn=tn(ra,Fa),Yn===0&&(Yn=Number.MIN_VALUE),Wr=ra/Yn,qr=Fa/Yn,ne[lt]=Yn,ra=Wr*V[lt]+qr*ne[lt+1],ne[lt+1]=-qr*V[lt]+Wr*ne[lt+1],Fa=qr*V[lt+1],V[lt+1]=Wr*V[lt+1],P&&lt<w-1)for(let _n=0;_n<w;_n++)Yn=Wr*Ae.get(_n,lt)+qr*Ae.get(_n,lt+1),Ae.set(_n,lt+1,-qr*Ae.get(_n,lt)+Wr*Ae.get(_n,lt+1)),Ae.set(_n,lt,Yn)}V[Qe-2]=ra;break}case 4:{if(ne[W]<=0&&(ne[W]=ne[W]<0?-ne[W]:0,R))for(let Se=0;Se<=Re;Se++)Ce.set(Se,W,-Ce.get(Se,W));for(;W<Re&&!(ne[W]>=ne[W+1]);){let Se=ne[W];if(ne[W]=ne[W+1],ne[W+1]=Se,R&&W<x-1)for(let pe=0;pe<x;pe++)Se=Ce.get(pe,W+1),Ce.set(pe,W+1,Ce.get(pe,W)),Ce.set(pe,W,Se);if(P&&W<w-1)for(let pe=0;pe<w;pe++)Se=Ae.get(pe,W+1),Ae.set(pe,W+1,Ae.get(pe,W)),Ae.set(pe,W,Se);W++}Qe--;break}}}if(J){let W=Ce;Ce=Ae,Ae=W}this.m=w,this.n=x,this.s=ne,this.U=Ae,this.V=Ce}solve(b){let E=b,w=this.threshold,x=this.s.length,M=K.zeros(x,x);for(let ae=0;ae<x;ae++)Math.abs(this.s[ae])<=w?M.set(ae,ae,0):M.set(ae,ae,1/this.s[ae]);let L=this.U,Q=this.rightSingularVectors,P=Q.mmul(M),R=Q.rows,J=L.rows,z=K.zeros(R,J);for(let ae=0;ae<R;ae++)for(let me=0;me<J;me++){let ne=0;for(let Ae=0;Ae<x;Ae++)ne+=P.get(ae,Ae)*L.get(me,Ae);z.set(ae,me,ne)}return z.mmul(E)}solveForDiagonal(b){return this.solve(K.diag(b))}inverse(){let b=this.V,E=this.threshold,w=b.rows,x=b.columns,M=new K(w,this.s.length);for(let J=0;J<w;J++)for(let z=0;z<x;z++)Math.abs(this.s[z])>E&&M.set(J,z,b.get(J,z)/this.s[z]);let L=this.U,Q=L.rows,P=L.columns,R=new K(w,Q);for(let J=0;J<w;J++)for(let z=0;z<Q;z++){let ae=0;for(let me=0;me<P;me++)ae+=M.get(J,me)*L.get(z,me);R.set(J,z,ae)}return R}get condition(){return this.s[0]/this.s[Math.min(this.m,this.n)-1]}get norm2(){return this.s[0]}get rank(){let b=Math.max(this.m,this.n)*this.s[0]*Number.EPSILON,E=0,w=this.s;for(let x=0,M=w.length;x<M;x++)w[x]>b&&E++;return E}get diagonal(){return Array.from(this.s)}get threshold(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}get leftSingularVectors(){return this.U}get rightSingularVectors(){return this.V}get diagonalMatrix(){return K.diag(this.s)}}function sr(_,b=!1){return _=It.checkMatrix(_),b?new qn(_).inverse():kr(_,K.eye(_.rows))}function kr(_,b,E=!1){return _=It.checkMatrix(_),b=It.checkMatrix(b),E?new qn(_).solve(b):_.isSquare()?new vr(_).solve(b):new Qt(_).solve(b)}function yr(_){if(_=K.checkMatrix(_),_.isSquare()){if(_.columns===0)return 1;let b,E,w,x;if(_.columns===2)return b=_.get(0,0),E=_.get(0,1),w=_.get(1,0),x=_.get(1,1),b*x-E*w;if(_.columns===3){let M,L,Q;return M=new Ue(_,[1,2],[1,2]),L=new Ue(_,[1,2],[0,2]),Q=new Ue(_,[1,2],[0,1]),b=_.get(0,0),E=_.get(0,1),w=_.get(0,2),b*yr(M)-E*yr(L)+w*yr(Q)}else return new vr(_).determinant}else throw Error("determinant can only be calculated for a square matrix")}function or(_,b){let E=[];for(let w=0;w<_;w++)w!==b&&E.push(w);return E}function fn(_,b,E,w=1e-9,x=1e-9){if(_>x)return new Array(b.rows+1).fill(0);{let M=b.addRow(E,[0]);for(let L=0;L<M.rows;L++)Math.abs(M.get(L,0))<w&&M.set(L,0,0);return M.to1DArray()}}function gn(_,b={}){const{thresholdValue:E=1e-9,thresholdError:w=1e-9}=b;_=K.checkMatrix(_);let x=_.rows,M=new K(x,x);for(let L=0;L<x;L++){let Q=K.columnVector(_.getRow(L)),P=_.subMatrixRow(or(x,L)).transpose(),J=new qn(P).solve(Q),z=K.sub(Q,P.mmul(J)).abs().max();M.setRow(L,fn(z,J,L,E,w))}return M}function tc(_,b=Number.EPSILON){if(_=K.checkMatrix(_),_.isEmpty())return _.transpose();let E=new qn(_,{autoTranspose:!0}),w=E.leftSingularVectors,x=E.rightSingularVectors,M=E.diagonal;for(let L=0;L<M.length;L++)Math.abs(M[L])>b?M[L]=1/M[L]:M[L]=0;return x.mmul(K.diag(M).mmul(w.transpose()))}function co(_,b=_,E={}){_=new K(_);let w=!1;if(typeof b=="object"&&!K.isMatrix(b)&&!r.isAnyArray(b)?(E=b,b=_,w=!0):b=new K(b),_.rows!==b.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:x=!0}=E;x&&(_=_.center("column"),w||(b=b.center("column")));const M=_.transpose().mmul(b);for(let L=0;L<M.rows;L++)for(let Q=0;Q<M.columns;Q++)M.set(L,Q,M.get(L,Q)*(1/(_.rows-1)));return M}function jr(_,b=_,E={}){_=new K(_);let w=!1;if(typeof b=="object"&&!K.isMatrix(b)&&!r.isAnyArray(b)?(E=b,b=_,w=!0):b=new K(b),_.rows!==b.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:x=!0,scale:M=!0}=E;x&&(_.center("column"),w||b.center("column")),M&&(_.scale("column"),w||b.scale("column"));const L=_.standardDeviation("column",{unbiased:!0}),Q=w?L:b.standardDeviation("column",{unbiased:!0}),P=_.transpose().mmul(b);for(let R=0;R<P.rows;R++)for(let J=0;J<P.columns;J++)P.set(R,J,P.get(R,J)*(1/(L[R]*Q[J]))*(1/(_.rows-1)));return P}class hi{constructor(b,E={}){const{assumeSymmetric:w=!1}=E;if(b=It.checkMatrix(b),!b.isSquare())throw new Error("Matrix is not a square matrix");if(b.isEmpty())throw new Error("Matrix must be non-empty");let x=b.columns,M=new K(x,x),L=new Float64Array(x),Q=new Float64Array(x),P=b,R,J,z=!1;if(w?z=!0:z=b.isSymmetric(),z){for(R=0;R<x;R++)for(J=0;J<x;J++)M.set(R,J,P.get(R,J));Tf(x,Q,L,M),Mf(x,Q,L,M)}else{let ae=new K(x,x),me=new Float64Array(x);for(J=0;J<x;J++)for(R=0;R<x;R++)ae.set(R,J,P.get(R,J));_b(x,ae,me,M),Of(x,Q,L,M,ae)}this.n=x,this.e=Q,this.d=L,this.V=M}get realEigenvalues(){return Array.from(this.d)}get imaginaryEigenvalues(){return Array.from(this.e)}get eigenvectorMatrix(){return this.V}get diagonalMatrix(){let b=this.n,E=this.e,w=this.d,x=new K(b,b),M,L;for(M=0;M<b;M++){for(L=0;L<b;L++)x.set(M,L,0);x.set(M,M,w[M]),E[M]>0?x.set(M,M+1,E[M]):E[M]<0&&x.set(M,M-1,E[M])}return x}}function Tf(_,b,E,w){let x,M,L,Q,P,R,J,z;for(P=0;P<_;P++)E[P]=w.get(_-1,P);for(Q=_-1;Q>0;Q--){for(z=0,L=0,R=0;R<Q;R++)z=z+Math.abs(E[R]);if(z===0)for(b[Q]=E[Q-1],P=0;P<Q;P++)E[P]=w.get(Q-1,P),w.set(Q,P,0),w.set(P,Q,0);else{for(R=0;R<Q;R++)E[R]/=z,L+=E[R]*E[R];for(x=E[Q-1],M=Math.sqrt(L),x>0&&(M=-M),b[Q]=z*M,L=L-x*M,E[Q-1]=x-M,P=0;P<Q;P++)b[P]=0;for(P=0;P<Q;P++){for(x=E[P],w.set(P,Q,x),M=b[P]+w.get(P,P)*x,R=P+1;R<=Q-1;R++)M+=w.get(R,P)*E[R],b[R]+=w.get(R,P)*x;b[P]=M}for(x=0,P=0;P<Q;P++)b[P]/=L,x+=b[P]*E[P];for(J=x/(L+L),P=0;P<Q;P++)b[P]-=J*E[P];for(P=0;P<Q;P++){for(x=E[P],M=b[P],R=P;R<=Q-1;R++)w.set(R,P,w.get(R,P)-(x*b[R]+M*E[R]));E[P]=w.get(Q-1,P),w.set(Q,P,0)}}E[Q]=L}for(Q=0;Q<_-1;Q++){if(w.set(_-1,Q,w.get(Q,Q)),w.set(Q,Q,1),L=E[Q+1],L!==0){for(R=0;R<=Q;R++)E[R]=w.get(R,Q+1)/L;for(P=0;P<=Q;P++){for(M=0,R=0;R<=Q;R++)M+=w.get(R,Q+1)*w.get(R,P);for(R=0;R<=Q;R++)w.set(R,P,w.get(R,P)-M*E[R])}}for(R=0;R<=Q;R++)w.set(R,Q+1,0)}for(P=0;P<_;P++)E[P]=w.get(_-1,P),w.set(_-1,P,0);w.set(_-1,_-1,1),b[0]=0}function Mf(_,b,E,w){let x,M,L,Q,P,R,J,z,ae,me,ne,Ae,Ce,V,ye,Oe;for(L=1;L<_;L++)b[L-1]=b[L];b[_-1]=0;let ze=0,Ye=0,Wt=Number.EPSILON;for(R=0;R<_;R++){for(Ye=Math.max(Ye,Math.abs(E[R])+Math.abs(b[R])),J=R;J<_&&!(Math.abs(b[J])<=Wt*Ye);)J++;if(J>R)do{for(x=E[R],z=(E[R+1]-x)/(2*b[R]),ae=tn(z,1),z<0&&(ae=-ae),E[R]=b[R]/(z+ae),E[R+1]=b[R]*(z+ae),me=E[R+1],M=x-E[R],L=R+2;L<_;L++)E[L]-=M;for(ze=ze+M,z=E[J],ne=1,Ae=ne,Ce=ne,V=b[R+1],ye=0,Oe=0,L=J-1;L>=R;L--)for(Ce=Ae,Ae=ne,Oe=ye,x=ne*b[L],M=ne*z,ae=tn(z,b[L]),b[L+1]=ye*ae,ye=b[L]/ae,ne=z/ae,z=ne*E[L]-ye*x,E[L+1]=M+ye*(ne*x+ye*E[L]),P=0;P<_;P++)M=w.get(P,L+1),w.set(P,L+1,ye*w.get(P,L)+ne*M),w.set(P,L,ne*w.get(P,L)-ye*M);z=-ye*Oe*Ce*V*b[R]/me,b[R]=ye*z,E[R]=ne*z}while(Math.abs(b[R])>Wt*Ye);E[R]=E[R]+ze,b[R]=0}for(L=0;L<_-1;L++){for(P=L,z=E[L],Q=L+1;Q<_;Q++)E[Q]<z&&(P=Q,z=E[Q]);if(P!==L)for(E[P]=E[L],E[L]=z,Q=0;Q<_;Q++)z=w.get(Q,L),w.set(Q,L,w.get(Q,P)),w.set(Q,P,z)}}function _b(_,b,E,w){let x=0,M=_-1,L,Q,P,R,J,z,ae;for(z=x+1;z<=M-1;z++){for(ae=0,R=z;R<=M;R++)ae=ae+Math.abs(b.get(R,z-1));if(ae!==0){for(P=0,R=M;R>=z;R--)E[R]=b.get(R,z-1)/ae,P+=E[R]*E[R];for(Q=Math.sqrt(P),E[z]>0&&(Q=-Q),P=P-E[z]*Q,E[z]=E[z]-Q,J=z;J<_;J++){for(L=0,R=M;R>=z;R--)L+=E[R]*b.get(R,J);for(L=L/P,R=z;R<=M;R++)b.set(R,J,b.get(R,J)-L*E[R])}for(R=0;R<=M;R++){for(L=0,J=M;J>=z;J--)L+=E[J]*b.get(R,J);for(L=L/P,J=z;J<=M;J++)b.set(R,J,b.get(R,J)-L*E[J])}E[z]=ae*E[z],b.set(z,z-1,ae*Q)}}for(R=0;R<_;R++)for(J=0;J<_;J++)w.set(R,J,R===J?1:0);for(z=M-1;z>=x+1;z--)if(b.get(z,z-1)!==0){for(R=z+1;R<=M;R++)E[R]=b.get(R,z-1);for(J=z;J<=M;J++){for(Q=0,R=z;R<=M;R++)Q+=E[R]*w.get(R,J);for(Q=Q/E[z]/b.get(z,z-1),R=z;R<=M;R++)w.set(R,J,w.get(R,J)+Q*E[R])}}}function Of(_,b,E,w,x){let M=_-1,L=0,Q=_-1,P=Number.EPSILON,R=0,J=0,z=0,ae=0,me=0,ne=0,Ae=0,Ce=0,V,ye,Oe,ze,Ye,Wt,Qe,Re,_t,W,de,Se,pe,qt,xt;for(V=0;V<_;V++)for((V<L||V>Q)&&(E[V]=x.get(V,V),b[V]=0),ye=Math.max(V-1,0);ye<_;ye++)J=J+Math.abs(x.get(V,ye));for(;M>=L;){for(ze=M;ze>L&&(ne=Math.abs(x.get(ze-1,ze-1))+Math.abs(x.get(ze,ze)),ne===0&&(ne=J),!(Math.abs(x.get(ze,ze-1))<P*ne));)ze--;if(ze===M)x.set(M,M,x.get(M,M)+R),E[M]=x.get(M,M),b[M]=0,M--,Ce=0;else if(ze===M-1){if(Qe=x.get(M,M-1)*x.get(M-1,M),z=(x.get(M-1,M-1)-x.get(M,M))/2,ae=z*z+Qe,Ae=Math.sqrt(Math.abs(ae)),x.set(M,M,x.get(M,M)+R),x.set(M-1,M-1,x.get(M-1,M-1)+R),Re=x.get(M,M),ae>=0){for(Ae=z>=0?z+Ae:z-Ae,E[M-1]=Re+Ae,E[M]=E[M-1],Ae!==0&&(E[M]=Re-Qe/Ae),b[M-1]=0,b[M]=0,Re=x.get(M,M-1),ne=Math.abs(Re)+Math.abs(Ae),z=Re/ne,ae=Ae/ne,me=Math.sqrt(z*z+ae*ae),z=z/me,ae=ae/me,ye=M-1;ye<_;ye++)Ae=x.get(M-1,ye),x.set(M-1,ye,ae*Ae+z*x.get(M,ye)),x.set(M,ye,ae*x.get(M,ye)-z*Ae);for(V=0;V<=M;V++)Ae=x.get(V,M-1),x.set(V,M-1,ae*Ae+z*x.get(V,M)),x.set(V,M,ae*x.get(V,M)-z*Ae);for(V=L;V<=Q;V++)Ae=w.get(V,M-1),w.set(V,M-1,ae*Ae+z*w.get(V,M)),w.set(V,M,ae*w.get(V,M)-z*Ae)}else E[M-1]=Re+z,E[M]=Re+z,b[M-1]=Ae,b[M]=-Ae;M=M-2,Ce=0}else{if(Re=x.get(M,M),_t=0,Qe=0,ze<M&&(_t=x.get(M-1,M-1),Qe=x.get(M,M-1)*x.get(M-1,M)),Ce===10){for(R+=Re,V=L;V<=M;V++)x.set(V,V,x.get(V,V)-Re);ne=Math.abs(x.get(M,M-1))+Math.abs(x.get(M-1,M-2)),Re=_t=.75*ne,Qe=-.4375*ne*ne}if(Ce===30&&(ne=(_t-Re)/2,ne=ne*ne+Qe,ne>0)){for(ne=Math.sqrt(ne),_t<Re&&(ne=-ne),ne=Re-Qe/((_t-Re)/2+ne),V=L;V<=M;V++)x.set(V,V,x.get(V,V)-ne);R+=ne,Re=_t=Qe=.964}for(Ce=Ce+1,Ye=M-2;Ye>=ze&&(Ae=x.get(Ye,Ye),me=Re-Ae,ne=_t-Ae,z=(me*ne-Qe)/x.get(Ye+1,Ye)+x.get(Ye,Ye+1),ae=x.get(Ye+1,Ye+1)-Ae-me-ne,me=x.get(Ye+2,Ye+1),ne=Math.abs(z)+Math.abs(ae)+Math.abs(me),z=z/ne,ae=ae/ne,me=me/ne,!(Ye===ze||Math.abs(x.get(Ye,Ye-1))*(Math.abs(ae)+Math.abs(me))<P*(Math.abs(z)*(Math.abs(x.get(Ye-1,Ye-1))+Math.abs(Ae)+Math.abs(x.get(Ye+1,Ye+1))))));)Ye--;for(V=Ye+2;V<=M;V++)x.set(V,V-2,0),V>Ye+2&&x.set(V,V-3,0);for(Oe=Ye;Oe<=M-1&&(qt=Oe!==M-1,Oe!==Ye&&(z=x.get(Oe,Oe-1),ae=x.get(Oe+1,Oe-1),me=qt?x.get(Oe+2,Oe-1):0,Re=Math.abs(z)+Math.abs(ae)+Math.abs(me),Re!==0&&(z=z/Re,ae=ae/Re,me=me/Re)),Re!==0);Oe++)if(ne=Math.sqrt(z*z+ae*ae+me*me),z<0&&(ne=-ne),ne!==0){for(Oe!==Ye?x.set(Oe,Oe-1,-ne*Re):ze!==Ye&&x.set(Oe,Oe-1,-x.get(Oe,Oe-1)),z=z+ne,Re=z/ne,_t=ae/ne,Ae=me/ne,ae=ae/z,me=me/z,ye=Oe;ye<_;ye++)z=x.get(Oe,ye)+ae*x.get(Oe+1,ye),qt&&(z=z+me*x.get(Oe+2,ye),x.set(Oe+2,ye,x.get(Oe+2,ye)-z*Ae)),x.set(Oe,ye,x.get(Oe,ye)-z*Re),x.set(Oe+1,ye,x.get(Oe+1,ye)-z*_t);for(V=0;V<=Math.min(M,Oe+3);V++)z=Re*x.get(V,Oe)+_t*x.get(V,Oe+1),qt&&(z=z+Ae*x.get(V,Oe+2),x.set(V,Oe+2,x.get(V,Oe+2)-z*me)),x.set(V,Oe,x.get(V,Oe)-z),x.set(V,Oe+1,x.get(V,Oe+1)-z*ae);for(V=L;V<=Q;V++)z=Re*w.get(V,Oe)+_t*w.get(V,Oe+1),qt&&(z=z+Ae*w.get(V,Oe+2),w.set(V,Oe+2,w.get(V,Oe+2)-z*me)),w.set(V,Oe,w.get(V,Oe)-z),w.set(V,Oe+1,w.get(V,Oe+1)-z*ae)}}}if(J!==0){for(M=_-1;M>=0;M--)if(z=E[M],ae=b[M],ae===0)for(ze=M,x.set(M,M,1),V=M-1;V>=0;V--){for(Qe=x.get(V,V)-z,me=0,ye=ze;ye<=M;ye++)me=me+x.get(V,ye)*x.get(ye,M);if(b[V]<0)Ae=Qe,ne=me;else if(ze=V,b[V]===0?x.set(V,M,Qe!==0?-me/Qe:-me/(P*J)):(Re=x.get(V,V+1),_t=x.get(V+1,V),ae=(E[V]-z)*(E[V]-z)+b[V]*b[V],Wt=(Re*ne-Ae*me)/ae,x.set(V,M,Wt),x.set(V+1,M,Math.abs(Re)>Math.abs(Ae)?(-me-Qe*Wt)/Re:(-ne-_t*Wt)/Ae)),Wt=Math.abs(x.get(V,M)),P*Wt*Wt>1)for(ye=V;ye<=M;ye++)x.set(ye,M,x.get(ye,M)/Wt)}else if(ae<0)for(ze=M-1,Math.abs(x.get(M,M-1))>Math.abs(x.get(M-1,M))?(x.set(M-1,M-1,ae/x.get(M,M-1)),x.set(M-1,M,-(x.get(M,M)-z)/x.get(M,M-1))):(xt=Sa(0,-x.get(M-1,M),x.get(M-1,M-1)-z,ae),x.set(M-1,M-1,xt[0]),x.set(M-1,M,xt[1])),x.set(M,M-1,0),x.set(M,M,1),V=M-2;V>=0;V--){for(W=0,de=0,ye=ze;ye<=M;ye++)W=W+x.get(V,ye)*x.get(ye,M-1),de=de+x.get(V,ye)*x.get(ye,M);if(Qe=x.get(V,V)-z,b[V]<0)Ae=Qe,me=W,ne=de;else if(ze=V,b[V]===0?(xt=Sa(-W,-de,Qe,ae),x.set(V,M-1,xt[0]),x.set(V,M,xt[1])):(Re=x.get(V,V+1),_t=x.get(V+1,V),Se=(E[V]-z)*(E[V]-z)+b[V]*b[V]-ae*ae,pe=(E[V]-z)*2*ae,Se===0&&pe===0&&(Se=P*J*(Math.abs(Qe)+Math.abs(ae)+Math.abs(Re)+Math.abs(_t)+Math.abs(Ae))),xt=Sa(Re*me-Ae*W+ae*de,Re*ne-Ae*de-ae*W,Se,pe),x.set(V,M-1,xt[0]),x.set(V,M,xt[1]),Math.abs(Re)>Math.abs(Ae)+Math.abs(ae)?(x.set(V+1,M-1,(-W-Qe*x.get(V,M-1)+ae*x.get(V,M))/Re),x.set(V+1,M,(-de-Qe*x.get(V,M)-ae*x.get(V,M-1))/Re)):(xt=Sa(-me-_t*x.get(V,M-1),-ne-_t*x.get(V,M),Ae,ae),x.set(V+1,M-1,xt[0]),x.set(V+1,M,xt[1]))),Wt=Math.max(Math.abs(x.get(V,M-1)),Math.abs(x.get(V,M))),P*Wt*Wt>1)for(ye=V;ye<=M;ye++)x.set(ye,M-1,x.get(ye,M-1)/Wt),x.set(ye,M,x.get(ye,M)/Wt)}for(V=0;V<_;V++)if(V<L||V>Q)for(ye=V;ye<_;ye++)w.set(V,ye,x.get(V,ye));for(ye=_-1;ye>=L;ye--)for(V=L;V<=Q;V++){for(Ae=0,Oe=L;Oe<=Math.min(ye,Q);Oe++)Ae=Ae+w.get(V,Oe)*x.get(Oe,ye);w.set(V,ye,Ae)}}}function Sa(_,b,E,w){let x,M;return Math.abs(E)>Math.abs(w)?(x=w/E,M=E+x*w,[(_+x*b)/M,(b-x*_)/M]):(x=E/w,M=w+x*E,[(x*_+b)/M,(x*b-_)/M])}class If{constructor(b){if(b=It.checkMatrix(b),!b.isSymmetric())throw new Error("Matrix is not symmetric");let E=b,w=E.rows,x=new K(w,w),M=!0,L,Q,P;for(Q=0;Q<w;Q++){let R=0;for(P=0;P<Q;P++){let J=0;for(L=0;L<P;L++)J+=x.get(P,L)*x.get(Q,L);J=(E.get(Q,P)-J)/x.get(P,P),x.set(Q,P,J),R=R+J*J}for(R=E.get(Q,Q)-R,M&&=R>0,x.set(Q,Q,Math.sqrt(Math.max(R,0))),P=Q+1;P<w;P++)x.set(Q,P,0)}this.L=x,this.positiveDefinite=M}isPositiveDefinite(){return this.positiveDefinite}solve(b){b=It.checkMatrix(b);let E=this.L,w=E.rows;if(b.rows!==w)throw new Error("Matrix dimensions do not match");if(this.isPositiveDefinite()===!1)throw new Error("Matrix is not positive definite");let x=b.columns,M=b.clone(),L,Q,P;for(P=0;P<w;P++)for(Q=0;Q<x;Q++){for(L=0;L<P;L++)M.set(P,Q,M.get(P,Q)-M.get(L,Q)*E.get(P,L));M.set(P,Q,M.get(P,Q)/E.get(P,P))}for(P=w-1;P>=0;P--)for(Q=0;Q<x;Q++){for(L=P+1;L<w;L++)M.set(P,Q,M.get(P,Q)-M.get(L,Q)*E.get(L,P));M.set(P,Q,M.get(P,Q)/E.get(P,P))}return M}get lowerTriangularMatrix(){return this.L}}class _f{constructor(b,E={}){b=It.checkMatrix(b);let{Y:w}=E;const{scaleScores:x=!1,maxIterations:M=1e3,terminationCriteria:L=1e-10}=E;let Q;if(w){if(r.isAnyArray(w)&&typeof w[0]=="number"?w=K.columnVector(w):w=It.checkMatrix(w),w.rows!==b.rows)throw new Error("Y should have the same number of rows as X");Q=w.getColumnVector(0)}else Q=b.getColumnVector(0);let P=1,R,J,z,ae;for(let me=0;me<M&&P>L;me++)z=b.transpose().mmul(Q).div(Q.transpose().mmul(Q).get(0,0)),z=z.div(z.norm()),R=b.mmul(z).div(z.transpose().mmul(z).get(0,0)),me>0&&(P=R.clone().sub(ae).pow(2).sum()),ae=R.clone(),w?(J=w.transpose().mmul(R).div(R.transpose().mmul(R).get(0,0)),J=J.div(J.norm()),Q=w.mmul(J).div(J.transpose().mmul(J).get(0,0))):Q=R;if(w){let me=b.transpose().mmul(R).div(R.transpose().mmul(R).get(0,0));me=me.div(me.norm());let ne=b.clone().sub(R.clone().mmul(me.transpose())),Ae=Q.transpose().mmul(R).div(R.transpose().mmul(R).get(0,0)),Ce=w.clone().sub(R.clone().mulS(Ae.get(0,0)).mmul(J.transpose()));this.t=R,this.p=me.transpose(),this.w=z.transpose(),this.q=J,this.u=Q,this.s=R.transpose().mmul(R),this.xResidual=ne,this.yResidual=Ce,this.betas=Ae}else this.w=z.transpose(),this.s=R.transpose().mmul(R).sqrt(),x?this.t=R.clone().div(this.s.get(0,0)):this.t=R,this.xResidual=b.sub(R.mmul(z.transpose()))}}return rt.AbstractMatrix=Y,rt.CHO=If,rt.CholeskyDecomposition=If,rt.DistanceMatrix=oe,rt.EVD=hi,rt.EigenvalueDecomposition=hi,rt.LU=vr,rt.LuDecomposition=vr,rt.Matrix=K,rt.MatrixColumnSelectionView=Pe,rt.MatrixColumnView=Le,rt.MatrixFlipColumnView=st,rt.MatrixFlipRowView=ut,rt.MatrixRowSelectionView=Et,rt.MatrixRowView=ht,rt.MatrixSelectionView=Ue,rt.MatrixSubView=vt,rt.MatrixTransposeView=it,rt.NIPALS=_f,rt.Nipals=_f,rt.QR=Qt,rt.QrDecomposition=Qt,rt.SVD=qn,rt.SingularValueDecomposition=qn,rt.SymmetricMatrix=ee,rt.WrapperMatrix1D=_r,rt.WrapperMatrix2D=It,rt.correlation=jr,rt.covariance=co,rt.default=K,rt.determinant=yr,rt.inverse=sr,rt.linearDependencies=gn,rt.pseudoInverse=tc,rt.solve=kr,rt.wrap=Ca,rt}var Yh=D7();const UT=ic(Yh),os=Yh.Matrix,PT=Yh.SingularValueDecomposition;UT.Matrix?UT.Matrix:Yh.Matrix;const H7={center:[0,0],linkDistance:50};class RT{constructor(e={}){this.options=e,this.id="mds",this.options=Object.assign(Object.assign({},H7),e)}execute(e,t){return et(this,void 0,void 0,function*(){return this.genericMDSLayout(!1,e,t)})}assign(e,t){return et(this,void 0,void 0,function*(){yield this.genericMDSLayout(!0,e,t)})}genericMDSLayout(e,t,n){return et(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),n),{center:a=[0,0],linkDistance:s=50}=i,o=t.getAllNodes(),A=t.getAllEdges();if(!o?.length||o.length===1)return Ys(t,e,a);const l=CT({nodes:o,edges:A}),c=xT(l);G7(c);const u=N$(c,s),h=K7(u),d=[];return h.forEach((g,p)=>{const v=Kr(o[p]);v.data.x=g[0]+a[0],v.data.y=g[1]+a[1],d.push(v)}),e&&d.forEach(g=>t.mergeNodeData(g.id,{x:g.data.x,y:g.data.y})),{nodes:d,edges:A}})}}const G7=r=>{let e=-999999;r.forEach(t=>{t.forEach(n=>{n!==1/0&&e<n&&(e=n)})}),r.forEach((t,n)=>{t.forEach((i,a)=>{i===1/0&&(r[n][a]=e)})})},K7=r=>{const t=os.mul(os.pow(r,2),-.5),n=t.mean("row"),i=t.mean("column"),a=t.mean();t.add(a).subRowVector(n).subColumnVector(i);const s=new PT(t),o=os.sqrt(s.diagonalMatrix).diagonal();return s.leftSingularVectors.toJSON().map(A=>os.mul([A],[o]).toJSON()[0].splice(0,2))};function Kv(r){return!!r.tick&&!!r.stop}const z7={gForce:!0,force2:!0,d3force:!0,fruchterman:!0,forceAtlas2:!0,force:!0,"graphin-force":!0},V7={center:[0,0],comboPadding:10,treeKey:"combo"};class j7{constructor(e={}){this.options=e,this.id="comboCombined",this.options=Object.assign(Object.assign({},V7),e)}execute(e,t){return et(this,void 0,void 0,function*(){return this.genericComboCombinedLayout(!1,e,t)})}assign(e,t){return et(this,void 0,void 0,function*(){yield this.genericComboCombinedLayout(!0,e,t)})}genericComboCombinedLayout(e,t,n){return et(this,void 0,void 0,function*(){const i=this.initVals(Object.assign(Object.assign({},this.options),n)),{center:a,treeKey:s,outerLayout:o}=i,A=t.getAllNodes().filter(T=>!T.data._isCombo),l=t.getAllNodes().filter(T=>T.data._isCombo),c=t.getAllEdges(),u=A?.length;if(!u||u===1)return Ys(t,e,a);const h=[],d=new Map;A.forEach(T=>{d.set(T.id,T)});const f=new Map;l.forEach(T=>{f.set(T.id,T)});const g=new Map,p=this.getInnerGraphs(t,s,d,f,c,i,g);yield Promise.all(p);const v=new Map,y=[],m=new Map;let B=!0;t.getRoots(s).forEach(T=>{const O=g.get(T.id),I=f.get(T.id)||d.get(T.id),k={id:T.id,data:Object.assign(Object.assign({},T.data),{x:O.data.x||I.data.x,y:O.data.y||I.data.y,fx:O.data.fx||I.data.fx,fy:O.data.fy||I.data.fy,mass:O.data.mass||I.data.mass,size:O.data.size})};y.push(k),v.set(T.id,!0),!isNaN(k.data.x)&&k.data.x!==0&&!isNaN(k.data.y)&&k.data.y!==0?B=!1:(k.data.x=Math.random()*100,k.data.y=Math.random()*100),Nv(t,[T],N=>{N.id!==T.id&&m.set(N.id,T.id)},"TB",s)});const C=[];c.forEach(T=>{const O=m.get(T.source)||T.source,I=m.get(T.target)||T.target;O!==I&&v.has(O)&&v.has(I)&&C.push({id:T.id,source:O,target:I,data:{}})});let S;if(y?.length){if(y.length===1)y[0].data.x=a[0],y[0].data.y=a[1];else{const T=new Tn({nodes:y,edges:C}),O=o||new kT;B&&z7[O.id]&&(yield(y.length<100?new RT:new Pv).assign(T));const I=Object.assign({center:a,kg:5,preventOverlap:!0,animate:!1},O.id==="force"?{gravity:1,factor:4,linkDistance:(k,N,U)=>{const D=Math.max(...N.data.size)||32,G=Math.max(...U.data.size)||32;return D/2+G/2+200}}:{});S=yield DT(O,T,I)}g.forEach(T=>{var O;const I=S.nodes.find(U=>U.id===T.id);if(I){const{x:U,y:D}=I.data;T.data.visited=!0,T.data.x=U,T.data.y=D,h.push({id:T.id,data:{x:U,y:D}})}const{x:k,y:N}=T.data;(O=T.data.nodes)===null||O===void 0||O.forEach(U=>{h.push({id:U.id,data:{x:U.data.x+k,y:U.data.y+N}})})}),g.forEach(({data:T})=>{const{x:O,y:I,visited:k,nodes:N}=T;N?.forEach(U=>{if(!k){const D=h.find(G=>G.id===U.id);D.data.x+=O||0,D.data.y+=I||0}})})}return e&&h.forEach(T=>{t.mergeNodeData(T.id,{x:T.data.x,y:T.data.y})}),{nodes:h,edges:c}})}initVals(e){const t=Object.assign({},e),{nodeSize:n,spacing:i,comboPadding:a}=e;let s,o;if(Be(i)?o=()=>i:Te(i)?o=i:o=()=>0,t.spacing=o,!n)s=l=>{const c=o(l);return l.size?ya(l.size)?((l.size[0]>l.size[1]?l.size[0]:l.size[1])+c)/2:on(l.size)?((l.size.width>l.size.height?l.size.width:l.size.height)+c)/2:(l.size+c)/2:32+c/2};else if(Te(n))s=l=>{const c=n(l),u=o(l);return ya(l.size)?((l.size[0]>l.size[1]?l.size[0]:l.size[1])+u)/2:((c||32)+u)/2};else if(ya(n)){const c=(n[0]>n[1]?n[0]:n[1])/2;s=u=>c+o(u)/2}else{const l=n/2;s=c=>l+o(c)/2}t.nodeSize=s;let A;return Be(a)?A=()=>a:ya(a)?A=()=>Math.max.apply(null,a):Te(a)?A=a:A=()=>0,t.comboPadding=A,t}getInnerGraphs(e,t,n,i,a,s,o){const{nodeSize:A,comboPadding:l,spacing:c,innerLayout:u}=s,h=u||new Pv({}),d={center:[0,0],preventOverlap:!0,nodeSpacing:c},f=[],g=p=>{let v=l?.(p)||10;return ya(v)&&(v=Math.max(...v)),{size:v?[v*2,v*2]:[30,30],padding:v}};return e.getRoots(t).forEach(p=>{o.set(p.id,{id:p.id,data:{nodes:[],size:g(p).size}});let v=Promise.resolve();Nv(e,[p],y=>{var m;if(!y.data._isCombo)return;const{size:B,padding:C}=g(y);if(!(!((m=e.getChildren(y.id,t))===null||m===void 0)&&m.length))o.set(y.id,{id:y.id,data:Object.assign(Object.assign({},y.data),{size:B})});else{const S=o.get(y.id);o.set(y.id,{id:y.id,data:Object.assign({nodes:[]},S?.data)});const F=new Map,T=e.getChildren(y.id,t).map(k=>{if(k.data._isCombo)return o.has(k.id)||o.set(k.id,{id:k.id,data:Object.assign({},k.data)}),F.set(k.id,!0),o.get(k.id);const N=n.get(k.id)||i.get(k.id);return F.set(k.id,!0),{id:k.id,data:Object.assign(Object.assign({},N.data),k.data)}}),O={nodes:T,edges:a.filter(k=>F.has(k.source)&&F.has(k.target))};let I=1/0;T.forEach(k=>{var N;let{size:U}=k.data;U||(U=((N=o.get(k.id))===null||N===void 0?void 0:N.data.size)||A?.(k)||[30,30]),Be(U)&&(U=[U,U]);const[D,G]=U;I>D&&(I=D),I>G&&(I=G),k.data.size=U}),v=v.then(()=>et(this,void 0,void 0,function*(){const k=new Tn(O);yield DT(h,k,d,!0);const{minX:N,minY:U,maxX:D,maxY:G}=L$(T),Z={x:(D+N)/2,y:(G+U)/2};O.nodes.forEach(j=>{j.data.x-=Z.x,j.data.y-=Z.y});const q=[Math.max(D-N,I)+C*2,Math.max(G-U,I)+C*2];o.get(y.id).data.size=q,o.get(y.id).data.nodes=T}))}return!0},"BT",t),f.push(v)}),f}}function DT(r,e,t,n){var i;return et(this,void 0,void 0,function*(){return Kv(r)?(r.execute(e,t),r.stop(),r.tick((i=t.iterations)!==null&&i!==void 0?i:300)):n?yield r.assign(e,t):yield r.execute(e,t)})}function W7(r,e){var t,n=1;r==null&&(r=0),e==null&&(e=0);function i(){var a,s=t.length,o,A=0,l=0;for(a=0;a<s;++a)o=t[a],A+=o.x,l+=o.y;for(A=(A/s-r)*n,l=(l/s-e)*n,a=0;a<s;++a)o=t[a],o.x-=A,o.y-=l}return i.initialize=function(a){t=a},i.x=function(a){return arguments.length?(r=+a,i):r},i.y=function(a){return arguments.length?(e=+a,i):e},i.strength=function(a){return arguments.length?(n=+a,i):n},i}function Mn(r){return function(){return r}}function As(r){return(r()-.5)*1e-6}function q7(r){return r.x+r.vx}function $7(r){return r.y+r.vy}function Y7(r){var e,t,n,i=1,a=1;typeof r!="function"&&(r=Mn(r==null?1:+r));function s(){for(var l,c=e.length,u,h,d,f,g,p,v=0;v<a;++v)for(u=$h(e,q7,$7).visitAfter(o),l=0;l<c;++l)h=e[l],g=t[h.index],p=g*g,d=h.x+h.vx,f=h.y+h.vy,u.visit(y);function y(m,B,C,S,F){var T=m.data,O=m.r,I=g+O;if(T){if(T.index>h.index){var k=d-T.x-T.vx,N=f-T.y-T.vy,U=k*k+N*N;U<I*I&&(k===0&&(k=As(n),U+=k*k),N===0&&(N=As(n),U+=N*N),U=(I-(U=Math.sqrt(U)))/U*i,h.vx+=(k*=U)*(I=(O*=O)/(p+O)),h.vy+=(N*=U)*I,T.vx-=k*(I=1-I),T.vy-=N*I)}return}return B>d+I||S<d-I||C>f+I||F<f-I}}function o(l){if(l.data)return l.r=t[l.data.index];for(var c=l.r=0;c<4;++c)l[c]&&l[c].r>l.r&&(l.r=l[c].r)}function A(){if(e){var l,c=e.length,u;for(t=new Array(c),l=0;l<c;++l)u=e[l],t[u.index]=+r(u,l,e)}}return s.initialize=function(l,c){e=l,n=c,A()},s.iterations=function(l){return arguments.length?(a=+l,s):a},s.strength=function(l){return arguments.length?(i=+l,s):i},s.radius=function(l){return arguments.length?(r=typeof l=="function"?l:Mn(+l),A(),s):r},s}function X7(r){return r.index}function HT(r,e){var t=r.get(e);if(!t)throw new Error("node not found: "+e);return t}function Z7(r){var e=X7,t=u,n,i=Mn(30),a,s,o,A,l,c=1;r==null&&(r=[]);function u(p){return 1/Math.min(o[p.source.index],o[p.target.index])}function h(p){for(var v=0,y=r.length;v<c;++v)for(var m=0,B,C,S,F,T,O,I;m<y;++m)B=r[m],C=B.source,S=B.target,F=S.x+S.vx-C.x-C.vx||As(l),T=S.y+S.vy-C.y-C.vy||As(l),O=Math.sqrt(F*F+T*T),O=(O-a[m])/O*p*n[m],F*=O,T*=O,S.vx-=F*(I=A[m]),S.vy-=T*I,C.vx+=F*(I=1-I),C.vy+=T*I}function d(){if(s){var p,v=s.length,y=r.length,m=new Map(s.map((C,S)=>[e(C,S,s),C])),B;for(p=0,o=new Array(v);p<y;++p)B=r[p],B.index=p,typeof B.source!="object"&&(B.source=HT(m,B.source)),typeof B.target!="object"&&(B.target=HT(m,B.target)),o[B.source.index]=(o[B.source.index]||0)+1,o[B.target.index]=(o[B.target.index]||0)+1;for(p=0,A=new Array(y);p<y;++p)B=r[p],A[p]=o[B.source.index]/(o[B.source.index]+o[B.target.index]);n=new Array(y),f(),a=new Array(y),g()}}function f(){if(s)for(var p=0,v=r.length;p<v;++p)n[p]=+t(r[p],p,r)}function g(){if(s)for(var p=0,v=r.length;p<v;++p)a[p]=+i(r[p],p,r)}return h.initialize=function(p,v){s=p,l=v,d()},h.links=function(p){return arguments.length?(r=p,d(),h):r},h.id=function(p){return arguments.length?(e=p,h):e},h.iterations=function(p){return arguments.length?(c=+p,h):c},h.strength=function(p){return arguments.length?(t=typeof p=="function"?p:Mn(+p),f(),h):t},h.distance=function(p){return arguments.length?(i=typeof p=="function"?p:Mn(+p),g(),h):i},h}var J7={value:()=>{}};function GT(){for(var r=0,e=arguments.length,t={},n;r<e;++r){if(!(n=arguments[r]+"")||n in t||/[\s.]/.test(n))throw new Error("illegal type: "+n);t[n]=[]}return new Xh(t)}function Xh(r){this._=r}function eY(r,e){return r.trim().split(/^|\s+/).map(function(t){var n="",i=t.indexOf(".");if(i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})}Xh.prototype=GT.prototype={constructor:Xh,on:function(r,e){var t=this._,n=eY(r+"",t),i,a=-1,s=n.length;if(arguments.length<2){for(;++a<s;)if((i=(r=n[a]).type)&&(i=tY(t[i],r.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++a<s;)if(i=(r=n[a]).type)t[i]=KT(t[i],r.name,e);else if(e==null)for(i in t)t[i]=KT(t[i],r.name,null);return this},copy:function(){var r={},e=this._;for(var t in e)r[t]=e[t].slice();return new Xh(r)},call:function(r,e){if((i=arguments.length-2)>0)for(var t=new Array(i),n=0,i,a;n<i;++n)t[n]=arguments[n+2];if(!this._.hasOwnProperty(r))throw new Error("unknown type: "+r);for(a=this._[r],n=0,i=a.length;n<i;++n)a[n].value.apply(e,t)},apply:function(r,e,t){if(!this._.hasOwnProperty(r))throw new Error("unknown type: "+r);for(var n=this._[r],i=0,a=n.length;i<a;++i)n[i].value.apply(e,t)}};function tY(r,e){for(var t=0,n=r.length,i;t<n;++t)if((i=r[t]).name===e)return i.value}function KT(r,e,t){for(var n=0,i=r.length;n<i;++n)if(r[n].name===e){r[n]=J7,r=r.slice(0,n).concat(r.slice(n+1));break}return t!=null&&r.push({name:e,value:t}),r}var Wo=0,Ml=0,Ol=0,zT=1e3,Zh,Il,Jh=0,Xs=0,ed=0,_l=typeof performance=="object"&&performance.now?performance:Date,VT=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(r){setTimeout(r,17)};function jT(){return Xs||(VT(nY),Xs=_l.now()+ed)}function nY(){Xs=0}function zv(){this._call=this._time=this._next=null}zv.prototype=WT.prototype={constructor:zv,restart:function(r,e,t){if(typeof r!="function")throw new TypeError("callback is not a function");t=(t==null?jT():+t)+(e==null?0:+e),!this._next&&Il!==this&&(Il?Il._next=this:Zh=this,Il=this),this._call=r,this._time=t,Vv()},stop:function(){this._call&&(this._call=null,this._time=1/0,Vv())}};function WT(r,e,t){var n=new zv;return n.restart(r,e,t),n}function rY(){jT(),++Wo;for(var r=Zh,e;r;)(e=Xs-r._time)>=0&&r._call.call(void 0,e),r=r._next;--Wo}function qT(){Xs=(Jh=_l.now())+ed,Wo=Ml=0;try{rY()}finally{Wo=0,aY(),Xs=0}}function iY(){var r=_l.now(),e=r-Jh;e>zT&&(ed-=e,Jh=r)}function aY(){for(var r,e=Zh,t,n=1/0;e;)e._call?(n>e._time&&(n=e._time),r=e,e=e._next):(t=e._next,e._next=null,e=r?r._next=t:Zh=t);Il=r,Vv(n)}function Vv(r){if(!Wo){Ml&&(Ml=clearTimeout(Ml));var e=r-Xs;e>24?(r<1/0&&(Ml=setTimeout(qT,r-_l.now()-ed)),Ol&&(Ol=clearInterval(Ol))):(Ol||(Jh=_l.now(),Ol=setInterval(iY,zT)),Wo=1,VT(qT))}}const sY=1664525,oY=1013904223,$T=4294967296;function AY(){let r=1;return()=>(r=(sY*r+oY)%$T)/$T}function lY(r){return r.x}function cY(r){return r.y}var uY=10,hY=Math.PI*(3-Math.sqrt(5));function dY(r){var e,t=1,n=.001,i=1-Math.pow(n,1/300),a=0,s=.6,o=new Map,A=WT(u),l=GT("tick","end"),c=AY();r==null&&(r=[]);function u(){h(),l.call("tick",e),t<n&&(A.stop(),l.call("end",e))}function h(g){var p,v=r.length,y;g===void 0&&(g=1);for(var m=0;m<g;++m)for(t+=(a-t)*i,o.forEach(function(B){B(t)}),p=0;p<v;++p)y=r[p],y.fx==null?y.x+=y.vx*=s:(y.x=y.fx,y.vx=0),y.fy==null?y.y+=y.vy*=s:(y.y=y.fy,y.vy=0);return e}function d(){for(var g=0,p=r.length,v;g<p;++g){if(v=r[g],v.index=g,v.fx!=null&&(v.x=v.fx),v.fy!=null&&(v.y=v.fy),isNaN(v.x)||isNaN(v.y)){var y=uY*Math.sqrt(.5+g),m=g*hY;v.x=y*Math.cos(m),v.y=y*Math.sin(m)}(isNaN(v.vx)||isNaN(v.vy))&&(v.vx=v.vy=0)}}function f(g){return g.initialize&&g.initialize(r,c),g}return d(),e={tick:h,restart:function(){return A.restart(u),e},stop:function(){return A.stop(),e},nodes:function(g){return arguments.length?(r=g,d(),o.forEach(f),e):r},alpha:function(g){return arguments.length?(t=+g,e):t},alphaMin:function(g){return arguments.length?(n=+g,e):n},alphaDecay:function(g){return arguments.length?(i=+g,e):+i},alphaTarget:function(g){return arguments.length?(a=+g,e):a},velocityDecay:function(g){return arguments.length?(s=1-g,e):1-s},randomSource:function(g){return arguments.length?(c=g,o.forEach(f),e):c},force:function(g,p){return arguments.length>1?(p==null?o.delete(g):o.set(g,f(p)),e):o.get(g)},find:function(g,p,v){var y=0,m=r.length,B,C,S,F,T;for(v==null?v=1/0:v*=v,y=0;y<m;++y)F=r[y],B=g-F.x,C=p-F.y,S=B*B+C*C,S<v&&(T=F,v=S);return T},on:function(g,p){return arguments.length>1?(l.on(g,p),e):l.on(g)}}}function fY(){var r,e,t,n,i=Mn(-30),a,s=1,o=1/0,A=.81;function l(d){var f,g=r.length,p=$h(r,lY,cY).visitAfter(u);for(n=d,f=0;f<g;++f)e=r[f],p.visit(h)}function c(){if(r){var d,f=r.length,g;for(a=new Array(f),d=0;d<f;++d)g=r[d],a[g.index]=+i(g,d,r)}}function u(d){var f=0,g,p,v=0,y,m,B;if(d.length){for(y=m=B=0;B<4;++B)(g=d[B])&&(p=Math.abs(g.value))&&(f+=g.value,v+=p,y+=p*g.x,m+=p*g.y);d.x=y/v,d.y=m/v}else{g=d,g.x=g.data.x,g.y=g.data.y;do f+=a[g.data.index];while(g=g.next)}d.value=f}function h(d,f,g,p){if(!d.value)return!0;var v=d.x-e.x,y=d.y-e.y,m=p-f,B=v*v+y*y;if(m*m/A<B)return B<o&&(v===0&&(v=As(t),B+=v*v),y===0&&(y=As(t),B+=y*y),B<s&&(B=Math.sqrt(s*B)),e.vx+=v*d.value*n/B,e.vy+=y*d.value*n/B),!0;if(d.length||B>=o)return;(d.data!==e||d.next)&&(v===0&&(v=As(t),B+=v*v),y===0&&(y=As(t),B+=y*y),B<s&&(B=Math.sqrt(s*B)));do d.data!==e&&(m=a[d.data.index]*n/B,e.vx+=v*m,e.vy+=y*m);while(d=d.next)}return l.initialize=function(d,f){r=d,t=f,c()},l.strength=function(d){return arguments.length?(i=typeof d=="function"?d:Mn(+d),c(),l):i},l.distanceMin=function(d){return arguments.length?(s=d*d,l):Math.sqrt(s)},l.distanceMax=function(d){return arguments.length?(o=d*d,l):Math.sqrt(o)},l.theta=function(d){return arguments.length?(A=d*d,l):Math.sqrt(A)},l}function gY(r,e,t){var n,i=Mn(.1),a,s;typeof r!="function"&&(r=Mn(+r)),e==null&&(e=0),t==null&&(t=0);function o(l){for(var c=0,u=n.length;c<u;++c){var h=n[c],d=h.x-e||1e-6,f=h.y-t||1e-6,g=Math.sqrt(d*d+f*f),p=(s[c]-g)*a[c]*l/g;h.vx+=d*p,h.vy+=f*p}}function A(){if(n){var l,c=n.length;for(a=new Array(c),s=new Array(c),l=0;l<c;++l)s[l]=+r(n[l],l,n),a[l]=isNaN(s[l])?0:+i(n[l],l,n)}}return o.initialize=function(l){n=l,A()},o.strength=function(l){return arguments.length?(i=typeof l=="function"?l:Mn(+l),A(),o):i},o.radius=function(l){return arguments.length?(r=typeof l=="function"?l:Mn(+l),A(),o):r},o.x=function(l){return arguments.length?(e=+l,o):e},o.y=function(l){return arguments.length?(t=+l,o):t},o}function pY(r){var e=Mn(.1),t,n,i;typeof r!="function"&&(r=Mn(r==null?0:+r));function a(o){for(var A=0,l=t.length,c;A<l;++A)c=t[A],c.vx+=(i[A]-c.x)*n[A]*o}function s(){if(t){var o,A=t.length;for(n=new Array(A),i=new Array(A),o=0;o<A;++o)n[o]=isNaN(i[o]=+r(t[o],o,t))?0:+e(t[o],o,t)}}return a.initialize=function(o){t=o,s()},a.strength=function(o){return arguments.length?(e=typeof o=="function"?o:Mn(+o),s(),a):e},a.x=function(o){return arguments.length?(r=typeof o=="function"?o:Mn(+o),s(),a):r},a}function vY(r){var e=Mn(.1),t,n,i;typeof r!="function"&&(r=Mn(r==null?0:+r));function a(o){for(var A=0,l=t.length,c;A<l;++A)c=t[A],c.vy+=(i[A]-c.y)*n[A]*o}function s(){if(t){var o,A=t.length;for(n=new Array(A),i=new Array(A),o=0;o<A;++o)n[o]=isNaN(i[o]=+r(t[o],o,t))?0:+e(t[o],o,t)}}return a.initialize=function(o){t=o,s()},a.strength=function(o){return arguments.length?(e=typeof o=="function"?o:Mn(+o),s(),a):e},a.y=function(o){return arguments.length?(r=typeof o=="function"?o:Mn(+o),s(),a):r},a}class yY{constructor(e){this.id="d3-force",this.config={inputNodeAttrs:["x","y","vx","vy","fx","fy"],outputNodeAttrs:["x","y","vx","vy"],simulationAttrs:["alpha","alphaMin","alphaDecay","alphaTarget","velocityDecay","randomSource"]},this.forceMap={link:Z7,manyBody:fY,center:W7,collide:Y7,radial:gY,x:pY,y:vY},this.options={link:{id:t=>t.id},manyBody:{},center:{x:0,y:0}},this.context={options:{},assign:!1,nodes:[],edges:[]},Rn(this.options,e),this.options.forceSimulation&&(this.simulation=this.options.forceSimulation)}execute(e,t){return et(this,void 0,void 0,function*(){return this.genericLayout(!1,e,t)})}assign(e,t){return et(this,void 0,void 0,function*(){yield this.genericLayout(!0,e,t)})}stop(){this.simulation.stop()}tick(e){return this.simulation.tick(e),this.getResult()}restart(){this.simulation.restart()}setFixedPosition(e,t){const n=this.context.nodes.find(i=>i.id===e);n&&t.forEach((i,a)=>{if(typeof i=="number"||i===null){const s=["fx","fy","fz"][a];n[s]=i}})}getOptions(e){var t,n;const i=Rn({},this.options,e);return i.collide&&((t=i.collide)===null||t===void 0?void 0:t.radius)===void 0&&(i.collide=i.collide||{},i.collide.radius=(n=i.nodeSize)!==null&&n!==void 0?n:10),i.iterations===void 0&&(i.link&&i.link.iterations===void 0&&(i.iterations=i.link.iterations),i.collide&&i.collide.iterations===void 0&&(i.iterations=i.collide.iterations)),this.context.options=i,i}genericLayout(e,t,n){var i;return et(this,void 0,void 0,function*(){const a=this.getOptions(n),s=t.getAllNodes().map(({id:c,data:u})=>Object.assign(Object.assign({id:c},u),ms(u.data,this.config.inputNodeAttrs))),o=t.getAllEdges().map(c=>Object.assign({},c));Object.assign(this.context,{assign:e,nodes:s,edges:o,graph:t});const A=new Promise(c=>{this.resolver=c}),l=this.setSimulation(a);return l.nodes(s),(i=l.force("link"))===null||i===void 0||i.links(o),A})}getResult(){const{assign:e,nodes:t,edges:n,graph:i}=this.context,a=t.map(o=>({id:o.id,data:Object.assign(Object.assign({},o.data),ms(o,this.config.outputNodeAttrs))})),s=n.map(({id:o,source:A,target:l,data:c})=>({id:o,source:typeof A=="object"?A.id:A,target:typeof l=="object"?l.id:l,data:c}));return e&&a.forEach(o=>i.mergeNodeData(o.id,o.data)),{nodes:a,edges:s}}initSimulation(){return dY()}setSimulation(e){const t=this.simulation||this.options.forceSimulation||this.initSimulation();return this.simulation||(this.simulation=t.on("tick",()=>{var n;return(n=e.onTick)===null||n===void 0?void 0:n.call(e,this.getResult())}).on("end",()=>{var n;return(n=this.resolver)===null||n===void 0?void 0:n.call(this,this.getResult())})),YT(t,this.config.simulationAttrs.map(n=>[n,e[n]])),Object.entries(this.forceMap).forEach(([n,i])=>{const a=n;if(e[n]){let s=t.force(a);s||(s=i(),t.force(a,s)),YT(s,Object.entries(e[a]))}else t.force(a,null)}),t}}const YT=(r,e)=>e.reduce((t,[n,i])=>!t[n]||i===void 0?t:t[n].call(r,i),r);function jv(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Wv,XT;function mY(){if(XT)return Wv;XT=1;function r(){this.__data__=[],this.size=0}return Wv=r,Wv}var qv,ZT;function qo(){if(ZT)return qv;ZT=1;function r(e,t){return e===t||e!==e&&t!==t}return qv=r,qv}var $v,JT;function td(){if(JT)return $v;JT=1;var r=qo();function e(t,n){for(var i=t.length;i--;)if(r(t[i][0],n))return i;return-1}return $v=e,$v}var Yv,eM;function wY(){if(eM)return Yv;eM=1;var r=td(),e=Array.prototype,t=e.splice;function n(i){var a=this.__data__,s=r(a,i);if(s<0)return!1;var o=a.length-1;return s==o?a.pop():t.call(a,s,1),--this.size,!0}return Yv=n,Yv}var Xv,tM;function BY(){if(tM)return Xv;tM=1;var r=td();function e(t){var n=this.__data__,i=r(n,t);return i<0?void 0:n[i][1]}return Xv=e,Xv}var Zv,nM;function bY(){if(nM)return Zv;nM=1;var r=td();function e(t){return r(this.__data__,t)>-1}return Zv=e,Zv}var Jv,rM;function EY(){if(rM)return Jv;rM=1;var r=td();function e(t,n){var i=this.__data__,a=r(i,t);return a<0?(++this.size,i.push([t,n])):i[a][1]=n,this}return Jv=e,Jv}var e0,iM;function nd(){if(iM)return e0;iM=1;var r=mY(),e=wY(),t=BY(),n=bY(),i=EY();function a(s){var o=-1,A=s==null?0:s.length;for(this.clear();++o<A;){var l=s[o];this.set(l[0],l[1])}}return a.prototype.clear=r,a.prototype.delete=e,a.prototype.get=t,a.prototype.has=n,a.prototype.set=i,e0=a,e0}var t0,aM;function xY(){if(aM)return t0;aM=1;var r=nd();function e(){this.__data__=new r,this.size=0}return t0=e,t0}var n0,sM;function CY(){if(sM)return n0;sM=1;function r(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}return n0=r,n0}var r0,oM;function SY(){if(oM)return r0;oM=1;function r(e){return this.__data__.get(e)}return r0=r,r0}var i0,AM;function FY(){if(AM)return i0;AM=1;function r(e){return this.__data__.has(e)}return i0=r,i0}var a0,lM;function cM(){if(lM)return a0;lM=1;var r=typeof rc=="object"&&rc&&rc.Object===Object&&rc;return a0=r,a0}var s0,uM;function Ci(){if(uM)return s0;uM=1;var r=cM(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=r||e||Function("return this")();return s0=t,s0}var o0,hM;function $o(){if(hM)return o0;hM=1;var r=Ci(),e=r.Symbol;return o0=e,o0}var A0,dM;function TY(){if(dM)return A0;dM=1;var r=$o(),e=Object.prototype,t=e.hasOwnProperty,n=e.toString,i=r?r.toStringTag:void 0;function a(s){var o=t.call(s,i),A=s[i];try{s[i]=void 0;var l=!0}catch{}var c=n.call(s);return l&&(o?s[i]=A:delete s[i]),c}return A0=a,A0}var l0,fM;function MY(){if(fM)return l0;fM=1;var r=Object.prototype,e=r.toString;function t(n){return e.call(n)}return l0=t,l0}var c0,gM;function Zs(){if(gM)return c0;gM=1;var r=$o(),e=TY(),t=MY(),n="[object Null]",i="[object Undefined]",a=r?r.toStringTag:void 0;function s(o){return o==null?o===void 0?i:n:a&&a in Object(o)?e(o):t(o)}return c0=s,c0}var u0,pM;function oi(){if(pM)return u0;pM=1;function r(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return u0=r,u0}var h0,vM;function kl(){if(vM)return h0;vM=1;var r=Zs(),e=oi(),t="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function s(o){if(!e(o))return!1;var A=r(o);return A==n||A==i||A==t||A==a}return h0=s,h0}var d0,yM;function OY(){if(yM)return d0;yM=1;var r=Ci(),e=r["__core-js_shared__"];return d0=e,d0}var f0,mM;function IY(){if(mM)return f0;mM=1;var r=OY(),e=(function(){var n=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function t(n){return!!e&&e in n}return f0=t,f0}var g0,wM;function BM(){if(wM)return g0;wM=1;var r=Function.prototype,e=r.toString;function t(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return g0=t,g0}var p0,bM;function _Y(){if(bM)return p0;bM=1;var r=kl(),e=IY(),t=oi(),n=BM(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,s=Function.prototype,o=Object.prototype,A=s.toString,l=o.hasOwnProperty,c=RegExp("^"+A.call(l).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function u(h){if(!t(h)||e(h))return!1;var d=r(h)?c:a;return d.test(n(h))}return p0=u,p0}var v0,EM;function kY(){if(EM)return v0;EM=1;function r(e,t){return e?.[t]}return v0=r,v0}var y0,xM;function Js(){if(xM)return y0;xM=1;var r=_Y(),e=kY();function t(n,i){var a=e(n,i);return r(a)?a:void 0}return y0=t,y0}var m0,CM;function w0(){if(CM)return m0;CM=1;var r=Js(),e=Ci(),t=r(e,"Map");return m0=t,m0}var B0,SM;function rd(){if(SM)return B0;SM=1;var r=Js(),e=r(Object,"create");return B0=e,B0}var b0,FM;function NY(){if(FM)return b0;FM=1;var r=rd();function e(){this.__data__=r?r(null):{},this.size=0}return b0=e,b0}var E0,TM;function LY(){if(TM)return E0;TM=1;function r(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return E0=r,E0}var x0,MM;function QY(){if(MM)return x0;MM=1;var r=rd(),e="__lodash_hash_undefined__",t=Object.prototype,n=t.hasOwnProperty;function i(a){var s=this.__data__;if(r){var o=s[a];return o===e?void 0:o}return n.call(s,a)?s[a]:void 0}return x0=i,x0}var C0,OM;function UY(){if(OM)return C0;OM=1;var r=rd(),e=Object.prototype,t=e.hasOwnProperty;function n(i){var a=this.__data__;return r?a[i]!==void 0:t.call(a,i)}return C0=n,C0}var S0,IM;function PY(){if(IM)return S0;IM=1;var r=rd(),e="__lodash_hash_undefined__";function t(n,i){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=r&&i===void 0?e:i,this}return S0=t,S0}var F0,_M;function RY(){if(_M)return F0;_M=1;var r=NY(),e=LY(),t=QY(),n=UY(),i=PY();function a(s){var o=-1,A=s==null?0:s.length;for(this.clear();++o<A;){var l=s[o];this.set(l[0],l[1])}}return a.prototype.clear=r,a.prototype.delete=e,a.prototype.get=t,a.prototype.has=n,a.prototype.set=i,F0=a,F0}var T0,kM;function DY(){if(kM)return T0;kM=1;var r=RY(),e=nd(),t=w0();function n(){this.size=0,this.__data__={hash:new r,map:new(t||e),string:new r}}return T0=n,T0}var M0,NM;function HY(){if(NM)return M0;NM=1;function r(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return M0=r,M0}var O0,LM;function id(){if(LM)return O0;LM=1;var r=HY();function e(t,n){var i=t.__data__;return r(n)?i[typeof n=="string"?"string":"hash"]:i.map}return O0=e,O0}var I0,QM;function GY(){if(QM)return I0;QM=1;var r=id();function e(t){var n=r(this,t).delete(t);return this.size-=n?1:0,n}return I0=e,I0}var _0,UM;function KY(){if(UM)return _0;UM=1;var r=id();function e(t){return r(this,t).get(t)}return _0=e,_0}var k0,PM;function zY(){if(PM)return k0;PM=1;var r=id();function e(t){return r(this,t).has(t)}return k0=e,k0}var N0,RM;function VY(){if(RM)return N0;RM=1;var r=id();function e(t,n){var i=r(this,t),a=i.size;return i.set(t,n),this.size+=i.size==a?0:1,this}return N0=e,N0}var L0,DM;function Q0(){if(DM)return L0;DM=1;var r=DY(),e=GY(),t=KY(),n=zY(),i=VY();function a(s){var o=-1,A=s==null?0:s.length;for(this.clear();++o<A;){var l=s[o];this.set(l[0],l[1])}}return a.prototype.clear=r,a.prototype.delete=e,a.prototype.get=t,a.prototype.has=n,a.prototype.set=i,L0=a,L0}var U0,HM;function jY(){if(HM)return U0;HM=1;var r=nd(),e=w0(),t=Q0(),n=200;function i(a,s){var o=this.__data__;if(o instanceof r){var A=o.__data__;if(!e||A.length<n-1)return A.push([a,s]),this.size=++o.size,this;o=this.__data__=new t(A)}return o.set(a,s),this.size=o.size,this}return U0=i,U0}var P0,GM;function ad(){if(GM)return P0;GM=1;var r=nd(),e=xY(),t=CY(),n=SY(),i=FY(),a=jY();function s(o){var A=this.__data__=new r(o);this.size=A.size}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=n,s.prototype.has=i,s.prototype.set=a,P0=s,P0}var R0,KM;function D0(){if(KM)return R0;KM=1;function r(e,t){for(var n=-1,i=e==null?0:e.length;++n<i&&t(e[n],n,e)!==!1;);return e}return R0=r,R0}var H0,zM;function VM(){if(zM)return H0;zM=1;var r=Js(),e=(function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch{}})();return H0=e,H0}var G0,jM;function sd(){if(jM)return G0;jM=1;var r=VM();function e(t,n,i){n=="__proto__"&&r?r(t,n,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[n]=i}return G0=e,G0}var K0,WM;function od(){if(WM)return K0;WM=1;var r=sd(),e=qo(),t=Object.prototype,n=t.hasOwnProperty;function i(a,s,o){var A=a[s];(!(n.call(a,s)&&e(A,o))||o===void 0&&!(s in a))&&r(a,s,o)}return K0=i,K0}var z0,qM;function Nl(){if(qM)return z0;qM=1;var r=od(),e=sd();function t(n,i,a,s){var o=!a;a||(a={});for(var A=-1,l=i.length;++A<l;){var c=i[A],u=s?s(a[c],n[c],c,a,n):void 0;u===void 0&&(u=n[c]),o?e(a,c,u):r(a,c,u)}return a}return z0=t,z0}var V0,$M;function WY(){if($M)return V0;$M=1;function r(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}return V0=r,V0}var j0,YM;function ta(){if(YM)return j0;YM=1;function r(e){return e!=null&&typeof e=="object"}return j0=r,j0}var W0,XM;function qY(){if(XM)return W0;XM=1;var r=Zs(),e=ta(),t="[object Arguments]";function n(i){return e(i)&&r(i)==t}return W0=n,W0}var q0,ZM;function Ll(){if(ZM)return q0;ZM=1;var r=qY(),e=ta(),t=Object.prototype,n=t.hasOwnProperty,i=t.propertyIsEnumerable,a=r((function(){return arguments})())?r:function(s){return e(s)&&n.call(s,"callee")&&!i.call(s,"callee")};return q0=a,q0}var $0,JM;function Bn(){if(JM)return $0;JM=1;var r=Array.isArray;return $0=r,$0}var Ql={exports:{}},Y0,eO;function $Y(){if(eO)return Y0;eO=1;function r(){return!1}return Y0=r,Y0}Ql.exports;var tO;function Yo(){return tO||(tO=1,(function(r,e){var t=Ci(),n=$Y(),i=e&&!e.nodeType&&e,a=i&&!0&&r&&!r.nodeType&&r,s=a&&a.exports===i,o=s?t.Buffer:void 0,A=o?o.isBuffer:void 0,l=A||n;r.exports=l})(Ql,Ql.exports)),Ql.exports}var X0,nO;function Ad(){if(nO)return X0;nO=1;var r=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function t(n,i){var a=typeof n;return i=i??r,!!i&&(a=="number"||a!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<i}return X0=t,X0}var Z0,rO;function J0(){if(rO)return Z0;rO=1;var r=9007199254740991;function e(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=r}return Z0=e,Z0}var ey,iO;function YY(){if(iO)return ey;iO=1;var r=Zs(),e=J0(),t=ta(),n="[object Arguments]",i="[object Array]",a="[object Boolean]",s="[object Date]",o="[object Error]",A="[object Function]",l="[object Map]",c="[object Number]",u="[object Object]",h="[object RegExp]",d="[object Set]",f="[object String]",g="[object WeakMap]",p="[object ArrayBuffer]",v="[object DataView]",y="[object Float32Array]",m="[object Float64Array]",B="[object Int8Array]",C="[object Int16Array]",S="[object Int32Array]",F="[object Uint8Array]",T="[object Uint8ClampedArray]",O="[object Uint16Array]",I="[object Uint32Array]",k={};k[y]=k[m]=k[B]=k[C]=k[S]=k[F]=k[T]=k[O]=k[I]=!0,k[n]=k[i]=k[p]=k[a]=k[v]=k[s]=k[o]=k[A]=k[l]=k[c]=k[u]=k[h]=k[d]=k[f]=k[g]=!1;function N(U){return t(U)&&e(U.length)&&!!k[r(U)]}return ey=N,ey}var ty,aO;function ld(){if(aO)return ty;aO=1;function r(e){return function(t){return e(t)}}return ty=r,ty}var Ul={exports:{}};Ul.exports;var sO;function ny(){return sO||(sO=1,(function(r,e){var t=cM(),n=e&&!e.nodeType&&e,i=n&&!0&&r&&!r.nodeType&&r,a=i&&i.exports===n,s=a&&t.process,o=(function(){try{var A=i&&i.require&&i.require("util").types;return A||s&&s.binding&&s.binding("util")}catch{}})();r.exports=o})(Ul,Ul.exports)),Ul.exports}var ry,oO;function Pl(){if(oO)return ry;oO=1;var r=YY(),e=ld(),t=ny(),n=t&&t.isTypedArray,i=n?e(n):r;return ry=i,ry}var iy,AO;function lO(){if(AO)return iy;AO=1;var r=WY(),e=Ll(),t=Bn(),n=Yo(),i=Ad(),a=Pl(),s=Object.prototype,o=s.hasOwnProperty;function A(l,c){var u=t(l),h=!u&&e(l),d=!u&&!h&&n(l),f=!u&&!h&&!d&&a(l),g=u||h||d||f,p=g?r(l.length,String):[],v=p.length;for(var y in l)(c||o.call(l,y))&&!(g&&(y=="length"||d&&(y=="offset"||y=="parent")||f&&(y=="buffer"||y=="byteLength"||y=="byteOffset")||i(y,v)))&&p.push(y);return p}return iy=A,iy}var ay,cO;function cd(){if(cO)return ay;cO=1;var r=Object.prototype;function e(t){var n=t&&t.constructor,i=typeof n=="function"&&n.prototype||r;return t===i}return ay=e,ay}var sy,uO;function hO(){if(uO)return sy;uO=1;function r(e,t){return function(n){return e(t(n))}}return sy=r,sy}var oy,dO;function XY(){if(dO)return oy;dO=1;var r=hO(),e=r(Object.keys,Object);return oy=e,oy}var Ay,fO;function ly(){if(fO)return Ay;fO=1;var r=cd(),e=XY(),t=Object.prototype,n=t.hasOwnProperty;function i(a){if(!r(a))return e(a);var s=[];for(var o in Object(a))n.call(a,o)&&o!="constructor"&&s.push(o);return s}return Ay=i,Ay}var cy,gO;function ma(){if(gO)return cy;gO=1;var r=kl(),e=J0();function t(n){return n!=null&&e(n.length)&&!r(n)}return cy=t,cy}var uy,pO;function ls(){if(pO)return uy;pO=1;var r=lO(),e=ly(),t=ma();function n(i){return t(i)?r(i):e(i)}return uy=n,uy}var hy,vO;function ZY(){if(vO)return hy;vO=1;var r=Nl(),e=ls();function t(n,i){return n&&r(i,e(i),n)}return hy=t,hy}var dy,yO;function JY(){if(yO)return dy;yO=1;function r(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}return dy=r,dy}var fy,mO;function eX(){if(mO)return fy;mO=1;var r=oi(),e=cd(),t=JY(),n=Object.prototype,i=n.hasOwnProperty;function a(s){if(!r(s))return t(s);var o=e(s),A=[];for(var l in s)l=="constructor"&&(o||!i.call(s,l))||A.push(l);return A}return fy=a,fy}var gy,wO;function eo(){if(wO)return gy;wO=1;var r=lO(),e=eX(),t=ma();function n(i){return t(i)?r(i,!0):e(i)}return gy=n,gy}var py,BO;function tX(){if(BO)return py;BO=1;var r=Nl(),e=eo();function t(n,i){return n&&r(i,e(i),n)}return py=t,py}var Rl={exports:{}};Rl.exports;var bO;function EO(){return bO||(bO=1,(function(r,e){var t=Ci(),n=e&&!e.nodeType&&e,i=n&&!0&&r&&!r.nodeType&&r,a=i&&i.exports===n,s=a?t.Buffer:void 0,o=s?s.allocUnsafe:void 0;function A(l,c){if(c)return l.slice();var u=l.length,h=o?o(u):new l.constructor(u);return l.copy(h),h}r.exports=A})(Rl,Rl.exports)),Rl.exports}var vy,xO;function CO(){if(xO)return vy;xO=1;function r(e,t){var n=-1,i=e.length;for(t||(t=Array(i));++n<i;)t[n]=e[n];return t}return vy=r,vy}var yy,SO;function FO(){if(SO)return yy;SO=1;function r(e,t){for(var n=-1,i=e==null?0:e.length,a=0,s=[];++n<i;){var o=e[n];t(o,n,e)&&(s[a++]=o)}return s}return yy=r,yy}var my,TO;function MO(){if(TO)return my;TO=1;function r(){return[]}return my=r,my}var wy,OO;function By(){if(OO)return wy;OO=1;var r=FO(),e=MO(),t=Object.prototype,n=t.propertyIsEnumerable,i=Object.getOwnPropertySymbols,a=i?function(s){return s==null?[]:(s=Object(s),r(i(s),function(o){return n.call(s,o)}))}:e;return wy=a,wy}var by,IO;function nX(){if(IO)return by;IO=1;var r=Nl(),e=By();function t(n,i){return r(n,e(n),i)}return by=t,by}var Ey,_O;function xy(){if(_O)return Ey;_O=1;function r(e,t){for(var n=-1,i=t.length,a=e.length;++n<i;)e[a+n]=t[n];return e}return Ey=r,Ey}var Cy,kO;function ud(){if(kO)return Cy;kO=1;var r=hO(),e=r(Object.getPrototypeOf,Object);return Cy=e,Cy}var Sy,NO;function LO(){if(NO)return Sy;NO=1;var r=xy(),e=ud(),t=By(),n=MO(),i=Object.getOwnPropertySymbols,a=i?function(s){for(var o=[];s;)r(o,t(s)),s=e(s);return o}:n;return Sy=a,Sy}var Fy,QO;function rX(){if(QO)return Fy;QO=1;var r=Nl(),e=LO();function t(n,i){return r(n,e(n),i)}return Fy=t,Fy}var Ty,UO;function PO(){if(UO)return Ty;UO=1;var r=xy(),e=Bn();function t(n,i,a){var s=i(n);return e(n)?s:r(s,a(n))}return Ty=t,Ty}var My,RO;function DO(){if(RO)return My;RO=1;var r=PO(),e=By(),t=ls();function n(i){return r(i,t,e)}return My=n,My}var Oy,HO;function iX(){if(HO)return Oy;HO=1;var r=PO(),e=LO(),t=eo();function n(i){return r(i,t,e)}return Oy=n,Oy}var Iy,GO;function aX(){if(GO)return Iy;GO=1;var r=Js(),e=Ci(),t=r(e,"DataView");return Iy=t,Iy}var _y,KO;function sX(){if(KO)return _y;KO=1;var r=Js(),e=Ci(),t=r(e,"Promise");return _y=t,_y}var ky,zO;function VO(){if(zO)return ky;zO=1;var r=Js(),e=Ci(),t=r(e,"Set");return ky=t,ky}var Ny,jO;function oX(){if(jO)return Ny;jO=1;var r=Js(),e=Ci(),t=r(e,"WeakMap");return Ny=t,Ny}var Ly,WO;function Xo(){if(WO)return Ly;WO=1;var r=aX(),e=w0(),t=sX(),n=VO(),i=oX(),a=Zs(),s=BM(),o="[object Map]",A="[object Object]",l="[object Promise]",c="[object Set]",u="[object WeakMap]",h="[object DataView]",d=s(r),f=s(e),g=s(t),p=s(n),v=s(i),y=a;return(r&&y(new r(new ArrayBuffer(1)))!=h||e&&y(new e)!=o||t&&y(t.resolve())!=l||n&&y(new n)!=c||i&&y(new i)!=u)&&(y=function(m){var B=a(m),C=B==A?m.constructor:void 0,S=C?s(C):"";if(S)switch(S){case d:return h;case f:return o;case g:return l;case p:return c;case v:return u}return B}),Ly=y,Ly}var Qy,qO;function AX(){if(qO)return Qy;qO=1;var r=Object.prototype,e=r.hasOwnProperty;function t(n){var i=n.length,a=new n.constructor(i);return i&&typeof n[0]=="string"&&e.call(n,"index")&&(a.index=n.index,a.input=n.input),a}return Qy=t,Qy}var Uy,$O;function YO(){if($O)return Uy;$O=1;var r=Ci(),e=r.Uint8Array;return Uy=e,Uy}var Py,XO;function Ry(){if(XO)return Py;XO=1;var r=YO();function e(t){var n=new t.constructor(t.byteLength);return new r(n).set(new r(t)),n}return Py=e,Py}var Dy,ZO;function lX(){if(ZO)return Dy;ZO=1;var r=Ry();function e(t,n){var i=n?r(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.byteLength)}return Dy=e,Dy}var Hy,JO;function cX(){if(JO)return Hy;JO=1;var r=/\w*$/;function e(t){var n=new t.constructor(t.source,r.exec(t));return n.lastIndex=t.lastIndex,n}return Hy=e,Hy}var Gy,eI;function uX(){if(eI)return Gy;eI=1;var r=$o(),e=r?r.prototype:void 0,t=e?e.valueOf:void 0;function n(i){return t?Object(t.call(i)):{}}return Gy=n,Gy}var Ky,tI;function nI(){if(tI)return Ky;tI=1;var r=Ry();function e(t,n){var i=n?r(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.length)}return Ky=e,Ky}var zy,rI;function hX(){if(rI)return zy;rI=1;var r=Ry(),e=lX(),t=cX(),n=uX(),i=nI(),a="[object Boolean]",s="[object Date]",o="[object Map]",A="[object Number]",l="[object RegExp]",c="[object Set]",u="[object String]",h="[object Symbol]",d="[object ArrayBuffer]",f="[object DataView]",g="[object Float32Array]",p="[object Float64Array]",v="[object Int8Array]",y="[object Int16Array]",m="[object Int32Array]",B="[object Uint8Array]",C="[object Uint8ClampedArray]",S="[object Uint16Array]",F="[object Uint32Array]";function T(O,I,k){var N=O.constructor;switch(I){case d:return r(O);case a:case s:return new N(+O);case f:return e(O,k);case g:case p:case v:case y:case m:case B:case C:case S:case F:return i(O,k);case o:return new N;case A:case u:return new N(O);case l:return t(O);case c:return new N;case h:return n(O)}}return zy=T,zy}var Vy,iI;function aI(){if(iI)return Vy;iI=1;var r=oi(),e=Object.create,t=(function(){function n(){}return function(i){if(!r(i))return{};if(e)return e(i);n.prototype=i;var a=new n;return n.prototype=void 0,a}})();return Vy=t,Vy}var jy,sI;function oI(){if(sI)return jy;sI=1;var r=aI(),e=ud(),t=cd();function n(i){return typeof i.constructor=="function"&&!t(i)?r(e(i)):{}}return jy=n,jy}var Wy,AI;function dX(){if(AI)return Wy;AI=1;var r=Xo(),e=ta(),t="[object Map]";function n(i){return e(i)&&r(i)==t}return Wy=n,Wy}var qy,lI;function fX(){if(lI)return qy;lI=1;var r=dX(),e=ld(),t=ny(),n=t&&t.isMap,i=n?e(n):r;return qy=i,qy}var $y,cI;function gX(){if(cI)return $y;cI=1;var r=Xo(),e=ta(),t="[object Set]";function n(i){return e(i)&&r(i)==t}return $y=n,$y}var Yy,uI;function pX(){if(uI)return Yy;uI=1;var r=gX(),e=ld(),t=ny(),n=t&&t.isSet,i=n?e(n):r;return Yy=i,Yy}var Xy,hI;function dI(){if(hI)return Xy;hI=1;var r=ad(),e=D0(),t=od(),n=ZY(),i=tX(),a=EO(),s=CO(),o=nX(),A=rX(),l=DO(),c=iX(),u=Xo(),h=AX(),d=hX(),f=oI(),g=Bn(),p=Yo(),v=fX(),y=oi(),m=pX(),B=ls(),C=eo(),S=1,F=2,T=4,O="[object Arguments]",I="[object Array]",k="[object Boolean]",N="[object Date]",U="[object Error]",D="[object Function]",G="[object GeneratorFunction]",Z="[object Map]",q="[object Number]",j="[object Object]",te="[object RegExp]",ue="[object Set]",ge="[object String]",Y="[object Symbol]",xe="[object WeakMap]",$="[object ArrayBuffer]",K="[object DataView]",ee="[object Float32Array]",oe="[object Float64Array]",Ee="[object Int8Array]",Le="[object Int16Array]",Pe="[object Int32Array]",st="[object Uint8Array]",ut="[object Uint8ClampedArray]",ht="[object Uint16Array]",Et="[object Uint32Array]",Ue={};Ue[O]=Ue[I]=Ue[$]=Ue[K]=Ue[k]=Ue[N]=Ue[ee]=Ue[oe]=Ue[Ee]=Ue[Le]=Ue[Pe]=Ue[Z]=Ue[q]=Ue[j]=Ue[te]=Ue[ue]=Ue[ge]=Ue[Y]=Ue[st]=Ue[ut]=Ue[ht]=Ue[Et]=!0,Ue[U]=Ue[D]=Ue[xe]=!1;function vt(it,_r,It,Ca,vr,tn){var Qt,qn=_r&S,sr=_r&F,kr=_r&T;if(It&&(Qt=vr?It(it,Ca,vr,tn):It(it)),Qt!==void 0)return Qt;if(!y(it))return it;var yr=g(it);if(yr){if(Qt=h(it),!qn)return s(it,Qt)}else{var or=u(it),fn=or==D||or==G;if(p(it))return a(it,qn);if(or==j||or==O||fn&&!vr){if(Qt=sr||fn?{}:f(it),!qn)return sr?A(it,i(Qt,it)):o(it,n(Qt,it))}else{if(!Ue[or])return vr?it:{};Qt=d(it,or,qn)}}tn||(tn=new r);var gn=tn.get(it);if(gn)return gn;tn.set(it,Qt),m(it)?it.forEach(function(jr){Qt.add(vt(jr,_r,It,jr,it,tn))}):v(it)&&it.forEach(function(jr,hi){Qt.set(hi,vt(jr,_r,It,hi,it,tn))});var tc=kr?sr?c:l:sr?C:B,co=yr?void 0:tc(it);return e(co||it,function(jr,hi){co&&(hi=jr,jr=it[hi]),t(Qt,hi,vt(jr,_r,It,hi,it,tn))}),Qt}return Xy=vt,Xy}var Zy,fI;function vX(){if(fI)return Zy;fI=1;var r=dI(),e=4;function t(n){return r(n,e)}return Zy=t,Zy}var Jy,gI;function em(){if(gI)return Jy;gI=1;function r(e){return function(){return e}}return Jy=r,Jy}var tm,pI;function yX(){if(pI)return tm;pI=1;function r(e){return function(t,n,i){for(var a=-1,s=Object(t),o=i(t),A=o.length;A--;){var l=o[e?A:++a];if(n(s[l],l,s)===!1)break}return t}}return tm=r,tm}var nm,vI;function rm(){if(vI)return nm;vI=1;var r=yX(),e=r();return nm=e,nm}var im,yI;function am(){if(yI)return im;yI=1;var r=rm(),e=ls();function t(n,i){return n&&r(n,i,e)}return im=t,im}var sm,mI;function mX(){if(mI)return sm;mI=1;var r=ma();function e(t,n){return function(i,a){if(i==null)return i;if(!r(i))return t(i,a);for(var s=i.length,o=n?s:-1,A=Object(i);(n?o--:++o<s)&&a(A[o],o,A)!==!1;);return i}}return sm=e,sm}var om,wI;function hd(){if(wI)return om;wI=1;var r=am(),e=mX(),t=e(r);return om=t,om}var Am,BI;function to(){if(BI)return Am;BI=1;function r(e){return e}return Am=r,Am}var lm,bI;function EI(){if(bI)return lm;bI=1;var r=to();function e(t){return typeof t=="function"?t:r}return lm=e,lm}var cm,xI;function CI(){if(xI)return cm;xI=1;var r=D0(),e=hd(),t=EI(),n=Bn();function i(a,s){var o=n(a)?r:e;return o(a,t(s))}return cm=i,cm}var um,SI;function FI(){return SI||(SI=1,um=CI()),um}var hm,TI;function wX(){if(TI)return hm;TI=1;var r=hd();function e(t,n){var i=[];return r(t,function(a,s,o){n(a,s,o)&&i.push(a)}),i}return hm=e,hm}var dm,MI;function BX(){if(MI)return dm;MI=1;var r="__lodash_hash_undefined__";function e(t){return this.__data__.set(t,r),this}return dm=e,dm}var fm,OI;function bX(){if(OI)return fm;OI=1;function r(e){return this.__data__.has(e)}return fm=r,fm}var gm,II;function _I(){if(II)return gm;II=1;var r=Q0(),e=BX(),t=bX();function n(i){var a=-1,s=i==null?0:i.length;for(this.__data__=new r;++a<s;)this.add(i[a])}return n.prototype.add=n.prototype.push=e,n.prototype.has=t,gm=n,gm}var pm,kI;function EX(){if(kI)return pm;kI=1;function r(e,t){for(var n=-1,i=e==null?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1}return pm=r,pm}var vm,NI;function LI(){if(NI)return vm;NI=1;function r(e,t){return e.has(t)}return vm=r,vm}var ym,QI;function UI(){if(QI)return ym;QI=1;var r=_I(),e=EX(),t=LI(),n=1,i=2;function a(s,o,A,l,c,u){var h=A&n,d=s.length,f=o.length;if(d!=f&&!(h&&f>d))return!1;var g=u.get(s),p=u.get(o);if(g&&p)return g==o&&p==s;var v=-1,y=!0,m=A&i?new r:void 0;for(u.set(s,o),u.set(o,s);++v<d;){var B=s[v],C=o[v];if(l)var S=h?l(C,B,v,o,s,u):l(B,C,v,s,o,u);if(S!==void 0){if(S)continue;y=!1;break}if(m){if(!e(o,function(F,T){if(!t(m,T)&&(B===F||c(B,F,A,l,u)))return m.push(T)})){y=!1;break}}else if(!(B===C||c(B,C,A,l,u))){y=!1;break}}return u.delete(s),u.delete(o),y}return ym=a,ym}var mm,PI;function xX(){if(PI)return mm;PI=1;function r(e){var t=-1,n=Array(e.size);return e.forEach(function(i,a){n[++t]=[a,i]}),n}return mm=r,mm}var wm,RI;function Bm(){if(RI)return wm;RI=1;function r(e){var t=-1,n=Array(e.size);return e.forEach(function(i){n[++t]=i}),n}return wm=r,wm}var bm,DI;function CX(){if(DI)return bm;DI=1;var r=$o(),e=YO(),t=qo(),n=UI(),i=xX(),a=Bm(),s=1,o=2,A="[object Boolean]",l="[object Date]",c="[object Error]",u="[object Map]",h="[object Number]",d="[object RegExp]",f="[object Set]",g="[object String]",p="[object Symbol]",v="[object ArrayBuffer]",y="[object DataView]",m=r?r.prototype:void 0,B=m?m.valueOf:void 0;function C(S,F,T,O,I,k,N){switch(T){case y:if(S.byteLength!=F.byteLength||S.byteOffset!=F.byteOffset)return!1;S=S.buffer,F=F.buffer;case v:return!(S.byteLength!=F.byteLength||!k(new e(S),new e(F)));case A:case l:case h:return t(+S,+F);case c:return S.name==F.name&&S.message==F.message;case d:case g:return S==F+"";case u:var U=i;case f:var D=O&s;if(U||(U=a),S.size!=F.size&&!D)return!1;var G=N.get(S);if(G)return G==F;O|=o,N.set(S,F);var Z=n(U(S),U(F),O,I,k,N);return N.delete(S),Z;case p:if(B)return B.call(S)==B.call(F)}return!1}return bm=C,bm}var Em,HI;function SX(){if(HI)return Em;HI=1;var r=DO(),e=1,t=Object.prototype,n=t.hasOwnProperty;function i(a,s,o,A,l,c){var u=o&e,h=r(a),d=h.length,f=r(s),g=f.length;if(d!=g&&!u)return!1;for(var p=d;p--;){var v=h[p];if(!(u?v in s:n.call(s,v)))return!1}var y=c.get(a),m=c.get(s);if(y&&m)return y==s&&m==a;var B=!0;c.set(a,s),c.set(s,a);for(var C=u;++p<d;){v=h[p];var S=a[v],F=s[v];if(A)var T=u?A(F,S,v,s,a,c):A(S,F,v,a,s,c);if(!(T===void 0?S===F||l(S,F,o,A,c):T)){B=!1;break}C||(C=v=="constructor")}if(B&&!C){var O=a.constructor,I=s.constructor;O!=I&&"constructor"in a&&"constructor"in s&&!(typeof O=="function"&&O instanceof O&&typeof I=="function"&&I instanceof I)&&(B=!1)}return c.delete(a),c.delete(s),B}return Em=i,Em}var xm,GI;function FX(){if(GI)return xm;GI=1;var r=ad(),e=UI(),t=CX(),n=SX(),i=Xo(),a=Bn(),s=Yo(),o=Pl(),A=1,l="[object Arguments]",c="[object Array]",u="[object Object]",h=Object.prototype,d=h.hasOwnProperty;function f(g,p,v,y,m,B){var C=a(g),S=a(p),F=C?c:i(g),T=S?c:i(p);F=F==l?u:F,T=T==l?u:T;var O=F==u,I=T==u,k=F==T;if(k&&s(g)){if(!s(p))return!1;C=!0,O=!1}if(k&&!O)return B||(B=new r),C||o(g)?e(g,p,v,y,m,B):t(g,p,F,v,y,m,B);if(!(v&A)){var N=O&&d.call(g,"__wrapped__"),U=I&&d.call(p,"__wrapped__");if(N||U){var D=N?g.value():g,G=U?p.value():p;return B||(B=new r),m(D,G,v,y,B)}}return k?(B||(B=new r),n(g,p,v,y,m,B)):!1}return xm=f,xm}var Cm,KI;function zI(){if(KI)return Cm;KI=1;var r=FX(),e=ta();function t(n,i,a,s,o){return n===i?!0:n==null||i==null||!e(n)&&!e(i)?n!==n&&i!==i:r(n,i,a,s,t,o)}return Cm=t,Cm}var Sm,VI;function TX(){if(VI)return Sm;VI=1;var r=ad(),e=zI(),t=1,n=2;function i(a,s,o,A){var l=o.length,c=l,u=!A;if(a==null)return!c;for(a=Object(a);l--;){var h=o[l];if(u&&h[2]?h[1]!==a[h[0]]:!(h[0]in a))return!1}for(;++l<c;){h=o[l];var d=h[0],f=a[d],g=h[1];if(u&&h[2]){if(f===void 0&&!(d in a))return!1}else{var p=new r;if(A)var v=A(f,g,d,a,s,p);if(!(v===void 0?e(g,f,t|n,A,p):v))return!1}}return!0}return Sm=i,Sm}var Fm,jI;function WI(){if(jI)return Fm;jI=1;var r=oi();function e(t){return t===t&&!r(t)}return Fm=e,Fm}var Tm,qI;function MX(){if(qI)return Tm;qI=1;var r=WI(),e=ls();function t(n){for(var i=e(n),a=i.length;a--;){var s=i[a],o=n[s];i[a]=[s,o,r(o)]}return i}return Tm=t,Tm}var Mm,$I;function YI(){if($I)return Mm;$I=1;function r(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}return Mm=r,Mm}var Om,XI;function OX(){if(XI)return Om;XI=1;var r=TX(),e=MX(),t=YI();function n(i){var a=e(i);return a.length==1&&a[0][2]?t(a[0][0],a[0][1]):function(s){return s===i||r(s,i,a)}}return Om=n,Om}var Im,ZI;function Zo(){if(ZI)return Im;ZI=1;var r=Zs(),e=ta(),t="[object Symbol]";function n(i){return typeof i=="symbol"||e(i)&&r(i)==t}return Im=n,Im}var _m,JI;function km(){if(JI)return _m;JI=1;var r=Bn(),e=Zo(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(a,s){if(r(a))return!1;var o=typeof a;return o=="number"||o=="symbol"||o=="boolean"||a==null||e(a)?!0:n.test(a)||!t.test(a)||s!=null&&a in Object(s)}return _m=i,_m}var Nm,e_;function IX(){if(e_)return Nm;e_=1;var r=Q0(),e="Expected a function";function t(n,i){if(typeof n!="function"||i!=null&&typeof i!="function")throw new TypeError(e);var a=function(){var s=arguments,o=i?i.apply(this,s):s[0],A=a.cache;if(A.has(o))return A.get(o);var l=n.apply(this,s);return a.cache=A.set(o,l)||A,l};return a.cache=new(t.Cache||r),a}return t.Cache=r,Nm=t,Nm}var Lm,t_;function _X(){if(t_)return Lm;t_=1;var r=IX(),e=500;function t(n){var i=r(n,function(s){return a.size===e&&a.clear(),s}),a=i.cache;return i}return Lm=t,Lm}var Qm,n_;function kX(){if(n_)return Qm;n_=1;var r=_X(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,n=r(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(e,function(s,o,A,l){a.push(A?l.replace(t,"$1"):o||s)}),a});return Qm=n,Qm}var Um,r_;function dd(){if(r_)return Um;r_=1;function r(e,t){for(var n=-1,i=e==null?0:e.length,a=Array(i);++n<i;)a[n]=t(e[n],n,e);return a}return Um=r,Um}var Pm,i_;function NX(){if(i_)return Pm;i_=1;var r=$o(),e=dd(),t=Bn(),n=Zo(),i=r?r.prototype:void 0,a=i?i.toString:void 0;function s(o){if(typeof o=="string")return o;if(t(o))return e(o,s)+"";if(n(o))return a?a.call(o):"";var A=o+"";return A=="0"&&1/o==-1/0?"-0":A}return Pm=s,Pm}var Rm,a_;function s_(){if(a_)return Rm;a_=1;var r=NX();function e(t){return t==null?"":r(t)}return Rm=e,Rm}var Dm,o_;function fd(){if(o_)return Dm;o_=1;var r=Bn(),e=km(),t=kX(),n=s_();function i(a,s){return r(a)?a:e(a,s)?[a]:t(n(a))}return Dm=i,Dm}var Hm,A_;function Dl(){if(A_)return Hm;A_=1;var r=Zo();function e(t){if(typeof t=="string"||r(t))return t;var n=t+"";return n=="0"&&1/t==-1/0?"-0":n}return Hm=e,Hm}var Gm,l_;function gd(){if(l_)return Gm;l_=1;var r=fd(),e=Dl();function t(n,i){i=r(i,n);for(var a=0,s=i.length;n!=null&&a<s;)n=n[e(i[a++])];return a&&a==s?n:void 0}return Gm=t,Gm}var Km,c_;function LX(){if(c_)return Km;c_=1;var r=gd();function e(t,n,i){var a=t==null?void 0:r(t,n);return a===void 0?i:a}return Km=e,Km}var zm,u_;function QX(){if(u_)return zm;u_=1;function r(e,t){return e!=null&&t in Object(e)}return zm=r,zm}var Vm,h_;function d_(){if(h_)return Vm;h_=1;var r=fd(),e=Ll(),t=Bn(),n=Ad(),i=J0(),a=Dl();function s(o,A,l){A=r(A,o);for(var c=-1,u=A.length,h=!1;++c<u;){var d=a(A[c]);if(!(h=o!=null&&l(o,d)))break;o=o[d]}return h||++c!=u?h:(u=o==null?0:o.length,!!u&&i(u)&&n(d,u)&&(t(o)||e(o)))}return Vm=s,Vm}var jm,f_;function g_(){if(f_)return jm;f_=1;var r=QX(),e=d_();function t(n,i){return n!=null&&e(n,i,r)}return jm=t,jm}var Wm,p_;function UX(){if(p_)return Wm;p_=1;var r=zI(),e=LX(),t=g_(),n=km(),i=WI(),a=YI(),s=Dl(),o=1,A=2;function l(c,u){return n(c)&&i(u)?a(s(c),u):function(h){var d=e(h,c);return d===void 0&&d===u?t(h,c):r(u,d,o|A)}}return Wm=l,Wm}var qm,v_;function y_(){if(v_)return qm;v_=1;function r(e){return function(t){return t?.[e]}}return qm=r,qm}var $m,m_;function PX(){if(m_)return $m;m_=1;var r=gd();function e(t){return function(n){return r(n,t)}}return $m=e,$m}var Ym,w_;function RX(){if(w_)return Ym;w_=1;var r=y_(),e=PX(),t=km(),n=Dl();function i(a){return t(a)?r(n(a)):e(a)}return Ym=i,Ym}var Xm,B_;function wa(){if(B_)return Xm;B_=1;var r=OX(),e=UX(),t=to(),n=Bn(),i=RX();function a(s){return typeof s=="function"?s:s==null?t:typeof s=="object"?n(s)?e(s[0],s[1]):r(s):i(s)}return Xm=a,Xm}var Zm,b_;function E_(){if(b_)return Zm;b_=1;var r=FO(),e=wX(),t=wa(),n=Bn();function i(a,s){var o=n(a)?r:e;return o(a,t(s,3))}return Zm=i,Zm}var Jm,x_;function DX(){if(x_)return Jm;x_=1;var r=Object.prototype,e=r.hasOwnProperty;function t(n,i){return n!=null&&e.call(n,i)}return Jm=t,Jm}var ew,C_;function S_(){if(C_)return ew;C_=1;var r=DX(),e=d_();function t(n,i){return n!=null&&e(n,i,r)}return ew=t,ew}var tw,F_;function HX(){if(F_)return tw;F_=1;var r=ly(),e=Xo(),t=Ll(),n=Bn(),i=ma(),a=Yo(),s=cd(),o=Pl(),A="[object Map]",l="[object Set]",c=Object.prototype,u=c.hasOwnProperty;function h(d){if(d==null)return!0;if(i(d)&&(n(d)||typeof d=="string"||typeof d.splice=="function"||a(d)||o(d)||t(d)))return!d.length;var f=e(d);if(f==A||f==l)return!d.size;if(s(d))return!r(d).length;for(var g in d)if(u.call(d,g))return!1;return!0}return tw=h,tw}var nw,T_;function M_(){if(T_)return nw;T_=1;function r(e){return e===void 0}return nw=r,nw}var rw,O_;function I_(){if(O_)return rw;O_=1;var r=hd(),e=ma();function t(n,i){var a=-1,s=e(n)?Array(n.length):[];return r(n,function(o,A,l){s[++a]=i(o,A,l)}),s}return rw=t,rw}var iw,__;function k_(){if(__)return iw;__=1;var r=dd(),e=wa(),t=I_(),n=Bn();function i(a,s){var o=n(a)?r:t;return o(a,e(s,3))}return iw=i,iw}var aw,N_;function GX(){if(N_)return aw;N_=1;function r(e,t,n,i){var a=-1,s=e==null?0:e.length;for(i&&s&&(n=e[++a]);++a<s;)n=t(n,e[a],a,e);return n}return aw=r,aw}var sw,L_;function KX(){if(L_)return sw;L_=1;function r(e,t,n,i,a){return a(e,function(s,o,A){n=i?(i=!1,s):t(n,s,o,A)}),n}return sw=r,sw}var ow,Q_;function U_(){if(Q_)return ow;Q_=1;var r=GX(),e=hd(),t=wa(),n=KX(),i=Bn();function a(s,o,A){var l=i(s)?r:n,c=arguments.length<3;return l(s,t(o,4),A,c,e)}return ow=a,ow}var Aw,P_;function zX(){if(P_)return Aw;P_=1;var r=Zs(),e=Bn(),t=ta(),n="[object String]";function i(a){return typeof a=="string"||!e(a)&&t(a)&&r(a)==n}return Aw=i,Aw}var lw,R_;function VX(){if(R_)return lw;R_=1;var r=y_(),e=r("length");return lw=e,lw}var cw,D_;function jX(){if(D_)return cw;D_=1;var r="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=e+t+n,a="\\ufe0e\\ufe0f",s="\\u200d",o=RegExp("["+s+r+i+a+"]");function A(l){return o.test(l)}return cw=A,cw}var uw,H_;function WX(){if(H_)return uw;H_=1;var r="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=e+t+n,a="\\ufe0e\\ufe0f",s="["+r+"]",o="["+i+"]",A="\\ud83c[\\udffb-\\udfff]",l="(?:"+o+"|"+A+")",c="[^"+r+"]",u="(?:\\ud83c[\\udde6-\\uddff]){2}",h="[\\ud800-\\udbff][\\udc00-\\udfff]",d="\\u200d",f=l+"?",g="["+a+"]?",p="(?:"+d+"(?:"+[c,u,h].join("|")+")"+g+f+")*",v=g+f+p,y="(?:"+[c+o+"?",o,u,h,s].join("|")+")",m=RegExp(A+"(?="+A+")|"+y+v,"g");function B(C){for(var S=m.lastIndex=0;m.test(C);)++S;return S}return uw=B,uw}var hw,G_;function qX(){if(G_)return hw;G_=1;var r=VX(),e=jX(),t=WX();function n(i){return e(i)?t(i):r(i)}return hw=n,hw}var dw,K_;function $X(){if(K_)return dw;K_=1;var r=ly(),e=Xo(),t=ma(),n=zX(),i=qX(),a="[object Map]",s="[object Set]";function o(A){if(A==null)return 0;if(t(A))return n(A)?i(A):A.length;var l=e(A);return l==a||l==s?A.size:r(A).length}return dw=o,dw}var fw,z_;function YX(){if(z_)return fw;z_=1;var r=D0(),e=aI(),t=am(),n=wa(),i=ud(),a=Bn(),s=Yo(),o=kl(),A=oi(),l=Pl();function c(u,h,d){var f=a(u),g=f||s(u)||l(u);if(h=n(h,4),d==null){var p=u&&u.constructor;g?d=f?new p:[]:A(u)?d=o(p)?e(i(u)):{}:d={}}return(g?r:t)(u,function(v,y,m){return h(d,v,y,m)}),d}return fw=c,fw}var gw,V_;function XX(){if(V_)return gw;V_=1;var r=$o(),e=Ll(),t=Bn(),n=r?r.isConcatSpreadable:void 0;function i(a){return t(a)||e(a)||!!(n&&a&&a[n])}return gw=i,gw}var pw,j_;function vw(){if(j_)return pw;j_=1;var r=xy(),e=XX();function t(n,i,a,s,o){var A=-1,l=n.length;for(a||(a=e),o||(o=[]);++A<l;){var c=n[A];i>0&&a(c)?i>1?t(c,i-1,a,s,o):r(o,c):s||(o[o.length]=c)}return o}return pw=t,pw}var yw,W_;function ZX(){if(W_)return yw;W_=1;function r(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}return yw=r,yw}var mw,q_;function $_(){if(q_)return mw;q_=1;var r=ZX(),e=Math.max;function t(n,i,a){return i=e(i===void 0?n.length-1:i,0),function(){for(var s=arguments,o=-1,A=e(s.length-i,0),l=Array(A);++o<A;)l[o]=s[i+o];o=-1;for(var c=Array(i+1);++o<i;)c[o]=s[o];return c[i]=a(l),r(n,this,c)}}return mw=t,mw}var ww,Y_;function JX(){if(Y_)return ww;Y_=1;var r=em(),e=VM(),t=to(),n=e?function(i,a){return e(i,"toString",{configurable:!0,enumerable:!1,value:r(a),writable:!0})}:t;return ww=n,ww}var Bw,X_;function eZ(){if(X_)return Bw;X_=1;var r=800,e=16,t=Date.now;function n(i){var a=0,s=0;return function(){var o=t(),A=e-(o-s);if(s=o,A>0){if(++a>=r)return arguments[0]}else a=0;return i.apply(void 0,arguments)}}return Bw=n,Bw}var bw,Z_;function J_(){if(Z_)return bw;Z_=1;var r=JX(),e=eZ(),t=e(r);return bw=t,bw}var Ew,ek;function pd(){if(ek)return Ew;ek=1;var r=to(),e=$_(),t=J_();function n(i,a){return t(e(i,a,r),i+"")}return Ew=n,Ew}var xw,tk;function nk(){if(tk)return xw;tk=1;function r(e,t,n,i){for(var a=e.length,s=n+(i?1:-1);i?s--:++s<a;)if(t(e[s],s,e))return s;return-1}return xw=r,xw}var Cw,rk;function tZ(){if(rk)return Cw;rk=1;function r(e){return e!==e}return Cw=r,Cw}var Sw,ik;function nZ(){if(ik)return Sw;ik=1;function r(e,t,n){for(var i=n-1,a=e.length;++i<a;)if(e[i]===t)return i;return-1}return Sw=r,Sw}var Fw,ak;function rZ(){if(ak)return Fw;ak=1;var r=nk(),e=tZ(),t=nZ();function n(i,a,s){return a===a?t(i,a,s):r(i,e,s)}return Fw=n,Fw}var Tw,sk;function iZ(){if(sk)return Tw;sk=1;var r=rZ();function e(t,n){var i=t==null?0:t.length;return!!i&&r(t,n,0)>-1}return Tw=e,Tw}var Mw,ok;function aZ(){if(ok)return Mw;ok=1;function r(e,t,n){for(var i=-1,a=e==null?0:e.length;++i<a;)if(n(t,e[i]))return!0;return!1}return Mw=r,Mw}var Ow,Ak;function sZ(){if(Ak)return Ow;Ak=1;function r(){}return Ow=r,Ow}var Iw,lk;function oZ(){if(lk)return Iw;lk=1;var r=VO(),e=sZ(),t=Bm(),n=1/0,i=r&&1/t(new r([,-0]))[1]==n?function(a){return new r(a)}:e;return Iw=i,Iw}var _w,ck;function AZ(){if(ck)return _w;ck=1;var r=_I(),e=iZ(),t=aZ(),n=LI(),i=oZ(),a=Bm(),s=200;function o(A,l,c){var u=-1,h=e,d=A.length,f=!0,g=[],p=g;if(c)f=!1,h=t;else if(d>=s){var v=l?null:i(A);if(v)return a(v);f=!1,h=n,p=new r}else p=l?[]:g;e:for(;++u<d;){var y=A[u],m=l?l(y):y;if(y=c||y!==0?y:0,f&&m===m){for(var B=p.length;B--;)if(p[B]===m)continue e;l&&p.push(m),g.push(y)}else h(p,m,c)||(p!==g&&p.push(m),g.push(y))}return g}return _w=o,_w}var kw,uk;function hk(){if(uk)return kw;uk=1;var r=ma(),e=ta();function t(n){return e(n)&&r(n)}return kw=t,kw}var Nw,dk;function lZ(){if(dk)return Nw;dk=1;var r=vw(),e=pd(),t=AZ(),n=hk(),i=e(function(a){return t(r(a,1,n,!0))});return Nw=i,Nw}var Lw,fk;function cZ(){if(fk)return Lw;fk=1;var r=dd();function e(t,n){return r(n,function(i){return t[i]})}return Lw=e,Lw}var Qw,gk;function pk(){if(gk)return Qw;gk=1;var r=cZ(),e=ls();function t(n){return n==null?[]:r(n,e(n))}return Qw=t,Qw}var Uw,vk;function Ai(){if(vk)return Uw;vk=1;var r;if(typeof jv=="function")try{r={clone:vX(),constant:em(),each:FI(),filter:E_(),has:S_(),isArray:Bn(),isEmpty:HX(),isFunction:kl(),isUndefined:M_(),keys:ls(),map:k_(),reduce:U_(),size:$X(),transform:YX(),union:lZ(),values:pk()}}catch{}return r||(r=window._),Uw=r,Uw}var Pw,yk;function Rw(){if(yk)return Pw;yk=1;var r=Ai();Pw=i;var e="\0",t="\0",n="";function i(c){this._isDirected=r.has(c,"directed")?c.directed:!0,this._isMultigraph=r.has(c,"multigraph")?c.multigraph:!1,this._isCompound=r.has(c,"compound")?c.compound:!1,this._label=void 0,this._defaultNodeLabelFn=r.constant(void 0),this._defaultEdgeLabelFn=r.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[t]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}i.prototype._nodeCount=0,i.prototype._edgeCount=0,i.prototype.isDirected=function(){return this._isDirected},i.prototype.isMultigraph=function(){return this._isMultigraph},i.prototype.isCompound=function(){return this._isCompound},i.prototype.setGraph=function(c){return this._label=c,this},i.prototype.graph=function(){return this._label},i.prototype.setDefaultNodeLabel=function(c){return r.isFunction(c)||(c=r.constant(c)),this._defaultNodeLabelFn=c,this},i.prototype.nodeCount=function(){return this._nodeCount},i.prototype.nodes=function(){return r.keys(this._nodes)},i.prototype.sources=function(){var c=this;return r.filter(this.nodes(),function(u){return r.isEmpty(c._in[u])})},i.prototype.sinks=function(){var c=this;return r.filter(this.nodes(),function(u){return r.isEmpty(c._out[u])})},i.prototype.setNodes=function(c,u){var h=arguments,d=this;return r.each(c,function(f){h.length>1?d.setNode(f,u):d.setNode(f)}),this},i.prototype.setNode=function(c,u){return r.has(this._nodes,c)?(arguments.length>1&&(this._nodes[c]=u),this):(this._nodes[c]=arguments.length>1?u:this._defaultNodeLabelFn(c),this._isCompound&&(this._parent[c]=t,this._children[c]={},this._children[t][c]=!0),this._in[c]={},this._preds[c]={},this._out[c]={},this._sucs[c]={},++this._nodeCount,this)},i.prototype.node=function(c){return this._nodes[c]},i.prototype.hasNode=function(c){return r.has(this._nodes,c)},i.prototype.removeNode=function(c){var u=this;if(r.has(this._nodes,c)){var h=function(d){u.removeEdge(u._edgeObjs[d])};delete this._nodes[c],this._isCompound&&(this._removeFromParentsChildList(c),delete this._parent[c],r.each(this.children(c),function(d){u.setParent(d)}),delete this._children[c]),r.each(r.keys(this._in[c]),h),delete this._in[c],delete this._preds[c],r.each(r.keys(this._out[c]),h),delete this._out[c],delete this._sucs[c],--this._nodeCount}return this},i.prototype.setParent=function(c,u){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(u))u=t;else{u+="";for(var h=u;!r.isUndefined(h);h=this.parent(h))if(h===c)throw new Error("Setting "+u+" as parent of "+c+" would create a cycle");this.setNode(u)}return this.setNode(c),this._removeFromParentsChildList(c),this._parent[c]=u,this._children[u][c]=!0,this},i.prototype._removeFromParentsChildList=function(c){delete this._children[this._parent[c]][c]},i.prototype.parent=function(c){if(this._isCompound){var u=this._parent[c];if(u!==t)return u}},i.prototype.children=function(c){if(r.isUndefined(c)&&(c=t),this._isCompound){var u=this._children[c];if(u)return r.keys(u)}else{if(c===t)return this.nodes();if(this.hasNode(c))return[]}},i.prototype.predecessors=function(c){var u=this._preds[c];if(u)return r.keys(u)},i.prototype.successors=function(c){var u=this._sucs[c];if(u)return r.keys(u)},i.prototype.neighbors=function(c){var u=this.predecessors(c);if(u)return r.union(u,this.successors(c))},i.prototype.isLeaf=function(c){var u;return this.isDirected()?u=this.successors(c):u=this.neighbors(c),u.length===0},i.prototype.filterNodes=function(c){var u=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});u.setGraph(this.graph());var h=this;r.each(this._nodes,function(g,p){c(p)&&u.setNode(p,g)}),r.each(this._edgeObjs,function(g){u.hasNode(g.v)&&u.hasNode(g.w)&&u.setEdge(g,h.edge(g))});var d={};function f(g){var p=h.parent(g);return p===void 0||u.hasNode(p)?(d[g]=p,p):p in d?d[p]:f(p)}return this._isCompound&&r.each(u.nodes(),function(g){u.setParent(g,f(g))}),u},i.prototype.setDefaultEdgeLabel=function(c){return r.isFunction(c)||(c=r.constant(c)),this._defaultEdgeLabelFn=c,this},i.prototype.edgeCount=function(){return this._edgeCount},i.prototype.edges=function(){return r.values(this._edgeObjs)},i.prototype.setPath=function(c,u){var h=this,d=arguments;return r.reduce(c,function(f,g){return d.length>1?h.setEdge(f,g,u):h.setEdge(f,g),g}),this},i.prototype.setEdge=function(){var c,u,h,d,f=!1,g=arguments[0];typeof g=="object"&&g!==null&&"v"in g?(c=g.v,u=g.w,h=g.name,arguments.length===2&&(d=arguments[1],f=!0)):(c=g,u=arguments[1],h=arguments[3],arguments.length>2&&(d=arguments[2],f=!0)),c=""+c,u=""+u,r.isUndefined(h)||(h=""+h);var p=o(this._isDirected,c,u,h);if(r.has(this._edgeLabels,p))return f&&(this._edgeLabels[p]=d),this;if(!r.isUndefined(h)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(c),this.setNode(u),this._edgeLabels[p]=f?d:this._defaultEdgeLabelFn(c,u,h);var v=A(this._isDirected,c,u,h);return c=v.v,u=v.w,Object.freeze(v),this._edgeObjs[p]=v,a(this._preds[u],c),a(this._sucs[c],u),this._in[u][p]=v,this._out[c][p]=v,this._edgeCount++,this},i.prototype.edge=function(c,u,h){var d=arguments.length===1?l(this._isDirected,arguments[0]):o(this._isDirected,c,u,h);return this._edgeLabels[d]},i.prototype.hasEdge=function(c,u,h){var d=arguments.length===1?l(this._isDirected,arguments[0]):o(this._isDirected,c,u,h);return r.has(this._edgeLabels,d)},i.prototype.removeEdge=function(c,u,h){var d=arguments.length===1?l(this._isDirected,arguments[0]):o(this._isDirected,c,u,h),f=this._edgeObjs[d];return f&&(c=f.v,u=f.w,delete this._edgeLabels[d],delete this._edgeObjs[d],s(this._preds[u],c),s(this._sucs[c],u),delete this._in[u][d],delete this._out[c][d],this._edgeCount--),this},i.prototype.inEdges=function(c,u){var h=this._in[c];if(h){var d=r.values(h);return u?r.filter(d,function(f){return f.v===u}):d}},i.prototype.outEdges=function(c,u){var h=this._out[c];if(h){var d=r.values(h);return u?r.filter(d,function(f){return f.w===u}):d}},i.prototype.nodeEdges=function(c,u){var h=this.inEdges(c,u);if(h)return h.concat(this.outEdges(c,u))};function a(c,u){c[u]?c[u]++:c[u]=1}function s(c,u){--c[u]||delete c[u]}function o(c,u,h,d){var f=""+u,g=""+h;if(!c&&f>g){var p=f;f=g,g=p}return f+n+g+n+(r.isUndefined(d)?e:d)}function A(c,u,h,d){var f=""+u,g=""+h;if(!c&&f>g){var p=f;f=g,g=p}var v={v:f,w:g};return d&&(v.name=d),v}function l(c,u){return o(c,u.v,u.w,u.name)}return Pw}var Dw,mk;function uZ(){return mk||(mk=1,Dw="2.1.8"),Dw}var Hw,wk;function hZ(){return wk||(wk=1,Hw={Graph:Rw(),version:uZ()}),Hw}var Gw,Bk;function dZ(){if(Bk)return Gw;Bk=1;var r=Ai(),e=Rw();Gw={write:t,read:a};function t(s){var o={options:{directed:s.isDirected(),multigraph:s.isMultigraph(),compound:s.isCompound()},nodes:n(s),edges:i(s)};return r.isUndefined(s.graph())||(o.value=r.clone(s.graph())),o}function n(s){return r.map(s.nodes(),function(o){var A=s.node(o),l=s.parent(o),c={v:o};return r.isUndefined(A)||(c.value=A),r.isUndefined(l)||(c.parent=l),c})}function i(s){return r.map(s.edges(),function(o){var A=s.edge(o),l={v:o.v,w:o.w};return r.isUndefined(o.name)||(l.name=o.name),r.isUndefined(A)||(l.value=A),l})}function a(s){var o=new e(s.options).setGraph(s.value);return r.each(s.nodes,function(A){o.setNode(A.v,A.value),A.parent&&o.setParent(A.v,A.parent)}),r.each(s.edges,function(A){o.setEdge({v:A.v,w:A.w,name:A.name},A.value)}),o}return Gw}var Kw,bk;function fZ(){if(bk)return Kw;bk=1;var r=Ai();Kw=e;function e(t){var n={},i=[],a;function s(o){r.has(n,o)||(n[o]=!0,a.push(o),r.each(t.successors(o),s),r.each(t.predecessors(o),s))}return r.each(t.nodes(),function(o){a=[],s(o),a.length&&i.push(a)}),i}return Kw}var zw,Ek;function xk(){if(Ek)return zw;Ek=1;var r=Ai();zw=e;function e(){this._arr=[],this._keyIndices={}}return e.prototype.size=function(){return this._arr.length},e.prototype.keys=function(){return this._arr.map(function(t){return t.key})},e.prototype.has=function(t){return r.has(this._keyIndices,t)},e.prototype.priority=function(t){var n=this._keyIndices[t];if(n!==void 0)return this._arr[n].priority},e.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},e.prototype.add=function(t,n){var i=this._keyIndices;if(t=String(t),!r.has(i,t)){var a=this._arr,s=a.length;return i[t]=s,a.push({key:t,priority:n}),this._decrease(s),!0}return!1},e.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},e.prototype.decrease=function(t,n){var i=this._keyIndices[t];if(n>this._arr[i].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[i].priority+" New: "+n);this._arr[i].priority=n,this._decrease(i)},e.prototype._heapify=function(t){var n=this._arr,i=2*t,a=i+1,s=t;i<n.length&&(s=n[i].priority<n[s].priority?i:s,a<n.length&&(s=n[a].priority<n[s].priority?a:s),s!==t&&(this._swap(t,s),this._heapify(s)))},e.prototype._decrease=function(t){for(var n=this._arr,i=n[t].priority,a;t!==0&&(a=t>>1,!(n[a].priority<i));)this._swap(t,a),t=a},e.prototype._swap=function(t,n){var i=this._arr,a=this._keyIndices,s=i[t],o=i[n];i[t]=o,i[n]=s,a[o.key]=t,a[s.key]=n},zw}var Vw,Ck;function Sk(){if(Ck)return Vw;Ck=1;var r=Ai(),e=xk();Vw=n;var t=r.constant(1);function n(a,s,o,A){return i(a,String(s),o||t,A||function(l){return a.outEdges(l)})}function i(a,s,o,A){var l={},c=new e,u,h,d=function(f){var g=f.v!==u?f.v:f.w,p=l[g],v=o(f),y=h.distance+v;if(v<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+f+" Weight: "+v);y<p.distance&&(p.distance=y,p.predecessor=u,c.decrease(g,y))};for(a.nodes().forEach(function(f){var g=f===s?0:Number.POSITIVE_INFINITY;l[f]={distance:g},c.add(f,g)});c.size()>0&&(u=c.removeMin(),h=l[u],h.distance!==Number.POSITIVE_INFINITY);)A(u).forEach(d);return l}return Vw}var jw,Fk;function gZ(){if(Fk)return jw;Fk=1;var r=Sk(),e=Ai();jw=t;function t(n,i,a){return e.transform(n.nodes(),function(s,o){s[o]=r(n,o,i,a)},{})}return jw}var Ww,Tk;function Mk(){if(Tk)return Ww;Tk=1;var r=Ai();Ww=e;function e(t){var n=0,i=[],a={},s=[];function o(A){var l=a[A]={onStack:!0,lowlink:n,index:n++};if(i.push(A),t.successors(A).forEach(function(h){r.has(a,h)?a[h].onStack&&(l.lowlink=Math.min(l.lowlink,a[h].index)):(o(h),l.lowlink=Math.min(l.lowlink,a[h].lowlink))}),l.lowlink===l.index){var c=[],u;do u=i.pop(),a[u].onStack=!1,c.push(u);while(A!==u);s.push(c)}}return t.nodes().forEach(function(A){r.has(a,A)||o(A)}),s}return Ww}var qw,Ok;function pZ(){if(Ok)return qw;Ok=1;var r=Ai(),e=Mk();qw=t;function t(n){return r.filter(e(n),function(i){return i.length>1||i.length===1&&n.hasEdge(i[0],i[0])})}return qw}var $w,Ik;function vZ(){if(Ik)return $w;Ik=1;var r=Ai();$w=t;var e=r.constant(1);function t(i,a,s){return n(i,a||e,s||function(o){return i.outEdges(o)})}function n(i,a,s){var o={},A=i.nodes();return A.forEach(function(l){o[l]={},o[l][l]={distance:0},A.forEach(function(c){l!==c&&(o[l][c]={distance:Number.POSITIVE_INFINITY})}),s(l).forEach(function(c){var u=c.v===l?c.w:c.v,h=a(c);o[l][u]={distance:h,predecessor:l}})}),A.forEach(function(l){var c=o[l];A.forEach(function(u){var h=o[u];A.forEach(function(d){var f=h[l],g=c[d],p=h[d],v=f.distance+g.distance;v<p.distance&&(p.distance=v,p.predecessor=g.predecessor)})})}),o}return $w}var Yw,_k;function kk(){if(_k)return Yw;_k=1;var r=Ai();Yw=e,e.CycleException=t;function e(n){var i={},a={},s=[];function o(A){if(r.has(a,A))throw new t;r.has(i,A)||(a[A]=!0,i[A]=!0,r.each(n.predecessors(A),o),delete a[A],s.push(A))}if(r.each(n.sinks(),o),r.size(i)!==n.nodeCount())throw new t;return s}function t(){}return t.prototype=new Error,Yw}var Xw,Nk;function yZ(){if(Nk)return Xw;Nk=1;var r=kk();Xw=e;function e(t){try{r(t)}catch(n){if(n instanceof r.CycleException)return!1;throw n}return!0}return Xw}var Zw,Lk;function Qk(){if(Lk)return Zw;Lk=1;var r=Ai();Zw=e;function e(n,i,a){r.isArray(i)||(i=[i]);var s=(n.isDirected()?n.successors:n.neighbors).bind(n),o=[],A={};return r.each(i,function(l){if(!n.hasNode(l))throw new Error("Graph does not have node: "+l);t(n,l,a==="post",A,s,o)}),o}function t(n,i,a,s,o,A){r.has(s,i)||(s[i]=!0,a||A.push(i),r.each(o(i),function(l){t(n,l,a,s,o,A)}),a&&A.push(i))}return Zw}var Jw,Uk;function mZ(){if(Uk)return Jw;Uk=1;var r=Qk();Jw=e;function e(t,n){return r(t,n,"post")}return Jw}var e1,Pk;function wZ(){if(Pk)return e1;Pk=1;var r=Qk();e1=e;function e(t,n){return r(t,n,"pre")}return e1}var t1,Rk;function BZ(){if(Rk)return t1;Rk=1;var r=Ai(),e=Rw(),t=xk();t1=n;function n(i,a){var s=new e,o={},A=new t,l;function c(h){var d=h.v===l?h.w:h.v,f=A.priority(d);if(f!==void 0){var g=a(h);g<f&&(o[d]=l,A.decrease(d,g))}}if(i.nodeCount()===0)return s;r.each(i.nodes(),function(h){A.add(h,Number.POSITIVE_INFINITY),s.setNode(h)}),A.decrease(i.nodes()[0],0);for(var u=!1;A.size()>0;){if(l=A.removeMin(),r.has(o,l))s.setEdge(l,o[l]);else{if(u)throw new Error("Input graph is not connected: "+i);u=!0}i.nodeEdges(l).forEach(c)}return s}return t1}var n1,Dk;function bZ(){return Dk||(Dk=1,n1={components:fZ(),dijkstra:Sk(),dijkstraAll:gZ(),findCycles:pZ(),floydWarshall:vZ(),isAcyclic:yZ(),postorder:mZ(),preorder:wZ(),prim:BZ(),tarjan:Mk(),topsort:kk()}),n1}var r1,Hk;function EZ(){if(Hk)return r1;Hk=1;var r=hZ();return r1={Graph:r.Graph,json:dZ(),alg:bZ(),version:r.version},r1}var i1,Gk;function Si(){if(Gk)return i1;Gk=1;var r;if(typeof jv=="function")try{r=EZ()}catch{}return r||(r=window.graphlib),i1=r,i1}var a1,Kk;function xZ(){if(Kk)return a1;Kk=1;var r=dI(),e=1,t=4;function n(i){return r(i,e|t)}return a1=n,a1}var s1,zk;function vd(){if(zk)return s1;zk=1;var r=qo(),e=ma(),t=Ad(),n=oi();function i(a,s,o){if(!n(o))return!1;var A=typeof s;return(A=="number"?e(o)&&t(s,o.length):A=="string"&&s in o)?r(o[s],a):!1}return s1=i,s1}var o1,Vk;function CZ(){if(Vk)return o1;Vk=1;var r=pd(),e=qo(),t=vd(),n=eo(),i=Object.prototype,a=i.hasOwnProperty,s=r(function(o,A){o=Object(o);var l=-1,c=A.length,u=c>2?A[2]:void 0;for(u&&t(A[0],A[1],u)&&(c=1);++l<c;)for(var h=A[l],d=n(h),f=-1,g=d.length;++f<g;){var p=d[f],v=o[p];(v===void 0||e(v,i[p])&&!a.call(o,p))&&(o[p]=h[p])}return o});return o1=s,o1}var A1,jk;function SZ(){if(jk)return A1;jk=1;var r=wa(),e=ma(),t=ls();function n(i){return function(a,s,o){var A=Object(a);if(!e(a)){var l=r(s,3);a=t(a),s=function(u){return l(A[u],u,A)}}var c=i(a,s,o);return c>-1?A[l?a[c]:c]:void 0}}return A1=n,A1}var l1,Wk;function FZ(){if(Wk)return l1;Wk=1;var r=/\s/;function e(t){for(var n=t.length;n--&&r.test(t.charAt(n)););return n}return l1=e,l1}var c1,qk;function TZ(){if(qk)return c1;qk=1;var r=FZ(),e=/^\s+/;function t(n){return n&&n.slice(0,r(n)+1).replace(e,"")}return c1=t,c1}var u1,$k;function MZ(){if($k)return u1;$k=1;var r=TZ(),e=oi(),t=Zo(),n=NaN,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt;function A(l){if(typeof l=="number")return l;if(t(l))return n;if(e(l)){var c=typeof l.valueOf=="function"?l.valueOf():l;l=e(c)?c+"":c}if(typeof l!="string")return l===0?l:+l;l=r(l);var u=a.test(l);return u||s.test(l)?o(l.slice(2),u?2:8):i.test(l)?n:+l}return u1=A,u1}var h1,Yk;function Xk(){if(Yk)return h1;Yk=1;var r=MZ(),e=1/0,t=17976931348623157e292;function n(i){if(!i)return i===0?i:0;if(i=r(i),i===e||i===-e){var a=i<0?-1:1;return a*t}return i===i?i:0}return h1=n,h1}var d1,Zk;function OZ(){if(Zk)return d1;Zk=1;var r=Xk();function e(t){var n=r(t),i=n%1;return n===n?i?n-i:n:0}return d1=e,d1}var f1,Jk;function IZ(){if(Jk)return f1;Jk=1;var r=nk(),e=wa(),t=OZ(),n=Math.max;function i(a,s,o){var A=a==null?0:a.length;if(!A)return-1;var l=o==null?0:t(o);return l<0&&(l=n(A+l,0)),r(a,e(s,3),l)}return f1=i,f1}var g1,eN;function _Z(){if(eN)return g1;eN=1;var r=SZ(),e=IZ(),t=r(e);return g1=t,g1}var p1,tN;function nN(){if(tN)return p1;tN=1;var r=vw();function e(t){var n=t==null?0:t.length;return n?r(t,1):[]}return p1=e,p1}var v1,rN;function kZ(){if(rN)return v1;rN=1;var r=rm(),e=EI(),t=eo();function n(i,a){return i==null?i:r(i,e(a),t)}return v1=n,v1}var y1,iN;function NZ(){if(iN)return y1;iN=1;function r(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}return y1=r,y1}var m1,aN;function LZ(){if(aN)return m1;aN=1;var r=sd(),e=am(),t=wa();function n(i,a){var s={};return a=t(a,3),e(i,function(o,A,l){r(s,A,a(o,A,l))}),s}return m1=n,m1}var w1,sN;function B1(){if(sN)return w1;sN=1;var r=Zo();function e(t,n,i){for(var a=-1,s=t.length;++a<s;){var o=t[a],A=n(o);if(A!=null&&(l===void 0?A===A&&!r(A):i(A,l)))var l=A,c=o}return c}return w1=e,w1}var b1,oN;function QZ(){if(oN)return b1;oN=1;function r(e,t){return e>t}return b1=r,b1}var E1,AN;function UZ(){if(AN)return E1;AN=1;var r=B1(),e=QZ(),t=to();function n(i){return i&&i.length?r(i,t,e):void 0}return E1=n,E1}var x1,lN;function cN(){if(lN)return x1;lN=1;var r=sd(),e=qo();function t(n,i,a){(a!==void 0&&!e(n[i],a)||a===void 0&&!(i in n))&&r(n,i,a)}return x1=t,x1}var C1,uN;function PZ(){if(uN)return C1;uN=1;var r=Zs(),e=ud(),t=ta(),n="[object Object]",i=Function.prototype,a=Object.prototype,s=i.toString,o=a.hasOwnProperty,A=s.call(Object);function l(c){if(!t(c)||r(c)!=n)return!1;var u=e(c);if(u===null)return!0;var h=o.call(u,"constructor")&&u.constructor;return typeof h=="function"&&h instanceof h&&s.call(h)==A}return C1=l,C1}var S1,hN;function dN(){if(hN)return S1;hN=1;function r(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}return S1=r,S1}var F1,fN;function RZ(){if(fN)return F1;fN=1;var r=Nl(),e=eo();function t(n){return r(n,e(n))}return F1=t,F1}var T1,gN;function DZ(){if(gN)return T1;gN=1;var r=cN(),e=EO(),t=nI(),n=CO(),i=oI(),a=Ll(),s=Bn(),o=hk(),A=Yo(),l=kl(),c=oi(),u=PZ(),h=Pl(),d=dN(),f=RZ();function g(p,v,y,m,B,C,S){var F=d(p,y),T=d(v,y),O=S.get(T);if(O){r(p,y,O);return}var I=C?C(F,T,y+"",p,v,S):void 0,k=I===void 0;if(k){var N=s(T),U=!N&&A(T),D=!N&&!U&&h(T);I=T,N||U||D?s(F)?I=F:o(F)?I=n(F):U?(k=!1,I=e(T,!0)):D?(k=!1,I=t(T,!0)):I=[]:u(T)||a(T)?(I=F,a(F)?I=f(F):(!c(F)||l(F))&&(I=i(T))):k=!1}k&&(S.set(T,I),B(I,T,m,C,S),S.delete(T)),r(p,y,I)}return T1=g,T1}var M1,pN;function HZ(){if(pN)return M1;pN=1;var r=ad(),e=cN(),t=rm(),n=DZ(),i=oi(),a=eo(),s=dN();function o(A,l,c,u,h){A!==l&&t(l,function(d,f){if(h||(h=new r),i(d))n(A,l,f,c,o,u,h);else{var g=u?u(s(A,f),d,f+"",A,l,h):void 0;g===void 0&&(g=d),e(A,f,g)}},a)}return M1=o,M1}var O1,vN;function GZ(){if(vN)return O1;vN=1;var r=pd(),e=vd();function t(n){return r(function(i,a){var s=-1,o=a.length,A=o>1?a[o-1]:void 0,l=o>2?a[2]:void 0;for(A=n.length>3&&typeof A=="function"?(o--,A):void 0,l&&e(a[0],a[1],l)&&(A=o<3?void 0:A,o=1),i=Object(i);++s<o;){var c=a[s];c&&n(i,c,s,A)}return i})}return O1=t,O1}var I1,yN;function KZ(){if(yN)return I1;yN=1;var r=HZ(),e=GZ(),t=e(function(n,i,a){r(n,i,a)});return I1=t,I1}var _1,mN;function wN(){if(mN)return _1;mN=1;function r(e,t){return e<t}return _1=r,_1}var k1,BN;function zZ(){if(BN)return k1;BN=1;var r=B1(),e=wN(),t=to();function n(i){return i&&i.length?r(i,t,e):void 0}return k1=n,k1}var N1,bN;function VZ(){if(bN)return N1;bN=1;var r=B1(),e=wa(),t=wN();function n(i,a){return i&&i.length?r(i,e(a,2),t):void 0}return N1=n,N1}var L1,EN;function jZ(){if(EN)return L1;EN=1;var r=Ci(),e=function(){return r.Date.now()};return L1=e,L1}var Q1,xN;function WZ(){if(xN)return Q1;xN=1;var r=od(),e=fd(),t=Ad(),n=oi(),i=Dl();function a(s,o,A,l){if(!n(s))return s;o=e(o,s);for(var c=-1,u=o.length,h=u-1,d=s;d!=null&&++c<u;){var f=i(o[c]),g=A;if(f==="__proto__"||f==="constructor"||f==="prototype")return s;if(c!=h){var p=d[f];g=l?l(p,f,d):void 0,g===void 0&&(g=n(p)?p:t(o[c+1])?[]:{})}r(d,f,g),d=d[f]}return s}return Q1=a,Q1}var U1,CN;function qZ(){if(CN)return U1;CN=1;var r=gd(),e=WZ(),t=fd();function n(i,a,s){for(var o=-1,A=a.length,l={};++o<A;){var c=a[o],u=r(i,c);s(u,c)&&e(l,t(c,i),u)}return l}return U1=n,U1}var P1,SN;function $Z(){if(SN)return P1;SN=1;var r=qZ(),e=g_();function t(n,i){return r(n,i,function(a,s){return e(n,s)})}return P1=t,P1}var R1,FN;function YZ(){if(FN)return R1;FN=1;var r=nN(),e=$_(),t=J_();function n(i){return t(e(i,void 0,r),i+"")}return R1=n,R1}var D1,TN;function XZ(){if(TN)return D1;TN=1;var r=$Z(),e=YZ(),t=e(function(n,i){return n==null?{}:r(n,i)});return D1=t,D1}var H1,MN;function ZZ(){if(MN)return H1;MN=1;var r=Math.ceil,e=Math.max;function t(n,i,a,s){for(var o=-1,A=e(r((i-n)/(a||1)),0),l=Array(A);A--;)l[s?A:++o]=n,n+=a;return l}return H1=t,H1}var G1,ON;function JZ(){if(ON)return G1;ON=1;var r=ZZ(),e=vd(),t=Xk();function n(i){return function(a,s,o){return o&&typeof o!="number"&&e(a,s,o)&&(s=o=void 0),a=t(a),s===void 0?(s=a,a=0):s=t(s),o=o===void 0?a<s?1:-1:t(o),r(a,s,o,i)}}return G1=n,G1}var K1,IN;function eJ(){if(IN)return K1;IN=1;var r=JZ(),e=r();return K1=e,K1}var z1,_N;function tJ(){if(_N)return z1;_N=1;function r(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}return z1=r,z1}var V1,kN;function nJ(){if(kN)return V1;kN=1;var r=Zo();function e(t,n){if(t!==n){var i=t!==void 0,a=t===null,s=t===t,o=r(t),A=n!==void 0,l=n===null,c=n===n,u=r(n);if(!l&&!u&&!o&&t>n||o&&A&&c&&!l&&!u||a&&A&&c||!i&&c||!s)return 1;if(!a&&!o&&!u&&t<n||u&&i&&s&&!a&&!o||l&&i&&s||!A&&s||!c)return-1}return 0}return V1=e,V1}var j1,NN;function rJ(){if(NN)return j1;NN=1;var r=nJ();function e(t,n,i){for(var a=-1,s=t.criteria,o=n.criteria,A=s.length,l=i.length;++a<A;){var c=r(s[a],o[a]);if(c){if(a>=l)return c;var u=i[a];return c*(u=="desc"?-1:1)}}return t.index-n.index}return j1=e,j1}var W1,LN;function iJ(){if(LN)return W1;LN=1;var r=dd(),e=gd(),t=wa(),n=I_(),i=tJ(),a=ld(),s=rJ(),o=to(),A=Bn();function l(c,u,h){u.length?u=r(u,function(g){return A(g)?function(p){return e(p,g.length===1?g[0]:g)}:g}):u=[o];var d=-1;u=r(u,a(t));var f=n(c,function(g,p,v){var y=r(u,function(m){return m(g)});return{criteria:y,index:++d,value:g}});return i(f,function(g,p){return s(g,p,h)})}return W1=l,W1}var q1,QN;function aJ(){if(QN)return q1;QN=1;var r=vw(),e=iJ(),t=pd(),n=vd(),i=t(function(a,s){if(a==null)return[];var o=s.length;return o>1&&n(a,s[0],s[1])?s=[]:o>2&&n(s[0],s[1],s[2])&&(s=[s[0]]),e(a,r(s,1),[])});return q1=i,q1}var $1,UN;function sJ(){if(UN)return $1;UN=1;var r=s_(),e=0;function t(n){var i=++e;return r(n)+i}return $1=t,$1}var Y1,PN;function oJ(){if(PN)return Y1;PN=1;function r(e,t,n){for(var i=-1,a=e.length,s=t.length,o={};++i<a;){var A=i<s?t[i]:void 0;n(o,e[i],A)}return o}return Y1=r,Y1}var X1,RN;function AJ(){if(RN)return X1;RN=1;var r=od(),e=oJ();function t(n,i){return e(n||[],i||[],r)}return X1=t,X1}var Z1,DN;function Vt(){if(DN)return Z1;DN=1;var r;if(typeof jv=="function")try{r={cloneDeep:xZ(),constant:em(),defaults:CZ(),each:FI(),filter:E_(),find:_Z(),flatten:nN(),forEach:CI(),forIn:kZ(),has:S_(),isUndefined:M_(),last:NZ(),map:k_(),mapValues:LZ(),max:UZ(),merge:KZ(),min:zZ(),minBy:VZ(),now:jZ(),pick:XZ(),range:eJ(),reduce:U_(),sortBy:aJ(),uniqueId:sJ(),values:pk(),zipObject:AJ()}}catch{}return r||(r=window._),Z1=r,Z1}var J1,HN;function lJ(){if(HN)return J1;HN=1,J1=r;function r(){var n={};n._next=n._prev=n,this._sentinel=n}r.prototype.dequeue=function(){var n=this._sentinel,i=n._prev;if(i!==n)return e(i),i},r.prototype.enqueue=function(n){var i=this._sentinel;n._prev&&n._next&&e(n),n._next=i._next,i._next._prev=n,i._next=n,n._prev=i},r.prototype.toString=function(){for(var n=[],i=this._sentinel,a=i._prev;a!==i;)n.push(JSON.stringify(a,t)),a=a._prev;return"["+n.join(", ")+"]"};function e(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function t(n,i){if(n!=="_next"&&n!=="_prev")return i}return J1}var eB,GN;function cJ(){if(GN)return eB;GN=1;var r=Vt(),e=Si().Graph,t=lJ();eB=i;var n=r.constant(1);function i(l,c){if(l.nodeCount()<=1)return[];var u=o(l,c||n),h=a(u.graph,u.buckets,u.zeroIdx);return r.flatten(r.map(h,function(d){return l.outEdges(d.v,d.w)}),!0)}function a(l,c,u){for(var h=[],d=c[c.length-1],f=c[0],g;l.nodeCount();){for(;g=f.dequeue();)s(l,c,u,g);for(;g=d.dequeue();)s(l,c,u,g);if(l.nodeCount()){for(var p=c.length-2;p>0;--p)if(g=c[p].dequeue(),g){h=h.concat(s(l,c,u,g,!0));break}}}return h}function s(l,c,u,h,d){var f=d?[]:void 0;return r.forEach(l.inEdges(h.v),function(g){var p=l.edge(g),v=l.node(g.v);d&&f.push({v:g.v,w:g.w}),v.out-=p,A(c,u,v)}),r.forEach(l.outEdges(h.v),function(g){var p=l.edge(g),v=g.w,y=l.node(v);y.in-=p,A(c,u,y)}),l.removeNode(h.v),f}function o(l,c){var u=new e,h=0,d=0;r.forEach(l.nodes(),function(p){u.setNode(p,{v:p,in:0,out:0})}),r.forEach(l.edges(),function(p){var v=u.edge(p.v,p.w)||0,y=c(p),m=v+y;u.setEdge(p.v,p.w,m),d=Math.max(d,u.node(p.v).out+=y),h=Math.max(h,u.node(p.w).in+=y)});var f=r.range(d+h+3).map(function(){return new t}),g=h+1;return r.forEach(u.nodes(),function(p){A(f,g,u.node(p))}),{graph:u,buckets:f,zeroIdx:g}}function A(l,c,u){u.out?u.in?l[u.out-u.in+c].enqueue(u):l[l.length-1].enqueue(u):l[0].enqueue(u)}return eB}var tB,KN;function uJ(){if(KN)return tB;KN=1;var r=Vt(),e=cJ();tB={run:t,undo:i};function t(a){var s=a.graph().acyclicer==="greedy"?e(a,o(a)):n(a);r.forEach(s,function(A){var l=a.edge(A);a.removeEdge(A),l.forwardName=A.name,l.reversed=!0,a.setEdge(A.w,A.v,l,r.uniqueId("rev"))});function o(A){return function(l){return A.edge(l).weight}}}function n(a){var s=[],o={},A={};function l(c){r.has(A,c)||(A[c]=!0,o[c]=!0,r.forEach(a.outEdges(c),function(u){r.has(o,u.w)?s.push(u):l(u.w)}),delete o[c])}return r.forEach(a.nodes(),l),s}function i(a){r.forEach(a.edges(),function(s){var o=a.edge(s);if(o.reversed){a.removeEdge(s);var A=o.forwardName;delete o.reversed,delete o.forwardName,a.setEdge(s.w,s.v,o,A)}})}return tB}var nB,zN;function Tr(){if(zN)return nB;zN=1;var r=Vt(),e=Si().Graph;nB={addDummyNode:t,simplify:n,asNonCompoundGraph:i,successorWeights:a,predecessorWeights:s,intersectRect:o,buildLayerMatrix:A,normalizeRanks:l,removeEmptyRanks:c,addBorderNode:u,maxRank:h,partition:d,time:f,notime:g};function t(p,v,y,m){var B;do B=r.uniqueId(m);while(p.hasNode(B));return y.dummy=v,p.setNode(B,y),B}function n(p){var v=new e().setGraph(p.graph());return r.forEach(p.nodes(),function(y){v.setNode(y,p.node(y))}),r.forEach(p.edges(),function(y){var m=v.edge(y.v,y.w)||{weight:0,minlen:1},B=p.edge(y);v.setEdge(y.v,y.w,{weight:m.weight+B.weight,minlen:Math.max(m.minlen,B.minlen)})}),v}function i(p){var v=new e({multigraph:p.isMultigraph()}).setGraph(p.graph());return r.forEach(p.nodes(),function(y){p.children(y).length||v.setNode(y,p.node(y))}),r.forEach(p.edges(),function(y){v.setEdge(y,p.edge(y))}),v}function a(p){var v=r.map(p.nodes(),function(y){var m={};return r.forEach(p.outEdges(y),function(B){m[B.w]=(m[B.w]||0)+p.edge(B).weight}),m});return r.zipObject(p.nodes(),v)}function s(p){var v=r.map(p.nodes(),function(y){var m={};return r.forEach(p.inEdges(y),function(B){m[B.v]=(m[B.v]||0)+p.edge(B).weight}),m});return r.zipObject(p.nodes(),v)}function o(p,v){var y=p.x,m=p.y,B=v.x-y,C=v.y-m,S=p.width/2,F=p.height/2;if(!B&&!C)throw new Error("Not possible to find intersection inside of the rectangle");var T,O;return Math.abs(C)*S>Math.abs(B)*F?(C<0&&(F=-F),T=F*B/C,O=F):(B<0&&(S=-S),T=S,O=S*C/B),{x:y+T,y:m+O}}function A(p){var v=r.map(r.range(h(p)+1),function(){return[]});return r.forEach(p.nodes(),function(y){var m=p.node(y),B=m.rank;r.isUndefined(B)||(v[B][m.order]=y)}),v}function l(p){var v=r.min(r.map(p.nodes(),function(y){return p.node(y).rank}));r.forEach(p.nodes(),function(y){var m=p.node(y);r.has(m,"rank")&&(m.rank-=v)})}function c(p){var v=r.min(r.map(p.nodes(),function(C){return p.node(C).rank})),y=[];r.forEach(p.nodes(),function(C){var S=p.node(C).rank-v;y[S]||(y[S]=[]),y[S].push(C)});var m=0,B=p.graph().nodeRankFactor;r.forEach(y,function(C,S){r.isUndefined(C)&&S%B!==0?--m:m&&r.forEach(C,function(F){p.node(F).rank+=m})})}function u(p,v,y,m){var B={width:0,height:0};return arguments.length>=4&&(B.rank=y,B.order=m),t(p,"border",B,v)}function h(p){return r.max(r.map(p.nodes(),function(v){var y=p.node(v).rank;if(!r.isUndefined(y))return y}))}function d(p,v){var y={lhs:[],rhs:[]};return r.forEach(p,function(m){v(m)?y.lhs.push(m):y.rhs.push(m)}),y}function f(p,v){var y=r.now();try{return v()}finally{console.log(p+" time: "+(r.now()-y)+"ms")}}function g(p,v){return v()}return nB}var rB,VN;function hJ(){if(VN)return rB;VN=1;var r=Vt(),e=Tr();rB={run:t,undo:i};function t(a){a.graph().dummyChains=[],r.forEach(a.edges(),function(s){n(a,s)})}function n(a,s){var o=s.v,A=a.node(o).rank,l=s.w,c=a.node(l).rank,u=s.name,h=a.edge(s),d=h.labelRank;if(c!==A+1){a.removeEdge(s);var f,g,p;for(p=0,++A;A<c;++p,++A)h.points=[],g={width:0,height:0,edgeLabel:h,edgeObj:s,rank:A},f=e.addDummyNode(a,"edge",g,"_d"),A===d&&(g.width=h.width,g.height=h.height,g.dummy="edge-label",g.labelpos=h.labelpos),a.setEdge(o,f,{weight:h.weight},u),p===0&&a.graph().dummyChains.push(f),o=f;a.setEdge(o,l,{weight:h.weight},u)}}function i(a){r.forEach(a.graph().dummyChains,function(s){var o=a.node(s),A=o.edgeLabel,l;for(a.setEdge(o.edgeObj,A);o.dummy;)l=a.successors(s)[0],a.removeNode(s),A.points.push({x:o.x,y:o.y}),o.dummy==="edge-label"&&(A.x=o.x,A.y=o.y,A.width=o.width,A.height=o.height),s=l,o=a.node(s)})}return rB}var iB,jN;function yd(){if(jN)return iB;jN=1;var r=Vt();iB={longestPath:e,slack:t};function e(n){var i={};function a(s){var o=n.node(s);if(r.has(i,s))return o.rank;i[s]=!0;var A=r.min(r.map(n.outEdges(s),function(l){return a(l.w)-n.edge(l).minlen}));return(A===Number.POSITIVE_INFINITY||A===void 0||A===null)&&(A=0),o.rank=A}r.forEach(n.sources(),a)}function t(n,i){return n.node(i.w).rank-n.node(i.v).rank-n.edge(i).minlen}return iB}var aB,WN;function qN(){if(WN)return aB;WN=1;var r=Vt(),e=Si().Graph,t=yd().slack;aB=n;function n(o){var A=new e({directed:!1}),l=o.nodes()[0],c=o.nodeCount();A.setNode(l,{});for(var u,h;i(A,o)<c;)u=a(A,o),h=A.hasNode(u.v)?t(o,u):-t(o,u),s(A,o,h);return A}function i(o,A){function l(c){r.forEach(A.nodeEdges(c),function(u){var h=u.v,d=c===h?u.w:h;!o.hasNode(d)&&!t(A,u)&&(o.setNode(d,{}),o.setEdge(c,d,{}),l(d))})}return r.forEach(o.nodes(),l),o.nodeCount()}function a(o,A){return r.minBy(A.edges(),function(l){if(o.hasNode(l.v)!==o.hasNode(l.w))return t(A,l)})}function s(o,A,l){r.forEach(o.nodes(),function(c){A.node(c).rank+=l})}return aB}var sB,$N;function dJ(){if($N)return sB;$N=1;var r=Vt(),e=qN(),t=yd().slack,n=yd().longestPath,i=Si().alg.preorder,a=Si().alg.postorder,s=Tr().simplify;sB=o,o.initLowLimValues=u,o.initCutValues=A,o.calcCutValue=c,o.leaveEdge=d,o.enterEdge=f,o.exchangeEdges=g;function o(m){m=s(m),n(m);var B=e(m);u(B),A(B,m);for(var C,S;C=d(B);)S=f(B,m,C),g(B,m,C,S)}function A(m,B){var C=a(m,m.nodes());C=C.slice(0,C.length-1),r.forEach(C,function(S){l(m,B,S)})}function l(m,B,C){var S=m.node(C),F=S.parent;m.edge(C,F).cutvalue=c(m,B,C)}function c(m,B,C){var S=m.node(C),F=S.parent,T=!0,O=B.edge(C,F),I=0;return O||(T=!1,O=B.edge(F,C)),I=O.weight,r.forEach(B.nodeEdges(C),function(k){var N=k.v===C,U=N?k.w:k.v;if(U!==F){var D=N===T,G=B.edge(k).weight;if(I+=D?G:-G,v(m,C,U)){var Z=m.edge(C,U).cutvalue;I+=D?-Z:Z}}}),I}function u(m,B){arguments.length<2&&(B=m.nodes()[0]),h(m,{},1,B)}function h(m,B,C,S,F){var T=C,O=m.node(S);return B[S]=!0,r.forEach(m.neighbors(S),function(I){r.has(B,I)||(C=h(m,B,C,I,S))}),O.low=T,O.lim=C++,F?O.parent=F:delete O.parent,C}function d(m){return r.find(m.edges(),function(B){return m.edge(B).cutvalue<0})}function f(m,B,C){var S=C.v,F=C.w;B.hasEdge(S,F)||(S=C.w,F=C.v);var T=m.node(S),O=m.node(F),I=T,k=!1;T.lim>O.lim&&(I=O,k=!0);var N=r.filter(B.edges(),function(U){return k===y(m,m.node(U.v),I)&&k!==y(m,m.node(U.w),I)});return r.minBy(N,function(U){return t(B,U)})}function g(m,B,C,S){var F=C.v,T=C.w;m.removeEdge(F,T),m.setEdge(S.v,S.w,{}),u(m),A(m,B),p(m,B)}function p(m,B){var C=r.find(m.nodes(),function(F){return!B.node(F).parent}),S=i(m,C);S=S.slice(1),r.forEach(S,function(F){var T=m.node(F).parent,O=B.edge(F,T),I=!1;O||(O=B.edge(T,F),I=!0),B.node(F).rank=B.node(T).rank+(I?O.minlen:-O.minlen)})}function v(m,B,C){return m.hasEdge(B,C)}function y(m,B,C){return C.low<=B.lim&&B.lim<=C.lim}return sB}var oB,YN;function fJ(){if(YN)return oB;YN=1;var r=yd(),e=r.longestPath,t=qN(),n=dJ();oB=i;function i(A){switch(A.graph().ranker){case"network-simplex":o(A);break;case"tight-tree":s(A);break;case"longest-path":a(A);break;default:o(A)}}var a=e;function s(A){e(A),t(A)}function o(A){n(A)}return oB}var AB,XN;function gJ(){if(XN)return AB;XN=1;var r=Vt();AB=e;function e(i){var a=n(i);r.forEach(i.graph().dummyChains,function(s){for(var o=i.node(s),A=o.edgeObj,l=t(i,a,A.v,A.w),c=l.path,u=l.lca,h=0,d=c[h],f=!0;s!==A.w;){if(o=i.node(s),f){for(;(d=c[h])!==u&&i.node(d).maxRank<o.rank;)h++;d===u&&(f=!1)}if(!f){for(;h<c.length-1&&i.node(d=c[h+1]).minRank<=o.rank;)h++;d=c[h]}i.setParent(s,d),s=i.successors(s)[0]}})}function t(i,a,s,o){var A=[],l=[],c=Math.min(a[s].low,a[o].low),u=Math.max(a[s].lim,a[o].lim),h,d;h=s;do h=i.parent(h),A.push(h);while(h&&(a[h].low>c||u>a[h].lim));for(d=h,h=o;(h=i.parent(h))!==d;)l.push(h);return{path:A.concat(l.reverse()),lca:d}}function n(i){var a={},s=0;function o(A){var l=s;r.forEach(i.children(A),o),a[A]={low:l,lim:s++}}return r.forEach(i.children(),o),a}return AB}var lB,ZN;function pJ(){if(ZN)return lB;ZN=1;var r=Vt(),e=Tr();lB={run:t,cleanup:s};function t(o){var A=e.addDummyNode(o,"root",{},"_root"),l=i(o),c=r.max(r.values(l))-1,u=2*c+1;o.graph().nestingRoot=A,r.forEach(o.edges(),function(d){o.edge(d).minlen*=u});var h=a(o)+1;r.forEach(o.children(),function(d){n(o,A,u,h,c,l,d)}),o.graph().nodeRankFactor=u}function n(o,A,l,c,u,h,d){var f=o.children(d);if(!f.length){d!==A&&o.setEdge(A,d,{weight:0,minlen:l});return}var g=e.addBorderNode(o,"_bt"),p=e.addBorderNode(o,"_bb"),v=o.node(d);o.setParent(g,d),v.borderTop=g,o.setParent(p,d),v.borderBottom=p,r.forEach(f,function(y){n(o,A,l,c,u,h,y);var m=o.node(y),B=m.borderTop?m.borderTop:y,C=m.borderBottom?m.borderBottom:y,S=m.borderTop?c:2*c,F=B!==C?1:u-h[d]+1;o.setEdge(g,B,{weight:S,minlen:F,nestingEdge:!0}),o.setEdge(C,p,{weight:S,minlen:F,nestingEdge:!0})}),o.parent(d)||o.setEdge(A,g,{weight:0,minlen:u+h[d]})}function i(o){var A={};function l(c,u){var h=o.children(c);h&&h.length&&r.forEach(h,function(d){l(d,u+1)}),A[c]=u}return r.forEach(o.children(),function(c){l(c,1)}),A}function a(o){return r.reduce(o.edges(),function(A,l){return A+o.edge(l).weight},0)}function s(o){var A=o.graph();o.removeNode(A.nestingRoot),delete A.nestingRoot,r.forEach(o.edges(),function(l){var c=o.edge(l);c.nestingEdge&&o.removeEdge(l)})}return lB}var cB,JN;function vJ(){if(JN)return cB;JN=1;var r=Vt(),e=Tr();cB=t;function t(i){function a(s){var o=i.children(s),A=i.node(s);if(o.length&&r.forEach(o,a),r.has(A,"minRank")){A.borderLeft=[],A.borderRight=[];for(var l=A.minRank,c=A.maxRank+1;l<c;++l)n(i,"borderLeft","_bl",s,A,l),n(i,"borderRight","_br",s,A,l)}}r.forEach(i.children(),a)}function n(i,a,s,o,A,l){var c={width:0,height:0,rank:l,borderType:a},u=A[a][l-1],h=e.addDummyNode(i,"border",c,s);A[a][l]=h,i.setParent(h,o),u&&i.setEdge(u,h,{weight:1})}return cB}var uB,eL;function yJ(){if(eL)return uB;eL=1;var r=Vt();uB={adjust:e,undo:t};function e(l){var c=l.graph().rankdir.toLowerCase();(c==="lr"||c==="rl")&&n(l)}function t(l){var c=l.graph().rankdir.toLowerCase();(c==="bt"||c==="rl")&&a(l),(c==="lr"||c==="rl")&&(o(l),n(l))}function n(l){r.forEach(l.nodes(),function(c){i(l.node(c))}),r.forEach(l.edges(),function(c){i(l.edge(c))})}function i(l){var c=l.width;l.width=l.height,l.height=c}function a(l){r.forEach(l.nodes(),function(c){s(l.node(c))}),r.forEach(l.edges(),function(c){var u=l.edge(c);r.forEach(u.points,s),r.has(u,"y")&&s(u)})}function s(l){l.y=-l.y}function o(l){r.forEach(l.nodes(),function(c){A(l.node(c))}),r.forEach(l.edges(),function(c){var u=l.edge(c);r.forEach(u.points,A),r.has(u,"x")&&A(u)})}function A(l){var c=l.x;l.x=l.y,l.y=c}return uB}var hB,tL;function mJ(){if(tL)return hB;tL=1;var r=Vt();hB=e;function e(t){var n={},i=r.filter(t.nodes(),function(l){return!t.children(l).length}),a=r.max(r.map(i,function(l){return t.node(l).rank})),s=r.map(r.range(a+1),function(){return[]});function o(l){if(!r.has(n,l)){n[l]=!0;var c=t.node(l);s[c.rank].push(l),r.forEach(t.successors(l),o)}}var A=r.sortBy(i,function(l){return t.node(l).rank});return r.forEach(A,o),s}return hB}var dB,nL;function wJ(){if(nL)return dB;nL=1;var r=Vt();dB=e;function e(n,i){for(var a=0,s=1;s<i.length;++s)a+=t(n,i[s-1],i[s]);return a}function t(n,i,a){for(var s=r.zipObject(a,r.map(a,function(h,d){return d})),o=r.flatten(r.map(i,function(h){return r.sortBy(r.map(n.outEdges(h),function(d){return{pos:s[d.w],weight:n.edge(d).weight}}),"pos")}),!0),A=1;A<a.length;)A<<=1;var l=2*A-1;A-=1;var c=r.map(new Array(l),function(){return 0}),u=0;return r.forEach(o.forEach(function(h){var d=h.pos+A;c[d]+=h.weight;for(var f=0;d>0;)d%2&&(f+=c[d+1]),d=d-1>>1,c[d]+=h.weight;u+=h.weight*f})),u}return dB}var fB,rL;function BJ(){if(rL)return fB;rL=1;var r=Vt();fB=e;function e(t,n){return r.map(n,function(i){var a=t.inEdges(i);if(a.length){var s=r.reduce(a,function(o,A){var l=t.edge(A),c=t.node(A.v);return{sum:o.sum+l.weight*c.order,weight:o.weight+l.weight}},{sum:0,weight:0});return{v:i,barycenter:s.sum/s.weight,weight:s.weight}}else return{v:i}})}return fB}var gB,iL;function bJ(){if(iL)return gB;iL=1;var r=Vt();gB=e;function e(i,a){var s={};r.forEach(i,function(A,l){var c=s[A.v]={indegree:0,in:[],out:[],vs:[A.v],i:l};r.isUndefined(A.barycenter)||(c.barycenter=A.barycenter,c.weight=A.weight)}),r.forEach(a.edges(),function(A){var l=s[A.v],c=s[A.w];!r.isUndefined(l)&&!r.isUndefined(c)&&(c.indegree++,l.out.push(s[A.w]))});var o=r.filter(s,function(A){return!A.indegree});return t(o)}function t(i){var a=[];function s(l){return function(c){c.merged||(r.isUndefined(c.barycenter)||r.isUndefined(l.barycenter)||c.barycenter>=l.barycenter)&&n(l,c)}}function o(l){return function(c){c.in.push(l),--c.indegree===0&&i.push(c)}}for(;i.length;){var A=i.pop();a.push(A),r.forEach(A.in.reverse(),s(A)),r.forEach(A.out,o(A))}return r.map(r.filter(a,function(l){return!l.merged}),function(l){return r.pick(l,["vs","i","barycenter","weight"])})}function n(i,a){var s=0,o=0;i.weight&&(s+=i.barycenter*i.weight,o+=i.weight),a.weight&&(s+=a.barycenter*a.weight,o+=a.weight),i.vs=a.vs.concat(i.vs),i.barycenter=s/o,i.weight=o,i.i=Math.min(a.i,i.i),a.merged=!0}return gB}var pB,aL;function EJ(){if(aL)return pB;aL=1;var r=Vt(),e=Tr();pB=t;function t(a,s){var o=e.partition(a,function(g){return r.has(g,"barycenter")}),A=o.lhs,l=r.sortBy(o.rhs,function(g){return-g.i}),c=[],u=0,h=0,d=0;A.sort(i(!!s)),d=n(c,l,d),r.forEach(A,function(g){d+=g.vs.length,c.push(g.vs),u+=g.barycenter*g.weight,h+=g.weight,d=n(c,l,d)});var f={vs:r.flatten(c,!0)};return h&&(f.barycenter=u/h,f.weight=h),f}function n(a,s,o){for(var A;s.length&&(A=r.last(s)).i<=o;)s.pop(),a.push(A.vs),o++;return o}function i(a){return function(s,o){return s.barycenter<o.barycenter?-1:s.barycenter>o.barycenter?1:a?o.i-s.i:s.i-o.i}}return pB}var vB,sL;function xJ(){if(sL)return vB;sL=1;var r=Vt(),e=BJ(),t=bJ(),n=EJ();vB=i;function i(o,A,l,c){var u=o.children(A),h=o.node(A),d=h?h.borderLeft:void 0,f=h?h.borderRight:void 0,g={};d&&(u=r.filter(u,function(C){return C!==d&&C!==f}));var p=e(o,u);r.forEach(p,function(C){if(o.children(C.v).length){var S=i(o,C.v,l,c);g[C.v]=S,r.has(S,"barycenter")&&s(C,S)}});var v=t(p,l);a(v,g);var y=n(v,c);if(d&&(y.vs=r.flatten([d,y.vs,f],!0),o.predecessors(d).length)){var m=o.node(o.predecessors(d)[0]),B=o.node(o.predecessors(f)[0]);r.has(y,"barycenter")||(y.barycenter=0,y.weight=0),y.barycenter=(y.barycenter*y.weight+m.order+B.order)/(y.weight+2),y.weight+=2}return y}function a(o,A){r.forEach(o,function(l){l.vs=r.flatten(l.vs.map(function(c){return A[c]?A[c].vs:c}),!0)})}function s(o,A){r.isUndefined(o.barycenter)?(o.barycenter=A.barycenter,o.weight=A.weight):(o.barycenter=(o.barycenter*o.weight+A.barycenter*A.weight)/(o.weight+A.weight),o.weight+=A.weight)}return vB}var yB,oL;function CJ(){if(oL)return yB;oL=1;var r=Vt(),e=Si().Graph;yB=t;function t(i,a,s){var o=n(i),A=new e({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(function(l){return i.node(l)});return r.forEach(i.nodes(),function(l){var c=i.node(l),u=i.parent(l);(c.rank===a||c.minRank<=a&&a<=c.maxRank)&&(A.setNode(l),A.setParent(l,u||o),r.forEach(i[s](l),function(h){var d=h.v===l?h.w:h.v,f=A.edge(d,l),g=r.isUndefined(f)?0:f.weight;A.setEdge(d,l,{weight:i.edge(h).weight+g})}),r.has(c,"minRank")&&A.setNode(l,{borderLeft:c.borderLeft[a],borderRight:c.borderRight[a]}))}),A}function n(i){for(var a;i.hasNode(a=r.uniqueId("_root")););return a}return yB}var mB,AL;function SJ(){if(AL)return mB;AL=1;var r=Vt();mB=e;function e(t,n,i){var a={},s;r.forEach(i,function(o){for(var A=t.parent(o),l,c;A;){if(l=t.parent(A),l?(c=a[l],a[l]=A):(c=s,s=A),c&&c!==A){n.setEdge(c,A);return}A=l}})}return mB}var wB,lL;function FJ(){if(lL)return wB;lL=1;var r=Vt(),e=mJ(),t=wJ(),n=xJ(),i=CJ(),a=SJ(),s=Si().Graph,o=Tr();wB=A;function A(h){var d=o.maxRank(h),f=l(h,r.range(1,d+1),"inEdges"),g=l(h,r.range(d-1,-1,-1),"outEdges"),p=e(h);u(h,p);for(var v=Number.POSITIVE_INFINITY,y,m=0,B=0;B<4;++m,++B){c(m%2?f:g,m%4>=2),p=o.buildLayerMatrix(h);var C=t(h,p);C<v&&(B=0,y=r.cloneDeep(p),v=C)}u(h,y)}function l(h,d,f){return r.map(d,function(g){return i(h,g,f)})}function c(h,d){var f=new s;r.forEach(h,function(g){var p=g.graph().root,v=n(g,p,f,d);r.forEach(v.vs,function(y,m){g.node(y).order=m}),a(g,f,v.vs)})}function u(h,d){r.forEach(d,function(f){r.forEach(f,function(g,p){h.node(g).order=p})})}return wB}var BB,cL;function TJ(){if(cL)return BB;cL=1;var r=Vt(),e=Si().Graph,t=Tr();BB={positionX:f,findType1Conflicts:n,findType2Conflicts:i,addConflict:s,hasConflict:o,verticalAlignment:A,horizontalCompaction:l,alignCoordinates:h,findSmallestWidthAlignment:u,balance:d};function n(v,y){var m={};function B(C,S){var F=0,T=0,O=C.length,I=r.last(S);return r.forEach(S,function(k,N){var U=a(v,k),D=U?v.node(U).order:O;(U||k===I)&&(r.forEach(S.slice(T,N+1),function(G){r.forEach(v.predecessors(G),function(Z){var q=v.node(Z),j=q.order;(j<F||D<j)&&!(q.dummy&&v.node(G).dummy)&&s(m,Z,G)})}),T=N+1,F=D)}),S}return r.reduce(y,B),m}function i(v,y){var m={};function B(S,F,T,O,I){var k;r.forEach(r.range(F,T),function(N){k=S[N],v.node(k).dummy&&r.forEach(v.predecessors(k),function(U){var D=v.node(U);D.dummy&&(D.order<O||D.order>I)&&s(m,U,k)})})}function C(S,F){var T=-1,O,I=0;return r.forEach(F,function(k,N){if(v.node(k).dummy==="border"){var U=v.predecessors(k);U.length&&(O=v.node(U[0]).order,B(F,I,N,T,O),I=N,T=O)}B(F,I,F.length,O,S.length)}),F}return r.reduce(y,C),m}function a(v,y){if(v.node(y).dummy)return r.find(v.predecessors(y),function(m){return v.node(m).dummy})}function s(v,y,m){if(y>m){var B=y;y=m,m=B}var C=v[y];C||(v[y]=C={}),C[m]=!0}function o(v,y,m){if(y>m){var B=y;y=m,m=B}return r.has(v[y],m)}function A(v,y,m,B){var C={},S={},F={};return r.forEach(y,function(T){r.forEach(T,function(O,I){C[O]=O,S[O]=O,F[O]=I})}),r.forEach(y,function(T){var O=-1;r.forEach(T,function(I){var k=B(I);if(k.length){k=r.sortBy(k,function(Z){return F[Z]});for(var N=(k.length-1)/2,U=Math.floor(N),D=Math.ceil(N);U<=D;++U){var G=k[U];S[I]===I&&O<F[G]&&!o(m,I,G)&&(S[G]=I,S[I]=C[I]=C[G],O=F[G])}}})}),{root:C,align:S}}function l(v,y,m,B,C){var S={},F=c(v,y,m,C),T=C?"borderLeft":"borderRight";function O(N,U){for(var D=F.nodes(),G=D.pop(),Z={};G;)Z[G]?N(G):(Z[G]=!0,D.push(G),D=D.concat(U(G))),G=D.pop()}function I(N){S[N]=F.inEdges(N).reduce(function(U,D){return Math.max(U,S[D.v]+F.edge(D))},0)}function k(N){var U=F.outEdges(N).reduce(function(G,Z){return Math.min(G,S[Z.w]-F.edge(Z))},Number.POSITIVE_INFINITY),D=v.node(N);U!==Number.POSITIVE_INFINITY&&D.borderType!==T&&(S[N]=Math.max(S[N],U))}return O(I,F.predecessors.bind(F)),O(k,F.successors.bind(F)),r.forEach(B,function(N){S[N]=S[m[N]]}),S}function c(v,y,m,B){var C=new e,S=v.graph(),F=g(S.nodesep,S.edgesep,B);return r.forEach(y,function(T){var O;r.forEach(T,function(I){var k=m[I];if(C.setNode(k),O){var N=m[O],U=C.edge(N,k);C.setEdge(N,k,Math.max(F(v,I,O),U||0))}O=I})}),C}function u(v,y){return r.minBy(r.values(y),function(m){var B=Number.NEGATIVE_INFINITY,C=Number.POSITIVE_INFINITY;return r.forIn(m,function(S,F){var T=p(v,F)/2;B=Math.max(S+T,B),C=Math.min(S-T,C)}),B-C})}function h(v,y){var m=r.values(y),B=r.min(m),C=r.max(m);r.forEach(["u","d"],function(S){r.forEach(["l","r"],function(F){var T=S+F,O=v[T],I;if(O!==y){var k=r.values(O);I=F==="l"?B-r.min(k):C-r.max(k),I&&(v[T]=r.mapValues(O,function(N){return N+I}))}})})}function d(v,y){return r.mapValues(v.ul,function(m,B){if(y)return v[y.toLowerCase()][B];var C=r.sortBy(r.map(v,B));return(C[1]+C[2])/2})}function f(v){var y=t.buildLayerMatrix(v),m=r.merge(n(v,y),i(v,y)),B={},C;r.forEach(["u","d"],function(F){C=F==="u"?y:r.values(y).reverse(),r.forEach(["l","r"],function(T){T==="r"&&(C=r.map(C,function(N){return r.values(N).reverse()}));var O=(F==="u"?v.predecessors:v.successors).bind(v),I=A(v,C,m,O),k=l(v,C,I.root,I.align,T==="r");T==="r"&&(k=r.mapValues(k,function(N){return-N})),B[F+T]=k})});var S=u(v,B);return h(B,S),d(B,v.graph().align)}function g(v,y,m){return function(B,C,S){var F=B.node(C),T=B.node(S),O=0,I;if(O+=F.width/2,r.has(F,"labelpos"))switch(F.labelpos.toLowerCase()){case"l":I=-F.width/2;break;case"r":I=F.width/2;break}if(I&&(O+=m?I:-I),I=0,O+=(F.dummy?y:v)/2,O+=(T.dummy?y:v)/2,O+=T.width/2,r.has(T,"labelpos"))switch(T.labelpos.toLowerCase()){case"l":I=T.width/2;break;case"r":I=-T.width/2;break}return I&&(O+=m?I:-I),I=0,O}}function p(v,y){return v.node(y).width}return BB}var bB,uL;function MJ(){if(uL)return bB;uL=1;var r=Vt(),e=Tr(),t=TJ().positionX;bB=n;function n(a){a=e.asNonCompoundGraph(a),i(a),r.forEach(t(a),function(s,o){a.node(o).x=s})}function i(a){var s=e.buildLayerMatrix(a),o=a.graph().ranksep,A=0;r.forEach(s,function(l){var c=r.max(r.map(l,function(u){return a.node(u).height}));r.forEach(l,function(u){a.node(u).y=A+c/2}),A+=c+o})}return bB}var EB,hL;function OJ(){if(hL)return EB;hL=1;var r=Vt(),e=uJ(),t=hJ(),n=fJ(),i=Tr().normalizeRanks,a=gJ(),s=Tr().removeEmptyRanks,o=pJ(),A=vJ(),l=yJ(),c=FJ(),u=MJ(),h=Tr(),d=Si().Graph;EB=f;function f($,K){var ee=K&&K.debugTiming?h.time:h.notime;ee("layout",function(){var oe=ee(" buildLayoutGraph",function(){return O($)});ee(" runLayout",function(){g(oe,ee)}),ee(" updateInputGraph",function(){p($,oe)})})}function g($,K){K(" makeSpaceForEdgeLabels",function(){I($)}),K(" removeSelfEdges",function(){te($)}),K(" acyclic",function(){e.run($)}),K(" nestingGraph.run",function(){o.run($)}),K(" rank",function(){n(h.asNonCompoundGraph($))}),K(" injectEdgeLabelProxies",function(){k($)}),K(" removeEmptyRanks",function(){s($)}),K(" nestingGraph.cleanup",function(){o.cleanup($)}),K(" normalizeRanks",function(){i($)}),K(" assignRankMinMax",function(){N($)}),K(" removeEdgeLabelProxies",function(){U($)}),K(" normalize.run",function(){t.run($)}),K(" parentDummyChains",function(){a($)}),K(" addBorderSegments",function(){A($)}),K(" order",function(){c($)}),K(" insertSelfEdges",function(){ue($)}),K(" adjustCoordinateSystem",function(){l.adjust($)}),K(" position",function(){u($)}),K(" positionSelfEdges",function(){ge($)}),K(" removeBorderNodes",function(){j($)}),K(" normalize.undo",function(){t.undo($)}),K(" fixupEdgeLabelCoords",function(){Z($)}),K(" undoCoordinateSystem",function(){l.undo($)}),K(" translateGraph",function(){D($)}),K(" assignNodeIntersects",function(){G($)}),K(" reversePoints",function(){q($)}),K(" acyclic.undo",function(){e.undo($)})}function p($,K){r.forEach($.nodes(),function(ee){var oe=$.node(ee),Ee=K.node(ee);oe&&(oe.x=Ee.x,oe.y=Ee.y,K.children(ee).length&&(oe.width=Ee.width,oe.height=Ee.height))}),r.forEach($.edges(),function(ee){var oe=$.edge(ee),Ee=K.edge(ee);oe.points=Ee.points,r.has(Ee,"x")&&(oe.x=Ee.x,oe.y=Ee.y)}),$.graph().width=K.graph().width,$.graph().height=K.graph().height}var v=["nodesep","edgesep","ranksep","marginx","marginy"],y={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},m=["acyclicer","ranker","rankdir","align"],B=["width","height"],C={width:0,height:0},S=["minlen","weight","width","height","labeloffset"],F={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},T=["labelpos"];function O($){var K=new d({multigraph:!0,compound:!0}),ee=xe($.graph());return K.setGraph(r.merge({},y,Y(ee,v),r.pick(ee,m))),r.forEach($.nodes(),function(oe){var Ee=xe($.node(oe));K.setNode(oe,r.defaults(Y(Ee,B),C)),K.setParent(oe,$.parent(oe))}),r.forEach($.edges(),function(oe){var Ee=xe($.edge(oe));K.setEdge(oe,r.merge({},F,Y(Ee,S),r.pick(Ee,T)))}),K}function I($){var K=$.graph();K.ranksep/=2,r.forEach($.edges(),function(ee){var oe=$.edge(ee);oe.minlen*=2,oe.labelpos.toLowerCase()!=="c"&&(K.rankdir==="TB"||K.rankdir==="BT"?oe.width+=oe.labeloffset:oe.height+=oe.labeloffset)})}function k($){r.forEach($.edges(),function(K){var ee=$.edge(K);if(ee.width&&ee.height){var oe=$.node(K.v),Ee=$.node(K.w),Le={rank:(Ee.rank-oe.rank)/2+oe.rank,e:K};h.addDummyNode($,"edge-proxy",Le,"_ep")}})}function N($){var K=0;r.forEach($.nodes(),function(ee){var oe=$.node(ee);oe.borderTop&&(oe.minRank=$.node(oe.borderTop).rank,oe.maxRank=$.node(oe.borderBottom).rank,K=r.max(K,oe.maxRank))}),$.graph().maxRank=K}function U($){r.forEach($.nodes(),function(K){var ee=$.node(K);ee.dummy==="edge-proxy"&&($.edge(ee.e).labelRank=ee.rank,$.removeNode(K))})}function D($){var K=Number.POSITIVE_INFINITY,ee=0,oe=Number.POSITIVE_INFINITY,Ee=0,Le=$.graph(),Pe=Le.marginx||0,st=Le.marginy||0;function ut(ht){var Et=ht.x,Ue=ht.y,vt=ht.width,it=ht.height;K=Math.min(K,Et-vt/2),ee=Math.max(ee,Et+vt/2),oe=Math.min(oe,Ue-it/2),Ee=Math.max(Ee,Ue+it/2)}r.forEach($.nodes(),function(ht){ut($.node(ht))}),r.forEach($.edges(),function(ht){var Et=$.edge(ht);r.has(Et,"x")&&ut(Et)}),K-=Pe,oe-=st,r.forEach($.nodes(),function(ht){var Et=$.node(ht);Et.x-=K,Et.y-=oe}),r.forEach($.edges(),function(ht){var Et=$.edge(ht);r.forEach(Et.points,function(Ue){Ue.x-=K,Ue.y-=oe}),r.has(Et,"x")&&(Et.x-=K),r.has(Et,"y")&&(Et.y-=oe)}),Le.width=ee-K+Pe,Le.height=Ee-oe+st}function G($){r.forEach($.edges(),function(K){var ee=$.edge(K),oe=$.node(K.v),Ee=$.node(K.w),Le,Pe;ee.points?(Le=ee.points[0],Pe=ee.points[ee.points.length-1]):(ee.points=[],Le=Ee,Pe=oe),ee.points.unshift(h.intersectRect(oe,Le)),ee.points.push(h.intersectRect(Ee,Pe))})}function Z($){r.forEach($.edges(),function(K){var ee=$.edge(K);if(r.has(ee,"x"))switch((ee.labelpos==="l"||ee.labelpos==="r")&&(ee.width-=ee.labeloffset),ee.labelpos){case"l":ee.x-=ee.width/2+ee.labeloffset;break;case"r":ee.x+=ee.width/2+ee.labeloffset;break}})}function q($){r.forEach($.edges(),function(K){var ee=$.edge(K);ee.reversed&&ee.points.reverse()})}function j($){r.forEach($.nodes(),function(K){if($.children(K).length){var ee=$.node(K),oe=$.node(ee.borderTop),Ee=$.node(ee.borderBottom),Le=$.node(r.last(ee.borderLeft)),Pe=$.node(r.last(ee.borderRight));ee.width=Math.abs(Pe.x-Le.x),ee.height=Math.abs(Ee.y-oe.y),ee.x=Le.x+ee.width/2,ee.y=oe.y+ee.height/2}}),r.forEach($.nodes(),function(K){$.node(K).dummy==="border"&&$.removeNode(K)})}function te($){r.forEach($.edges(),function(K){if(K.v===K.w){var ee=$.node(K.v);ee.selfEdges||(ee.selfEdges=[]),ee.selfEdges.push({e:K,label:$.edge(K)}),$.removeEdge(K)}})}function ue($){var K=h.buildLayerMatrix($);r.forEach(K,function(ee){var oe=0;r.forEach(ee,function(Ee,Le){var Pe=$.node(Ee);Pe.order=Le+oe,r.forEach(Pe.selfEdges,function(st){h.addDummyNode($,"selfedge",{width:st.label.width,height:st.label.height,rank:Pe.rank,order:Le+ ++oe,e:st.e,label:st.label},"_se")}),delete Pe.selfEdges})})}function ge($){r.forEach($.nodes(),function(K){var ee=$.node(K);if(ee.dummy==="selfedge"){var oe=$.node(ee.e.v),Ee=oe.x+oe.width/2,Le=oe.y,Pe=ee.x-Ee,st=oe.height/2;$.setEdge(ee.e,ee.label),$.removeNode(K),ee.label.points=[{x:Ee+2*Pe/3,y:Le-st},{x:Ee+5*Pe/6,y:Le-st},{x:Ee+Pe,y:Le},{x:Ee+5*Pe/6,y:Le+st},{x:Ee+2*Pe/3,y:Le+st}],ee.label.x=ee.x,ee.label.y=ee.y}})}function Y($,K){return r.mapValues(r.pick($,K),Number)}function xe($){var K={};return r.forEach($,function(ee,oe){K[oe.toLowerCase()]=ee}),K}return EB}var xB,dL;function IJ(){if(dL)return xB;dL=1;var r=Vt(),e=Tr(),t=Si().Graph;xB={debugOrdering:n};function n(i){var a=e.buildLayerMatrix(i),s=new t({compound:!0,multigraph:!0}).setGraph({});return r.forEach(i.nodes(),function(o){s.setNode(o,{label:o}),s.setParent(o,"layer"+i.node(o).rank)}),r.forEach(i.edges(),function(o){s.setEdge(o.v,o.w,{},o.name)}),r.forEach(a,function(o,A){var l="layer"+A;s.setNode(l,{rank:"same"}),r.reduce(o,function(c,u){return s.setEdge(c,u,{style:"invis"}),u})}),s}return xB}var CB,fL;function _J(){return fL||(fL=1,CB="0.8.5"),CB}var SB,gL;function kJ(){return gL||(gL=1,SB={graphlib:Si(),layout:OJ(),debug:IJ(),util:{time:Tr().time,notime:Tr().notime},version:_J()}),SB}var pL=kJ();const NJ=ic(pL);class md{constructor(e){this.id="dagre",this.options={},Object.assign(this.options,md.defaultOptions,e)}execute(e,t){return et(this,void 0,void 0,function*(){return this.genericDagreLayout(!1,e,Object.assign(Object.assign({},this.options),t))})}assign(e,t){return et(this,void 0,void 0,function*(){yield this.genericDagreLayout(!0,e,Object.assign(Object.assign({},this.options),t))})}genericDagreLayout(e,t,n){return et(this,void 0,void 0,function*(){const{nodeSize:i}=n,a=new pL.graphlib.Graph;a.setGraph(n),a.setDefaultEdgeLabel(()=>({}));const s=t.getAllNodes(),o=t.getAllEdges();[...s,...o].some(({id:l})=>Be(l))&&console.error("Dagre layout only support string id, it will convert number to string."),t.getAllNodes().forEach(l=>{const{id:c}=l,u=Object.assign({},l.data);if(i!==void 0){const[h,d]=Fl(Te(i)?i(l):i);Object.assign(u,{width:h,height:d})}a.setNode(c.toString(),u)}),t.getAllEdges().forEach(({id:l,source:c,target:u})=>{a.setEdge(c.toString(),u.toString(),{id:l})}),NJ.layout(a);const A={nodes:[],edges:[]};return a.nodes().forEach(l=>{const c=a.node(l);A.nodes.push({id:l,data:c}),e&&t.mergeNodeData(l,c)}),a.edges().forEach(l=>{const c=a.edge(l),{id:u}=c,h=Pt(c,["id"]),{v:d,w:f}=l;A.edges.push({id:u,source:d,target:f,data:h}),e&&t.mergeEdgeData(u,h)}),A})}}md.defaultOptions={};class FB{constructor(e){this.id=e.id||0,this.rx=e.rx,this.ry=e.ry,this.fx=0,this.fy=0,this.mass=e.mass,this.degree=e.degree,this.g=e.g||0}distanceTo(e){const t=this.rx-e.rx,n=this.ry-e.ry;return Math.hypot(t,n)}setPos(e,t){this.rx=e,this.ry=t}resetForce(){this.fx=0,this.fy=0}addForce(e){const t=e.rx-this.rx,n=e.ry-this.ry;let i=Math.hypot(t,n);i=i<1e-4?1e-4:i;const a=this.g*(this.degree+1)*(e.degree+1)/i;this.fx+=a*t/i,this.fy+=a*n/i}in(e){return e.contains(this.rx,this.ry)}add(e){const t=this.mass+e.mass,n=(this.rx*this.mass+e.rx*e.mass)/t,i=(this.ry*this.mass+e.ry*e.mass)/t,a=this.degree+e.degree,s={rx:n,ry:i,mass:t,degree:a};return new FB(s)}}class Jo{constructor(e){this.xmid=e.xmid,this.ymid=e.ymid,this.length=e.length,this.massCenter=e.massCenter||[0,0],this.mass=e.mass||1}getLength(){return this.length}contains(e,t){const n=this.length/2;return e<=this.xmid+n&&e>=this.xmid-n&&t<=this.ymid+n&&t>=this.ymid-n}NW(){const e=this.xmid-this.length/4,t=this.ymid+this.length/4,n=this.length/2,i={xmid:e,ymid:t,length:n};return new Jo(i)}NE(){const e=this.xmid+this.length/4,t=this.ymid+this.length/4,n=this.length/2,i={xmid:e,ymid:t,length:n};return new Jo(i)}SW(){const e=this.xmid-this.length/4,t=this.ymid-this.length/4,n=this.length/2,i={xmid:e,ymid:t,length:n};return new Jo(i)}SE(){const e=this.xmid+this.length/4,t=this.ymid-this.length/4,n=this.length/2,i={xmid:e,ymid:t,length:n};return new Jo(i)}}class eA{constructor(e){this.body=null,this.quad=null,this.NW=null,this.NE=null,this.SW=null,this.SE=null,this.theta=.5,e!=null&&(this.quad=e)}insert(e){if(this.body==null){this.body=e;return}this._isExternal()?(this.quad&&(this.NW=new eA(this.quad.NW()),this.NE=new eA(this.quad.NE()),this.SW=new eA(this.quad.SW()),this.SE=new eA(this.quad.SE())),this._putBody(this.body),this._putBody(e),this.body=this.body.add(e)):(this.body=this.body.add(e),this._putBody(e))}_putBody(e){this.quad&&(e.in(this.quad.NW())&&this.NW?this.NW.insert(e):e.in(this.quad.NE())&&this.NE?this.NE.insert(e):e.in(this.quad.SW())&&this.SW?this.SW.insert(e):e.in(this.quad.SE())&&this.SE&&this.SE.insert(e))}_isExternal(){return this.NW==null&&this.NE==null&&this.SW==null&&this.SE==null}updateForce(e){if(!(this.body==null||e===this.body))if(this._isExternal())e.addForce(this.body);else{const t=this.quad?this.quad.getLength():0,n=this.body.distanceTo(e);t/n<this.theta?e.addForce(this.body):(this.NW&&this.NW.updateForce(e),this.NE&&this.NE.updateForce(e),this.SW&&this.SW.updateForce(e),this.SE&&this.SE.updateForce(e))}}}const LJ={center:[0,0],width:300,height:300,kr:5,kg:1,mode:"normal",preventOverlap:!1,dissuadeHubs:!1,maxIteration:0,ks:.1,ksmax:10,tao:.1};class QJ{constructor(e={}){this.options=e,this.id="forceAtlas2",this.options=Object.assign(Object.assign({},LJ),e)}execute(e,t){return et(this,void 0,void 0,function*(){return this.genericForceAtlas2Layout(!1,e,t)})}assign(e,t){return et(this,void 0,void 0,function*(){yield this.genericForceAtlas2Layout(!0,e,t)})}genericForceAtlas2Layout(e,t,n){return et(this,void 0,void 0,function*(){const i=t.getAllEdges(),a=t.getAllNodes(),s=this.formatOptions(n,a.length),{width:o,height:A,prune:l,maxIteration:c,nodeSize:u,center:h}=s;if(!a?.length||a.length===1)return Ys(t,e,h);const d=a.map(v=>Kr(v,[o,A])),f=i.filter(v=>{const{source:y,target:m}=v;return y!==m}),g=new Tn({nodes:d,edges:f}),p=this.getSizes(g,u);if(this.run(g,t,c,p,e,s),l){for(let y=0;y<f.length;y+=1){const{source:m,target:B}=f[y],C=g.getDegree(m),S=g.getDegree(m);if(C<=1){const F=g.getNode(B);g.mergeNodeData(m,{x:F.data.x,y:F.data.y})}else if(S<=1){const F=g.getNode(m);g.mergeNodeData(B,{x:F.data.x,y:F.data.y})}}const v=Object.assign(Object.assign({},s),{prune:!1,barnesHut:!1});this.run(g,t,100,p,e,v)}return{nodes:d,edges:i}})}getSizes(e,t){const n=e.getAllNodes(),i={};for(let a=0;a<n.length;a+=1){const s=n[a];i[s.id]=Uv(t,void 0)(s)}return i}formatOptions(e={},t){const n=Object.assign(Object.assign({},this.options),e),{center:i,width:a,height:s,barnesHut:o,prune:A,maxIteration:l,kr:c,kg:u}=n;return n.width=!a&&typeof window<"u"?window.innerWidth:a,n.height=!s&&typeof window<"u"?window.innerHeight:s,n.center=i||[n.width/2,n.height/2],o===void 0&&t>250&&(n.barnesHut=!0),A===void 0&&t>100&&(n.prune=!0),l===0&&!A?(n.maxIteration=250,t<=200&&t>100?n.maxIteration=1e3:t>200&&(n.maxIteration=1200)):l===0&&A&&(n.maxIteration=100,t<=200&&t>100?n.maxIteration=500:t>200&&(n.maxIteration=950)),c||(n.kr=50,t>100&&t<=500?n.kr=20:t>500&&(n.kr=1)),u||(n.kg=20,t>100&&t<=500?n.kg=10:t>500&&(n.kg=1)),n}run(e,t,n,i,a,s){const{kr:o,barnesHut:A,onTick:l}=s,c=e.getAllNodes();let u=0,h=n;const d={},f={},g={};for(let p=0;p<c.length;p+=1){const{data:v,id:y}=c[p];if(d[y]=[0,0],A){const m={id:p,rx:v.x,ry:v.y,mass:1,g:o,degree:e.getDegree(y)};g[y]=new FB(m)}}for(;h>0;)u=this.oneStep(e,{iter:h,preventOverlapIters:50,krPrime:100,sg:u,forces:d,preForces:f,bodies:g,sizes:i},s),h--,l?.({nodes:c,edges:t.getAllEdges()});return e}oneStep(e,t,n){const{iter:i,preventOverlapIters:a,krPrime:s,sg:o,preForces:A,bodies:l,sizes:c}=t;let{forces:u}=t;const{preventOverlap:h,barnesHut:d}=n,f=e.getAllNodes();for(let g=0;g<f.length;g+=1){const{id:p}=f[g];A[p]=[...u[p]],u[p]=[0,0]}return u=this.getAttrForces(e,i,a,c,u,n),d&&(h&&i>a||!h)?u=this.getOptRepGraForces(e,u,l,n):u=this.getRepGraForces(e,i,a,u,s,c,n),this.updatePos(e,u,A,o,n)}getAttrForces(e,t,n,i,a,s){const{preventOverlap:o,dissuadeHubs:A,mode:l,prune:c}=s,u=e.getAllEdges();for(let h=0;h<u.length;h+=1){const{source:d,target:f}=u[h],g=e.getNode(d),p=e.getNode(f),v=e.getDegree(d),y=e.getDegree(f);if(c&&(v<=1||y<=1))continue;const m=[p.data.x-g.data.x,p.data.y-g.data.y];let B=Math.hypot(m[0],m[1]);B=B<1e-4?1e-4:B,m[0]=m[0]/B,m[1]=m[1]/B,o&&t<n&&(B=B-i[d]-i[f]);let C=B,S=C;l==="linlog"&&(C=Math.log(1+B),S=C),A&&(C=B/v,S=B/y),o&&t<n&&B<=0?(C=0,S=0):o&&t<n&&B>0&&(C=B,S=B),a[d][0]+=C*m[0],a[f][0]-=S*m[0],a[d][1]+=C*m[1],a[f][1]-=S*m[1]}return a}getOptRepGraForces(e,t,n,i){const{kg:a,center:s,prune:o}=i,A=e.getAllNodes(),l=A.length;let c=9e10,u=-9e10,h=9e10,d=-9e10;for(let y=0;y<l;y+=1){const{id:m,data:B}=A[y];o&&e.getDegree(m)<=1||(n[m].setPos(B.x,B.y),B.x>=u&&(u=B.x),B.x<=c&&(c=B.x),B.y>=d&&(d=B.y),B.y<=h&&(h=B.y))}const f=Math.max(u-c,d-h),g={xmid:(u+c)/2,ymid:(d+h)/2,length:f,massCenter:s,mass:l},p=new Jo(g),v=new eA(p);for(let y=0;y<l;y+=1){const{id:m}=A[y];o&&e.getDegree(m)<=1||n[m].in(p)&&v.insert(n[m])}for(let y=0;y<l;y+=1){const{id:m,data:B}=A[y],C=e.getDegree(m);if(o&&C<=1)continue;n[m].resetForce(),v.updateForce(n[m]),t[m][0]-=n[m].fx,t[m][1]-=n[m].fy;const S=[B.x-s[0],B.y-s[1]];let F=Math.hypot(S[0],S[1]);F=F<1e-4?1e-4:F,S[0]=S[0]/F,S[1]=S[1]/F;const T=a*(C+1);t[m][0]-=T*S[0],t[m][1]-=T*S[1]}return t}getRepGraForces(e,t,n,i,a,s,o){const{preventOverlap:A,kr:l,kg:c,center:u,prune:h}=o,d=e.getAllNodes(),f=d.length;for(let g=0;g<f;g+=1){const p=d[g],v=e.getDegree(p.id);for(let C=g+1;C<f;C+=1){const S=d[C],F=e.getDegree(S.id);if(h&&(v<=1||F<=1))continue;const T=[S.data.x-p.data.x,S.data.y-p.data.y];let O=Math.hypot(T[0],T[1]);O=O<1e-4?1e-4:O,T[0]=T[0]/O,T[1]=T[1]/O,A&&t<n&&(O=O-s[p.id]-s[S.id]);let I=l*(v+1)*(F+1)/O;A&&t<n&&O<0?I=a*(v+1)*(F+1):A&&t<n&&O===0?I=0:A&&t<n&&O>0&&(I=l*(v+1)*(F+1)/O),i[p.id][0]-=I*T[0],i[S.id][0]+=I*T[0],i[p.id][1]-=I*T[1],i[S.id][1]+=I*T[1]}const y=[p.data.x-u[0],p.data.y-u[1]],m=Math.hypot(y[0],y[1]);y[0]=y[0]/m,y[1]=y[1]/m;const B=c*(v+1);i[p.id][0]-=B*y[0],i[p.id][1]-=B*y[1]}return i}updatePos(e,t,n,i,a){const{ks:s,tao:o,prune:A,ksmax:l}=a,c=e.getAllNodes(),u=c.length,h=[],d=[];let f=0,g=0,p=i;for(let y=0;y<u;y+=1){const{id:m}=c[y],B=e.getDegree(m);if(A&&B<=1)continue;const C=[t[m][0]-n[m][0],t[m][1]-n[m][1]],S=Math.hypot(C[0],C[1]),F=[t[m][0]+n[m][0],t[m][1]+n[m][1]],T=Math.hypot(F[0],F[1]);h[y]=S,d[y]=T/2,f+=(B+1)*h[y],g+=(B+1)*d[y]}const v=p;p=o*g/f,v!==0&&(p=p>1.5*v?1.5*v:p);for(let y=0;y<u;y+=1){const{id:m,data:B}=c[y],C=e.getDegree(m);if(A&&C<=1||Be(B.fx)&&Be(B.fy))continue;let S=s*p/(1+p*Math.sqrt(h[y])),F=Math.hypot(t[m][0],t[m][1]);F=F<1e-4?1e-4:F;const T=l/F;S=S>T?T:S;const O=S*t[m][0],I=S*t[m][1];e.mergeNodeData(m,{x:B.x+O,y:B.y+I})}return p}}const UJ={maxIteration:1e3,gravity:10,speed:5,clustering:!1,clusterGravity:10,width:300,height:300,nodeClusterBy:"cluster"},PJ=800;class RJ{constructor(e={}){this.options=e,this.id="fruchterman",this.timeInterval=0,this.running=!1,this.options=Object.assign(Object.assign({},UJ),e)}execute(e,t){return et(this,void 0,void 0,function*(){return this.genericFruchtermanLayout(!1,e,t)})}assign(e,t){return et(this,void 0,void 0,function*(){yield this.genericFruchtermanLayout(!0,e,t)})}stop(){this.timeInterval&&typeof window<"u"&&window.clearInterval(this.timeInterval),this.running=!1}tick(e=this.options.maxIteration||1){if(this.lastResult)return this.lastResult;for(let n=0;n<e;n++)this.runOneStep(this.lastGraph,this.lastClusterMap,this.lastOptions);const t={nodes:this.lastLayoutNodes,edges:this.lastLayoutEdges};return this.lastAssign&&t.nodes.forEach(n=>this.lastGraph.mergeNodeData(n.id,{x:n.data.x,y:n.data.y,z:this.options.dimensions===3?n.data.z:void 0})),t}genericFruchtermanLayout(e,t,n){return et(this,void 0,void 0,function*(){if(this.running)return;const i=this.formatOptions(n),{dimensions:a,width:s,height:o,center:A,clustering:l,nodeClusterBy:c,maxIteration:u,onTick:h}=i,d=t.getAllNodes(),f=t.getAllEdges();if(!d?.length){const m={nodes:[],edges:f};return this.lastResult=m,m}if(d.length===1){e&&t.mergeNodeData(d[0].id,{x:A[0],y:A[1],z:a===3?A[2]:void 0});const m={nodes:[Object.assign(Object.assign({},d[0]),{data:Object.assign(Object.assign({},d[0].data),{x:A[0],y:A[1],z:a===3?A[2]:void 0})})],edges:f};return this.lastResult=m,m}const g=d.map(m=>Kr(m,[s,o])),p=new Tn({nodes:g,edges:f}),v={};if(l&&g.forEach(m=>{const B=m.data[c];v[B]||(v[B]={name:B,cx:0,cy:0,count:0})}),this.lastLayoutNodes=g,this.lastLayoutEdges=f,this.lastAssign=e,this.lastGraph=p,this.lastOptions=i,this.lastClusterMap=v,typeof window>"u")return;let y=0;return new Promise(m=>{this.timeInterval=window.setInterval(()=>{if(!this.running){m({nodes:g,edges:f});return}this.runOneStep(p,v,i),e&&g.forEach(({id:B,data:C})=>t.mergeNodeData(B,{x:C.x,y:C.y,z:a===3?C.z:void 0})),h?.({nodes:g,edges:f}),y++,y>=u&&(window.clearInterval(this.timeInterval),m({nodes:g,edges:f}))},0),this.running=!0})})}formatOptions(e={}){const t=Object.assign(Object.assign({},this.options),e),{clustering:n,nodeClusterBy:i}=t,{center:a,width:s,height:o}=t;return t.width=!s&&typeof window<"u"?window.innerWidth:s,t.height=!o&&typeof window<"u"?window.innerHeight:o,t.center=a||[t.width/2,t.height/2],t.clustering=n&&!!i,t}runOneStep(e,t,n){const{dimensions:i,height:a,width:s,gravity:o,center:A,speed:l,clustering:c,nodeClusterBy:u,clusterGravity:h}=n,d=a*s,f=Math.sqrt(d)/10,g=e.getAllNodes(),p=d/(g.length+1),v=Math.sqrt(p),y={};if(this.applyCalculate(e,y,v,p),c){for(const B in t)t[B].cx=0,t[B].cy=0,t[B].count=0;g.forEach(B=>{const{data:C}=B,S=t[C[u]];Be(C.x)&&(S.cx+=C.x),Be(C.y)&&(S.cy+=C.y),S.count++});for(const B in t)t[B].cx/=t[B].count,t[B].cy/=t[B].count;const m=h||o;g.forEach((B,C)=>{const{id:S,data:F}=B;if(!Be(F.x)||!Be(F.y))return;const T=t[F[u]],O=Math.sqrt((F.x-T.cx)*(F.x-T.cx)+(F.y-T.cy)*(F.y-T.cy)),I=v*m;y[S].x-=I*(F.x-T.cx)/O,y[S].y-=I*(F.y-T.cy)/O})}g.forEach((m,B)=>{const{id:C,data:S}=m;if(!Be(S.x)||!Be(S.y))return;const F=.01*v*o;y[C].x-=F*(S.x-A[0]),y[C].y-=F*(S.y-A[1]),i===3&&(y[C].z-=F*(S.z-A[2]))}),g.forEach((m,B)=>{const{id:C,data:S}=m;if(Be(S.fx)&&Be(S.fy)){S.x=S.fx,S.y=S.fy,i===3&&(S.z=S.fz);return}if(!Be(S.x)||!Be(S.y))return;const F=Math.sqrt(y[C].x*y[C].x+y[C].y*y[C].y+(i===3?y[C].z*y[C].z:0));if(F>0){const T=Math.min(f*(l/PJ),F);e.mergeNodeData(C,{x:S.x+y[C].x/F*T,y:S.y+y[C].y/F*T,z:i===3?S.z+y[C].z/F*T:void 0})}})}applyCalculate(e,t,n,i){this.calRepulsive(e,t,i),this.calAttractive(e,t,n)}calRepulsive(e,t,n){const i=e.getAllNodes();i.forEach(({data:a,id:s},o)=>{t[s]={x:0,y:0,z:0},i.forEach(({data:A,id:l},c)=>{if(o<=c||!Be(a.x)||!Be(A.x)||!Be(a.y)||!Be(A.y))return;let u=a.x-A.x,h=a.y-A.y,d=this.options.dimensions===3?a.z-A.z:0,f=u*u+h*h+d*d;f===0&&(f=1,u=.01,h=.01,d=.01);const g=n/f,p=u*g,v=h*g,y=d*g;t[s].x+=p,t[s].y+=v,t[l].x-=p,t[l].y-=v,this.options.dimensions===3&&(t[s].z+=y,t[l].z-=y)})})}calAttractive(e,t,n){e.getAllEdges().forEach(a=>{const{source:s,target:o}=a;if(!s||!o||s===o)return;const{data:A}=e.getNode(s),{data:l}=e.getNode(o);if(!Be(l.x)||!Be(A.x)||!Be(l.y)||!Be(A.y))return;const c=l.x-A.x,u=l.y-A.y,h=this.options.dimensions===3?l.z-A.z:0,d=Math.sqrt(c*c+u*u+h*h)/n,f=c*d,g=u*d,p=h*d;t[s].x+=f,t[s].y+=g,t[o].x-=f,t[o].y-=g,this.options.dimensions===3&&(t[s].z+=p,t[o].z-=p)})}}const DJ={begin:[0,0],preventOverlap:!0,preventOverlapPadding:10,condense:!1,rows:void 0,cols:void 0,position:void 0,sortBy:"degree",nodeSize:30,width:300,height:300};class HJ{constructor(e={}){this.options=e,this.id="grid",this.options=Object.assign(Object.assign({},DJ),e)}execute(e,t){return et(this,void 0,void 0,function*(){return this.genericGridLayout(!1,e,t)})}assign(e,t){return et(this,void 0,void 0,function*(){yield this.genericGridLayout(!0,e,t)})}genericGridLayout(e,t,n){return et(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),n),{begin:a=[0,0],condense:s,preventOverlapPadding:o,preventOverlap:A,rows:l,cols:c,nodeSpacing:u,nodeSize:h,width:d,height:f,position:g}=i;let{sortBy:p}=i;const v=t.getAllNodes(),y=t.getAllEdges(),m=v?.length;if(!m||m===1)return Ys(t,e,a);const B=v.map(G=>Kr(G));p!=="id"&&(!ot(p)||B[0].data[p]===void 0)&&(p="degree"),p==="degree"?B.sort((G,Z)=>t.getDegree(Z.id,"both")-t.getDegree(G.id,"both")):p==="id"?B.sort((G,Z)=>Be(Z.id)&&Be(G.id)?Z.id-G.id:`${G.id}`.localeCompare(`${Z.id}`)):B.sort((G,Z)=>Z.data[p]-G.data[p]);const C=!d&&typeof window<"u"?window.innerWidth:d,S=!f&&typeof window<"u"?window.innerHeight:f,F=m,T={rows:l,cols:c};if(l!=null&&c!=null)T.rows=l,T.cols=c;else if(l!=null&&c==null)T.rows=l,T.cols=Math.ceil(F/T.rows);else if(l==null&&c!=null)T.cols=c,T.rows=Math.ceil(F/T.cols);else{const G=Math.sqrt(F*S/C);T.rows=Math.round(G),T.cols=Math.round(C/S*G)}if(T.rows=Math.max(T.rows,1),T.cols=Math.max(T.cols,1),T.cols*T.rows>F){const G=wd(T),Z=Bd(T);(G-1)*Z>=F?wd(T,G-1):(Z-1)*G>=F&&Bd(T,Z-1)}else for(;T.cols*T.rows<F;){const G=wd(T),Z=Bd(T);(Z+1)*G>=F?Bd(T,Z+1):wd(T,G+1)}let O=s?0:C/T.cols,I=s?0:S/T.rows;if(A||u){const G=$s(10,u),Z=Qv(30,h,!1);B.forEach(q=>{(!q.data.x||!q.data.y)&&(q.data.x=0,q.data.y=0);const j=t.getNode(q.id),[te,ue]=Fl(Z(j)||30),ge=G!==void 0?G(q):o,Y=te+ge,xe=ue+ge;O=Math.max(O,Y),I=Math.max(I,xe)})}const k={},N={row:0,col:0},U={};for(let G=0;G<B.length;G++){const Z=B[G];let q;if(g&&(q=g(t.getNode(Z.id))),q&&(q.row!==void 0||q.col!==void 0)){const j={row:q.row,col:q.col};if(j.col===void 0)for(j.col=0;TB(k,j);)j.col++;else if(j.row===void 0)for(j.row=0;TB(k,j);)j.row++;U[Z.id]=j,vL(k,j)}GJ(Z,a,O,I,U,T,N,k)}const D={nodes:B,edges:y};return e&&B.forEach(G=>{t.mergeNodeData(G.id,{x:G.data.x,y:G.data.y})}),D})}}const wd=(r,e)=>{let t;const n=r.rows||5,i=r.cols||5;return e==null?t=Math.min(n,i):Math.min(n,i)===r.rows?r.rows=e:r.cols=e,t},Bd=(r,e)=>{let t;const n=r.rows||5,i=r.cols||5;return e==null?t=Math.max(n,i):Math.max(n,i)===r.rows?r.rows=e:r.cols=e,t},TB=(r,e)=>r[`c-${e.row}-${e.col}`]||!1,vL=(r,e)=>r[`c-${e.row}-${e.col}`]=!0,yL=(r,e)=>{const t=r.cols||5;e.col++,e.col>=t&&(e.col=0,e.row++)},GJ=(r,e,t,n,i,a,s,o)=>{let A,l;const c=i[r.id];if(c)A=c.col*t+t/2+e[0],l=c.row*n+n/2+e[1];else{for(;TB(o,s);)yL(a,s);A=s.col*t+t/2+e[0],l=s.row*n+n/2+e[1],vL(o,s),yL(a,s)}r.data.x=A,r.data.y=l},KJ=(r,e,t)=>{try{const n=os.mul(os.pow(e,2),-.5),i=n.mean("row"),a=n.mean("column"),s=n.mean();n.add(s).subRowVector(i).subColumnVector(a);const o=new PT(n),A=os.sqrt(o.diagonalMatrix).diagonal();return o.leftSingularVectors.toJSON().map(l=>os.mul([l],[A]).toJSON()[0].splice(0,r))}catch{const i=[];for(let a=0;a<e.length;a++){const s=Math.random()*t,o=Math.random()*t;i.push([s,o])}return i}},zJ=800,VJ={iterations:10,height:10,width:10,speed:100,gravity:10,k:5},jJ=(r,e)=>{const t=Object.assign(Object.assign({},VJ),e),{positions:n,iterations:i,width:a,k:s,speed:o=100,strictRadial:A,focusIdx:l,radii:c=[],nodeSizeFunc:u}=t,h=r.getAllNodes(),d=[],f=a/10;for(let g=0;g<i;g++)n.forEach((p,v)=>{d[v]={x:0,y:0}}),WJ(h,n,d,s,c,u),qJ(n,d,o,A,l,f,a,c);return n},WJ=(r,e,t,n,i,a)=>{e.forEach((s,o)=>{t[o]={x:0,y:0},e.forEach((A,l)=>{if(o===l||i[o]!==i[l])return;let c=s.x-A.x,u=s.y-A.y,h=Math.sqrt(c*c+u*u);if(h===0){h=1;const d=o>l?1:-1;c=.01*d,u=.01*d}if(h<a(r[o])/2+a(r[l])/2){const d=n*n/h;t[o].x+=c/h*d,t[o].y+=u/h*d}})})},qJ=(r,e,t,n,i,a,s,o)=>{const A=a||s/10;return n&&e.forEach((l,c)=>{const u=r[c].x-r[i].x,h=r[c].y-r[i].y,d=Math.sqrt(u*u+h*h);let f=h/d,g=-u/d;const p=Math.sqrt(l.x*l.x+l.y*l.y);let v=Math.acos((f*l.x+g*l.y)/p);v>Math.PI/2&&(v-=Math.PI/2,f*=-1,g*=-1);const y=Math.cos(v)*p;l.x=f*y,l.y=g*y}),r.forEach((l,c)=>{if(c===i)return;const u=Math.sqrt(e[c].x*e[c].x+e[c].y*e[c].y);if(u>0&&c!==i){const h=Math.min(A*(t/zJ),u);if(l.x+=e[c].x/u*h,l.y+=e[c].y/u*h,n){let d=l.x-r[i].x,f=l.y-r[i].y;const g=Math.sqrt(d*d+f*f);d=d/g*o[c],f=f/g*o[c],l.x=r[i].x+d,l.y=r[i].y+f}}}),r},$J={maxIteration:1e3,focusNode:null,unitRadius:null,linkDistance:50,preventOverlap:!1,strictRadial:!0,maxPreventOverlapIteration:200,sortStrength:10};class YJ{constructor(e={}){this.options=e,this.id="radial",this.options=Object.assign(Object.assign({},$J),e)}execute(e,t){return et(this,void 0,void 0,function*(){return this.genericRadialLayout(!1,e,t)})}assign(e,t){return et(this,void 0,void 0,function*(){yield this.genericRadialLayout(!0,e,t)})}genericRadialLayout(e,t,n){return et(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),n),{width:a,height:s,center:o,focusNode:A,unitRadius:l,nodeSize:c,nodeSpacing:u,strictRadial:h,preventOverlap:d,maxPreventOverlapIteration:f,sortBy:g,linkDistance:p=50,sortStrength:v=10,maxIteration:y=1e3}=i,m=t.getAllNodes(),B=t.getAllEdges(),C=!a&&typeof window<"u"?window.innerWidth:a,S=!s&&typeof window<"u"?window.innerHeight:s,F=o||[C/2,S/2];if(!m?.length||m.length===1)return Ys(t,e,F);let T=m[0];if(ot(A)){for(let oe=0;oe<m.length;oe++)if(m[oe].id===A){T=m[oe];break}}else T=A||m[0];const O=JJ(m,T.id),I=CT({nodes:m,edges:B}),k=xT(I),N=tee(k,O);eee(k,O,N+1);const U=k[O];let D=C-F[0]>F[0]?F[0]:C-F[0],G=S-F[1]>F[1]?F[1]:S-F[1];D===0&&(D=C/2),G===0&&(G=S/2);const Z=Math.min(D,G),q=Math.max(...U),j=[],te=l||Z/q;U.forEach((oe,Ee)=>{j[Ee]=oe*te});const ue=XJ(m,k,p,j,te,g,v),ge=ZJ(ue),Y=KJ(p,ue,p);let xe=Y.map(([oe,Ee])=>({x:(isNaN(oe)?Math.random()*p:oe)-Y[O][0],y:(isNaN(Ee)?Math.random()*p:Ee)-Y[O][1]}));this.run(y,xe,ge,ue,j,O);let $;if(d){$=Uv(c,u);const oe={nodes:m,nodeSizeFunc:$,positions:xe,radii:j,height:S,width:C,strictRadial:!!h,focusIdx:O,iterations:f||200,k:xe.length/4.5};xe=jJ(t,oe)}const K=[];return xe.forEach((oe,Ee)=>{const Le=Kr(m[Ee]);Le.data.x=oe.x+F[0],Le.data.y=oe.y+F[1],K.push(Le)}),e&&K.forEach(oe=>t.mergeNodeData(oe.id,{x:oe.data.x,y:oe.data.y})),{nodes:K,edges:B}})}run(e,t,n,i,a,s){for(let o=0;o<=e;o++){const A=o/e;this.oneIteration(A,t,a,i,n,s)}}oneIteration(e,t,n,i,a,s){const o=1-e;t.forEach((A,l)=>{const c=ST(A,{x:0,y:0}),u=c===0?0:1/c;if(l===s)return;let h=0,d=0,f=0;t.forEach((p,v)=>{if(l===v)return;const y=ST(A,p),m=y===0?0:1/y,B=i[v][l];f+=a[l][v],h+=a[l][v]*(p.x+B*(A.x-p.x)*m),d+=a[l][v]*(p.y+B*(A.y-p.y)*m)});const g=n[l]===0?0:1/n[l];f*=o,f+=e*g*g,h*=o,h+=e*g*A.x*u,A.x=h/f,d*=o,d+=e*g*A.y*u,A.y=d/f})}}const XJ=(r,e,t,n,i,a,s)=>{if(!r)return[];const o=[];if(e){const A={};e.forEach((l,c)=>{const u=[];l.forEach((h,d)=>{var f,g;if(c===d)u.push(0);else if(n[c]===n[d])if(a==="data")u.push(h*(Math.abs(c-d)*s)/(n[c]/i));else if(a){let p,v;if(A[r[c].id])p=A[r[c].id];else{const y=(a==="id"?r[c].id:(f=r[c].data)===null||f===void 0?void 0:f[a])||0;ot(y)?p=y.charCodeAt(0):p=y,A[r[c].id]=p}if(A[r[d].id])v=A[r[d].id];else{const y=(a==="id"?r[d].id:(g=r[d].data)===null||g===void 0?void 0:g[a])||0;ot(y)?v=y.charCodeAt(0):v=y,A[r[d].id]=v}u.push(h*(Math.abs(p-v)*s)/(n[c]/i))}else u.push(h*t/(n[c]/i));else{const p=(t+i)/2;u.push(h*p)}}),o.push(u)})}return o},ZJ=r=>{const e=r.length,t=r[0].length,n=[];for(let i=0;i<e;i++){const a=[];for(let s=0;s<t;s++)r[i][s]!==0?a.push(1/(r[i][s]*r[i][s])):a.push(0);n.push(a)}return n},JJ=(r,e)=>{let t=-1;return r.forEach((n,i)=>{n.id===e&&(t=i)}),Math.max(t,0)},eee=(r,e,t)=>{const n=r.length;for(let i=0;i<n;i++)if(r[e][i]===1/0){r[e][i]=t,r[i][e]=t;for(let a=0;a<n;a++)r[i][a]!==1/0&&r[e][a]===1/0&&(r[e][a]=t+r[i][a],r[a][e]=t+r[i][a])}for(let i=0;i<n;i++)if(i!==e){for(let a=0;a<n;a++)if(r[i][a]===1/0){let s=Math.abs(r[e][i]-r[e][a]);s=s===0?1:s,r[i][a]=s}}},tee=(r,e)=>{let t=0;for(let n=0;n<r[e].length;n++)r[e][n]!==1/0&&(t=r[e][n]>t?r[e][n]:t);return t},nee={center:[0,0],width:300,height:300};class ree{constructor(e={}){this.options=e,this.id="random",this.options=Object.assign(Object.assign({},nee),e)}execute(e,t){return et(this,void 0,void 0,function*(){return this.genericRandomLayout(!1,e,t)})}assign(e,t){return et(this,void 0,void 0,function*(){yield this.genericRandomLayout(!0,e,t)})}genericRandomLayout(e,t,n){return et(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),n),{center:a,width:s,height:o}=i,A=t.getAllNodes(),l=.9,c=!s&&typeof window<"u"?window.innerWidth:s,u=!o&&typeof window<"u"?window.innerHeight:o,h=a||[c/2,u/2],d=[];return A&&A.forEach(g=>{d.push({id:g.id,data:{x:(Math.random()-.5)*l*c+h[0],y:(Math.random()-.5)*l*u+h[1]}})}),e&&d.forEach(g=>t.mergeNodeData(g.id,{x:g.data.x,y:g.data.y})),{nodes:d,edges:t.getAllEdges()}})}}const mL=Symbol("Comlink.proxy"),iee=Symbol("Comlink.endpoint"),wL=Symbol("Comlink.releaseProxy"),MB=Symbol("Comlink.finalizer"),bd=Symbol("Comlink.thrown"),BL=r=>typeof r=="object"&&r!==null||typeof r=="function",aee={canHandle:r=>BL(r)&&r[mL],serialize(r){const{port1:e,port2:t}=new MessageChannel;return EL(r,e),[t,[t]]},deserialize(r){return r.start(),CL(r)}},see={canHandle:r=>BL(r)&&bd in r,serialize({value:r}){let e;return r instanceof Error?e={isError:!0,value:{message:r.message,name:r.name,stack:r.stack}}:e={isError:!1,value:r},[e,[]]},deserialize(r){throw r.isError?Object.assign(new Error(r.value.message),r.value):r.value}},bL=new Map([["proxy",aee],["throw",see]]);function oee(r,e){for(const t of r)if(e===t||t==="*"||t instanceof RegExp&&t.test(e))return!0;return!1}function EL(r,e=globalThis,t=["*"]){e.addEventListener("message",function n(i){if(!i||!i.data)return;if(!oee(t,i.origin)){console.warn(`Invalid origin '${i.origin}' for comlink proxy`);return}const{id:a,type:s,path:o}=Object.assign({path:[]},i.data),A=(i.data.argumentList||[]).map(no);let l;try{const c=o.slice(0,-1).reduce((h,d)=>h[d],r),u=o.reduce((h,d)=>h[d],r);switch(s){case"GET":l=u;break;case"SET":c[o.slice(-1)[0]]=no(i.data.value),l=!0;break;case"APPLY":l=u.apply(c,A);break;case"CONSTRUCT":{const h=new u(...A);l=dee(h)}break;case"ENDPOINT":{const{port1:h,port2:d}=new MessageChannel;EL(r,d),l=hee(h,[h])}break;case"RELEASE":l=void 0;break;default:return}}catch(c){l={value:c,[bd]:0}}Promise.resolve(l).catch(c=>({value:c,[bd]:0})).then(c=>{const[u,h]=Sd(c);e.postMessage(Object.assign(Object.assign({},u),{id:a}),h),s==="RELEASE"&&(e.removeEventListener("message",n),xL(e),MB in r&&typeof r[MB]=="function"&&r[MB]())}).catch(c=>{const[u,h]=Sd({value:new TypeError("Unserializable return value"),[bd]:0});e.postMessage(Object.assign(Object.assign({},u),{id:a}),h)})}),e.start&&e.start()}function Aee(r){return r.constructor.name==="MessagePort"}function xL(r){Aee(r)&&r.close()}function CL(r,e){const t=new Map;return r.addEventListener("message",function(i){const{data:a}=i;if(!a||!a.id)return;const s=t.get(a.id);if(s)try{s(a)}finally{t.delete(a.id)}}),OB(r,t,[],e)}function Ed(r){if(r)throw new Error("Proxy has been released and is not useable")}function SL(r){return tA(r,new Map,{type:"RELEASE"}).then(()=>{xL(r)})}const xd=new WeakMap,Cd="FinalizationRegistry"in globalThis&&new FinalizationRegistry(r=>{const e=(xd.get(r)||0)-1;xd.set(r,e),e===0&&SL(r)});function lee(r,e){const t=(xd.get(e)||0)+1;xd.set(e,t),Cd&&Cd.register(r,e,r)}function cee(r){Cd&&Cd.unregister(r)}function OB(r,e,t=[],n=function(){}){let i=!1;const a=new Proxy(n,{get(s,o){if(Ed(i),o===wL)return()=>{cee(a),SL(r),e.clear(),i=!0};if(o==="then"){if(t.length===0)return{then:()=>a};const A=tA(r,e,{type:"GET",path:t.map(l=>l.toString())}).then(no);return A.then.bind(A)}return OB(r,e,[...t,o])},set(s,o,A){Ed(i);const[l,c]=Sd(A);return tA(r,e,{type:"SET",path:[...t,o].map(u=>u.toString()),value:l},c).then(no)},apply(s,o,A){Ed(i);const l=t[t.length-1];if(l===iee)return tA(r,e,{type:"ENDPOINT"}).then(no);if(l==="bind")return OB(r,e,t.slice(0,-1));const[c,u]=FL(A);return tA(r,e,{type:"APPLY",path:t.map(h=>h.toString()),argumentList:c},u).then(no)},construct(s,o){Ed(i);const[A,l]=FL(o);return tA(r,e,{type:"CONSTRUCT",path:t.map(c=>c.toString()),argumentList:A},l).then(no)}});return lee(a,r),a}function uee(r){return Array.prototype.concat.apply([],r)}function FL(r){const e=r.map(Sd);return[e.map(t=>t[0]),uee(e.map(t=>t[1]))]}const TL=new WeakMap;function hee(r,e){return TL.set(r,e),r}function dee(r){return Object.assign(r,{[mL]:!0})}function Sd(r){for(const[e,t]of bL)if(t.canHandle(r)){const[n,i]=t.serialize(r);return[{type:"HANDLER",name:e,value:n},i]}return[{type:"RAW",value:r},TL.get(r)||[]]}function no(r){switch(r.type){case"HANDLER":return bL.get(r.name).deserialize(r.value);case"RAW":return r.value}}function tA(r,e,t,n){return new Promise(i=>{const a=fee();e.set(a,i),r.start&&r.start(),r.postMessage(Object.assign({id:a},t),n)})}function fee(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}class gee extends Qh{constructor(e,t,n){super(),this.graph=e,this.layout=t,this.options=n,this.spawnWorker()}spawnWorker(){this.proxy=CL(new Worker(new URL("/assets/worker-DEQoElfg.js",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Nf&&Nf.tagName.toUpperCase()==="SCRIPT"&&Nf.src||new URL("irr-gh.umd.cjs",document.baseURI).href),{type:"module"})),this.running&&(this.running=!1,this.execute())}execute(){var e;return et(this,void 0,void 0,function*(){if(this.running)return this;this.running=!0;const t=this.layout.options,{onTick:n}=t,i=Pt(t,["onTick"]),a={};Object.keys(i).forEach(l=>{Te(i[l])||(a[l]=i[l])});const s={layout:{id:this.layout.id,options:a,iterations:(e=this.options)===null||e===void 0?void 0:e.iterations},nodes:this.graph.getAllNodes(),edges:this.graph.getAllEdges()},o=new Float32Array([0]),[A]=yield this.proxy.calculateLayout(s,[o]);return A})}stop(){return this.running=!1,this.proxy.stopLayout(),this}kill(){this.proxy[wL]()}isRunning(){return this.running}}var pee=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{l(n.next(c))}catch(u){s(u)}}function A(c){try{l(n.throw(c))}catch(u){s(u)}}function l(c){c.done?a(c.value):i(c.value).then(o,A)}l((n=n.apply(r,e||[])).next())})};class Fd extends Ph{constructor(){super(...arguments),this.id="fishbone"}getRoot(){const e=this.context.model.getRootsData();if(!(Ui(e)||e.length>2))return e[0]}formatSize(e){const t=typeof e=="function"?e:()=>e;return n=>Gr(t(n))}doLayout(e,t){const{hGap:n,getRibSep:i,vGap:a,nodeSize:s,height:o}=t,{model:A}=this.context,l=this.formatSize(s);let c=l(e)[0]+i(e);const u=(m,B=0)=>{var C;return B+=n*((m.children||[]).length+1),(C=m.children)===null||C===void 0||C.forEach(S=>{var F;(F=A.getNodeLikeDatum(S).children)===null||F===void 0||F.forEach(O=>{const I=A.getNodeLikeDatum(O);B=u(I,B)})}),B},h=m=>{if(m.depth===1)return c;const B=A.getParentData(m.id,"tree");if(nA(m)){const C=A.getParentData(B.id,"tree"),S=g(m)-g(C);return h(B)+S*n/a}else{const C=(B.children||[]).indexOf(m.id),S=A.getNodeData((B.children||[]).slice(C));return d(B)-S.reduce((F,T)=>F+u(T),0)-l(B)[0]/2}},d=$f(m=>{if(IB(m))return l(m)[0]/2;const B=A.getParentData(m.id,"tree");if(nA(m))return h(m)+u(m)+l(m)[0]/2;{const C=g(m)-g(B),S=n/a;return h(m)+C*S}},m=>m.id),f=m=>g(A.getParentData(m,"tree")),g=$f(m=>{if(IB(m))return o/2;if(nA(m)){const B=A.getParentData(m.id,"tree"),C=B.children.indexOf(m.id);if(C===0)return f(B.id)+a;const S=A.getNodeLikeDatum(B.children[C-1]);if(Ui(S.children))return g(S)+a;const F=A.getDescendantsData(S.id);return Math.max(...F.map(T=>nA(T)?f(T.id):g(T)))+a}else{if(Ui(m.children))return f(m.id)+a;const B=A.getNodeLikeDatum(m.children.slice(-1)[0]);if(Ui(B.children))return g(B)+a;const C=A.getDescendantsData(m.id).slice(-1)[0];return(nA(C)?f(C.id):g(C))+a}},m=>m.id);let p=0;const v={nodes:[],edges:[]},y=m=>{var B;(B=m.children)===null||B===void 0||B.forEach(O=>y(A.getNodeLikeDatum(O)));const C=g(m),S=d(m);if(v.nodes.push({id:m.id,x:S,y:C}),IB(m))return;const F=A.getRelatedEdgesData(m.id,"in")[0],T=[h(m),nA(m)?C:f(m.id)];v.edges.push({id:X(F),controlPoints:[T],relatedNodeId:m.id}),p=Math.max(p,S+i(m)),m.depth===1&&(c=p)};return y(e),v}placeAlterative(e,t){const n=(t.children||[]).filter((o,A)=>A%2!==0);if(n.length===0)return e;const{model:i}=this.context,a=e.nodes.find(o=>o.id===t.id).y,s=o=>{const A=i.getAncestorsData(o,"tree");if(Ui(A))return!1;const l=A.length===1?o:A[A.length-2].id;return n.includes(l)};e.nodes.forEach(o=>{s(o.id)&&(o.y=2*a-o.y)}),e.edges.forEach(o=>{s(o.relatedNodeId)&&(o.controlPoints=o.controlPoints.map(A=>[A[0],2*a-A[1]]))})}rightToLeft(e,t){return e.nodes.forEach(n=>n.x=t.width-n.x),e.edges.forEach(n=>{n.controlPoints=n.controlPoints.map(i=>[t.width-i[0],i[1]])}),e}execute(e,t){return pee(this,void 0,void 0,function*(){const n=Object.assign(Object.assign(Object.assign({},Fd.defaultOptions),this.options),t),{direction:i,nodeSize:a}=n,s=this.getRoot();if(!s)return e;const o=this.formatSize(a);n.vGap||(n.vGap=Math.max(...(e.nodes||[]).map(h=>o(h)[1]))),n.hGap||(n.hGap=Math.max(...(e.nodes||[]).map(h=>o(h)[0])));let A=this.doLayout(s,n);this.placeAlterative(A,s),i==="RL"&&(A=this.rightToLeft(A,n));const{model:l}=this.context,c=[],u=[];return A.nodes.forEach(h=>{const{id:d,x:f,y:g}=h,p=l.getNodeLikeDatum(d);c.push(ML(p,{x:f,y:g}))}),A.edges.forEach(h=>{const{id:d,controlPoints:f}=h,g=l.getEdgeDatum(d);u.push(ML(g,{controlPoints:f}))}),{nodes:c,edges:u}})}}Fd.defaultOptions={direction:"RL",getRibSep:()=>60};const ML=(r,e)=>Object.assign(Object.assign({},r),{style:Object.assign(Object.assign({},r.style||{}),e)}),IB=r=>r.depth===0,nA=r=>(r.depth||(r.depth=0))%2===0;var vee=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{l(n.next(c))}catch(u){s(u)}}function A(c){try{l(n.throw(c))}catch(u){s(u)}}function l(c){c.done?a(c.value):i(c.value).then(o,A)}l((n=n.apply(r,e||[])).next())})};class Td extends Ph{constructor(){super(...arguments),this.id="snake"}formatSize(e,t){const n=typeof t=="function"?t:(()=>t);return e.reduce((i,a)=>{const[s,o]=Gr(n(a))||[0,0];return[Math.max(i[0],s),Math.max(i[1],o)]},[0,0])}validate(e){const{nodes:t=[],edges:n=[]}=e,i={},a={},s={};t.forEach(h=>{i[h.id]=0,a[h.id]=0,s[h.id]=[]}),n.forEach(h=>{i[h.target]++,a[h.source]++,s[h.source].push(h.target)});const o=new Set,A=h=>{o.has(h)||(o.add(h),s[h].forEach(A))};if(A(t[0].id),o.size!==t.length)return!1;const l=t.filter(h=>i[h.id]===0),c=t.filter(h=>a[h.id]===0);return!(l.length!==1||c.length!==1||t.filter(h=>i[h.id]===1&&a[h.id]===1).length!==t.length-2)}execute(e,t){return vee(this,void 0,void 0,function*(){var n;if(!this.validate(e))return e;const{nodeSize:i,padding:a,sortBy:s,cols:o,colGap:A,rowGap:l,clockwise:c,width:u,height:h}=Object.assign({},Td.defaultOptions,this.options,t),[d,f,g,p]=si(a),v=this.formatSize(e.nodes||[],i),y=Math.ceil((e.nodes||[]).length/o);let m=A||(u-p-f-o*v[0])/(o-1),B=l||(h-d-g-y*v[1])/(y-1);return(B===1/0||B<0)&&(B=0),(m===1/0||m<0)&&(m=0),{nodes:((s?(n=e.nodes)===null||n===void 0?void 0:n.sort(s):yee(e))||[]).map((F,T)=>{const O=Math.floor(T/o),I=T%o,k=c?O%2===0?I:o-1-I:O%2===0?o-1-I:I,N=p+k*(v[0]+m)+v[0]/2,U=d+O*(v[1]+B)+v[1]/2;return{id:F.id,style:{x:N,y:U}}})}})}}Td.defaultOptions={padding:0,cols:5,clockwise:!0};function yee(r){const{nodes:e=[],edges:t=[]}=r,n={},i={};e.forEach(o=>{n[o.id]=0,i[o.id]=[]}),t.forEach(o=>{n[o.target]++,i[o.source].push(o.target)});const a=[],s=[];for(e.forEach(o=>{n[o.id]===0&&a.push(o.id)});a.length>0;){const o=a.shift(),A=e.find(l=>l.id===o);s.push(A),i[o].forEach(l=>{n[l]--,n[l]===0&&a.push(l)})}return s}const mee=["rgb(158, 1, 66)","rgb(213, 62, 79)","rgb(244, 109, 67)","rgb(253, 174, 97)","rgb(254, 224, 139)","rgb(255, 255, 191)","rgb(230, 245, 152)","rgb(171, 221, 164)","rgb(102, 194, 165)","rgb(50, 136, 189)","rgb(94, 79, 162)"],wee=["rgb(78, 121, 167)","rgb(242, 142, 44)","rgb(225, 87, 89)","rgb(118, 183, 178)","rgb(89, 161, 79)","rgb(237, 201, 73)","rgb(175, 122, 161)","rgb(255, 157, 167)","rgb(156, 117, 95)","rgb(186, 176, 171)"],Bee=["rgb(255, 245, 235)","rgb(254, 230, 206)","rgb(253, 208, 162)","rgb(253, 174, 107)","rgb(253, 141, 60)","rgb(241, 105, 19)","rgb(217, 72, 1)","rgb(166, 54, 3)","rgb(127, 39, 4)"],bee=["rgb(247, 252, 245)","rgb(229, 245, 224)","rgb(199, 233, 192)","rgb(161, 217, 155)","rgb(116, 196, 118)","rgb(65, 171, 93)","rgb(35, 139, 69)","rgb(0, 109, 44)","rgb(0, 68, 27)"],Eee=["rgb(247, 251, 255)","rgb(222, 235, 247)","rgb(198, 219, 239)","rgb(158, 202, 225)","rgb(107, 174, 214)","rgb(66, 146, 198)","rgb(33, 113, 181)","rgb(8, 81, 156)","rgb(8, 48, 107)"];class Qn extends Yp{}function rA(r,e=!0,t){const n=document.createElement("div");return n.setAttribute("class",`g6-${r}`),Object.assign(n.style,{position:"absolute",display:"block"}),e&&Object.assign(n.style,{position:"unset",gridArea:"1 / 1 / 2 / 2",inset:"0px",height:"100%",width:"100%",overflow:"hidden",pointerEvents:"none"}),t&&Object.assign(n.style,t),n}function _B(r,e="div",t={},n="",i=document.body){const a=document.getElementById(r);a&&a.remove();const s=document.createElement(e);return s.innerHTML=n,s.id=r,Object.assign(s.style,t),i.appendChild(s),s}var xee=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{l(n.next(c))}catch(u){s(u)}}function A(c){try{l(n.throw(c))}catch(u){s(u)}}function l(c){c.done?a(c.value):i(c.value).then(o,A)}l((n=n.apply(r,e||[])).next())})};class Md extends Qn{constructor(e,t){super(e,Object.assign({},Md.defaultOptions,t)),this.$element=rA("background"),this.context.canvas.getContainer().prepend(this.$element),this.update(t)}update(e){const t=Object.create(null,{update:{get:()=>super.update}});return xee(this,void 0,void 0,function*(){t.update.call(this,e),Object.assign(this.$element.style,Yf(this.options,["key","type"]))})}destroy(){super.destroy(),this.$element.remove()}}Md.defaultOptions={transition:"background 0.5s",backgroundSize:"cover",zIndex:"-1"};function kB(r,e,t,n,i,a){const s=r,o=e,A=t-s,l=n-o;let c=i-s,u=a-o,h=c*A+u*l,d=0;h<=0?d=0:(c=A-c,u=l-u,h=c*A+u*l,h<=0?d=0:d=h*h/(A*A+l*l));const f=c*c+u*u-d;return f<0?0:f}function cs(r,e,t,n){return(r-t)*(r-t)+(e-n)*(e-n)}function OL(r,e,t,n,i){return cs(r,e,t,n)<i*i}function Cee(r){if(!Number.isFinite(r))return t=>t;if(r===0)return Math.round;const e=Math.pow(10,r);return t=>Math.round(t*e)/e}function IL(r){const e=Math.min(r.x1,r.x2),t=Math.max(r.x1,r.x2),n=Math.min(r.y1,r.y2),i=Math.max(r.y1,r.y2);return{x:e,y:n,x2:t,y2:i,width:t-e,height:i-n}}class Un{constructor(e,t,n,i){this.x1=e,this.y1=t,this.x2=n,this.y2=i}equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2}draw(e){e.moveTo(this.x1,this.y1),e.lineTo(this.x2,this.y2)}toString(){return`Line(from=(${this.x1},${this.y1}),to=(${this.x2},${this.y2}))`}static from(e){return new Un(e.x1,e.y1,e.x2,e.y2)}cuts(e,t){if(this.y1===this.y2||t<this.y1&&t<=this.y2||t>this.y1&&t>=this.y2||e>this.x1&&e>=this.x2)return!1;if(e<this.x1&&e<=this.x2)return!0;const n=this.x1+(t-this.y1)*(this.x2-this.x1)/(this.y2-this.y1);return e<=n}distSquare(e,t){return kB(this.x1,this.y1,this.x2,this.y2,e,t)}ptClose(e,t,n){if(this.x1<this.x2){if(e<this.x1-n||e>this.x2+n)return!1}else if(e<this.x2-n||e>this.x1+n)return!1;if(this.y1<this.y2){if(t<this.y1-n||t>this.y2+n)return!1}else if(t<this.y2-n||t>this.y1+n)return!1;return!0}}var an;(function(r){r[r.POINT=1]="POINT",r[r.PARALLEL=2]="PARALLEL",r[r.COINCIDENT=3]="COINCIDENT",r[r.NONE=4]="NONE"})(an||(an={}));class NB{constructor(e,t=0,n=0){this.state=e,this.x=t,this.y=n}}function Od(r,e){const t=(e.x2-e.x1)*(r.y1-e.y1)-(e.y2-e.y1)*(r.x1-e.x1),n=(r.x2-r.x1)*(r.y1-e.y1)-(r.y2-r.y1)*(r.x1-e.x1),i=(e.y2-e.y1)*(r.x2-r.x1)-(e.x2-e.x1)*(r.y2-r.y1);if(i){const a=t/i,s=n/i;return 0<=a&&a<=1&&0<=s&&s<=1?new NB(an.POINT,r.x1+a*(r.x2-r.x1),r.y1+a*(r.y2-r.y1)):new NB(an.NONE)}return new NB(t===0||n===0?an.COINCIDENT:an.PARALLEL)}function _L(r,e){const t=(e.x2-e.x1)*(r.y1-e.y1)-(e.y2-e.y1)*(r.x1-e.x1),n=(r.x2-r.x1)*(r.y1-e.y1)-(r.y2-r.y1)*(r.x1-e.x1),i=(e.y2-e.y1)*(r.x2-r.x1)-(e.x2-e.x1)*(r.y2-r.y1);if(i){const a=t/i,s=n/i;if(0<=a&&a<=1&&0<=s&&s<=1)return a}return Number.POSITIVE_INFINITY}function See(r,e){function t(i,a,s,o){let A=_L(e,new Un(i,a,s,o));return A=Math.abs(A-.5),A>=0&&A<=1?1:0}let n=t(r.x,r.y,r.x2,r.y);return n+=t(r.x,r.y,r.x,r.y2),n>1||(n+=t(r.x,r.y2,r.x2,r.y2),n>1)?!0:(n+=t(r.x2,r.y,r.x2,r.y2),n>0)}var sn;(function(r){r[r.LEFT=0]="LEFT",r[r.TOP=1]="TOP",r[r.RIGHT=2]="RIGHT",r[r.BOTTOM=3]="BOTTOM"})(sn||(sn={}));function Id(r,e,t){const n=new Set;return r.width<=0?(n.add(sn.LEFT),n.add(sn.RIGHT)):e<r.x?n.add(sn.LEFT):e>r.x+r.width&&n.add(sn.RIGHT),r.height<=0?(n.add(sn.TOP),n.add(sn.BOTTOM)):t<r.y?n.add(sn.TOP):t>r.y+r.height&&n.add(sn.BOTTOM),n}function kL(r,e){let t=e.x1,n=e.y1;const i=e.x2,a=e.y2,s=Array.from(Id(r,i,a));if(s.length===0)return!0;let o=Id(r,t,n);for(;o.size!==0;){for(const A of s)if(o.has(A))return!1;if(o.has(sn.RIGHT)||o.has(sn.LEFT)){let A=r.x;o.has(sn.RIGHT)&&(A+=r.width),n=n+(A-t)*(a-n)/(i-t),t=A}else{let A=r.y;o.has(sn.BOTTOM)&&(A+=r.height),t=t+(A-n)*(i-t)/(a-n),n=A}o=Id(r,t,n)}return!0}function Fee(r,e){let t=Number.POSITIVE_INFINITY,n=0;function i(a,s,o,A){let l=_L(e,new Un(a,s,o,A));l=Math.abs(l-.5),l>=0&&l<=1&&(n++,l<t&&(t=l))}return i(r.x,r.y,r.x2,r.y),i(r.x,r.y,r.x,r.y2),n>1||(i(r.x,r.y2,r.x2,r.y2),n>1)?t:(i(r.x2,r.y,r.x2,r.y2),n===0?-1:t)}function Tee(r,e){let t=0;const n=Od(r,new Un(e.x,e.y,e.x2,e.y));t+=n.state===an.POINT?1:0;const i=Od(r,new Un(e.x,e.y,e.x,e.y2));t+=i.state===an.POINT?1:0;const a=Od(r,new Un(e.x,e.y2,e.x2,e.y2));t+=a.state===an.POINT?1:0;const s=Od(r,new Un(e.x2,e.y,e.x2,e.y2));return t+=s.state===an.POINT?1:0,{top:n,left:i,bottom:a,right:s,count:t}}class ir{constructor(e,t,n,i){this.x=e,this.y=t,this.width=n,this.height=i}get x2(){return this.x+this.width}get y2(){return this.y+this.height}get cx(){return this.x+this.width/2}get cy(){return this.y+this.height/2}get radius(){return Math.max(this.width,this.height)/2}static from(e){return new ir(e.x,e.y,e.width,e.height)}equals(e){return this.x===e.x&&this.y===e.y&&this.width===e.width&&this.height===e.height}clone(){return new ir(this.x,this.y,this.width,this.height)}add(e){const t=Math.min(this.x,e.x),n=Math.min(this.y,e.y),i=Math.max(this.x2,e.x+e.width),a=Math.max(this.y2,e.y+e.height);this.x=t,this.y=n,this.width=i-t,this.height=a-n}addPoint(e){const t=Math.min(this.x,e.x),n=Math.min(this.y,e.y),i=Math.max(this.x2,e.x),a=Math.max(this.y2,e.y);this.x=t,this.y=n,this.width=i-t,this.height=a-n}toString(){return`Rectangle[x=${this.x}, y=${this.y}, w=${this.width}, h=${this.height}]`}draw(e){e.rect(this.x,this.y,this.width,this.height)}containsPt(e,t){return e>=this.x&&e<=this.x2&&t>=this.y&&t<=this.y2}get area(){return this.width*this.height}intersects(e){return this.area<=0||e.width<=0||e.height<=0?!1:e.x+e.width>this.x&&e.y+e.height>this.y&&e.x<this.x2&&e.y<this.y2}distSquare(e,t){if(this.containsPt(e,t))return 0;const n=Id(this,e,t);return n.has(sn.TOP)?n.has(sn.LEFT)?cs(e,t,this.x,this.y):n.has(sn.RIGHT)?cs(e,t,this.x2,this.y):(this.y-t)*(this.y-t):n.has(sn.BOTTOM)?n.has(sn.LEFT)?cs(e,t,this.x,this.y2):n.has(sn.RIGHT)?cs(e,t,this.x2,this.y2):(t-this.y2)*(t-this.y2):n.has(sn.LEFT)?(this.x-e)*(this.x-e):n.has(sn.RIGHT)?(e-this.x2)*(e-this.x2):0}}function Mee(r){if(r.length===0)return null;const e=r[0],t=new ir(e.x,e.y,0,0);for(const n of r)t.addPoint(n);return t}class _d{constructor(e,t,n){this.cx=e,this.cy=t,this.radius=n}get x(){return this.cx-this.radius}get x2(){return this.cx+this.radius}get width(){return this.radius*2}get y(){return this.cy-this.radius}get y2(){return this.cy+this.radius}get height(){return this.radius*2}static from(e){return new _d(e.cx,e.cy,e.radius)}containsPt(e,t){return cs(this.cx,this.cy,e,t)<this.radius*this.radius}distSquare(e,t){const n=cs(this.cx,this.cy,e,t);if(n<this.radius*this.radius)return 0;const i=Math.sqrt(n)-this.radius;return i*i}draw(e){e.ellipse(this.cx,this.cy,this.radius,this.radius,0,0,Math.PI*2)}}class ro{constructor(e,t=0,n=0,i=0,a=0,s=10,o=10,A=new Float32Array(Math.max(0,s*o)).fill(0)){this.pixelGroup=e,this.i=t,this.j=n,this.pixelX=i,this.pixelY=a,this.width=s,this.height=o,this.area=A}createSub(e,t){return new ro(this.pixelGroup,e.x,e.y,t.x,t.y,e.width,e.height)}static fromPixelRegion(e,t){return new ro(t,0,0,e.x,e.y,Math.ceil(e.width/t),Math.ceil(e.height/t))}copy(e,t){return new ro(this.pixelGroup,this.scaleX(t.x),this.scaleY(t.y),t.x,t.y,e.width,e.height,e.area)}boundX(e){return e<this.i?this.i:e>=this.width?this.width-1:e}boundY(e){return e<this.j?this.j:e>=this.height?this.height-1:e}scaleX(e){return this.boundX(Math.floor((e-this.pixelX)/this.pixelGroup))}scaleY(e){return this.boundY(Math.floor((e-this.pixelY)/this.pixelGroup))}scale(e){const t=this.scaleX(e.x),n=this.scaleY(e.y),i=this.boundX(Math.ceil((e.x+e.width-this.pixelX)/this.pixelGroup)),a=this.boundY(Math.ceil((e.y+e.height-this.pixelY)/this.pixelGroup)),s=i-t,o=a-n;return new ir(t,n,s,o)}invertScaleX(e){return Math.round(e*this.pixelGroup+this.pixelX)}invertScaleY(e){return Math.round(e*this.pixelGroup+this.pixelY)}addPadding(e,t){const n=Math.ceil(t/this.pixelGroup),i=this.boundX(e.x-n),a=this.boundY(e.y-n),s=this.boundX(e.x2+n),o=this.boundY(e.y2+n),A=s-i,l=o-a;return new ir(i,a,A,l)}get(e,t){return e<0||t<0||e>=this.width||t>=this.height?Number.NaN:this.area[e+t*this.width]}inc(e,t,n){e<0||t<0||e>=this.width||t>=this.height||(this.area[e+t*this.width]+=n)}set(e,t,n){e<0||t<0||e>=this.width||t>=this.height||(this.area[e+t*this.width]=n)}incArea(e,t){if(e.width<=0||e.height<=0||t===0)return;const n=this.width,i=e.width,a=Math.max(0,e.i),s=Math.max(0,e.j),o=Math.min(e.i+e.width,n),A=Math.min(e.j+e.height,this.height);if(!(A<=0||o<=0||a>=n||A>=this.height))for(let l=s;l<A;l++){const c=(l-e.j)*i,u=l*n;for(let h=a;h<o;h++){const d=e.area[h-e.i+c];d!==0&&(this.area[h+u]+=t*d)}}}fill(e){this.area.fill(e)}fillArea(e,t){const n=e.x+e.y*this.width;for(let i=0;i<e.height;i++){const a=n+i*this.width;this.area.fill(t,a,a+e.width)}}fillHorizontalLine(e,t,n,i){const a=e+t*this.width;this.area.fill(i,a,a+n)}fillVerticalLine(e,t,n,i){const a=e+t*this.width;for(let s=0;s<n;s++)this.area[a+s*this.width]=i}clear(){this.area.fill(0)}toString(){let e="";for(let t=0;t<this.height;t++){const n=t*this.width;for(let i=0;i<this.width;i++){const a=this.area[n+i];e+=a.toFixed(1).padStart(6),e+=" "}e+=`
14
+ `}return e}draw(e,t=!0){if(this.width<=0||this.height<=0)return;e.save(),t&&e.translate(this.pixelX,this.pixelY);const n=this.area.reduce((s,o)=>Math.min(s,o),Number.POSITIVE_INFINITY),i=this.area.reduce((s,o)=>Math.max(s,o),Number.NEGATIVE_INFINITY),a=s=>(s-n)/(i-n);e.scale(this.pixelGroup,this.pixelGroup);for(let s=0;s<this.width;s++)for(let o=0;o<this.height;o++){const A=this.area[s+o*this.width];e.fillStyle=`rgba(0, 0, 0, ${a(A)})`,e.fillRect(s,o,1,1)}e.restore()}drawThreshold(e,t,n=!0){if(!(this.width<=0||this.height<=0)){e.save(),n&&e.translate(this.pixelX,this.pixelY),e.scale(this.pixelGroup,this.pixelGroup);for(let i=0;i<this.width;i++)for(let a=0;a<this.height;a++){const s=this.area[i+a*this.width];e.fillStyle=s>t?"black":"white",e.fillRect(i,a,1,1)}e.restore()}}}function NL(r,e){const t=n=>({x:n.x-e,y:n.y-e,width:n.width+2*e,height:n.height+2*e});return Array.isArray(r)?r.map(t):t(r)}function LL(r,e,t){return QL(Object.assign(IL(r),{distSquare:(n,i)=>kB(r.x1,r.y1,r.x2,r.y2,n,i)}),e,t)}function QL(r,e,t){const n=NL(r,t),i=e.scale(n),a=e.createSub(i,n);return Oee(a,e,t,(s,o)=>r.distSquare(s,o)),a}function Oee(r,e,t,n){const i=t*t;for(let a=0;a<r.height;a++)for(let s=0;s<r.width;s++){const o=e.invertScaleX(r.i+s),A=e.invertScaleY(r.j+a),l=n(o,A);if(l===0){r.set(s,a,i);continue}if(l<i){const c=t-Math.sqrt(l);r.set(s,a,c*c)}}return r}function Iee(r,e,t){const n=e.scale(r),i=e.addPadding(n,t),a=e.createSub(i,{x:r.x-t,y:r.y-t}),s=n.x-i.x,o=n.y-i.y,A=i.x2-n.x2,l=i.y2-n.y2,c=i.width-s-A,u=i.height-o-l,h=t*t;a.fillArea({x:s,y:o,width:c+1,height:u+1},h);const d=[0],f=Math.max(o,s,A,l);{const y=e.invertScaleX(n.x+n.width/2);for(let m=1;m<f;m++){const B=e.invertScaleY(n.y-m),C=r.distSquare(y,B);if(C<h){const S=t-Math.sqrt(C);d.push(S*S)}else break}}const g=[],p=Math.max(s,A),v=Math.max(o,A);for(let y=1;y<p;y++){const m=e.invertScaleX(n.x-y),B=[];for(let C=1;C<v;C++){const S=e.invertScaleY(n.y-C),F=r.distSquare(m,S);if(F<h){const T=t-Math.sqrt(F);B.push(T*T)}else B.push(0)}g.push(B)}for(let y=1;y<Math.min(o,d.length);y++){const m=d[y];a.fillHorizontalLine(s,o-y,c+1,m)}for(let y=1;y<Math.min(l,d.length);y++){const m=d[y];a.fillHorizontalLine(s,o+u+y,c+1,m)}for(let y=1;y<Math.min(s,d.length);y++){const m=d[y];a.fillVerticalLine(s-y,o,u+1,m)}for(let y=1;y<Math.min(l,d.length);y++){const m=d[y];a.fillVerticalLine(s+c+y,o,u+1,m)}for(let y=1;y<s;y++){const m=g[y-1],B=s-y;for(let C=1;C<o;C++)a.set(B,o-C,m[C-1]);for(let C=1;C<l;C++)a.set(B,o+u+C,m[C-1])}for(let y=1;y<A;y++){const m=g[y-1],B=s+c+y;for(let C=1;C<o;C++)a.set(B,o-C,m[C-1]);for(let C=1;C<l;C++)a.set(B,o+u+C,m[C-1])}return a}function Ht(r,e){return{x:r,y:e}}function _ee(r,e,t,n){if(r.length===0)return[];const i=Uee(r);return i.map((a,s)=>{const o=i.slice(0,s);return kee(e,a,o,t,n)}).flat()}function kee(r,e,t,n,i){const a=Ht(e.cx,e.cy),s=Qee(a,t,r);if(s==null)return[];const o=new Un(a.x,a.y,s.cx,s.cy),A=Nee(o,r,n,i);return Lee(A,r)}function Nee(r,e,t,n){const i=[],a=[];a.push(r);let s=!0;for(let o=0;o<t&&s;o++)for(s=!1;!s&&a.length>0;){const A=a.pop(),l=UL(e,A),c=l?Tee(A,l):null;if(!l||!c||c.count!==2){s||i.push(A);continue}let u=n,h=Nd(l,u,c,!0),d=us(h,a)||us(h,i),f=kd(h,e);for(;!d&&f&&u>=1;)u/=1.5,h=Nd(l,u,c,!0),d=us(h,a)||us(h,i),f=kd(h,e);if(h&&!d&&!f&&(a.push(new Un(A.x1,A.y1,h.x,h.y)),a.push(new Un(h.x,h.y,A.x2,A.y2)),s=!0),s)continue;u=n,h=Nd(l,u,c,!1);let g=us(h,a)||us(h,i);for(f=kd(h,e);!g&&f&&u>=1;)u/=1.5,h=Nd(l,u,c,!1),g=us(h,a)||us(h,i),f=kd(h,e);h&&!g&&(a.push(new Un(A.x1,A.y1,h.x,h.y)),a.push(new Un(h.x,h.y,A.x2,A.y2)),s=!0),s||i.push(A)}for(;a.length>0;)i.push(a.pop());return i}function Lee(r,e){const t=[];for(;r.length>0;){const n=r.pop();if(r.length===0){t.push(n);break}const i=r.pop(),a=new Un(n.x1,n.y1,i.x2,i.y2);UL(e,a)?(t.push(n),r.push(i)):r.push(a)}return t}function Qee(r,e,t){let n=Number.POSITIVE_INFINITY;return e.reduce((i,a)=>{const s=cs(r.x,r.y,a.cx,a.cy);if(s>n)return i;const o=new Un(r.x,r.y,a.cx,a.cy),A=Pee(t,o);return s*(A+1)*(A+1)<n&&(i=a,n=s*(A+1)*(A+1)),i},null)}function Uee(r){if(r.length<2)return r;let e=0,t=0;return r.forEach(n=>{e+=n.cx,t+=n.cy}),e/=r.length,t/=r.length,r.map(n=>{const i=e-n.cx,a=t-n.cy,s=i*i+a*a;return[n,s]}).sort((n,i)=>n[1]-i[1]).map(n=>n[0])}function kd(r,e){return e.some(t=>t.containsPt(r.x,r.y))}function us(r,e){return e.some(t=>!!(OL(t.x1,t.y1,r.x,r.y,.001)||OL(t.x2,t.y2,r.x,r.y,.001)))}function UL(r,e){let t=Number.POSITIVE_INFINITY,n=null;for(const i of r){if(!kL(i,e))continue;const a=Fee(i,e);a>=0&&a<t&&(n=i,t=a)}return n}function Pee(r,e){return r.reduce((t,n)=>kL(n,e)&&See(n,e)?t+1:t,0)}function Nd(r,e,t,n){const i=t.top,a=t.left,s=t.bottom,o=t.right;if(n){if(a.state===an.POINT){if(i.state===an.POINT)return Ht(r.x-e,r.y-e);if(s.state===an.POINT)return Ht(r.x-e,r.y2+e);const h=r.width*r.height;return r.width*((a.y-r.y+(o.y-r.y))*.5)<h*.5?a.y>o.y?Ht(r.x-e,r.y-e):Ht(r.x2+e,r.y-e):a.y<o.y?Ht(r.x-e,r.y2+e):Ht(r.x2+e,r.y2+e)}if(o.state===an.POINT){if(i.state===an.POINT)return Ht(r.x2+e,r.y-e);if(s.state===an.POINT)return Ht(r.x2+e,r.y2+e)}const c=r.height*r.width;return r.height*((i.x-r.x+(o.x-r.x))*.5)<c*.5?i.x>s.x?Ht(r.x-e,r.y-e):Ht(r.x-e,r.y2+e):i.x<s.x?Ht(r.x2+e,r.y-e):Ht(r.x2+e,r.y2+e)}if(a.state===an.POINT){if(i.state===an.POINT)return Ht(r.x2+e,r.y2+e);if(s.state===an.POINT)return Ht(r.x2+e,r.y-e);const c=r.height*r.width;return r.width*((a.y-r.y+(o.y-r.y))*.5)<c*.5?a.y>o.y?Ht(r.x2+e,r.y2+e):Ht(r.x-e,r.y2+e):a.y<o.y?Ht(r.x2+e,r.y-e):Ht(r.x-e,r.y-e)}if(o.state===an.POINT){if(i.state===an.POINT)return Ht(r.x-e,r.y2+e);if(s.state===an.POINT)return Ht(r.x-e,r.y-e)}const A=r.height*r.width;return r.height*((i.x-r.x+(o.x-r.x))*.5)<A*.5?i.x>s.x?Ht(r.x2+e,r.y2+e):Ht(r.x2+e,r.y-e):i.x<s.x?Ht(r.x-e,r.y2+e):Ht(r.x-e,r.y-e)}function Ree(r,e,t,n){if(!(r.closed?t<r.length:t<r.length-1))return!1;const a=r.get(e),s=r.get(t+1);for(let o=e+1;o<=t;o++){const A=r.get(o);if(kB(a.x,a.y,s.x,s.y,A.x,A.y)>n)return!1}return!0}function Dee(r=0){return e=>{if(r<0||e.length<3)return e;const t=[];let n=0;const i=r*r;for(;n<e.length;){let a=n+1;for(;Ree(e,n,a,i);)a++;t.push(e.get(n)),n=a}return new iA(t)}}function Hee(r,e){switch(r){case-2:return(((-e+3)*e-3)*e+1)/6;case-1:return((3*e-6)*e*e+4)/6;case 0:return(((-3*e+3)*e+3)*e+1)/6;case 1:return e*e*e/6;default:throw new Error("unknown error")}}function Gee(r=6){function a(s,o,A){let l=0,c=0;for(let u=-2;u<=1;u++){const h=s.get(o+u),d=Hee(u,A);l+=d*h.x,c+=d*h.y}return{x:l,y:c}}return s=>{if(s.length<3)return s;const o=[],A=s.closed,l=s.length+3-1+(A?0:2);o.push(a(s,2-(A?0:2),0));for(let c=2-(A?0:2);c<l;c++)for(let u=1;u<=r;u++)o.push(a(s,c,u/r));return new iA(o)}}function Kee(r=8){return e=>{let t=r,n=e.length;if(t>1)for(n=Math.floor(e.length/t);n<3&&t>1;)t-=1,n=Math.floor(e.length/t);const i=[];for(let a=0,s=0;s<n;s++,a+=t)i.push(e.get(a));return new iA(i)}}class iA{constructor(e=[],t=!0){this.points=e,this.closed=t}get(e){const t=e,n=this.points.length;return e<0?this.closed?this.get(e+n):this.points[0]:e>=n?this.closed?this.get(e-n):this.points[n-1]:this.points[t]}get length(){return this.points.length}toString(e=1/0){const t=this.points;if(t.length===0)return"";const n=typeof e=="function"?e:Cee(e);let i="M";for(const a of t)i+=`${n(a.x)},${n(a.y)} L`;return i=i.slice(0,-1),this.closed&&(i+=" Z"),i}draw(e){const t=this.points;if(t.length!==0){e.beginPath(),e.moveTo(t[0].x,t[0].y);for(const n of t)e.lineTo(n.x,n.y);this.closed&&e.closePath()}}sample(e){return Kee(e)(this)}simplify(e){return Dee(e)(this)}bSplines(e){return Gee(e)(this)}apply(e){return e(this)}containsElements(e){const t=Mee(this.points);return t?e.every(n=>t.containsPt(n.cx,n.cy)&&this.withinArea(n.cx,n.cy)):!1}withinArea(e,t){if(this.length===0)return!1;let n=0;const i=this.points[0],a=new Un(i.x,i.y,i.x,i.y);for(let s=1;s<this.points.length;s++){const o=this.points[s];a.x1=a.x2,a.y1=a.y2,a.x2=o.x,a.y2=o.y,a.cuts(e,t)&&n++}return a.x1=a.x2,a.y1=a.y2,a.x2=i.x,a.y2=i.y,a.cuts(e,t)&&n++,n%2===1}}class zee{constructor(e=0){this.count=0,this.arr=[],this.set=new Set,this.arr.length=e}add(e){this.set.add(`${e.x}x${e.y}`),this.arr[this.count++]=e}contains(e){return this.set.has(`${e.x}x${e.y}`)}isFirst(e){if(this.count===0)return!1;const t=this.arr[0];return t!=null&&t.x===e.x&&t.y===e.y}path(){return new iA(this.arr.slice(0,this.count))}clear(){this.set.clear(),this.count=0}get(e){return this.arr[e]}get length(){return this.count}}const Hl=0,Ld=1,Qd=2,LB=3;function Vee(r,e){const t=(Math.floor(r.width)+Math.floor(r.height))*2,n=new zee(t);function i(A,l,c,u){const h=r.get(A,l);return Number.isNaN(h)?Number.NaN:h>e?c+u:c}function a(A,l){let c=Hl;return c=i(A,l,c,1),c=i(A+1,l,c,2),c=i(A,l+1,c,4),c=i(A+1,l+1,c,8),Number.isNaN(c)?-1:c}let s=Ld;function o(A,l){let c=A,u=l,h=r.invertScaleX(c),d=r.invertScaleY(u);for(let f=0;f<r.width*r.height;f++){const g={x:h,y:d};if(n.contains(g)){if(n.isFirst(g))return!0}else n.add(g);const p=a(c,u);switch(p){case-1:return!0;case 0:case 3:case 2:case 7:s=Qd;break;case 12:case 14:case 4:s=LB;break;case 6:s=s===Hl?LB:Qd;break;case 1:case 13:case 5:s=Hl;break;case 9:s=s===Qd?Hl:Ld;break;case 10:case 8:case 11:s=Ld;break;default:return console.warn("Marching squares invalid state: "+p),!0}switch(s){case Hl:u--,d-=r.pixelGroup;break;case Ld:u++,d+=r.pixelGroup;break;case LB:c--,h-=r.pixelGroup;break;case Qd:c++,h+=r.pixelGroup;break;default:return console.warn("Marching squares invalid state: "+p),!0}}return!0}for(let A=0;A<r.width;A++)for(let l=0;l<r.height;l++){if(r.get(A,l)<=e)continue;const c=a(A,l);if(!(c<0||c===15)&&o(A,l))return n.path()}return null}const Ud={maxRoutingIterations:100,maxMarchingIterations:20,pixelGroup:4,edgeR0:10,edgeR1:20,nodeR0:15,nodeR1:50,morphBuffer:10,threshold:1,memberInfluenceFactor:1,edgeInfluenceFactor:1,nonMemberInfluenceFactor:-.8,virtualEdges:!0};function Gl(r){return r!=null&&typeof r.radius=="number"}function PL(r,e){if(Gl(r)!==Gl(e))return!1;if(Gl(r)){const n=e;return r.cx===n.cx&&r.cy===n.cy&&r.radius===n.radius}const t=e;return r.x===t.x&&r.y===t.y&&r.width===t.width&&r.height===t.height}var Fi;(function(r){r[r.MEMBERS=0]="MEMBERS",r[r.NON_MEMBERS=1]="NON_MEMBERS",r[r.EDGES=2]="EDGES"})(Fi||(Fi={}));let RL=class{constructor(e={}){this.dirty=new Set,this.members=[],this.nonMembers=[],this.virtualEdges=[],this.edges=[],this.activeRegion=new ir(0,0,0,0),this.potentialArea=new ro(1,0,0,0,0,0,0),this.o=Object.assign({},Ud,e)}pushMember(...e){if(e.length!==0){this.dirty.add(Fi.MEMBERS);for(const t of e)this.members.push({raw:t,obj:Gl(t)?_d.from(t):ir.from(t),area:null})}}removeMember(e){const t=this.members.findIndex(n=>PL(n.raw,e));return t<0?!1:(this.members.splice(t,1),this.dirty.add(Fi.MEMBERS),!0)}removeNonMember(e){const t=this.nonMembers.findIndex(n=>PL(n.raw,e));return t<0?!1:(this.nonMembers.splice(t,1),this.dirty.add(Fi.NON_MEMBERS),!0)}removeEdge(e){const t=this.edges.findIndex(n=>n.obj.equals(e));return t<0?!1:(this.edges.splice(t,1),this.dirty.add(Fi.NON_MEMBERS),!0)}pushNonMember(...e){if(e.length!==0){this.dirty.add(Fi.NON_MEMBERS);for(const t of e)this.nonMembers.push({raw:t,obj:Gl(t)?_d.from(t):ir.from(t),area:null})}}pushEdge(...e){if(e.length!==0){this.dirty.add(Fi.EDGES);for(const t of e)this.edges.push({raw:t,obj:Un.from(t),area:null})}}update(){const e=this.dirty.has(Fi.MEMBERS),t=this.dirty.has(Fi.NON_MEMBERS);let n=this.dirty.has(Fi.EDGES);this.dirty.clear();const i=this.members.map(l=>l.obj);if(this.o.virtualEdges&&(e||t)){const l=this.nonMembers.map(h=>h.obj),c=_ee(i,l,this.o.maxRoutingIterations,this.o.morphBuffer),u=new Map(this.virtualEdges.map(h=>[h.obj.toString(),h.area]));this.virtualEdges=c.map(h=>{var d;return{raw:h,obj:h,area:(d=u.get(h.toString()))!==null&&d!==void 0?d:null}}),n=!0}let a=!1;if(e||n){const l=this.virtualEdges.concat(this.edges).map(d=>d.obj),c=Wee(i,l),u=Math.max(this.o.edgeR1,this.o.nodeR1)+this.o.morphBuffer,h=ir.from(NL(c,u));h.equals(this.activeRegion)||(a=!0,this.activeRegion=h)}if(a){const l=Math.ceil(this.activeRegion.width/this.o.pixelGroup),c=Math.ceil(this.activeRegion.height/this.o.pixelGroup);this.activeRegion.x!==this.potentialArea.pixelX||this.activeRegion.y!==this.potentialArea.pixelY?(this.potentialArea=ro.fromPixelRegion(this.activeRegion,this.o.pixelGroup),this.members.forEach(u=>u.area=null),this.nonMembers.forEach(u=>u.area=null),this.edges.forEach(u=>u.area=null),this.virtualEdges.forEach(u=>u.area=null)):(l!==this.potentialArea.width||c!==this.potentialArea.height)&&(this.potentialArea=ro.fromPixelRegion(this.activeRegion,this.o.pixelGroup))}const s=new Map,o=l=>{if(l.area){const c=`${l.obj.width}x${l.obj.height}x${l.obj instanceof ir?"R":"C"}`;s.set(c,l.area)}},A=l=>{if(l.area)return;const c=`${l.obj.width}x${l.obj.height}x${l.obj instanceof ir?"R":"C"}`;if(s.has(c)){const h=s.get(c);l.area=this.potentialArea.copy(h,{x:l.obj.x-this.o.nodeR1,y:l.obj.y-this.o.nodeR1});return}const u=l.obj instanceof ir?Iee(l.obj,this.potentialArea,this.o.nodeR1):QL(l.obj,this.potentialArea,this.o.nodeR1);l.area=u,s.set(c,u)};this.members.forEach(o),this.nonMembers.forEach(o),this.members.forEach(A),this.nonMembers.forEach(l=>{this.activeRegion.intersects(l.obj)?A(l):l.area=null}),this.edges.forEach(l=>{l.area||(l.area=LL(l.obj,this.potentialArea,this.o.edgeR1))}),this.virtualEdges.forEach(l=>{l.area||(l.area=LL(l.obj,this.potentialArea,this.o.edgeR1))})}drawMembers(e){for(const t of this.members)t.obj.draw(e)}drawNonMembers(e){for(const t of this.nonMembers)t.obj.draw(e)}drawEdges(e){for(const t of this.edges)t.obj.draw(e)}drawPotentialArea(e,t=!0){this.potentialArea.draw(e,t)}compute(){if(this.members.length===0)return new iA([]);this.dirty.size>0&&this.update();const{o:e,potentialArea:t}=this,n=this.members.map(o=>o.area),i=this.virtualEdges.concat(this.edges).map(o=>o.area),a=this.nonMembers.filter(o=>o.area!=null).map(o=>o.area),s=this.members.map(o=>o.obj);return jee(t,n,i,a,o=>o.containsElements(s),e)}};function jee(r,e,t,n,i,a={}){const s=Object.assign({},Ud,a);let o=s.threshold,A=s.memberInfluenceFactor,l=s.edgeInfluenceFactor,c=s.nonMemberInfluenceFactor;const u=(s.nodeR0-s.nodeR1)*(s.nodeR0-s.nodeR1),h=(s.edgeR0-s.edgeR1)*(s.edgeR0-s.edgeR1);for(let d=0;d<s.maxMarchingIterations;d++){if(r.clear(),A!==0){const g=A/u;for(const p of e)r.incArea(p,g)}if(l!==0){const g=l/h;for(const p of t)r.incArea(p,g)}if(c!==0){const g=c/u;for(const p of n)r.incArea(p,g)}const f=Vee(r,o);if(f&&i(f))return f;if(o*=.95,d<=s.maxMarchingIterations*.5)A*=1.2,l*=1.2;else if(c!==0&&n.length>0)c*=.8;else break}return new iA([])}function Wee(r,e){if(r.length===0)return new ir(0,0,0,0);const t=ir.from(r[0]);for(const n of r)t.add(n);for(const n of e)t.add(IL(n));return t}var qee=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};class Pd extends Qn{constructor(e,t){super(e,Rn({},Pd.defaultOptions,t)),this.path=null,this.members=new Map,this.avoidMembers=new Map,this.bubbleSetOptions={},this.drawBubbleSets=()=>{const{style:n,bubbleSetOptions:i}=this.parseOptions();Xt(this.bubbleSetOptions,i)||this.init(),this.bubbleSetOptions=Object.assign({},i);const a=Object.assign(Object.assign({},n),{d:this.getPath()});this.shape?this.shape.update(a):(this.shape=new pl({style:a}),this.context.canvas.appendChild(this.shape))},this.updateBubbleSetsPath=n=>{if(!this.shape)return;const i=X(n.data);[...this.options.members,...this.options.avoidMembers].includes(i)&&this.shape.update(Object.assign(Object.assign({},this.parseOptions().style),{d:this.getPath(i)}))},this.getPath=n=>{const{graph:i}=this.context,a=this.options.members,s=[...this.members.keys()],o=this.options.avoidMembers,A=[...this.avoidMembers.keys()];if(a.length===0&&o.length===0)return this.members.clear(),this.avoidMembers.clear(),this.path=[],this.path;if(!n&&this.path&&Xt(a,s)&&Xt(o,A))return this.path;const{enter:l=[],exit:c=[]}=Xa(s,a,p=>p),{enter:u=[],exit:h=[]}=Xa(A,o,p=>p);if(n){const p=a.includes(n),v=o.includes(n);p&&(c.push(n),l.push(n)),v&&(h.push(n),u.push(n))}const d=(p,v,y)=>{p.forEach(m=>{const B=y?this.members:this.avoidMembers,C=y?"pushMember":"pushNonMember",S=y?"removeMember":"removeNonMember";if(v){let F;i.getElementType(m)==="edge"?([F]=Yee(i,m),this.bubbleSets.pushEdge(F)):([F]=$ee(i,m),this.bubbleSets[C](F)),B.set(m,F)}else{const F=B.get(m);F&&(i.getElementType(m)==="edge"?this.bubbleSets.removeEdge(F):this.bubbleSets[S](F),B.delete(m))}})};d(c,!1,!0),d(l,!0,!0),d(h,!1,!1),d(u,!0,!1);const g=this.bubbleSets.compute().sample(8).simplify(0).bSplines().simplify(0);return this.path=YS(g.points.map(zn)),this.path},this.bindEvents(),this.bubbleSets=new RL(this.options)}bindEvents(){this.context.graph.on(fe.AFTER_RENDER,this.drawBubbleSets),this.context.graph.on(fe.AFTER_ELEMENT_UPDATE,this.updateBubbleSetsPath)}init(){this.bubbleSets=new RL(this.options),this.members.clear(),this.avoidMembers.clear(),this.path=null}parseOptions(){const e=this.options,{type:t,key:n,members:i,avoidMembers:a}=e,s=qee(e,["type","key","members","avoidMembers"]),o=Object.keys(s).reduce((A,l)=>(l in Ud?A.bubbleSetOptions[l]=s[l]:A.style[l]=s[l],A),{style:{},bubbleSetOptions:{}});return Object.assign({type:t,key:n,members:i,avoidMembers:a},o)}addMember(e){const t=Array.isArray(e)?e:[e];t.some(n=>this.options.avoidMembers.includes(n))&&(this.options.avoidMembers=this.options.avoidMembers.filter(n=>!t.includes(n))),this.options.members=[...new Set([...this.options.members,...t])],this.drawBubbleSets()}removeMember(e){const t=Array.isArray(e)?e:[e];this.options.members=this.options.members.filter(n=>!t.includes(n)),this.drawBubbleSets()}updateMember(e){this.options.members=Te(e)?e(this.options.members):e,this.drawBubbleSets()}getMember(){return this.options.members}addAvoidMember(e){const t=Array.isArray(e)?e:[e];t.some(n=>this.options.members.includes(n))&&(this.options.members=this.options.members.filter(n=>!t.includes(n))),this.options.avoidMembers=[...new Set([...this.options.avoidMembers,...t])],this.drawBubbleSets()}removeAvoidMember(e){const t=Array.isArray(e)?e:[e];this.options.avoidMembers.some(n=>t.includes(n))&&(this.options.avoidMembers=this.options.avoidMembers.filter(n=>!t.includes(n)),this.drawBubbleSets())}updateAvoidMember(e){this.options.avoidMembers=Array.isArray(e)?e:[e],this.drawBubbleSets()}getAvoidMember(){return this.options.avoidMembers}destroy(){this.context.graph.off(fe.AFTER_RENDER,this.drawBubbleSets),this.context.graph.off(fe.AFTER_ELEMENT_UPDATE,this.updateBubbleSetsPath),this.shape&&(this.shape.destroy(),this.shape=void 0),super.destroy()}}Pd.defaultOptions=Object.assign({members:[],avoidMembers:[],fill:"lightblue",fillOpacity:.2,stroke:"blue",strokeOpacity:.2},Ud);const $ee=(r,e)=>(Array.isArray(e)?e:[e]).map(n=>{const i=r.getElementRenderBounds(n);return new ir(i.min[0],i.min[1],Xi(i),Zi(i))}),Yee=(r,e)=>(Array.isArray(e)?e:[e]).map(n=>{const i=r.getEdgeData(n),a=r.getElementPosition(i.source),s=r.getElementPosition(i.target);return Un.from({x1:a[0],y1:a[1],x2:s[0],y2:s[1]})});function Xee(r){return`
15
+ <ul class="g6-contextmenu-ul">
16
+ ${r.map(e=>`<li class="g6-contextmenu-li" value="${e.value}">${e.name}</li>`).join("")}
17
+ </ul>
18
+ `}const Zee=`
19
+ .g6-contextmenu {
20
+ font-size: 12px;
21
+ background-color: rgba(255, 255, 255, 0.96);
22
+ border-radius: 4px;
23
+ overflow: hidden;
24
+ box-shadow: rgba(0, 0, 0, 0.12) 0px 6px 12px 0px;
25
+ transition: visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1) 0s, left 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s, top 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s;
26
+ }
27
+
28
+ .g6-contextmenu-ul {
29
+ max-width: 256px;
30
+ min-width: 96px;
31
+ list-style: none;
32
+ padding: 0;
33
+ margin: 0;
34
+ }
35
+
36
+ .g6-contextmenu-li {
37
+ padding: 8px 12px;
38
+ cursor: pointer;
39
+ user-select: none;
40
+ }
41
+
42
+ .g6-contextmenu-li:hover {
43
+ background-color: #f5f5f5;
44
+ cursor: pointer;
45
+ }
46
+ `;var DL=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{l(n.next(c))}catch(u){s(u)}}function A(c){try{l(n.throw(c))}catch(u){s(u)}}function l(c){c.done?a(c.value):i(c.value).then(o,A)}l((n=n.apply(r,e||[])).next())})};class Rd extends Qn{constructor(e,t){super(e,Object.assign({},Rd.defaultOptions,t)),this.targetElement=null,this.onTriggerEvent=n=>{var i;(i=n.preventDefault)===null||i===void 0||i.call(n),this.show(n)},this.onMenuItemClick=n=>{const{onClick:i,trigger:a}=this.options;if(n.target instanceof HTMLElement&&n.target.className.includes("g6-contextmenu-li")){const s=n.target.getAttribute("value");i?.(s,n.target,this.targetElement),this.hide()}a!=="click"&&this.hide()},this.initElement(),this.update(t)}initElement(){this.$element=rA("contextmenu",!1,{zIndex:"99"});const{className:e}=this.options;e&&this.$element.classList.add(e),this.context.canvas.getContainer().appendChild(this.$element),_B("g6-contextmenu-css","style",{},Zee,document.head)}show(e){return DL(this,void 0,void 0,function*(){const{enable:t,offset:n}=this.options;if(typeof t=="function"&&!t(e)||!t){this.hide();return}const i=yield this.getDOMContent(e);i instanceof HTMLElement?(this.$element.innerHTML="",this.$element.appendChild(i)):this.$element.innerHTML=i;const a=this.context.graph.getCanvas().getContainer().getBoundingClientRect();this.$element.style.left=`${e.client.x-a.left+n[0]}px`,this.$element.style.top=`${e.client.y-a.top+n[1]}px`,this.$element.style.display="block",this.targetElement=e.target})}hide(){this.$element.style.display="none",this.targetElement=null}update(e){this.unbindEvents(),super.update(e),this.bindEvents()}destroy(){this.unbindEvents(),super.destroy(),this.$element.remove()}getDOMContent(e){return DL(this,void 0,void 0,function*(){const{getContent:t,getItems:n}=this.options;return n?Xee(yield n(e)):yield t(e)})}bindEvents(){const{graph:e}=this.context,{trigger:t}=this.options;e.on(`canvas:${t}`,this.onTriggerEvent),e.on(`node:${t}`,this.onTriggerEvent),e.on(`edge:${t}`,this.onTriggerEvent),e.on(`combo:${t}`,this.onTriggerEvent),document.addEventListener("click",this.onMenuItemClick)}unbindEvents(){const{graph:e}=this.context,{trigger:t}=this.options;e.off(`canvas:${t}`,this.onTriggerEvent),e.off(`node:${t}`,this.onTriggerEvent),e.off(`edge:${t}`,this.onTriggerEvent),e.off(`combo:${t}`,this.onTriggerEvent),document.removeEventListener("click",this.onMenuItemClick)}}Rd.defaultOptions={trigger:"contextmenu",offset:[4,4],loadingContent:'<div class="g6-contextmenu-loading">Loading...</div>',getContent:()=>"It is a empty context menu.",enable:()=>!0};class Dd extends Qn{constructor(e,t){super(e,Object.assign({},Dd.defaultOptions,t)),this.edgeBundles={},this.edgePoints={},this.onBundle=()=>{const{model:n,element:i}=this.context,a=n.getEdgeData();this.divideEdges(this.options.divisions);const{cycles:s,iterRate:o,divRate:A}=this.options;let{lambda:l,divisions:c,iterations:u}=this.options;for(let h=0;h<s;h++){for(let d=0;d<u;d++){const f={};a.forEach(g=>{var p;if(g.source===g.target)return;const v=X(g);f[v]=this.getEdgeForces(g,c,l);for(let y=0;y<c+1;y++)(p=this.edgePoints)[v]||(p[v]=[]),this.edgePoints[v][y]=Ve(this.edgePoints[v][y],f[v][y])})}l/=2,c*=A,u*=o,this.divideEdges(c)}a.forEach(h=>{const d=X(h),f=i.getElement(d);f?.update({d:gv(this.edgePoints[d])})})},this.bindEvents()}get nodeMap(){const e=this.context.model.getNodeData();return Object.fromEntries(e.map(t=>[X(t),Ks(Fn(t))]))}divideEdges(e){this.context.model.getEdgeData().forEach(n=>{var i;const a=X(n);(i=this.edgePoints)[a]||(i[a]=[]);const s=this.nodeMap[n.source],o=this.nodeMap[n.target];if(e===1)this.edgePoints[a].push(s),this.edgePoints[a].push(bi(Ve(s,o),2)),this.edgePoints[a].push(o);else{const l=(this.edgePoints[a].length===0?Lt(s,o):rte(this.edgePoints[a]))/(e+1);let c=l;const u=[s];for(let h=1;h<this.edgePoints[a].length;h++){const d=this.edgePoints[a][h-1],f=this.edgePoints[a][h];let g=Lt(f,d);for(;g>c;){const p=c/g,v=Ve(d,Bi(bt(f,d),p));u.push(v),g-=c,c=l}c-=g}u.push(o),this.edgePoints[a]=u}})}getVectorPosition(e){const t=this.nodeMap[e.source],n=this.nodeMap[e.target],[i,a]=bt(n,t),s=Lt(t,n);return{source:t,target:n,vx:i,vy:a,length:s}}measureEdgeCompatibility(e,t){const n=this.getVectorPosition(e),i=this.getVectorPosition(t),a=Jee(n,i),s=ete(n,i),o=tte(n,i),A=nte(n,i);return a*s*o*A}getEdgeBundles(){const e={},t=this.options.bundleThreshold,n=this.context.model.getEdgeData();return n.forEach((i,a)=>{n.forEach((s,o)=>{var A,l;if(o<=a)return;this.measureEdgeCompatibility(i,s)>=t&&(e[A=X(i)]||(e[A]=[]),e[X(i)].push(s),e[l=X(s)]||(e[l]=[]),e[X(s)].push(i))})}),e}getSpringForce(e,t){const{pre:n,cur:i,next:a}=e;return Bi(bt(Ve(n,a),Bi(i,2)),t)}getElectrostaticForce(e,t){Ui(this.edgeBundles)&&(this.edgeBundles=this.getEdgeBundles());const n=this.edgeBundles[X(t)];let i=[0,0];return n?.forEach(a=>{const s=this.edgePoints[X(a)][e],o=this.edgePoints[X(t)][e],A=bt(s,o),l=Lt(s,o);i=Ve(i,Bi(A,1/l))}),i}getEdgeForces(e,t,n){const i=this.nodeMap[e.source],a=this.nodeMap[e.target],s=this.options.K/(Lt(i,a)*(t+1)),o=[[0,0]],A=X(e);for(let l=1;l<t;l++){const c=this.getSpringForce({pre:this.edgePoints[A][l-1],cur:this.edgePoints[A][l],next:this.edgePoints[A][l+1]||[0,0]},s),u=this.getElectrostaticForce(l,e);o.push(Bi(Ve(c,u),n))}return o.push([0,0]),o}bindEvents(){const{graph:e}=this.context;e.on(fe.AFTER_RENDER,this.onBundle)}unbindEvents(){const{graph:e}=this.context;e.off(fe.AFTER_RENDER,this.onBundle)}destroy(){this.unbindEvents(),super.destroy()}}Dd.defaultOptions={K:.1,lambda:.1,divisions:1,divRate:2,cycles:6,iterations:90,iterRate:2/3,bundleThreshold:.6};const Jee=(r,e)=>Math.abs(nj([r.vx,r.vy],[e.vx,e.vy])/(r.length*e.length)),ete=(r,e)=>{const t=(r.length+e.length)/2;return 2/(t/Math.min(r.length,e.length)+Math.max(r.length,e.length)/t)},tte=(r,e)=>{const t=(r.length+e.length)/2,n=bi(Ve(r.source,r.target),2),i=bi(Ve(e.source,e.target),2);return t/(t+Lt(n,i))},HL=(r,e)=>{if(e.source[0]===e.target[0])return[e.source[0],r[1]];if(e.source[1]===e.target[1])return[r[0],e.source[1]];const t=(e.source[1]-e.target[1])/(e.source[0]-e.target[0]),n=(t*t*e.source[0]+t*(r[1]-e.source[1])+r[0])/(t*t+1),i=t*(n-e.source[0])+e.source[1];return[n,i]},GL=(r,e)=>{const t=HL(e.source,r),n=HL(e.target,r),i=bi(Ve(t,n),2),a=bi(Ve(r.source,r.target),2);return Lt(t,n)===0?0:Math.max(0,1-2*Lt(a,i)/Lt(t,n))},nte=(r,e)=>Math.min(GL(r,e),GL(e,r)),rte=r=>{let e=0;for(let t=1;t<r.length;t++)e+=Lt(r[t],r[t-1]);return e},ite={fill:"#fff",fillOpacity:1,lineWidth:1,stroke:"#000",strokeOpacity:.8,zIndex:-1/0},KL=.05;class Hd extends Qn{constructor(e,t){super(e,Object.assign({},Hd.defaultOptions,t)),this.shapes=new Map,this.r=this.options.r,this.onEdgeFilter=n=>{if(this.options.trigger==="drag"&&this.isLensOn)return;const i=zn(n.canvas);this.renderLens(i),this.renderFocusElements()},this.renderLens=n=>{const i=Object.assign({},ite,this.options.style);this.isLensOn||(this.lens=new vl({style:i}),this.canvas.appendChild(this.lens)),Object.assign(i,Ei(n),{size:this.r*2}),this.lens.update(i)},this.getFilterData=()=>{const{filter:n}=this.options,{model:i}=this.context,a=i.getData();if(!n)return a;const{nodes:s,edges:o,combos:A}=a;return{nodes:s.filter(l=>n(X(l),"node")),edges:o.filter(l=>n(X(l),"edge")),combos:A.filter(l=>n(X(l),"combo"))}},this.getFocusElements=n=>{const{nodes:i,edges:a}=this.getFilterData(),s=i.filter(l=>Lt(Fn(l),n)<this.r),o=s.map(l=>X(l)),A=a.filter(l=>{const{source:c,target:u}=l,h=o.includes(c),d=o.includes(u);switch(this.options.nodeType){case"both":return h&&d;case"either":return h!==d;case"source":return h&&!d;case"target":return!h&&d;default:return!1}});return{nodes:s,edges:A}},this.renderFocusElements=()=>{const{element:n,graph:i}=this.context;if(!this.isLensOn)return;const a=this.lens.getCenter(),{nodes:s,edges:o}=this.getFocusElements(a),A=new Set,l=c=>{const u=X(c);A.add(u);const h=n.getElement(u);if(!h)return;const d=this.shapes.get(u)||h.cloneNode();d.setPosition(h.getPosition()),d.id=h.id,this.shapes.has(u)?Object.entries(h.attributes).forEach(([p,v])=>{d.style[p]!==v&&(d.style[p]=v)}):(this.canvas.appendChild(d),this.shapes.set(u,d));const f=i.getElementType(u),g=this.getElementStyle(f,c);d.update(g)};s.forEach(l),o.forEach(l),this.shapes.forEach((c,u)=>{A.has(u)||(c.destroy(),this.shapes.delete(u))})},this.scaleRByWheel=n=>{var i;this.options.preventDefault&&n.preventDefault();const{clientX:a,clientY:s,deltaX:o,deltaY:A}=n,{graph:l,canvas:c}=this.context,u=l.getCanvasByClient([a,s]),h=(i=this.lens)===null||i===void 0?void 0:i.getCenter();if(!this.isLensOn||Lt(u,h)>this.r)return;const{maxR:d,minR:f}=this.options,g=o+A>0?1/(1-KL):1-KL,p=Math.min(...c.getSize())/2;this.r=Math.max(f||0,Math.min(d||p,this.r*g)),this.renderLens(h),this.renderFocusElements()},this.isLensDragging=!1,this.onDragStart=n=>{var i;const a=zn(n.canvas),s=(i=this.lens)===null||i===void 0?void 0:i.getCenter();!this.isLensOn||Lt(a,s)>this.r||(this.isLensDragging=!0)},this.onDrag=n=>{if(!this.isLensDragging)return;const i=zn(n.canvas);this.renderLens(i),this.renderFocusElements()},this.onDragEnd=()=>{this.isLensDragging=!1},this.bindEvents()}get canvas(){return this.context.canvas.getLayer("transient")}get isLensOn(){return this.lens&&!this.lens.destroyed}getElementStyle(e,t){const n=e==="node"?this.options.nodeStyle:this.options.edgeStyle;return typeof n=="function"?n(t):n}get graphDom(){return this.context.graph.getCanvas().getContextService().getDomElement()}bindEvents(){var e;const{graph:t}=this.context,{trigger:n,scaleRBy:i}=this.options,a=t.getCanvas().getLayer();["click","drag"].includes(n)&&a.addEventListener(ie.CLICK,this.onEdgeFilter),n==="pointermove"?a.addEventListener(ie.POINTER_MOVE,this.onEdgeFilter):n==="drag"&&(a.addEventListener(ie.DRAG_START,this.onDragStart),a.addEventListener(ie.DRAG,this.onDrag),a.addEventListener(ie.DRAG_END,this.onDragEnd)),i==="wheel"&&((e=this.graphDom)===null||e===void 0||e.addEventListener(ie.WHEEL,this.scaleRByWheel,{passive:!1}))}unbindEvents(){var e;const{graph:t}=this.context,{trigger:n,scaleRBy:i}=this.options,a=t.getCanvas().getLayer();["click","drag"].includes(n)&&a.removeEventListener(ie.CLICK,this.onEdgeFilter),n==="pointermove"?a.removeEventListener(ie.POINTER_MOVE,this.onEdgeFilter):n==="drag"&&(a.removeEventListener(ie.DRAG_START,this.onDragStart),a.removeEventListener(ie.DRAG,this.onDrag),a.removeEventListener(ie.DRAG_END,this.onDragEnd)),i==="wheel"&&((e=this.graphDom)===null||e===void 0||e.removeEventListener(ie.WHEEL,this.scaleRByWheel))}update(e){var t;this.unbindEvents(),super.update(e),this.r=(t=e.r)!==null&&t!==void 0?t:this.r,this.bindEvents()}destroy(){this.unbindEvents(),this.isLensOn&&this.lens.destroy(),this.shapes.forEach((e,t)=>{e.destroy(),this.shapes.delete(t)}),super.destroy()}}Hd.defaultOptions={trigger:"pointermove",r:60,nodeType:"both",filter:()=>!0,style:{lineWidth:2},nodeStyle:{label:!1},edgeStyle:{label:!0},scaleRBy:"wheel",preventDefault:!0};const ate={fill:"#ccc",fillOpacity:.1,lineWidth:2,stroke:"#000",strokeOpacity:.8,labelFontSize:12},zL=.05,VL=.1;class Gd extends Qn{constructor(e,t){super(e,Object.assign({},Gd.defaultOptions,t)),this.r=this.options.r,this.d=this.options.d,this.onCreateFisheye=n=>{if(this.options.trigger==="drag"&&this.isLensOn)return;const i=zn(n.canvas);this.onMagnify(i)},this.onMagnify=n=>{n.some(isNaN)||(this.renderLens(n),this.renderFocusElements())},this.renderLens=n=>{const i=Object.assign({},ate,this.options.style);this.isLensOn||(this.lens=new vl({style:i}),this.canvas.appendChild(this.lens)),Object.assign(i,Ei(n),{size:this.r*2,label:this.options.showDPercent,labelText:this.getDPercent()}),this.lens.update(i)},this.getDPercent=()=>{const{minD:n,maxD:i}=this.options;return`${Math.round((this.d-n)/(i-n)*100)}%`},this.prevMagnifiedStyleMap=new Map,this.prevOriginStyleMap=new Map,this.renderFocusElements=()=>{if(!this.isLensOn)return;const{graph:n}=this.context,i=this.lens.getCenter(),a=(this.d+1)*this.r,s=new Map,o=new Map;n.getNodeData().forEach(l=>{const c=Fn(l),u=Lt(c,i);if(u>this.r)return;const h=a*u/(this.d*u+this.r),[d,f]=c,[g,p]=i,v=(d-g)/u,y=(f-p)/u,m=[g+h*v,p+h*y],B=X(l),C=this.getNodeStyle(l),S=ms(n.getElementRenderStyle(B),Object.keys(C));s.set(B,Object.assign(Object.assign({},Ei(m)),C)),o.set(B,Object.assign(Object.assign({},Ei(c)),S))}),this.updateStyle(s,o)},this.getNodeStyle=n=>{const{nodeStyle:i}=this.options;return typeof i=="function"?i(n):i},this.updateStyle=(n,i)=>{const{graph:a,element:s}=this.context,{enter:o,exit:A,keep:l}=Xa(Array.from(this.prevMagnifiedStyleMap.keys()),Array.from(n.keys()),h=>h),c=new Set,u=(h,d)=>{const f=s.getElement(h);f?.update(d),a.getRelatedEdgesData(h).forEach(g=>{c.add(X(g))})};[...o,...l].forEach(h=>{u(h,n.get(h))}),A.forEach(h=>{u(h,this.prevOriginStyleMap.get(h)),this.prevOriginStyleMap.delete(h)}),c.forEach(h=>{const d=s.getElement(h);d?.update({})}),this.prevMagnifiedStyleMap=n,i.forEach((h,d)=>{this.prevOriginStyleMap.has(d)||this.prevOriginStyleMap.set(d,h)})},this.isWheelValid=n=>{if(this.options.preventDefault&&n.preventDefault(),!this.isLensOn)return!1;const{clientX:i,clientY:a}=n,s=this.context.graph.getCanvasByClient([i,a]),o=this.lens.getCenter();return!(Lt(s,o)>this.r)},this.scaleR=n=>{const{maxR:i,minR:a}=this.options,s=n?1/(1-zL):1-zL,o=Math.min(...this.context.canvas.getSize())/2;this.r=Math.max(a||0,Math.min(i||o,this.r*s))},this.scaleD=n=>{const{maxD:i,minD:a}=this.options,s=n?this.d+VL:this.d-VL;this.d=Math.max(a,Math.min(i,s))},this.scaleRByWheel=n=>{if(!this.isWheelValid(n))return;const{deltaX:i,deltaY:a}=n;this.scaleR(i+a>0);const s=this.lens.getCenter();this.onMagnify(s)},this.scaleDByWheel=n=>{if(!this.isWheelValid(n))return;const{deltaX:i,deltaY:a}=n;this.scaleD(i+a>0);const s=this.lens.getCenter();this.onMagnify(s)},this.isDragValid=n=>{if(this.options.preventDefault&&n.preventDefault(),!this.isLensOn)return!1;const i=zn(n.canvas),a=this.lens.getCenter();return!(Lt(i,a)>this.r)},this.isLensDragging=!1,this.onDragStart=n=>{this.isDragValid(n)&&(this.isLensDragging=!0)},this.onDrag=n=>{if(!this.isLensDragging)return;const i=zn(n.canvas);this.onMagnify(i)},this.onDragEnd=()=>{this.isLensDragging=!1},this.scaleRByDrag=n=>{if(!this.isLensDragging)return;const{dx:i,dy:a}=n;this.scaleR(i-a>0);const s=this.lens.getCenter();this.onMagnify(s)},this.scaleDByDrag=n=>{if(!this.isLensDragging)return;const{dx:i,dy:a}=n;this.scaleD(i-a>0);const s=this.lens.getCenter();this.onMagnify(s)},this.bindEvents()}get canvas(){return this.context.canvas.getLayer("transient")}get isLensOn(){return this.lens&&!this.lens.destroyed}get graphDom(){return this.context.graph.getCanvas().getContextService().getDomElement()}bindEvents(){var e;const{graph:t}=this.context,{trigger:n,scaleRBy:i,scaleDBy:a}=this.options,s=t.getCanvas().getLayer();if(["click","drag"].includes(n)&&s.addEventListener(ie.CLICK,this.onCreateFisheye),n==="pointermove"&&s.addEventListener(ie.POINTER_MOVE,this.onCreateFisheye),n==="drag"||i==="drag"||a==="drag"){s.addEventListener(ie.DRAG_START,this.onDragStart),s.addEventListener(ie.DRAG_END,this.onDragEnd);const o=n==="drag"?this.onDrag:i==="drag"?this.scaleRByDrag:this.scaleDByDrag;s.addEventListener(ie.DRAG,o)}if(i==="wheel"||a==="wheel"){const o=i==="wheel"?this.scaleRByWheel:this.scaleDByWheel;(e=this.graphDom)===null||e===void 0||e.addEventListener(ie.WHEEL,o,{passive:!1})}}unbindEvents(){var e;const{graph:t}=this.context,{trigger:n,scaleRBy:i,scaleDBy:a}=this.options,s=t.getCanvas().getLayer();if(["click","drag"].includes(n)&&s.removeEventListener(ie.CLICK,this.onCreateFisheye),n==="pointermove"&&s.removeEventListener(ie.POINTER_MOVE,this.onCreateFisheye),n==="drag"||i==="drag"||a==="drag"){s.removeEventListener(ie.DRAG_START,this.onDragStart),s.removeEventListener(ie.DRAG_END,this.onDragEnd);const o=n==="drag"?this.onDrag:i==="drag"?this.scaleRByDrag:this.scaleDByDrag;s.removeEventListener(ie.DRAG,o)}if(i==="wheel"||a==="wheel"){const o=i==="wheel"?this.scaleRByWheel:this.scaleDByWheel;(e=this.graphDom)===null||e===void 0||e.removeEventListener(ie.WHEEL,o)}}update(e){var t,n;this.unbindEvents(),super.update(e),this.r=(t=e.r)!==null&&t!==void 0?t:this.r,this.d=(n=e.d)!==null&&n!==void 0?n:this.d,this.bindEvents()}destroy(){var e;this.unbindEvents(),this.isLensOn&&((e=this.lens)===null||e===void 0||e.destroy()),this.prevMagnifiedStyleMap.clear(),this.prevOriginStyleMap.clear(),super.destroy()}}Gd.defaultOptions={trigger:"pointermove",r:120,d:1.5,maxD:5,minD:0,showDPercent:!0,style:{},nodeStyle:{label:!0},preventDefault:!0};class Kd extends Qn{constructor(e,t){super(e,Object.assign({},Kd.defaultOptions,t)),this.$el=this.context.canvas.getContainer(),this.graphSize=[0,0],this.onFullscreenChange=()=>{var n,i,a,s;const o=!!document.fullscreenElement;this.options.autoFit&&this.setGraphSize(o),o?(i=(n=this.options).onEnter)===null||i===void 0||i.call(n):(s=(a=this.options).onExit)===null||s===void 0||s.call(a)},this.shortcut=new es(e.graph),this.bindEvents(),this.style=document.createElement("style"),document.head.appendChild(this.style),this.style.innerHTML=`
47
+ :not(:root):fullscreen::backdrop {
48
+ background: transparent;
49
+ }
50
+ `}bindEvents(){this.unbindEvents(),this.shortcut.unbindAll();const{request:e=[],exit:t=[]}=this.options.trigger;this.shortcut.bind(e,this.request),this.shortcut.bind(t,this.exit),["webkitfullscreenchange","mozfullscreenchange","fullscreenchange","MSFullscreenChange"].forEach(i=>{document.addEventListener(i,this.onFullscreenChange,!1)})}unbindEvents(){this.shortcut.unbindAll(),["webkitfullscreenchange","mozfullscreenchange","fullscreenchange","MSFullscreenChange"].forEach(t=>{document.removeEventListener(t,this.onFullscreenChange,!1)})}setGraphSize(e=!0){var t,n;let i,a;e?(i=((t=globalThis.screen)===null||t===void 0?void 0:t.width)||0,a=((n=globalThis.screen)===null||n===void 0?void 0:n.height)||0,this.graphSize=this.context.graph.getSize()):[i,a]=this.graphSize,this.context.graph.setSize(i,a),this.context.graph.render()}request(){document.fullscreenElement||!ste()||this.$el.requestFullscreen().catch(e=>{$i.warn(`Error attempting to enable full-screen: ${e.message} (${e.name})`)})}exit(){document.fullscreenElement&&document.exitFullscreen()}update(e){this.unbindEvents(),super.update(e),this.bindEvents()}destroy(){this.exit(),this.style.remove(),super.destroy()}}Kd.defaultOptions={trigger:{},autoFit:!0};function ste(){return document.fullscreenEnabled||Reflect.get(document,"webkitFullscreenEnabled")||Reflect.get(document,"mozFullscreenEnabled")||Reflect.get(document,"msFullscreenEnabled")}class zd extends Qn{constructor(e,t){super(e,Object.assign({},zd.defaultOptions,t)),this.$element=rA("grid-line",!0),this.offset=[0,0],this.currentScale=1,this.followZoom=i=>{const{data:{scale:a,origin:s}}=i;if(!a||s===void 0&&this.context.viewport===void 0)return;const o=this.currentScale;this.currentScale=a;const A=a/o,l=Bi(s||this.context.graph.getCanvasCenter(),1-A),c=this.baseSize*a,u=Bi(this.offset,A),h=Zp(u,c),d=Ve(h,l);this.$element.style.backgroundSize=`${c}px ${c}px`,this.$element.style.backgroundPosition=`${d[0]}px ${d[1]}px`,this.offset=Zp(d,c)},this.followTranslate=i=>{if(!this.options.follow)return;const{data:{translate:a}}=i;a&&this.updateOffset(a)},this.onTransform=i=>{const a=this.parseFollow(this.options.follow);a.zoom&&this.followZoom(i),a.translate&&this.followTranslate(i)},this.context.canvas.getContainer().prepend(this.$element),this.baseSize=this.options.size,this.updateStyle(),this.bindEvents()}update(e){super.update(e),e.size!==void 0&&(this.baseSize=e.size),this.updateStyle()}bindEvents(){const{graph:e}=this.context;e.on(fe.AFTER_TRANSFORM,this.onTransform)}updateStyle(){const{stroke:e,lineWidth:t,border:n,borderLineWidth:i,borderStroke:a,borderStyle:s}=this.options,o=this.baseSize*this.currentScale;Object.assign(this.$element.style,{border:n?`${i}px ${s} ${a}`:"none",backgroundImage:`linear-gradient(${e} ${t}px, transparent ${t}px), linear-gradient(90deg, ${e} ${t}px, transparent ${t}px)`,backgroundSize:`${o}px ${o}px`,backgroundRepeat:"repeat"})}updateOffset(e){const t=this.baseSize*this.currentScale;this.offset=Zp(Ve(this.offset,e),t),this.$element.style.backgroundPosition=`${this.offset[0]}px ${this.offset[1]}px`}parseFollow(e){var t,n;return mA(e)?{translate:e,zoom:e}:{translate:(t=e?.translate)!==null&&t!==void 0?t:!1,zoom:(n=e?.zoom)!==null&&n!==void 0?n:!1}}destroy(){this.context.graph.off(fe.AFTER_TRANSFORM,this.onTransform),this.$element.remove(),super.destroy()}}zd.defaultOptions={border:!0,borderLineWidth:1,borderStroke:"#eee",borderStyle:"solid",lineWidth:1,size:20,stroke:"#eee"};function QB(r){const e={Added:new Map,Updated:new Map,Removed:new Map};return r.forEach(t=>{const{type:n,value:i}=t,a=X(i);if(n==="NodeAdded"||n==="EdgeAdded"||n==="ComboAdded")e.Added.set(a,t);else if(n==="NodeUpdated"||n==="EdgeUpdated"||n==="ComboUpdated")if(e.Added.has(a))e.Added.set(a,{type:n.replace("Updated","Added"),value:i});else if(e.Updated.has(a)){const{original:s}=e.Updated.get(a);e.Updated.set(a,{type:n,value:i,original:s})}else e.Removed.has(a)||e.Updated.set(a,t);else(n==="NodeRemoved"||n==="EdgeRemoved"||n==="ComboRemoved")&&(e.Added.has(a)?e.Added.delete(a):(e.Updated.has(a)&&e.Updated.delete(a),e.Removed.set(a,t)))}),[...Array.from(e.Added.values()),...Array.from(e.Updated.values()),...Array.from(e.Removed.values())]}function jL(r){const{NodeAdded:e=[],NodeUpdated:t=[],NodeRemoved:n=[],EdgeAdded:i=[],EdgeUpdated:a=[],EdgeRemoved:s=[],ComboAdded:o=[],ComboUpdated:A=[],ComboRemoved:l=[]}=fc(r,c=>c.type);return{add:{nodes:e,edges:i,combos:o},update:{nodes:t,edges:a,combos:A},remove:{nodes:n,edges:s,combos:l}}}function WL(r,e){for(const t in r)on(r[t])&&!Array.isArray(r[t])&&r[t]!==null?(e[t]||(e[t]={}),WL(r[t],e[t])):e[t]===void 0&&(e[t]=ll(t))}function ote(r,e=!1,t){const n={animation:e,current:{add:{},update:{},remove:{}},original:{add:{},update:{},remove:{}}},{add:i,update:a,remove:s}=jL(QB(r));return["nodes","edges","combos"].forEach(o=>{a[o]&&a[o].forEach(A=>{var l,c;const u=Object.assign({},A.value);let h=Object.assign({},A.original);if(t){const d=t.graph.getElementType(X(A.original)),f=d==="edge"?"stroke":"fill",g=t.element.getElementComputedStyle(d,A.original);h=Object.assign(Object.assign({},A.original),{style:Object.assign({[f]:g[f]},A.original.style)})}WL(u,h),(l=n.current.update)[o]||(l[o]=[]),n.current.update[o].push(u),(c=n.original.update)[o]||(c[o]=[]),n.original.update[o].push(h)}),i[o]&&i[o].forEach(A=>{var l,c;const u=Object.assign({},A.value);(l=n.current.add)[o]||(l[o]=[]),n.current.add[o].push(u),(c=n.original.remove)[o]||(c[o]=[]),n.original.remove[o].push(u)}),s[o]&&s[o].forEach(A=>{var l,c;const u=Object.assign({},A.value);(l=n.current.remove)[o]||(l[o]=[]),n.current.remove[o].push(u),(c=n.original.add)[o]||(c[o]=[]),n.original.add[o].push(u)})}),n}class Vd extends Qn{constructor(e,t){super(e,Object.assign({},Vd.defaultOptions,t)),this.batchChanges=null,this.batchAnimation=!1,this.undoStack=[],this.redoStack=[],this.freezed=!1,this.executeCommand=(i,a=!0)=>{var s,o,A;this.freezed=!0,(o=(s=this.options).executeCommand)===null||o===void 0||o.call(s,i);const l=a?i.original:i.current;this.context.graph.addData(l.add),this.context.graph.updateData(l.update),this.context.graph.removeData(SS(l.remove,!1)),(A=this.context.element)===null||A===void 0||A.draw({silence:!0,animation:i.animation}),this.freezed=!1},this.addCommand=i=>{var a;if(!this.freezed){if(i.type===fe.AFTER_DRAW){const{dataChanges:s=[],animation:o=!0}=i.data;if(!((a=this.context.batch)===null||a===void 0)&&a.isBatching){if(!this.batchChanges)return;this.batchChanges.push(s),this.batchAnimation&&(this.batchAnimation=o);return}this.batchChanges=[s],this.batchAnimation=o}this.undoStackPush(ote(this.batchChanges.flat(),this.batchAnimation,this.context)),this.notify(Wa.ADD,this.undoStack[this.undoStack.length-1])}},this.initBatchCommand=i=>{const{initiate:a}=i.data;this.batchAnimation=!1,a?this.batchChanges=[]:this.undoStack.pop()||(this.batchChanges=null)},this.emitter=new Qh;const{graph:n}=this.context;n.on(fe.AFTER_DRAW,this.addCommand),n.on(fe.BATCH_START,this.initBatchCommand),n.on(fe.BATCH_END,this.addCommand)}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}undo(){var e,t,n,i;const a=this.undoStack.pop();if(a){if(this.executeCommand(a),((t=(e=this.options).beforeAddCommand)===null||t===void 0?void 0:t.call(e,a,!1))===!1)return;this.redoStack.push(a),(i=(n=this.options).afterAddCommand)===null||i===void 0||i.call(n,a,!1),this.notify(Wa.UNDO,a)}return this}redo(){const e=this.redoStack.pop();return e&&(this.executeCommand(e,!1),this.undoStackPush(e),this.notify(Wa.REDO,e)),this}undoAndCancel(){const e=this.undoStack.pop();return e&&(this.executeCommand(e,!1),this.redoStack=[],this.notify(Wa.CANCEL,e)),this}undoStackPush(e){var t,n,i,a;const{stackSize:s}=this.options;s!==0&&this.undoStack.length>=s&&this.undoStack.shift(),((n=(t=this.options).beforeAddCommand)===null||n===void 0?void 0:n.call(t,e,!0))!==!1&&(this.undoStack.push(e),(a=(i=this.options).afterAddCommand)===null||a===void 0||a.call(i,e,!0))}clear(){this.undoStack=[],this.redoStack=[],this.batchChanges=null,this.batchAnimation=!1,this.notify(Wa.CLEAR,null)}notify(e,t){this.emitter.emit(e,{cmd:t}),this.emitter.emit(Wa.CHANGE,{cmd:t})}on(e,t){this.emitter.on(e,t)}destroy(){const{graph:e}=this.context;e.off(fe.AFTER_DRAW,this.addCommand),e.off(fe.BATCH_START,this.initBatchCommand),e.off(fe.BATCH_END,this.addCommand),this.emitter.off(),super.destroy(),this.undoStack=[],this.redoStack=[]}}Vd.defaultOptions={stackSize:0};const UB={toXy(r,e){if(!e)return[...r];const t=e[0].slice(1),n=e[1].slice(1);return r.map(i=>[i[t],i[n]])},fromXy(r,e){if(!e)return[...r];const t=e[0].slice(1),n=e[1].slice(1);return r.map(([i,a])=>({[t]:i,[n]:a}))}};let Ate=class{constructor(e,t){this._cells=[],this._cellSize=t,this._reverseCellSize=1/t;for(const n of e){const i=this.coordToCellNum(n[0]),a=this.coordToCellNum(n[1]);this._cells[i]||(this._cells[i]=[]),this._cells[i][a]||(this._cells[i][a]=[]),this._cells[i][a].push(n)}}cellPoints(e,t){var n;return((n=this._cells[e])===null||n===void 0?void 0:n[t])||[]}rangePoints(e){const t=this.coordToCellNum(e[0]),n=this.coordToCellNum(e[1]),i=this.coordToCellNum(e[2]),a=this.coordToCellNum(e[3]),s=[];for(let o=t;o<=i;o++)for(let A=n;A<=a;A++){const l=this.cellPoints(o,A);for(const c of l)s.push(c)}return s}removePoint(e){const t=this.coordToCellNum(e[0]),n=this.coordToCellNum(e[1]),i=this._cells[t][n],a=i.findIndex(([s,o])=>s===e[0]&&o===e[1]);return a>-1&&i.splice(a,1),i}trunc(e){return Math.trunc(e)}coordToCellNum(e){return this.trunc(e*this._reverseCellSize)}extendBbox(e,t){return[e[0]-t*this._cellSize,e[1]-t*this._cellSize,e[2]+t*this._cellSize,e[3]+t*this._cellSize]}};function lte(r,e){return new Ate(r,e)}const qL=+(Math.pow(2,27)+1);function jd(r,e,t){const n=r*e,i=qL*r,a=i-r,s=i-a,o=r-s,A=qL*e,l=A-e,c=A-l,u=e-c,f=n-s*c-o*c-s*u,g=o*u-f;return t?(t[0]=g,t[1]=n,t):[g,n]}function cte(r,e,t){const n=r+e,i=n-r,a=n-i,s=e-i,o=r-a;return t?(t[0]=o+s,t[1]=n,t):[o+s,n]}function ute(r,e){const t=r.length;if(t===1){const o=jd(r[0],e);return o[0]?o:[o[1]]}const n=new Array(2*t),i=[.1,.1],a=[.1,.1];let s=0;jd(r[0],e,i),i[0]&&(n[s++]=i[0]);for(let o=1;o<t;++o){jd(r[o],e,a);const A=i[1];cte(A,a[0],i),i[0]&&(n[s++]=i[0]);const l=a[1],c=i[1],u=l+c,h=u-l,d=c-h;i[1]=u,d&&(n[s++]=d)}return i[1]&&(n[s++]=i[1]),s===0&&(n[s++]=0),n.length=s,n}function hte(r,e){const t=r+e,n=t-r,i=t-n,a=e-n,o=r-i+a;return o?[o,t]:[t]}function dte(r,e){const t=r.length|0,n=e.length|0;if(t===1&&n===1)return hte(r[0],-e[0]);const i=t+n,a=new Array(i);let s=0,o=0,A=0;const l=Math.abs;let c=r[o],u=l(c),h=-e[A],d=l(h),f,g;u<d?(g=c,o+=1,o<t&&(c=r[o],u=l(c))):(g=h,A+=1,A<n&&(h=-e[A],d=l(h))),o<t&&u<d||A>=n?(f=c,o+=1,o<t&&(c=r[o],u=l(c))):(f=h,A+=1,A<n&&(h=-e[A],d=l(h)));let p=f+g,v=p-f,y=g-v,m=y,B=p,C,S,F,T,O;for(;o<t&&A<n;)u<d?(f=c,o+=1,o<t&&(c=r[o],u=l(c))):(f=h,A+=1,A<n&&(h=-e[A],d=l(h))),g=m,p=f+g,v=p-f,y=g-v,y&&(a[s++]=y),C=B+p,S=C-B,F=C-S,T=p-S,O=B-F,m=O+T,B=C;for(;o<t;)f=c,g=m,p=f+g,v=p-f,y=g-v,y&&(a[s++]=y),C=B+p,S=C-B,F=C-S,T=p-S,O=B-F,m=O+T,B=C,o+=1,o<t&&(c=r[o]);for(;A<n;)f=h,g=m,p=f+g,v=p-f,y=g-v,y&&(a[s++]=y),C=B+p,S=C-B,F=C-S,T=p-S,O=B-F,m=O+T,B=C,A+=1,A<n&&(h=-e[A]);return m&&(a[s++]=m),B&&(a[s++]=B),s||(a[s++]=0),a.length=s,a}function fte(r,e){const t=r+e,n=t-r,i=t-n,a=e-n,o=r-i+a;return o?[o,t]:[t]}function gte(r,e){const t=r.length|0,n=e.length|0;if(t===1&&n===1)return fte(r[0],e[0]);const i=t+n,a=new Array(i);let s=0,o=0,A=0;const l=Math.abs;let c=r[o],u=l(c),h=e[A],d=l(h),f,g;u<d?(g=c,o+=1,o<t&&(c=r[o],u=l(c))):(g=h,A+=1,A<n&&(h=e[A],d=l(h))),o<t&&u<d||A>=n?(f=c,o+=1,o<t&&(c=r[o],u=l(c))):(f=h,A+=1,A<n&&(h=e[A],d=l(h)));let p=f+g,v=p-f,y=g-v,m=y,B=p,C,S,F,T,O;for(;o<t&&A<n;)u<d?(f=c,o+=1,o<t&&(c=r[o],u=l(c))):(f=h,A+=1,A<n&&(h=e[A],d=l(h))),g=m,p=f+g,v=p-f,y=g-v,y&&(a[s++]=y),C=B+p,S=C-B,F=C-S,T=p-S,O=B-F,m=O+T,B=C;for(;o<t;)f=c,g=m,p=f+g,v=p-f,y=g-v,y&&(a[s++]=y),C=B+p,S=C-B,F=C-S,T=p-S,O=B-F,m=O+T,B=C,o+=1,o<t&&(c=r[o]);for(;A<n;)f=h,g=m,p=f+g,v=p-f,y=g-v,y&&(a[s++]=y),C=B+p,S=C-B,F=C-S,T=p-S,O=B-F,m=O+T,B=C,A+=1,A<n&&(h=e[A]);return m&&(a[s++]=m),B&&(a[s++]=B),s||(a[s++]=0),a.length=s,a}const $L=5,Wd=11102230246251565e-32,pte=(3+16*Wd)*Wd,vte=(7+56*Wd)*Wd;function yte(r,e,t,n){return function(a,s,o){const A=r(r(e(s[1],o[0]),e(-o[1],s[0])),r(e(a[1],s[0]),e(-s[1],a[0]))),l=r(e(a[1],o[0]),e(-o[1],a[0])),c=n(A,l);return c[c.length-1]}}function mte(r,e,t,n){return function(a,s,o,A){const l=r(r(t(r(e(o[1],A[0]),e(-A[1],o[0])),s[2]),r(t(r(e(s[1],A[0]),e(-A[1],s[0])),-o[2]),t(r(e(s[1],o[0]),e(-o[1],s[0])),A[2]))),r(t(r(e(s[1],A[0]),e(-A[1],s[0])),a[2]),r(t(r(e(a[1],A[0]),e(-A[1],a[0])),-s[2]),t(r(e(a[1],s[0]),e(-s[1],a[0])),A[2])))),c=r(r(t(r(e(o[1],A[0]),e(-A[1],o[0])),a[2]),r(t(r(e(a[1],A[0]),e(-A[1],a[0])),-o[2]),t(r(e(a[1],o[0]),e(-o[1],a[0])),A[2]))),r(t(r(e(s[1],o[0]),e(-o[1],s[0])),a[2]),r(t(r(e(a[1],o[0]),e(-o[1],a[0])),-s[2]),t(r(e(a[1],s[0]),e(-s[1],a[0])),o[2])))),u=n(l,c);return u[u.length-1]}}function wte(r,e,t,n){return function(a,s,o,A,l){const c=r(r(r(t(r(t(r(e(A[1],l[0]),e(-l[1],A[0])),o[2]),r(t(r(e(o[1],l[0]),e(-l[1],o[0])),-A[2]),t(r(e(o[1],A[0]),e(-A[1],o[0])),l[2]))),s[3]),r(t(r(t(r(e(A[1],l[0]),e(-l[1],A[0])),s[2]),r(t(r(e(s[1],l[0]),e(-l[1],s[0])),-A[2]),t(r(e(s[1],A[0]),e(-A[1],s[0])),l[2]))),-o[3]),t(r(t(r(e(o[1],l[0]),e(-l[1],o[0])),s[2]),r(t(r(e(s[1],l[0]),e(-l[1],s[0])),-o[2]),t(r(e(s[1],o[0]),e(-o[1],s[0])),l[2]))),A[3]))),r(t(r(t(r(e(o[1],A[0]),e(-A[1],o[0])),s[2]),r(t(r(e(s[1],A[0]),e(-A[1],s[0])),-o[2]),t(r(e(s[1],o[0]),e(-o[1],s[0])),A[2]))),-l[3]),r(t(r(t(r(e(A[1],l[0]),e(-l[1],A[0])),s[2]),r(t(r(e(s[1],l[0]),e(-l[1],s[0])),-A[2]),t(r(e(s[1],A[0]),e(-A[1],s[0])),l[2]))),a[3]),t(r(t(r(e(A[1],l[0]),e(-l[1],A[0])),a[2]),r(t(r(e(a[1],l[0]),e(-l[1],a[0])),-A[2]),t(r(e(a[1],A[0]),e(-A[1],a[0])),l[2]))),-s[3])))),r(r(t(r(t(r(e(s[1],l[0]),e(-l[1],s[0])),a[2]),r(t(r(e(a[1],l[0]),e(-l[1],a[0])),-s[2]),t(r(e(a[1],s[0]),e(-s[1],a[0])),l[2]))),A[3]),r(t(r(t(r(e(s[1],A[0]),e(-A[1],s[0])),a[2]),r(t(r(e(a[1],A[0]),e(-A[1],a[0])),-s[2]),t(r(e(a[1],s[0]),e(-s[1],a[0])),A[2]))),-l[3]),t(r(t(r(e(o[1],A[0]),e(-A[1],o[0])),s[2]),r(t(r(e(s[1],A[0]),e(-A[1],s[0])),-o[2]),t(r(e(s[1],o[0]),e(-o[1],s[0])),A[2]))),a[3]))),r(t(r(t(r(e(o[1],A[0]),e(-A[1],o[0])),a[2]),r(t(r(e(a[1],A[0]),e(-A[1],a[0])),-o[2]),t(r(e(a[1],o[0]),e(-o[1],a[0])),A[2]))),-s[3]),r(t(r(t(r(e(s[1],A[0]),e(-A[1],s[0])),a[2]),r(t(r(e(a[1],A[0]),e(-A[1],a[0])),-s[2]),t(r(e(a[1],s[0]),e(-s[1],a[0])),A[2]))),o[3]),t(r(t(r(e(s[1],o[0]),e(-o[1],s[0])),a[2]),r(t(r(e(a[1],o[0]),e(-o[1],a[0])),-s[2]),t(r(e(a[1],s[0]),e(-s[1],a[0])),o[2]))),-A[3]))))),u=r(r(r(t(r(t(r(e(A[1],l[0]),e(-l[1],A[0])),o[2]),r(t(r(e(o[1],l[0]),e(-l[1],o[0])),-A[2]),t(r(e(o[1],A[0]),e(-A[1],o[0])),l[2]))),a[3]),t(r(t(r(e(A[1],l[0]),e(-l[1],A[0])),a[2]),r(t(r(e(a[1],l[0]),e(-l[1],a[0])),-A[2]),t(r(e(a[1],A[0]),e(-A[1],a[0])),l[2]))),-o[3])),r(t(r(t(r(e(o[1],l[0]),e(-l[1],o[0])),a[2]),r(t(r(e(a[1],l[0]),e(-l[1],a[0])),-o[2]),t(r(e(a[1],o[0]),e(-o[1],a[0])),l[2]))),A[3]),t(r(t(r(e(o[1],A[0]),e(-A[1],o[0])),a[2]),r(t(r(e(a[1],A[0]),e(-A[1],a[0])),-o[2]),t(r(e(a[1],o[0]),e(-o[1],a[0])),A[2]))),-l[3]))),r(r(t(r(t(r(e(o[1],l[0]),e(-l[1],o[0])),s[2]),r(t(r(e(s[1],l[0]),e(-l[1],s[0])),-o[2]),t(r(e(s[1],o[0]),e(-o[1],s[0])),l[2]))),a[3]),t(r(t(r(e(o[1],l[0]),e(-l[1],o[0])),a[2]),r(t(r(e(a[1],l[0]),e(-l[1],a[0])),-o[2]),t(r(e(a[1],o[0]),e(-o[1],a[0])),l[2]))),-s[3])),r(t(r(t(r(e(s[1],l[0]),e(-l[1],s[0])),a[2]),r(t(r(e(a[1],l[0]),e(-l[1],a[0])),-s[2]),t(r(e(a[1],s[0]),e(-s[1],a[0])),l[2]))),o[3]),t(r(t(r(e(s[1],o[0]),e(-o[1],s[0])),a[2]),r(t(r(e(a[1],o[0]),e(-o[1],a[0])),-s[2]),t(r(e(a[1],s[0]),e(-s[1],a[0])),o[2]))),-l[3])))),h=n(c,u);return h[h.length-1]}}function qd(r){return(r===3?yte:r===4?mte:wte)(gte,jd,ute,dte)}const Bte=qd(3),bte=qd(4),io=[function(){return 0},function(){return 0},function(e,t){return t[0]-e[0]},function(e,t,n){const i=(e[1]-n[1])*(t[0]-n[0]),a=(e[0]-n[0])*(t[1]-n[1]),s=i-a;let o;if(i>0){if(a<=0)return s;o=i+a}else if(i<0){if(a>=0)return s;o=-(i+a)}else return s;const A=pte*o;return s>=A||s<=-A?s:Bte(e,t,n)},function(e,t,n,i){const a=e[0]-i[0],s=t[0]-i[0],o=n[0]-i[0],A=e[1]-i[1],l=t[1]-i[1],c=n[1]-i[1],u=e[2]-i[2],h=t[2]-i[2],d=n[2]-i[2],f=s*c,g=o*l,p=o*A,v=a*c,y=a*l,m=s*A,B=u*(f-g)+h*(p-v)+d*(y-m),C=(Math.abs(f)+Math.abs(g))*Math.abs(u)+(Math.abs(p)+Math.abs(v))*Math.abs(h)+(Math.abs(y)+Math.abs(m))*Math.abs(d),S=vte*C;return B>S||-B>S?B:bte(e,t,n,i)}];function Ete(r){let e=io[r.length];return e||(e=io[r.length]=qd(r.length)),e.apply(void 0,...r)}function xte(r,e,t,n,i,a,s){return function(...A){switch(A.length){case 0:case 1:return 0;case 2:return n(A[0],A[1]);case 3:return i(A[0],A[1],A[2]);case 4:return a(A[0],A[1],A[2],A[3]);case 5:return s(A[0],A[1],A[2],A[3],A[4])}return r(A)}}function Cte(){for(;io.length<=$L;)io.push(qd(io.length));const r=xte(void 0,Ete,...io);for(let e=0;e<=$L;++e)r[e]=io[e];return r}const Kl=Cte(),YL=Kl[3];function Ste(r){const e=r.length;if(e<3){const o=new Array(e);for(let A=0;A<e;++A)o[A]=A;return e===2&&r[0][0]===r[1][0]&&r[0][1]===r[1][1]?[0]:o}const t=new Array(e);for(let o=0;o<e;++o)t[o]=o;t.sort((o,A)=>{const l=r[o][0]-r[A][0];return l||r[o][1]-r[A][1]});const n=[t[0],t[1]],i=[t[0],t[1]];for(let o=2;o<e;++o){const A=t[o],l=r[A];let c=n.length;for(;c>1&&YL(r[n[c-2]],r[n[c-1]],l)<=0;)c-=1,n.pop();for(n.push(A),c=i.length;c>1&&YL(r[i[c-2]],r[i[c-1]],l)>=0;)c-=1,i.pop();i.push(A)}const a=new Array(i.length+n.length-2);let s=0;for(let o=0,A=n.length;o<A;++o)a[s++]=n[o];for(let o=i.length-2;o>0;--o)a[s++]=i[o];return a}function Fte(r,e,t,n){for(let i=0;i<2;++i){const a=r[i],s=e[i],[o,A]=[Math.min(a,s),Math.max(a,s)],l=t[i],c=n[i],[u,h]=[Math.min(l,c),Math.max(l,c)];if(h<o||A<u)return!1}return!0}function Tte(r,e,t,n){const i=Kl(r,t,n),a=Kl(e,t,n);if(i>0&&a>0||i<0&&a<0)return!1;const s=Kl(t,r,e),o=Kl(n,r,e);return s>0&&o>0||s<0&&o<0?!1:i===0&&a===0&&s===0&&o===0?Fte(r,e,t,n):!0}function Mte(r){const e=[r[0]];let t=r[0];for(let n=1;n<r.length;n++){const i=r[n];(t[0]!==i[0]||t[1]!==i[1])&&e.push(i),t=i}return e}function Ote(r){return r.sort(function(e,t){return e[0]-t[0]||e[1]-t[1]})}function PB(r,e){return Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2)}function XL(r,e,t){const n=[e[0]-r[0],e[1]-r[1]],i=[t[0]-r[0],t[1]-r[1]],a=PB(r,e),s=PB(r,t);return(n[0]*i[0]+n[1]*i[1])/Math.sqrt(a*s)}function ZL(r,e){for(let t=0;t<e.length-1;t++){const n=[e[t],e[t+1]];if(!(r[0][0]===n[0][0]&&r[0][1]===n[0][1]||r[0][0]===n[1][0]&&r[0][1]===n[1][1])&&Tte(r[0],r[1],n[0],n[1]))return!0}return!1}function Ite(r){let e=1/0,t=1/0,n=-1/0,i=-1/0;for(let a=r.length-1;a>=0;a--)r[a][0]<e&&(e=r[a][0]),r[a][1]<t&&(t=r[a][1]),r[a][0]>n&&(n=r[a][0]),r[a][1]>i&&(i=r[a][1]);return[n-e,i-t]}function _te(r){return[Math.min(r[0][0],r[1][0]),Math.min(r[0][1],r[1][1]),Math.max(r[0][0],r[1][0]),Math.max(r[0][1],r[1][1])]}function kte(r,e,t){let n=null,i=eQ,a=eQ,s,o;for(let A=0;A<e.length;A++)s=XL(r[0],r[1],e[A]),o=XL(r[1],r[0],e[A]),s>i&&o>a&&!ZL([r[0],e[A]],t)&&!ZL([r[1],e[A]],t)&&(i=s,a=o,n=e[A]);return n}function JL(r,e,t,n,i){let a=!1;for(let s=0;s<r.length-1;s++){const o=[r[s],r[s+1]],A=o[0][0]+","+o[0][1]+","+o[1][0]+","+o[1][1];if(PB(o[0],o[1])<e||i.has(A))continue;let l=0,c=_te(o),u,h,d;do c=n.extendBbox(c,l),u=c[2]-c[0],h=c[3]-c[1],d=kte(o,n.rangePoints(c),r),l++;while(d===null&&(t[0]>u||t[1]>h));u>=t[0]&&h>=t[1]&&i.add(A),d!==null&&(r.splice(s+1,0,d),n.removePoint(d),a=!0)}return a?JL(r,e,t,n,i):r}function Nte(r,e,t){const n=e||20,i=Mte(Ote(UB.toXy(r,t)));if(i.length<4){const u=i.concat([i[0]]);return t?UB.fromXy(u,t):u}const a=Ite(i),s=[a[0]*tQ,a[1]*tQ],o=Ste(i).reverse().map(u=>i[u]);o.push(o[0]);const A=i.filter(function(u){return o.indexOf(u)<0}),l=Math.ceil(1/(i.length/(a[0]*a[1]))),c=JL(o,Math.pow(n,2),s,lte(A,l),new Set);return t?UB.fromXy(c,t):c}const eQ=Math.cos(90/(180/Math.PI)),tQ=.6;function Lte(r,e,t){if(r.length===1)return Qte(r[0],e,t);if(r.length===2)return nQ(r,e,t);if(r.length===3){const[n,i,a]=ev(r);if(LS(n,i,a))return nQ([n,a],e,t)}switch(t){case"smooth":return Pte(r,e);case"sharp":return Rte(r,e);default:return Ute(r,e)}}const Qte=(r,e,t)=>{if(t==="sharp")return[["M",r[0]-e,r[1]-e],["L",r[0]+e,r[1]-e],["L",r[0]+e,r[1]+e],["L",r[0]-e,r[1]+e],["Z"]];const n=[e,e,0,0,0];return[["M",r[0],r[1]-e],["A",...n,r[0],r[1]+e],["A",...n,r[0],r[1]-e]]},nQ=(r,e,t)=>{const n=[e,e,0,0,0],i=t==="sharp"?Ve(r[0],Za(fa(bt(r[0],r[1])),e)):r[0],a=t==="sharp"?Ve(r[1],Za(fa(bt(r[1],r[0])),e)):r[1],s=Za(fa(ah(bt(i,a),!1)),e),o=Za(s,-1),A=Ve(i,s),l=Ve(a,s),c=Ve(a,o),u=Ve(i,o);return t==="sharp"?[["M",A[0],A[1]],["L",l[0],l[1]],["L",c[0],c[1]],["L",u[0],u[1]],["Z"]]:[["M",A[0],A[1]],["L",l[0],l[1]],["A",...n,c[0],c[1]],["L",u[0],u[1]],["A",...n,A[0],A[1]]]},Ute=(r,e)=>{const t=ev(r).map((o,A)=>{const l=(A-2+r.length)%r.length,c=(A-1+r.length)%r.length,u=(A+1)%r.length,h=r[l],d=r[c],f=r[u],g=bt(h,d),p=bt(d,o),v=bt(o,f),y=(F,T)=>Xp(F,T,!0)<Math.PI,m=y(g,p),B=y(p,v),C=F=>Za(fa(ah(F,!1)),e),S=C(p);return[{p:Ks(m?Ve(d,C(g)):Ve(d,S)),concave:m&&d},{p:Ks(B?Ve(o,C(v)):Ve(o,S)),concave:B&&o}]}),n=[e,e,0,0,0],i=t.findIndex((o,A)=>!t[(A-1+t.length)%t.length][0].concave&&!t[(A-1+t.length)%t.length][1].concave&&!o[0].concave&&!o[0].concave&&!o[1].concave),a=t.slice(i).concat(t.slice(0,i));let s=[];return a.flatMap((o,A)=>{const l=[],c=a[t.length-1];return A===0&&l.push(["M",...c[1].p]),o[0].concave?s.push(o[0].p,o[1].p):l.push(["A",...n,...o[0].p]),o[1].concave?s.unshift(o[1].p):l.push(["L",...o[1].p]),s.length===3&&(l.pop(),l.push(["C",...s.flat()]),s=[]),l})},Pte=(r,e)=>{const t=ev(r).map((n,i)=>{const a=r[(i+1)%r.length];return{p:n,v:fa(bt(a,n))}});return t.forEach((n,i)=>{const a=i>0?i-1:r.length-1,s=t[a].v,o=fa(Ve(s,Za(n.v,Xp(s,n.v,!0)<Math.PI?1:-1)));n.p=Ve(n.p,Za(o,e))}),YS(t.map(n=>n.p))},Rte=(r,e)=>{const n=r.map((a,s)=>{const o=r[s===0?r.length-1:s-1],A=hl(Za(fa(ah(bt(o,a),!1)),e));return[Ve(o,A),Ve(a,A)]}).flat();return n.map((a,s)=>{if(s%2===0)return null;const o=[n[(s-1)%n.length],n[s%n.length]],A=[n[(s+1)%n.length],n[(s+2)%n.length]];return Jp(o,A,!0)}).filter(Boolean).map((a,s)=>[s===0?"M":"L",a[0],a[1]]).concat([["Z"]])};var Dte=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};class $d extends Qn{constructor(e,t){super(e,Object.assign({},$d.defaultOptions,t)),this.hullMemberIds=[],this.drawHull=()=>{if(!this.shape)this.shape=new pl({style:this.getHullStyle()}),this.context.canvas.appendChild(this.shape);else{const n=!Xt(this.optionsCache,this.options);this.shape.update(this.getHullStyle(n))}this.optionsCache=Object.assign({},this.options)},this.updateHullPath=n=>{this.shape&&this.options.members.includes(X(n.data))&&this.shape.update({d:this.getHullPath(!0)})},this.getHullPath=(n=!1)=>{const{graph:i}=this.context,a=this.getMember();if(a.length===0)return"";const s=a.map(l=>i.getNodeData(l)),o=Nte(s.map(Fn),this.options.concavity).slice(1).reverse(),A=o.flatMap(l=>s.filter(c=>Xt(Fn(c),l)).map(X));return Xt(A,this.hullMemberIds)&&!n?this.path:(this.hullMemberIds=A,this.path=Lte(o,this.getPadding(),this.options.corner),this.path)},this.bindEvents()}bindEvents(){this.context.graph.on(fe.AFTER_RENDER,this.drawHull),this.context.graph.on(fe.AFTER_ELEMENT_UPDATE,this.updateHullPath)}unbindEvents(){this.context.graph.off(fe.AFTER_RENDER,this.drawHull),this.context.graph.off(fe.AFTER_ELEMENT_UPDATE,this.updateHullPath)}getHullStyle(e){const t=this.options,{members:n,padding:i,corner:a}=t,s=Dte(t,["members","padding","corner"]);return Object.assign(Object.assign({},s),{d:this.getHullPath(e)})}getPadding(){const{graph:e}=this.context;return this.hullMemberIds.reduce((n,i)=>{const{halfExtents:a}=e.getElementRenderBounds(i),s=Math.max(a[0],a[1]);return Math.max(n,s)},0)+this.options.padding}addMember(e){const t=Array.isArray(e)?e:[e];this.options.members=[...new Set([...this.options.members,...t])],this.shape.update({d:this.getHullPath()})}removeMember(e){const t=Array.isArray(e)?e:[e];this.options.members=this.options.members.filter(n=>!t.includes(n)),t.some(n=>this.hullMemberIds.includes(n))&&this.shape.update({d:this.getHullPath()})}updateMember(e){this.options.members=Te(e)?e(this.options.members):e,this.shape.update(this.getHullStyle(!0))}getMember(){return this.options.members}destroy(){this.unbindEvents(),this.shape.destroy(),this.hullMemberIds=[],super.destroy()}}$d.defaultOptions={members:[],padding:10,corner:"rounded",concavity:1/0,fill:"lightblue",fillOpacity:.2,labelOpacity:1,stroke:"blue",strokeOpacity:.2};function rQ(r,e){e(r),r.children&&r.children.forEach(function(t){t&&rQ(t,e)})}function zl(r){Yd(r,!0)}function Ti(r){Yd(r,!1)}function Yd(r,e){var t=e?"visible":"hidden";rQ(r,function(n){n.attr("visibility",t)})}var Hte=(function(r){Xe(e,r);function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=r.apply(this,Ie([],H(t),!1))||this;return i.isMutationObserved=!0,i.addEventListener(at.INSERTED,function(){Ti(i)}),i}return e})(Cn);function iQ(r){var e=r.appendChild(new Hte({class:"offscreen"}));return Ti(e),e}function Gte(r){for(var e=r;e;){if(e.className==="offscreen")return!0;e=e.parent}return!1}var RB=(function(r){Xe(e,r);function e(t){t===void 0&&(t={});var n=t.style,i=Pt(t,["style"]);return r.call(this,se({style:se({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},n)},i))||this}return Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=iQ(this)),this._offscreen},enumerable:!1,configurable:!0}),e.prototype.disconnectedCallback=function(){var t;(t=this._offscreen)===null||t===void 0||t.destroy()},e})(ks);function aA(r){return r*Math.PI/180}function aQ(r){return Number((r*180/Math.PI).toPrecision(5))}var dr=(function(){function r(e,t,n,i){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0),i===void 0&&(i=0),this.x=0,this.y=0,this.width=0,this.height=0,this.x=e,this.y=t,this.width=n,this.height=i}return Object.defineProperty(r.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),r.fromRect=function(e){return new r(e.x,e.y,e.width,e.height)},r.prototype.toJSON=function(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.top,right:this.right,bottom:this.bottom,left:this.left}},r.prototype.isPointIn=function(e,t){return e>=this.left&&e<=this.right&&t>=this.top&&t<=this.bottom},r})();function Mr(r,e){return Te(r)?r.apply(void 0,Ie([],H(e),!1)):r}var Mi=function(r,e){var t=function(i){return"".concat(e,"-").concat(i)},n=Object.fromEntries(Object.entries(r).map(function(i){var a=H(i,2),s=a[0],o=a[1],A=t(o);return[s,{name:A,class:".".concat(A),id:"#".concat(A),toString:function(){return A}}]}));return Object.assign(n,{prefix:t}),n},Kte=5,sQ=function(r,e,t,n){t===void 0&&(t=0),n===void 0&&(n=Kte),Object.entries(e).forEach(function(i){var a=H(i,2),s=a[0],o=a[1],A=r;Object.prototype.hasOwnProperty.call(e,s)&&(o?po(o)?(po(r[s])||(A[s]={}),t<n?sQ(r[s],o,t+1,n):A[s]=e[s]):mr(o)?(A[s]=[],A[s]=A[s].concat(o)):A[s]=o:A[s]=o)})},bn=function(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var n=0;n<e.length;n+=1)sQ(r,e[n]);return r},zte=function(r){return r!==void 0&&r!=null&&!Number.isNaN(r)},Xd,Vte=$f(function(r,e){var t=e.fontSize,n=e.fontFamily,i=e.fontWeight,a=e.fontStyle,s=e.fontVariant;return Xd||(Xd=he.offscreenCanvasCreator.getOrCreateContext(void 0)),Xd.font=[a,s,i,"".concat(t,"px"),n].join(" "),Xd.measureText(r).width},function(r,e){return[r,Object.values(e||oQ(r)).join()].join("")},4096),oQ=function(r){var e=r.style.fontFamily||"sans-serif",t=r.style.fontWeight||"normal",n=r.style.fontStyle||"normal",i=r.style.fontVariant,a=r.style.fontSize;return a=typeof a=="object"?a.value:a,{fontSize:a,fontFamily:e,fontWeight:t,fontStyle:n,fontVariant:i}};function AQ(r){return r.nodeName==="text"?r:r.nodeName==="g"&&r.children.length===1&&r.children[0].nodeName==="text"?r.children[0]:null}function lQ(r,e){var t=AQ(r);t&&t.attr(e)}function DB(r,e,t){t===void 0&&(t="..."),lQ(r,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:t})}function jte(r,e,t,n){t===void 0&&(t=2),n===void 0&&(n="top"),lQ(r,{wordWrap:!0,wordWrapWidth:e,maxLines:t,textBaseline:n})}function cQ(r){var e=r.nativeEvent,t=r.touches,n=r.clientX,i=r.clientY;if(e)return[e.clientX,e.clientY];if(t){var a=t[0],s=a.clientX,o=a.clientY;return[s,o]}return typeof n=="number"&&typeof i=="number"?[n,i]:[0,0]}function Ba(r){return typeof r=="function"?r():ot(r)||Be(r)?new RB({style:{text:String(r)}}):r}function Wte(r,e){return typeof r=="function"?r():ot(r)||Be(r)?new Os({style:se(se({pointerEvents:"auto"},e),{innerHTML:r})}):r}function qte(r,e){return r.reduce(function(t,n){return(t[n[e]]=t[n[e]]||[]).push(n),t},{})}function Or(r,e,t,n,i){return n===void 0&&(n=!0),i===void 0&&(i=function(a){a.node().removeChildren()}),r?t(e):(n&&i(e),null)}function jn(r,e,t,n,i){return n===void 0&&(n=!0),i===void 0&&(i=!1),n&&r===e||i&&r===t?!0:r>e&&r<t}var $te=function(r,e){return function(t){return r*(1-t)+e*t}};function Yte(r,e){var t=e?e.length:0,n=r?Math.min(t,r.length):0;return function(i){var a=new Array(n),s=new Array(t),o=0;for(o=0;o<n;++o)a[o]=HB(r[o],e[o]);for(;o<t;++o)s[o]=e[o];for(o=0;o<n;++o)s[o]=a[o](i);return s}}function Xte(r,e){r===void 0&&(r={}),e===void 0&&(e={});var t={},n={};return Object.entries(e).forEach(function(i){var a=H(i,2),s=a[0],o=a[1];s in r?t[s]=HB(r[s],o):n[s]=o}),function(i){return Object.entries(t).forEach(function(a){var s=H(a,2),o=s[0],A=s[1];return n[o]=A(i)}),n}}function HB(r,e){return typeof r=="number"&&typeof e=="number"?$te(r,e):Array.isArray(r)&&Array.isArray(e)?Yte(r,e):typeof r=="object"&&typeof e=="object"?Xte(r,e):(function(t){return r})}function Zte(r,e,t,n){if(!n)return r.attr("__keyframe_data__",t),null;var i=n.duration,a=i===void 0?0:i,s=HB(e,t),o=Math.ceil(+a/16),A=new Array(o).fill(0).map(function(l,c,u){return{__keyframe_data__:s(c/(u.length-1))}});return r.animate(A,se({fill:"both"},n))}function ba(r,e){return[r[0]*e,r[1]*e]}function Vl(r,e){return[r[0]+e[0],r[1]+e[1]]}function GB(r,e){return[r[0]-e[0],r[1]-e[1]]}function ao(r,e){return[Math.min(r[0],e[0]),Math.min(r[1],e[1])]}function so(r,e){return[Math.max(r[0],e[0]),Math.max(r[1],e[1])]}function jl(r,e){return Math.sqrt(Math.pow(r[0]-e[0],2)+Math.pow(r[1]-e[1],2))}function uQ(r){if(r[0]===0&&r[1]===0)return[0,0];var e=Math.sqrt(Math.pow(r[0],2)+Math.pow(r[1],2));return[r[0]/e,r[1]/e]}function Jte(r,e){return e?[r[1],-r[0]]:[-r[1],r[0]]}function hQ(r,e){return+r.toPrecision(e)}function KB(r,e){var t={},n=Array.isArray(e)?e:[e];for(var i in r)n.includes(i)||(t[i]=r[i]);return t}function ene(r,e,t,n){var i,a=[],s=!!n,o,A,l=[1/0,1/0],c=[-1/0,-1/0],u,h,d;if(s){i=H(n,2),l=i[0],c=i[1];for(var f=0,g=r.length;f<g;f+=1){var p=r[f];l=ao(l,p),c=so(c,p)}}for(var f=0,v=r.length;f<v;f+=1){var p=r[f];if(f===0)d=p;else if(f===v-1)h=p,a.push(d),a.push(h);else{var y=[f?f-1:v-1,f-1][1];o=r[y],A=r[f+1];var m=[0,0];m=GB(A,o),m=ba(m,e);var B=jl(p,o),C=jl(p,A),S=B+C;S!==0&&(B/=S,C/=S);var F=ba(m,-B),T=ba(m,C);h=Vl(p,F),u=Vl(p,T),u=ao(u,so(A,p)),u=so(u,ao(A,p)),F=GB(u,p),F=ba(F,-B/C),h=Vl(p,F),h=ao(h,so(o,p)),h=so(h,ao(o,p)),T=GB(p,h),T=ba(T,C/B),u=Vl(p,T),s&&(h=so(h,l),h=ao(h,c),u=so(u,l),u=ao(u,c)),a.push(d),a.push(h),d=u}}return a}function tne(r,e,t){t===void 0&&(t=[[0,0],[1,1]]);for(var n=!1,i=[],a=0,s=r.length;a<s;a+=2)i.push([r[a],r[a+1]]);for(var o=ene(i,.4,n,t),A=i.length,l=[],c,u,h,a=0;a<A-1;a+=1)c=o[a*2],u=o[a*2+1],h=i[a+1],l.push(["C",c[0],c[1],u[0],u[1],h[0],h[1]]);return l}var nne=["$el","cx","cy","d","dx","dy","fill","fillOpacity","filter","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","height","img","increasedLineWidthForHitTesting","innerHTML","isBillboard","billboardRotation","isSizeAttenuation","isClosed","isOverflowing","leading","letterSpacing","lineDash","lineHeight","lineWidth","markerEnd","markerEndOffset","markerMid","markerStart","markerStartOffset","maxLines","metrics","miterLimit","offsetX","offsetY","opacity","path","points","r","radius","rx","ry","shadowColor","src","stroke","strokeOpacity","text","textAlign","textBaseline","textDecorationColor","textDecorationLine","textDecorationStyle","textOverflow","textPath","textPathSide","textPathStartOffset","transform","transformOrigin","visibility","width","wordWrap","wordWrapWidth","x","x1","x2","y","y1","y2","z1","z2","zIndex"];function rne(r){return nne.includes(r)}function dQ(r){var e={};for(var t in r)rne(t)&&(e[t]=r[t]);return e}function ine(r,e){if(r.length<=e)return r;for(var t=Math.floor(r.length/e),n=[],i=0;i<r.length;i+=t)n.push(r[i]);return n}function zB(r,e,t){var n=r.getBBox(),i=n.width,a=n.height,s=e/Math.max(i,a);return r.style.transform="scale(".concat(s,")"),s}function ane(r,e){var t=new Map;return r.forEach(function(n){var i=e(n);t.has(i)||t.set(i,[]),t.get(i).push(n)}),t}function sne(r){throw new Error(r)}var one=(function(){function r(i,a,s,o,A,l,c){i===void 0&&(i=null),a===void 0&&(a=null),s===void 0&&(s=null),o===void 0&&(o=null),A===void 0&&(A=[null,null,null,null,null]),l===void 0&&(l=[]),c===void 0&&(c=[]),e.add(this),this._elements=Array.from(i),this._data=a,this._parent=s,this._document=o,this._enter=A[0],this._update=A[1],this._exit=A[2],this._merge=A[3],this._split=A[4],this._transitions=l,this._facetElements=c}r.prototype.selectAll=function(i){var a=typeof i=="string"?this._parent.querySelectorAll(i):i;return new t(a,null,this._elements[0],this._document)},r.prototype.selectFacetAll=function(i){var a=typeof i=="string"?this._parent.querySelectorAll(i):i;return new t(this._elements,null,this._parent,this._document,void 0,void 0,a)},r.prototype.select=function(i){var a=typeof i=="string"?this._parent.querySelectorAll(i)[0]||null:i;return new t([a],null,a,this._document)},r.prototype.append=function(i){var a=this,s=typeof i=="function"?i:function(){return a.createElement(i)},o=[];if(this._data!==null){for(var A=0;A<this._data.length;A++){var l=this._data[A],c=H(Array.isArray(l)?l:[l,null],2),u=c[0],h=c[1],d=s(u,A);d.__data__=u,h!==null&&(d.__fromElements__=h),this._parent.appendChild(d),o.push(d)}return new t(o,null,this._parent,this._document)}for(var A=0;A<this._elements.length;A++){var f=this._elements[A],u=f.__data__,d=s(u,A);f.appendChild(d),o.push(d)}return new t(o,null,o[0],this._document)},r.prototype.maybeAppend=function(i,a){var s=eg(this,e,"m",n).call(this,i[0]==="#"?i:"#".concat(i),a);return s.attr("id",i),s},r.prototype.maybeAppendByClassName=function(i,a){var s=i.toString(),o=eg(this,e,"m",n).call(this,s[0]==="."?s:".".concat(s),a);return o.attr("className",s),o},r.prototype.maybeAppendByName=function(i,a){var s=eg(this,e,"m",n).call(this,'[name="'.concat(i,'"]'),a);return s.attr("name",i),s},r.prototype.data=function(i,a,s){var o,A;a===void 0&&(a=function(I){return I}),s===void 0&&(s=function(){return null});for(var l=[],c=[],u=new Set(this._elements),h=[],d=new Set,f=new Map(this._elements.map(function(I,k){return[a(I.__data__,k),I]})),g=new Map(this._facetElements.map(function(I,k){return[a(I.__data__,k),I]})),p=ane(this._elements,function(I){return s(I.__data__)}),v=0;v<i.length;v++){var y=i[v],m=a(y,v),B=s(y,v);if(f.has(m)){var C=f.get(m);C.__data__=y,C.__facet__=!1,c.push(C),u.delete(C),f.delete(m)}else if(g.has(m)){var C=g.get(m);C.__data__=y,C.__facet__=!0,c.push(C),g.delete(m)}else if(p.has(m)){var S=p.get(m);h.push([y,S]);try{for(var F=(o=void 0,bA(S)),T=F.next();!T.done;T=F.next()){var C=T.value;u.delete(C)}}catch(I){o={error:I}}finally{try{T&&!T.done&&(A=F.return)&&A.call(F)}finally{if(o)throw o.error}}p.delete(m)}else if(f.has(B)){var C=f.get(B);C.__toData__?C.__toData__.push(y):C.__toData__=[y],d.add(C),u.delete(C)}else l.push(y)}var O=[new t([],l,this._parent,this._document),new t(c,null,this._parent,this._document),new t(u,null,this._parent,this._document),new t([],h,this._parent,this._document),new t(d,null,this._parent,this._document)];return new t(this._elements,null,this._parent,this._document,O)},r.prototype.merge=function(i){var a=Ie(Ie([],H(this._elements),!1),H(i._elements),!1),s=Ie(Ie([],H(this._transitions),!1),H(i._transitions),!1);return new t(a,null,this._parent,this._document,void 0,s)},r.prototype.createElement=function(i){if(this._document)return this._document.createElement(i,{});var a=t.registry[i];return a?new a:sne("Unknown node type: ".concat(i))},r.prototype.join=function(i,a,s,o,A){i===void 0&&(i=function(f){return f}),a===void 0&&(a=function(f){return f}),s===void 0&&(s=function(f){return f.remove()}),o===void 0&&(o=function(f){return f}),A===void 0&&(A=function(f){return f.remove()});var l=i(this._enter),c=a(this._update),u=s(this._exit),h=o(this._merge),d=A(this._split);return c.merge(l).merge(u).merge(h).merge(d)},r.prototype.remove=function(){for(var i=function(o){var A=a._elements[o],l=a._transitions[o];l?l.then(function(){return A.remove()}):A.remove()},a=this,s=0;s<this._elements.length;s++)i(s);return new t([],null,this._parent,this._document,void 0,this._transitions)},r.prototype.each=function(i){for(var a=0;a<this._elements.length;a++){var s=this._elements[a],o=s.__data__;i.call(s,o,a)}return this},r.prototype.attr=function(i,a){var s=typeof a!="function"?function(){return a}:a;return this.each(function(o,A){a!==void 0&&(this[i]=s.call(this,o,A))})},r.prototype.style=function(i,a,s){s===void 0&&(s=!0);var o=typeof a!="function"||!s?function(){return a}:a;return this.each(function(A,l){a!==void 0&&(this.style[i]=o.call(this,A,l))})},r.prototype.styles=function(i,a){return i===void 0&&(i={}),a===void 0&&(a=!0),this.each(function(s,o){var A=this;Object.entries(i).forEach(function(l){var c=H(l,2),u=c[0],h=c[1],d=typeof h!="function"||!a?function(){return h}:h;h!==void 0&&A.attr(u,d.call(A,s,o))})})},r.prototype.update=function(i,a){a===void 0&&(a=!0);var s=typeof i!="function"||!a?function(){return i}:i;return this.each(function(o,A){i&&this.update&&this.update(s.call(this,o,A))})},r.prototype.maybeUpdate=function(i,a){a===void 0&&(a=!0);var s=typeof i!="function"||!a?function(){return i}:i;return this.each(function(o,A){i&&this.update&&this.update(s.call(this,o,A))})},r.prototype.transition=function(i){this._transitions;var a=new Array(this._elements.length);return this.each(function(s,o){a[o]=i.call(this,s,o)}),this._transitions=fR(a),this},r.prototype.on=function(i,a){return this.each(function(){this.addEventListener(i,a)}),this},r.prototype.call=function(i){for(var a=[],s=1;s<arguments.length;s++)a[s-1]=arguments[s];return i.call.apply(i,Ie([this._parent,this],H(a),!1)),this},r.prototype.node=function(){return this._elements[0]},r.prototype.nodes=function(){return this._elements},r.prototype.transitions=function(){return this._transitions.filter(function(i){return!!i})},r.prototype.parent=function(){return this._parent};var e,t,n;return t=r,e=new WeakSet,n=function(a,s){var o=this._elements[0],A=o.querySelector(a);if(A)return new t([A],null,this._parent,this._document);var l=typeof s=="string"?this.createElement(s):s();return o.appendChild(l),new t([l],null,this._parent,this._document)},r.registry={g:Cn,rect:Gn,circle:zi,path:tr,text:RB,ellipse:UA,image:PA,line:Is,polygon:_s,polyline:Gc,html:Os},r})();function Me(r){return new one([r],null,r,r.ownerDocument)}function Ane(r,e,t){return r.querySelector(e)?Me(r).select(e):Me(r).append(t)}function Wn(r){if(Be(r))return[r,r,r,r];if(mr(r)){var e=r.length;if(e===1)return[r[0],r[0],r[0],r[0]];if(e===2)return[r[0],r[1],r[0],r[1]];if(e===3)return[r[0],r[1],r[2],r[1]];if(e===4)return r}return[0,0,0,0]}function fQ(r){var e=r.getLocalBounds(),t=e.min,n=e.max,i=H([t,n],2),a=H(i[0],2),s=a[0],o=a[1],A=H(i[1],2),l=A[0],c=A[1];return{x:s,y:o,width:l-s,height:c-o,left:s,bottom:c,top:o,right:l}}function lne(r,e){var t=H(r,2),n=t[0],i=t[1],a=H(e,2),s=a[0],o=a[1];return n!==s&&i===o}function cne(r,e){var t,n,i=e.attributes;try{for(var a=bA(Object.entries(i)),s=a.next();!s.done;s=a.next()){var o=H(s.value,2),A=o[0],l=o[1];A!=="id"&&A!=="className"&&r.attr(A,l)}}catch(c){t={error:c}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}}function VB(r){return r.toString().charAt(0).toUpperCase()+r.toString().slice(1)}function une(r){return r.toString().charAt(0).toLowerCase()+r.toString().slice(1)}function hne(r,e){return"".concat(e).concat(VB(r))}function gQ(r,e,t){var n;t===void 0&&(t=!0);var i=e||((n=r.match(/^([a-z][a-z0-9]+)/))===null||n===void 0?void 0:n[0])||"",a=r.replace(new RegExp("^(".concat(i,")")),"");return t?une(a):a}function dne(r,e){Object.entries(e).forEach(function(t){var n=H(t,2),i=n[0],a=n[1];Ie([r],H(r.querySelectorAll(i)),!1).filter(function(s){return s.matches(i)}).forEach(function(s){if(s){var o=s;o.style.cssText+=Object.entries(a).reduce(function(A,l){return"".concat(A).concat(l.join(":"),";")},"")}})})}var Zd=function(r,e){if(!r?.startsWith(e))return!1;var t=r[e.length];return t>="A"&&t<="Z"};function je(r,e,t){t===void 0&&(t=!1);var n={};return Object.entries(r).forEach(function(i){var a=H(i,2),s=a[0],o=a[1];if(!(s==="className"||s==="class")){if(Zd(s,"show")&&Zd(gQ(s,"show"),e)!==t)s===hne(e,"show")?n[s]=o:n[s.replace(new RegExp(VB(e)),"")]=o;else if(!Zd(s,"show")&&Zd(s,e)!==t){var A=gQ(s,e);A==="filter"&&typeof o=="function"||(n[A]=o)}}}),n}function sA(r,e){return Object.entries(r).reduce(function(t,n){var i=H(n,2),a=i[0],s=i[1];return a.startsWith("show")?t["show".concat(e).concat(a.slice(4))]=s:t["".concat(e).concat(VB(a))]=s,t},{})}function Ea(r,e){e===void 0&&(e=["x","y","class","className"]);var t=["transform","transformOrigin","anchor","visibility","pointerEvents","zIndex","cursor","clipPath","clipPathTargets","offsetPath","offsetPathTargets","offsetDistance","draggable","droppable"],n={},i={};return Object.entries(r).forEach(function(a){var s=H(a,2),o=s[0],A=s[1];e.includes(o)||(t.indexOf(o)!==-1?i[o]=A:n[o]=A)}),[n,i]}function Ir(r,e){var t={YYYY:r.getFullYear(),MM:r.getMonth()+1,DD:r.getDate(),HH:r.getHours(),mm:r.getMinutes(),ss:r.getSeconds()},n=e;return Object.keys(t).forEach(function(i){var a=t[i];n=n.replace(i,i==="YYYY"?"".concat(a):"".concat(a).padStart(2,"0"))}),n}function fne(r,e,t){var n=r.getBBox(),i=n.width,a=n.height,s=H([e,t].map(function(l,c){var u;return l.includes("%")?parseFloat(((u=l.match(/[+-]?([0-9]*[.])?[0-9]+/))===null||u===void 0?void 0:u[0])||"0")/100*(c===0?i:a):l}),2),o=s[0],A=s[1];return[o,A]}function pQ(r,e){if(e)try{var t=/translate\(([+-]*[\d]+[%]*),[ ]*([+-]*[\d]+[%]*)\)/g,n=e.replace(t,function(i,a,s){return"translate(".concat(fne(r,a,s),")")});r.attr("transform",n)}catch{}}function gne(r){var e;return((e=r[0])===null||e===void 0?void 0:e.map(function(t,n){return r.map(function(i){return i[n]})}))||[]}var vQ=function(r,e){if(e==null){r.innerHTML="";return}r.replaceChildren?Array.isArray(e)?r.replaceChildren.apply(r,Ie([],H(e),!1)):r.replaceChildren(e):(r.innerHTML="",Array.isArray(e)?e.forEach(function(t){return r.appendChild(t)}):r.appendChild(e))};function Jd(r){return/\S+-\S+/g.test(r)?r.split("-").map(function(e){return e[0]}):r.length>2?[r[0]]:r.split("")}var pne=function(r){var e=new DOMParser,t=e.parseFromString(r,"text/html"),n=t.body.firstElementChild;if(console.log(n?.getClientRects(),11),!n)return 0;var i=n.getAttribute("style")||"",a=Object.fromEntries(i.split(";").map(function(p){return p.trim()}).filter(function(p){return p.includes(":")}).map(function(p){var v=H(p.split(":").map(function(B){return B.trim()}),2),y=v[0],m=v[1];return[y.toLowerCase(),m]})),s=function(p){if(!p)return 0;var v=p.match(/([\d.]+)px/);return v?parseFloat(v[1]):0};if(a.height)return s(a.height);var o=s(a["font-size"])||16,A=a["line-height"],l;!A||A==="normal"?l=1.2*o:A.endsWith("px")?l=s(A):/^[\d.]+$/.test(A)?l=parseFloat(A)*o:l=o;var c=s(a["padding-top"]),u=s(a["padding-bottom"]);if(a.padding){var h=a.padding.split(/\s+/).map(s);h.length===1||h.length===2?(c=h[0],u=h[0]):(h.length===3||h.length===4)&&(c=h[0],u=h[2])}var d=s(a["border-top-width"]),f=s(a["border-bottom-width"]);if(a.border){var g=a.border.match(/([\d.]+)px/);g&&(d=parseFloat(g[1]),f=parseFloat(g[1]))}if(a["border-width"]){var h=a["border-width"].split(/\s+/).map(s);h.length===1||h.length===2?(d=h[0],f=h[0]):(h.length===3||h.length===4)&&(d=h[0],f=h[2])}return l+c+u+d+f};function vne(){Yd(this,this.attributes.visibility!=="hidden")}var en=(function(r){Xe(e,r);function e(t,n){n===void 0&&(n={});var i=r.call(this,bn({},{style:n},t))||this;return i.initialized=!1,i._defaultOptions=n,i}return Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=iQ(this)),this._offscreen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"defaultOptions",{get:function(){return this._defaultOptions},enumerable:!1,configurable:!0}),e.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this),this.initialized=!0},e.prototype.disconnectedCallback=function(){var t;(t=this._offscreen)===null||t===void 0||t.destroy()},e.prototype.attributeChangedCallback=function(t){t==="visibility"&&vne.call(this)},e.prototype.update=function(t,n){var i;return this.attr(bn({},this.attributes,t||{})),(i=this.render)===null||i===void 0?void 0:i.call(this,this.attributes,this,n)},e.prototype.clear=function(){this.removeChildren()},e.prototype.bindEvents=function(t,n){},e.prototype.getSubShapeStyle=function(t){t.x,t.y,t.transform,t.transformOrigin,t.class,t.className,t.zIndex;var n=Pt(t,["x","y","transform","transformOrigin","class","className","zIndex"]);return n},e})(QA),yQ=function(r,e,t){return[["M",r-t,e],["A",t,t,0,1,0,r+t,e],["A",t,t,0,1,0,r-t,e],["Z"]]},yne=yQ,mne=function(r,e,t){return[["M",r-t,e-t],["L",r+t,e-t],["L",r+t,e+t],["L",r-t,e+t],["Z"]]},wne=function(r,e,t){return[["M",r-t,e],["L",r,e-t],["L",r+t,e],["L",r,e+t],["Z"]]},Bne=function(r,e,t){var n=t*Math.sin(.3333333333333333*Math.PI);return[["M",r-t,e+n],["L",r,e-n],["L",r+t,e+n],["Z"]]},bne=function(r,e,t){var n=t*Math.sin(.3333333333333333*Math.PI);return[["M",r-t,e-n],["L",r+t,e-n],["L",r,e+n],["Z"]]},Ene=function(r,e,t){var n=t/2*Math.sqrt(3);return[["M",r,e-t],["L",r+n,e-t/2],["L",r+n,e+t/2],["L",r,e+t],["L",r-n,e+t/2],["L",r-n,e-t/2],["Z"]]},xne=function(r,e,t){var n=t-1.5;return[["M",r-t,e-n],["L",r+t,e+n],["L",r+t,e-n],["L",r-t,e+n],["Z"]]},mQ=function(r,e,t){return[["M",r,e+t],["L",r,e-t]]},Cne=function(r,e,t){return[["M",r-t,e-t],["L",r+t,e+t],["M",r+t,e-t],["L",r-t,e+t]]},Sne=function(r,e,t){return[["M",r-t/2,e-t],["L",r+t/2,e-t],["M",r,e-t],["L",r,e+t],["M",r-t/2,e+t],["L",r+t/2,e+t]]},Fne=function(r,e,t){return[["M",r-t,e],["L",r+t,e],["M",r,e-t],["L",r,e+t]]},Tne=function(r,e,t){return[["M",r-t,e],["L",r+t,e]]},wQ=function(r,e,t){return[["M",r-t,e],["L",r+t,e]]},Mne=wQ,One=function(r,e,t){return[["M",r-t,e],["A",t/2,t/2,0,1,1,r,e],["A",t/2,t/2,0,1,0,r+t,e]]},Ine=function(r,e,t){return[["M",r-t-1,e-2.5],["L",r,e-2.5],["L",r,e+2.5],["L",r+t+1,e+2.5]]},_ne=function(r,e,t){return[["M",r-t-1,e+2.5],["L",r,e+2.5],["L",r,e-2.5],["L",r+t+1,e-2.5]]},kne=function(r,e,t){return[["M",r-(t+1),e+2.5],["L",r-t/2,e+2.5],["L",r-t/2,e-2.5],["L",r+t/2,e-2.5],["L",r+t/2,e+2.5],["L",r+t+1,e+2.5]]};function Nne(r,e){return[["M",r-5,e+2.5],["L",r-5,e],["L",r,e],["L",r,e-3],["L",r,e+3],["L",r+6.5,e+3]]}var Lne=function(r,e,t){return[["M",r-t,e-t],["L",r+t,e],["L",r-t,e+t],["Z"]]},Qne=function(r,e,t){var n=t,i=t*.2,a=t*.7;return[["M",r-n,e],["A",n,n,0,1,0,r+n,e],["A",n,n,0,1,0,r-n,e],["Z"],["M",r-a,e],["L",r-i,e],["M",r+i,e],["L",r+a,e],["M",r,e-a],["L",r,e-i],["M",r,e+i],["L",r,e+a]]};function Une(r){var e="default";if(on(r)&&r instanceof Image)e="image";else if(Te(r))e="symbol";else if(ot(r)){var t=new RegExp("data:(image|text)");r.match(t)?e="base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(r)?e="url":e="symbol"}return e}function Pne(r){var e=Une(r);return["base64","url","image"].includes(e)?"image":r&&e==="symbol"?"path":null}var gt=(function(r){Xe(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.render=function(t,n){var i=t.x,a=i===void 0?0:i,s=t.y,o=s===void 0?0:s,A=this.getSubShapeStyle(t),l=A.symbol,c=A.size,u=c===void 0?16:c,h=Pt(A,["symbol","size"]),d=Pne(l);Or(!!d,Me(n),function(f){f.maybeAppendByClassName("marker",d).attr("className","marker ".concat(d,"-marker")).call(function(g){if(d==="image"){var p=u*2;g.styles({img:l,width:p,height:p,x:a-u,y:o-u})}else{var p=u/2,v=Te(l)?l:e.getSymbol(l);g.styles(se({d:v?.(a,o,p)},h))}})})},e.MARKER_SYMBOL_MAP=new Map,e.registerSymbol=function(t,n){e.MARKER_SYMBOL_MAP.set(t,n)},e.getSymbol=function(t){return e.MARKER_SYMBOL_MAP.get(t)},e.getSymbols=function(){return Array.from(e.MARKER_SYMBOL_MAP.keys())},e})(en);gt.registerSymbol("cross",Cne),gt.registerSymbol("hyphen",Tne),gt.registerSymbol("line",mQ),gt.registerSymbol("plus",Fne),gt.registerSymbol("tick",Sne),gt.registerSymbol("circle",yQ),gt.registerSymbol("point",yne),gt.registerSymbol("bowtie",xne),gt.registerSymbol("hexagon",Ene),gt.registerSymbol("square",mne),gt.registerSymbol("diamond",wne),gt.registerSymbol("triangle",Bne),gt.registerSymbol("triangle-down",bne),gt.registerSymbol("line",mQ),gt.registerSymbol("dot",wQ),gt.registerSymbol("dash",Mne),gt.registerSymbol("smooth",One),gt.registerSymbol("hv",Ine),gt.registerSymbol("vh",_ne),gt.registerSymbol("hvh",kne),gt.registerSymbol("vhv",Nne),gt.registerSymbol("focus",Qne);function ef(r,...e){return e.reduce((t,n)=>i=>t(n(i)),r)}function jB(r,e){return e-r?t=>(t-r)/(e-r):t=>.5}function Rne(r,e){const t=e<r?e:r,n=r>e?r:e;return i=>Math.min(Math.max(t,i),n)}function Dne(r,e,t,n,i){let a=t,s=n||r.length;const o=(A=>A);for(;a<s;){const A=Math.floor((a+s)/2);o(r[A])>e?s=A:a=A+1}return a}const BQ=Math.sqrt(50),bQ=Math.sqrt(10),EQ=Math.sqrt(2);function tf(r,e,t){const n=(e-r)/Math.max(0,t),i=Math.floor(Math.log(n)/Math.LN10),a=n/10**i;return i>=0?(a>=BQ?10:a>=bQ?5:a>=EQ?2:1)*10**i:-(10**-i)/(a>=BQ?10:a>=bQ?5:a>=EQ?2:1)}const Hne=(r,e,t=5)=>{const n=[r,e];let i=0,a=n.length-1,s=n[i],o=n[a],A;return o<s&&([s,o]=[o,s],[i,a]=[a,i]),A=tf(s,o,t),A>0?(s=Math.floor(s/A)*A,o=Math.ceil(o/A)*A,A=tf(s,o,t)):A<0&&(s=Math.ceil(s*A)/A,o=Math.floor(o*A)/A,A=tf(s,o,t)),A>0?(n[i]=Math.floor(s/A)*A,n[a]=Math.ceil(o/A)*A):A<0&&(n[i]=Math.ceil(s*A)/A,n[a]=Math.floor(o*A)/A),n};function xQ(r){return!Ge(r)&&!SR(r)&&!Number.isNaN(r)}var WB={exports:{}},qB,CQ;function Gne(){return CQ||(CQ=1,qB={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),qB}var $B={exports:{}},YB,SQ;function Kne(){return SQ||(SQ=1,YB=function(e){return!e||typeof e=="string"?!1:e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&e.constructor.name!=="String")}),YB}var FQ;function zne(){if(FQ)return $B.exports;FQ=1;var r=Kne(),e=Array.prototype.concat,t=Array.prototype.slice,n=$B.exports=function(a){for(var s=[],o=0,A=a.length;o<A;o++){var l=a[o];r(l)?s=e.call(s,t.call(l)):s.push(l)}return s};return n.wrap=function(i){return function(){return i(n(arguments))}},$B.exports}var TQ;function Vne(){if(TQ)return WB.exports;TQ=1;var r=Gne(),e=zne(),t=Object.hasOwnProperty,n=Object.create(null);for(var i in r)t.call(r,i)&&(n[r[i]]=i);var a=WB.exports={to:{},get:{}};a.get=function(A){var l=A.substring(0,3).toLowerCase(),c,u;switch(l){case"hsl":c=a.get.hsl(A),u="hsl";break;case"hwb":c=a.get.hwb(A),u="hwb";break;default:c=a.get.rgb(A),u="rgb";break}return c?{model:u,value:c}:null},a.get.rgb=function(A){if(!A)return null;var l=/^#([a-f0-9]{3,4})$/i,c=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,u=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,h=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,d=/^(\w+)$/,f=[0,0,0,1],g,p,v;if(g=A.match(c)){for(v=g[2],g=g[1],p=0;p<3;p++){var y=p*2;f[p]=parseInt(g.slice(y,y+2),16)}v&&(f[3]=parseInt(v,16)/255)}else if(g=A.match(l)){for(g=g[1],v=g[3],p=0;p<3;p++)f[p]=parseInt(g[p]+g[p],16);v&&(f[3]=parseInt(v+v,16)/255)}else if(g=A.match(u)){for(p=0;p<3;p++)f[p]=parseInt(g[p+1],0);g[4]&&(g[5]?f[3]=parseFloat(g[4])*.01:f[3]=parseFloat(g[4]))}else if(g=A.match(h)){for(p=0;p<3;p++)f[p]=Math.round(parseFloat(g[p+1])*2.55);g[4]&&(g[5]?f[3]=parseFloat(g[4])*.01:f[3]=parseFloat(g[4]))}else return(g=A.match(d))?g[1]==="transparent"?[0,0,0,0]:t.call(r,g[1])?(f=r[g[1]],f[3]=1,f):null:null;for(p=0;p<3;p++)f[p]=s(f[p],0,255);return f[3]=s(f[3],0,1),f},a.get.hsl=function(A){if(!A)return null;var l=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,c=A.match(l);if(c){var u=parseFloat(c[4]),h=(parseFloat(c[1])%360+360)%360,d=s(parseFloat(c[2]),0,100),f=s(parseFloat(c[3]),0,100),g=s(isNaN(u)?1:u,0,1);return[h,d,f,g]}return null},a.get.hwb=function(A){if(!A)return null;var l=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,c=A.match(l);if(c){var u=parseFloat(c[4]),h=(parseFloat(c[1])%360+360)%360,d=s(parseFloat(c[2]),0,100),f=s(parseFloat(c[3]),0,100),g=s(isNaN(u)?1:u,0,1);return[h,d,f,g]}return null},a.to.hex=function(){var A=e(arguments);return"#"+o(A[0])+o(A[1])+o(A[2])+(A[3]<1?o(Math.round(A[3]*255)):"")},a.to.rgb=function(){var A=e(arguments);return A.length<4||A[3]===1?"rgb("+Math.round(A[0])+", "+Math.round(A[1])+", "+Math.round(A[2])+")":"rgba("+Math.round(A[0])+", "+Math.round(A[1])+", "+Math.round(A[2])+", "+A[3]+")"},a.to.rgb.percent=function(){var A=e(arguments),l=Math.round(A[0]/255*100),c=Math.round(A[1]/255*100),u=Math.round(A[2]/255*100);return A.length<4||A[3]===1?"rgb("+l+"%, "+c+"%, "+u+"%)":"rgba("+l+"%, "+c+"%, "+u+"%, "+A[3]+")"},a.to.hsl=function(){var A=e(arguments);return A.length<4||A[3]===1?"hsl("+A[0]+", "+A[1]+"%, "+A[2]+"%)":"hsla("+A[0]+", "+A[1]+"%, "+A[2]+"%, "+A[3]+")"},a.to.hwb=function(){var A=e(arguments),l="";return A.length>=4&&A[3]!==1&&(l=", "+A[3]),"hwb("+A[0]+", "+A[1]+"%, "+A[2]+"%"+l+")"},a.to.keyword=function(A){return n[A.slice(0,3)]};function s(A,l,c){return Math.min(Math.max(l,A),c)}function o(A){var l=Math.round(A).toString(16).toUpperCase();return l.length<2?"0"+l:l}return WB.exports}var jne=Vne();const Wne=ic(jne);function XB(r,e,t){let n=t;return n<0&&(n+=1),n>1&&(n-=1),n<1/6?r+(e-r)*6*n:n<1/2?e:n<2/3?r+(e-r)*(2/3-n)*6:r}function qne(r){const e=r[0]/360,t=r[1]/100,n=r[2]/100,i=r[3];if(t===0)return[n*255,n*255,n*255,i];const a=n<.5?n*(1+t):n+t-n*t,s=2*n-a,o=XB(s,a,e+1/3),A=XB(s,a,e),l=XB(s,a,e-1/3);return[o*255,A*255,l*255,i]}function MQ(r){const e=Wne.get(r);if(!e)return null;const{model:t,value:n}=e;return t==="rgb"?n:t==="hsl"?qne(n):null}const nf=(r,e)=>t=>r*(1-t)+e*t,$ne=(r,e)=>{const t=MQ(r),n=MQ(e);return t===null||n===null?t?()=>r:()=>e:i=>{const a=new Array(4);for(let c=0;c<4;c+=1){const u=t[c],h=n[c];a[c]=u*(1-i)+h*i}const[s,o,A,l]=a;return`rgba(${Math.round(s)}, ${Math.round(o)}, ${Math.round(A)}, ${l})`}},Yne=(r,e)=>typeof r=="number"&&typeof e=="number"?nf(r,e):typeof r=="string"&&typeof e=="string"?$ne(r,e):()=>r,Xne=(r,e)=>{const t=nf(r,e);return n=>Math.round(t(n))};function OQ({map:r,initKey:e},t){const n=e(t);return r.has(n)?r.get(n):t}function Zne({map:r,initKey:e},t){const n=e(t);return r.has(n)?r.get(n):(r.set(n,t),t)}function Jne({map:r,initKey:e},t){const n=e(t);return r.has(n)&&(t=r.get(n),r.delete(n)),t}function ere(r){return typeof r=="object"?r.valueOf():r}class IQ extends Map{constructor(e){if(super(),this.map=new Map,this.initKey=ere,e!==null)for(const[t,n]of e)this.set(t,n)}get(e){return super.get(OQ({map:this.map,initKey:this.initKey},e))}has(e){return super.has(OQ({map:this.map,initKey:this.initKey},e))}set(e,t){return super.set(Zne({map:this.map,initKey:this.initKey},e),t)}delete(e){return super.delete(Jne({map:this.map,initKey:this.initKey},e))}}class _Q{constructor(e){this.options=Rn({},this.getDefaultOptions()),this.update(e)}getOptions(){return this.options}update(e={}){this.options=Rn({},this.options,e),this.rescale(e)}rescale(e){}}const ZB=Symbol("defaultUnknown");function kQ(r,e,t){for(let n=0;n<e.length;n+=1)r.has(e[n])||r.set(t(e[n]),n)}function NQ(r){const{value:e,from:t,to:n,mapper:i,notFoundReturn:a}=r;let s=i.get(e);if(s===void 0){if(a!==ZB)return a;s=t.push(e)-1,i.set(e,s)}return n[s%n.length]}function LQ(r){return r instanceof Date?e=>`${e}`:typeof r=="object"?e=>JSON.stringify(e):e=>e}class JB extends _Q{getDefaultOptions(){return{domain:[],range:[],unknown:ZB}}constructor(e){super(e)}map(e){return this.domainIndexMap.size===0&&kQ(this.domainIndexMap,this.getDomain(),this.domainKey),NQ({value:this.domainKey(e),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(e){return this.rangeIndexMap.size===0&&kQ(this.rangeIndexMap,this.getRange(),this.rangeKey),NQ({value:this.rangeKey(e),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(e){const[t]=this.options.domain,[n]=this.options.range;if(this.domainKey=LQ(t),this.rangeKey=LQ(n),!this.rangeIndexMap){this.rangeIndexMap=new Map,this.domainIndexMap=new Map;return}(!e||e.range)&&this.rangeIndexMap.clear(),(!e||e.domain||e.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new JB(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:e,compare:t}=this.options;return this.sortedDomain=t?[...e].sort(t):e,this.sortedDomain}}function tre(r){const e=Math.min(...r);return r.map(t=>t/e)}function nre(r,e){const t=r.length,n=e-t;return n>0?[...r,...new Array(n).fill(1)]:n<0?r.slice(0,e):r}function rre(r){return Math.round(r*1e12)/1e12}function ire(r){const{domain:e,range:t,paddingOuter:n,paddingInner:i,flex:a,round:s,align:o}=r,A=e.length,l=nre(a,A),[c,u]=t,h=u-c,d=2/A*n+1-1/A*i,f=h/d,g=f*i/A,p=f-A*g,v=tre(l),y=v.reduce((N,U)=>N+U),m=p/y,B=new IQ(e.map((N,U)=>{const D=v[U]*m;return[N,s?Math.floor(D):D]})),C=new IQ(e.map((N,U)=>{const G=v[U]*m+g;return[N,s?Math.floor(G):G]})),S=Array.from(C.values()).reduce((N,U)=>N+U),T=(h-(S-S/A*i))*o,O=c+T;let I=s?Math.round(O):O;const k=new Array(A);for(let N=0;N<A;N+=1){k[N]=rre(I);const U=e[N];I+=C.get(U)}return{valueBandWidth:B,valueStep:C,adjustedRange:k}}function are(r){var e;const{domain:t}=r,n=t.length;if(n===0)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(!!(!((e=r.flex)===null||e===void 0)&&e.length))return ire(r);const{range:a,paddingOuter:s,paddingInner:o,round:A,align:l}=r;let c,u,h=a[0];const f=a[1]-h,g=s*2,p=n-o;c=f/Math.max(1,g+p),A&&(c=Math.floor(c)),h+=(f-c*(n-o))*l,u=c*(1-o),A&&(h=Math.round(h),u=Math.round(u));const v=new Array(n).fill(0).map((y,m)=>h+m*c);return{valueStep:c,valueBandWidth:u,adjustedRange:v}}class eb extends JB{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:ZB,flex:[]}}constructor(e){super(e)}clone(){return new eb(this.options)}getStep(e){return this.valueStep===void 0?1:typeof this.valueStep=="number"?this.valueStep:e===void 0?Array.from(this.valueStep.values())[0]:this.valueStep.get(e)}getBandWidth(e){return this.valueBandWidth===void 0?1:typeof this.valueBandWidth=="number"?this.valueBandWidth:e===void 0?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(e)}getRange(){return this.adjustedRange}getPaddingInner(){const{padding:e,paddingInner:t}=this.options;return e>0?e:t}getPaddingOuter(){const{padding:e,paddingOuter:t}=this.options;return e>0?e:t}rescale(){super.rescale();const{align:e,domain:t,range:n,round:i,flex:a}=this.options,{adjustedRange:s,valueBandWidth:o,valueStep:A}=are({align:e,range:n,round:i,flex:a,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:t});this.valueStep=A,this.valueBandWidth=o,this.adjustedRange=s}}const sre=(r,e,t)=>{let n,i,a=r,s=e;if(a===s&&t>0)return[a];let o=tf(a,s,t);if(o===0||!Number.isFinite(o))return[];if(o>0){a=Math.ceil(a/o),s=Math.floor(s/o),i=new Array(n=Math.ceil(s-a+1));for(let A=0;A<n;A+=1)i[A]=(a+A)*o}else{o=-o,a=Math.ceil(a*o),s=Math.floor(s*o),i=new Array(n=Math.ceil(s-a+1));for(let A=0;A<n;A+=1)i[A]=(a+A)/o}return i},ore=(r,e,t)=>{const[n,i]=r,[a,s]=e;let o,A;return n<i?(o=jB(n,i),A=t(a,s)):(o=jB(i,n),A=t(s,a)),ef(A,o)},Are=(r,e,t)=>{const n=Math.min(r.length,e.length)-1,i=new Array(n),a=new Array(n),s=r[0]>r[n],o=s?[...r].reverse():r,A=s?[...e].reverse():e;for(let l=0;l<n;l+=1)i[l]=jB(o[l],o[l+1]),a[l]=t(A[l],A[l+1]);return l=>{const c=Dne(r,l,1,n)-1,u=i[c],h=a[c];return ef(h,u)(l)}},QQ=(r,e,t,n)=>(Math.min(r.length,e.length)>2?Are:ore)(r,e,n?Xne:t);class lre extends _Q{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:nf,tickCount:5}}map(e){return xQ(e)?this.output(e):this.options.unknown}invert(e){return xQ(e)?this.input(e):this.options.unknown}nice(){if(!this.options.nice)return;const[e,t,n,...i]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(e,t,n,...i)}getTicks(){const{tickMethod:e}=this.options,[t,n,i,...a]=this.getTickMethodOptions();return e(t,n,i,...a)}getTickMethodOptions(){const{domain:e,tickCount:t}=this.options,n=e[0],i=e[e.length-1];return[n,i,t]}chooseNice(){return Hne}rescale(){this.nice();const[e,t]=this.chooseTransforms();this.composeOutput(e,this.chooseClamp(e)),this.composeInput(e,t,this.chooseClamp(t))}chooseClamp(e){const{clamp:t,range:n}=this.options,i=this.options.domain.map(e),a=Math.min(i.length,n.length);return t?Rne(i[0],i[a-1]):Zf}composeOutput(e,t){const{domain:n,range:i,round:a,interpolate:s}=this.options,o=QQ(n.map(e),i,s,a);this.output=ef(o,t,e)}composeInput(e,t,n){const{domain:i,range:a}=this.options,s=QQ(a,i.map(e),nf);this.input=ef(t,n,s)}}class Wl extends lre{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:Yne,tickMethod:sre,tickCount:5}}chooseTransforms(){return[Zf,Zf]}clone(){return new Wl(this.options)}}var cre=(function(r){Xe(e,r);function e(t){var n=this,i=t.style,a=Pt(t,["style"]);return n=r.call(this,Rn({},{type:"column"},se({style:i},a)))||this,n.columnsGroup=new Cn({name:"columns"}),n.appendChild(n.columnsGroup),n.render(),n}return e.prototype.render=function(){var t=this.attributes,n=t.columns,i=t.x,a=t.y;this.columnsGroup.style.transform="translate(".concat(i,", ").concat(a,")"),Me(this.columnsGroup).selectAll(".column").data(n.flat()).join(function(s){return s.append("rect").attr("className","column").each(function(o){this.attr(o)})},function(s){return s.each(function(o){this.attr(o)})},function(s){return s.remove()})},e.prototype.update=function(t){this.attr(bn({},this.attributes,t)),this.render()},e.prototype.clear=function(){this.removeChildren()},e})(Tt),ure=(function(r){Xe(e,r);function e(t){var n=this,i=t.style,a=Pt(t,["style"]);return n=r.call(this,Rn({},{type:"lines"},se({style:i},a)))||this,n.linesGroup=n.appendChild(new Cn),n.areasGroup=n.appendChild(new Cn),n.render(),n}return e.prototype.render=function(){var t=this.attributes,n=t.lines,i=t.areas,a=t.x,s=t.y;this.style.transform="translate(".concat(a,", ").concat(s,")"),n&&this.renderLines(n),i&&this.renderAreas(i)},e.prototype.clear=function(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()},e.prototype.update=function(t){this.attr(bn({},this.attributes,t)),this.render()},e.prototype.renderLines=function(t){Me(this.linesGroup).selectAll(".line").data(t).join(function(n){return n.append("path").attr("className","line").each(function(i){this.attr(i)})},function(n){return n.each(function(i){this.attr(i)})},function(n){return n.remove()})},e.prototype.renderAreas=function(t){Me(this.linesGroup).selectAll(".area").data(t).join(function(n){return n.append("path").attr("className","area").each(function(i){this.attr(i)})},function(n){return n.each(function(i){this.style(i)})},function(n){return n.remove()})},e})(Tt);function hre(r,e){var t,n=e.x,i=e.y,a=H(i.getOptions().range||[0,0],2),s=a[0],o=a[1];return o>s&&(t=H([s,o],2),o=t[0],s=t[1]),r.map(function(A){var l=A.map(function(c,u){return[n.map(u),Yt(i.map(c),o,s)]});return l})}function ql(r,e){e===void 0&&(e=!1);var t=e?r.length-1:0,n=r.map(function(i,a){return Ie([a===t?"M":"L"],H(i),!1)});return e?n.reverse():n}function rf(r,e){if(e===void 0&&(e=!1),r.length<=2)return ql(r);for(var t=[],n=r.length,i=0;i<n;i+=1){var a=e?r[n-i-1]:r[i];Xt(a,t.slice(-2))||t.push.apply(t,Ie([],H(a),!1))}var s=tne(t);return e?s.unshift(Ie(["M"],H(r[n-1]),!1)):s.unshift(Ie(["M"],H(r[0]),!1)),s}function tb(r,e,t){var n=ka(r);return n.push(["L",e,t],["L",0,t],["Z"]),n}function dre(r,e,t,n){return r.map(function(i){return tb(e?rf(i):ql(i),t,n)})}function fre(r,e,t){for(var n=[],i=r.length-1;i>=0;i-=1){var a=r[i],s=ql(a),o=void 0;if(i===0)o=tb(s,e,t);else{var A=r[i-1],l=ql(A,!0);l[0][0]="L",o=Ie(Ie(Ie([],H(s),!1),H(l),!1),[["Z"]],!1)}n.push(o)}return n}function gre(r,e,t){for(var n=[],i=r.length-1;i>=0;i-=1){var a=r[i],s=rf(a),o=void 0;if(i===0)o=tb(s,e,t);else{var A=r[i-1],l=rf(A,!0),c=a[0];l[0][0]="L",o=Ie(Ie(Ie([],H(s),!1),H(l),!1),[Ie(["M"],H(c),!1),["Z"]],!1)}n.push(o)}return n}function UQ(r){return r.length===0?[0,0]:[dc(wR(r,function(e){return dc(e)||0})),hc(mR(r,function(e){return hc(e)||0}))]}function PQ(r){for(var e=ka(r),t=e[0].length,n=H([Array(t).fill(0),Array(t).fill(0)],2),i=n[0],a=n[1],s=0;s<e.length;s+=1)for(var o=e[s],A=0;A<t;A+=1)o[A]>=0?(o[A]+=i[A],i[A]=o[A]):(o[A]+=a[A],a[A]=o[A]);return e}var pre=(function(r){Xe(e,r);function e(t){return r.call(this,t,{type:"line",x:0,y:0,width:200,height:20,isStack:!1,color:["#83daad","#edbf45","#d2cef9","#e290b3","#6f63f4"],smooth:!0,lineLineWidth:1,areaOpacity:0,isGroup:!1,columnLineWidth:1,columnStroke:"#fff",scale:1,spacing:0})||this}return Object.defineProperty(e.prototype,"rawData",{get:function(){var t=this.attributes.data;if(!t||t?.length===0)return[[]];var n=ka(t);return Be(n[0])?[n]:n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.attributes.isStack?PQ(this.rawData):this.rawData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scales",{get:function(){return this.createScales(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseline",{get:function(){var t=this.scales.y,n=H(t.getOptions().domain||[0,0],2),i=n[0],a=n[1];return a<0?t.map(a):t.map(i<0?0:i)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"containerShape",{get:function(){var t=this.attributes,n=t.width,i=t.height;return{width:n,height:i}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linesStyle",{get:function(){var t=this,n=this.attributes,i=n.type,a=n.isStack,s=n.smooth;if(i!=="line")throw new Error("linesStyle can only be used in line type");var o=je(this.attributes,"area"),A=je(this.attributes,"line"),l=this.containerShape.width,c=this.data;if(c[0].length===0)return{lines:[],areas:[]};var u=this.scales,h=u.x,d=u.y,f=hre(c,{x:h,y:d}),g=[];if(o){var p=this.baseline;a?g=s?gre(f,l,p):fre(f,l,p):g=dre(f,s,l,p)}return{lines:f.map(function(v,y){return se({stroke:t.getColor(y),d:s?rf(v):ql(v)},A)}),areas:g.map(function(v,y){return se({d:v,fill:t.getColor(y)},o)})}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"columnsStyle",{get:function(){var t=this,n=je(this.attributes,"column"),i=this.attributes,a=i.isStack,s=i.type,o=i.scale;if(s!=="column")throw new Error("columnsStyle can only be used in column type");var A=this.containerShape.height,l=this.rawData;if(!l)return{columns:[]};a&&(l=PQ(l));var c=this.createScales(l),u=c.x,h=c.y,d=H(UQ(l),2),f=d[0],g=d[1],p=new Wl({domain:[0,g-(f>0?0:f)],range:[0,A*o]}),v=u.getBandWidth(),y=this.rawData;return{columns:l.map(function(m,B){return m.map(function(C,S){var F=v/l.length,T=function(){return{x:u.map(S)+F*B,y:C>=0?h.map(C):h.map(0),width:F,height:p.map(Math.abs(C))}},O=function(){return{x:u.map(S),y:h.map(C),width:v,height:p.map(y[B][S])}};return se(se({fill:t.getColor(B)},n),a?O():T())})})}},enumerable:!1,configurable:!0}),e.prototype.render=function(t,n){Ane(n,".container","rect").attr("className","container").node();var i=t.type,a=t.x,s=t.y,o="spark".concat(i),A=se({x:a,y:s},i==="line"?this.linesStyle:this.columnsStyle);Me(n).selectAll(".spark").data([i]).join(function(l){return l.append(function(c){return c==="line"?new ure({className:o,style:A}):new cre({className:o,style:A})}).attr("className","spark ".concat(o))},function(l){return l.update(A)},function(l){return l.remove()})},e.prototype.getColor=function(t){var n=this.attributes.color;return mr(n)?n[t%n.length]:Te(n)?n.call(null,t):n},e.prototype.createScales=function(t){var n,i,a=this.attributes,s=a.type,o=a.scale,A=a.range,l=A===void 0?[]:A,c=a.spacing,u=this.containerShape,h=u.width,d=u.height,f=H(UQ(t),2),g=f[0],p=f[1],v=new Wl({domain:[(n=l[0])!==null&&n!==void 0?n:g,(i=l[1])!==null&&i!==void 0?i:p],range:[d,d*(1-o)]});return s==="line"?{type:s,x:new Wl({domain:[0,t[0].length-1],range:[0,h]}),y:v}:{type:s,x:new eb({domain:t[0].map(function(y,m){return m}),range:[0,h],paddingInner:c,paddingOuter:c/2,align:.5}),y:v}},e.tag="sparkline",e})(en);function vre(r){return typeof r=="boolean"?!1:"enter"in r&&"update"in r&&"exit"in r}function RQ(r){if(!r)return{enter:!1,update:!1,exit:!1};var e=["enter","update","exit"],t=Object.fromEntries(Object.entries(r).filter(function(n){var i=H(n,1),a=i[0];return!e.includes(a)}));return Object.fromEntries(e.map(function(n){return vre(r)?r[n]===!1?[n,!1]:[n,se(se({},r[n]),t)]:[n,t]}))}function oA(r,e){r?r.finished.then(e):e()}function yre(r,e){r.length===0?e():Promise.all(r.map(function(t){return t?.finished})).then(e)}function DQ(r,e){"update"in r?r.update(e):r.attr(e)}function HQ(r,e,t){if(e.length===0)return null;if(!t){var n=e.slice(-1)[0];return DQ(r,{style:n}),null}return r.animate(e,t)}function mre(r,e){return!(r.nodeName!=="text"||e.nodeName!=="text"||r.attributes.text!==e.attributes.text)}function wre(r,e,t,n){if(n===void 0&&(n="destroy"),mre(r,e))return r.remove(),[null];var i=function(){n==="destroy"?r.destroy():n==="hide"&&Ti(r),e.isVisible()&&zl(e)};if(!t)return i(),[null];var a=t.duration,s=a===void 0?0:a,o=t.delay,A=o===void 0?0:o,l=Math.ceil(+s/2),c=+s/4,u=H(r.getGeometryBounds().center,2),h=u[0],d=u[1],f=H(e.getGeometryBounds().center,2),g=f[0],p=f[1],v=H([(h+g)/2-h,(d+p)/2-d],2),y=v[0],m=v[1],B=r.style.opacity,C=B===void 0?1:B,S=e.style.opacity,F=S===void 0?1:S,T=r.style.transform||"",O=e.style.transform||"",I=r.animate([{opacity:C,transform:"translate(0, 0) ".concat(T)},{opacity:0,transform:"translate(".concat(y,", ").concat(m,") ").concat(T)}],se(se({fill:"both"},t),{duration:A+l+c})),k=e.animate([{opacity:0,transform:"translate(".concat(-y,", ").concat(-m,") ").concat(O),offset:.01},{opacity:F,transform:"translate(0, 0) ".concat(O)}],se(se({fill:"both"},t),{duration:l+c,delay:A+l-c}));return oA(k,i),[I,k]}function Oi(r,e,t){var n={},i={};return Object.entries(e).forEach(function(a){var s=H(a,2),o=s[0],A=s[1];if(!ke(A)){var l=r.style[o]||r.parsedStyle[o]||0;l!==A&&(n[o]=l,i[o]=A)}}),t?HQ(r,[n,i],se({fill:"both"},t)):(DQ(r,i),null)}function af(r,e){return r.style.opacity||(r.style.opacity=1),Oi(r,{opacity:0},e)}var GQ={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},KQ={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},zQ={x:0,y:0,orientation:"horizontal",showLabel:!0,type:"start"},na=Mi({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider"),li=Mi({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),Bre=(function(r){Xe(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.render=function(t,n){var i=t.x,a=t.y,s=t.size,o=s===void 0?10:s,A=t.radius,l=A===void 0?o/4:A,c=t.orientation,u=t.classNamePrefix,h=Pt(t,["x","y","size","radius","orientation","classNamePrefix"]),d=o,f=d*2.4,g=u?"".concat(li.iconRect.name," ").concat(u,"handle-icon-rect"):li.iconRect.name,p=function(S){return u?"".concat(li.iconLine,"-").concat(S," ").concat(u,"handle-icon-line"):"".concat(li.iconLine,"-").concat(S)},v=Me(n).maybeAppendByClassName(li.iconRect,"rect").attr("className",g).styles(se(se({},h),{width:d,height:f,radius:l,x:i-d/2,y:a-f/2,transformOrigin:"center"})),y=i+1/3*d-d/2,m=i+2/3*d-d/2,B=a+1/4*f-f/2,C=a+3/4*f-f/2;v.maybeAppendByClassName("".concat(li.iconLine,"-1"),"line").attr("className",p(1)).styles(se({x1:y,x2:y,y1:B,y2:C},h)),v.maybeAppendByClassName("".concat(li.iconLine,"-2"),"line").attr("className",p(2)).styles(se({x1:m,x2:m,y1:B,y2:C},h)),c==="vertical"&&(v.node().style.transform="rotate(90)")},e})(en),bre=(function(r){Xe(e,r);function e(t){return r.call(this,t,zQ)||this}return e.prototype.renderLabel=function(t){var n=this,i=this.attributes,a=i.x,s=i.y,o=i.showLabel,A=je(this.attributes,"label"),l=A.x,c=l===void 0?0:l,u=A.y,h=u===void 0?0:u,d=A.transform,f=A.transformOrigin,g=Pt(A,["x","y","transform","transformOrigin"]),p=H(Ea(g,[]),2),v=p[0],y=p[1],m=Me(t).maybeAppendByClassName(li.labelGroup,"g").styles(y),B=se(se({},KQ),v),C=B.text,S=Pt(B,["text"]);Or(!!o,m,function(F){n.label=F.maybeAppendByClassName(li.label,"text").styles(se(se({},S),{x:a+c,y:s+h,transform:d,transformOrigin:f,text:"".concat(C)})),n.label.on("mousedown",function(T){T.stopPropagation()}),n.label.on("touchstart",function(T){T.stopPropagation()})})},e.prototype.renderIcon=function(t){var n=this.attributes,i=n.x,a=n.y,s=n.orientation,o=n.type,A=n.classNamePrefix,l=se(se({x:i,y:a,orientation:s,classNamePrefix:A},GQ),je(this.attributes,"icon")),c=this.attributes.iconShape,u=c===void 0?function(){return new Bre({style:l})}:c,h=Me(t).maybeAppendByClassName(li.iconGroup,"g");h.selectAll(li.icon.class).data([u]).join(function(d){return d.append(typeof u=="string"?u:function(){return u(o)}).attr("className",li.icon.name)},function(d){return d.update(l)},function(d){return d.remove()})},e.prototype.render=function(t,n){this.renderIcon(n),this.renderLabel(n)},e})(en),Ere=(function(r){Xe(e,r);function e(t){var n=r.call(this,t,se(se(se({x:0,y:0,animate:{duration:100,fill:"both"},brushable:!0,formatter:function(i){return i.toString()},handleSpacing:2,orientation:"horizontal",padding:0,autoFitLabel:!0,scrollable:!0,selectionFill:"#5B8FF9",selectionFillOpacity:.45,selectionZIndex:2,showHandle:!0,showLabel:!0,slidable:!0,trackFill:"#416180",trackLength:200,trackOpacity:.05,trackSize:20,trackZIndex:-1,values:[0,1],type:"range",selectionType:"select",handleIconOffset:0},sA(zQ,"handle")),sA(GQ,"handleIcon")),sA(KQ,"handleLabel")))||this;return n.range=[0,1],n.onDragStart=function(i){return function(a){a.stopPropagation(),n.target=i,n.prevPos=n.getOrientVal(cQ(a));var s=n.availableSpace,o=s.x,A=s.y,l=n.getBBox(),c=l.x,u=l.y;n.selectionStartPos=n.getRatio(n.prevPos-n.getOrientVal([o,A])-n.getOrientVal([+c,+u])),n.selectionWidth=0,document.addEventListener("pointermove",n.onDragging),document.addEventListener("pointerup",n.onDragEnd)}},n.onDragging=function(i){var a=n.attributes,s=a.slidable,o=a.brushable,A=a.type;i.stopPropagation();var l=n.getOrientVal(cQ(i)),c=l-n.prevPos;if(c){var u=n.getRatio(c);switch(n.target){case"start":s&&n.setValuesOffset(u);break;case"end":s&&n.setValuesOffset(0,u);break;case"selection":s&&n.setValuesOffset(u,u);break;case"track":if(!o)return;n.selectionWidth+=u,A==="range"?n.innerSetValues([n.selectionStartPos,n.selectionStartPos+n.selectionWidth].sort(),!0):n.innerSetValues([0,n.selectionStartPos+n.selectionWidth],!0);break}n.prevPos=l}},n.onDragEnd=function(){document.removeEventListener("pointermove",n.onDragging),document.removeEventListener("pointermove",n.onDragging),document.removeEventListener("pointerup",n.onDragEnd),n.target="",n.updateHandlesPosition(!1)},n.onValueChange=function(i){var a=n.attributes,s=a.onChange,o=a.type,A=o==="range"?i:i[1],l=o==="range"?n.getValues():n.getValues()[1],c=new yn("valuechange",{detail:{oldValue:A,value:l}});n.dispatchEvent(c),s?.(l)},n.selectionStartPos=0,n.selectionWidth=0,n.prevPos=0,n.target="",n}return Object.defineProperty(e.prototype,"values",{get:function(){return this.attributes.values},set:function(t){this.attributes.values=this.clampValues(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sparklineStyle",{get:function(){var t=this.attributes.orientation;if(t!=="horizontal")return null;var n=je(this.attributes,"sparkline");return se(se({zIndex:0},this.availableSpace),n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var t=this.attributes,n=t.trackLength,i=t.trackSize,a=H(this.getOrientVal([[n,i],[i,n]]),2),s=a[0],o=a[1];return{width:s,height:o}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes;t.x,t.y;var n=t.padding,i=H(Wn(n),4),a=i[0],s=i[1],o=i[2],A=i[3],l=this.shape,c=l.width,u=l.height;return{x:A,y:a,width:c-(A+s),height:u-(a+o)}},enumerable:!1,configurable:!0}),e.prototype.getValues=function(){return this.values},e.prototype.setValues=function(t,n){t===void 0&&(t=[0,0]),n===void 0&&(n=!1),this.attributes.values=t;var i=n===!1?!1:this.attributes.animate;this.updateSelectionArea(i),this.updateHandlesPosition(i)},e.prototype.updateSelectionArea=function(t){var n=this.calcSelectionArea();this.foregroundGroup.selectAll(na.selection.class).each(function(i,a){Oi(this,n[a],t)})},e.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(this.startHandle&&Oi(this.startHandle,this.getHandleStyle("start"),t),this.endHandle&&Oi(this.endHandle,this.getHandleStyle("end"),t))},e.prototype.innerSetValues=function(t,n){t===void 0&&(t=[0,0]),n===void 0&&(n=!1);var i=this.values,a=this.clampValues(t);this.attributes.values=a,this.setValues(a),n&&this.onValueChange(i)},e.prototype.renderTrack=function(t){var n=this.attributes,i=n.x,a=n.y,s=je(this.attributes,"track");this.trackShape=Me(t).maybeAppendByClassName(na.track,"rect").styles(se(se({x:i,y:a},this.shape),s))},e.prototype.renderBrushArea=function(t){var n=this.attributes,i=n.x,a=n.y,s=n.brushable;this.brushArea=Me(t).maybeAppendByClassName(na.brushArea,"rect").styles(se({x:i,y:a,fill:"transparent",cursor:s?"crosshair":"default"},this.shape))},e.prototype.renderSparkline=function(t){var n=this,i=this.attributes,a=i.x,s=i.y,o=i.orientation,A=Me(t).maybeAppendByClassName(na.sparklineGroup,"g");Or(o==="horizontal",A,function(l){var c=se(se({},n.sparklineStyle),{x:a,y:s});l.maybeAppendByClassName(na.sparkline,function(){return new pre({style:c})}).update(c)})},e.prototype.renderHandles=function(){var t=this,n,i=this.attributes,a=i.showHandle,s=i.type,o=s==="range"?["start","end"]:["end"],A=a?o:[],l=this;(n=this.foregroundGroup)===null||n===void 0||n.selectAll(na.handle.class).data(A.map(function(c){return{type:c}}),function(c){return c.type}).join(function(c){return c.append(function(u){var h=u.type;return new bre({style:t.getHandleStyle(h)})}).each(function(u){var h=u.type;this.attr("class","".concat(na.handle.name," ").concat(h,"-handle"));var d="".concat(h,"Handle");l[d]=this,this.addEventListener("pointerdown",l.onDragStart(h))})},function(c){return c.each(function(u){var h=u.type;this.update(l.getHandleStyle(h))})},function(c){return c.each(function(u){var h=u.type,d="".concat(h,"Handle");l[d]=void 0}).remove()})},e.prototype.renderSelection=function(t){var n=this.attributes,i=n.x,a=n.y,s=n.type,o=n.selectionType;this.foregroundGroup=Me(t).maybeAppendByClassName(na.foreground,"g");var A=je(this.attributes,"selection"),l=function(u){return u.style("visibility",function(h){return h.show?"visible":"hidden"}).style("cursor",function(h){return o==="select"?"grab":o==="invert"?"crosshair":"default"}).styles(se(se({},A),{transform:"translate(".concat(i,", ").concat(a,")")}))},c=this;this.foregroundGroup.selectAll(na.selection.class).data(s==="value"?[]:this.calcSelectionArea().map(function(u,h){return{style:se({},u),index:h,show:o==="select"?h===1:h!==1}}),function(u){return u.index}).join(function(u){return u.append("rect").attr("className",na.selection.name).call(l).each(function(h,d){var f=this;d===1?(c.selectionShape=Me(this),this.on("pointerdown",function(g){f.attr("cursor","grabbing"),c.onDragStart("selection")(g)}),c.dispatchCustomEvent(this,"pointerenter","selectionMouseenter"),c.dispatchCustomEvent(this,"pointerleave","selectionMouseleave"),c.dispatchCustomEvent(this,"click","selectionClick"),this.addEventListener("pointerdown",function(){f.attr("cursor","grabbing")}),this.addEventListener("pointerup",function(){f.attr("cursor","pointer")}),this.addEventListener("pointerover",function(){f.attr("cursor","pointer")})):this.on("pointerdown",c.onDragStart("track"))})},function(u){return u.call(l)},function(u){return u.remove()}),this.updateSelectionArea(!1),this.renderHandles()},e.prototype.render=function(t,n){this.renderTrack(n),this.renderSparkline(n),this.renderBrushArea(n),this.renderSelection(n)},e.prototype.clampValues=function(t,n){var i;n===void 0&&(n=4);var a=H(this.range,2),s=a[0],o=a[1],A=H(this.getValues().map(function(p){return hQ(p,n)}),2),l=A[0],c=A[1],u=Array.isArray(t)?t:[l,t??c],h=H((u||[l,c]).map(function(p){return hQ(p,n)}),2),d=h[0],f=h[1];if(this.attributes.type==="value")return[0,Yt(f,s,o)];d>f&&(i=H([f,d],2),d=i[0],f=i[1]);var g=f-d;return g>o-s?[s,o]:d<s?l===s&&c===f?[s,f]:[s,g+s]:f>o?c===o&&l===d?[d,o]:[o-g,o]:[d,f]},e.prototype.calcSelectionArea=function(t){var n=H(this.clampValues(t),2),i=n[0],a=n[1],s=this.availableSpace,o=s.x,A=s.y,l=s.width,c=s.height;return this.getOrientVal([[{y:A,height:c,x:o,width:i*l},{y:A,height:c,x:i*l+o,width:(a-i)*l},{y:A,height:c,x:a*l,width:(1-a)*l}],[{x:o,width:l,y:A,height:i*c},{x:o,width:l,y:i*c+A,height:(a-i)*c},{x:o,width:l,y:a*c,height:(1-a)*c}]])},e.prototype.calcHandlePosition=function(t){var n=this.attributes.handleIconOffset,i=this.availableSpace,a=i.x,s=i.y,o=i.width,A=i.height,l=H(this.clampValues(),2),c=l[0],u=l[1],h=t==="start"?-n:n,d=(t==="start"?c:u)*this.getOrientVal([o,A])+h;return{x:a+this.getOrientVal([d,o/2]),y:s+this.getOrientVal([A/2,d])}},e.prototype.inferTextStyle=function(t){var n=this.attributes.orientation;return n==="horizontal"?{}:t==="start"?{transformOrigin:"left center",transform:"rotate(90)",textAlign:"start"}:t==="end"?{transformOrigin:"right center",transform:"rotate(90)",textAlign:"end"}:{}},e.prototype.calcHandleText=function(t){var n,i=this.attributes,a=i.type,s=i.orientation,o=i.formatter,A=i.autoFitLabel,l=je(this.attributes,"handle"),c=je(l,"label"),u=l.spacing,h=this.getHandleSize(),d=this.clampValues(),f=t==="start"?d[0]:d[1],g=o(f),p=new RB({style:se(se(se({},c),this.inferTextStyle(t)),{text:g})}),v=p.getBBox(),y=v.width,m=v.height;if(p.destroy(),!A){if(a==="value")return{text:g,x:0,y:-m-u};var B=u+h+(s==="horizontal"?y/2:0);return n={text:g},n[s==="horizontal"?"x":"y"]=t==="start"?-B:B,n}var C=0,S=0,F=this.availableSpace,T=F.width,O=F.height,I=this.calcSelectionArea()[1],k=I.x,N=I.y,U=I.width,D=I.height,G=u+h;if(s==="horizontal"){var Z=G+y/2;if(t==="start"){var q=k-G-y;C=q>0?-Z:Z}else{var j=T-k-U-G>y;C=j?Z:-Z}}else{var te=G,ue=m+G;t==="start"?S=N-h>m?-ue:te:S=O-(N+D)-h>m?ue:-te}return{x:C,y:S,text:g}},e.prototype.getHandleLabelStyle=function(t){var n=je(this.attributes,"handleLabel");return se(se(se({},n),this.calcHandleText(t)),this.inferTextStyle(t))},e.prototype.getHandleIconStyle=function(){var t=this.attributes.handleIconShape,n=je(this.attributes,"handleIcon"),i=this.getOrientVal(["ew-resize","ns-resize"]),a=this.getHandleSize();return se({cursor:i,shape:t,size:a},n)},e.prototype.getHandleStyle=function(t){var n=this.attributes,i=n.x,a=n.y,s=n.showLabel,o=n.showLabelOnInteraction,A=n.orientation,l=this.calcHandlePosition(t),c=l.x,u=l.y,h=this.calcHandleText(t),d=s;return!s&&o&&(this.target?d=!0:d=!1),se(se(se({},sA(this.getHandleIconStyle(),"icon")),sA(se(se({},this.getHandleLabelStyle(t)),h),"label")),{transform:"translate(".concat(c+i,", ").concat(u+a,")"),orientation:A,showLabel:d,type:t,zIndex:3})},e.prototype.getHandleSize=function(){var t=this.attributes,n=t.handleIconSize,i=t.width,a=t.height;return n||Math.floor((this.getOrientVal([+a,+i])+4)/2.4)},e.prototype.getOrientVal=function(t){var n=H(t,2),i=n[0],a=n[1],s=this.attributes.orientation;return s==="horizontal"?i:a},e.prototype.setValuesOffset=function(t,n){n===void 0&&(n=0);var i=this.attributes.type,a=H(this.getValues(),2),s=a[0],o=a[1],A=i==="range"?t:0,l=[s+A,o+n].sort();this.innerSetValues(l,!0)},e.prototype.getRatio=function(t){var n=this.availableSpace,i=n.width,a=n.height;return t/this.getOrientVal([i,a])},e.prototype.dispatchCustomEvent=function(t,n,i){var a=this;t.on(n,function(s){s.stopPropagation(),a.dispatchEvent(new yn(i,{detail:s}))})},e.prototype.bindEvents=function(){this.addEventListener("wheel",this.onScroll);var t=this.brushArea;this.dispatchCustomEvent(t,"click","trackClick"),this.dispatchCustomEvent(t,"pointerenter","trackMouseenter"),this.dispatchCustomEvent(t,"pointerleave","trackMouseleave"),t.on("pointerdown",this.onDragStart("track"))},e.prototype.onScroll=function(t){var n=this.attributes.scrollable;if(n){var i=t.deltaX,a=t.deltaY,s=a||i,o=this.getRatio(s);this.setValuesOffset(o,o)}},e.tag="slider",e})(en),pt={gridGroup:"grid-group",mainGroup:"main-group",lineGroup:"line-group",tickGroup:"tick-group",labelGroup:"label-group",titleGroup:"title-group",grid:"grid",line:"line",lineFirst:"line-first",lineSecond:"line-second",tick:"tick",tickItem:"tick-item",label:"label",labelItem:"label-item",title:"title"},nb={data:[],animate:{enter:!1,update:{duration:100,easing:"ease-in-out-sine",fill:"both"},exit:{duration:100,fill:"both"}},showArrow:!0,showGrid:!0,showLabel:!0,showLine:!0,showTick:!0,showTitle:!0,showTrunc:!1,dataThreshold:100,lineLineWidth:1,lineStroke:"black",crossPadding:10,titleFill:"black",titleFontSize:12,titlePosition:"lb",titleSpacing:0,titleTextAlign:"center",titleTextBaseline:"middle",lineArrow:function(){return new tr({style:{d:[["M",10,10],["L",-10,0],["L",10,-10],["L",0,0],["L",10,10],["Z"]],fill:"black",transformOrigin:"center"}})},labelAlign:"parallel",labelDirection:"positive",labelFontSize:12,labelSpacing:0,gridConnect:"line",gridControlAngles:[],gridDirection:"positive",gridLength:0,gridType:"segment",lineArrowOffset:15,lineArrowSize:10,tickDirection:"positive",tickLength:5,tickLineWidth:1,tickStroke:"black",labelOverlap:[]};Rn({},nb,{style:{type:"arc"}}),Rn({},nb,{style:{}});var Ke=Mi({mainGroup:pt.mainGroup,gridGroup:pt.gridGroup,grid:pt.grid,lineGroup:pt.lineGroup,line:pt.line,tickGroup:pt.tickGroup,tick:pt.tick,tickItem:pt.tickItem,labelGroup:pt.labelGroup,label:pt.label,labelItem:pt.labelItem,titleGroup:pt.titleGroup,title:pt.title,lineFirst:pt.lineFirst,lineSecond:pt.lineSecond},"axis"),AA=Mi({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function VQ(r){return r.reduce(function(e,t,n){return e.push(Ie([n===0?"M":"L"],H(t),!1)),e},[])}function xre(r,e,t){var n=e.connect,i=n===void 0?"line":n,a=e.center;if(i==="line")return VQ(r);if(!a)return[];var s=jl(r[0],a),o=t?0:1;return r.reduce(function(A,l,c){return c===0?A.push(Ie(["M"],H(l),!1)):A.push(Ie(["A",s,s,0,0,o],H(l),!1)),A},[])}function rb(r,e,t){return e.type==="surround"?xre(r,e,t):VQ(r)}function Cre(r,e,t){var n=t.type,i=t.connect,a=t.center,s=t.closed,o=s?[["Z"]]:[],A=H([rb(r,t),rb(e.slice().reverse(),t,!0)],2),l=A[0],c=A[1],u=H([r[0],e.slice(-1)[0]],2),h=u[0],d=u[1],f=function(y,m){return[l,y,c,m,o].flat()};if(i==="line"||n==="surround")return f([Ie(["L"],H(d),!1)],[Ie(["L"],H(h),!1)]);if(!a)throw new Error("Arc grid need to specified center");var g=H([jl(d,a),jl(h,a)],2),p=g[0],v=g[1];return f([Ie(["A",p,p,0,0,1],H(d),!1),Ie(["L"],H(d),!1)],[Ie(["A",v,v,0,0,0],H(h),!1),Ie(["L"],H(h),!1)])}function Sre(r,e,t,n){var i=t.animate,a=t.isBillboard,s=e.map(function(o,A){return{id:o.id||"grid-line-".concat(A),d:rb(o.points,t)}});return r.selectAll(AA.line.class).data(s,function(o){return o.id}).join(function(o){return o.append("path").each(function(A,l){var c=Mr(dQ(se({d:A.d},n)),[A,l,s]);this.attr(se({class:AA.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:a},c))})},function(o){return o.transition(function(A,l){var c=Mr(dQ(se({d:A.d},n)),[A,l,s]);return Oi(this,c,i.update)})},function(o){return o.transition(function(){var A=this,l=af(this,i.exit);return oA(l,function(){return A.remove()}),l})}).transitions()}function Fre(r,e,t){var n=t.animate,i=t.connect,a=t.areaFill;if(e.length<2||!a||!i)return[];for(var s=Array.isArray(a)?a:[a,"transparent"],o=function(f){return s[f%s.length]},A=[],l=0;l<e.length-1;l++){var c=H([e[l].points,e[l+1].points],2),u=c[0],h=c[1],d=Cre(u,h,t);A.push({d,fill:o(l)})}return r.selectAll(AA.region.class).data(A,function(f,g){return g}).join(function(f){return f.append("path").each(function(g,p){var v=Mr(g,[g,p,A]);this.attr(v)}).attr("className",AA.region.name)},function(f){return f.transition(function(g,p){var v=Mr(g,[g,p,A]);return Oi(this,v,n.update)})},function(f){return f.transition(function(){var g=this,p=af(this,n.exit);return oA(p,function(){return g.remove()}),p})}).transitions()}function Tre(r){var e=r.data,t=e===void 0?[]:e,n=r.closed;return n?t.map(function(i){var a=i.points,s=H(a,1),o=s[0];return se(se({},i),{points:Ie(Ie([],H(a),!1),[o],!1)})}):t}var Mre=(function(r){Xe(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.render=function(t,n){t.type,t.center,t.areaFill,t.closed;var i=Pt(t,["type","center","areaFill","closed"]),a=Tre(t),s=Me(n).maybeAppendByClassName(AA.lineGroup,"g"),o=Me(n).maybeAppendByClassName(AA.regionGroup,"g"),A=Sre(s,a,t,i),l=Fre(o,a,t);return Ie(Ie([],H(A),!1),H(l),!1)},e})(en);function jQ(r,e){return Object.fromEntries(Object.entries(r).map(function(t){var n=H(t,2),i=n[0],a=n[1];return[i,Mr(a,e)]}))}function ib(r,e){return e&&Te(e)?r.filter(e):r}function WQ(r,e){var t=e.startAngle,n=e.endAngle;return(n-t)*r+t}function sf(r,e){if(e.type==="linear"){var t=H(e.startPos,2),n=t[0],i=t[1],a=H(e.endPos,2),s=a[0],o=a[1],A=H([s-n,o-i],2),l=A[0],c=A[1];return uQ([l,c])}var u=aA(WQ(r,e));return[-Math.sin(u),Math.cos(u)]}function ab(r,e,t){var n=sf(r,t);return Jte(n,e!=="positive")}function lA(r,e){return ab(r,e.labelDirection,e)}function of(r,e,t){return t?"".concat(r," ").concat(t,"axis-").concat(e):r}function zr(r,e,t,n){return n&&r.attr("className",of(e.name,t,n)),r}function Ore(r,e){var t=H(e.startPos,2),n=t[0],i=t[1],a=H(e.endPos,2),s=a[0],o=a[1],A=H([s-n,o-i],2),l=A[0],c=A[1];return[n+l*r,i+c*r]}function Ire(r,e){var t=e.radius,n=H(e.center,2),i=n[0],a=n[1],s=aA(WQ(r,e));return[i+t*Math.cos(s),a+t*Math.sin(s)]}function Af(r,e){return e.type==="linear"?Ore(r,e):Ire(r,e)}function sb(r){return sf(0,r)[1]===0}function qQ(r){return sf(0,r)[0]===0}function $Q(r,e){return e-r===360}function YQ(r,e,t,n,i){var a=e-r,s=H([i,i],2),o=s[0],A=s[1],l=H([aA(r),aA(e)],2),c=l[0],u=l[1],h=function(O){return[t+i*Math.cos(O),n+i*Math.sin(O)]},d=H(h(c),2),f=d[0],g=d[1],p=H(h(u),2),v=p[0],y=p[1];if($Q(r,e)){var m=(u+c)/2,B=H(h(m),2),C=B[0],S=B[1];return[["M",f,g],["A",o,A,0,1,0,C,S],["A",o,A,0,1,0,v,y]]}var F=a>180?1:0,T=r>e?0:1;return"M".concat(f,",").concat(g,",A").concat(o,",").concat(A,",0,").concat(F,",").concat(T,",").concat(v,",").concat(y)}function _re(r){var e=r.attributes,t=e.startAngle,n=e.endAngle,i=e.center,a=e.radius;return Ie(Ie([t,n],H(i),!1),[a],!1)}function kre(r,e,t,n){var i=e.startAngle,a=e.endAngle,s=e.center,o=e.radius,A=e.classNamePrefix;return r.selectAll(Ke.line.class).data([{d:YQ.apply(void 0,Ie(Ie([i,a],H(s),!1),[o],!1))}],function(l,c){return c}).join(function(l){var c=l.append("path").attr("className",Ke.line.name).styles(e).styles({d:function(u){return u.d}});return zr(c,Ke.line,pt.line,A),c},function(l){return l.transition(function(){var c=this,u=Zte(this,_re(this),Ie(Ie([i,a],H(s),!1),[o],!1),n.update);if(u){var h=function(){var d=Dn(c.attributes,"__keyframe_data__");c.style.d=YQ.apply(void 0,Ie([],H(d),!1))};u.onframe=h,u.onfinish=h}return u}).styles(e)},function(l){return l.remove()}).styles(t).transitions()}function Nre(r,e){e.truncRange,e.truncShape,e.lineExtension}function Lre(r,e,t){t===void 0&&(t=[0,0]);var n=H([r,e,t],3),i=H(n[0],2),a=i[0],s=i[1],o=H(n[1],2),A=o[0],l=o[1],c=H(n[2],2),u=c[0],h=c[1],d=H([A-a,l-s],2),f=d[0],g=d[1],p=Math.sqrt(Math.pow(f,2)+Math.pow(g,2)),v=H([-u/p,h/p],2),y=v[0],m=v[1];return[y*f,y*g,m*f,m*g]}function XQ(r){var e=H(r,2),t=H(e[0],2),n=t[0],i=t[1],a=H(e[1],2),s=a[0],o=a[1];return{x1:n,y1:i,x2:s,y2:o}}function Qre(r,e,t,n){var i=e.showTrunc,a=e.startPos,s=e.endPos,o=e.truncRange,A=e.lineExtension,l=e.classNamePrefix,c=H([a,s],2),u=H(c[0],2),h=u[0],d=u[1],f=H(c[1],2),g=f[0],p=f[1],v=H(A?Lre(a,s,A):new Array(4).fill(0),4),y=v[0],m=v[1],B=v[2],C=v[3],S=function(te){return r.selectAll(Ke.line.class).data(te,function(ue,ge){return ge}).join(function(ue){var ge=ue.append("line").styles(t).transition(function(Y){return Oi(this,XQ(Y.line),!1)});return ge.attr("className",function(Y){if(!l)return"".concat(Ke.line.name," ").concat(Y.className);var xe=of(Ke.line.name,pt.line,l);if(Y.className===Ke.lineFirst.name){var $=of(Ke.lineFirst.name,pt.lineFirst,l);return"".concat(xe," ").concat($)}if(Y.className===Ke.lineSecond.name){var $=of(Ke.lineSecond.name,pt.lineSecond,l);return"".concat(xe," ").concat($)}return xe}),ge},function(ue){return ue.styles(t).transition(function(ge){var Y=ge.line;return Oi(this,XQ(Y),n.update)})},function(ue){return ue.remove()}).transitions()};if(!i||!o)return S([{line:[[h+y,d+m],[g+B,p+C]],className:Ke.line.name}]);var F=H(o,2),T=F[0],O=F[1],I=g-h,k=p-d,N=H([h+I*T,d+k*T],2),U=N[0],D=N[1],G=H([h+I*O,d+k*O],2),Z=G[0],q=G[1],j=S([{line:[[h+y,d+m],[U,D]],className:Ke.lineFirst.name},{line:[[Z,q],[g+B,p+C]],className:Ke.lineSecond.name}]);return Nre(r,e),j}function Ure(r,e,t,n){var i=t.showArrow,a=t.showTrunc,s=t.lineArrow,o=t.lineArrowOffset,A=t.lineArrowSize,l;if(e==="arc"?l=r.select(Ke.line.class):a?l=r.select(Ke.lineSecond.class):l=r.select(Ke.line.class),!i||!s||t.type==="arc"&&$Q(t.startAngle,t.endAngle)){var c=l.node();c&&(c.style.markerEnd=void 0);return}var u=Ba(s);u.attr(n),zB(u,A),l.style("markerEnd",u).style("markerEndOffset",-o)}function Pre(r,e,t){var n=e.type,i,a=je(e,"line");return n==="linear"?i=Qre(r,e,KB(a,"arrow"),t):i=kre(r,e,KB(a,"arrow"),t),Ure(r,n,e,a),i}function Rre(r,e){return ab(r,e.gridDirection,e)}function ZQ(r){var e=r.type,t=r.gridCenter;return e==="linear"?t:t||r.center}function Dre(r,e){var t=e.gridLength;return r.map(function(n,i){var a=n.value,s=H(Af(a,e),2),o=s[0],A=s[1],l=H(ba(Rre(a,e),t),2),c=l[0],u=l[1];return{id:i,points:[[o,A],[o+c,A+u]]}})}function Hre(r,e){var t=e.gridControlAngles,n=ZQ(e);if(!n)throw new Error("grid center is not provide");if(r.length<2)throw new Error("Invalid grid data");if(!t||t.length===0)throw new Error("Invalid gridControlAngles");var i=H(n,2),a=i[0],s=i[1];return r.map(function(o,A){var l=o.value,c=H(Af(l,e),2),u=c[0],h=c[1],d=H([u-a,h-s],2),f=d[0],g=d[1],p=[];return t.forEach(function(v){var y=aA(v),m=H([Math.cos(y),Math.sin(y)],2),B=m[0],C=m[1],S=f*B-g*C+a,F=f*C+g*B+s;p.push([S,F])}),{points:p,id:A}})}function Gre(r,e,t,n){var i=t.classNamePrefix,a=je(t,"grid"),s=a.type,o=a.areaFill,A=ZQ(t),l=ib(e,t.gridFilter),c=s==="segment"?Dre(l,t):Hre(l,t),u=se(se({},a),{center:A,areaFill:Te(o)?l.map(function(h,d){return Mr(o,[h,d,l])}):o,animate:n,data:c});return r.selectAll(Ke.grid.class).data([1]).join(function(h){var d=h.append(function(){return new Mre({style:u})}).attr("className",Ke.grid.name);return zr(d,Ke.grid,pt.grid,i),d},function(h){return h.transition(function(){return this.update(u)})},function(h){return h.remove()}).transitions()}var ob=(function(){function r(e,t,n,i){this.set(e,t,n,i)}return Object.defineProperty(r.prototype,"left",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"top",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"right",{get:function(){return this.x2},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"bottom",{get:function(){return this.y2},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"width",{get:function(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0},enumerable:!1,configurable:!0}),r.prototype.rotatedPoints=function(e,t,n){var i=this,a=i.x1,s=i.y1,o=i.x2,A=i.y2,l=Math.cos(e),c=Math.sin(e),u=t-t*l+n*c,h=n-t*c-n*l,d=[[l*a-c*A+u,c*a+l*A+h],[l*o-c*A+u,c*o+l*A+h],[l*a-c*s+u,c*a+l*s+h],[l*o-c*s+u,c*o+l*s+h]];return d},r.prototype.set=function(e,t,n,i){return n<e?(this.x2=e,this.x1=n):(this.x1=e,this.x2=n),i<t?(this.y2=t,this.y1=i):(this.y1=t,this.y2=i),this},r.prototype.defined=function(e){return this[e]!==Number.MAX_VALUE&&this[e]!==-Number.MAX_VALUE},r})();function Ab(r,e){var t=r.getEulerAngles()||0;r.setEulerAngles(0);var n=r.getBounds(),i=H(n.min,2),a=i[0],s=i[1],o=H(n.max,2),A=o[0],l=o[1],c=r.getBBox(),u=c.width,h=c.height,d=h,f=0,g=0,p=a,v=s,y=AQ(r);if(y){d-=1.5;var m=y.style.textAlign,B=y.style.textBaseline;m==="center"?p=(a+A)/2:(m==="right"||m==="end")&&(p=A),B==="middle"?v=(s+l)/2:B==="bottom"&&(v=l)}var C=H(Wn(e),4),S=C[0],F=S===void 0?0:S,T=C[1],O=T===void 0?0:T,I=C[2],k=I===void 0?F:I,N=C[3],U=N===void 0?O:N,D=new ob((f+=a)-U,(g+=s)-F,f+u+O,g+d+k);return r.setEulerAngles(t),D.rotatedPoints(aA(t),p,v)}function $l(r,e){return e[0]<=Math.max(r[0][0],r[1][0])&&e[0]<=Math.min(r[0][0],r[1][0])&&e[1]<=Math.max(r[0][1],r[1][1])&&e[1]<=Math.min(r[0][1],r[1][1])}function Yl(r,e,t){var n=(e[1]-r[1])*(t[0]-e[0])-(e[0]-r[0])*(t[1]-e[1]);return n===0?0:n<0?2:1}function Kre(r,e){var t=Yl(r[0],r[1],e[0]),n=Yl(r[0],r[1],e[1]),i=Yl(e[0],e[1],r[0]),a=Yl(e[0],e[1],r[1]);return!!(t!==n&&i!==a||t===0&&$l(r,e[0])||n===0&&$l(r,e[1])||i===0&&$l(e,r[0])||a===0&&$l(e,r[1]))}function zre(r,e){var t=r.length;if(t<3)return!1;var n=[e,[9999,e[1]]],i=0,a=0;do{var s=[r[a],r[(a+1)%t]];if(Kre(s,n)){if(Yl(s[0],e,s[1])===0)return $l(s,e);i++}a=(a+1)%t}while(a!==0);return!!(i&1)}function Vre(r,e){return e.every(function(t){return zre(r,t)})}function jre(r,e,t){var n=r.x1,i=r.x2,a=r.y1,s=r.y2,o=[[n,a],[i,a],[i,s],[n,s]],A=Ab(e,t);return Vre(o,A)}function Wre(r,e){var t=H(r,4),n=t[0],i=t[1],a=t[2],s=t[3],o=H(e,4),A=o[0],l=o[1],c=o[2],u=o[3],h=a-n,d=s-i,f=c-A,g=u-l,p=h*g-f*d;if(p===0)return!1;var v=p>0,y=n-A,m=i-l,B=h*m-d*y;if(B<0===v)return!1;var C=f*m-g*y;return!(C<0===v||B>p===v||C>p===v)}function qre(r,e){var t=[[r[0],r[1],r[2],r[3]],[r[2],r[3],r[4],r[5]],[r[4],r[5],r[6],r[7]],[r[6],r[7],r[0],r[1]]];return t.some(function(n){return Wre(e,n)})}function $re(r,e,t){var n,i,a=Ab(r,t).flat(1),s=Ab(e,t).flat(1),o=[[a[0],a[1],a[2],a[3]],[a[0],a[1],a[4],a[5]],[a[4],a[5],a[6],a[7]],[a[2],a[3],a[6],a[7]]];try{for(var A=bA(o),l=A.next();!l.done;l=A.next()){var c=l.value;if(qre(s,c))return!0}}catch(u){n={error:u}}finally{try{l&&!l.done&&(i=A.return)&&i.call(A)}finally{if(n)throw n.error}}return!1}function Yre(r,e){var t=r.type,n=r.labelDirection,i=r.crossSize;if(!i)return!1;if(t==="arc"){var a=r.center,s=r.radius,o=H(a,2),A=o[0],l=o[1],c=n==="negative"?0:i,u=-s-c,h=s+c,d=H(Wn(e),4),f=d[0],g=d[1],p=d[2],v=d[3];return new ob(A+u-v,l+u-f,A+h+g,l+h+p)}var y=H(r.startPos,2),m=y[0],B=y[1],C=H(r.endPos,2),S=C[0],F=C[1],T=H(qQ(r)?[-e,0,e,0]:[0,e,0,-e],4),O=T[0],I=T[1],k=T[2],N=T[3],U=lA(0,r),D=ba(U,i),G=new ob(m,B,S,F);return G.x1+=N,G.y1+=O,G.x2+=I+D[0],G.y2+=k+D[1],G}function lf(r,e,t){var n,i,a=e.crossPadding,s=new Set,o=null,A=Yre(e,a),l=function(f){return A?jre(A,f):!0},c=function(f,g){return!f||!f.firstChild?!0:!$re(f.firstChild,g.firstChild,Wn(t))};try{for(var u=bA(r),h=u.next();!h.done;h=u.next()){var d=h.value;l(d)?!o||c(o,d)?o=d:(s.add(o),s.add(d)):s.add(d)}}catch(f){n={error:f}}finally{try{h&&!h.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}return Array.from(s)}function lb(r,e){return e===void 0&&(e={}),ke(r)?0:typeof r=="number"?r:Math.floor(Vte(r,e))}function Xre(r,e,t,n){if(!(r.length<=0)){var i=e.suffix,a=i===void 0?"...":i,s=e.minLength,o=e.maxLength,A=o===void 0?1/0:o,l=e.step,c=l===void 0?" ":l,u=e.margin,h=u===void 0?[0,0,0,0]:u,d=oQ(n.getTextShape(r[0])),f=lb(c,d),g=s?lb(s,d):f,p=lb(A,d);(ke(p)||p===1/0)&&(p=Math.max.apply(null,r.map(function(S){return S.getBBox().width})));var v=r.slice(),y=H(h,4);y[0],y[1],y[2],y[3];for(var m=function(S){if(v.forEach(function(F){n.ellipsis(n.getTextShape(F),S,a)}),v=lf(r,t,h),v.length<1)return{value:void 0}},B=p;B>g+f;B-=f){var C=m(B);if(typeof C=="object")return C.value}}}var Zre={parity:function(r,e){var t=e.seq,n=t===void 0?2:t;return r.filter(function(i,a){return a%n?(Ti(i),!1):!0})}},Jre=function(r){return r.filter(zte)};function eie(r,e,t,n){var i=r.length,a=e.keepHeader,s=e.keepTail;if(!(i<=1||i===2&&a&&s)){var o=Zre.parity,A=function(m){return m.forEach(n.show),m},l=2,c=r.slice(),u=r.slice(),h=Math.min.apply(Math,Ie([1],H(r.map(function(m){return m.getBBox().width})),!1));if(t.type==="linear"&&(sb(t)||qQ(t))){var d=fQ(r[0]).left,f=fQ(r[i-1]).right,g=Math.abs(f-d)||1;l=Math.max(Math.floor(i*h/g),l)}var p,v;for(a&&(p=c.splice(0,1)[0]),s&&(v=c.splice(-1,1)[0],c.reverse()),A(c);l<r.length&&lf(Jre(v?Ie(Ie([v],H(u),!1),[p],!1):Ie([p],H(u),!1)),t,e?.margin).length;){if(v&&!p&&l%2===0){var y=c.splice(0,1);y.forEach(n.hide)}else if(v&&p){var y=c.splice(0,1);y.forEach(n.hide)}u=o(A(c),{seq:l}),l++}}}function tie(r,e,t,n){var i,a,s=e.optionalAngles,o=s===void 0?[0,45,90]:s,A=e.margin,l=e.recoverWhenFailed,c=l===void 0?!0:l,u=r.map(function(v){return v.getLocalEulerAngles()}),h=function(){return lf(r,t,A).length<1},d=function(v){return r.forEach(function(y,m){var B=Array.isArray(v)?v[m]:v;n.rotate(y,+B)})};try{for(var f=bA(o),g=f.next();!g.done;g=f.next()){var p=g.value;if(d(p),h())return}}catch(v){i={error:v}}finally{try{g&&!g.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}c&&d(u)}function nie(r){var e=r.type,t=r.labelDirection;return e==="linear"&&sb(r)?t==="negative"?"bottom":"top":"middle"}function rie(r,e,t,n,i){var a,s=e.maxLines,o=s===void 0?3:s,A=e.recoverWhenFailed,l=A===void 0?!0:A,c=e.margin,u=c===void 0?[0,0,0,0]:c,h=Mr((a=e.wordWrapWidth)!==null&&a!==void 0?a:50,[i]),d=r.map(function(m){return m.attr("maxLines")||1}),f=Math.min.apply(Math,Ie([],H(d),!1)),g=function(){return lf(r,t,u).length<1},p=nie(t),v=function(m){return r.forEach(function(B,C){var S=Array.isArray(m)?m[C]:m;n.wrap(B,h,S,p)})};if(!(f>o)){if(t.type==="linear"&&sb(t)){if(v(o),g())return}else for(var y=f;y<=o;y++)if(v(y),g())return;l&&v(d)}}var iie=new Map([["hide",eie],["rotate",tie],["ellipsis",Xre],["wrap",rie]]);function aie(r,e,t){return e.labelOverlap.length<1?!1:t==="hide"?!Gte(r[0]):t==="rotate"?!r.some(function(n){var i;return!!(!((i=n.attr("transform"))===null||i===void 0)&&i.includes("rotate"))}):t==="ellipsis"||t==="wrap"?r.filter(function(n){return n.querySelector("text")}).length>=1:!0}function sie(r,e,t,n){var i=e.labelOverlap,a=i===void 0?[]:i;a.length&&a.forEach(function(s){var o=s.type,A=iie.get(o);aie(r,e,o)&&A?.(r,s,e,n,t)})}function oie(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=function(n){return n==="positive"?-1:1};return r.reduce(function(n,i){return n*t(i)},1)}function JQ(r){for(var e=r;e<0;)e+=360;return Math.round(e%360)}function cb(r,e){var t=H(r,2),n=t[0],i=t[1],a=H(e,2),s=a[0],o=a[1],A=H([n*s+i*o,n*o-i*s],2),l=A[0],c=A[1];return Math.atan2(c,l)}function Aie(r){var e=(r+360)%180;return jn(e,-90,90)||(e+=180),e}function lie(r,e,t){var n,i=t.labelAlign,a=(n=e.style.transform)===null||n===void 0?void 0:n.includes("rotate");if(a)return e.getLocalEulerAngles();var s=0,o=lA(r.value,t),A=sf(r.value,t);return i==="horizontal"?0:(i==="perpendicular"?s=cb([1,0],o):s=cb([A[0]<0?-1:1,0],A),Aie(aQ(s)))}function eU(r,e,t){var n=t.type,i=t.labelAlign,a=lA(r,t),s=JQ(e),o=JQ(aQ(cb([1,0],a))),A="center",l="middle";return n==="linear"?[90,270].includes(o)&&s===0?(A="center",l=a[1]===1?"top":"bottom"):!(o%180)&&[90,270].includes(s)?A="center":o===0?(jn(s,0,90,!1,!0)||jn(s,0,90)||jn(s,270,360))&&(A="start"):o===90?jn(s,0,90,!1,!0)?A="start":(jn(s,90,180)||jn(s,270,360))&&(A="end"):o===270?jn(s,0,90,!1,!0)?A="end":(jn(s,90,180)||jn(s,270,360))&&(A="start"):o===180&&(s===90?A="start":(jn(s,0,90)||jn(s,270,360))&&(A="end")):i==="parallel"?jn(o,0,180,!0)?l="top":l="bottom":i==="horizontal"?jn(o,90,270,!1)?A="end":(jn(o,270,360,!1)||jn(o,0,90))&&(A="start"):i==="perpendicular"&&(jn(o,90,270)?A="end":A="start"),{textAlign:A,textBaseline:l}}function cie(r,e,t){e.setLocalEulerAngles(r);var n=e.__data__.value,i=eU(n,r,t),a=e.querySelector(Ke.labelItem.class);a&&nU(a,i)}function tU(r,e,t){var n=t.showTick,i=t.tickLength,a=t.tickDirection,s=t.labelDirection,o=t.labelSpacing,A=e.indexOf(r),l=Mr(o,[r,A,e]),c=H([lA(r.value,t),oie(s,a)],2),u=c[0],h=c[1],d=h===1?Mr(n?i:0,[r,A,e]):0,f=H(Vl(ba(u,l+d),Af(r.value,t)),2),g=f[0],p=f[1];return{x:g,y:p}}function uie(r,e,t,n){var i=n.labelFormatter,a=Te(i)?function(){return Ba(Mr(i,[r,e,t,lA(r.value,n)]))}:function(){return Ba(r.label||"")};return a}function hie(r,e,t,n){var i=n.labelRender,a=(Dn(n,"endPos.0",400)-Dn(n,"startPos.0",0))/t.length,s=Te(i)?Mr(i,[r,e,t,lA(r.value,n)]):r.label||"",o=pne(s)||30;return function(){return Wte(s,{width:a,height:o})}}var die={html:["fill"],text:[]};function nU(r,e){["text","html"].includes(r.nodeName)&&r.attr(KB(e,die[r.nodeName]))}function fie(r,e){sie(this.node().childNodes,r,e,{hide:Ti,show:zl,rotate:function(t,n){cie(+n,t,r)},ellipsis:function(t,n,i){t&&DB(t,n||1/0,i)},wrap:function(t,n,i){t&&jte(t,n,i)},getTextShape:function(t){return t.querySelector(Ke.labelItem.class)}})}function rU(r,e,t,n,i){var a=t.indexOf(e),s=i.labelRender,o=i.classNamePrefix,A=Me(r).append(s?hie(e,a,t,i):uie(e,a,t,i)).attr("className",Ke.labelItem.name).node();zr(Me(A),Ke.labelItem,pt.labelItem,o);var l=H(Ea(jQ(n,[e,a,t])),2),c=l[0],u=l[1],h=u.transform,d=Pt(u,["transform"]);pQ(A,h);var f=lie(e,A,i);if(A.getLocalEulerAngles()||A.setLocalEulerAngles(f),nU(A,se(se({},eU(e.value,f,i)),c)),A.nodeName==="html"){var g=A.getBBox(),p=A.style.x||0;A.attr("x",p-g.width/2)}return r.attr(d),A}function gie(r,e,t,n,i){var a=t.classNamePrefix,s=ib(e,t.labelFilter),o=je(t,"label"),A,l=r.selectAll(Ke.label.class).data(s,function(c,u){return u}).join(function(c){var u=c.append("g").attr("className",Ke.label.name).transition(function(h){rU(this,h,e,o,t);var d=tU(h,e,t),f=d.x,g=d.y;return this.style.transform="translate(".concat(f,", ").concat(g,")"),null});return zr(u,Ke.label,pt.label,a),u},function(c){return c.transition(function(u){var h=this.querySelector(Ke.labelItem.class),d=rU(this,u,e,o,t),f=wre(h,d,n.update),g=tU(u,e,t),p=g.x,v=g.y,y=Oi(this,{transform:"translate(".concat(p,", ").concat(v,")")},n.update);return Ie(Ie([],H(f),!1),[y],!1)})},function(c){return A=c,c.transition(function(){var u=this,h=af(this.childNodes[0],n.exit);return oA(h,function(){return Me(u).remove()}),h}),A}).transitions();return yre(l,function(){fie.call(r,t,i)}),l}function iU(r,e){return ab(r,e.tickDirection,e)}function pie(r,e){var t=H(r,2),n=t[0],i=t[1];return[[0,0],[n*e,i*e]]}function vie(r,e,t,n,i){var a=i.tickLength,s=H(pie(n,Mr(a,[r,e,t])),2),o=H(s[0],2),A=o[0],l=o[1],c=H(s[1],2),u=c[0],h=c[1];return{x1:A,x2:u,y1:l,y2:h}}function yie(r,e,t,n,i){var a=i.tickFormatter,s=i.classNamePrefix,o=iU(e.value,i),A="line";Te(a)&&(A=function(){return Mr(a,[e,t,n,o])});var l=r.append(A).attr("className",Ke.tickItem.name);return zr(l,Ke.tickItem,pt.tickItem,s),l}function mie(r,e,t,n,i,a,s){var o=iU(r.value,a),A=vie(r,e,t,o,a),l=A.x1,c=A.x2,u=A.y1,h=A.y2,d=H(Ea(jQ(s,[r,e,t,o])),2),f=d[0],g=d[1];n.node().nodeName==="line"&&n.styles(se({x1:l,x2:c,y1:u,y2:h},f)),i.attr(g),n.styles(f)}function aU(r,e,t,n,i,a){var s=yie(Me(this),r,e,t,n);mie(r,e,t,s,this,n,i);var o=H(Af(r.value,n),2),A=o[0],l=o[1];return Oi(this,{transform:"translate(".concat(A,", ").concat(l,")")},a)}function wie(r,e,t,n){var i=t.classNamePrefix,a=ib(e,t.tickFilter),s=je(t,"tick");return r.selectAll(Ke.tick.class).data(a,function(o){return o.id||o.label}).join(function(o){var A=o.append("g").attr("className",Ke.tick.name).transition(function(l,c){return aU.call(this,l,c,a,t,s,!1)});return zr(A,Ke.tick,pt.tick,i),A},function(o){return o.transition(function(A,l){return this.removeChildren(),aU.call(this,A,l,a,t,s,n.update)})},function(o){return o.transition(function(){var A=this,l=af(this.childNodes[0],n.exit);return oA(l,function(){return A.remove()}),l})}).transitions()}function Bie(r,e,t){var n=t.titlePosition,i=n===void 0?"lb":n,a=t.titleSpacing,s=Jd(i),o=r.node().getLocalBounds(),A=H(o.min,2),l=A[0],c=A[1],u=H(o.halfExtents,2),h=u[0],d=u[1],f=H(e.node().getLocalBounds().halfExtents,2),g=f[0],p=f[1],v=H([l+h,c+d],2),y=v[0],m=v[1],B=H(Wn(a),4),C=B[0],S=B[1],F=B[2],T=B[3];if(["start","end"].includes(i)&&t.type==="linear"){var O=t.startPos,I=t.endPos,k=H(i==="start"?[O,I]:[I,O],2),N=k[0],U=k[1],D=uQ([-U[0]+N[0],-U[1]+N[1]]),G=H(ba(D,C),2),Z=G[0],q=G[1];return{x:N[0]+Z,y:N[1]+q}}return s.includes("t")&&(m-=d+p+C),s.includes("r")&&(y+=h+g+S),s.includes("l")&&(y-=h+g+T),s.includes("b")&&(m+=d+p+F),{x:y,y:m}}function bie(r,e,t){var n=r.getGeometryBounds().halfExtents,i=n[1]*2;if(e==="vertical"){if(t==="left")return"rotate(-90) translate(0, ".concat(i/2,")");if(t==="right")return"rotate(-90) translate(0, -".concat(i/2,")")}return""}function sU(r,e,t,n,i){var a=je(n,"title"),s=H(Ea(a),2),o=s[0],A=s[1],l=A.transform,c=A.transformOrigin,u=Pt(A,["transform","transformOrigin"]);e.styles(u);var h=l||bie(r.node(),o.direction,o.position);r.styles(se(se({},o),{transformOrigin:c})),pQ(r.node(),h);var d=Bie(Me(t._offscreen||t.querySelector(Ke.mainGroup.class)),e,n),f=d.x,g=d.y,p=Oi(e.node(),{transform:"translate(".concat(f,", ").concat(g,")")},i);return p}function Eie(r,e,t,n){var i=t.titleText,a=t.classNamePrefix;return r.selectAll(Ke.title.class).data([{title:i}].filter(function(s){return!!s.title}),function(s,o){return s.title}).join(function(s){var o=s.append(function(){return Ba(i)}).attr("className",Ke.title.name).transition(function(){return sU(Me(this),r,e,t,n.enter)});return zr(o,Ke.title,pt.title,a),o},function(s){return s.transition(function(){return sU(Me(this),r,e,t,n.update)})},function(s){return s.remove()}).transitions()}function oU(r,e,t,n){var i=r.showLine,a=r.showTick,s=r.showLabel,o=r.classNamePrefix,A=e.maybeAppendByClassName(Ke.lineGroup,"g");zr(A,Ke.lineGroup,pt.lineGroup,o);var l=Or(i,A,function(f){return Pre(f,r,n)})||[],c=e.maybeAppendByClassName(Ke.tickGroup,"g");zr(c,Ke.tickGroup,pt.tickGroup,o);var u=Or(a,c,function(f){return wie(f,t,r,n)})||[],h=e.maybeAppendByClassName(Ke.labelGroup,"g");zr(h,Ke.labelGroup,pt.labelGroup,o);var d=Or(s,h,function(f){return gie(f,t,r,n,e.node())})||[];return Ie(Ie(Ie([],H(l),!1),H(u),!1),H(d),!1).filter(function(f){return!!f})}var xie=(function(r){Xe(e,r);function e(t){return r.call(this,t,nb)||this}return e.prototype.render=function(t,n,i){var a=this,s=t.titleText,o=t.data,A=t.animate,l=t.showTitle,c=t.showGrid,u=t.dataThreshold,h=t.truncRange,d=t.classNamePrefix,f=n.className||"axis";d?n.attr("className","".concat(f," ").concat(d,"axis")):n.className||n.attr("className","axis");var g=ine(o,u).filter(function(F){var T=F.value;return!(h&&T>h[0]&&T<h[1])}),p=RQ(i===void 0?A:i),v=Me(n).maybeAppendByClassName(Ke.gridGroup,"g");zr(v,Ke.gridGroup,pt.gridGroup,d);var y=Or(c,v,function(F){return Gre(F,g,t,p)})||[],m=Me(n).maybeAppendByClassName(Ke.mainGroup,"g");zr(m,Ke.mainGroup,pt.mainGroup,d),s&&(!this.initialized&&p.enter||this.initialized&&p.update)&&oU(t,Me(this.offscreenGroup),g,RQ(!1));var B=oU(t,Me(m.node()),g,p),C=Me(n).maybeAppendByClassName(Ke.titleGroup,"g");zr(C,Ke.titleGroup,pt.titleGroup,d);var S=Or(l,C,function(F){return Eie(F,a,t,p)})||[];return Ie(Ie(Ie([],H(y),!1),H(B),!1),H(S),!1).flat().filter(function(F){return!!F})},e})(en);function fr(r,e,t){return t?"".concat(r," ").concat(t,"legend-").concat(e):r}function Cie(r,e,t){var n=1.4,i=n*t;return[["M",r-t,e-i],["L",r+t,e-i],["L",r+t,e+i],["L",r-t,e+i],["Z"]]}var AU=1.4,lU=.4;function Sie(r,e,t){var n=t,i=n*AU,a=n/2,s=n/6,o=r+i*lU;return[["M",r,e],["L",o,e+a],["L",r+i,e+a],["L",r+i,e-a],["L",o,e-a],["Z"],["M",o,e+s],["L",r+i-2,e+s],["M",o,e-s],["L",r+i-2,e-s]]}function Fie(r,e,t){var n=t,i=n*AU,a=n/2,s=n/6,o=e+i*lU;return[["M",r,e],["L",r-a,o],["L",r-a,e+i],["L",r+a,e+i],["L",r+a,o],["Z"],["M",r-s,o],["L",r-s,e+i-2],["M",r+s,o],["L",r+s,e+i-2]]}gt.registerSymbol("hiddenHandle",Cie),gt.registerSymbol("verticalHandle",Sie),gt.registerSymbol("horizontalHandle",Fie);function ub(r,e,t){return r===void 0&&(r="horizontal"),r==="horizontal"?e:t}var gr={title:"title",item:"item",marker:"marker",label:"label",value:"value",focusIcon:"focus-icon",background:"background",handleMarker:"handle-marker",handleLabel:"handle-label",prevBtn:"prev-btn",nextBtn:"next-btn",pageInfo:"page-info"},oo=Mi({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),cU={showLabel:!0,formatter:function(r){return r.toString()},markerSize:25,markerStroke:"#c5c5c5",markerFill:"#fff",markerLineWidth:1,labelFontSize:12,labelFill:"#c5c5c5",labelText:"",orientation:"vertical",spacing:0};(function(r){Xe(e,r);function e(t){return r.call(this,t,cU)||this}return e.prototype.render=function(t,n){var i=Me(n).maybeAppendByClassName(oo.markerGroup,"g");this.renderMarker(i);var a=Me(n).maybeAppendByClassName(oo.labelGroup,"g");this.renderLabel(a)},e.prototype.renderMarker=function(t){var n=this,i=this.attributes,a=i.orientation,s=i.classNamePrefix,o=i.markerSymbol,A=o===void 0?ub(a,"horizontalHandle","verticalHandle"):o;Or(!!A,t,function(l){var c=je(n.attributes,"marker"),u=se({symbol:A},c),h=fr(oo.marker.name,gr.handleMarker,s);if(n.marker=l.maybeAppendByClassName(oo.marker,function(){return new gt({style:u,className:h})}).update(u),s){var d=n.marker.node().querySelector(".marker");if(d){var f=d.getAttribute("class")||"",g=f.split(" ")[0],p=fr(g,gr.handleMarker,s);d.setAttribute("class",p)}}})},e.prototype.renderLabel=function(t){var n=this,i=this.attributes,a=i.showLabel,s=i.orientation,o=i.spacing,A=o===void 0?0:o,l=i.formatter,c=i.classNamePrefix;Or(a,t,function(u){var h,d=je(n.attributes,"label"),f=d.text,g=Pt(d,["text"]),p=((h=u.select(oo.marker.class))===null||h===void 0?void 0:h.node().getBBox())||{},v=p.width,y=v===void 0?0:v,m=p.height,B=m===void 0?0:m,C=H(ub(s,[0,B+A,"center","top"],[y+A,0,"start","middle"]),4),S=C[0],F=C[1],T=C[2],O=C[3],I=fr(oo.label.name,gr.handleLabel,c);u.maybeAppendByClassName(oo.label,"text").attr("className",I).styles(se(se({},g),{x:S,y:F,text:l(f).toString(),textAlign:T,textBaseline:O}))})},e})(en);var uU={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},Tie=bn({},uU,{});bn({},uU,sA(cU,"handle"),{color:["#d0e3fa","#acc7f6","#8daaf2","#6d8eea","#4d73cd","#325bb1","#5a3e75","#8c3c79","#e23455","#e7655b"],indicatorBackgroundFill:"#262626",indicatorLabelFill:"white",indicatorLabelFontSize:12,indicatorVisibility:"hidden",labelAlign:"value",labelDirection:"positive",labelSpacing:5,showHandle:!0,showIndicator:!0,showLabel:!0,slidable:!0,titleText:"",type:"continuous"});var Ao=Mi({title:"title",html:"html",titleGroup:"title-group",items:"items",itemsGroup:"items-group",contentGroup:"content-group",ribbonGroup:"ribbon-group",ribbon:"ribbon",handlesGroup:"handles-group",handle:"handle",startHandle:"start-handle",endHandle:"end-handle",labelGroup:"label-group",label:"label",indicator:"indicator"},"legend"),hb=Mi({text:"text"},"title");function Mie(r,e){var t=r.attributes,n=t.position,i=t.spacing,a=t.inset,s=t.text,o=r.getBBox(),A=e.getBBox(),l=Jd(n),c=H(Wn(s?i:0),4),u=c[0],h=c[1],d=c[2],f=c[3],g=H(Wn(a),4),p=g[0],v=g[1],y=g[2],m=g[3],B=H([f+h,u+d],2),C=B[0],S=B[1],F=H([m+v,p+y],2),T=F[0],O=F[1];if(l[0]==="l")return new dr(o.x,o.y,A.width+o.width+C+T,Math.max(A.height+O,o.height));if(l[0]==="t")return new dr(o.x,o.y,Math.max(A.width+T,o.width),A.height+o.height+S+O);var I=H([e.attributes.width||A.width,e.attributes.height||A.height],2),k=I[0],N=I[1];return new dr(A.x,A.y,k+o.width+C+T,N+o.height+S+O)}function Oie(r,e){var t=Object.entries(e).reduce(function(n,i){var a=H(i,2),s=a[0],o=a[1],A=r.node().attr(s);return A||(n[s]=o),n},{});r.styles(t)}function Iie(r){var e,t,n,i,a=r,s=a.width,o=a.height,A=a.position,l=H([+s/2,+o/2],2),c=l[0],u=l[1],h=H([+c,+u,"center","middle"],4),d=h[0],f=h[1],g=h[2],p=h[3],v=Jd(A);return v.includes("l")&&(e=H([0,"start"],2),d=e[0],g=e[1]),v.includes("r")&&(t=H([+s,"end"],2),d=t[0],g=t[1]),v.includes("t")&&(n=H([0,"top"],2),f=n[0],p=n[1]),v.includes("b")&&(i=H([+o,"bottom"],2),f=i[0],p=i[1]),{x:d,y:f,textAlign:g,textBaseline:p}}var _ie=(function(r){Xe(e,r);function e(t){return r.call(this,t,{text:"",width:0,height:0,fill:"#4a505a",fontWeight:"bold",fontSize:12,fontFamily:"sans-serif",inset:0,spacing:0,position:"top-left"})||this}return e.prototype.getAvailableSpace=function(){var t=this,n=this.attributes,i=n.width,a=n.height,s=n.position,o=n.spacing,A=n.inset,l=t.querySelector(hb.text.class);if(!l)return new dr(0,0,+i,+a);var c=l.getBBox(),u=c.width,h=c.height,d=H(Wn(o),4),f=d[0],g=d[1],p=d[2],v=d[3],y=H([0,0,+i,+a],4),m=y[0],B=y[1],C=y[2],S=y[3],F=Jd(s);if(F.includes("i"))return new dr(m,B,C,S);F.forEach(function(Z,q){var j,te,ue,ge;Z==="t"&&(j=H(q===0?[h+p,+a-h-p]:[0,+a],2),B=j[0],S=j[1]),Z==="r"&&(te=H([+i-u-v],1),C=te[0]),Z==="b"&&(ue=H([+a-h-f],1),S=ue[0]),Z==="l"&&(ge=H(q===0?[u+g,+i-u-g]:[0,+i],2),m=ge[0],C=ge[1])});var T=H(Wn(A),4),O=T[0],I=T[1],k=T[2],N=T[3],U=H([N+I,O+k],2),D=U[0],G=U[1];return new dr(m+N,B+O,C-D,S-G)},e.prototype.getBBox=function(){return this.title?this.title.getBBox():new dr(0,0,0,0)},e.prototype.render=function(t,n){var i=this;t.width,t.height,t.position,t.spacing;var a=t.classNamePrefix,s=Pt(t,["width","height","position","spacing","classNamePrefix"]),o=H(Ea(s),1),A=o[0],l=Iie(t),c=l.x,u=l.y,h=l.textAlign,d=l.textBaseline;Or(!!s.text,Me(n),function(f){var g=fr(hb.text.name,gr.title,a);i.title=f.maybeAppendByClassName(hb.text,"text").attr("className",g).styles(A).call(Oie,{x:c,y:u,textAlign:h,textBaseline:d}).node()})},e})(en),pr=Mi({prevBtnGroup:"prev-btn-group",prevBtn:"prev-btn",nextBtnGroup:"next-btn-group",nextBtn:"next-btn",pageInfoGroup:"page-info-group",pageInfo:"page-info",playWindow:"play-window",contentGroup:"content-group",controller:"controller",clipPath:"clip-path"},"navigator"),kie=(function(r){Xe(e,r);function e(t){var n=r.call(this,t,{x:0,y:0,animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonD:Lne(0,0,6),buttonSize:12,controllerPadding:5,controllerSpacing:5,formatter:function(i,a){return"".concat(i,"/").concat(a)},defaultPage:0,loop:!1,orientation:"horizontal",pageNumFill:"black",pageNumFontSize:12,pageNumTextAlign:"start",pageNumTextBaseline:"middle"})||this;return n.playState="idle",n.contentGroup=n.appendChild(new Cn({class:pr.contentGroup.name})),n.playWindow=n.contentGroup.appendChild(new Cn({class:pr.playWindow.name})),n.innerCurrPage=n.defaultPage,n}return Object.defineProperty(e.prototype,"defaultPage",{get:function(){var t=this.attributes.defaultPage;return Yt(t,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"controllerShape",{get:function(){return this.totalPages>1?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageShape",{get:function(){var t=this.pageViews,n=H(gne(t.map(function(u){var h=u.getBBox(),d=h.width,f=h.height;return[d,f]})).map(function(u){return Math.max.apply(Math,Ie([],H(u),!1))}),2),i=n[0],a=n[1],s=this.attributes,o=s.pageWidth,A=o===void 0?i:o,l=s.pageHeight,c=l===void 0?a:l;return{pageWidth:A,pageHeight:c}},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(e.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var t=r.prototype.getBBox.call(this),n=t.x,i=t.y,a=this.controllerShape,s=this.pageShape,o=s.pageWidth,A=s.pageHeight;return new dr(n,i,o+a.width,A)},e.prototype.goTo=function(t){var n=this,i=this.attributes.animate,a=this,s=a.currPage,o=a.playState,A=a.playWindow,l=a.pageViews;if(o!=="idle"||t<0||l.length<=0||t>=l.length)return null;l[s].setLocalPosition(0,0),this.prepareFollowingPage(t);var c=H(this.getFollowingPageDiff(t),2),u=c[0],h=c[1];this.playState="running";var d=HQ(A,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-u,", ").concat(-h,")")}],i);return oA(d,function(){n.innerCurrPage=t,n.playState="idle",n.setVisiblePages([t]),n.updatePageInfo()}),d},e.prototype.prev=function(){var t=this.attributes.loop,n=this.pageViews.length,i=this.currPage;if(!t&&i<=0)return null;var a=t?(i-1+n)%n:Yt(i-1,0,n);return this.goTo(a)},e.prototype.next=function(){var t=this.attributes.loop,n=this.pageViews.length,i=this.currPage;if(!t&&i>=n-1)return null;var a=t?(i+1)%n:Yt(i+1,0,n);return this.goTo(a)},e.prototype.renderClipPath=function(t){var n=this.pageShape,i=n.pageWidth,a=n.pageHeight;if(!i||!a){this.contentGroup.style.clipPath=void 0;return}this.clipPath=t.maybeAppendByClassName(pr.clipPath,"rect").styles({width:i,height:a}),this.contentGroup.attr("clipPath",this.clipPath.node())},e.prototype.setVisiblePages=function(t){this.playWindow.children.forEach(function(n,i){t.includes(i)?zl(n):Ti(n)})},e.prototype.adjustControllerLayout=function(){var t=this,n=t.prevBtnGroup,i=t.nextBtnGroup,a=t.pageInfoGroup,s=this.attributes,o=s.orientation,A=s.controllerPadding,l=a.getBBox(),c=l.width;l.height;var u=H(o==="horizontal"?[-180,0]:[-90,90],2),h=u[0],d=u[1];n.setLocalEulerAngles(h),i.setLocalEulerAngles(d);var f=n.getBBox(),g=f.width,p=f.height,v=i.getBBox(),y=v.width,m=v.height,B=Math.max(g,c,y),C=o==="horizontal"?{offset:[[0,0],[g/2+A,0],[g+c+A*2,0]],textAlign:"start"}:{offset:[[B/2,-p-A],[B/2,0],[B/2,m+A]],textAlign:"center"},S=H(C.offset,3),F=H(S[0],2),T=F[0],O=F[1],I=H(S[1],2),k=I[0],N=I[1],U=H(S[2],2),D=U[0],G=U[1],Z=C.textAlign,q=a.querySelector("text");q&&(q.style.textAlign=Z),n.setLocalPosition(T,O),a.setLocalPosition(k,N),i.setLocalPosition(D,G)},e.prototype.updatePageInfo=function(){var t,n=this,i=n.currPage,a=n.pageViews,s=n.attributes.formatter;a.length<2||((t=this.pageInfoGroup.querySelector(pr.pageInfo.class))===null||t===void 0||t.attr("text",s(i+1,a.length)),this.adjustControllerLayout())},e.prototype.getFollowingPageDiff=function(t){var n=this.currPage;if(n===t)return[0,0];var i=this.attributes.orientation,a=this.pageShape,s=a.pageWidth,o=a.pageHeight,A=t<n?-1:1;return i==="horizontal"?[A*s,0]:[0,A*o]},e.prototype.prepareFollowingPage=function(t){var n=this,i=n.currPage,a=n.pageViews;if(this.setVisiblePages([t,i]),t!==i){var s=H(this.getFollowingPageDiff(t),2),o=s[0],A=s[1];a[t].setLocalPosition(o,A)}},e.prototype.renderController=function(t){var n=this,i=this.attributes,a=i.controllerSpacing,s=i.classNamePrefix,o=s===void 0?"":s,A=this.pageShape,l=A.pageWidth,c=A.pageHeight,u=this.pageViews.length>=2,h=t.maybeAppendByClassName(pr.controller,"g");if(Yd(h.node(),u),!!u){var d=je(this.attributes,"button"),f=je(this.attributes,"pageNum"),g=H(Ea(d),2),p=g[0],v=g[1],y=p.size,m=Pt(p,["size"]),B=!h.select(pr.prevBtnGroup.class).node(),C=h.maybeAppendByClassName(pr.prevBtnGroup,"g").styles(v);this.prevBtnGroup=C.node();var S=C.maybeAppendByClassName(pr.prevBtn,"path");if(o){var F=fr(pr.prevBtn.name,gr.prevBtn,o);S.node().setAttribute("class",F)}var T=h.maybeAppendByClassName(pr.nextBtnGroup,"g").styles(v);this.nextBtnGroup=T.node();var O=T.maybeAppendByClassName(pr.nextBtn,"path");if(o){var I=fr(pr.nextBtn.name,gr.nextBtn,o);O.node().setAttribute("class",I)}[S,O].forEach(function(D){D.styles(se(se({},m),{transformOrigin:"center"})),zB(D.node(),y)});var k=h.maybeAppendByClassName(pr.pageInfoGroup,"g");this.pageInfoGroup=k.node();var N=k.maybeAppendByClassName(pr.pageInfo,"text");if(N.styles(f),o){var U=fr(pr.pageInfo.name,gr.pageInfo,o);N.node().setAttribute("class",U)}this.updatePageInfo(),h.node().setLocalPosition(l+a,c/2),B&&(this.prevBtnGroup.addEventListener("click",function(){n.prev()}),this.nextBtnGroup.addEventListener("click",function(){n.next()}))}},e.prototype.render=function(t,n){var i=t.x,a=i===void 0?0:i,s=t.y,o=s===void 0?0:s;this.attr("transform","translate(".concat(a,", ").concat(o,")"));var A=Me(n);this.renderClipPath(A),this.renderController(A),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},e.prototype.bindEvents=function(){var t=this,n=wA(function(){return t.render(t.attributes,t)},50);this.playWindow.addEventListener(at.INSERTED,n),this.playWindow.addEventListener(at.REMOVED,n)},e})(en),nt,Nie="component-poptip",Ze={CONTAINER:"component-poptip",ARROW:"component-poptip-arrow",TEXT:"component-poptip-text"},hU=(nt={},nt[".".concat(Ze.CONTAINER)]={visibility:"visible",position:"absolute","background-color":"rgba(0, 0, 0)","box-shadow":"0px 0px 10px #aeaeae","border-radius":"3px",color:"#fff",opacity:.8,"font-size":"12px",padding:"4px 6px",display:"flex","justify-content":"center","align-items":"center","z-index":8,transition:"visibility 50ms"},nt[".".concat(Ze.TEXT)]={"text-align":"center"},nt[".".concat(Ze.CONTAINER,"[data-position='top']")]={transform:"translate(-50%, -100%)"},nt[".".concat(Ze.CONTAINER,"[data-position='left']")]={transform:"translate(-100%, -50%)"},nt[".".concat(Ze.CONTAINER,"[data-position='right']")]={transform:"translate(0, -50%)"},nt[".".concat(Ze.CONTAINER,"[data-position='bottom']")]={transform:"translate(-50%, 0)"},nt[".".concat(Ze.CONTAINER,"[data-position='top-left']")]={transform:"translate(0,-100%)"},nt[".".concat(Ze.CONTAINER,"[data-position='top-right']")]={transform:"translate(-100%,-100%)"},nt[".".concat(Ze.CONTAINER,"[data-position='left-top']")]={transform:"translate(-100%, 0)"},nt[".".concat(Ze.CONTAINER,"[data-position='left-bottom']")]={transform:"translate(-100%, -100%)"},nt[".".concat(Ze.CONTAINER,"[data-position='right-top']")]={transform:"translate(0, 0)"},nt[".".concat(Ze.CONTAINER,"[data-position='right-bottom']")]={transform:"translate(0, -100%)"},nt[".".concat(Ze.CONTAINER,"[data-position='bottom-left']")]={transform:"translate(0, 0)"},nt[".".concat(Ze.CONTAINER,"[data-position='bottom-right']")]={transform:"translate(-100%, 0)"},nt[".".concat(Ze.ARROW)]={width:"4px",height:"4px",transform:"rotate(45deg)","background-color":"rgba(0, 0, 0)",position:"absolute","z-index":-1},nt[".".concat(Ze.CONTAINER,"[data-position='top']")]={transform:"translate(-50%, calc(-100% - 5px))"},nt["[data-position='top'] .".concat(Ze.ARROW)]={bottom:"-2px"},nt[".".concat(Ze.CONTAINER,"[data-position='left']")]={transform:"translate(calc(-100% - 5px), -50%)"},nt["[data-position='left'] .".concat(Ze.ARROW)]={right:"-2px"},nt[".".concat(Ze.CONTAINER,"[data-position='right']")]={transform:"translate(5px, -50%)"},nt["[data-position='right'] .".concat(Ze.ARROW)]={left:"-2px"},nt[".".concat(Ze.CONTAINER,"[data-position='bottom']")]={transform:"translate(-50%, 5px)"},nt["[data-position='bottom'] .".concat(Ze.ARROW)]={top:"-2px"},nt[".".concat(Ze.CONTAINER,"[data-position='top-left']")]={transform:"translate(0, calc(-100% - 5px))"},nt["[data-position='top-left'] .".concat(Ze.ARROW)]={left:"10px",bottom:"-2px"},nt[".".concat(Ze.CONTAINER,"[data-position='top-right']")]={transform:"translate(-100%, calc(-100% - 5px))"},nt["[data-position='top-right'] .".concat(Ze.ARROW)]={right:"10px",bottom:"-2px"},nt[".".concat(Ze.CONTAINER,"[data-position='left-top']")]={transform:"translate(calc(-100% - 5px), 0)"},nt["[data-position='left-top'] .".concat(Ze.ARROW)]={right:"-2px",top:"8px"},nt[".".concat(Ze.CONTAINER,"[data-position='left-bottom']")]={transform:"translate(calc(-100% - 5px), -100%)"},nt["[data-position='left-bottom'] .".concat(Ze.ARROW)]={right:"-2px",bottom:"8px"},nt[".".concat(Ze.CONTAINER,"[data-position='right-top']")]={transform:"translate(5px, 0)"},nt["[data-position='right-top'] .".concat(Ze.ARROW)]={left:"-2px",top:"8px"},nt[".".concat(Ze.CONTAINER,"[data-position='right-bottom']")]={transform:"translate(5px, -100%)"},nt["[data-position='right-bottom'] .".concat(Ze.ARROW)]={left:"-2px",bottom:"8px"},nt[".".concat(Ze.CONTAINER,"[data-position='bottom-left']")]={transform:"translate(0, 5px)"},nt["[data-position='bottom-left'] .".concat(Ze.ARROW)]={top:"-2px",left:"8px"},nt[".".concat(Ze.CONTAINER,"[data-position='bottom-right']")]={transform:"translate(-100%, 5px)"},nt["[data-position='bottom-right'] .".concat(Ze.ARROW)]={top:"-2px",right:"8px"},nt),Lie=void 0;function Qie(r,e,t,n,i,a){if(i===void 0&&(i=!1),a===void 0&&(a=!1),a)return[r,e];var s=t.getBoundingClientRect(),o=s.x,A=s.y,l=s.width,c=s.height;switch(n){case"top":return i?[o+l/2,A]:[r,A];case"left":return i?[o,A+c/2]:[o,e];case"bottom":return i?[o+l/2,A+c]:[r,A+c];case"right":return i?[o+l,A+c/2]:[o+l,e];case"top-right":case"right-top":return[o+l,A];case"left-bottom":case"bottom-left":return[o,A+c];case"right-bottom":case"bottom-right":return[o+l,A+c];default:return[o,A]}}var Uie=function(r){var e;return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e||(e=r.apply(Lie,t)),e}};function Pie(r){var e=r&&document.getElementById(r);return e||(e=document.createElement("div"),e.setAttribute("id",r),document.body.appendChild(e)),e}function Rie(r){var e=Uie(Pie)(r);return e}var Die=(function(r){Xe(e,r);function e(t){var n=r.call(this,Rn({style:{id:Nie}},e.defaultOptions,t))||this;return n.visibility="visible",n.map=new Map,n.domStyles="",n.initShape(),n.render(n.attributes,n),n}return Object.defineProperty(e.prototype,"visible",{get:function(){return this.visibility==="visible"},enumerable:!1,configurable:!0}),e.prototype.render=function(t,n){this.visibility=this.style.visibility,this.updatePoptipElement()},e.prototype.update=function(t){this.attr(Rn({},this.style,t)),this.render(this.attributes,this)},e.prototype.bind=function(t,n){var i=this;if(t){var a=this.style.text,s=function(A){var l=t,c=i.style,u=a;if(n){var h=typeof n=="function"?n.call(null,A):n,d=h.html,f=h.target,g=Pt(h,["html","target"]);c=OR({},i.style,g),(f||f===!1)&&(l=f),typeof d=="string"&&(u=d)}var p=c.position,v=c.arrowPointAtCenter,y=c.follow,m=c.offset;if(l){var B=A,C=B.clientX,S=B.clientY,F=H(Qie(C,S,l,p,v,y),2),T=F[0],O=F[1];i.showTip(T,O,{text:u,position:p,offset:m})}else i.hideTip()},o=function(){i.hideTip()};t.addEventListener("mousemove",s),t.addEventListener("mouseleave",o),this.map.set(t,[s,o])}},e.prototype.unbind=function(t){if(this.map.has(t)){var n=H(this.map.get(t)||[],2),i=n[0],a=n[1];i&&t.removeEventListener("mousemove",i),a&&t.removeEventListener("mouseleave",a),this.map.delete(t)}},e.prototype.clear=function(){this.container.innerHTML=""},e.prototype.destroy=function(){var t=this,n;Ie([],H(this.map.keys()),!1).forEach(function(i){return t.unbind(i)}),(n=this.container)===null||n===void 0||n.remove(),r.prototype.destroy.call(this)},e.prototype.showTip=function(t,n,i){var a=Dn(i,"text");if(!(a&&typeof a!="string")&&(this.applyStyles(),t&&n&&i)){var s=i.offset,o=i.position;if(o&&this.container.setAttribute("data-position",o),this.setOffsetPosition(t,n,s),typeof a=="string"){var A=this.container.querySelector(".".concat(Ze.TEXT));A&&(A.innerHTML=a)}this.visibility="visible",this.container.style.visibility="visible"}},e.prototype.hideTip=function(){this.visibility="hidden",this.container.style.visibility="hidden"},e.prototype.getContainer=function(){return this.container},e.prototype.getClassName=function(){var t=this.style.containerClassName;return"".concat(Ze.CONTAINER).concat(t?" ".concat(t):"")},e.prototype.initShape=function(){var t=this,n=this.style.id;this.container=Rie(n),this.container.className=this.getClassName(),this.container.addEventListener("mousemove",function(){return t.showTip()}),this.container.addEventListener("mouseleave",function(){return t.hideTip()})},e.prototype.updatePoptipElement=function(){var t=this.container;this.clear();var n=this.style,i=n.id,a=n.template,s=n.text;this.container.setAttribute("id",i),this.container.className=this.getClassName();var o='<span class="'.concat(Ze.ARROW,'"></span>');t.innerHTML=o,ot(a)?t.innerHTML+=a:a&&MR(a)&&t.appendChild(a),s&&(t.getElementsByClassName(Ze.TEXT)[0].textContent=s),this.applyStyles(),this.container.style.visibility=this.visibility},e.prototype.applyStyles=function(){var t=bn({},hU,this.style.domStyles),n=Object.entries(t).reduce(function(a,s){var o=H(s,2),A=o[0],l=o[1],c=Object.entries(l).reduce(function(u,h){var d=H(h,2),f=d[0],g=d[1];return"".concat(u).concat(f,": ").concat(g,";")},"");return"".concat(a).concat(A,"{").concat(c,"}")},"");if(this.domStyles!==n){this.domStyles=n;var i=this.container.querySelector("style");i&&this.container.removeChild(i),i=document.createElement("style"),i.innerHTML=n,this.container.appendChild(i)}},e.prototype.setOffsetPosition=function(t,n,i){i===void 0&&(i=this.style.offset);var a=H(i,2),s=a[0],o=s===void 0?0:s,A=a[1],l=A===void 0?0:A;this.container.style.left="".concat(t+o,"px"),this.container.style.top="".concat(n+l,"px")},e.tag="poptip",e.defaultOptions={style:{x:0,y:0,width:0,height:0,target:null,visibility:"hidden",text:"",position:"top",follow:!1,offset:[0,0],domStyles:hU,template:'<div class="'.concat(Ze.TEXT,'"></div>')}},e})(en),En=Mi({layout:"flex",markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label",valueGroup:"value-group",focusGroup:"focus-group",focus:"focus",value:"value",backgroundGroup:"background-group",background:"background"},"legend-category-item"),Hie={offset:[0,20],domStyles:{".component-poptip":{opacity:"1",padding:"8px 12px",background:"#fff",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)"},".component-poptip-arrow":{display:"none"},".component-poptip-text":{color:"#000",lineHeight:"20px"}}};function Gie(r){var e=r.querySelector(En.marker.class);return e?e.style:{}}var Kie=(function(r){Xe(e,r);function e(t,n){var i=r.call(this,t,{span:[1,1],marker:function(){return new zi({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this;return i.keyFields={},i.keyFields=n||{},i}return Object.defineProperty(e.prototype,"showValue",{get:function(){var t=this.attributes.valueText;return t?typeof t=="string"||typeof t=="number"?t!=="":typeof t=="function"?!0:t.attr("text")!=="":!1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"actualSpace",{get:function(){var t=this.labelGroup,n=this.valueGroup,i=this.attributes,a=i.markerSize,s=i.focus,o=i.focusMarkerSize,A=t.node().getBBox(),l=A.width,c=A.height,u=n.node().getBBox(),h=u.width,d=u.height,f=s?o??12:0;return{markerWidth:a,labelWidth:l,valueWidth:h,focusWidth:f,height:Math.max(a,c,d)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"span",{get:function(){var t=this.attributes.span;if(!t)return[1,1];var n=H(Wn(t),2),i=n[0],a=n[1],s=this.showValue?a:0,o=i+s;return[i/o,s/o]},enumerable:!1,configurable:!0}),e.prototype.setAttribute=function(t,n){r.prototype.setAttribute.call(this,t,n)},Object.defineProperty(e.prototype,"shape",{get:function(){var t,n=this.attributes,i=n.markerSize,a=n.width,s=this.actualSpace,o=s.markerWidth,A=s.focusWidth,l=s.height,c=this.actualSpace,u=c.labelWidth,h=c.valueWidth,d=H(this.spacing,3),f=d[0],g=d[1],p=d[2];if(a){var v=a-i-f-g-A-p,y=H(this.span,2),m=y[0],B=y[1];t=H([m*v,B*v],2),u=t[0],h=t[1]}var C=o+u+h+f+g+A+p;return{width:C,height:l,markerWidth:o,labelWidth:u,valueWidth:h,focusWidth:A}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){var t=this.attributes,n=t.spacing,i=t.focus;if(!n)return[0,0,0];var a=H(Wn(n),3),s=a[0],o=a[1],A=a[2];return[s,this.showValue?o:0,i?A:0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"layout",{get:function(){var t=this.shape,n=t.markerWidth,i=t.labelWidth,a=t.valueWidth,s=t.focusWidth,o=t.width,A=t.height,l=H(this.spacing,3),c=l[0],u=l[1],h=l[2];return{height:A,width:o,markerWidth:n,labelWidth:i,valueWidth:a,focusWidth:s,position:[n/2,n+c,n+i+c+u,n+i+a+c+u+h+s/2]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleSize",{get:function(){var t=Gie(this.markerGroup.node()),n=this.attributes,i=n.markerSize,a=n.markerStrokeWidth,s=a===void 0?t.strokeWidth:a,o=n.markerLineWidth,A=o===void 0?t.lineWidth:o,l=n.markerStroke,c=l===void 0?t.stroke:l,u=+(s||A||(c?1:0))*Math.sqrt(2),h=this.markerGroup.node().getBBox(),d=h.width,f=h.height;return(1-u/Math.max(d,f))*i},enumerable:!1,configurable:!0}),e.prototype.renderMarker=function(t){var n=this,i=this.attributes,a=i.marker,s=i.classNamePrefix,o=je(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(En.markerGroup,"g").style("zIndex",0),Or(!!a,this.markerGroup,function(){var A,l=n.markerGroup.node(),c=(A=l.childNodes)===null||A===void 0?void 0:A[0],u=fr(En.marker.name,gr.marker,s),h=typeof a=="string"?new gt({style:{symbol:a},className:u}):a();if(c)if(h.nodeName===c.nodeName)c instanceof gt?c.update(se(se({},o),{symbol:a})):(cne(c,h),Me(c).styles(o));else{if(c.remove(),!(h instanceof gt)){var f=fr(En.marker.name,gr.marker,s);h.className=f}Me(h).styles(o),l.appendChild(h)}else{if(!(h instanceof gt)){var d=fr(En.marker.name,gr.marker,s);h.className=d,Me(h).styles(o)}l.appendChild(h)}n.markerGroup.node().scale(1/n.markerGroup.node().getScale()[0]);var g=zB(n.markerGroup.node(),n.scaleSize);n.markerGroup.node().style._transform="scale(".concat(g,")")})},e.prototype.renderLabel=function(t){var n=je(this.attributes,"label"),i=n.text,a=Pt(n,["text"]),s=this.attributes.classNamePrefix;this.labelGroup=t.maybeAppendByClassName(En.labelGroup,"g").style("zIndex",0);var o=fr(En.label.name,gr.label,s),A=this.labelGroup.maybeAppendByClassName(En.label,function(){return Ba(i)});A.node().setAttribute("class",o),A.styles(a)},e.prototype.renderValue=function(t){var n=this,i=je(this.attributes,"value"),a=i.text,s=Pt(i,["text"]),o=this.attributes.classNamePrefix;this.valueGroup=t.maybeAppendByClassName(En.valueGroup,"g").style("zIndex",0),Or(this.showValue,this.valueGroup,function(){var A=fr(En.value.name,gr.value,o),l=n.valueGroup.maybeAppendByClassName(En.value,function(){return Ba(a)});l.node().setAttribute("class",A),l.styles(s)})},e.prototype.createPoptip=function(){var t=this.attributes.poptip,n=t||{};n.render;var i=Pt(n,["render"]),a=new Die({style:bn(Hie,i)});return this.poptipGroup=a,a},e.prototype.bindPoptip=function(t){var n=this,i=this.attributes.poptip;if(i){var a=this.poptipGroup||this.createPoptip();a.bind(t,function(){var s=n.attributes,o=s.labelText,A=s.valueText,l=s.markerFill,c=typeof o=="string"?o:o?.attr("text"),u=typeof A=="string"?A:A?.attr("text");if(typeof i.render=="function")return{html:i.render(se(se({},n.keyFields),{label:c,value:u,color:l}))};var h="";return(typeof c=="string"||typeof c=="number")&&(h+='<div class="component-poptip-label">'.concat(c,"</div>")),(typeof u=="string"||typeof u=="number")&&(h+='<div class="component-poptip-value">'.concat(u,"</div>")),{html:h}})}},e.prototype.renderFocus=function(t){var n=this,i=this.attributes,a=i.focus,s=i.focusMarkerSize,o=i.classNamePrefix,A={x:0,y:0,size:s,opacity:.6,symbol:"focus",stroke:"#aaaaaa",lineWidth:1};Ge(a)||(this.focusGroup=t.maybeAppendByClassName(En.focusGroup,"g").style("zIndex",0),Or(a,this.focusGroup,function(){var l=fr(En.focus.name,gr.focusIcon,o),c=new gt({style:se(se({},A),{symbol:"focus"}),className:l}),u=new zi({style:{r:A.size/2,fill:"transparent"}}),h=n.focusGroup.node();h.appendChild(u),h.appendChild(c),c.update({opacity:0}),t.node().addEventListener("pointerenter",function(){c.update({opacity:1})}),t.node().addEventListener("pointerleave",function(){c.update({opacity:0})})}))},e.prototype.renderPoptip=function(t){var n=this,i=this.attributes.poptip;if(i){var a=t.maybeAppendByClassName(En.value,"g").node(),s=t.maybeAppendByClassName(En.label,"g").node();[a,s].forEach(function(o){o&&n.bindPoptip(o)})}},e.prototype.renderBackground=function(t){var n=this.shape,i=n.width,a=n.height,s=je(this.attributes,"background");this.background=t.maybeAppendByClassName(En.backgroundGroup,"g").style("zIndex",-1);var o=this.background.maybeAppendByClassName(En.background,"rect");o.styles(se({width:i,height:a},s));var A=this.attributes.classNamePrefix,l=A===void 0?"":A;if(l){var c=fr(En.background.name,gr.background,l);o.node().setAttribute("class",c)}},e.prototype.adjustLayout=function(){var t=this.layout,n=t.labelWidth,i=t.valueWidth,a=t.height,s=H(t.position,4),o=s[0],A=s[1],l=s[2],c=s[3],u=a/2;this.markerGroup.styles({transform:"translate(".concat(o,", ").concat(u,")").concat(this.markerGroup.node().style._transform)}),this.labelGroup.styles({transform:"translate(".concat(A,", ").concat(u,")")}),this.focusGroup&&this.focusGroup.styles({transform:"translate(".concat(c,", ").concat(u,")")}),DB(this.labelGroup.select(En.label.class).node(),Math.ceil(n)),this.showValue&&(this.valueGroup.styles({transform:"translate(".concat(l,", ").concat(u,")")}),DB(this.valueGroup.select(En.value.class).node(),Math.ceil(i)))},e.prototype.render=function(t,n){var i=Me(n),a=t.x,s=a===void 0?0:a,o=t.y,A=o===void 0?0:o;i.styles({transform:"translate(".concat(s,", ").concat(A,")")}),this.renderMarker(i),this.renderLabel(i),this.renderValue(i),this.renderBackground(i),this.renderPoptip(i),this.renderFocus(i),this.adjustLayout()},e})(en),lo=Mi({page:"item-page",navigator:"navigator",item:"item"},"items"),dU=function(r,e,t){return t===void 0&&(t=!0),r?e(r):t},zie=(function(r){Xe(e,r);function e(t){var n=r.call(this,t,{data:[],gridRow:1/0,gridCol:void 0,padding:0,width:1e3,height:100,rowPadding:0,colPadding:0,layout:"flex",orientation:"horizontal",click:Xf,mouseenter:Xf,mouseleave:Xf})||this;return n.navigatorShape=[0,0],n}return Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"grid",{get:function(){var t=this.attributes,n=t.gridRow,i=t.gridCol,a=t.data;if(!n&&!i)throw new Error("gridRow and gridCol can not be set null at the same time");return n&&i?[n,i]:n?[n,a.length]:[a.length,i]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderData",{get:function(){var t=this.attributes,n=t.data,i=t.layout,a=t.poptip,s=t.focus,o=t.focusMarkerSize,A=t.classNamePrefix,l=je(this.attributes,"item"),c=n.map(function(u,h){var d=u.id,f=d===void 0?h:d,g=u.label,p=u.value;return{id:"".concat(f),index:h,style:se({layout:i,labelText:g,valueText:p,poptip:a,focus:s,focusMarkerSize:o,classNamePrefix:A},Object.fromEntries(Object.entries(l).map(function(v){var y=H(v,2),m=y[0],B=y[1];return[m,Mr(B,[u,h,n])]})))}});return c},enumerable:!1,configurable:!0}),e.prototype.getGridLayout=function(){var t=this,n=this.attributes,i=n.orientation,a=n.width,s=n.rowPadding,o=n.colPadding,A=H(this.navigatorShape,1),l=A[0],c=H(this.grid,2),u=c[0],h=c[1],d=h*u,f=0;return this.pageViews.children.map(function(g,p){var v,y,m=Math.floor(p/d),B=p%d,C=t.ifHorizontal(h,u),S=[Math.floor(B/C),B%C];i==="vertical"&&S.reverse();var F=H(S,2),T=F[0],O=F[1],I=(a-l-(h-1)*o)/h,k=g.getBBox().height,N=H([0,0],2),U=N[0],D=N[1];return i==="horizontal"?(v=H([f,T*(k+s)],2),U=v[0],D=v[1],f=O===h-1?0:f+I+o):(y=H([O*(I+o),f],2),U=y[0],D=y[1],f=T===u-1?0:f+k+s),{page:m,index:p,row:T,col:O,pageIndex:B,width:I,height:k,x:U,y:D}})},e.prototype.getFlexLayout=function(){var t=this.attributes,n=t.width,i=t.height,a=t.rowPadding,s=t.colPadding,o=H(this.navigatorShape,1),A=o[0],l=H(this.grid,2),c=l[0],u=l[1],h=H([n-A,i],2),d=h[0],f=h[1],g=H([0,0,0,0,0,0,0,0],8),p=g[0],v=g[1],y=g[2],m=g[3],B=g[4],C=g[5],S=g[6],F=g[7];return this.pageViews.children.map(function(T,O){var I,k,N,U,D=T.getBBox(),G=D.width,Z=D.height,q=S===0?0:s,j=S+q+G;if(j<=d&&dU(B,function(ue){return ue<u}))return I=H([S+q,F,j],3),p=I[0],v=I[1],S=I[2],{width:G,height:Z,x:p,y:v,page:y,index:O,pageIndex:m++,row:C,col:B++};k=H([C+1,0,0,F+Z+a],4),C=k[0],B=k[1],S=k[2],F=k[3];var te=F+Z;return te<=f&&dU(C,function(ue){return ue<c})?(N=H([S,F,G],3),p=N[0],v=N[1],S=N[2],{width:G,height:Z,x:p,y:v,page:y,index:O,pageIndex:m++,row:C,col:B++}):(U=H([0,0,G,0,y+1,0,0,0],8),p=U[0],v=U[1],S=U[2],F=U[3],y=U[4],m=U[5],C=U[6],B=U[7],{width:G,height:Z,x:p,y:v,page:y,index:O,pageIndex:m++,row:C,col:B++})})},Object.defineProperty(e.prototype,"itemsLayout",{get:function(){this.navigatorShape=[0,0];var t=this.attributes.layout==="grid"?this.getGridLayout:this.getFlexLayout,n=t.call(this);return n.slice(-1)[0].page>0?(this.navigatorShape=[55,0],t.call(this)):n},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,n){var i=this.attributes.orientation;return ub(i,t,n)},e.prototype.flattenPage=function(t){t.querySelectorAll(lo.item.class).forEach(function(n){t.appendChild(n)}),t.querySelectorAll(lo.page.class).forEach(function(n){var i=t.removeChild(n);i.destroy()})},e.prototype.renderItems=function(t){var n=this.attributes,i=n.click,a=n.mouseenter,s=n.mouseleave,o=n.classNamePrefix;this.flattenPage(t);var A=this.dispatchCustomEvent.bind(this),l=fr(lo.item.name,gr.item,o);Me(t).selectAll(lo.item.class).data(this.renderData,function(c){return c.id}).join(function(c){return c.append(function(u){var h=u.style,d=Pt(u,["style"]);return new Kie({style:h},d)}).attr("className",l).on("click",function(){i?.(this),A("itemClick",{item:this})}).on("pointerenter",function(){a?.(this),A("itemMouseenter",{item:this})}).on("pointerleave",function(){s?.(this),A("itemMouseleave",{item:this})})},function(c){return c.each(function(u){var h=u.style;this.update(h)})},function(c){return c.remove()})},e.prototype.relayoutNavigator=function(){var t,n=this.attributes,i=n.layout,a=n.width,s=((t=this.pageViews.children[0])===null||t===void 0?void 0:t.getBBox().height)||0,o=H(this.navigatorShape,2),A=o[0],l=o[1];this.navigator.update(i==="grid"?{pageWidth:a-A,pageHeight:s-l}:{})},e.prototype.adjustLayout=function(){var t=this,n=Object.entries(qte(this.itemsLayout,"page")).map(function(a){var s=H(a,2),o=s[0],A=s[1];return{page:o,layouts:A}}),i=Ie([],H(this.navigator.getContainer().children),!1);n.forEach(function(a){var s=a.layouts,o=t.pageViews.appendChild(new Cn({className:lo.page.name}));s.forEach(function(A){var l=A.x,c=A.y,u=A.index,h=A.width,d=A.height,f=i[u];o.appendChild(f),BA(f,"__layout__",A),f.update({x:l,y:c,width:h,height:d})})}),this.relayoutNavigator()},e.prototype.renderNavigator=function(t){var n=this.attributes,i=n.orientation,a=n.classNamePrefix,s=je(this.attributes,"nav"),o=bn({orientation:i,classNamePrefix:a},s),A=this;return t.selectAll(lo.navigator.class).data(["nav"]).join(function(l){return l.append(function(){return new kie({style:o})}).attr("className",lo.navigator.name).each(function(){A.navigator=this})},function(l){return l.each(function(){this.update(o)})},function(l){return l.remove()}),this.navigator},e.prototype.getBBox=function(){return this.navigator.getBBox()},e.prototype.render=function(t,n){var i=this.attributes.data;if(!(!i||i.length===0)){var a=this.renderNavigator(Me(n));this.renderItems(a.getContainer()),this.adjustLayout()}},e.prototype.dispatchCustomEvent=function(t,n){var i=new yn(t,{detail:n});this.dispatchEvent(i)},e})(en),Vie=(function(r){Xe(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.update=function(t){this.attr(t)},e})(Os),jie=(function(r){Xe(e,r);function e(t){return r.call(this,t,Tie)||this}return e.prototype.renderTitle=function(t,n,i){var a=this.attributes,s=a.showTitle,o=a.titleText,A=a.classNamePrefix,l=je(this.attributes,"title"),c=H(Ea(l),2),u=c[0],h=c[1];this.titleGroup=t.maybeAppendByClassName(Ao.titleGroup,"g").styles(h);var d=se(se({width:n,height:i},u),{text:s?o:"",classNamePrefix:A});this.title=this.titleGroup.maybeAppendByClassName(Ao.title,function(){return new _ie({style:d})}).update(d)},e.prototype.renderCustom=function(t){var n=this.attributes.data,i={innerHTML:this.attributes.render(n),pointerEvents:"auto"};t.maybeAppendByClassName(Ao.html,function(){return new Vie({className:Ao.html.name,style:i})}).update(i)},e.prototype.renderItems=function(t,n){var i=n.x,a=n.y,s=n.width,o=n.height,A=je(this.attributes,"title",!0),l=H(Ea(A),2),c=l[0],u=l[1],h=se(se({},c),{width:s,height:o,x:0,y:0});this.itemsGroup=t.maybeAppendByClassName(Ao.itemsGroup,"g").styles(se(se({},u),{transform:"translate(".concat(i,", ").concat(a,")")}));var d=this;this.itemsGroup.selectAll(Ao.items.class).data(["items"]).join(function(f){return f.append(function(){return new zie({style:h})}).attr("className",Ao.items.name).each(function(){d.items=Me(this)})},function(f){return f.update(h)},function(f){return f.remove()})},e.prototype.adjustLayout=function(){var t=this.attributes.showTitle;if(t){var n=this.title.node().getAvailableSpace(),i=n.x,a=n.y;this.itemsGroup.node().style.transform="translate(".concat(i,", ").concat(a,")")}},Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes,n=t.showTitle,i=t.width,a=t.height;return n?this.title.node().getAvailableSpace():new dr(0,0,i,a)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var t,n,i=(t=this.title)===null||t===void 0?void 0:t.node(),a=(n=this.items)===null||n===void 0?void 0:n.node();return!i||!a?r.prototype.getBBox.call(this):Mie(i,a)},e.prototype.render=function(t,n){var i=this.attributes,a=i.width,s=i.height,o=i.x,A=o===void 0?0:o,l=i.y,c=l===void 0?0:l,u=i.classNamePrefix,h=i.render,d=Me(n),f=n.className||"legend-category";u?n.attr("className","".concat(f," ").concat(u,"legend")):n.className||n.attr("className","legend-category"),n.style.transform="translate(".concat(A,", ").concat(c,")"),h?this.renderCustom(d):(this.renderTitle(d,a,s),this.renderItems(d,this.availableSpace),this.adjustLayout())},e})(en),Wie={backgroundFill:"#262626",backgroundLineCap:"round",backgroundLineWidth:1,backgroundStroke:"#333",backgroundZIndex:-1,formatter:function(r){return r.toString()},labelFill:"#fff",labelFontSize:12,labelTextBaseline:"middle",padding:[2,4],position:"right",radius:0,zIndex:999},db=Mi({background:"background",labelGroup:"label-group",label:"label"},"indicator"),qie=(function(r){Xe(e,r);function e(t){var n=r.call(this,t,Wie)||this;return n.point=[0,0],n.group=n.appendChild(new Cn({})),n.isMutationObserved=!0,n}return e.prototype.renderBackground=function(){if(this.label){var t=this.attributes,n=t.position,i=t.padding,a=H(Wn(i),4),s=a[0],o=a[1],A=a[2],l=a[3],c=this.label.node().getLocalBounds(),u=c.min,h=c.max,d=new dr(u[0]-l,u[1]-s,h[0]+o-u[0]+l,h[1]+A-u[1]+s),f=this.getPath(n,d),g=je(this.attributes,"background");this.background=Me(this.group).maybeAppendByClassName(db.background,"path").styles(se(se({},g),{d:f})),this.group.appendChild(this.label.node())}},e.prototype.renderLabel=function(){var t=this.attributes,n=t.formatter,i=t.labelText,a=je(this.attributes,"label"),s=H(Ea(a),2),o=s[0],A=s[1];o.text;var l=Pt(o,["text"]);if(this.label=Me(this.group).maybeAppendByClassName(db.labelGroup,"g").styles(A),!!i){var c=this.label.maybeAppendByClassName(db.label,function(){return Ba(n(i))}).style("text",n(i).toString());c.selectAll("text").styles(l)}},e.prototype.adjustLayout=function(){var t=H(this.point,2),n=t[0],i=t[1],a=this.attributes,s=a.x,o=a.y;this.group.attr("transform","translate(".concat(s-n,", ").concat(o-i,")"))},e.prototype.getPath=function(t,n){var i=this.attributes.radius,a=n.x,s=n.y,o=n.width,A=n.height,l=[["M",a+i,s],["L",a+o-i,s],["A",i,i,0,0,1,a+o,s+i],["L",a+o,s+A-i],["A",i,i,0,0,1,a+o-i,s+A],["L",a+i,s+A],["A",i,i,0,0,1,a,s+A-i],["L",a,s+i],["A",i,i,0,0,1,a+i,s],["Z"]],c={top:4,right:6,bottom:0,left:2},u=c[t],h=this.createCorner([l[u].slice(-2),l[u+1].slice(-2)]);return l.splice.apply(l,Ie([u+1,1],H(h),!1)),l[0][0]="M",l},e.prototype.createCorner=function(t,n){n===void 0&&(n=10);var i=.8,a=lne.apply(void 0,Ie([],H(t),!1)),s=H(t,2),o=H(s[0],2),A=o[0],l=o[1],c=H(s[1],2),u=c[0],h=c[1],d=H(a?[u-A,[A,u]]:[h-l,[l,h]],2),f=d[0],g=H(d[1],2),p=g[0],v=g[1],y=f/2,m=f/Math.abs(f),B=n*m,C=B/2,S=B*Math.sqrt(3)/2*i,F=H([p,p+y-C,p+y,p+y+C,v],5),T=F[0],O=F[1],I=F[2],k=F[3],N=F[4];return a?(this.point=[I,l-S],[["L",T,l],["L",O,l],["L",I,l-S],["L",k,l],["L",N,l]]):(this.point=[A+S,I],[["L",A,T],["L",A,O],["L",A+S,I],["L",A,k],["L",A,N]])},e.prototype.applyVisibility=function(){var t=this.attributes.visibility;t==="hidden"?Ti(this):zl(this)},e.prototype.bindEvents=function(){this.label.on(at.BOUNDS_CHANGED,this.renderBackground)},e.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()},e})(en);function fb(r){return r===void 0&&(r=""),{CONTAINER:"".concat(r,"tooltip"),TITLE:"".concat(r,"tooltip-title"),LIST:"".concat(r,"tooltip-list"),LIST_ITEM:"".concat(r,"tooltip-list-item"),NAME:"".concat(r,"tooltip-list-item-name"),MARKER:"".concat(r,"tooltip-list-item-marker"),NAME_LABEL:"".concat(r,"tooltip-list-item-name-label"),VALUE:"".concat(r,"tooltip-list-item-value"),CROSSHAIR_X:"".concat(r,"tooltip-crosshair-x"),CROSSHAIR_Y:"".concat(r,"tooltip-crosshair-y")}}var fU={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function $ie(r){var e;r===void 0&&(r="");var t=fb(r);return e={},e[".".concat(t.CONTAINER)]={position:"absolute",visibility:"visible","z-index":8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)","background-color":"rgba(255, 255, 255, 0.96)","box-shadow":"0 6px 12px 0 rgba(0, 0, 0, 0.12)","border-radius":"4px",color:"rgba(0, 0, 0, 0.65)","font-size":"12px","line-height":"20px",padding:"12px","min-width":"120px","max-width":"360px","font-family":"Roboto-Regular"},e[".".concat(t.TITLE)]={color:"rgba(0, 0, 0, 0.45)"},e[".".concat(t.LIST)]={margin:"0px","list-style-type":"none",padding:"0px"},e[".".concat(t.LIST_ITEM)]={"list-style-type":"none",display:"flex","line-height":"2em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},e[".".concat(t.MARKER)]={width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},e[".".concat(t.NAME)]={display:"flex","align-items":"center","max-width":"216px"},e[".".concat(t.NAME_LABEL)]=se({flex:1},fU),e[".".concat(t.VALUE)]=se({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},fU),e[".".concat(t.CROSSHAIR_X)]={position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e[".".concat(t.CROSSHAIR_Y)]={position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e}var Yie=(function(r){Xe(e,r);function e(t){var n=this,i,a,s=(a=(i=t.style)===null||i===void 0?void 0:i.template)===null||a===void 0?void 0:a.prefixCls,o=fb(s);return n=r.call(this,t,{data:[],x:0,y:0,visibility:"visible",title:"",position:"bottom-right",offset:[5,5],enterable:!1,container:{x:0,y:0},bounding:null,template:{prefixCls:"",container:'<div class="'.concat(o.CONTAINER,'"></div>'),title:'<div class="'.concat(o.TITLE,'"></div>'),item:'<li class="'.concat(o.LIST_ITEM,`" data-index={index}>
51
+ <span class="`).concat(o.NAME,`">
52
+ <span class="`).concat(o.MARKER,`" style="background:{color}"></span>
53
+ <span class="`).concat(o.NAME_LABEL,`" title="{name}">{name}</span>
54
+ </span>
55
+ <span class="`).concat(o.VALUE,`" title="{value}">{value}</span>
56
+ </li>`)},style:$ie(s)})||this,n.timestamp=-1,n.prevCustomContentKey=n.attributes.contentKey,n.initShape(),n.render(n.attributes,n),n}return Object.defineProperty(e.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.element},Object.defineProperty(e.prototype,"elementSize",{get:function(){var t=this.element.offsetWidth,n=this.element.offsetHeight;return{width:t,height:n}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HTMLTooltipItemsElements",{get:function(){var t=this.attributes,n=t.data,i=t.template;return n.map(function(a,s){var o=a.name,A=o===void 0?"":o,l=a.color,c=l===void 0?"black":l,u=a.index,h=Pt(a,["name","color","index"]),d=se({name:A,color:c,index:u??s},h);return ig(bR(i.item,d))})},enumerable:!1,configurable:!0}),e.prototype.render=function(t,n){this.renderHTMLTooltipElement(),this.updatePosition()},e.prototype.destroy=function(){var t;(t=this.element)===null||t===void 0||t.remove(),r.prototype.destroy.call(this)},e.prototype.show=function(t,n){var i=this;if(t!==void 0&&n!==void 0){var a=this.element.style.visibility==="hidden",s=function(){i.attributes.x=t??i.attributes.x,i.attributes.y=n??i.attributes.y,i.updatePosition()};a?this.closeTransition(s):s()}this.element.style.visibility="visible"},e.prototype.hide=function(t,n){t===void 0&&(t=0),n===void 0&&(n=0);var i=this.attributes.enterable;i&&this.isCursorEntered(t,n)||(this.element.style.visibility="hidden")},e.prototype.initShape=function(){var t=this.attributes.template;this.element=ig(t.container),this.id&&this.element.setAttribute("id",this.id)},e.prototype.renderCustomContent=function(){if(!(this.prevCustomContentKey!==void 0&&this.prevCustomContentKey===this.attributes.contentKey)){this.prevCustomContentKey=this.attributes.contentKey;var t=this.attributes.content;t&&(typeof t=="string"?this.element.innerHTML=t:vQ(this.element,t))}},e.prototype.renderHTMLTooltipElement=function(){var t,n,i=this.attributes,a=i.template,s=i.title,o=i.enterable,A=i.style,l=i.content,c=fb(a.prefixCls),u=this.element;if(this.element.style.pointerEvents=o?"auto":"none",l)this.renderCustomContent();else{s?(u.innerHTML=a.title,u.getElementsByClassName(c.TITLE)[0].innerHTML=s):(n=(t=u.getElementsByClassName(c.TITLE))===null||t===void 0?void 0:t[0])===null||n===void 0||n.remove();var h=this.HTMLTooltipItemsElements,d=document.createElement("ul");d.className=c.LIST,vQ(d,h);var f=this.element.querySelector(".".concat(c.LIST));f?f.replaceWith(d):u.appendChild(d)}dne(u,A)},e.prototype.getRelativeOffsetFromCursor=function(t){var n=this.attributes,i=n.position,a=n.offset,s=t||i,o=s.split("-"),A={left:[-1,0],right:[1,0],top:[0,-1],bottom:[0,1]},l=this.elementSize,c=l.width,u=l.height,h=[-c/2,-u/2];return o.forEach(function(d){var f=H(h,2),g=f[0],p=f[1],v=H(A[d],2),y=v[0],m=v[1];h=[g+(c/2+a[0])*y,p+(u/2+a[1])*m]}),h},e.prototype.setOffsetPosition=function(t){var n=H(t,2),i=n[0],a=n[1],s=this.attributes,o=s.x,A=o===void 0?0:o,l=s.y,c=l===void 0?0:l,u=s.container,h=u.x,d=u.y;this.element.style.left="".concat(+A+h+i,"px"),this.element.style.top="".concat(+c+d+a,"px")},e.prototype.updatePosition=function(){var t=this.attributes.showDelay,n=t===void 0?60:t,i=Date.now();this.timestamp>0&&i-this.timestamp<n||(this.timestamp=i,this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor())))},e.prototype.autoPosition=function(t){var n=H(t,2),i=n[0],a=n[1],s=this.attributes,o=s.x,A=s.y,l=s.bounding,c=s.position;if(!l)return[i,a];var u=this.element,h=u.offsetWidth,d=u.offsetHeight,f=H([+o+i,+A+a],2),g=f[0],p=f[1],v={left:"right",right:"left",top:"bottom",bottom:"top"},y=l.x,m=l.y,B=l.width,C=l.height,S={left:g<y,right:g+h>y+B,top:p<m,bottom:p+d>m+C},F=[];c.split("-").forEach(function(O){S[O]?F.push(v[O]):F.push(O)});var T=F.join("-");return this.getRelativeOffsetFromCursor(T)},e.prototype.isCursorEntered=function(t,n){if(this.element){var i=this.element.getBoundingClientRect(),a=i.x,s=i.y,o=i.width,A=i.height;return new dr(a,s,o,A).isPointIn(t,n)}return!1},e.prototype.closeTransition=function(t){var n=this,i=this.element.style.transition;this.element.style.transition="none",t(),setTimeout(function(){n.element.style.transition=i},10)},e.tag="tooltip",e})(en),Xie=(function(r){Xe(e,r);function e(t){var n=r.call(this,bn({},e.defaultOptions,t))||this;return n.hoverColor="#f5f5f5",n.selectedColor="#e6f7ff",n.background=n.appendChild(new Gn({})),n.label=n.background.appendChild(new Cn({})),n}return Object.defineProperty(e.prototype,"padding",{get:function(){return Wn(this.style.padding)},enumerable:!1,configurable:!0}),e.prototype.renderLabel=function(){var t=this.style,n=t.label,i=t.value,a=je(this.attributes,"label");Me(this.label).maybeAppend(".label",function(){return Ba(n)}).attr("className","label").styles(a),this.label.attr("__data__",i)},e.prototype.renderBackground=function(){var t=this.label.getBBox(),n=H(this.padding,4),i=n[0],a=n[1],s=n[2],o=n[3],A=t.width,l=t.height,c=A+o+a,u=l+i+s,h=je(this.attributes,"background"),d=this.style,f=d.width,g=f===void 0?0:f,p=d.height,v=p===void 0?0:p,y=d.selected;this.background.attr(se(se({},h),{width:Math.max(c,g),height:Math.max(u,v),fill:y?this.selectedColor:"#fff"})),this.label.attr({transform:"translate(".concat(o,", ").concat((u-l)/2,")")})},e.prototype.render=function(){this.renderLabel(),this.renderBackground()},e.prototype.bindEvents=function(){var t=this;this.addEventListener("pointerenter",function(){t.style.selected||t.background.attr("fill",t.hoverColor)}),this.addEventListener("pointerleave",function(){t.style.selected||t.background.attr("fill",t.style.backgroundFill)});var n=this;this.addEventListener("click",function(){var i=t.style,a=i.label,s=i.value,o=i.onClick;o?.(s,{label:a,value:s},n)})},e.defaultOptions={style:{value:"",label:"",cursor:"pointer"}},e})(en),Zie=(function(r){Xe(e,r);function e(t){var n,i,a=r.call(this,bn({},e.defaultOptions,t))||this;a.currentValue=(n=e.defaultOptions.style)===null||n===void 0?void 0:n.defaultValue,a.isPointerInSelect=!1,a.select=a.appendChild(new Gn({className:"select",style:{cursor:"pointer",width:0,height:0}})),a.dropdown=a.appendChild(new Gn({className:"dropdown"}));var s=a.style.defaultValue;return s&&(!((i=a.style.options)===null||i===void 0)&&i.some(function(o){return o.value===s}))&&(a.currentValue=s),a}return e.prototype.setValue=function(t){this.currentValue=t,this.render()},e.prototype.getValue=function(){return this.currentValue},Object.defineProperty(e.prototype,"dropdownPadding",{get:function(){return Wn(this.style.dropdownPadding)},enumerable:!1,configurable:!0}),e.prototype.renderSelect=function(){var t=this,n,i=this.style,a=i.x,s=i.y,o=i.width,A=i.height,l=i.bordered,c=i.showDropdownIcon,u=je(this.attributes,"select"),h=je(this.attributes,"placeholder");this.select.attr(se(se({x:a,y:s,width:o,height:A},u),{fill:"#fff",strokeWidth:l?1:0}));var d=this.dropdownPadding,f=10;c&&Me(this.select).maybeAppend(".dropdown-icon","path").style("d","M-5,-3.5 L0,3.5 L5,-3.5").style("transform","translate(".concat(a+o-f-d[1]-d[3],", ").concat(s+A/2,")")).style("lineWidth",1).style("stroke",this.select.style.stroke);var g=(n=this.style.options)===null||n===void 0?void 0:n.find(function(m){return m.value===t.currentValue}),p=se({x:a+d[3]},h);Me(this.select).selectAll(".placeholder").data(g?[]:[1]).join(function(m){return m.append("text").attr("className","placeholder").styles(p).style("y",function(){var B=this.getBBox();return s+(A-B.height)/2})},function(m){return m.styles(p)},function(m){return m.remove()});var v=je(this.attributes,"optionLabel"),y=se({x:a+d[3]},v);Me(this.select).selectAll(".value").data(g?[g]:[]).join(function(m){return m.append(function(B){return Ba(B.label)}).attr("className","value").styles(y).style("y",function(){var B=this.getBBox();return s+(A-B.height)/2})},function(m){return m.styles(y)},function(m){return m.remove()})},e.prototype.renderDropdown=function(){var t=this,n,i,a=this.style,s=a.x,o=a.y,A=a.width,l=a.height,c=a.options,u=a.onSelect,h=a.open,d=je(this.attributes,"dropdown"),f=je(this.attributes,"option"),g=this.dropdownPadding;Me(this.dropdown).maybeAppend(".dropdown-container","g").attr("className","dropdown-container").selectAll(".dropdown-item").data(c,function(y){return y.value}).join(function(y){return y.append(function(m){return new Xie({className:"dropdown-item",style:se(se(se({},m),f),{width:A-g[1]-g[3],selected:m.value===t.currentValue,onClick:function(B,C,S){t.setValue(B),u?.(B,C,S),t.dispatchEvent(new yn("change",{detail:{value:B,option:C,item:S}})),Ti(t.dropdown)}})})}).each(function(m,B){var C,S=(C=this.parentNode)===null||C===void 0?void 0:C.children,F=S.reduce(function(T,O,I){return I<B&&(T+=O.getBBox().height),T},0);this.attr("transform","translate(".concat(g[3],", ").concat(g[0]+F,")"))})},function(y){return y.update(function(m){return{selected:m.value===t.currentValue}})},function(y){return y.remove()});var p=(i=(n=this.dropdown.getElementsByClassName("dropdown-container"))===null||n===void 0?void 0:n[0])===null||i===void 0?void 0:i.getBBox(),v=d.spacing;this.dropdown.attr(se({transform:"translate(".concat(s,", ").concat(o+l+v,")"),width:p.width+g[1]+g[3],height:p.height+g[0]+g[2]},d)),!h&&Ti(this.dropdown)},e.prototype.render=function(){this.renderSelect(),this.renderDropdown()},e.prototype.bindEvents=function(){var t=this;this.addEventListener("click",function(n){n.stopPropagation()}),this.select.addEventListener("click",function(){t.dropdown.style.visibility==="visible"?Ti(t.dropdown):zl(t.dropdown)}),this.addEventListener("pointerenter",function(){t.isPointerInSelect=!0}),this.addEventListener("pointerleave",function(){t.isPointerInSelect=!1}),document?.addEventListener("click",function(){t.isPointerInSelect||Ti(t.dropdown)})},e.defaultOptions={style:{x:0,y:0,width:140,height:32,options:[],bordered:!0,defaultValue:"",selectRadius:8,selectStroke:"#d9d9d9",showDropdownIcon:!0,placeholderText:"请选择",placeholderFontSize:12,placeholderTextBaseline:"top",placeholderFill:"#c2c2c2",dropdownFill:"#fff",dropdownStroke:"#d9d9d9",dropdownRadius:8,dropdownShadowBlur:4,dropdownShadowColor:"rgba(0, 0, 0, 0.08)",dropdownPadding:8,dropdownSpacing:10,optionPadding:[8,12],optionFontSize:12,optionTextBaseline:"top",optionBackgroundFill:"#fff",optionBackgroundRadius:4,optionLabelFontSize:12,optionLabelTextBaseline:"top"}},e})(en),Ii=(function(r){Xe(e,r);function e(t){var n=r.call(this,bn({},{style:{backgroundOpacity:e.backgroundOpacities.default}},e.defaultOptions,t))||this;return n.showBackground=!0,n.background=n.appendChild(new Gn({})),n.icon=n.appendChild(new Cn({})),n}return Object.defineProperty(e.prototype,"label",{get:function(){return"BaseIcon"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lineWidth",{get:function(){return Math.log10(this.attributes.size)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"padding",{get:function(){return Wn(this.attributes.size/5)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"iconSize",{get:function(){var t=this.attributes.size,n=H(this.padding,4),i=n[0],a=n[1],s=n[2],o=n[3];return Math.max(t-Math.max(o+a,i+s),this.lineWidth*2+1)},enumerable:!1,configurable:!0}),e.prototype.renderBackground=function(){var t=this.attributes,n=t.x,i=t.y,a=t.size,s=a/2,o=je(this.attributes,"background");this.background.attr(se({x:n-s,y:i-s,width:a,height:a},o))},e.prototype.showIndicator=function(){if(this.label){var t=this.attributes.size,n=this.background.getBBox(),i=n.x,a=n.y;this.indicator.update({x:i+t/2,y:a-5,labelText:this.label,visibility:"visible"})}},e.prototype.hideIndicator=function(){this.indicator.update({visibility:"hidden"})},e.prototype.connectedCallback=function(){var t;r.prototype.connectedCallback.call(this);var n=this.attributes.size,i=this.background.getBBox(),a=i.x,s=i.y,o=(t=this.ownerDocument)===null||t===void 0?void 0:t.defaultView;o&&(this.indicator=o.appendChild(new qie({style:{x:a+n/2,y:s-n/2,visibility:"hidden",position:"top",radius:3,zIndex:100}})))},e.prototype.disconnectedCallback=function(){this.indicator.destroy()},e.prototype.render=function(){this.renderIcon(),this.showBackground&&this.renderBackground()},e.prototype.bindEvents=function(){var t=this,n=this.attributes.onClick;if(this.addEventListener("click",function(){n?.(t)}),this.showBackground){var i=function(){return t.background.attr({opacity:e.backgroundOpacities.default})},a=function(){return t.background.attr({opacity:e.backgroundOpacities.hover})},s=function(){return t.background.attr({opacity:e.backgroundOpacities.active})};this.addEventListener("pointerenter",function(){a(),t.showIndicator()}),this.addEventListener("pointerleave",function(){i(),t.hideIndicator()}),this.addEventListener("pointerdown",function(){s()}),this.addEventListener("pointerup",function(){i()})}},e.tag="IconBase",e.defaultOptions={style:{x:0,y:0,size:10,color:"#565758",backgroundRadius:4,backgroundFill:"#e2e2e2"}},e.backgroundOpacities={default:0,hover:.8,active:1},e})(en),Xl=function(r,e){return e===void 0&&(e="#565758"),new tr({style:{fill:e,d:"M ".concat(r,",").concat(r," L -").concat(r,",0 L ").concat(r,",-").concat(r," Z"),transformOrigin:"center"}})},Jie=(function(r){Xe(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.arcPath=function(t,n,i){var a=H([i,i],2),s=a[0],o=a[1],A=function(g){return[t+i*Math.cos(g),n+i*Math.sin(g)]},l=H(A(-5/4*Math.PI),2),c=l[0],u=l[1],h=H(A(1/4*Math.PI),2),d=h[0],f=h[1];return"M".concat(c,",").concat(u,",A").concat(s,",").concat(o,",0,1,1,").concat(d,",").concat(f)},Object.defineProperty(e.prototype,"label",{get:function(){return"重置"},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.attributes,n=t.x,i=t.y,a=t.color,s=this.iconSize,o=this.lineWidth,A=o+.5;Me(this.icon).maybeAppend(".reset","path").styles({stroke:a,lineWidth:o,d:this.arcPath(n,i,s/2-o),markerStart:Xl(A,a)})},e})(Ii),eae=(function(r){Xe(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"label",{get:function(){return"快退"},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.attributes,n=t.x,i=t.y,a=t.color,s=this.iconSize,o=s/2,A=s/2/Math.pow(3,.5),l=[[n,i],[n,i-A],[n-o,i],[n,i+A],[n,i],[n+o,i-A],[n+o,i+A],[n,i]];Me(this.icon).maybeAppend(".backward","polygon").styles({points:l,fill:a})},e})(Ii),tae=(function(r){Xe(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"label",{get:function(){return"快进"},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.attributes,n=t.x,i=t.y,a=t.color,s=this.iconSize,o=s/2,A=s/2/Math.pow(3,.5),l=[[n,i],[n,i-A],[n+o,i],[n,i+A],[n,i],[n-o,i-A],[n-o,i+A],[n,i]];Me(this.icon).maybeAppend(".forward","polygon").styles({points:l,fill:a})},e})(Ii),nae=(function(r){Xe(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"label",{get:function(){return"播放"},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.attributes,n=t.x,i=t.y,a=t.color,s=this.iconSize,o=s/3*Math.pow(3,.5)*.8,A=[[n+o,i],[n-o/2,i-s/2*.8],[n-o/2,i+s/2*.8],[n+o,i]];Me(this.icon).maybeAppend(".play","polygon").styles({points:A,fill:a})},e})(Ii),rae=(function(r){Xe(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"label",{get:function(){return"暂停"},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.attributes,n=t.x,i=t.y,a=t.color,s=this.iconSize,o=s/3,A=[[n-o,i-s/2],[n-o,i+s/2],[n-o/2,i+s/2],[n-o/2,i-s/2],[n-o,i-s/2],[n+o/2,i-s/2],[n+o/2,i+s/2],[n+o,i+s/2],[n+o,i-s/2]];Me(this.icon).maybeAppend(".pause","polygon").styles({points:A,fill:a})},e})(Ii),iae=(function(r){Xe(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"label",{get:function(){return"范围时间"},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.attributes,n=t.x,i=t.y,a=t.color,s=this,o=s.iconSize,A=s.lineWidth,l=A;Me(this.icon).maybeAppend(".left-line","line").styles({x1:n-o/2,y1:i-o/2,x2:n-o/2,y2:i+o/2,stroke:a,lineWidth:A}),Me(this.icon).maybeAppend(".right-line","line").styles({x1:n+o/2,y1:i-o/2,x2:n+o/2,y2:i+o/2,stroke:a,lineWidth:A}),Me(this.icon).maybeAppend(".left-arrow","line").styles({x1:n,y1:i,x2:n-o/2+l*2,y2:i,stroke:a,lineWidth:A,markerEnd:Xl(A*2,a)}),Me(this.icon).maybeAppend(".right-arrow","line").styles({x1:n,y1:i,x2:n+o/2-l*2,y2:i,stroke:a,lineWidth:A,markerEnd:Xl(A*2,a)})},e})(Ii),aae=(function(r){Xe(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"label",{get:function(){return"单一时间"},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.attributes,n=t.x,i=t.y,a=t.color,s=this,o=s.iconSize,A=s.lineWidth;Me(this.icon).maybeAppend(".line","line").styles({x1:n,y1:i-o/2,x2:n,y2:i+o/2,stroke:a,lineWidth:A});var l=A;Me(this.icon).maybeAppend(".left-arrow","line").styles({x1:n-o/2-l*2,y1:i,x2:n-l*2,y2:i,stroke:a,lineWidth:A,markerEnd:Xl(A*2,a)}),Me(this.icon).maybeAppend(".right-arrow","line").styles({x1:n+o/2+l*2,y1:i,x2:n+l*2,y2:i,stroke:a,lineWidth:A,markerEnd:Xl(A*2,a)})},e})(Ii),gU=function(r){return[[-r/2,-r/2],[-r/2,r/2],[r/2,r/2]]},sae=(function(r){Xe(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"label",{get:function(){return"折线图"},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.attributes,n=t.x,i=t.y,a=t.color,s=this,o=s.iconSize,A=s.lineWidth,l=A,c=(o-l*2-A)/4,u=(o-l*2-A)/2,h=H([n-o/2+l,i+o/2-l*2],2),d=h[0],f=h[1];Me(this.icon).maybeAppend(".coordinate","polyline").styles({points:gU(o).map(function(g){var p=H(g,2),v=p[0],y=p[1];return[v+n,y+i]}),stroke:a,lineWidth:A}),Me(this.icon).maybeAppend(".line","polyline").styles({points:[[d,f],[d+c,f-u],[d+c*2,f],[d+c*4,f-u*2]],stroke:a,lineWidth:A})},e})(Ii),oae=(function(r){Xe(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"label",{get:function(){return"条形图"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return[1,4,2,4,3]},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.data,n=this.attributes,i=n.x,a=n.y,s=n.color,o=this,A=o.iconSize,l=o.lineWidth,c=l,u=(A-c)/t.length,h=(A-c*2)/4,d=H([i-A/2+c*2,a+A/2-c],2),f=d[0],g=d[1];Me(this.icon).maybeAppend(".coordinate","polyline").styles({points:gU(A).map(function(p){var v=H(p,2),y=v[0],m=v[1];return[y+i,m+a]}),stroke:s,lineWidth:l}),Me(this.icon).maybeAppend(".bars","g").selectAll(".column").data(this.data.map(function(p,v){return{value:p,index:v}})).join(function(p){return p.append("line").attr("className","column").style("x1",function(v){var y=v.index;return f+u*y}).style("y1",g).style("x2",function(v){var y=v.index;return f+u*y}).style("y2",function(v){var y=v.value;return g-h*y}).styles({y1:g,stroke:s,lineWidth:l})})},e})(Ii),Aae=(function(r){Xe(e,r);function e(t){var n=r.call(this,bn({},{style:{color:"#d8d9d9"}},t))||this;return n.showBackground=!1,n}return e.prototype.renderIcon=function(){var t=this.attributes,n=t.x,i=t.y,a=t.color,s=this,o=s.iconSize,A=s.lineWidth;Me(this.icon).maybeAppend(".split","line").styles({x1:n,y1:i-o/2,x2:n,y2:i+o/2,stroke:a,lineWidth:A})},e})(Ii),gb=(function(r){Xe(e,r);function e(){var t=r.apply(this,Ie([],H(arguments),!1))||this;return t.showBackground=!1,t}return Object.defineProperty(e.prototype,"padding",{get:function(){return Wn(0)},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.iconSize,n=this.attributes,i=n.x,a=n.y,s=n.speed,o=s===void 0?1:s,A=Yf(this.attributes,["x","y","transform","transformOrigin","width","height","size","color","speed"]),l=Yt(t,20,1/0),c=20,u=se(se({},A),{x:i-l/2,y:a-c/2,width:l,height:c,defaultValue:o,bordered:!1,showDropdownIcon:!1,selectRadius:2,dropdownPadding:this.padding,dropdownRadius:2,dropdownSpacing:t/5,placeholderFontSize:t/2,optionPadding:0,optionLabelFontSize:t/2,optionBackgroundRadius:1,options:[{label:"1x",value:1},{label:"1.5x",value:1.5},{label:"2x",value:2}]});Me(this.icon).maybeAppend(".speed",function(){return new Zie({style:u})}).attr("className","speed").each(function(){this.update(u)})},e.tag="SpeedSelect",e})(Ii),pb=(function(r){Xe(e,r);function e(t){var n=r.call(this,t)||this;return n.icon=n.appendChild(new Cn({})),n.currentType=n.attributes.type,n}return e.prototype.getType=function(){return this.currentType},e.prototype.render=function(){var t=this,n=this.attributes;n.onChange;var i=Pt(n,["onChange"]);Me(this.icon).selectAll(".icon").data([this.currentType]).join(function(a){return a.append(function(s){var o,A=(o=t.toggles.find(function(l){var c=H(l,1),u=c[0];return u===s}))===null||o===void 0?void 0:o[1];if(!A)throw new Error("Invalid type: ".concat(s));return new A({})}).attr("className","icon").styles(i,!1).update({})},function(a){return a.styles({restStyles:i}).update({})},function(a){return a.remove()})},e.prototype.bindEvents=function(){var t=this,n=this.attributes.onChange;this.addEventListener("click",function(i){i.preventDefault(),i.stopPropagation();var a=(t.toggles.findIndex(function(o){var A=H(o,1),l=A[0];return l===t.currentType})+1)%t.toggles.length,s=t.toggles[a][0];n?.(t.currentType),t.currentType=s,t.render()})},e.tag="ToggleIcon",e})(en),vb=(function(r){Xe(e,r);function e(t){var n=r.call(this,bn({},{style:{type:"play"}},t))||this;return n.toggles=[["play",nae],["pause",rae]],n}return e})(pb),yb=(function(r){Xe(e,r);function e(t){var n=r.call(this,bn({},{style:{type:"range"}},t))||this;return n.toggles=[["range",iae],["value",aae]],n}return e})(pb),mb=(function(r){Xe(e,r);function e(t){var n=r.call(this,bn({},{style:{type:"column"}},t))||this;return n.toggles=[["line",sae],["column",oae]],n}return e})(pb),lae={reset:Jie,speed:gb,backward:eae,playPause:vb,forward:tae,selectionType:yb,chartType:mb,split:Aae},cae=(function(r){Xe(e,r);function e(t){var n=r.call(this,bn({},e.defaultOptions,t))||this;return n.background=n.appendChild(new Gn({})),n.functions=n.appendChild(new Cn({})),n}return Object.defineProperty(e.prototype,"padding",{get:function(){return Wn(this.attributes.padding)},enumerable:!1,configurable:!0}),e.prototype.renderBackground=function(){var t=this.style,n=t.x,i=t.y,a=t.width,s=t.height,o=je(this.attributes,"background");this.background.attr(se({x:n,y:i,width:a,height:s},o))},e.prototype.renderFunctions=function(){var t=this,n,i=this.attributes,a=i.functions,s=i.iconSize,o=i.iconSpacing,A=i.x,l=i.y,c=i.width,u=i.height,h=i.align,d=H(this.padding,4),f=d[1],g=d[3],p=a.reduce(function(m,B){return m.length&&B.length?m.concat.apply(m,Ie(["split"],H(B),!1)):m.concat.apply(m,Ie([],H(B),!1))},[]),v=p.length*(s+o)-o,y={left:g+s/2,center:(c-v)/2+s/2,right:c-v-g-f+s/2}[h]||0;(n=this.speedSelect)===null||n===void 0||n.destroy(),this.functions.removeChildren(),p.forEach(function(m,B){var C,S=lae[m],F={x:A+B*(s+o)+y,y:l+u/2,size:s};if(S===gb?(F.speed=t.attributes.speed,F.onSelect=function(O){return t.handleFunctionChange(m,{value:O})}):[vb,yb,mb].includes(S)?(F.onChange=function(O){return t.handleFunctionChange(m,{value:O})},S===vb&&(F.type=t.attributes.state==="play"?"pause":"play"),S===yb&&(F.type=t.attributes.selectionType==="range"?"value":"range"),S===mb&&(F.type=t.attributes.chartType==="line"?"column":"line")):F.onClick=function(){return t.handleFunctionChange(m,{value:m})},S===gb){var T=(C=t.ownerDocument)===null||C===void 0?void 0:C.defaultView;T&&(t.speedSelect=new S({style:se(se({},F),{zIndex:100})}),T.appendChild(t.speedSelect))}else t.functions.appendChild(new S({style:F}))})},e.prototype.disconnectedCallback=function(){var t;r.prototype.disconnectedCallback.call(this),(t=this.speedSelect)===null||t===void 0||t.destroy()},e.prototype.render=function(){this.renderBackground(),this.renderFunctions()},e.prototype.handleFunctionChange=function(t,n){var i=this.attributes.onChange;i?.(t,n)},e.defaultOptions={style:{x:0,y:0,width:300,height:40,padding:0,align:"center",iconSize:25,iconSpacing:0,speed:1,state:"pause",chartType:"line",selectionType:"range",backgroundFill:"#fbfdff",backgroundStroke:"#ebedf0",functions:[["reset","speed"],["backward","playPause","forward"],["selectionType","chartType"]]}},e})(en),uae=(function(r){Xe(e,r);function e(t){var n=r.call(this,bn({},e.defaultOptions,t))||this;return n.bindEvents(),n}return e.prototype.bindEvents=function(){var t=this;this.addEventListener("mouseenter",function(){t.attr("lineWidth",Math.ceil(+(t.style.r||0)/2))}),this.addEventListener("mouseleave",function(){t.attr("lineWidth",0)})},e.defaultOptions={style:{r:5,fill:"#3f7cf7",lineWidth:0,stroke:"#3f7cf7",strokeOpacity:.5,cursor:"pointer"}},e})(zi),hae=(function(r){Xe(e,r);function e(t){return r.call(this,bn({},e.defaultOptions,t))||this}return e.prototype.renderBackground=function(){var t=this.attributes,n=t.x,i=t.y,a=t.width,s=t.height,o=je(this.attributes,"background");Me(this).maybeAppend("background","rect").attr("className","background").styles(se({x:n-a/2,y:i-s/2,width:a,height:s},o))},e.prototype.renderIcon=function(){var t=this.attributes,n=t.x,i=t.y,a=t.iconSize,s=je(this.attributes,"icon"),o=1,A=a/2;Me(this).maybeAppend("icon-left-line","line").attr("className","icon-left-line").styles(se({x1:n-o,y1:i-A,x2:n-o,y2:i+A},s)),Me(this).maybeAppend("icon-right-line","line").attr("className","icon-right-line").styles(se({x1:n+o,y1:i-A,x2:n+o,y2:i+A},s))},e.prototype.renderBorder=function(){var t=this.attributes,n=t.x,i=t.y,a=t.width,s=t.height,o=t.type,A=je(this.attributes,"border"),l=o==="start"?+a/2:-a/2;Me(this).maybeAppend("border","line").attr("className","border").styles(se({x1:l+n,y1:i-s/2,x2:l+n,y2:i+s/2},A))},e.prototype.render=function(){this.renderBackground(),this.renderIcon(),this.renderBorder()},e.defaultOptions={style:{x:0,y:0,width:10,height:50,iconSize:10,type:"start",backgroundFill:"#fff",backgroundFillOpacity:.5,iconStroke:"#9a9a9a",iconLineWidth:1,borderStroke:"#e8e8e8",borderLineWidth:1}},e})(en);function dae(r,e){return typeof r=="number"?pU(r):fae(r,e)}function fae(r,e){var t=new Date(r);switch(e){case"half-hour":case"hour":case"four-hour":return[0,6,12,18].includes(t.getHours())&&t.getMinutes()===0?Ir(t,`HH:mm
57
+ YYYY-MM-DD`):Ir(t,"HH:mm");case"half-day":return t.getHours()<12?`AM
58
+ `.concat(Ir(t,"YYYY-MM-DD")):"PM";case"day":return[1,10,20].includes(t.getDate())?Ir(t,`DD
59
+ YYYY-MM`):Ir(t,"DD");case"week":return t.getDate()<=7?Ir(t,`DD
60
+ YYYY-MM`):Ir(t,"DD");case"month":return[0,6].includes(t.getMonth())?Ir(t,`MM月
61
+ YYYY`):Ir(t,"MM月");case"season":return[0].includes(t.getMonth())?Ir(t,`MM月
62
+ YYYY`):Ir(t,"MM月");case"year":return Ir(t,"YYYY");default:return Ir(t,"YYYY-MM-DD HH:mm")}}function pU(r){var e=String(Math.floor(r/3600)).padStart(2,"0"),t=String(Math.floor(r%3600/60)).padStart(2,"0"),n=String(Math.floor(r%60)).padStart(2,"0");return r<3600?"".concat(t,":").concat(n):"".concat(e,":").concat(t,":").concat(n)}var gae=(function(r){Xe(e,r);function e(t){var n=r.call(this,bn({},e.defaultOptions,t))||this;n.axis=n.appendChild(new xie({style:{type:"linear",startPos:[0,0],endPos:[0,0],data:[],showArrow:!1,animate:!1}})),n.timeline=n.appendChild(new Ere({style:{onChange:function(u){n.handleSliderChange(u)}}})),n.controller=n.appendChild(new cae({})),n.states={},n.handleSliderChange=function(u){var h=(function(){var d=n.states.values;return Array.isArray(d)?Ie([],H(d),!1):d})();n.setBySliderValues(u),n.dispatchOnChange(h)};var i=n.attributes,a=i.selectionType,s=i.chartType,o=i.speed,A=i.state,l=i.playMode,c=i.values;return n.states={chartType:s,playMode:l,selectionType:a,speed:o,state:A},n.setByTimebarValues(c),n}return Object.defineProperty(e.prototype,"data",{get:function(){var t=this.attributes.data,n=function(i,a){return i.time<a.time?-1:i.time>a.time?1:0};return t.sort(n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"space",{get:function(){var t=this.attributes,n=t.x,i=t.y,a=t.width,s=t.height,o=t.type,A=t.controllerHeight,l=Yt(+s-A,0,+s),c=new dr(n,i+ +s-A,+a,A),u,h=0;o==="chart"?(h=35,u=new dr(n,i+l-h,+a,h)):u=new dr;var d=o==="time"?10:l,f=new dr(n,i+(o==="time"?l:l-d),+a,d-h);return{axisBBox:u,controllerBBox:c,timelineBBox:f}},enumerable:!1,configurable:!0}),e.prototype.setBySliderValues=function(t){var n,i,a=this.data,s=H(Array.isArray(t)?t:[0,t],2),o=s[0],A=s[1],l=a.length,c=a[Math.floor(o*l)],u=a[Math.ceil(A*l)-(Array.isArray(t)?0:1)];this.states.values=[(n=c?.time)!==null&&n!==void 0?n:a[0].time,(i=u?.time)!==null&&i!==void 0?i:1/0]},e.prototype.setByTimebarValues=function(t){var n,i,a,s=this.data,o=H(Array.isArray(t)?t:[void 0,t],2),A=o[0],l=o[1],c=s.find(function(h){var d=h.time;return d===A}),u=s.find(function(h){var d=h.time;return d===l});this.states.values=[(n=c?.time)!==null&&n!==void 0?n:(i=s[0])===null||i===void 0?void 0:i.time,(a=u?.time)!==null&&a!==void 0?a:1/0]},e.prototype.setByIndex=function(t){var n,i,a,s,o=this.data,A=H(t,2),l=A[0],c=A[1];this.states.values=[(i=(n=o[l])===null||n===void 0?void 0:n.time)!==null&&i!==void 0?i:o[0].time,(s=(a=this.data[c])===null||a===void 0?void 0:a.time)!==null&&s!==void 0?s:1/0]},Object.defineProperty(e.prototype,"sliderValues",{get:function(){var t=this.states,n=t.values,i=t.selectionType,a=H(Array.isArray(n)?n:[void 0,n],2),s=a[0],o=a[1],A=this.data,l=A.length,c=i==="value",u=function(){var d=A.findIndex(function(f){var g=f.time;return g===s});return c?0:d>-1?d/l:0},h=function(){if(o===1/0)return 1;var d=A.findIndex(function(f){var g=f.time;return g===o});return d>-1?d/l:c?.5:1};return[u(),h()]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"values",{get:function(){var t=this.states,n=t.values,i=t.selectionType,a=H(Array.isArray(n)?n:[this.data[0].time,n],2),s=a[0],o=a[1];return i==="value"?o:[s,o]},enumerable:!1,configurable:!0}),e.prototype.getDatumByRatio=function(t){var n=this.data,i=n.length,a=Math.floor(t*(i-1));return n[a]},Object.defineProperty(e.prototype,"chartHandleIconShape",{get:function(){var t=this.states.selectionType,n=this.space.timelineBBox.height;return t==="range"?function(i){return new hae({style:{type:i,height:n,iconSize:n/6}})}:function(){return new Is({style:{x1:0,y1:-n/2,x2:0,y2:n/2,lineWidth:2,stroke:"#c8c8c8"}})}},enumerable:!1,configurable:!0}),e.prototype.getChartStyle=function(t){var n=this,i=t.x,a=t.y,s=t.width,o=t.height,A=this.states,l=A.selectionType,c=A.chartType,u=this.data,h=this.attributes,d=h.type,f=h.labelFormatter,g=je(this.attributes,"chart");g.type;var p=Pt(g,["type"]),v=l==="range";if(d==="time")return se({handleIconShape:function(){return new uae({})},selectionFill:"#2e7ff8",selectionFillOpacity:1,showLabelOnInteraction:!0,handleLabelDy:v?-15:0,autoFitLabel:v,handleSpacing:v?-15:0,trackFill:"#edeeef",trackLength:s,trackOpacity:.5,trackRadius:o/2,trackSize:o/2,type:l,values:this.sliderValues,formatter:function(B){if(f)return f(B);var C=n.getDatumByRatio(B).time;return typeof C=="number"?pU(C):Ir(C,"YYYY-MM-DD HH:mm:ss")},transform:"translate(".concat(i,", ").concat(a,")"),zIndex:1},p);var y=l==="range"?5:0,m=u.map(function(B){var C=B.value;return C});return se({handleIconOffset:y,handleIconShape:this.chartHandleIconShape,selectionFill:"#fff",selectionFillOpacity:.5,selectionType:"invert",sparklineSpacing:.1,sparklineColumnLineWidth:0,sparklineColor:"#d4e5fd",sparklineAreaOpacity:1,sparklineAreaLineWidth:0,sparklineData:m,sparklineType:c,sparklineScale:.8,trackLength:s,trackSize:o,type:l,values:this.sliderValues,transform:"translate(".concat(i,", ").concat(a,")"),zIndex:1},p)},e.prototype.renderChart=function(t){t===void 0&&(t=this.space.timelineBBox),this.timeline.update(this.getChartStyle(t))},e.prototype.updateSelection=function(){this.timeline.setValues(this.sliderValues,!0),this.handleSliderChange(this.sliderValues)},e.prototype.getAxisStyle=function(t){var n=this.data,i=this.attributes,a=i.interval,s=i.labelFormatter,o=je(this.attributes,"axis"),A=t.x,l=t.y,c=t.width,u=Ie(Ie([],H(n),!1),[{time:0}],!1).map(function(d,f,g){var p=d.time;return{label:"".concat(p),value:f/(g.length-1),time:p}}),h=se({startPos:[A,l],endPos:[A+c,l],data:u,labelFilter:function(d,f){return f<u.length-1},labelFormatter:function(d){var f=d.time;return s?s(f):dae(f,a)}},o);return h},e.prototype.renderAxis=function(t){t===void 0&&(t=this.space.axisBBox);var n=this.attributes.type;n==="chart"&&this.axis.update(this.getAxisStyle(t))},e.prototype.renderController=function(t){t===void 0&&(t=this.space.controllerBBox);var n=this.attributes.type,i=this.states,a=i.state,s=i.speed,o=i.selectionType,A=i.chartType,l=je(this.attributes,"controller"),c=this,u=se(se(se({},t),{iconSize:20,speed:s,state:a,selectionType:o,chartType:A,onChange:function(h,d){var f=d.value;switch(h){case"reset":c.internalReset();break;case"speed":c.handleSpeedChange(f);break;case"backward":c.internalBackward();break;case"playPause":f==="play"?c.internalPlay():c.internalPause();break;case"forward":c.internalForward();break;case"selectionType":c.handleSelectionTypeChange(f);break;case"chartType":c.handleChartTypeChange(f);break}}}),l);n==="time"&&(u.functions=[["reset","speed"],["backward","playPause","forward"],["selectionType"]]),this.controller.update(u)},e.prototype.dispatchOnChange=function(t){var n=this.data,i=this.attributes.onChange,a=this.states,s=a.values,o=a.selectionType,A=H(s,2),l=A[0],c=A[1],u=c===1/0?n.at(-1).time:c,h=o==="range"?[l,u]:u,d=function(f,g){return Array.isArray(f)?Array.isArray(g)?f[0]===g[0]&&(f[1]===g[1]||f[1]===1/0||g[1]===1/0):!1:Array.isArray(g)?!1:f===g};(!t||!d(t,h))&&i?.(o==="range"?[l,u]:u)},e.prototype.internalReset=function(t){var n,i,a=this.states.selectionType;this.internalPause(),this.setBySliderValues(a==="range"?[0,1]:[0,0]),this.renderController(),this.updateSelection(),t||((i=(n=this.attributes)===null||n===void 0?void 0:n.onReset)===null||i===void 0||i.call(n),this.dispatchOnChange())},e.prototype.reset=function(){this.internalReset()},e.prototype.moveSelection=function(t,n){var i=this.data,a=i.length,s=this.states,o=s.values,A=s.selectionType,l=s.playMode,c=H(o,2),u=c[0],h=c[1],d=i.findIndex(function(m){var B=m.time;return B===u}),f=i.findIndex(function(m){var B=m.time;return B===h});f===-1&&(f=a);var g=t==="backward"?-1:1,p;A==="range"?l==="acc"?(p=[d,f+g],g===-1&&d===f&&(p=[d,a])):p=[d+g,f+g]:p=[d,f+g];var v=function(m){var B=H(m.sort(function(T,O){return T-O}),2),C=B[0],S=B[1],F=function(T){return Yt(T,0,a)};return S>a?A==="value"?[0,0]:l==="acc"?[F(C),F(C)]:[0,F(S-C)]:C<0?l==="acc"?[0,F(S)]:[F(C+a-S),a]:[F(C),F(S)]},y=v(p);return this.setByIndex(y),this.updateSelection(),y},e.prototype.internalBackward=function(t){var n,i,a=this.moveSelection("backward",t);return t||((i=(n=this.attributes)===null||n===void 0?void 0:n.onBackward)===null||i===void 0||i.call(n),this.dispatchOnChange()),a},e.prototype.backward=function(){this.internalBackward()},e.prototype.internalPlay=function(t){var n=this,i,a,s=this.data,o=this.attributes.loop,A=this.states.speed,l=A===void 0?1:A;this.playInterval=window.setInterval(function(){var c=n.internalForward();c[1]===s.length&&!o&&(n.internalPause(),n.renderController())},1e3/l),this.states.state="play",!t&&((a=(i=this.attributes)===null||i===void 0?void 0:i.onPlay)===null||a===void 0||a.call(i))},e.prototype.play=function(){this.internalPlay()},e.prototype.internalPause=function(t){var n,i;clearInterval(this.playInterval),this.states.state="pause",!t&&((i=(n=this.attributes)===null||n===void 0?void 0:n.onPause)===null||i===void 0||i.call(n))},e.prototype.pause=function(){this.internalPause()},e.prototype.internalForward=function(t){var n,i,a=this.moveSelection("forward",t);return t||((i=(n=this.attributes)===null||n===void 0?void 0:n.onForward)===null||i===void 0||i.call(n),this.dispatchOnChange()),a},e.prototype.forward=function(){this.internalForward()},e.prototype.handleSpeedChange=function(t){var n,i;this.states.speed=t;var a=this.states.state;a==="play"&&(this.internalPause(!0),this.internalPlay(!0)),(i=(n=this.attributes)===null||n===void 0?void 0:n.onSpeedChange)===null||i===void 0||i.call(n,t)},e.prototype.handleSelectionTypeChange=function(t){var n,i;this.states.selectionType=t,this.renderChart(),(i=(n=this.attributes)===null||n===void 0?void 0:n.onSelectionTypeChange)===null||i===void 0||i.call(n,t)},e.prototype.handleChartTypeChange=function(t){var n,i;this.states.chartType=t,this.renderChart(),(i=(n=this.attributes)===null||n===void 0?void 0:n.onChartTypeChange)===null||i===void 0||i.call(n,t)},e.prototype.render=function(){var t=this.space,n=t.axisBBox,i=t.controllerBBox,a=t.timelineBBox;this.renderController(i),this.renderAxis(n),this.renderChart(a),this.states.state==="play"&&this.internalPlay()},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.internalPause(!0)},e.defaultOptions={style:{x:0,y:0,axisLabelFill:"#6e6e6e",axisLabelTextAlign:"left",axisLabelTextBaseline:"top",axisLabelTransform:"translate(5, -12)",axisLineLineWidth:1,axisLineStroke:"#cacdd1",axisTickLength:15,axisTickLineWidth:1,axisTickStroke:"#cacdd1",chartShowLabel:!1,chartType:"line",controllerAlign:"center",controllerHeight:40,data:[],interval:"day",loop:!1,playMode:"acc",selectionType:"range",type:"time"}},e})(en);function cf(r){const{width:e,height:t,renderer:n}=r,i=pae(r),a=new zg({width:e,height:t,container:i,renderer:n||new yl});return[i,a]}function pae(r){var e;const{container:t,className:n,graphCanvas:i}=r;if(t)return typeof t=="string"?document.getElementById(t):t;const a=rA(n,!1),{width:s,height:o,containerStyle:A}=r,[l,c]=vae(r);return Object.assign(a.style,Object.assign({position:"absolute",left:l+"px",top:c+"px",width:s+"px",height:o+"px"},A)),(e=i.getContainer())===null||e===void 0||e.appendChild(a),a}function vae(r){const{width:e,height:t,placement:n,graphCanvas:i}=r,[a,s]=i.getSize(),[o,A]=kS(n);return[o*(a-e),A*(s-t)]}var yae=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};class uf extends Qn{constructor(e,t){super(e,Object.assign({},uf.defaultOptions,t)),this.typePrefix="__data__",this.draw=!1,this.fieldMap={node:new Map,edge:new Map,combo:new Map},this.selectedItems=[],this.bindEvents=()=>{const{graph:n}=this.context;n.on(fe.AFTER_DRAW,this.createElement)},this.changeState=(n,i)=>{const{graph:a}=this.context,{typePrefix:s}=this,o=Dn(n,[s,"id"]),A=Dn(n,[s,"style","labelText"]),[l]=o.split("__"),c=this.fieldMap[l].get(A)||[];a.setElementState(Object.fromEntries(c?.map(u=>[u,i])))},this.click=n=>{if(this.options.trigger==="hover")return;const i=Dn(n,[this.typePrefix,"id"]);this.selectedItems.includes(i)?(this.selectedItems=this.selectedItems.filter(a=>a!==i),this.changeState(n,[])):(this.selectedItems.push(i),this.changeState(n,"selected"))},this.mouseleave=n=>{this.options.trigger!=="click"&&(this.selectedItems=[],this.changeState(n,[]))},this.mouseenter=n=>{if(this.options.trigger==="click")return;const i=Dn(n,[this.typePrefix,"id"]);this.selectedItems.includes(i)?this.selectedItems=this.selectedItems.filter(a=>a!==i):(this.selectedItems.push(i),this.changeState(n,"active"))},this.setFieldMap=(n,i,a)=>{if(!n)return;const s=this.fieldMap[a];if(s)if(!s.has(n))s.set(n,[i]);else{const o=s.get(n);o&&(o.push(i),s.set(n,o))}},this.getEvents=()=>({mouseenter:this.mouseenter,mouseleave:this.mouseleave,click:this.click}),this.getMarkerData=(n,i)=>{if(!n)return[];const{model:a,element:s}=this.context,{nodes:o,edges:A,combos:l}=a.getData(),c={},u=p=>Te(n)?n(p):n,h={node:"circle",edge:"line",combo:"rect"},d={circle:"circle",ellipse:"circle",image:"bowtie",rect:"square",star:"cross",triangle:"triangle",diamond:"diamond",cubic:"dot",line:"hyphen",polyline:"hyphen",quadratic:"hv","cubic-horizontal":"hyphen","cubic-vertical":"line"},f=(p,v)=>s?.getElementComputedStyle(p,v),g=(p,v)=>{p.forEach(y=>{const{id:m}=y,B=Dn(y,["data",u(y)]),C=s?.getElementType(v,y)||"circle",S=f(v,y),F=(v==="edge"?S?.stroke:S?.fill)||"#1783ff";m&&B&&B.replace(/\s+/g,"")&&(this.setFieldMap(B,m,v),c[B]||(c[B]={id:`${v}__${m}`,label:B,marker:d[C]||h[v],elementType:v,lineWidth:1,stroke:F,fill:F}))})};switch(i){case"node":g(o,"node");break;case"edge":g(A,"edge");break;case"combo":g(l,"combo");break;default:return[]}return Object.values(c)},this.createElement=()=>{if(this.draw){this.updateElement();return}const n=this.options,{width:i,height:a,nodeField:s,edgeField:o,comboField:A,trigger:l,position:c,container:u,containerStyle:h,className:d}=n,f=yae(n,["width","height","nodeField","edgeField","comboField","trigger","position","container","containerStyle","className"]),g=this.getMarkerData(s,"node"),p=this.getMarkerData(o,"edge"),v=this.getMarkerData(A,"combo"),y=[...g,...v,...p],m=Object.assign({width:i,height:a,data:y,itemMarkerLineWidth:({lineWidth:S})=>S,itemMarker:({marker:S})=>S,itemMarkerStroke:({stroke:S})=>S,itemMarkerFill:({fill:S})=>S,gridCol:g.length},f,this.getEvents()),B=new jie({className:"legend",style:m});this.category=B,this.upsertCanvas().appendChild(B),this.draw=!0},this.bindEvents()}update(e){super.update(e),this.clear(),this.createElement()}clear(){var e,t;(e=this.canvas)===null||e===void 0||e.destroy(),(t=this.container)===null||t===void 0||t.remove(),this.canvas=void 0,this.container=void 0,this.draw=!1}updateElement(){this.category&&this.category.update({itemMarkerOpacity:({id:e})=>!this.selectedItems.length||this.selectedItems.includes(e)?1:.5,itemLabelOpacity:({id:e})=>!this.selectedItems.length||this.selectedItems.includes(e)?1:.5})}upsertCanvas(){if(this.canvas)return this.canvas;const e=this.context.canvas,[t,n]=e.getSize(),{width:i=t,height:a=n,position:s,container:o,containerStyle:A,className:l}=this.options,[c,u]=cf({width:i,height:a,graphCanvas:e,container:o,containerStyle:A,placement:s,className:"legend"});return this.container=c,l&&c.classList.add(l),this.canvas=u,this.canvas}destroy(){this.clear(),this.context.graph.off(fe.AFTER_DRAW,this.createElement),super.destroy()}}uf.defaultOptions={position:"bottom",trigger:"hover",orientation:"horizontal",layout:"flex",itemSpacing:4,rowPadding:10,colPadding:10,itemMarkerSize:16,itemLabelFontSize:16,width:240,height:160};class hf extends Qn{constructor(e,t){super(e,Object.assign({},hf.defaultOptions,t)),this.onDraw=n=>{var i;!((i=n?.data)===null||i===void 0)&&i.render||this.onRender()},this.landmarkMap=new Map,this.mask=null,this.isMaskDragging=!1,this.onMaskDragStart=n=>{this.mask&&(this.isMaskDragging=!0,this.mask.setPointerCapture(n.pointerId),this.mask.addEventListener("pointermove",this.onMaskDrag),this.mask.addEventListener("pointerup",this.onMaskDragEnd),this.mask.addEventListener("pointercancel",this.onMaskDragEnd))},this.onMaskDrag=n=>{if(!this.mask||!this.isMaskDragging)return;const{size:[i,a]}=this.options,{movementX:s,movementY:o}=n,{left:A,top:l,width:c,height:u}=this.mask.style,[,,h,d]=this.maskBBox;let f=parseInt(A)+s,g=parseInt(l)+o,p=parseInt(c),v=parseInt(u);f<0&&(f=0),g<0&&(g=0),f+p>i&&(f=ds(i-p,0)),g+v>a&&(g=ds(a-v,0)),p<h&&(s>0?(f=ds(f-s,0),p=hs(p+s,i)):s<0&&(p=hs(p-s,i))),v<d&&(o>0?(g=ds(g-o,0),v=hs(v+o,a)):o<0&&(v=hs(v-o,a))),Object.assign(this.mask.style,{left:f+"px",top:g+"px",width:p+"px",height:v+"px"});const y=parseInt(A)-f,m=parseInt(l)-g;if(y===0&&m===0)return;const B=this.context.canvas.getCamera().getZoom(),C=this.canvas.getCamera().getZoom(),S=B/C;this.context.graph.translateBy([y*S,m*S],!1)},this.onMaskDragEnd=n=>{this.mask&&(this.isMaskDragging=!1,this.mask.releasePointerCapture(n.pointerId),this.mask.removeEventListener("pointermove",this.onMaskDrag),this.mask.removeEventListener("pointerup",this.onMaskDragEnd),this.mask.removeEventListener("pointercancel",this.onMaskDragEnd))},this.onTransform=pE(()=>{this.isMaskDragging||(this.updateMask(),this.setCamera())},32,{leading:!0}),this.setOnRender(),this.bindEvents()}update(e){this.unbindEvents(),super.update(e),"delay"in e&&this.setOnRender(),this.bindEvents()}setOnRender(){this.onRender=wA(()=>{this.renderMinimap(),this.renderMask()},this.options.delay)}bindEvents(){const{graph:e}=this.context;e.on(fe.AFTER_DRAW,this.onDraw),e.on(fe.AFTER_RENDER,this.onRender),e.on(fe.AFTER_ANIMATE,this.onRender),e.on(fe.AFTER_TRANSFORM,this.onTransform)}unbindEvents(){const{graph:e}=this.context;e.off(fe.AFTER_DRAW,this.onDraw),e.off(fe.AFTER_RENDER,this.onRender),e.off(fe.AFTER_ANIMATE,this.onRender),e.off(fe.AFTER_TRANSFORM,this.onTransform)}renderMinimap(){const e=this.getElements(),t=this.initCanvas();this.setShapes(t,e)}getElements(){const{filter:e}=this.options,{model:t,element:n}=this.context,i=t.getData(),a={nodes:i.nodes.filter(l=>n?.getElement(X(l))),edges:i.edges.filter(l=>{const c=n?.getElement(X(l));return c&&OF(c)}),combos:i.combos.filter(l=>n?.getElement(X(l)))};if(!e)return a;const{nodes:s,edges:o,combos:A}=a;return{nodes:s.filter(l=>e(X(l),"node")),edges:o.filter(l=>e(X(l),"edge")),combos:A.filter(l=>e(X(l),"combo"))}}setShapes(e,t){const{nodes:n,edges:i,combos:a}=t,{shape:s}=this.options,{element:o}=this.context,A=(l,c)=>{const u=X(l),h=o?.getElement(u);if(!h)return;const d=h.getShape("key");let f;if(typeof s=="string"){const g=s;f=h.getShape(g).cloneNode()}else{const g=s(u,c,h);g===h?f=g.cloneNode(!0):f=g}f.setPosition(d.getPosition()),h.style.zIndex&&(f.style.zIndex=h.style.zIndex),f.id=h.id,e.appendChild(f)};e.removeChildren(),i.forEach(l=>A(l,"edge")),a.forEach(l=>A(l,"combo")),n.forEach(l=>A(l,"node"))}initCanvas(){const{renderer:e,size:[t,n]}=this.options;if(this.canvas){const{width:i,height:a}=this.canvas.getConfig();(t!==i||n!==a)&&this.canvas.resize(t,n),e&&this.canvas.setRenderer(e)}else{const{className:i,position:a,container:s,containerStyle:o}=this.options,[A,l]=cf({renderer:e,width:t,height:n,placement:a,className:"minimap",container:s,containerStyle:o,graphCanvas:this.context.canvas});i&&A.classList.add(i),this.container=A,this.canvas=l}return this.setCamera(),this.canvas}createLandmark(e,t,n){const i=`${e.join(",")}-${t.join(",")}-${n}`;if(this.landmarkMap.has(i))return this.landmarkMap.get(i);const s=this.canvas.getCamera().createLandmark(i,{position:e,focalPoint:t,zoom:n});return this.landmarkMap.set(i,s),s}setCamera(){var e;const{canvas:t}=this.context,n=(e=this.canvas)===null||e===void 0?void 0:e.getCamera();if(!n)return;const{size:[i,a],padding:s}=this.options,[o,A,l,c]=si(s),{min:u,max:h,center:d}=t.getBounds("elements"),f=h[0]-u[0],g=h[1]-u[1],p=i-c-A,v=a-o-l,y=p/f,m=v/g,B=Math.min(y,m),C=this.createLandmark(d,d,B);n.gotoLandmark(C,0)}get maskBBox(){const{canvas:e}=this.context,t=e.getSize(),n=e.getCanvasByViewport([0,0]),i=e.getCanvasByViewport(t),a=this.canvas.canvas2Viewport(Ei(n)),s=this.canvas.canvas2Viewport(Ei(i)),o=s.x-a.x,A=s.y-a.y;return[a.x,a.y,o,A]}calculateMaskBBox(){const{size:[e,t]}=this.options;let[n,i,a,s]=this.maskBBox;return n<0&&(a=hs(a+n,e),n=0),i<0&&(s=hs(s+i,t),i=0),n+a>e&&(a=ds(e-n,0)),i+s>t&&(s=ds(t-i,0)),[hs(n,e),hs(i,t),ds(a,0),ds(s,0)]}renderMask(){const{maskStyle:e}=this.options;this.mask||(this.mask=document.createElement("div"),this.mask.addEventListener("pointerdown",this.onMaskDragStart),this.mask.draggable=!0,this.mask.addEventListener("dragstart",t=>t.preventDefault&&t.preventDefault())),this.container.appendChild(this.mask),Object.assign(this.mask.style,Object.assign(Object.assign({},e),{cursor:"move",position:"absolute",pointerEvents:"auto"})),this.updateMask()}updateMask(){if(!this.mask)return;const[e,t,n,i]=this.calculateMaskBBox();Object.assign(this.mask.style,{top:t+"px",left:e+"px",width:n+"px",height:i+"px"})}destroy(){var e,t,n;this.unbindEvents(),(e=this.canvas)===null||e===void 0||e.destroy(),(t=this.mask)===null||t===void 0||t.remove(),(n=this.container)===null||n===void 0||n.remove(),super.destroy()}}hf.defaultOptions={size:[240,160],shape:"key",padding:10,position:"right-bottom",maskStyle:{border:"1px solid #ddd",background:"rgba(0, 0, 0, 0.1)"},containerStyle:{border:"1px solid #ddd",background:"#fff"},delay:128};const hs=(r,e)=>Math.min(r,e),ds=(r,e)=>Math.max(r,e);var wb=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{l(n.next(c))}catch(u){s(u)}}function A(c){try{l(n.throw(c))}catch(u){s(u)}}function l(c){c.done?a(c.value):i(c.value).then(o,A)}l((n=n.apply(r,e||[])).next())})};const Bb={x1:0,y1:0,x2:0,y2:0,visibility:"hidden"};class df extends Qn{constructor(e,t){super(e,Object.assign({},df.defaultOptions,t)),this.initSnapline=()=>{const n=this.context.canvas.getLayer("transient");this.horizontalLine||(this.horizontalLine=n.appendChild(new Is({style:Object.assign(Object.assign({},Bb),this.options.horizontalLineStyle)}))),this.verticalLine||(this.verticalLine=n.appendChild(new Is({style:Object.assign(Object.assign({},Bb),this.options.verticalLineStyle)})))},this.isHorizontalSticking=!1,this.isVerticalSticking=!1,this.enableStick=!0,this.autoSnapToLine=(n,i,a)=>wb(this,void 0,void 0,function*(){const{verticalX:s,horizontalY:o}=a,{tolerance:A}=this.options,{min:[l,c],max:[u,h],center:[d,f]}=i;let g=0,p=0;s!==null&&(ar(u,s)<A&&(g=s-u),ar(l,s)<A&&(g=s-l),ar(d,s)<A&&(g=s-d),g!==0&&(this.isVerticalSticking=!0)),o!==null&&(ar(h,o)<A&&(p=o-h),ar(c,o)<A&&(p=o-c),ar(f,o)<A&&(p=o-f),p!==0&&(this.isHorizontalSticking=!0)),(g!==0||p!==0)&&(yield this.context.graph.translateElementBy({[n]:[g,p]},!1))}),this.enableSnap=n=>{const{target:i}=n,a=.5;if(this.isHorizontalSticking||this.isVerticalSticking){const[s,o]=this.getDelta(n);if(this.isHorizontalSticking&&this.isVerticalSticking&&Math.abs(s)<=a&&Math.abs(o)<=a)return this.context.graph.translateElementBy({[i.id]:[-s,-o]},!1),!1;if(this.isHorizontalSticking&&Math.abs(o)<=a)return this.context.graph.translateElementBy({[i.id]:[0,-o]},!1),!1;if(this.isVerticalSticking&&Math.abs(s)<=a)return this.context.graph.translateElementBy({[i.id]:[-s,0]},!1),!1;this.isHorizontalSticking=!1,this.isVerticalSticking=!1,this.enableStick=!1,setTimeout(()=>{this.enableStick=!0},200)}return this.enableStick},this.calcSnaplineMetadata=(n,i)=>{const{tolerance:a,shape:s}=this.options,{min:[o,A],max:[l,c],center:[u,h]}=i;let d=null,f=null,g=null,p=null,v=null,y=null;return this.getNodes().some(m=>{if(Xt(n.id,m.id))return!1;const B=vU(m,s).getRenderBounds(),{min:[C,S],max:[F,T],center:[O,I]}=B;return d===null&&(ar(O,u)<a?d=O:ar(C,o)<a||ar(C,l)<a?d=C:(ar(F,l)<a||ar(F,o)<a)&&(d=F),d!==null&&(f=Math.min(S,A),g=Math.max(T,c))),p===null&&(ar(I,h)<a?p=I:ar(S,A)<a||ar(S,c)<a?p=S:(ar(T,c)<a||ar(T,A)<a)&&(p=T),p!==null&&(v=Math.min(C,o),y=Math.max(F,l))),d!==null&&p!==null}),{verticalX:d,verticalMinY:f,verticalMaxY:g,horizontalY:p,horizontalMinX:v,horizontalMaxX:y}},this.onDragStart=()=>{this.initSnapline()},this.onDrag=n=>wb(this,void 0,void 0,function*(){const{target:i}=n;if(this.options.autoSnap&&!this.enableSnap(n))return;const a=vU(i,this.options.shape).getRenderBounds(),s=this.calcSnaplineMetadata(i,a);this.hideSnapline(),(s.verticalX!==null||s.horizontalY!==null)&&this.updateSnapline(s),this.options.autoSnap&&(yield this.autoSnapToLine(i.id,a,s))}),this.onDragEnd=()=>{this.hideSnapline()},this.bindEvents()}getNodes(){var e;const{filter:t}=this.options,i=(((e=this.context.element)===null||e===void 0?void 0:e.getNodes())||[]).filter(a=>{var s;return OF(a)&&((s=this.context.viewport)===null||s===void 0?void 0:s.isInViewport(a.getRenderBounds()))});return t?i.filter(a=>t(a)):i}hideSnapline(){this.horizontalLine.style.visibility="hidden",this.verticalLine.style.visibility="hidden"}getLineWidth(e){const{lineWidth:t}=this.options[`${e}LineStyle`];return+(t||Bb.lineWidth||1)/this.context.graph.getZoom()}updateSnapline(e){const{verticalX:t,verticalMinY:n,verticalMaxY:i,horizontalY:a,horizontalMinX:s,horizontalMaxX:o}=e,[A,l]=this.context.canvas.getSize(),{offset:c}=this.options;a!==null?Object.assign(this.horizontalLine.style,{x1:c===1/0?0:s-c,y1:a,x2:c===1/0?A:o+c,y2:a,visibility:"visible",lineWidth:this.getLineWidth("horizontal")}):this.horizontalLine.style.visibility="hidden",t!==null?Object.assign(this.verticalLine.style,{x1:t,y1:c===1/0?0:n-c,x2:t,y2:c===1/0?l:i+c,visibility:"visible",lineWidth:this.getLineWidth("vertical")}):this.verticalLine.style.visibility="hidden"}getDelta(e){const t=this.context.graph.getZoom();return bi([e.dx,e.dy],t)}bindEvents(){return wb(this,void 0,void 0,function*(){const{graph:e}=this.context;e.on(ai.DRAG_START,this.onDragStart),e.on(ai.DRAG,this.onDrag),e.on(ai.DRAG_END,this.onDragEnd)})}unbindEvents(){const{graph:e}=this.context;e.off(ai.DRAG_START,this.onDragStart),e.off(ai.DRAG,this.onDrag),e.off(ai.DRAG_END,this.onDragEnd)}destroyElements(){var e,t;(e=this.horizontalLine)===null||e===void 0||e.destroy(),(t=this.verticalLine)===null||t===void 0||t.destroy()}destroy(){this.destroyElements(),this.unbindEvents(),super.destroy()}}df.defaultOptions={tolerance:5,offset:20,autoSnap:!0,shape:"key",verticalLineStyle:{stroke:"#1783FF"},horizontalLineStyle:{stroke:"#1783FF"},filter:()=>!0};const ar=(r,e)=>Math.abs(r-e),vU=(r,e)=>typeof e=="function"?e(r):r.getShape(e);var mae=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{l(n.next(c))}catch(u){s(u)}}function A(c){try{l(n.throw(c))}catch(u){s(u)}}function l(c){c.done?a(c.value):i(c.value).then(o,A)}l((n=n.apply(r,e||[])).next())})},wae=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};const Bae=["timestamp","time","date","datetime"];class ff extends Qn{get padding(){return si(this.options.padding)}constructor(e,t){super(e,Object.assign({},ff.defaultOptions,t)),this.backup(),this.upsertTimebar()}play(){var e;(e=this.timebar)===null||e===void 0||e.play()}pause(){var e;(e=this.timebar)===null||e===void 0||e.pause()}forward(){var e;(e=this.timebar)===null||e===void 0||e.forward()}backward(){var e;(e=this.timebar)===null||e===void 0||e.backward()}reset(){var e;(e=this.timebar)===null||e===void 0||e.reset()}update(e){super.update(e),this.backup(),this.upsertTimebar()}backup(){this.originalData=yU(this.context.graph.getData())}upsertTimebar(){const{canvas:e}=this.context,t=this.options,{onChange:n,timebarType:i,data:a,x:s,y:o,width:A,height:l,mode:c}=t,u=wae(t,["onChange","timebarType","data","x","y","width","height","mode"]),h=e.getSize(),[d]=this.padding;this.upsertCanvas().ready.then(()=>{var f;const g=Object.assign(Object.assign({x:h[0]/2-A/2,y:d,onChange:p=>{const v=(mr(p)?p:[p,p]).map(y=>CR(y)?y.getTime():y);this.options.mode==="modify"?this.filterElements(v):this.hiddenElements(v),n?.(v)}},u),{data:a.map(p=>Be(p)?{time:p,value:0}:p),width:A,height:l,type:i});this.timebar?this.timebar.update(g):(this.timebar=new gae({style:g}),(f=this.canvas)===null||f===void 0||f.appendChild(this.timebar))})}upsertCanvas(){if(this.canvas)return this.canvas;const{className:e,height:t,position:n}=this.options,i=this.context.canvas,[a]=i.getSize(),[s,,o]=this.padding,[A,l]=cf({width:a,height:t+s+o,graphCanvas:i,className:"timebar",placement:n});return this.container=A,e&&A.classList.add(e),this.canvas=l,this.canvas}filterElements(e){return mae(this,void 0,void 0,function*(){var t;if(!this.originalData)return;const{elementTypes:n,getTime:i}=this.options,{graph:a,element:s}=this.context,o=yU(this.originalData);n.forEach(l=>{const c=`${l}s`;o[c]=(this.originalData[c]||[]).filter(u=>{const h=i(u);return!!mU(h,e)})});const A=[...o.nodes,...o.combos].map(l=>X(l));o.edges=o.edges.filter(l=>{const c=l.source,u=l.target;return A.includes(c)&&A.includes(u)}),a.setData(o),yield(t=s.draw({animation:!1,silence:!0}))===null||t===void 0?void 0:t.finished})}hiddenElements(e){const{graph:t}=this.context,{elementTypes:n,getTime:i}=this.options,a=[],s=[];n.forEach(o=>{var A;const l=`${o}s`;(((A=this.originalData)===null||A===void 0?void 0:A[l])||[]).forEach(u=>{const h=X(u),d=i(u);mU(d,e)?s.push(h):a.push(h)})}),t.hideElement(a,!1),t.showElement(s,!1)}destroy(){var e,t,n;const{graph:i}=this.context;this.originalData&&i.setData(Object.assign({},this.originalData)),(e=this.timebar)===null||e===void 0||e.destroy(),(t=this.canvas)===null||t===void 0||t.destroy(),(n=this.container)===null||n===void 0||n.remove(),this.originalData=void 0,this.container=void 0,this.timebar=void 0,this.canvas=void 0,super.destroy()}}ff.defaultOptions={position:"bottom",enable:!0,timebarType:"time",className:"g6-timebar",width:450,height:60,zIndex:3,elementTypes:["node"],padding:10,mode:"modify",getTime:r=>bae(r,Bae,void 0),loop:!1};const yU=r=>{const{nodes:e=[],edges:t=[],combos:n=[]}=r;return{nodes:[...e],edges:[...t],combos:[...n]}},mU=(r,e)=>{if(Be(e))return r===e;const[t,n]=e;return r>=t&&r<=n},bae=(r,e,t)=>{var n;for(let i=0;i<e.length;i++){const a=e[i],s=(n=r.data)===null||n===void 0?void 0:n[a];if(s)return s}return t};var Eae=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};const wU={fill:"#1D2129",wordWrap:!0,maxLines:1,textOverflow:"ellipsis",textBaseline:"top",textAlign:"start",x:0},xae=Object.assign(Object.assign({},wU),{fillOpacity:.9,fontSize:16,fontWeight:"bold"}),Cae=Object.assign(Object.assign({},wU),{fillOpacity:.65,fontSize:12,fontWeight:"normal"}),Sae={align:"left",spacing:8,size:44,padding:[16,24,0,24]},bb="title",BU="subtitle";class Fae extends Qn{get padding(){return si(this.options.padding)}constructor(e,t){const n=Object.assign({},Sae,t);super(e,n),this.onRender=()=>{const i=this.updateCanvas();this.renderTitle(i)},this.bindEvents()}bindEvents(){const{graph:e}=this.context;e.on(fe.AFTER_RENDER,this.onRender),e.on(fe.AFTER_ANIMATE,this.onRender)}unbindEvents(){const{graph:e}=this.context;e.off(fe.AFTER_RENDER,this.onRender),e.off(fe.AFTER_ANIMATE,this.onRender)}destroy(){var e,t;this.unbindEvents(),(e=this.canvas)===null||e===void 0||e.destroy(),(t=this.container)===null||t===void 0||t.remove(),super.destroy()}updateCanvas(){const{size:e,className:t,align:n}=this.options,[i]=this.context.canvas.getSize(),[a=0,,s=0]=this.padding,o=e+a+s;if(this.canvas){const{width:A,height:l}=this.canvas.getConfig();(i!==A||o!==l)&&this.canvas.resize(i,o)}else{const A={left:"left-top",center:"top",right:"right-top"},[l,c]=cf({width:i,height:o,placement:A[n]||A.left,className:"title-canvas",graphCanvas:this.context.canvas});t&&l.classList.add(t),this.container=l,this.canvas=c}return this.canvas}renderTitle(e){const t=new Tae({options:this.options,ctx:this.context});e.removeChildren(),t.getTitle().forEach(n=>{n&&e.appendChild(n)})}}class Tae{get padding(){return si(this.options.padding)}constructor(e){const{options:t,ctx:n}=e;this.options=t,this.context=n}getTitle(){const e=this.options,t=bb,n=e[t],i=BU,a=e[i],{spacing:s=44,padding:o,align:A}=e,l=Eae(e,[t+"",i+"","spacing","padding","align"]),c=n,u=a,h=rn(l,bb),d=rn(l,BU),[f]=this.context.graph.getSize(),[g=0,p=0,,v=0]=this.padding,y=f,m=y-v-p;let B=null,C=v,S="left";switch(A){case"left":C=v,S="left";break;case"center":C=y/2,S="center";break;case"right":C=y-p,S="right";break;default:C=v,S="left"}const F=new Ji({className:bb,style:Object.assign(Object.assign(Object.assign(Object.assign({},xae),{wordWrapWidth:m-5,x:C,y:g,textAlign:S}),h),{text:c})}),T=F.getBBox();return u&&(B=new Ji({className:"subTitle",style:Object.assign(Object.assign(Object.assign(Object.assign({},Cae),{wordWrapWidth:m-5,x:C,y:T.height+s+g,textAlign:S}),d),{text:u})})),[F,B]}}function Mae(r){const e={top:"unset",right:"unset",bottom:"unset",left:"unset"};return r.split("-").forEach(n=>{e[n]="8px"}),e.flexDirection=r.startsWith("top")||r.startsWith("bottom")?"row":"column",e}const Oae=`
63
+ .g6-toolbar {
64
+ position: absolute;
65
+ z-index: 100;
66
+ display: flex;
67
+ flex-direction: row;
68
+ align-items: center;
69
+ justify-content: center;
70
+ border-radius: 4px;
71
+ box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.1);
72
+ opacity: 0.65;
73
+ }
74
+ .g6-toolbar .g6-toolbar-item {
75
+ display: inline-block;
76
+ width: 16px;
77
+ height: 16px;
78
+ padding: 4px;
79
+ cursor: pointer;
80
+ box-sizing: content-box;
81
+ }
82
+
83
+ .g6-toolbar .g6-toolbar-item:hover {
84
+ background-color: #f0f0f0;
85
+ }
86
+
87
+ .g6-toolbar .g6-toolbar-item svg {
88
+ display: inline-block;
89
+ width: 100%;
90
+ height: 100%;
91
+ pointer-events: none;
92
+ }
93
+ `,Iae=`
94
+ <svg>
95
+ <symbol id="zoom-in" viewBox="64 64 896 896">
96
+ <path d="M637 443H519V309c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v134H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h118v134c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V519h118c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"></path>
97
+ </symbol>
98
+ <symbol id="zoom-out" viewBox="64 64 896 896">
99
+ <path d="M637 443H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h312c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"></path>
100
+ </symbol>
101
+ <symbol id="edit" viewBox="64 64 896 896">
102
+ <path d="M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"></path>
103
+ </symbol>
104
+ <symbol id="delete" viewBox="64 64 896 896">
105
+ <path d="M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"></path>
106
+ </symbol>
107
+ <symbol id="redo" viewBox="64 64 896 896">
108
+ <path d="M758.2 839.1C851.8 765.9 912 651.9 912 523.9 912 303 733.5 124.3 512.6 124 291.4 123.7 112 302.8 112 523.9c0 125.2 57.5 236.9 147.6 310.2 3.5 2.8 8.6 2.2 11.4-1.3l39.4-50.5c2.7-3.4 2.1-8.3-1.2-11.1-8.1-6.6-15.9-13.7-23.4-21.2a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-9.3 9.3-19.1 18-29.3 26L668.2 724a8 8 0 00-14.1 3l-39.6 162.2c-1.2 5 2.6 9.9 7.7 9.9l167 .8c6.7 0 10.5-7.7 6.3-12.9l-37.3-47.9z"></path>
109
+ </symbol>
110
+ <symbol id="undo" viewBox="64 64 896 896">
111
+ <path d="M511.4 124C290.5 124.3 112 303 112 523.9c0 128 60.2 242 153.8 315.2l-37.5 48c-4.1 5.3-.3 13 6.3 12.9l167-.8c5.2 0 9-4.9 7.7-9.9L369.8 727a8 8 0 00-14.1-3L315 776.1c-10.2-8-20-16.7-29.3-26a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-7.5 7.5-15.3 14.5-23.4 21.2a7.93 7.93 0 00-1.2 11.1l39.4 50.5c2.8 3.5 7.9 4.1 11.4 1.3C854.5 760.8 912 649.1 912 523.9c0-221.1-179.4-400.2-400.6-399.9z"></path>
112
+ </symbol>
113
+ <symbol id="export" viewBox="64 64 896 896">
114
+ <path d="M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM770.87 199.13l-52.2-52.2a8.01 8.01 0 014.7-13.6l179.4-21c5.1-.6 9.5 3.7 8.9 8.9l-21 179.4c-.8 6.6-8.9 9.4-13.6 4.7l-52.4-52.4-256.2 256.2a8.03 8.03 0 01-11.3 0l-42.4-42.4a8.03 8.03 0 010-11.3l256.1-256.3z"></path>
115
+ </symbol>
116
+ <symbol id="auto-fit" viewBox="64 64 896 896">
117
+ <path d="M952 474H829.8C812.5 327.6 696.4 211.5 550 194.2V72c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v122.2C327.6 211.5 211.5 327.6 194.2 474H72c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h122.2C211.5 696.4 327.6 812.5 474 829.8V952c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V829.8C696.4 812.5 812.5 696.4 829.8 550H952c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zM512 756c-134.8 0-244-109.2-244-244s109.2-244 244-244 244 109.2 244 244-109.2 244-244 244z"></path>
118
+ <path d="M512 392c-32.1 0-62.1 12.4-84.8 35.2-22.7 22.7-35.2 52.7-35.2 84.8s12.5 62.1 35.2 84.8C449.9 619.4 480 632 512 632s62.1-12.5 84.8-35.2C619.4 574.1 632 544 632 512s-12.5-62.1-35.2-84.8A118.57 118.57 0 00512 392z"></path>
119
+ </symbol>
120
+ <symbol id="reset" viewBox="64 64 896 896">
121
+ <path d="M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"></path>
122
+ </symbol>
123
+ <symbol id="exit-fullscreen" viewBox="0 0 1024 1024">
124
+ <path d="M418.13333333 361.43786666c0 0.2048-0.13653333 0.4096-0.13653334 0.68266667C417.99679999 362.32533333 418.13333333 362.53013333 418.13333333 362.73493333 418.13333333 371.54133333 414.44693333 379.392 408.78079999 385.39946666 408.43946666 385.7408 408.30293333 386.21866666 408.02986666 386.49173333c-1.09226667 1.09226667-2.59413333 1.77493333-3.82293333 2.73066667C398.40426666 393.65973333 391.64586666 396.8 383.93173333 396.8 383.72693333 396.8 383.59039999 396.73173333 383.38559999 396.73173333S382.97599999 396.8 382.77119999 396.8L112.29866666 396.8C92.50133333 396.8 76.79999999 381.50826666 76.79999999 362.66666666 76.66346666 343.89333333 92.63786666 328.53333333 112.16213333 328.53333333l189.44 0L87.44959999 114.51733333C73.59146666 100.59093333 73.25013333 78.5408 86.63039999 65.29706666c13.17546667-13.44853333 35.36213333-12.97066667 49.152 0.88746667l214.08426667 214.08426667L349.86666666 90.89706666C349.79839999 71.23626666 365.22666666 55.46666666 383.99999999 55.46666666 402.77333333 55.33013333 418.13333333 71.30453333 418.13333333 90.8288L418.13333333 361.43786666zM928.90453333 328.53333333l-189.44 0 214.15253333-214.08426667c13.85813333-13.9264 14.19946667-35.90826667 0.88746667-49.22026666-13.17546667-13.44853333-35.36213333-12.97066667-49.152 0.88746666l-214.08426667 214.08426667L691.26826666 90.89706666C691.26826666 71.23626666 675.83999999 55.46666666 657.06666666 55.46666666 638.29333333 55.33013333 622.93333333 71.30453333 622.93333333 90.8288l0 270.60906666c0 0.2048 0.13653333 0.4096 0.13653333 0.68266667C623.06986666 362.32533333 622.93333333 362.53013333 622.93333333 362.73493333 622.93333333 371.54133333 626.61973333 379.392 632.28586666 385.39946666c0.34133333 0.34133333 0.47786667 0.8192 0.8192 1.09226667 1.09226667 1.09226667 2.59413333 1.77493333 3.8912 2.73066667C642.66239999 393.65973333 649.42079999 396.8 657.13493333 396.8c0.2048 0 0.34133333-0.06826667 0.54613333-0.06826667S658.09066666 396.8 658.29546666 396.8l270.5408 0C948.56533333 396.8 964.26666666 381.50826666 964.26666666 362.66666666 964.40319999 343.89333333 948.42879999 328.53333333 928.90453333 328.53333333zM418.13333333 635.73333333c0-8.8064-3.6864-16.5888-9.35253334-22.66453333C408.43946666 612.72746666 408.30293333 612.2496 408.02986666 611.90826666 406.86933333 610.88426666 405.43573333 610.2016 404.20693333 609.24586666 398.47253333 604.80853333 391.64586666 601.6 383.93173333 601.6 383.72693333 601.6 383.59039999 601.73653333 383.38559999 601.73653333S382.97599999 601.6 382.77119999 601.6L112.29866666 601.6C92.50133333 601.6 76.79999999 616.96 76.79999999 635.73333333 76.66346666 654.50666666 92.63786666 669.86666666 112.16213333 669.86666666l189.44 0-214.15253334 214.15253334c-13.85813333 13.85813333-14.19946667 35.84-0.88746666 49.22026666 13.17546667 13.44853333 35.36213333 12.9024 49.152-0.95573333l214.08426666-214.08426667 0 189.37173334c0 19.59253333 15.42826667 35.49866667 34.2016 35.36213333C402.77333333 943.2064 418.13333333 927.232 418.13333333 907.5712L418.13333333 637.09866666c0-0.27306667-0.13653333-0.47786667-0.13653334-0.68266666C417.99679999 636.14293333 418.13333333 635.93813333 418.13333333 635.73333333zM739.46453333 669.86666666l189.44 0c19.456 0 35.49866667-15.36 35.36213333-34.13333333C964.26666666 616.96 948.56533333 601.6 928.76799999 601.6L658.29546666 601.6C658.09066666 601.6 657.88586666 601.73653333 657.68106666 601.73653333S657.33973333 601.6 657.13493333 601.6C649.42079999 601.6 642.59413333 604.80853333 636.85973333 609.24586666 635.63093333 610.2016 634.19733333 610.88426666 633.03679999 611.90826666 632.76373333 612.2496 632.62719999 612.72746666 632.28586666 613.0688 626.61973333 619.14453333 622.93333333 626.92693333 622.93333333 635.73333333c0 0.2048 0.13653333 0.4096 0.13653333 0.68266667C623.06986666 636.6208 622.93333333 636.8256 622.93333333 637.09866666l0 270.5408C622.93333333 927.232 638.29333333 943.2064 657.06666666 942.93333333c18.77333333 0.13653333 34.2016-15.70133333 34.2016-35.36213333l0-189.37173334 214.08426667 214.08426667c13.78986667 13.85813333 35.90826667 14.40426667 49.152 0.95573333 13.312-13.312 12.97066667-35.36213333-0.88746667-49.22026666L739.46453333 669.86666666z" ></path></symbol>
125
+ <symbol id="request-fullscreen" viewBox="0 0 1024 1024">
126
+ <path d="M69.818182 87.598545v273.128728a34.909091 34.909091 0 0 0 69.818182 0V163.653818l221.928727 222.021818a33.512727 33.512727 0 0 0 47.383273-47.383272L186.926545 116.363636h197.073455a34.909091 34.909091 0 0 0 0-69.818181H110.871273C85.364364 46.545455 69.818182 59.671273 69.818182 87.598545zM938.542545 46.545455H665.413818a34.909091 34.909091 0 0 0 0 69.818181h197.073455L640.465455 338.292364a33.512727 33.512727 0 0 0 47.383272 47.383272l221.928728-222.021818v197.073455a34.909091 34.909091 0 0 0 69.818181 0V87.598545c0-27.927273-15.453091-41.053091-40.96-41.05309z m-827.671272 907.636363h273.128727a34.909091 34.909091 0 0 0 0-69.818182H186.926545l222.021819-221.928727a33.512727 33.512727 0 0 0-47.383273-47.383273L139.636364 837.073455V640a34.909091 34.909091 0 0 0-69.818182 0v273.128727c0 27.927273 15.546182 41.053091 41.053091 41.053091z m868.724363-41.053091V640a34.909091 34.909091 0 0 0-69.818181 0v197.073455L687.941818 615.051636a33.512727 33.512727 0 0 0-47.383273 47.383273L862.487273 884.363636H665.413818a34.909091 34.909091 0 0 0 0 69.818182h273.128727c25.6 0 41.053091-13.125818 41.053091-41.053091z" ></path></symbol>
127
+ </svg>
128
+ `;var bU=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{l(n.next(c))}catch(u){s(u)}}function A(c){try{l(n.throw(c))}catch(u){s(u)}}function l(c){c.done?a(c.value):i(c.value).then(o,A)}l((n=n.apply(r,e||[])).next())})};class gf extends Qn{constructor(e,t){super(e,Object.assign({},gf.defaultOptions,t)),this.$element=rA("toolbar",!1),this.onToolbarItemClick=i=>{const{onClick:a}=this.options;if(i.target instanceof Element&&i.target.className.includes("g6-toolbar-item")){const s=i.target.getAttribute("value");a?.(s,i.target)}};const n=this.context.canvas.getContainer();this.$element.style.display="flex",n.appendChild(this.$element),_B("g6-toolbar-css","style",{},Oae,document.head),_B("g6-toolbar-svgicon","div",{display:"none"},Iae),this.$element.addEventListener("click",this.onToolbarItemClick),this.update(t)}update(e){const t=Object.create(null,{update:{get:()=>super.update}});return bU(this,void 0,void 0,function*(){t.update.call(this,e);const{className:n,position:i,style:a}=this.options;this.$element.className=`g6-toolbar ${n||""}`,Object.assign(this.$element.style,a,Mae(i)),this.$element.innerHTML=yield this.getDOMContent()})}destroy(){this.$element.removeEventListener("click",this.onToolbarItemClick),this.$element.remove(),super.destroy()}getDOMContent(){return bU(this,void 0,void 0,function*(){return(yield this.options.getItems()).map(t=>{var n;return`
129
+ <div class="g6-toolbar-item" value="${t.value}" title="${(n=t.title)!==null&&n!==void 0?n:""}">
130
+ <svg aria-hidden="true" focusable="false">
131
+ <use xlink:href="#${t.id}"></use>
132
+ </svg>
133
+ </div>`}).join("")})}}gf.defaultOptions={position:"top-left"};var EU=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{l(n.next(c))}catch(u){s(u)}}function A(c){try{l(n.throw(c))}catch(u){s(u)}}function l(c){c.done?a(c.value):i(c.value).then(o,A)}l((n=n.apply(r,e||[])).next())})};class pf extends Qn{constructor(e,t){super(e,Object.assign({},pf.defaultOptions,t)),this.currentTarget=null,this.tooltipElement=null,this.container=null,this.isEnable=(n,i)=>{const{enable:a}=this.options;return typeof a=="function"?a(n,i):a},this.onClick=n=>{const{target:{id:i}}=n;this.currentTarget===i?this.hide(n):this.show(n)},this.onPointerMove=n=>{const{target:i}=n;!this.currentTarget||i.id===this.currentTarget||this.show(n)},this.onPointerLeave=n=>{this.hide(n)},this.onCanvasMove=n=>{this.hide(n)},this.onPointerOver=n=>{this.show(n)},this.showById=n=>EU(this,void 0,void 0,function*(){const i={target:{id:n}};yield this.show(i)}),this.getElementData=(n,i)=>{const{model:a}=this.context;switch(i){case"node":return a.getNodeData([n]);case"edge":return a.getEdgeData([n]);case"combo":return a.getComboData([n]);default:return[]}},this.show=n=>EU(this,void 0,void 0,function*(){var i,a;const{client:s,target:{id:o}}=n;if(bl(n.target))return;const A=this.context.graph.getElementType(o),{getContent:l,title:c}=this.options,u=this.getElementData(o,A);if(!this.tooltipElement)return;if(!this.isEnable(n,u)){this.hide(n);return}let h={};if(l){if(h.content=yield l(n,u),!h.content)return}else{const g=this.context.graph.getElementRenderStyle(o),p=A==="node"?g.fill:g.stroke;h={title:c||A,data:u.map(v=>({name:"ID",value:v.id||`${v.source} -> ${v.target}`,color:p}))}}this.currentTarget=o;let d,f;if(s)d=s.x,f=s.y;else{const g=Dn(u,"0.style",{x:0,y:0});d=g.x,f=g.y}(a=(i=this.options).onOpenChange)===null||a===void 0||a.call(i,!0),this.tooltipElement.update(Object.assign(Object.assign(Object.assign({},this.tooltipStyleProps),{x:d,y:f,style:{".tooltip":{visibility:"visible"}}}),h))}),this.hide=n=>{var i,a,s,o,A;if(!n){(a=(i=this.options).onOpenChange)===null||a===void 0||a.call(i,!1),(s=this.tooltipElement)===null||s===void 0||s.hide(),this.currentTarget=null;return}if(!this.tooltipElement||!this.currentTarget)return;const{client:{x:l,y:c}}=n;(A=(o=this.options).onOpenChange)===null||A===void 0||A.call(o,!1),this.tooltipElement.hide(l,c),this.currentTarget=null},this.initTooltip=()=>{var n;const i=new Yie({className:"tooltip",style:this.tooltipStyleProps});return(n=this.container)===null||n===void 0||n.appendChild(i.HTMLTooltipElement),i},this.render(),this.bindEvents()}getEvents(){return this.options.trigger==="click"?{"node:click":this.onClick,"edge:click":this.onClick,"combo:click":this.onClick,"canvas:click":this.onPointerLeave,contextmenu:this.onPointerLeave,drag:this.onPointerLeave}:{"node:pointerover":this.onPointerOver,"node:pointermove":this.onPointerMove,"canvas:pointermove":this.onCanvasMove,"edge:pointerover":this.onPointerOver,"edge:pointermove":this.onPointerMove,"combo:pointerover":this.onPointerOver,"combo:pointermove":this.onPointerMove,contextmenu:this.onPointerLeave,"node:drag":this.onPointerLeave}}update(e){var t;this.unbindEvents(),super.update(e),this.tooltipElement&&((t=this.container)===null||t===void 0||t.removeChild(this.tooltipElement.HTMLTooltipElement)),this.tooltipElement=this.initTooltip(),this.bindEvents()}render(){const{canvas:e}=this.context,t=e.getContainer();t&&(this.container=t,this.tooltipElement=this.initTooltip())}unbindEvents(){const{graph:e}=this.context,t=this.getEvents();Object.keys(t).forEach(n=>{e.off(n,t[n])})}bindEvents(){const{graph:e}=this.context,t=this.getEvents();Object.keys(t).forEach(n=>{e.on(n,t[n])})}get tooltipStyleProps(){const{canvas:e}=this.context,{center:t}=e.getBounds(),n=e.getContainer(),{top:i,left:a}=n.getBoundingClientRect(),{style:s,position:o,enterable:A,container:l={x:-a,y:-i},title:c,offset:u}=this.options,[h,d]=t,[f,g]=e.getSize();return{x:h,y:d,container:l,title:c,bounding:{x:0,y:0,width:f,height:g},position:o,enterable:A,offset:u,style:s}}destroy(){var e;this.unbindEvents(),this.tooltipElement&&((e=this.container)===null||e===void 0||e.removeChild(this.tooltipElement.HTMLTooltipElement)),super.destroy()}}pf.defaultOptions={trigger:"hover",position:"top-right",enterable:!1,enable:!0,offset:[10,10],style:{".tooltip":{visibility:"hidden"}}};var xU=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{l(n.next(c))}catch(u){s(u)}}function A(c){try{l(n.throw(c))}catch(u){s(u)}}function l(c){c.done?a(c.value):i(c.value).then(o,A)}l((n=n.apply(r,e||[])).next())})};let cA;function CU(r,e){return cA||(cA=document.createElement("canvas")),cA.width=r,cA.height=e,cA.getContext("2d").clearRect(0,0,r,e),cA}function _ae(r,e,t,n){return xU(this,void 0,void 0,function*(){const i=CU(r,e),a=i.getContext("2d"),{rotate:s,opacity:o,textFill:A,textFontSize:l,textFontFamily:c,textFontVariant:u,textFontWeight:h,textAlign:d,textBaseline:f}=n;return a.textAlign=d,a.textBaseline=f,a.translate(r/2,e/2),a.font=`${l}px ${c} ${u} ${h}`,s&&a.rotate(s),o&&(a.globalAlpha=o),A&&(a.fillStyle=A,a.fillText(`${t}`,0,0)),i.toDataURL()})}function kae(r,e,t,n){return xU(this,void 0,void 0,function*(){const i=CU(r,e),a=i.getContext("2d"),{rotate:s,opacity:o}=n;s&&a.rotate(s),o&&(a.globalAlpha=o);const A=new Image;return A.crossOrigin="anonymous",A.src=t,new Promise(l=>{A.onload=function(){const c=r>A.width?(r-A.width)/2:0,u=e>A.height?(e-A.height)/2:0;a.drawImage(A,0,0,A.width,A.height,c,u,r-c*2,e-u*2),l(i.toDataURL())}})})}var Nae=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{l(n.next(c))}catch(u){s(u)}}function A(c){try{l(n.throw(c))}catch(u){s(u)}}function l(c){c.done?a(c.value):i(c.value).then(o,A)}l((n=n.apply(r,e||[])).next())})},Lae=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};class vf extends Qn{constructor(e,t){super(e,Object.assign({},vf.defaultOptions,t)),this.$element=rA("watermark"),this.context.canvas.getContainer().appendChild(this.$element),this.update(t)}update(e){const t=Object.create(null,{update:{get:()=>super.update}});return Nae(this,void 0,void 0,function*(){t.update.call(this,e);const n=this.options,{width:i,height:a,text:s,imageURL:o}=n,A=Lae(n,["width","height","text","imageURL"]);Object.keys(A).forEach(c=>{c.startsWith("background")&&(this.$element.style[c]=e[c])});const l=o?yield kae(i,a,o,A):yield _ae(i,a,s,A);this.$element.style.backgroundImage=`url(${l})`})}destroy(){super.destroy(),this.$element.remove()}}vf.defaultOptions={width:200,height:100,opacity:.2,rotate:Math.PI/12,text:"",textFill:"#000",textFontSize:16,textAlign:"center",textBaseline:"middle",backgroundRepeat:"repeat"};const Qae=["#7E92B5","#F4664A","#FFBE3A"],Uae={type:"group",color:["#1783FF","#00C9C9","#F08F56","#D580FF","#7863FF","#DB9D0D","#60C42D","#FF80CA","#2491B3","#17C76F"]},Pae={type:"group",color:["#99ADD1","#1783FF","#00C9C9","#F08F56","#D580FF","#7863FF","#DB9D0D","#60C42D","#FF80CA","#2491B3","#17C76F"]};function SU(r){const{bgColor:e,textColor:t,nodeColor:n,nodeColorDisabled:i,nodeStroke:a,nodeHaloStrokeOpacityActive:s=.15,nodeHaloStrokeOpacitySelected:o=.25,nodeOpacityDisabled:A=.06,nodeIconOpacityInactive:l=.85,nodeOpacityInactive:c=.25,nodeBadgePalette:u=Qae,nodePaletteOptions:h=Uae,edgeColor:d,edgeColorDisabled:f,edgePaletteOptions:g=Pae,comboColor:p,comboColorDisabled:v,comboStroke:y,comboStrokeDisabled:m,edgeColorInactive:B}=r;return{background:e,node:{palette:h,style:{donutOpacity:1,badgeBackgroundOpacity:1,badgeFill:"#fff",badgeFontSize:8,badgePadding:[0,4],badgePalette:u,fill:n,fillOpacity:1,halo:!1,iconFill:"#fff",iconOpacity:1,labelBackground:!1,labelBackgroundFill:e,labelBackgroundLineWidth:0,labelBackgroundOpacity:.75,labelFill:t,labelFillOpacity:.85,labelLineHeight:16,labelPadding:[0,2],labelFontSize:12,labelFontWeight:400,labelOpacity:1,labelOffsetY:2,lineWidth:0,portFill:n,portLineWidth:1,portStroke:a,portStrokeOpacity:.65,size:32,stroke:a,strokeOpacity:1,zIndex:2},state:{selected:{halo:!0,haloLineWidth:24,haloStrokeOpacity:o,labelFontSize:12,labelFontWeight:"bold",lineWidth:4,stroke:a},active:{halo:!0,haloLineWidth:12,haloStrokeOpacity:s},highlight:{labelFontWeight:"bold",lineWidth:4,stroke:a,strokeOpacity:.85},inactive:{badgeBackgroundOpacity:c,donutOpacity:c,fillOpacity:c,iconOpacity:l,labelFill:t,labelFillOpacity:c,strokeOpacity:c},disabled:{badgeBackgroundOpacity:.25,donutOpacity:A,fill:i,fillOpacity:A,iconFill:i,iconOpacity:.25,labelFill:t,labelFillOpacity:.25,strokeOpacity:A}},animation:{enter:"fade",exit:"fade",show:"fade",hide:"fade",expand:"node-expand",collapse:"node-collapse",update:[{fields:["x","y","fill","stroke"]}],translate:[{fields:["x","y"]}]}},edge:{palette:g,style:{badgeBackgroundFill:d,badgeFill:"#fff",badgeFontSize:8,badgeOffsetX:10,badgeBackgroundOpacity:1,fillOpacity:1,halo:!1,haloLineWidth:12,haloStrokeOpacity:1,increasedLineWidthForHitTesting:2,labelBackground:!1,labelBackgroundFill:e,labelBackgroundLineWidth:0,labelBackgroundOpacity:.75,labelBackgroundPadding:[4,4,4,4],labelFill:t,labelFontSize:12,labelFontWeight:400,labelOpacity:1,labelPlacement:"center",labelTextBaseline:"middle",lineWidth:1,stroke:d,strokeOpacity:1,zIndex:1},state:{selected:{halo:!0,haloStrokeOpacity:.25,labelFontSize:14,labelFontWeight:"bold",lineWidth:3},active:{halo:!0,haloStrokeOpacity:.15},highlight:{labelFontWeight:"bold",lineWidth:3},inactive:{stroke:B,fillOpacity:.08,labelOpacity:.25,strokeOpacity:.08,badgeBackgroundOpacity:.25},disabled:{stroke:f,fillOpacity:.45,strokeOpacity:.45,labelOpacity:.25,badgeBackgroundOpacity:.45}},animation:{enter:"fade",exit:"fade",expand:"path-in",collapse:"path-out",show:"fade",hide:"fade",update:[{fields:["sourceNode","targetNode"]},{fields:["stroke"],shape:"key"}],translate:[{fields:["sourceNode","targetNode"]}]}},combo:{style:{collapsedMarkerFill:e,collapsedMarkerFontSize:12,collapsedMarkerFillOpacity:1,collapsedSize:32,collapsedFillOpacity:1,fill:p,halo:!1,haloLineWidth:12,haloStroke:y,haloStrokeOpacity:.25,labelBackground:!1,labelBackgroundFill:e,labelBackgroundLineWidth:0,labelBackgroundOpacity:.75,labelBackgroundPadding:[2,4,2,4],labelFill:t,labelFontSize:12,labelFontWeight:400,labelOpacity:1,lineDash:0,lineWidth:1,fillOpacity:.04,strokeOpacity:1,padding:10,stroke:y},state:{selected:{halo:!0,labelFontSize:14,labelFontWeight:700,lineWidth:4},active:{halo:!0},highlight:{labelFontWeight:700,lineWidth:4},inactive:{fillOpacity:.65,labelOpacity:.25,strokeOpacity:.65},disabled:{fill:v,fillOpacity:.25,labelOpacity:.25,stroke:m,strokeOpacity:.25}},animation:{enter:"fade",exit:"fade",show:"fade",hide:"fade",expand:"combo-expand",collapse:"combo-collapse",update:[{fields:["x","y"]},{fields:["fill","stroke","lineWidth"],shape:"key"}],translate:[{fields:["x","y"]}]}}}}const Rae=SU({bgColor:"#000000",comboColor:"#fdfdfd",comboColorDisabled:"#d0e4ff",comboStroke:"#99add1",comboStrokeDisabled:"#969696",edgeColor:"#637088",edgeColorDisabled:"#637088",edgeColorInactive:"#D0E4FF",edgePaletteOptions:{type:"group",color:["#637088","#0F55A6","#008383","#9C5D38","#8B53A6","#4E40A6","#8F6608","#3E801D","#A65383","#175E75","#0F8248"]},nodeColor:"#1783ff",nodeColorDisabled:"#D0E4FF",nodeHaloStrokeOpacityActive:.25,nodeHaloStrokeOpacitySelected:.45,nodeIconOpacityInactive:.45,nodeOpacityDisabled:.25,nodeOpacityInactive:.45,nodeStroke:"#d0e4ff",textColor:"#ffffff"}),Dae=SU({bgColor:"#ffffff",comboColor:"#99ADD1",comboColorDisabled:"#f0f0f0",comboStroke:"#99add1",comboStrokeDisabled:"#d9d9d9",edgeColor:"#99add1",edgeColorDisabled:"#d9d9d9",edgeColorInactive:"#1B324F",nodeColor:"#1783ff",nodeColorDisabled:"#1B324F",nodeHaloStrokeOpacityActive:.15,nodeHaloStrokeOpacitySelected:.25,nodeIconOpacityInactive:.85,nodeOpacityDisabled:.06,nodeOpacityInactive:.25,nodeStroke:"#000000",textColor:"#000000"});class fs extends Yp{beforeDraw(e,t){return e}afterLayout(e,t){}}class Hae extends fs{beforeDraw(e){const{model:t}=this.context,n=e.add.combos,i=a=>{const s=[];return a.forEach((o,A)=>{const c=t.getAncestorsData(A,"combo").map(u=>X(u)).reverse();s.push([A,o,c.length])}),new Map(s.sort(([,,o],[,,A])=>A-o).map(([o,A])=>[o,A]))};return e.add.combos=i(n),e.update.combos=i(e.update.combos),e}}function Vr(r,e,t,n,i){const a=X(n),s=`${t}s`,o=i?n:r.add[s].get(a)||r.update[s].get(a)||r.remove[s].get(a)||n;Object.entries(r).forEach(([A,l])=>{e===A?l[s].set(a,o):l[s].delete(a)})}function yf(r,e){return Object.keys(r).every(t=>r[t]===e[t])}class Gae extends fs{beforeDraw(e,t){if(t.stage==="visibility"||!this.context.model.model.hasTreeStructure(Ft))return e;const{model:n}=this.context,{add:i,update:a}=e,s=[...e.update.combos.entries(),...e.add.combos.entries()];for(;s.length;){const[o,A]=s.pop();if(Fr(A)){const l=n.getDescendantsData(o),c=l.map(X),{internal:u,external:h}=pv(c,d=>n.getRelatedEdgesData(d));l.forEach(d=>{const f=X(d),g=s.findIndex(([v])=>v===f);g!==-1&&s.splice(g,1);const p=n.getElementType(f);Vr(e,"remove",p,d)}),u.forEach(d=>Vr(e,"remove","edge",d)),h.forEach(d=>{var f;const g=X(d);((f=this.context.element)===null||f===void 0?void 0:f.getElement(g))?a.edges.set(g,d):i.edges.set(g,d)})}else{const l=n.getChildrenData(o),c=l.map(X),{edges:u}=pv(c,h=>n.getRelatedEdgesData(h));[...l,...u].forEach(h=>{var d;const f=X(h),g=n.getElementType(f);((d=this.context.element)===null||d===void 0?void 0:d.getElement(f))?Vr(e,"update",g,h):Vr(e,"add",g,h),g==="combo"&&s.push([f,h])})}}return e}}const FU=(r,e,t,n)=>{const i=`${t}s`,a=X(n);!r.add[i].has(a)&&!r.update[i].has(a)&&r[e][i].set(X(n),n)};class Kae extends fs{getElement(e){return this.context.element.getElement(e)}handleExpand(e,t){if(FU(t,"add","node",e),Fr(e))return;const n=X(e);FU(t,"add","node",e),this.context.model.getRelatedEdgesData(n).forEach(s=>{Vr(t,"add","edge",s)}),this.context.model.getChildrenData(n).forEach(s=>{this.handleExpand(s,t)})}beforeDraw(e){const{graph:t,model:n}=this.context;if(!n.model.hasTreeStructure(Dr))return e;const{add:{nodes:i,edges:a},update:{nodes:s}}=e,o=new Map,A=new Map;i.forEach((c,u)=>{Fr(c)&&o.set(u,c)}),a.forEach(c=>{if(t.getElementType(c.source)!=="node")return;const u=t.getNodeData(c.source);Fr(u)&&o.set(c.source,u)}),s.forEach((c,u)=>{const h=this.getElement(u);if(!h)return;const d=h.attributes.collapsed;Fr(c)?d||o.set(u,c):d&&A.set(u,c)});const l=new Set;return o.forEach((c,u)=>{n.getDescendantsData(u).forEach(d=>{const f=X(d);if(l.has(f))return;Vr(e,"remove","node",d),n.getRelatedEdgesData(f).forEach(p=>{Vr(e,"remove","edge",p)}),l.add(f)})}),A.forEach((c,u)=>{if(n.getAncestorsData(u,Dr).some(Fr)){Vr(e,"remove","node",c);return}this.handleExpand(c,e)}),e}}function zae(r,e,t){zp[r][e]&&$i.warn(`The extension ${e} of ${r} has been registered before, and will be overridden.`),Object.assign(zp[r],{[e]:t})}var TU=(function(){function r(e){le(this,r),this.dragndropPluginOptions=e}return ce(r,[{key:"apply",value:function(t){var n=this,i=t.renderingService,a=t.renderingContext,s=a.root.ownerDocument,o=s.defaultView,A=function(c){var u=c.target,h=u===s,d=h&&n.dragndropPluginOptions.isDocumentDraggable?s:u.closest&&u.closest("[draggable=true]");if(d){var f=!1,g=c.timeStamp,p=[c.clientX,c.clientY],v=null,y=[c.clientX,c.clientY],m=(function(){var C=La(kn().mark(function S(F){var T,O,I,k,N,U;return kn().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:if(f){D.next=2;break}if(T=F.timeStamp-g,O=wr([F.clientX,F.clientY],p),!(T<=n.dragndropPluginOptions.dragstartTimeThreshold||O<=n.dragndropPluginOptions.dragstartDistanceThreshold)){D.next=1;break}return D.abrupt("return");case 1:F.type="dragstart",d.dispatchEvent(F),f=!0;case 2:if(F.type="drag",F.dx=F.clientX-y[0],F.dy=F.clientY-y[1],d.dispatchEvent(F),y=[F.clientX,F.clientY],h){D.next=4;break}return I=n.dragndropPluginOptions.overlap==="pointer"?[F.canvasX,F.canvasY]:u.getBounds().center,D.next=3,s.elementsFromPoint(I[0],I[1]);case 3:k=D.sent,N=k[k.indexOf(u)+1],U=N?.closest("[droppable=true]")||(n.dragndropPluginOptions.isDocumentDroppable?s:null),v!==U&&(v&&(F.type="dragleave",F.target=v,v.dispatchEvent(F)),U&&(F.type="dragenter",F.target=U,U.dispatchEvent(F)),v=U,v&&(F.type="dragover",F.target=v,v.dispatchEvent(F)));case 4:case"end":return D.stop()}},S)}));return function(F){return C.apply(this,arguments)}})();o.addEventListener("pointermove",m);var B=function(S){if(f){S.detail={preventClick:!0};var F=S.clone();v&&(F.type="drop",F.target=v,v.dispatchEvent(F)),F.type="dragend",d.dispatchEvent(F),f=!1}o.removeEventListener("pointermove",m)};u.addEventListener("pointerup",B,{once:!0}),u.addEventListener("pointerupoutside",B,{once:!0})}};i.hooks.init.tap(r.tag,function(){o.addEventListener("pointerdown",A)}),i.hooks.destroy.tap(r.tag,function(){o.removeEventListener("pointerdown",A)})}}])})();TU.tag="Dragndrop";var Vae=(function(r){function e(){var t,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return le(this,e),t=We(this,e),t.name="dragndrop",t.options=n,t}return qe(e,r),ce(e,[{key:"init",value:function(){this.addRenderingPlugin(new TU(De({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}},{key:"setOptions",value:function(n){Object.assign(this.plugins[0].dragndropPluginOptions,n)}}])})(Ua),MU=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{l(n.next(c))}catch(u){s(u)}}function A(c){try{l(n.throw(c))}catch(u){s(u)}}function l(c){c.done?a(c.value):i(c.value).then(o,A)}l((n=n.apply(r,e||[])).next())})},OU=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};const IU=["main"],_U=["background","main","label","transient"];function jae(r){return r.main}class kU{getConfig(){return this.config}getLayer(e="main"){return this.extends.layers[e]||jae(this.getLayers())}getLayers(){return this.extends.layers}getRenderer(e){return this.extends.renderers[e]}getCamera(e="main"){return this.getLayer(e).getCamera()}getRoot(e="main"){return this.getLayer(e).getRoot()}getContextService(e="main"){return this.getLayer(e).getContextService()}setCursor(e){this.config.cursor=e,this.getLayer().setCursor(e)}get document(){return this.getLayer().document}get context(){return this.getLayer().context}constructor(e){this.config={enableMultiLayer:!0},Object.assign(this.config,e);const t=this.config,{renderer:n,background:i,cursor:a,enableMultiLayer:s}=t,o=OU(t,["renderer","background","cursor","enableMultiLayer"]),A=s?_U:IU,l=NU(n,A),c=Object.fromEntries(A.map(u=>{const h=new zg(Object.assign(Object.assign({},o),{supportsMutipleCanvasesInOneContainer:s,renderer:l[u],background:s?u==="background"?i:void 0:i}));return[u,h]}));LU(c),this.extends={config:this.config,renderer:n,renderers:l,layers:c}}get ready(){return Promise.all(Object.entries(this.getLayers()).map(([,e])=>e.ready))}resize(e,t){Object.assign(this.extends.config,{width:e,height:t}),Object.values(this.getLayers()).forEach(n=>{const i=n.getCamera(),a=i.getPosition(),s=i.getFocalPoint();n.resize(e,t),i.setPosition(a),i.setFocalPoint(s)})}getBounds(e){return cl(Object.values(this.getLayers()).map(t=>e?t.getRoot().childNodes.find(i=>i.classList.includes(e)):t.getRoot()).filter(t=>t?.childNodes.length>0).map(t=>t.getBounds()))}getContainer(){const e=this.extends.config.container;return typeof e=="string"?document.getElementById(e):e}getSize(){return[this.extends.config.width||0,this.extends.config.height||0]}appendChild(e,t){var n;const i=((n=e.style)===null||n===void 0?void 0:n.$layer)||"main";return this.getLayer(i).appendChild(e,t)}setRenderer(e){if(e===this.extends.renderer)return;const t=NU(e,this.config.enableMultiLayer?_U:IU);this.extends.renderers=t,Object.entries(t).forEach(([n,i])=>this.getLayer(n).setRenderer(i)),LU(this.getLayers())}getCanvasByViewport(e){return zn(this.getLayer().viewport2Canvas(Ei(e)))}getViewportByCanvas(e){return zn(this.getLayer().canvas2Viewport(Ei(e)))}getViewportByClient(e){return zn(this.getLayer().client2Viewport(Ei(e)))}getClientByViewport(e){return zn(this.getLayer().viewport2Client(Ei(e)))}getClientByCanvas(e){return this.getClientByViewport(this.getViewportByCanvas(e))}getCanvasByClient(e){const t=this.getLayer(),n=t.client2Viewport(Ei(e));return zn(t.viewport2Canvas(n))}toDataURL(){return MU(this,arguments,void 0,function*(e={}){const t=globalThis.devicePixelRatio||1,{mode:n="viewport"}=e,i=OU(e,["mode"]);let[a,s,o,A]=[0,0,0,0];if(n==="viewport")[o,A]=this.getSize();else if(n==="overall"){const v=this.getBounds(),y=qa(v);[a,s]=v.min,[o,A]=y}const l=ig('<div id="virtual-image"></div>'),c=new zg({width:o,height:A,renderer:new yl,devicePixelRatio:t,container:l,background:this.extends.config.background});yield c.ready,c.appendChild(this.getLayer("background").getRoot().cloneNode(!0)),c.appendChild(this.getRoot().cloneNode(!0));const u=this.getLayer("label").getRoot().cloneNode(!0),h=c.viewport2Canvas({x:0,y:0}),d=this.getCanvasByViewport([0,0]);u.translate([d[0]-h.x,d[1]-h.y]),u.scale(1/this.getCamera().getZoom()),c.appendChild(u),c.appendChild(this.getLayer("transient").getRoot().cloneNode(!0));const f=this.getCamera(),g=c.getCamera();if(n==="viewport")g.setZoom(f.getZoom()),g.setPosition(f.getPosition()),g.setFocalPoint(f.getFocalPoint());else if(n==="overall"){const[v,y,m]=g.getPosition(),[B,C,S]=g.getFocalPoint();g.setPosition([v+a,y+s,m]),g.setFocalPoint([B+a,C+s,S])}const p=c.getContextService();return new Promise(v=>{c.addEventListener(Lr.RERENDER,()=>MU(this,void 0,void 0,function*(){yield new Promise(m=>setTimeout(m,300));const y=yield p.toDataURL(i);v(y)}))})})}destroy(){Object.values(this.getLayers()).forEach(e=>{e.getCamera().cancelLandmarkAnimation(),e.destroy()})}}function NU(r,e){return Object.fromEntries(e.map(t=>{const n=r?.(t)||new yl;return n instanceof yl&&n.setConfig({enableDirtyRectangleRendering:!1}),t==="main"?n.registerPlugin(new Vae({isDocumentDraggable:!0,isDocumentDroppable:!0,dragstartDistanceThreshold:10,dragstartTimeThreshold:100})):n.unregisterPlugin(n.getPlugin("dom-interaction")),[t,n]}))}function LU(r){Object.entries(r).forEach(([e,t])=>{const n=t.getContextService().getDomElement();n?.style&&(n.style.gridArea="1 / 1 / 2 / 2",n.style.outline="none",n.tabIndex=1,e!=="main"&&(n.style.pointerEvents="none")),n?.parentElement&&(n.parentElement.style.display="grid",n.parentElement.style.isolation="isolate")})}const uA=r=>r?parseInt(r):0;function Wae(r){const e=getComputedStyle(r),t=r.clientWidth||uA(e.width),n=r.clientHeight||uA(e.height),i=uA(e.paddingLeft)+uA(e.paddingRight),a=uA(e.paddingTop)+uA(e.paddingBottom);return[t-i,n-a]}function QU(r){if(!r)return[0,0];let e=640,t=480;const[n,i]=Wae(r);e=n||e,t=i||t;const a=1,s=1;return[Math.max(Be(e)?e:a,a),Math.max(Be(t)?t:s,s)]}class mf{constructor(e){this.type=e}}class xn extends mf{constructor(e,t){super(e),this.data=t}}class ci extends mf{constructor(e,t,n,i){super(e),this.animationType=t,this.animation=n,this.data=i}}class hA extends mf{constructor(e,t,n){super(e),this.elementType=t,this.data=n}}class wf extends mf{constructor(e,t){super(e),this.data=t}}function On(r,e){r.emit(e.type,e)}function qae(r){if(!r)return null;if(r instanceof $x)return{type:"canvas",element:r};let e=r;for(;e;){if(wl(e))return{type:"node",element:e};if(CF(e))return{type:"edge",element:e};if(vv(e))return{type:"combo",element:e};e=e.parentElement}return null}function UU(r){var e;return((e=r?.style)===null||e===void 0?void 0:e.zIndex)||0}const Zl="cachedStyle",Eb=r=>`__${r}__`;function $ae(r,e){const t=Array.isArray(e)?e:[e];Dn(r,Zl)||BA(r,Zl,{}),t.forEach(n=>{BA(Dn(r,Zl),Eb(n),r.attributes[n])})}function PU(r,e){return Dn(r,[Zl,Eb(e)])}function Yae(r,e){return Eb(e)in(Dn(r,Zl)||{})}class Xae{constructor(e){this.tasks=[],this.animations=new Set,this.context=e}getTasks(){const e=[...this.tasks];return this.tasks=[],e}add(e,t){this.tasks.push([e,t])}animate(e,t,n){var i,a,s;(i=t?.before)===null||i===void 0||i.call(t);const o=this.getTasks().map(([l,c])=>{var u,h,d;const{element:f,elementType:g,stage:p}=l,v=yV(this.context.options,g,p,e);(u=c?.before)===null||u===void 0||u.call(c);const y=v.length?wV(f,this.inferStyle(l,n),v):null;return y?((h=c?.beforeAnimate)===null||h===void 0||h.call(c,y),y.finished.then(()=>{var m,B;(m=c?.afterAnimate)===null||m===void 0||m.call(c,y),(B=c?.after)===null||B===void 0||B.call(c),this.animations.delete(y)})):(d=c?.after)===null||d===void 0||d.call(c),y}).filter(Boolean);o.forEach(l=>this.animations.add(l));const A=Vp(o);return A?((a=t?.beforeAnimate)===null||a===void 0||a.call(t,A),A.finished.then(()=>{var l,c;(l=t?.afterAnimate)===null||l===void 0||l.call(t,A),(c=t?.after)===null||c===void 0||c.call(t),this.release()})):(s=t?.after)===null||s===void 0||s.call(t),A}inferStyle(e,t){var n,i;const{element:a,elementType:s,stage:o,originalStyle:A,updatedStyle:l={}}=e;e.modifiedStyle||(e.modifiedStyle=Object.assign(Object.assign({},A),l));const{modifiedStyle:c}=e,u={},h={};if(o==="enter")Object.assign(u,{opacity:0});else if(o==="exit")Object.assign(h,{opacity:0});else if(o==="show")Object.assign(u,{opacity:0}),Object.assign(h,{opacity:(n=PU(a,"opacity"))!==null&&n!==void 0?n:ll("opacity")});else if(o==="hide")Object.assign(u,{opacity:(i=PU(a,"opacity"))!==null&&i!==void 0?i:ll("opacity")}),Object.assign(h,{opacity:0});else if(o==="collapse"){const{collapse:d}=t||{},{target:f,descendants:g,position:p}=d;if(s==="node"){if(g.includes(a.id)){const[v,y,m]=p;Object.assign(h,{x:v,y,z:m})}}else if(s==="combo"){if(a.id===f||g.includes(a.id)){const[v,y]=p;Object.assign(h,{x:v,y,childrenNode:A.childrenNode})}}else s==="edge"&&Object.assign(h,{sourceNode:c.sourceNode,targetNode:c.targetNode})}else if(o==="expand"){const{expand:d}=t||{},{target:f,descendants:g,position:p}=d;if(s==="node"){if(a.id===f||g.includes(a.id)){const[v,y,m]=p;Object.assign(u,{x:v,y,z:m})}}else if(s==="combo"){if(a.id===f||g.includes(a.id)){const[v,y,m]=p;Object.assign(u,{x:v,y,z:m,childrenNode:c.childrenNode})}}else s==="edge"&&Object.assign(u,{sourceNode:c.sourceNode,targetNode:c.targetNode})}return[Object.keys(u).length>0?Object.assign({},A,u):A,Object.keys(h).length>0?Object.assign({},c,h):c]}stop(){this.animations.forEach(e=>e.cancel())}clear(){this.tasks=[]}release(){var e,t;const{canvas:n}=this.context,i=(t=(e=n.document)===null||e===void 0?void 0:e.timeline)===null||t===void 0?void 0:t.animationsWithPromises;i&&(n.document.timeline.animationsWithPromises=i.filter(a=>a.playState!=="finished"))}destroy(){this.stop(),this.animations.clear(),this.tasks=[]}}class Zae{constructor(e){this.batchCount=0,this.context=e}emit(e){const{graph:t}=this.context;t.emit(e.type,e)}startBatch(e=!0){this.batchCount++,this.batchCount===1&&this.emit(new xn(fe.BATCH_START,{initiate:e}))}endBatch(){this.batchCount--,this.batchCount===0&&this.emit(new xn(fe.BATCH_END))}get isBatching(){return this.batchCount>0}destroy(){this.context=null}}class Jae extends $p{constructor(e){super(e),this.currentTarget=null,this.currentTargetType=null,this.category="behavior",this.forwardCanvasEvents=t=>{const{target:n}=t,i=qae(n);if(!i)return;const{graph:a,canvas:s}=this.context,{type:o,element:A}=i;if("destroyed"in A&&(bl(A)||A.destroyed))return;const{type:l,detail:c,button:u}=t,h=Object.assign(Object.assign({},t),{target:A,targetType:o,originalTarget:n});l===ie.POINTER_MOVE&&(this.currentTarget!==A&&(this.currentTarget&&a.emit(`${this.currentTargetType}:${ie.POINTER_LEAVE}`,Object.assign(Object.assign({},h),{type:ie.POINTER_LEAVE,target:this.currentTarget,targetType:this.currentTargetType})),A&&(Object.assign(h,{type:ie.POINTER_ENTER}),a.emit(`${o}:${ie.POINTER_ENTER}`,h))),this.currentTarget=A,this.currentTargetType=o),l===ie.CLICK&&u===2||(a.emit(`${o}:${l}`,h),a.emit(l,h)),l===ie.CLICK&&c===2&&(Object.assign(h,{type:ie.DBLCLICK}),a.emit(`${o}:${ie.DBLCLICK}`,h),a.emit(ie.DBLCLICK,h)),l===ie.POINTER_DOWN&&u===2&&(Object.assign(h,{type:ie.CONTEXT_MENU,preventDefault:()=>{var d;(d=s.getContainer())===null||d===void 0||d.addEventListener(ie.CONTEXT_MENU,f=>f.preventDefault(),{once:!0})}}),a.emit(`${o}:${ie.CONTEXT_MENU}`,h),a.emit(ie.CONTEXT_MENU,h))},this.forwardContainerEvents=t=>{this.context.graph.emit(t.type,t)},this.forwardEvents(),this.setBehaviors(this.context.options.behaviors||[])}setBehaviors(e){this.setExtensions(e)}forwardEvents(){const e=this.context.canvas.getContainer();e&&[Ro.KEY_DOWN,Ro.KEY_UP].forEach(n=>{e.addEventListener(n,this.forwardContainerEvents)});const t=this.context.canvas.document;t&&[ie.CLICK,ie.DBLCLICK,ie.POINTER_OVER,ie.POINTER_LEAVE,ie.POINTER_ENTER,ie.POINTER_MOVE,ie.POINTER_OUT,ie.POINTER_DOWN,ie.POINTER_UP,ie.CONTEXT_MENU,ie.DRAG_START,ie.DRAG,ie.DRAG_END,ie.DRAG_ENTER,ie.DRAG_OVER,ie.DRAG_LEAVE,ie.DROP,ie.WHEEL].forEach(n=>{t.addEventListener(n,this.forwardCanvasEvents)})}destroy(){const e=this.context.canvas.getContainer();e&&[Ro.KEY_DOWN,Ro.KEY_UP].forEach(t=>{e.removeEventListener(t,this.forwardContainerEvents)}),this.context.canvas.document.removeAllEventListeners(),super.destroy()}}var ese=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};function xb(r){const{id:e=X(r),style:t,data:n}=r,i=ese(r,["id","style","data"]),a=Object.assign(Object.assign({},r),{style:Object.assign({},t),data:Object.assign({},n)});return SV(r)?Object.assign({id:e,data:a},i):{id:e,data:a}}function Pn(r){return r.data}function tse(r){if(r.hasTreeStructure(Dr))return;r.attachTreeStructure(Dr);const e=r.getAllEdges();for(const t of e){const{source:n,target:i}=t;r.setParent(i,n,Dr)}}class nse{constructor(){this.latestRemovedComboIds=new Set,this.comboIds=new Set,this.changes=[],this.batchCount=0,this.isTraceless=!1,this.enableUpdateNodeLikeHierarchy=!0,this.model=new Tn}pushChange(e){if(this.isTraceless)return;const{type:t}=e;if(t===Dt.NodeUpdated||t===Dt.EdgeUpdated||t===Dt.ComboUpdated){const{value:n,original:i}=e;this.changes.push({value:bv(n),original:bv(i),type:t})}else this.changes.push({value:bv(e.value),type:t})}getChanges(){return this.changes}clearChanges(){this.changes=[]}batch(e){this.batchCount++,this.model.batch(e),this.batchCount--}isBatching(){return this.batchCount>0}silence(e){this.isTraceless=!0,e(),this.isTraceless=!1}isCombo(e){return this.comboIds.has(e)||this.latestRemovedComboIds.has(e)}getData(){return{nodes:this.getNodeData(),edges:this.getEdgeData(),combos:this.getComboData()}}getNodeData(e){return this.model.getAllNodes().reduce((t,n)=>{const i=Pn(n);return this.isCombo(X(i))||(e===void 0||e.includes(X(i)))&&t.push(i),t},[])}getEdgeDatum(e){return Pn(this.model.getEdge(e))}getEdgeData(e){return this.model.getAllEdges().reduce((t,n)=>{const i=Pn(n);return(e===void 0||e.includes(X(i)))&&t.push(i),t},[])}getComboData(e){return this.model.getAllNodes().reduce((t,n)=>{const i=Pn(n);return this.isCombo(X(i))&&(e===void 0||e.includes(X(i)))&&t.push(i),t},[])}getRootsData(e=Dr){return this.model.getRoots(e).map(Pn)}getAncestorsData(e,t){const{model:n}=this;return!n.hasNode(e)||!n.hasTreeStructure(t)?[]:n.getAncestors(e,t).map(Pn)}getDescendantsData(e){const t=this.getElementDataById(e),n=[];return Ho(t,i=>{i!==t&&n.push(i)},i=>this.getChildrenData(X(i)),"TB"),n}getParentData(e,t){const{model:n}=this;if(!t){$i.warn("The hierarchy structure key is not specified");return}if(!n.hasNode(e)||!n.hasTreeStructure(t))return;const i=n.getParent(e,t);return i?Pn(i):void 0}getChildrenData(e){const t=this.getElementType(e)==="node"?Dr:Ft,{model:n}=this;return!n.hasNode(e)||!n.hasTreeStructure(t)?[]:n.getChildren(e,t).map(Pn)}getElementsDataByType(e){return e==="node"?this.getNodeData():e==="edge"?this.getEdgeData():e==="combo"?this.getComboData():[]}getElementDataById(e){return this.getElementType(e)==="edge"?this.getEdgeDatum(e):this.getNodeLikeDatum(e)}getNodeLikeDatum(e){const t=this.model.getNode(e);return Pn(t)}getNodeLikeData(e){return this.model.getAllNodes().reduce((t,n)=>{const i=Pn(n);return e?e.includes(X(i))&&t.push(i):t.push(i),t},[])}getElementDataByState(e,t){return this.getElementsDataByType(e).filter(i=>{var a;return(a=i.states)===null||a===void 0?void 0:a.includes(t)})}getElementState(e){var t;return((t=this.getElementDataById(e))===null||t===void 0?void 0:t.states)||[]}hasNode(e){return this.model.hasNode(e)&&!this.isCombo(e)}hasEdge(e){return this.model.hasEdge(e)}hasCombo(e){return this.model.hasNode(e)&&this.isCombo(e)}getRelatedEdgesData(e,t="both"){return this.model.getRelatedEdges(e,t).map(Pn)}getNeighborNodesData(e){return this.model.getNeighbors(e).map(Pn)}setData(e){const{nodes:t=[],edges:n=[],combos:i=[]}=e,{nodes:a,edges:s,combos:o}=this.getData(),A=Xa(a,t,u=>X(u),Vo),l=Xa(s,n,u=>X(u),Vo),c=Xa(o,i,u=>X(u),Vo);this.batch(()=>{const u={nodes:A.enter,edges:l.enter,combos:c.enter};this.addData(u),this.computeZIndex(u,"add",!0);const h={nodes:A.update,edges:l.update,combos:c.update};this.updateData(h),this.computeZIndex(h,"update",!0);const d={nodes:A.exit.map(X),edges:l.exit.map(X),combos:c.exit.map(X)};this.removeData(d)})}addData(e){const{nodes:t,edges:n,combos:i}=e;this.batch(()=>{this.addComboData(i),this.addNodeData(t),this.addEdgeData(n)}),this.computeZIndex(e,"add")}addNodeData(e=[]){e.length&&(this.model.addNodes(e.map(t=>(this.pushChange({value:t,type:Dt.NodeAdded}),xb(t)))),this.updateNodeLikeHierarchy(e),this.computeZIndex({nodes:e},"add"))}addEdgeData(e=[]){e.length&&(this.model.addEdges(e.map(t=>(this.pushChange({value:t,type:Dt.EdgeAdded}),xb(t)))),this.computeZIndex({edges:e},"add"))}addComboData(e=[]){if(!e.length)return;const{model:t}=this;t.hasTreeStructure(Ft)||t.attachTreeStructure(Ft),t.addNodes(e.map(n=>(this.comboIds.add(X(n)),this.pushChange({value:n,type:Dt.ComboAdded}),xb(n)))),this.updateNodeLikeHierarchy(e),this.computeZIndex({combos:e},"add")}addChildrenData(e,t){const n=this.getNodeLikeDatum(e),i=t.map(X);this.addNodeData(t),this.updateNodeData([{id:e,children:[...n.children||[],...i]}]),this.addEdgeData(i.map(a=>({source:e,target:a})))}computeZIndex(e,t,n=!1){!n&&this.isBatching()||this.batch(()=>{const{nodes:i=[],edges:a=[],combos:s=[]}=e;s.forEach(o=>{var A,l,c;const u=X(o);if(t==="add"&&Be((A=o.style)===null||A===void 0?void 0:A.zIndex)||t==="update"&&!("combo"in o))return;const h=this.getParentData(u,Ft),d=h?((c=(l=h.style)===null||l===void 0?void 0:l.zIndex)!==null&&c!==void 0?c:0)+1:0;this.preventUpdateNodeLikeHierarchy(()=>{this.updateComboData([{id:u,style:{zIndex:d}}])})}),i.forEach(o=>{var A,l,c;const u=X(o);if(t==="add"&&Be((A=o.style)===null||A===void 0?void 0:A.zIndex)||t==="update"&&!("combo"in o)&&!("children"in o))return;let h=0;const d=this.getParentData(u,Ft);if(d)h=(((l=d.style)===null||l===void 0?void 0:l.zIndex)||0)+1;else{const f=this.getParentData(u,Dr);f&&(h=((c=f?.style)===null||c===void 0?void 0:c.zIndex)||0)}this.preventUpdateNodeLikeHierarchy(()=>{this.updateNodeData([{id:u,style:{zIndex:h}}])})}),a.forEach(o=>{var A,l,c,u,h;if(Be((A=o.style)===null||A===void 0?void 0:A.zIndex))return;let{id:d,source:f,target:g}=o;if(!d)d=X(o);else{const y=this.getEdgeDatum(d);f=y.source,g=y.target}if(!f||!g)return;const p=((c=(l=this.getNodeLikeDatum(f))===null||l===void 0?void 0:l.style)===null||c===void 0?void 0:c.zIndex)||0,v=((h=(u=this.getNodeLikeDatum(g))===null||u===void 0?void 0:u.style)===null||h===void 0?void 0:h.zIndex)||0;this.updateEdgeData([{id:X(o),style:{zIndex:Math.max(p,v)-1}}])})})}getFrontZIndex(e){var t;const n=this.getElementType(e),i=this.getElementDataById(e),a=this.getData();if(Object.assign(a,{[`${n}s`]:a[`${n}s`].filter(s=>X(s)!==e)}),n==="combo"&&!Fr(i)){const s=new Set(this.getAncestorsData(e,Ft).map(X));a.nodes=a.nodes.filter(o=>!s.has(X(o))),a.combos=a.combos.filter(o=>!s.has(X(o))),a.edges=a.edges.filter(({source:o,target:A})=>!s.has(o)&&!s.has(A))}return Math.max(((t=i.style)===null||t===void 0?void 0:t.zIndex)||0,0,...Object.values(a).flat().map(s=>{var o;return(((o=s?.style)===null||o===void 0?void 0:o.zIndex)||0)+1}))}updateNodeLikeHierarchy(e){if(!this.enableUpdateNodeLikeHierarchy)return;const{model:t}=this;e.forEach(n=>{const i=X(n),a=nh(n);a!==void 0&&(t.hasTreeStructure(Ft)||t.attachTreeStructure(Ft),a===null&&this.refreshComboData(i),this.setParent(i,nh(n),Ft));const s=n.children||[];if(s.length){t.hasTreeStructure(Dr)||t.attachTreeStructure(Dr);const o=s.filter(A=>t.hasNode(A));o.forEach(A=>this.setParent(A,i,Dr)),o.length!==s.length&&this.updateNodeData([{id:i,children:o}])}})}preventUpdateNodeLikeHierarchy(e){this.enableUpdateNodeLikeHierarchy=!1,e(),this.enableUpdateNodeLikeHierarchy=!0}updateData(e){const{nodes:t,edges:n,combos:i}=e;this.batch(()=>{this.updateNodeData(t),this.updateComboData(i),this.updateEdgeData(n)}),this.computeZIndex(e,"update")}updateNodeData(e=[]){if(!e.length)return;const{model:t}=this;this.batch(()=>{const n=[];e.forEach(i=>{const a=X(i),s=Pn(t.getNode(a));if(Vo(s,i))return;const o=is(s,i);this.pushChange({value:o,original:s,type:Dt.NodeUpdated}),t.mergeNodeData(a,o),n.push(o)}),this.updateNodeLikeHierarchy(n)}),this.computeZIndex({nodes:e},"update")}refreshData(){const{nodes:e,edges:t,combos:n}=this.getData();e.forEach(i=>{this.pushChange({value:i,original:i,type:Dt.NodeUpdated})}),t.forEach(i=>{this.pushChange({value:i,original:i,type:Dt.EdgeUpdated})}),n.forEach(i=>{this.pushChange({value:i,original:i,type:Dt.ComboUpdated})})}syncNodeLikeDatum(e){const{model:t}=this,n=X(e);if(!t.hasNode(n))return;const i=Pn(t.getNode(n)),a=is(i,e);t.mergeNodeData(n,a)}syncEdgeDatum(e){const{model:t}=this,n=X(e);if(!t.hasEdge(n))return;const i=Pn(t.getEdge(n)),a=is(i,e);t.mergeEdgeData(n,a)}updateEdgeData(e=[]){if(!e.length)return;const{model:t}=this;this.batch(()=>{e.forEach(n=>{const i=X(n),a=Pn(t.getEdge(i));if(Vo(a,n))return;n.source&&a.source!==n.source&&t.updateEdgeSource(i,n.source),n.target&&a.target!==n.target&&t.updateEdgeTarget(i,n.target);const s=is(a,n);this.pushChange({value:s,original:a,type:Dt.EdgeUpdated}),t.mergeEdgeData(i,s)})}),this.computeZIndex({edges:e},"update")}updateComboData(e=[]){if(!e.length)return;const{model:t}=this;t.batch(()=>{const n=[];e.forEach(i=>{const a=X(i),s=Pn(t.getNode(a));if(Vo(s,i))return;const o=is(s,i);this.pushChange({value:o,original:s,type:Dt.ComboUpdated}),t.mergeNodeData(a,o),n.push(o)}),this.updateNodeLikeHierarchy(n)}),this.computeZIndex({combos:e},"update")}setParent(e,t,n,i=!0){if(e===t)return;const a=this.getNodeLikeDatum(e),s=nh(a);if(s!==t&&n===Ft){const o={id:e,combo:t};this.isCombo(e)?this.syncNodeLikeDatum(o):this.syncNodeLikeDatum(o)}this.model.setParent(e,t,n),i&&n===Ft&&pR([s,t]).forEach(o=>{o!==void 0&&this.refreshComboData(o)})}refreshComboData(e){const t=this.getComboData([e])[0],n=this.getAncestorsData(e,Ft);t&&this.pushChange({value:t,original:t,type:Dt.ComboUpdated}),n.forEach(i=>{this.pushChange({value:i,original:i,type:Dt.ComboUpdated})})}getElementPosition(e){const t=this.getElementDataById(e);return Fn(t)}translateNodeLikeBy(e,t){this.isCombo(e)?this.translateComboBy(e,t):this.translateNodeBy(e,t)}translateNodeLikeTo(e,t){this.isCombo(e)?this.translateComboTo(e,t):this.translateNodeTo(e,t)}translateNodeBy(e,t){const n=this.getElementPosition(e),i=Ve(n,[...t,0].slice(0,3));this.translateNodeTo(e,i)}translateNodeTo(e,t){const[n=0,i=0,a=0]=t;this.preventUpdateNodeLikeHierarchy(()=>{this.updateNodeData([{id:e,style:{x:n,y:i,z:a}}])})}translateComboBy(e,t){const[n=0,i=0,a=0]=t;if([n,i,a].some(isNaN)||[n,i,a].every(A=>A===0))return;const s=this.getComboData([e])[0];if(!s)return;const o=new Set;Ho(s,A=>{const l=X(A);if(o.has(l))return;o.add(l);const[c,u,h]=Fn(A),d=is(A,{style:{x:c+n,y:u+i,z:h+a}});this.pushChange({value:d,original:A,type:this.isCombo(l)?Dt.ComboUpdated:Dt.NodeUpdated}),this.model.mergeNodeData(l,d)},A=>this.getChildrenData(X(A)),"BT")}translateComboTo(e,t){var n;if(t.some(isNaN))return;const[i=0,a=0,s=0]=t,o=(n=this.getComboData([e]))===null||n===void 0?void 0:n[0];if(!o)return;const[A,l,c]=Fn(o),u=i-A,h=a-l,d=s-c;Ho(o,f=>{const g=X(f),[p,v,y]=Fn(f),m=is(f,{style:{x:p+u,y:v+h,z:y+d}});this.pushChange({value:m,original:f,type:this.isCombo(g)?Dt.ComboUpdated:Dt.NodeUpdated}),this.model.mergeNodeData(g,m)},f=>this.getChildrenData(X(f)),"BT")}removeData(e){const{nodes:t,edges:n,combos:i}=e;this.batch(()=>{this.removeEdgeData(n),this.removeNodeData(t),this.removeComboData(i),this.latestRemovedComboIds=new Set(i)})}removeNodeData(e=[]){e.length&&this.batch(()=>{e.forEach(t=>{this.removeEdgeData(this.getRelatedEdgesData(t).map(X)),this.pushChange({value:this.getNodeData([t])[0],type:Dt.NodeRemoved}),this.removeNodeLikeHierarchy(t)}),this.model.removeNodes(e)})}removeEdgeData(e=[]){e.length&&(e.forEach(t=>this.pushChange({value:this.getEdgeData([t])[0],type:Dt.EdgeRemoved})),this.model.removeEdges(e))}removeComboData(e=[]){e.length&&this.batch(()=>{e.forEach(t=>{this.pushChange({value:this.getComboData([t])[0],type:Dt.ComboRemoved}),this.removeNodeLikeHierarchy(t),this.comboIds.delete(t)}),this.model.removeNodes(e)})}removeNodeLikeHierarchy(e){if(this.model.hasTreeStructure(Ft)){const t=nh(this.getNodeLikeDatum(e));this.setParent(e,void 0,Ft,!1),this.model.getChildren(e,Ft).forEach(n=>{const i=Pn(n),a=X(i);this.setParent(X(i),t,Ft,!1);const s=is(i,{id:X(i),combo:t});this.pushChange({value:s,original:i,type:this.isCombo(a)?Dt.ComboUpdated:Dt.NodeUpdated}),this.model.mergeNodeData(X(i),s)}),ke(t)||this.refreshComboData(t)}}getElementType(e){if(this.model.hasNode(e))return this.isCombo(e)?"combo":"node";if(this.model.hasEdge(e))return"edge";throw new Error(da(`Unknown element type of id: ${e}`))}destroy(){const{model:e}=this,t=e.getAllNodes(),n=e.getAllEdges();e.removeEdges(n.map(i=>i.id)),e.removeNodes(t.map(i=>i.id)),this.context={}}}var dA=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{l(n.next(c))}catch(u){s(u)}}function A(c){try{l(n.throw(c))}catch(u){s(u)}}function l(c){c.done?a(c.value):i(c.value).then(o,A)}l((n=n.apply(r,e||[])).next())})};class rse{constructor(e){this.elementMap={},this.shapeTypeMap={},this.paletteStyle={},this.defaultStyle={},this.stateStyle={},this.visibilityCache=new WeakMap,this.context=e}init(){this.initContainer()}initContainer(){if(!this.container||this.container.destroyed){const{canvas:e}=this.context;this.container=e.appendChild(new Cn({className:"elements"}))}}emit(e,t){t.silence||On(this.context.graph,e)}forEachElementData(e){zs.forEach(t=>{const n=this.context.model.getElementsDataByType(t);e(t,n)})}getElementType(e,t){var n;const{options:i,graph:a}=this.context,s=_F(t)&&((n=i[e])===null||n===void 0?void 0:n.type)||t.type;return s?typeof s=="string"?s:s.call(a,t):e==="edge"?"line":"circle"}getTheme(e){return dS(this.context.options)[e]||{}}getThemeStyle(e){return this.getTheme(e).style||{}}getThemeStateStyle(e,t){const{state:n={}}=this.getTheme(e);return Object.assign({},...t.map(i=>n[i]||{}))}computePaletteStyle(){const{options:e}=this.context;this.paletteStyle={},this.forEachElementData((t,n)=>{var i,a;const s=Object.assign({},zS((i=this.getTheme(t))===null||i===void 0?void 0:i.palette),zS((a=e[t])===null||a===void 0?void 0:a.palette));s?.field&&Object.assign(this.paletteStyle,wj(n,s))})}getPaletteStyle(e,t){const n=this.paletteStyle[t];return n?e==="edge"?{stroke:n}:{fill:n}:{}}computeElementDefaultStyle(e,t){var n;const{options:i}=this.context,a=((n=i[e])===null||n===void 0?void 0:n.style)||{};"transform"in a&&Array.isArray(a.transform)&&(a.transform=[...a.transform]),this.defaultStyle[X(t.datum)]=KS(a,t)}computeElementsDefaultStyle(e){const{graph:t}=this.context;this.forEachElementData((n,i)=>{const a=i.length;for(let s=0;s<a;s++){const o=i[s];(e===void 0||e.includes(X(o)))&&this.computeElementDefaultStyle(n,{datum:o,graph:t})}})}getDefaultStyle(e){return this.defaultStyle[e]||{}}getElementState(e){try{const{model:t}=this.context;return t.getElementState(e)}catch{return[]}}getElementStateStyle(e,t,n){var i,a;const{options:s}=this.context,o=((a=(i=s[e])===null||i===void 0?void 0:i.state)===null||a===void 0?void 0:a[t])||{};return KS(o,n)}computeElementStatesStyle(e,t,n){this.stateStyle[X(n.datum)]=Object.assign({},...t.map(i=>this.getElementStateStyle(e,i,n)))}computeElementsStatesStyle(e){const{graph:t}=this.context;this.forEachElementData((n,i)=>{const a=i.length;for(let s=0;s<a;s++){const o=i[s];if(e===void 0||e.includes(X(o))){const A=this.getElementState(X(o));this.computeElementStatesStyle(n,A,{datum:o,graph:t})}}})}getStateStyle(e){return this.stateStyle[e]||{}}computeStyle(e,t){e&&["translate","zIndex"].includes(e)||(this.computePaletteStyle(),this.computeElementsDefaultStyle(t),this.computeElementsStatesStyle(t))}getElement(e){return this.elementMap[e]}getNodes(){return this.context.model.getNodeData().map(({id:e})=>this.elementMap[e])}getEdges(){return this.context.model.getEdgeData().map(e=>this.elementMap[X(e)])}getCombos(){return this.context.model.getComboData().map(({id:e})=>this.elementMap[e])}getElementComputedStyle(e,t){const n=X(t),i=this.getThemeStyle(e),a=this.getPaletteStyle(e,n),s=t.style||{},o=this.getDefaultStyle(n),A=this.getThemeStateStyle(e,this.getElementState(n)),l=this.getStateStyle(n),c=_F(t)?Object.assign({},i,a,s,o,A,l):Object.assign({},s);if(e==="combo"){const u=this.context.model.getChildrenData(n),d=!!c.collapsed?[]:u.map(X).filter(f=>this.getElement(f));Object.assign(c,{childrenNode:d,childrenData:u})}return c}getDrawData(e){this.init();const t=this.computeChangesAndDrawData(e);if(!t)return null;const{type:n="draw",stage:i=n}=e;return this.markDestroyElement(t.drawData),this.computeStyle(i),{type:n,stage:i,data:t}}draw(e={animation:!0}){const t=this.getDrawData(e);if(!t)return;const{data:{drawData:{add:n,update:i,remove:a}}}=t;return this.destroyElements(a,e),this.createElements(n,e),this.updateElements(i,e),this.setAnimationTask(e,t)}preLayoutDraw(){return dA(this,arguments,void 0,function*(e={animation:!0}){var t,n;const i=this.getDrawData(e);if(!i)return;const{data:{drawData:a}}=i;yield(n=(t=this.context.layout)===null||t===void 0?void 0:t.preLayout)===null||n===void 0?void 0:n.call(t,a);const{add:s,update:o,remove:A}=a;return this.destroyElements(A,e),this.createElements(s,e),this.updateElements(o,e),this.setAnimationTask(e,i)})}setAnimationTask(e,t){const{animation:n,silence:i}=e,{data:{dataChanges:a,drawData:s},stage:o,type:A}=t;return this.context.animation.animate(n,i?{}:{before:()=>this.emit(new xn(fe.BEFORE_DRAW,{dataChanges:a,animation:n,stage:o,render:A==="render"}),e),beforeAnimate:l=>this.emit(new ci(fe.BEFORE_ANIMATE,Sr.DRAW,l,s),e),afterAnimate:l=>this.emit(new ci(fe.AFTER_ANIMATE,Sr.DRAW,l,s),e),after:()=>this.emit(new xn(fe.AFTER_DRAW,{dataChanges:a,animation:n,stage:o,render:A==="render",firstRender:this.context.graph.rendered===!1}),e)})}computeChangesAndDrawData(e){const{model:t}=this.context,n=t.getChanges(),i=QB(n);if(i.length===0)return null;const{NodeAdded:a=[],NodeUpdated:s=[],NodeRemoved:o=[],EdgeAdded:A=[],EdgeUpdated:l=[],EdgeRemoved:c=[],ComboAdded:u=[],ComboUpdated:h=[],ComboRemoved:d=[]}=fc(i,C=>C.type),f=(C,S)=>{const F=[];return C.forEach(T=>{const O=X(T.value);this.getElement(O)?F.push(T):S.push(T)}),F},g=f(s,a),p=f(l,A),v=f(h,u),y=C=>new Map(C.map(S=>{const F=S.value;return[X(F),F]})),m={add:{nodes:y(a),edges:y(A),combos:y(u)},update:{nodes:y(g),edges:y(p),combos:y(v)},remove:{nodes:y(o),edges:y(c),combos:y(d)}},B=this.transformData(m,e);return t.clearChanges(),{dataChanges:n,drawData:B}}transformData(e,t){const n=this.context.transform.getTransformInstance();return Object.values(n).reduce((i,a)=>a.beforeDraw(i,t),e)}createElement(e,t,n){var i;const a=X(t);if(this.getElement(a))return;const o=this.getElementType(e,t),A=this.getElementComputedStyle(e,t),l=ha(e,o);if(!l)return $i.warn(`The element ${o} of ${e} is not registered.`);this.emit(new hA(fe.BEFORE_ELEMENT_CREATE,e,t),n);const c=this.container.appendChild(new l({id:a,context:this.context,style:A}));this.shapeTypeMap[a]=o,this.elementMap[a]=c;const{stage:u="enter"}=n;(i=this.context.animation)===null||i===void 0||i.add({element:c,elementType:e,stage:u,originalStyle:Object.assign({},c.attributes),updatedStyle:A},{after:()=>{var h;this.emit(new hA(fe.AFTER_ELEMENT_CREATE,e,t),n),(h=c.onCreate)===null||h===void 0||h.call(c)}})}createElements(e,t){const{nodes:n,edges:i,combos:a}=e;[["node",n],["combo",a],["edge",i]].forEach(([o,A])=>{A.forEach(l=>this.createElement(o,l,t))})}getUpdateStageStyle(e,t,n){const{stage:i="update"}=n;if(i==="translate")if(e==="node"||e==="combo"){const{style:{x:a=0,y:s=0,z:o=0}={}}=t;return{x:a,y:s,z:o}}else return{};return this.getElementComputedStyle(e,t)}updateElement(e,t,n){var i;const a=X(t),{stage:s="update"}=n,o=this.getElement(a);if(!o)return()=>null;this.emit(new hA(fe.BEFORE_ELEMENT_UPDATE,e,t),n);const A=this.getElementType(e,t),l=this.getUpdateStageStyle(e,t,n);this.shapeTypeMap[a]!==A&&(o.destroy(),delete this.shapeTypeMap[a],delete this.elementMap[a],this.createElement(e,t,{animation:!1,silence:!0}));const c=s!=="visibility"?s:l.visibility==="hidden"?"hide":"show";c==="hide"&&delete l.visibility,(i=this.context.animation)===null||i===void 0||i.add({element:o,elementType:e,stage:c,originalStyle:Object.assign({},o.attributes),updatedStyle:l},{before:()=>{const u=this.elementMap[a];s!=="collapse"&&Bv(u,l),s==="visibility"&&(Yae(u,"opacity")||$ae(u,"opacity"),this.visibilityCache.set(u,c==="show"?"visible":"hidden"),c==="show"&&Gs(u,"visible"))},after:()=>{var u;const h=this.elementMap[a];s==="collapse"&&Bv(h,l),c==="hide"&&Gs(h,this.visibilityCache.get(h)),this.emit(new hA(fe.AFTER_ELEMENT_UPDATE,e,t),n),(u=h.onUpdate)===null||u===void 0||u.call(h)}})}updateElements(e,t){const{nodes:n,edges:i,combos:a}=e;[["node",n],["combo",a],["edge",i]].forEach(([o,A])=>{A.forEach(l=>this.updateElement(o,l,t))})}markDestroyElement(e){Object.values(e.remove).forEach(t=>{t.forEach(n=>{const i=X(n),a=this.getElement(i);a&&oW(a)})})}destroyElement(e,t,n){var i;const{stage:a="exit"}=n,s=X(t),o=this.elementMap[s];if(!o)return()=>null;this.emit(new hA(fe.BEFORE_ELEMENT_DESTROY,e,t),n),(i=this.context.animation)===null||i===void 0||i.add({element:o,elementType:e,stage:a,originalStyle:Object.assign({},o.attributes),updatedStyle:{}},{after:()=>{var A;this.clearElement(s),o.destroy(),(A=o.onDestroy)===null||A===void 0||A.call(o),this.emit(new hA(fe.AFTER_ELEMENT_DESTROY,e,t),n)}})}destroyElements(e,t){const{nodes:n,edges:i,combos:a}=e;[["combo",a],["edge",i],["node",n]].forEach(([o,A])=>{A.forEach(l=>this.destroyElement(o,l,t))})}clearElement(e){delete this.paletteStyle[e],delete this.defaultStyle[e],delete this.stateStyle[e],delete this.elementMap[e],delete this.shapeTypeMap[e]}alignLayoutResultToElement(e,t){var n,i;const a=(n=e.nodes)===null||n===void 0?void 0:n.find(s=>X(s)===t);if(a){const s=Fn(this.context.model.getNodeLikeDatum(t)),o=Fn(a),A=bt(s,o);(i=e.nodes)===null||i===void 0||i.forEach(l=>{var c,u,h;!((c=l.style)===null||c===void 0)&&c.x&&(l.style.x+=A[0]),!((u=l.style)===null||u===void 0)&&u.y&&(l.style.y+=A[1]),!((h=l.style)===null||h===void 0)&&h.z&&(l.style.z+=A[2]||0)})}}syncLayoutResult(e,t){return dA(this,void 0,void 0,function*(){const{layout:n,model:i}=this.context;if(!n)return;const a=this.context.options.layout,s=A=>Array.isArray(A)?A.map(l=>Object.assign(Object.assign({},l),{preLayout:!0})):Object.assign(Object.assign({},A),{preLayout:!0}),o=yield n.simulate(a?s(a):void 0);t&&this.alignLayoutResultToElement(o,e),i.updateData(o)})}collapseNode(e,t){return dA(this,void 0,void 0,function*(){var n;const{animation:i,align:a}=t;yield this.syncLayoutResult(e,a);const s=this.computeChangesAndDrawData({stage:"collapse",animation:i});if(!s)return;const{drawData:o}=s,{add:A,remove:l,update:c}=o;this.markDestroyElement(o);const u={animation:i,stage:"collapse",data:o};this.destroyElements(l,u),this.createElements(A,u),this.updateElements(c,u),yield(n=this.context.animation.animate(i,{beforeAnimate:h=>this.emit(new ci(fe.BEFORE_ANIMATE,Sr.COLLAPSE,h,o),u),afterAnimate:h=>this.emit(new ci(fe.AFTER_ANIMATE,Sr.COLLAPSE,h,o),u)},{collapse:{target:e,descendants:Array.from(l.nodes).map(([,h])=>X(h)),position:Fn(c.nodes.get(e))}}))===null||n===void 0?void 0:n.finished})}expandNode(e,t){return dA(this,void 0,void 0,function*(){var n;const{model:i}=this.context,{animation:a,align:s}=t,o=Fn(i.getNodeData([e])[0]);yield this.syncLayoutResult(e,s);const A=this.computeChangesAndDrawData({stage:"expand",animation:a});if(this.createElements(A.drawData.add,{animation:!1,stage:"expand",target:e}),this.context.animation.clear(),this.computeStyle("expand"),!A)return;const{drawData:l}=A,{update:c,add:u}=l,h={animation:a,stage:"expand",data:l};u.edges.forEach(d=>c.edges.set(X(d),d)),u.nodes.forEach(d=>c.nodes.set(X(d),d)),this.updateElements(c,h),yield(n=this.context.animation.animate(a,{beforeAnimate:d=>this.emit(new ci(fe.BEFORE_ANIMATE,Sr.EXPAND,d,l),h),afterAnimate:d=>this.emit(new ci(fe.AFTER_ANIMATE,Sr.EXPAND,d,l),h)},{expand:{target:e,descendants:Array.from(u.nodes).map(([,d])=>X(d)),position:o}}))===null||n===void 0?void 0:n.finished})}collapseCombo(e,t){return dA(this,void 0,void 0,function*(){var n;const{model:i,element:a}=this.context;if(i.getAncestorsData(e,Ft).some(g=>Fr(g)))return;const s=a.getElement(e),o=s.getComboPosition(Object.assign(Object.assign({},s.attributes),{collapsed:!0})),A=this.computeChangesAndDrawData({stage:"collapse",animation:t});if(!A)return;const{dataChanges:l,drawData:c}=A;this.markDestroyElement(c);const{update:u,remove:h}=c,d={animation:t,stage:"collapse",data:c};this.destroyElements(h,d),this.updateElements(u,d);const f=g=>Array.from(g).map(([,p])=>X(p));yield(n=this.context.animation.animate(t,{before:()=>this.emit(new xn(fe.BEFORE_DRAW,{dataChanges:l,animation:t}),d),beforeAnimate:g=>this.emit(new ci(fe.BEFORE_ANIMATE,Sr.COLLAPSE,g,c),d),afterAnimate:g=>this.emit(new ci(fe.AFTER_ANIMATE,Sr.COLLAPSE,g,c),d),after:()=>this.emit(new xn(fe.AFTER_DRAW,{dataChanges:l,animation:t}),d)},{collapse:{target:e,descendants:[...f(h.nodes),...f(h.combos)],position:o}}))===null||n===void 0?void 0:n.finished})}expandCombo(e,t){return dA(this,void 0,void 0,function*(){var n;const{model:i}=this.context,a=Fn(i.getComboData([e])[0]);this.computeStyle("expand");const s=this.computeChangesAndDrawData({stage:"expand",animation:t});if(!s)return;const{dataChanges:o,drawData:A}=s,{add:l,update:c}=A,u={animation:t,stage:"expand",data:A,target:e};this.createElements(l,u),this.updateElements(c,u);const h=d=>Array.from(d).map(([,f])=>X(f));yield(n=this.context.animation.animate(t,{before:()=>this.emit(new xn(fe.BEFORE_DRAW,{dataChanges:o,animation:t}),u),beforeAnimate:d=>this.emit(new ci(fe.BEFORE_ANIMATE,Sr.EXPAND,d,A),u),afterAnimate:d=>this.emit(new ci(fe.AFTER_ANIMATE,Sr.EXPAND,d,A),u),after:()=>this.emit(new xn(fe.AFTER_DRAW,{dataChanges:o,animation:t}),u)},{expand:{target:e,descendants:[...h(l.nodes),...h(l.combos)],position:a}}))===null||n===void 0?void 0:n.finished})}clear(){this.container.destroy(),this.initContainer(),this.elementMap={},this.shapeTypeMap={},this.defaultStyle={},this.stateStyle={},this.paletteStyle={}}destroy(){this.clear(),this.container.destroy(),this.context={}}}var fA=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{l(n.next(c))}catch(u){s(u)}}function A(c){try{l(n.throw(c))}catch(u){s(u)}}function l(c){c.done?a(c.value):i(c.value).then(o,A)}l((n=n.apply(r,e||[])).next())})},ise=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};class ase{get presetOptions(){return{animation:!!fS(this.context.options,!0)}}get options(){const{options:e}=this.context;return e.layout}constructor(e){this.instances=[],this.context=e}getLayoutInstance(){return this.instances}preLayout(e){return fA(this,void 0,void 0,function*(){var t,n,i,a;const{graph:s,model:o}=this.context,{add:A}=e;On(s,new xn(fe.BEFORE_LAYOUT,{type:"pre"}));const l=yield(t=this.context.layout)===null||t===void 0?void 0:t.simulate();(n=l?.nodes)===null||n===void 0||n.forEach(c=>{const u=X(c),h=A.nodes.get(u);o.syncNodeLikeDatum(c),h&&Object.assign(h.style,c.style)}),(i=l?.edges)===null||i===void 0||i.forEach(c=>{const u=X(c),h=A.edges.get(u);o.syncEdgeDatum(c),h&&Object.assign(h.style,c.style)}),(a=l?.combos)===null||a===void 0||a.forEach(c=>{const u=X(c),h=A.combos.get(u);o.syncNodeLikeDatum(c),h&&Object.assign(h.style,c.style)}),On(s,new xn(fe.AFTER_LAYOUT,{type:"pre"})),this.transformDataAfterLayout("pre",e)})}postLayout(){return fA(this,arguments,void 0,function*(e=this.options){if(!e)return;const t=Array.isArray(e)?e:[e],{graph:n}=this.context;On(n,new xn(fe.BEFORE_LAYOUT,{type:"post"}));for(let i=0;i<t.length;i++){const a=t[i],s=this.getLayoutData(a),o=Object.assign(Object.assign({},this.presetOptions),a);On(n,new xn(fe.BEFORE_STAGE_LAYOUT,{options:o,index:i}));const A=yield this.stepLayout(s,o,i);On(n,new xn(fe.AFTER_STAGE_LAYOUT,{options:o,index:i})),a.animation||this.updateElementPosition(A,!1)}On(n,new xn(fe.AFTER_LAYOUT,{type:"post"})),this.transformDataAfterLayout("post")})}transformDataAfterLayout(e,t){const n=this.context.transform.getTransformInstance();Object.values(n).forEach(i=>i.afterLayout(e,t))}simulate(){return fA(this,arguments,void 0,function*(e=this.options){if(!e)return{};const t=Array.isArray(e)?e:[e];let n={};for(let i=0;i<t.length;i++){const a=t[i],s=this.getLayoutData(a);n=yield this.stepLayout(s,Object.assign(Object.assign(Object.assign({},this.presetOptions),a),{animation:!1}),i)}return n})}stepLayout(e,t,n){return fA(this,void 0,void 0,function*(){return fW(t)?yield this.treeLayout(e,t,n):yield this.graphLayout(e,t,n)})}graphLayout(e,t,n){return fA(this,void 0,void 0,function*(){const{animation:i,enableWorker:a,iterations:s=300}=t,o=this.initGraphLayout(t);if(!o)return{};if(this.instances[n]=o,this.instance=o,a){const l=o;return this.supervisor=new gee(l.graphData2LayoutModel(e),l.instance,{iterations:s}),Rh(yield this.supervisor.execute())}if(Kv(o))return i?yield o.execute(e,{onTick:l=>{this.updateElementPosition(l,!1)}}):(o.execute(e),o.stop(),o.tick(s));const A=yield o.execute(e);if(i){const l=this.updateElementPosition(A,i);yield l?.finished}return A})}treeLayout(e,t,n){return fA(this,void 0,void 0,function*(){const{type:i,animation:a}=t,s=ha("layout",i);if(!s)return{};const{nodes:o=[],edges:A=[]}=e,l=new Tn({nodes:o.map(f=>({id:X(f),data:f.data||{}})),edges:A.map(f=>({id:X(f),source:f.source,target:f.target,data:f.data||{}}))});tse(l);const c={nodes:[],edges:[]},u={nodes:[],edges:[]};l.getRoots(Dr).forEach(f=>{Ho(f,m=>{m.children=l.getSuccessors(m.id)},m=>l.getSuccessors(m.id),"TB");const g=s(f,t),{x:p,y:v,z:y=0}=g;Ho(g,m=>{const{id:B,x:C,y:S,z:F=0}=m;c.nodes.push({id:B,style:{x:p,y:v,z:y}}),u.nodes.push({id:B,style:{x:C,y:S,z:F}})},m=>m.children,"TB")});const d=this.inferTreeLayoutOffset(u);if(RU(u,d),a){RU(c,d),this.updateElementPosition(c,!1);const f=this.updateElementPosition(u,a);yield f?.finished}return u})}inferTreeLayoutOffset(e){var t;let[n,i]=[1/0,-1/0],[a,s]=[1/0,-1/0];(t=e.nodes)===null||t===void 0||t.forEach(g=>{const{x:p=0,y:v=0}=g.style||{};n=Math.min(n,p),i=Math.max(i,p),a=Math.min(a,v),s=Math.max(s,v)});const{canvas:o}=this.context,A=o.getSize(),[l,c]=o.getCanvasByViewport([0,0]),[u,h]=o.getCanvasByViewport(A);if(n>=l&&i<=u&&a>=c&&s<=h)return[0,0];const d=(l+u)/2,f=(c+h)/2;return[d-(n+i)/2,f-(a+s)/2]}stopLayout(){this.instance&&Kv(this.instance)&&(this.instance.stop(),this.instance=void 0),this.supervisor&&(this.supervisor.stop(),this.supervisor=void 0),this.animationResult&&(this.animationResult.finish(),this.animationResult=void 0)}getLayoutData(e){const{nodeFilter:t=()=>!0,comboFilter:n=()=>!0,preLayout:i=!1,isLayoutInvisibleNodes:a=!1}=e,{nodes:s,edges:o,combos:A}=this.context.model.getData(),{element:l,model:c}=this.context,u=v=>l.getElement(v),h=i?v=>{var y;return!a&&(((y=v.style)===null||y===void 0?void 0:y.visibility)==="hidden"||c.getAncestorsData(v.id,Dr).some(Fr)||c.getAncestorsData(v.id,Ft).some(Fr))?!1:t(v)}:v=>{const y=X(v),m=u(y);return!m||bl(m)?!1:t(v)},d=s.filter(h),f=A.filter(n),g=new Map(d.map(v=>[X(v),v]));f.forEach(v=>g.set(X(v),v));const p=o.filter(({source:v,target:y})=>g.has(v)&&g.has(y));return{nodes:d,edges:p,combos:f}}initGraphLayout(e){var t;const{element:n,viewport:i}=this.context,{type:a,enableWorker:s,animation:o,iterations:A}=e,l=ise(e,["type","enableWorker","animation","iterations"]),[c,u]=i.getCanvasSize(),h=[c/2,u/2],d=(t=e?.nodeSize)!==null&&t!==void 0?t:(y=>{const m=n?.getElement(y.id);return m?m.attributes.size:n?.getElementComputedStyle("node",y).size}),f=ha("layout",a);if(!f)return $i.warn(`The layout of ${a} is not registered.`);const g=Object.getPrototypeOf(f.prototype)===Ph.prototype?f:pW(f,this.context),p=new g(this.context),v={nodeSize:d,width:c,height:u,center:h};switch(p.id){case"d3-force":case"d3-force-3d":Object.assign(v,{center:{x:c/2,y:u/2,z:0}});break}return Rn(p.options,v,l),p}updateElementPosition(e,t){const{model:n,element:i}=this.context;return i?(n.updateData(e),i.draw({animation:t,silence:!0})):null}destroy(){var e;this.stopLayout(),this.context={},(e=this.supervisor)===null||e===void 0||e.kill(),this.supervisor=void 0,this.instance=void 0,this.instances=[],this.animationResult=void 0}}const RU=(r,e)=>{var t;const[n,i]=e;(t=r.nodes)===null||t===void 0||t.forEach(a=>{if(a.style){const{x:s=0,y:o=0}=a.style;a.style.x=s+n,a.style.y=o+i}else a.style={x:n,y:i}})};function sse(r){return[ose].reduce((t,n)=>n(t),r)}function ose(r){return!r.layout||Array.isArray(r.layout)||"preLayout"in r.layout||["antv-dagre","combo-combined","compact-box","circular","concentric","dagre","fishbone","grid","indented","mds","radial","random","snake","dendrogram","mindmap"].includes(r.layout.type)&&(r.layout.preLayout=!0),r}class Ase extends $p{constructor(e){super(e),this.category="plugin",this.setPlugins(this.context.options.plugins||[])}setPlugins(e){this.setExtensions(e)}getPluginInstance(e){const t=this.extensionMap[e];if(t)return t;$i.warn(`Cannot find the plugin ${e}, will try to find it by type.`);const n=this.extensions.find(i=>i.type===e);if(n)return this.extensionMap[n.key]}}const Bf=["update-related-edges","collapse-expand-node","collapse-expand-combo","get-edge-actual-ends","arrange-draw-order"];class lse extends $p{constructor(e){super(e),this.category="transform",this.setTransforms(this.context.options.transforms||[])}getTransforms(){}setTransforms(e){this.setExtensions([...Bf.slice(0,Bf.length-1),...e,Bf[Bf.length-1]])}getTransformInstance(e){return e?this.extensionMap[e]:this.extensionMap}}var Jl=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{l(n.next(c))}catch(u){s(u)}}function A(c){try{l(n.throw(c))}catch(u){s(u)}}function l(c){c.done?a(c.value):i(c.value).then(o,A)}l((n=n.apply(r,e||[])).next())})};class cse{get padding(){return si(this.context.options.padding)}get paddingOffset(){const[e,t,n,i]=this.padding,[a,s,o]=[(i-t)/2,(e-n)/2,0];return[a,s,o]}constructor(e){this.landmarkCounter=0,this.context=e;const[t,n]=this.paddingOffset,{zoom:i,rotation:a,x:s=t,y:o=n}=e.options;this.transform({mode:"absolute",scale:i,translate:[s,o],rotate:a},!1)}get camera(){const{canvas:e}=this.context;return new Proxy(e.getCamera(),{get:(t,n)=>{const a=Object.entries(e.getLayers()).filter(([o])=>!["main"].includes(o)).map(([,o])=>o.getCamera()),s=t[n];if(typeof s=="function")return(...o)=>{const A=s.apply(t,o);return a.forEach(l=>{l[n].apply(l,o)}),A}}})}createLandmark(e){return this.camera.createLandmark(`landmark-${this.landmarkCounter++}`,e)}getAnimation(e){const t=fS(this.context.options,e);return t?ms(Object.assign({},t),["easing","duration"]):!1}getCanvasSize(){const{canvas:e}=this.context,{width:t=0,height:n=0}=e.getConfig();return[t,n]}getCanvasCenter(){const{canvas:e}=this.context,{width:t=0,height:n=0}=e.getConfig();return[t/2,n/2,0]}getViewportCenter(){const[e,t]=this.camera.getPosition();return[e,t,0]}getGraphCenter(){return this.context.graph.getViewportByCanvas(this.getCanvasCenter())}getZoom(){return this.camera.getZoom()}getRotation(){return this.camera.getRoll()}getTranslateOptions(e){const{camera:t}=this,{mode:n,translate:i=[]}=e,a=this.getZoom(),s=t.getPosition(),o=t.getFocalPoint(),[A,l]=this.getCanvasCenter(),[c=0,u=0,h=0]=i,d=bi([-c,-u,-h],a);return n==="relative"?{position:Ve(s,d),focalPoint:Ve(o,d)}:{position:Ve([A,l,s[2]],d),focalPoint:Ve([A,l,o[2]],d)}}getRotateOptions(e){const{mode:t,rotate:n=0}=e;return{roll:t==="relative"?this.camera.getRoll()+n:n}}getZoomOptions(e){const{zoomRange:t}=this.context.options,n=this.camera.getZoom(),{mode:i,scale:a=1}=e;return Yt(i==="relative"?n*a:a,...t)}transform(e,t){return Jl(this,void 0,void 0,function*(){const{graph:n}=this.context,{translate:i,rotate:a,scale:s,origin:o}=e;this.cancelAnimation();const A=this.getAnimation(t);if(On(n,new wf(fe.BEFORE_TRANSFORM,e)),!a&&s&&!i&&o&&!A){this.camera.setZoomByViewportPoint(this.getZoomOptions(e),o),On(n,new wf(fe.AFTER_TRANSFORM,e));return}const l={};if(i&&Object.assign(l,this.getTranslateOptions(e)),Be(a)&&Object.assign(l,this.getRotateOptions(e)),Be(s)&&Object.assign(l,{zoom:this.getZoomOptions(e)}),A)return On(n,new ci(fe.BEFORE_ANIMATE,Sr.TRANSFORM,null,e)),new Promise(c=>{this.transformResolver=c,this.camera.gotoLandmark(this.createLandmark(l),Object.assign(Object.assign({},A),{onfinish:()=>{On(n,new ci(fe.AFTER_ANIMATE,Sr.TRANSFORM,null,e)),On(n,new wf(fe.AFTER_TRANSFORM,e)),this.transformResolver=void 0,c()}}))});this.camera.gotoLandmark(this.createLandmark(l),{duration:0}),On(n,new wf(fe.AFTER_TRANSFORM,e))})}fitView(e,t){return Jl(this,void 0,void 0,function*(){const[n,i,a,s]=this.padding,{when:o="always",direction:A="both"}=e||{},[l,c]=this.context.canvas.getSize(),u=l-s-i,h=c-n-a,d=this.context.canvas.getBounds(),f=this.getBBoxInViewport(d),[g,p]=qa(f),v=A==="x"&&g>=u||A==="y"&&p>=h||A==="both"&&g>=u&&p>=h;if(o==="overflow"&&!v)return yield this.fitCenter({animation:t});const y=u/g,m=h/p,B=A==="x"?y:A==="y"?m:Math.min(y,m),C=this.getAnimation(t);Number.isFinite(B)&&(yield this.transform({mode:"relative",scale:B,translate:Ve(bt(this.getCanvasCenter(),this.getBBoxInViewport(d).center),bi(this.paddingOffset,B))},C))})}fitCenter(e){return Jl(this,void 0,void 0,function*(){const t=this.context.canvas.getBounds();yield this.focus(t,e)})}focusElements(e){return Jl(this,arguments,void 0,function*(t,n={}){const{element:i}=this.context;if(!i)return;const a=o=>n.shapes?o.getShape(n.shapes).getRenderBounds():o.getRenderBounds(),s=cl(t.map(o=>a(i.getElement(o))));yield this.focus(s,n)})}focus(e,t){return Jl(this,void 0,void 0,function*(){const n=this.context.graph.getViewportByCanvas(e.center),i=t.position||this.getCanvasCenter(),a=bt(i,n);yield this.transform({mode:"relative",translate:Ve(a,this.paddingOffset)},t.animation)})}getBBoxInViewport(e){const{min:t,max:n}=e,{graph:i}=this.context,[a,s]=i.getViewportByCanvas(t),[o,A]=i.getViewportByCanvas(n),l=new kt;return l.setMinMax([a,s,0],[o,A,0]),l}isInViewport(e,t=!1,n=0){const{graph:i}=this.context,a=this.getCanvasSize(),[s,o]=i.getCanvasByViewport([0,0]),[A,l]=i.getCanvasByViewport(a);let c=new kt;return c.setMinMax([s,o,0],[A,l,0]),n&&(c=Ya(c,n)),Do(e)?wi(e,c):t?MV(e,c):c.intersects(e)}cancelAnimation(){var e,t;!((e=this.camera.landmarks)===null||e===void 0)&&e.length&&this.camera.cancelLandmarkAnimation(),(t=this.transformResolver)===null||t===void 0||t.call(this)}}var Ot=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(s){s(a)})}return new(t||(t=Promise))(function(a,s){function o(c){try{l(n.next(c))}catch(u){s(u)}}function A(c){try{l(n.throw(c))}catch(u){s(u)}}function l(c){c.done?a(c.value):i(c.value).then(o,A)}l((n=n.apply(r,e||[])).next())})};class bf extends Qh{constructor(e){var t;super(),this.options={},this.rendered=!1,this.destroyed=!1,this.context={model:new nse},this.isCollapsingExpanding=!1,this.onResize=wA(()=>{this.resize()},300),this._setOptions(Object.assign({},bf.defaultOptions,e),!0),this.context.graph=this,this.options.autoResize&&((t=globalThis.addEventListener)===null||t===void 0||t.call(globalThis,"resize",this.onResize))}getOptions(){return this.options}setOptions(e){this._setOptions(e,!1)}_setOptions(e,t){if(this.updateCanvas(e),Object.assign(this.options,sse(e)),t){const{data:h}=e;h&&this.addData(h);return}const{behaviors:n,combo:i,data:a,edge:s,layout:o,node:A,plugins:l,theme:c,transforms:u}=e;n&&this.setBehaviors(n),a&&this.setData(a),A&&this.setNode(A),s&&this.setEdge(s),i&&this.setCombo(i),o&&this.setLayout(o),c&&this.setTheme(c),l&&this.setPlugins(l),u&&this.setTransforms(u)}getSize(){return this.context.canvas?this.context.canvas.getSize():[this.options.width||0,this.options.height||0]}setSize(e,t){e&&(this.options.width=e),t&&(this.options.height=t),this.resize(e,t)}setZoomRange(e){this.options.zoomRange=e}getZoomRange(){return this.options.zoomRange}setNode(e){this.options.node=e,this.context.model.refreshData()}setEdge(e){this.options.edge=e,this.context.model.refreshData()}setCombo(e){this.options.combo=e,this.context.model.refreshData()}getTheme(){return this.options.theme}setTheme(e){this.options.theme=Te(e)?e(this.getTheme()):e}setLayout(e){this.options.layout=Te(e)?e(this.getLayout()):e}getLayout(){return this.options.layout}setBehaviors(e){var t;this.options.behaviors=Te(e)?e(this.getBehaviors()):e,(t=this.context.behavior)===null||t===void 0||t.setBehaviors(this.options.behaviors)}updateBehavior(e){this.setBehaviors(t=>t.map(n=>typeof n=="object"&&n.key===e.key?Object.assign(Object.assign({},n),e):n))}getBehaviors(){return this.options.behaviors||[]}setPlugins(e){var t;this.options.plugins=Te(e)?e(this.getPlugins()):e,(t=this.context.plugin)===null||t===void 0||t.setPlugins(this.options.plugins)}updatePlugin(e){this.setPlugins(t=>t.map(n=>typeof n=="object"&&n.key===e.key?Object.assign(Object.assign({},n),e):n))}getPlugins(){return this.options.plugins||[]}getPluginInstance(e){return this.context.plugin.getPluginInstance(e)}setTransforms(e){var t;this.options.transforms=Te(e)?e(this.getTransforms()):e,(t=this.context.transform)===null||t===void 0||t.setTransforms(this.options.transforms)}updateTransform(e){this.setTransforms(t=>t.map(n=>typeof n=="object"&&n.key===e.key?Object.assign(Object.assign({},n),e):n)),this.context.model.refreshData()}getTransforms(){return this.options.transforms||[]}getData(){return this.context.model.getData()}hasNode(e){return this.context.model.hasNode(e)}hasEdge(e){return this.context.model.hasEdge(e)}hasCombo(e){return this.context.model.hasCombo(e)}getElementData(e){return Array.isArray(e)?e.map(t=>this.context.model.getElementDataById(t)):this.context.model.getElementDataById(e)}getNodeData(e){return e===void 0?this.context.model.getNodeData():Array.isArray(e)?this.context.model.getNodeData(e):this.context.model.getNodeLikeDatum(e)}getEdgeData(e){return e===void 0?this.context.model.getEdgeData():Array.isArray(e)?this.context.model.getEdgeData(e):this.context.model.getEdgeDatum(e)}getComboData(e){return e===void 0?this.context.model.getComboData():Array.isArray(e)?this.context.model.getComboData(e):this.context.model.getNodeLikeDatum(e)}setData(e){this.context.model.setData(Te(e)?e(this.getData()):e)}addData(e){this.context.model.addData(Te(e)?e(this.getData()):e)}addNodeData(e){this.context.model.addNodeData(Te(e)?e(this.getNodeData()):e)}addEdgeData(e){this.context.model.addEdgeData(Te(e)?e(this.getEdgeData()):e)}addComboData(e){this.context.model.addComboData(Te(e)?e(this.getComboData()):e)}addChildrenData(e,t){this.context.model.addChildrenData(e,t)}updateData(e){this.context.model.updateData(Te(e)?e(this.getData()):e)}updateNodeData(e){this.context.model.updateNodeData(Te(e)?e(this.getNodeData()):e)}updateEdgeData(e){this.context.model.updateEdgeData(Te(e)?e(this.getEdgeData()):e)}updateComboData(e){this.context.model.updateComboData(Te(e)?e(this.getComboData()):e)}removeData(e){this.context.model.removeData(Te(e)?e(this.getData()):e)}removeNodeData(e){this.context.model.removeNodeData(Te(e)?e(this.getNodeData()):e)}removeEdgeData(e){this.context.model.removeEdgeData(Te(e)?e(this.getEdgeData()):e)}removeComboData(e){this.context.model.removeComboData(Te(e)?e(this.getComboData()):e)}getElementType(e){return this.context.model.getElementType(e)}getRelatedEdgesData(e,t="both"){return this.context.model.getRelatedEdgesData(e,t)}getNeighborNodesData(e){return this.context.model.getNeighborNodesData(e)}getAncestorsData(e,t){return this.context.model.getAncestorsData(e,t)}getParentData(e,t){return this.context.model.getParentData(e,t)}getChildrenData(e){return this.context.model.getChildrenData(e)}getDescendantsData(e){return this.context.model.getDescendantsData(e)}getElementDataByState(e,t){return this.context.model.getElementDataByState(e,t)}initCanvas(){return Ot(this,void 0,void 0,function*(){var e;if(this.context.canvas)return yield this.context.canvas.ready;const{container:t="container",width:n,height:i,renderer:a,cursor:s,background:o,canvas:A,devicePixelRatio:l=(e=globalThis.devicePixelRatio)!==null&&e!==void 0?e:1}=this.options;if(t instanceof kU)this.context.canvas=t,s&&t.setCursor(s),a&&t.setRenderer(a),yield t.ready;else{const c=ot(t)?document.getElementById(t):t,u=QU(c);this.emit(fe.BEFORE_CANVAS_INIT,{container:c,width:n,height:i});const h=Object.assign(Object.assign({},A),{container:c,width:n||u[0],height:i||u[1],background:o,renderer:a,cursor:s,devicePixelRatio:l}),d=new kU(h);this.context.canvas=d,yield d.ready,this.emit(fe.AFTER_CANVAS_INIT,{canvas:d})}})}updateCanvas(e){var t,n;const{renderer:i,cursor:a,height:s,width:o}=e,A=this.context.canvas;A&&(i&&(this.emit(fe.BEFORE_RENDERER_CHANGE,{renderer:this.options.renderer}),A.setRenderer(i),this.emit(fe.AFTER_RENDERER_CHANGE,{renderer:i})),a&&A.setCursor(a),(Be(o)||Be(s))&&this.setSize((t=o??this.options.width)!==null&&t!==void 0?t:0,(n=s??this.options.height)!==null&&n!==void 0?n:0))}initRuntime(){this.context.options=this.options,this.context.batch||(this.context.batch=new Zae(this.context)),this.context.plugin||(this.context.plugin=new Ase(this.context)),this.context.viewport||(this.context.viewport=new cse(this.context)),this.context.transform||(this.context.transform=new lse(this.context)),this.context.element||(this.context.element=new rse(this.context)),this.context.animation||(this.context.animation=new Xae(this.context)),this.context.layout||(this.context.layout=new ase(this.context)),this.context.behavior||(this.context.behavior=new Jae(this.context))}prepare(){return Ot(this,void 0,void 0,function*(){if(yield Promise.resolve(),this.destroyed){console.error(da("The graph instance has been destroyed"));return}yield this.initCanvas(),this.initRuntime()})}render(){return Ot(this,void 0,void 0,function*(){if(yield this.prepare(),On(this,new xn(fe.BEFORE_RENDER)),this.options.layout)if(!this.rendered&&gW(this.options.layout)){const e=yield this.context.element.preLayoutDraw({type:"render"});yield Promise.all([e?.finished,this.autoFit()])}else{const e=this.context.element.draw({type:"render"});yield Promise.all([e?.finished,this.context.layout.postLayout()]),yield this.autoFit()}else{const e=this.context.element.draw({type:"render"});yield Promise.all([e?.finished,this.autoFit()])}this.rendered=!0,On(this,new xn(fe.AFTER_RENDER))})}draw(){return Ot(this,void 0,void 0,function*(){var e;yield this.prepare(),yield(e=this.context.element.draw())===null||e===void 0?void 0:e.finished})}layout(e){return Ot(this,void 0,void 0,function*(){yield this.context.layout.postLayout(e)})}stopLayout(){this.context.layout.stopLayout()}clear(){return Ot(this,void 0,void 0,function*(){const{model:e,element:t}=this.context;e.setData({}),e.clearChanges(),t?.clear()})}destroy(){var e;On(this,new xn(fe.BEFORE_DESTROY));const{layout:t,animation:n,element:i,model:a,canvas:s,behavior:o,plugin:A}=this.context;A?.destroy(),o?.destroy(),t?.destroy(),n?.destroy(),i?.destroy(),a.destroy(),s?.destroy(),this.options={},this.context={},this.off(),(e=globalThis.removeEventListener)===null||e===void 0||e.call(globalThis,"resize",this.onResize),this.destroyed=!0,On(this,new xn(fe.AFTER_DESTROY))}getCanvas(){return this.context.canvas}resize(e,t){var n;const i=QU((n=this.context.canvas)===null||n===void 0?void 0:n.getContainer()),a=[e||i[0],t||i[1]];if(!this.context.canvas)return;const s=this.context.canvas.getSize();Xt(a,s)||(On(this,new xn(fe.BEFORE_SIZE_CHANGE,{size:a})),this.context.canvas.resize(...a),On(this,new xn(fe.AFTER_SIZE_CHANGE,{size:a})))}fitView(e,t){return Ot(this,void 0,void 0,function*(){var n;yield(n=this.context.viewport)===null||n===void 0?void 0:n.fitView(e,t)})}fitCenter(e){return Ot(this,void 0,void 0,function*(){var t;yield(t=this.context.viewport)===null||t===void 0?void 0:t.fitCenter({animation:e})})}autoFit(){return Ot(this,void 0,void 0,function*(){const{autoFit:e}=this.context.options;if(e)if(ot(e))e==="view"?yield this.fitView():e==="center"&&(yield this.fitCenter());else{const{type:t,animation:n}=e;t==="view"?yield this.fitView(e.options,n):t==="center"&&(yield this.fitCenter(n))}})}focusElement(e,t){return Ot(this,void 0,void 0,function*(){var n;yield(n=this.context.viewport)===null||n===void 0?void 0:n.focusElements(Array.isArray(e)?e:[e],{animation:t})})}zoomBy(e,t,n){return Ot(this,void 0,void 0,function*(){yield this.context.viewport.transform({mode:"relative",scale:e,origin:n},t)})}zoomTo(e,t,n){return Ot(this,void 0,void 0,function*(){yield this.context.viewport.transform({mode:"absolute",scale:e,origin:n},t)})}getZoom(){return this.context.viewport.getZoom()}rotateBy(e,t,n){return Ot(this,void 0,void 0,function*(){yield this.context.viewport.transform({mode:"relative",rotate:e,origin:n},t)})}rotateTo(e,t,n){return Ot(this,void 0,void 0,function*(){yield this.context.viewport.transform({mode:"absolute",rotate:e,origin:n},t)})}getRotation(){return this.context.viewport.getRotation()}translateBy(e,t){return Ot(this,void 0,void 0,function*(){yield this.context.viewport.transform({mode:"relative",translate:e},t)})}translateTo(e,t){return Ot(this,void 0,void 0,function*(){yield this.context.viewport.transform({mode:"absolute",translate:e},t)})}getPosition(){return bt([0,0],this.getCanvasByViewport([0,0]))}translateElementBy(e,t){return Ot(this,arguments,void 0,function*(n,i,a=!0){var s,o;const[A,l]=on(n)?[n,(s=i)!==null&&s!==void 0?s:!0]:[{[n]:i},a];Object.entries(A).forEach(([c,u])=>this.context.model.translateNodeLikeBy(c,u)),yield(o=this.context.element.draw({animation:l,stage:"translate"}))===null||o===void 0?void 0:o.finished})}translateElementTo(e,t){return Ot(this,arguments,void 0,function*(n,i,a=!0){var s,o;const[A,l]=on(n)?[n,(s=i)!==null&&s!==void 0?s:!0]:[{[n]:i},a];Object.entries(A).forEach(([c,u])=>this.context.model.translateNodeLikeTo(c,u)),yield(o=this.context.element.draw({animation:l,stage:"translate"}))===null||o===void 0?void 0:o.finished})}getElementPosition(e){return this.context.model.getElementPosition(e)}getElementRenderStyle(e){return Yf(this.context.element.getElement(e).attributes,["context"])}setElementVisibility(e,t){return Ot(this,arguments,void 0,function*(n,i,a=!0){var s,o;const[A,l]=on(n)?[n,(s=i)!==null&&s!==void 0?s:!0]:[{[n]:i},a],c={nodes:[],edges:[],combos:[]};Object.entries(A).forEach(([d,f])=>{const g=this.getElementType(d);c[`${g}s`].push({id:d,style:{visibility:f}})});const{model:u,element:h}=this.context;u.preventUpdateNodeLikeHierarchy(()=>{u.updateData(c)}),yield(o=h.draw({animation:l,stage:"visibility"}))===null||o===void 0?void 0:o.finished})}showElement(e,t){return Ot(this,void 0,void 0,function*(){const n=Array.isArray(e)?e:[e];yield this.setElementVisibility(Object.fromEntries(n.map(i=>[i,"visible"])),t)})}hideElement(e,t){return Ot(this,void 0,void 0,function*(){const n=Array.isArray(e)?e:[e];yield this.setElementVisibility(Object.fromEntries(n.map(i=>[i,"hidden"])),t)})}getElementVisibility(e){var t,n;const i=this.context.element.getElement(e);return(n=(t=i?.style)===null||t===void 0?void 0:t.visibility)!==null&&n!==void 0?n:"visible"}setElementZIndex(e,t){return Ot(this,void 0,void 0,function*(){var n;const i={nodes:[],edges:[],combos:[]},a=on(e)?e:{[e]:t};Object.entries(a).forEach(([A,l])=>{const c=this.getElementType(A);i[`${c}s`].push({id:A,style:{zIndex:l}})});const{model:s,element:o}=this.context;s.preventUpdateNodeLikeHierarchy(()=>s.updateData(i)),yield(n=o.draw({animation:!1,stage:"zIndex"}))===null||n===void 0?void 0:n.finished})}frontElement(e){return Ot(this,void 0,void 0,function*(){const t=Array.isArray(e)?e:[e],{model:n}=this.context,i={};t.map(a=>{const s=n.getFrontZIndex(a);if(n.getElementType(a)==="combo"){const A=n.getAncestorsData(a,Ft).at(-1)||this.getComboData(a),l=[A,...n.getDescendantsData(X(A))],c=s-UU(A);l.forEach(h=>{i[X(h)]=this.getElementZIndex(X(h))+c});const{internal:u}=pv(l.map(X),h=>n.getRelatedEdgesData(h));u.forEach(h=>{const d=X(h);i[d]=this.getElementZIndex(d)+c})}else i[a]=s}),yield this.setElementZIndex(i)})}getElementZIndex(e){return UU(this.context.model.getElementDataById(e))}setElementState(e,t){return Ot(this,arguments,void 0,function*(n,i,a=!0){var s,o;const[A,l]=on(n)?[n,(s=i)!==null&&s!==void 0?s:!0]:[{[n]:i},a],c=h=>h?Array.isArray(h)?h:[h]:[],u={nodes:[],edges:[],combos:[]};Object.entries(A).forEach(([h,d])=>{const f=this.getElementType(h);u[`${f}s`].push({id:h,states:c(d)})}),this.updateData(u),yield(o=this.context.element.draw({animation:l,stage:"state"}))===null||o===void 0?void 0:o.finished})}getElementState(e){return this.context.model.getElementState(e)}getElementRenderBounds(e){return this.context.element.getElement(e).getRenderBounds()}collapseElement(e){return Ot(this,arguments,void 0,function*(t,n=!0){const{model:i,element:a}=this.context;if(Fr(i.getNodeLikeData([t])[0])||this.isCollapsingExpanding)return;typeof n=="boolean"&&(n={animation:n,align:!1});const s=i.getElementType(t);yield this.frontElement(t),this.isCollapsingExpanding=!0,i.updateData(s==="node"?{nodes:[{id:t,style:{collapsed:!0}}]}:{combos:[{id:t,style:{collapsed:!0}}]}),s==="node"?yield a.collapseNode(t,n):s==="combo"&&(yield a.collapseCombo(t,!!n.animation)),this.isCollapsingExpanding=!1})}expandElement(e){return Ot(this,arguments,void 0,function*(t,n=!0){const{model:i,element:a}=this.context;if(!Fr(i.getNodeLikeData([t])[0])||this.isCollapsingExpanding)return;typeof n=="boolean"&&(n={animation:n,align:!1});const s=i.getElementType(t);this.isCollapsingExpanding=!0,i.updateData(s==="node"?{nodes:[{id:t,style:{collapsed:!1}}]}:{combos:[{id:t,style:{collapsed:!1}}]}),s==="node"?yield a.expandNode(t,n):s==="combo"&&(yield a.expandCombo(t,!!n.animation)),this.isCollapsingExpanding=!1})}setElementCollapsibility(e,t){const n=this.getElementType(e);n==="node"?this.updateNodeData([{id:e,style:{collapsed:t}}]):n==="combo"&&this.updateComboData([{id:e,style:{collapsed:t}}])}toDataURL(){return Ot(this,arguments,void 0,function*(e={}){return this.context.canvas.toDataURL(e)})}getCanvasByViewport(e){return this.context.canvas.getCanvasByViewport(e)}getViewportByCanvas(e){return this.context.canvas.getViewportByCanvas(e)}getClientByCanvas(e){return this.context.canvas.getClientByCanvas(e)}getCanvasByClient(e){return this.context.canvas.getCanvasByClient(e)}getViewportCenter(){return this.context.viewport.getViewportCenter()}getCanvasCenter(){return this.context.viewport.getCanvasCenter()}on(e,t,n){return super.on(e,t,n)}once(e,t){return super.once(e,t)}off(e,t){return super.off(e,t)}}bf.defaultOptions={autoResize:!1,theme:"light",rotation:0,zoom:1,zoomRange:[.01,10]};class use extends fs{beforeDraw(e){const{add:t,update:n}=e,{model:i}=this.context;return[...t.edges.entries(),...n.edges.entries()].forEach(([,a])=>{DU(i,a)}),e}}const DU=(r,e)=>{const{source:t,target:n}=e,i=r.getElementDataById(t),a=r.getElementDataById(n),s=yF(i,u=>r.getParentData(u,Ft)),o=yF(a,u=>r.getParentData(u,Ft)),A=X(s),l=X(o),c={sourceNode:A,targetNode:l};return e.style?Object.assign(e.style,c):e.style=c,e},hse=(r,e,t)=>{const[n,i]=e,[a,s]=t;if(i===n)return a;const o=(r-n)/(i-n);return a+o*(s-a)},dse=(r,e,t)=>{const[n,i]=e,[a,s]=t,o=Math.log(r-n+1)/Math.log(i-n+1);return a+o*(s-a)},fse=(r,e,t,n=2)=>{const[i,a]=e,[s,o]=t,A=Math.pow((r-i)/(a-i),n);return s+A*(o-s)},gse=(r,e,t)=>{const[n,i]=e,[a,s]=t,o=Math.sqrt((r-n)/(i-n));return a+o*(s-a)};class Ef extends fs{constructor(e,t){super(e,Rn({},Ef.defaultOptions,t)),this.assignSizeByCentrality=(n,i,a,s,o,A)=>{const l=[i,a],c=[s[0],o[0]],u=[s[1],o[1]],h=[s[2],o[2]],d=(f,g)=>{if(typeof A=="function")return A(f,l,g);switch(A){case"linear":return hse(f,l,g);case"log":return dse(f,l,g);case"pow":return fse(f,l,g,2);case"sqrt":return gse(f,l,g);default:return g[0]}};return[d(n,c),d(n,u),d(n,h)]}}beforeDraw(e){const{model:t}=this.context,n=t.getNodeData(),i=Gr(this.options.maxSize),a=Gr(this.options.minSize),s=this.getCentralities(this.options.centrality),o=s.size>0?Math.max(...s.values()):0,A=s.size>0?Math.min(...s.values()):0;return n.forEach(l=>{var c;const u=this.assignSizeByCentrality(s.get(X(l))||0,A,o,a,i,this.options.scale),h=(c=this.context.element)===null||c===void 0?void 0:c.getElement(X(l)),d={size:u};this.assignLabelStyle(d,u,l,h),(!h||!yf(d,h.attributes))&&Vr(e,h?"update":"add","node",Rn(l,{style:d}),!0)}),e}assignLabelStyle(e,t,n,i){var a;const s=i?i.config.style:(a=this.context.element)===null||a===void 0?void 0:a.getElementComputedStyle("node",n);if(Object.assign(e,ms(s,["labelFontSize","labelLineHeight"])),this.options.mapLabelSize){const o=this.getLabelSizeByNodeSize(t,1/0,Number(e.labelFontSize));Object.assign(e,{labelFontSize:o,labelLineHeight:o+TV(e.labelPadding)})}return e}getLabelSizeByNodeSize(e,t,n){const i=Math.min(...e)/2,[a,s]=Array.isArray(this.options.mapLabelSize)?this.options.mapLabelSize:[n,t];return Math.min(s,Math.max(i,a))}getCentralities(e){const{model:t}=this.context,n=t.getData();if(typeof e=="function")return e(n);const i=t.getRelatedEdgesData.bind(t);return FS(n,i,e)}}Ef.defaultOptions={centrality:{type:"degree"},maxSize:80,minSize:20,scale:"linear",mapLabelSize:!1};class xf extends fs{constructor(e,t){super(e,Object.assign({},xf.defaultOptions,t))}get ref(){return this.context.model.getRootsData()[0]}afterLayout(){var e;const t=Fn(this.ref),{graph:n,model:i}=this.context;(e=i.getData().nodes)===null||e===void 0||e.forEach(s=>{var o;if(X(s)===X(this.ref))return;const A=OS(bt(Fn(s),t)),l=Math.abs(A)>Math.PI/2,c=!s.children||s.children.length===0,u=X(s),h=(o=this.context.element)===null||o===void 0?void 0:o.getElement(u);if(!h||!h.isVisible())return;const d=Gr(n.getElementRenderStyle(u).size)[0]/2,f=(c?1:-1)*(d+this.options.offset),g=[["translate",f*Math.cos(A),f*Math.sin(A)],["rotate",l?Br(A)+180:Br(A)]];i.updateNodeData([{id:X(s),style:{labelTextAlign:l===c?"right":"left",labelTextBaseline:"middle",labelTransform:g}}])}),n.draw()}}xf.defaultOptions={offset:5};const pse="quadratic",HU=["top","top-right","right","right-bottom","bottom","bottom-left","left","left-top"];class Cf extends fs{constructor(e,t){super(e,Object.assign({},Cf.defaultOptions,t)),this.cacheMergeStyle=new Map,this.getAffectedParallelEdges=n=>{const{add:{edges:i},update:{nodes:a,edges:s,combos:o},remove:{edges:A}}=n,{model:l}=this.context,c=new Map,u=(f,g)=>{l.getRelatedEdgesData(g).forEach(v=>!c.has(X(v))&&c.set(X(v),v))};a.forEach(u),o.forEach(u);const h=f=>{const g=new Set(n.remove.edges.keys()),p=l.getEdgeData().filter(v=>!g.has(X(v))).map(v=>DU(l,v));vse(f,p).forEach(v=>{const y=X(v);c.has(y)||c.set(y,v)})};if(A.size&&A.forEach(h),i.size&&i.forEach(h),s.size){const f=jL(QB(l.getChanges())).update.edges;s.forEach(g=>{var p;h(g);const v=(p=f.find(y=>X(y.value)===X(g)))===null||p===void 0?void 0:p.original;v&&!Cb(g,v)&&h(v)})}Ui(this.options.edges)||c.forEach((f,g)=>!this.options.edges.includes(g)&&c.delete(g));const d=l.getEdgeData().map(X);return new Map([...c].sort((f,g)=>d.indexOf(f[0])-d.indexOf(g[0])))},this.applyBundlingStyle=(n,i,a)=>{const{edgeMap:s,reverses:o}=GU(i);s.forEach(A=>{A.forEach((l,c,u)=>{var h;const d=u.length,f=l.style||{};if(l.source===l.target){const v=HU.length;f.loopPlacement=HU[c%v],f.loopDist=Math.floor(c/v)*a+50}else if(d===1)f.curveOffset=0;else{const v=(c%2===0?1:-1)*(o[`${l.source}|${l.target}|${c}`]?-1:1);f.curveOffset=d%2===1?v*Math.ceil(c/2)*a*2:v*(Math.floor(c/2)*a*2+a)}const g=Object.assign(l,{type:pse,style:f}),p=(h=this.context.element)===null||h===void 0?void 0:h.getElement(X(l));(!p||!yf(g.style,p.attributes))&&Vr(n,p?"update":"add","edge",g,!0)})})},this.resetEdgeStyle=n=>{const i=n.style||{},a=this.cacheMergeStyle.get(X(n))||{};return Object.keys(a).forEach(s=>{Xt(i[s],a[s])&&(n[s]?i[s]=n[s]:delete i[s])}),Object.assign(n,{style:i})},this.applyMergingStyle=(n,i)=>{const{edgeMap:a,reverses:s}=GU(i);a.forEach(o=>{var A;if(o.length===1){const c=o[0],u=(A=this.context.element)===null||A===void 0?void 0:A.getElement(X(c)),h=this.resetEdgeStyle(c);(!u||!yf(h,u.attributes))&&Vr(n,u?"update":"add","edge",h);return}const l=o.map(({source:c,target:u,style:h={}},d)=>{const{startArrow:f,endArrow:g}=h,p={},[v,y]=s[`${c}|${u}|${d}`]?["endArrow","startArrow"]:["startArrow","endArrow"];return mA(f)&&(p[v]=f),mA(g)&&(p[y]=g),p}).reduce((c,u)=>Object.assign(Object.assign({},c),u),{});o.forEach((c,u,h)=>{var d;if(u!==0){Vr(n,"remove","edge",c);return}const f=Object.assign({},Te(this.options.style)?this.options.style(h):this.options.style,{childrenData:h});this.cacheMergeStyle.set(X(c),f);const g=Object.assign(Object.assign({},c),{type:"line",style:Object.assign(Object.assign(Object.assign({},c.style),l),f)}),p=(d=this.context.element)===null||d===void 0?void 0:d.getElement(X(c));(!p||!yf(g.style,p.attributes))&&Vr(n,p?"update":"add","edge",g,!0)})})}}beforeDraw(e){const t=this.getAffectedParallelEdges(e);return t.size===0||(this.options.mode==="bundle"?this.applyBundlingStyle(e,t,this.options.distance):this.applyMergingStyle(e,t)),e}}Cf.defaultOptions={mode:"bundle",distance:15};const GU=r=>{const e=new Map,t=new Set,n={},i=new Map;for(const[a,s]of r){if(t.has(a))continue;const{source:o,target:A}=s,l=`${o}-${A}`;e.has(l)||(e.set(l,[]),i.set(l,new Set));const c=e.get(l),u=i.get(l);c&&u&&!u.has(a)&&(c.push(s),u.add(a),t.add(a));for(const[h,d]of r)if(!(t.has(h)||h===a)&&Cb(s,d)){const f=e.get(l),g=i.get(l);f&&g&&!g.has(h)&&(f.push(d),g.add(h),o===d.target&&A===d.source&&(n[`${d.source}|${d.target}|${f.length-1}`]=!0),t.add(h))}}return{edgeMap:e,reverses:n}},vse=(r,e,t)=>e.filter(n=>Cb(n,r)),Cb=(r,e)=>{const{sourceNode:t,targetNode:n}=r.style||{},{sourceNode:i,targetNode:a}=e.style||{};return t===i&&n===a||t===a&&n===i};class yse extends fs{beforeDraw(e,t){const{stage:n}=t;if(n==="visibility")return e;const{model:i}=this.context,{update:{nodes:a,edges:s,combos:o}}=e,A=(l,c)=>{i.getRelatedEdgesData(c).forEach(h=>!s.has(X(h))&&s.set(X(h),h))};return a.forEach(A),o.forEach(A),e}}const mse={animation:{"combo-collapse":yS,"combo-expand":CV,"node-collapse":pS,"node-expand":EV,"path-in":vS,"path-out":xV,fade:BV,translate:bV},behavior:{"brush-select":fl,"click-select":lh,"collapse-expand":Ih,"create-edge":Nh,"drag-canvas":Lh,"drag-element-force":yW,"drag-element":xl,"fix-element-size":Dh,"focus-element":Hh,"hover-activate":Gh,"lasso-select":wW,"auto-adapt-label":rh,"optimize-viewport-transform":Kh,"scroll-canvas":zh,"zoom-canvas":Vh},combo:{circle:E9,rect:x9},edge:{cubic:js,line:wF,polyline:Mh,quadratic:Oh,"cubic-horizontal":Sh,"cubic-radial":Fh,"cubic-vertical":Th},layout:{"antv-dagre":U$,"combo-combined":j7,"compact-box":MW,"d3-force":yY,"force-atlas2":QJ,circular:D$,concentric:Pv,dagre:md,dendrogram:LW,fishbone:Fd,force:kT,fruchterman:RJ,grid:HJ,indented:RW,mds:RT,mindmap:zW,radial:YJ,random:ree,snake:Td},node:{circle:vl,diamond:Ij,ellipse:gh,hexagon:Qj,html:bh,image:AF,rect:B9,star:b9,donut:dh,triangle:Eh},palette:{spectral:mee,tableau:wee,oranges:Bee,greens:bee,blues:Eee},theme:{dark:Rae,light:Dae},plugin:{"bubble-sets":Pd,"edge-bundling":Dd,"edge-filter-lens":Hd,"grid-line":zd,background:Md,contextmenu:Rd,fisheye:Gd,fullscreen:Kd,history:Vd,hull:$d,legend:uf,minimap:hf,snapline:df,timebar:ff,title:Fae,toolbar:gf,tooltip:pf,watermark:vf},transform:{"arrange-draw-order":Hae,"collapse-expand-combo":Gae,"collapse-expand-node":Kae,"get-edge-actual-ends":use,"map-node-size":Ef,"place-radial-labels":xf,"process-parallel-edges":Cf,"update-related-edges":yse},shape:{circle:zi,ellipse:UA,group:Cn,html:Os,image:av,line:Is,path:tr,polygon:_s,polyline:Gc,rect:Gn,text:ks,label:Ji,badge:Go}};function wse(){Object.entries(mse).forEach(([r,e])=>{Object.entries(e).forEach(([t,n])=>{zae(r,t,n)})})}wse();const gs={canal:"#1890ff",pumpStation:"#52c41a",reservoir:"#13c2c2",sluice:"#faad14",dispatchUnit:"#722ed1",dispatchNode:"#eb2f96",auxiliary:"#8c8c8c"},xa={canal:{fill:"#e6f7ff",stroke:"#1890ff",lineWidth:2,radius:4,width:200,height:40},pumpStation:{fill:"#f6ffed",stroke:"#52c41a",lineWidth:2,width:48,height:48,img:""},reservoir:{fill:"#e6fffb",stroke:"#13c2c2",lineWidth:2,radius:24,width:48,height:48},sluice:{fill:"#fffbe6",stroke:"#faad14",lineWidth:2,radius:4,width:48,height:36},dispatchUnit:{fill:"#f9f0ff",stroke:"#722ed1",lineWidth:2,radius:20,width:40,height:40},dispatchNode:{fill:"#fff0f6",stroke:"#eb2f96",lineWidth:2,radius:16,width:32,height:32},auxiliary:{fill:"#f5f5f5",stroke:"#8c8c8c",lineWidth:2,radius:8,width:16,height:16}},Sb={stroke:"#91d5ff",lineWidth:2,endArrow:{path:"M 0,0 L 8,4 L 8,-4 Z",fill:"#91d5ff"}},KU={flow:{stroke:"#1890ff",lineWidth:2},control:{stroke:"#faad14",lineWidth:1.5,lineDash:[6,3]},supply:{stroke:"#52c41a",lineWidth:1.5,lineDash:[4,4]}};function zU(r){return{...xa[r]}}function VU(r){const e={...Sb};return r&&KU[r]?{...e,...KU[r]}:e}const Fb={light:{name:"light",backgroundColor:"#ffffff",nodeStyle:xa,edgeStyle:Sb},dark:{name:"dark",backgroundColor:"#141414",nodeStyle:{canal:{...xa.canal,fill:"#1d3557",stroke:"#4dabf7"},pumpStation:{...xa.pumpStation,fill:"#2d4a22",stroke:"#69db7c"},reservoir:{...xa.reservoir,fill:"#1d4a4a",stroke:"#38d9a9"},sluice:{...xa.sluice,fill:"#4a3e1d",stroke:"#ffd43b"},dispatchUnit:{...xa.dispatchUnit,fill:"#2d1d4a",stroke:"#b197fc"},dispatchNode:{...xa.dispatchNode,fill:"#4a1d3e",stroke:"#f783ac"},auxiliary:{...xa.auxiliary,fill:"#262626",stroke:"#595959"}},edgeStyle:{...Sb,stroke:"#4dabf7"}}};function jU(r){const e=r?.name||"light",t=Fb[e]??Fb.light;return{...t,...r,nodeStyle:{...t.nodeStyle||{},...r?.nodeStyle||{}},edgeStyle:{...t.edgeStyle||{},...r?.edgeStyle||{}}}}function Bse(r,e){return{...r,...e}}function bse(r,e){return{...r,...e}}const Sf={canal:{type:"rect",style:{fill:"#e6f7ff",stroke:gs.canal,lineWidth:2,radius:4,width:200,height:40}},pumpStation:{type:"circle",style:{fill:"#f6ffed",stroke:gs.pumpStation,lineWidth:2,width:48,height:48}},reservoir:{type:"circle",style:{fill:"#e6fffb",stroke:gs.reservoir,lineWidth:2,width:48,height:48}},sluice:{type:"rect",style:{fill:"#fffbe6",stroke:gs.sluice,lineWidth:2,radius:4,width:48,height:36}},dispatchUnit:{type:"circle",style:{fill:"#f9f0ff",stroke:gs.dispatchUnit,lineWidth:2,width:40,height:40}},dispatchNode:{type:"circle",style:{fill:"#fff0f6",stroke:gs.dispatchNode,lineWidth:2,width:32,height:32}},auxiliary:{type:"circle",style:{fill:"#f0f0f0",stroke:gs.auxiliary,lineWidth:1,width:16,height:16}}};function Ese(){}function xse(r){return Sf[r]?.type||"circle"}function Cse(r){return{...Sf[r]?.style}}function Sse(r,e){const t=Sf[r]||Sf.dispatchNode;return{type:t.type,style:{...t.style,...e}}}const Ff={flow:{type:"polyline",style:{stroke:"#1890ff",lineWidth:2,endArrow:!0}},control:{type:"line",style:{stroke:"#faad14",lineWidth:1.5,lineDash:[6,3],endArrow:!0}},supply:{type:"line",style:{stroke:"#52c41a",lineWidth:1.5,lineDash:[4,4],endArrow:!0}},curve:{type:"quadratic",style:{stroke:"#91d5ff",lineWidth:2,endArrow:!0,curveOffset:30}}};function Fse(){}function Tse(r){return Ff[r||"flow"]?.type||"line"}function Mse(r){return{...Ff[r||"flow"]?.style}}function Ose(r,e){const t=Ff[r||"flow"]??Ff.flow;return{type:t.type,style:{...t.style,...e}}}function WU(r){const e=[];return r.enableZoom!==!1&&e.push({type:"zoom-canvas",sensitivity:1,minZoom:.1,maxZoom:5}),r.enableDrag!==!1&&e.push({type:"drag-element",key:"drag-element",enable:t=>["node","edge","combo"].includes(t.targetType),shadow:!1,dropEffect:"move"}),e.push({type:"drag-canvas",key:"drag-canvas",enable:t=>t.targetType==="canvas"}),e.push({type:"click-select",multiple:!0}),r.enableBrush&&e.push({type:"brush-select",trigger:"shift"}),e.push({type:"hover-activate"}),e}function Ise(r){const e=[];return r.enableZoom!==!1&&e.push({type:"zoom-canvas",sensitivity:1,minZoom:.1,maxZoom:5}),e.push({type:"drag-canvas",enable:!0}),e.push({type:"hover-activate"}),e}const _se={ZOOM_CANVAS:"zoom-canvas",DRAG_CANVAS:"drag-canvas",DRAG_ELEMENT:"drag-element",CLICK_SELECT:"click-select",BRUSH_SELECT:"brush-select",HOVER_ACTIVATE:"hover-activate"};class Tb{graph=null;container=null;options;state={loading:!1,rendered:!1,zoom:1,selectedNodes:[],selectedEdges:[]};eventHandlers=new Map;constructor(e){this.options=e}async init(){const e=typeof this.options.container=="string"?document.getElementById(this.options.container):this.options.container;if(!e)throw new Error("Container not found");this.container=e,jU(this.options.theme);const t=WU(this.options);return this.graph=new bf({container:e,width:this.options.width||e.clientWidth,height:this.options.height||e.clientHeight,autoFit:this.options.fitView?"view":void 0,padding:this.options.fitViewPadding,layout:this.buildLayoutConfig(this.options.layout),behaviors:t,plugins:this.buildPlugins(),node:{style:{labelText:n=>n.data?.label||"",labelPlacement:"bottom"}},edge:{type:n=>{const i=n;return i.styleConfig?.router?"polyline":i.edgeShape||"line"},style:n=>{const i=n,a={stroke:i.styleConfig?.stroke||"#1890ff",lineWidth:i.styleConfig?.lineWidth||2,endArrow:i.styleConfig?.endArrow??!0};return i.styleConfig?.router&&(a.router={type:"orth",offset:20}),a}}}),this.bindEvents(),this.state.rendered=!0,this.graph}buildLayoutConfig(e){return!e||e.type==="custom"?void 0:{force:{type:"force",preventOverlap:!0,nodeSize:50,...e.options},grid:{type:"grid",rows:4,cols:4,...e.options},dagre:{type:"dagre",rankdir:"TB",nodesep:60,ranksep:80,...e.options},circular:{type:"circular",radius:200,...e.options},radial:{type:"radial",unitRadius:100,...e.options},concentric:{type:"concentric",minNodeSpacing:60,...e.options},tree:{type:"dendrogram",direction:"TB",nodeSep:40,rankSep:100,...e.options}}[e.type]||{type:e.type,...e.options}}buildPlugins(){const e=[];return this.options.tooltip?.enabled!==!1&&e.push({type:"tooltip",getContent:(t,n)=>{if(this.options.tooltip?.formatter&&n.length>0)return this.options.tooltip.formatter(n[0]);const i=n[0];return`<div style="padding: 8px 12px;">
134
+ <div style="font-weight: bold;">${i?.data?.label||""}</div>
135
+ <div style="color: #666; font-size: 12px;">${i?.entityType||""}</div>
136
+ </div>`}}),this.options.enableMinimap&&e.push({type:"minimap",size:[150,100]}),e}bindEvents(){if(!this.graph)return;const e=["node:click","node:dblclick","node:contextmenu","node:mouseenter","node:mouseleave","node:dragstart","node:drag","node:dragend","edge:click","edge:dblclick","edge:contextmenu","edge:mouseenter","edge:mouseleave","canvas:click","canvas:dragstart","canvas:drag","canvas:dragend","combo:click","combo:dblclick"];for(const t of e)this.graph.on(t,n=>{this.emitEvent(t,n)})}emitEvent(e,t){const n=this.eventHandlers.get(e);if(n)for(const i of n)i({type:e,itemData:t?.target,originalEvent:t,graph:this.graph})}on(e,t){this.eventHandlers.has(e)||this.eventHandlers.set(e,new Set),this.eventHandlers.get(e).add(t)}off(e,t){t?this.eventHandlers.get(e)?.delete(t):this.eventHandlers.delete(e)}async render(e){this.graph||await this.init(),this.state.loading=!0;try{await this.graph.setData(e),await this.graph.render()}finally{this.state.loading=!1}}async updateData(e){if(!this.graph)return;const t=this.graph.getData(),n={nodes:e.nodes??t.nodes,edges:e.edges??t.edges,combos:e.combos??t.combos};await this.graph.setData(n),await this.graph.render()}async addNode(e){this.graph&&(await this.graph.addNodeData([e]),await this.graph.draw())}async addEdge(e){this.graph&&(await this.graph.addEdgeData([e]),await this.graph.draw())}async removeNode(e){this.graph&&(await this.graph.removeNodeData([e]),await this.graph.draw())}async removeEdge(e){this.graph&&(await this.graph.removeEdgeData([e]),await this.graph.draw())}async updateNode(e,t){this.graph&&(await this.graph.updateNodeData([{id:e,...t}]),await this.graph.draw())}async updateEdge(e,t){this.graph&&(await this.graph.updateEdgeData([{id:e,...t}]),await this.graph.draw())}zoomTo(e){this.graph&&(this.graph.zoomTo(e),this.state.zoom=e)}zoomIn(){const e=Math.min(this.state.zoom*1.2,5);this.zoomTo(e)}zoomOut(){const e=Math.max(this.state.zoom/1.2,.1);this.zoomTo(e)}fitView(){this.graph&&this.graph.fitView()}focusNode(e){this.graph&&this.graph.focusElement(e)}getData(){return this.graph?this.graph.getData():{nodes:[],edges:[],combos:[]}}save(){const e=this.getData();return JSON.stringify(e,null,2)}async load(e){const t=JSON.parse(e);await this.render(t)}async toImage(e){return this.graph?await this.graph.toDataURL({mode:"overall",type:e?.format==="jpg"?"image/jpeg":"image/png"}):""}async downloadImage(e){const t=await this.toImage(e);if(!t)return;const n=document.createElement("a");n.download=e?.fileName||"irrigation-graph",n.href=t,n.click()}print(){if(!this.container)return;const e=window.open("","_blank");e&&(e.document.write(`
137
+ <html>
138
+ <head><title>灌溉概化图</title></head>
139
+ <body>${this.container.innerHTML}</body>
140
+ </html>
141
+ `),e.document.close(),e.print())}getState(){return{...this.state}}getSelectedNodes(){return[...this.state.selectedNodes]}getSelectedEdges(){return[...this.state.selectedEdges]}async setLayout(e){if(!this.graph)return;const t=this.buildLayoutConfig(e);this.graph.setLayout(t),await this.graph.layout()}getGraph(){return this.graph}destroy(){this.graph&&(this.graph.destroy(),this.graph=null),this.eventHandlers.clear(),this.state.rendered=!1}}function kse(r){return new Tb(r)}const qU={horizontal:150,vertical:120,branchOffset:80},$U={spacing:qU,autoGenerateAuxiliary:!0,autoGenerateEdges:!0,startPosition:{x:100,y:300}};class Mb{config;spacing;canalMap=new Map;canalChildren=new Map;canalNodeInfos=new Map;pointsByCanalId=new Map;constructor(e){this.config={...$U,...e,spacing:{...qU,...e?.spacing},startPosition:e?.startPosition||$U.startPosition},this.spacing=this.config.spacing}transform(e){this.clear(),this.buildIndex(e);const t=this.transformAndPositionNodes(e),n=this.transformEdges(e,t),i=this.transformCombos(e.canals);return{nodes:t,edges:n,combos:i}}clear(){this.canalMap.clear(),this.canalChildren.clear(),this.canalNodeInfos.clear(),this.pointsByCanalId.clear()}buildIndex(e){for(const t of e.canals)if(this.canalMap.set(t.id,t),t.parentId){const n=this.canalChildren.get(t.parentId)||[];n.push(t),this.canalChildren.set(t.parentId,n)}for(const t of e.points){const n=this.pointsByCanalId.get(t.canalId)||[];n.push(t),this.pointsByCanalId.set(t.canalId,n)}for(const[t,n]of this.pointsByCanalId)n.sort((i,a)=>i.chainage-a.chainage),this.pointsByCanalId.set(t,n)}transformAndPositionNodes(e){const t=[],n=e.canals.filter(a=>!a.parentId);let i=this.config.startPosition.y;for(const a of n)this.processCanal(a,this.config.startPosition.x,i,"horizontal",t),i+=this.spacing.vertical*3;return t}processCanal(e,t,n,i,a){const s=this.pointsByCanalId.get(e.id)||[],o=[];let A=t,l=n;for(let c=0;c<s.length;c++){const u=s[c],h=this.createPointNode(u);if(h.style={...h.style||{},x:A,y:l},i==="horizontal"?A+=this.spacing.horizontal:i==="horizontal-left"?A-=this.spacing.horizontal:i==="up"?l-=this.spacing.vertical:l+=this.spacing.vertical,o.push(h),a.push(h),u.type==="auxiliary"&&u.auxiliaryType==="fork"){const d=u;if(d.branchCanalId){const f=this.canalMap.get(d.branchCanalId);if(f){const g=this.calculateBranchDirection(i,f.bankSide),p=h.style.x,v=h.style.y,{branchStartX:y,branchStartY:m}=this.calculateBranchStartPosition(p,v,g);this.processCanal(f,y,m,g,a)}}}}this.canalNodeInfos.set(e.id,{canalId:e.id,nodes:o,startX:t,startY:n,direction:i})}calculateBranchDirection(e,t){return e==="horizontal"||e==="horizontal-left"?t==="left"?"up":"down":t==="left"?"horizontal-left":"horizontal"}calculateBranchStartPosition(e,t,n){let i=e,a=t;switch(n){case"up":a-=this.spacing.vertical;break;case"down":a+=this.spacing.vertical;break;case"horizontal":i+=this.spacing.horizontal;break;case"horizontal-left":i-=this.spacing.horizontal;break}return{branchStartX:i,branchStartY:a}}createPointNode(e){const t=this.getNodeShape(e.type),n=zU(e.type);if(e.type==="auxiliary"){const i=e;return{id:e.id,data:{label:(i.auxiliaryType==="fork","")},entityType:e.type,businessData:e,nodeShape:"circle",styleConfig:{...n,size:i.auxiliaryType==="fork"?16:12,fill:i.auxiliaryType==="fork"?"#1890ff":"#999",stroke:"#fff",lineWidth:2}}}return{id:e.id,data:{label:e.name},entityType:e.type,businessData:e,nodeShape:t,styleConfig:n}}getNodeShape(e){return{canal:"rect",pumpStation:"rect",reservoir:"circle",sluice:"rect",dispatchUnit:"diamond",dispatchNode:"circle",auxiliary:"circle"}[e]||"circle"}transformEdges(e,t){const n=[];if(e.connections&&e.connections.length>0){for(const i of e.connections)n.push(this.createEdge(i.id,i.sourceId,i.targetId,i.connectionType));return n}if(!this.config.autoGenerateEdges)return n;for(const[i,a]of this.pointsByCanalId)for(let s=0;s<a.length-1;s++){const o=a[s],A=a[s+1];n.push(this.createEdge(`edge-${o.id}-${A.id}`,o.id,A.id,"flow"))}for(const i of e.points)if(i.type==="auxiliary"&&i.auxiliaryType==="fork"){const a=i;if(a.branchCanalId){const s=this.canalMap.get(a.branchCanalId),o=this.pointsByCanalId.get(a.branchCanalId);if(o&&o.length>0&&s){const A=s.bankSide==="left"?"up":"down";n.push(this.createEdge(`edge-${a.id}-${o[0].id}`,a.id,o[0].id,"flow",!0,A))}}}return n}createEdge(e,t,n,i,a=!1,s){const o=VU();return a?{id:e,source:t,target:n,data:{label:""},edgeShape:"polyline",connectionType:i||"flow",styleConfig:{...o,endArrow:!0,router:{type:"orth",offset:20}}}:{id:e,source:t,target:n,data:{label:""},edgeShape:"line",connectionType:i||"flow",styleConfig:{...o,endArrow:!0}}}transformCombos(e){return[]}setSpacing(e){this.spacing={...this.spacing,...e},this.config.spacing=this.spacing}getConfig(){return{...this.config}}}function Nse(r){return new Mb(r)}function YU(r,e){return new Mb(e).transform(r)}function XU(r){return JSON.stringify(r,null,2)}function ZU(r){try{const e=JSON.parse(r);return{nodes:e.nodes||[],edges:e.edges||[],combos:e.combos||[]}}catch(e){return console.error("Failed to parse graph data:",e),{nodes:[],edges:[],combos:[]}}}function Lse(r,e="irrigation-graph.json"){const t=XU(r),n=new Blob([t],{type:"application/json"}),i=URL.createObjectURL(n),a=document.createElement("a");a.href=i,a.download=e,a.click(),URL.revokeObjectURL(i)}function Qse(r){return new Promise((e,t)=>{const n=new FileReader;n.onload=i=>{try{const a=i.target?.result,s=ZU(a);e(s)}catch(a){t(a)}},n.onerror=()=>t(new Error("Failed to read file")),n.readAsText(r)})}async function Use(r){try{return await navigator.clipboard.writeText(r),!0}catch(e){return console.error("Failed to copy to clipboard:",e),!1}}function Pse(r="node"){return`${r}-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}function Rse(r){return JSON.parse(JSON.stringify(r))}function Dse(r,e){let t=null;return(...n)=>{t&&clearTimeout(t),t=setTimeout(()=>{r(...n)},e)}}function Hse(r,e){let t=0;return(...n)=>{const i=Date.now();i-t>=e&&(r(...n),t=i)}}function Ob(r,e,t,n){return Math.sqrt(Math.pow(t-r,2)+Math.pow(n-e,2))}function Gse(r,e,t,n,i,a){const s=i-t,o=a-n,A=Math.sqrt(s*s+o*o);if(A===0)return Ob(r,e,t,n);const l=Math.max(0,Math.min(1,((r-t)*s+(e-n)*o)/(A*A))),c=t+l*s,u=n+l*o;return Ob(r,e,c,u)}function Kse(r){const e=[],t=new Set;if(!r.nodes||!Array.isArray(r.nodes))e.push("nodes must be an array");else for(const n of r.nodes)n.id?t.has(n.id)?e.push(`Duplicate node id: ${n.id}`):t.add(n.id):e.push("Node must have an id");if(r.edges&&Array.isArray(r.edges))for(const n of r.edges)(!n.source||!n.target)&&e.push("Edge must have source and target"),n.source&&!t.has(n.source)&&e.push(`Edge source node not found: ${n.source}`),n.target&&!t.has(n.target)&&e.push(`Edge target node not found: ${n.target}`);return{valid:e.length===0,errors:e}}function jt(r){const e=r.style;return{x:e?.x??0,y:e?.y??0}}function ui(r,e,t){r.style||(r.style={}),r.style.x=e,r.style.y=t}function JU(r,e){if(r.length<2)return;const t=r.map(i=>jt(i));let n;if(e==="top")n=Math.min(...t.map(i=>i.y));else if(e==="bottom")n=Math.max(...t.map(i=>i.y));else{const i=Math.min(...t.map(s=>s.y)),a=Math.max(...t.map(s=>s.y));n=(i+a)/2}for(const i of r){const a=jt(i);ui(i,a.x,n)}}function eP(r,e){if(r.length<2)return;const t=r.map(i=>jt(i));let n;if(e==="left")n=Math.min(...t.map(i=>i.x));else if(e==="right")n=Math.max(...t.map(i=>i.x));else{const i=Math.min(...t.map(s=>s.x)),a=Math.max(...t.map(s=>s.x));n=(i+a)/2}for(const i of r){const a=jt(i);ui(i,n,a.y)}}function tP(r,e){if(r.length<3)return;const t=[...r].sort((o,A)=>jt(o).x-jt(A).x),n=jt(t[0]),a=jt(t[t.length-1]).x-n.x,s=e??a/(r.length-1);for(let o=1;o<t.length-1;o++){const A=t[o],l=jt(A);ui(A,n.x+s*o,l.y)}}function nP(r,e){if(r.length<3)return;const t=[...r].sort((o,A)=>jt(o).y-jt(A).y),n=jt(t[0]),a=jt(t[t.length-1]).y-n.y,s=e??a/(r.length-1);for(let o=1;o<t.length-1;o++){const A=t[o],l=jt(A);ui(A,l.x,n.y+s*o)}}function Ib(r,e,t){for(const n of r){const i=jt(n);ui(n,i.x+e,i.y+t)}}function ec(r){if(r.length===0)return{minX:0,minY:0,maxX:0,maxY:0,width:0,height:0,centerX:0,centerY:0};const e=r.map(s=>jt(s)),t=Math.min(...e.map(s=>s.x)),n=Math.min(...e.map(s=>s.y)),i=Math.max(...e.map(s=>s.x)),a=Math.max(...e.map(s=>s.y));return{minX:t,minY:n,maxX:i,maxY:a,width:i-t,height:a-n,centerX:(t+i)/2,centerY:(n+a)/2}}function rP(r,e,t){const n=ec(r),i=e-n.centerX,a=t-n.centerY;Ib(r,i,a)}function iP(r,e){return(r.nodes||[]).filter(t=>t.businessData?.canalId===e)}function aP(r,e){const t=r.edges||[],n=r.nodes||[],i=t.filter(s=>s.target===e).map(s=>s.source),a=t.filter(s=>s.source===e).map(s=>s.target);return{sources:n.filter(s=>i.includes(s.id)),targets:n.filter(s=>a.includes(s.id))}}function sP(r,e,t){if(r.length<2)return;const n=[...r].sort((a,s)=>{const o=jt(a),A=jt(s);return e==="horizontal"?o.x-A.x:o.y-A.y}),i=jt(n[0]);for(let a=1;a<n.length;a++){const s=n[a],o=jt(s);e==="horizontal"?ui(s,i.x+t*a,o.y):ui(s,o.x,i.y+t*a)}}function oP(r,e){if(r.length===0)return;const t=ec(r);for(const n of r){const i=jt(n);if(e==="horizontal"){const a=t.centerX*2-i.x;ui(n,a,i.y)}else{const a=t.centerY*2-i.y;ui(n,i.x,a)}}}function AP(r,e=!0){if(r.length===0)return;const t=ec(r);for(const n of r){const i=jt(n),a=i.x-t.centerX,s=i.y-t.centerY;let o,A;e?(o=t.centerX+s,A=t.centerY-a):(o=t.centerX-s,A=t.centerY+a),ui(n,o,A)}}const zse=Object.freeze(Object.defineProperty({__proto__:null,alignNodesHorizontally:JU,alignNodesVertically:eP,autoAdjustSpacing:sP,centerNodesToPosition:rP,distributeNodesHorizontally:tP,distributeNodesVertically:nP,flipNodes:oP,getConnectedNodes:aP,getNodePosition:jt,getNodesBoundingBox:ec,getNodesByCanalId:iP,moveNodes:Ib,rotateNodes90:AP,setNodePosition:ui},Symbol.toStringTag,{value:"Module"}));function lP(r){const{container:e,width:t,height:n,data:i,graphData:a,options:s={},autoInit:o=!0}=r,A=dt.shallowRef(null),l=dt.shallowRef(null),c=dt.ref(!1),u=dt.ref(!1),h=dt.ref({loading:!1,rendered:!1,zoom:1,selectedNodes:[],selectedEdges:[]});async function d(){if(!(!e.value||c.value)){u.value=!0;try{A.value=new Tb({container:e.value,width:t,height:n,...s}),l.value=await A.value.init(),c.value=!0,a?await f(a):i&&await g(i)}catch(Y){throw console.error("Failed to initialize graph:",Y),Y}finally{u.value=!1}}}async function f(Y){if(A.value){u.value=!0;try{await A.value.render(Y),h.value=A.value.getState()}finally{u.value=!1}}}async function g(Y){const xe=YU(Y);await f(xe)}async function p(Y){A.value&&await A.value.updateData(Y)}async function v(Y){A.value&&await A.value.addNode(Y)}async function y(Y){A.value&&await A.value.addEdge(Y)}async function m(Y){A.value&&await A.value.removeNode(Y)}async function B(Y){A.value&&await A.value.removeEdge(Y)}async function C(Y,xe){A.value&&await A.value.updateNode(Y,xe)}async function S(Y,xe){A.value&&await A.value.updateEdge(Y,xe)}function F(){A.value?.zoomIn(),A.value&&(h.value=A.value.getState())}function T(){A.value?.zoomOut(),A.value&&(h.value=A.value.getState())}function O(Y){A.value?.zoomTo(Y),A.value&&(h.value=A.value.getState())}function I(){A.value?.fitView()}function k(Y){A.value?.focusNode(Y)}function N(){return A.value?.getData()||{nodes:[],edges:[],combos:[]}}function U(){return A.value?.save()||"{}"}async function D(Y){A.value&&await A.value.load(Y)}async function G(Y){return A.value?.toImage(Y)||""}async function Z(Y){await A.value?.downloadImage(Y)}function q(){A.value?.print()}async function j(Y){A.value&&await A.value.setLayout(Y)}function te(Y,xe){A.value?.on(Y,xe)}function ue(Y,xe){A.value?.off(Y,xe)}function ge(){A.value?.destroy(),A.value=null,l.value=null,c.value=!1}return dt.onMounted(()=>{o&&e.value&&d()}),dt.onUnmounted(()=>{ge()}),dt.watch(e,Y=>{Y&&o&&!c.value&&d()}),{manager:A,graph:l,state:h,initialized:c,loading:u,init:d,render:f,renderFromData:g,updateData:p,addNode:v,addEdge:y,removeNode:m,removeEdge:B,updateNode:C,updateEdge:S,zoomIn:F,zoomOut:T,zoomTo:O,fitView:I,focusNode:k,getData:N,save:U,load:D,toImage:G,downloadImage:Z,print:q,setLayout:j,on:te,off:ue,destroy:ge}}const Vse={key:0,class:"irrigation-graph__loading"},cP=((r,e)=>{const t=r.__vccOpts||r;for(const[n,i]of e)t[n]=i;return t})(dt.defineComponent({__name:"IrrigationGraph",props:{width:{default:void 0},height:{default:void 0},data:{},graphData:{},layout:{},theme:{},tooltip:{},enableDrag:{type:Boolean,default:!0},enableZoom:{type:Boolean,default:!0},enableBrush:{type:Boolean,default:!1},enableMinimap:{type:Boolean,default:!1},fitView:{type:Boolean,default:!0},fitViewPadding:{},readonly:{type:Boolean,default:!1}},emits:["ready","itemClick","itemDblClick","itemContextMenu","selectionChange","canvasClick","dataChange"],setup(r,{expose:e,emit:t}){const n=r,i=t,a=dt.ref(null),{manager:s,graph:o,state:A,initialized:l,loading:c,init:u,render:h,renderFromData:d,updateData:f,addNode:g,addEdge:p,removeNode:v,removeEdge:y,updateNode:m,updateEdge:B,zoomIn:C,zoomOut:S,zoomTo:F,fitView:T,focusNode:O,getData:I,save:k,load:N,toImage:U,downloadImage:D,print:G,setLayout:Z,on:q,off:j,destroy:te}=lP({container:a,width:n.width,height:n.height,data:n.data,graphData:n.graphData,options:{layout:n.layout,theme:n.theme,tooltip:n.tooltip,enableDrag:n.enableDrag,enableZoom:n.enableZoom,enableBrush:n.enableBrush,enableMinimap:n.enableMinimap,fitView:n.fitView,fitViewPadding:n.fitViewPadding},autoInit:!1}),ue=dt.computed(()=>({width:n.width?`${n.width}px`:"100%",height:n.height?`${n.height}px`:"100%"}));function ge(){s.value&&(q("node:click",Y=>{i("itemClick",{type:"node",item:Y.itemData})}),q("node:dblclick",Y=>{i("itemDblClick",{type:"node",item:Y.itemData})}),q("node:contextmenu",Y=>{i("itemContextMenu",{type:"node",item:Y.itemData,event:Y.originalEvent})}),q("edge:click",Y=>{i("itemClick",{type:"edge",item:Y.itemData})}),q("edge:dblclick",Y=>{i("itemDblClick",{type:"edge",item:Y.itemData})}),q("edge:contextmenu",Y=>{i("itemContextMenu",{type:"edge",item:Y.itemData,event:Y.originalEvent})}),q("canvas:click",Y=>{i("canvasClick",Y.originalEvent)}))}return dt.onMounted(async()=>{a.value&&(await u(),ge(),i("ready",o.value))}),dt.watch(()=>n.data,async Y=>{Y&&l.value&&(await d(Y),i("dataChange",I()))},{deep:!0}),dt.watch(()=>n.graphData,async Y=>{Y&&l.value&&(await h(Y),i("dataChange",I()))},{deep:!0}),e({graph:o,manager:s,state:A,initialized:l,loading:c,render:h,renderFromData:d,updateData:f,addNode:g,addEdge:p,removeNode:v,removeEdge:y,updateNode:m,updateEdge:B,getData:I,zoomIn:C,zoomOut:S,zoomTo:F,fitView:T,focusNode:O,setLayout:Z,save:k,load:N,toImage:U,downloadImage:D,print:G,on:q,off:j,layoutUtils:zse,destroy:te}),(Y,xe)=>(dt.openBlock(),dt.createElementBlock("div",{class:"irrigation-graph",style:dt.normalizeStyle(ue.value)},[dt.renderSlot(Y.$slots,"toolbar",{zoomIn:dt.unref(C),zoomOut:dt.unref(S),fitView:dt.unref(T)},void 0,!0),dt.createElementVNode("div",{ref_key:"containerRef",ref:a,class:"irrigation-graph__canvas"},null,512),dt.unref(c)?(dt.openBlock(),dt.createElementBlock("div",Vse,[dt.renderSlot(Y.$slots,"loading",{},()=>[xe[0]||(xe[0]=dt.createElementVNode("span",null,"加载中...",-1))],!0)])):dt.createCommentVNode("",!0),dt.renderSlot(Y.$slots,"default",{},void 0,!0)],4))}}),[["__scopeId","data-v-bfd0c40e"]]),jse={install(r){r.component("IrrigationGraph",cP)}};Ne.BEHAVIOR_NAMES=_se,Ne.DataTransformer=Mb,Ne.ENTITY_COLORS=gs,Ne.IrrigationGraph=cP,Ne.IrrigationGraphManager=Tb,Ne.PRESET_THEMES=Fb,Ne.alignNodesHorizontally=JU,Ne.alignNodesVertically=eP,Ne.autoAdjustSpacing=sP,Ne.centerNodesToPosition=rP,Ne.copyToClipboard=Use,Ne.createBehaviors=WU,Ne.createEdgeConfig=Ose,Ne.createGraphManager=kse,Ne.createNodeConfig=Sse,Ne.createReadonlyBehaviors=Ise,Ne.createTheme=jU,Ne.createTransformer=Nse,Ne.debounce=Dse,Ne.deepClone=Rse,Ne.default=jse,Ne.deserializeGraphData=ZU,Ne.distance=Ob,Ne.distributeNodesHorizontally=tP,Ne.distributeNodesVertically=nP,Ne.downloadJSON=Lse,Ne.flipNodes=oP,Ne.generateId=Pse,Ne.getConnectedNodes=aP,Ne.getDefaultEdgeStyle=VU,Ne.getDefaultNodeStyle=zU,Ne.getEdgeDefaultStyle=Mse,Ne.getEdgeTypeName=Tse,Ne.getNodeDefaultStyle=Cse,Ne.getNodePosition=jt,Ne.getNodeTypeName=xse,Ne.getNodesBoundingBox=ec,Ne.getNodesByCanalId=iP,Ne.mergeEdgeStyle=bse,Ne.mergeNodeStyle=Bse,Ne.moveNodes=Ib,Ne.pointToSegmentDistance=Gse,Ne.readJSONFile=Qse,Ne.registerCustomEdges=Fse,Ne.registerCustomNodes=Ese,Ne.rotateNodes90=AP,Ne.serializeGraphData=XU,Ne.setNodePosition=ui,Ne.throttle=Hse,Ne.transformData=YU,Ne.useIrrigationGraph=lP,Ne.validateGraphData=Kse,Object.defineProperties(Ne,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));