@antv/layout 0.3.22-beta.0 → 0.3.22-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see layout.min.js.LICENSE.txt */
2
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.layout=e():t.layout=e()}(self,(()=>(()=>{var t={9216:(t,e,n)=>{"use strict";n(9504),n(3982),n(721),n(5778),n(3898),n(7536),n(5834),n(6945),n(547),n(5967),n(3515),n(3042),n(4962),n(8246)},9504:(t,e,n)=>{n(2825),n(6051),n(2640),n(9518),n(8201),n(470),n(5723),n(7525),n(9788),n(1498),n(7577),n(6129),n(2802),n(7940),n(5261),n(9340),n(1584),n(7298),n(1765),n(5747),n(7451),n(2784),n(2809),n(7454),n(3053),n(8032),n(7551),n(2929),n(215),n(6183),n(8190),n(476),n(948),n(942),n(2870),n(2212),n(4230),n(9754),n(2811),n(3998),n(1769),n(8789),n(2848),n(1762),n(1323),n(6063),n(3282),n(6816),n(1854),n(3303),n(4421),n(2203),n(1028),n(6818),n(5557),n(7938),n(8316),n(7937),n(637),n(8219),n(9029),n(3157),n(9791),n(2296),n(4555),n(6505),n(4722),n(9713),n(7392),n(4687),n(3684),n(3339),n(4148),n(7754),n(4094),n(8781),n(5013),n(3735),n(8723),n(2247),n(9689),n(9003),n(9026),n(4088),n(535),n(5788),n(7878),n(5119),n(3135),n(5015),n(8059),n(646),n(5377),n(9879),n(5305),n(6341),n(5915),n(4488),n(9281),n(163),n(6668),n(7139),n(6408),n(8686),n(5480),n(9121),n(914),n(7742),n(7843),n(6441),n(429),n(2214),n(498),n(6349),n(3742),n(9604),n(2592),n(9290),n(9363),n(3871),n(8632),n(1838),n(3421),n(6144),n(8275),n(2552),n(3077),n(1031),n(8916),n(8978),n(8531),n(7323),n(3704),n(3153),n(8812),n(2636),n(1602),n(377),t.exports=n(2845)},721:(t,e,n)=>{n(7744),t.exports=n(2845).Array.flatMap},3982:(t,e,n)=>{n(5448),t.exports=n(2845).Array.includes},3515:(t,e,n)=>{n(8938),t.exports=n(2845).Object.entries},547:(t,e,n)=>{n(7819),t.exports=n(2845).Object.getOwnPropertyDescriptors},5967:(t,e,n)=>{n(6572),t.exports=n(2845).Object.values},3042:(t,e,n)=>{"use strict";n(7843),n(8228),t.exports=n(2845).Promise.finally},3898:(t,e,n)=>{n(3336),t.exports=n(2845).String.padEnd},5778:(t,e,n)=>{n(3718),t.exports=n(2845).String.padStart},5834:(t,e,n)=>{n(6642),t.exports=n(2845).String.trimRight},7536:(t,e,n)=>{n(7831),t.exports=n(2845).String.trimLeft},6945:(t,e,n)=>{n(9956),t.exports=n(7686).f("asyncIterator")},2680:(t,e,n)=>{n(8358),t.exports=n(3142).global},3749:t=>{t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},8891:(t,e,n)=>{var r=n(2799);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},3142:t=>{var e=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=e)},5526:(t,e,n)=>{var r=n(3749);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},7498:(t,e,n)=>{t.exports=!n(9880)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},2004:(t,e,n)=>{var r=n(2799),o=n(5505).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},2069:(t,e,n)=>{var r=n(5505),o=n(3142),i=n(5526),a=n(5954),u=n(9761),s="prototype",c=function(t,e,n){var f,l,d,h=t&c.F,p=t&c.G,v=t&c.S,g=t&c.P,m=t&c.B,y=t&c.W,b=p?o:o[e]||(o[e]={}),w=b[s],E=p?r:v?r[e]:(r[e]||{})[s];for(f in p&&(n=e),n)(l=!h&&E&&void 0!==E[f])&&u(b,f)||(d=l?E[f]:n[f],b[f]=p&&"function"!=typeof E[f]?n[f]:m&&l?i(d,r):y&&E[f]==d?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e[s]=t[s],e}(d):g&&"function"==typeof d?i(Function.call,d):d,g&&((b.virtual||(b.virtual={}))[f]=d,t&c.R&&w&&!w[f]&&a(w,f,d)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},9880:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},5505:t=>{var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},9761:t=>{var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},5954:(t,e,n)=>{var r=n(5584),o=n(5734);t.exports=n(7498)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},4053:(t,e,n)=>{t.exports=!n(7498)&&!n(9880)((function(){return 7!=Object.defineProperty(n(2004)("div"),"a",{get:function(){return 7}}).a}))},2799:t=>{t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},5584:(t,e,n)=>{var r=n(8891),o=n(4053),i=n(923),a=Object.defineProperty;e.f=n(7498)?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},5734:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},923:(t,e,n)=>{var r=n(2799);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},8358:(t,e,n)=>{var r=n(2069);r(r.G,{global:n(5505)})},1464:t=>{t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},8347:(t,e,n)=>{var r=n(1669);t.exports=function(t,e){if("number"!=typeof t&&"Number"!=r(t))throw TypeError(e);return+t}},4691:(t,e,n)=>{var r=n(341)("unscopables"),o=Array.prototype;null==o[r]&&n(913)(o,r,{}),t.exports=function(t){o[r][t]=!0}},178:(t,e,n)=>{"use strict";var r=n(8016)(!0);t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},6903:t=>{t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},486:(t,e,n)=>{var r=n(1255);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},1064:(t,e,n)=>{"use strict";var r=n(7583),o=n(9260),i=n(8087);t.exports=[].copyWithin||function(t,e){var n=r(this),a=i(n.length),u=o(t,a),s=o(e,a),c=arguments.length>2?arguments[2]:void 0,f=Math.min((void 0===c?a:o(c,a))-s,a-u),l=1;for(s<u&&u<s+f&&(l=-1,s+=f-1,u+=f-1);f-- >0;)s in n?n[u]=n[s]:delete n[u],u+=l,s+=l;return n}},8676:(t,e,n)=>{"use strict";var r=n(7583),o=n(9260),i=n(8087);t.exports=function(t){for(var e=r(this),n=i(e.length),a=arguments.length,u=o(a>1?arguments[1]:void 0,n),s=a>2?arguments[2]:void 0,c=void 0===s?n:o(s,n);c>u;)e[u++]=t;return e}},4538:(t,e,n)=>{var r=n(8182),o=n(8087),i=n(9260);t.exports=function(t){return function(e,n,a){var u,s=r(e),c=o(s.length),f=i(a,c);if(t&&n!=n){for(;c>f;)if((u=s[f++])!=u)return!0}else for(;c>f;f++)if((t||f in s)&&s[f]===n)return t||f||0;return!t&&-1}}},7622:(t,e,n)=>{var r=n(994),o=n(8579),i=n(7583),a=n(8087),u=n(6699);t.exports=function(t,e){var n=1==t,s=2==t,c=3==t,f=4==t,l=6==t,d=5==t||l,h=e||u;return function(e,u,p){for(var v,g,m=i(e),y=o(m),b=r(u,p,3),w=a(y.length),E=0,x=n?h(e,w):s?h(e,0):void 0;w>E;E++)if((d||E in y)&&(g=b(v=y[E],E,m),t))if(n)x[E]=g;else if(g)switch(t){case 3:return!0;case 5:return v;case 6:return E;case 2:x.push(v)}else if(f)return!1;return l?-1:c||f?f:x}}},5336:(t,e,n)=>{var r=n(1464),o=n(7583),i=n(8579),a=n(8087);t.exports=function(t,e,n,u,s){r(e);var c=o(t),f=i(c),l=a(c.length),d=s?l-1:0,h=s?-1:1;if(n<2)for(;;){if(d in f){u=f[d],d+=h;break}if(d+=h,s?d<0:l<=d)throw TypeError("Reduce of empty array with no initial value")}for(;s?d>=0:l>d;d+=h)d in f&&(u=e(u,f[d],d,c));return u}},7600:(t,e,n)=>{var r=n(1255),o=n(7183),i=n(341)("species");t.exports=function(t){var e;return o(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!o(e.prototype)||(e=void 0),r(e)&&null===(e=e[i])&&(e=void 0)),void 0===e?Array:e}},6699:(t,e,n)=>{var r=n(7600);t.exports=function(t,e){return new(r(t))(e)}},8366:(t,e,n)=>{"use strict";var r=n(1464),o=n(1255),i=n(8262),a=[].slice,u={};t.exports=Function.bind||function(t){var e=r(this),n=a.call(arguments,1),s=function(){var r=n.concat(a.call(arguments));return this instanceof s?function(t,e,n){if(!(e in u)){for(var r=[],o=0;o<e;o++)r[o]="a["+o+"]";u[e]=Function("F,a","return new F("+r.join(",")+")")}return u[e](t,n)}(e,r.length,r):i(e,r,t)};return o(e.prototype)&&(s.prototype=e.prototype),s}},4939:(t,e,n)=>{var r=n(1669),o=n(341)("toStringTag"),i="Arguments"==r(function(){return arguments}());t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),o))?n:i?r(e):"Object"==(a=r(e))&&"function"==typeof e.callee?"Arguments":a}},1669:t=>{var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},3050:(t,e,n)=>{"use strict";var r=n(3886).f,o=n(9055),i=n(8565),a=n(994),u=n(6903),s=n(9822),c=n(966),f=n(8782),l=n(4412),d=n(1216),h=n(4278).fastKey,p=n(4664),v=d?"_s":"size",g=function(t,e){var n,r=h(e);if("F"!==r)return t._i[r];for(n=t._f;n;n=n.n)if(n.k==e)return n};t.exports={getConstructor:function(t,e,n,c){var f=t((function(t,r){u(t,f,e,"_i"),t._t=e,t._i=o(null),t._f=void 0,t._l=void 0,t[v]=0,null!=r&&s(r,n,t[c],t)}));return i(f.prototype,{clear:function(){for(var t=p(this,e),n=t._i,r=t._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];t._f=t._l=void 0,t[v]=0},delete:function(t){var n=p(this,e),r=g(n,t);if(r){var o=r.n,i=r.p;delete n._i[r.i],r.r=!0,i&&(i.n=o),o&&(o.p=i),n._f==r&&(n._f=o),n._l==r&&(n._l=i),n[v]--}return!!r},forEach:function(t){p(this,e);for(var n,r=a(t,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(t){return!!g(p(this,e),t)}}),d&&r(f.prototype,"size",{get:function(){return p(this,e)[v]}}),f},def:function(t,e,n){var r,o,i=g(t,e);return i?i.v=n:(t._l=i={i:o=h(e,!0),k:e,v:n,p:r=t._l,n:void 0,r:!1},t._f||(t._f=i),r&&(r.n=i),t[v]++,"F"!==o&&(t._i[o]=i)),t},getEntry:g,setStrong:function(t,e,n){c(t,e,(function(t,n){this._t=p(t,e),this._k=n,this._l=void 0}),(function(){for(var t=this,e=t._k,n=t._l;n&&n.r;)n=n.p;return t._t&&(t._l=n=n?n.n:t._t._f)?f(0,"keys"==e?n.k:"values"==e?n.v:[n.k,n.v]):(t._t=void 0,f(1))}),n?"entries":"values",!n,!0),l(e)}}},1990:(t,e,n)=>{"use strict";var r=n(8565),o=n(4278).getWeak,i=n(486),a=n(1255),u=n(6903),s=n(9822),c=n(7622),f=n(7384),l=n(4664),d=c(5),h=c(6),p=0,v=function(t){return t._l||(t._l=new g)},g=function(){this.a=[]},m=function(t,e){return d(t.a,(function(t){return t[0]===e}))};g.prototype={get:function(t){var e=m(this,t);if(e)return e[1]},has:function(t){return!!m(this,t)},set:function(t,e){var n=m(this,t);n?n[1]=e:this.a.push([t,e])},delete:function(t){var e=h(this.a,(function(e){return e[0]===t}));return~e&&this.a.splice(e,1),!!~e}},t.exports={getConstructor:function(t,e,n,i){var c=t((function(t,r){u(t,c,e,"_i"),t._t=e,t._i=p++,t._l=void 0,null!=r&&s(r,n,t[i],t)}));return r(c.prototype,{delete:function(t){if(!a(t))return!1;var n=o(t);return!0===n?v(l(this,e)).delete(t):n&&f(n,this._i)&&delete n[this._i]},has:function(t){if(!a(t))return!1;var n=o(t);return!0===n?v(l(this,e)).has(t):n&&f(n,this._i)}}),c},def:function(t,e,n){var r=o(i(e),!0);return!0===r?v(t).set(e,n):r[t._i]=n,t},ufstore:v}},859:(t,e,n)=>{"use strict";var r=n(7571),o=n(7044),i=n(6476),a=n(8565),u=n(4278),s=n(9822),c=n(6903),f=n(1255),l=n(5338),d=n(2803),h=n(5837),p=n(116);t.exports=function(t,e,n,v,g,m){var y=r[t],b=y,w=g?"set":"add",E=b&&b.prototype,x={},_=function(t){var e=E[t];i(E,t,"delete"==t||"has"==t?function(t){return!(m&&!f(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return m&&!f(t)?void 0:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,n){return e.call(this,0===t?0:t,n),this})};if("function"==typeof b&&(m||E.forEach&&!l((function(){(new b).entries().next()})))){var S=new b,A=S[w](m?{}:-0,1)!=S,I=l((function(){S.has(1)})),T=d((function(t){new b(t)})),O=!m&&l((function(){for(var t=new b,e=5;e--;)t[w](e,e);return!t.has(-0)}));T||((b=e((function(e,n){c(e,b,t);var r=p(new y,e,b);return null!=n&&s(n,g,r[w],r),r}))).prototype=E,E.constructor=b),(I||O)&&(_("delete"),_("has"),g&&_("get")),(O||A)&&_(w),m&&E.clear&&delete E.clear}else b=v.getConstructor(e,t,g,w),a(b.prototype,n),u.NEED=!0;return h(b,t),x[t]=b,o(o.G+o.W+o.F*(b!=y),x),m||v.setStrong(b,t,g),b}},2845:t=>{var e=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=e)},1395:(t,e,n)=>{"use strict";var r=n(3886),o=n(8328);t.exports=function(t,e,n){e in t?r.f(t,e,o(0,n)):t[e]=n}},994:(t,e,n)=>{var r=n(1464);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},4506:(t,e,n)=>{"use strict";var r=n(5338),o=Date.prototype.getTime,i=Date.prototype.toISOString,a=function(t){return t>9?t:"0"+t};t.exports=r((function(){return"0385-07-25T07:06:39.999Z"!=i.call(new Date(-50000000000001))}))||!r((function(){i.call(new Date(NaN))}))?function(){if(!isFinite(o.call(this)))throw RangeError("Invalid time value");var t=this,e=t.getUTCFullYear(),n=t.getUTCMilliseconds(),r=e<0?"-":e>9999?"+":"";return r+("00000"+Math.abs(e)).slice(r?-6:-4)+"-"+a(t.getUTCMonth()+1)+"-"+a(t.getUTCDate())+"T"+a(t.getUTCHours())+":"+a(t.getUTCMinutes())+":"+a(t.getUTCSeconds())+"."+(n>99?n:"0"+a(n))+"Z"}:i},9514:(t,e,n)=>{"use strict";var r=n(486),o=n(4467),i="number";t.exports=function(t){if("string"!==t&&t!==i&&"default"!==t)throw TypeError("Incorrect hint");return o(r(this),t!=i)}},5091:t=>{t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},1216:(t,e,n)=>{t.exports=!n(5338)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},3438:(t,e,n)=>{var r=n(1255),o=n(7571).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},9824:t=>{t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},6397:(t,e,n)=>{var r=n(9804),o=n(3844),i=n(4179);t.exports=function(t){var e=r(t),n=o.f;if(n)for(var a,u=n(t),s=i.f,c=0;u.length>c;)s.call(t,a=u[c++])&&e.push(a);return e}},7044:(t,e,n)=>{var r=n(7571),o=n(2845),i=n(913),a=n(6476),u=n(994),s="prototype",c=function(t,e,n){var f,l,d,h,p=t&c.F,v=t&c.G,g=t&c.S,m=t&c.P,y=t&c.B,b=v?r:g?r[e]||(r[e]={}):(r[e]||{})[s],w=v?o:o[e]||(o[e]={}),E=w[s]||(w[s]={});for(f in v&&(n=e),n)d=((l=!p&&b&&void 0!==b[f])?b:n)[f],h=y&&l?u(d,r):m&&"function"==typeof d?u(Function.call,d):d,b&&a(b,f,d,t&c.U),w[f]!=d&&i(w,f,h),m&&E[f]!=d&&(E[f]=d)};r.core=o,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},2910:(t,e,n)=>{var r=n(341)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,!"/./"[t](e)}catch(t){}}return!0}},5338:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},6719:(t,e,n)=>{"use strict";n(7139);var r=n(6476),o=n(913),i=n(5338),a=n(5091),u=n(341),s=n(9020),c=u("species"),f=!i((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),l=function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();t.exports=function(t,e,n){var d=u(t),h=!i((function(){var e={};return e[d]=function(){return 7},7!=""[t](e)})),p=h?!i((function(){var e=!1,n=/a/;return n.exec=function(){return e=!0,null},"split"===t&&(n.constructor={},n.constructor[c]=function(){return n}),n[d](""),!e})):void 0;if(!h||!p||"replace"===t&&!f||"split"===t&&!l){var v=/./[d],g=n(a,d,""[t],(function(t,e,n,r,o){return e.exec===s?h&&!o?{done:!0,value:v.call(e,n,r)}:{done:!0,value:t.call(n,e,r)}:{done:!1}})),m=g[0],y=g[1];r(String.prototype,t,m),o(RegExp.prototype,d,2==e?function(t,e){return y.call(t,this,e)}:function(t){return y.call(t,this)})}}},3649:(t,e,n)=>{"use strict";var r=n(486);t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},6806:(t,e,n)=>{"use strict";var r=n(7183),o=n(1255),i=n(8087),a=n(994),u=n(341)("isConcatSpreadable");t.exports=function t(e,n,s,c,f,l,d,h){for(var p,v,g=f,m=0,y=!!d&&a(d,h,3);m<c;){if(m in s){if(p=y?y(s[m],m,n):s[m],v=!1,o(p)&&(v=void 0!==(v=p[u])?!!v:r(p)),v&&l>0)g=t(e,n,p,i(p.length),g,l-1)-1;else{if(g>=9007199254740991)throw TypeError();e[g]=p}g++}m++}return g}},9822:(t,e,n)=>{var r=n(994),o=n(4902),i=n(9981),a=n(486),u=n(8087),s=n(9685),c={},f={},l=t.exports=function(t,e,n,l,d){var h,p,v,g,m=d?function(){return t}:s(t),y=r(n,l,e?2:1),b=0;if("function"!=typeof m)throw TypeError(t+" is not iterable!");if(i(m)){for(h=u(t.length);h>b;b++)if((g=e?y(a(p=t[b])[0],p[1]):y(t[b]))===c||g===f)return g}else for(v=m.call(t);!(p=v.next()).done;)if((g=o(v,y,p.value,e))===c||g===f)return g};l.BREAK=c,l.RETURN=f},8454:(t,e,n)=>{t.exports=n(5570)("native-function-to-string",Function.toString)},7571:t=>{var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},7384:t=>{var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},913:(t,e,n)=>{var r=n(3886),o=n(8328);t.exports=n(1216)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},7680:(t,e,n)=>{var r=n(7571).document;t.exports=r&&r.documentElement},6252:(t,e,n)=>{t.exports=!n(1216)&&!n(5338)((function(){return 7!=Object.defineProperty(n(3438)("div"),"a",{get:function(){return 7}}).a}))},116:(t,e,n)=>{var r=n(1255),o=n(473).set;t.exports=function(t,e,n){var i,a=e.constructor;return a!==n&&"function"==typeof a&&(i=a.prototype)!==n.prototype&&r(i)&&o&&o(t,i),t}},8262:t=>{t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},8579:(t,e,n)=>{var r=n(1669);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},9981:(t,e,n)=>{var r=n(9740),o=n(341)("iterator"),i=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||i[o]===t)}},7183:(t,e,n)=>{var r=n(1669);t.exports=Array.isArray||function(t){return"Array"==r(t)}},1272:(t,e,n)=>{var r=n(1255),o=Math.floor;t.exports=function(t){return!r(t)&&isFinite(t)&&o(t)===t}},1255:t=>{t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},8990:(t,e,n)=>{var r=n(1255),o=n(1669),i=n(341)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[i])?!!e:"RegExp"==o(t))}},4902:(t,e,n)=>{var r=n(486);t.exports=function(t,e,n,o){try{return o?e(r(n)[0],n[1]):e(n)}catch(e){var i=t.return;throw void 0!==i&&r(i.call(t)),e}}},4529:(t,e,n)=>{"use strict";var r=n(9055),o=n(8328),i=n(5837),a={};n(913)(a,n(341)("iterator"),(function(){return this})),t.exports=function(t,e,n){t.prototype=r(a,{next:o(1,n)}),i(t,e+" Iterator")}},966:(t,e,n)=>{"use strict";var r=n(2725),o=n(7044),i=n(6476),a=n(913),u=n(9740),s=n(4529),c=n(5837),f=n(9881),l=n(341)("iterator"),d=!([].keys&&"next"in[].keys()),h="keys",p="values",v=function(){return this};t.exports=function(t,e,n,g,m,y,b){s(n,e,g);var w,E,x,_=function(t){if(!d&&t in T)return T[t];switch(t){case h:case p:return function(){return new n(this,t)}}return function(){return new n(this,t)}},S=e+" Iterator",A=m==p,I=!1,T=t.prototype,O=T[l]||T["@@iterator"]||m&&T[m],N=O||_(m),D=m?A?_("entries"):N:void 0,M="Array"==e&&T.entries||O;if(M&&(x=f(M.call(new t)))!==Object.prototype&&x.next&&(c(x,S,!0),r||"function"==typeof x[l]||a(x,l,v)),A&&O&&O.name!==p&&(I=!0,N=function(){return O.call(this)}),r&&!b||!d&&!I&&T[l]||a(T,l,N),u[e]=N,u[S]=v,m)if(w={values:A?N:_(p),keys:y?N:_(h),entries:D},b)for(E in w)E in T||i(T,E,w[E]);else o(o.P+o.F*(d||I),e,w);return w}},2803:(t,e,n)=>{var r=n(341)("iterator"),o=!1;try{var i=[7][r]();i.return=function(){o=!0},Array.from(i,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!o)return!1;var n=!1;try{var i=[7],a=i[r]();a.next=function(){return{done:n=!0}},i[r]=function(){return a},t(i)}catch(t){}return n}},8782:t=>{t.exports=function(t,e){return{value:e,done:!!t}}},9740:t=>{t.exports={}},2725:t=>{t.exports=!1},959:t=>{var e=Math.expm1;t.exports=!e||e(10)>22025.465794806718||e(10)<22025.465794806718||-2e-17!=e(-2e-17)?function(t){return 0==(t=+t)?t:t>-1e-6&&t<1e-6?t+t*t/2:Math.exp(t)-1}:e},7682:(t,e,n)=>{var r=n(2987),o=Math.pow,i=o(2,-52),a=o(2,-23),u=o(2,127)*(2-a),s=o(2,-126);t.exports=Math.fround||function(t){var e,n,o=Math.abs(t),c=r(t);return o<s?c*(o/s/a+1/i-1/i)*s*a:(n=(e=(1+a/i)*o)-(e-o))>u||n!=n?c*(1/0):c*n}},1618:t=>{t.exports=Math.log1p||function(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},2987:t=>{t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},4278:(t,e,n)=>{var r=n(4316)("meta"),o=n(1255),i=n(7384),a=n(3886).f,u=0,s=Object.isExtensible||function(){return!0},c=!n(5338)((function(){return s(Object.preventExtensions({}))})),f=function(t){a(t,r,{value:{i:"O"+ ++u,w:{}}})},l=t.exports={KEY:r,NEED:!1,fastKey:function(t,e){if(!o(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!i(t,r)){if(!s(t))return"F";if(!e)return"E";f(t)}return t[r].i},getWeak:function(t,e){if(!i(t,r)){if(!s(t))return!0;if(!e)return!1;f(t)}return t[r].w},onFreeze:function(t){return c&&l.NEED&&s(t)&&!i(t,r)&&f(t),t}}},7485:(t,e,n)=>{var r=n(7571),o=n(7225).set,i=r.MutationObserver||r.WebKitMutationObserver,a=r.process,u=r.Promise,s="process"==n(1669)(a);t.exports=function(){var t,e,n,c=function(){var r,o;for(s&&(r=a.domain)&&r.exit();t;){o=t.fn,t=t.next;try{o()}catch(r){throw t?n():e=void 0,r}}e=void 0,r&&r.enter()};if(s)n=function(){a.nextTick(c)};else if(!i||r.navigator&&r.navigator.standalone)if(u&&u.resolve){var f=u.resolve(void 0);n=function(){f.then(c)}}else n=function(){o.call(r,c)};else{var l=!0,d=document.createTextNode("");new i(c).observe(d,{characterData:!0}),n=function(){d.data=l=!l}}return function(r){var o={fn:r,next:void 0};e&&(e.next=o),t||(t=o,n()),e=o}}},449:(t,e,n)=>{"use strict";var r=n(1464);function o(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)}t.exports.f=function(t){return new o(t)}},4643:(t,e,n)=>{"use strict";var r=n(1216),o=n(9804),i=n(3844),a=n(4179),u=n(7583),s=n(8579),c=Object.assign;t.exports=!c||n(5338)((function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!=c({},t)[n]||Object.keys(c({},e)).join("")!=r}))?function(t,e){for(var n=u(t),c=arguments.length,f=1,l=i.f,d=a.f;c>f;)for(var h,p=s(arguments[f++]),v=l?o(p).concat(l(p)):o(p),g=v.length,m=0;g>m;)h=v[m++],r&&!d.call(p,h)||(n[h]=p[h]);return n}:c},9055:(t,e,n)=>{var r=n(486),o=n(6283),i=n(9824),a=n(3574)("IE_PROTO"),u=function(){},s="prototype",c=function(){var t,e=n(3438)("iframe"),r=i.length;for(e.style.display="none",n(7680).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),c=t.F;r--;)delete c[s][i[r]];return c()};t.exports=Object.create||function(t,e){var n;return null!==t?(u[s]=r(t),n=new u,u[s]=null,n[a]=t):n=c(),void 0===e?n:o(n,e)}},3886:(t,e,n)=>{var r=n(486),o=n(6252),i=n(4467),a=Object.defineProperty;e.f=n(1216)?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},6283:(t,e,n)=>{var r=n(3886),o=n(486),i=n(9804);t.exports=n(1216)?Object.defineProperties:function(t,e){o(t);for(var n,a=i(e),u=a.length,s=0;u>s;)r.f(t,n=a[s++],e[n]);return t}},5385:(t,e,n)=>{var r=n(4179),o=n(8328),i=n(8182),a=n(4467),u=n(7384),s=n(6252),c=Object.getOwnPropertyDescriptor;e.f=n(1216)?c:function(t,e){if(t=i(t),e=a(e,!0),s)try{return c(t,e)}catch(t){}if(u(t,e))return o(!r.f.call(t,e),t[e])}},3473:(t,e,n)=>{var r=n(8182),o=n(6907).f,i={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"[object Window]"==i.call(t)?function(t){try{return o(t)}catch(t){return a.slice()}}(t):o(r(t))}},6907:(t,e,n)=>{var r=n(946),o=n(9824).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},3844:(t,e)=>{e.f=Object.getOwnPropertySymbols},9881:(t,e,n)=>{var r=n(7384),o=n(7583),i=n(3574)("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),r(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},946:(t,e,n)=>{var r=n(7384),o=n(8182),i=n(4538)(!1),a=n(3574)("IE_PROTO");t.exports=function(t,e){var n,u=o(t),s=0,c=[];for(n in u)n!=a&&r(u,n)&&c.push(n);for(;e.length>s;)r(u,n=e[s++])&&(~i(c,n)||c.push(n));return c}},9804:(t,e,n)=>{var r=n(946),o=n(9824);t.exports=Object.keys||function(t){return r(t,o)}},4179:(t,e)=>{e.f={}.propertyIsEnumerable},381:(t,e,n)=>{var r=n(7044),o=n(2845),i=n(5338);t.exports=function(t,e){var n=(o.Object||{})[t]||Object[t],a={};a[t]=e(n),r(r.S+r.F*i((function(){n(1)})),"Object",a)}},6460:(t,e,n)=>{var r=n(1216),o=n(9804),i=n(8182),a=n(4179).f;t.exports=function(t){return function(e){for(var n,u=i(e),s=o(u),c=s.length,f=0,l=[];c>f;)n=s[f++],r&&!a.call(u,n)||l.push(t?[n,u[n]]:u[n]);return l}}},8125:(t,e,n)=>{var r=n(6907),o=n(3844),i=n(486),a=n(7571).Reflect;t.exports=a&&a.ownKeys||function(t){var e=r.f(i(t)),n=o.f;return n?e.concat(n(t)):e}},1885:(t,e,n)=>{var r=n(7571).parseFloat,o=n(4961).trim;t.exports=1/r(n(1644)+"-0")!=-1/0?function(t){var e=o(String(t),3),n=r(e);return 0===n&&"-"==e.charAt(0)?-0:n}:r},343:(t,e,n)=>{var r=n(7571).parseInt,o=n(4961).trim,i=n(1644),a=/^[-+]?0[xX]/;t.exports=8!==r(i+"08")||22!==r(i+"0x16")?function(t,e){var n=o(String(t),3);return r(n,e>>>0||(a.test(n)?16:10))}:r},9696:t=>{t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},909:(t,e,n)=>{var r=n(486),o=n(1255),i=n(449);t.exports=function(t,e){if(r(t),o(e)&&e.constructor===t)return e;var n=i.f(t);return(0,n.resolve)(e),n.promise}},8328:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},8565:(t,e,n)=>{var r=n(6476);t.exports=function(t,e,n){for(var o in e)r(t,o,e[o],n);return t}},6476:(t,e,n)=>{var r=n(7571),o=n(913),i=n(7384),a=n(4316)("src"),u=n(8454),s="toString",c=(""+u).split(s);n(2845).inspectSource=function(t){return u.call(t)},(t.exports=function(t,e,n,u){var s="function"==typeof n;s&&(i(n,"name")||o(n,"name",e)),t[e]!==n&&(s&&(i(n,a)||o(n,a,t[e]?""+t[e]:c.join(String(e)))),t===r?t[e]=n:u?t[e]?t[e]=n:o(t,e,n):(delete t[e],o(t,e,n)))})(Function.prototype,s,(function(){return"function"==typeof this&&this[a]||u.call(this)}))},2968:(t,e,n)=>{"use strict";var r=n(4939),o=RegExp.prototype.exec;t.exports=function(t,e){var n=t.exec;if("function"==typeof n){var i=n.call(t,e);if("object"!=typeof i)throw new TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==r(t))throw new TypeError("RegExp#exec called on incompatible receiver");return o.call(t,e)}},9020:(t,e,n)=>{"use strict";var r,o,i=n(3649),a=RegExp.prototype.exec,u=String.prototype.replace,s=a,c="lastIndex",f=(r=/a/,o=/b*/g,a.call(r,"a"),a.call(o,"a"),0!==r[c]||0!==o[c]),l=void 0!==/()??/.exec("")[1];(f||l)&&(s=function(t){var e,n,r,o,s=this;return l&&(n=new RegExp("^"+s.source+"$(?!\\s)",i.call(s))),f&&(e=s[c]),r=a.call(s,t),f&&r&&(s[c]=s.global?r.index+r[0].length:e),l&&r&&r.length>1&&u.call(r[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r}),t.exports=s},6962:t=>{t.exports=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}},473:(t,e,n)=>{var r=n(1255),o=n(486),i=function(t,e){if(o(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,r){try{(r=n(994)(Function.call,n(5385).f(Object.prototype,"__proto__").set,2))(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,n){return i(t,n),e?t.__proto__=n:r(t,n),t}}({},!1):void 0),check:i}},4412:(t,e,n)=>{"use strict";var r=n(7571),o=n(3886),i=n(1216),a=n(341)("species");t.exports=function(t){var e=r[t];i&&e&&!e[a]&&o.f(e,a,{configurable:!0,get:function(){return this}})}},5837:(t,e,n)=>{var r=n(3886).f,o=n(7384),i=n(341)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},3574:(t,e,n)=>{var r=n(5570)("keys"),o=n(4316);t.exports=function(t){return r[t]||(r[t]=o(t))}},5570:(t,e,n)=>{var r=n(2845),o=n(7571),i="__core-js_shared__",a=o[i]||(o[i]={});(t.exports=function(t,e){return a[t]||(a[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n(2725)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},8713:(t,e,n)=>{var r=n(486),o=n(1464),i=n(341)("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||null==(n=r(a)[i])?e:o(n)}},5296:(t,e,n)=>{"use strict";var r=n(5338);t.exports=function(t,e){return!!t&&r((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},8016:(t,e,n)=>{var r=n(5845),o=n(5091);t.exports=function(t){return function(e,n){var i,a,u=String(o(e)),s=r(n),c=u.length;return s<0||s>=c?t?"":void 0:(i=u.charCodeAt(s))<55296||i>56319||s+1===c||(a=u.charCodeAt(s+1))<56320||a>57343?t?u.charAt(s):i:t?u.slice(s,s+2):a-56320+(i-55296<<10)+65536}}},5692:(t,e,n)=>{var r=n(8990),o=n(5091);t.exports=function(t,e,n){if(r(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(o(t))}},5264:(t,e,n)=>{var r=n(7044),o=n(5338),i=n(5091),a=/"/g,u=function(t,e,n,r){var o=String(i(t)),u="<"+e;return""!==n&&(u+=" "+n+'="'+String(r).replace(a,"&quot;")+'"'),u+">"+o+"</"+e+">"};t.exports=function(t,e){var n={};n[t]=e(u),r(r.P+r.F*o((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3})),"String",n)}},8261:(t,e,n)=>{var r=n(8087),o=n(5458),i=n(5091);t.exports=function(t,e,n,a){var u=String(i(t)),s=u.length,c=void 0===n?" ":String(n),f=r(e);if(f<=s||""==c)return u;var l=f-s,d=o.call(c,Math.ceil(l/c.length));return d.length>l&&(d=d.slice(0,l)),a?d+u:u+d}},5458:(t,e,n)=>{"use strict";var r=n(5845),o=n(5091);t.exports=function(t){var e=String(o(this)),n="",i=r(t);if(i<0||i==1/0)throw RangeError("Count can't be negative");for(;i>0;(i>>>=1)&&(e+=e))1&i&&(n+=e);return n}},4961:(t,e,n)=>{var r=n(7044),o=n(5091),i=n(5338),a=n(1644),u="["+a+"]",s=RegExp("^"+u+u+"*"),c=RegExp(u+u+"*$"),f=function(t,e,n){var o={},u=i((function(){return!!a[t]()||"​…"!="​…"[t]()})),s=o[t]=u?e(l):a[t];n&&(o[n]=s),r(r.P+r.F*u,"String",o)},l=f.trim=function(t,e){return t=String(o(t)),1&e&&(t=t.replace(s,"")),2&e&&(t=t.replace(c,"")),t};t.exports=f},1644:t=>{t.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},7225:(t,e,n)=>{var r,o,i,a=n(994),u=n(8262),s=n(7680),c=n(3438),f=n(7571),l=f.process,d=f.setImmediate,h=f.clearImmediate,p=f.MessageChannel,v=f.Dispatch,g=0,m={},y="onreadystatechange",b=function(){var t=+this;if(m.hasOwnProperty(t)){var e=m[t];delete m[t],e()}},w=function(t){b.call(t.data)};d&&h||(d=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return m[++g]=function(){u("function"==typeof t?t:Function(t),e)},r(g),g},h=function(t){delete m[t]},"process"==n(1669)(l)?r=function(t){l.nextTick(a(b,t,1))}:v&&v.now?r=function(t){v.now(a(b,t,1))}:p?(i=(o=new p).port2,o.port1.onmessage=w,r=a(i.postMessage,i,1)):f.addEventListener&&"function"==typeof postMessage&&!f.importScripts?(r=function(t){f.postMessage(t+"","*")},f.addEventListener("message",w,!1)):r=y in c("script")?function(t){s.appendChild(c("script"))[y]=function(){s.removeChild(this),b.call(t)}}:function(t){setTimeout(a(b,t,1),0)}),t.exports={set:d,clear:h}},9260:(t,e,n)=>{var r=n(5845),o=Math.max,i=Math.min;t.exports=function(t,e){return(t=r(t))<0?o(t+e,0):i(t,e)}},5e3:(t,e,n)=>{var r=n(5845),o=n(8087);t.exports=function(t){if(void 0===t)return 0;var e=r(t),n=o(e);if(e!==n)throw RangeError("Wrong length!");return n}},5845:t=>{var e=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:e)(t)}},8182:(t,e,n)=>{var r=n(8579),o=n(5091);t.exports=function(t){return r(o(t))}},8087:(t,e,n)=>{var r=n(5845),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},7583:(t,e,n)=>{var r=n(5091);t.exports=function(t){return Object(r(t))}},4467:(t,e,n)=>{var r=n(1255);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},1063:(t,e,n)=>{"use strict";if(n(1216)){var r=n(2725),o=n(7571),i=n(5338),a=n(7044),u=n(604),s=n(1541),c=n(994),f=n(6903),l=n(8328),d=n(913),h=n(8565),p=n(5845),v=n(8087),g=n(5e3),m=n(9260),y=n(4467),b=n(7384),w=n(4939),E=n(1255),x=n(7583),_=n(9981),S=n(9055),A=n(9881),I=n(6907).f,T=n(9685),O=n(4316),N=n(341),D=n(7622),M=n(4538),k=n(8713),R=n(163),C=n(9740),L=n(2803),P=n(4412),j=n(8676),z=n(1064),F=n(3886),G=n(5385),U=F.f,B=G.f,V=o.RangeError,W=o.TypeError,X=o.Uint8Array,H="ArrayBuffer",q="Shared"+H,Y="BYTES_PER_ELEMENT",K="prototype",Z=Array[K],$=s.ArrayBuffer,Q=s.DataView,J=D(0),tt=D(2),et=D(3),nt=D(4),rt=D(5),ot=D(6),it=M(!0),at=M(!1),ut=R.values,st=R.keys,ct=R.entries,ft=Z.lastIndexOf,lt=Z.reduce,dt=Z.reduceRight,ht=Z.join,pt=Z.sort,vt=Z.slice,gt=Z.toString,mt=Z.toLocaleString,yt=N("iterator"),bt=N("toStringTag"),wt=O("typed_constructor"),Et=O("def_constructor"),xt=u.CONSTR,_t=u.TYPED,St=u.VIEW,At="Wrong length!",It=D(1,(function(t,e){return Mt(k(t,t[Et]),e)})),Tt=i((function(){return 1===new X(new Uint16Array([1]).buffer)[0]})),Ot=!!X&&!!X[K].set&&i((function(){new X(1).set({})})),Nt=function(t,e){var n=p(t);if(n<0||n%e)throw V("Wrong offset!");return n},Dt=function(t){if(E(t)&&_t in t)return t;throw W(t+" is not a typed array!")},Mt=function(t,e){if(!E(t)||!(wt in t))throw W("It is not a typed array constructor!");return new t(e)},kt=function(t,e){return Rt(k(t,t[Et]),e)},Rt=function(t,e){for(var n=0,r=e.length,o=Mt(t,r);r>n;)o[n]=e[n++];return o},Ct=function(t,e,n){U(t,e,{get:function(){return this._d[n]}})},Lt=function(t){var e,n,r,o,i,a,u=x(t),s=arguments.length,f=s>1?arguments[1]:void 0,l=void 0!==f,d=T(u);if(null!=d&&!_(d)){for(a=d.call(u),r=[],e=0;!(i=a.next()).done;e++)r.push(i.value);u=r}for(l&&s>2&&(f=c(f,arguments[2],2)),e=0,n=v(u.length),o=Mt(this,n);n>e;e++)o[e]=l?f(u[e],e):u[e];return o},Pt=function(){for(var t=0,e=arguments.length,n=Mt(this,e);e>t;)n[t]=arguments[t++];return n},jt=!!X&&i((function(){mt.call(new X(1))})),zt=function(){return mt.apply(jt?vt.call(Dt(this)):Dt(this),arguments)},Ft={copyWithin:function(t,e){return z.call(Dt(this),t,e,arguments.length>2?arguments[2]:void 0)},every:function(t){return nt(Dt(this),t,arguments.length>1?arguments[1]:void 0)},fill:function(t){return j.apply(Dt(this),arguments)},filter:function(t){return kt(this,tt(Dt(this),t,arguments.length>1?arguments[1]:void 0))},find:function(t){return rt(Dt(this),t,arguments.length>1?arguments[1]:void 0)},findIndex:function(t){return ot(Dt(this),t,arguments.length>1?arguments[1]:void 0)},forEach:function(t){J(Dt(this),t,arguments.length>1?arguments[1]:void 0)},indexOf:function(t){return at(Dt(this),t,arguments.length>1?arguments[1]:void 0)},includes:function(t){return it(Dt(this),t,arguments.length>1?arguments[1]:void 0)},join:function(t){return ht.apply(Dt(this),arguments)},lastIndexOf:function(t){return ft.apply(Dt(this),arguments)},map:function(t){return It(Dt(this),t,arguments.length>1?arguments[1]:void 0)},reduce:function(t){return lt.apply(Dt(this),arguments)},reduceRight:function(t){return dt.apply(Dt(this),arguments)},reverse:function(){for(var t,e=this,n=Dt(e).length,r=Math.floor(n/2),o=0;o<r;)t=e[o],e[o++]=e[--n],e[n]=t;return e},some:function(t){return et(Dt(this),t,arguments.length>1?arguments[1]:void 0)},sort:function(t){return pt.call(Dt(this),t)},subarray:function(t,e){var n=Dt(this),r=n.length,o=m(t,r);return new(k(n,n[Et]))(n.buffer,n.byteOffset+o*n.BYTES_PER_ELEMENT,v((void 0===e?r:m(e,r))-o))}},Gt=function(t,e){return kt(this,vt.call(Dt(this),t,e))},Ut=function(t){Dt(this);var e=Nt(arguments[1],1),n=this.length,r=x(t),o=v(r.length),i=0;if(o+e>n)throw V(At);for(;i<o;)this[e+i]=r[i++]},Bt={entries:function(){return ct.call(Dt(this))},keys:function(){return st.call(Dt(this))},values:function(){return ut.call(Dt(this))}},Vt=function(t,e){return E(t)&&t[_t]&&"symbol"!=typeof e&&e in t&&String(+e)==String(e)},Wt=function(t,e){return Vt(t,e=y(e,!0))?l(2,t[e]):B(t,e)},Xt=function(t,e,n){return!(Vt(t,e=y(e,!0))&&E(n)&&b(n,"value"))||b(n,"get")||b(n,"set")||n.configurable||b(n,"writable")&&!n.writable||b(n,"enumerable")&&!n.enumerable?U(t,e,n):(t[e]=n.value,t)};xt||(G.f=Wt,F.f=Xt),a(a.S+a.F*!xt,"Object",{getOwnPropertyDescriptor:Wt,defineProperty:Xt}),i((function(){gt.call({})}))&&(gt=mt=function(){return ht.call(this)});var Ht=h({},Ft);h(Ht,Bt),d(Ht,yt,Bt.values),h(Ht,{slice:Gt,set:Ut,constructor:function(){},toString:gt,toLocaleString:zt}),Ct(Ht,"buffer","b"),Ct(Ht,"byteOffset","o"),Ct(Ht,"byteLength","l"),Ct(Ht,"length","e"),U(Ht,bt,{get:function(){return this[_t]}}),t.exports=function(t,e,n,s){var c=t+((s=!!s)?"Clamped":"")+"Array",l="get"+t,h="set"+t,p=o[c],m=p||{},y=p&&A(p),b=!p||!u.ABV,x={},_=p&&p[K],T=function(t,n){U(t,n,{get:function(){return function(t,n){var r=t._d;return r.v[l](n*e+r.o,Tt)}(this,n)},set:function(t){return function(t,n,r){var o=t._d;s&&(r=(r=Math.round(r))<0?0:r>255?255:255&r),o.v[h](n*e+o.o,r,Tt)}(this,n,t)},enumerable:!0})};b?(p=n((function(t,n,r,o){f(t,p,c,"_d");var i,a,u,s,l=0,h=0;if(E(n)){if(!(n instanceof $||(s=w(n))==H||s==q))return _t in n?Rt(p,n):Lt.call(p,n);i=n,h=Nt(r,e);var m=n.byteLength;if(void 0===o){if(m%e)throw V(At);if((a=m-h)<0)throw V(At)}else if((a=v(o)*e)+h>m)throw V(At);u=a/e}else u=g(n),i=new $(a=u*e);for(d(t,"_d",{b:i,o:h,l:a,e:u,v:new Q(i)});l<u;)T(t,l++)})),_=p[K]=S(Ht),d(_,"constructor",p)):i((function(){p(1)}))&&i((function(){new p(-1)}))&&L((function(t){new p,new p(null),new p(1.5),new p(t)}),!0)||(p=n((function(t,n,r,o){var i;return f(t,p,c),E(n)?n instanceof $||(i=w(n))==H||i==q?void 0!==o?new m(n,Nt(r,e),o):void 0!==r?new m(n,Nt(r,e)):new m(n):_t in n?Rt(p,n):Lt.call(p,n):new m(g(n))})),J(y!==Function.prototype?I(m).concat(I(y)):I(m),(function(t){t in p||d(p,t,m[t])})),p[K]=_,r||(_.constructor=p));var O=_[yt],N=!!O&&("values"==O.name||null==O.name),D=Bt.values;d(p,wt,!0),d(_,_t,c),d(_,St,!0),d(_,Et,p),(s?new p(1)[bt]==c:bt in _)||U(_,bt,{get:function(){return c}}),x[c]=p,a(a.G+a.W+a.F*(p!=m),x),a(a.S,c,{BYTES_PER_ELEMENT:e}),a(a.S+a.F*i((function(){m.of.call(p,1)})),c,{from:Lt,of:Pt}),Y in _||d(_,Y,e),a(a.P,c,Ft),P(c),a(a.P+a.F*Ot,c,{set:Ut}),a(a.P+a.F*!N,c,Bt),r||_.toString==gt||(_.toString=gt),a(a.P+a.F*i((function(){new p(1).slice()})),c,{slice:Gt}),a(a.P+a.F*(i((function(){return[1,2].toLocaleString()!=new p([1,2]).toLocaleString()}))||!i((function(){_.toLocaleString.call([1,2])}))),c,{toLocaleString:zt}),C[c]=N?O:D,r||N||d(_,yt,D)}}else t.exports=function(){}},1541:(t,e,n)=>{"use strict";var r=n(7571),o=n(1216),i=n(2725),a=n(604),u=n(913),s=n(8565),c=n(5338),f=n(6903),l=n(5845),d=n(8087),h=n(5e3),p=n(6907).f,v=n(3886).f,g=n(8676),m=n(5837),y="ArrayBuffer",b="DataView",w="prototype",E="Wrong index!",x=r[y],_=r[b],S=r.Math,A=r.RangeError,I=r.Infinity,T=x,O=S.abs,N=S.pow,D=S.floor,M=S.log,k=S.LN2,R="buffer",C="byteLength",L="byteOffset",P=o?"_b":R,j=o?"_l":C,z=o?"_o":L;function F(t,e,n){var r,o,i,a=new Array(n),u=8*n-e-1,s=(1<<u)-1,c=s>>1,f=23===e?N(2,-24)-N(2,-77):0,l=0,d=t<0||0===t&&1/t<0?1:0;for((t=O(t))!=t||t===I?(o=t!=t?1:0,r=s):(r=D(M(t)/k),t*(i=N(2,-r))<1&&(r--,i*=2),(t+=r+c>=1?f/i:f*N(2,1-c))*i>=2&&(r++,i/=2),r+c>=s?(o=0,r=s):r+c>=1?(o=(t*i-1)*N(2,e),r+=c):(o=t*N(2,c-1)*N(2,e),r=0));e>=8;a[l++]=255&o,o/=256,e-=8);for(r=r<<e|o,u+=e;u>0;a[l++]=255&r,r/=256,u-=8);return a[--l]|=128*d,a}function G(t,e,n){var r,o=8*n-e-1,i=(1<<o)-1,a=i>>1,u=o-7,s=n-1,c=t[s--],f=127&c;for(c>>=7;u>0;f=256*f+t[s],s--,u-=8);for(r=f&(1<<-u)-1,f>>=-u,u+=e;u>0;r=256*r+t[s],s--,u-=8);if(0===f)f=1-a;else{if(f===i)return r?NaN:c?-I:I;r+=N(2,e),f-=a}return(c?-1:1)*r*N(2,f-e)}function U(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]}function B(t){return[255&t]}function V(t){return[255&t,t>>8&255]}function W(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function X(t){return F(t,52,8)}function H(t){return F(t,23,4)}function q(t,e,n){v(t[w],e,{get:function(){return this[n]}})}function Y(t,e,n,r){var o=h(+n);if(o+e>t[j])throw A(E);var i=t[P]._b,a=o+t[z],u=i.slice(a,a+e);return r?u:u.reverse()}function K(t,e,n,r,o,i){var a=h(+n);if(a+e>t[j])throw A(E);for(var u=t[P]._b,s=a+t[z],c=r(+o),f=0;f<e;f++)u[s+f]=c[i?f:e-f-1]}if(a.ABV){if(!c((function(){x(1)}))||!c((function(){new x(-1)}))||c((function(){return new x,new x(1.5),new x(NaN),x.name!=y}))){for(var Z,$=(x=function(t){return f(this,x),new T(h(t))})[w]=T[w],Q=p(T),J=0;Q.length>J;)(Z=Q[J++])in x||u(x,Z,T[Z]);i||($.constructor=x)}var tt=new _(new x(2)),et=_[w].setInt8;tt.setInt8(0,2147483648),tt.setInt8(1,2147483649),!tt.getInt8(0)&&tt.getInt8(1)||s(_[w],{setInt8:function(t,e){et.call(this,t,e<<24>>24)},setUint8:function(t,e){et.call(this,t,e<<24>>24)}},!0)}else x=function(t){f(this,x,y);var e=h(t);this._b=g.call(new Array(e),0),this[j]=e},_=function(t,e,n){f(this,_,b),f(t,x,b);var r=t[j],o=l(e);if(o<0||o>r)throw A("Wrong offset!");if(o+(n=void 0===n?r-o:d(n))>r)throw A("Wrong length!");this[P]=t,this[z]=o,this[j]=n},o&&(q(x,C,"_l"),q(_,R,"_b"),q(_,C,"_l"),q(_,L,"_o")),s(_[w],{getInt8:function(t){return Y(this,1,t)[0]<<24>>24},getUint8:function(t){return Y(this,1,t)[0]},getInt16:function(t){var e=Y(this,2,t,arguments[1]);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=Y(this,2,t,arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return U(Y(this,4,t,arguments[1]))},getUint32:function(t){return U(Y(this,4,t,arguments[1]))>>>0},getFloat32:function(t){return G(Y(this,4,t,arguments[1]),23,4)},getFloat64:function(t){return G(Y(this,8,t,arguments[1]),52,8)},setInt8:function(t,e){K(this,1,t,B,e)},setUint8:function(t,e){K(this,1,t,B,e)},setInt16:function(t,e){K(this,2,t,V,e,arguments[2])},setUint16:function(t,e){K(this,2,t,V,e,arguments[2])},setInt32:function(t,e){K(this,4,t,W,e,arguments[2])},setUint32:function(t,e){K(this,4,t,W,e,arguments[2])},setFloat32:function(t,e){K(this,4,t,H,e,arguments[2])},setFloat64:function(t,e){K(this,8,t,X,e,arguments[2])}});m(x,y),m(_,b),u(_[w],a.VIEW,!0),e[y]=x,e[b]=_},604:(t,e,n)=>{for(var r,o=n(7571),i=n(913),a=n(4316),u=a("typed_array"),s=a("view"),c=!(!o.ArrayBuffer||!o.DataView),f=c,l=0,d="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");l<9;)(r=o[d[l++]])?(i(r.prototype,u,!0),i(r.prototype,s,!0)):f=!1;t.exports={ABV:c,CONSTR:f,TYPED:u,VIEW:s}},4316:t=>{var e=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+n).toString(36))}},2541:(t,e,n)=>{var r=n(7571).navigator;t.exports=r&&r.userAgent||""},4664:(t,e,n)=>{var r=n(1255);t.exports=function(t,e){if(!r(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t}},6262:(t,e,n)=>{var r=n(7571),o=n(2845),i=n(2725),a=n(7686),u=n(3886).f;t.exports=function(t){var e=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||u(e,t,{value:a.f(t)})}},7686:(t,e,n)=>{e.f=n(341)},341:(t,e,n)=>{var r=n(5570)("wks"),o=n(4316),i=n(7571).Symbol,a="function"==typeof i;(t.exports=function(t){return r[t]||(r[t]=a&&i[t]||(a?i:o)("Symbol."+t))}).store=r},9685:(t,e,n)=>{var r=n(4939),o=n(341)("iterator"),i=n(9740);t.exports=n(2845).getIteratorMethod=function(t){if(null!=t)return t[o]||t["@@iterator"]||i[r(t)]}},5305:(t,e,n)=>{var r=n(7044);r(r.P,"Array",{copyWithin:n(1064)}),n(4691)("copyWithin")},5015:(t,e,n)=>{"use strict";var r=n(7044),o=n(7622)(4);r(r.P+r.F*!n(5296)([].every,!0),"Array",{every:function(t){return o(this,t,arguments[1])}})},6341:(t,e,n)=>{var r=n(7044);r(r.P,"Array",{fill:n(8676)}),n(4691)("fill")},5119:(t,e,n)=>{"use strict";var r=n(7044),o=n(7622)(2);r(r.P+r.F*!n(5296)([].filter,!0),"Array",{filter:function(t){return o(this,t,arguments[1])}})},4488:(t,e,n)=>{"use strict";var r=n(7044),o=n(7622)(6),i="findIndex",a=!0;i in[]&&Array(1)[i]((function(){a=!1})),r(r.P+r.F*a,"Array",{findIndex:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),n(4691)(i)},5915:(t,e,n)=>{"use strict";var r=n(7044),o=n(7622)(5),i="find",a=!0;i in[]&&Array(1)[i]((function(){a=!1})),r(r.P+r.F*a,"Array",{find:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),n(4691)(i)},5788:(t,e,n)=>{"use strict";var r=n(7044),o=n(7622)(0),i=n(5296)([].forEach,!0);r(r.P+r.F*!i,"Array",{forEach:function(t){return o(this,t,arguments[1])}})},9689:(t,e,n)=>{"use strict";var r=n(994),o=n(7044),i=n(7583),a=n(4902),u=n(9981),s=n(8087),c=n(1395),f=n(9685);o(o.S+o.F*!n(2803)((function(t){Array.from(t)})),"Array",{from:function(t){var e,n,o,l,d=i(t),h="function"==typeof this?this:Array,p=arguments.length,v=p>1?arguments[1]:void 0,g=void 0!==v,m=0,y=f(d);if(g&&(v=r(v,p>2?arguments[2]:void 0,2)),null==y||h==Array&&u(y))for(n=new h(e=s(d.length));e>m;m++)c(n,m,g?v(d[m],m):d[m]);else for(l=y.call(d),n=new h;!(o=l.next()).done;m++)c(n,m,g?a(l,v,[o.value,m],!0):o.value);return n.length=m,n}})},5377:(t,e,n)=>{"use strict";var r=n(7044),o=n(4538)(!1),i=[].indexOf,a=!!i&&1/[1].indexOf(1,-0)<0;r(r.P+r.F*(a||!n(5296)(i)),"Array",{indexOf:function(t){return a?i.apply(this,arguments)||0:o(this,t,arguments[1])}})},2247:(t,e,n)=>{var r=n(7044);r(r.S,"Array",{isArray:n(7183)})},163:(t,e,n)=>{"use strict";var r=n(4691),o=n(8782),i=n(9740),a=n(8182);t.exports=n(966)(Array,"Array",(function(t,e){this._t=a(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,o(1)):o(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])}),"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},9026:(t,e,n)=>{"use strict";var r=n(7044),o=n(8182),i=[].join;r(r.P+r.F*(n(8579)!=Object||!n(5296)(i)),"Array",{join:function(t){return i.call(o(this),void 0===t?",":t)}})},9879:(t,e,n)=>{"use strict";var r=n(7044),o=n(8182),i=n(5845),a=n(8087),u=[].lastIndexOf,s=!!u&&1/[1].lastIndexOf(1,-0)<0;r(r.P+r.F*(s||!n(5296)(u)),"Array",{lastIndexOf:function(t){if(s)return u.apply(this,arguments)||0;var e=o(this),n=a(e.length),r=n-1;for(arguments.length>1&&(r=Math.min(r,i(arguments[1]))),r<0&&(r=n+r);r>=0;r--)if(r in e&&e[r]===t)return r||0;return-1}})},7878:(t,e,n)=>{"use strict";var r=n(7044),o=n(7622)(1);r(r.P+r.F*!n(5296)([].map,!0),"Array",{map:function(t){return o(this,t,arguments[1])}})},9003:(t,e,n)=>{"use strict";var r=n(7044),o=n(1395);r(r.S+r.F*n(5338)((function(){function t(){}return!(Array.of.call(t)instanceof t)})),"Array",{of:function(){for(var t=0,e=arguments.length,n=new("function"==typeof this?this:Array)(e);e>t;)o(n,t,arguments[t++]);return n.length=e,n}})},646:(t,e,n)=>{"use strict";var r=n(7044),o=n(5336);r(r.P+r.F*!n(5296)([].reduceRight,!0),"Array",{reduceRight:function(t){return o(this,t,arguments.length,arguments[1],!0)}})},8059:(t,e,n)=>{"use strict";var r=n(7044),o=n(5336);r(r.P+r.F*!n(5296)([].reduce,!0),"Array",{reduce:function(t){return o(this,t,arguments.length,arguments[1],!1)}})},4088:(t,e,n)=>{"use strict";var r=n(7044),o=n(7680),i=n(1669),a=n(9260),u=n(8087),s=[].slice;r(r.P+r.F*n(5338)((function(){o&&s.call(o)})),"Array",{slice:function(t,e){var n=u(this.length),r=i(this);if(e=void 0===e?n:e,"Array"==r)return s.call(this,t,e);for(var o=a(t,n),c=a(e,n),f=u(c-o),l=new Array(f),d=0;d<f;d++)l[d]="String"==r?this.charAt(o+d):this[o+d];return l}})},3135:(t,e,n)=>{"use strict";var r=n(7044),o=n(7622)(3);r(r.P+r.F*!n(5296)([].some,!0),"Array",{some:function(t){return o(this,t,arguments[1])}})},535:(t,e,n)=>{"use strict";var r=n(7044),o=n(1464),i=n(7583),a=n(5338),u=[].sort,s=[1,2,3];r(r.P+r.F*(a((function(){s.sort(void 0)}))||!a((function(){s.sort(null)}))||!n(5296)(u)),"Array",{sort:function(t){return void 0===t?u.call(i(this)):u.call(i(this),o(t))}})},9281:(t,e,n)=>{n(4412)("Array")},4094:(t,e,n)=>{var r=n(7044);r(r.S,"Date",{now:function(){return(new Date).getTime()}})},5013:(t,e,n)=>{var r=n(7044),o=n(4506);r(r.P+r.F*(Date.prototype.toISOString!==o),"Date",{toISOString:o})},8781:(t,e,n)=>{"use strict";var r=n(7044),o=n(7583),i=n(4467);r(r.P+r.F*n(5338)((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})})),"Date",{toJSON:function(t){var e=o(this),n=i(e);return"number"!=typeof n||isFinite(n)?e.toISOString():null}})},8723:(t,e,n)=>{var r=n(341)("toPrimitive"),o=Date.prototype;r in o||n(913)(o,r,n(9514))},3735:(t,e,n)=>{var r=Date.prototype,o="Invalid Date",i="toString",a=r[i],u=r.getTime;new Date(NaN)+""!=o&&n(6476)(r,i,(function(){var t=u.call(this);return t==t?a.call(this):o}))},1765:(t,e,n)=>{var r=n(7044);r(r.P,"Function",{bind:n(8366)})},7451:(t,e,n)=>{"use strict";var r=n(1255),o=n(9881),i=n(341)("hasInstance"),a=Function.prototype;i in a||n(3886).f(a,i,{value:function(t){if("function"!=typeof this||!r(t))return!1;if(!r(this.prototype))return t instanceof this;for(;t=o(t);)if(this.prototype===t)return!0;return!1}})},5747:(t,e,n)=>{var r=n(3886).f,o=Function.prototype,i=/^\s*function ([^ (]*)/,a="name";a in o||n(1216)&&r(o,a,{configurable:!0,get:function(){try{return(""+this).match(i)[1]}catch(t){return""}}})},6441:(t,e,n)=>{"use strict";var r=n(3050),o=n(4664),i="Map";t.exports=n(859)(i,(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{get:function(t){var e=r.getEntry(o(this,i),t);return e&&e.v},set:function(t,e){return r.def(o(this,i),0===t?0:t,e)}},r,!0)},2212:(t,e,n)=>{var r=n(7044),o=n(1618),i=Math.sqrt,a=Math.acosh;r(r.S+r.F*!(a&&710==Math.floor(a(Number.MAX_VALUE))&&a(1/0)==1/0),"Math",{acosh:function(t){return(t=+t)<1?NaN:t>94906265.62425156?Math.log(t)+Math.LN2:o(t-1+i(t-1)*i(t+1))}})},4230:(t,e,n)=>{var r=n(7044),o=Math.asinh;r(r.S+r.F*!(o&&1/o(0)>0),"Math",{asinh:function t(e){return isFinite(e=+e)&&0!=e?e<0?-t(-e):Math.log(e+Math.sqrt(e*e+1)):e}})},9754:(t,e,n)=>{var r=n(7044),o=Math.atanh;r(r.S+r.F*!(o&&1/o(-0)<0),"Math",{atanh:function(t){return 0==(t=+t)?t:Math.log((1+t)/(1-t))/2}})},2811:(t,e,n)=>{var r=n(7044),o=n(2987);r(r.S,"Math",{cbrt:function(t){return o(t=+t)*Math.pow(Math.abs(t),1/3)}})},3998:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{clz32:function(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},1769:(t,e,n)=>{var r=n(7044),o=Math.exp;r(r.S,"Math",{cosh:function(t){return(o(t=+t)+o(-t))/2}})},8789:(t,e,n)=>{var r=n(7044),o=n(959);r(r.S+r.F*(o!=Math.expm1),"Math",{expm1:o})},2848:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{fround:n(7682)})},1762:(t,e,n)=>{var r=n(7044),o=Math.abs;r(r.S,"Math",{hypot:function(t,e){for(var n,r,i=0,a=0,u=arguments.length,s=0;a<u;)s<(n=o(arguments[a++]))?(i=i*(r=s/n)*r+1,s=n):i+=n>0?(r=n/s)*r:n;return s===1/0?1/0:s*Math.sqrt(i)}})},1323:(t,e,n)=>{var r=n(7044),o=Math.imul;r(r.S+r.F*n(5338)((function(){return-5!=o(4294967295,5)||2!=o.length})),"Math",{imul:function(t,e){var n=65535,r=+t,o=+e,i=n&r,a=n&o;return 0|i*a+((n&r>>>16)*a+i*(n&o>>>16)<<16>>>0)}})},6063:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{log10:function(t){return Math.log(t)*Math.LOG10E}})},3282:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{log1p:n(1618)})},6816:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}})},1854:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{sign:n(2987)})},3303:(t,e,n)=>{var r=n(7044),o=n(959),i=Math.exp;r(r.S+r.F*n(5338)((function(){return-2e-17!=!Math.sinh(-2e-17)})),"Math",{sinh:function(t){return Math.abs(t=+t)<1?(o(t)-o(-t))/2:(i(t-1)-i(-t-1))*(Math.E/2)}})},4421:(t,e,n)=>{var r=n(7044),o=n(959),i=Math.exp;r(r.S,"Math",{tanh:function(t){var e=o(t=+t),n=o(-t);return e==1/0?1:n==1/0?-1:(e-n)/(i(t)+i(-t))}})},2203:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{trunc:function(t){return(t>0?Math.floor:Math.ceil)(t)}})},7454:(t,e,n)=>{"use strict";var r=n(7571),o=n(7384),i=n(1669),a=n(116),u=n(4467),s=n(5338),c=n(6907).f,f=n(5385).f,l=n(3886).f,d=n(4961).trim,h="Number",p=r[h],v=p,g=p.prototype,m=i(n(9055)(g))==h,y="trim"in String.prototype,b=function(t){var e=u(t,!1);if("string"==typeof e&&e.length>2){var n,r,o,i=(e=y?e.trim():d(e,3)).charCodeAt(0);if(43===i||45===i){if(88===(n=e.charCodeAt(2))||120===n)return NaN}else if(48===i){switch(e.charCodeAt(1)){case 66:case 98:r=2,o=49;break;case 79:case 111:r=8,o=55;break;default:return+e}for(var a,s=e.slice(2),c=0,f=s.length;c<f;c++)if((a=s.charCodeAt(c))<48||a>o)return NaN;return parseInt(s,r)}}return+e};if(!p(" 0o1")||!p("0b1")||p("+0x1")){p=function(t){var e=arguments.length<1?0:t,n=this;return n instanceof p&&(m?s((function(){g.valueOf.call(n)})):i(n)!=h)?a(new v(b(e)),n,p):b(e)};for(var w,E=n(1216)?c(v):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),x=0;E.length>x;x++)o(v,w=E[x])&&!o(p,w)&&l(p,w,f(v,w));p.prototype=g,g.constructor=p,n(6476)(r,h,p)}},7551:(t,e,n)=>{var r=n(7044);r(r.S,"Number",{EPSILON:Math.pow(2,-52)})},2929:(t,e,n)=>{var r=n(7044),o=n(7571).isFinite;r(r.S,"Number",{isFinite:function(t){return"number"==typeof t&&o(t)}})},215:(t,e,n)=>{var r=n(7044);r(r.S,"Number",{isInteger:n(1272)})},6183:(t,e,n)=>{var r=n(7044);r(r.S,"Number",{isNaN:function(t){return t!=t}})},8190:(t,e,n)=>{var r=n(7044),o=n(1272),i=Math.abs;r(r.S,"Number",{isSafeInteger:function(t){return o(t)&&i(t)<=9007199254740991}})},476:(t,e,n)=>{var r=n(7044);r(r.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},948:(t,e,n)=>{var r=n(7044);r(r.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},942:(t,e,n)=>{var r=n(7044),o=n(1885);r(r.S+r.F*(Number.parseFloat!=o),"Number",{parseFloat:o})},2870:(t,e,n)=>{var r=n(7044),o=n(343);r(r.S+r.F*(Number.parseInt!=o),"Number",{parseInt:o})},3053:(t,e,n)=>{"use strict";var r=n(7044),o=n(5845),i=n(8347),a=n(5458),u=1..toFixed,s=Math.floor,c=[0,0,0,0,0,0],f="Number.toFixed: incorrect invocation!",l="0",d=function(t,e){for(var n=-1,r=e;++n<6;)r+=t*c[n],c[n]=r%1e7,r=s(r/1e7)},h=function(t){for(var e=6,n=0;--e>=0;)n+=c[e],c[e]=s(n/t),n=n%t*1e7},p=function(){for(var t=6,e="";--t>=0;)if(""!==e||0===t||0!==c[t]){var n=String(c[t]);e=""===e?n:e+a.call(l,7-n.length)+n}return e},v=function(t,e,n){return 0===e?n:e%2==1?v(t,e-1,n*t):v(t*t,e/2,n)};r(r.P+r.F*(!!u&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!n(5338)((function(){u.call({})}))),"Number",{toFixed:function(t){var e,n,r,u,s=i(this,f),c=o(t),g="",m=l;if(c<0||c>20)throw RangeError(f);if(s!=s)return"NaN";if(s<=-1e21||s>=1e21)return String(s);if(s<0&&(g="-",s=-s),s>1e-21)if(e=function(t){for(var e=0,n=t;n>=4096;)e+=12,n/=4096;for(;n>=2;)e+=1,n/=2;return e}(s*v(2,69,1))-69,n=e<0?s*v(2,-e,1):s/v(2,e,1),n*=4503599627370496,(e=52-e)>0){for(d(0,n),r=c;r>=7;)d(1e7,0),r-=7;for(d(v(10,r,1),0),r=e-1;r>=23;)h(1<<23),r-=23;h(1<<r),d(1,1),h(2),m=p()}else d(0,n),d(1<<-e,0),m=p()+a.call(l,c);return c>0?g+((u=m.length)<=c?"0."+a.call(l,c-u)+m:m.slice(0,u-c)+"."+m.slice(u-c)):g+m}})},8032:(t,e,n)=>{"use strict";var r=n(7044),o=n(5338),i=n(8347),a=1..toPrecision;r(r.P+r.F*(o((function(){return"1"!==a.call(1,void 0)}))||!o((function(){a.call({})}))),"Number",{toPrecision:function(t){var e=i(this,"Number#toPrecision: incorrect invocation!");return void 0===t?a.call(e):a.call(e,t)}})},5261:(t,e,n)=>{var r=n(7044);r(r.S+r.F,"Object",{assign:n(4643)})},6051:(t,e,n)=>{var r=n(7044);r(r.S,"Object",{create:n(9055)})},9518:(t,e,n)=>{var r=n(7044);r(r.S+r.F*!n(1216),"Object",{defineProperties:n(6283)})},2640:(t,e,n)=>{var r=n(7044);r(r.S+r.F*!n(1216),"Object",{defineProperty:n(3886).f})},9788:(t,e,n)=>{var r=n(1255),o=n(4278).onFreeze;n(381)("freeze",(function(t){return function(e){return t&&r(e)?t(o(e)):e}}))},8201:(t,e,n)=>{var r=n(8182),o=n(5385).f;n(381)("getOwnPropertyDescriptor",(function(){return function(t,e){return o(r(t),e)}}))},7525:(t,e,n)=>{n(381)("getOwnPropertyNames",(function(){return n(3473).f}))},470:(t,e,n)=>{var r=n(7583),o=n(9881);n(381)("getPrototypeOf",(function(){return function(t){return o(r(t))}}))},7940:(t,e,n)=>{var r=n(1255);n(381)("isExtensible",(function(t){return function(e){return!!r(e)&&(!t||t(e))}}))},6129:(t,e,n)=>{var r=n(1255);n(381)("isFrozen",(function(t){return function(e){return!r(e)||!!t&&t(e)}}))},2802:(t,e,n)=>{var r=n(1255);n(381)("isSealed",(function(t){return function(e){return!r(e)||!!t&&t(e)}}))},9340:(t,e,n)=>{var r=n(7044);r(r.S,"Object",{is:n(6962)})},5723:(t,e,n)=>{var r=n(7583),o=n(9804);n(381)("keys",(function(){return function(t){return o(r(t))}}))},7577:(t,e,n)=>{var r=n(1255),o=n(4278).onFreeze;n(381)("preventExtensions",(function(t){return function(e){return t&&r(e)?t(o(e)):e}}))},1498:(t,e,n)=>{var r=n(1255),o=n(4278).onFreeze;n(381)("seal",(function(t){return function(e){return t&&r(e)?t(o(e)):e}}))},1584:(t,e,n)=>{var r=n(7044);r(r.S,"Object",{setPrototypeOf:n(473).set})},7298:(t,e,n)=>{"use strict";var r=n(4939),o={};o[n(341)("toStringTag")]="z",o+""!="[object z]"&&n(6476)(Object.prototype,"toString",(function(){return"[object "+r(this)+"]"}),!0)},2809:(t,e,n)=>{var r=n(7044),o=n(1885);r(r.G+r.F*(parseFloat!=o),{parseFloat:o})},2784:(t,e,n)=>{var r=n(7044),o=n(343);r(r.G+r.F*(parseInt!=o),{parseInt:o})},7843:(t,e,n)=>{"use strict";var r,o,i,a,u=n(2725),s=n(7571),c=n(994),f=n(4939),l=n(7044),d=n(1255),h=n(1464),p=n(6903),v=n(9822),g=n(8713),m=n(7225).set,y=n(7485)(),b=n(449),w=n(9696),E=n(2541),x=n(909),_="Promise",S=s.TypeError,A=s.process,I=A&&A.versions,T=I&&I.v8||"",O=s[_],N="process"==f(A),D=function(){},M=o=b.f,k=!!function(){try{var t=O.resolve(1),e=(t.constructor={})[n(341)("species")]=function(t){t(D,D)};return(N||"function"==typeof PromiseRejectionEvent)&&t.then(D)instanceof e&&0!==T.indexOf("6.6")&&-1===E.indexOf("Chrome/66")}catch(t){}}(),R=function(t){var e;return!(!d(t)||"function"!=typeof(e=t.then))&&e},C=function(t,e){if(!t._n){t._n=!0;var n=t._c;y((function(){for(var r=t._v,o=1==t._s,i=0,a=function(e){var n,i,a,u=o?e.ok:e.fail,s=e.resolve,c=e.reject,f=e.domain;try{u?(o||(2==t._h&&j(t),t._h=1),!0===u?n=r:(f&&f.enter(),n=u(r),f&&(f.exit(),a=!0)),n===e.promise?c(S("Promise-chain cycle")):(i=R(n))?i.call(n,s,c):s(n)):c(r)}catch(t){f&&!a&&f.exit(),c(t)}};n.length>i;)a(n[i++]);t._c=[],t._n=!1,e&&!t._h&&L(t)}))}},L=function(t){m.call(s,(function(){var e,n,r,o=t._v,i=P(t);if(i&&(e=w((function(){N?A.emit("unhandledRejection",o,t):(n=s.onunhandledrejection)?n({promise:t,reason:o}):(r=s.console)&&r.error&&r.error("Unhandled promise rejection",o)})),t._h=N||P(t)?2:1),t._a=void 0,i&&e.e)throw e.v}))},P=function(t){return 1!==t._h&&0===(t._a||t._c).length},j=function(t){m.call(s,(function(){var e;N?A.emit("rejectionHandled",t):(e=s.onrejectionhandled)&&e({promise:t,reason:t._v})}))},z=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),C(e,!0))},F=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw S("Promise can't be resolved itself");(e=R(t))?y((function(){var r={_w:n,_d:!1};try{e.call(t,c(F,r,1),c(z,r,1))}catch(t){z.call(r,t)}})):(n._v=t,n._s=1,C(n,!1))}catch(t){z.call({_w:n,_d:!1},t)}}};k||(O=function(t){p(this,O,_,"_h"),h(t),r.call(this);try{t(c(F,this,1),c(z,this,1))}catch(t){z.call(this,t)}},(r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(8565)(O.prototype,{then:function(t,e){var n=M(g(this,O));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=N?A.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&C(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),i=function(){var t=new r;this.promise=t,this.resolve=c(F,t,1),this.reject=c(z,t,1)},b.f=M=function(t){return t===O||t===a?new i(t):o(t)}),l(l.G+l.W+l.F*!k,{Promise:O}),n(5837)(O,_),n(4412)(_),a=n(2845)[_],l(l.S+l.F*!k,_,{reject:function(t){var e=M(this);return(0,e.reject)(t),e.promise}}),l(l.S+l.F*(u||!k),_,{resolve:function(t){return x(u&&this===a?O:this,t)}}),l(l.S+l.F*!(k&&n(2803)((function(t){O.all(t).catch(D)}))),_,{all:function(t){var e=this,n=M(e),r=n.resolve,o=n.reject,i=w((function(){var n=[],i=0,a=1;v(t,!1,(function(t){var u=i++,s=!1;n.push(void 0),a++,e.resolve(t).then((function(t){s||(s=!0,n[u]=t,--a||r(n))}),o)})),--a||r(n)}));return i.e&&o(i.v),n.promise},race:function(t){var e=this,n=M(e),r=n.reject,o=w((function(){v(t,!1,(function(t){e.resolve(t).then(n.resolve,r)}))}));return o.e&&r(o.v),n.promise}})},8275:(t,e,n)=>{var r=n(7044),o=n(1464),i=n(486),a=(n(7571).Reflect||{}).apply,u=Function.apply;r(r.S+r.F*!n(5338)((function(){a((function(){}))})),"Reflect",{apply:function(t,e,n){var r=o(t),s=i(n);return a?a(r,e,s):u.call(r,e,s)}})},2552:(t,e,n)=>{var r=n(7044),o=n(9055),i=n(1464),a=n(486),u=n(1255),s=n(5338),c=n(8366),f=(n(7571).Reflect||{}).construct,l=s((function(){function t(){}return!(f((function(){}),[],t)instanceof t)})),d=!s((function(){f((function(){}))}));r(r.S+r.F*(l||d),"Reflect",{construct:function(t,e){i(t),a(e);var n=arguments.length<3?t:i(arguments[2]);if(d&&!l)return f(t,e,n);if(t==n){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var r=[null];return r.push.apply(r,e),new(c.apply(t,r))}var s=n.prototype,h=o(u(s)?s:Object.prototype),p=Function.apply.call(t,h,e);return u(p)?p:h}})},3077:(t,e,n)=>{var r=n(3886),o=n(7044),i=n(486),a=n(4467);o(o.S+o.F*n(5338)((function(){Reflect.defineProperty(r.f({},1,{value:1}),1,{value:2})})),"Reflect",{defineProperty:function(t,e,n){i(t),e=a(e,!0),i(n);try{return r.f(t,e,n),!0}catch(t){return!1}}})},1031:(t,e,n)=>{var r=n(7044),o=n(5385).f,i=n(486);r(r.S,"Reflect",{deleteProperty:function(t,e){var n=o(i(t),e);return!(n&&!n.configurable)&&delete t[e]}})},8916:(t,e,n)=>{"use strict";var r=n(7044),o=n(486),i=function(t){this._t=o(t),this._i=0;var e,n=this._k=[];for(e in t)n.push(e)};n(4529)(i,"Object",(function(){var t,e=this,n=e._k;do{if(e._i>=n.length)return{value:void 0,done:!0}}while(!((t=n[e._i++])in e._t));return{value:t,done:!1}})),r(r.S,"Reflect",{enumerate:function(t){return new i(t)}})},8531:(t,e,n)=>{var r=n(5385),o=n(7044),i=n(486);o(o.S,"Reflect",{getOwnPropertyDescriptor:function(t,e){return r.f(i(t),e)}})},7323:(t,e,n)=>{var r=n(7044),o=n(9881),i=n(486);r(r.S,"Reflect",{getPrototypeOf:function(t){return o(i(t))}})},8978:(t,e,n)=>{var r=n(5385),o=n(9881),i=n(7384),a=n(7044),u=n(1255),s=n(486);a(a.S,"Reflect",{get:function t(e,n){var a,c,f=arguments.length<3?e:arguments[2];return s(e)===f?e[n]:(a=r.f(e,n))?i(a,"value")?a.value:void 0!==a.get?a.get.call(f):void 0:u(c=o(e))?t(c,n,f):void 0}})},3704:(t,e,n)=>{var r=n(7044);r(r.S,"Reflect",{has:function(t,e){return e in t}})},3153:(t,e,n)=>{var r=n(7044),o=n(486),i=Object.isExtensible;r(r.S,"Reflect",{isExtensible:function(t){return o(t),!i||i(t)}})},8812:(t,e,n)=>{var r=n(7044);r(r.S,"Reflect",{ownKeys:n(8125)})},2636:(t,e,n)=>{var r=n(7044),o=n(486),i=Object.preventExtensions;r(r.S,"Reflect",{preventExtensions:function(t){o(t);try{return i&&i(t),!0}catch(t){return!1}}})},377:(t,e,n)=>{var r=n(7044),o=n(473);o&&r(r.S,"Reflect",{setPrototypeOf:function(t,e){o.check(t,e);try{return o.set(t,e),!0}catch(t){return!1}}})},1602:(t,e,n)=>{var r=n(3886),o=n(5385),i=n(9881),a=n(7384),u=n(7044),s=n(8328),c=n(486),f=n(1255);u(u.S,"Reflect",{set:function t(e,n,u){var l,d,h=arguments.length<4?e:arguments[3],p=o.f(c(e),n);if(!p){if(f(d=i(e)))return t(d,n,u,h);p=s(0)}if(a(p,"value")){if(!1===p.writable||!f(h))return!1;if(l=o.f(h,n)){if(l.get||l.set||!1===l.writable)return!1;l.value=u,r.f(h,n,l)}else r.f(h,n,s(0,u));return!0}return void 0!==p.set&&(p.set.call(h,u),!0)}})},6668:(t,e,n)=>{var r=n(7571),o=n(116),i=n(3886).f,a=n(6907).f,u=n(8990),s=n(3649),c=r.RegExp,f=c,l=c.prototype,d=/a/g,h=/a/g,p=new c(d)!==d;if(n(1216)&&(!p||n(5338)((function(){return h[n(341)("match")]=!1,c(d)!=d||c(h)==h||"/a/i"!=c(d,"i")})))){c=function(t,e){var n=this instanceof c,r=u(t),i=void 0===e;return!n&&r&&t.constructor===c&&i?t:o(p?new f(r&&!i?t.source:t,e):f((r=t instanceof c)?t.source:t,r&&i?s.call(t):e),n?this:l,c)};for(var v=function(t){t in c||i(c,t,{configurable:!0,get:function(){return f[t]},set:function(e){f[t]=e}})},g=a(f),m=0;g.length>m;)v(g[m++]);l.constructor=c,c.prototype=l,n(6476)(r,"RegExp",c)}n(4412)("RegExp")},7139:(t,e,n)=>{"use strict";var r=n(9020);n(7044)({target:"RegExp",proto:!0,forced:r!==/./.exec},{exec:r})},8686:(t,e,n)=>{n(1216)&&"g"!=/./g.flags&&n(3886).f(RegExp.prototype,"flags",{configurable:!0,get:n(3649)})},5480:(t,e,n)=>{"use strict";var r=n(486),o=n(8087),i=n(178),a=n(2968);n(6719)("match",1,(function(t,e,n,u){return[function(n){var r=t(this),o=null==n?void 0:n[e];return void 0!==o?o.call(n,r):new RegExp(n)[e](String(r))},function(t){var e=u(n,t,this);if(e.done)return e.value;var s=r(t),c=String(this);if(!s.global)return a(s,c);var f=s.unicode;s.lastIndex=0;for(var l,d=[],h=0;null!==(l=a(s,c));){var p=String(l[0]);d[h]=p,""===p&&(s.lastIndex=i(c,o(s.lastIndex),f)),h++}return 0===h?null:d}]}))},9121:(t,e,n)=>{"use strict";var r=n(486),o=n(7583),i=n(8087),a=n(5845),u=n(178),s=n(2968),c=Math.max,f=Math.min,l=Math.floor,d=/\$([$&`']|\d\d?|<[^>]*>)/g,h=/\$([$&`']|\d\d?)/g;n(6719)("replace",2,(function(t,e,n,p){return[function(r,o){var i=t(this),a=null==r?void 0:r[e];return void 0!==a?a.call(r,i,o):n.call(String(i),r,o)},function(t,e){var o=p(n,t,this,e);if(o.done)return o.value;var l=r(t),d=String(this),h="function"==typeof e;h||(e=String(e));var g=l.global;if(g){var m=l.unicode;l.lastIndex=0}for(var y=[];;){var b=s(l,d);if(null===b)break;if(y.push(b),!g)break;""===String(b[0])&&(l.lastIndex=u(d,i(l.lastIndex),m))}for(var w,E="",x=0,_=0;_<y.length;_++){b=y[_];for(var S=String(b[0]),A=c(f(a(b.index),d.length),0),I=[],T=1;T<b.length;T++)I.push(void 0===(w=b[T])?w:String(w));var O=b.groups;if(h){var N=[S].concat(I,A,d);void 0!==O&&N.push(O);var D=String(e.apply(void 0,N))}else D=v(S,d,A,I,O,e);A>=x&&(E+=d.slice(x,A)+D,x=A+S.length)}return E+d.slice(x)}];function v(t,e,r,i,a,u){var s=r+t.length,c=i.length,f=h;return void 0!==a&&(a=o(a),f=d),n.call(u,f,(function(n,o){var u;switch(o.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,r);case"'":return e.slice(s);case"<":u=a[o.slice(1,-1)];break;default:var f=+o;if(0===f)return n;if(f>c){var d=l(f/10);return 0===d?n:d<=c?void 0===i[d-1]?o.charAt(1):i[d-1]+o.charAt(1):n}u=i[f-1]}return void 0===u?"":u}))}}))},914:(t,e,n)=>{"use strict";var r=n(486),o=n(6962),i=n(2968);n(6719)("search",1,(function(t,e,n,a){return[function(n){var r=t(this),o=null==n?void 0:n[e];return void 0!==o?o.call(n,r):new RegExp(n)[e](String(r))},function(t){var e=a(n,t,this);if(e.done)return e.value;var u=r(t),s=String(this),c=u.lastIndex;o(c,0)||(u.lastIndex=0);var f=i(u,s);return o(u.lastIndex,c)||(u.lastIndex=c),null===f?-1:f.index}]}))},7742:(t,e,n)=>{"use strict";var r=n(8990),o=n(486),i=n(8713),a=n(178),u=n(8087),s=n(2968),c=n(9020),f=n(5338),l=Math.min,d=[].push,h="split",p="length",v="lastIndex",g=4294967295,m=!f((function(){RegExp(g,"y")}));n(6719)("split",2,(function(t,e,n,f){var y;return y="c"=="abbc"[h](/(b)*/)[1]||4!="test"[h](/(?:)/,-1)[p]||2!="ab"[h](/(?:ab)*/)[p]||4!="."[h](/(.?)(.?)/)[p]||"."[h](/()()/)[p]>1||""[h](/.?/)[p]?function(t,e){var o=String(this);if(void 0===t&&0===e)return[];if(!r(t))return n.call(o,t,e);for(var i,a,u,s=[],f=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),l=0,h=void 0===e?g:e>>>0,m=new RegExp(t.source,f+"g");(i=c.call(m,o))&&!((a=m[v])>l&&(s.push(o.slice(l,i.index)),i[p]>1&&i.index<o[p]&&d.apply(s,i.slice(1)),u=i[0][p],l=a,s[p]>=h));)m[v]===i.index&&m[v]++;return l===o[p]?!u&&m.test("")||s.push(""):s.push(o.slice(l)),s[p]>h?s.slice(0,h):s}:"0"[h](void 0,0)[p]?function(t,e){return void 0===t&&0===e?[]:n.call(this,t,e)}:n,[function(n,r){var o=t(this),i=null==n?void 0:n[e];return void 0!==i?i.call(n,o,r):y.call(String(o),n,r)},function(t,e){var r=f(y,t,this,e,y!==n);if(r.done)return r.value;var c=o(t),d=String(this),h=i(c,RegExp),p=c.unicode,v=(c.ignoreCase?"i":"")+(c.multiline?"m":"")+(c.unicode?"u":"")+(m?"y":"g"),b=new h(m?c:"^(?:"+c.source+")",v),w=void 0===e?g:e>>>0;if(0===w)return[];if(0===d.length)return null===s(b,d)?[d]:[];for(var E=0,x=0,_=[];x<d.length;){b.lastIndex=m?x:0;var S,A=s(b,m?d:d.slice(x));if(null===A||(S=l(u(b.lastIndex+(m?0:x)),d.length))===E)x=a(d,x,p);else{if(_.push(d.slice(E,x)),_.length===w)return _;for(var I=1;I<=A.length-1;I++)if(_.push(A[I]),_.length===w)return _;x=E=S}}return _.push(d.slice(E)),_}]}))},6408:(t,e,n)=>{"use strict";n(8686);var r=n(486),o=n(3649),i=n(1216),a="toString",u=/./[a],s=function(t){n(6476)(RegExp.prototype,a,t,!0)};n(5338)((function(){return"/a/b"!=u.call({source:"a",flags:"b"})}))?s((function(){var t=r(this);return"/".concat(t.source,"/","flags"in t?t.flags:!i&&t instanceof RegExp?o.call(t):void 0)})):u.name!=a&&s((function(){return u.call(this)}))},429:(t,e,n)=>{"use strict";var r=n(3050),o=n(4664);t.exports=n(859)("Set",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(t){return r.def(o(this,"Set"),t=0===t?0:t,t)}},r)},3157:(t,e,n)=>{"use strict";n(5264)("anchor",(function(t){return function(e){return t(this,"a","name",e)}}))},9791:(t,e,n)=>{"use strict";n(5264)("big",(function(t){return function(){return t(this,"big","","")}}))},2296:(t,e,n)=>{"use strict";n(5264)("blink",(function(t){return function(){return t(this,"blink","","")}}))},4555:(t,e,n)=>{"use strict";n(5264)("bold",(function(t){return function(){return t(this,"b","","")}}))},8316:(t,e,n)=>{"use strict";var r=n(7044),o=n(8016)(!1);r(r.P,"String",{codePointAt:function(t){return o(this,t)}})},7937:(t,e,n)=>{"use strict";var r=n(7044),o=n(8087),i=n(5692),a="endsWith",u=""[a];r(r.P+r.F*n(2910)(a),"String",{endsWith:function(t){var e=i(this,t,a),n=arguments.length>1?arguments[1]:void 0,r=o(e.length),s=void 0===n?r:Math.min(o(n),r),c=String(t);return u?u.call(e,c,s):e.slice(s-c.length,s)===c}})},6505:(t,e,n)=>{"use strict";n(5264)("fixed",(function(t){return function(){return t(this,"tt","","")}}))},4722:(t,e,n)=>{"use strict";n(5264)("fontcolor",(function(t){return function(e){return t(this,"font","color",e)}}))},9713:(t,e,n)=>{"use strict";n(5264)("fontsize",(function(t){return function(e){return t(this,"font","size",e)}}))},1028:(t,e,n)=>{var r=n(7044),o=n(9260),i=String.fromCharCode,a=String.fromCodePoint;r(r.S+r.F*(!!a&&1!=a.length),"String",{fromCodePoint:function(t){for(var e,n=[],r=arguments.length,a=0;r>a;){if(e=+arguments[a++],o(e,1114111)!==e)throw RangeError(e+" is not a valid code point");n.push(e<65536?i(e):i(55296+((e-=65536)>>10),e%1024+56320))}return n.join("")}})},637:(t,e,n)=>{"use strict";var r=n(7044),o=n(5692),i="includes";r(r.P+r.F*n(2910)(i),"String",{includes:function(t){return!!~o(this,t,i).indexOf(t,arguments.length>1?arguments[1]:void 0)}})},7392:(t,e,n)=>{"use strict";n(5264)("italics",(function(t){return function(){return t(this,"i","","")}}))},7938:(t,e,n)=>{"use strict";var r=n(8016)(!0);n(966)(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})}))},4687:(t,e,n)=>{"use strict";n(5264)("link",(function(t){return function(e){return t(this,"a","href",e)}}))},6818:(t,e,n)=>{var r=n(7044),o=n(8182),i=n(8087);r(r.S,"String",{raw:function(t){for(var e=o(t.raw),n=i(e.length),r=arguments.length,a=[],u=0;n>u;)a.push(String(e[u++])),u<r&&a.push(String(arguments[u]));return a.join("")}})},8219:(t,e,n)=>{var r=n(7044);r(r.P,"String",{repeat:n(5458)})},3684:(t,e,n)=>{"use strict";n(5264)("small",(function(t){return function(){return t(this,"small","","")}}))},9029:(t,e,n)=>{"use strict";var r=n(7044),o=n(8087),i=n(5692),a="startsWith",u=""[a];r(r.P+r.F*n(2910)(a),"String",{startsWith:function(t){var e=i(this,t,a),n=o(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),r=String(t);return u?u.call(e,r,n):e.slice(n,n+r.length)===r}})},3339:(t,e,n)=>{"use strict";n(5264)("strike",(function(t){return function(){return t(this,"strike","","")}}))},4148:(t,e,n)=>{"use strict";n(5264)("sub",(function(t){return function(){return t(this,"sub","","")}}))},7754:(t,e,n)=>{"use strict";n(5264)("sup",(function(t){return function(){return t(this,"sup","","")}}))},5557:(t,e,n)=>{"use strict";n(4961)("trim",(function(t){return function(){return t(this,3)}}))},2825:(t,e,n)=>{"use strict";var r=n(7571),o=n(7384),i=n(1216),a=n(7044),u=n(6476),s=n(4278).KEY,c=n(5338),f=n(5570),l=n(5837),d=n(4316),h=n(341),p=n(7686),v=n(6262),g=n(6397),m=n(7183),y=n(486),b=n(1255),w=n(7583),E=n(8182),x=n(4467),_=n(8328),S=n(9055),A=n(3473),I=n(5385),T=n(3844),O=n(3886),N=n(9804),D=I.f,M=O.f,k=A.f,R=r.Symbol,C=r.JSON,L=C&&C.stringify,P="prototype",j=h("_hidden"),z=h("toPrimitive"),F={}.propertyIsEnumerable,G=f("symbol-registry"),U=f("symbols"),B=f("op-symbols"),V=Object[P],W="function"==typeof R&&!!T.f,X=r.QObject,H=!X||!X[P]||!X[P].findChild,q=i&&c((function(){return 7!=S(M({},"a",{get:function(){return M(this,"a",{value:7}).a}})).a}))?function(t,e,n){var r=D(V,e);r&&delete V[e],M(t,e,n),r&&t!==V&&M(V,e,r)}:M,Y=function(t){var e=U[t]=S(R[P]);return e._k=t,e},K=W&&"symbol"==typeof R.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof R},Z=function(t,e,n){return t===V&&Z(B,e,n),y(t),e=x(e,!0),y(n),o(U,e)?(n.enumerable?(o(t,j)&&t[j][e]&&(t[j][e]=!1),n=S(n,{enumerable:_(0,!1)})):(o(t,j)||M(t,j,_(1,{})),t[j][e]=!0),q(t,e,n)):M(t,e,n)},$=function(t,e){y(t);for(var n,r=g(e=E(e)),o=0,i=r.length;i>o;)Z(t,n=r[o++],e[n]);return t},Q=function(t){var e=F.call(this,t=x(t,!0));return!(this===V&&o(U,t)&&!o(B,t))&&(!(e||!o(this,t)||!o(U,t)||o(this,j)&&this[j][t])||e)},J=function(t,e){if(t=E(t),e=x(e,!0),t!==V||!o(U,e)||o(B,e)){var n=D(t,e);return!n||!o(U,e)||o(t,j)&&t[j][e]||(n.enumerable=!0),n}},tt=function(t){for(var e,n=k(E(t)),r=[],i=0;n.length>i;)o(U,e=n[i++])||e==j||e==s||r.push(e);return r},et=function(t){for(var e,n=t===V,r=k(n?B:E(t)),i=[],a=0;r.length>a;)!o(U,e=r[a++])||n&&!o(V,e)||i.push(U[e]);return i};W||(u((R=function(){if(this instanceof R)throw TypeError("Symbol is not a constructor!");var t=d(arguments.length>0?arguments[0]:void 0),e=function(n){this===V&&e.call(B,n),o(this,j)&&o(this[j],t)&&(this[j][t]=!1),q(this,t,_(1,n))};return i&&H&&q(V,t,{configurable:!0,set:e}),Y(t)})[P],"toString",(function(){return this._k})),I.f=J,O.f=Z,n(6907).f=A.f=tt,n(4179).f=Q,T.f=et,i&&!n(2725)&&u(V,"propertyIsEnumerable",Q,!0),p.f=function(t){return Y(h(t))}),a(a.G+a.W+a.F*!W,{Symbol:R});for(var nt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),rt=0;nt.length>rt;)h(nt[rt++]);for(var ot=N(h.store),it=0;ot.length>it;)v(ot[it++]);a(a.S+a.F*!W,"Symbol",{for:function(t){return o(G,t+="")?G[t]:G[t]=R(t)},keyFor:function(t){if(!K(t))throw TypeError(t+" is not a symbol!");for(var e in G)if(G[e]===t)return e},useSetter:function(){H=!0},useSimple:function(){H=!1}}),a(a.S+a.F*!W,"Object",{create:function(t,e){return void 0===e?S(t):$(S(t),e)},defineProperty:Z,defineProperties:$,getOwnPropertyDescriptor:J,getOwnPropertyNames:tt,getOwnPropertySymbols:et});var at=c((function(){T.f(1)}));a(a.S+a.F*at,"Object",{getOwnPropertySymbols:function(t){return T.f(w(t))}}),C&&a(a.S+a.F*(!W||c((function(){var t=R();return"[null]"!=L([t])||"{}"!=L({a:t})||"{}"!=L(Object(t))}))),"JSON",{stringify:function(t){for(var e,n,r=[t],o=1;arguments.length>o;)r.push(arguments[o++]);if(n=e=r[1],(b(e)||void 0!==t)&&!K(t))return m(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!K(e))return e}),r[1]=e,L.apply(C,r)}}),R[P][z]||n(913)(R[P],z,R[P].valueOf),l(R,"Symbol"),l(Math,"Math",!0),l(r.JSON,"JSON",!0)},6349:(t,e,n)=>{"use strict";var r=n(7044),o=n(604),i=n(1541),a=n(486),u=n(9260),s=n(8087),c=n(1255),f=n(7571).ArrayBuffer,l=n(8713),d=i.ArrayBuffer,h=i.DataView,p=o.ABV&&f.isView,v=d.prototype.slice,g=o.VIEW,m="ArrayBuffer";r(r.G+r.W+r.F*(f!==d),{ArrayBuffer:d}),r(r.S+r.F*!o.CONSTR,m,{isView:function(t){return p&&p(t)||c(t)&&g in t}}),r(r.P+r.U+r.F*n(5338)((function(){return!new d(2).slice(1,void 0).byteLength})),m,{slice:function(t,e){if(void 0!==v&&void 0===e)return v.call(a(this),t);for(var n=a(this).byteLength,r=u(t,n),o=u(void 0===e?n:e,n),i=new(l(this,d))(s(o-r)),c=new h(this),f=new h(i),p=0;r<o;)f.setUint8(p++,c.getUint8(r++));return i}}),n(4412)(m)},3742:(t,e,n)=>{var r=n(7044);r(r.G+r.W+r.F*!n(604).ABV,{DataView:n(1541).DataView})},3421:(t,e,n)=>{n(1063)("Float32",4,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},6144:(t,e,n)=>{n(1063)("Float64",8,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},9363:(t,e,n)=>{n(1063)("Int16",2,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},8632:(t,e,n)=>{n(1063)("Int32",4,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},9604:(t,e,n)=>{n(1063)("Int8",1,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},3871:(t,e,n)=>{n(1063)("Uint16",2,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},1838:(t,e,n)=>{n(1063)("Uint32",4,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},2592:(t,e,n)=>{n(1063)("Uint8",1,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},9290:(t,e,n)=>{n(1063)("Uint8",1,(function(t){return function(e,n,r){return t(this,e,n,r)}}),!0)},2214:(t,e,n)=>{"use strict";var r,o=n(7571),i=n(7622)(0),a=n(6476),u=n(4278),s=n(4643),c=n(1990),f=n(1255),l=n(4664),d=n(4664),h=!o.ActiveXObject&&"ActiveXObject"in o,p="WeakMap",v=u.getWeak,g=Object.isExtensible,m=c.ufstore,y=function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},b={get:function(t){if(f(t)){var e=v(t);return!0===e?m(l(this,p)).get(t):e?e[this._i]:void 0}},set:function(t,e){return c.def(l(this,p),t,e)}},w=t.exports=n(859)(p,y,b,c,!0,!0);d&&h&&(s((r=c.getConstructor(y,p)).prototype,b),u.NEED=!0,i(["delete","has","get","set"],(function(t){var e=w.prototype,n=e[t];a(e,t,(function(e,o){if(f(e)&&!g(e)){this._f||(this._f=new r);var i=this._f[t](e,o);return"set"==t?this:i}return n.call(this,e,o)}))})))},498:(t,e,n)=>{"use strict";var r=n(1990),o=n(4664),i="WeakSet";n(859)(i,(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(t){return r.def(o(this,i),t,!0)}},r,!1,!0)},7744:(t,e,n)=>{"use strict";var r=n(7044),o=n(6806),i=n(7583),a=n(8087),u=n(1464),s=n(6699);r(r.P,"Array",{flatMap:function(t){var e,n,r=i(this);return u(t),e=a(r.length),n=s(r,0),o(n,r,r,e,0,1,t,arguments[1]),n}}),n(4691)("flatMap")},5448:(t,e,n)=>{"use strict";var r=n(7044),o=n(4538)(!0);r(r.P,"Array",{includes:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),n(4691)("includes")},8938:(t,e,n)=>{var r=n(7044),o=n(6460)(!0);r(r.S,"Object",{entries:function(t){return o(t)}})},7819:(t,e,n)=>{var r=n(7044),o=n(8125),i=n(8182),a=n(5385),u=n(1395);r(r.S,"Object",{getOwnPropertyDescriptors:function(t){for(var e,n,r=i(t),s=a.f,c=o(r),f={},l=0;c.length>l;)void 0!==(n=s(r,e=c[l++]))&&u(f,e,n);return f}})},6572:(t,e,n)=>{var r=n(7044),o=n(6460)(!1);r(r.S,"Object",{values:function(t){return o(t)}})},8228:(t,e,n)=>{"use strict";var r=n(7044),o=n(2845),i=n(7571),a=n(8713),u=n(909);r(r.P+r.R,"Promise",{finally:function(t){var e=a(this,o.Promise||i.Promise),n="function"==typeof t;return this.then(n?function(n){return u(e,t()).then((function(){return n}))}:t,n?function(n){return u(e,t()).then((function(){throw n}))}:t)}})},3336:(t,e,n)=>{"use strict";var r=n(7044),o=n(8261),i=n(2541),a=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(i);r(r.P+r.F*a,"String",{padEnd:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0,!1)}})},3718:(t,e,n)=>{"use strict";var r=n(7044),o=n(8261),i=n(2541),a=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(i);r(r.P+r.F*a,"String",{padStart:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0,!0)}})},7831:(t,e,n)=>{"use strict";n(4961)("trimLeft",(function(t){return function(){return t(this,1)}}),"trimStart")},6642:(t,e,n)=>{"use strict";n(4961)("trimRight",(function(t){return function(){return t(this,2)}}),"trimEnd")},9956:(t,e,n)=>{n(6262)("asyncIterator")},4367:(t,e,n)=>{for(var r=n(163),o=n(9804),i=n(6476),a=n(7571),u=n(913),s=n(9740),c=n(341),f=c("iterator"),l=c("toStringTag"),d=s.Array,h={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},p=o(h),v=0;v<p.length;v++){var g,m=p[v],y=h[m],b=a[m],w=b&&b.prototype;if(w&&(w[f]||u(w,f,d),w[l]||u(w,l,m),s[m]=d,y))for(g in r)w[g]||i(w,g,r[g],!0)}},4433:(t,e,n)=>{var r=n(7044),o=n(7225);r(r.G+r.B,{setImmediate:o.set,clearImmediate:o.clear})},110:(t,e,n)=>{var r=n(7571),o=n(7044),i=n(2541),a=[].slice,u=/MSIE .\./.test(i),s=function(t){return function(e,n){var r=arguments.length>2,o=!!r&&a.call(arguments,2);return t(r?function(){("function"==typeof e?e:Function(e)).apply(this,o)}:e,n)}};o(o.G+o.B+o.F*u,{setTimeout:s(r.setTimeout),setInterval:s(r.setInterval)})},4962:(t,e,n)=>{n(110),n(4433),n(4367),t.exports=n(2845)},1869:(t,e,n)=>{var r=n(3152).Symbol;t.exports=r},6756:(t,e,n)=>{var r=n(1869),o=n(2533),i=n(4702),a=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?o(t):i(t)}},766:(t,e,n)=>{var r=n(6756),o=n(1156),i=n(3913),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exports=function(t){return i(t)&&o(t.length)&&!!a[r(t)]}},8342:t=>{t.exports=function(t){return function(e){return t(e)}}},7675:(t,e,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=r},9217:(t,e,n)=>{var r=n(1030)(Object.getPrototypeOf,Object);t.exports=r},2533:(t,e,n)=>{var r=n(1869),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,u=r?r.toStringTag:void 0;t.exports=function(t){var e=i.call(t,u),n=t[u];try{t[u]=void 0;var r=!0}catch(t){}var o=a.call(t);return r&&(e?t[u]=n:delete t[u]),o}},2495:(t,e,n)=>{t=n.nmd(t);var r=n(7675),o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,a=i&&i.exports===o&&r.process,u=function(){try{return i&&i.require&&i.require("util").types||a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=u},4702:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},1030:t=>{t.exports=function(t,e){return function(n){return t(e(n))}}},3152:(t,e,n)=>{var r=n(7675),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i},744:t=>{var e=Array.isArray;t.exports=e},1156:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},8868:(t,e,n)=>{var r=n(6756),o=n(3913);t.exports=function(t){return"number"==typeof t||o(t)&&"[object Number]"==r(t)}},3913:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},9308:(t,e,n)=>{var r=n(6756),o=n(9217),i=n(3913),a=Function.prototype,u=Object.prototype,s=a.toString,c=u.hasOwnProperty,f=s.call(Object);t.exports=function(t){if(!i(t)||"[object Object]"!=r(t))return!1;var e=o(t);if(null===e)return!0;var n=c.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&s.call(n)==f}},8397:(t,e,n)=>{var r=n(766),o=n(8342),i=n(2495),a=i&&i.isTypedArray,u=a?o(a):r;t.exports=u},8246:t=>{var e=function(t){"use strict";var e,n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),u=new D(r||[]);return o(a,"_invoke",{value:I(t,n,u)}),a}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=f;var d="suspendedStart",h="suspendedYield",p="executing",v="completed",g={};function m(){}function y(){}function b(){}var w={};c(w,a,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(M([])));x&&x!==n&&r.call(x,a)&&(w=x);var _=b.prototype=m.prototype=Object.create(w);function S(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function n(o,i,a,u){var s=l(t[o],t,i);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==typeof f&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,u)}))}u(s.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function I(t,e,n){var r=d;return function(o,i){if(r===p)throw new Error("Generator is already running");if(r===v){if("throw"===o)throw i;return k()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=T(a,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var s=l(t,e,n);if("normal"===s.type){if(r=n.done?v:h,s.arg===g)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r=v,n.method="throw",n.arg=s.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=l(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function M(t){if(t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}return{next:k}}function k(){return{value:e,done:!0}}return y.prototype=b,o(_,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:y,configurable:!0}),y.displayName=c(b,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,s,"GeneratorFunction")),t.prototype=Object.create(_),t},t.awrap=function(t){return{__await:t}},S(A.prototype),c(A.prototype,u,(function(){return this})),t.AsyncIterator=A,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new A(f(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(_),c(_,s,"Generator"),c(_,a,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=M,D.prototype={constructor:D,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(N),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return u.type="throw",u.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),N(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;N(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},6377:function(t){t.exports=function(){"use strict";var t=function(t){return t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Float32Array||t instanceof Float64Array||t instanceof Uint8ClampedArray},e=function(t,e){for(var n=Object.keys(e),r=0;r<n.length;++r)t[n[r]]=e[n[r]];return t},n="\n";function r(t){var e=new Error("(regl) "+t);throw console.error(e),e}function o(t,e){t||r(e)}function i(t){return t?": "+t:""}function a(t,e){switch(e){case"number":return"number"==typeof t;case"object":return"object"==typeof t;case"string":return"string"==typeof t;case"boolean":return"boolean"==typeof t;case"function":return"function"==typeof t;case"undefined":return void 0===t;case"symbol":return"symbol"==typeof t}}function u(t,e,n){e.indexOf(t)<0&&r("invalid value"+i(n)+". must be one of: "+e)}var s=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function c(t,e){for(t+="";t.length<e;)t=" "+t;return t}function f(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function l(t,e){this.number=t,this.line=e,this.errors=[]}function d(t,e,n){this.file=t,this.line=e,this.message=n}function h(){var t=new Error,e=(t.stack||t).toString(),n=/compileProcedure.*\n\s*at.*\((.*)\)/.exec(e);if(n)return n[1];var r=/compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(e);return r?r[1]:"unknown"}function p(){var t=new Error,e=(t.stack||t).toString(),n=/at REGLCommand.*\n\s+at.*\((.*)\)/.exec(e);if(n)return n[1];var r=/at REGLCommand.*\n\s+at\s+(.*)\n/.exec(e);return r?r[1]:"unknown"}function v(t,e){var n,r=t.split("\n"),o=1,i=0,a={unknown:new f,0:new f};a.unknown.name=a[0].name=e||h(),a.unknown.lines.push(new l(0,""));for(var u=0;u<r.length;++u){var s=r[u],c=/^\s*#\s*(\w+)\s+(.+)\s*$/.exec(s);if(c)switch(c[1]){case"line":var d=/(\d+)(\s+\d+)?/.exec(c[2]);d&&(o=0|d[1],d[2]&&((i=0|d[2])in a||(a[i]=new f)));break;case"define":var p=/SHADER_NAME(_B64)?\s+(.*)$/.exec(c[2]);p&&(a[i].name=p[1]?(n=p[2],"undefined"!=typeof atob?atob(n):"base64:"+n):p[2])}a[i].lines.push(new l(o++,s))}return Object.keys(a).forEach((function(t){var e=a[t];e.lines.forEach((function(t){e.index[t.number]=t}))})),a}function g(t){t._commandRef=h()}function m(t,e){var n=p();r(t+" in command "+(e||h())+("unknown"===n?"":" called from "+n))}function y(t,e,n,r){a(t,e)||m("invalid parameter type"+i(n)+". expected "+e+", got "+typeof t,r||h())}var b=33071,w=32819,E=32820,x=33635,_=34042,S={};function A(t,e){return t===E||t===w||t===x?2:t===_?4:S[t]*e}function I(t){return!(t&t-1||!t)}S[5120]=S[5121]=1,S[5122]=S[5123]=S[36193]=S[x]=S[w]=S[E]=2,S[5124]=S[5125]=S[5126]=S[_]=4;var T=e(o,{optional:function(t){t()},raise:r,commandRaise:m,command:function(t,e,n){t||m(e,n||h())},parameter:function(t,e,n){t in e||r("unknown parameter ("+t+")"+i(n)+". possible values: "+Object.keys(e).join())},commandParameter:function(t,e,n,r){t in e||m("unknown parameter ("+t+")"+i(n)+". possible values: "+Object.keys(e).join(),r||h())},constructor:function(t){Object.keys(t).forEach((function(t){s.indexOf(t)<0&&r('invalid regl constructor argument "'+t+'". must be one of '+s)}))},type:function(t,e,n){a(t,e)||r("invalid parameter type"+i(n)+". expected "+e+", got "+typeof t)},commandType:y,isTypedArray:function(e,n){t(e)||r("invalid parameter type"+i(n)+". must be a typed array")},nni:function(t,e){t>=0&&(0|t)===t||r("invalid parameter type, ("+t+")"+i(e)+". must be a nonnegative integer")},oneOf:u,shaderError:function(t,e,r,i,a){if(!t.getShaderParameter(e,t.COMPILE_STATUS)){var u=t.getShaderInfoLog(e),s=i===t.FRAGMENT_SHADER?"fragment":"vertex";y(r,"string",s+" shader source must be a string",a);var f=v(r,a),l=function(t){var e=[];return t.split("\n").forEach((function(t){if(!(t.length<5)){var n=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(t);n?e.push(new d(0|n[1],0|n[2],n[3].trim())):t.length>0&&e.push(new d("unknown",0,t))}})),e}(u);(function(t,e){e.forEach((function(e){var n=t[e.file];if(n){var r=n.index[e.line];if(r)return r.errors.push(e),void(n.hasErrors=!0)}t.unknown.hasErrors=!0,t.unknown.lines[0].errors.push(e)}))})(f,l),Object.keys(f).forEach((function(t){var e=f[t];if(e.hasErrors){var r=[""],o=[""];i("file number "+t+": "+e.name+"\n","color:red;text-decoration:underline;font-weight:bold"),e.lines.forEach((function(t){if(t.errors.length>0){i(c(t.number,4)+"| ","background-color:yellow; font-weight:bold"),i(t.line+n,"color:red; background-color:yellow; font-weight:bold");var e=0;t.errors.forEach((function(r){var o=r.message,a=/^\s*'(.*)'\s*:\s*(.*)$/.exec(o);if(a){var u=a[1];o=a[2],"assign"===u&&(u="="),e=Math.max(t.line.indexOf(u,e),0)}else e=0;i(c("| ",6)),i(c("^^^",e+3)+n,"font-weight:bold"),i(c("| ",6)),i(o+n,"font-weight:bold")})),i(c("| ",6)+n)}else i(c(t.number,4)+"| "),i(t.line+n,"color:red")})),"undefined"==typeof document||window.chrome?console.log(r.join("")):(o[0]=r.join("%c"),console.log.apply(console,o))}function i(t,e){r.push(t),o.push(e||"")}})),o.raise("Error compiling "+s+" shader, "+f[0].name)}},linkError:function(t,e,r,i,a){if(!t.getProgramParameter(e,t.LINK_STATUS)){var u=t.getProgramInfoLog(e),s=v(r,a),c='Error linking program with vertex shader, "'+v(i,a)[0].name+'", and fragment shader "'+s[0].name+'"';"undefined"!=typeof document?console.log("%c"+c+"\n%c"+u,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(c+n+u),o.raise(c)}},callSite:p,saveCommandRef:g,saveDrawInfo:function(t,e,n,r){function o(t){return t?r.id(t):0}function i(t,e){Object.keys(e).forEach((function(e){t[r.id(e)]=!0}))}g(t),t._fragId=o(t.static.frag),t._vertId=o(t.static.vert);var a=t._uniformSet={};i(a,e.static),i(a,e.dynamic);var u=t._attributeSet={};i(u,n.static),i(u,n.dynamic),t._hasCount="count"in t.static||"count"in t.dynamic||"elements"in t.static||"elements"in t.dynamic},framebufferFormat:function(t,e,n){t.texture?u(t.texture._texture.internalformat,e,"unsupported texture format for attachment"):u(t.renderbuffer._renderbuffer.format,n,"unsupported renderbuffer format for attachment")},guessCommand:h,texture2D:function(t,e,n){var r,i=e.width,a=e.height,u=e.channels;o(i>0&&i<=n.maxTextureSize&&a>0&&a<=n.maxTextureSize,"invalid texture shape"),t.wrapS===b&&t.wrapT===b||o(I(i)&&I(a),"incompatible wrap mode for texture, both width and height must be power of 2"),1===e.mipmask?1!==i&&1!==a&&o(9984!==t.minFilter&&9986!==t.minFilter&&9985!==t.minFilter&&9987!==t.minFilter,"min filter requires mipmap"):(o(I(i)&&I(a),"texture must be a square power of 2 to support mipmapping"),o(e.mipmask===(i<<1)-1,"missing or incomplete mipmap data")),5126===e.type&&(n.extensions.indexOf("oes_texture_float_linear")<0&&o(9728===t.minFilter&&9728===t.magFilter,"filter not supported, must enable oes_texture_float_linear"),o(!t.genMipmaps,"mipmap generation not supported with float textures"));var s=e.images;for(r=0;r<16;++r)if(s[r]){var c=i>>r,f=a>>r;o(e.mipmask&1<<r,"missing mipmap data");var l=s[r];if(o(l.width===c&&l.height===f,"invalid shape for mip images"),o(l.format===e.format&&l.internalformat===e.internalformat&&l.type===e.type,"incompatible type for mip image"),l.compressed);else if(l.data){var d=Math.ceil(A(l.type,u)*c/l.unpackAlignment)*l.unpackAlignment;o(l.data.byteLength===d*f,"invalid data for image, buffer size is inconsistent with image format")}else l.element||l.copy}else t.genMipmaps||o(0==(e.mipmask&1<<r),"extra mipmap data");e.compressed&&o(!t.genMipmaps,"mipmap generation for compressed images not supported")},textureCube:function(t,e,n,r){var i=t.width,a=t.height,u=t.channels;o(i>0&&i<=r.maxTextureSize&&a>0&&a<=r.maxTextureSize,"invalid texture shape"),o(i===a,"cube map must be square"),o(e.wrapS===b&&e.wrapT===b,"wrap mode not supported by cube map");for(var s=0;s<n.length;++s){var c=n[s];o(c.width===i&&c.height===a,"inconsistent cube map face shape"),e.genMipmaps&&(o(!c.compressed,"can not generate mipmap for compressed textures"),o(1===c.mipmask,"can not specify mipmaps and generate mipmaps"));for(var f=c.images,l=0;l<16;++l){var d=f[l];if(d){var h=i>>l,p=a>>l;o(c.mipmask&1<<l,"missing mipmap data"),o(d.width===h&&d.height===p,"invalid shape for mip images"),o(d.format===t.format&&d.internalformat===t.internalformat&&d.type===t.type,"incompatible type for mip image"),d.compressed||(d.data?o(d.data.byteLength===h*p*Math.max(A(d.type,u),d.unpackAlignment),"invalid data for image, buffer size is inconsistent with image format"):d.element||d.copy)}}}}}),O=0;function N(t,e){this.id=O++,this.type=t,this.data=e}function D(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function M(t){if(0===t.length)return[];var e=t.charAt(0),n=t.charAt(t.length-1);if(t.length>1&&e===n&&('"'===e||"'"===e))return['"'+D(t.substr(1,t.length-2))+'"'];var r=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(t);if(r)return M(t.substr(0,r.index)).concat(M(r[1])).concat(M(t.substr(r.index+r[0].length)));var o=t.split(".");if(1===o.length)return['"'+D(t)+'"'];for(var i=[],a=0;a<o.length;++a)i=i.concat(M(o[a]));return i}function k(t){return"["+M(t).join("][")+"]"}var R={DynamicVariable:N,define:function(t,e){return new N(t,k(e+""))},isDynamic:function(t){return"function"==typeof t&&!t._reglType||t instanceof N},unbox:function t(e,n){return"function"==typeof e?new N(0,e):"number"==typeof e||"boolean"==typeof e?new N(5,e):Array.isArray(e)?new N(6,e.map(((e,r)=>t(e,n+"["+r+"]")))):e instanceof N?e:void T(!1,"invalid option type in uniform "+n)},accessor:k},C={next:"function"==typeof requestAnimationFrame?function(t){return requestAnimationFrame(t)}:function(t){return setTimeout(t,16)},cancel:"function"==typeof cancelAnimationFrame?function(t){return cancelAnimationFrame(t)}:clearTimeout},L="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date};function P(t){return"string"==typeof t?t.split():(T(Array.isArray(t),"invalid extension array"),t)}function j(t){return"string"==typeof t?(T("undefined"!=typeof document,"not supported outside of DOM"),document.querySelector(t)):t}function z(t){var n,r,o,i,a,u=t||{},s={},c=[],f=[],l="undefined"==typeof window?1:window.devicePixelRatio,d=!1,h=function(t){t&&T.raise(t)},p=function(){};if("string"==typeof u?(T("undefined"!=typeof document,"selector queries only supported in DOM enviroments"),n=document.querySelector(u),T(n,"invalid query string for element")):"object"==typeof u?"string"==typeof(a=u).nodeName&&"function"==typeof a.appendChild&&"function"==typeof a.getBoundingClientRect?n=u:function(t){return"function"==typeof t.drawArrays||"function"==typeof t.drawElements}(u)?o=(i=u).canvas:(T.constructor(u),"gl"in u?i=u.gl:"canvas"in u?o=j(u.canvas):"container"in u&&(r=j(u.container)),"attributes"in u&&(s=u.attributes,T.type(s,"object","invalid context attributes")),"extensions"in u&&(c=P(u.extensions)),"optionalExtensions"in u&&(f=P(u.optionalExtensions)),"onDone"in u&&(T.type(u.onDone,"function","invalid or missing onDone callback"),h=u.onDone),"profile"in u&&(d=!!u.profile),"pixelRatio"in u&&(l=+u.pixelRatio,T(l>0,"invalid pixel ratio"))):T.raise("invalid arguments to regl"),n&&("canvas"===n.nodeName.toLowerCase()?o=n:r=n),!i){if(!o){T("undefined"!=typeof document,"must manually specify webgl context outside of DOM environments");var v=function(t,n,r){var o,i=document.createElement("canvas");function a(){var n=window.innerWidth,o=window.innerHeight;if(t!==document.body){var a=t.getBoundingClientRect();n=a.right-a.left,o=a.bottom-a.top}i.width=r*n,i.height=r*o,e(i.style,{width:n+"px",height:o+"px"})}return e(i.style,{border:0,margin:0,padding:0,top:0,left:0}),t.appendChild(i),t===document.body&&(i.style.position="absolute",e(t.style,{margin:0,padding:0})),t!==document.body&&"function"==typeof ResizeObserver?(o=new ResizeObserver((function(){setTimeout(a)}))).observe(t):window.addEventListener("resize",a,!1),a(),{canvas:i,onDestroy:function(){o?o.disconnect():window.removeEventListener("resize",a),t.removeChild(i)}}}(r||document.body,0,l);if(!v)return null;o=v.canvas,p=v.onDestroy}void 0===s.premultipliedAlpha&&(s.premultipliedAlpha=!0),i=function(t,e){function n(n){try{return t.getContext(n,e)}catch(t){return null}}return n("webgl")||n("experimental-webgl")||n("webgl-experimental")}(o,s)}return i?{gl:i,canvas:o,container:r,extensions:c,optionalExtensions:f,pixelRatio:l,profile:d,onDone:h,onDestroy:p}:(p(),h("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function F(t,e){for(var n=Array(t),r=0;r<t;++r)n[r]=e(r);return n}function G(t){var e,n;return e=(t>65535)<<4,e|=n=((t>>>=e)>255)<<3,e|=n=((t>>>=n)>15)<<2,(e|=n=((t>>>=n)>3)<<1)|(t>>>=n)>>1}function U(){var t=F(8,(function(){return[]}));function e(e){var n=function(t){for(var e=16;e<=1<<28;e*=16)if(t<=e)return e;return 0}(e),r=t[G(n)>>2];return r.length>0?r.pop():new ArrayBuffer(n)}function n(e){t[G(e.byteLength)>>2].push(e)}return{alloc:e,free:n,allocType:function(t,n){var r=null;switch(t){case 5120:r=new Int8Array(e(n),0,n);break;case 5121:r=new Uint8Array(e(n),0,n);break;case 5122:r=new Int16Array(e(2*n),0,n);break;case 5123:r=new Uint16Array(e(2*n),0,n);break;case 5124:r=new Int32Array(e(4*n),0,n);break;case 5125:r=new Uint32Array(e(4*n),0,n);break;case 5126:r=new Float32Array(e(4*n),0,n);break;default:return null}return r.length!==n?r.subarray(0,n):r},freeType:function(t){n(t.buffer)}}}var B=U();B.zero=U();var V=3553,W=6408,X=5126,H=36160;function q(e){return!!e&&"object"==typeof e&&Array.isArray(e.shape)&&Array.isArray(e.stride)&&"number"==typeof e.offset&&e.shape.length===e.stride.length&&(Array.isArray(e.data)||t(e.data))}var Y=function(t){return Object.keys(t).map((function(e){return t[e]}))},K={shape:function(t){for(var e=[],n=t;n.length;n=n[0])e.push(n.length);return e},flatten:function(t,e,n,r){var o=1;if(e.length)for(var i=0;i<e.length;++i)o*=e[i];else o=0;var a=r||B.allocType(n,o);switch(e.length){case 0:break;case 1:!function(t,e,n){for(var r=0;r<e;++r)n[r]=t[r]}(t,e[0],a);break;case 2:!function(t,e,n,r){for(var o=0,i=0;i<e;++i)for(var a=t[i],u=0;u<n;++u)r[o++]=a[u]}(t,e[0],e[1],a);break;case 3:Z(t,e[0],e[1],e[2],a,0);break;default:$(t,e,0,a,0)}return a}};function Z(t,e,n,r,o,i){for(var a=i,u=0;u<e;++u)for(var s=t[u],c=0;c<n;++c)for(var f=s[c],l=0;l<r;++l)o[a++]=f[l]}function $(t,e,n,r,o){for(var i=1,a=n+1;a<e.length;++a)i*=e[a];var u=e[n];if(e.length-n==4){var s=e[n+1],c=e[n+2],f=e[n+3];for(a=0;a<u;++a)Z(t[a],s,c,f,r,o),o+=i}else for(a=0;a<u;++a)$(t[a],e,n+1,r,o),o+=i}var Q={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},J={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},tt={dynamic:35048,stream:35040,static:35044},et=K.flatten,nt=K.shape,rt=35044,ot=35040,it=5121,at=5126,ut=[];function st(t){return 0|Q[Object.prototype.toString.call(t)]}function ct(t,e){for(var n=0;n<e.length;++n)t[n]=e[n]}function ft(t,e,n,r,o,i,a){for(var u=0,s=0;s<n;++s)for(var c=0;c<r;++c)t[u++]=e[o*s+i*c+a]}ut[5120]=1,ut[5122]=2,ut[5124]=4,ut[5121]=1,ut[5123]=2,ut[5125]=4,ut[5126]=4;var lt={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},dt=0,ht=1,pt=4,vt=5120,gt=5121,mt=5122,yt=5123,bt=5124,wt=5125,Et=34963,xt=35040,_t=35044;var St=new Float32Array(1),At=new Uint32Array(St.buffer),It=5123;function Tt(t){for(var e=B.allocType(It,t.length),n=0;n<t.length;++n)if(isNaN(t[n]))e[n]=65535;else if(t[n]===1/0)e[n]=31744;else if(t[n]===-1/0)e[n]=64512;else{St[0]=t[n];var r=At[0],o=r>>>31<<15,i=(r<<1>>>24)-127,a=r>>13&1023;if(i<-24)e[n]=o;else if(i<-14){var u=-14-i;e[n]=o+(a+1024>>u)}else e[n]=i>15?o+31744:o+(i+15<<10)+a}return e}function Ot(e){return Array.isArray(e)||t(e)}var Nt=function(t){return!(t&t-1||!t)},Dt=34467,Mt=3553,kt=34067,Rt=34069,Ct=6408,Lt=6406,Pt=6407,jt=6409,zt=6410,Ft=32854,Gt=32855,Ut=36194,Bt=32819,Vt=32820,Wt=33635,Xt=34042,Ht=6402,qt=34041,Yt=35904,Kt=35906,Zt=36193,$t=33776,Qt=33777,Jt=33778,te=33779,ee=35986,ne=35987,re=34798,oe=35840,ie=35841,ae=35842,ue=35843,se=36196,ce=5121,fe=5123,le=5125,de=5126,he=10242,pe=10243,ve=10497,ge=33071,me=33648,ye=10240,be=10241,we=9728,Ee=9729,xe=9984,_e=9985,Se=9986,Ae=9987,Ie=33170,Te=4352,Oe=4353,Ne=4354,De=34046,Me=3317,ke=37440,Re=37441,Ce=37443,Le=37444,Pe=33984,je=[xe,Se,_e,Ae],ze=[0,jt,zt,Pt,Ct],Fe={};function Ge(t){return"[object "+t+"]"}Fe[jt]=Fe[Lt]=Fe[Ht]=1,Fe[qt]=Fe[zt]=2,Fe[Pt]=Fe[Yt]=3,Fe[Ct]=Fe[Kt]=4;var Ue=Ge("HTMLCanvasElement"),Be=Ge("OffscreenCanvas"),Ve=Ge("CanvasRenderingContext2D"),We=Ge("ImageBitmap"),Xe=Ge("HTMLImageElement"),He=Ge("HTMLVideoElement"),qe=Object.keys(Q).concat([Ue,Be,Ve,We,Xe,He]),Ye=[];Ye[ce]=1,Ye[de]=4,Ye[Zt]=2,Ye[fe]=2,Ye[le]=4;var Ke=[];function Ze(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function $e(t){return!!Array.isArray(t)&&!(0===t.length||!Ot(t[0]))}function Qe(t){return Object.prototype.toString.call(t)}function Je(t){return Qe(t)===Ue}function tn(t){return Qe(t)===Be}function en(t){if(!t)return!1;var e=Qe(t);return qe.indexOf(e)>=0||Ze(t)||$e(t)||q(t)}function nn(t){return 0|Q[Object.prototype.toString.call(t)]}function rn(t,e){return B.allocType(t.type===Zt?de:t.type,e)}function on(t,e){t.type===Zt?(t.data=Tt(e),B.freeType(e)):t.data=e}function an(t,e,n,r,o,i){var a;if(a=void 0!==Ke[t]?Ke[t]:Fe[t]*Ye[e],i&&(a*=6),o){for(var u=0,s=n;s>=1;)u+=a*s*s,s/=2;return u}return a*n*r}function un(n,r,o,i,a,u,s){var c={"don't care":Te,"dont care":Te,nice:Ne,fast:Oe},f={repeat:ve,clamp:ge,mirror:me},l={nearest:we,linear:Ee},d=e({mipmap:Ae,"nearest mipmap nearest":xe,"linear mipmap nearest":_e,"nearest mipmap linear":Se,"linear mipmap linear":Ae},l),h={none:0,browser:Le},p={uint8:ce,rgba4:Bt,rgb565:Wt,"rgb5 a1":Vt},v={alpha:Lt,luminance:jt,"luminance alpha":zt,rgb:Pt,rgba:Ct,rgba4:Ft,"rgb5 a1":Gt,rgb565:Ut},g={};r.ext_srgb&&(v.srgb=Yt,v.srgba=Kt),r.oes_texture_float&&(p.float32=p.float=de),r.oes_texture_half_float&&(p.float16=p["half float"]=Zt),r.webgl_depth_texture&&(e(v,{depth:Ht,"depth stencil":qt}),e(p,{uint16:fe,uint32:le,"depth stencil":Xt})),r.webgl_compressed_texture_s3tc&&e(g,{"rgb s3tc dxt1":$t,"rgba s3tc dxt1":Qt,"rgba s3tc dxt3":Jt,"rgba s3tc dxt5":te}),r.webgl_compressed_texture_atc&&e(g,{"rgb atc":ee,"rgba atc explicit alpha":ne,"rgba atc interpolated alpha":re}),r.webgl_compressed_texture_pvrtc&&e(g,{"rgb pvrtc 4bppv1":oe,"rgb pvrtc 2bppv1":ie,"rgba pvrtc 4bppv1":ae,"rgba pvrtc 2bppv1":ue}),r.webgl_compressed_texture_etc1&&(g["rgb etc1"]=se);var m=Array.prototype.slice.call(n.getParameter(Dt));Object.keys(g).forEach((function(t){var e=g[t];m.indexOf(e)>=0&&(v[t]=e)}));var y=Object.keys(v);o.textureFormats=y;var b=[];Object.keys(v).forEach((function(t){var e=v[t];b[e]=t}));var w=[];Object.keys(p).forEach((function(t){var e=p[t];w[e]=t}));var E=[];Object.keys(l).forEach((function(t){var e=l[t];E[e]=t}));var x=[];Object.keys(d).forEach((function(t){var e=d[t];x[e]=t}));var _=[];Object.keys(f).forEach((function(t){var e=f[t];_[e]=t}));var S=y.reduce((function(t,e){var n=v[e];return n===jt||n===Lt||n===jt||n===zt||n===Ht||n===qt||r.ext_srgb&&(n===Yt||n===Kt)?t[n]=n:n===Gt||e.indexOf("rgba")>=0?t[n]=Ct:t[n]=Pt,t}),{});function A(){this.internalformat=Ct,this.format=Ct,this.type=ce,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=Le,this.width=0,this.height=0,this.channels=0}function I(t,e){t.internalformat=e.internalformat,t.format=e.format,t.type=e.type,t.compressed=e.compressed,t.premultiplyAlpha=e.premultiplyAlpha,t.flipY=e.flipY,t.unpackAlignment=e.unpackAlignment,t.colorSpace=e.colorSpace,t.width=e.width,t.height=e.height,t.channels=e.channels}function O(t,e){if("object"==typeof e&&e){if("premultiplyAlpha"in e&&(T.type(e.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),t.premultiplyAlpha=e.premultiplyAlpha),"flipY"in e&&(T.type(e.flipY,"boolean","invalid texture flip"),t.flipY=e.flipY),"alignment"in e&&(T.oneOf(e.alignment,[1,2,4,8],"invalid texture unpack alignment"),t.unpackAlignment=e.alignment),"colorSpace"in e&&(T.parameter(e.colorSpace,h,"invalid colorSpace"),t.colorSpace=h[e.colorSpace]),"type"in e){var n=e.type;T(r.oes_texture_float||!("float"===n||"float32"===n),"you must enable the OES_texture_float extension in order to use floating point textures."),T(r.oes_texture_half_float||!("half float"===n||"float16"===n),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),T(r.webgl_depth_texture||!("uint16"===n||"uint32"===n||"depth stencil"===n),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),T.parameter(n,p,"invalid texture type"),t.type=p[n]}var i=t.width,a=t.height,u=t.channels,s=!1;"shape"in e?(T(Array.isArray(e.shape)&&e.shape.length>=2,"shape must be an array"),i=e.shape[0],a=e.shape[1],3===e.shape.length&&(u=e.shape[2],T(u>0&&u<=4,"invalid number of channels"),s=!0),T(i>=0&&i<=o.maxTextureSize,"invalid width"),T(a>=0&&a<=o.maxTextureSize,"invalid height")):("radius"in e&&(i=a=e.radius,T(i>=0&&i<=o.maxTextureSize,"invalid radius")),"width"in e&&(i=e.width,T(i>=0&&i<=o.maxTextureSize,"invalid width")),"height"in e&&(a=e.height,T(a>=0&&a<=o.maxTextureSize,"invalid height")),"channels"in e&&(u=e.channels,T(u>0&&u<=4,"invalid number of channels"),s=!0)),t.width=0|i,t.height=0|a,t.channels=0|u;var c=!1;if("format"in e){var f=e.format;T(r.webgl_depth_texture||!("depth"===f||"depth stencil"===f),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),T.parameter(f,v,"invalid texture format");var l=t.internalformat=v[f];t.format=S[l],f in p&&("type"in e||(t.type=p[f])),f in g&&(t.compressed=!0),c=!0}!s&&c?t.channels=Fe[t.format]:s&&!c?t.channels!==ze[t.format]&&(t.format=t.internalformat=ze[t.channels]):c&&s&&T(t.channels===Fe[t.format],"number of channels inconsistent with specified format")}}function N(t){n.pixelStorei(ke,t.flipY),n.pixelStorei(Re,t.premultiplyAlpha),n.pixelStorei(Ce,t.colorSpace),n.pixelStorei(Me,t.unpackAlignment)}function D(){A.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function M(e,n){var r=null;if(en(n)?r=n:n&&(T.type(n,"object","invalid pixel data type"),O(e,n),"x"in n&&(e.xOffset=0|n.x),"y"in n&&(e.yOffset=0|n.y),en(n.data)&&(r=n.data)),T(!e.compressed||r instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),n.copy){T(!r,"can not specify copy and data field for the same texture");var i=a.viewportWidth,u=a.viewportHeight;e.width=e.width||i-e.xOffset,e.height=e.height||u-e.yOffset,e.needsCopy=!0,T(e.xOffset>=0&&e.xOffset<i&&e.yOffset>=0&&e.yOffset<u&&e.width>0&&e.width<=i&&e.height>0&&e.height<=u,"copy texture read out of bounds")}else if(r){if(t(r))e.channels=e.channels||4,e.data=r,"type"in n||e.type!==ce||(e.type=nn(r));else if(Ze(r))e.channels=e.channels||4,function(t,e){var n=e.length;switch(t.type){case ce:case fe:case le:case de:var r=B.allocType(t.type,n);r.set(e),t.data=r;break;case Zt:t.data=Tt(e);break;default:T.raise("unsupported texture type, must specify a typed array")}}(e,r),e.alignment=1,e.needsFree=!0;else if(q(r)){var s=r.data;Array.isArray(s)||e.type!==ce||(e.type=nn(s));var c,f,l,d,h,p,v=r.shape,g=r.stride;3===v.length?(l=v[2],p=g[2]):(T(2===v.length,"invalid ndarray pixel data, must be 2 or 3D"),l=1,p=1),c=v[0],f=v[1],d=g[0],h=g[1],e.alignment=1,e.width=c,e.height=f,e.channels=l,e.format=e.internalformat=ze[l],e.needsFree=!0,function(t,e,n,r,o,i){for(var a=t.width,u=t.height,s=t.channels,c=rn(t,a*u*s),f=0,l=0;l<u;++l)for(var d=0;d<a;++d)for(var h=0;h<s;++h)c[f++]=e[n*d+r*l+o*h+i];on(t,c)}(e,s,d,h,p,r.offset)}else if(Je(r)||tn(r)||Qe(r)===Ve)Je(r)||tn(r)?e.element=r:e.element=r.canvas,e.width=e.element.width,e.height=e.element.height,e.channels=4;else if(function(t){return Qe(t)===We}(r))e.element=r,e.width=r.width,e.height=r.height,e.channels=4;else if(function(t){return Qe(t)===Xe}(r))e.element=r,e.width=r.naturalWidth,e.height=r.naturalHeight,e.channels=4;else if(function(t){return Qe(t)===He}(r))e.element=r,e.width=r.videoWidth,e.height=r.videoHeight,e.channels=4;else if($e(r)){var m=e.width||r[0].length,y=e.height||r.length,b=e.channels;b=Ot(r[0][0])?b||r[0][0].length:b||1;for(var w=K.shape(r),E=1,x=0;x<w.length;++x)E*=w[x];var _=rn(e,E);K.flatten(r,w,"",_),on(e,_),e.alignment=1,e.width=m,e.height=y,e.channels=b,e.format=e.internalformat=ze[b],e.needsFree=!0}}else e.width=e.width||1,e.height=e.height||1,e.channels=e.channels||4;e.type===de?T(o.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):e.type===Zt&&T(o.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function k(t,e,r){var o=t.element,a=t.data,u=t.internalformat,s=t.format,c=t.type,f=t.width,l=t.height;N(t),o?n.texImage2D(e,r,s,s,c,o):t.compressed?n.compressedTexImage2D(e,r,u,f,l,0,a):t.needsCopy?(i(),n.copyTexImage2D(e,r,s,t.xOffset,t.yOffset,f,l,0)):n.texImage2D(e,r,s,f,l,0,s,c,a||null)}function R(t,e,r,o,a){var u=t.element,s=t.data,c=t.internalformat,f=t.format,l=t.type,d=t.width,h=t.height;N(t),u?n.texSubImage2D(e,a,r,o,f,l,u):t.compressed?n.compressedTexSubImage2D(e,a,r,o,c,d,h,s):t.needsCopy?(i(),n.copyTexSubImage2D(e,a,r,o,t.xOffset,t.yOffset,d,h)):n.texSubImage2D(e,a,r,o,d,h,f,l,s)}var C=[];function L(){return C.pop()||new D}function P(t){t.needsFree&&B.freeType(t.data),D.call(t),C.push(t)}function j(){A.call(this),this.genMipmaps=!1,this.mipmapHint=Te,this.mipmask=0,this.images=Array(16)}function z(t,e,n){var r=t.images[0]=L();t.mipmask=1,r.width=t.width=e,r.height=t.height=n,r.channels=t.channels=4}function F(t,e){var n=null;if(en(e))I(n=t.images[0]=L(),t),M(n,e),t.mipmask=1;else if(O(t,e),Array.isArray(e.mipmap))for(var r=e.mipmap,o=0;o<r.length;++o)I(n=t.images[o]=L(),t),n.width>>=o,n.height>>=o,M(n,r[o]),t.mipmask|=1<<o;else I(n=t.images[0]=L(),t),M(n,e),t.mipmask=1;I(t,t.images[0]),!t.compressed||t.internalformat!==$t&&t.internalformat!==Qt&&t.internalformat!==Jt&&t.internalformat!==te||T(t.width%4==0&&t.height%4==0,"for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4")}function G(t,e){for(var n=t.images,r=0;r<n.length;++r){if(!n[r])return;k(n[r],e,r)}}var U=[];function V(){var t=U.pop()||new j;A.call(t),t.mipmask=0;for(var e=0;e<16;++e)t.images[e]=null;return t}function W(t){for(var e=t.images,n=0;n<e.length;++n)e[n]&&P(e[n]),e[n]=null;U.push(t)}function X(){this.minFilter=we,this.magFilter=we,this.wrapS=ge,this.wrapT=ge,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=Te}function H(t,e){if("min"in e){var n=e.min;T.parameter(n,d),t.minFilter=d[n],je.indexOf(t.minFilter)>=0&&!("faces"in e)&&(t.genMipmaps=!0)}if("mag"in e){var r=e.mag;T.parameter(r,l),t.magFilter=l[r]}var i=t.wrapS,a=t.wrapT;if("wrap"in e){var u=e.wrap;"string"==typeof u?(T.parameter(u,f),i=a=f[u]):Array.isArray(u)&&(T.parameter(u[0],f),T.parameter(u[1],f),i=f[u[0]],a=f[u[1]])}else{if("wrapS"in e){var s=e.wrapS;T.parameter(s,f),i=f[s]}if("wrapT"in e){var h=e.wrapT;T.parameter(h,f),a=f[h]}}if(t.wrapS=i,t.wrapT=a,"anisotropic"in e){var p=e.anisotropic;T("number"==typeof p&&p>=1&&p<=o.maxAnisotropic,"aniso samples must be between 1 and "),t.anisotropic=e.anisotropic}if("mipmap"in e){var v=!1;switch(typeof e.mipmap){case"string":T.parameter(e.mipmap,c,"invalid mipmap hint"),t.mipmapHint=c[e.mipmap],t.genMipmaps=!0,v=!0;break;case"boolean":v=t.genMipmaps=e.mipmap;break;case"object":T(Array.isArray(e.mipmap),"invalid mipmap type"),t.genMipmaps=!1,v=!0;break;default:T.raise("invalid mipmap type")}v&&!("min"in e)&&(t.minFilter=xe)}}function Z(t,e){n.texParameteri(e,be,t.minFilter),n.texParameteri(e,ye,t.magFilter),n.texParameteri(e,he,t.wrapS),n.texParameteri(e,pe,t.wrapT),r.ext_texture_filter_anisotropic&&n.texParameteri(e,De,t.anisotropic),t.genMipmaps&&(n.hint(Ie,t.mipmapHint),n.generateMipmap(e))}var $=0,Q={},J=o.maxTextureUnits,tt=Array(J).map((function(){return null}));function et(t){A.call(this),this.mipmask=0,this.internalformat=Ct,this.id=$++,this.refCount=1,this.target=t,this.texture=n.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new X,s.profile&&(this.stats={size:0})}function nt(t){n.activeTexture(Pe),n.bindTexture(t.target,t.texture)}function rt(){var t=tt[0];t?n.bindTexture(t.target,t.texture):n.bindTexture(Mt,null)}function ot(t){var e=t.texture;T(e,"must not double destroy texture");var r=t.unit,o=t.target;r>=0&&(n.activeTexture(Pe+r),n.bindTexture(o,null),tt[r]=null),n.deleteTexture(e),t.texture=null,t.params=null,t.pixels=null,t.refCount=0,delete Q[t.id],u.textureCount--}return e(et.prototype,{bind:function(){var t=this;t.bindCount+=1;var e=t.unit;if(e<0){for(var r=0;r<J;++r){var o=tt[r];if(o){if(o.bindCount>0)continue;o.unit=-1}tt[r]=t,e=r;break}e>=J&&T.raise("insufficient number of texture units"),s.profile&&u.maxTextureUnits<e+1&&(u.maxTextureUnits=e+1),t.unit=e,n.activeTexture(Pe+e),n.bindTexture(t.target,t.texture)}return e},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&ot(this)}}),s.profile&&(u.getTotalTextureSize=function(){var t=0;return Object.keys(Q).forEach((function(e){t+=Q[e].stats.size})),t}),{create2D:function(t,e){var r=new et(Mt);function i(t,e){var n=r.texInfo;X.call(n);var a=V();return"number"==typeof t?z(a,0|t,"number"==typeof e?0|e:0|t):t?(T.type(t,"object","invalid arguments to regl.texture"),H(n,t),F(a,t)):z(a,1,1),n.genMipmaps&&(a.mipmask=(a.width<<1)-1),r.mipmask=a.mipmask,I(r,a),T.texture2D(n,a,o),r.internalformat=a.internalformat,i.width=a.width,i.height=a.height,nt(r),G(a,Mt),Z(n,Mt),rt(),W(a),s.profile&&(r.stats.size=an(r.internalformat,r.type,a.width,a.height,n.genMipmaps,!1)),i.format=b[r.internalformat],i.type=w[r.type],i.mag=E[n.magFilter],i.min=x[n.minFilter],i.wrapS=_[n.wrapS],i.wrapT=_[n.wrapT],i}return Q[r.id]=r,u.textureCount++,i(t,e),i.subimage=function(t,e,n,o){T(!!t,"must specify image data");var a=0|e,u=0|n,s=0|o,c=L();return I(c,r),c.width=0,c.height=0,M(c,t),c.width=c.width||(r.width>>s)-a,c.height=c.height||(r.height>>s)-u,T(r.type===c.type&&r.format===c.format&&r.internalformat===c.internalformat,"incompatible format for texture.subimage"),T(a>=0&&u>=0&&a+c.width<=r.width&&u+c.height<=r.height,"texture.subimage write out of bounds"),T(r.mipmask&1<<s,"missing mipmap data"),T(c.data||c.element||c.needsCopy,"missing image data"),nt(r),R(c,Mt,a,u,s),rt(),P(c),i},i.resize=function(t,e){var o=0|t,a=0|e||o;if(o===r.width&&a===r.height)return i;i.width=r.width=o,i.height=r.height=a,nt(r);for(var u=0;r.mipmask>>u;++u){var c=o>>u,f=a>>u;if(!c||!f)break;n.texImage2D(Mt,u,r.format,c,f,0,r.format,r.type,null)}return rt(),s.profile&&(r.stats.size=an(r.internalformat,r.type,o,a,!1,!1)),i},i._reglType="texture2d",i._texture=r,s.profile&&(i.stats=r.stats),i.destroy=function(){r.decRef()},i},createCube:function(t,e,r,i,a,c){var f=new et(kt);Q[f.id]=f,u.cubeCount++;var l=new Array(6);function d(t,e,n,r,i,a){var u,c=f.texInfo;for(X.call(c),u=0;u<6;++u)l[u]=V();if("number"!=typeof t&&t)if("object"==typeof t)if(e)F(l[0],t),F(l[1],e),F(l[2],n),F(l[3],r),F(l[4],i),F(l[5],a);else if(H(c,t),O(f,t),"faces"in t){var h=t.faces;for(T(Array.isArray(h)&&6===h.length,"cube faces must be a length 6 array"),u=0;u<6;++u)T("object"==typeof h[u]&&!!h[u],"invalid input for cube map face"),I(l[u],f),F(l[u],h[u])}else for(u=0;u<6;++u)F(l[u],t);else T.raise("invalid arguments to cube map");else{var p=0|t||1;for(u=0;u<6;++u)z(l[u],p,p)}for(I(f,l[0]),o.npotTextureCube||T(Nt(f.width)&&Nt(f.height),"your browser does not support non power or two texture dimensions"),c.genMipmaps?f.mipmask=(l[0].width<<1)-1:f.mipmask=l[0].mipmask,T.textureCube(f,c,l,o),f.internalformat=l[0].internalformat,d.width=l[0].width,d.height=l[0].height,nt(f),u=0;u<6;++u)G(l[u],Rt+u);for(Z(c,kt),rt(),s.profile&&(f.stats.size=an(f.internalformat,f.type,d.width,d.height,c.genMipmaps,!0)),d.format=b[f.internalformat],d.type=w[f.type],d.mag=E[c.magFilter],d.min=x[c.minFilter],d.wrapS=_[c.wrapS],d.wrapT=_[c.wrapT],u=0;u<6;++u)W(l[u]);return d}return d(t,e,r,i,a,c),d.subimage=function(t,e,n,r,o){T(!!e,"must specify image data"),T("number"==typeof t&&t===(0|t)&&t>=0&&t<6,"invalid face");var i=0|n,a=0|r,u=0|o,s=L();return I(s,f),s.width=0,s.height=0,M(s,e),s.width=s.width||(f.width>>u)-i,s.height=s.height||(f.height>>u)-a,T(f.type===s.type&&f.format===s.format&&f.internalformat===s.internalformat,"incompatible format for texture.subimage"),T(i>=0&&a>=0&&i+s.width<=f.width&&a+s.height<=f.height,"texture.subimage write out of bounds"),T(f.mipmask&1<<u,"missing mipmap data"),T(s.data||s.element||s.needsCopy,"missing image data"),nt(f),R(s,Rt+t,i,a,u),rt(),P(s),d},d.resize=function(t){var e=0|t;if(e!==f.width){d.width=f.width=e,d.height=f.height=e,nt(f);for(var r=0;r<6;++r)for(var o=0;f.mipmask>>o;++o)n.texImage2D(Rt+r,o,f.format,e>>o,e>>o,0,f.format,f.type,null);return rt(),s.profile&&(f.stats.size=an(f.internalformat,f.type,d.width,d.height,!1,!0)),d}},d._reglType="textureCube",d._texture=f,s.profile&&(d.stats=f.stats),d.destroy=function(){f.decRef()},d},clear:function(){for(var t=0;t<J;++t)n.activeTexture(Pe+t),n.bindTexture(Mt,null),tt[t]=null;Y(Q).forEach(ot),u.cubeCount=0,u.textureCount=0},getTexture:function(t){return null},restore:function(){for(var t=0;t<J;++t){var e=tt[t];e&&(e.bindCount=0,e.unit=-1,tt[t]=null)}Y(Q).forEach((function(t){t.texture=n.createTexture(),n.bindTexture(t.target,t.texture);for(var e=0;e<32;++e)if(0!=(t.mipmask&1<<e))if(t.target===Mt)n.texImage2D(Mt,e,t.internalformat,t.width>>e,t.height>>e,0,t.internalformat,t.type,null);else for(var r=0;r<6;++r)n.texImage2D(Rt+r,e,t.internalformat,t.width>>e,t.height>>e,0,t.internalformat,t.type,null);Z(t.texInfo,t.target)}))},refresh:function(){for(var t=0;t<J;++t){var e=tt[t];e&&(e.bindCount=0,e.unit=-1,tt[t]=null),n.activeTexture(Pe+t),n.bindTexture(Mt,null),n.bindTexture(kt,null)}}}}Ke[Ft]=2,Ke[Gt]=2,Ke[Ut]=2,Ke[qt]=4,Ke[$t]=.5,Ke[Qt]=.5,Ke[Jt]=1,Ke[te]=1,Ke[ee]=.5,Ke[ne]=1,Ke[re]=1,Ke[oe]=.5,Ke[ie]=.25,Ke[ae]=.5,Ke[ue]=.25,Ke[se]=.5;var sn=36161,cn=32854,fn=[];function ln(t,e,n){return fn[t]*e*n}fn[32854]=2,fn[32855]=2,fn[36194]=2,fn[33189]=2,fn[36168]=1,fn[34041]=4,fn[35907]=4,fn[34836]=16,fn[34842]=8,fn[34843]=6;var dn=36160,hn=36161,pn=3553,vn=34069,gn=36064,mn=36096,yn=36128,bn=33306,wn=36053,En=6402,xn=[6407,6408],_n=[];_n[6408]=4,_n[6407]=3;var Sn=[];Sn[5121]=1,Sn[5126]=4,Sn[36193]=2;var An=33189,In=36168,Tn=34041,On=[32854,32855,36194,35907,34842,34843,34836],Nn={};Nn[wn]="complete",Nn[36054]="incomplete attachment",Nn[36057]="incomplete dimensions",Nn[36055]="incomplete, missing attachment",Nn[36061]="unsupported";var Dn=5126,Mn=34962;function kn(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=Dn,this.offset=0,this.stride=0,this.divisor=0}var Rn=35632,Cn=35633,Ln=35718,Pn=35721;var jn=6408,zn=5121,Fn=3333,Gn=5126;function Un(e,n,r,o,i,a,u){function s(s){var c;null===n.next?(T(i.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),c=zn):(T(null!==n.next.colorAttachments[0].texture,"You cannot read from a renderbuffer"),c=n.next.colorAttachments[0].texture._texture.type,a.oes_texture_float?(T(c===zn||c===Gn,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),c===Gn&&T(u.readFloat,"Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):T(c===zn,"Reading from a framebuffer is only allowed for the type 'uint8'"));var f=0,l=0,d=o.framebufferWidth,h=o.framebufferHeight,p=null;t(s)?p=s:s&&(T.type(s,"object","invalid arguments to regl.read()"),f=0|s.x,l=0|s.y,T(f>=0&&f<o.framebufferWidth,"invalid x offset for regl.read"),T(l>=0&&l<o.framebufferHeight,"invalid y offset for regl.read"),d=0|(s.width||o.framebufferWidth-f),h=0|(s.height||o.framebufferHeight-l),p=s.data||null),p&&(c===zn?T(p instanceof Uint8Array,"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"):c===Gn&&T(p instanceof Float32Array,"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'")),T(d>0&&d+f<=o.framebufferWidth,"invalid width for read pixels"),T(h>0&&h+l<=o.framebufferHeight,"invalid height for read pixels"),r();var v=d*h*4;return p||(c===zn?p=new Uint8Array(v):c===Gn&&(p=p||new Float32Array(v))),T.isTypedArray(p,"data buffer for regl.read() must be a typedarray"),T(p.byteLength>=v,"data buffer for regl.read() too small"),e.pixelStorei(Fn,4),e.readPixels(f,l,d,h,jn,c,p),p}return function(t){return t&&"framebuffer"in t?function(t){var e;return n.setFBO({framebuffer:t.framebuffer},(function(){e=s(t)})),e}(t):s(t)}}function Bn(t){return Array.prototype.slice.call(t)}function Vn(t){return Bn(t).join("")}var Wn="xyzw".split(""),Xn=5121,Hn=1,qn=2,Yn=0,Kn=1,Zn=2,$n=3,Qn=4,Jn=5,tr=6,er="dither",nr="blend.enable",rr="blend.color",or="blend.equation",ir="blend.func",ar="depth.enable",ur="depth.func",sr="depth.range",cr="depth.mask",fr="colorMask",lr="cull.enable",dr="cull.face",hr="frontFace",pr="lineWidth",vr="polygonOffset.enable",gr="polygonOffset.offset",mr="sample.alpha",yr="sample.enable",br="sample.coverage",wr="stencil.enable",Er="stencil.mask",xr="stencil.func",_r="stencil.opFront",Sr="stencil.opBack",Ar="scissor.enable",Ir="scissor.box",Tr="viewport",Or="profile",Nr="framebuffer",Dr="vert",Mr="frag",kr="elements",Rr="primitive",Cr="count",Lr="offset",Pr="instances",jr="vao",zr="Width",Fr="Height",Gr=Nr+zr,Ur=Nr+Fr,Br=Tr+zr,Vr=Tr+Fr,Wr="drawingBuffer",Xr=Wr+zr,Hr=Wr+Fr,qr=[ir,or,xr,_r,Sr,br,Tr,Ir,gr],Yr=34962,Kr=34963,Zr=3553,$r=34067,Qr=2884,Jr=3042,to=3024,eo=2960,no=2929,ro=3089,oo=32823,io=32926,ao=32928,uo=5126,so=35664,co=35665,fo=35666,lo=5124,ho=35667,po=35668,vo=35669,go=35670,mo=35671,yo=35672,bo=35673,wo=35674,Eo=35675,xo=35676,_o=35678,So=35680,Ao=4,Io=1028,To=1029,Oo=2304,No=2305,Do=32775,Mo=32776,ko=519,Ro=7680,Co=0,Lo=1,Po=32774,jo=513,zo=36160,Fo=36064,Go={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},Uo=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],Bo={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Vo={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Wo={frag:35632,vert:35633},Xo={cw:Oo,ccw:No};function Ho(e){return Array.isArray(e)||t(e)||q(e)}function qo(t){return t.sort((function(t,e){return t===Tr?-1:e===Tr?1:t<e?-1:1}))}function Yo(t,e,n,r){this.thisDep=t,this.contextDep=e,this.propDep=n,this.append=r}function Ko(t){return t&&!(t.thisDep||t.contextDep||t.propDep)}function Zo(t){return new Yo(!1,!1,!1,t)}function $o(t,e){var n=t.type;if(n===Yn){var r=t.data.length;return new Yo(!0,r>=1,r>=2,e)}if(n===Qn){var o=t.data;return new Yo(o.thisDep,o.contextDep,o.propDep,e)}if(n===Jn)return new Yo(!1,!1,!1,e);if(n===tr){for(var i=!1,a=!1,u=!1,s=0;s<t.data.length;++s){var c=t.data[s];if(c.type===Kn)u=!0;else if(c.type===Zn)a=!0;else if(c.type===$n)i=!0;else if(c.type===Yn){i=!0;var f=c.data;f>=1&&(a=!0),f>=2&&(u=!0)}else c.type===Qn&&(i=i||c.data.thisDep,a=a||c.data.contextDep,u=u||c.data.propDep)}return new Yo(i,a,u,e)}return new Yo(n===$n,n===Zn,n===Kn,e)}var Qo=new Yo(!1,!1,!1,(function(){}));function Jo(t,n,r,o,i,a,u,s,c,f,l,d,h,p,v){var g=f.Record,m={add:32774,subtract:32778,"reverse subtract":32779};r.ext_blend_minmax&&(m.min=Do,m.max=Mo);var y=r.angle_instanced_arrays,b=r.webgl_draw_buffers,w={dirty:!0,profile:v.profile},E={},x=[],_={},S={};function A(t){return t.replace(".","_")}function I(t,e,n){var r=A(t);x.push(t),E[r]=w[r]=!!n,_[r]=e}function O(t,e,n){var r=A(t);x.push(t),Array.isArray(n)?(w[r]=n.slice(),E[r]=n.slice()):w[r]=E[r]=n,S[r]=e}I(er,to),I(nr,Jr),O(rr,"blendColor",[0,0,0,0]),O(or,"blendEquationSeparate",[Po,Po]),O(ir,"blendFuncSeparate",[Lo,Co,Lo,Co]),I(ar,no,!0),O(ur,"depthFunc",jo),O(sr,"depthRange",[0,1]),O(cr,"depthMask",!0),O(fr,fr,[!0,!0,!0,!0]),I(lr,Qr),O(dr,"cullFace",To),O(hr,hr,No),O(pr,pr,1),I(vr,oo),O(gr,"polygonOffset",[0,0]),I(mr,io),I(yr,ao),O(br,"sampleCoverage",[1,!1]),I(wr,eo),O(Er,"stencilMask",-1),O(xr,"stencilFunc",[ko,0,-1]),O(_r,"stencilOpSeparate",[Io,Ro,Ro,Ro]),O(Sr,"stencilOpSeparate",[To,Ro,Ro,Ro]),I(Ar,ro),O(Ir,"scissor",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]),O(Tr,Tr,[0,0,t.drawingBufferWidth,t.drawingBufferHeight]);var N={gl:t,context:h,strings:n,next:E,current:w,draw:d,elements:a,buffer:i,shader:l,attributes:f.state,vao:f,uniforms:c,framebuffer:s,extensions:r,timer:p,isBufferArgs:Ho},D={primTypes:lt,compareFuncs:Bo,blendFuncs:Go,blendEquations:m,stencilOps:Vo,glTypes:J,orientationType:Xo};T.optional((function(){N.isArrayLike=Ot})),b&&(D.backBuffer=[To],D.drawBuffer=F(o.maxDrawbuffers,(function(t){return 0===t?[0]:F(t,(function(t){return Fo+t}))})));var M=0;function k(){var t=function(){var t=0,n=[],r=[];function o(){var n=[],r=[];return e((function(){n.push.apply(n,Bn(arguments))}),{def:function(){var e="v"+t++;return r.push(e),arguments.length>0&&(n.push(e,"="),n.push.apply(n,Bn(arguments)),n.push(";")),e},toString:function(){return Vn([r.length>0?"var "+r.join(",")+";":"",Vn(n)])}})}function i(){var t=o(),n=o(),r=t.toString,i=n.toString;function a(e,r){n(e,r,"=",t.def(e,r),";")}return e((function(){t.apply(t,Bn(arguments))}),{def:t.def,entry:t,exit:n,save:a,set:function(e,n,r){a(e,n),t(e,n,"=",r,";")},toString:function(){return r()+i()}})}var a=o(),u={};return{global:a,link:function(e){for(var o=0;o<r.length;++o)if(r[o]===e)return n[o];var i="g"+t++;return n.push(i),r.push(e),i},block:o,proc:function(t,n){var r=[];function o(){var t="a"+r.length;return r.push(t),t}n=n||0;for(var a=0;a<n;++a)o();var s=i(),c=s.toString;return u[t]=e(s,{arg:o,toString:function(){return Vn(["function(",r.join(),"){",c(),"}"])}})},scope:i,cond:function(){var t=Vn(arguments),n=i(),r=i(),o=n.toString,a=r.toString;return e(n,{then:function(){return n.apply(n,Bn(arguments)),this},else:function(){return r.apply(r,Bn(arguments)),this},toString:function(){var e=a();return e&&(e="else{"+e+"}"),Vn(["if(",t,"){",o(),"}",e])}})},compile:function(){var t=['"use strict";',a,"return {"];Object.keys(u).forEach((function(e){t.push('"',e,'":',u[e].toString(),",")})),t.push("}");var e=Vn(t).replace(/;/g,";\n").replace(/}/g,"}\n").replace(/{/g,"{\n");return Function.apply(null,n.concat(e)).apply(null,r)}}}(),r=t.link,o=t.global;t.id=M++,t.batchId="0";var i=r(N),a=t.shared={props:"a0"};Object.keys(N).forEach((function(t){a[t]=o.def(i,".",t)})),T.optional((function(){t.CHECK=r(T),t.commandStr=T.guessCommand(),t.command=r(t.commandStr),t.assert=function(t,e,n){t("if(!(",e,"))",this.CHECK,".commandRaise(",r(n),",",this.command,");")},D.invalidBlendCombinations=Uo}));var u=t.next={},s=t.current={};Object.keys(S).forEach((function(t){Array.isArray(w[t])&&(u[t]=o.def(a.next,".",t),s[t]=o.def(a.current,".",t))}));var c=t.constants={};Object.keys(D).forEach((function(t){c[t]=o.def(JSON.stringify(D[t]))})),t.invoke=function(e,n){switch(n.type){case Yn:var o=["this",a.context,a.props,t.batchId];return e.def(r(n.data),".call(",o.slice(0,Math.max(n.data.length+1,4)),")");case Kn:return e.def(a.props,n.data);case Zn:return e.def(a.context,n.data);case $n:return e.def("this",n.data);case Qn:return n.data.append(t,e),n.data.ref;case Jn:return n.data.toString();case tr:return n.data.map((function(n){return t.invoke(e,n)}))}},t.attribCache={};var l={};return t.scopeAttrib=function(t){var e=n.id(t);if(e in l)return l[e];var o=f.scope[e];return o||(o=f.scope[e]=new g),l[e]=r(o)},t}function C(t,e,u,c,d){var h=t.static,p=t.dynamic;T.optional((function(){var t=[Nr,Dr,Mr,kr,Rr,Lr,Cr,Pr,Or,jr].concat(x);function e(e){Object.keys(e).forEach((function(e){T.command(t.indexOf(e)>=0,'unknown parameter "'+e+'"',d.commandStr)}))}e(h),e(p)}));var v=function(t,e){var n=t.static;if("string"==typeof n[Mr]&&"string"==typeof n[Dr]){if(Object.keys(e.dynamic).length>0)return null;var r=e.static,o=Object.keys(r);if(o.length>0&&"number"==typeof r[o[0]]){for(var i=[],a=0;a<o.length;++a)T("number"==typeof r[o[a]],"must specify all vertex attribute locations when using vaos"),i.push([0|r[o[a]],o[a]]);return i}}return null}(t,e),b=function(t,e){var n=t.static,r=t.dynamic;if(Nr in n){var o=n[Nr];return o?(o=s.getFramebuffer(o),T.command(o,"invalid framebuffer object"),Zo((function(t,e){var n=t.link(o),r=t.shared;e.set(r.framebuffer,".next",n);var i=r.context;return e.set(i,"."+Gr,n+".width"),e.set(i,"."+Ur,n+".height"),n}))):Zo((function(t,e){var n=t.shared;e.set(n.framebuffer,".next","null");var r=n.context;return e.set(r,"."+Gr,r+"."+Xr),e.set(r,"."+Ur,r+"."+Hr),"null"}))}if(Nr in r){var i=r[Nr];return $o(i,(function(t,e){var n=t.invoke(e,i),r=t.shared,o=r.framebuffer,a=e.def(o,".getFramebuffer(",n,")");T.optional((function(){t.assert(e,"!"+n+"||"+a,"invalid framebuffer object")})),e.set(o,".next",a);var u=r.context;return e.set(u,"."+Gr,a+"?"+a+".width:"+u+"."+Xr),e.set(u,"."+Ur,a+"?"+a+".height:"+u+"."+Hr),a}))}return null}(t),w=function(t,e,n){var r=t.static,o=t.dynamic;function i(t){if(t in r){var i=r[t];T.commandType(i,"object","invalid "+t,n.commandStr);var a,u,s=!0,c=0|i.x,f=0|i.y;return"width"in i?(a=0|i.width,T.command(a>=0,"invalid "+t,n.commandStr)):s=!1,"height"in i?(u=0|i.height,T.command(u>=0,"invalid "+t,n.commandStr)):s=!1,new Yo(!s&&e&&e.thisDep,!s&&e&&e.contextDep,!s&&e&&e.propDep,(function(t,e){var n=t.shared.context,r=a;"width"in i||(r=e.def(n,".",Gr,"-",c));var o=u;return"height"in i||(o=e.def(n,".",Ur,"-",f)),[c,f,r,o]}))}if(t in o){var l=o[t],d=$o(l,(function(e,n){var r=e.invoke(n,l);T.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)}));var o=e.shared.context,i=n.def(r,".x|0"),a=n.def(r,".y|0"),u=n.def('"width" in ',r,"?",r,".width|0:","(",o,".",Gr,"-",i,")"),s=n.def('"height" in ',r,"?",r,".height|0:","(",o,".",Ur,"-",a,")");return T.optional((function(){e.assert(n,u+">=0&&"+s+">=0","invalid "+t)})),[i,a,u,s]}));return e&&(d.thisDep=d.thisDep||e.thisDep,d.contextDep=d.contextDep||e.contextDep,d.propDep=d.propDep||e.propDep),d}return e?new Yo(e.thisDep,e.contextDep,e.propDep,(function(t,e){var n=t.shared.context;return[0,0,e.def(n,".",Gr),e.def(n,".",Ur)]})):null}var a=i(Tr);if(a){var u=a;a=new Yo(a.thisDep,a.contextDep,a.propDep,(function(t,e){var n=u.append(t,e),r=t.shared.context;return e.set(r,"."+Br,n[2]),e.set(r,"."+Vr,n[3]),n}))}return{viewport:a,scissor_box:i(Ir)}}(t,b,d),E=function(t,e){var n=t.static,r=t.dynamic,o=function(){if(kr in n){var t=n[kr];Ho(t)?t=a.getElements(a.create(t,!0)):t&&(t=a.getElements(t),T.command(t,"invalid elements",e.commandStr));var o=Zo((function(e,n){if(t){var r=e.link(t);return e.ELEMENTS=r,r}return e.ELEMENTS=null,null}));return o.value=t,o}if(kr in r){var i=r[kr];return $o(i,(function(t,e){var n=t.shared,r=n.isBufferArgs,o=n.elements,a=t.invoke(e,i),u=e.def("null"),s=e.def(r,"(",a,")"),c=t.cond(s).then(u,"=",o,".createStream(",a,");").else(u,"=",o,".getElements(",a,");");return T.optional((function(){t.assert(c.else,"!"+a+"||"+u,"invalid elements")})),e.entry(c),e.exit(t.cond(s).then(o,".destroyStream(",u,");")),t.ELEMENTS=u,u}))}return null}();function i(t,i){if(t in n){var a=0|n[t];return T.command(!i||a>=0,"invalid "+t,e.commandStr),Zo((function(t,e){return i&&(t.OFFSET=a),a}))}if(t in r){var u=r[t];return $o(u,(function(e,n){var r=e.invoke(n,u);return i&&(e.OFFSET=r,T.optional((function(){e.assert(n,r+">=0","invalid "+t)}))),r}))}return i&&o?Zo((function(t,e){return t.OFFSET="0",0})):null}var u=i(Lr,!0);return{elements:o,primitive:function(){if(Rr in n){var t=n[Rr];return T.commandParameter(t,lt,"invalid primitve",e.commandStr),Zo((function(e,n){return lt[t]}))}if(Rr in r){var i=r[Rr];return $o(i,(function(t,e){var n=t.constants.primTypes,r=t.invoke(e,i);return T.optional((function(){t.assert(e,r+" in "+n,"invalid primitive, must be one of "+Object.keys(lt))})),e.def(n,"[",r,"]")}))}return o?Ko(o)?o.value?Zo((function(t,e){return e.def(t.ELEMENTS,".primType")})):Zo((function(){return Ao})):new Yo(o.thisDep,o.contextDep,o.propDep,(function(t,e){var n=t.ELEMENTS;return e.def(n,"?",n,".primType:",Ao)})):null}(),count:function(){if(Cr in n){var t=0|n[Cr];return T.command("number"==typeof t&&t>=0,"invalid vertex count",e.commandStr),Zo((function(){return t}))}if(Cr in r){var i=r[Cr];return $o(i,(function(t,e){var n=t.invoke(e,i);return T.optional((function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">=0&&"+n+"===("+n+"|0)","invalid vertex count")})),n}))}if(o){if(Ko(o)){if(o)return u?new Yo(u.thisDep,u.contextDep,u.propDep,(function(t,e){var n=e.def(t.ELEMENTS,".vertCount-",t.OFFSET);return T.optional((function(){t.assert(e,n+">=0","invalid vertex offset/element buffer too small")})),n})):Zo((function(t,e){return e.def(t.ELEMENTS,".vertCount")}));var a=Zo((function(){return-1}));return T.optional((function(){a.MISSING=!0})),a}var s=new Yo(o.thisDep||u.thisDep,o.contextDep||u.contextDep,o.propDep||u.propDep,(function(t,e){var n=t.ELEMENTS;return t.OFFSET?e.def(n,"?",n,".vertCount-",t.OFFSET,":-1"):e.def(n,"?",n,".vertCount:-1")}));return T.optional((function(){s.DYNAMIC=!0})),s}return null}(),instances:i(Pr,!1),offset:u}}(t,d),_=function(t,e){var n=t.static,r=t.dynamic,i={};return x.forEach((function(t){var a=A(t);function u(e,o){if(t in n){var u=e(n[t]);i[a]=Zo((function(){return u}))}else if(t in r){var s=r[t];i[a]=$o(s,(function(t,e){return o(t,e,t.invoke(e,s))}))}}switch(t){case lr:case nr:case er:case wr:case ar:case Ar:case vr:case mr:case yr:case cr:return u((function(n){return T.commandType(n,"boolean",t,e.commandStr),n}),(function(e,n,r){return T.optional((function(){e.assert(n,"typeof "+r+'==="boolean"',"invalid flag "+t,e.commandStr)})),r}));case ur:return u((function(n){return T.commandParameter(n,Bo,"invalid "+t,e.commandStr),Bo[n]}),(function(e,n,r){var o=e.constants.compareFuncs;return T.optional((function(){e.assert(n,r+" in "+o,"invalid "+t+", must be one of "+Object.keys(Bo))})),n.def(o,"[",r,"]")}));case sr:return u((function(t){return T.command(Ot(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]&&t[0]<=t[1],"depth range is 2d array",e.commandStr),t}),(function(t,e,n){return T.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===2&&typeof "+n+'[0]==="number"&&typeof '+n+'[1]==="number"&&'+n+"[0]<="+n+"[1]","depth range must be a 2d array")})),[e.def("+",n,"[0]"),e.def("+",n,"[1]")]}));case ir:return u((function(t){T.commandType(t,"object","blend.func",e.commandStr);var n="srcRGB"in t?t.srcRGB:t.src,r="srcAlpha"in t?t.srcAlpha:t.src,o="dstRGB"in t?t.dstRGB:t.dst,i="dstAlpha"in t?t.dstAlpha:t.dst;return T.commandParameter(n,Go,a+".srcRGB",e.commandStr),T.commandParameter(r,Go,a+".srcAlpha",e.commandStr),T.commandParameter(o,Go,a+".dstRGB",e.commandStr),T.commandParameter(i,Go,a+".dstAlpha",e.commandStr),T.command(-1===Uo.indexOf(n+", "+o),"unallowed blending combination (srcRGB, dstRGB) = ("+n+", "+o+")",e.commandStr),[Go[n],Go[o],Go[r],Go[i]]}),(function(e,n,r){var o=e.constants.blendFuncs;function i(i,a){var u=n.def('"',i,a,'" in ',r,"?",r,".",i,a,":",r,".",i);return T.optional((function(){e.assert(n,u+" in "+o,"invalid "+t+"."+i+a+", must be one of "+Object.keys(Go))})),u}T.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid blend func, must be an object")}));var a=i("src","RGB"),u=i("dst","RGB");T.optional((function(){var t=e.constants.invalidBlendCombinations;e.assert(n,t+".indexOf("+a+'+", "+'+u+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")}));var s=n.def(o,"[",a,"]"),c=n.def(o,"[",i("src","Alpha"),"]");return[s,n.def(o,"[",u,"]"),c,n.def(o,"[",i("dst","Alpha"),"]")]}));case or:return u((function(n){return"string"==typeof n?(T.commandParameter(n,m,"invalid "+t,e.commandStr),[m[n],m[n]]):"object"==typeof n?(T.commandParameter(n.rgb,m,t+".rgb",e.commandStr),T.commandParameter(n.alpha,m,t+".alpha",e.commandStr),[m[n.rgb],m[n.alpha]]):void T.commandRaise("invalid blend.equation",e.commandStr)}),(function(e,n,r){var o=e.constants.blendEquations,i=n.def(),a=n.def(),u=e.cond("typeof ",r,'==="string"');return T.optional((function(){function n(t,n,r){e.assert(t,r+" in "+o,"invalid "+n+", must be one of "+Object.keys(m))}n(u.then,t,r),e.assert(u.else,r+"&&typeof "+r+'==="object"',"invalid "+t),n(u.else,t+".rgb",r+".rgb"),n(u.else,t+".alpha",r+".alpha")})),u.then(i,"=",a,"=",o,"[",r,"];"),u.else(i,"=",o,"[",r,".rgb];",a,"=",o,"[",r,".alpha];"),n(u),[i,a]}));case rr:return u((function(t){return T.command(Ot(t)&&4===t.length,"blend.color must be a 4d array",e.commandStr),F(4,(function(e){return+t[e]}))}),(function(t,e,n){return T.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","blend.color must be a 4d array")})),F(4,(function(t){return e.def("+",n,"[",t,"]")}))}));case Er:return u((function(t){return T.commandType(t,"number",a,e.commandStr),0|t}),(function(t,e,n){return T.optional((function(){t.assert(e,"typeof "+n+'==="number"',"invalid stencil.mask")})),e.def(n,"|0")}));case xr:return u((function(n){T.commandType(n,"object",a,e.commandStr);var r=n.cmp||"keep",o=n.ref||0,i="mask"in n?n.mask:-1;return T.commandParameter(r,Bo,t+".cmp",e.commandStr),T.commandType(o,"number",t+".ref",e.commandStr),T.commandType(i,"number",t+".mask",e.commandStr),[Bo[r],o,i]}),(function(t,e,n){var r=t.constants.compareFuncs;return T.optional((function(){function o(){t.assert(e,Array.prototype.join.call(arguments,""),"invalid stencil.func")}o(n+"&&typeof ",n,'==="object"'),o('!("cmp" in ',n,")||(",n,".cmp in ",r,")")})),[e.def('"cmp" in ',n,"?",r,"[",n,".cmp]",":",Ro),e.def(n,".ref|0"),e.def('"mask" in ',n,"?",n,".mask|0:-1")]}));case _r:case Sr:return u((function(n){T.commandType(n,"object",a,e.commandStr);var r=n.fail||"keep",o=n.zfail||"keep",i=n.zpass||"keep";return T.commandParameter(r,Vo,t+".fail",e.commandStr),T.commandParameter(o,Vo,t+".zfail",e.commandStr),T.commandParameter(i,Vo,t+".zpass",e.commandStr),[t===Sr?To:Io,Vo[r],Vo[o],Vo[i]]}),(function(e,n,r){var o=e.constants.stencilOps;function i(i){return T.optional((function(){e.assert(n,'!("'+i+'" in '+r+")||("+r+"."+i+" in "+o+")","invalid "+t+"."+i+", must be one of "+Object.keys(Vo))})),n.def('"',i,'" in ',r,"?",o,"[",r,".",i,"]:",Ro)}return T.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)})),[t===Sr?To:Io,i("fail"),i("zfail"),i("zpass")]}));case gr:return u((function(t){T.commandType(t,"object",a,e.commandStr);var n=0|t.factor,r=0|t.units;return T.commandType(n,"number",a+".factor",e.commandStr),T.commandType(r,"number",a+".units",e.commandStr),[n,r]}),(function(e,n,r){return T.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)})),[n.def(r,".factor|0"),n.def(r,".units|0")]}));case dr:return u((function(t){var n=0;return"front"===t?n=Io:"back"===t&&(n=To),T.command(!!n,a,e.commandStr),n}),(function(t,e,n){return T.optional((function(){t.assert(e,n+'==="front"||'+n+'==="back"',"invalid cull.face")})),e.def(n,'==="front"?',Io,":",To)}));case pr:return u((function(t){return T.command("number"==typeof t&&t>=o.lineWidthDims[0]&&t<=o.lineWidthDims[1],"invalid line width, must be a positive number between "+o.lineWidthDims[0]+" and "+o.lineWidthDims[1],e.commandStr),t}),(function(t,e,n){return T.optional((function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">="+o.lineWidthDims[0]+"&&"+n+"<="+o.lineWidthDims[1],"invalid line width")})),n}));case hr:return u((function(t){return T.commandParameter(t,Xo,a,e.commandStr),Xo[t]}),(function(t,e,n){return T.optional((function(){t.assert(e,n+'==="cw"||'+n+'==="ccw"',"invalid frontFace, must be one of cw,ccw")})),e.def(n+'==="cw"?'+Oo+":"+No)}));case fr:return u((function(t){return T.command(Ot(t)&&4===t.length,"color.mask must be length 4 array",e.commandStr),t.map((function(t){return!!t}))}),(function(t,e,n){return T.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","invalid color.mask")})),F(4,(function(t){return"!!"+n+"["+t+"]"}))}));case br:return u((function(t){T.command("object"==typeof t&&t,a,e.commandStr);var n="value"in t?t.value:1,r=!!t.invert;return T.command("number"==typeof n&&n>=0&&n<=1,"sample.coverage.value must be a number between 0 and 1",e.commandStr),[n,r]}),(function(t,e,n){return T.optional((function(){t.assert(e,n+"&&typeof "+n+'==="object"',"invalid sample.coverage")})),[e.def('"value" in ',n,"?+",n,".value:1"),e.def("!!",n,".invert")]}))}})),i}(t,d),S=function(t,e,r){var o=t.static,i=t.dynamic;function a(t){if(t in o){var e=n.id(o[t]);T.optional((function(){l.shader(Wo[t],e,T.guessCommand())}));var r=Zo((function(){return e}));return r.id=e,r}if(t in i){var a=i[t];return $o(a,(function(e,n){var r=e.invoke(n,a),o=n.def(e.shared.strings,".id(",r,")");return T.optional((function(){n(e.shared.shader,".shader(",Wo[t],",",o,",",e.command,");")})),o}))}return null}var u,s=a(Mr),c=a(Dr),f=null;return Ko(s)&&Ko(c)?(f=l.program(c.id,s.id,null,r),u=Zo((function(t,e){return t.link(f)}))):u=new Yo(s&&s.thisDep||c&&c.thisDep,s&&s.contextDep||c&&c.contextDep,s&&s.propDep||c&&c.propDep,(function(t,e){var n,r=t.shared.shader;n=s?s.append(t,e):e.def(r,".",Mr);var o=r+".program("+(c?c.append(t,e):e.def(r,".",Dr))+","+n;return T.optional((function(){o+=","+t.command})),e.def(o+")")})),{frag:s,vert:c,progVar:u,program:f}}(t,0,v);function I(t){var e=w[t];e&&(_[t]=e)}I(Tr),I(A(Ir));var O=Object.keys(_).length>0,N={framebuffer:b,draw:E,shader:S,state:_,dirty:O,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(N.profile=function(t){var e,n=t.static,r=t.dynamic;if(Or in n){var o=!!n[Or];(e=Zo((function(t,e){return o}))).enable=o}else if(Or in r){var i=r[Or];e=$o(i,(function(t,e){return t.invoke(e,i)}))}return e}(t),N.uniforms=function(t,e){var n=t.static,r=t.dynamic,o={};return Object.keys(n).forEach((function(t){var r,i=n[t];if("number"==typeof i||"boolean"==typeof i)r=Zo((function(){return i}));else if("function"==typeof i){var a=i._reglType;"texture2d"===a||"textureCube"===a?r=Zo((function(t){return t.link(i)})):"framebuffer"===a||"framebufferCube"===a?(T.command(i.color.length>0,'missing color attachment for framebuffer sent to uniform "'+t+'"',e.commandStr),r=Zo((function(t){return t.link(i.color[0])}))):T.commandRaise('invalid data for uniform "'+t+'"',e.commandStr)}else Ot(i)?r=Zo((function(e){return e.global.def("[",F(i.length,(function(n){return T.command("number"==typeof i[n]||"boolean"==typeof i[n],"invalid uniform "+t,e.commandStr),i[n]})),"]")})):T.commandRaise('invalid or missing data for uniform "'+t+'"',e.commandStr);r.value=i,o[t]=r})),Object.keys(r).forEach((function(t){var e=r[t];o[t]=$o(e,(function(t,n){return t.invoke(n,e)}))})),o}(u,d),N.drawVAO=N.scopeVAO=function(t,e){var n=t.static,r=t.dynamic;if(jr in n){var o=n[jr];return null!==o&&null===f.getVAO(o)&&(o=f.createVAO(o)),Zo((function(t){return t.link(f.getVAO(o))}))}if(jr in r){var i=r[jr];return $o(i,(function(t,e){var n=t.invoke(e,i);return e.def(t.shared.vao+".getVAO("+n+")")}))}return null}(t),!N.drawVAO&&S.program&&!v&&r.angle_instanced_arrays){var D=!0,M=S.program.attributes.map((function(t){var n=e.static[t];return D=D&&!!n,n}));if(D&&M.length>0){var k=f.getVAO(f.createVAO(M));N.drawVAO=new Yo(null,null,null,(function(t,e){return t.link(k)})),N.useVAO=!0}}return v?N.useVAO=!0:N.attributes=function(t,e){var r=t.static,o=t.dynamic,a={};return Object.keys(r).forEach((function(t){var o=r[t],u=n.id(t),s=new g;if(Ho(o))s.state=Hn,s.buffer=i.getBuffer(i.create(o,Yr,!1,!0)),s.type=0;else{var c=i.getBuffer(o);if(c)s.state=Hn,s.buffer=c,s.type=0;else if(T.command("object"==typeof o&&o,"invalid data for attribute "+t,e.commandStr),"constant"in o){var f=o.constant;s.buffer="null",s.state=qn,"number"==typeof f?s.x=f:(T.command(Ot(f)&&f.length>0&&f.length<=4,"invalid constant for attribute "+t,e.commandStr),Wn.forEach((function(t,e){e<f.length&&(s[t]=f[e])})))}else{c=Ho(o.buffer)?i.getBuffer(i.create(o.buffer,Yr,!1,!0)):i.getBuffer(o.buffer),T.command(!!c,'missing buffer for attribute "'+t+'"',e.commandStr);var l=0|o.offset;T.command(l>=0,'invalid offset for attribute "'+t+'"',e.commandStr);var d=0|o.stride;T.command(d>=0&&d<256,'invalid stride for attribute "'+t+'", must be integer betweeen [0, 255]',e.commandStr);var h=0|o.size;T.command(!("size"in o)||h>0&&h<=4,'invalid size for attribute "'+t+'", must be 1,2,3,4',e.commandStr);var p=!!o.normalized,v=0;"type"in o&&(T.commandParameter(o.type,J,"invalid type for attribute "+t,e.commandStr),v=J[o.type]);var m=0|o.divisor;"divisor"in o&&(T.command(0===m||y,'cannot specify divisor for attribute "'+t+'", instancing not supported',e.commandStr),T.command(m>=0,'invalid divisor for attribute "'+t+'"',e.commandStr)),T.optional((function(){var n=e.commandStr,r=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(o).forEach((function(e){T.command(r.indexOf(e)>=0,'unknown parameter "'+e+'" for attribute pointer "'+t+'" (valid parameters are '+r+")",n)}))})),s.buffer=c,s.state=Hn,s.size=h,s.normalized=p,s.type=v||c.dtype,s.offset=l,s.stride=d,s.divisor=m}}a[t]=Zo((function(t,e){var n=t.attribCache;if(u in n)return n[u];var r={isStream:!1};return Object.keys(s).forEach((function(t){r[t]=s[t]})),s.buffer&&(r.buffer=t.link(s.buffer),r.type=r.type||r.buffer+".dtype"),n[u]=r,r}))})),Object.keys(o).forEach((function(t){var e=o[t];a[t]=$o(e,(function(n,r){var o=n.invoke(r,e),i=n.shared,a=n.constants,u=i.isBufferArgs,s=i.buffer;T.optional((function(){n.assert(r,o+"&&(typeof "+o+'==="object"||typeof '+o+'==="function")&&('+u+"("+o+")||"+s+".getBuffer("+o+")||"+s+".getBuffer("+o+".buffer)||"+u+"("+o+'.buffer)||("constant" in '+o+"&&(typeof "+o+'.constant==="number"||'+i.isArrayLike+"("+o+".constant))))",'invalid dynamic attribute "'+t+'"')}));var c={isStream:r.def(!1)},f=new g;f.state=Hn,Object.keys(f).forEach((function(t){c[t]=r.def(""+f[t])}));var l=c.buffer,d=c.type;function h(t){r(c[t],"=",o,".",t,"|0;")}return r("if(",u,"(",o,")){",c.isStream,"=true;",l,"=",s,".createStream(",Yr,",",o,");",d,"=",l,".dtype;","}else{",l,"=",s,".getBuffer(",o,");","if(",l,"){",d,"=",l,".dtype;",'}else if("constant" in ',o,"){",c.state,"=",qn,";","if(typeof "+o+'.constant === "number"){',c[Wn[0]],"=",o,".constant;",Wn.slice(1).map((function(t){return c[t]})).join("="),"=0;","}else{",Wn.map((function(t,e){return c[t]+"="+o+".constant.length>"+e+"?"+o+".constant["+e+"]:0;"})).join(""),"}}else{","if(",u,"(",o,".buffer)){",l,"=",s,".createStream(",Yr,",",o,".buffer);","}else{",l,"=",s,".getBuffer(",o,".buffer);","}",d,'="type" in ',o,"?",a.glTypes,"[",o,".type]:",l,".dtype;",c.normalized,"=!!",o,".normalized;"),h("size"),h("offset"),h("stride"),h("divisor"),r("}}"),r.exit("if(",c.isStream,"){",s,".destroyStream(",l,");","}"),c}))})),a}(e,d),N.context=function(t){var e=t.static,n=t.dynamic,r={};return Object.keys(e).forEach((function(t){var n=e[t];r[t]=Zo((function(t,e){return"number"==typeof n||"boolean"==typeof n?""+n:t.link(n)}))})),Object.keys(n).forEach((function(t){var e=n[t];r[t]=$o(e,(function(t,n){return t.invoke(n,e)}))})),r}(c),N}function L(t,e,n){var r=t.shared.context,o=t.scope();Object.keys(n).forEach((function(i){e.save(r,"."+i);var a=n[i].append(t,e);Array.isArray(a)?o(r,".",i,"=[",a.join(),"];"):o(r,".",i,"=",a,";")})),e(o)}function P(t,e,n,r){var o,i=t.shared,a=i.gl,u=i.framebuffer;b&&(o=e.def(i.extensions,".webgl_draw_buffers"));var s,c=t.constants,f=c.drawBuffer,l=c.backBuffer;s=n?n.append(t,e):e.def(u,".next"),r||e("if(",s,"!==",u,".cur){"),e("if(",s,"){",a,".bindFramebuffer(",zo,",",s,".framebuffer);"),b&&e(o,".drawBuffersWEBGL(",f,"[",s,".colorAttachments.length]);"),e("}else{",a,".bindFramebuffer(",zo,",null);"),b&&e(o,".drawBuffersWEBGL(",l,");"),e("}",u,".cur=",s,";"),r||e("}")}function j(t,e,n){var r=t.shared,o=r.gl,i=t.current,a=t.next,u=r.current,s=r.next,c=t.cond(u,".dirty");x.forEach((function(e){var r,f,l=A(e);if(!(l in n.state))if(l in a){r=a[l],f=i[l];var d=F(w[l].length,(function(t){return c.def(r,"[",t,"]")}));c(t.cond(d.map((function(t,e){return t+"!=="+f+"["+e+"]"})).join("||")).then(o,".",S[l],"(",d,");",d.map((function(t,e){return f+"["+e+"]="+t})).join(";"),";"))}else{r=c.def(s,".",l);var h=t.cond(r,"!==",u,".",l);c(h),l in _?h(t.cond(r).then(o,".enable(",_[l],");").else(o,".disable(",_[l],");"),u,".",l,"=",r,";"):h(o,".",S[l],"(",r,");",u,".",l,"=",r,";")}})),0===Object.keys(n.state).length&&c(u,".dirty=false;"),e(c)}function z(t,e,n,r){var o=t.shared,i=t.current,a=o.current,u=o.gl;qo(Object.keys(n)).forEach((function(o){var s=n[o];if(!r||r(s)){var c=s.append(t,e);if(_[o]){var f=_[o];Ko(s)?e(u,c?".enable(":".disable(",f,");"):e(t.cond(c).then(u,".enable(",f,");").else(u,".disable(",f,");")),e(a,".",o,"=",c,";")}else if(Ot(c)){var l=i[o];e(u,".",S[o],"(",c,");",c.map((function(t,e){return l+"["+e+"]="+t})).join(";"),";")}else e(u,".",S[o],"(",c,");",a,".",o,"=",c,";")}}))}function G(t,e){y&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function U(t,e,n,r,o){var i,a,u,s=t.shared,c=t.stats,f=s.current,l=s.timer,d=n.profile;function h(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function v(t){t(i=e.def(),"=",h(),";"),"string"==typeof o?t(c,".count+=",o,";"):t(c,".count++;"),p&&(r?t(a=e.def(),"=",l,".getNumPendingQueries();"):t(l,".beginQuery(",c,");"))}function g(t){t(c,".cpuTime+=",h(),"-",i,";"),p&&(r?t(l,".pushScopeStats(",a,",",l,".getNumPendingQueries(),",c,");"):t(l,".endQuery();"))}function m(t){var n=e.def(f,".profile");e(f,".profile=",t,";"),e.exit(f,".profile=",n,";")}if(d){if(Ko(d))return void(d.enable?(v(e),g(e.exit),m("true")):m("false"));m(u=d.append(t,e))}else u=e.def(f,".profile");var y=t.block();v(y),e("if(",u,"){",y,"}");var b=t.block();g(b),e.exit("if(",u,"){",b,"}")}function B(t,e,n,r,o){var i=t.shared;r.forEach((function(r){var a,u=r.name,s=n.attributes[u];if(s){if(!o(s))return;a=s.append(t,e)}else{if(!o(Qo))return;var c=t.scopeAttrib(u);T.optional((function(){t.assert(e,c+".state","missing attribute "+u)})),a={},Object.keys(new g).forEach((function(t){a[t]=e.def(c,".",t)}))}!function(n,r,o){var a=i.gl,u=e.def(n,".location"),s=e.def(i.attributes,"[",u,"]"),c=o.state,f=o.buffer,l=[o.x,o.y,o.z,o.w],d=["buffer","normalized","offset","stride"];function h(){e("if(!",s,".buffer){",a,".enableVertexAttribArray(",u,");}");var n,i=o.type;if(n=o.size?e.def(o.size,"||",r):r,e("if(",s,".type!==",i,"||",s,".size!==",n,"||",d.map((function(t){return s+"."+t+"!=="+o[t]})).join("||"),"){",a,".bindBuffer(",Yr,",",f,".buffer);",a,".vertexAttribPointer(",[u,n,i,o.normalized,o.stride,o.offset],");",s,".type=",i,";",s,".size=",n,";",d.map((function(t){return s+"."+t+"="+o[t]+";"})).join(""),"}"),y){var c=o.divisor;e("if(",s,".divisor!==",c,"){",t.instancing,".vertexAttribDivisorANGLE(",[u,c],");",s,".divisor=",c,";}")}}function p(){e("if(",s,".buffer){",a,".disableVertexAttribArray(",u,");",s,".buffer=null;","}if(",Wn.map((function(t,e){return s+"."+t+"!=="+l[e]})).join("||"),"){",a,".vertexAttrib4f(",u,",",l,");",Wn.map((function(t,e){return s+"."+t+"="+l[e]+";"})).join(""),"}")}c===Hn?h():c===qn?p():(e("if(",c,"===",Hn,"){"),h(),e("}else{"),p(),e("}"))}(t.link(r),function(t){switch(t){case so:case ho:case mo:return 2;case co:case po:case yo:return 3;case fo:case vo:case bo:return 4;default:return 1}}(r.info.type),a)}))}function V(t,e,r,o,i){for(var a,u=t.shared,s=u.gl,c=0;c<o.length;++c){var f,l=o[c],d=l.name,h=l.info.type,p=r.uniforms[d],v=t.link(l)+".location";if(p){if(!i(p))continue;if(Ko(p)){var g=p.value;if(T.command(null!=g,'missing uniform "'+d+'"',t.commandStr),h===_o||h===So){T.command("function"==typeof g&&(h===_o&&("texture2d"===g._reglType||"framebuffer"===g._reglType)||h===So&&("textureCube"===g._reglType||"framebufferCube"===g._reglType)),"invalid texture for uniform "+d,t.commandStr);var m=t.link(g._texture||g.color[0]._texture);e(s,".uniform1i(",v,",",m+".bind());"),e.exit(m,".unbind();")}else if(h===wo||h===Eo||h===xo){T.optional((function(){T.command(Ot(g),"invalid matrix for uniform "+d,t.commandStr),T.command(h===wo&&4===g.length||h===Eo&&9===g.length||h===xo&&16===g.length,"invalid length for matrix uniform "+d,t.commandStr)}));var y=t.global.def("new Float32Array(["+Array.prototype.slice.call(g)+"])"),b=2;h===Eo?b=3:h===xo&&(b=4),e(s,".uniformMatrix",b,"fv(",v,",false,",y,");")}else{switch(h){case uo:T.commandType(g,"number","uniform "+d,t.commandStr),a="1f";break;case so:T.command(Ot(g)&&2===g.length,"uniform "+d,t.commandStr),a="2f";break;case co:T.command(Ot(g)&&3===g.length,"uniform "+d,t.commandStr),a="3f";break;case fo:T.command(Ot(g)&&4===g.length,"uniform "+d,t.commandStr),a="4f";break;case go:T.commandType(g,"boolean","uniform "+d,t.commandStr),a="1i";break;case lo:T.commandType(g,"number","uniform "+d,t.commandStr),a="1i";break;case mo:case ho:T.command(Ot(g)&&2===g.length,"uniform "+d,t.commandStr),a="2i";break;case yo:case po:T.command(Ot(g)&&3===g.length,"uniform "+d,t.commandStr),a="3i";break;case bo:case vo:T.command(Ot(g)&&4===g.length,"uniform "+d,t.commandStr),a="4i"}e(s,".uniform",a,"(",v,",",Ot(g)?Array.prototype.slice.call(g):g,");")}continue}f=p.append(t,e)}else{if(!i(Qo))continue;f=e.def(u.uniforms,"[",n.id(d),"]")}h===_o?(T(!Array.isArray(f),"must specify a scalar prop for textures"),e("if(",f,"&&",f,'._reglType==="framebuffer"){',f,"=",f,".color[0];","}")):h===So&&(T(!Array.isArray(f),"must specify a scalar prop for cube maps"),e("if(",f,"&&",f,'._reglType==="framebufferCube"){',f,"=",f,".color[0];","}")),T.optional((function(){function n(n,r){t.assert(e,n,'bad data or missing for uniform "'+d+'". '+r)}function r(t){T(!Array.isArray(f),"must not specify an array type for uniform"),n("typeof "+f+'==="'+t+'"',"invalid type, expected "+t)}function o(e,r){Array.isArray(f)?T(f.length===e,"must have length "+e):n(u.isArrayLike+"("+f+")&&"+f+".length==="+e,"invalid vector, should have length "+e,t.commandStr)}function i(e){T(!Array.isArray(f),"must not specify a value type"),n("typeof "+f+'==="function"&&'+f+'._reglType==="texture'+(e===Zr?"2d":"Cube")+'"',"invalid texture type",t.commandStr)}switch(h){case lo:r("number");break;case ho:o(2);break;case po:o(3);break;case vo:o(4);break;case uo:r("number");break;case so:o(2);break;case co:o(3);break;case fo:o(4);break;case go:r("boolean");break;case mo:o(2);break;case yo:o(3);break;case bo:case wo:o(4);break;case Eo:o(9);break;case xo:o(16);break;case _o:i(Zr);break;case So:i($r)}}));var w=1;switch(h){case _o:case So:var E=e.def(f,"._texture");e(s,".uniform1i(",v,",",E,".bind());"),e.exit(E,".unbind();");continue;case lo:case go:a="1i";break;case ho:case mo:a="2i",w=2;break;case po:case yo:a="3i",w=3;break;case vo:case bo:a="4i",w=4;break;case uo:a="1f";break;case so:a="2f",w=2;break;case co:a="3f",w=3;break;case fo:a="4f",w=4;break;case wo:a="Matrix2fv";break;case Eo:a="Matrix3fv";break;case xo:a="Matrix4fv"}if(e(s,".uniform",a,"(",v,","),"M"===a.charAt(0)){var x=Math.pow(h-wo+2,2),_=t.global.def("new Float32Array(",x,")");Array.isArray(f)?e("false,(",F(x,(function(t){return _+"["+t+"]="+f[t]})),",",_,")"):e("false,(Array.isArray(",f,")||",f," instanceof Float32Array)?",f,":(",F(x,(function(t){return _+"["+t+"]="+f+"["+t+"]"})),",",_,")")}else w>1?e(F(w,(function(t){return Array.isArray(f)?f[t]:f+"["+t+"]"}))):(T(!Array.isArray(f),"uniform value must not be an array"),e(f));e(");")}}function W(t,e,n,r){var o=t.shared,i=o.gl,a=o.draw,u=r.draw;var s=function(){var o,s=u.elements,c=e;return s?((s.contextDep&&r.contextDynamic||s.propDep)&&(c=n),o=s.append(t,c)):o=c.def(a,".",kr),o&&c("if("+o+")"+i+".bindBuffer("+Kr+","+o+".buffer.buffer);"),o}();function c(o){var i=u[o];return i?i.contextDep&&r.contextDynamic||i.propDep?i.append(t,n):i.append(t,e):e.def(a,".",o)}var f,l,d=c(Rr),h=c(Lr),p=function(){var o,i=u.count,s=e;return i?((i.contextDep&&r.contextDynamic||i.propDep)&&(s=n),o=i.append(t,s),T.optional((function(){i.MISSING&&t.assert(e,"false","missing vertex count"),i.DYNAMIC&&t.assert(s,o+">=0","missing vertex count")}))):(o=s.def(a,".",Cr),T.optional((function(){t.assert(s,o+">=0","missing vertex count")}))),o}();if("number"==typeof p){if(0===p)return}else n("if(",p,"){"),n.exit("}");y&&(f=c(Pr),l=t.instancing);var v=s+".type",g=u.elements&&Ko(u.elements);function m(){function t(){n(l,".drawElementsInstancedANGLE(",[d,p,v,h+"<<(("+v+"-"+Xn+")>>1)",f],");")}function e(){n(l,".drawArraysInstancedANGLE(",[d,h,p,f],");")}s?g?t():(n("if(",s,"){"),t(),n("}else{"),e(),n("}")):e()}function b(){function t(){n(i+".drawElements("+[d,p,v,h+"<<(("+v+"-"+Xn+")>>1)"]+");")}function e(){n(i+".drawArrays("+[d,h,p]+");")}s?g?t():(n("if(",s,"){"),t(),n("}else{"),e(),n("}")):e()}y&&("number"!=typeof f||f>=0)?"string"==typeof f?(n("if(",f,">0){"),m(),n("}else if(",f,"<0){"),b(),n("}")):m():b()}function X(t,e,n,r,o){var i=k(),a=i.proc("body",o);return T.optional((function(){i.commandStr=e.commandStr,i.command=i.link(e.commandStr)})),y&&(i.instancing=a.def(i.shared.extensions,".angle_instanced_arrays")),t(i,a,n,r),i.compile().body}function H(t,e,n,r){G(t,e),n.useVAO?n.drawVAO?e(t.shared.vao,".setVAO(",n.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),B(t,e,n,r.attributes,(function(){return!0}))),V(t,e,n,r.uniforms,(function(){return!0})),W(t,e,e,n)}function q(t,e,n,r){function o(){return!0}t.batchId="a1",G(t,e),B(t,e,n,r.attributes,o),V(t,e,n,r.uniforms,o),W(t,e,e,n)}function Y(t,e,n,r){G(t,e);var o=n.contextDep,i=e.def(),a=e.def();t.shared.props=a,t.batchId=i;var u=t.scope(),s=t.scope();function c(t){return t.contextDep&&o||t.propDep}function f(t){return!c(t)}if(e(u.entry,"for(",i,"=0;",i,"<","a1",";++",i,"){",a,"=","a0","[",i,"];",s,"}",u.exit),n.needsContext&&L(t,s,n.context),n.needsFramebuffer&&P(t,s,n.framebuffer),z(t,s,n.state,c),n.profile&&c(n.profile)&&U(t,s,n,!1,!0),r)n.useVAO?n.drawVAO?c(n.drawVAO)?s(t.shared.vao,".setVAO(",n.drawVAO.append(t,s),");"):u(t.shared.vao,".setVAO(",n.drawVAO.append(t,u),");"):u(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(u(t.shared.vao,".setVAO(null);"),B(t,u,n,r.attributes,f),B(t,s,n,r.attributes,c)),V(t,u,n,r.uniforms,f),V(t,s,n,r.uniforms,c),W(t,u,s,n);else{var l=t.global.def("{}"),d=n.shader.progVar.append(t,s),h=s.def(d,".id"),p=s.def(l,"[",h,"]");s(t.shared.gl,".useProgram(",d,".program);","if(!",p,"){",p,"=",l,"[",h,"]=",t.link((function(e){return X(q,t,n,e,2)})),"(",d,");}",p,".call(this,a0[",i,"],",i,");")}}function K(t,e,n){var r=e.static[n];if(r&&function(t){if("object"==typeof t&&!Ot(t)){for(var e=Object.keys(t),n=0;n<e.length;++n)if(R.isDynamic(t[e[n]]))return!0;return!1}}(r)){var o=t.global,i=Object.keys(r),a=!1,u=!1,s=!1,c=t.global.def("{}");i.forEach((function(e){var n=r[e];if(R.isDynamic(n)){"function"==typeof n&&(n=r[e]=R.unbox(n));var i=$o(n,null);a=a||i.thisDep,s=s||i.propDep,u=u||i.contextDep}else{switch(o(c,".",e,"="),typeof n){case"number":o(n);break;case"string":o('"',n,'"');break;case"object":Array.isArray(n)&&o("[",n.join(),"]");break;default:o(t.link(n))}o(";")}})),e.dynamic[n]=new R.DynamicVariable(Qn,{thisDep:a,contextDep:u,propDep:s,ref:c,append:function(t,e){i.forEach((function(n){var o=r[n];if(R.isDynamic(o)){var i=t.invoke(e,o);e(c,".",n,"=",i,";")}}))}}),delete e.static[n]}}return{next:E,current:w,procs:function(){var t=k(),e=t.proc("poll"),n=t.proc("refresh"),i=t.block();e(i),n(i);var a,u=t.shared,s=u.gl,c=u.next,f=u.current;i(f,".dirty=false;"),P(t,e),P(t,n,null,!0),y&&(a=t.link(y)),r.oes_vertex_array_object&&n(t.link(r.oes_vertex_array_object),".bindVertexArrayOES(null);");for(var l=0;l<o.maxAttributes;++l){var d=n.def(u.attributes,"[",l,"]"),h=t.cond(d,".buffer");h.then(s,".enableVertexAttribArray(",l,");",s,".bindBuffer(",Yr,",",d,".buffer.buffer);",s,".vertexAttribPointer(",l,",",d,".size,",d,".type,",d,".normalized,",d,".stride,",d,".offset);").else(s,".disableVertexAttribArray(",l,");",s,".vertexAttrib4f(",l,",",d,".x,",d,".y,",d,".z,",d,".w);",d,".buffer=null;"),n(h),y&&n(a,".vertexAttribDivisorANGLE(",l,",",d,".divisor);")}return n(t.shared.vao,".currentVAO=null;",t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"),Object.keys(_).forEach((function(r){var o=_[r],a=i.def(c,".",r),u=t.block();u("if(",a,"){",s,".enable(",o,")}else{",s,".disable(",o,")}",f,".",r,"=",a,";"),n(u),e("if(",a,"!==",f,".",r,"){",u,"}")})),Object.keys(S).forEach((function(r){var o,a,u=S[r],l=w[r],d=t.block();if(d(s,".",u,"("),Ot(l)){var h=l.length;o=t.global.def(c,".",r),a=t.global.def(f,".",r),d(F(h,(function(t){return o+"["+t+"]"})),");",F(h,(function(t){return a+"["+t+"]="+o+"["+t+"];"})).join("")),e("if(",F(h,(function(t){return o+"["+t+"]!=="+a+"["+t+"]"})).join("||"),"){",d,"}")}else o=i.def(c,".",r),a=i.def(f,".",r),d(o,");",f,".",r,"=",o,";"),e("if(",o,"!==",a,"){",d,"}");n(d)})),t.compile()}(),compile:function(t,r,o,i,a){var u=k();u.stats=u.link(a),Object.keys(r.static).forEach((function(t){K(u,r,t)})),qr.forEach((function(e){K(u,t,e)}));var s=C(t,r,o,i,u);return function(t,e){var n=t.proc("draw",1);G(t,n),L(t,n,e.context),P(t,n,e.framebuffer),j(t,n,e),z(t,n,e.state),U(t,n,e,!1,!0);var r=e.shader.progVar.append(t,n);if(n(t.shared.gl,".useProgram(",r,".program);"),e.shader.program)H(t,n,e,e.shader.program);else{n(t.shared.vao,".setVAO(null);");var o=t.global.def("{}"),i=n.def(r,".id"),a=n.def(o,"[",i,"]");n(t.cond(a).then(a,".call(this,a0);").else(a,"=",o,"[",i,"]=",t.link((function(n){return X(H,t,e,n,1)})),"(",r,");",a,".call(this,a0);"))}Object.keys(e.state).length>0&&n(t.shared.current,".dirty=true;")}(u,s),function(t,e){var r=t.proc("scope",3);t.batchId="a2";var o=t.shared,i=o.current;function a(n){var i=e.shader[n];i&&r.set(o.shader,"."+n,i.append(t,r))}L(t,r,e.context),e.framebuffer&&e.framebuffer.append(t,r),qo(Object.keys(e.state)).forEach((function(n){var i=e.state[n].append(t,r);Ot(i)?i.forEach((function(e,o){r.set(t.next[n],"["+o+"]",e)})):r.set(o.next,"."+n,i)})),U(t,r,e,!0,!0),[kr,Lr,Cr,Pr,Rr].forEach((function(n){var i=e.draw[n];i&&r.set(o.draw,"."+n,""+i.append(t,r))})),Object.keys(e.uniforms).forEach((function(i){var a=e.uniforms[i].append(t,r);Array.isArray(a)&&(a="["+a.join()+"]"),r.set(o.uniforms,"["+n.id(i)+"]",a)})),Object.keys(e.attributes).forEach((function(n){var o=e.attributes[n].append(t,r),i=t.scopeAttrib(n);Object.keys(new g).forEach((function(t){r.set(i,"."+t,o[t])}))})),e.scopeVAO&&r.set(o.vao,".targetVAO",e.scopeVAO.append(t,r)),a(Dr),a(Mr),Object.keys(e.state).length>0&&(r(i,".dirty=true;"),r.exit(i,".dirty=true;")),r("a1(",t.shared.context,",a0,",t.batchId,");")}(u,s),function(t,e){var n=t.proc("batch",2);t.batchId="0",G(t,n);var r=!1,o=!0;Object.keys(e.context).forEach((function(t){r=r||e.context[t].propDep})),r||(L(t,n,e.context),o=!1);var i=e.framebuffer,a=!1;function u(t){return t.contextDep&&r||t.propDep}i?(i.propDep?r=a=!0:i.contextDep&&r&&(a=!0),a||P(t,n,i)):P(t,n,null),e.state.viewport&&e.state.viewport.propDep&&(r=!0),j(t,n,e),z(t,n,e.state,(function(t){return!u(t)})),e.profile&&u(e.profile)||U(t,n,e,!1,"a1"),e.contextDep=r,e.needsContext=o,e.needsFramebuffer=a;var s=e.shader.progVar;if(s.contextDep&&r||s.propDep)Y(t,n,e,null);else{var c=s.append(t,n);if(n(t.shared.gl,".useProgram(",c,".program);"),e.shader.program)Y(t,n,e,e.shader.program);else{n(t.shared.vao,".setVAO(null);");var f=t.global.def("{}"),l=n.def(c,".id"),d=n.def(f,"[",l,"]");n(t.cond(d).then(d,".call(this,a0,a1);").else(d,"=",f,"[",l,"]=",t.link((function(n){return X(Y,t,e,n,2)})),"(",c,");",d,".call(this,a0,a1);"))}}Object.keys(e.state).length>0&&n(t.shared.current,".dirty=true;")}(u,s),e(u.compile(),{destroy:function(){s.shader.program.destroy()}})}}}var ti=function(t,e){if(!e.ext_disjoint_timer_query)return null;var n=[];function r(t){n.push(t)}var o=[];function i(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var a=[];function u(t){a.push(t)}var s=[];function c(t,e,n){var r=a.pop()||new i;r.startQueryIndex=t,r.endQueryIndex=e,r.sum=0,r.stats=n,s.push(r)}var f=[],l=[];return{beginQuery:function(t){var r=n.pop()||e.ext_disjoint_timer_query.createQueryEXT();e.ext_disjoint_timer_query.beginQueryEXT(35007,r),o.push(r),c(o.length-1,o.length,t)},endQuery:function(){e.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:c,update:function(){var t,n,i=o.length;if(0!==i){l.length=Math.max(l.length,i+1),f.length=Math.max(f.length,i+1),f[0]=0,l[0]=0;var a=0;for(t=0,n=0;n<o.length;++n){var c=o[n];e.ext_disjoint_timer_query.getQueryObjectEXT(c,34919)?(a+=e.ext_disjoint_timer_query.getQueryObjectEXT(c,34918),r(c)):o[t++]=c,f[n+1]=a,l[n+1]=t}for(o.length=t,t=0,n=0;n<s.length;++n){var d=s[n],h=d.startQueryIndex,p=d.endQueryIndex;d.sum+=f[p]-f[h];var v=l[h],g=l[p];g===v?(d.stats.gpuTime+=d.sum/1e6,u(d)):(d.startQueryIndex=v,d.endQueryIndex=g,s[t++]=d)}s.length=t}},getNumPendingQueries:function(){return o.length},clear:function(){n.push.apply(n,o);for(var t=0;t<n.length;t++)e.ext_disjoint_timer_query.deleteQueryEXT(n[t]);o.length=0,n.length=0},restore:function(){o.length=0,n.length=0}}},ei="webglcontextlost",ni="webglcontextrestored";function ri(t,e){for(var n=0;n<t.length;++n)if(t[n]===e)return n;return-1}return function(n){var r=z(n);if(!r)return null;var o=r.gl,i=o.getContextAttributes(),a=o.isContextLost(),u=function(t,e){var n={};function r(e){T.type(e,"string","extension name must be string");var r,o=e.toLowerCase();try{r=n[o]=t.getExtension(o)}catch(t){}return!!r}for(var o=0;o<e.extensions.length;++o){var i=e.extensions[o];if(!r(i))return e.onDestroy(),e.onDone('"'+i+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return e.optionalExtensions.forEach(r),{extensions:n,restore:function(){Object.keys(n).forEach((function(t){if(n[t]&&!r(t))throw new Error("(regl): error restoring extension "+t)}))}}}(o,r);if(!u)return null;var s,c,f=(s={"":0},c=[""],{id:function(t){var e=s[t];return e||(e=s[t]=c.length,c.push(t),e)},str:function(t){return c[t]}}),l={vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},d=u.extensions,h=ti(0,d),p=L(),v=o.drawingBufferWidth,g=o.drawingBufferHeight,m={tick:0,time:0,viewportWidth:v,viewportHeight:g,framebufferWidth:v,framebufferHeight:g,drawingBufferWidth:v,drawingBufferHeight:g,pixelRatio:r.pixelRatio},y=function(t,e){var n=1;e.ext_texture_filter_anisotropic&&(n=t.getParameter(34047));var r=1,o=1;e.webgl_draw_buffers&&(r=t.getParameter(34852),o=t.getParameter(36063));var i=!!e.oes_texture_float;if(i){var a=t.createTexture();t.bindTexture(V,a),t.texImage2D(V,0,W,1,1,0,W,X,null);var u=t.createFramebuffer();if(t.bindFramebuffer(H,u),t.framebufferTexture2D(H,36064,V,a,0),t.bindTexture(V,null),36053!==t.checkFramebufferStatus(H))i=!1;else{t.viewport(0,0,1,1),t.clearColor(1,0,0,1),t.clear(16384);var s=B.allocType(X,4);t.readPixels(0,0,1,1,W,X,s),t.getError()?i=!1:(t.deleteFramebuffer(u),t.deleteTexture(a),i=1===s[0]),B.freeType(s)}}var c=!0;if("undefined"==typeof navigator||!(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent))){var f=t.createTexture(),l=B.allocType(5121,36);t.activeTexture(33984),t.bindTexture(34067,f),t.texImage2D(34069,0,W,3,3,0,W,5121,l),B.freeType(l),t.bindTexture(34067,null),t.deleteTexture(f),c=!t.getError()}return{colorBits:[t.getParameter(3410),t.getParameter(3411),t.getParameter(3412),t.getParameter(3413)],depthBits:t.getParameter(3414),stencilBits:t.getParameter(3415),subpixelBits:t.getParameter(3408),extensions:Object.keys(e).filter((function(t){return!!e[t]})),maxAnisotropic:n,maxDrawbuffers:r,maxColorAttachments:o,pointSizeDims:t.getParameter(33901),lineWidthDims:t.getParameter(33902),maxViewportDims:t.getParameter(3386),maxCombinedTextureUnits:t.getParameter(35661),maxCubeMapSize:t.getParameter(34076),maxRenderbufferSize:t.getParameter(34024),maxTextureUnits:t.getParameter(34930),maxTextureSize:t.getParameter(3379),maxAttributes:t.getParameter(34921),maxVertexUniforms:t.getParameter(36347),maxVertexTextureUnits:t.getParameter(35660),maxVaryingVectors:t.getParameter(36348),maxFragmentUniforms:t.getParameter(36349),glsl:t.getParameter(35724),renderer:t.getParameter(7937),vendor:t.getParameter(7936),version:t.getParameter(7938),readFloat:i,npotTextureCube:c}}(o,d),b=function(e,n,r,o){var i=0,a={};function u(t){this.id=i++,this.buffer=e.createBuffer(),this.type=t,this.usage=rt,this.byteLength=0,this.dimension=1,this.dtype=it,this.persistentData=null,r.profile&&(this.stats={size:0})}u.prototype.bind=function(){e.bindBuffer(this.type,this.buffer)},u.prototype.destroy=function(){l(this)};var s=[];function c(t,n,r){t.byteLength=n.byteLength,e.bufferData(t.type,n,r)}function f(e,n,r,o,i,a){var u,s;if(e.usage=r,Array.isArray(n)){if(e.dtype=o||at,n.length>0)if(Array.isArray(n[0])){u=nt(n);for(var f=1,l=1;l<u.length;++l)f*=u[l];e.dimension=f,c(e,s=et(n,u,e.dtype),r),a?e.persistentData=s:B.freeType(s)}else if("number"==typeof n[0]){e.dimension=i;var d=B.allocType(e.dtype,n.length);ct(d,n),c(e,d,r),a?e.persistentData=d:B.freeType(d)}else t(n[0])?(e.dimension=n[0].length,e.dtype=o||st(n[0])||at,c(e,s=et(n,[n.length,n[0].length],e.dtype),r),a?e.persistentData=s:B.freeType(s)):T.raise("invalid buffer data")}else if(t(n))e.dtype=o||st(n),e.dimension=i,c(e,n,r),a&&(e.persistentData=new Uint8Array(new Uint8Array(n.buffer)));else if(q(n)){u=n.shape;var h=n.stride,p=n.offset,v=0,g=0,m=0,y=0;1===u.length?(v=u[0],g=1,m=h[0],y=0):2===u.length?(v=u[0],g=u[1],m=h[0],y=h[1]):T.raise("invalid shape"),e.dtype=o||st(n.data)||at,e.dimension=g;var b=B.allocType(e.dtype,v*g);ft(b,n.data,v,g,m,y,p),c(e,b,r),a?e.persistentData=b:B.freeType(b)}else n instanceof ArrayBuffer?(e.dtype=it,e.dimension=i,c(e,n,r),a&&(e.persistentData=new Uint8Array(new Uint8Array(n)))):T.raise("invalid buffer data")}function l(t){n.bufferCount--,o(t);var r=t.buffer;T(r,"buffer must not be deleted already"),e.deleteBuffer(r),t.buffer=null,delete a[t.id]}return r.profile&&(n.getTotalBufferSize=function(){var t=0;return Object.keys(a).forEach((function(e){t+=a[e].stats.size})),t}),{create:function(o,i,s,c){n.bufferCount++;var d=new u(i);function h(n){var o=rt,i=null,a=0,u=0,s=1;return Array.isArray(n)||t(n)||q(n)||n instanceof ArrayBuffer?i=n:"number"==typeof n?a=0|n:n&&(T.type(n,"object","buffer arguments must be an object, a number or an array"),"data"in n&&(T(null===i||Array.isArray(i)||t(i)||q(i),"invalid data for buffer"),i=n.data),"usage"in n&&(T.parameter(n.usage,tt,"invalid buffer usage"),o=tt[n.usage]),"type"in n&&(T.parameter(n.type,J,"invalid buffer type"),u=J[n.type]),"dimension"in n&&(T.type(n.dimension,"number","invalid dimension"),s=0|n.dimension),"length"in n&&(T.nni(a,"buffer length must be a nonnegative integer"),a=0|n.length)),d.bind(),i?f(d,i,o,u,s,c):(a&&e.bufferData(d.type,a,o),d.dtype=u||it,d.usage=o,d.dimension=s,d.byteLength=a),r.profile&&(d.stats.size=d.byteLength*ut[d.dtype]),h}function p(t,n){T(n+t.byteLength<=d.byteLength,"invalid buffer subdata call, buffer is too small. Can't write data of size "+t.byteLength+" starting from offset "+n+" to a buffer of size "+d.byteLength),e.bufferSubData(d.type,n,t)}return a[d.id]=d,s||h(o),h._reglType="buffer",h._buffer=d,h.subdata=function(e,n){var r,o=0|(n||0);if(d.bind(),t(e)||e instanceof ArrayBuffer)p(e,o);else if(Array.isArray(e)){if(e.length>0)if("number"==typeof e[0]){var i=B.allocType(d.dtype,e.length);ct(i,e),p(i,o),B.freeType(i)}else if(Array.isArray(e[0])||t(e[0])){r=nt(e);var a=et(e,r,d.dtype);p(a,o),B.freeType(a)}else T.raise("invalid buffer data")}else if(q(e)){r=e.shape;var u=e.stride,s=0,c=0,f=0,l=0;1===r.length?(s=r[0],c=1,f=u[0],l=0):2===r.length?(s=r[0],c=r[1],f=u[0],l=u[1]):T.raise("invalid shape");var v=Array.isArray(e.data)?d.dtype:st(e.data),g=B.allocType(v,s*c);ft(g,e.data,s,c,f,l,e.offset),p(g,o),B.freeType(g)}else T.raise("invalid data for buffer subdata");return h},r.profile&&(h.stats=d.stats),h.destroy=function(){l(d)},h},createStream:function(t,e){var n=s.pop();return n||(n=new u(t)),n.bind(),f(n,e,ot,0,1,!1),n},destroyStream:function(t){s.push(t)},clear:function(){Y(a).forEach(l),s.forEach(l)},getBuffer:function(t){return t&&t._buffer instanceof u?t._buffer:null},restore:function(){Y(a).forEach((function(t){t.buffer=e.createBuffer(),e.bindBuffer(t.type,t.buffer),e.bufferData(t.type,t.persistentData||t.byteLength,t.usage)}))},_initBuffer:f}}(o,l,r,(function(t){return w.destroyBuffer(t)})),w=function(e,n,r,o,i){for(var a=r.maxAttributes,u=new Array(a),s=0;s<a;++s)u[s]=new kn;var c=0,f={},l={Record:kn,scope:{},state:u,currentVAO:null,targetVAO:null,restore:d()?function(){d()&&Y(f).forEach((function(t){t.refresh()}))}:function(){},createVAO:function(e){var r=new p;function u(e){T(Array.isArray(e),"arguments to vertex array constructor must be an array"),T(e.length<a,"too many attributes"),T(e.length>0,"must specify at least one attribute");var o={},s=r.attributes;s.length=e.length;for(var c=0;c<e.length;++c){var f,l=e[c],d=s[c]=new kn,h=l.data||l;Array.isArray(h)||t(h)||q(h)?(r.buffers[c]&&(f=r.buffers[c],t(h)&&f._buffer.byteLength>=h.byteLength?f.subdata(h):(f.destroy(),r.buffers[c]=null)),r.buffers[c]||(f=r.buffers[c]=i.create(l,Mn,!1,!0)),d.buffer=i.getBuffer(f),d.size=0|d.buffer.dimension,d.normalized=!1,d.type=d.buffer.dtype,d.offset=0,d.stride=0,d.divisor=0,d.state=1,o[c]=1):i.getBuffer(l)?(d.buffer=i.getBuffer(l),d.size=0|d.buffer.dimension,d.normalized=!1,d.type=d.buffer.dtype,d.offset=0,d.stride=0,d.divisor=0,d.state=1):i.getBuffer(l.buffer)?(d.buffer=i.getBuffer(l.buffer),d.size=0|(+l.size||d.buffer.dimension),d.normalized=!!l.normalized||!1,"type"in l?(T.parameter(l.type,J,"invalid buffer type"),d.type=J[l.type]):d.type=d.buffer.dtype,d.offset=0|(l.offset||0),d.stride=0|(l.stride||0),d.divisor=0|(l.divisor||0),d.state=1,T(d.size>=1&&d.size<=4,"size must be between 1 and 4"),T(d.offset>=0,"invalid offset"),T(d.stride>=0&&d.stride<=255,"stride must be between 0 and 255"),T(d.divisor>=0,"divisor must be positive"),T(!d.divisor||!!n.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in l?(T(c>0,"first attribute must not be a constant"),d.x=+l.x||0,d.y=+l.y||0,d.z=+l.z||0,d.w=+l.w||0,d.state=2):T(!1,"invalid attribute spec for location "+c)}for(var p=0;p<r.buffers.length;++p)!o[p]&&r.buffers[p]&&(r.buffers[p].destroy(),r.buffers[p]=null);return r.refresh(),u}return o.vaoCount+=1,u.destroy=function(){for(var t=0;t<r.buffers.length;++t)r.buffers[t]&&r.buffers[t].destroy();r.buffers.length=0,r.destroy()},u._vao=r,u._reglType="vao",u(e)},getVAO:function(t){return"function"==typeof t&&t._vao?t._vao:null},destroyBuffer:function(t){for(var n=0;n<u.length;++n){var r=u[n];r.buffer===t&&(e.disableVertexAttribArray(n),r.buffer=null)}},setVAO:d()?function(t){if(t!==l.currentVAO){var e=d();t?e.bindVertexArrayOES(t.vao):e.bindVertexArrayOES(null),l.currentVAO=t}}:function(t){if(t!==l.currentVAO){if(t)t.bindAttrs();else for(var n=h(),r=0;r<u.length;++r){var o=u[r];o.buffer?(e.enableVertexAttribArray(r),e.vertexAttribPointer(r,o.size,o.type,o.normalized,o.stride,o.offfset),n&&o.divisor&&n.vertexAttribDivisorANGLE(r,o.divisor)):(e.disableVertexAttribArray(r),e.vertexAttrib4f(r,o.x,o.y,o.z,o.w))}l.currentVAO=t}},clear:d()?function(){Y(f).forEach((function(t){t.destroy()}))}:function(){}};function d(){return n.oes_vertex_array_object}function h(){return n.angle_instanced_arrays}function p(){this.id=++c,this.attributes=[];var t=d();this.vao=t?t.createVertexArrayOES():null,f[this.id]=this,this.buffers=[]}return p.prototype.bindAttrs=function(){for(var t=h(),n=this.attributes,r=0;r<n.length;++r){var o=n[r];o.buffer?(e.enableVertexAttribArray(r),e.bindBuffer(Mn,o.buffer.buffer),e.vertexAttribPointer(r,o.size,o.type,o.normalized,o.stride,o.offset),t&&o.divisor&&t.vertexAttribDivisorANGLE(r,o.divisor)):(e.disableVertexAttribArray(r),e.vertexAttrib4f(r,o.x,o.y,o.z,o.w))}for(var i=n.length;i<a;++i)e.disableVertexAttribArray(i)},p.prototype.refresh=function(){var t=d();t&&(t.bindVertexArrayOES(this.vao),this.bindAttrs(),l.currentVAO=this)},p.prototype.destroy=function(){if(this.vao){var t=d();this===l.currentVAO&&(l.currentVAO=null,t.bindVertexArrayOES(null)),t.deleteVertexArrayOES(this.vao),this.vao=null}f[this.id]&&(delete f[this.id],o.vaoCount-=1)},l}(o,d,y,l,b),E=function(e,n,r,o){var i={},a=0,u={uint8:gt,uint16:yt};function s(t){this.id=a++,i[this.id]=this,this.buffer=t,this.primType=pt,this.vertCount=0,this.type=0}n.oes_element_index_uint&&(u.uint32=wt),s.prototype.bind=function(){this.buffer.bind()};var c=[];function f(o,i,a,u,s,c,f){var l;if(o.buffer.bind(),i){var d=f;f||t(i)&&(!q(i)||t(i.data))||(d=n.oes_element_index_uint?wt:yt),r._initBuffer(o.buffer,i,a,d,3)}else e.bufferData(Et,c,a),o.buffer.dtype=l||gt,o.buffer.usage=a,o.buffer.dimension=3,o.buffer.byteLength=c;if(l=f,!f){switch(o.buffer.dtype){case gt:case vt:l=gt;break;case yt:case mt:l=yt;break;case wt:case bt:l=wt;break;default:T.raise("unsupported type for element array")}o.buffer.dtype=l}o.type=l,T(l!==wt||!!n.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var h=s;h<0&&(h=o.buffer.byteLength,l===yt?h>>=1:l===wt&&(h>>=2)),o.vertCount=h;var p=u;if(u<0){p=pt;var v=o.buffer.dimension;1===v&&(p=dt),2===v&&(p=ht),3===v&&(p=pt)}o.primType=p}function l(t){o.elementsCount--,T(null!==t.buffer,"must not double destroy elements"),delete i[t.id],t.buffer.destroy(),t.buffer=null}return{create:function(e,n){var i=r.create(null,Et,!0),a=new s(i._buffer);function c(e){if(e)if("number"==typeof e)i(e),a.primType=pt,a.vertCount=0|e,a.type=gt;else{var n=null,r=_t,o=-1,s=-1,l=0,d=0;Array.isArray(e)||t(e)||q(e)?n=e:(T.type(e,"object","invalid arguments for elements"),"data"in e&&(n=e.data,T(Array.isArray(n)||t(n)||q(n),"invalid data for element buffer")),"usage"in e&&(T.parameter(e.usage,tt,"invalid element buffer usage"),r=tt[e.usage]),"primitive"in e&&(T.parameter(e.primitive,lt,"invalid element buffer primitive"),o=lt[e.primitive]),"count"in e&&(T("number"==typeof e.count&&e.count>=0,"invalid vertex count for elements"),s=0|e.count),"type"in e&&(T.parameter(e.type,u,"invalid buffer type"),d=u[e.type]),"length"in e?l=0|e.length:(l=s,d===yt||d===mt?l*=2:d!==wt&&d!==bt||(l*=4))),f(a,n,r,o,s,l,d)}else i(),a.primType=pt,a.vertCount=0,a.type=gt;return c}return o.elementsCount++,c(e),c._reglType="elements",c._elements=a,c.subdata=function(t,e){return i.subdata(t,e),c},c.destroy=function(){l(a)},c},createStream:function(t){var e=c.pop();return e||(e=new s(r.create(null,Et,!0,!1)._buffer)),f(e,t,xt,-1,-1,0,0),e},destroyStream:function(t){c.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof s?t._elements:null},clear:function(){Y(i).forEach(l)}}}(o,d,b,l),x=function(t,n,r,o){var i={},a={};function u(t,e,n,r){this.name=t,this.id=e,this.location=n,this.info=r}function s(t,e){for(var n=0;n<t.length;++n)if(t[n].id===e.id)return void(t[n].location=e.location);t.push(e)}function c(e,r,o){var u=e===Rn?i:a,s=u[r];if(!s){var c=n.str(r);s=t.createShader(e),t.shaderSource(s,c),t.compileShader(s),T.shaderError(t,s,c,e,o),u[r]=s}return s}var f={},l=[],d=0;function h(t,e){this.id=d++,this.fragId=t,this.vertId=e,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,o.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function p(e,r,i){var a,f,l=c(Rn,e.fragId),d=c(Cn,e.vertId),h=e.program=t.createProgram();if(t.attachShader(h,l),t.attachShader(h,d),i)for(a=0;a<i.length;++a){var p=i[a];t.bindAttribLocation(h,p[0],p[1])}t.linkProgram(h),T.linkError(t,h,n.str(e.fragId),n.str(e.vertId),r);var v=t.getProgramParameter(h,Ln);o.profile&&(e.stats.uniformsCount=v);var g=e.uniforms;for(a=0;a<v;++a)if(f=t.getActiveUniform(h,a))if(f.size>1)for(var m=0;m<f.size;++m){var y=f.name.replace("[0]","["+m+"]");s(g,new u(y,n.id(y),t.getUniformLocation(h,y),f))}else s(g,new u(f.name,n.id(f.name),t.getUniformLocation(h,f.name),f));var b=t.getProgramParameter(h,Pn);o.profile&&(e.stats.attributesCount=b);var w=e.attributes;for(a=0;a<b;++a)(f=t.getActiveAttrib(h,a))&&s(w,new u(f.name,n.id(f.name),t.getAttribLocation(h,f.name),f))}return o.profile&&(r.getMaxUniformsCount=function(){var t=0;return l.forEach((function(e){e.stats.uniformsCount>t&&(t=e.stats.uniformsCount)})),t},r.getMaxAttributesCount=function(){var t=0;return l.forEach((function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)})),t}),{clear:function(){var e=t.deleteShader.bind(t);Y(i).forEach(e),i={},Y(a).forEach(e),a={},l.forEach((function(e){t.deleteProgram(e.program)})),l.length=0,f={},r.shaderCount=0},program:function(n,o,u,s){T.command(n>=0,"missing vertex shader",u),T.command(o>=0,"missing fragment shader",u);var c=f[o];c||(c=f[o]={});var d=c[n];if(d&&(d.refCount++,!s))return d;var v=new h(o,n);return r.shaderCount++,p(v,u,s),d||(c[n]=v),l.push(v),e(v,{destroy:function(){if(v.refCount--,v.refCount<=0){t.deleteProgram(v.program);var e=l.indexOf(v);l.splice(e,1),r.shaderCount--}c[v.vertId].refCount<=0&&(t.deleteShader(a[v.vertId]),delete a[v.vertId],delete f[v.fragId][v.vertId]),Object.keys(f[v.fragId]).length||(t.deleteShader(i[v.fragId]),delete i[v.fragId],delete f[v.fragId])}})},restore:function(){i={},a={};for(var t=0;t<l.length;++t)p(l[t],null,l[t].attributes.map((function(t){return[t.location,t.name]})))},shader:c,frag:-1,vert:-1}}(o,f,l,r),_=un(o,d,y,(function(){I.procs.poll()}),m,l,r),S=function(t,e,n,r,o){var i={rgba4:cn,rgb565:36194,"rgb5 a1":32855,depth:33189,stencil:36168,"depth stencil":34041};e.ext_srgb&&(i.srgba=35907),e.ext_color_buffer_half_float&&(i.rgba16f=34842,i.rgb16f=34843),e.webgl_color_buffer_float&&(i.rgba32f=34836);var a=[];Object.keys(i).forEach((function(t){var e=i[t];a[e]=t}));var u=0,s={};function c(t){this.id=u++,this.refCount=1,this.renderbuffer=t,this.format=cn,this.width=0,this.height=0,o.profile&&(this.stats={size:0})}function f(e){var n=e.renderbuffer;T(n,"must not double destroy renderbuffer"),t.bindRenderbuffer(sn,null),t.deleteRenderbuffer(n),e.renderbuffer=null,e.refCount=0,delete s[e.id],r.renderbufferCount--}return c.prototype.decRef=function(){--this.refCount<=0&&f(this)},o.profile&&(r.getTotalRenderbufferSize=function(){var t=0;return Object.keys(s).forEach((function(e){t+=s[e].stats.size})),t}),{create:function(e,u){var f=new c(t.createRenderbuffer());function l(e,r){var u=0,s=0,c=cn;if("object"==typeof e&&e){var d=e;if("shape"in d){var h=d.shape;T(Array.isArray(h)&&h.length>=2,"invalid renderbuffer shape"),u=0|h[0],s=0|h[1]}else"radius"in d&&(u=s=0|d.radius),"width"in d&&(u=0|d.width),"height"in d&&(s=0|d.height);"format"in d&&(T.parameter(d.format,i,"invalid renderbuffer format"),c=i[d.format])}else"number"==typeof e?(u=0|e,s="number"==typeof r?0|r:u):e?T.raise("invalid arguments to renderbuffer constructor"):u=s=1;if(T(u>0&&s>0&&u<=n.maxRenderbufferSize&&s<=n.maxRenderbufferSize,"invalid renderbuffer size"),u!==f.width||s!==f.height||c!==f.format)return l.width=f.width=u,l.height=f.height=s,f.format=c,t.bindRenderbuffer(sn,f.renderbuffer),t.renderbufferStorage(sn,c,u,s),T(0===t.getError(),"invalid render buffer format"),o.profile&&(f.stats.size=ln(f.format,f.width,f.height)),l.format=a[f.format],l}return s[f.id]=f,r.renderbufferCount++,l(e,u),l.resize=function(e,r){var i=0|e,a=0|r||i;return i===f.width&&a===f.height||(T(i>0&&a>0&&i<=n.maxRenderbufferSize&&a<=n.maxRenderbufferSize,"invalid renderbuffer size"),l.width=f.width=i,l.height=f.height=a,t.bindRenderbuffer(sn,f.renderbuffer),t.renderbufferStorage(sn,f.format,i,a),T(0===t.getError(),"invalid render buffer format"),o.profile&&(f.stats.size=ln(f.format,f.width,f.height))),l},l._reglType="renderbuffer",l._renderbuffer=f,o.profile&&(l.stats=f.stats),l.destroy=function(){f.decRef()},l},clear:function(){Y(s).forEach(f)},restore:function(){Y(s).forEach((function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(sn,e.renderbuffer),t.renderbufferStorage(sn,e.format,e.width,e.height)})),t.bindRenderbuffer(sn,null)}}}(o,d,y,l,r),A=function(t,n,r,o,i,a){var u={cur:null,next:null,dirty:!1,setFBO:null},s=["rgba"],c=["rgba4","rgb565","rgb5 a1"];n.ext_srgb&&c.push("srgba"),n.ext_color_buffer_half_float&&c.push("rgba16f","rgb16f"),n.webgl_color_buffer_float&&c.push("rgba32f");var f=["uint8"];function l(t,e,n){this.target=t,this.texture=e,this.renderbuffer=n;var r=0,o=0;e?(r=e.width,o=e.height):n&&(r=n.width,o=n.height),this.width=r,this.height=o}function d(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function h(t,e,n){if(t)if(t.texture){var r=t.texture._texture,o=Math.max(1,r.width),i=Math.max(1,r.height);T(o===e&&i===n,"inconsistent width/height for supplied texture"),r.refCount+=1}else{var a=t.renderbuffer._renderbuffer;T(a.width===e&&a.height===n,"inconsistent width/height for renderbuffer"),a.refCount+=1}}function p(e,n){n&&(n.texture?t.framebufferTexture2D(dn,e,n.target,n.texture._texture.texture,0):t.framebufferRenderbuffer(dn,e,hn,n.renderbuffer._renderbuffer.renderbuffer))}function v(t){var e=pn,n=null,r=null,o=t;"object"==typeof t&&(o=t.data,"target"in t&&(e=0|t.target)),T.type(o,"function","invalid attachment data");var i=o._reglType;return"texture2d"===i?(n=o,T(e===pn)):"textureCube"===i?(n=o,T(e>=vn&&e<vn+6,"invalid cube map target")):"renderbuffer"===i?(r=o,e=hn):T.raise("invalid regl object for attachment"),new l(e,n,r)}function g(t,e,n,r,a){if(n){var u=o.create2D({width:t,height:e,format:r,type:a});return u._texture.refCount=0,new l(pn,u,null)}var s=i.create({width:t,height:e,format:r});return s._renderbuffer.refCount=0,new l(hn,null,s)}function m(t){return t&&(t.texture||t.renderbuffer)}function y(t,e,n){t&&(t.texture?t.texture.resize(e,n):t.renderbuffer&&t.renderbuffer.resize(e,n),t.width=e,t.height=n)}n.oes_texture_half_float&&f.push("half float","float16"),n.oes_texture_float&&f.push("float","float32");var b=0,w={};function E(){this.id=b++,w[this.id]=this,this.framebuffer=t.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function x(t){t.colorAttachments.forEach(d),d(t.depthAttachment),d(t.stencilAttachment),d(t.depthStencilAttachment)}function _(e){var n=e.framebuffer;T(n,"must not double destroy framebuffer"),t.deleteFramebuffer(n),e.framebuffer=null,a.framebufferCount--,delete w[e.id]}function S(e){var n;t.bindFramebuffer(dn,e.framebuffer);var o=e.colorAttachments;for(n=0;n<o.length;++n)p(gn+n,o[n]);for(n=o.length;n<r.maxColorAttachments;++n)t.framebufferTexture2D(dn,gn+n,pn,null,0);t.framebufferTexture2D(dn,bn,pn,null,0),t.framebufferTexture2D(dn,mn,pn,null,0),t.framebufferTexture2D(dn,yn,pn,null,0),p(mn,e.depthAttachment),p(yn,e.stencilAttachment),p(bn,e.depthStencilAttachment);var i=t.checkFramebufferStatus(dn);t.isContextLost()||i===wn||T.raise("framebuffer configuration not supported, status = "+Nn[i]),t.bindFramebuffer(dn,u.next?u.next.framebuffer:null),u.cur=u.next,t.getError()}function A(t,o){var i=new E;function l(t,e){var o;T(u.next!==i,"can not update framebuffer which is currently in use");var a=0,d=0,p=!0,y=!0,b=null,w=!0,E="rgba",_="uint8",A=1,I=null,O=null,N=null,D=!1;if("number"==typeof t)a=0|t,d=0|e||a;else if(t){T.type(t,"object","invalid arguments for framebuffer");var M=t;if("shape"in M){var k=M.shape;T(Array.isArray(k)&&k.length>=2,"invalid shape for framebuffer"),a=k[0],d=k[1]}else"radius"in M&&(a=d=M.radius),"width"in M&&(a=M.width),"height"in M&&(d=M.height);("color"in M||"colors"in M)&&(b=M.color||M.colors,Array.isArray(b)&&T(1===b.length||n.webgl_draw_buffers,"multiple render targets not supported")),b||("colorCount"in M&&(A=0|M.colorCount,T(A>0,"invalid color buffer count")),"colorTexture"in M&&(w=!!M.colorTexture,E="rgba4"),"colorType"in M&&(_=M.colorType,w?(T(n.oes_texture_float||!("float"===_||"float32"===_),"you must enable OES_texture_float in order to use floating point framebuffer objects"),T(n.oes_texture_half_float||!("half float"===_||"float16"===_),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):"half float"===_||"float16"===_?(T(n.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),E="rgba16f"):"float"!==_&&"float32"!==_||(T(n.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),E="rgba32f"),T.oneOf(_,f,"invalid color type")),"colorFormat"in M&&(E=M.colorFormat,s.indexOf(E)>=0?w=!0:c.indexOf(E)>=0?w=!1:w?T.oneOf(M.colorFormat,s,"invalid color format for texture"):T.oneOf(M.colorFormat,c,"invalid color format for renderbuffer"))),("depthTexture"in M||"depthStencilTexture"in M)&&(D=!(!M.depthTexture&&!M.depthStencilTexture),T(!D||n.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in M&&("boolean"==typeof M.depth?p=M.depth:(I=M.depth,y=!1)),"stencil"in M&&("boolean"==typeof M.stencil?y=M.stencil:(O=M.stencil,p=!1)),"depthStencil"in M&&("boolean"==typeof M.depthStencil?p=y=M.depthStencil:(N=M.depthStencil,p=!1,y=!1))}else a=d=1;var R=null,C=null,L=null,P=null;if(Array.isArray(b))R=b.map(v);else if(b)R=[v(b)];else for(R=new Array(A),o=0;o<A;++o)R[o]=g(a,d,w,E,_);T(n.webgl_draw_buffers||R.length<=1,"you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers."),T(R.length<=r.maxColorAttachments,"too many color attachments, not supported"),a=a||R[0].width,d=d||R[0].height,I?C=v(I):p&&!y&&(C=g(a,d,D,"depth","uint32")),O?L=v(O):y&&!p&&(L=g(a,d,!1,"stencil","uint8")),N?P=v(N):!I&&!O&&y&&p&&(P=g(a,d,D,"depth stencil","depth stencil")),T(!!I+!!O+!!N<=1,"invalid framebuffer configuration, can specify exactly one depth/stencil attachment");var j=null;for(o=0;o<R.length;++o)if(h(R[o],a,d),T(!R[o]||R[o].texture&&xn.indexOf(R[o].texture._texture.format)>=0||R[o].renderbuffer&&On.indexOf(R[o].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+o+" is invalid"),R[o]&&R[o].texture){var z=_n[R[o].texture._texture.format]*Sn[R[o].texture._texture.type];null===j?j=z:T(j===z,"all color attachments much have the same number of bits per pixel.")}return h(C,a,d),T(!C||C.texture&&C.texture._texture.format===En||C.renderbuffer&&C.renderbuffer._renderbuffer.format===An,"invalid depth attachment for framebuffer object"),h(L,a,d),T(!L||L.renderbuffer&&L.renderbuffer._renderbuffer.format===In,"invalid stencil attachment for framebuffer object"),h(P,a,d),T(!P||P.texture&&P.texture._texture.format===Tn||P.renderbuffer&&P.renderbuffer._renderbuffer.format===Tn,"invalid depth-stencil attachment for framebuffer object"),x(i),i.width=a,i.height=d,i.colorAttachments=R,i.depthAttachment=C,i.stencilAttachment=L,i.depthStencilAttachment=P,l.color=R.map(m),l.depth=m(C),l.stencil=m(L),l.depthStencil=m(P),l.width=i.width,l.height=i.height,S(i),l}return a.framebufferCount++,l(t,o),e(l,{resize:function(t,e){T(u.next!==i,"can not resize a framebuffer which is currently in use");var n=Math.max(0|t,1),r=Math.max(0|e||n,1);if(n===i.width&&r===i.height)return l;for(var o=i.colorAttachments,a=0;a<o.length;++a)y(o[a],n,r);return y(i.depthAttachment,n,r),y(i.stencilAttachment,n,r),y(i.depthStencilAttachment,n,r),i.width=l.width=n,i.height=l.height=r,S(i),l},_reglType:"framebuffer",_framebuffer:i,destroy:function(){_(i),x(i)},use:function(t){u.setFBO({framebuffer:l},t)}})}return e(u,{getFramebuffer:function(t){if("function"==typeof t&&"framebuffer"===t._reglType){var e=t._framebuffer;if(e instanceof E)return e}return null},create:A,createCube:function(t){var i=Array(6);function a(t){var r;T(i.indexOf(u.next)<0,"can not update framebuffer which is currently in use");var c,l={color:null},d=0,h=null,p="rgba",v="uint8",g=1;if("number"==typeof t)d=0|t;else if(t){T.type(t,"object","invalid arguments for framebuffer");var m=t;if("shape"in m){var y=m.shape;T(Array.isArray(y)&&y.length>=2,"invalid shape for framebuffer"),T(y[0]===y[1],"cube framebuffer must be square"),d=y[0]}else"radius"in m&&(d=0|m.radius),"width"in m?(d=0|m.width,"height"in m&&T(m.height===d,"must be square")):"height"in m&&(d=0|m.height);("color"in m||"colors"in m)&&(h=m.color||m.colors,Array.isArray(h)&&T(1===h.length||n.webgl_draw_buffers,"multiple render targets not supported")),h||("colorCount"in m&&(g=0|m.colorCount,T(g>0,"invalid color buffer count")),"colorType"in m&&(T.oneOf(m.colorType,f,"invalid color type"),v=m.colorType),"colorFormat"in m&&(p=m.colorFormat,T.oneOf(m.colorFormat,s,"invalid color format for texture"))),"depth"in m&&(l.depth=m.depth),"stencil"in m&&(l.stencil=m.stencil),"depthStencil"in m&&(l.depthStencil=m.depthStencil)}else d=1;if(h)if(Array.isArray(h))for(c=[],r=0;r<h.length;++r)c[r]=h[r];else c=[h];else{c=Array(g);var b={radius:d,format:p,type:v};for(r=0;r<g;++r)c[r]=o.createCube(b)}for(l.color=Array(c.length),r=0;r<c.length;++r){var w=c[r];T("function"==typeof w&&"textureCube"===w._reglType,"invalid cube map"),d=d||w.width,T(w.width===d&&w.height===d,"invalid cube map shape"),l.color[r]={target:vn,data:c[r]}}for(r=0;r<6;++r){for(var E=0;E<c.length;++E)l.color[E].target=vn+r;r>0&&(l.depth=i[0].depth,l.stencil=i[0].stencil,l.depthStencil=i[0].depthStencil),i[r]?i[r](l):i[r]=A(l)}return e(a,{width:d,height:d,color:c})}return a(t),e(a,{faces:i,resize:function(t){var e,n=0|t;if(T(n>0&&n<=r.maxCubeMapSize,"invalid radius for cube fbo"),n===a.width)return a;var o=a.color;for(e=0;e<o.length;++e)o[e].resize(n);for(e=0;e<6;++e)i[e].resize(n);return a.width=a.height=n,a},_reglType:"framebufferCube",destroy:function(){i.forEach((function(t){t.destroy()}))}})},clear:function(){Y(w).forEach(_)},restore:function(){u.cur=null,u.next=null,u.dirty=!0,Y(w).forEach((function(e){e.framebuffer=t.createFramebuffer(),S(e)}))}})}(o,d,y,_,S,l),I=Jo(o,f,d,y,b,E,0,A,{},w,x,{elements:null,primitive:4,count:-1,offset:0,instances:-1},m,h,r),O=Un(o,A,I.procs.poll,m,i,d,y),N=I.next,D=o.canvas,M=[],k=[],P=[],j=[r.onDestroy],F=null;function G(){if(0===M.length)return h&&h.update(),void(F=null);F=C.next(G),Ot();for(var t=M.length-1;t>=0;--t){var e=M[t];e&&e(m,null,0)}o.flush(),h&&h.update()}function U(){!F&&M.length>0&&(F=C.next(G))}function K(){F&&(C.cancel(G),F=null)}function Z(t){t.preventDefault(),a=!0,K(),k.forEach((function(t){t()}))}function $(t){o.getError(),a=!1,u.restore(),x.restore(),b.restore(),_.restore(),S.restore(),A.restore(),w.restore(),h&&h.restore(),I.procs.refresh(),U(),P.forEach((function(t){t()}))}function Q(t){function n(t,e){var n={},r={};return Object.keys(t).forEach((function(o){var i=t[o];if(R.isDynamic(i))r[o]=R.unbox(i,o);else{if(e&&Array.isArray(i))for(var a=0;a<i.length;++a)if(R.isDynamic(i[a]))return void(r[o]=R.unbox(i,o));n[o]=i}})),{dynamic:r,static:n}}T(!!t,"invalid args to regl({...})"),T.type(t,"object","invalid args to regl({...})");var r=n(t.context||{},!0),o=n(t.uniforms||{},!0),i=n(t.attributes||{},!1),u=n(function(t){var n=e({},t);function r(t){if(t in n){var e=n[t];delete n[t],Object.keys(e).forEach((function(r){n[t+"."+r]=e[r]}))}}return delete n.uniforms,delete n.attributes,delete n.context,delete n.vao,"stencil"in n&&n.stencil.op&&(n.stencil.opBack=n.stencil.opFront=n.stencil.op,delete n.stencil.op),r("blend"),r("depth"),r("cull"),r("stencil"),r("polygonOffset"),r("scissor"),r("sample"),"vao"in t&&(n.vao=t.vao),n}(t),!1),s={gpuTime:0,cpuTime:0,count:0},c=I.compile(u,i,o,r,s),f=c.draw,l=c.batch,d=c.scope,h=[];return e((function(t,e){var n;if(a&&T.raise("context lost"),"function"==typeof t)return d.call(this,null,t,0);if("function"==typeof e)if("number"==typeof t)for(n=0;n<t;++n)d.call(this,null,e,n);else{if(!Array.isArray(t))return d.call(this,t,e,0);for(n=0;n<t.length;++n)d.call(this,t[n],e,n)}else if("number"==typeof t){if(t>0)return l.call(this,function(t){for(;h.length<t;)h.push(null);return h}(0|t),0|t)}else{if(!Array.isArray(t))return f.call(this,t);if(t.length)return l.call(this,t,t.length)}}),{stats:s,destroy:function(){c.destroy()}})}D&&(D.addEventListener(ei,Z,!1),D.addEventListener(ni,$,!1));var St=A.setFBO=Q({framebuffer:R.define.call(null,1,"framebuffer")});function At(t,e){var n=0;I.procs.poll();var r=e.color;r&&(o.clearColor(+r[0]||0,+r[1]||0,+r[2]||0,+r[3]||0),n|=16384),"depth"in e&&(o.clearDepth(+e.depth),n|=256),"stencil"in e&&(o.clearStencil(0|e.stencil),n|=1024),T(!!n,"called regl.clear with no buffer specified"),o.clear(n)}function It(t){return T.type(t,"function","regl.frame() callback must be a function"),M.push(t),U(),{cancel:function(){var e=ri(M,t);T(e>=0,"cannot cancel a frame twice"),M[e]=function t(){var e=ri(M,t);M[e]=M[M.length-1],M.length-=1,M.length<=0&&K()}}}}function Tt(){var t=N.viewport,e=N.scissor_box;t[0]=t[1]=e[0]=e[1]=0,m.viewportWidth=m.framebufferWidth=m.drawingBufferWidth=t[2]=e[2]=o.drawingBufferWidth,m.viewportHeight=m.framebufferHeight=m.drawingBufferHeight=t[3]=e[3]=o.drawingBufferHeight}function Ot(){m.tick+=1,m.time=Dt(),Tt(),I.procs.poll()}function Nt(){_.refresh(),Tt(),I.procs.refresh(),h&&h.update()}function Dt(){return(L()-p)/1e3}Nt();var Mt=e(Q,{clear:function(t){if(T("object"==typeof t&&t,"regl.clear() takes an object as input"),"framebuffer"in t)if(t.framebuffer&&"framebufferCube"===t.framebuffer_reglType)for(var n=0;n<6;++n)St(e({framebuffer:t.framebuffer.faces[n]},t),At);else St(t,At);else At(0,t)},prop:R.define.bind(null,1),context:R.define.bind(null,2),this:R.define.bind(null,3),draw:Q({}),buffer:function(t){return b.create(t,34962,!1,!1)},elements:function(t){return E.create(t,!1)},texture:_.create2D,cube:_.createCube,renderbuffer:S.create,framebuffer:A.create,framebufferCube:A.createCube,vao:w.createVAO,attributes:i,frame:It,on:function(t,e){var n;switch(T.type(e,"function","listener callback must be a function"),t){case"frame":return It(e);case"lost":n=k;break;case"restore":n=P;break;case"destroy":n=j;break;default:T.raise("invalid event, must be one of frame,lost,restore,destroy")}return n.push(e),{cancel:function(){for(var t=0;t<n.length;++t)if(n[t]===e)return n[t]=n[n.length-1],void n.pop()}}},limits:y,hasExtension:function(t){return y.extensions.indexOf(t.toLowerCase())>=0},read:O,destroy:function(){M.length=0,K(),D&&(D.removeEventListener(ei,Z),D.removeEventListener(ni,$)),x.clear(),A.clear(),S.clear(),_.clear(),E.clear(),b.clear(),w.clear(),h&&h.clear(),j.forEach((function(t){t()}))},_gl:o,_refresh:Nt,poll:function(){Ot(),h&&h.update()},now:Dt,stats:l});return r.onDone(null,Mt),Mt}}()},8982:(t,e,n)=>{var r=n(4075).default;function o(){"use strict";t.exports=o=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var e={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},u="function"==typeof Symbol?Symbol:{},s=u.iterator||"@@iterator",c=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var o=e&&e.prototype instanceof v?e:v,i=Object.create(o.prototype),u=new O(r||[]);return a(i,"_invoke",{value:S(t,n,u)}),i}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var p={};function v(){}function g(){}function m(){}var y={};l(y,s,(function(){return this}));var b=Object.getPrototypeOf,w=b&&b(b(N([])));w&&w!==n&&i.call(w,s)&&(y=w);var E=m.prototype=v.prototype=Object.create(y);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function n(o,a,u,s){var c=h(t[o],t,a);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==r(l)&&i.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,u,s)}),(function(t){n("throw",t,u,s)})):e.resolve(l).then((function(t){f.value=t,u(f)}),(function(t){return n("throw",t,u,s)}))}s(c.arg)}var o;a(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}})}function S(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=A(a,n);if(u){if(u===p)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=h(t,e,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===p)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}function A(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,A(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var o=h(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,p;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function N(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(i.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return r.next=r}}return{next:D}}function D(){return{value:void 0,done:!0}}return g.prototype=m,a(E,"constructor",{value:m,configurable:!0}),a(m,"constructor",{value:g,configurable:!0}),g.displayName=l(m,f,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,l(t,f,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},x(_.prototype),l(_.prototype,c,(function(){return this})),e.AsyncIterator=_,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new _(d(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(E),l(E,f,"Generator"),l(E,s,(function(){return this})),l(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=N,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(T),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var u=i.call(o,"catchLoc"),s=i.call(o,"finallyLoc");if(u&&s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:N(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},4075:t=>{function e(n){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},6298:(t,e,n)=>{var r=n(8982)();t.exports=r;try{regeneratorRuntime=r}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={id:r,loaded:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var r={};return(()=>{"use strict";n(9216);var t,e=(t=n(2680))&&t.__esModule?t:{default:t};e.default._babelPolyfill&&"undefined"!=typeof console&&console.warn&&console.warn("@babel/polyfill is loaded more than once on this page. This is probably not desirable/intended and may have consequences if different versions of the polyfills are applied sequentially. If you do need to load the polyfill more than once, use @babel/polyfill/noConflict instead to bypass the warning."),e.default._babelPolyfill=!0})(),(()=>{"use strict";n.r(r),n.d(r,{CircularLayout:()=>qt,ComboCombinedLayout:()=>Td,ComboForceLayout:()=>Sd,ConcentricLayout:()=>Ff,DagreCompoundLayout:()=>sf,DagreLayout:()=>dr,ERLayout:()=>eh,Force2Layout:()=>K,ForceAtlas2Layout:()=>Rd,ForceLayout:()=>Vt,FruchtermanGPULayout:()=>yd,FruchtermanLayout:()=>Vf,GForceGPULayout:()=>xd,GForceLayout:()=>L,GridLayout:()=>D,Layout:()=>nh,Layouts:()=>rh,MDSLayout:()=>Uf,RadialLayout:()=>jf,RandomLayout:()=>k,getLayoutByName:()=>O,registerLayout:()=>I,unRegisterLayout:()=>T});var t=function(){function t(){this.nodes=[],this.edges=[],this.combos=[],this.comboEdges=[],this.hiddenNodes=[],this.hiddenEdges=[],this.hiddenCombos=[],this.vedges=[],this.positions=[],this.destroyed=!1,this.onLayoutEnd=function(){}}return t.prototype.layout=function(t){return this.init(t),this.execute(!0)},t.prototype.init=function(t){this.nodes=t.nodes||[],this.edges=t.edges||[],this.combos=t.combos||[],this.comboEdges=t.comboEdges||[],this.hiddenNodes=t.hiddenNodes||[],this.hiddenEdges=t.hiddenEdges||[],this.hiddenCombos=t.hiddenCombos||[],this.vedges=t.vedges||[]},t.prototype.execute=function(t){},t.prototype.executeWithWorker=function(){},t.prototype.getDefaultCfg=function(){return{}},t.prototype.updateCfg=function(t){t&&Object.assign(this,t)},t.prototype.getType=function(){return"base"},t.prototype.destroy=function(){this.nodes=null,this.edges=null,this.combos=null,this.positions=null,this.destroyed=!0},t}(),e=function(t){return"string"==typeof t},o=(Object.create(null),Array.isArray),i=function(t){return"number"==typeof t},a=function(t){return Number.isNaN(Number(t))};function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}var s,c=function(){return c=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},c.apply(this,arguments)},f=function(t){return null!==t&&"object"===u(t)},l=function t(e){if(null===e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array){var n=[];return e.forEach((function(t){n.push(t)})),n.map((function(e){return t(e)}))}if("object"===u(e)&&Object.keys(e).length){var r=c({},e);return Object.keys(r).forEach((function(e){r[e]=t(r[e])})),r}return e},d=function(t,e){var n=t[e];return f(n)?n.cell:n},h=function(t,e,n){for(var r=[],o=0;o<t;o++)r[o]={in:0,out:0,all:0};return n?(n.forEach((function(t){var n=d(t,"source"),o=d(t,"target");n&&r[e[n]]&&(r[e[n]].out+=1,r[e[n]].all+=1),o&&r[e[o]]&&(r[e[o]].in+=1,r[e[o]].all+=1)})),r):r},p=function(t){for(var e=[],n=t.length,r=0;r<n;r+=1){e[r]=[];for(var o=0;o<n;o+=1)r===o?e[r][o]=0:0!==t[r][o]&&t[r][o]?e[r][o]=t[r][o]:e[r][o]=1/0}for(var i=0;i<n;i+=1)for(r=0;r<n;r+=1)for(o=0;o<n;o+=1)e[r][o]>e[r][i]+e[i][o]&&(e[r][o]=e[r][i]+e[i][o]);return e},v=function(t,e){var n=t.nodes,r=t.edges,o=[],i={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach((function(t,e){i[t.id]=e,o.push([])})),null==r||r.forEach((function(t){var n=d(t,"source"),r=d(t,"target"),a=i[n],u=i[r];void 0!==a&&void 0!==u&&(o[a][u]=1,e||(o[u][a]=1))})),o},g=function t(e,n){if(e&&e.children)for(var r=e.children.length-1;r>=0;r--)if(!t(e.children[r],n))return;return!!n(e)},m=function(t,e){"function"==typeof e&&g(t,e)},y=function(t){var e={x:0,y:0};t.forEach((function(t){e.x+=t.x||0,e.y+=t.y||0}));var n=t.length||1;return{x:e.x/n,y:e.y/n}},b=function(t,e,n){var r,o;return"source"===t?(null===(r=null==n?void 0:n.find((function(t){return t.target===e.id})))||void 0===r?void 0:r.source)||{}:(null===(o=null==n?void 0:n.find((function(t){return t.source===e.id})))||void 0===o?void 0:o.target)||{}},w=function(t,e,n){var r=[];switch(t){case"source":r=null==n?void 0:n.filter((function(t){return t.source===e.id})).map((function(t){return t.target}));break;case"target":r=null==n?void 0:n.filter((function(t){return t.target===e.id})).map((function(t){return t.source}));break;case"both":r=null==n?void 0:n.filter((function(t){return t.source===e.id})).map((function(t){return t.target})).concat(null==n?void 0:n.filter((function(t){return t.target===e.id})).map((function(t){return t.source})))}var o=new Set(r);return Array.from(o)},E=function(t){return"function"==typeof t},x=function(t,e,n){return n||(i(t)?function(){return t}:function(){return e})},_=function(t,e,n){return void 0===n&&(n=!0),e||0===e?E(e)?e:i(e)?function(){return e}:o(e)?function(){if(n){var r=Math.max.apply(Math,e);return isNaN(r)?t:r}return e}:f(e)?function(){if(n){var r=Math.max(e.width,e.height);return isNaN(r)?t:r}return[e.width,e.height]}:function(){return t}:function(e){return e.size?o(e.size)?e.size[0]>e.size[1]?e.size[0]:e.size[1]:f(e.size)?e.size.width>e.size.height?e.size.width:e.size.height:e.size:t}},S=(s=function(t,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},s(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),A=new Map,I=function(e,n){if(A.get(e)&&console.warn("The layout with the name ".concat(e," exists already, it will be overridden")),f(n)){var r=function(t){function e(e){var r,o,i=r=t.call(this)||this,a={},u=Object.assign({},i.getDefaultCfg(),(null===(o=n.getDefaultCfg)||void 0===o?void 0:o.call(n))||{});return Object.assign(a,u,n,e),Object.keys(a).forEach((function(t){var e=a[t];i[t]=e})),r}return S(e,t),e}(t);A.set(e,r)}else A.set(e,n);return A.get(e)},T=function(t){A.has(t)&&A.delete(t)},O=function(t){return A.has(t)?A.get(t):null},N=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),D=function(t){function n(e){var n=t.call(this)||this;return n.begin=[0,0],n.preventOverlap=!0,n.preventOverlapPadding=10,n.condense=!1,n.sortBy="degree",n.nodes=[],n.edges=[],n.width=300,n.height=300,n.row=0,n.col=0,n.cellWidth=0,n.cellHeight=0,n.cellUsed={},n.id2manPos={},n.onLayoutEnd=function(){},n.updateCfg(e),n}return N(n,t),n.prototype.getDefaultCfg=function(){return{begin:[0,0],preventOverlap:!0,preventOverlapPadding:10,condense:!1,rows:void 0,cols:void 0,position:void 0,sortBy:"degree",nodeSize:30}},n.prototype.execute=function(){var t=this,n=t.nodes,r=t.edges,i=t.begin,u=n.length;if(0===u)return t.onLayoutEnd&&t.onLayoutEnd(),{nodes:n,edges:r};if(1===u)return n[0].x=i[0],n[0].y=i[1],t.onLayoutEnd&&t.onLayoutEnd(),{nodes:n,edges:r};var s=t.sortBy,c=t.width,f=t.height,l=t.condense,d=t.preventOverlapPadding,p=t.preventOverlap,v=t.nodeSpacing,g=t.nodeSize,m=[];n.forEach((function(t){m.push(t)}));var y={};if(m.forEach((function(t,e){y[t.id]=e})),("degree"===s||!e(s)||void 0===m[0][s])&&(s="degree",a(n[0].degree))){var b=h(m.length,y,r);m.forEach((function(t,e){t.degree=b[e].all}))}m.sort((function(t,e){return e[s]-t[s]})),c||"undefined"==typeof window||(c=window.innerWidth),f||"undefined"==typeof window||(f=window.innerHeight);var w=t.rows,E=null!=t.cols?t.cols:t.columns;if(t.cells=u,null!=w&&null!=E?(t.rows=w,t.cols=E):null!=w&&null==E?(t.rows=w,t.cols=Math.ceil(t.cells/t.rows)):null==w&&null!=E?(t.cols=E,t.rows=Math.ceil(t.cells/t.cols)):(t.splits=Math.sqrt(t.cells*t.height/t.width),t.rows=Math.round(t.splits),t.cols=Math.round(t.width/t.height*t.splits)),t.rows=Math.max(t.rows,1),t.cols=Math.max(t.cols,1),t.cols*t.rows>t.cells)((S=t.small())-1)*(x=t.large())>=t.cells?t.small(S-1):(x-1)*S>=t.cells&&t.large(x-1);else for(;t.cols*t.rows<t.cells;){var x,S=t.small();((x=t.large())+1)*S>=t.cells?t.large(x+1):t.small(S+1)}if(t.cellWidth=c/t.cols,t.cellHeight=f/t.rows,l&&(t.cellWidth=0,t.cellHeight=0),p||v){var A=_(10,v),I=_(30,g,!1);m.forEach((function(e){e.x&&e.y||(e.x=0,e.y=0);var n,r,i=I(e)||30;o(i)?(n=i[0],r=i[1]):(n=i,r=i);var a=void 0!==A?A(e):d,u=n+a,s=r+a;t.cellWidth=Math.max(t.cellWidth,u),t.cellHeight=Math.max(t.cellHeight,s)}))}t.cellUsed={},t.row=0,t.col=0,t.id2manPos={};for(var T=0;T<m.length;T++){var O=m[T],N=void 0;if(t.position&&(N=t.position(O)),N&&(void 0!==N.row||void 0!==N.col)){var D={row:N.row,col:N.col};if(void 0===D.col)for(D.col=0;t.used(D.row,D.col);)D.col++;else if(void 0===D.row)for(D.row=0;t.used(D.row,D.col);)D.row++;t.id2manPos[O.id]=D,t.use(D.row,D.col)}t.getPos(O)}return t.onLayoutEnd&&t.onLayoutEnd(),{edges:r,nodes:m}},n.prototype.small=function(t){var e,n=this,r=n.rows||5,o=n.cols||5;return null==t?e=Math.min(r,o):Math.min(r,o)===n.rows?n.rows=t:n.cols=t,e},n.prototype.large=function(t){var e,n=this,r=n.rows||5,o=n.cols||5;return null==t?e=Math.max(r,o):Math.max(r,o)===n.rows?n.rows=t:n.cols=t,e},n.prototype.used=function(t,e){return this.cellUsed["c-".concat(t,"-").concat(e)]||!1},n.prototype.use=function(t,e){this.cellUsed["c-".concat(t,"-").concat(e)]=!0},n.prototype.moveToNextCell=function(){var t=this,e=t.cols||5;t.col++,t.col>=e&&(t.col=0,t.row++)},n.prototype.getPos=function(t){var e,n,r=this,o=r.begin,i=r.cellWidth,a=r.cellHeight,u=r.id2manPos[t.id];if(u)e=u.col*i+i/2+o[0],n=u.row*a+a/2+o[1];else{for(;r.used(r.row,r.col);)r.moveToNextCell();e=r.col*i+i/2+o[0],n=r.row*a+a/2+o[1],r.use(r.row,r.col),r.moveToNextCell()}t.x=e,t.y=n},n.prototype.getType=function(){return"grid"},n}(t),M=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),k=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.width=300,n.height=300,n.nodes=[],n.edges=[],n.onLayoutEnd=function(){},n.updateCfg(e),n}return M(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],width:300,height:300}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.center;return t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),e&&e.forEach((function(e){e.x=.9*(Math.random()-.5)*t.width+n[0],e.y=.9*(Math.random()-.5)*t.height+n[1]})),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:this.edges}},e.prototype.getType=function(){return"random"},e}(t),R=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),C=function(t,e){return t?i(t)?function(e){return t}:t:function(t){return e||1}},L=function(t){function e(e){var n=t.call(this)||this;return n.maxIteration=500,n.workerEnabled=!1,n.edgeStrength=200,n.nodeStrength=1e3,n.coulombDisScale=.005,n.damping=.9,n.maxSpeed=1e3,n.minMovement=.5,n.interval=.02,n.factor=1,n.linkDistance=1,n.gravity=10,n.preventOverlap=!0,n.collideStrength=1,n.tick=function(){},n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.animate=!0,n.updateCfg(e),n}return R(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},e.prototype.execute=function(){var t,e,n=this,r=n.nodes;if(void 0!==n.timeInterval&&"undefined"!=typeof window&&window.clearInterval(n.timeInterval),r&&0!==r.length){n.width||"undefined"==typeof window||(n.width=window.innerWidth),n.height||"undefined"==typeof window||(n.height=window.innerHeight),n.center||(n.center=[n.width/2,n.height/2]);var a=n.center;if(1===r.length)return r[0].x=a[0],r[0].y=a[1],void(null===(e=n.onLayoutEnd)||void 0===e||e.call(n));var u={},s={};r.forEach((function(t,e){i(t.x)||(t.x=Math.random()*n.width),i(t.y)||(t.y=Math.random()*n.height),u[t.id]=t,s[t.id]=e})),n.nodeMap=u,n.nodeIdxMap=s,n.linkDistance=C(n.linkDistance,1),n.nodeStrength=C(n.nodeStrength,1),n.edgeStrength=C(n.edgeStrength,1);var c,l=n.nodeSize;if(n.preventOverlap){var d,p=n.nodeSpacing;d=i(p)?function(){return p}:E(p)?p:function(){return 0},c=l?o(l)?function(t){return Math.max(l[0],l[1])+d(t)}:function(t){return l+d(t)}:function(t){return t.size?o(t.size)?Math.max(t.size[0],t.size[1])+d(t):f(t.size)?Math.max(t.size.width,t.size.height)+d(t):t.size+d(t):10+d(t)}}n.nodeSize=c;var v=n.edges;n.degrees=h(r.length,n.nodeIdxMap,v),n.getMass||(n.getMass=function(t){return t.mass||n.degrees[n.nodeIdxMap[t.id]].all||1}),n.run()}else null===(t=n.onLayoutEnd)||void 0===t||t.call(n)},e.prototype.run=function(){var t,e=this,n=e.maxIteration,r=e.nodes,o=e.workerEnabled,i=e.minMovement,a=e.animate;if(r)if(o||!a){for(var u=0;u<n;u++){var s=e.runOneStep(u);if(e.reachMoveThreshold(r,s,i))break}null===(t=e.onLayoutEnd)||void 0===t||t.call(e)}else{if("undefined"==typeof window)return;var c=0;this.timeInterval=window.setInterval((function(){var t,o;if(r){var a=e.runOneStep(c)||[];e.reachMoveThreshold(r,a,i)&&(null===(t=e.onLayoutEnd)||void 0===t||t.call(e),window.clearInterval(e.timeInterval)),++c>=n&&(null===(o=e.onLayoutEnd)||void 0===o||o.call(e),window.clearInterval(e.timeInterval))}}),0)}},e.prototype.reachMoveThreshold=function(t,e,n){var r=0;return t.forEach((function(t,n){var o=t.x-e[n].x,i=t.y-e[n].y;r+=Math.sqrt(o*o+i*i)})),(r/=t.length)<n},e.prototype.runOneStep=function(t){var e,n=this,r=n.nodes,o=n.edges,i=[],a=[];if(r){r.forEach((function(t,e){i[2*e]=0,i[2*e+1]=0,a[2*e]=0,a[2*e+1]=0})),n.calRepulsive(i,r),o&&n.calAttractive(i,o),n.calGravity(i,r);var u=Math.max(.02,n.interval-.002*t);n.updateVelocity(i,a,u,r);var s=[];return r.forEach((function(t){s.push({x:t.x,y:t.y})})),n.updatePosition(a,u,r),null===(e=n.tick)||void 0===e||e.call(n),s}},e.prototype.calRepulsive=function(t,e){var n=this,r=n.getMass,o=n.factor,i=n.coulombDisScale,a=n.preventOverlap,u=n.collideStrength,s=void 0===u?1:u,c=n.nodeStrength,f=n.nodeSize;e.forEach((function(n,u){var l=r?r(n):1;e.forEach((function(e,d){if(!(u>=d)){var h=n.x-e.x,p=n.y-e.y;0===h&&0===p&&(h=.01*Math.random(),p=.01*Math.random());var v=h*h+p*p,g=Math.sqrt(v),m=(g+.1)*i,y=h/g,b=p/g,w=.5*(c(n)+c(e))*o/(m*m),E=r?r(e):1;if(t[2*u]+=y*w,t[2*u+1]+=b*w,t[2*d]-=y*w,t[2*d+1]-=b*w,a&&(f(n)+f(e))/2>g){var x=s*(c(n)+c(e))*.5/v;t[2*u]+=y*x/l,t[2*u+1]+=b*x/l,t[2*d]-=y*x/E,t[2*d+1]-=b*x/E}}}))}))},e.prototype.calAttractive=function(t,e){var n=this,r=n.nodeMap,o=n.nodeIdxMap,i=n.linkDistance,a=n.edgeStrength,u=n.nodeSize,s=n.getMass;e.forEach((function(e,n){var c=d(e,"source"),f=d(e,"target"),l=r[c],h=r[f],p=h.x-l.x,v=h.y-l.y;0===p&&0===v&&(p=.01*Math.random(),v=.01*Math.random());var g=Math.sqrt(p*p+v*v),m=p/g,y=v/g,b=((i(e,l,h)||1+(u(l)+u(h)||0)/2)-g)*a(e),w=o[c],E=o[f],x=s?s(l):1,_=s?s(h):1;t[2*w]-=m*b/x,t[2*w+1]-=y*b/x,t[2*E]+=m*b/_,t[2*E+1]+=y*b/_}))},e.prototype.calGravity=function(t,e){for(var n=this,r=n.center,o=n.gravity,a=n.degrees,u=e.length,s=0;s<u;s++){var c=e[s],f=c.x-r[0],l=c.y-r[1],d=o;if(n.getCenter){var h=n.getCenter(c,a[s].all);h&&i(h[0])&&i(h[1])&&i(h[2])&&(f=c.x-h[0],l=c.y-h[1],d=h[2])}d&&(t[2*s]-=d*f,t[2*s+1]-=d*l)}},e.prototype.updateVelocity=function(t,e,n,r){var o=this,i=n*o.damping;r.forEach((function(n,r){var a=t[2*r]*i||.01,u=t[2*r+1]*i||.01,s=Math.sqrt(a*a+u*u);if(s>o.maxSpeed){var c=o.maxSpeed/s;a*=c,u*=c}e[2*r]=a,e[2*r+1]=u}))},e.prototype.updatePosition=function(t,e,n){n.forEach((function(n,r){if(i(n.fx)&&i(n.fy))return n.x=n.fx,void(n.y=n.fy);var o=t[2*r]*e,a=t[2*r+1]*e;n.x+=o,n.y+=a}))},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){var t=this;t.stop(),t.tick=null,t.nodes=null,t.edges=null,t.destroyed=!0},e.prototype.getType=function(){return"gForce"},e}(t);function P(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var o,i,a,u,s,c,f,l,d,h=t._root,p={data:r},v=t._x0,g=t._y0,m=t._x1,y=t._y1;if(!h)return t._root=p,t;for(;h.length;)if((c=e>=(i=(v+m)/2))?v=i:m=i,(f=n>=(a=(g+y)/2))?g=a:y=a,o=h,!(h=h[l=f<<1|c]))return o[l]=p,t;if(u=+t._x.call(null,h.data),s=+t._y.call(null,h.data),e===u&&n===s)return p.next=h,o?o[l]=p:t._root=p,t;do{o=o?o[l]=new Array(4):t._root=new Array(4),(c=e>=(i=(v+m)/2))?v=i:m=i,(f=n>=(a=(g+y)/2))?g=a:y=a}while((l=f<<1|c)==(d=(s>=a)<<1|u>=i));return o[d]=h,o[l]=p,t}function j(t,e,n,r,o){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=o}function z(t){return t[0]}function F(t){return t[1]}function G(t,e,n){var r=new U(null==e?z:e,null==n?F:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function U(t,e,n,r,o,i){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=o,this._y1=i,this._root=void 0}function B(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var V=G.prototype=U.prototype;function W(t){var e=0,n=0,r=0;if(t.length){for(var o=0;o<4;o++)(i=t[o])&&i.weight&&(e+=i.weight,n+=i.x*i.weight,r+=i.y*i.weight);t.x=n/e,t.y=r/e,t.weight=e}else{var i=t;t.x=i.data.x,t.y=i.data.y,t.weight=i.data.weight}}V.copy=function(){var t,e,n=new U(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=B(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var o=0;o<4;++o)(e=r.source[o])&&(e.length?t.push({source:e,target:r.target[o]=new Array(4)}):r.target[o]=B(e));return n},V.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return P(this.cover(e,n),e,n,t)},V.addAll=function(t){var e,n,r,o,i=t.length,a=new Array(i),u=new Array(i),s=1/0,c=1/0,f=-1/0,l=-1/0;for(n=0;n<i;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(o=+this._y.call(null,e))||(a[n]=r,u[n]=o,r<s&&(s=r),r>f&&(f=r),o<c&&(c=o),o>l&&(l=o));if(s>f||c>l)return this;for(this.cover(s,c).cover(f,l),n=0;n<i;++n)P(this,a[n],u[n],t[n]);return this},V.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,o=this._x1,i=this._y1;if(isNaN(n))o=(n=Math.floor(t))+1,i=(r=Math.floor(e))+1;else{for(var a,u,s=o-n||1,c=this._root;n>t||t>=o||r>e||e>=i;)switch(u=(e<r)<<1|t<n,(a=new Array(4))[u]=c,c=a,s*=2,u){case 0:o=n+s,i=r+s;break;case 1:n=o-s,i=r+s;break;case 2:o=n+s,r=i-s;break;case 3:n=o-s,r=i-s}this._root&&this._root.length&&(this._root=c)}return this._x0=n,this._y0=r,this._x1=o,this._y1=i,this},V.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},V.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},V.find=function(t,e,n){var r,o,i,a,u,s,c,f=this._x0,l=this._y0,d=this._x1,h=this._y1,p=[],v=this._root;for(v&&p.push(new j(v,f,l,d,h)),null==n?n=1/0:(f=t-n,l=e-n,d=t+n,h=e+n,n*=n);s=p.pop();)if(!(!(v=s.node)||(o=s.x0)>d||(i=s.y0)>h||(a=s.x1)<f||(u=s.y1)<l))if(v.length){var g=(o+a)/2,m=(i+u)/2;p.push(new j(v[3],g,m,a,u),new j(v[2],o,m,g,u),new j(v[1],g,i,a,m),new j(v[0],o,i,g,m)),(c=(e>=m)<<1|t>=g)&&(s=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=s)}else{var y=t-+this._x.call(null,v.data),b=e-+this._y.call(null,v.data),w=y*y+b*b;if(w<n){var E=Math.sqrt(n=w);f=t-E,l=e-E,d=t+E,h=e+E,r=v.data}}return r},V.remove=function(t){if(isNaN(i=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,n,r,o,i,a,u,s,c,f,l,d,h=this._root,p=this._x0,v=this._y0,g=this._x1,m=this._y1;if(!h)return this;if(h.length)for(;;){if((c=i>=(u=(p+g)/2))?p=u:g=u,(f=a>=(s=(v+m)/2))?v=s:m=s,e=h,!(h=h[l=f<<1|c]))return this;if(!h.length)break;(e[l+1&3]||e[l+2&3]||e[l+3&3])&&(n=e,d=l)}for(;h.data!==t;)if(r=h,!(h=h.next))return this;return(o=h.next)&&delete h.next,r?(o?r.next=o:delete r.next,this):e?(o?e[l]=o:delete e[l],(h=e[0]||e[1]||e[2]||e[3])&&h===(e[3]||e[2]||e[1]||e[0])&&!h.length&&(n?n[d]=h:this._root=h),this):(this._root=o,this)},V.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},V.root=function(){return this._root},V.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},V.visit=function(t){var e,n,r,o,i,a,u=[],s=this._root;for(s&&u.push(new j(s,this._x0,this._y0,this._x1,this._y1));e=u.pop();)if(!t(s=e.node,r=e.x0,o=e.y0,i=e.x1,a=e.y1)&&s.length){var c=(r+i)/2,f=(o+a)/2;(n=s[3])&&u.push(new j(n,c,f,i,a)),(n=s[2])&&u.push(new j(n,r,f,c,a)),(n=s[1])&&u.push(new j(n,c,o,i,f)),(n=s[0])&&u.push(new j(n,r,o,c,f))}return this},V.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new j(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var o=e.node;if(o.length){var i,a=e.x0,u=e.y0,s=e.x1,c=e.y1,f=(a+s)/2,l=(u+c)/2;(i=o[0])&&n.push(new j(i,a,u,f,l)),(i=o[1])&&n.push(new j(i,f,u,s,l)),(i=o[2])&&n.push(new j(i,a,l,f,c)),(i=o[3])&&n.push(new j(i,f,l,s,c))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},V.x=function(t){return arguments.length?(this._x=t,this):this._x},V.y=function(t){return arguments.length?(this._y=t,this):this._y};var X=function(t,e,n,r,o,i){var a=i.x-t.x||.1,u=i.y-t.y||.1,s=r-e,c=a*a+u*u,f=Math.sqrt(c)*c;if(s*s*.81<c){var l=t.weight/f;return i.vx+=a*l,i.vy+=u*l,!0}if(t.length)return!1;t.data!==i&&(l=t.data.weight/f,i.vx+=a*l,i.vy+=u*l)},H=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),q=function(){return q=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},q.apply(this,arguments)},Y=function(t,e){return t?i(t)?function(e){return t}:t:function(t){return e||1}},K=function(t){function e(e){var n=t.call(this)||this;n.maxIteration=1e3,n.workerEnabled=!1,n.edgeStrength=200,n.nodeStrength=1e3,n.coulombDisScale=.005,n.damping=.9,n.maxSpeed=500,n.minMovement=.4,n.interval=.02,n.factor=1,n.linkDistance=200,n.gravity=0,n.clusterNodeStrength=20,n.preventOverlap=!0,n.distanceThresholdMode="mean",n.tick=function(){},n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.judgingDistance=0,n.centripetalOptions={leaf:2,single:2,others:1,center:function(t){return{x:n.width/2,y:n.height/2}}};var r=e.getMass;return n.propsGetMass=r,n.updateCfg(e),n}return H(e,t),e.prototype.getCentripetalOptions=function(){var t,e=this,n=e.leafCluster,r=e.clustering,o=e.nodeClusterBy,i=e.nodes,a=e.nodeMap,u=e.clusterNodeStrength,s=function(t){return"function"==typeof u?u(t):u},c={};if(n){t=this.getSameTypeLeafMap()||{};var f=Array.from(new Set(null==i?void 0:i.map((function(t){return t[o]}))))||[];c={single:100,leaf:function(e,n,r){var o=t[e.id]||{},i=o.relativeLeafNodes,a=o.sameTypeLeafNodes;return(null==a?void 0:a.length)===(null==i?void 0:i.length)||1===(null==f?void 0:f.length)?1:s(e)},others:1,center:function(e,n,r){var o,i,a=((null===(o=e.data)||void 0===o?void 0:o.layout)||{}).degree;if(!a)return{x:100,y:100};if(1===a){var u=(t[e.id]||{}).sameTypeLeafNodes,s=void 0===u?[]:u;1===s.length?i=void 0:s.length>1&&(i=y(s))}else i=void 0;return{x:null==i?void 0:i.x,y:null==i?void 0:i.y}}}}if(r){t||(t=this.getSameTypeLeafMap());var l=Array.from(new Set(i.map((function(t,e){return t[o]})))).filter((function(t){return void 0!==t})),d={};l.forEach((function(t){var e=i.filter((function(e){return e[o]===t})).map((function(t){return a[t.id]}));d[t]=y(e)})),c={single:function(t){return s(t)},leaf:function(t){return s(t)},others:function(t){return s(t)},center:function(t,e,n){var r=d[t[o]];return{x:null==r?void 0:r.x,y:null==r?void 0:r.y}}}}this.centripetalOptions=q(q({},this.centripetalOptions),c);var h=this.centripetalOptions,p=h.leaf,v=h.single,g=h.others;p&&"function"!=typeof p&&(this.centripetalOptions.leaf=function(){return p}),v&&"function"!=typeof v&&(this.centripetalOptions.single=function(){return v}),g&&"function"!=typeof g&&(this.centripetalOptions.others=function(){return g})},e.prototype.updateCfg=function(t){t&&Object.assign(this,t)},e.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},e.prototype.execute=function(){console.log("here");var t=this;t.stop();var e=t.nodes,n=t.edges,r=t.defSpringLen;if(t.judgingDistance=0,e&&0!==e.length){t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]);var a=t.center;if(1===e.length)return e[0].x=a[0],e[0].y=a[1],void t.onLayoutEnd([q({},e[0])]);t.degreesMap=function(t,e){var n={};return t.forEach((function(t){n[t.id]={in:0,out:0,all:0}})),e?(e.forEach((function(t){var e=d(t,"source"),r=d(t,"target");e&&(n[e].out+=1,n[e].all+=1),r&&(n[r].in+=1,n[r].all+=1)})),n):n}(e,n),t.propsGetMass?t.getMass=t.propsGetMass:t.getMass=function(e){var n=1;i(e.mass)&&(n=e.mass);var r=t.degreesMap[e.id].all;return!r||r<5?n:5*r*n};var u,s=t.nodeSize;if(t.preventOverlap){var c,l=t.nodeSpacing;c=i(l)?function(){return l}:E(l)?l:function(){return 0},u=s?o(s)?function(t){return Math.max(s[0],s[1])+c(t)}:function(t){return s+c(t)}:function(t){return t.size?o(t.size)?Math.max(t.size[0],t.size[1])+c(t):f(t.size)?Math.max(t.size.width,t.size.height)+c(t):t.size+c(t):10+c(t)}}t.nodeSize=u,t.linkDistance=Y(t.linkDistance,1),t.nodeStrength=Y(t.nodeStrength,1),t.edgeStrength=Y(t.edgeStrength,1);var h={},p={};e.forEach((function(e,r){i(e.x)||(e.x=Math.random()*t.width),i(e.y)||(e.y=Math.random()*t.height);var o=t.degreesMap[e.id];h[e.id]=q(q({},e),{data:q(q({},e.data),{size:t.nodeSize(e)||30,layout:{inDegree:o.in,outDegree:o.out,degree:o.all,tDegree:o.in,sDegree:o.out,force:{mass:t.getMass(e),nodeStrength:t.nodeStrength(e,n)}}})}),p[e.id]=r})),t.nodeMap=h,t.nodeIdxMap=p,t.edgeInfos=[],null==n||n.forEach((function(e){var n=h[e.source],o=h[e.target];n&&o?t.edgeInfos.push({edgeStrength:t.edgeStrength(e),linkDistance:r?r(q(q({},e),{source:n,target:o}),n,o):t.linkDistance(e,n,o)||1+(s(n)+s(n)||0)/2}):elf.edgeInfos.push({})})),this.getCentripetalOptions(),t.onLayoutEnd=t.onLayoutEnd||function(){},t.run()}else t.onLayoutEnd([])},e.prototype.run=function(){var t=this,e=t.maxIteration,n=t.nodes,r=t.workerEnabled,o=t.minMovement,i=t.animate,a=t.nodeMap;if(n){var u=[];n.forEach((function(t,e){u[2*e]=0,u[2*e+1]=0}));var s=e;if(r||!i){for(var c=0;(t.judgingDistance>o||c<1)&&c<s;c++)t.runOneStep(c,u);t.onLayoutEnd(Object.values(a))}else{if("undefined"==typeof window)return;var f=0;this.timeInterval=window.setInterval((function(){n&&(t.runOneStep(f,u),(++f>=s||t.judgingDistance<o)&&(t.onLayoutEnd(Object.values(a)),window.clearInterval(t.timeInterval)))}),0)}}},e.prototype.runOneStep=function(t,e){var n,r=this,o=r.nodes,i=r.edges,a=(r.nodeMap,r.monitor),u=[];if(null==o?void 0:o.length){r.calRepulsive(u),i&&r.calAttractive(u),r.calGravity(u);var s=r.interval;r.updateVelocity(u,e,s),r.updatePosition(e,s),null===(n=r.tick)||void 0===n||n.call(r),a&&a({energy:this.calTotalEnergy(u),nodes:o,edges:i,iterations:t})}},e.prototype.calTotalEnergy=function(t){var e=this.nodes,n=this.nodeMap;if(!(null==e?void 0:e.length))return 0;var r=0;return e.forEach((function(e,o){var i=t[2*o],a=t[2*o+1],u=i*i+a*a,s=n[e.id].data.layout.force.mass;r+=(void 0===s?1:s)*u*.5})),r},e.prototype.calRepulsive=function(t){var e=this,n=e.nodes,r=e.nodeMap,o=e.factor,i=e.coulombDisScale;e.nodeSize,function(t,e,n,r,o){var i=n/r,a=t.map((function(t,n){var r=e[t.id],o=r.data,a=r.x,u=r.y,s=r.size,c=o.layout.force.nodeStrength;return{x:a,y:u,size:s,index:n,vx:0,vy:0,weight:i*c}})),u=G(a,(function(t){return t.x}),(function(t){return t.y})).visitAfter(W);a.forEach((function(t){!function(t,e){e.visit((function(e,n,r,o,i){return X(e,n,r,o,i,t)}))}(t,u)})),a.map((function(n,r){var i=e[t[r].id].data.layout.force.mass,a=void 0===i?1:i;o[2*r]=n.vx/a,o[2*r+1]=n.vy/a}))}(n,r,o,i*i,t)},e.prototype.calAttractive=function(t){var e=this,n=e.edges,r=e.nodeMap,o=e.nodeIdxMap,i=e.edgeInfos;e.nodeSize,n.forEach((function(e,n){var a=d(e,"source"),u=d(e,"target"),s=r[a],c=r[u];if(s&&c){var f=c.x-s.x,l=c.y-s.y;f||l||(f=.01*Math.random(),l=.01*Math.random());var h=Math.sqrt(f*f+l*l),p=f/h,v=l/h,g=i[n]||{},m=g.linkDistance,y=void 0===m?200:m,b=g.edgeStrength,w=(y-h)*(void 0===b?200:b),E=1/(s.data.layout.force.mass||1),x=1/(c.data.layout.force.mass||1),_=p*w,S=v*w,A=2*o[a],I=2*o[u];t[A]-=_*E,t[A+1]-=S*E,t[I]+=_*x,t[I+1]+=S*x}}))},e.prototype.calGravity=function(t){var e,n=this,r=n.nodes,o=n.edges,a=void 0===o?[]:o,u=n.nodeMap,s=n.width,c=n.height,f=n.center,l=n.gravity,d=n.degreesMap,h=n.centripetalOptions;if(r)for(var p=r.length,v=0;v<p;v++){var g=2*v,m=u[r[v].id],y=m.data.layout.force.mass,b=void 0===y?1:y,w=0,E=0,x=l,_=d[m.id],S=_.in,A=_.out,I=_.all,T=null===(e=n.getCenter)||void 0===e?void 0:e.call(n,m,I);if(T){var O=T[0],N=T[1],D=T[2];w=m.x-O,E=m.y-N,x=D}else w=m.x-f[0],E=m.y-f[1];if(x&&(t[g]-=x*w/b,t[g+1]-=x*E/b),h){var M=h.leaf,k=h.single,R=h.others,C=h.center,L=(null==C?void 0:C(m,r,a,s,c))||{x:0,y:0,centerStrength:0},P=L.x,j=L.y,z=L.centerStrength;if(!i(P)||!i(j))continue;var F=(m.x-P)/b,G=(m.y-j)/b;if(z&&(t[g]-=z*F,t[g+1]-=z*G),0===I){var U=k(m);if(!U)continue;t[g]-=U*F,t[g+1]-=U*G;continue}if(0===S||0===A){var B=M(m,r,a);if(!B)continue;t[g]-=B*F,t[g+1]-=B*G;continue}var V=R(m);if(!V)continue;t[g]-=V*F,t[g+1]-=V*G}}},e.prototype.attractToSide=function(t){var e=this,n=e.defSideCoe,r=e.height,o=e.nodes,i=e.edges;if(n&&"function"==typeof n&&(null==o?void 0:o.length)){var a={};i.forEach((function(t){var e=t.source,n=t.target;a[e.id]=a[e.id]||[],a[e.id].push(t),a[n.id]=a[n.id]||[],a[n.id].push(t)})),o.forEach((function(e,o){var i=n(e,a[e.id]||[]);if(0!==i){var u=i>0?0:r,s=Math.abs(i);t[2*o+1]-=s*(u-e.y)}}))}},e.prototype.updateVelocity=function(t,e,n){var r=this,o=r.nodes,i=r.damping,a=r.maxSpeed;(null==o?void 0:o.length)&&o.forEach((function(r,o){var u=(e[2*o]+t[2*o]*n)*i||.01,s=(e[2*o+1]+t[2*o+1]*n)*i||.01,c=Math.sqrt(u*u+s*s);if(c>a){var f=a/c;u*=f,s*=f}e[2*o]=u,e[2*o+1]=s}))},e.prototype.updatePosition=function(t,e){var n=this,r=n.nodes,o=n.distanceThresholdMode,a=n.nodeMap;if(null==r?void 0:r.length){var u=0;"max"===o?n.judgingDistance=-1/0:"min"===o&&(n.judgingDistance=1/0),r.forEach((function(r,s){var c=a[r.id];if(i(r.fx)&&i(r.fy))return r.x=r.fx,r.y=r.fy,c.x=r.x,void(c.y=r.y);var f=t[2*s]*e,l=t[2*s+1]*e;r.x+=f,r.y+=l,c.x=r.x,c.y=r.y;var d=Math.sqrt(f*f+l*l);switch(o){case"max":n.judgingDistance<d&&(n.judgingDistance=d);break;case"min":n.judgingDistance>d&&(n.judgingDistance=d);break;default:u+=d}})),o&&"mean"!==o||(n.judgingDistance=u/r.length)}else this.judgingDistance=0},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){var t=this;t.stop(),t.tick=null,t.nodes=null,t.edges=null,t.destroyed=!0},e.prototype.getType=function(){return"force2"},e.prototype.getSameTypeLeafMap=function(){var t=this,e=t.nodeClusterBy,n=t.nodes,r=t.edges,o=t.nodeMap,i=t.degreesMap;if(null==n?void 0:n.length){var a={};return n.forEach((function(t,n){1===i[t.id].all&&(a[t.id]=function(t,e,n,r,o,i){var a=o[e.id],u=a.in,s=a.out,c=e,f=[];0===u?(c=b("source",e,n),f=w("both",c,n).map((function(t){return i[t]}))):0===s&&(c=b("target",e,n),f=w("both",c,n).map((function(t){return i[t]}))),f=f.filter((function(t){return o[t.id]&&(0===o[t.id].in||0===o[t.id].out)}));var l=function(t,e,n,r,o){var i=n[e]||"",a=(null==r?void 0:r.filter((function(t){return t[e]===i})))||[];return a=a.filter((function(t){var e,n;return 0===(null===(e=o[t.id])||void 0===e?void 0:e.in)||0===(null===(n=o[t.id])||void 0===n?void 0:n.out)})),a}(0,r,e,f,o);return{coreNode:c,relativeLeafNodes:f,sameTypeLeafNodes:l}}(0,t,r,e,i,o))})),a}},e}(t);function Z(t){return function(){return t}}function $(t){return 1e-6*(t()-.5)}var Q={value:()=>{}};function J(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new tt(r)}function tt(t){this._=t}function et(t,e){for(var n,r=0,o=t.length;r<o;++r)if((n=t[r]).name===e)return n.value}function nt(t,e,n){for(var r=0,o=t.length;r<o;++r)if(t[r].name===e){t[r]=Q,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}tt.prototype=J.prototype={constructor:tt,on:function(t,e){var n,r,o=this._,i=(r=o,(t+"").trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),a=-1,u=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a<u;)if(n=(t=i[a]).type)o[n]=nt(o[n],t.name,e);else if(null==e)for(n in o)o[n]=nt(o[n],t.name,null);return this}for(;++a<u;)if((n=(t=i[a]).type)&&(n=et(o[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new tt(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,o=new Array(n),i=0;i<n;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=0,n=(r=this._[t]).length;i<n;++i)r[i].value.apply(e,o)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],o=0,i=r.length;o<i;++o)r[o].value.apply(e,n)}};const rt=J;var ot,it,at=0,ut=0,st=0,ct=1e3,ft=0,lt=0,dt=0,ht="object"==typeof performance&&performance.now?performance:Date,pt="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function vt(){return lt||(pt(gt),lt=ht.now()+dt)}function gt(){lt=0}function mt(){this._call=this._time=this._next=null}function yt(t,e,n){var r=new mt;return r.restart(t,e,n),r}function bt(){lt=(ft=ht.now())+dt,at=ut=0;try{!function(){vt(),++at;for(var t,e=ot;e;)(t=lt-e._time)>=0&&e._call.call(null,t),e=e._next;--at}()}finally{at=0,function(){for(var t,e,n=ot,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:ot=e);it=t,Et(r)}(),lt=0}}function wt(){var t=ht.now(),e=t-ft;e>ct&&(dt-=e,ft=t)}function Et(t){at||(ut&&(ut=clearTimeout(ut)),t-lt>24?(t<1/0&&(ut=setTimeout(bt,t-ht.now()-dt)),st&&(st=clearInterval(st))):(st||(ft=ht.now(),st=setInterval(wt,ct)),at=1,pt(bt)))}mt.prototype=yt.prototype={constructor:mt,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?vt():+n)+(null==e?0:+e),this._next||it===this||(it?it._next=this:ot=this,it=this),this._call=t,this._time=n,Et()},stop:function(){this._call&&(this._call=null,this._time=1/0,Et())}};const xt=1664525,_t=1013904223,St=4294967296;function At(t){return t.x}function It(t){return t.y}var Tt=10,Ot=Math.PI*(3-Math.sqrt(5));function Nt(t){var e,n=1,r=.001,o=1-Math.pow(r,1/300),i=0,a=.6,u=new Map,s=yt(l),c=rt("tick","end"),f=function(){let t=1;return()=>(t=(xt*t+_t)%St)/St}();function l(){d(),c.call("tick",e),n<r&&(s.stop(),c.call("end",e))}function d(r){var s,c,f=t.length;void 0===r&&(r=1);for(var l=0;l<r;++l)for(n+=(i-n)*o,u.forEach((function(t){t(n)})),s=0;s<f;++s)null==(c=t[s]).fx?c.x+=c.vx*=a:(c.x=c.fx,c.vx=0),null==c.fy?c.y+=c.vy*=a:(c.y=c.fy,c.vy=0);return e}function h(){for(var e,n=0,r=t.length;n<r;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var o=Tt*Math.sqrt(.5+n),i=n*Ot;e.x=o*Math.cos(i),e.y=o*Math.sin(i)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function p(e){return e.initialize&&e.initialize(t,f),e}return null==t&&(t=[]),h(),e={tick:d,restart:function(){return s.restart(l),e},stop:function(){return s.stop(),e},nodes:function(n){return arguments.length?(t=n,h(),u.forEach(p),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(r=+t,e):r},alphaDecay:function(t){return arguments.length?(o=+t,e):+o},alphaTarget:function(t){return arguments.length?(i=+t,e):i},velocityDecay:function(t){return arguments.length?(a=1-t,e):1-a},randomSource:function(t){return arguments.length?(f=t,u.forEach(p),e):f},force:function(t,n){return arguments.length>1?(null==n?u.delete(t):u.set(t,p(n)),e):u.get(t)},find:function(e,n,r){var o,i,a,u,s,c=0,f=t.length;for(null==r?r=1/0:r*=r,c=0;c<f;++c)(a=(o=e-(u=t[c]).x)*o+(i=n-u.y)*i)<r&&(s=u,r=a);return s},on:function(t,n){return arguments.length>1?(c.on(t,n),e):c.on(t)}}}function Dt(){var t,e,n,r,o,i=Z(-30),a=1,u=1/0,s=.81;function c(n){var o,i=t.length,a=G(t,At,It).visitAfter(l);for(r=n,o=0;o<i;++o)e=t[o],a.visit(d)}function f(){if(t){var e,n,r=t.length;for(o=new Array(r),e=0;e<r;++e)n=t[e],o[n.index]=+i(n,e,t)}}function l(t){var e,n,r,i,a,u=0,s=0;if(t.length){for(r=i=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(u+=e.value,s+=n,r+=n*e.x,i+=n*e.y);t.x=r/s,t.y=i/s}else{(e=t).x=e.data.x,e.y=e.data.y;do{u+=o[e.data.index]}while(e=e.next)}t.value=u}function d(t,i,c,f){if(!t.value)return!0;var l=t.x-e.x,d=t.y-e.y,h=f-i,p=l*l+d*d;if(h*h/s<p)return p<u&&(0===l&&(p+=(l=$(n))*l),0===d&&(p+=(d=$(n))*d),p<a&&(p=Math.sqrt(a*p)),e.vx+=l*t.value*r/p,e.vy+=d*t.value*r/p),!0;if(!(t.length||p>=u)){(t.data!==e||t.next)&&(0===l&&(p+=(l=$(n))*l),0===d&&(p+=(d=$(n))*d),p<a&&(p=Math.sqrt(a*p)));do{t.data!==e&&(h=o[t.data.index]*r/p,e.vx+=l*h,e.vy+=d*h)}while(t=t.next)}}return c.initialize=function(e,r){t=e,n=r,f()},c.strength=function(t){return arguments.length?(i="function"==typeof t?t:Z(+t),f(),c):i},c.distanceMin=function(t){return arguments.length?(a=t*t,c):Math.sqrt(a)},c.distanceMax=function(t){return arguments.length?(u=t*t,c):Math.sqrt(u)},c.theta=function(t){return arguments.length?(s=t*t,c):Math.sqrt(s)},c}function Mt(t,e){var n,r=1;function o(){var o,i,a=n.length,u=0,s=0;for(o=0;o<a;++o)u+=(i=n[o]).x,s+=i.y;for(u=(u/a-t)*r,s=(s/a-e)*r,o=0;o<a;++o)(i=n[o]).x-=u,i.y-=s}return null==t&&(t=0),null==e&&(e=0),o.initialize=function(t){n=t},o.x=function(e){return arguments.length?(t=+e,o):t},o.y=function(t){return arguments.length?(e=+t,o):e},o.strength=function(t){return arguments.length?(r=+t,o):r},o}function kt(t){return t.index}function Rt(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}function Ct(t){var e,n,r,o,i,a,u=kt,s=function(t){return 1/Math.min(o[t.source.index],o[t.target.index])},c=Z(30),f=1;function l(r){for(var o=0,u=t.length;o<f;++o)for(var s,c,l,d,h,p,v,g=0;g<u;++g)c=(s=t[g]).source,d=(l=s.target).x+l.vx-c.x-c.vx||$(a),h=l.y+l.vy-c.y-c.vy||$(a),d*=p=((p=Math.sqrt(d*d+h*h))-n[g])/p*r*e[g],h*=p,l.vx-=d*(v=i[g]),l.vy-=h*v,c.vx+=d*(v=1-v),c.vy+=h*v}function d(){if(r){var a,s,c=r.length,f=t.length,l=new Map(r.map(((t,e)=>[u(t,e,r),t])));for(a=0,o=new Array(c);a<f;++a)(s=t[a]).index=a,"object"!=typeof s.source&&(s.source=Rt(l,s.source)),"object"!=typeof s.target&&(s.target=Rt(l,s.target)),o[s.source.index]=(o[s.source.index]||0)+1,o[s.target.index]=(o[s.target.index]||0)+1;for(a=0,i=new Array(f);a<f;++a)s=t[a],i[a]=o[s.source.index]/(o[s.source.index]+o[s.target.index]);e=new Array(f),h(),n=new Array(f),p()}}function h(){if(r)for(var n=0,o=t.length;n<o;++n)e[n]=+s(t[n],n,t)}function p(){if(r)for(var e=0,o=t.length;e<o;++e)n[e]=+c(t[e],e,t)}return null==t&&(t=[]),l.initialize=function(t,e){r=t,a=e,d()},l.links=function(e){return arguments.length?(t=e,d(),l):t},l.id=function(t){return arguments.length?(u=t,l):u},l.iterations=function(t){return arguments.length?(f=+t,l):f},l.strength=function(t){return arguments.length?(s="function"==typeof t?t:Z(+t),h(),l):s},l.distance=function(t){return arguments.length?(c="function"==typeof t?t:Z(+t),p(),l):c},l}function Lt(t){return t.x+t.vx}function Pt(t){return t.y+t.vy}function jt(t){var e,n,r,o=1,i=1;function a(){for(var t,a,s,c,f,l,d,h=e.length,p=0;p<i;++p)for(a=G(e,Lt,Pt).visitAfter(u),t=0;t<h;++t)s=e[t],l=n[s.index],d=l*l,c=s.x+s.vx,f=s.y+s.vy,a.visit(v);function v(t,e,n,i,a){var u=t.data,h=t.r,p=l+h;if(!u)return e>c+p||i<c-p||n>f+p||a<f-p;if(u.index>s.index){var v=c-u.x-u.vx,g=f-u.y-u.vy,m=v*v+g*g;m<p*p&&(0===v&&(m+=(v=$(r))*v),0===g&&(m+=(g=$(r))*g),m=(p-(m=Math.sqrt(m)))/m*o,s.vx+=(v*=m)*(p=(h*=h)/(d+h)),s.vy+=(g*=m)*p,u.vx-=v*(p=1-p),u.vy-=g*p)}}}function u(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function s(){if(e){var r,o,i=e.length;for(n=new Array(i),r=0;r<i;++r)o=e[r],n[o.index]=+t(o,r,e)}}return"function"!=typeof t&&(t=Z(null==t?1:+t)),a.initialize=function(t,n){e=t,r=n,s()},a.iterations=function(t){return arguments.length?(i=+t,a):i},a.strength=function(t){return arguments.length?(o=+t,a):o},a.radius=function(e){return arguments.length?(t="function"==typeof e?e:Z(+e),s(),a):t},a}function zt(t){var e,n,r,o=Z(.1);function i(t){for(var o,i=0,a=e.length;i<a;++i)(o=e[i]).vx+=(r[i]-o.x)*n[i]*t}function a(){if(e){var i,a=e.length;for(n=new Array(a),r=new Array(a),i=0;i<a;++i)n[i]=isNaN(r[i]=+t(e[i],i,e))?0:+o(e[i],i,e)}}return"function"!=typeof t&&(t=Z(null==t?0:+t)),i.initialize=function(t){e=t,a()},i.strength=function(t){return arguments.length?(o="function"==typeof t?t:Z(+t),a(),i):o},i.x=function(e){return arguments.length?(t="function"==typeof e?e:Z(+e),a(),i):t},i}function Ft(t){var e,n,r,o=Z(.1);function i(t){for(var o,i=0,a=e.length;i<a;++i)(o=e[i]).vy+=(r[i]-o.y)*n[i]*t}function a(){if(e){var i,a=e.length;for(n=new Array(a),r=new Array(a),i=0;i<a;++i)n[i]=isNaN(r[i]=+t(e[i],i,e))?0:+o(e[i],i,e)}}return"function"!=typeof t&&(t=Z(null==t?0:+t)),i.initialize=function(t){e=t,a()},i.strength=function(t){return arguments.length?(o="function"==typeof t?t:Z(+t),a(),i):o},i.y=function(e){return arguments.length?(t="function"==typeof e?e:Z(+e),a(),i):t},i}var Gt="GPU_LAYOUT_END",Ut={gForce:!0,force2:!0,fruchterman:!0,forceAtlas2:!0,force:!0,"graphin-force":!0},Bt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vt=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.nodeStrength=null,n.edgeStrength=null,n.preventOverlap=!1,n.clusterNodeStrength=null,n.clusterEdgeStrength=null,n.clusterEdgeDistance=null,n.clusterNodeSize=null,n.clusterFociStrength=null,n.linkDistance=50,n.alphaDecay=.028,n.alphaMin=.001,n.alpha=.3,n.collideStrength=1,n.workerEnabled=!1,n.tick=function(){},n.onLayoutEnd=function(){},n.ticking=void 0,e&&n.updateCfg(e),n}return Bt(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],nodeStrength:null,edgeStrength:null,preventOverlap:!1,nodeSize:void 0,nodeSpacing:void 0,linkDistance:50,forceSimulation:null,alphaDecay:.028,alphaMin:.001,alpha:.3,collideStrength:1,clustering:!1,clusterNodeStrength:-1,clusterEdgeStrength:.1,clusterEdgeDistance:100,clusterFociStrength:.8,clusterNodeSize:10,tick:function(){},onLayoutEnd:function(){},workerEnabled:!1}},e.prototype.init=function(t){var e=this;e.nodes=t.nodes||[];var n=t.edges||[];e.edges=n.map((function(t){var e={},n=["targetNode","sourceNode","startPoint","endPoint"];return Object.keys(t).forEach((function(r){n.indexOf(r)>-1||(e[r]=t[r])})),e})),e.ticking=!1},e.prototype.execute=function(t){var e=this,n=e.nodes,r=e.edges;if(!e.ticking){var o=e.forceSimulation,i=e.alphaMin,a=e.alphaDecay,u=e.alpha;if(o)t&&(e.clustering&&e.clusterForce&&(e.clusterForce.nodes(n),e.clusterForce.links(r)),o.nodes(n),r&&e.edgeForce?e.edgeForce.links(r):r&&!e.edgeForce&&(f=Ct().id((function(t){return t.id})).links(r),e.edgeStrength&&f.strength(e.edgeStrength),e.linkDistance&&f.distance(e.linkDistance),e.edgeForce=f,o.force("link",f))),e.preventOverlap&&e.overlapProcess(o),o.alpha(u).restart(),this.ticking=!0;else try{var s=Dt();if(e.nodeStrength&&s.strength(e.nodeStrength),o=Nt().nodes(n),e.clustering){var c=function(){function t(t){return function(){return t}}var e,n=function(t){return t.cluster},r=t(1),o=t(-1),i=t(100),a=t(.1),u=[0,0],s=[],c={},f=[],l=100,h=100,p={none:{x:0,y:0}},v=[],g="force",m=!0,y=.1;function b(t){if(!m)return b;e.tick(),E();for(var r=0,o=s.length,i=void 0,a=t*y;r<o;++r)(i=s[r]).vx+=(p[n(i)].x-i.x)*a,i.vy+=(p[n(i)].y-i.y)*a}function w(){s&&function(){if(s&&s.length){if(void 0===n(s[0]))throw Error("Couldnt find the grouping attribute for the nodes. Make sure to set it up with forceInABox.groupBy('clusterAttr') before calling .links()");var t,u,p,g,m,y=(t=[],u=[],p={},m=[],g=function(t){var e={};return t.forEach((function(t){var r=n(t);e[r]||(e[r]={count:0,sumforceNodeSize:0})})),t.forEach((function(t){var o=n(t),i=r(t),a=e[o];a.count=a.count+1,a.sumforceNodeSize=a.sumforceNodeSize+Math.PI*(i*i)*1.3,e[o]=a})),e}(s),m=function(t){var e={},r=[];return t.forEach((function(t){var r=function(t){var e=d(t,"source"),r=d(t,"target"),o=n(c[e]),i=n(c[r]);return o<=i?"".concat(o,"~").concat(i):"".concat(i,"~").concat(o)}(t),o=0;void 0!==e[r]&&(o=e[r]),o+=1,e[r]=o})),Object.entries(e).forEach((function(t){var e=t[0],n=t[1],o=e.split("~")[0],i=e.split("~")[1];void 0!==o&&void 0!==i&&r.push({source:o,target:i,count:n})})),r}(f),Object.keys(g).forEach((function(e,n){var r=g[e];t.push({id:e,size:r.count,r:Math.sqrt(r.sumforceNodeSize/Math.PI)}),p[e]=n})),m.forEach((function(t){var e=d(t,"source"),n=d(t,"target"),r=p[e],o=p[n];void 0!==r&&void 0!==o&&u.push({source:r,target:o,count:t.count})})),{nodes:t,links:u});e=Nt(y.nodes).force("x",zt(l).strength(.1)).force("y",Ft(h).strength(.1)).force("collide",jt((function(t){return t.r})).iterations(4)).force("charge",Dt().strength(o)).force("links",Ct(y.nodes.length?y.links:[]).distance(i).strength(a)),v=e.nodes(),E()}}()}function E(){return p={none:{x:0,y:0}},v.forEach((function(t){p[t.id]={x:t.x-u[0],y:t.y-u[1]}})),p}return b.initialize=function(t){s=t,w()},b.template=function(t){return arguments.length?(g=t,w(),b):g},b.groupBy=function(t){return arguments.length?"string"==typeof t?(n=function(e){return e[t]},b):(n=t,b):n},b.enableGrouping=function(t){return arguments.length?(m=t,b):m},b.strength=function(t){return arguments.length?(y=t,b):y},b.centerX=function(t){return arguments.length?(l=t,b):l},b.centerY=function(t){return arguments.length?(h=t,b):h},b.nodes=function(t){return arguments.length?(function(t){c={},t.forEach((function(t){c[t.id]=t}))}(t||[]),s=t||[],b):s},b.links=function(t){return arguments.length?(f=t||[],w(),b):f},b.forceNodeSize=function(e){return arguments.length?(r="function"==typeof e?e:t(+e),w(),b):r},b.nodeSize=b.forceNodeSize,b.forceCharge=function(e){return arguments.length?(o="function"==typeof e?e:t(+e),w(),b):o},b.forceLinkDistance=function(e){return arguments.length?(i="function"==typeof e?e:t(+e),w(),b):i},b.forceLinkStrength=function(e){return arguments.length?(a="function"==typeof e?e:t(+e),w(),b):a},b.offset=function(t){return arguments.length?(u=t,b):u},b.getFocis=E,b}();c.centerX(e.center[0]).centerY(e.center[1]).template("force").strength(e.clusterFociStrength),r&&c.links(r),n&&c.nodes(n),c.forceLinkDistance(e.clusterEdgeDistance).forceLinkStrength(e.clusterEdgeStrength).forceCharge(e.clusterNodeStrength).forceNodeSize(e.clusterNodeSize),e.clusterForce=c,o.force("group",c)}if(o.force("center",Mt(e.center[0],e.center[1])).force("charge",s).alpha(u).alphaDecay(a).alphaMin(i),e.preventOverlap&&e.overlapProcess(o),r){var f=Ct().id((function(t){return t.id})).links(r);e.edgeStrength&&f.strength(e.edgeStrength),e.linkDistance&&f.distance(e.linkDistance),e.edgeForce=f,o.force("link",f)}if(e.workerEnabled&&!Wt()&&(e.workerEnabled=!1,console.warn("workerEnabled option is only supported when running in web worker.")),e.workerEnabled){o.stop();for(var l=function(t){var e=t.alphaMin(),n=t.alphaTarget(),r=t.alpha(),o=Math.log((e-n)/(r-n))/Math.log(1-t.alphaDecay());return Math.ceil(o)}(o),h=1;h<=l;h++)o.tick(),postMessage({nodes:n,currentTick:h,totalTicks:l,type:"LAYOUT_TICK"},void 0);e.ticking=!1}else o.on("tick",(function(){e.tick()})).on("end",(function(){e.ticking=!1,e.onLayoutEnd&&e.onLayoutEnd()})),e.ticking=!0;e.forceSimulation=o,e.ticking=!0}catch(t){e.ticking=!1,console.warn(t)}}},e.prototype.overlapProcess=function(t){var e,n,r=this,a=r.nodeSize,u=r.nodeSpacing,s=r.collideStrength;if(n=i(u)?function(){return u}:E(u)?u:function(){return 0},a)if(E(a))e=function(t){return a(t)+n(t)};else if(o(a)){var c=(a[0]>a[1]?a[0]:a[1])/2;e=function(t){return c+n(t)}}else if(i(a)){var l=a/2;e=function(t){return l+n(t)}}else e=function(){return 10};else e=function(t){return t.size?o(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2+n(t):f(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)/2+n(t):t.size/2+n(t):10+n(t)};t.force("collisionForce",jt(e).strength(s))},e.prototype.updateCfg=function(t){var e=this;e.ticking&&(e.forceSimulation.stop(),e.ticking=!1),e.forceSimulation=null,Object.assign(e,t)},e.prototype.destroy=function(){var t=this;t.ticking&&(t.forceSimulation.stop(),t.ticking=!1),t.nodes=null,t.edges=null,t.destroyed=!0},e}(t);function Wt(){return"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope}var Xt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function Ht(t,e){var n=t.degree,r=e.degree;return n<r?-1:n>r?1:0}var qt=function(t){function e(e){var n=t.call(this)||this;return n.radius=null,n.nodeSize=void 0,n.startRadius=null,n.endRadius=null,n.startAngle=0,n.endAngle=2*Math.PI,n.clockwise=!0,n.divisions=1,n.ordering=null,n.angleRatio=1,n.nodes=[],n.edges=[],n.nodeMap={},n.degrees=[],n.width=300,n.height=300,n.updateCfg(e),n}return Xt(e,t),e.prototype.getDefaultCfg=function(){return{radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1}},e.prototype.execute=function(){var t,e=this,n=e.nodes,r=e.edges,o=n.length;if(0!==o){e.width||"undefined"==typeof window||(e.width=window.innerWidth),e.height||"undefined"==typeof window||(e.height=window.innerHeight),e.center||(e.center=[e.width/2,e.height/2]);var i=e.center;if(1===o)return n[0].x=i[0],n[0].y=i[1],void(e.onLayoutEnd&&e.onLayoutEnd());var a=e.radius,u=e.startRadius,s=e.endRadius,c=e.divisions,f=e.startAngle,l=e.endAngle,d=e.angleRatio,p=e.ordering,v=e.clockwise,g=e.nodeSpacing,m=e.nodeSize,y=(l-f)/o,b={};n.forEach((function(t,e){b[t.id]=e})),e.nodeMap=b;var w=h(n.length,b,r);if(e.degrees=w,g){var E=_(10,g),x=_(10,m),S=-1/0;n.forEach((function(t){var e=x(t);S<e&&(S=e)}));var A=0;n.forEach((function(t,e){A+=0===e?S||10:(E(t)||0)+(S||10)})),a=A/(2*Math.PI)}else a||u||s?!u&&s?u=s:u&&!s&&(s=u):a=e.height>e.width?e.width/2:e.height/2;var I=y*d,T=[];T="topology"===p?e.topologyOrdering():"topology-directed"===p?e.topologyOrdering(!0):"degree"===p?e.degreeOrdering():n;for(var O=Math.ceil(o/c),N=0;N<o;++N){var D=a;D||null===u||null===s||(D=u+N*(s-u)/(o-1)),D||(D=10+100*N/(o-1));var M=f+N%O*I+2*Math.PI/c*Math.floor(N/O);v||(M=l-N%O*I-2*Math.PI/c*Math.floor(N/O)),T[N].x=i[0]+Math.cos(M)*D,T[N].y=i[1]+Math.sin(M)*D,T[N].weight=w[N].all}return null===(t=e.onLayoutEnd)||void 0===t||t.call(e),{nodes:T,edges:this.edges}}e.onLayoutEnd&&e.onLayoutEnd()},e.prototype.topologyOrdering=function(t){void 0===t&&(t=!1);var e=this,n=e.degrees,r=e.edges,o=e.nodes,i=l(o),a=e.nodeMap,u=[i[0]],s=[o[0]],c=[],f=o.length;c[0]=!0,function(t,e,n,r){t.forEach((function(e,n){t[n].children=[],t[n].parent=[]})),r?e.forEach((function(e){var r=d(e,"source"),o=d(e,"target"),i=0;r&&(i=n[r]);var a=0;o&&(a=n[o]);var u=t[i].children,s=t[a].parent;u.push(t[a].id),s.push(t[i].id)})):e.forEach((function(e){var r=d(e,"source"),o=d(e,"target"),i=0;r&&(i=n[r]);var a=0;o&&(a=n[o]);var u=t[i].children,s=t[a].children;u.push(t[a].id),s.push(t[i].id)}))}(i,r,a,t);var h=0;return i.forEach((function(t,e){if(0!==e)if(e!==f-1&&n[e].all===n[e+1].all&&!function(t,e,n){for(var r=n.length,o=0;o<r;o++){var i=d(n[o],"source"),a=d(n[o],"target");if(t.id===i&&e.id===a||e.id===i&&t.id===a)return!0}return!1}(u[h],t,r)||c[e]){for(var l=u[h].children,p=!1,v=0;v<l.length;v++){var g=a[l[v]];if(n[g].all===n[e].all&&!c[g]){u.push(i[g]),s.push(o[a[i[g].id]]),c[g]=!0,p=!0;break}}for(var m=0;!p&&(c[m]||(u.push(i[m]),s.push(o[a[i[m].id]]),c[m]=!0,p=!0),++m!==f););}else u.push(t),s.push(o[a[t.id]]),c[e]=!0,h++})),s},e.prototype.degreeOrdering=function(){var t=this.nodes,e=[],n=this.degrees;return t.forEach((function(t,r){t.degree=n[r].all,e.push(t)})),e.sort(Ht),e},e.prototype.getType=function(){return"circular"},e}(t),Yt=function(t,e){if("next"!==t&&"prev"!==t)return e},Kt=function(t){t.prev.next=t.next,t.next.prev=t.prev,delete t.next,delete t.prev};const Zt=function(){function t(){var t={};t.prev=t,t.next=t.prev,this.shortcut=t}return t.prototype.dequeue=function(){var t=this.shortcut,e=t.prev;if(e&&e!==t)return Kt(e),e},t.prototype.enqueue=function(t){var e=this.shortcut;t.prev&&t.next&&Kt(t),t.next=e.next,e.next.prev=t,e.next=t,t.prev=e},t.prototype.toString=function(){for(var t=[],e=this.shortcut,n=e.prev;n!==e;)t.push(JSON.stringify(n,Yt)),n=null==n?void 0:n.prev;return"[".concat(t.join(", "),"]")},t}();var $t;function Qt(t,e){var n=t.get(e)||0;t.set(e,n+1)}function Jt(t,e){var n=t.get(e);void 0!==n&&((n-=1)>0?t.set(e,n):t.delete(e))}function te(t,e,n,r){var o=String(e),i=String(n);if(!t&&o>i){var a=o;o=i,i=a}return o+$t.EDGE_KEY_DELIM+i+$t.EDGE_KEY_DELIM+(void 0===r?$t.DEFAULT_EDGE_NAME:r)}function ee(t,e,n,r){var o=String(e),i=String(n),a={v:e,w:n};if(!t&&o>i){var u=a.v;a.v=a.w,a.w=u}return void 0!==r&&(a.name=r),a}function ne(t,e){return te(t,e.v,e.w,e.name)}function re(t){return"function"==typeof t}!function(t){t.DEFAULT_EDGE_NAME="\0",t.GRAPH_NODE="\0",t.EDGE_KEY_DELIM=""}($t||($t={}));var oe=function(t){return t.nodes().map((function(e){var n={id:e,value:t.node(e),parent:t.parent(e)};return void 0===n.value&&delete n.value,void 0===n.parent&&delete n.parent,n}))},ie=function(t){return t.edges().map((function(e){var n=t.edge(e),r={v:e.v,w:e.w,value:n,name:e.name};return void 0===r.name&&delete r.name,void 0===r.value&&delete r.value,r}))};function ae(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ue(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ae(Object(n),!0).forEach((function(e){se(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ae(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function se(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ce(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var fe={compound:!1,multigraph:!1,directed:!0},le=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.directed=!0,this.multigraph=!1,this.compound=!1,this.GRAPH_NODE=$t.GRAPH_NODE,this.label=void 0,this.nodeCountNum=0,this.edgeCountNum=0,this.defaultNodeLabelFn=function(){},this.defaultEdgeLabelFn=function(){},this.parentMap=void 0,this.childrenMap=void 0,this.nodesLabelMap=new Map,this.inEdgesMap=new Map,this.outEdgesMap=new Map,this.predecessorsMap=new Map,this.successorsMap=new Map,this.edgesMap=new Map,this.edgesLabelsMap=new Map,this.isDirected=function(){return e.directed},this.isMultigraph=function(){return e.multigraph},this.isCompound=function(){return e.compound},this.setGraph=function(t){return e.label=t,e},this.graph=function(){return e.label},this.setDefaultNodeLabel=function(t){return re(t)?e.defaultNodeLabelFn=t:e.defaultNodeLabelFn=function(){return t},e},this.nodeCount=function(){return e.nodeCountNum},this.node=function(t){return e.nodesLabelMap.get(t)},this.nodes=function(){return Array.from(e.nodesLabelMap.keys())},this.sources=function(){return e.nodes().filter((function(t){var n;return!(null===(n=e.inEdgesMap.get(t))||void 0===n?void 0:n.size)}))},this.sinks=function(){return e.nodes().filter((function(t){var n;return!(null===(n=e.outEdgesMap.get(t))||void 0===n?void 0:n.size)}))},this.setNodes=function(t,n){return t.map((function(t){return e.setNode(t,n)})),e},this.hasNode=function(t){return e.nodesLabelMap.has(t)},this.checkCompound=function(){if(!e.isCompound())throw new Error("Cannot construct parent-children relations in a non-compound graph")},this.parent=function(t){if(e.isCompound()){var n,r=null===(n=e.parentMap)||void 0===n?void 0:n.get(t);if(r!==e.GRAPH_NODE)return r}},this.removeFromParentsChildList=function(t){var n=e.parentMap.get(t);e.childrenMap.get(n).delete(t)},this.setParent=function(t,n){var r,o;e.checkCompound();for(var i=void 0===n?e.GRAPH_NODE:n,a=e.parent(i);a;){if(t===a)throw new Error("Setting "+n+" as parent of "+t+" would create a cycle");a=e.parent(a)}n&&e.setNode(n),e.setNode(t),e.removeFromParentsChildList(t),null===(r=e.parentMap)||void 0===r||r.set(t,i);var u=e.childrenMap.get(i);return u.set(t,!0),null===(o=e.childrenMap)||void 0===o||o.set(i,u),e},this.children=function(t){var n=void 0===t?e.GRAPH_NODE:t;if(e.isCompound()){var r,o=null===(r=e.childrenMap)||void 0===r?void 0:r.get(n);return o?Array.from(o.keys()):void 0}return n===e.GRAPH_NODE?e.nodes():t&&e.hasNode(t)?[]:void 0},this.predecessors=function(t){var n=e.predecessorsMap.get(t);return n?Array.from(n.keys()):void 0},this.successors=function(t){var n=e.successorsMap.get(t);return n?Array.from(n.keys()):void 0},this.neighbors=function(t){var n;if(e.hasNode(t))return Array.from(new Set(null===(n=e.predecessors(t))||void 0===n?void 0:n.concat(e.successors(t))))},this.isLeaf=function(t){var n,r;return e.isDirected()?!(null===(r=e.successors(t))||void 0===r?void 0:r.length):!(null===(n=e.neighbors(t))||void 0===n?void 0:n.length)},this.filterNodes=function(n){var r=e.directed,o=e.multigraph,i=e.compound,a=new t({directed:r,multigraph:o,compound:i});return a.setGraph(e.graph()),e.nodes().forEach((function(t){n(t)&&a.setNode(t,e.node(t))})),e.edges().forEach((function(t){a.hasNode(t.v)&&a.hasNode(t.w)&&a.setEdgeObj(t,e.edge(t))})),i&&a.nodes().forEach((function(t){a.setParent(t,function(t){for(var n=e.parent(t);void 0!==n&&!a.hasNode(n);)n=e.parent(n);return n}(t))})),a},this.setDefaultEdgeLabel=function(t){return re(t)?e.defaultEdgeLabelFn=t:e.defaultEdgeLabelFn=function(){return t},e},this.edgeCount=function(){return e.edgeCountNum},this.setEdgeObj=function(t,n){return e.setEdge(t.v,t.w,n,t.name)},this.setPath=function(t,n){return t.reduce((function(t,r){return e.setEdge(t,r,n),r})),e},this.edgeFromArgs=function(t,n,r){return e.edge({v:t,w:n,name:r})},this.edge=function(t){return e.edgesLabelsMap.get(ne(e.isDirected(),t))},this.hasEdge=function(t,n,r){return e.edgesLabelsMap.has(ne(e.isDirected(),{v:t,w:n,name:r}))},this.removeEdgeObj=function(t){var n=t.v,r=t.w,o=t.name;return e.removeEdge(n,r,o)},this.edges=function(){return Array.from(e.edgesMap.values())},this.inEdges=function(t,n){var r=e.inEdgesMap.get(t);if(r)return Array.from(r.values()).filter((function(t){return!n||t.v===n}))},this.outEdges=function(t,n){var r=e.outEdgesMap.get(t);if(r)return Array.from(r.values()).filter((function(t){return!n||t.w===n}))},this.nodeEdges=function(t,n){var r;if(e.hasNode(t))return null===(r=e.inEdges(t,n))||void 0===r?void 0:r.concat(e.outEdges(t,n))},this.toJSON=function(){return void 0===(n={options:{directed:(t=e).isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:oe(t),edges:ie(t),value:t.graph()}).value&&delete n.value,n;var t,n},this.nodeInDegree=function(t){var n=e.inEdgesMap.get(t);return n?n.size:0},this.nodeOutDegree=function(t){var n=e.outEdgesMap.get(t);return n?n.size:0},this.nodeDegree=function(t){return e.nodeInDegree(t)+e.nodeOutDegree(t)},this.source=function(t){return t.v},this.target=function(t){return t.w};var r=ue(ue({},fe),n);this.compound=r.compound,this.directed=r.directed,this.multigraph=r.multigraph,this.compound&&(this.parentMap=new Map,this.childrenMap=new Map)}var e,n;return e=t,n=[{key:"setNode",value:function(t,e){var n,r=this.nodesLabelMap,o=this.defaultNodeLabelFn,i=this.isCompound,a=this.parentMap,u=this.childrenMap,s=this.inEdgesMap,c=this.outEdgesMap,f=this.predecessorsMap,l=this.successorsMap;return r.has(t)?(void 0!==e&&r.set(t,e),this):(r.set(t,e||o(t)),i()&&(null==a||a.set(t,this.GRAPH_NODE),null==u||u.set(t,new Map),(null==u?void 0:u.has(this.GRAPH_NODE))||null==u||u.set(this.GRAPH_NODE,new Map),null==u||null===(n=u.get(this.GRAPH_NODE))||void 0===n||n.set(t,!0)),[s,c,f,l].forEach((function(e){return e.set(t,new Map)})),this.nodeCountNum+=1,this)}},{key:"removeNode",value:function(t){var e=this;if(this.hasNode(t)){var n,r,o,i=function(t){e.removeEdge(t.v,t.w,t.name)},a=this.inEdgesMap,u=this.outEdgesMap,s=this.predecessorsMap,c=this.successorsMap,f=this.nodesLabelMap;this.isCompound()&&(this.removeFromParentsChildList(t),null===(n=this.parentMap)||void 0===n||n.delete(t),null===(r=this.children(t))||void 0===r||r.forEach((function(t){return e.setParent(t)})),null===(o=this.childrenMap)||void 0===o||o.delete(t));var l=a.get(t),d=u.get(t);Array.from(l.values()).forEach((function(t){return i(t)})),Array.from(d.values()).forEach((function(t){return i(t)})),f.delete(t),a.delete(t),u.delete(t),s.delete(t),c.delete(t),this.nodeCountNum-=1}return this}},{key:"setEdge",value:function(t,e,n,r){var o,i,a=ee(this.isDirected(),t,e,r),u=ne(this.isDirected(),a),s=a.v,c=a.w;if(this.edgesLabelsMap.has(u))return this.edgesLabelsMap.set(u,n),this;if(void 0!==r&&!this.isMultigraph())throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(s),this.setNode(c),this.edgesLabelsMap.set(u,n||this.defaultEdgeLabelFn(s,c,r)),Object.freeze(a),this.edgesMap.set(u,a);var f=this.predecessorsMap.get(c),l=this.successorsMap.get(s);return Qt(f,s),Qt(l,c),null===(o=this.inEdgesMap.get(c))||void 0===o||o.set(u,a),null===(i=this.outEdgesMap.get(s))||void 0===i||i.set(u,a),this.edgeCountNum+=1,this}},{key:"removeEdge",value:function(t,e,n){var r=te(this.isDirected(),t,e,n);if(this.edgesMap.get(r)){var o=ee(this.isDirected(),t,e,n),i=o.v,a=o.w;this.edgesLabelsMap.delete(r),this.edgesMap.delete(r);var u=this.predecessorsMap.get(a),s=this.successorsMap.get(i);Jt(u,i),Jt(s,a),this.inEdgesMap.get(a).delete(r),this.outEdgesMap.get(i).delete(r),this.edgeCountNum-=1}return this}}],n&&ce(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();le.fromJSON=function(t){var e=new le(t.options);return void 0!==t.value&&e.setGraph(t.value),t.nodes.forEach((function(t){e.setNode(t.id,t.value),t.parent&&e.setParent(t.id,t.parent)})),t.edges.forEach((function(t){e.setEdge(t.v,t.w,t.value,t.name)})),e},Error;var de=function t(e,n,r,o,i,a){o.includes(n)||(o.push(n),r||a.push(n),i(n).forEach((function(n){return t(e,n,r,o,i,a)})),r&&a.push(n))};const he=function(t,e,n){var r=Array.isArray(e)?e:[e],o=function(e){return t.isDirected()?t.successors(e):t.neighbors(e)},i=[],a=[];return r.forEach((function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);de(t,e,"post"===n,a,o,i)})),i};var pe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ve=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return pe(e,t),e}(Zt),ge=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return pe(e,t),e}(le),me=function(){return 1},ye=function(t,e,n,r,o){var i,a,u=[];return null===(i=t.inEdges(r.v))||void 0===i||i.forEach((function(r){var i=t.edge(r),a=t.node(r.v);o&&u.push({v:r.v,w:r.w,in:0,out:0}),void 0===a.out&&(a.out=0),a.out-=i,be(e,n,a)})),null===(a=t.outEdges(r.v))||void 0===a||a.forEach((function(r){var o=t.edge(r),i=r.w,a=t.node(i);void 0===a.in&&(a.in=0),a.in-=o,be(e,n,a)})),t.removeNode(r.v),o?u:void 0},be=function(t,e,n){n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)};const we=function(t,e){var n;if(t.nodeCount()<=1)return[];var r=function(t,e){var n=new ge,r=0,o=0;t.nodes().forEach((function(t){n.setNode(t,{v:t,in:0,out:0})})),t.edges().forEach((function(t){var i=n.edge(t)||0,a=(null==e?void 0:e(t))||1,u=i+a;n.setEdge(t.v,t.w,u),o=Math.max(o,n.node(t.v).out+=a),r=Math.max(r,n.node(t.w).in+=a)}));for(var i=[],a=o+r+3,u=0;u<a;u++)i.push(new ve);var s=r+1;return n.nodes().forEach((function(t){be(i,s,n.node(t))})),{buckets:i,zeroIdx:s,graph:n}}(t,e||me);return null===(n=function(t,e,n){for(var r,o=[],i=e[e.length-1],a=e[0];t.nodeCount();){for(;r=a.dequeue();)ye(t,e,n,r);for(;r=i.dequeue();)ye(t,e,n,r);if(t.nodeCount())for(var u=e.length-2;u>0;--u)if(r=e[u].dequeue()){o=o.concat(ye(t,e,n,r,!0));break}}return o}(r.graph,r.buckets,r.zeroIdx).map((function(e){return t.outEdges(e.v,e.w)})))||void 0===n?void 0:n.flat()};var Ee=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ee(e,t),e}(le),_e=function(t,e,n,r){var o;do{o="".concat(r).concat(Math.random())}while(t.hasNode(o));return n.dummy=e,t.setNode(o,n),o},Se=function(t){var e=new xe({multigraph:t.isMultigraph()}).setGraph(t.graph());return t.nodes().forEach((function(n){var r;(null===(r=t.children(n))||void 0===r?void 0:r.length)||e.setNode(n,t.node(n))})),t.edges().forEach((function(n){e.setEdgeObj(n,t.edge(n))})),e},Ae=function(t,e){var n,r,o=Number(t.x),i=Number(t.y),a=Number(e.x)-o,u=Number(e.y)-i,s=Number(t.width)/2,c=Number(t.height)/2;return a||u?(Math.abs(u)*s>Math.abs(a)*c?(u<0&&(c=-c),n=c*a/u,r=c):(a<0&&(s=-s),n=s,r=s*u/a),{x:o+n,y:i+r}):{x:0,y:0}},Ie=function(t){for(var e=[],n=Oe(t)+1,r=0;r<n;r++)e.push([]);for(t.nodes().forEach((function(n){var r=t.node(n);if(r){var o=r.rank;void 0!==o&&e[o]&&e[o].push(n)}})),r=0;r<n;r++)e[r]=e[r].sort((function(e,n){var r,o,i,a;return i=null===(r=t.node(e))||void 0===r?void 0:r.order,a=null===(o=t.node(n))||void 0===o?void 0:o.order,Number(i)-Number(a)}));return e},Te=function(t,e,n,r){var o={width:0,height:0};return i(n)&&i(r)&&(o.rank=n,o.order=r),_e(t,"border",o,e)},Oe=function(t){var e;return t.nodes().forEach((function(n){var r,o=null===(r=t.node(n))||void 0===r?void 0:r.rank;void 0!==o&&(void 0===e||o>e)&&(e=o)})),e||(e=0),e},Ne=function(t,e){var n=Date.now();try{return e()}finally{console.log("".concat(t," time: ").concat(Date.now()-n,"ms"))}},De=function(t,e){return e()},Me=function(t,e){return t.reduce((function(t,n){return e(t)>e(n)?n:t}))};const ke=function(t){t.graph().dummyChains=[],t.edges().forEach((function(e){return function(t,e){var n=e.v,r=t.node(n).rank,o=e.w,i=t.node(o).rank,a=e.name,u=t.edge(e),s=u.labelRank;if(i!==r+1){t.removeEdgeObj(e);var c,f,l,d=t.graph();for(l=0,++r;r<i;++l,++r)u.points=[],c=_e(t,"edge",f={edgeLabel:u,width:0,height:0,edgeObj:e,rank:r},"_d"),r===s&&(f.width=u.width,f.height=u.height,f.dummy="edge-label",f.labelpos=u.labelpos),t.setEdge(n,c,{weight:u.weight},a),0===l&&(d.dummyChains||(d.dummyChains=[]),d.dummyChains.push(c)),n=c;t.setEdge(n,o,{weight:u.weight},a)}}(t,e)}))};var Re=function(t){var e,n={},r=function e(r){var o,i,a=t.node(r);return a?n[r]?a.rank:(n[r]=!0,null===(o=t.outEdges(r))||void 0===o||o.forEach((function(n){var r=e(n.w)-t.edge(n).minlen;r&&(void 0===i||r<i)&&(i=r)})),i||(i=0),a.rank=i,i):0};null===(e=t.sources())||void 0===e||e.forEach((function(t){return r(t)}))},Ce=function(t){var e,n,r={},o=function e(o){var i,a,u=t.node(o);return u?r[o]?u.rank:(r[o]=!0,null===(i=t.outEdges(o))||void 0===i||i.forEach((function(n){var r=e(n.w)-t.edge(n).minlen;r&&(void 0===a||r<a)&&(a=r)})),a||(a=0),(void 0===n||a<n)&&(n=a),u.rank=a,a):0};null===(e=t.sources())||void 0===e||e.forEach((function(e){t.node(e)&&o(e)})),void 0===n&&(n=0);var i={},a=function e(n,r){var o,a=t.node(n),u=isNaN(a.layer)?r:a.layer;(void 0===a.rank||a.rank<u)&&(a.rank=u),i[n]||(i[n]=!0,null===(o=t.outEdges(n))||void 0===o||o.map((function(n){e(n.w,u+t.edge(n).minlen)})))};t.nodes().forEach((function(e){var r=t.node(e);r&&(isNaN(r.layer)?r.rank-=n:a(e,r.layer))}))},Le=function(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen},Pe=function(t,e){return t.nodes().forEach((function n(r){e.nodeEdges(r).forEach((function(o){var i=o.v,a=r===i?o.w:i;t.hasNode(a)||Le(e,o)||(t.setNode(a,{}),t.setEdge(r,a,{}),n(a))}))})),t.nodeCount()},je=function(t,e){return t.nodes().forEach((function n(r){var o;null===(o=e.nodeEdges(r))||void 0===o||o.forEach((function(o){var i=o.v,a=r===i?o.w:i;t.hasNode(a)||void 0===e.node(a).layer&&Le(e,o)||(t.setNode(a,{}),t.setEdge(r,a,{}),n(a))}))})),t.nodeCount()},ze=function(t,e){return Me(e.edges(),(function(n){return t.hasNode(n.v)!==t.hasNode(n.w)?Le(e,n):1/0}))},Fe=function(t,e,n){t.nodes().forEach((function(t){e.node(t).rank||(e.node(t).rank=0),e.node(t).rank+=n}))},Ge=function(t,e){return he(t,e,"pre")},Ue=function(t,e){return he(t,e,"post")},Be=function(t,e){var n=Ue(t,t.nodes());null==(n=null==n?void 0:n.slice(0,(null==n?void 0:n.length)-1))||n.forEach((function(n){Ve(t,e,n)}))},Ve=function(t,e,n){var r=t.node(n).parent;t.edgeFromArgs(n,r).cutvalue=We(t,e,n)},We=function(t,e,n){var r,o=t.node(n).parent,i=!0,a=e.edgeFromArgs(n,o),u=0;return a||(i=!1,a=e.edgeFromArgs(o,n)),u=a.weight,null===(r=e.nodeEdges(n))||void 0===r||r.forEach((function(r){var a=r.v===n,s=a?r.w:r.v;if(s!==o){var c=a===i,f=e.edge(r).weight;if(u+=c?f:-f,$e(t,n,s)){var l=t.edgeFromArgs(n,s).cutvalue;u+=c?-l:l}}})),u},Xe=function(t,e){void 0===e&&(e=t.nodes()[0]),He(t,{},1,e)},He=function t(e,n,r,o,i){var a,u=r,s=r,c=e.node(o);return n[o]=!0,null===(a=e.neighbors(o))||void 0===a||a.forEach((function(r){n[r]||(s=t(e,n,s,r,o))})),c.low=u,c.lim=s++,i?c.parent=i:delete c.parent,s},qe=function(t){return t.edges().find((function(e){return t.edge(e).cutvalue<0}))},Ye=function(t,e,n){var r=n.v,o=n.w;e.hasEdge(r,o)||(r=n.w,o=n.v);var i=t.node(r),a=t.node(o),u=i,s=!1;i.lim>a.lim&&(u=a,s=!0);var c=e.edges().filter((function(e){return s===Qe(t,t.node(e.v),u)&&s!==Qe(t,t.node(e.w),u)}));return Me(c,(function(t){return Le(e,t)}))},Ke=function(t,e,n,r){var o=n.v,i=n.w;t.removeEdge(o,i),t.setEdge(r.v,r.w,{}),Xe(t),Be(t,e),Ze(t,e)},Ze=function(t,e){var n=t.nodes().find((function(t){var n;return!(null===(n=e.node(t))||void 0===n?void 0:n.parent)})),r=Ge(t,n);null==(r=null==r?void 0:r.slice(1))||r.forEach((function(n){var r=t.node(n).parent,o=e.edgeFromArgs(n,r),i=!1;o||(o=e.edgeFromArgs(r,n),i=!0),e.node(n).rank=e.node(r).rank+(i?o.minlen:-o.minlen)}))},$e=function(t,e,n){return t.hasEdge(e,n)},Qe=function(t,e,n){return n.low<=e.lim&&e.lim<=n.lim};const Je=function(t){var e=function(t){var e=(new xe).setGraph(t.graph());return t.nodes().forEach((function(n){e.setNode(n,t.node(n))})),t.edges().forEach((function(n){var r=e.edgeFromArgs(n.v,n.w)||{weight:0,minlen:1},o=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})})),e}(t);Re(e);var n,r,o=function(t){var e,n,r=new xe({directed:!1}),o=t.nodes()[0],i=t.nodeCount();for(r.setNode(o,{});Pe(r,t)<i;)e=ze(r,t),n=r.hasNode(e.v)?Le(t,e):-Le(t,e),Fe(r,t,n);return r}(e);for(Xe(o),Be(o,e);n=qe(o);)r=Ye(o,e,n),Ke(o,e,n,r)};var tn=Re,en=function(t){Ce(t),function(t){var e,n,r=new xe({directed:!1}),o=t.nodes()[0],i=t.nodes().filter((function(e){return!!t.node(e)})).length;for(r.setNode(o,{});je(r,t)<i;)e=ze(r,t),n=r.hasNode(e.v)?Le(t,e):-Le(t,e),Fe(r,t,n)}(t)};const nn=function(t){switch(t.graph().ranker){case"network-simplex":!function(t){Je(t)}(t);break;case"tight-tree":default:en(t);break;case"longest-path":tn(t)}};var rn=function t(e,n,r,o,i,a,u){var s=e.children(u);if(null==s?void 0:s.length){var c=Te(e,"_bt"),f=Te(e,"_bb"),l=e.node(u);e.setParent(c,u),l.borderTop=c,e.setParent(f,u),l.borderBottom=f,null==s||s.forEach((function(s){t(e,n,r,o,i,a,s);var l=e.node(s),d=l.borderTop?l.borderTop:s,h=l.borderBottom?l.borderBottom:s,p=l.borderTop?o:2*o,v=d!==h?1:i-a[u]+1;e.setEdge(c,d,{minlen:v,weight:p,nestingEdge:!0}),e.setEdge(h,f,{minlen:v,weight:p,nestingEdge:!0})})),e.parent(u)||e.setEdge(n,c,{weight:0,minlen:i+a[u]})}else u!==n&&e.setEdge(n,u,{weight:0,minlen:r})},on=function(t){var e,n={},r=function e(r,o){var i=t.children(r);null==i||i.forEach((function(t){return e(t,o+1)})),n[r]=o};return null===(e=t.children())||void 0===e||e.forEach((function(t){return r(t,1)})),n};const an=function(t){var e,n=_e(t,"root",{},"_root"),r=on(t),o=Math.max.apply(Math,Object.values(r));Math.abs(o)===1/0&&(o=1);var i=o-1,a=2*i+1;t.graph().nestingRoot=n,t.edges().forEach((function(e){t.edge(e).minlen*=a}));var u=function(t){var e=0;return t.edges().forEach((function(n){e+=t.edge(n).weight})),e}(t)+1;null===(e=t.children())||void 0===e||e.forEach((function(e){rn(t,n,a,u,i,r,e)})),t.graph().nodeRankFactor=a};var un=function(t,e,n,r,o,i){var a={rank:i,borderType:e,width:0,height:0},u=o[e][i-1],s=_e(t,"border",a,n);o[e][i]=s,t.setParent(s,r),u&&t.setEdge(u,s,{weight:1})};const sn=function(t){var e,n=function e(n){var r=t.children(n),o=t.node(n);if((null==r?void 0:r.length)&&r.forEach((function(t){return e(t)})),o.hasOwnProperty("minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,a=o.maxRank+1;i<a;i+=1)un(t,"borderLeft","_bl",n,o,i),un(t,"borderRight","_br",n,o,i)}};null===(e=t.children())||void 0===e||e.forEach((function(t){return n(t)}))};var cn=function(t){t.nodes().forEach((function(e){fn(t.node(e))})),t.edges().forEach((function(e){fn(t.edge(e))}))},fn=function(t){var e=t.width;t.width=t.height,t.height=e},ln=function(t){(null==t?void 0:t.y)&&(t.y=-t.y)},dn=function(t){var e=t.x;t.x=t.y,t.y=e};const hn=function(t){var e,n=null===(e=t.graph().rankdir)||void 0===e?void 0:e.toLowerCase();"bt"!==n&&"rl"!==n||function(t){t.nodes().forEach((function(e){ln(t.node(e))})),t.edges().forEach((function(e){var n,r=t.edge(e);null===(n=r.points)||void 0===n||n.forEach((function(t){return ln(t)})),r.hasOwnProperty("y")&&ln(r)}))}(t),"lr"!==n&&"rl"!==n||(function(t){t.nodes().forEach((function(e){dn(t.node(e))})),t.edges().forEach((function(e){var n,r=t.edge(e);null===(n=r.points)||void 0===n||n.forEach((function(t){return dn(t)})),r.hasOwnProperty("x")&&dn(r)}))}(t),cn(t))};var pn={}.toString;const vn=function(t){return Array.isArray?Array.isArray(t):function(t,e){return pn.call(t)==="[object "+e+"]"}(t,"Array")},gn=function(t){if(vn(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},mn=function(t){for(var e={},n=t.nodes().filter((function(e){var n;return!(null===(n=t.children(e))||void 0===n?void 0:n.length)})),r=n.map((function(e){return t.node(e).rank})),o=gn(r),i=[],a=0;a<o+1;a++)i.push([]);var u=n.sort((function(e,n){return t.node(e).rank-t.node(n).rank})),s=u.filter((function(e){return void 0!==t.node(e).fixorder})),c=s.sort((function(e,n){return t.node(e).fixorder-t.node(n).fixorder}));return null==c||c.forEach((function(n){isNaN(t.node(n).rank)||i[t.node(n).rank].push(n),e[n]=!0})),null==u||u.forEach((function n(r){var o;if(!e.hasOwnProperty(r)){e[r]=!0;var a=t.node(r);isNaN(a.rank)||i[a.rank].push(r),null===(o=t.successors(r))||void 0===o||o.forEach((function(t){return n(t)}))}})),i};var yn=function(t,e,n){for(var r=function(t,e){return null==t?void 0:t.reduce((function(t,n,r){return t[n]=e[r],t}),{})}(n,n.map((function(t,e){return e}))),o=e.map((function(e){var n,o=null===(n=t.outEdges(e))||void 0===n?void 0:n.map((function(e){return{pos:r[e.w]||0,weight:t.edge(e).weight}}));return null==o?void 0:o.sort((function(t,e){return t.pos-e.pos}))})),i=o.flat().filter((function(t){return void 0!==t})),a=1;a<n.length;)a<<=1;var u=2*a-1;a-=1;var s=Array(u).fill(0,0,u),c=0;return null==i||i.forEach((function(t){if(t){var e=t.pos+a;s[e]+=t.weight;for(var n=0;e>0;)e%2&&(n+=s[e+1]),s[e=e-1>>1]+=t.weight;c+=t.weight*n}})),c};const bn=function(t,e){for(var n=0,r=1;r<(null==e?void 0:e.length);r+=1)n+=yn(t,e[r-1],e[r]);return n};const wn=function(t,e,n){var r=function(t){for(var e;t.hasNode(e="_root".concat(Math.random())););return e}(t),o=new xe({compound:!0}).setGraph({root:r}).setDefaultNodeLabel((function(e){return t.node(e)}));return t.nodes().forEach((function(i){var a,u=t.node(i),s=t.parent(i);(u.rank===e||u.minRank<=e&&e<=u.maxRank)&&(o.setNode(i),o.setParent(i,s||r),null===(a=t[n](i))||void 0===a||a.forEach((function(e){var n=e.v===i?e.w:e.v,r=o.edgeFromArgs(n,i),a=void 0!==r?r.weight:0;o.setEdge(n,i,{weight:t.edge(e).weight+a})})),u.hasOwnProperty("minRank")&&o.setNode(i,{borderLeft:u.borderLeft[e],borderRight:u.borderRight[e]}))})),o};var En=function(t,e){var n,r=0,o=0;t.weight&&(r+=t.barycenter*t.weight,o+=t.weight),e.weight&&(r+=e.barycenter*e.weight,o+=e.weight),t.vs=null===(n=e.vs)||void 0===n?void 0:n.concat(t.vs),t.barycenter=r/o,t.weight=o,t.i=Math.min(e.i,t.i),e.merged=!0};const xn=function(t,e){var n,r,o,i={};return null==t||t.forEach((function(t,e){i[t.v]={i:e,indegree:0,in:[],out:[],vs:[t.v]};var n=i[t.v];void 0!==t.barycenter&&(n.barycenter=t.barycenter,n.weight=t.weight)})),null===(n=e.edges())||void 0===n||n.forEach((function(t){var e=i[t.v],n=i[t.w];void 0!==e&&void 0!==n&&(n.indegree++,e.out.push(i[t.w]))})),function(t){for(var e,n,r=[],o=function(){var o=t.pop();r.push(o),null===(e=o.in.reverse())||void 0===e||e.forEach((function(t){return(e=o,function(t){t.merged||(void 0===t.barycenter||void 0===e.barycenter||t.barycenter>=e.barycenter)&&En(e,t)})(t);var e})),null===(n=o.out)||void 0===n||n.forEach((function(e){return(n=o,function(e){e.in.push(n),0==--e.indegree&&t.push(e)})(e);var n}))};null==t?void 0:t.length;)o();var i=r.filter((function(t){return!t.merged})),a=["vs","i","barycenter","weight"];return i.map((function(t){var e={};return null==a||a.forEach((function(n){void 0!==t[n]&&(e[n]=t[n])})),e}))}(null===(o=(r=Object.values(i)).filter)||void 0===o?void 0:o.call(r,(function(t){return!t.indegree})))};var _n=function(t,e,n){for(var r,o=n;e.length&&(r=e[e.length-1]).i<=o;)e.pop(),null==t||t.push(r.vs),o++;return o};const Sn=function(t,e,n,r){var o=function(t,e){var n={lhs:[],rhs:[]};return null==t||t.forEach((function(t){var e,o;o=(e=t).hasOwnProperty("fixorder")&&!isNaN(e.fixorder),(r?!o&&e.hasOwnProperty("barycenter"):o||e.hasOwnProperty("barycenter"))?n.lhs.push(t):n.rhs.push(t)})),n}(t),i=o.lhs,a=o.rhs.sort((function(t,e){return-t.i- -e.i})),u=[],s=0,c=0,f=0;null==i||i.sort(function(t,e){return function(n,r){if(void 0!==n.fixorder&&void 0!==r.fixorder)return n.fixorder-r.fixorder;if(n.barycenter<r.barycenter)return-1;if(n.barycenter>r.barycenter)return 1;if(e&&void 0!==n.order&&void 0!==r.order){if(n.order<r.order)return-1;if(n.order>r.order)return 1}return t?r.i-n.i:n.i-r.i}}(!!e,!!n)),f=_n(u,a,f),null==i||i.forEach((function(t){var e;f+=null===(e=t.vs)||void 0===e?void 0:e.length,u.push(t.vs),s+=t.barycenter*t.weight,c+=t.weight,f=_n(u,a,f)}));var l={vs:u.flat()};return c&&(l.barycenter=s/c,l.weight=c),l};const An=function t(e,n,r,o,i,a){var u,s,c,f,l=e.children(n),d=e.node(n),h=d?d.borderLeft:void 0,p=d?d.borderRight:void 0,v={};h&&(l=null==l?void 0:l.filter((function(t){return t!==h&&t!==p})));var g=function(t,e){return e.map((function(e){var n=t.inEdges(e);if(!(null==n?void 0:n.length))return{v:e};var r={sum:0,weight:0};return null==n||n.forEach((function(e){var n=t.edge(e),o=t.node(e.v);r.sum+=n.weight*o.order,r.weight+=n.weight})),{v:e,barycenter:r.sum/r.weight,weight:r.weight}}))}(e,l||[]);null==g||g.forEach((function(n){var i,u,s;if(null===(i=e.children(n.v))||void 0===i?void 0:i.length){var c=t(e,n.v,r,o,a);v[n.v]=c,c.hasOwnProperty("barycenter")&&(s=c,void 0!==(u=n).barycenter?(u.barycenter=(u.barycenter*u.weight+s.barycenter*s.weight)/(u.weight+s.weight),u.weight+=s.weight):(u.barycenter=s.barycenter,u.weight=s.weight))}}));var m=xn(g,r);(function(t,e){null==t||t.forEach((function(t){var n,r=null===(n=t.vs)||void 0===n?void 0:n.map((function(t){return e[t]?e[t].vs:t}));t.vs=r.flat()}))})(m,v),null===(u=m.filter((function(t){return t.vs.length>0})))||void 0===u||u.forEach((function(t){var n=e.node(t.vs[0]);n&&(t.fixorder=n.fixorder,t.order=n.order)}));var y=Sn(m,o,i,a);if(h&&(y.vs=[h,y.vs,p].flat(),null===(s=e.predecessors(h))||void 0===s?void 0:s.length)){var b=e.node((null===(c=e.predecessors(h))||void 0===c?void 0:c[0])||""),w=e.node((null===(f=e.predecessors(p))||void 0===f?void 0:f[0])||"");y.hasOwnProperty("barycenter")||(y.barycenter=0,y.weight=0),y.barycenter=(y.barycenter*y.weight+b.order+w.order)/(y.weight+2),y.weight+=2}return y};var In=function(t,e,n){return e.map((function(e){return wn(t,e,n)}))},Tn=function(t,e,n,r){var o=new xe;null==t||t.forEach((function(t){for(var i,a=t.graph().root,u=An(t,a,o,e,n,r),s=0;s<(null===(i=u.vs)||void 0===i?void 0:i.length);s++){var c=t.node(u.vs[s]);c&&(c.order=s)}!function(t,e,n){var r,o={};null==n||n.forEach((function(n){for(var i,a,u=t.parent(n);u;){if((i=t.parent(u))?(a=o[i],o[i]=u):(a=r,r=u),a&&a!==u)return void e.setEdge(a,u);u=i}}))}(t,o,u.vs)}))},On=function(t,e){null==e||e.forEach((function(e){null==e||e.forEach((function(e,n){t.node(e).order=n}))}))};const Nn=function(t){if(vn(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])};var Dn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Mn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Dn(e,t),e}(le),kn=function(t,e){var n={};function r(e,r,o,i,a){for(var u,s,c,f=r;f<o;f++)c=e[f],(null===(u=t.node(c))||void 0===u?void 0:u.dummy)&&(null===(s=t.predecessors(c))||void 0===s||s.forEach((function(e){var r=t.node(e);r.dummy&&(r.order<i||r.order>a)&&Cn(n,e,c)})))}function o(t,e){var n=function(t){return JSON.stringify(t.slice(1))}(t);e.get(n)||(r.apply(void 0,t),e.set(n,!0))}return(null==e?void 0:e.length)&&e.reduce((function(e,n){var r,i=-1,a=0,u=new Map;return null==n||n.forEach((function(s,c){var f;if("border"===(null===(f=t.node(s))||void 0===f?void 0:f.dummy)){var l=t.predecessors(s)||[];l.length&&(r=t.node(l[0]).order,o([n,a,c,i,r],u),a=c,i=r)}o([n,a,n.length,r,e.length],u)})),n})),n},Rn=function(t,e){var n,r;if(null===(n=t.node(e))||void 0===n?void 0:n.dummy)return null===(r=t.predecessors(e))||void 0===r?void 0:r.find((function(e){return t.node(e).dummy}))},Cn=function(t,e,n){var r=e,o=n;if(r>o){var i=r;r=o,o=i}var a=t[r];a||(t[r]=a={}),a[o]=!0},Ln=function(t,e,n){var r=e;return r>n&&(r=n),!!t[r]},Pn=function(t,e,n,r){var o=new Mn,i=t.graph(),a=jn(i.nodesep,i.edgesep,r);return null==e||e.forEach((function(e){var r;null==e||e.forEach((function(e){var i=n[e];if(o.setNode(i),r){var u=n[r],s=o.edgeFromArgs(u,i);o.setEdge(u,i,Math.max(a(t,e,r),s||0))}r=e}))})),o};var jn=function(t,e,n){return function(r,o,i){var a,u=r.node(o),s=r.node(i),c=0;if(c+=u.width/2,u.hasOwnProperty("labelpos"))switch((u.labelpos||"").toLowerCase()){case"l":a=-u.width/2;break;case"r":a=u.width/2}if(a&&(c+=n?a:-a),a=0,c+=(u.dummy?e:t)/2,c+=(s.dummy?e:t)/2,c+=s.width/2,s.labelpos)switch((s.labelpos||"").toLowerCase()){case"l":a=s.width/2;break;case"r":a=-s.width/2}return a&&(c+=n?a:-a),a=0,c}},zn=function(t,e){return t.node(e).width||0},Fn=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))};const Gn=function(t){var e,n=Se(t);!function(t){var e=Ie(t),n=t.graph().ranksep,r=0;null==e||e.forEach((function(e){var o=e.map((function(e){return t.node(e).height})),i=Math.max.apply(Math,Fn(Fn([],o,!1),[0],!1));null==e||e.forEach((function(e){t.node(e).y=r+i/2})),r+=i+n}))}(n);var r=function(t){var e=Ie(t),n=Object.assign(function(t,e){var n={};return(null==e?void 0:e.length)&&e.reduce((function(e,r){var o=0,i=0,a=e.length,u=null==r?void 0:r[(null==r?void 0:r.length)-1];return null==r||r.forEach((function(e,s){var c,f=Rn(t,e),l=f?t.node(f).order:a;(f||e===u)&&(null===(c=r.slice(i,s+1))||void 0===c||c.forEach((function(e){var r;null===(r=t.predecessors(e))||void 0===r||r.forEach((function(r){var i,a=t.node(r),u=a.order;!(u<o||l<u)||a.dummy&&(null===(i=t.node(e))||void 0===i?void 0:i.dummy)||Cn(n,r,e)}))})),i=s+1,o=l)})),r})),n}(t,e),kn(t,e)),r={},o=[];["u","d"].forEach((function(i){o="u"===i?e:Object.values(e).reverse(),["l","r"].forEach((function(e){"r"===e&&(o=o.map((function(t){return Object.values(t).reverse()})));var a=("u"===i?t.predecessors:t.successors).bind(t),u=function(t,e,n,r){var o={},i={},a={};return null==e||e.forEach((function(t){null==t||t.forEach((function(t,e){o[t]=t,i[t]=t,a[t]=e}))})),null==e||e.forEach((function(t){var e=-1;null==t||t.forEach((function(t){var u=r(t);if(u.length){u=u.sort((function(t,e){return a[t]-a[e]}));for(var s=(u.length-1)/2,c=Math.floor(s),f=Math.ceil(s);c<=f;++c){var l=u[c];i[t]===t&&e<a[l]&&!Ln(n,t,l)&&(i[l]=t,i[t]=o[t]=o[l],e=a[l])}}}))})),{root:o,align:i}}(0,o,n,a),s=function(t,e,n,r,o){var i,a={},u=Pn(t,e,n,o),s=o?"borderLeft":"borderRight",c=function(t,e){for(var n=u.nodes(),r=n.pop(),o={};r;)o[r]?t(r):(o[r]=!0,n.push(r),n=n.concat(e(r))),r=n.pop()};return c((function(t){a[t]=(u.inEdges(t)||[]).reduce((function(t,e){return Math.max(t,(a[e.v]||0)+u.edge(e))}),0)}),u.predecessors.bind(u)),c((function(e){var n=(u.outEdges(e)||[]).reduce((function(t,e){return Math.min(t,(a[e.w]||0)-u.edge(e))}),Number.POSITIVE_INFINITY),r=t.node(e);n!==Number.POSITIVE_INFINITY&&r.borderType!==s&&(a[e]=Math.max(a[e],n))}),u.successors.bind(u)),null===(i=Object.values(r))||void 0===i||i.forEach((function(t){a[t]=a[n[t]]})),a}(t,o,u.root,u.align,"r"===e);"r"===e&&Object.keys(s).forEach((function(t){return s[t]=-s[t]})),r[i+e]=s}))}));var i=function(t,e){return Me(Object.values(e),(function(e){var n,r=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;return null===(n=Object.keys(e))||void 0===n||n.forEach((function(n){var i=e[n],a=zn(t,n)/2;r=Math.max(i+a,r),o=Math.min(i-a,o)})),r-o}))}(t,r);return i&&function(t,e){var n=Object.values(e),r=Nn(n),o=gn(n);["u","d"].forEach((function(n){["l","r"].forEach((function(i){var a,u=n+i,s=t[u];if(s!==e){var c=Object.values(s);(a="l"===i?r-Nn(c):o-gn(c))&&(t[u]={},Object.keys(s).forEach((function(e){t[u][e]=s[e]+a})))}}))}))}(r,i),function(t,e){var n={};return Object.keys(t.ul).forEach((function(r){if(e)n[r]=t[e.toLowerCase()][r];else{var o=Object.values(t).map((function(t){return t[r]}));n[r]=(o[0]+o[1])/2}})),n}(r,t.graph().align)}(n);null===(e=Object.keys(r))||void 0===e||e.forEach((function(t){n.node(t).x=r[t]}))};var Un=function(){return Un=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Un.apply(this,arguments)},Bn=function(t,e,n){e(" removeSelfEdges",(function(){ir(t)})),e(" acyclic",(function(){!function(t){var e="greedy"===t.graph().acyclicer?we(t,function(t){return function(e){var n;return(null===(n=t.edge(e))||void 0===n?void 0:n.weight)||1}}(t)):function(t){var e=[],n={},r={};return t.nodes().forEach((function o(i){var a;r[i]||(r[i]=!0,n[i]=!0,null===(a=t.outEdges(i))||void 0===a||a.forEach((function(t){n[t.w]?e.push(t):o(t.w)})),delete n[i])})),e}(t);null==e||e.forEach((function(e){var n=t.edge(e);t.removeEdgeObj(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,"rev-".concat(Math.random()))}))}(t)})),e(" nestingGraph.run",(function(){an(t)})),e(" rank",(function(){nn(Se(t))})),e(" injectEdgeLabelProxies",(function(){$n(t)})),e(" removeEmptyRanks",(function(){!function(t){var e=t.nodes(),n=e.filter((function(e){var n;return void 0!==(null===(n=t.node(e))||void 0===n?void 0:n.rank)})).map((function(e){return t.node(e).rank})),r=Math.min.apply(Math,n),o=[];e.forEach((function(e){var n,i=((null===(n=t.node(e))||void 0===n?void 0:n.rank)||0)-r;o[i]||(o[i]=[]),o[i].push(e)}));for(var i=0,a=t.graph().nodeRankFactor||0,u=0;u<o.length;u++){var s=o[u];void 0===s?u%a!=0&&(i-=1):i&&(null==s||s.forEach((function(e){var n=t.node(e);n&&(n.rank=n.rank||0,n.rank+=i)})))}}(t)})),e(" nestingGraph.cleanup",(function(){!function(t){var e=t.graph();e.nestingRoot&&t.removeNode(e.nestingRoot),delete e.nestingRoot,t.edges().forEach((function(e){t.edge(e).nestingEdge&&t.removeEdgeObj(e)}))}(t)})),e(" normalizeRanks",(function(){!function(t){var e=t.nodes().filter((function(e){var n;return void 0!==(null===(n=t.node(e))||void 0===n?void 0:n.rank)})).map((function(e){return t.node(e).rank})),n=Math.min.apply(Math,e);t.nodes().forEach((function(e){var r=t.node(e);r.hasOwnProperty("rank")&&n!==1/0&&(r.rank-=n)}))}(t)})),e(" assignRankMinMax",(function(){Qn(t)})),e(" removeEdgeLabelProxies",(function(){Jn(t)})),e(" normalize.run",(function(){ke(t)})),e(" parentDummyChains",(function(){!function(t){var e,n=function(t){var e,n={},r=0;return null===(e=t.children())||void 0===e||e.forEach((function e(o){var i,a=r;null===(i=t.children(o))||void 0===i||i.forEach(e),n[o]={low:a,lim:r++}})),n}(t);null===(e=t.graph().dummyChains)||void 0===e||e.forEach((function(e){var r,o,i=e,a=t.node(i),u=a.edgeObj;if(u)for(var s=function(t,e,n,r){var o,i,a=[],u=[],s=Math.min(e[n].low,e[r].low),c=Math.max(e[n].lim,e[r].lim);o=n;do{o=t.parent(o),a.push(o)}while(o&&(e[o].low>s||c>e[o].lim));for(i=o,o=r;o&&o!==i;)u.push(o),o=t.parent(o);return{lca:i,path:a.concat(u.reverse())}}(t,n,u.v,u.w),c=s.path,f=s.lca,l=0,d=c[l],h=!0;i!==u.w;){if(a=t.node(i),h){for(;d!==f&&(null===(r=t.node(d))||void 0===r?void 0:r.maxRank)<a.rank;)d=c[++l];d===f&&(h=!1)}if(!h){for(;l<c.length-1&&(null===(o=t.node(c[l+1]))||void 0===o?void 0:o.minRank)<=a.rank;)l++;d=c[l]}t.setParent(i,d),i=t.successors(i)[0]}}))}(t)})),e(" addBorderSegments",(function(){sn(t)})),n&&n.keepNodeOrder&&e(" initDataOrder",(function(){!function(t,e){for(var n=t.nodes().filter((function(e){var n;return!(null===(n=t.children(e))||void 0===n?void 0:n.length)})),r=n.map((function(e){return t.node(e).rank})),o=Math.max.apply(Math,r),i=[],a=0;a<o+1;a++)i[a]=[];null==e||e.forEach((function(e){var n=t.node(e);n&&!(null==n?void 0:n.dummy)&&(isNaN(n.rank)||(n.fixorder=i[n.rank].length,i[n.rank].push(e)))}))}(t,n.nodeOrder)})),e(" order",(function(){!function(t,e){for(var n=Oe(t),r=[],o=[],i=1;i<n+1;i++)r.push(i);for(i=n-1;i>-1;i--)o.push(i);var a=In(t,r,"inEdges"),u=In(t,o,"outEdges"),s=mn(t);On(t,s);for(var c,f=Number.POSITIVE_INFINITY,d=(i=0,0);d<4;++i,++d)Tn(i%2?a:u,i%4>=2,!1,e),s=Ie(t),(h=bn(t,s))<f&&(d=0,c=l(s),f=h);for(s=mn(t),On(t,s),i=0,d=0;d<4;++i,++d){var h;Tn(i%2?a:u,i%4>=2,!0,e),s=Ie(t),(h=bn(t,s))<f&&(d=0,c=l(s),f=h)}On(t,c)}(t,null==n?void 0:n.keepNodeOrder)})),e(" insertSelfEdges",(function(){ar(t)})),e(" adjustCoordinateSystem",(function(){!function(t){var e,n=null===(e=t.graph().rankdir)||void 0===e?void 0:e.toLowerCase();"lr"!==n&&"rl"!==n||cn(t)}(t)})),e(" position",(function(){Gn(t)})),e(" positionSelfEdges",(function(){ur(t)})),e(" removeBorderNodes",(function(){or(t)})),e(" normalize.undo",(function(){!function(t){var e;null===(e=t.graph().dummyChains)||void 0===e||e.forEach((function(e){var n,r=t.node(e),o=r.edgeLabel;r.edgeObj&&t.setEdgeObj(r.edgeObj,o);for(var i=e;r.dummy;)n=t.successors(i)[0],t.removeNode(i),o.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(o.x=r.x,o.y=r.y,o.width=r.width,o.height=r.height),i=n,r=t.node(i)}))}(t)})),e(" fixupEdgeLabelCoords",(function(){nr(t)})),e(" undoCoordinateSystem",(function(){hn(t)})),e(" translateGraph",(function(){tr(t)})),e(" assignNodeIntersects",(function(){er(t)})),e(" reversePoints",(function(){rr(t)})),e(" acyclic.undo",(function(){!function(t){t.edges().forEach((function(e){var n=t.edge(e);if(n.reversed){t.removeEdgeObj(e);var r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}}))}(t)}))},Vn=["nodesep","edgesep","ranksep","marginx","marginy"],Wn={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Xn=["acyclicer","ranker","rankdir","align"],Hn=["width","height","layer","fixorder"],qn={width:0,height:0},Yn=["minlen","weight","width","height","labeloffset"],Kn={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Zn=["labelpos"],$n=function(t){t.edges().forEach((function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),o={e,rank:(t.node(e.w).rank-r.rank)/2+r.rank};_e(t,"edge-proxy",o,"_ep")}}))},Qn=function(t){var e=0;t.nodes().forEach((function(n){var r,o,i=t.node(n);i.borderTop&&(i.minRank=null===(r=t.node(i.borderTop))||void 0===r?void 0:r.rank,i.maxRank=null===(o=t.node(i.borderBottom))||void 0===o?void 0:o.rank,e=Math.max(e,i.maxRank||-1/0))})),t.graph().maxRank=e},Jn=function(t){t.nodes().forEach((function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))}))},tr=function(t){var e,n,r=0,o=0,i=t.graph(),a=i.marginx||0,u=i.marginy||0,s=function(t){if(t){var i=t.x,a=t.y,u=t.width,s=t.height;isNaN(i)||isNaN(u)||(void 0===e&&(e=i-u/2),e=Math.min(e,i-u/2),r=Math.max(r,i+u/2)),isNaN(a)||isNaN(s)||(void 0===n&&(n=a-s/2),n=Math.min(n,a-s/2),o=Math.max(o,a+s/2))}};t.nodes().forEach((function(e){s(t.node(e))})),t.edges().forEach((function(e){var n=t.edge(e);(null==n?void 0:n.hasOwnProperty("x"))&&s(n)})),e-=a,n-=u,t.nodes().forEach((function(r){var o=t.node(r);o&&(o.x-=e,o.y-=n)})),t.edges().forEach((function(r){var o,i=t.edge(r);null===(o=i.points)||void 0===o||o.forEach((function(t){t.x-=e,t.y-=n})),i.hasOwnProperty("x")&&(i.x-=e),i.hasOwnProperty("y")&&(i.y-=n)})),i.width=r-e+a,i.height=o-n+u},er=function(t){t.edges().forEach((function(e){var n,r,o=t.edge(e),i=t.node(e.v),a=t.node(e.w);o.points?(n=o.points[0],r=o.points[o.points.length-1]):(o.points=[],n=a,r=i),o.points.unshift(Ae(i,n)),o.points.push(Ae(a,r))}))},nr=function(t){t.edges().forEach((function(e){var n=t.edge(e);if(null==n?void 0:n.hasOwnProperty("x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))},rr=function(t){t.edges().forEach((function(e){var n,r=t.edge(e);r.reversed&&(null===(n=r.points)||void 0===n||n.reverse())}))},or=function(t){t.nodes().forEach((function(e){var n,r,o;if(null===(n=t.children(e))||void 0===n?void 0:n.length){var i=t.node(e),a=t.node(i.borderTop),u=t.node(i.borderBottom),s=t.node(i.borderLeft[(null===(r=i.borderLeft)||void 0===r?void 0:r.length)-1]),c=t.node(i.borderRight[(null===(o=i.borderRight)||void 0===o?void 0:o.length)-1]);i.width=Math.abs((null==c?void 0:c.x)-(null==s?void 0:s.x))||10,i.height=Math.abs((null==u?void 0:u.y)-(null==a?void 0:a.y))||10,i.x=((null==s?void 0:s.x)||0)+i.width/2,i.y=((null==a?void 0:a.y)||0)+i.height/2}})),t.nodes().forEach((function(e){var n;"border"===(null===(n=t.node(e))||void 0===n?void 0:n.dummy)&&t.removeNode(e)}))},ir=function(t){t.edges().forEach((function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e,label:t.edge(e)}),t.removeEdgeObj(e)}}))},ar=function(t){var e=Ie(t);null==e||e.forEach((function(e){var n=0;null==e||e.forEach((function(e,r){var o,i=t.node(e);i.order=r+n,null===(o=i.selfEdges)||void 0===o||o.forEach((function(e){_e(t,"selfedge",{width:e.label.width,height:e.label.height,rank:i.rank,order:r+ ++n,e:e.e,label:e.label},"_se")})),delete i.selfEdges}))}))},ur=function(t){t.nodes().forEach((function(e){var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),o=r.x+r.width/2,i=r.y,a=n.x-o,u=r.height/2;t.setEdgeObj(n.e,n.label),t.removeNode(e),n.label.points=[{x:o+2*a/3,y:i-u},{x:o+5*a/6,y:i-u},{y:i,x:o+a},{x:o+5*a/6,y:i+u},{x:o+2*a/3,y:i+u}],n.label.x=n.x,n.label.y=n.y}}))},sr=function(t,e){var n={};return null==e||e.forEach((function(e){void 0!==t[e]&&(n[e]=+t[e])})),n},cr=function(t){void 0===t&&(t={});var e={};return Object.keys(t).forEach((function(n){e[n.toLowerCase()]=t[n]})),e};const fr=function(t,e){var n=e&&e.debugTiming?Ne:De;n("layout",(function(){e&&!e.keepNodeOrder&&e.prevGraph&&n(" inheritOrder",(function(){var n,r;n=t,r=e.prevGraph,n.nodes().forEach((function(t){var e=n.node(t),o=r.node(t);void 0!==o?(e.fixorder=o._order,delete o._order):delete e.fixorder}))}));var r=n(" buildLayoutGraph",(function(){return function(t){var e=new xe({multigraph:!0,compound:!0}),n=cr(t.graph()),r={};return null==Xn||Xn.forEach((function(t){void 0!==n[t]&&(r[t]=n[t])})),e.setGraph(Object.assign({},Wn,sr(n,Vn),r)),t.nodes().forEach((function(n){var r=cr(t.node(n)),o=Un(Un({},qn),r),i=sr(o,Hn);e.setNode(n,i),e.setParent(n,t.parent(n))})),t.edges().forEach((function(n){var r=cr(t.edge(n)),o={};null==Zn||Zn.forEach((function(t){void 0!==r[t]&&(o[t]=r[t])})),e.setEdgeObj(n,Object.assign({},Kn,sr(r,Yn),o))})),e}(t)}));e&&!1===e.edgeLabelSpace||n(" makeSpaceForEdgeLabels",(function(){!function(t){var e=t.graph();e.ranksep||(e.ranksep=0),e.ranksep/=2,t.nodes().forEach((function(e){var n=t.node(e);isNaN(n.layer)||n.layer||(n.layer=0)})),t.edges().forEach((function(n){var r,o=t.edge(n);o.minlen*=2,"c"!==(null===(r=o.labelpos)||void 0===r?void 0:r.toLowerCase())&&("TB"===e.rankdir||"BT"===e.rankdir?o.width+=o.labeloffset:o.height+=o.labeloffset)}))}(r)}));try{n(" runLayout",(function(){Bn(r,n,e)}))}catch(t){if("Not possible to find intersection inside of the rectangle"===t.message)return void 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:\n",t);throw t}n(" updateInputGraph",(function(){!function(t,e){t.nodes().forEach((function(n){var r,o=t.node(n);if(o){var i=e.node(n);o.x=i.x,o.y=i.y,o._order=i.order,o._rank=i.rank,(null===(r=e.children(n))||void 0===r?void 0:r.length)&&(o.width=i.width,o.height=i.height)}})),t.edges().forEach((function(n){var r=t.edge(n),o=e.edge(n);r.points=o?o.points:[],o&&o.hasOwnProperty("x")&&(r.x=o.x,r.y=o.y)})),t.graph().width=e.graph().width,t.graph().height=e.graph().height}(t,r)}))}))};var lr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),dr=function(t){function n(e){var n=t.call(this)||this;return n.rankdir="TB",n.nodesep=50,n.ranksep=50,n.controlPoints=!1,n.sortByCombo=!1,n.edgeLabelSpace=!0,n.radial=!1,n.nodes=[],n.edges=[],n.onLayoutEnd=function(){},n.layoutNode=function(t){var e=n.nodes.find((function(e){return e.id===t}));return!e||!1!==e.layout},n.updateCfg(e),n}return lr(n,t),n.prototype.getDefaultCfg=function(){return{rankdir:"TB",align:void 0,nodeSize:void 0,nodesepFunc:void 0,ranksepFunc:void 0,nodesep:50,ranksep:50,controlPoints:!1,radial:!1,focusNode:null}},n.prototype.execute=function(){var t,n,r,a,u=this,s=this,c=s.nodes,l=s.nodeSize,h=s.rankdir,p=s.combos,v=s.begin,g=s.radial,m=s.comboEdges,y=void 0===m?[]:m,b=s.vedges,w=void 0===b?[]:b;if(c){var E=s.edges||[],_=new xe({multigraph:!0,compound:!0});s.nodeMap={};var S={};c.forEach((function(t){s.nodeMap[t.id]=t,t.comboId&&(S[t.comboId]=S[t.comboId]||[],S[t.comboId].push(t.id))}));var A,I=[],T={};(null===(t=s.nodeOrder)||void 0===t?void 0:t.length)?(s.nodeOrder.forEach((function(t){T[t]=!0,I.push(s.nodeMap[t])})),c.forEach((function(t){T[t.id]||I.push(t)}))):I=c,A=l?o(l)?function(){return l}:function(){return[l,l]}:function(t){return t.size?o(t.size)?t.size:f(t.size)?[t.size.width||40,t.size.height||40]:[t.size,t.size]:[40,40]};var O=x(s.ranksep,50,s.ranksepFunc),N=x(s.nodesep,50,s.nodesepFunc),D=N,M=O;"LR"!==h&&"RL"!==h||(D=O,M=N),_.setDefaultEdgeLabel((function(){return{}})),_.setGraph(s);var k={};this.sortByCombo&&p&&p.forEach((function(t){if(k[t.id]=t,t.collapsed){var e=A(t),n=M(t),r=D(t),o=e[0]+2*r,i=e[1]+2*n;_.setNode(t.id,{width:o,height:i})}t.parentId&&(k[t.parentId]||_.setNode(t.parentId,{}),_.setParent(t.id,t.parentId))})),I.filter((function(t){return!1!==t.layout})).forEach((function(t){var e=A(t),n=M(t),r=D(t),o=e[0]+2*r,a=e[1]+2*n,s=t.layer;i(s)?_.setNode(t.id,{width:o,height:a,layer:s}):_.setNode(t.id,{width:o,height:a}),u.sortByCombo&&t.comboId&&(k[t.comboId]||(k[t.comboId]={id:t.comboId},_.setNode(t.comboId,{})),_.setParent(t.id,t.comboId))})),E.forEach((function(t){var e=d(t,"source"),n=d(t,"target");u.layoutNode(e)&&u.layoutNode(n)&&_.setEdge(e,n,{weight:t.weight||1})})),null===(n=null==y?void 0:y.concat(w||[]))||void 0===n||n.forEach((function(t){var e,n,r=t.source,o=t.target,i=(null===(e=k[r])||void 0===e?void 0:e.collapsed)?[r]:S[r]||[r],a=(null===(n=k[o])||void 0===n?void 0:n.collapsed)?[o]:S[o]||[o];i.forEach((function(e){a.forEach((function(n){_.setEdge(e,n,{weight:t.weight||1})}))}))}));var R=void 0;(null===(r=s.preset)||void 0===r?void 0:r.nodes)&&(R=new xe({multigraph:!0,compound:!0}),s.preset.nodes.forEach((function(t){null==R||R.setNode(t.id,t)}))),fr(_,{prevGraph:R,edgeLabelSpace:s.edgeLabelSpace,keepNodeOrder:Boolean(!!s.nodeOrder),nodeOrder:s.nodeOrder});var C=[0,0];if(v){var L=1/0,P=1/0;_.nodes().forEach((function(t){var e=_.node(t);L>e.x&&(L=e.x),P>e.y&&(P=e.y)})),_.edges().forEach((function(t){var e;null===(e=_.edge(t).points)||void 0===e||e.forEach((function(t){L>t.x&&(L=t.x),P>t.y&&(P=t.y)}))})),C[0]=v[0]-L,C[1]=v[1]-P}var j="LR"===h||"RL"===h;if(g){var z=this,F=z.focusNode,G=z.ranksep,U=z.getRadialPos,B=e(F)?F:null==F?void 0:F.id,V=B?null===(a=_.node(B))||void 0===a?void 0:a._rank:0,W=[],X=j?"y":"x",H=j?"height":"width",q=1/0,Y=-1/0;_.nodes().forEach((function(t){var e=_.node(t);if(s.nodeMap[t]){var n=N(s.nodeMap[t]);if(0===V)W[e._rank]||(W[e._rank]={nodes:[],totalWidth:0,maxSize:-1/0}),W[e._rank].nodes.push(t),W[e._rank].totalWidth+=2*n+e[H],W[e._rank].maxSize<Math.max(e.width,e.height)&&(W[e._rank].maxSize=Math.max(e.width,e.height));else{var r=e._rank-V;if(0===r)W[r]||(W[r]={nodes:[],totalWidth:0,maxSize:-1/0}),W[r].nodes.push(t),W[r].totalWidth+=2*n+e[H],W[r].maxSize<Math.max(e.width,e.height)&&(W[r].maxSize=Math.max(e.width,e.height));else{var o=Math.abs(r);W[o]||(W[o]={left:[],right:[],totalWidth:0,maxSize:-1/0}),W[o].totalWidth+=2*n+e[H],W[o].maxSize<Math.max(e.width,e.height)&&(W[o].maxSize=Math.max(e.width,e.height)),r<0?W[o].left.push(t):W[o].right.push(t)}}var i=e[X]-e[H]/2-n,a=e[X]+e[H]/2+n;i<q&&(q=i),a>Y&&(Y=a)}}));var K=G||50,Z={},$=(Y-q)/.9,Q=[.5*(q+Y-$),.5*(q+Y+$)],J=function(t,e,n,r){void 0===n&&(n=-1/0),void 0===r&&(r=[0,1]);var o=n;return t.forEach((function(t){var n=_.node(t);Z[t]=e;var i=U(n[X],Q,$,e,r),a=i.x,u=i.y;if(s.nodeMap[t]){s.nodeMap[t].x=a+C[0],s.nodeMap[t].y=u+C[1],s.nodeMap[t]._order=n._order;var c=O(s.nodeMap[t]);o<c&&(o=c)}})),o},tt=!0;W.forEach((function(t){var e,n,r,o,i,a,u;if((null===(e=null==t?void 0:t.nodes)||void 0===e?void 0:e.length)||(null===(n=null==t?void 0:t.left)||void 0===n?void 0:n.length)||(null===(r=null==t?void 0:t.right)||void 0===r?void 0:r.length)){if(tt&&1===t.nodes.length){var c=t.nodes[0];if(!s.nodeMap[c])return;return s.nodeMap[c].x=C[0],s.nodeMap[c].y=C[1],Z[t.nodes[0]]=0,K=O(s.nodeMap[c]),void(tt=!1)}K=Math.max(K,t.totalWidth/(2*Math.PI));var f=-1/0;if(0===V||(null===(o=t.nodes)||void 0===o?void 0:o.length))f=J(t.nodes,K,f,[0,1]);else{var l=(null===(i=t.left)||void 0===i?void 0:i.length)/((null===(a=t.left)||void 0===a?void 0:a.length)+(null===(u=t.right)||void 0===u?void 0:u.length));f=J(t.left,K,f,[0,l]),f=J(t.right,K,f,[l+.05,1])}K+=f,tt=!1,t.maxSize}})),_.edges().forEach((function(t){var e,n,r,o=_.edge(t),i=E.findIndex((function(e){var n=d(e,"source"),r=d(e,"target");return n===t.v&&r===t.w}));if(!(i<=-1)&&s.edgeLabelSpace&&s.controlPoints&&"loop"!==E[i].type){var a="x"===X?"y":"x",u=null===(e=null==o?void 0:o.points)||void 0===e?void 0:e.slice(1,o.points.length-1),c=[],f=null===(n=_.node(t.v))||void 0===n?void 0:n[a],l=f-(null===(r=_.node(t.w))||void 0===r?void 0:r[a]),h=Z[t.v],p=h-Z[t.w];null==u||u.forEach((function(t){var e=(t[a]-f)/l*p+h,n=U(t[X],Q,$,e);c.push({x:n.x+C[0],y:n.y+C[1]})})),E[i].controlPoints=c}}))}else{var et=new Set,nt="BT"===h||"RL"===h?function(t,e){return e-t}:function(t,e){return t-e};_.nodes().forEach((function(t){var e=_.node(t);if(e){var n=u.nodeMap[t];n||(n=null==p?void 0:p.find((function(e){return e.id===t}))),n&&(n.x=e.x+C[0],n.y=e.y+C[1],n._order=e._order,et.add(j?n.x:n.y))}}));var rt=Array.from(et).sort(nt),ot=j?function(t,e){return t.x!==e.x}:function(t,e){return t.y!==e.y},it=j?function(t,e,n){var r=Math.max(e.y,n.y),o=Math.min(e.y,n.y);return t.filter((function(t){return t.y<=r&&t.y>=o}))}:function(t,e,n){var r=Math.max(e.x,n.x),o=Math.min(e.x,n.x);return t.filter((function(t){return t.x<=r&&t.x>=o}))};_.edges().forEach((function(t){var e,n=_.edge(t),r=E.findIndex((function(e){var n=d(e,"source"),r=d(e,"target");return n===t.v&&r===t.w}));if(!(r<=-1)&&s.edgeLabelSpace&&s.controlPoints&&"loop"!==E[r].type){null===(e=null==n?void 0:n.points)||void 0===e||e.forEach((function(t){t.x+=C[0],t.y+=C[1]}));var o=s.nodeMap[t.v],i=s.nodeMap[t.w];E[r].controlPoints=hr(null==n?void 0:n.points,o,i,rt,j,ot,it)}}))}return s.onLayoutEnd&&s.onLayoutEnd(),{nodes:c,edges:E}}},n.prototype.getRadialPos=function(t,e,n,r,o){void 0===o&&(o=[0,1]);var i=(t-e[0])/n,a=2*(i=i*(o[1]-o[0])+o[0])*Math.PI;return{x:Math.cos(a)*r,y:Math.sin(a)*r}},n.prototype.getType=function(){return"dagre"},n}(t),hr=function(t,e,n,r,o,i,a){var u=(null==t?void 0:t.slice(1,t.length-1))||[];if(e&&n){var s=e.x,c=e.y,f=n.x,l=n.y;if(o&&(s=e.y,c=e.x,f=n.y,l=n.x),l!==c&&s!==f){var d=r.indexOf(c),h=r[d+1];if(h){var p=u[0],v=o?{x:(c+h)/2,y:(null==p?void 0:p.y)||f}:{x:(null==p?void 0:p.x)||f,y:(c+h)/2};p&&!i(p,v)||u.unshift(v)}var g=r.indexOf(l),m=Math.abs(g-d);if(1===m)(u=a(u,e,n)).length||u.push(o?{x:(c+l)/2,y:s}:{x:s,y:(c+l)/2});else if(m>1){var y=r[g-1];if(y){var b=u[u.length-1],w=o?{x:(l+y)/2,y:(null==b?void 0:b.y)||f}:{x:(null==b?void 0:b.x)||s,y:(l+y)/2};b&&!i(b,w)||u.push(w)}}}}return u};const pr={graph:{meta:{rankDir:"TB",nodeSep:50,rankSep:50,edgeSep:5,align:void 0}},subScene:{meta:{paddingTop:20,paddingBottom:20,paddingLeft:20,paddingRight:20,labelHeight:20}},nodeSize:{meta:{width:100,maxLabelWidth:0,height:20},node:{width:80,height:20,labelOffset:10,maxLabelWidth:40},bridge:{width:5,height:5,radius:2,labelOffset:0}}};function vr(t={},e=pr){var n,r,o,i;const a=JSON.parse(JSON.stringify(e)),u=(null===(n=null==t?void 0:t.graph)||void 0===n?void 0:n.meta)||{},s=(null===(r=null==t?void 0:t.subScene)||void 0===r?void 0:r.meta)||{},c=(null===(o=null==t?void 0:t.nodeSize)||void 0===o?void 0:o.meta)||{},f=(null===(i=null==t?void 0:t.nodeSize)||void 0===i?void 0:i.node)||{},l=a.nodeSize.bridge;return{graph:{meta:Object.assign(a.graph.meta,u)},subScene:{meta:Object.assign(a.subScene.meta,s)},nodeSize:{meta:Object.assign(a.nodeSize.meta,c),node:Object.assign(a.nodeSize.node,f),bridge:l}}}function gr(t){return`◬${t}◬`}const mr=gr("ROOT"),yr=gr("BRIDGE_GRAPH");var br,wr,Er,xr;!function(t){t[t.META=0]="META",t[t.NODE=1]="NODE",t[t.BRIDGE=2]="BRIDGE"}(br||(br={})),function(t){t[t.INCLUDE=0]="INCLUDE",t[t.EXCLUDE=1]="EXCLUDE",t[t.UNSPECIFIED=2]="UNSPECIFIED"}(wr||(wr={})),function(t){t[t.META=0]="META",t[t.CORE=1]="CORE",t[t.BRIDGE=2]="BRIDGE"}(Er||(Er={})),function(t){t[t.META=0]="META",t[t.OP=1]="OP",t[t.SERIES=2]="SERIES"}(xr||(xr={}));var _r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{};function Sr(t,e){return t(e={exports:{}},e.exports),e.exports}var Ar=function(t,e){return t===e||t!=t&&e!=e},Ir=function(t,e){for(var n=t.length;n--;)if(Ar(t[n][0],e))return n;return-1},Tr=Array.prototype.splice;function Or(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Or.prototype.clear=function(){this.__data__=[],this.size=0},Or.prototype.delete=function(t){var e=this.__data__,n=Ir(e,t);return!(n<0||(n==e.length-1?e.pop():Tr.call(e,n,1),--this.size,0))},Or.prototype.get=function(t){var e=this.__data__,n=Ir(e,t);return n<0?void 0:e[n][1]},Or.prototype.has=function(t){return Ir(this.__data__,t)>-1},Or.prototype.set=function(t,e){var n=this.__data__,r=Ir(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var Nr,Dr=Or,Mr="object"==typeof _r&&_r&&_r.Object===Object&&_r,kr="object"==typeof self&&self&&self.Object===Object&&self,Rr=Mr||kr||Function("return this")(),Cr=Rr.Symbol,Lr=Object.prototype,Pr=Lr.hasOwnProperty,jr=Lr.toString,zr=Cr?Cr.toStringTag:void 0,Fr=Object.prototype.toString,Gr=Cr?Cr.toStringTag:void 0,Ur=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Gr&&Gr in Object(t)?function(t){var e=Pr.call(t,zr),n=t[zr];try{t[zr]=void 0;var r=!0}catch(t){}var o=jr.call(t);return r&&(e?t[zr]=n:delete t[zr]),o}(t):function(t){return Fr.call(t)}(t)},Br=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},Vr=function(t){if(!Br(t))return!1;var e=Ur(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},Wr=Rr["__core-js_shared__"],Xr=(Nr=/[^.]+$/.exec(Wr&&Wr.keys&&Wr.keys.IE_PROTO||""))?"Symbol(src)_1."+Nr:"",Hr=Function.prototype.toString,qr=function(t){if(null!=t){try{return Hr.call(t)}catch(t){}try{return t+""}catch(t){}}return""},Yr=/^\[object .+?Constructor\]$/,Kr=Function.prototype,Zr=Object.prototype,$r=Kr.toString,Qr=Zr.hasOwnProperty,Jr=RegExp("^"+$r.call(Qr).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),to=function(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!Br(t)||function(t){return!!Xr&&Xr in t}(t))&&(Vr(t)?Jr:Yr).test(qr(t))}(n)?n:void 0},eo=to(Rr,"Map"),no=to(Object,"create"),ro=Object.prototype.hasOwnProperty,oo=Object.prototype.hasOwnProperty;function io(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}io.prototype.clear=function(){this.__data__=no?no(null):{},this.size=0},io.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},io.prototype.get=function(t){var e=this.__data__;if(no){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return ro.call(e,t)?e[t]:void 0},io.prototype.has=function(t){var e=this.__data__;return no?void 0!==e[t]:oo.call(e,t)},io.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=no&&void 0===e?"__lodash_hash_undefined__":e,this};var ao=io,uo=function(t,e){var n=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?n["string"==typeof e?"string":"hash"]:n.map};function so(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}so.prototype.clear=function(){this.size=0,this.__data__={hash:new ao,map:new(eo||Dr),string:new ao}},so.prototype.delete=function(t){var e=uo(this,t).delete(t);return this.size-=e?1:0,e},so.prototype.get=function(t){return uo(this,t).get(t)},so.prototype.has=function(t){return uo(this,t).has(t)},so.prototype.set=function(t,e){var n=uo(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};var co=so;function fo(t){var e=this.__data__=new Dr(t);this.size=e.size}fo.prototype.clear=function(){this.__data__=new Dr,this.size=0},fo.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},fo.prototype.get=function(t){return this.__data__.get(t)},fo.prototype.has=function(t){return this.__data__.has(t)},fo.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Dr){var r=n.__data__;if(!eo||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new co(r)}return n.set(t,e),this.size=n.size,this};var lo=fo,ho=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t},po=function(){try{var t=to(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),vo=function(t,e,n){"__proto__"==e&&po?po(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n},go=Object.prototype.hasOwnProperty,mo=function(t,e,n){var r=t[e];go.call(t,e)&&Ar(r,n)&&(void 0!==n||e in t)||vo(t,e,n)},yo=function(t,e,n,r){var o=!n;n||(n={});for(var i=-1,a=e.length;++i<a;){var u=e[i],s=r?r(n[u],t[u],u,n,t):void 0;void 0===s&&(s=t[u]),o?vo(n,u,s):mo(n,u,s)}return n},bo=function(t){return null!=t&&"object"==typeof t},wo=function(t){return bo(t)&&"[object Arguments]"==Ur(t)},Eo=Object.prototype,xo=Eo.hasOwnProperty,_o=Eo.propertyIsEnumerable,So=wo(function(){return arguments}())?wo:function(t){return bo(t)&&xo.call(t,"callee")&&!_o.call(t,"callee")},Ao=Array.isArray,Io=function(){return!1},To=Sr((function(t,e){var n=e&&!e.nodeType&&e,r=n&&t&&!t.nodeType&&t,o=r&&r.exports===n?Rr.Buffer:void 0,i=(o?o.isBuffer:void 0)||Io;t.exports=i})),Oo=/^(?:0|[1-9]\d*)$/,No=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&Oo.test(t))&&t>-1&&t%1==0&&t<e},Do=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},Mo={};Mo["[object Float32Array]"]=Mo["[object Float64Array]"]=Mo["[object Int8Array]"]=Mo["[object Int16Array]"]=Mo["[object Int32Array]"]=Mo["[object Uint8Array]"]=Mo["[object Uint8ClampedArray]"]=Mo["[object Uint16Array]"]=Mo["[object Uint32Array]"]=!0,Mo["[object Arguments]"]=Mo["[object Array]"]=Mo["[object ArrayBuffer]"]=Mo["[object Boolean]"]=Mo["[object DataView]"]=Mo["[object Date]"]=Mo["[object Error]"]=Mo["[object Function]"]=Mo["[object Map]"]=Mo["[object Number]"]=Mo["[object Object]"]=Mo["[object RegExp]"]=Mo["[object Set]"]=Mo["[object String]"]=Mo["[object WeakMap]"]=!1;var ko=function(t){return function(e){return t(e)}},Ro=Sr((function(t,e){var n=e&&!e.nodeType&&e,r=n&&t&&!t.nodeType&&t,o=r&&r.exports===n&&Mr.process,i=function(){try{return r&&r.require&&r.require("util").types||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=i})),Co=Ro&&Ro.isTypedArray,Lo=Co?ko(Co):function(t){return bo(t)&&Do(t.length)&&!!Mo[Ur(t)]},Po=Object.prototype.hasOwnProperty,jo=function(t,e){var n=Ao(t),r=!n&&So(t),o=!n&&!r&&To(t),i=!n&&!r&&!o&&Lo(t),a=n||r||o||i,u=a?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],s=u.length;for(var c in t)!e&&!Po.call(t,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||No(c,s))||u.push(c);return u},zo=Object.prototype,Fo=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||zo)},Go=function(t,e){return function(n){return t(e(n))}},Uo=Go(Object.keys,Object),Bo=Object.prototype.hasOwnProperty,Vo=function(t){if(!Fo(t))return Uo(t);var e=[];for(var n in Object(t))Bo.call(t,n)&&"constructor"!=n&&e.push(n);return e},Wo=function(t){return null!=t&&Do(t.length)&&!Vr(t)},Xo=function(t){return Wo(t)?jo(t):Vo(t)},Ho=Object.prototype.hasOwnProperty,qo=function(t){return Wo(t)?jo(t,!0):function(t){if(!Br(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=Fo(t),n=[];for(var r in t)("constructor"!=r||!e&&Ho.call(t,r))&&n.push(r);return n}(t)},Yo=Sr((function(t,e){var n=e&&!e.nodeType&&e,r=n&&t&&!t.nodeType&&t,o=r&&r.exports===n?Rr.Buffer:void 0,i=o?o.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=i?i(n):new t.constructor(n);return t.copy(r),r}})),Ko=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e},Zo=function(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var a=t[n];e(a,n,t)&&(i[o++]=a)}return i},$o=function(){return[]},Qo=Object.prototype.propertyIsEnumerable,Jo=Object.getOwnPropertySymbols,ti=Jo?function(t){return null==t?[]:(t=Object(t),Zo(Jo(t),(function(e){return Qo.call(t,e)})))}:$o,ei=function(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t},ni=Go(Object.getPrototypeOf,Object),ri=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)ei(e,ti(t)),t=ni(t);return e}:$o,oi=function(t,e,n){var r=e(t);return Ao(t)?r:ei(r,n(t))},ii=function(t){return oi(t,Xo,ti)},ai=function(t){return oi(t,qo,ri)},ui=to(Rr,"DataView"),si=to(Rr,"Promise"),ci=to(Rr,"Set"),fi=to(Rr,"WeakMap"),li=qr(ui),di=qr(eo),hi=qr(si),pi=qr(ci),vi=qr(fi),gi=Ur;(ui&&"[object DataView]"!=gi(new ui(new ArrayBuffer(1)))||eo&&"[object Map]"!=gi(new eo)||si&&"[object Promise]"!=gi(si.resolve())||ci&&"[object Set]"!=gi(new ci)||fi&&"[object WeakMap]"!=gi(new fi))&&(gi=function(t){var e=Ur(t),n="[object Object]"==e?t.constructor:void 0,r=n?qr(n):"";if(r)switch(r){case li:return"[object DataView]";case di:return"[object Map]";case hi:return"[object Promise]";case pi:return"[object Set]";case vi:return"[object WeakMap]"}return e});var mi=gi,yi=Object.prototype.hasOwnProperty,bi=Rr.Uint8Array,wi=function(t){var e=new t.constructor(t.byteLength);return new bi(e).set(new bi(t)),e},Ei=/\w*$/,xi=Cr?Cr.prototype:void 0,_i=xi?xi.valueOf:void 0,Si=function(t,e){var n=e?wi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)},Ai=Object.create,Ii=function(){function t(){}return function(e){if(!Br(e))return{};if(Ai)return Ai(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}(),Ti=function(t){return"function"!=typeof t.constructor||Fo(t)?{}:Ii(ni(t))},Oi=Ro&&Ro.isMap,Ni=Oi?ko(Oi):function(t){return bo(t)&&"[object Map]"==mi(t)},Di=Ro&&Ro.isSet,Mi=Di?ko(Di):function(t){return bo(t)&&"[object Set]"==mi(t)},ki={};ki["[object Arguments]"]=ki["[object Array]"]=ki["[object ArrayBuffer]"]=ki["[object DataView]"]=ki["[object Boolean]"]=ki["[object Date]"]=ki["[object Float32Array]"]=ki["[object Float64Array]"]=ki["[object Int8Array]"]=ki["[object Int16Array]"]=ki["[object Int32Array]"]=ki["[object Map]"]=ki["[object Number]"]=ki["[object Object]"]=ki["[object RegExp]"]=ki["[object Set]"]=ki["[object String]"]=ki["[object Symbol]"]=ki["[object Uint8Array]"]=ki["[object Uint8ClampedArray]"]=ki["[object Uint16Array]"]=ki["[object Uint32Array]"]=!0,ki["[object Error]"]=ki["[object Function]"]=ki["[object WeakMap]"]=!1;var Ri=function t(e,n,r,o,i,a){var u,s=1&n,c=2&n,f=4&n;if(r&&(u=i?r(e,o,i,a):r(e)),void 0!==u)return u;if(!Br(e))return e;var l=Ao(e);if(l){if(u=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&yi.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(e),!s)return Ko(e,u)}else{var d=mi(e),h="[object Function]"==d||"[object GeneratorFunction]"==d;if(To(e))return Yo(e,s);if("[object Object]"==d||"[object Arguments]"==d||h&&!i){if(u=c||h?{}:Ti(e),!s)return c?function(t,e){return yo(t,ri(t),e)}(e,function(t,e){return t&&yo(e,qo(e),t)}(u,e)):function(t,e){return yo(t,ti(t),e)}(e,function(t,e){return t&&yo(e,Xo(e),t)}(u,e))}else{if(!ki[d])return i?e:{};u=function(t,e,n){var r=t.constructor;switch(e){case"[object ArrayBuffer]":return wi(t);case"[object Boolean]":case"[object Date]":return new r(+t);case"[object DataView]":return function(t,e){var n=e?wi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Si(t,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(t);case"[object RegExp]":return function(t){var e=new t.constructor(t.source,Ei.exec(t));return e.lastIndex=t.lastIndex,e}(t);case"[object Symbol]":return function(t){return _i?Object(_i.call(t)):{}}(t)}}(e,d,s)}}a||(a=new lo);var p=a.get(e);if(p)return p;a.set(e,u),Mi(e)?e.forEach((function(o){u.add(t(o,n,r,o,e,a))})):Ni(e)&&e.forEach((function(o,i){u.set(i,t(o,n,r,i,e,a))}));var v=l?void 0:(f?c?ai:ii:c?qo:Xo)(e);return ho(v||e,(function(o,i){v&&(o=e[i=o]),mo(u,i,t(o,n,r,i,e,a))})),u},Ci=function(t){return function(){return t}},Li=function(t,e,n){for(var r=-1,o=Object(t),i=n(t),a=i.length;a--;){var u=i[++r];if(!1===e(o[u],u,o))break}return t},Pi=function(t,e){return t&&Li(t,e,Xo)},ji=function(t,e){return function(e,n){if(null==e)return e;if(!Wo(e))return t(e,n);for(var r=e.length,o=-1,i=Object(e);++o<r&&!1!==n(i[o],o,i););return e}}(Pi),zi=function(t){return t},Fi=function(t){return"function"==typeof t?t:zi},Gi=function(t,e){return(Ao(t)?ho:ji)(t,Fi(e))},Ui=Gi,Bi=function(t,e){var n=[];return ji(t,(function(t,r,o){e(t,r,o)&&n.push(t)})),n};function Vi(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new co;++e<n;)this.add(t[e])}Vi.prototype.add=Vi.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Vi.prototype.has=function(t){return this.__data__.has(t)};var Wi=Vi,Xi=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1},Hi=function(t,e){return t.has(e)},qi=function(t,e,n,r,o,i){var a=1&n,u=t.length,s=e.length;if(u!=s&&!(a&&s>u))return!1;var c=i.get(t),f=i.get(e);if(c&&f)return c==e&&f==t;var l=-1,d=!0,h=2&n?new Wi:void 0;for(i.set(t,e),i.set(e,t);++l<u;){var p=t[l],v=e[l];if(r)var g=a?r(v,p,l,e,t,i):r(p,v,l,t,e,i);if(void 0!==g){if(g)continue;d=!1;break}if(h){if(!Xi(e,(function(t,e){if(!Hi(h,e)&&(p===t||o(p,t,n,r,i)))return h.push(e)}))){d=!1;break}}else if(p!==v&&!o(p,v,n,r,i)){d=!1;break}}return i.delete(t),i.delete(e),d},Yi=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n},Ki=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n},Zi=Cr?Cr.prototype:void 0,$i=Zi?Zi.valueOf:void 0,Qi=function(t,e,n,r,o,i,a){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!i(new bi(t),new bi(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Ar(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var u=Yi;case"[object Set]":var s=1&r;if(u||(u=Ki),t.size!=e.size&&!s)return!1;var c=a.get(t);if(c)return c==e;r|=2,a.set(t,e);var f=qi(u(t),u(e),r,o,i,a);return a.delete(t),f;case"[object Symbol]":if($i)return $i.call(t)==$i.call(e)}return!1},Ji=Object.prototype.hasOwnProperty,ta=Object.prototype.hasOwnProperty,ea=function t(e,n,r,o,i){return e===n||(null==e||null==n||!bo(e)&&!bo(n)?e!=e&&n!=n:function(t,e,n,r,o,i){var a=Ao(t),u=Ao(e),s=a?"[object Array]":mi(t),c=u?"[object Array]":mi(e),f="[object Object]"==(s="[object Arguments]"==s?"[object Object]":s),l="[object Object]"==(c="[object Arguments]"==c?"[object Object]":c),d=s==c;if(d&&To(t)){if(!To(e))return!1;a=!0,f=!1}if(d&&!f)return i||(i=new lo),a||Lo(t)?qi(t,e,n,r,o,i):Qi(t,e,s,n,r,o,i);if(!(1&n)){var h=f&&ta.call(t,"__wrapped__"),p=l&&ta.call(e,"__wrapped__");if(h||p){var v=h?t.value():t,g=p?e.value():e;return i||(i=new lo),o(v,g,n,r,i)}}return!!d&&(i||(i=new lo),function(t,e,n,r,o,i){var a=1&n,u=ii(t),s=u.length;if(s!=ii(e).length&&!a)return!1;for(var c=s;c--;){var f=u[c];if(!(a?f in e:Ji.call(e,f)))return!1}var l=i.get(t),d=i.get(e);if(l&&d)return l==e&&d==t;var h=!0;i.set(t,e),i.set(e,t);for(var p=a;++c<s;){var v=t[f=u[c]],g=e[f];if(r)var m=a?r(g,v,f,e,t,i):r(v,g,f,t,e,i);if(!(void 0===m?v===g||o(v,g,n,r,i):m)){h=!1;break}p||(p="constructor"==f)}if(h&&!p){var y=t.constructor,b=e.constructor;y==b||!("constructor"in t)||!("constructor"in e)||"function"==typeof y&&y instanceof y&&"function"==typeof b&&b instanceof b||(h=!1)}return i.delete(t),i.delete(e),h}(t,e,n,r,o,i))}(e,n,r,o,t,i))},na=function(t){return t==t&&!Br(t)},ra=function(t,e){return function(n){return null!=n&&n[t]===e&&(void 0!==e||t in Object(n))}},oa=function(t){return"symbol"==typeof t||bo(t)&&"[object Symbol]"==Ur(t)},ia=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,aa=/^\w*$/,ua=function(t,e){if(Ao(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!oa(t))||aa.test(t)||!ia.test(t)||null!=e&&t in Object(e)};function sa(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=t.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(sa.Cache||co),n}sa.Cache=co;var ca,fa=sa,la=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,da=/\\(\\)?/g,ha=function(t){var e=fa((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(la,(function(t,n,r,o){e.push(r?o.replace(da,"$1"):n||t)})),e}),(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}(),pa=function(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o},va=Cr?Cr.prototype:void 0,ga=va?va.toString:void 0,ma=function t(e){if("string"==typeof e)return e;if(Ao(e))return pa(e,t)+"";if(oa(e))return ga?ga.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n},ya=function(t){return null==t?"":ma(t)},ba=function(t,e){return Ao(t)?t:ua(t,e)?[t]:ha(ya(t))},wa=function(t){if("string"==typeof t||oa(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e},Ea=function(t,e){for(var n=0,r=(e=ba(e,t)).length;null!=t&&n<r;)t=t[wa(e[n++])];return n&&n==r?t:void 0},xa=function(t,e){return null!=t&&e in Object(t)},_a=function(t,e,n){for(var r=-1,o=(e=ba(e,t)).length,i=!1;++r<o;){var a=wa(e[r]);if(!(i=null!=t&&n(t,a)))break;t=t[a]}return i||++r!=o?i:!!(o=null==t?0:t.length)&&Do(o)&&No(a,o)&&(Ao(t)||So(t))},Sa=function(t,e){return null!=t&&_a(t,e,xa)},Aa=function(t){return function(e){return null==e?void 0:e[t]}},Ia=function(t){return"function"==typeof t?t:null==t?zi:"object"==typeof t?Ao(t)?function(t,e){return ua(t)&&na(e)?ra(wa(t),e):function(n){var r=function(t,e,n){var r=null==t?void 0:Ea(t,e);return void 0===r?void 0:r}(n,t);return void 0===r&&r===e?Sa(n,t):ea(e,r,3)}}(t[0],t[1]):function(t){var e=function(t){for(var e=Xo(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,na(o)]}return e}(t);return 1==e.length&&e[0][2]?ra(e[0][0],e[0][1]):function(n){return n===t||function(t,e,n,r){var o=n.length,i=o;if(null==t)return!i;for(t=Object(t);o--;){var a=n[o];if(a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++o<i;){var u=(a=n[o])[0],s=t[u],c=a[1];if(a[2]){if(void 0===s&&!(u in t))return!1}else{var f,l=new lo;if(!(void 0===f?ea(c,s,3,r,l):f))return!1}}return!0}(n,0,e)}}(t):function(t){return ua(t)?Aa(wa(t)):function(t){return function(e){return Ea(e,t)}}(t)}(t)},Ta=function(t,e){return(Ao(t)?Zo:Bi)(t,Ia(e))},Oa=Object.prototype.hasOwnProperty,Na=function(t,e){return null!=t&&Oa.call(t,e)},Da=function(t,e){return null!=t&&_a(t,e,Na)},Ma=Object.prototype.hasOwnProperty,ka=function(t){return void 0===t},Ra=function(t,e){var n=-1,r=Wo(t)?Array(t.length):[];return ji(t,(function(t,o,i){r[++n]=e(t,o,i)})),r},Ca=function(t,e){return(Ao(t)?pa:Ra)(t,Ia(e))},La=function(t,e,n,r){var o=-1,i=null==t?0:t.length;for(r&&i&&(n=t[++o]);++o<i;)n=e(n,t[o],o,t);return n},Pa=function(t,e,n,r,o){return o(t,(function(t,o,i){n=r?(r=!1,t):e(n,t,o,i)})),n},ja=function(t,e,n){var r=Ao(t)?La:Pa,o=arguments.length<3;return r(t,Ia(e),n,o,ji)},za=Aa("length"),Fa=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),Ga="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Ua="\\ud83c[\\udffb-\\udfff]",Ba="[^\\ud800-\\udfff]",Va="(?:\\ud83c[\\udde6-\\uddff]){2}",Wa="[\\ud800-\\udbff][\\udc00-\\udfff]",Xa="(?:"+Ga+"|"+Ua+")?",Ha="[\\ufe0e\\ufe0f]?"+Xa+"(?:\\u200d(?:"+[Ba,Va,Wa].join("|")+")[\\ufe0e\\ufe0f]?"+Xa+")*",qa="(?:"+[Ba+Ga+"?",Ga,Va,Wa,"[\\ud800-\\udfff]"].join("|")+")",Ya=RegExp(Ua+"(?="+Ua+")|"+qa+Ha,"g"),Ka=Cr?Cr.isConcatSpreadable:void 0,Za=function(t){return Ao(t)||So(t)||!!(Ka&&t&&t[Ka])},$a=function t(e,n,r,o,i){var a=-1,u=e.length;for(r||(r=Za),i||(i=[]);++a<u;){var s=e[a];n>0&&r(s)?n>1?t(s,n-1,r,o,i):ei(i,s):o||(i[i.length]=s)}return i},Qa=Math.max,Ja=function(t,e,n){return e=Qa(void 0===e?t.length-1:e,0),function(){for(var r=arguments,o=-1,i=Qa(r.length-e,0),a=Array(i);++o<i;)a[o]=r[e+o];o=-1;for(var u=Array(e+1);++o<e;)u[o]=r[o];return u[e]=n(a),function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}(t,this,u)}},tu=po?function(t,e){return po(t,"toString",{configurable:!0,enumerable:!1,value:Ci(e),writable:!0})}:zi,eu=Date.now,nu=function(t){var e=0,n=0;return function(){var r=eu(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(tu),ru=function(t,e){return nu(Ja(t,e,zi),t+"")},ou=function(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i<o;)if(e(t[i],i,t))return i;return-1},iu=function(t){return t!=t},au=function(t,e){return!(null==t||!t.length)&&function(t,e,n){return e==e?function(t,e,n){for(var r=-1,o=t.length;++r<o;)if(t[r]===e)return r;return-1}(t,e):ou(t,iu,0)}(t,e)>-1},uu=ci&&1/Ki(new ci([,-0]))[1]==1/0?function(t){return new ci(t)}:function(){},su=function(t){return bo(t)&&Wo(t)},cu=ru((function(t){return function(t,e,n){var r=-1,o=au,i=t.length,a=!0,u=[],s=u;if(i>=200){var c=uu(t);if(c)return Ki(c);a=!1,o=Hi,s=new Wi}else s=u;t:for(;++r<i;){var f=t[r],l=f;if(f=0!==f?f:0,a&&l==l){for(var d=s.length;d--;)if(s[d]===l)continue t;u.push(f)}else o(s,l,n)||(s!==u&&s.push(l),u.push(f))}return u}($a(t,1,su,!0))})),fu=function(t){return null==t?[]:function(t,e){return pa(e,(function(e){return t[e]}))}(t,Xo(t))};try{ca={clone:function(t){return Ri(t,4)},constant:Ci,each:Ui,filter:Ta,has:Da,isArray:Ao,isEmpty:function(t){if(null==t)return!0;if(Wo(t)&&(Ao(t)||"string"==typeof t||"function"==typeof t.splice||To(t)||Lo(t)||So(t)))return!t.length;var e=mi(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(Fo(t))return!Vo(t).length;for(var n in t)if(Ma.call(t,n))return!1;return!0},isFunction:Vr,isUndefined:ka,keys:Xo,map:Ca,reduce:ja,size:function(t){if(null==t)return 0;if(Wo(t))return function(t){return"string"==typeof t||!Ao(t)&&bo(t)&&"[object String]"==Ur(t)}(t)?function(t){return function(t){return Fa.test(t)}(t)?function(t){for(var e=Ya.lastIndex=0;Ya.test(t);)++e;return e}(t):za(t)}(t):t.length;var e=mi(t);return"[object Map]"==e||"[object Set]"==e?t.size:Vo(t).length},transform:function(t,e,n){var r=Ao(t),o=r||To(t)||Lo(t);if(e=Ia(e),null==n){var i=t&&t.constructor;n=o?r?new i:[]:Br(t)&&Vr(i)?Ii(ni(t)):{}}return(o?ho:Pi)(t,(function(t,r,o){return e(n,t,r,o)})),n},union:cu,values:fu}}catch(pr){}ca||(ca=window._);var lu=ca,du=hu;function hu(t){this._isDirected=!lu.has(t,"directed")||t.directed,this._isMultigraph=!!lu.has(t,"multigraph")&&t.multigraph,this._isCompound=!!lu.has(t,"compound")&&t.compound,this._label=void 0,this._defaultNodeLabelFn=lu.constant(void 0),this._defaultEdgeLabelFn=lu.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function pu(t,e){t[e]?t[e]++:t[e]=1}function vu(t,e){--t[e]||delete t[e]}function gu(t,e,n,r){var o=""+e,i=""+n;if(!t&&o>i){var a=o;o=i,i=a}return o+""+i+""+(lu.isUndefined(r)?"\0":r)}function mu(t,e){return gu(t,e.v,e.w,e.name)}hu.prototype._nodeCount=0,hu.prototype._edgeCount=0,hu.prototype.isDirected=function(){return this._isDirected},hu.prototype.isMultigraph=function(){return this._isMultigraph},hu.prototype.isCompound=function(){return this._isCompound},hu.prototype.setGraph=function(t){return this._label=t,this},hu.prototype.graph=function(){return this._label},hu.prototype.setDefaultNodeLabel=function(t){return lu.isFunction(t)||(t=lu.constant(t)),this._defaultNodeLabelFn=t,this},hu.prototype.nodeCount=function(){return this._nodeCount},hu.prototype.nodes=function(){return lu.keys(this._nodes)},hu.prototype.sources=function(){var t=this;return lu.filter(this.nodes(),(function(e){return lu.isEmpty(t._in[e])}))},hu.prototype.sinks=function(){var t=this;return lu.filter(this.nodes(),(function(e){return lu.isEmpty(t._out[e])}))},hu.prototype.setNodes=function(t,e){var n=arguments,r=this;return lu.each(t,(function(t){n.length>1?r.setNode(t,e):r.setNode(t)})),this},hu.prototype.setNode=function(t,e){return lu.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},hu.prototype.node=function(t){return this._nodes[t]},hu.prototype.hasNode=function(t){return lu.has(this._nodes,t)},hu.prototype.removeNode=function(t){var e=this;if(lu.has(this._nodes,t)){var n=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],lu.each(this.children(t),(function(t){e.setParent(t)})),delete this._children[t]),lu.each(lu.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],lu.each(lu.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},hu.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(lu.isUndefined(e))e="\0";else{for(var n=e+="";!lu.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},hu.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},hu.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if("\0"!==e)return e}},hu.prototype.children=function(t){if(lu.isUndefined(t)&&(t="\0"),this._isCompound){var e=this._children[t];if(e)return lu.keys(e)}else{if("\0"===t)return this.nodes();if(this.hasNode(t))return[]}},hu.prototype.predecessors=function(t){var e=this._preds[t];if(e)return lu.keys(e)},hu.prototype.successors=function(t){var e=this._sucs[t];if(e)return lu.keys(e)},hu.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return lu.union(e,this.successors(t))},hu.prototype.isLeaf=function(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length},hu.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var n=this;lu.each(this._nodes,(function(n,r){t(r)&&e.setNode(r,n)})),lu.each(this._edgeObjs,(function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,n.edge(t))}));var r={};function o(t){var i=n.parent(t);return void 0===i||e.hasNode(i)?(r[t]=i,i):i in r?r[i]:o(i)}return this._isCompound&&lu.each(e.nodes(),(function(t){e.setParent(t,o(t))})),e},hu.prototype.setDefaultEdgeLabel=function(t){return lu.isFunction(t)||(t=lu.constant(t)),this._defaultEdgeLabelFn=t,this},hu.prototype.edgeCount=function(){return this._edgeCount},hu.prototype.edges=function(){return lu.values(this._edgeObjs)},hu.prototype.setPath=function(t,e){var n=this,r=arguments;return lu.reduce(t,(function(t,o){return r.length>1?n.setEdge(t,o,e):n.setEdge(t,o),o})),this},hu.prototype.setEdge=function(){var t,e,n,r,o=!1,i=arguments[0];"object"==typeof i&&null!==i&&"v"in i?(t=i.v,e=i.w,n=i.name,2===arguments.length&&(r=arguments[1],o=!0)):(t=i,e=arguments[1],n=arguments[3],arguments.length>2&&(r=arguments[2],o=!0)),t=""+t,e=""+e,lu.isUndefined(n)||(n=""+n);var a=gu(this._isDirected,t,e,n);if(lu.has(this._edgeLabels,a))return o&&(this._edgeLabels[a]=r),this;if(!lu.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[a]=o?r:this._defaultEdgeLabelFn(t,e,n);var u=function(t,e,n,r){var o=""+e,i=""+n;if(!t&&o>i){var a=o;o=i,i=a}var u={v:o,w:i};return r&&(u.name=r),u}(this._isDirected,t,e,n);return t=u.v,e=u.w,Object.freeze(u),this._edgeObjs[a]=u,pu(this._preds[e],t),pu(this._sucs[t],e),this._in[e][a]=u,this._out[t][a]=u,this._edgeCount++,this},hu.prototype.edge=function(t,e,n){var r=1===arguments.length?mu(this._isDirected,arguments[0]):gu(this._isDirected,t,e,n);return this._edgeLabels[r]},hu.prototype.hasEdge=function(t,e,n){var r=1===arguments.length?mu(this._isDirected,arguments[0]):gu(this._isDirected,t,e,n);return lu.has(this._edgeLabels,r)},hu.prototype.removeEdge=function(t,e,n){var r=1===arguments.length?mu(this._isDirected,arguments[0]):gu(this._isDirected,t,e,n),o=this._edgeObjs[r];return o&&(t=o.v,e=o.w,delete this._edgeLabels[r],delete this._edgeObjs[r],vu(this._preds[e],t),vu(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this},hu.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var r=lu.values(n);return e?lu.filter(r,(function(t){return t.v===e})):r}},hu.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var r=lu.values(n);return e?lu.filter(r,(function(t){return t.w===e})):r}},hu.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))};var yu={Graph:du,version:"2.1.8"},bu={write:function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:wu(t),edges:Eu(t)};return lu.isUndefined(t.graph())||(e.value=lu.clone(t.graph())),e},read:function(t){var e=new du(t.options).setGraph(t.value);return lu.each(t.nodes,(function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)})),lu.each(t.edges,(function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)})),e}};function wu(t){return lu.map(t.nodes(),(function(e){var n=t.node(e),r=t.parent(e),o={v:e};return lu.isUndefined(n)||(o.value=n),lu.isUndefined(r)||(o.parent=r),o}))}function Eu(t){return lu.map(t.edges(),(function(e){var n=t.edge(e),r={v:e.v,w:e.w};return lu.isUndefined(e.name)||(r.name=e.name),lu.isUndefined(n)||(r.value=n),r}))}var xu=_u;function _u(){this._arr=[],this._keyIndices={}}_u.prototype.size=function(){return this._arr.length},_u.prototype.keys=function(){return this._arr.map((function(t){return t.key}))},_u.prototype.has=function(t){return lu.has(this._keyIndices,t)},_u.prototype.priority=function(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority},_u.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},_u.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!lu.has(n,t)){var r=this._arr,o=r.length;return n[t]=o,r.push({key:t,priority:e}),this._decrease(o),!0}return!1},_u.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},_u.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)},_u.prototype._heapify=function(t){var e=this._arr,n=2*t,r=n+1,o=t;n<e.length&&(o=e[n].priority<e[o].priority?n:o,r<e.length&&(o=e[r].priority<e[o].priority?r:o),o!==t&&(this._swap(t,o),this._heapify(o)))},_u.prototype._decrease=function(t){for(var e,n=this._arr,r=n[t].priority;0!==t&&!(n[e=t>>1].priority<r);)this._swap(t,e),t=e},_u.prototype._swap=function(t,e){var n=this._arr,r=this._keyIndices,o=n[t],i=n[e];n[t]=i,n[e]=o,r[i.key]=t,r[o.key]=e};var Su=function(t,e,n,r){return function(t,e,n,r){var o,i,a={},u=new xu,s=function(t){var e=t.v!==o?t.v:t.w,r=a[e],s=n(t),c=i.distance+s;if(s<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+t+" Weight: "+s);c<r.distance&&(r.distance=c,r.predecessor=o,u.decrease(e,c))};for(t.nodes().forEach((function(t){var n=t===e?0:Number.POSITIVE_INFINITY;a[t]={distance:n},u.add(t,n)}));u.size()>0&&(o=u.removeMin(),(i=a[o]).distance!==Number.POSITIVE_INFINITY);)r(o).forEach(s);return a}(t,String(e),n||Au,r||function(e){return t.outEdges(e)})},Au=lu.constant(1),Iu=function(t){var e=0,n=[],r={},o=[];function i(a){var u=r[a]={onStack:!0,lowlink:e,index:e++};if(n.push(a),t.successors(a).forEach((function(t){lu.has(r,t)?r[t].onStack&&(u.lowlink=Math.min(u.lowlink,r[t].index)):(i(t),u.lowlink=Math.min(u.lowlink,r[t].lowlink))})),u.lowlink===u.index){var s,c=[];do{s=n.pop(),r[s].onStack=!1,c.push(s)}while(a!==s);o.push(c)}}return t.nodes().forEach((function(t){lu.has(r,t)||i(t)})),o},Tu=lu.constant(1),Ou=Nu;function Nu(t){var e={},n={},r=[];if(lu.each(t.sinks(),(function o(i){if(lu.has(n,i))throw new Du;lu.has(e,i)||(n[i]=!0,e[i]=!0,lu.each(t.predecessors(i),o),delete n[i],r.push(i))})),lu.size(e)!==t.nodeCount())throw new Du;return r}function Du(){}Nu.CycleException=Du,Du.prototype=new Error;var Mu=function(t,e,n){lu.isArray(e)||(e=[e]);var r=(t.isDirected()?t.successors:t.neighbors).bind(t),o=[],i={};return lu.each(e,(function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);ku(t,e,"post"===n,i,r,o)})),o};function ku(t,e,n,r,o,i){lu.has(r,e)||(r[e]=!0,n||i.push(e),lu.each(o(e),(function(e){ku(t,e,n,r,o,i)})),n&&i.push(e))}var Ru,Cu={Graph:yu.Graph,json:bu,alg:{components:function(t){var e,n={},r=[];function o(r){lu.has(n,r)||(n[r]=!0,e.push(r),lu.each(t.successors(r),o),lu.each(t.predecessors(r),o))}return lu.each(t.nodes(),(function(t){e=[],o(t),e.length&&r.push(e)})),r},dijkstra:Su,dijkstraAll:function(t,e,n){return lu.transform(t.nodes(),(function(r,o){r[o]=Su(t,o,e,n)}),{})},findCycles:function(t){return lu.filter(Iu(t),(function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])}))},floydWarshall:function(t,e,n){return function(t,e,n){var r={},o=t.nodes();return o.forEach((function(t){r[t]={},r[t][t]={distance:0},o.forEach((function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})})),n(t).forEach((function(n){var o=n.v===t?n.w:n.v,i=e(n);r[t][o]={distance:i,predecessor:t}}))})),o.forEach((function(t){var e=r[t];o.forEach((function(n){var i=r[n];o.forEach((function(n){var r=i[t],o=e[n],a=i[n],u=r.distance+o.distance;u<a.distance&&(a.distance=u,a.predecessor=o.predecessor)}))}))})),r}(t,e||Tu,n||function(e){return t.outEdges(e)})},isAcyclic:function(t){try{Ou(t)}catch(t){if(t instanceof Ou.CycleException)return!1;throw t}return!0},postorder:function(t,e){return Mu(t,e,"post")},preorder:function(t,e){return Mu(t,e,"pre")},prim:function(t,e){var n,r=new du,o={},i=new xu;function a(t){var r=t.v===n?t.w:t.v,a=i.priority(r);if(void 0!==a){var u=e(t);u<a&&(o[r]=n,i.decrease(r,u))}}if(0===t.nodeCount())return r;lu.each(t.nodes(),(function(t){i.add(t,Number.POSITIVE_INFINITY),r.setNode(t)})),i.decrease(t.nodes()[0],0);for(var u=!1;i.size()>0;){if(n=i.removeMin(),lu.has(o,n))r.setEdge(n,o[n]);else{if(u)throw new Error("Input graph is not connected: "+t);u=!0}t.nodeEdges(n).forEach(a)}return r},tarjan:Iu,topsort:Ou},version:yu.version};try{Ru=Cu}catch(pr){}Ru||(Ru=window.graphlib);var Lu,Pu=Ru,ju=function(t,e,n){if(!Br(n))return!1;var r=typeof e;return!!("number"==r?Wo(n)&&No(e,n.length):"string"==r&&e in n)&&Ar(n[e],t)},zu=Object.prototype,Fu=zu.hasOwnProperty,Gu=ru((function(t,e){t=Object(t);var n=-1,r=e.length,o=r>2?e[2]:void 0;for(o&&ju(e[0],e[1],o)&&(r=1);++n<r;)for(var i=e[n],a=qo(i),u=-1,s=a.length;++u<s;){var c=a[u],f=t[c];(void 0===f||Ar(f,zu[c])&&!Fu.call(t,c))&&(t[c]=i[c])}return t})),Uu=/^\s+|\s+$/g,Bu=/^[-+]0x[0-9a-f]+$/i,Vu=/^0b[01]+$/i,Wu=/^0o[0-7]+$/i,Xu=parseInt,Hu=function(t){return t?1/0===(t=function(t){if("number"==typeof t)return t;if(oa(t))return NaN;if(Br(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Br(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(Uu,"");var n=Vu.test(t);return n||Wu.test(t)?Xu(t.slice(2),n?2:8):Bu.test(t)?NaN:+t}(t))||-1/0===t?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0},qu=Math.max,Yu=function(t,e,n){var r=Object(t);if(!Wo(t)){var o=Ia(e);t=Xo(t),e=function(t){return o(r[t],t,r)}}var i=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:function(t){var e=Hu(t),n=e%1;return e==e?n?e-n:e:0}(n);return o<0&&(o=qu(r+o,0)),ou(t,Ia(e),o)}(t,e,n);return i>-1?r[o?t[i]:i]:void 0},Ku=function(t){return null!=t&&t.length?$a(t,1):[]},Zu=function(t,e,n){for(var r=-1,o=t.length;++r<o;){var i=t[r],a=e(i);if(null!=a&&(void 0===u?a==a&&!oa(a):n(a,u)))var u=a,s=i}return s},$u=function(t,e){return t>e},Qu=function(t,e,n){(void 0!==n&&!Ar(t[e],n)||void 0===n&&!(e in t))&&vo(t,e,n)},Ju=Function.prototype,ts=Object.prototype,es=Ju.toString,ns=ts.hasOwnProperty,rs=es.call(Object),os=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]},is=function t(e,n,r,o,i){e!==n&&Li(n,(function(a,u){if(i||(i=new lo),Br(a))!function(t,e,n,r,o,i,a){var u=os(t,n),s=os(e,n),c=a.get(s);if(c)Qu(t,n,c);else{var f=i?i(u,s,n+"",t,e,a):void 0,l=void 0===f;if(l){var d=Ao(s),h=!d&&To(s),p=!d&&!h&&Lo(s);f=s,d||h||p?Ao(u)?f=u:su(u)?f=Ko(u):h?(l=!1,f=Yo(s,!0)):p?(l=!1,f=Si(s,!0)):f=[]:function(t){if(!bo(t)||"[object Object]"!=Ur(t))return!1;var e=ni(t);if(null===e)return!0;var n=ns.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&es.call(n)==rs}(s)||So(s)?(f=u,So(u)?f=function(t){return yo(t,qo(t))}(u):Br(u)&&!Vr(u)||(f=Ti(s))):l=!1}l&&(a.set(s,f),o(f,s,r,i,a),a.delete(s)),Qu(t,n,f)}}(e,n,u,r,t,o,i);else{var s=o?o(os(e,u),a,u+"",e,n,i):void 0;void 0===s&&(s=a),Qu(e,u,s)}}),qo)},as=function(t){return ru((function(e,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(i=t.length>3&&"function"==typeof i?(o--,i):void 0,a&&ju(n[0],n[1],a)&&(i=o<3?void 0:i,o=1),e=Object(e);++r<o;){var u=n[r];u&&t(e,u,r)}return e}))}((function(t,e,n){is(t,e,n)})),us=function(t,e){return t<e},ss=function(t,e,n,r){if(!Br(t))return t;for(var o=-1,i=(e=ba(e,t)).length,a=i-1,u=t;null!=u&&++o<i;){var s=wa(e[o]),c=n;if("__proto__"===s||"constructor"===s||"prototype"===s)return t;if(o!=a){var f=u[s];void 0===(c=r?r(f,s,u):void 0)&&(c=Br(f)?f:No(e[o+1])?[]:{})}mo(u,s,c),u=u[s]}return t},cs=function(t){return nu(Ja(t,void 0,Ku),t+"")}((function(t,e){return null==t?{}:function(t,e){return function(t,e,n){for(var r=-1,o=e.length,i={};++r<o;){var a=e[r],u=Ea(t,a);n(0,a)&&ss(i,ba(a,t),u)}return i}(t,e,(function(e,n){return Sa(t,n)}))}(t,e)})),fs=Math.ceil,ls=Math.max,ds=function(t,e){if(t!==e){var n=void 0!==t,r=null===t,o=t==t,i=oa(t),a=void 0!==e,u=null===e,s=e==e,c=oa(e);if(!u&&!c&&!i&&t>e||i&&a&&s&&!u&&!c||r&&a&&s||!n&&s||!o)return 1;if(!r&&!i&&!c&&t<e||c&&n&&o&&!r&&!i||u&&n&&o||!a&&o||!s)return-1}return 0},hs=ru((function(t,e){if(null==t)return[];var n=e.length;return n>1&&ju(t,e[0],e[1])?e=[]:n>2&&ju(e[0],e[1],e[2])&&(e=[e[0]]),function(t,e,n){e=e.length?pa(e,(function(t){return Ao(t)?function(e){return Ea(e,1===t.length?t[0]:t)}:t})):[zi];var r=-1;e=pa(e,ko(Ia));var o=Ra(t,(function(t,n,o){return{criteria:pa(e,(function(e){return e(t)})),index:++r,value:t}}));return function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(o,(function(t,e){return function(t,e,n){for(var r=-1,o=t.criteria,i=e.criteria,a=o.length,u=n.length;++r<a;){var s=ds(o[r],i[r]);if(s)return r>=u?s:s*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}(t,$a(e,1),[])})),ps=0;try{Lu={cloneDeep:function(t){return Ri(t,5)},constant:Ci,defaults:Gu,each:Ui,filter:Ta,find:Yu,flatten:Ku,forEach:Gi,forIn:function(t,e){return null==t?t:Li(t,Fi(e),qo)},has:Da,isUndefined:ka,last:function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0},map:Ca,mapValues:function(t,e){var n={};return e=Ia(e),Pi(t,(function(t,r,o){vo(n,r,e(t,r,o))})),n},max:function(t){return t&&t.length?Zu(t,zi,$u):void 0},merge:as,min:function(t){return t&&t.length?Zu(t,zi,us):void 0},minBy:function(t,e){return t&&t.length?Zu(t,Ia(e),us):void 0},now:function(){return Rr.Date.now()},pick:cs,range:function(t,e,n){return n&&"number"!=typeof n&&ju(t,e,n)&&(e=n=void 0),t=Hu(t),void 0===e?(e=t,t=0):e=Hu(e),function(t,e,n,r){for(var o=-1,i=ls(fs((e-t)/(n||1)),0),a=Array(i);i--;)a[++o]=t,t+=n;return a}(t,e,n=void 0===n?t<e?1:-1:Hu(n))},reduce:ja,sortBy:hs,uniqueId:function(t){var e=++ps;return ya(t)+e},values:fu,zipObject:function(t,e){return function(t,e,n){for(var r=-1,o=t.length,i=e.length,a={};++r<o;){var u=r<i?e[r]:void 0;n(a,t[r],u)}return a}(t||[],e||[],mo)}}}catch(pr){}Lu||(Lu=window._);var vs=Lu,gs=ms;function ms(){var t={};t._next=t._prev=t,this._sentinel=t}function ys(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function bs(t,e){if("_next"!==t&&"_prev"!==t)return e}ms.prototype.dequeue=function(){var t=this._sentinel,e=t._prev;if(e!==t)return ys(e),e},ms.prototype.enqueue=function(t){var e=this._sentinel;t._prev&&t._next&&ys(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e},ms.prototype.toString=function(){for(var t=[],e=this._sentinel,n=e._prev;n!==e;)t.push(JSON.stringify(n,bs)),n=n._prev;return"["+t.join(", ")+"]"};var ws=Pu.Graph,Es=vs.constant(1);function xs(t,e,n,r,o){var i=o?[]:void 0;return vs.forEach(t.inEdges(r.v),(function(r){var a=t.edge(r),u=t.node(r.v);o&&i.push({v:r.v,w:r.w}),u.out-=a,_s(e,n,u)})),vs.forEach(t.outEdges(r.v),(function(r){var o=t.edge(r),i=r.w,a=t.node(i);a.in-=o,_s(e,n,a)})),t.removeNode(r.v),i}function _s(t,e,n){n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)}var Ss=Pu.Graph,As={addDummyNode:Is,simplify:function(t){var e=(new Ss).setGraph(t.graph());return vs.forEach(t.nodes(),(function(n){e.setNode(n,t.node(n))})),vs.forEach(t.edges(),(function(n){var r=e.edge(n.v,n.w)||{weight:0,minlen:1},o=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})})),e},asNonCompoundGraph:function(t){var e=new Ss({multigraph:t.isMultigraph()}).setGraph(t.graph());return vs.forEach(t.nodes(),(function(n){t.children(n).length||e.setNode(n,t.node(n))})),vs.forEach(t.edges(),(function(n){e.setEdge(n,t.edge(n))})),e},successorWeights:function(t){var e=vs.map(t.nodes(),(function(e){var n={};return vs.forEach(t.outEdges(e),(function(e){n[e.w]=(n[e.w]||0)+t.edge(e).weight})),n}));return vs.zipObject(t.nodes(),e)},predecessorWeights:function(t){var e=vs.map(t.nodes(),(function(e){var n={};return vs.forEach(t.inEdges(e),(function(e){n[e.v]=(n[e.v]||0)+t.edge(e).weight})),n}));return vs.zipObject(t.nodes(),e)},intersectRect:function(t,e){var n,r,o=t.x,i=t.y,a=e.x-o,u=e.y-i,s=t.width/2,c=t.height/2;if(!a&&!u)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(u)*s>Math.abs(a)*c?(u<0&&(c=-c),n=c*a/u,r=c):(a<0&&(s=-s),n=s,r=s*u/a),{x:o+n,y:i+r}},buildLayerMatrix:function(t){var e=vs.map(vs.range(Ts(t)+1),(function(){return[]}));return vs.forEach(t.nodes(),(function(n){var r=t.node(n),o=r.rank;vs.isUndefined(o)||(e[o][r.order]=n)})),e},normalizeRanks:function(t){var e=vs.min(vs.map(t.nodes(),(function(e){return t.node(e).rank})));vs.forEach(t.nodes(),(function(n){var r=t.node(n);vs.has(r,"rank")&&(r.rank-=e)}))},removeEmptyRanks:function(t){var e=vs.min(vs.map(t.nodes(),(function(e){return t.node(e).rank}))),n=[];vs.forEach(t.nodes(),(function(r){var o=t.node(r).rank-e;n[o]||(n[o]=[]),n[o].push(r)}));var r=0,o=t.graph().nodeRankFactor;vs.forEach(n,(function(e,n){vs.isUndefined(e)&&n%o!=0?--r:r&&vs.forEach(e,(function(e){t.node(e).rank+=r}))}))},addBorderNode:function(t,e,n,r){var o={width:0,height:0};return arguments.length>=4&&(o.rank=n,o.order=r),Is(t,"border",o,e)},maxRank:Ts,partition:function(t,e){var n={lhs:[],rhs:[]};return vs.forEach(t,(function(t){e(t)?n.lhs.push(t):n.rhs.push(t)})),n},time:function(t,e){var n=vs.now();try{return e()}finally{console.log(t+" time: "+(vs.now()-n)+"ms")}},notime:function(t,e){return e()}};function Is(t,e,n,r){var o;do{o=vs.uniqueId(r)}while(t.hasNode(o));return n.dummy=e,t.setNode(o,n),o}function Ts(t){return vs.max(vs.map(t.nodes(),(function(e){var n=t.node(e).rank;if(!vs.isUndefined(n))return n})))}var Os=function(t){var e={};vs.forEach(t.sources(),(function n(r){var o=t.node(r);if(vs.has(e,r))return o.rank;e[r]=!0;var i=vs.min(vs.map(t.outEdges(r),(function(e){return n(e.w)-t.edge(e).minlen})));return i!==Number.POSITIVE_INFINITY&&null!=i||(i=0),o.rank=i}))},Ns=function(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen},Ds=Pu.Graph,Ms=Ns,ks=function(t){var e,n,r=new Ds({directed:!1}),o=t.nodes()[0],i=t.nodeCount();for(r.setNode(o,{});Rs(r,t)<i;)e=Cs(r,t),n=r.hasNode(e.v)?Ms(t,e):-Ms(t,e),Ls(r,t,n);return r};function Rs(t,e){return vs.forEach(t.nodes(),(function n(r){vs.forEach(e.nodeEdges(r),(function(o){var i=o.v,a=r===i?o.w:i;t.hasNode(a)||Ms(e,o)||(t.setNode(a,{}),t.setEdge(r,a,{}),n(a))}))})),t.nodeCount()}function Cs(t,e){return vs.minBy(e.edges(),(function(n){if(t.hasNode(n.v)!==t.hasNode(n.w))return Ms(e,n)}))}function Ls(t,e,n){vs.forEach(t.nodes(),(function(t){e.node(t).rank+=n}))}var Ps=Ns,js=Os,zs=Pu.alg.preorder,Fs=Pu.alg.postorder,Gs=As.simplify,Us=Bs;function Bs(t){t=Gs(t),js(t);var e,n=ks(t);for(Xs(n),Vs(n,t);e=qs(n);)Ks(n,t,e,Ys(n,t,e))}function Vs(t,e){var n=Fs(t,t.nodes());n=n.slice(0,n.length-1),vs.forEach(n,(function(n){!function(t,e,n){var r=t.node(n).parent;t.edge(n,r).cutvalue=Ws(t,e,n)}(t,e,n)}))}function Ws(t,e,n){var r=t.node(n).parent,o=!0,i=e.edge(n,r),a=0;return i||(o=!1,i=e.edge(r,n)),a=i.weight,vs.forEach(e.nodeEdges(n),(function(i){var u,s,c=i.v===n,f=c?i.w:i.v;if(f!==r){var l=c===o,d=e.edge(i).weight;if(a+=l?d:-d,u=n,s=f,t.hasEdge(u,s)){var h=t.edge(n,f).cutvalue;a+=l?-h:h}}})),a}function Xs(t,e){arguments.length<2&&(e=t.nodes()[0]),Hs(t,{},1,e)}function Hs(t,e,n,r,o){var i=n,a=t.node(r);return e[r]=!0,vs.forEach(t.neighbors(r),(function(o){vs.has(e,o)||(n=Hs(t,e,n,o,r))})),a.low=i,a.lim=n++,o?a.parent=o:delete a.parent,n}function qs(t){return vs.find(t.edges(),(function(e){return t.edge(e).cutvalue<0}))}function Ys(t,e,n){var r=n.v,o=n.w;e.hasEdge(r,o)||(r=n.w,o=n.v);var i=t.node(r),a=t.node(o),u=i,s=!1;i.lim>a.lim&&(u=a,s=!0);var c=vs.filter(e.edges(),(function(e){return s===Zs(0,t.node(e.v),u)&&s!==Zs(0,t.node(e.w),u)}));return vs.minBy(c,(function(t){return Ps(e,t)}))}function Ks(t,e,n,r){var o=n.v,i=n.w;t.removeEdge(o,i),t.setEdge(r.v,r.w,{}),Xs(t),Vs(t,e),function(t,e){var n=vs.find(t.nodes(),(function(t){return!e.node(t).parent})),r=zs(t,n);r=r.slice(1),vs.forEach(r,(function(n){var r=t.node(n).parent,o=e.edge(n,r),i=!1;o||(o=e.edge(r,n),i=!0),e.node(n).rank=e.node(r).rank+(i?o.minlen:-o.minlen)}))}(t,e)}function Zs(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}Bs.initLowLimValues=Xs,Bs.initCutValues=Vs,Bs.calcCutValue=Ws,Bs.leaveEdge=qs,Bs.enterEdge=Ys,Bs.exchangeEdges=Ks;var $s=Os,Qs=$s;var Js=function(t){var e=As.addDummyNode(t,"root",{},"_root"),n=function(t){var e={};function n(r,o){var i=t.children(r);i&&i.length&&vs.forEach(i,(function(t){n(t,o+1)})),e[r]=o}return vs.forEach(t.children(),(function(t){n(t,1)})),e}(t),r=vs.max(vs.values(n))-1,o=2*r+1;t.graph().nestingRoot=e,vs.forEach(t.edges(),(function(e){t.edge(e).minlen*=o}));var i=function(t){return vs.reduce(t.edges(),(function(e,n){return e+t.edge(n).weight}),0)}(t)+1;vs.forEach(t.children(),(function(a){tc(t,e,o,i,r,n,a)})),t.graph().nodeRankFactor=o};function tc(t,e,n,r,o,i,a){var u=t.children(a);if(u.length){var s=As.addBorderNode(t,"_bt"),c=As.addBorderNode(t,"_bb"),f=t.node(a);t.setParent(s,a),f.borderTop=s,t.setParent(c,a),f.borderBottom=c,vs.forEach(u,(function(u){tc(t,e,n,r,o,i,u);var f=t.node(u),l=f.borderTop?f.borderTop:u,d=f.borderBottom?f.borderBottom:u,h=f.borderTop?r:2*r,p=l!==d?1:o-i[a]+1;t.setEdge(s,l,{weight:h,minlen:p,nestingEdge:!0}),t.setEdge(d,c,{weight:h,minlen:p,nestingEdge:!0})})),t.parent(a)||t.setEdge(e,s,{weight:0,minlen:o+i[a]})}else a!==e&&t.setEdge(e,a,{weight:0,minlen:n})}function ec(t,e,n,r,o,i){var a={width:0,height:0,rank:i,borderType:e},u=o[e][i-1],s=As.addDummyNode(t,"border",a,n);o[e][i]=s,t.setParent(s,r),u&&t.setEdge(u,s,{weight:1})}function nc(t){vs.forEach(t.nodes(),(function(e){rc(t.node(e))})),vs.forEach(t.edges(),(function(e){rc(t.edge(e))}))}function rc(t){var e=t.width;t.width=t.height,t.height=e}function oc(t){t.y=-t.y}function ic(t){var e=t.x;t.x=t.y,t.y=e}var ac=function(t,e){for(var n=0,r=1;r<e.length;++r)n+=uc(t,e[r-1],e[r]);return n};function uc(t,e,n){for(var r=vs.zipObject(n,vs.map(n,(function(t,e){return e}))),o=vs.flatten(vs.map(e,(function(e){return vs.sortBy(vs.map(t.outEdges(e),(function(e){return{pos:r[e.w],weight:t.edge(e).weight}})),"pos")})),!0),i=1;i<n.length;)i<<=1;var a=2*i-1;i-=1;var u=vs.map(new Array(a),(function(){return 0})),s=0;return vs.forEach(o.forEach((function(t){var e=t.pos+i;u[e]+=t.weight;for(var n=0;e>0;)e%2&&(n+=u[e+1]),u[e=e-1>>1]+=t.weight;s+=t.weight*n}))),s}function sc(t,e,n){for(var r;e.length&&(r=vs.last(e)).i<=n;)e.pop(),t.push(r.vs),n++;return n}var cc=function t(e,n,r,o){var i=e.children(n),a=e.node(n),u=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,c={};u&&(i=vs.filter(i,(function(t){return t!==u&&t!==s})));var f=function(t,e){return vs.map(e,(function(e){var n=t.inEdges(e);if(n.length){var r=vs.reduce(n,(function(e,n){var r=t.edge(n),o=t.node(n.v);return{sum:e.sum+r.weight*o.order,weight:e.weight+r.weight}}),{sum:0,weight:0});return{v:e,barycenter:r.sum/r.weight,weight:r.weight}}return{v:e}}))}(e,i);vs.forEach(f,(function(n){if(e.children(n.v).length){var i=t(e,n.v,r,o);c[n.v]=i,vs.has(i,"barycenter")&&(a=n,u=i,vs.isUndefined(a.barycenter)?(a.barycenter=u.barycenter,a.weight=u.weight):(a.barycenter=(a.barycenter*a.weight+u.barycenter*u.weight)/(a.weight+u.weight),a.weight+=u.weight))}var a,u}));var l=function(t,e){var n={};return vs.forEach(t,(function(t,e){var r=n[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};vs.isUndefined(t.barycenter)||(r.barycenter=t.barycenter,r.weight=t.weight)})),vs.forEach(e.edges(),(function(t){var e=n[t.v],r=n[t.w];vs.isUndefined(e)||vs.isUndefined(r)||(r.indegree++,e.out.push(n[t.w]))})),function(t){var e=[];function n(t){return function(e){e.merged||(vs.isUndefined(e.barycenter)||vs.isUndefined(t.barycenter)||e.barycenter>=t.barycenter)&&function(t,e){var n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}(t,e)}}function r(e){return function(n){n.in.push(e),0==--n.indegree&&t.push(n)}}for(;t.length;){var o=t.pop();e.push(o),vs.forEach(o.in.reverse(),n(o)),vs.forEach(o.out,r(o))}return vs.map(vs.filter(e,(function(t){return!t.merged})),(function(t){return vs.pick(t,["vs","i","barycenter","weight"])}))}(vs.filter(n,(function(t){return!t.indegree})))}(f,r);!function(t,e){vs.forEach(t,(function(t){t.vs=vs.flatten(t.vs.map((function(t){return e[t]?e[t].vs:t})),!0)}))}(l,c);var d=function(t,e){var n,r=As.partition(t,(function(t){return vs.has(t,"barycenter")})),o=r.lhs,i=vs.sortBy(r.rhs,(function(t){return-t.i})),a=[],u=0,s=0,c=0;o.sort((n=!!e,function(t,e){return t.barycenter<e.barycenter?-1:t.barycenter>e.barycenter?1:n?e.i-t.i:t.i-e.i})),c=sc(a,i,c),vs.forEach(o,(function(t){c+=t.vs.length,a.push(t.vs),u+=t.barycenter*t.weight,s+=t.weight,c=sc(a,i,c)}));var f={vs:vs.flatten(a,!0)};return s&&(f.barycenter=u/s,f.weight=s),f}(l,o);if(u&&(d.vs=vs.flatten([u,d.vs,s],!0),e.predecessors(u).length)){var h=e.node(e.predecessors(u)[0]),p=e.node(e.predecessors(s)[0]);vs.has(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+h.order+p.order)/(d.weight+2),d.weight+=2}return d},fc=Pu.Graph,lc=Pu.Graph;function dc(t,e,n){return vs.map(e,(function(e){return function(t,e,n){var r=function(t){for(var e;t.hasNode(e=vs.uniqueId("_root")););return e}(t),o=new fc({compound:!0}).setGraph({root:r}).setDefaultNodeLabel((function(e){return t.node(e)}));return vs.forEach(t.nodes(),(function(i){var a=t.node(i),u=t.parent(i);(a.rank===e||a.minRank<=e&&e<=a.maxRank)&&(o.setNode(i),o.setParent(i,u||r),vs.forEach(t[n](i),(function(e){var n=e.v===i?e.w:e.v,r=o.edge(n,i),a=vs.isUndefined(r)?0:r.weight;o.setEdge(n,i,{weight:t.edge(e).weight+a})})),vs.has(a,"minRank")&&o.setNode(i,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))})),o}(t,e,n)}))}function hc(t,e){var n=new lc;vs.forEach(t,(function(t){var r=t.graph().root,o=cc(t,r,n,e);vs.forEach(o.vs,(function(e,n){t.node(e).order=n})),function(t,e,n){var r,o={};vs.forEach(n,(function(n){for(var i,a,u=t.parent(n);u;){if((i=t.parent(u))?(a=o[i],o[i]=u):(a=r,r=u),a&&a!==u)return void e.setEdge(a,u);u=i}}))}(t,n,o.vs)}))}function pc(t,e){vs.forEach(e,(function(e){vs.forEach(e,(function(e,n){t.node(e).order=n}))}))}var vc=Pu.Graph;function gc(t,e,n){if(e>n){var r=e;e=n,n=r}var o=t[e];o||(t[e]=o={}),o[n]=!0}function mc(t,e,n){if(e>n){var r=e;e=n,n=r}return vs.has(t[e],n)}var yc=As.normalizeRanks,bc=As.removeEmptyRanks,wc=As,Ec=Pu.Graph,xc=["nodesep","edgesep","ranksep","marginx","marginy"],_c={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Sc=["acyclicer","ranker","rankdir","align"],Ac=["width","height"],Ic={width:0,height:0},Tc=["minlen","weight","width","height","labeloffset"],Oc={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Nc=["labelpos"];function Dc(t,e){return vs.mapValues(vs.pick(t,e),Number)}function Mc(t){var e={};return vs.forEach(t,(function(t,n){e[n.toLowerCase()]=t})),e}var kc=Pu.Graph,Rc={graphlib:Pu,layout:function(t,e){var n=e&&e.debugTiming?wc.time:wc.notime;n("layout",(function(){var e=n(" buildLayoutGraph",(function(){return function(t){var e=new Ec({multigraph:!0,compound:!0}),n=Mc(t.graph());return e.setGraph(vs.merge({},_c,Dc(n,xc),vs.pick(n,Sc))),vs.forEach(t.nodes(),(function(n){var r=Mc(t.node(n));e.setNode(n,vs.defaults(Dc(r,Ac),Ic)),e.setParent(n,t.parent(n))})),vs.forEach(t.edges(),(function(n){var r=Mc(t.edge(n));e.setEdge(n,vs.merge({},Oc,Dc(r,Tc),vs.pick(r,Nc)))})),e}(t)}));n(" runLayout",(function(){!function(t,e){e(" makeSpaceForEdgeLabels",(function(){!function(t){var e=t.graph();e.ranksep/=2,vs.forEach(t.edges(),(function(n){var r=t.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(t)})),e(" removeSelfEdges",(function(){!function(t){vs.forEach(t.edges(),(function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}}))}(t)})),e(" acyclic",(function(){!function(t){var e="greedy"===t.graph().acyclicer?function(t,e){if(t.nodeCount()<=1)return[];var n=function(t,e){var n=new ws,r=0,o=0;vs.forEach(t.nodes(),(function(t){n.setNode(t,{v:t,in:0,out:0})})),vs.forEach(t.edges(),(function(t){var i=n.edge(t.v,t.w)||0,a=e(t),u=i+a;n.setEdge(t.v,t.w,u),o=Math.max(o,n.node(t.v).out+=a),r=Math.max(r,n.node(t.w).in+=a)}));var i=vs.range(o+r+3).map((function(){return new gs})),a=r+1;return vs.forEach(n.nodes(),(function(t){_s(i,a,n.node(t))})),{graph:n,buckets:i,zeroIdx:a}}(t,e||Es),r=function(t,e,n){for(var r,o=[],i=e[e.length-1],a=e[0];t.nodeCount();){for(;r=a.dequeue();)xs(t,e,n,r);for(;r=i.dequeue();)xs(t,e,n,r);if(t.nodeCount())for(var u=e.length-2;u>0;--u)if(r=e[u].dequeue()){o=o.concat(xs(t,e,n,r,!0));break}}return o}(n.graph,n.buckets,n.zeroIdx);return vs.flatten(vs.map(r,(function(e){return t.outEdges(e.v,e.w)})),!0)}(t,function(t){return function(e){return t.edge(e).weight}}(t)):function(t){var e=[],n={},r={};return vs.forEach(t.nodes(),(function o(i){vs.has(r,i)||(r[i]=!0,n[i]=!0,vs.forEach(t.outEdges(i),(function(t){vs.has(n,t.w)?e.push(t):o(t.w)})),delete n[i])})),e}(t);vs.forEach(e,(function(e){var n=t.edge(e);t.removeEdge(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,vs.uniqueId("rev"))}))}(t)})),e(" nestingGraph.run",(function(){Js(t)})),e(" rank",(function(){!function(t){switch(t.graph().ranker){case"network-simplex":default:!function(t){Us(t)}(t);break;case"tight-tree":!function(t){$s(t),ks(t)}(t);break;case"longest-path":Qs(t)}}(wc.asNonCompoundGraph(t))})),e(" injectEdgeLabelProxies",(function(){!function(t){vs.forEach(t.edges(),(function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),o={rank:(t.node(e.w).rank-r.rank)/2+r.rank,e};wc.addDummyNode(t,"edge-proxy",o,"_ep")}}))}(t)})),e(" removeEmptyRanks",(function(){bc(t)})),e(" nestingGraph.cleanup",(function(){!function(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,vs.forEach(t.edges(),(function(e){t.edge(e).nestingEdge&&t.removeEdge(e)}))}(t)})),e(" normalizeRanks",(function(){yc(t)})),e(" assignRankMinMax",(function(){!function(t){var e=0;vs.forEach(t.nodes(),(function(n){var r=t.node(n);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,e=vs.max(e,r.maxRank))})),t.graph().maxRank=e}(t)})),e(" removeEdgeLabelProxies",(function(){!function(t){vs.forEach(t.nodes(),(function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))}))}(t)})),e(" normalize.run",(function(){!function(t){t.graph().dummyChains=[],vs.forEach(t.edges(),(function(e){!function(t,e){var n,r,o,i=e.v,a=t.node(i).rank,u=e.w,s=t.node(u).rank,c=e.name,f=t.edge(e),l=f.labelRank;if(s!==a+1){for(t.removeEdge(e),o=0,++a;a<s;++o,++a)f.points=[],r={width:0,height:0,edgeLabel:f,edgeObj:e,rank:a},n=As.addDummyNode(t,"edge",r,"_d"),a===l&&(r.width=f.width,r.height=f.height,r.dummy="edge-label",r.labelpos=f.labelpos),t.setEdge(i,n,{weight:f.weight},c),0===o&&t.graph().dummyChains.push(n),i=n;t.setEdge(i,u,{weight:f.weight},c)}}(t,e)}))}(t)})),e(" parentDummyChains",(function(){!function(t){var e=function(t){var e={},n=0;return vs.forEach(t.children(),(function r(o){var i=n;vs.forEach(t.children(o),r),e[o]={low:i,lim:n++}})),e}(t);vs.forEach(t.graph().dummyChains,(function(n){for(var r=t.node(n),o=r.edgeObj,i=function(t,e,n,r){var o,i,a=[],u=[],s=Math.min(e[n].low,e[r].low),c=Math.max(e[n].lim,e[r].lim);o=n;do{o=t.parent(o),a.push(o)}while(o&&(e[o].low>s||c>e[o].lim));for(i=o,o=r;(o=t.parent(o))!==i;)u.push(o);return{path:a.concat(u.reverse()),lca:i}}(t,e,o.v,o.w),a=i.path,u=i.lca,s=0,c=a[s],f=!0;n!==o.w;){if(r=t.node(n),f){for(;(c=a[s])!==u&&t.node(c).maxRank<r.rank;)s++;c===u&&(f=!1)}if(!f){for(;s<a.length-1&&t.node(c=a[s+1]).minRank<=r.rank;)s++;c=a[s]}t.setParent(n,c),n=t.successors(n)[0]}}))}(t)})),e(" addBorderSegments",(function(){!function(t){vs.forEach(t.children(),(function e(n){var r=t.children(n),o=t.node(n);if(r.length&&vs.forEach(r,e),vs.has(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,a=o.maxRank+1;i<a;++i)ec(t,"borderLeft","_bl",n,o,i),ec(t,"borderRight","_br",n,o,i)}}))}(t)})),e(" order",(function(){!function(t){var e=As.maxRank(t),n=dc(t,vs.range(1,e+1),"inEdges"),r=dc(t,vs.range(e-1,-1,-1),"outEdges"),o=function(t){var e={},n=vs.filter(t.nodes(),(function(e){return!t.children(e).length})),r=vs.max(vs.map(n,(function(e){return t.node(e).rank}))),o=vs.map(vs.range(r+1),(function(){return[]})),i=vs.sortBy(n,(function(e){return t.node(e).rank}));return vs.forEach(i,(function n(r){if(!vs.has(e,r)){e[r]=!0;var i=t.node(r);o[i.rank].push(r),vs.forEach(t.successors(r),n)}})),o}(t);pc(t,o);for(var i,a=Number.POSITIVE_INFINITY,u=0,s=0;s<4;++u,++s){hc(u%2?n:r,u%4>=2),o=As.buildLayerMatrix(t);var c=ac(t,o);c<a&&(s=0,i=vs.cloneDeep(o),a=c)}pc(t,i)}(t)})),e(" insertSelfEdges",(function(){!function(t){var e=wc.buildLayerMatrix(t);vs.forEach(e,(function(e){var n=0;vs.forEach(e,(function(e,r){var o=t.node(e);o.order=r+n,vs.forEach(o.selfEdges,(function(e){wc.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:r+ ++n,e:e.e,label:e.label},"_se")})),delete o.selfEdges}))}))}(t)})),e(" adjustCoordinateSystem",(function(){!function(t){var e=t.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||nc(t)}(t)})),e(" position",(function(){!function(t){(function(t){var e=As.buildLayerMatrix(t),n=t.graph().ranksep,r=0;vs.forEach(e,(function(e){var o=vs.max(vs.map(e,(function(e){return t.node(e).height})));vs.forEach(e,(function(e){t.node(e).y=r+o/2})),r+=o+n}))})(t=As.asNonCompoundGraph(t)),vs.forEach(function(t){var e,n=As.buildLayerMatrix(t),r=vs.merge(function(t,e){var n={};return vs.reduce(e,(function(e,r){var o=0,i=0,a=e.length,u=vs.last(r);return vs.forEach(r,(function(e,s){var c=function(t,e){if(t.node(e).dummy)return vs.find(t.predecessors(e),(function(e){return t.node(e).dummy}))}(t,e),f=c?t.node(c).order:a;(c||e===u)&&(vs.forEach(r.slice(i,s+1),(function(e){vs.forEach(t.predecessors(e),(function(r){var i=t.node(r),a=i.order;!(a<o||f<a)||i.dummy&&t.node(e).dummy||gc(n,r,e)}))})),i=s+1,o=f)})),r})),n}(t,n),function(t,e){var n={};function r(e,r,o,i,a){var u;vs.forEach(vs.range(r,o),(function(r){u=e[r],t.node(u).dummy&&vs.forEach(t.predecessors(u),(function(e){var r=t.node(e);r.dummy&&(r.order<i||r.order>a)&&gc(n,e,u)}))}))}return vs.reduce(e,(function(e,n){var o,i=-1,a=0;return vs.forEach(n,(function(u,s){if("border"===t.node(u).dummy){var c=t.predecessors(u);c.length&&(o=t.node(c[0]).order,r(n,a,s,i,o),a=s,i=o)}r(n,a,n.length,o,e.length)})),n})),n}(t,n)),o={};vs.forEach(["u","d"],(function(i){e="u"===i?n:vs.values(n).reverse(),vs.forEach(["l","r"],(function(n){"r"===n&&(e=vs.map(e,(function(t){return vs.values(t).reverse()})));var a=("u"===i?t.predecessors:t.successors).bind(t),u=function(t,e,n,r){var o={},i={},a={};return vs.forEach(e,(function(t){vs.forEach(t,(function(t,e){o[t]=t,i[t]=t,a[t]=e}))})),vs.forEach(e,(function(t){var e=-1;vs.forEach(t,(function(t){var u=r(t);if(u.length)for(var s=((u=vs.sortBy(u,(function(t){return a[t]}))).length-1)/2,c=Math.floor(s),f=Math.ceil(s);c<=f;++c){var l=u[c];i[t]===t&&e<a[l]&&!mc(n,t,l)&&(i[l]=t,i[t]=o[t]=o[l],e=a[l])}}))})),{root:o,align:i}}(0,e,r,a),s=function(t,e,n,r,o){var i={},a=function(t,e,n,r){var o=new vc,i=t.graph(),a=function(t,e,n){return function(r,o,i){var a,u=r.node(o),s=r.node(i),c=0;if(c+=u.width/2,vs.has(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":a=-u.width/2;break;case"r":a=u.width/2}if(a&&(c+=n?a:-a),a=0,c+=(u.dummy?e:t)/2,c+=(s.dummy?e:t)/2,c+=s.width/2,vs.has(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":a=s.width/2;break;case"r":a=-s.width/2}return a&&(c+=n?a:-a),a=0,c}}(i.nodesep,i.edgesep,r);return vs.forEach(e,(function(e){var r;vs.forEach(e,(function(e){var i=n[e];if(o.setNode(i),r){var u=n[r],s=o.edge(u,i);o.setEdge(u,i,Math.max(a(t,e,r),s||0))}r=e}))})),o}(t,e,n,o),u=o?"borderLeft":"borderRight";function s(t,e){for(var n=a.nodes(),r=n.pop(),o={};r;)o[r]?t(r):(o[r]=!0,n.push(r),n=n.concat(e(r))),r=n.pop()}return s((function(t){i[t]=a.inEdges(t).reduce((function(t,e){return Math.max(t,i[e.v]+a.edge(e))}),0)}),a.predecessors.bind(a)),s((function(e){var n=a.outEdges(e).reduce((function(t,e){return Math.min(t,i[e.w]-a.edge(e))}),Number.POSITIVE_INFINITY),r=t.node(e);n!==Number.POSITIVE_INFINITY&&r.borderType!==u&&(i[e]=Math.max(i[e],n))}),a.successors.bind(a)),vs.forEach(r,(function(t){i[t]=i[n[t]]})),i}(t,e,u.root,u.align,"r"===n);"r"===n&&(s=vs.mapValues(s,(function(t){return-t}))),o[i+n]=s}))}));var i=function(t,e){return vs.minBy(vs.values(e),(function(e){var n=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY;return vs.forIn(e,(function(e,o){var i=function(t,e){return t.node(e).width}(t,o)/2;n=Math.max(e+i,n),r=Math.min(e-i,r)})),n-r}))}(t,o);return function(t,e){var n=vs.values(e),r=vs.min(n),o=vs.max(n);vs.forEach(["u","d"],(function(n){vs.forEach(["l","r"],(function(i){var a,u=n+i,s=t[u];if(s!==e){var c=vs.values(s);(a="l"===i?r-vs.min(c):o-vs.max(c))&&(t[u]=vs.mapValues(s,(function(t){return t+a})))}}))}))}(o,i),function(t,e){return vs.mapValues(t.ul,(function(n,r){if(e)return t[e.toLowerCase()][r];var o=vs.sortBy(vs.map(t,r));return(o[1]+o[2])/2}))}(o,t.graph().align)}(t),(function(e,n){t.node(n).x=e}))}(t)})),e(" positionSelfEdges",(function(){!function(t){vs.forEach(t.nodes(),(function(e){var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),o=r.x+r.width/2,i=r.y,a=n.x-o,u=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:o+2*a/3,y:i-u},{x:o+5*a/6,y:i-u},{x:o+a,y:i},{x:o+5*a/6,y:i+u},{x:o+2*a/3,y:i+u}],n.label.x=n.x,n.label.y=n.y}}))}(t)})),e(" removeBorderNodes",(function(){!function(t){vs.forEach(t.nodes(),(function(e){if(t.children(e).length){var n=t.node(e),r=t.node(n.borderTop),o=t.node(n.borderBottom),i=t.node(vs.last(n.borderLeft)),a=t.node(vs.last(n.borderRight));n.width=Math.abs(a.x-i.x),n.height=Math.abs(o.y-r.y),n.x=i.x+n.width/2,n.y=r.y+n.height/2}})),vs.forEach(t.nodes(),(function(e){"border"===t.node(e).dummy&&t.removeNode(e)}))}(t)})),e(" normalize.undo",(function(){!function(t){vs.forEach(t.graph().dummyChains,(function(e){var n,r=t.node(e),o=r.edgeLabel;for(t.setEdge(r.edgeObj,o);r.dummy;)n=t.successors(e)[0],t.removeNode(e),o.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(o.x=r.x,o.y=r.y,o.width=r.width,o.height=r.height),e=n,r=t.node(e)}))}(t)})),e(" fixupEdgeLabelCoords",(function(){!function(t){vs.forEach(t.edges(),(function(e){var n=t.edge(e);if(vs.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(t)})),e(" undoCoordinateSystem",(function(){!function(t){var e=t.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(t){vs.forEach(t.nodes(),(function(e){oc(t.node(e))})),vs.forEach(t.edges(),(function(e){var n=t.edge(e);vs.forEach(n.points,oc),vs.has(n,"y")&&oc(n)}))}(t),"lr"!==e&&"rl"!==e||(function(t){vs.forEach(t.nodes(),(function(e){ic(t.node(e))})),vs.forEach(t.edges(),(function(e){var n=t.edge(e);vs.forEach(n.points,ic),vs.has(n,"x")&&ic(n)}))}(t),nc(t))}(t)})),e(" translateGraph",(function(){!function(t){var e=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,o=0,i=t.graph(),a=i.marginx||0,u=i.marginy||0;function s(t){var i=t.x,a=t.y,u=t.width,s=t.height;e=Math.min(e,i-u/2),n=Math.max(n,i+u/2),r=Math.min(r,a-s/2),o=Math.max(o,a+s/2)}vs.forEach(t.nodes(),(function(e){s(t.node(e))})),vs.forEach(t.edges(),(function(e){var n=t.edge(e);vs.has(n,"x")&&s(n)})),e-=a,r-=u,vs.forEach(t.nodes(),(function(n){var o=t.node(n);o.x-=e,o.y-=r})),vs.forEach(t.edges(),(function(n){var o=t.edge(n);vs.forEach(o.points,(function(t){t.x-=e,t.y-=r})),vs.has(o,"x")&&(o.x-=e),vs.has(o,"y")&&(o.y-=r)})),i.width=n-e+a,i.height=o-r+u}(t)})),e(" assignNodeIntersects",(function(){!function(t){vs.forEach(t.edges(),(function(e){var n,r,o=t.edge(e),i=t.node(e.v),a=t.node(e.w);o.points?(n=o.points[0],r=o.points[o.points.length-1]):(o.points=[],n=a,r=i),o.points.unshift(wc.intersectRect(i,n)),o.points.push(wc.intersectRect(a,r))}))}(t)})),e(" reversePoints",(function(){!function(t){vs.forEach(t.edges(),(function(e){var n=t.edge(e);n.reversed&&n.points.reverse()}))}(t)})),e(" acyclic.undo",(function(){!function(t){vs.forEach(t.edges(),(function(e){var n=t.edge(e);if(n.reversed){t.removeEdge(e);var r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}}))}(t)}))}(e,n)})),n(" updateInputGraph",(function(){!function(t,e){vs.forEach(t.nodes(),(function(n){var r=t.node(n),o=e.node(n);r&&(r.x=o.x,r.y=o.y,e.children(n).length&&(r.width=o.width,r.height=o.height))})),vs.forEach(t.edges(),(function(n){var r=t.edge(n),o=e.edge(n);r.points=o.points,vs.has(o,"x")&&(r.x=o.x,r.y=o.y)})),t.graph().width=e.graph().width,t.graph().height=e.graph().height}(t,e)}))}))},debug:{debugOrdering:function(t){var e=As.buildLayerMatrix(t),n=new kc({compound:!0,multigraph:!0}).setGraph({});return vs.forEach(t.nodes(),(function(e){n.setNode(e,{label:e}),n.setParent(e,"layer"+t.node(e).rank)})),vs.forEach(t.edges(),(function(t){n.setEdge(t.v,t.w,{},t.name)})),vs.forEach(e,(function(t,e){var r="layer"+e;n.setNode(r,{rank:"same"}),vs.reduce(t,(function(t,e){return n.setEdge(t,e,{style:"invis"}),e}))})),n}},util:{time:As.time,notime:As.notime},version:"0.8.5"},Cc=Rc.graphlib,Lc=Rc.layout;class Pc{constructor(t){this.cardinality=1,this.include=wr.UNSPECIFIED,this.isGroupNode=!1,this.parentNode=null,this.type=br.NODE,this.name=t.name,this.attr=t.attr||{},this.inputs=t.inputs,this.path=t.path||[],this.width=t.width,this.height=t.height}}class jc{constructor(){this.nodes={},this.edges=[],this.nodes={},this.edges=[]}}class zc{constructor(t,e={}){this.attr=null,this.bridgeGraph=null,this.cardinality=0,this.depth=1,this.include=wr.UNSPECIFIED,this.isGroupNode=!0,this.parentNode=null,this.type=br.META,this.path=[],this.name=t,this.metaGraph=Bc(t,Er.META,e)}getFirstChild(){return this.metaGraph.node(this.metaGraph.nodes()[0])}getChildren(){return this.metaGraph.nodes().map((t=>this.metaGraph.node(t)))}leaves(){let t,e=[],n=[this];for(;n.length;){let r=n.shift();r.isGroupNode?(t=r.metaGraph,t.nodes().forEach((e=>n.push(t.node(e))))):e.push(r.name)}return e}}class Fc{constructor(t,e){this.v=t,this.w=e,this.baseEdgeList=[],this.inbound=null,this.name=null}addBaseEdge(t,e){this.baseEdgeList.push(t)}}function Gc(t,e={}){return new zc(t,e)}function Uc(t,e){return new Fc(t,e)}function Bc(t,e,n){const r=n||{},o=new Cc.Graph(r);return o.setGraph({name:t,rankdir:r.rankdir,type:e,align:r.align}),o}class Vc{constructor(t={}){this.graphOptions=t,this.index={},this.graphOptions.compound=!0,this.root=Gc(mr,this.graphOptions),this.index[mr]=this.root}getNodeMap(){return this.index}node(t){return this.index[t]}setNode(t,e){this.index[t]=e}getBridgeGraph(t){const e=this.index[t];if(!e)throw Error("Could not find node in hierarchy: "+t);if(!("metaGraph"in e))return null;const n=e;if(n.bridgeGraph)return n.bridgeGraph;const r=Bc(yr,Er.BRIDGE,this.graphOptions);if(n.bridgeGraph=r,!e.parentNode||!("metaGraph"in e.parentNode))return r;const o=e.parentNode;return[o.metaGraph,this.getBridgeGraph(o.name)].forEach((e=>{e.edges().filter((e=>e.v===t||e.w===t)).forEach((n=>{const o=n.w===t;e.edge(n).baseEdgeList.forEach((e=>{const[i,a]=o?[e.w,n.v]:[e.v,n.w],u=this.getChildName(t,i),s={v:o?a:u,w:o?u:a};let c=r.edge(s);c||(c=Uc(s.v,s.w),c.inbound=o,r.setEdge(s.v,s.w,c)),c.addBaseEdge(e,this)}))}))})),r}getChildName(t,e){let n=this.index[e];for(;n;){if(n.parentNode&&n.parentNode.name===t)return n.name;n=n.parentNode}throw Error("Could not find immediate child for descendant: "+e)}getPredecessors(t){const e=this.index[t];if(!e)throw Error("Could not find node with name: "+t);return this.getOneWayEdges(e,!0)}getSuccessors(t){const e=this.index[t];if(!e)throw Error("Could not find node with name: "+t);return this.getOneWayEdges(e,!1)}getOneWayEdges(t,e){const n=[];if(!t.parentNode||!t.parentNode.isGroupNode)return n;const r=t.parentNode,o=r.metaGraph,i=this.getBridgeGraph(r.name);return Wc(o,t,e,n),Wc(i,t,e,n),n}}function Wc(t,e,n,r){(n?t.inEdges(e.name):t.outEdges(e.name)).forEach((e=>{const n=t.edge(e);r.push(n)}))}class Xc{constructor(t){this.hierarchy=t,this.index={},this.hasSubHierarchy={},this.root=new Yc(this.hierarchy.root,this.hierarchy.graphOptions),this.index[t.root.name]=this.root,this.buildSubHierarchy(t.root.name),this.root.expanded=!0}getRenderInfoNodes(){return Object.values(this.index)}getSubHierarchy(){return this.hasSubHierarchy}buildSubHierarchy(t){if(t in this.hasSubHierarchy)return;this.hasSubHierarchy[t]=!0;const e=this.index[t];if(e.node.type!==br.META)return;const n=e,r=n.node.metaGraph,o=n.coreGraph;r.nodes().forEach((t=>{const e=this.getOrCreateRenderNodeByName(t);o.setNode(t,e)})),r.edges().forEach((t=>{const e=r.edge(t),n=new qc(e);o.setEdge(t.v,t.w,n)}));const i=n.node.parentNode;if(!i)return;const a=this.getRenderNodeByName(i.name),u=(t,...e)=>e.concat([t?"IN":"OUT"]).join("~~"),s=this.hierarchy.getBridgeGraph(t);s.edges().forEach((e=>{const n=s.edge(e),c=!!r.node(e.w),[f,l]=c?[e.w,e.v]:[e.v,e.w],d=e=>{const n=c?{v:e,w:t}:{v:t,w:e};return a.coreGraph.edge(n)};let h=d(l);h||(h=d(u(c,l,i.name)));const p=u(c,t),v=u(c,l,t);let g=o.node(v);if(!g){let t=o.node(p);if(!t){const e={name:p,type:br.BRIDGE,isGroupNode:!1,cardinality:0,parentNode:null,include:wr.UNSPECIFIED,inbound:c,attr:{}};t=new Hc(e),this.index[p]=t,o.setNode(p,t)}const e={name:v,type:br.BRIDGE,isGroupNode:!1,cardinality:1,parentNode:null,include:wr.UNSPECIFIED,inbound:c,attr:{}};g=new Hc(e),this.index[v]=g,o.setNode(v,g),o.setParent(v,p),t.node.cardinality++}const m=new qc(n);m.adjoiningMetaEdge=h,c?o.setEdge(v,f,m):o.setEdge(f,v,m)}))}getOrCreateRenderNodeByName(t){if(!t)return null;if(t in this.index)return this.index[t];const e=this.getNodeByName(t);return e?(this.index[t]=e.isGroupNode?new Yc(e,this.hierarchy.graphOptions):new Hc(e),this.index[t]):null}getRenderNodeByName(t){return this.index[t]}getNodeByName(t){return this.hierarchy.node(t)}}class Hc{constructor(t){this.node=t,this.expanded=!1,this.x=0,this.y=0,this.coreBox={width:0,height:0},this.outboxWidth=0,this.labelOffset=0,this.radius=0,this.labelHeight=0,this.paddingTop=0,this.paddingLeft=0,this.paddingRight=0,this.paddingBottom=0,this.width=t.width||0,this.height=t.height||0,this.displayName=t.name,this.attr=t.attr}}class qc{constructor(t){this.metaEdge=t,this.adjoiningMetaEdge=null,this.weight=1,this.points=[]}}class Yc extends Hc{constructor(t,e){super(t);const n=t.metaGraph.graph();e.compound=!0,this.coreGraph=Bc(n.name,Er.CORE,e)}}function Kc(t,e){t.node.isGroupNode&&function(t,e){const n=vr(e);t.coreGraph.nodes().map((e=>t.coreGraph.node(e))).forEach((t=>{var r,o,i,a,u,s;const{height:c,width:f}=t;switch(t.node.type){case br.NODE:Object.assign(t,n.nodeSize.node),t.height=c||n.nodeSize.node.height,t.width=f||n.nodeSize.node.width;break;case br.BRIDGE:Object.assign(t,n.nodeSize.bridge);break;case br.META:t.expanded?Kc(t,e):(Object.assign(t,n.nodeSize.meta),t.height=n.nodeSize.meta.height,t.width=n.nodeSize.meta.width);break;default:throw Error("Unrecognized node type: "+t.node.type)}if(!t.expanded){const n=t.attr;!function(t,e=!1){if(t.coreBox.width=t.width,t.coreBox.height=t.height,!e){const e=`${t.displayName}`.length,n=3;t.width=Math.max(t.coreBox.width,e*n)}}(t,e&&(0===t.node.type&&!!(null===(o=null===(r=null==e?void 0:e.nodeSize)||void 0===r?void 0:r.meta)||void 0===o?void 0:o.width)||1===t.node.type&&(!!(null===(a=null===(i=null==e?void 0:e.nodeSize)||void 0===i?void 0:i.node)||void 0===a?void 0:a.width)||!!n.width)||2===t.node.type&&!!(null===(s=null===(u=null==e?void 0:e.nodeSize)||void 0===u?void 0:u.bridge)||void 0===s?void 0:s.width)))}}))}(t,e),t.node.type===br.META&&function(t,e){const n=vr(e),r=n.subScene.meta;Object.assign(t,r);const{nodeSep:o,rankSep:i,edgeSep:a,align:u}=n.graph.meta,s={nodesep:o,ranksep:i,edgesep:a,align:u};Object.assign(t.coreBox,function(t,e){const{ranksep:n,nodesep:r,edgesep:o,align:i}=e;Object.assign(t.graph(),{ranksep:n,nodesep:r,edgesep:o,align:i});const a=[];if(t.nodes().forEach((e=>{t.node(e).node.type!==br.BRIDGE&&a.push(e)})),!a.length)return{width:0,height:0};Lc(t);let u=1/0,s=1/0,c=-1/0,f=-1/0;return a.forEach((e=>{const n=t.node(e),r=.5*n.width,o=n.x-r,i=n.x+r;u=o<u?o:u,c=i>c?i:c;const a=.5*n.height,l=n.y-a,d=n.y+a;s=l<s?l:s,f=d>f?d:f})),t.edges().forEach((e=>{const n=t.edge(e),r=t.node(n.metaEdge.v),o=t.node(n.metaEdge.w);if(3===n.points.length&&function(t){let e=Zc(t[0],t[1]);for(let n=1;n<t.length-1;n++){const r=Zc(t[n],t[n+1]);if(Math.abs(r-e)>1)return!1;e=r}return!0}(n.points)){if(null!=r){const t=r.expanded?r.x:$c(r);n.points[0].x=t}if(null!=o){const t=o.expanded?o.x:$c(o);n.points[2].x=t}n.points=[n.points[0],n.points[1]]}const i=n.points[n.points.length-2];null!=o&&(n.points[n.points.length-1]=Qc(i,o));const a=n.points[1];null!=r&&(n.points[0]=Qc(a,r)),n.points.forEach((t=>{u=t.x<u?t.x:u,c=t.x>c?t.x:c,s=t.y<s?t.y:s,f=t.y>f?t.y:f}))})),t.nodes().forEach((e=>{const n=t.node(e);n.x-=u,n.y-=s})),t.edges().forEach((e=>{t.edge(e).points.forEach((t=>{t.x-=u,t.y-=s}))})),{width:c-u,height:f-s}}(t.coreGraph,s));let c=0;t.coreGraph.nodeCount()>0&&c++;const f=c<=1?0:c;t.coreBox.width+=f+f,t.coreBox.height=r.labelHeight+t.coreBox.height,t.width=t.coreBox.width+r.paddingLeft+r.paddingRight,t.height=t.paddingTop+t.coreBox.height+t.paddingBottom}(t,e)}function Zc(t,e){const n=e.x-t.x,r=e.y-t.y;return 180*Math.atan(r/n)/Math.PI}function $c(t){return t.expanded?t.x:t.x-t.width/2+0+t.coreBox.width/2}function Qc(t,e){const n=e.expanded?e.x:$c(e),r=e.y,o=t.x-n,i=t.y-r;let a,u,s=e.expanded?e.width:e.coreBox.width,c=e.expanded?e.height:e.coreBox.height;return Math.abs(i)*s/2>Math.abs(o)*c/2?(i<0&&(c=-c),a=0===i?0:c/2*o/i,u=c/2):(o<0&&(s=-s),a=s/2,u=0===o?0:s/2*i/o),{x:n+a,y:r+u}}function Jc(t,e,n){var r,o,i,a;const u=t.nodes.filter(((t,e,n)=>n.findIndex((e=>e.id===t.id))!==e)).map((t=>t.id));if(u.length)throw new Error(`Duplicated ids found: ${u.join(", ")}`);const s=function(t){const e={nodes:[]},n=t.compound,r=Object.keys(n||{}),o=new Map,i=(t,e=[])=>{if(o.has(t))return o.get(t);for(let o=0;o<r.length;o++){let a=r[o];if(n&&-1!==n[a].indexOf(t))return e.unshift(a),i(a,e)}return 0===e.length&&o.set(t,e),e},a=e=>t.edges.filter((t=>t.w===e)).map((t=>({name:t.v})));return t.nodes.forEach((t=>{const n=t.id,r=[...i(n),n];let o=a(n);e.nodes.push({name:n,path:r,inputs:o,width:t.width,height:t.height,attr:Object.assign({},t)})})),e}(t),c=function(t,e){const n=(t,e)=>{for(let n of e.values())if(n.includes(t))return!0;return!1},r=(t,e=[])=>{if(0===Object.keys(t).length)return[...new Set(e)];const o=new Map(Object.keys(t).map((e=>[e,t[e]]))),i={};for(let[t,r]of o)n(t,o)?i[t]=r:e=e.concat(t,r);return r(i,e)};return r(t).filter((t=>e.includes(t)))}(t.compound||{},(null==e?void 0:e.expanded)||[]),f=function(t,e){return function(t){return new Xc(t)}(function(t,e){const{rankDirection:n,align:r}=e,o=new Vc({rankdir:n,align:r});return function(t,e){Object.keys(e.nodes).forEach((n=>{const r=e.nodes[n],o=r.path;let i=t.root;i.depth=Math.max(o.length,i.depth);for(let e=0;e<o.length&&(i.depth=Math.max(i.depth,o.length-e),i.cardinality+=r.cardinality,e!==o.length-1);e++){const n=o[e];let a=t.node(n);a||(a=Gc(n,t.graphOptions),a.path=r.path.slice(0,e+1),a.parentNode=i,t.setNode(n,a),i.metaGraph.setNode(n,a)),i=a}t.setNode(r.name,r),r.parentNode=i,i.metaGraph.setNode(r.name,r)}))}(o,t),function(t,e){const n=t.getNodeMap();let r=[],o=[];const i=(t,e)=>{let n=0;for(;t;)e[n++]=t.name,t=t.parentNode;return n-1};e.edges.forEach((a=>{r=[],o=[];let u=i(e.nodes[a.v],r),s=i(e.nodes[a.w],o);for(;r[u]===o[s];)if(u--,s--,u<0||s<0)throw Error("No difference found between ancestor paths.");const c=n[r[u+1]],f=r[u],l=o[s];let d=c.metaGraph.edge(f,l);d||(d=Uc(f,l),c.metaGraph.setEdge(f,l,d)),d.addBaseEdge(a,t)}))}(o,t),o}(function(t){const e=new jc;return t.nodes.map((t=>new Pc(t))).forEach((t=>{e.nodes[t.name]=t,t.inputs.forEach((n=>{!function(t,e,n){n.name!==e.name&&t.edges.push(Object.assign(Object.assign({},n.attr),{v:n.name,w:e.name}))}(e,t,n)}))})),e}(t),e))}(s,{rankDirection:(null===(o=null===(r=null==n?void 0:n.graph)||void 0===r?void 0:r.meta)||void 0===o?void 0:o.rankDir)||(null==e?void 0:e.rankDirection)||pr.graph.meta.rankDir,align:(null===(a=null===(i=null==n?void 0:n.graph)||void 0===i?void 0:i.meta)||void 0===a?void 0:a.align)||pr.graph.meta.align});return function(t,e){e.forEach((e=>{const n=t.getRenderInfoNodes().find((t=>t.displayName===e));let r=n&&n.node&&n.node.name||"";const o=t.getRenderNodeByName(r);if(!o)throw new Error(`No nodes found: ${r}`);o.expanded=!0,t.buildSubHierarchy(r)}))}(f,c),Kc(f.root,n),ef(f.root)}function tf(t,e,n,r){var o,i;let a=[];const u=(null===(o=n.find((e=>e.id===t)))||void 0===o?void 0:o.path)||[],s=(null===(i=n.find((t=>t.id===e)))||void 0===i?void 0:i.path)||[],c=[mr,...u].slice(0,u.length).reverse(),f=[mr,...s].slice(0,s.length);return c.forEach((o=>{const i=n.find((t=>t.id===o));a=a.concat(i.edges.filter((n=>n.baseEdgeList.some((n=>n.v===((null==r?void 0:r.v)||t)&&n.w===((null==r?void 0:r.w)||e))))))})),f.filter((t=>!c.includes(t))).forEach((o=>{const i=n.find((t=>t.id===o));a=a.concat(i.edges.filter((n=>n.baseEdgeList.some((n=>n.v===((null==r?void 0:r.v)||t)&&n.w===((null==r?void 0:r.w)||e))))))})),a}function ef(t){const e=t.coreGraph.nodes().map((e=>t.coreGraph.node(e)));return Object.assign(Object.assign({},nf(t)),{expanded:t.expanded,nodes:t.expanded?(n=e,n.map((t=>t.node.type===br.META?ef(t):nf(t)))):[],edges:t.expanded?rf(t):[]});var n}function nf(t){return{id:t.node.name,name:t.node.name,type:t.node.type,cardinality:t.node.cardinality,attr:t.attr,parentNodeName:t.node.parentNode?t.node.parentNode.name:null,coreBox:Object.assign({},t.coreBox),x:t.x,y:t.y,width:t.width,height:t.height,radius:t.radius,labelHeight:t.labelHeight,labelOffset:t.labelOffset,outboxWidth:t.outboxWidth,paddingLeft:t.paddingLeft,paddingTop:t.paddingTop,paddingRight:t.paddingRight,paddingBottom:t.paddingBottom,path:t.node.path}}function rf(t){return t.coreGraph.edges().map((e=>({renderInfoEdge:t.coreGraph.edge(e),edge:e}))).filter((({renderInfoEdge:t})=>t.metaEdge)).map((({edge:e,renderInfoEdge:n})=>{const r=function(t,e){const n=e.points.map((t=>Object.assign({},t)));if(e.adjoiningMetaEdge){const r=e.adjoiningMetaEdge.points,o=e.metaEdge.inbound,i=o?r[r.length-1]:r[0],a=n[o?0:n.length-1],u=t.x-t.width/2,s=t.y-t.height/2,c=i.x-u,f=i.y-s,l=-t.paddingLeft,d=-(t.paddingTop+t.labelHeight);a.x=c+l,a.y=f+d}return n}(t,n);return{adjoiningEdge:n.adjoiningMetaEdge?{w:n.adjoiningMetaEdge.metaEdge.w,v:n.adjoiningMetaEdge.metaEdge.v}:null,inbound:n.metaEdge.inbound,w:e.w,v:e.v,points:r,weight:n.weight,baseEdgeList:n.metaEdge.baseEdgeList,parentNodeName:t.node.name}}))}var of=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),af=function(){return af=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},af.apply(this,arguments)},uf=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},sf=function(t){function e(e){var n=t.call(this)||this;return n.rankdir="TB",n.nodesep=50,n.edgesep=5,n.ranksep=50,n.controlPoints=!0,n.anchorPoint=!0,n.nodes=[],n.edges=[],n.combos=[],n.onLayoutEnd=function(){},n.updateCfg(e),n}return of(e,t),e.prototype.getDefaultCfg=function(){return{rankdir:"TB",align:void 0,begin:void 0,nodeSize:void 0,nodesep:50,ranksep:50,controlPoints:!0,anchorPoint:!0}},e.prototype.init=function(t){var e=t.hiddenNodes||[],n=t.hiddenEdges||[],r=t.hiddenCombos||[];this.nodes=this.getDataByOrder((t.nodes||[]).concat(e)),this.edges=this.getDataByOrder((t.edges||[]).concat(n)),this.combos=(t.combos||[]).concat(r.map((function(t){return af(af({},t),{collapsed:!0})})))},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.edges;if(e){var r=t.getLayoutConfig(),o=function(t,e=!1){const n=JSON.parse(JSON.stringify(t)),r={nodes:[n],edges:[...n.edges]};return n.nodes.forEach((function t(e){(0===e.type||1===e.type)&&r.nodes.push(e),0===e.type&&(r.edges=r.edges.concat(e.edges)),Array.isArray(e.nodes)&&e.nodes.forEach(t)})),e&&r.nodes.forEach((t=>{const e=r.nodes.find((e=>e.id===t.parentNodeName));if(e){const n=e.x-e.width/2+e.paddingLeft,r=e.y-e.height/2+e.labelHeight+e.paddingTop;e.id!==mr&&(t.x+=n,t.y+=r),0===t.type&&t.edges.forEach((e=>{e.points.forEach((e=>{e.x+=t.x-t.width/2+t.paddingLeft,e.y+=t.y-t.height/2+t.labelHeight+t.paddingTop}))}))}})),r}(Jc(r.graphDef,r.graphOption,r.graphSettings),!0);return this.updatePosition(o),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:n}}},e.prototype.getNodePath=function(t){var e=this.nodes,n=this.combos,r=e.find((function(e){return e.id===t}));return r&&r.comboId?function t(e,r){void 0===r&&(r=[]);var o=n.find((function(t){return t.id===e}));return o?(r.unshift(e),o.parentId?t(o.parentId,r):r):r}(r.comboId,[t]):[t]},e.prototype.getLayoutConfig=function(){var t,e,n,r,i=this,a=i.nodes,u=i.edges,s=i.combos,c=i.nodeSize,l=i.rankdir,d=i.align,h=i.edgesep,p=i.nodesep,v=i.ranksep,g=i.settings,m=(s||[]).reduce((function(t,e){var n=a.filter((function(t){return t.comboId===e.id})).map((function(t){return t.id})),r=(s||[]).filter((function(t){return t.parentId===e.id})).map((function(t){return t.id}));return(n.length||r.length)&&(t[e.id]=uf(uf([],n,!0),r,!0)),t}),{});r=c?o(c)?function(){return c}:function(){return[c,c]}:function(t){return t&&t.size?o(t.size)?t.size:f(t.size)?[t.size.width||40,t.size.height||40]:[t.size,t.size]:[40,40]};var y=function(t){return t&&t.size?o(t.size)?t.size:[t.size,t.size]:[80,40]}(null==s?void 0:s[0]),b=y[0],w=y[1],E=null===(e=null===(t=i.graphSettings)||void 0===t?void 0:t.subScene)||void 0===e?void 0:e.meta,x=(null===(n=s.find((function(t){return!t.collapsed})))||void 0===n?void 0:n.padding)||[20,20,20,20],_=x[0],S=x[1],A=x[2],I=x[3],T={compound:m,nodes:uf([],(a||[]).map((function(t){var e=r(t),n=e[0],o=e[1];return af(af({},t),{width:n,height:o})})),!0),edges:uf([],(u||[]).map((function(t){return af(af({},t),{v:t.source,w:t.target})})),!0)},O={expanded:(s||[]).filter((function(t){return!t.collapsed})).map((function(t){return t.id}))},N={graph:{meta:{align:d,rankDir:l,nodeSep:p,edgeSep:h,rankSep:v}},subScene:{meta:{paddingTop:_||(null==E?void 0:E.paddingTop)||20,paddingRight:S||(null==E?void 0:E.paddingRight)||20,paddingBottom:A||(null==E?void 0:E.paddingBottom)||20,paddingLeft:I||(null==E?void 0:E.paddingLeft)||20,labelHeight:0}},nodeSize:{meta:{width:b,height:w}}},D=vr(g,af({},vr(N,pr)));return i.graphSettings=D,{graphDef:T,graphOption:O,graphSettings:D}},e.prototype.updatePosition=function(t){var e=t.nodes,n=t.edges;this.updateNodePosition(e,n),this.updateEdgePosition(e,n)},e.prototype.getBegin=function(t,e){var n=this.begin,r=[0,0];if(n){var o=1/0,i=1/0;t.forEach((function(t){o>t.x&&(o=t.x),i>t.y&&(i=t.y)})),e.forEach((function(t){t.points.forEach((function(t){o>t.x&&(o=t.x),i>t.y&&(i=t.y)}))})),r[0]=n[0]-o,r[1]=n[1]-i}return r},e.prototype.updateNodePosition=function(t,e){var n=this,r=n.combos,o=n.nodes,i=n.edges,a=n.anchorPoint,u=n.graphSettings,s=this.getBegin(t,e);t.forEach((function(t){var n,c=t.x,f=t.y,l=t.id,d=t.type,h=t.coreBox;if(d===xr.META&&l!==mr){var p=r.findIndex((function(t){return t.id===l})),v=null===(n=null==u?void 0:u.subScene)||void 0===n?void 0:n.meta;r[p].offsetX=c+s[0],r[p].offsetY=f+s[1],r[p].fixSize=[h.width,h.height],r[p].fixCollapseSize=[h.width,h.height],t.expanded?r[p].padding=[null==v?void 0:v.paddingTop,null==v?void 0:v.paddingRight,null==v?void 0:v.paddingBottom,null==v?void 0:v.paddingLeft]:r[p].padding=[0,0,0,0]}else if(d===xr.OP&&(p=o.findIndex((function(t){return t.id===l})),o[p].x=c+s[0],o[p].y=f+s[1],a)){var g=[],m=e.filter((function(t){return t.v===l})),y=e.filter((function(t){return t.w===l}));m.length>0&&m.forEach((function(e){var n=e.points[0],r=(n.x-c)/t.width+.5,o=(n.y-f)/t.height+.5;g.push([r,o]),e.baseEdgeList.forEach((function(t){var e=i.find((function(e){return e.source===t.v&&e.target===t.w}));e&&(e.sourceAnchor=g.length-1)}))})),y.length>0&&y.forEach((function(e){var n=e.points[e.points.length-1],r=(n.x-c)/t.width+.5,o=(n.y-f)/t.height+.5;g.push([r,o]),e.baseEdgeList.forEach((function(t){var e=i.find((function(e){return e.source===t.v&&e.target===t.w}));e&&(e.targetAnchor=g.length-1)}))})),o[p].anchorPoints=g.length>0?g:o[p].anchorPoints||[]}}))},e.prototype.updateEdgePosition=function(t,e){var n=this,r=n.combos,o=n.edges,i=n.controlPoints,a=this.getBegin(t,e);i&&(r.forEach((function(t){t.inEdges=[],t.outEdges=[]})),o.forEach((function(e){var o,i,u,s,c=t.find((function(t){return t.id===e.source})),f=t.find((function(t){return t.id===e.target})),l=[],d=[];if(c&&f)d=tf(null==c?void 0:c.id,null==f?void 0:f.id,t);else if(!c||!f){var h=n.getNodePath(e.source),p=n.getNodePath(e.target),v=h.reverse().slice(c?0:1).find((function(e){return t.find((function(t){return t.id===e}))})),g=p.reverse().slice(f?0:1).find((function(e){return t.find((function(t){return t.id===e}))}));c=t.find((function(t){return t.id===v})),f=t.find((function(t){return t.id===g})),d=tf(null==c?void 0:c.id,null==f?void 0:f.id,t,{v:e.source,w:e.target})}if(l=(l=d.reduce((function(t,e){return uf(uf([],t,!0),e.points.map((function(t){return af(af({},t),{x:t.x+a[0],y:t.y+a[1]})})),!0)}),[])).slice(1,-1),e.controlPoints=l,(null==f?void 0:f.type)===br.META){var m=r.findIndex((function(t){return t.id===(null==f?void 0:f.id)}));if(!r[m]||(null===(o=r[m].inEdges)||void 0===o?void 0:o.some((function(t){return t.source===c.id&&t.target===f.id}))))return;null===(i=r[m].inEdges)||void 0===i||i.push({source:c.id,target:f.id,controlPoints:l})}if((null==c?void 0:c.type)===br.META){if(m=r.findIndex((function(t){return t.id===(null==c?void 0:c.id)})),!r[m]||(null===(u=r[m].outEdges)||void 0===u?void 0:u.some((function(t){return t.source===c.id&&t.target===f.id}))))return;null===(s=r[m].outEdges)||void 0===s||s.push({source:c.id,target:f.id,controlPoints:l})}})))},e.prototype.getType=function(){return"dagreCompound"},e.prototype.getDataByOrder=function(t){return t.every((function(t){return void 0!==t.layoutOrder}))||t.forEach((function(t,e){t.layoutOrder=e})),t.sort((function(t,e){return t.layoutOrder-e.layoutOrder}))},e}(t);const cf=Object.prototype.toString;function ff(t){const e=cf.call(t);return e.endsWith("Array]")&&!e.includes("Big")}function lf(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!ff(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");if(void 0!==n.output){if(!ff(n.output))throw new TypeError("output option must be an array if specified");e=n.output}else e=new Array(t.length);var r=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!ff(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var n=e.fromIndex,r=void 0===n?0:n,o=e.toIndex,i=void 0===o?t.length:o;if(r<0||r>=t.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(i<=r||i>t.length||!Number.isInteger(i))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var a=t[r],u=r+1;u<i;u++)t[u]<a&&(a=t[u]);return a}(t),o=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!ff(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var n=e.fromIndex,r=void 0===n?0:n,o=e.toIndex,i=void 0===o?t.length:o;if(r<0||r>=t.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(i<=r||i>t.length||!Number.isInteger(i))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var a=t[r],u=r+1;u<i;u++)t[u]>a&&(a=t[u]);return a}(t);if(r===o)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var i=n.min,a=void 0===i?n.autoMinMax?r:0:i,u=n.max,s=void 0===u?n.autoMinMax?o:1:u;if(a>=s)throw new RangeError("min option must be smaller than max option");for(var c=(s-a)/(o-r),f=0;f<t.length;f++)e[f]=(t[f]-r)*c+a;return e}const df=" ".repeat(2),hf=" ".repeat(4);function pf(t,e={}){const{maxRows:n=15,maxColumns:r=10,maxNumSize:o=8,padMinus:i="auto"}=e;return`${t.constructor.name} {\n${df}[\n${hf}${function(t,e,n,r,o){const{rows:i,columns:a}=t,u=Math.min(i,e),s=Math.min(a,n),c=[];if("auto"===o){o=!1;t:for(let e=0;e<u;e++)for(let n=0;n<s;n++)if(t.get(e,n)<0){o=!0;break t}}for(let e=0;e<u;e++){let n=[];for(let i=0;i<s;i++)n.push(vf(t.get(e,i),r,o));c.push(`${n.join(" ")}`)}return s!==a&&(c[c.length-1]+=` ... ${a-n} more columns`),u!==i&&c.push(`... ${i-e} more rows`),c.join(`\n${hf}`)}(t,n,r,o,i)}\n${df}]\n${df}rows: ${t.rows}\n${df}columns: ${t.columns}\n}`}function vf(t,e,n){return(t>=0&&n?` ${gf(t,e-1)}`:gf(t,e)).padEnd(e)}function gf(t,e){let n=t.toString();if(n.length<=e)return n;let r=t.toFixed(e);if(r.length>e&&(r=t.toFixed(Math.max(0,e-(r.length-e)))),r.length<=e&&!r.startsWith("0.000")&&!r.startsWith("-0.000"))return r;let o=t.toExponential(e);return o.length>e&&(o=t.toExponential(Math.max(0,e-(o.length-e)))),o.slice(0)}function mf(t,e,n){let r=n?t.rows:t.rows-1;if(e<0||e>r)throw new RangeError("Row index out of range")}function yf(t,e,n){let r=n?t.columns:t.columns-1;if(e<0||e>r)throw new RangeError("Column index out of range")}function bf(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.columns)throw new RangeError("vector size must be the same as the number of columns");return e}function wf(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.rows)throw new RangeError("vector size must be the same as the number of rows");return e}function Ef(t,e,n,r,o){if(5!==arguments.length)throw new RangeError("expected 4 arguments");if(_f("startRow",e),_f("endRow",n),_f("startColumn",r),_f("endColumn",o),e>n||r>o||e<0||e>=t.rows||n<0||n>=t.rows||r<0||r>=t.columns||o<0||o>=t.columns)throw new RangeError("Submatrix indices are out of range")}function xf(t,e=0){let n=[];for(let r=0;r<t;r++)n.push(e);return n}function _f(t,e){if("number"!=typeof e)throw new TypeError(`${t} must be a number`)}function Sf(t){if(t.isEmpty())throw new Error("Empty matrix has no elements to index")}class Af{static from1DArray(t,e,n){if(t*e!==n.length)throw new RangeError("data length does not match given dimensions");let r=new Tf(t,e);for(let o=0;o<t;o++)for(let t=0;t<e;t++)r.set(o,t,n[o*e+t]);return r}static rowVector(t){let e=new Tf(1,t.length);for(let n=0;n<t.length;n++)e.set(0,n,t[n]);return e}static columnVector(t){let e=new Tf(t.length,1);for(let n=0;n<t.length;n++)e.set(n,0,t[n]);return e}static zeros(t,e){return new Tf(t,e)}static ones(t,e){return new Tf(t,e).fill(1)}static rand(t,e,n={}){if("object"!=typeof n)throw new TypeError("options must be an object");const{random:r=Math.random}=n;let o=new Tf(t,e);for(let n=0;n<t;n++)for(let t=0;t<e;t++)o.set(n,t,r());return o}static randInt(t,e,n={}){if("object"!=typeof n)throw new TypeError("options must be an object");const{min:r=0,max:o=1e3,random:i=Math.random}=n;if(!Number.isInteger(r))throw new TypeError("min must be an integer");if(!Number.isInteger(o))throw new TypeError("max must be an integer");if(r>=o)throw new RangeError("min must be smaller than max");let a=o-r,u=new Tf(t,e);for(let n=0;n<t;n++)for(let t=0;t<e;t++){let e=r+Math.round(i()*a);u.set(n,t,e)}return u}static eye(t,e,n){void 0===e&&(e=t),void 0===n&&(n=1);let r=Math.min(t,e),o=this.zeros(t,e);for(let t=0;t<r;t++)o.set(t,t,n);return o}static diag(t,e,n){let r=t.length;void 0===e&&(e=r),void 0===n&&(n=e);let o=Math.min(r,e,n),i=this.zeros(e,n);for(let e=0;e<o;e++)i.set(e,e,t[e]);return i}static min(t,e){t=this.checkMatrix(t),e=this.checkMatrix(e);let n=t.rows,r=t.columns,o=new Tf(n,r);for(let i=0;i<n;i++)for(let n=0;n<r;n++)o.set(i,n,Math.min(t.get(i,n),e.get(i,n)));return o}static max(t,e){t=this.checkMatrix(t),e=this.checkMatrix(e);let n=t.rows,r=t.columns,o=new this(n,r);for(let i=0;i<n;i++)for(let n=0;n<r;n++)o.set(i,n,Math.max(t.get(i,n),e.get(i,n)));return o}static checkMatrix(t){return Af.isMatrix(t)?t:new Tf(t)}static isMatrix(t){return null!=t&&"Matrix"===t.klass}get size(){return this.rows*this.columns}apply(t){if("function"!=typeof t)throw new TypeError("callback must be a function");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)t.call(this,e,n);return this}to1DArray(){let t=[];for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)t.push(this.get(e,n));return t}to2DArray(){let t=[];for(let e=0;e<this.rows;e++){t.push([]);for(let n=0;n<this.columns;n++)t[e].push(this.get(e,n))}return t}toJSON(){return this.to2DArray()}isRowVector(){return 1===this.rows}isColumnVector(){return 1===this.columns}isVector(){return 1===this.rows||1===this.columns}isSquare(){return this.rows===this.columns}isEmpty(){return 0===this.rows||0===this.columns}isSymmetric(){if(this.isSquare()){for(let t=0;t<this.rows;t++)for(let e=0;e<=t;e++)if(this.get(t,e)!==this.get(e,t))return!1;return!0}return!1}isEchelonForm(){let t=0,e=0,n=-1,r=!0,o=!1;for(;t<this.rows&&r;){for(e=0,o=!1;e<this.columns&&!1===o;)0===this.get(t,e)?e++:1===this.get(t,e)&&e>n?(o=!0,n=e):(r=!1,o=!0);t++}return r}isReducedEchelonForm(){let t=0,e=0,n=-1,r=!0,o=!1;for(;t<this.rows&&r;){for(e=0,o=!1;e<this.columns&&!1===o;)0===this.get(t,e)?e++:1===this.get(t,e)&&e>n?(o=!0,n=e):(r=!1,o=!0);for(let n=e+1;n<this.rows;n++)0!==this.get(t,n)&&(r=!1);t++}return r}echelonForm(){let t=this.clone(),e=0,n=0;for(;e<t.rows&&n<t.columns;){let r=e;for(let o=e;o<t.rows;o++)t.get(o,n)>t.get(r,n)&&(r=o);if(0===t.get(r,n))n++;else{t.swapRows(e,r);let o=t.get(e,n);for(let r=n;r<t.columns;r++)t.set(e,r,t.get(e,r)/o);for(let r=e+1;r<t.rows;r++){let o=t.get(r,n)/t.get(e,n);t.set(r,n,0);for(let i=n+1;i<t.columns;i++)t.set(r,i,t.get(r,i)-t.get(e,i)*o)}e++,n++}}return t}reducedEchelonForm(){let t=this.echelonForm(),e=t.columns,n=t.rows,r=n-1;for(;r>=0;)if(0===t.maxRow(r))r--;else{let o=0,i=!1;for(;o<n&&!1===i;)1===t.get(r,o)?i=!0:o++;for(let n=0;n<r;n++){let i=t.get(n,o);for(let a=o;a<e;a++){let e=t.get(n,a)-i*t.get(r,a);t.set(n,a,e)}}r--}return t}set(){throw new Error("set method is unimplemented")}get(){throw new Error("get method is unimplemented")}repeat(t={}){if("object"!=typeof t)throw new TypeError("options must be an object");const{rows:e=1,columns:n=1}=t;if(!Number.isInteger(e)||e<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(n)||n<=0)throw new TypeError("columns must be a positive integer");let r=new Tf(this.rows*e,this.columns*n);for(let t=0;t<e;t++)for(let e=0;e<n;e++)r.setSubMatrix(this,this.rows*t,this.columns*e);return r}fill(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,t);return this}neg(){return this.mulS(-1)}getRow(t){mf(this,t);let e=[];for(let n=0;n<this.columns;n++)e.push(this.get(t,n));return e}getRowVector(t){return Tf.rowVector(this.getRow(t))}setRow(t,e){mf(this,t),e=bf(this,e);for(let n=0;n<this.columns;n++)this.set(t,n,e[n]);return this}swapRows(t,e){mf(this,t),mf(this,e);for(let n=0;n<this.columns;n++){let r=this.get(t,n);this.set(t,n,this.get(e,n)),this.set(e,n,r)}return this}getColumn(t){yf(this,t);let e=[];for(let n=0;n<this.rows;n++)e.push(this.get(n,t));return e}getColumnVector(t){return Tf.columnVector(this.getColumn(t))}setColumn(t,e){yf(this,t),e=wf(this,e);for(let n=0;n<this.rows;n++)this.set(n,t,e[n]);return this}swapColumns(t,e){yf(this,t),yf(this,e);for(let n=0;n<this.rows;n++){let r=this.get(n,t);this.set(n,t,this.get(n,e)),this.set(n,e,r)}return this}addRowVector(t){t=bf(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t[n]);return this}subRowVector(t){t=bf(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t[n]);return this}mulRowVector(t){t=bf(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t[n]);return this}divRowVector(t){t=bf(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t[n]);return this}addColumnVector(t){t=wf(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t[e]);return this}subColumnVector(t){t=wf(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t[e]);return this}mulColumnVector(t){t=wf(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t[e]);return this}divColumnVector(t){t=wf(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t[e]);return this}mulRow(t,e){mf(this,t);for(let n=0;n<this.columns;n++)this.set(t,n,this.get(t,n)*e);return this}mulColumn(t,e){yf(this,t);for(let n=0;n<this.rows;n++)this.set(n,t,this.get(n,t)*e);return this}max(t){if(this.isEmpty())return NaN;switch(t){case"row":{const t=new Array(this.rows).fill(Number.NEGATIVE_INFINITY);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.get(e,n)>t[e]&&(t[e]=this.get(e,n));return t}case"column":{const t=new Array(this.columns).fill(Number.NEGATIVE_INFINITY);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.get(e,n)>t[n]&&(t[n]=this.get(e,n));return t}case void 0:{let t=this.get(0,0);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.get(e,n)>t&&(t=this.get(e,n));return t}default:throw new Error(`invalid option: ${t}`)}}maxIndex(){Sf(this);let t=this.get(0,0),e=[0,0];for(let n=0;n<this.rows;n++)for(let r=0;r<this.columns;r++)this.get(n,r)>t&&(t=this.get(n,r),e[0]=n,e[1]=r);return e}min(t){if(this.isEmpty())return NaN;switch(t){case"row":{const t=new Array(this.rows).fill(Number.POSITIVE_INFINITY);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.get(e,n)<t[e]&&(t[e]=this.get(e,n));return t}case"column":{const t=new Array(this.columns).fill(Number.POSITIVE_INFINITY);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.get(e,n)<t[n]&&(t[n]=this.get(e,n));return t}case void 0:{let t=this.get(0,0);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.get(e,n)<t&&(t=this.get(e,n));return t}default:throw new Error(`invalid option: ${t}`)}}minIndex(){Sf(this);let t=this.get(0,0),e=[0,0];for(let n=0;n<this.rows;n++)for(let r=0;r<this.columns;r++)this.get(n,r)<t&&(t=this.get(n,r),e[0]=n,e[1]=r);return e}maxRow(t){if(mf(this,t),this.isEmpty())return NaN;let e=this.get(t,0);for(let n=1;n<this.columns;n++)this.get(t,n)>e&&(e=this.get(t,n));return e}maxRowIndex(t){mf(this,t),Sf(this);let e=this.get(t,0),n=[t,0];for(let r=1;r<this.columns;r++)this.get(t,r)>e&&(e=this.get(t,r),n[1]=r);return n}minRow(t){if(mf(this,t),this.isEmpty())return NaN;let e=this.get(t,0);for(let n=1;n<this.columns;n++)this.get(t,n)<e&&(e=this.get(t,n));return e}minRowIndex(t){mf(this,t),Sf(this);let e=this.get(t,0),n=[t,0];for(let r=1;r<this.columns;r++)this.get(t,r)<e&&(e=this.get(t,r),n[1]=r);return n}maxColumn(t){if(yf(this,t),this.isEmpty())return NaN;let e=this.get(0,t);for(let n=1;n<this.rows;n++)this.get(n,t)>e&&(e=this.get(n,t));return e}maxColumnIndex(t){yf(this,t),Sf(this);let e=this.get(0,t),n=[0,t];for(let r=1;r<this.rows;r++)this.get(r,t)>e&&(e=this.get(r,t),n[0]=r);return n}minColumn(t){if(yf(this,t),this.isEmpty())return NaN;let e=this.get(0,t);for(let n=1;n<this.rows;n++)this.get(n,t)<e&&(e=this.get(n,t));return e}minColumnIndex(t){yf(this,t),Sf(this);let e=this.get(0,t),n=[0,t];for(let r=1;r<this.rows;r++)this.get(r,t)<e&&(e=this.get(r,t),n[0]=r);return n}diag(){let t=Math.min(this.rows,this.columns),e=[];for(let n=0;n<t;n++)e.push(this.get(n,n));return e}norm(t="frobenius"){let e=0;if("max"===t)return this.max();if("frobenius"===t){for(let t=0;t<this.rows;t++)for(let n=0;n<this.columns;n++)e+=this.get(t,n)*this.get(t,n);return Math.sqrt(e)}throw new RangeError(`unknown norm type: ${t}`)}cumulativeSum(){let t=0;for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)t+=this.get(e,n),this.set(e,n,t);return this}dot(t){Af.isMatrix(t)&&(t=t.to1DArray());let e=this.to1DArray();if(e.length!==t.length)throw new RangeError("vectors do not have the same size");let n=0;for(let r=0;r<e.length;r++)n+=e[r]*t[r];return n}mmul(t){t=Tf.checkMatrix(t);let e=this.rows,n=this.columns,r=t.columns,o=new Tf(e,r),i=new Float64Array(n);for(let a=0;a<r;a++){for(let e=0;e<n;e++)i[e]=t.get(e,a);for(let t=0;t<e;t++){let e=0;for(let r=0;r<n;r++)e+=this.get(t,r)*i[r];o.set(t,a,e)}}return o}strassen2x2(t){t=Tf.checkMatrix(t);let e=new Tf(2,2);const n=this.get(0,0),r=t.get(0,0),o=this.get(0,1),i=t.get(0,1),a=this.get(1,0),u=t.get(1,0),s=this.get(1,1),c=t.get(1,1),f=(n+s)*(r+c),l=(a+s)*r,d=n*(i-c),h=s*(u-r),p=(n+o)*c,v=f+h-p+(o-s)*(u+c),g=d+p,m=l+h,y=f-l+d+(a-n)*(r+i);return e.set(0,0,v),e.set(0,1,g),e.set(1,0,m),e.set(1,1,y),e}strassen3x3(t){t=Tf.checkMatrix(t);let e=new Tf(3,3);const n=this.get(0,0),r=this.get(0,1),o=this.get(0,2),i=this.get(1,0),a=this.get(1,1),u=this.get(1,2),s=this.get(2,0),c=this.get(2,1),f=this.get(2,2),l=t.get(0,0),d=t.get(0,1),h=t.get(0,2),p=t.get(1,0),v=t.get(1,1),g=t.get(1,2),m=t.get(2,0),y=t.get(2,1),b=t.get(2,2),w=(n-i)*(-d+v),E=(-n+i+a)*(l-d+v),x=(i+a)*(-l+d),_=n*l,S=(-n+s+c)*(l-h+g),A=(-n+s)*(h-g),I=(s+c)*(-l+h),T=(-o+c+f)*(v+m-y),O=(o-f)*(v-y),N=o*m,D=(c+f)*(-m+y),M=(-o+a+u)*(g+m-b),k=(o-u)*(g-b),R=(a+u)*(-m+b),C=_+N+r*p,L=(n+r+o-i-a-c-f)*v+E+x+_+T+N+D,P=_+S+I+(n+r+o-a-u-s-c)*g+N+M+R,j=w+a*(-l+d+p-v-g-m+b)+E+_+N+M+k,z=w+E+x+_+u*y,F=N+M+k+R+i*h,G=_+S+A+c*(-l+h+p-v-g-m+y)+T+O+N,U=T+O+N+D+s*d,B=_+S+A+I+f*b;return e.set(0,0,C),e.set(0,1,L),e.set(0,2,P),e.set(1,0,j),e.set(1,1,z),e.set(1,2,F),e.set(2,0,G),e.set(2,1,U),e.set(2,2,B),e}mmulStrassen(t){t=Tf.checkMatrix(t);let e=this.clone(),n=e.rows,r=e.columns,o=t.rows,i=t.columns;function a(t,e,n){let r=t.rows,o=t.columns;if(r===e&&o===n)return t;{let r=Af.zeros(e,n);return r=r.setSubMatrix(t,0,0),r}}r!==o&&console.warn(`Multiplying ${n} x ${r} and ${o} x ${i} matrix: dimensions do not match.`);let u=Math.max(n,o),s=Math.max(r,i);return e=a(e,u,s),function t(e,n,r,o){if(r<=512||o<=512)return e.mmul(n);r%2==1&&o%2==1?(e=a(e,r+1,o+1),n=a(n,r+1,o+1)):r%2==1?(e=a(e,r+1,o),n=a(n,r+1,o)):o%2==1&&(e=a(e,r,o+1),n=a(n,r,o+1));let i=parseInt(e.rows/2,10),u=parseInt(e.columns/2,10),s=e.subMatrix(0,i-1,0,u-1),c=n.subMatrix(0,i-1,0,u-1),f=e.subMatrix(0,i-1,u,e.columns-1),l=n.subMatrix(0,i-1,u,n.columns-1),d=e.subMatrix(i,e.rows-1,0,u-1),h=n.subMatrix(i,n.rows-1,0,u-1),p=e.subMatrix(i,e.rows-1,u,e.columns-1),v=n.subMatrix(i,n.rows-1,u,n.columns-1),g=t(Af.add(s,p),Af.add(c,v),i,u),m=t(Af.add(d,p),c,i,u),y=t(s,Af.sub(l,v),i,u),b=t(p,Af.sub(h,c),i,u),w=t(Af.add(s,f),v,i,u),E=t(Af.sub(d,s),Af.add(c,l),i,u),x=t(Af.sub(f,p),Af.add(h,v),i,u),_=Af.add(g,b);_.sub(w),_.add(x);let S=Af.add(y,w),A=Af.add(m,b),I=Af.sub(g,m);I.add(y),I.add(E);let T=Af.zeros(2*_.rows,2*_.columns);return T=T.setSubMatrix(_,0,0),T=T.setSubMatrix(S,_.rows,0),T=T.setSubMatrix(A,0,_.columns),T=T.setSubMatrix(I,_.rows,_.columns),T.subMatrix(0,r-1,0,o-1)}(e,t=a(t,u,s),u,s)}scaleRows(t={}){if("object"!=typeof t)throw new TypeError("options must be an object");const{min:e=0,max:n=1}=t;if(!Number.isFinite(e))throw new TypeError("min must be a number");if(!Number.isFinite(n))throw new TypeError("max must be a number");if(e>=n)throw new RangeError("min must be smaller than max");let r=new Tf(this.rows,this.columns);for(let t=0;t<this.rows;t++){const o=this.getRow(t);o.length>0&&lf(o,{min:e,max:n,output:o}),r.setRow(t,o)}return r}scaleColumns(t={}){if("object"!=typeof t)throw new TypeError("options must be an object");const{min:e=0,max:n=1}=t;if(!Number.isFinite(e))throw new TypeError("min must be a number");if(!Number.isFinite(n))throw new TypeError("max must be a number");if(e>=n)throw new RangeError("min must be smaller than max");let r=new Tf(this.rows,this.columns);for(let t=0;t<this.columns;t++){const o=this.getColumn(t);o.length&&lf(o,{min:e,max:n,output:o}),r.setColumn(t,o)}return r}flipRows(){const t=Math.ceil(this.columns/2);for(let e=0;e<this.rows;e++)for(let n=0;n<t;n++){let t=this.get(e,n),r=this.get(e,this.columns-1-n);this.set(e,n,r),this.set(e,this.columns-1-n,t)}return this}flipColumns(){const t=Math.ceil(this.rows/2);for(let e=0;e<this.columns;e++)for(let n=0;n<t;n++){let t=this.get(n,e),r=this.get(this.rows-1-n,e);this.set(n,e,r),this.set(this.rows-1-n,e,t)}return this}kroneckerProduct(t){t=Tf.checkMatrix(t);let e=this.rows,n=this.columns,r=t.rows,o=t.columns,i=new Tf(e*r,n*o);for(let a=0;a<e;a++)for(let e=0;e<n;e++)for(let n=0;n<r;n++)for(let u=0;u<o;u++)i.set(r*a+n,o*e+u,this.get(a,e)*t.get(n,u));return i}kroneckerSum(t){if(t=Tf.checkMatrix(t),!this.isSquare()||!t.isSquare())throw new Error("Kronecker Sum needs two Square Matrices");let e=this.rows,n=t.rows,r=this.kroneckerProduct(Tf.eye(n,n)),o=Tf.eye(e,e).kroneckerProduct(t);return r.add(o)}transpose(){let t=new Tf(this.columns,this.rows);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)t.set(n,e,this.get(e,n));return t}sortRows(t=If){for(let e=0;e<this.rows;e++)this.setRow(e,this.getRow(e).sort(t));return this}sortColumns(t=If){for(let e=0;e<this.columns;e++)this.setColumn(e,this.getColumn(e).sort(t));return this}subMatrix(t,e,n,r){Ef(this,t,e,n,r);let o=new Tf(e-t+1,r-n+1);for(let i=t;i<=e;i++)for(let e=n;e<=r;e++)o.set(i-t,e-n,this.get(i,e));return o}subMatrixRow(t,e,n){if(void 0===e&&(e=0),void 0===n&&(n=this.columns-1),e>n||e<0||e>=this.columns||n<0||n>=this.columns)throw new RangeError("Argument out of range");let r=new Tf(t.length,n-e+1);for(let o=0;o<t.length;o++)for(let i=e;i<=n;i++){if(t[o]<0||t[o]>=this.rows)throw new RangeError(`Row index out of range: ${t[o]}`);r.set(o,i-e,this.get(t[o],i))}return r}subMatrixColumn(t,e,n){if(void 0===e&&(e=0),void 0===n&&(n=this.rows-1),e>n||e<0||e>=this.rows||n<0||n>=this.rows)throw new RangeError("Argument out of range");let r=new Tf(n-e+1,t.length);for(let o=0;o<t.length;o++)for(let i=e;i<=n;i++){if(t[o]<0||t[o]>=this.columns)throw new RangeError(`Column index out of range: ${t[o]}`);r.set(i-e,o,this.get(i,t[o]))}return r}setSubMatrix(t,e,n){if((t=Tf.checkMatrix(t)).isEmpty())return this;Ef(this,e,e+t.rows-1,n,n+t.columns-1);for(let r=0;r<t.rows;r++)for(let o=0;o<t.columns;o++)this.set(e+r,n+o,t.get(r,o));return this}selection(t,e){!function(t,e){if(!ff(e))throw new TypeError("row indices must be an array");for(let n=0;n<e.length;n++)if(e[n]<0||e[n]>=t.rows)throw new RangeError("row indices are out of range")}(this,t),function(t,e){if(!ff(e))throw new TypeError("column indices must be an array");for(let n=0;n<e.length;n++)if(e[n]<0||e[n]>=t.columns)throw new RangeError("column indices are out of range")}(this,e);let n=new Tf(t.length,e.length);for(let r=0;r<t.length;r++){let o=t[r];for(let t=0;t<e.length;t++){let i=e[t];n.set(r,t,this.get(o,i))}}return n}trace(){let t=Math.min(this.rows,this.columns),e=0;for(let n=0;n<t;n++)e+=this.get(n,n);return e}clone(){let t=new Tf(this.rows,this.columns);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)t.set(e,n,this.get(e,n));return t}sum(t){switch(t){case"row":return function(t){let e=xf(t.rows);for(let n=0;n<t.rows;++n)for(let r=0;r<t.columns;++r)e[n]+=t.get(n,r);return e}(this);case"column":return function(t){let e=xf(t.columns);for(let n=0;n<t.rows;++n)for(let r=0;r<t.columns;++r)e[r]+=t.get(n,r);return e}(this);case void 0:return function(t){let e=0;for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)e+=t.get(n,r);return e}(this);default:throw new Error(`invalid option: ${t}`)}}product(t){switch(t){case"row":return function(t){let e=xf(t.rows,1);for(let n=0;n<t.rows;++n)for(let r=0;r<t.columns;++r)e[n]*=t.get(n,r);return e}(this);case"column":return function(t){let e=xf(t.columns,1);for(let n=0;n<t.rows;++n)for(let r=0;r<t.columns;++r)e[r]*=t.get(n,r);return e}(this);case void 0:return function(t){let e=1;for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)e*=t.get(n,r);return e}(this);default:throw new Error(`invalid option: ${t}`)}}mean(t){const e=this.sum(t);switch(t){case"row":for(let t=0;t<this.rows;t++)e[t]/=this.columns;return e;case"column":for(let t=0;t<this.columns;t++)e[t]/=this.rows;return e;case void 0:return e/this.size;default:throw new Error(`invalid option: ${t}`)}}variance(t,e={}){if("object"==typeof t&&(e=t,t=void 0),"object"!=typeof e)throw new TypeError("options must be an object");const{unbiased:n=!0,mean:r=this.mean(t)}=e;if("boolean"!=typeof n)throw new TypeError("unbiased must be a boolean");switch(t){case"row":if(!ff(r))throw new TypeError("mean must be an array");return function(t,e,n){const r=t.rows,o=t.columns,i=[];for(let a=0;a<r;a++){let r=0,u=0,s=0;for(let e=0;e<o;e++)s=t.get(a,e)-n[a],r+=s,u+=s*s;e?i.push((u-r*r/o)/(o-1)):i.push((u-r*r/o)/o)}return i}(this,n,r);case"column":if(!ff(r))throw new TypeError("mean must be an array");return function(t,e,n){const r=t.rows,o=t.columns,i=[];for(let a=0;a<o;a++){let o=0,u=0,s=0;for(let e=0;e<r;e++)s=t.get(e,a)-n[a],o+=s,u+=s*s;e?i.push((u-o*o/r)/(r-1)):i.push((u-o*o/r)/r)}return i}(this,n,r);case void 0:if("number"!=typeof r)throw new TypeError("mean must be a number");return function(t,e,n){const r=t.rows,o=t.columns,i=r*o;let a=0,u=0,s=0;for(let e=0;e<r;e++)for(let r=0;r<o;r++)s=t.get(e,r)-n,a+=s,u+=s*s;return e?(u-a*a/i)/(i-1):(u-a*a/i)/i}(this,n,r);default:throw new Error(`invalid option: ${t}`)}}standardDeviation(t,e){"object"==typeof t&&(e=t,t=void 0);const n=this.variance(t,e);if(void 0===t)return Math.sqrt(n);for(let t=0;t<n.length;t++)n[t]=Math.sqrt(n[t]);return n}center(t,e={}){if("object"==typeof t&&(e=t,t=void 0),"object"!=typeof e)throw new TypeError("options must be an object");const{center:n=this.mean(t)}=e;switch(t){case"row":if(!ff(n))throw new TypeError("center must be an array");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)-e[n])}(this,n),this;case"column":if(!ff(n))throw new TypeError("center must be an array");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)-e[r])}(this,n),this;case void 0:if("number"!=typeof n)throw new TypeError("center must be a number");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)-e)}(this,n),this;default:throw new Error(`invalid option: ${t}`)}}scale(t,e={}){if("object"==typeof t&&(e=t,t=void 0),"object"!=typeof e)throw new TypeError("options must be an object");let n=e.scale;switch(t){case"row":if(void 0===n)n=function(t){const e=[];for(let n=0;n<t.rows;n++){let r=0;for(let e=0;e<t.columns;e++)r+=Math.pow(t.get(n,e),2)/(t.columns-1);e.push(Math.sqrt(r))}return e}(this);else if(!ff(n))throw new TypeError("scale must be an array");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)/e[n])}(this,n),this;case"column":if(void 0===n)n=function(t){const e=[];for(let n=0;n<t.columns;n++){let r=0;for(let e=0;e<t.rows;e++)r+=Math.pow(t.get(e,n),2)/(t.rows-1);e.push(Math.sqrt(r))}return e}(this);else if(!ff(n))throw new TypeError("scale must be an array");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)/e[r])}(this,n),this;case void 0:if(void 0===n)n=function(t){const e=t.size-1;let n=0;for(let r=0;r<t.columns;r++)for(let o=0;o<t.rows;o++)n+=Math.pow(t.get(o,r),2)/e;return Math.sqrt(n)}(this);else if("number"!=typeof n)throw new TypeError("scale must be a number");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)/e)}(this,n),this;default:throw new Error(`invalid option: ${t}`)}}toString(t){return pf(this,t)}}function If(t,e){return t-e}Af.prototype.klass="Matrix","undefined"!=typeof Symbol&&(Af.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return pf(this)}),Af.random=Af.rand,Af.randomInt=Af.randInt,Af.diagonal=Af.diag,Af.prototype.diagonal=Af.prototype.diag,Af.identity=Af.eye,Af.prototype.negate=Af.prototype.neg,Af.prototype.tensorProduct=Af.prototype.kroneckerProduct;class Tf extends Af{constructor(t,e){if(super(),Tf.isMatrix(t))return t.clone();if(Number.isInteger(t)&&t>=0){if(this.data=[],!(Number.isInteger(e)&&e>=0))throw new TypeError("nColumns must be a positive integer");for(let n=0;n<t;n++)this.data.push(new Float64Array(e))}else{if(!ff(t))throw new TypeError("First argument must be a positive number or an array");{const n=t;if("number"!=typeof(e=(t=n.length)?n[0].length:0))throw new TypeError("Data must be a 2D array with at least one element");this.data=[];for(let r=0;r<t;r++){if(n[r].length!==e)throw new RangeError("Inconsistent array dimensions");if(!n[r].every((t=>"number"==typeof t)))throw new TypeError("Input data contains non-numeric values");this.data.push(Float64Array.from(n[r]))}}}this.rows=t,this.columns=e}set(t,e,n){return this.data[t][e]=n,this}get(t,e){return this.data[t][e]}removeRow(t){return mf(this,t),this.data.splice(t,1),this.rows-=1,this}addRow(t,e){return void 0===e&&(e=t,t=this.rows),mf(this,t,!0),e=Float64Array.from(bf(this,e)),this.data.splice(t,0,e),this.rows+=1,this}removeColumn(t){yf(this,t);for(let e=0;e<this.rows;e++){const n=new Float64Array(this.columns-1);for(let r=0;r<t;r++)n[r]=this.data[e][r];for(let r=t+1;r<this.columns;r++)n[r-1]=this.data[e][r];this.data[e]=n}return this.columns-=1,this}addColumn(t,e){void 0===e&&(e=t,t=this.columns),yf(this,t,!0),e=wf(this,e);for(let n=0;n<this.rows;n++){const r=new Float64Array(this.columns+1);let o=0;for(;o<t;o++)r[o]=this.data[n][o];for(r[o++]=e[n];o<this.columns+1;o++)r[o]=this.data[n][o-1];this.data[n]=r}return this.columns+=1,this}}!function(t,e){t.prototype.add=function(t){return"number"==typeof t?this.addS(t):this.addM(t)},t.prototype.addS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t);return this},t.prototype.addM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t.get(e,n));return this},t.add=function(t,n){return new e(t).add(n)},t.prototype.sub=function(t){return"number"==typeof t?this.subS(t):this.subM(t)},t.prototype.subS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t);return this},t.prototype.subM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t.get(e,n));return this},t.sub=function(t,n){return new e(t).sub(n)},t.prototype.subtract=t.prototype.sub,t.prototype.subtractS=t.prototype.subS,t.prototype.subtractM=t.prototype.subM,t.subtract=t.sub,t.prototype.mul=function(t){return"number"==typeof t?this.mulS(t):this.mulM(t)},t.prototype.mulS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t);return this},t.prototype.mulM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t.get(e,n));return this},t.mul=function(t,n){return new e(t).mul(n)},t.prototype.multiply=t.prototype.mul,t.prototype.multiplyS=t.prototype.mulS,t.prototype.multiplyM=t.prototype.mulM,t.multiply=t.mul,t.prototype.div=function(t){return"number"==typeof t?this.divS(t):this.divM(t)},t.prototype.divS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t);return this},t.prototype.divM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t.get(e,n));return this},t.div=function(t,n){return new e(t).div(n)},t.prototype.divide=t.prototype.div,t.prototype.divideS=t.prototype.divS,t.prototype.divideM=t.prototype.divM,t.divide=t.div,t.prototype.mod=function(t){return"number"==typeof t?this.modS(t):this.modM(t)},t.prototype.modS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)%t);return this},t.prototype.modM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)%t.get(e,n));return this},t.mod=function(t,n){return new e(t).mod(n)},t.prototype.modulus=t.prototype.mod,t.prototype.modulusS=t.prototype.modS,t.prototype.modulusM=t.prototype.modM,t.modulus=t.mod,t.prototype.and=function(t){return"number"==typeof t?this.andS(t):this.andM(t)},t.prototype.andS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)&t);return this},t.prototype.andM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)&t.get(e,n));return this},t.and=function(t,n){return new e(t).and(n)},t.prototype.or=function(t){return"number"==typeof t?this.orS(t):this.orM(t)},t.prototype.orS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)|t);return this},t.prototype.orM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)|t.get(e,n));return this},t.or=function(t,n){return new e(t).or(n)},t.prototype.xor=function(t){return"number"==typeof t?this.xorS(t):this.xorM(t)},t.prototype.xorS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)^t);return this},t.prototype.xorM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)^t.get(e,n));return this},t.xor=function(t,n){return new e(t).xor(n)},t.prototype.leftShift=function(t){return"number"==typeof t?this.leftShiftS(t):this.leftShiftM(t)},t.prototype.leftShiftS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)<<t);return this},t.prototype.leftShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)<<t.get(e,n));return this},t.leftShift=function(t,n){return new e(t).leftShift(n)},t.prototype.signPropagatingRightShift=function(t){return"number"==typeof t?this.signPropagatingRightShiftS(t):this.signPropagatingRightShiftM(t)},t.prototype.signPropagatingRightShiftS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>t);return this},t.prototype.signPropagatingRightShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>t.get(e,n));return this},t.signPropagatingRightShift=function(t,n){return new e(t).signPropagatingRightShift(n)},t.prototype.rightShift=function(t){return"number"==typeof t?this.rightShiftS(t):this.rightShiftM(t)},t.prototype.rightShiftS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>>t);return this},t.prototype.rightShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>>t.get(e,n));return this},t.rightShift=function(t,n){return new e(t).rightShift(n)},t.prototype.zeroFillRightShift=t.prototype.rightShift,t.prototype.zeroFillRightShiftS=t.prototype.rightShiftS,t.prototype.zeroFillRightShiftM=t.prototype.rightShiftM,t.zeroFillRightShift=t.rightShift,t.prototype.not=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,~this.get(t,e));return this},t.not=function(t){return new e(t).not()},t.prototype.abs=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.abs(this.get(t,e)));return this},t.abs=function(t){return new e(t).abs()},t.prototype.acos=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.acos(this.get(t,e)));return this},t.acos=function(t){return new e(t).acos()},t.prototype.acosh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.acosh(this.get(t,e)));return this},t.acosh=function(t){return new e(t).acosh()},t.prototype.asin=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.asin(this.get(t,e)));return this},t.asin=function(t){return new e(t).asin()},t.prototype.asinh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.asinh(this.get(t,e)));return this},t.asinh=function(t){return new e(t).asinh()},t.prototype.atan=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.atan(this.get(t,e)));return this},t.atan=function(t){return new e(t).atan()},t.prototype.atanh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.atanh(this.get(t,e)));return this},t.atanh=function(t){return new e(t).atanh()},t.prototype.cbrt=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.cbrt(this.get(t,e)));return this},t.cbrt=function(t){return new e(t).cbrt()},t.prototype.ceil=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.ceil(this.get(t,e)));return this},t.ceil=function(t){return new e(t).ceil()},t.prototype.clz32=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.clz32(this.get(t,e)));return this},t.clz32=function(t){return new e(t).clz32()},t.prototype.cos=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.cos(this.get(t,e)));return this},t.cos=function(t){return new e(t).cos()},t.prototype.cosh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.cosh(this.get(t,e)));return this},t.cosh=function(t){return new e(t).cosh()},t.prototype.exp=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.exp(this.get(t,e)));return this},t.exp=function(t){return new e(t).exp()},t.prototype.expm1=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.expm1(this.get(t,e)));return this},t.expm1=function(t){return new e(t).expm1()},t.prototype.floor=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.floor(this.get(t,e)));return this},t.floor=function(t){return new e(t).floor()},t.prototype.fround=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.fround(this.get(t,e)));return this},t.fround=function(t){return new e(t).fround()},t.prototype.log=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.log(this.get(t,e)));return this},t.log=function(t){return new e(t).log()},t.prototype.log1p=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.log1p(this.get(t,e)));return this},t.log1p=function(t){return new e(t).log1p()},t.prototype.log10=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.log10(this.get(t,e)));return this},t.log10=function(t){return new e(t).log10()},t.prototype.log2=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.log2(this.get(t,e)));return this},t.log2=function(t){return new e(t).log2()},t.prototype.round=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.round(this.get(t,e)));return this},t.round=function(t){return new e(t).round()},t.prototype.sign=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.sign(this.get(t,e)));return this},t.sign=function(t){return new e(t).sign()},t.prototype.sin=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.sin(this.get(t,e)));return this},t.sin=function(t){return new e(t).sin()},t.prototype.sinh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.sinh(this.get(t,e)));return this},t.sinh=function(t){return new e(t).sinh()},t.prototype.sqrt=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.sqrt(this.get(t,e)));return this},t.sqrt=function(t){return new e(t).sqrt()},t.prototype.tan=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.tan(this.get(t,e)));return this},t.tan=function(t){return new e(t).tan()},t.prototype.tanh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.tanh(this.get(t,e)));return this},t.tanh=function(t){return new e(t).tanh()},t.prototype.trunc=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.trunc(this.get(t,e)));return this},t.trunc=function(t){return new e(t).trunc()},t.pow=function(t,n){return new e(t).pow(n)},t.prototype.pow=function(t){return"number"==typeof t?this.powS(t):this.powM(t)},t.prototype.powS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,Math.pow(this.get(e,n),t));return this},t.prototype.powM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,Math.pow(this.get(e,n),t.get(e,n)));return this}}(Af,Tf);class Of extends Af{constructor(t){super(),this.data=t,this.rows=t.length,this.columns=t[0].length}set(t,e,n){return this.data[t][e]=n,this}get(t,e){return this.data[t][e]}}function Nf(t,e){let n=0;return Math.abs(t)>Math.abs(e)?(n=e/t,Math.abs(t)*Math.sqrt(1+n*n)):0!==e?(n=t/e,Math.abs(e)*Math.sqrt(1+n*n)):0}class Df{constructor(t,e={}){if((t=Of.checkMatrix(t)).isEmpty())throw new Error("Matrix must be non-empty");let n=t.rows,r=t.columns;const{computeLeftSingularVectors:o=!0,computeRightSingularVectors:i=!0,autoTranspose:a=!1}=e;let u,s=Boolean(o),c=Boolean(i),f=!1;if(n<r)if(a){u=t.transpose(),n=u.rows,r=u.columns,f=!0;let e=s;s=c,c=e}else u=t.clone(),console.warn("Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose");else u=t.clone();let l=Math.min(n,r),d=Math.min(n+1,r),h=new Float64Array(d),p=new Tf(n,l),v=new Tf(r,r),g=new Float64Array(r),m=new Float64Array(n),y=new Float64Array(d);for(let t=0;t<d;t++)y[t]=t;let b=Math.min(n-1,r),w=Math.max(0,Math.min(r-2,n)),E=Math.max(b,w);for(let t=0;t<E;t++){if(t<b){h[t]=0;for(let e=t;e<n;e++)h[t]=Nf(h[t],u.get(e,t));if(0!==h[t]){u.get(t,t)<0&&(h[t]=-h[t]);for(let e=t;e<n;e++)u.set(e,t,u.get(e,t)/h[t]);u.set(t,t,u.get(t,t)+1)}h[t]=-h[t]}for(let e=t+1;e<r;e++){if(t<b&&0!==h[t]){let r=0;for(let o=t;o<n;o++)r+=u.get(o,t)*u.get(o,e);r=-r/u.get(t,t);for(let o=t;o<n;o++)u.set(o,e,u.get(o,e)+r*u.get(o,t))}g[e]=u.get(t,e)}if(s&&t<b)for(let e=t;e<n;e++)p.set(e,t,u.get(e,t));if(t<w){g[t]=0;for(let e=t+1;e<r;e++)g[t]=Nf(g[t],g[e]);if(0!==g[t]){g[t+1]<0&&(g[t]=0-g[t]);for(let e=t+1;e<r;e++)g[e]/=g[t];g[t+1]+=1}if(g[t]=-g[t],t+1<n&&0!==g[t]){for(let e=t+1;e<n;e++)m[e]=0;for(let e=t+1;e<n;e++)for(let n=t+1;n<r;n++)m[e]+=g[n]*u.get(e,n);for(let e=t+1;e<r;e++){let r=-g[e]/g[t+1];for(let o=t+1;o<n;o++)u.set(o,e,u.get(o,e)+r*m[o])}}if(c)for(let e=t+1;e<r;e++)v.set(e,t,g[e])}}let x=Math.min(r,n+1);if(b<r&&(h[b]=u.get(b,b)),n<x&&(h[x-1]=0),w+1<x&&(g[w]=u.get(w,x-1)),g[x-1]=0,s){for(let t=b;t<l;t++){for(let e=0;e<n;e++)p.set(e,t,0);p.set(t,t,1)}for(let t=b-1;t>=0;t--)if(0!==h[t]){for(let e=t+1;e<l;e++){let r=0;for(let o=t;o<n;o++)r+=p.get(o,t)*p.get(o,e);r=-r/p.get(t,t);for(let o=t;o<n;o++)p.set(o,e,p.get(o,e)+r*p.get(o,t))}for(let e=t;e<n;e++)p.set(e,t,-p.get(e,t));p.set(t,t,1+p.get(t,t));for(let e=0;e<t-1;e++)p.set(e,t,0)}else{for(let e=0;e<n;e++)p.set(e,t,0);p.set(t,t,1)}}if(c)for(let t=r-1;t>=0;t--){if(t<w&&0!==g[t])for(let e=t+1;e<r;e++){let n=0;for(let o=t+1;o<r;o++)n+=v.get(o,t)*v.get(o,e);n=-n/v.get(t+1,t);for(let o=t+1;o<r;o++)v.set(o,e,v.get(o,e)+n*v.get(o,t))}for(let e=0;e<r;e++)v.set(e,t,0);v.set(t,t,1)}let _=x-1,S=0,A=Number.EPSILON;for(;x>0;){let t,e;for(t=x-2;t>=-1&&-1!==t;t--){const e=Number.MIN_VALUE+A*Math.abs(h[t]+Math.abs(h[t+1]));if(Math.abs(g[t])<=e||Number.isNaN(g[t])){g[t]=0;break}}if(t===x-2)e=4;else{let n;for(n=x-1;n>=t&&n!==t;n--){let e=(n!==x?Math.abs(g[n]):0)+(n!==t+1?Math.abs(g[n-1]):0);if(Math.abs(h[n])<=A*e){h[n]=0;break}}n===t?e=3:n===x-1?e=1:(e=2,t=n)}switch(t++,e){case 1:{let e=g[x-2];g[x-2]=0;for(let n=x-2;n>=t;n--){let o=Nf(h[n],e),i=h[n]/o,a=e/o;if(h[n]=o,n!==t&&(e=-a*g[n-1],g[n-1]=i*g[n-1]),c)for(let t=0;t<r;t++)o=i*v.get(t,n)+a*v.get(t,x-1),v.set(t,x-1,-a*v.get(t,n)+i*v.get(t,x-1)),v.set(t,n,o)}break}case 2:{let e=g[t-1];g[t-1]=0;for(let r=t;r<x;r++){let o=Nf(h[r],e),i=h[r]/o,a=e/o;if(h[r]=o,e=-a*g[r],g[r]=i*g[r],s)for(let e=0;e<n;e++)o=i*p.get(e,r)+a*p.get(e,t-1),p.set(e,t-1,-a*p.get(e,r)+i*p.get(e,t-1)),p.set(e,r,o)}break}case 3:{const e=Math.max(Math.abs(h[x-1]),Math.abs(h[x-2]),Math.abs(g[x-2]),Math.abs(h[t]),Math.abs(g[t])),o=h[x-1]/e,i=h[x-2]/e,a=g[x-2]/e,u=h[t]/e,f=g[t]/e,l=((i+o)*(i-o)+a*a)/2,d=o*a*(o*a);let m=0;0===l&&0===d||(m=l<0?0-Math.sqrt(l*l+d):Math.sqrt(l*l+d),m=d/(l+m));let y=(u+o)*(u-o)+m,b=u*f;for(let e=t;e<x-1;e++){let o=Nf(y,b);0===o&&(o=Number.MIN_VALUE);let i=y/o,a=b/o;if(e!==t&&(g[e-1]=o),y=i*h[e]+a*g[e],g[e]=i*g[e]-a*h[e],b=a*h[e+1],h[e+1]=i*h[e+1],c)for(let t=0;t<r;t++)o=i*v.get(t,e)+a*v.get(t,e+1),v.set(t,e+1,-a*v.get(t,e)+i*v.get(t,e+1)),v.set(t,e,o);if(o=Nf(y,b),0===o&&(o=Number.MIN_VALUE),i=y/o,a=b/o,h[e]=o,y=i*g[e]+a*h[e+1],h[e+1]=-a*g[e]+i*h[e+1],b=a*g[e+1],g[e+1]=i*g[e+1],s&&e<n-1)for(let t=0;t<n;t++)o=i*p.get(t,e)+a*p.get(t,e+1),p.set(t,e+1,-a*p.get(t,e)+i*p.get(t,e+1)),p.set(t,e,o)}g[x-2]=y,S+=1;break}case 4:if(h[t]<=0&&(h[t]=h[t]<0?-h[t]:0,c))for(let e=0;e<=_;e++)v.set(e,t,-v.get(e,t));for(;t<_&&!(h[t]>=h[t+1]);){let e=h[t];if(h[t]=h[t+1],h[t+1]=e,c&&t<r-1)for(let n=0;n<r;n++)e=v.get(n,t+1),v.set(n,t+1,v.get(n,t)),v.set(n,t,e);if(s&&t<n-1)for(let r=0;r<n;r++)e=p.get(r,t+1),p.set(r,t+1,p.get(r,t)),p.set(r,t,e);t++}S=0,x--}}if(f){let t=v;v=p,p=t}this.m=n,this.n=r,this.s=h,this.U=p,this.V=v}solve(t){let e=t,n=this.threshold,r=this.s.length,o=Tf.zeros(r,r);for(let t=0;t<r;t++)Math.abs(this.s[t])<=n?o.set(t,t,0):o.set(t,t,1/this.s[t]);let i=this.U,a=this.rightSingularVectors,u=a.mmul(o),s=a.rows,c=i.rows,f=Tf.zeros(s,c);for(let t=0;t<s;t++)for(let e=0;e<c;e++){let n=0;for(let o=0;o<r;o++)n+=u.get(t,o)*i.get(e,o);f.set(t,e,n)}return f.mmul(e)}solveForDiagonal(t){return this.solve(Tf.diag(t))}inverse(){let t=this.V,e=this.threshold,n=t.rows,r=t.columns,o=new Tf(n,this.s.length);for(let i=0;i<n;i++)for(let n=0;n<r;n++)Math.abs(this.s[n])>e&&o.set(i,n,t.get(i,n)/this.s[n]);let i=this.U,a=i.rows,u=i.columns,s=new Tf(n,a);for(let t=0;t<n;t++)for(let e=0;e<a;e++){let n=0;for(let r=0;r<u;r++)n+=o.get(t,r)*i.get(e,r);s.set(t,e,n)}return s}get condition(){return this.s[0]/this.s[Math.min(this.m,this.n)-1]}get norm2(){return this.s[0]}get rank(){let t=Math.max(this.m,this.n)*this.s[0]*Number.EPSILON,e=0,n=this.s;for(let r=0,o=n.length;r<o;r++)n[r]>t&&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 Tf.diag(this.s)}}var Mf=function(){function t(t){this.distances=t.distances,this.dimension=t.dimension||2,this.linkDistance=t.linkDistance}return t.prototype.layout=function(){var t=this,e=t.dimension,n=t.distances,r=t.linkDistance;try{var o=Tf.mul(Tf.pow(n,2),-.5),i=o.mean("row"),a=o.mean("column"),u=o.mean();o.add(u).subRowVector(i).subColumnVector(a);var s=new Df(o),c=Tf.sqrt(s.diagonalMatrix).diagonal();return s.leftSingularVectors.toJSON().map((function(t){return Tf.mul([t],[c]).toJSON()[0].splice(0,e)}))}catch(t){for(var f=[],l=0;l<n.length;l++){var d=Math.random()*r,h=Math.random()*r;f.push([d,h])}return f}},t}();const kf=Mf;var Rf=function(){function t(t){this.disp=[],this.positions=t.positions,this.adjMatrix=t.adjMatrix,this.focusID=t.focusID,this.radii=t.radii,this.iterations=t.iterations||10,this.height=t.height||10,this.width=t.width||10,this.speed=t.speed||100,this.gravity=t.gravity||10,this.nodeSizeFunc=t.nodeSizeFunc,this.k=t.k||5,this.strictRadial=t.strictRadial,this.nodes=t.nodes}return t.prototype.layout=function(){var t=this,e=t.positions,n=[],r=t.iterations,o=t.width/10;t.maxDisplace=o,t.disp=n;for(var i=0;i<r;i++)e.forEach((function(t,e){n[e]={x:0,y:0}})),t.getRepulsion(),t.updatePositions();return e},t.prototype.getRepulsion=function(){var t=this,e=t.positions,n=t.nodes,r=t.disp,o=t.k,i=t.radii||[];e.forEach((function(a,u){r[u]={x:0,y:0},e.forEach((function(e,s){if(u!==s&&i[u]===i[s]){var c=a[0]-e[0],f=a[1]-e[1],l=Math.sqrt(c*c+f*f);if(0===l){l=1;var d=u>s?1:-1;c=.01*d,f=.01*d}if(l<t.nodeSizeFunc(n[u])/2+t.nodeSizeFunc(n[s])/2){var h=o*o/l;r[u].x+=c/l*h,r[u].y+=f/l*h}}}))}))},t.prototype.updatePositions=function(){var t=this,e=t.positions,n=t.disp,r=t.speed,o=t.strictRadial,i=t.focusID,a=t.maxDisplace||t.width/10;o&&n.forEach((function(t,n){var r=e[n][0]-e[i][0],o=e[n][1]-e[i][1],a=Math.sqrt(r*r+o*o),u=o/a,s=-r/a,c=Math.sqrt(t.x*t.x+t.y*t.y),f=Math.acos((u*t.x+s*t.y)/c);f>Math.PI/2&&(f-=Math.PI/2,u*=-1,s*=-1);var l=Math.cos(f)*c;t.x=u*l,t.y=s*l}));var u=t.radii;e.forEach((function(t,s){if(s!==i){var c=Math.sqrt(n[s].x*n[s].x+n[s].y*n[s].y);if(c>0&&s!==i){var f=Math.min(a*(r/800),c);if(t[0]+=n[s].x/c*f,t[1]+=n[s].y/c*f,o){var l=t[0]-e[i][0],d=t[1]-e[i][1],h=Math.sqrt(l*l+d*d);l=l/h*u[s],d=d/h*u[s],t[0]=e[i][0]+l,t[1]=e[i][1]+d}}}}))},t}();const Cf=Rf;var Lf=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function Pf(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var jf=function(t){function n(e){var n=t.call(this)||this;return n.maxIteration=1e3,n.focusNode=null,n.unitRadius=null,n.linkDistance=50,n.preventOverlap=!1,n.strictRadial=!0,n.maxPreventOverlapIteration=200,n.sortStrength=10,n.nodes=[],n.edges=[],n.updateCfg(e),n}return Lf(n,t),n.prototype.getDefaultCfg=function(){return{maxIteration:1e3,focusNode:null,unitRadius:null,linkDistance:50,preventOverlap:!1,nodeSize:void 0,nodeSpacing:void 0,strictRadial:!0,maxPreventOverlapIteration:200,sortBy:void 0,sortStrength:10}},n.prototype.execute=function(){var t=this,n=t.nodes,r=t.edges||[];if(n&&0!==n.length){t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]);var u=t.center;if(1===n.length)return n[0].x=u[0],n[0].y=u[1],void(t.onLayoutEnd&&t.onLayoutEnd());var s=t.linkDistance,c=null;if(e(t.focusNode)){for(var l=!1,d=0;d<n.length;d++)n[d].id===t.focusNode&&(c=n[d],t.focusNode=c,l=!0,d=n.length);l||(c=null)}else c=t.focusNode;c||(c=n[0],t.focusNode=c);var h=function(t,e){var n=-1;return t.forEach((function(t,r){t.id===e&&(n=r)})),n}(n,c.id);h<0&&(h=0),t.focusIndex=h;var g=v({nodes:n,edges:r},!1),m=p(g),y=t.maxToFocus(m,h);t.handleInfinity(m,h,y+1),t.distances=m;var b=m[h],w=t.width||500,x=t.height||500,_=w-u[0]>u[0]?u[0]:w-u[0],S=x-u[1]>u[1]?u[1]:x-u[1];0===_&&(_=w/2),0===S&&(S=x/2);var A=S>_?_:S,I=Math.max.apply(Math,b),T=[];b.forEach((function(e,n){t.unitRadius||(t.unitRadius=A/I),T[n]=e*t.unitRadius})),t.radii=T;var O=t.eIdealDisMatrix();t.eIdealDistances=O;var N=function(t){for(var e=t.length,n=t[0].length,r=[],o=0;o<e;o++){for(var i=[],a=0;a<n;a++)0!==t[o][a]?i.push(1/(t[o][a]*t[o][a])):i.push(0);r.push(i)}return r}(O);t.weights=N;var D=new kf({linkDistance:s,distances:O}).layout();D.forEach((function(t){a(t[0])&&(t[0]=Math.random()*s),a(t[1])&&(t[1]=Math.random()*s)})),t.positions=D,D.forEach((function(t,e){n[e].x=t[0]+u[0],n[e].y=t[1]+u[1]})),D.forEach((function(t){t[0]-=D[h][0],t[1]-=D[h][1]})),t.run();var M,k=t.preventOverlap,R=t.nodeSize,C=t.strictRadial;if(k){var L,P=t.nodeSpacing;L=i(P)?function(){return P}:E(P)?P:function(){return 0},M=R?o(R)?function(t){return(R[0]>R[1]?R[0]:R[1])+L(t)}:function(t){return R+L(t)}:function(t){return t.size?o(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])+L(t):f(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)+L(t):t.size+L(t):10+L(t)};var j={nodes:n,nodeSizeFunc:M,adjMatrix:g,positions:D,radii:T,height:x,width:w,strictRadial:C,focusID:h,iterations:t.maxPreventOverlapIteration||200,k:D.length/4.5},z=new Cf(j);D=z.layout()}return D.forEach((function(t,e){n[e].x=t[0]+u[0],n[e].y=t[1]+u[1]})),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:n,edges:r}}t.onLayoutEnd&&t.onLayoutEnd()},n.prototype.run=function(){for(var t=this,e=t.maxIteration,n=t.positions||[],r=t.weights||[],o=t.eIdealDistances||[],i=t.radii||[],a=0;a<=e;a++){var u=a/e;t.oneIteration(u,n,i,o,r)}},n.prototype.oneIteration=function(t,e,n,r,o){var i=1-t,a=this.focusIndex;e.forEach((function(u,s){var c=Pf(u,[0,0]),f=0===c?0:1/c;if(s!==a){var l=0,d=0,h=0;e.forEach((function(t,e){if(s!==e){var n=Pf(u,t),i=0===n?0:1/n,a=r[e][s];h+=o[s][e],l+=o[s][e]*(t[0]+a*(u[0]-t[0])*i),d+=o[s][e]*(t[1]+a*(u[1]-t[1])*i)}}));var p=0===n[s]?0:1/n[s];h*=i,h+=t*p*p,l*=i,l+=t*p*u[0]*f,u[0]=l/h,d*=i,d+=t*p*u[1]*f,u[1]=d/h}}))},n.prototype.eIdealDisMatrix=function(){var t=this,n=t.nodes;if(!n)return[];var r=t.distances,o=t.linkDistance,i=t.radii||[],a=t.unitRadius||50,u=[];return r&&r.forEach((function(r,s){var c=[];r.forEach((function(r,u){if(s===u)c.push(0);else if(i[s]===i[u])if("data"===t.sortBy)c.push(r*(Math.abs(s-u)*t.sortStrength)/(i[s]/a));else if(t.sortBy){var f=n[s][t.sortBy]||0,l=n[u][t.sortBy]||0;e(f)&&(f=f.charCodeAt(0)),e(l)&&(l=l.charCodeAt(0)),c.push(r*(Math.abs(f-l)*t.sortStrength)/(i[s]/a))}else c.push(r*o/(i[s]/a));else{var d=(o+a)/2;c.push(r*d)}})),u.push(c)})),u},n.prototype.handleInfinity=function(t,e,n){for(var r=t.length,o=0;o<r;o++)if(t[e][o]===1/0){t[e][o]=n,t[o][e]=n;for(var i=0;i<r;i++)t[o][i]!==1/0&&t[e][i]===1/0&&(t[e][i]=n+t[o][i],t[i][e]=n+t[o][i])}for(o=0;o<r;o++)if(o!==e)for(i=0;i<r;i++)if(t[o][i]===1/0){var a=Math.abs(t[e][o]-t[e][i]);a=0===a?1:a,t[o][i]=a}},n.prototype.maxToFocus=function(t,e){for(var n=0,r=0;r<t[e].length;r++)t[e][r]!==1/0&&(n=t[e][r]>n?t[e][r]:n);return n},n.prototype.getType=function(){return"radial"},n}(t),zf=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ff=function(t){function n(e){var n=t.call(this)||this;return n.nodeSize=30,n.minNodeSpacing=10,n.nodeSpacing=10,n.preventOverlap=!1,n.equidistant=!1,n.startAngle=1.5*Math.PI,n.clockwise=!0,n.sortBy="degree",n.nodes=[],n.edges=[],n.width=300,n.height=300,n.onLayoutEnd=function(){},n.updateCfg(e),n}return zf(n,t),n.prototype.getDefaultCfg=function(){return{nodeSize:30,minNodeSpacing:10,nodeSpacing:10,preventOverlap:!1,sweep:void 0,equidistant:!1,startAngle:1.5*Math.PI,clockwise:!0,maxLevelDiff:void 0,sortBy:"degree"}},n.prototype.execute=function(){var t,n,r=this,a=r.nodes,u=r.edges,s=a.length;if(0!==s){r.width||"undefined"==typeof window||(r.width=window.innerWidth),r.height||"undefined"==typeof window||(r.height=window.innerHeight),r.center||(r.center=[r.width/2,r.height/2]);var c=r.center;if(1===s)return a[0].x=c[0],a[0].y=c[1],void(null===(n=r.onLayoutEnd)||void 0===n||n.call(r));var l,d=r.nodeSize,p=r.nodeSpacing,v=[],g=0;l=o(d)?Math.max(d[0],d[1]):d,o(p)?g=Math.max(p[0],p[1]):i(p)&&(g=p),a.forEach((function(t){v.push(t);var e=l;o(t.size)?e=Math.max(t.size[0],t.size[1]):i(t.size)?e=t.size:f(t.size)&&(e=Math.max(t.size.width,t.size.height)),l=Math.max(l,e),E(p)&&(g=Math.max(p(t),g))})),r.clockwise=void 0!==r.counterclockwise?!r.counterclockwise:r.clockwise;var m={},y={};if(v.forEach((function(t,e){m[t.id]=t,y[t.id]=e})),!("degree"!==r.sortBy&&e(r.sortBy)&&void 0!==v[0][r.sortBy]||(r.sortBy="degree",i(a[0].degree)))){var b=h(a.length,y,u);v.forEach((function(t,e){t.degree=b[e].all}))}v.sort((function(t,e){return e[r.sortBy]-t[r.sortBy]})),r.maxValueNode=v[0],r.maxLevelDiff=r.maxLevelDiff||r.maxValueNode[r.sortBy]/4;var w=[[]],x=w[0];v.forEach((function(t){if(x.length>0){var e=Math.abs(x[0][r.sortBy]-t[r.sortBy]);r.maxLevelDiff&&e>=r.maxLevelDiff&&(x=[],w.push(x))}x.push(t)}));var _=l+(g||r.minNodeSpacing);if(!r.preventOverlap){var S=w.length>0&&w[0].length>1,A=(Math.min(r.width,r.height)/2-_)/(w.length+(S?1:0));_=Math.min(_,A)}var I=0;if(w.forEach((function(t){var e=r.sweep;void 0===e&&(e=2*Math.PI-2*Math.PI/t.length);var n=t.dTheta=e/Math.max(1,t.length-1);if(t.length>1&&r.preventOverlap){var o=Math.cos(n)-Math.cos(0),i=Math.sin(n)-Math.sin(0),a=Math.sqrt(_*_/(o*o+i*i));I=Math.max(a,I)}t.r=I,I+=_})),r.equidistant){for(var T=0,O=0,N=0;N<w.length;N++){var D=w[N].r-O;T=Math.max(T,D)}O=0,w.forEach((function(t,e){0===e&&(O=t.r),t.r=O,O+=T}))}return w.forEach((function(t){var e=t.dTheta,n=t.r;t.forEach((function(t,o){var i=r.startAngle+(r.clockwise?1:-1)*e*o;t.x=c[0]+n*Math.cos(i),t.y=c[1]+n*Math.sin(i)}))})),r.onLayoutEnd&&r.onLayoutEnd(),{nodes:a,edges:u}}null===(t=r.onLayoutEnd)||void 0===t||t.call(r)},n.prototype.getType=function(){return"concentric"},n}(t),Gf=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Uf=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.linkDistance=50,n.nodes=[],n.edges=[],n.onLayoutEnd=function(){},n.updateCfg(e),n}return Gf(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],linkDistance:50}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.edges,r=void 0===n?[]:n,o=t.center;if(e&&0!==e.length){if(1===e.length)return e[0].x=o[0],e[0].y=o[1],void(t.onLayoutEnd&&t.onLayoutEnd());var i=t.linkDistance,a=v({nodes:e,edges:r},!1),u=p(a);t.handleInfinity(u);var s,c,f=(s=i,c=[],u.forEach((function(t){var e=[];t.forEach((function(t){e.push(t*s)})),c.push(e)})),c);t.scaledDistances=f;var l=t.runMDS();return t.positions=l,l.forEach((function(t,n){e[n].x=t[0]+o[0],e[n].y=t[1]+o[1]})),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:r}}t.onLayoutEnd&&t.onLayoutEnd()},e.prototype.runMDS=function(){var t=this.scaledDistances,e=Tf.mul(Tf.pow(t,2),-.5),n=e.mean("row"),r=e.mean("column"),o=e.mean();e.add(o).subRowVector(n).subColumnVector(r);var i=new Df(e),a=Tf.sqrt(i.diagonalMatrix).diagonal();return i.leftSingularVectors.toJSON().map((function(t){return Tf.mul([t],[a]).toJSON()[0].splice(0,2)}))},e.prototype.handleInfinity=function(t){var e=-999999;t.forEach((function(t){t.forEach((function(t){t!==1/0&&e<t&&(e=t)}))})),t.forEach((function(n,r){n.forEach((function(n,o){n===1/0&&(t[r][o]=e)}))}))},e.prototype.getType=function(){return"mds"},e}(t),Bf=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vf=function(t){function e(e){var n=t.call(this)||this;return n.maxIteration=1e3,n.workerEnabled=!1,n.gravity=10,n.speed=5,n.clustering=!1,n.clusterGravity=10,n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.onLayoutEnd=function(){},n.tick=function(){},n.animate=!0,n.updateCfg(e),n}return Bf(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:1e3,gravity:10,speed:1,clustering:!1,clusterGravity:10,animate:!0}},e.prototype.execute=function(){var t,e,n=this,r=this,o=r.nodes;if(void 0!==r.timeInterval&&"undefined"!=typeof window&&window.clearInterval(r.timeInterval),o&&0!==o.length){r.width||"undefined"==typeof window||(r.width=window.innerWidth),r.height||"undefined"==typeof window||(r.height=window.innerHeight),r.center||(r.center=[r.width/2,r.height/2]);var a=r.center;if(1===o.length)return o[0].x=a[0],o[0].y=a[1],void(null===(e=r.onLayoutEnd)||void 0===e||e.call(r));var u={},s={};return o.forEach((function(t,e){i(t.x)||(t.x=Math.random()*n.width),i(t.y)||(t.y=Math.random()*n.height),u[t.id]=t,s[t.id]=e})),r.nodeMap=u,r.nodeIdxMap=s,r.run()}null===(t=r.onLayoutEnd)||void 0===t||t.call(r)},e.prototype.run=function(){var t,e=this,n=e.nodes;if(n){var r=e.edges,o=e.maxIteration,i=e.workerEnabled,a=e.clustering,u=e.animate,s={};if(a&&n.forEach((function(t){void 0===s[t.cluster]&&(s[t.cluster]={name:t.cluster,cx:0,cy:0,count:0})})),i||!u){for(var c=0;c<o;c++)e.runOneStep(s);null===(t=e.onLayoutEnd)||void 0===t||t.call(e)}else{if("undefined"==typeof window)return;var f=0;this.timeInterval=window.setInterval((function(){var t;e.runOneStep(s),++f>=o&&(null===(t=e.onLayoutEnd)||void 0===t||t.call(e),window.clearInterval(e.timeInterval))}),0)}return{nodes:n,edges:r}}},e.prototype.runOneStep=function(t){var e,n=this,r=n.nodes;if(r){var o=n.edges,a=n.center,u=n.gravity,s=n.speed,c=n.clustering,f=n.height*n.width,l=Math.sqrt(f)/10,d=f/(r.length+1),h=Math.sqrt(d),p=[];if(r.forEach((function(t,e){p[e]={x:0,y:0}})),n.applyCalculate(r,o,p,h,d),c){for(var v in t)t[v].cx=0,t[v].cy=0,t[v].count=0;for(var v in r.forEach((function(e){var n=t[e.cluster];i(e.x)&&(n.cx+=e.x),i(e.y)&&(n.cy+=e.y),n.count++})),t)t[v].cx/=t[v].count,t[v].cy/=t[v].count;var g=n.clusterGravity||u;r.forEach((function(e,n){if(i(e.x)&&i(e.y)){var r=t[e.cluster],o=Math.sqrt((e.x-r.cx)*(e.x-r.cx)+(e.y-r.cy)*(e.y-r.cy)),a=h*g;p[n].x-=a*(e.x-r.cx)/o,p[n].y-=a*(e.y-r.cy)/o}}))}r.forEach((function(t,e){if(i(t.x)&&i(t.y)){var n=.01*h*u;p[e].x-=n*(t.x-a[0]),p[e].y-=n*(t.y-a[1])}})),r.forEach((function(t,e){if(i(t.fx)&&i(t.fy))return t.x=t.fx,void(t.y=t.fy);if(i(t.x)&&i(t.y)){var n=Math.sqrt(p[e].x*p[e].x+p[e].y*p[e].y);if(n>0){var r=Math.min(l*(s/800),n);t.x+=p[e].x/n*r,t.y+=p[e].y/n*r}}})),null===(e=n.tick)||void 0===e||e.call(n)}},e.prototype.applyCalculate=function(t,e,n,r,o){this.calRepulsive(t,n,o),e&&this.calAttractive(e,n,r)},e.prototype.calRepulsive=function(t,e,n){t.forEach((function(r,o){e[o]={x:0,y:0},t.forEach((function(t,a){if(o!==a&&i(r.x)&&i(t.x)&&i(r.y)&&i(t.y)){var u=r.x-t.x,s=r.y-t.y,c=u*u+s*s;if(0===c){c=1;var f=o>a?1:-1;u=.01*f,s=.01*f}var l=n/c;e[o].x+=u*l,e[o].y+=s*l}}))}))},e.prototype.calAttractive=function(t,e,n){var r=this;t.forEach((function(t){var o=d(t,"source"),a=d(t,"target");if(o&&a){var u=r.nodeIdxMap[o],s=r.nodeIdxMap[a];if(u!==s){var c=r.nodeMap[o],f=r.nodeMap[a];if(i(f.x)&&i(c.x)&&i(f.y)&&i(c.y)){var l=f.x-c.x,h=f.y-c.y,p=Math.sqrt(l*l+h*h),v=p*p/n;e[s].x-=l/p*v,e[s].y-=h/p*v,e[u].x+=l/p*v,e[u].y+=h/p*v}}}}))},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){var t=this;t.stop(),t.tick=null,t.nodes=null,t.edges=null,t.destroyed=!0},e.prototype.getType=function(){return"fruchterman"},e}(t);function Wf(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)}function Xf(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Wf(i,r,o,a,u,"next",t)}function u(t){Wf(i,r,o,a,u,"throw",t)}a(void 0)}))}}function Hf(t){return Hf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hf(t)}function qf(t){var e=function(t,e){if("object"!==Hf(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Hf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===Hf(e)?e:String(e)}function Yf(t,e,n){return(e=qf(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Kf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Zf(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,qf(r.key),r)}}function $f(t,e,n){return e&&Zf(t.prototype,e),n&&Zf(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var Qf,Jf=n(8397),tl=n.n(Jf),el=n(8868),nl=n.n(el),rl=n(744),ol=n.n(rl),il=n(6298),al=n.n(il),ul=1;function sl(){return ul++}!function(t){t[t.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",t[t.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",t[t.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC_COLOR=768]="SRC_COLOR",t[t.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.DST_COLOR=774]="DST_COLOR",t[t.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",t[t.FUNC_ADD=32774]="FUNC_ADD",t[t.BLEND_EQUATION=32777]="BLEND_EQUATION",t[t.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",t[t.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",t[t.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",t[t.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",t[t.MAX_EXT=32776]="MAX_EXT",t[t.MIN_EXT=32775]="MIN_EXT",t[t.BLEND_DST_RGB=32968]="BLEND_DST_RGB",t[t.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",t[t.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",t[t.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",t[t.CONSTANT_COLOR=32769]="CONSTANT_COLOR",t[t.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",t[t.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",t[t.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",t[t.BLEND_COLOR=32773]="BLEND_COLOR",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",t[t.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",t[t.STREAM_DRAW=35040]="STREAM_DRAW",t[t.STATIC_DRAW=35044]="STATIC_DRAW",t[t.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",t[t.BUFFER_SIZE=34660]="BUFFER_SIZE",t[t.BUFFER_USAGE=34661]="BUFFER_USAGE",t[t.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",t[t.FRONT=1028]="FRONT",t[t.BACK=1029]="BACK",t[t.FRONT_AND_BACK=1032]="FRONT_AND_BACK",t[t.CULL_FACE=2884]="CULL_FACE",t[t.BLEND=3042]="BLEND",t[t.DITHER=3024]="DITHER",t[t.STENCIL_TEST=2960]="STENCIL_TEST",t[t.DEPTH_TEST=2929]="DEPTH_TEST",t[t.SCISSOR_TEST=3089]="SCISSOR_TEST",t[t.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",t[t.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",t[t.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",t[t.NO_ERROR=0]="NO_ERROR",t[t.INVALID_ENUM=1280]="INVALID_ENUM",t[t.INVALID_VALUE=1281]="INVALID_VALUE",t[t.INVALID_OPERATION=1282]="INVALID_OPERATION",t[t.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",t[t.CW=2304]="CW",t[t.CCW=2305]="CCW",t[t.LINE_WIDTH=2849]="LINE_WIDTH",t[t.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",t[t.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",t[t.CULL_FACE_MODE=2885]="CULL_FACE_MODE",t[t.FRONT_FACE=2886]="FRONT_FACE",t[t.DEPTH_RANGE=2928]="DEPTH_RANGE",t[t.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",t[t.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",t[t.DEPTH_FUNC=2932]="DEPTH_FUNC",t[t.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",t[t.STENCIL_FUNC=2962]="STENCIL_FUNC",t[t.STENCIL_FAIL=2964]="STENCIL_FAIL",t[t.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",t[t.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",t[t.STENCIL_REF=2967]="STENCIL_REF",t[t.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",t[t.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",t[t.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",t[t.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",t[t.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",t[t.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",t[t.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",t[t.VIEWPORT=2978]="VIEWPORT",t[t.SCISSOR_BOX=3088]="SCISSOR_BOX",t[t.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",t[t.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",t[t.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",t[t.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",t[t.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",t[t.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",t[t.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",t[t.RED_BITS=3410]="RED_BITS",t[t.GREEN_BITS=3411]="GREEN_BITS",t[t.BLUE_BITS=3412]="BLUE_BITS",t[t.ALPHA_BITS=3413]="ALPHA_BITS",t[t.DEPTH_BITS=3414]="DEPTH_BITS",t[t.STENCIL_BITS=3415]="STENCIL_BITS",t[t.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",t[t.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",t[t.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",t[t.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",t[t.SAMPLES=32937]="SAMPLES",t[t.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",t[t.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",t[t.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",t[t.DONT_CARE=4352]="DONT_CARE",t[t.FASTEST=4353]="FASTEST",t[t.NICEST=4354]="NICEST",t[t.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.INT=5124]="INT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.FLOAT=5126]="FLOAT",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.ALPHA=6406]="ALPHA",t[t.RGB=6407]="RGB",t[t.RGBA=6408]="RGBA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",t[t.VERTEX_SHADER=35633]="VERTEX_SHADER",t[t.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",t[t.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",t[t.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",t[t.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",t[t.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",t[t.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",t[t.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",t[t.SHADER_TYPE=35663]="SHADER_TYPE",t[t.DELETE_STATUS=35712]="DELETE_STATUS",t[t.LINK_STATUS=35714]="LINK_STATUS",t[t.VALIDATE_STATUS=35715]="VALIDATE_STATUS",t[t.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",t[t.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",t[t.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",t[t.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",t[t.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",t[t.NEVER=512]="NEVER",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.GEQUAL=518]="GEQUAL",t[t.ALWAYS=519]="ALWAYS",t[t.KEEP=7680]="KEEP",t[t.REPLACE=7681]="REPLACE",t[t.INCR=7682]="INCR",t[t.DECR=7683]="DECR",t[t.INVERT=5386]="INVERT",t[t.INCR_WRAP=34055]="INCR_WRAP",t[t.DECR_WRAP=34056]="DECR_WRAP",t[t.VENDOR=7936]="VENDOR",t[t.RENDERER=7937]="RENDERER",t[t.VERSION=7938]="VERSION",t[t.NEAREST=9728]="NEAREST",t[t.LINEAR=9729]="LINEAR",t[t.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",t[t.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",t[t.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",t[t.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",t[t.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",t[t.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE=5890]="TEXTURE",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t[t.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",t[t.TEXTURE0=33984]="TEXTURE0",t[t.TEXTURE1=33985]="TEXTURE1",t[t.TEXTURE2=33986]="TEXTURE2",t[t.TEXTURE3=33987]="TEXTURE3",t[t.TEXTURE4=33988]="TEXTURE4",t[t.TEXTURE5=33989]="TEXTURE5",t[t.TEXTURE6=33990]="TEXTURE6",t[t.TEXTURE7=33991]="TEXTURE7",t[t.TEXTURE8=33992]="TEXTURE8",t[t.TEXTURE9=33993]="TEXTURE9",t[t.TEXTURE10=33994]="TEXTURE10",t[t.TEXTURE11=33995]="TEXTURE11",t[t.TEXTURE12=33996]="TEXTURE12",t[t.TEXTURE13=33997]="TEXTURE13",t[t.TEXTURE14=33998]="TEXTURE14",t[t.TEXTURE15=33999]="TEXTURE15",t[t.TEXTURE16=34e3]="TEXTURE16",t[t.TEXTURE17=34001]="TEXTURE17",t[t.TEXTURE18=34002]="TEXTURE18",t[t.TEXTURE19=34003]="TEXTURE19",t[t.TEXTURE20=34004]="TEXTURE20",t[t.TEXTURE21=34005]="TEXTURE21",t[t.TEXTURE22=34006]="TEXTURE22",t[t.TEXTURE23=34007]="TEXTURE23",t[t.TEXTURE24=34008]="TEXTURE24",t[t.TEXTURE25=34009]="TEXTURE25",t[t.TEXTURE26=34010]="TEXTURE26",t[t.TEXTURE27=34011]="TEXTURE27",t[t.TEXTURE28=34012]="TEXTURE28",t[t.TEXTURE29=34013]="TEXTURE29",t[t.TEXTURE30=34014]="TEXTURE30",t[t.TEXTURE31=34015]="TEXTURE31",t[t.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",t[t.REPEAT=10497]="REPEAT",t[t.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t[t.FLOAT_VEC2=35664]="FLOAT_VEC2",t[t.FLOAT_VEC3=35665]="FLOAT_VEC3",t[t.FLOAT_VEC4=35666]="FLOAT_VEC4",t[t.INT_VEC2=35667]="INT_VEC2",t[t.INT_VEC3=35668]="INT_VEC3",t[t.INT_VEC4=35669]="INT_VEC4",t[t.BOOL=35670]="BOOL",t[t.BOOL_VEC2=35671]="BOOL_VEC2",t[t.BOOL_VEC3=35672]="BOOL_VEC3",t[t.BOOL_VEC4=35673]="BOOL_VEC4",t[t.FLOAT_MAT2=35674]="FLOAT_MAT2",t[t.FLOAT_MAT3=35675]="FLOAT_MAT3",t[t.FLOAT_MAT4=35676]="FLOAT_MAT4",t[t.SAMPLER_2D=35678]="SAMPLER_2D",t[t.SAMPLER_CUBE=35680]="SAMPLER_CUBE",t[t.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",t[t.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",t[t.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",t[t.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",t[t.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",t[t.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",t[t.COMPILE_STATUS=35713]="COMPILE_STATUS",t[t.LOW_FLOAT=36336]="LOW_FLOAT",t[t.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",t[t.HIGH_FLOAT=36338]="HIGH_FLOAT",t[t.LOW_INT=36339]="LOW_INT",t[t.MEDIUM_INT=36340]="MEDIUM_INT",t[t.HIGH_INT=36341]="HIGH_INT",t[t.FRAMEBUFFER=36160]="FRAMEBUFFER",t[t.RENDERBUFFER=36161]="RENDERBUFFER",t[t.RGBA4=32854]="RGBA4",t[t.RGB5_A1=32855]="RGB5_A1",t[t.RGB565=36194]="RGB565",t[t.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",t[t.STENCIL_INDEX=6401]="STENCIL_INDEX",t[t.STENCIL_INDEX8=36168]="STENCIL_INDEX8",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",t[t.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",t[t.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",t[t.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",t[t.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",t[t.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",t[t.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",t[t.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",t[t.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",t[t.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",t[t.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",t[t.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",t[t.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",t[t.NONE=0]="NONE",t[t.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",t[t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",t[t.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",t[t.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",t[t.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",t[t.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",t[t.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",t[t.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",t[t.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",t[t.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",t[t.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",t[t.COPY_SRC=1]="COPY_SRC",t[t.COPY_DST=2]="COPY_DST",t[t.SAMPLED=4]="SAMPLED",t[t.STORAGE=8]="STORAGE",t[t.RENDER_ATTACHMENT=16]="RENDER_ATTACHMENT"}(Qf||(Qf={}));var cl,fl,ll,dl,hl=function(){function t(){Kf(this,t),this.config=void 0}return $f(t,[{key:"get",value:function(){return this.config}},{key:"set",value:function(t){this.config=t}}]),t}();function pl(){if("undefined"!=typeof document)return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}function vl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function gl(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?vl(Object(n),!0).forEach((function(e){Yf(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vl(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}"undefined"!=typeof navigator&&/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),function(t){t.Void="Void",t.Boolean="Boolean",t.Float="Float",t.Uint32="Uint32",t.Int32="Int32",t.Vector="Vector",t.Vector2Float="vec2<f32>",t.Vector3Float="vec3<f32>",t.Vector4Float="vec4<f32>",t.Vector2Boolean="vec2<bool>",t.Vector3Boolean="vec3<bool>",t.Vector4Boolean="vec4<bool>",t.Vector2Uint="vec2<u32>",t.Vector3Uint="vec3<u32>",t.Vector4Uint="vec4<u32>",t.Vector2Int="vec2<i32>",t.Vector3Int="vec3<i32>",t.Vector4Int="vec4<i32>",t.Matrix="Matrix",t.Matrix3x3Float="mat3x3<f32>",t.Matrix4x4Float="mat4x4<i32>",t.Struct="Struct",t.FloatArray="Float[]",t.Vector4FloatArray="vec4<f32>[]"}(cl||(cl={})),function(t){t.Program="Program",t.Identifier="Identifier",t.VariableDeclaration="VariableDeclaration",t.BlockStatement="BlockStatement",t.ReturnStatement="ReturnStatement",t.FunctionDeclaration="FunctionDeclaration",t.VariableDeclarator="VariableDeclarator",t.AssignmentExpression="AssignmentExpression",t.LogicalExpression="LogicalExpression",t.BinaryExpression="BinaryExpression",t.ArrayExpression="ArrayExpression",t.UnaryExpression="UnaryExpression",t.UpdateExpression="UpdateExpression",t.FunctionExpression="FunctionExpression",t.MemberExpression="MemberExpression",t.ConditionalExpression="ConditionalExpression",t.ExpressionStatement="ExpressionStatement",t.CallExpression="CallExpression",t.NumThreadStatement="NumThreadStatement",t.StorageStatement="StorageStatement",t.DoWhileStatement="DoWhileStatement",t.WhileStatement="WhileStatement",t.ForStatement="ForStatement",t.BreakStatement="BreakStatement",t.ContinueStatement="ContinueStatement",t.IfStatement="IfStatement",t.ImportedFunctionStatement="ImportedFunctionStatement"}(fl||(fl={})),function(t){t.Input="Input",t.Output="Output",t.Uniform="Uniform",t.Workgroup="Workgroup",t.UniformConstant="UniformConstant",t.Image="Image",t.StorageBuffer="StorageBuffer",t.Private="Private",t.Function="Function"}(ll||(ll={})),function(t){t.GLSL100="GLSL100",t.GLSL450="GLSL450",t.WGSL="WGSL"}(dl||(dl={}));var ml,yl,bl,wl,El,xl,_l,Sl,Al,Il,Tl,Ol,Nl,Dl,Ml=function(){function t(e,n){Kf(this,t),this.engine=e,this.configService=n,this.model=void 0,this.dirty=!0,this.compiledBundle=void 0,this.initPromise=void 0}var e,n,r;return $f(t,[{key:"init",value:function(){var t=this.configService.get(),e=t.canvas,n=t.engineOptions;this.initPromise=this.engine.init(gl({canvas:e||pl(),antialiasing:!1},n))}},{key:"setBundle",value:function(t){this.compiledBundle=JSON.parse(JSON.stringify(t))}},{key:"setDispatch",value:function(t){return this.compiledBundle.context&&(this.compiledBundle.context.dispatch=t),this}},{key:"setMaxIteration",value:function(t){return this.compiledBundle.context&&(this.compiledBundle.context.maxIteration=t),this}},{key:"setBinding",value:function(t,e){var n=this;if("string"==typeof t){var r=nl()(e)||tl()(e)||ol()(e);if(this.compiledBundle&&this.compiledBundle.context){var o=this.compiledBundle.context.defines.find((function(e){return e.name===t}));if(o)return o.value=e,this;var i=this.compiledBundle.context.uniforms.find((function(e){return e.name===t}));i&&(r?(i.data=e,i.isReferer=!1,i.storageClass===ll.Uniform?this.model&&this.model.updateUniform(t,e):this.model&&this.model.updateBuffer(t,e)):(i.isReferer=!0,i.data=e))}}else Object.keys(t).forEach((function(e){n.setBinding(e,t[e])}));return this}},{key:"execute",value:(r=Xf(al().mark((function t(){var e,n,r=this,o=arguments;return al().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=o.length>0&&void 0!==o[0]?o[0]:1,!this.dirty){t.next=6;break}return this.compiledBundle.context&&(e>1?this.compiledBundle.context.maxIteration=e:this.compiledBundle.context.maxIteration++),t.next=5,this.compile();case 5:this.dirty=!1;case 6:for(this.engine.beginFrame(),this.engine.clear({}),this.compiledBundle.context&&this.compiledBundle.context.uniforms.filter((function(t){return t.isReferer})).forEach((function(t){var e=t.data,n=t.name;r.model.confirmInput(e.model,n)})),n=0;n<e;n++)this.model.run();return this.engine.endFrame(),t.abrupt("return",this);case 12:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"getOutput",value:(n=Xf(al().mark((function t(){return al().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.model.readData());case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"compile",value:(e=Xf(al().mark((function t(){var e,n,r;return al().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.initPromise;case 2:return e=gl({},this.compiledBundle.context),n=this.engine.supportWebGPU?this.engine.useWGSL?dl.WGSL:dl.GLSL450:dl.GLSL100,r=this.compiledBundle.shaders[n],e.defines.filter((function(t){return t.runtime})).forEach((function(t){var e="".concat("__DefineValuePlaceholder__").concat(t.name);r=r.replace(e,"".concat(t.value))})),e.shader=r,e.uniforms.forEach((function(t){if(!t.data&&t.storageClass===ll.StorageBuffer){var n=1;t.type===cl.FloatArray?n=1:t.type===cl.Vector4FloatArray&&(n=4),t.data=new Float32Array(e.output.length*n).fill(0)}})),this.compiledBundle.context=e,t.next=11,this.engine.createComputeModel(this.compiledBundle.context);case 11:this.model=t.sent;case 12:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),t}(),kl=n(6377),Rl=n.n(kl),Cl=function(){function t(e,n){Kf(this,t),this.attribute=void 0,this.buffer=void 0;var r=n.buffer,o=n.offset,i=n.stride,a=n.normalized,u=n.size,s=n.divisor;this.buffer=r,this.attribute={buffer:r.get(),offset:o||0,stride:i||0,normalized:a||!1,divisor:s||0},u&&(this.attribute.size=u)}return $f(t,[{key:"get",value:function(){return this.attribute}},{key:"updateBuffer",value:function(t){this.buffer.subData(t)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),t}(),Ll=(Yf(ml={},Qf.POINTS,"points"),Yf(ml,Qf.LINES,"lines"),Yf(ml,Qf.LINE_LOOP,"line loop"),Yf(ml,Qf.LINE_STRIP,"line strip"),Yf(ml,Qf.TRIANGLES,"triangles"),Yf(ml,Qf.TRIANGLE_FAN,"triangle fan"),Yf(ml,Qf.TRIANGLE_STRIP,"triangle strip"),ml),Pl=(Yf(yl={},Qf.STATIC_DRAW,"static"),Yf(yl,Qf.DYNAMIC_DRAW,"dynamic"),Yf(yl,Qf.STREAM_DRAW,"stream"),yl),jl=(Yf(bl={},Qf.BYTE,"int8"),Yf(bl,Qf.UNSIGNED_INT,"int16"),Yf(bl,Qf.INT,"int32"),Yf(bl,Qf.UNSIGNED_BYTE,"uint8"),Yf(bl,Qf.UNSIGNED_SHORT,"uint16"),Yf(bl,Qf.UNSIGNED_INT,"uint32"),Yf(bl,Qf.FLOAT,"float"),bl),zl=(Yf(wl={},Qf.ALPHA,"alpha"),Yf(wl,Qf.LUMINANCE,"luminance"),Yf(wl,Qf.LUMINANCE_ALPHA,"luminance alpha"),Yf(wl,Qf.RGB,"rgb"),Yf(wl,Qf.RGBA,"rgba"),Yf(wl,Qf.RGBA4,"rgba4"),Yf(wl,Qf.RGB5_A1,"rgb5 a1"),Yf(wl,Qf.RGB565,"rgb565"),Yf(wl,Qf.DEPTH_COMPONENT,"depth"),Yf(wl,Qf.DEPTH_STENCIL,"depth stencil"),wl),Fl=(Yf(El={},Qf.DONT_CARE,"dont care"),Yf(El,Qf.NICEST,"nice"),Yf(El,Qf.FASTEST,"fast"),El),Gl=(Yf(xl={},Qf.NEAREST,"nearest"),Yf(xl,Qf.LINEAR,"linear"),Yf(xl,Qf.LINEAR_MIPMAP_LINEAR,"mipmap"),Yf(xl,Qf.NEAREST_MIPMAP_LINEAR,"nearest mipmap linear"),Yf(xl,Qf.LINEAR_MIPMAP_NEAREST,"linear mipmap nearest"),Yf(xl,Qf.NEAREST_MIPMAP_NEAREST,"nearest mipmap nearest"),xl),Ul=(Yf(_l={},Qf.REPEAT,"repeat"),Yf(_l,Qf.CLAMP_TO_EDGE,"clamp"),Yf(_l,Qf.MIRRORED_REPEAT,"mirror"),_l),Bl=(Yf(Sl={},Qf.NONE,"none"),Yf(Sl,Qf.BROWSER_DEFAULT_WEBGL,"browser"),Sl),Vl=(Yf(Al={},Qf.NEVER,"never"),Yf(Al,Qf.ALWAYS,"always"),Yf(Al,Qf.LESS,"less"),Yf(Al,Qf.LEQUAL,"lequal"),Yf(Al,Qf.GREATER,"greater"),Yf(Al,Qf.GEQUAL,"gequal"),Yf(Al,Qf.EQUAL,"equal"),Yf(Al,Qf.NOTEQUAL,"notequal"),Al),Wl=(Yf(Il={},Qf.FUNC_ADD,"add"),Yf(Il,Qf.MIN_EXT,"min"),Yf(Il,Qf.MAX_EXT,"max"),Yf(Il,Qf.FUNC_SUBTRACT,"subtract"),Yf(Il,Qf.FUNC_REVERSE_SUBTRACT,"reverse subtract"),Il),Xl=(Yf(Tl={},Qf.ZERO,"zero"),Yf(Tl,Qf.ONE,"one"),Yf(Tl,Qf.SRC_COLOR,"src color"),Yf(Tl,Qf.ONE_MINUS_SRC_COLOR,"one minus src color"),Yf(Tl,Qf.SRC_ALPHA,"src alpha"),Yf(Tl,Qf.ONE_MINUS_SRC_ALPHA,"one minus src alpha"),Yf(Tl,Qf.DST_COLOR,"dst color"),Yf(Tl,Qf.ONE_MINUS_DST_COLOR,"one minus dst color"),Yf(Tl,Qf.DST_ALPHA,"dst alpha"),Yf(Tl,Qf.ONE_MINUS_DST_ALPHA,"one minus dst alpha"),Yf(Tl,Qf.CONSTANT_COLOR,"constant color"),Yf(Tl,Qf.ONE_MINUS_CONSTANT_COLOR,"one minus constant color"),Yf(Tl,Qf.CONSTANT_ALPHA,"constant alpha"),Yf(Tl,Qf.ONE_MINUS_CONSTANT_ALPHA,"one minus constant alpha"),Yf(Tl,Qf.SRC_ALPHA_SATURATE,"src alpha saturate"),Tl),Hl=(Yf(Ol={},Qf.NEVER,"never"),Yf(Ol,Qf.ALWAYS,"always"),Yf(Ol,Qf.LESS,"less"),Yf(Ol,Qf.LEQUAL,"lequal"),Yf(Ol,Qf.GREATER,"greater"),Yf(Ol,Qf.GEQUAL,"gequal"),Yf(Ol,Qf.EQUAL,"equal"),Yf(Ol,Qf.NOTEQUAL,"notequal"),Ol),ql=(Yf(Nl={},Qf.ZERO,"zero"),Yf(Nl,Qf.KEEP,"keep"),Yf(Nl,Qf.REPLACE,"replace"),Yf(Nl,Qf.INVERT,"invert"),Yf(Nl,Qf.INCR,"increment"),Yf(Nl,Qf.DECR,"decrement"),Yf(Nl,Qf.INCR_WRAP,"increment wrap"),Yf(Nl,Qf.DECR_WRAP,"decrement wrap"),Nl),Yl=(Yf(Dl={},Qf.FRONT,"front"),Yf(Dl,Qf.BACK,"back"),Dl),Kl=function(){function t(e,n){Kf(this,t),this.buffer=void 0;var r=n.data,o=n.usage,i=n.type;this.buffer=e.buffer({data:r,usage:Pl[o||Qf.STATIC_DRAW],type:jl[i||Qf.UNSIGNED_BYTE]})}return $f(t,[{key:"get",value:function(){return this.buffer}},{key:"destroy",value:function(){}},{key:"subData",value:function(t){var e=t.data,n=t.offset;this.buffer.subdata(e,n)}}]),t}();function Zl(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function $l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ql(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?$l(Object(n),!0).forEach((function(e){Yf(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$l(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Jl=0,td=function(){function t(e,n){var r=this;Kf(this,t),this.reGl=e,this.context=n,this.entity=sl(),this.texFBO=void 0,this.computeCommand=void 0,this.textureCache={},this.outputTextureName=void 0,this.swapOutputTextureName=void 0,this.compiledPingpong=void 0,this.dynamicPingpong=void 0;var o={};this.context.uniforms.forEach((function(t){var e=t.name,n=t.type,i=t.data,a=t.isReferer,u=t.storageClass;if(u===ll.StorageBuffer){if(a)r.textureCache[e]={data:void 0},o["".concat(e,"Size")]=function(){return i.compiledBundle.context.output.textureSize};else{r.textureCache[e]=r.calcDataTexture(e,n,i);var s=r.textureCache[e],c=s.textureWidth,f=s.isOutput;o["".concat(e,"Size")]=[c,c],f&&(r.outputTextureName=e,r.context.needPingpong&&(r.outputTextureName="".concat(e,"Output"),r.textureCache[r.outputTextureName]=r.calcDataTexture(e,n,i)))}o[e]=function(){return r.textureCache[e].texture}}else if(u===ll.Uniform){if(i&&(Array.isArray(i)||tl()(i))&&i.length>16)throw new Error("invalid data type ".concat(n));o[e]=function(){return t.data}}}));var i=this.getOuputDataTexture(),a=i.textureWidth,u=i.texelCount;o.u_OutputTextureSize=[a,a],o.u_OutputTexelCount=u,this.context.output.textureSize=[a,a];var s={attributes:{a_Position:[[-1,1,0],[-1,-1,0],[1,1,0],[1,-1,0]],a_TexCoord:[[0,1],[0,0],[1,1],[1,0]]},frag:"#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n#else\n precision mediump float;\n#endif\n".concat(this.context.shader),uniforms:o,vert:"attribute vec3 a_Position;\nattribute vec2 a_TexCoord;\n\nvarying vec2 v_TexCoord;\n\nvoid main() {\n gl_Position = vec4(a_Position, 1.0);\n v_TexCoord = a_TexCoord;\n}",primitive:"triangle strip",count:4};this.computeCommand=this.reGl(s)}var e;return $f(t,[{key:"run",value:function(){var t=this;this.context.maxIteration>1&&this.context.needPingpong&&(this.compiledPingpong=!0),(this.compiledPingpong||this.dynamicPingpong)&&this.swap(),this.texFBO=this.reGl.framebuffer({color:this.getOuputDataTexture().texture}),this.texFBO.use((function(){t.computeCommand()}))}},{key:"readData",value:(e=Xf(al().mark((function t(){var e,n,r,o,i,a,u,s,c=this;return al().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.reGl({framebuffer:this.texFBO})((function(){e=c.reGl.read()})),!e){t.next=6;break}if(n=this.getOuputDataTexture(),r=n.originalDataLength,o=n.elementsPerTexel,i=n.typedArrayConstructor,a=void 0===i?Float32Array:i,u=[],4!==o)for(s=0;s<e.length;s+=4)1===o?u.push(e[s]):2===o?u.push(e[s],e[s+1]):u.push(e[s],e[s+1],e[s+2]);else u=e;return t.abrupt("return",new a(u.slice(0,r)));case 6:return t.abrupt("return",new Float32Array);case 7:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"confirmInput",value:function(t,e){var n;this.entity===t.entity?(this.dynamicPingpong=!0,n=this):n=t,this.textureCache[e].id=n.getOuputDataTexture().id,this.textureCache[e].texture=n.getOuputDataTexture().texture}},{key:"updateUniform",value:function(){}},{key:"updateBuffer",value:function(t,e){var n=this.context.uniforms.find((function(e){return e.name===t}));if(n){var r=this.calcDataTexture(t,n.type,e),o=r.texture,i=r.data;this.textureCache[t].data=i,this.textureCache[t].texture=o}}},{key:"destroy",value:function(){}},{key:"swap",value:function(){if(this.swapOutputTextureName||this.createSwapOutputDataTexture(),this.compiledPingpong){var t=this.context.output.name;this.textureCache[t].id=this.getOuputDataTexture().id,this.textureCache[t].texture=this.getOuputDataTexture().texture}var e=this.outputTextureName;this.outputTextureName=this.swapOutputTextureName,this.swapOutputTextureName=e}},{key:"getOuputDataTexture",value:function(){return this.textureCache[this.outputTextureName]}},{key:"createSwapOutputDataTexture",value:function(){var t=this.cloneDataTexture(this.getOuputDataTexture());this.swapOutputTextureName="".concat(this.entity,"-swap"),this.textureCache[this.swapOutputTextureName]=t}},{key:"cloneDataTexture",value:function(t){var e=t.data,n=t.textureWidth;return Ql(Ql({},t),{},{id:Jl++,texture:this.reGl.texture({width:n,height:n,data:e,type:"float"})})}},{key:"calcDataTexture",value:function(t,e,n){var r=1;e===cl.Vector4FloatArray&&(r=4);for(var o=[],i=0;i<n.length;i+=r)1===r?o.push(n[i],0,0,0):2===r?o.push(n[i],n[i+1],0,0):3===r?o.push(n[i],n[i+1],n[i+2],0):4===r&&o.push(n[i],n[i+1],n[i+2],n[i+3]);var a,u=n.length,s=Math.ceil(u/r),c=Math.ceil(Math.sqrt(s)),f=c*c;s<f&&o.push.apply(o,function(t){if(Array.isArray(t))return Zl(t)}(a=new Array(4*(f-s)).fill(0))||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(a)||function(t,e){if(t){if("string"==typeof t)return Zl(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Zl(t,e):void 0}}(a)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());var l=this.reGl.texture({width:c,height:c,data:o,type:"float"});return{id:Jl++,data:o,originalDataLength:u,typedArrayConstructor:tl()(n)?n.constructor:void 0,textureWidth:c,texture:l,texelCount:s,elementsPerTexel:r,isOutput:t===this.context.output.name}}}]),t}(),ed=function(){function t(e,n){Kf(this,t),this.elements=void 0;var r=n.data,o=n.usage,i=n.type,a=n.count;this.elements=e.elements({data:r,usage:Pl[o||Qf.STATIC_DRAW],type:jl[i||Qf.UNSIGNED_BYTE],count:a})}return $f(t,[{key:"get",value:function(){return this.elements}},{key:"subData",value:function(t){var e=t.data;this.elements.subdata(e)}},{key:"destroy",value:function(){this.elements.destroy()}}]),t}(),nd=function(){function t(e,n){Kf(this,t),this.framebuffer=void 0;var r=n.width,o=n.height,i=n.color,a=n.colors,u=(n.depth,n.stencil,{width:r,height:o});Array.isArray(a)&&(u.colors=a.map((function(t){return t.get()}))),i&&"boolean"!=typeof i&&(u.color=i.get()),this.framebuffer=e.framebuffer(u)}return $f(t,[{key:"get",value:function(){return this.framebuffer}},{key:"destroy",value:function(){this.framebuffer.destroy()}},{key:"resize",value:function(t){var e=t.width,n=t.height;this.framebuffer.resize(e,n)}}]),t}(),rd=n(9308),od=n.n(rd);function id(t){var e={};return Object.keys(t).forEach((function(n){ad(n,t[n],e,"")})),e}function ad(t,e,n,r){null===e||"number"==typeof e||"boolean"==typeof e||Array.isArray(e)&&"number"==typeof e[0]||tl()(e)||""===e||void 0!==e.resize?n["".concat(r&&r+".").concat(t)]=e:(od()(e)&&Object.keys(e).forEach((function(o){ad(o,e[o],n,"".concat(r&&r+".").concat(t))})),Array.isArray(e)&&e.forEach((function(e,o){Object.keys(e).forEach((function(i){ad(i,e[i],n,"".concat(r&&r+".").concat(t,"[").concat(o,"]"))}))})))}function ud(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function sd(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ud(Object(n),!0).forEach((function(e){Yf(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ud(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var cd=function(){function t(e,n){Kf(this,t),this.reGl=void 0,this.drawCommand=void 0,this.uniforms={},this.reGl=e;var r=n.vs,o=n.fs,i=n.defines,a=n.attributes,u=n.uniforms,s=n.primitive,c=n.count,f=n.elements,l=n.depth,d=n.blend,h=n.stencil,p=n.cull,v=n.instances,g=n.scissor,m=n.viewport,y={};u&&(this.uniforms=id(u),Object.keys(u).forEach((function(t){y[t]=e.prop(t)})));var b={};Object.keys(a).forEach((function(t){b[t]=a[t].get()}));var w=i&&this.generateDefines(i)||"",E={attributes:b,frag:"#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n#else\n precision mediump float;\n#endif\n".concat(w,"\n").concat(o),uniforms:y,vert:"\n".concat(w,"\n").concat(r),primitive:Ll[void 0===s?Qf.TRIANGLES:s]};v&&(E.instances=v),c&&(E.count=c),f&&(E.elements=f.get()),g&&(E.scissor=g),m&&(E.viewport=m),this.initDepthDrawParams({depth:l},E),this.initBlendDrawParams({blend:d},E),this.initStencilDrawParams({stencil:h},E),this.initCullDrawParams({cull:p},E),this.drawCommand=e(E)}return $f(t,[{key:"addUniforms",value:function(t){this.uniforms=sd(sd({},this.uniforms),id(t))}},{key:"draw",value:function(t){var e=sd(sd({},this.uniforms),id(t.uniforms||{})),n={};Object.keys(e).forEach((function(t){var r=Hf(e[t]);"boolean"===r||"number"===r||Array.isArray(e[t])||e[t].BYTES_PER_ELEMENT?n[t]=e[t]:"string"===r||(n[t]=e[t].get())})),this.drawCommand(n)}},{key:"destroy",value:function(){}},{key:"initDepthDrawParams",value:function(t,e){var n=t.depth;n&&(e.depth={enable:void 0===n.enable||!!n.enable,mask:void 0===n.mask||!!n.mask,func:Vl[n.func||Qf.LESS],range:n.range||[0,1]})}},{key:"initBlendDrawParams",value:function(t,e){var n=t.blend;if(n){var r=n.enable,o=n.func,i=n.equation,a=n.color,u=void 0===a?[0,0,0,0]:a;e.blend={enable:!!r,func:{srcRGB:Xl[o&&o.srcRGB||Qf.SRC_ALPHA],srcAlpha:Xl[o&&o.srcAlpha||Qf.SRC_ALPHA],dstRGB:Xl[o&&o.dstRGB||Qf.ONE_MINUS_SRC_ALPHA],dstAlpha:Xl[o&&o.dstAlpha||Qf.ONE_MINUS_SRC_ALPHA]},equation:{rgb:Wl[i&&i.rgb||Qf.FUNC_ADD],alpha:Wl[i&&i.alpha||Qf.FUNC_ADD]},color:u}}}},{key:"initStencilDrawParams",value:function(t,e){var n=t.stencil;if(n){var r=n.enable,o=n.mask,i=void 0===o?-1:o,a=n.func,u=void 0===a?{cmp:Qf.ALWAYS,ref:0,mask:-1}:a,s=n.opFront,c=void 0===s?{fail:Qf.KEEP,zfail:Qf.KEEP,zpass:Qf.KEEP}:s,f=n.opBack,l=void 0===f?{fail:Qf.KEEP,zfail:Qf.KEEP,zpass:Qf.KEEP}:f;e.stencil={enable:!!r,mask:i,func:sd(sd({},u),{},{cmp:Hl[u.cmp]}),opFront:{fail:ql[c.fail],zfail:ql[c.zfail],zpass:ql[c.zpass]},opBack:{fail:ql[l.fail],zfail:ql[l.zfail],zpass:ql[l.zpass]}}}}},{key:"initCullDrawParams",value:function(t,e){var n=t.cull;if(n){var r=n.enable,o=n.face,i=void 0===o?Qf.BACK:o;e.cull={enable:!!r,face:Yl[i]}}}},{key:"generateDefines",value:function(t){return Object.keys(t).map((function(e){return"#define ".concat(e," ").concat(Number(t[e]))})).join("\n")}}]),t}(),fd=function(){function t(e,n){Kf(this,t),this.texture=void 0,this.width=void 0,this.height=void 0;var r=n.data,o=n.type,i=void 0===o?Qf.UNSIGNED_BYTE:o,a=n.width,u=n.height,s=n.flipY,c=void 0!==s&&s,f=n.format,l=void 0===f?Qf.RGBA:f,d=n.mipmap,h=void 0!==d&&d,p=n.wrapS,v=void 0===p?Qf.CLAMP_TO_EDGE:p,g=n.wrapT,m=void 0===g?Qf.CLAMP_TO_EDGE:g,y=n.aniso,b=void 0===y?0:y,w=n.alignment,E=void 0===w?1:w,x=n.premultiplyAlpha,_=void 0!==x&&x,S=n.mag,A=void 0===S?Qf.NEAREST:S,I=n.min,T=void 0===I?Qf.NEAREST:I,O=n.colorSpace,N=void 0===O?Qf.BROWSER_DEFAULT_WEBGL:O;this.width=a,this.height=u;var D={width:a,height:u,type:jl[i],format:zl[l],wrapS:Ul[v],wrapT:Ul[m],mag:Gl[A],min:Gl[T],alignment:E,flipY:c,colorSpace:Bl[N],premultiplyAlpha:_,aniso:b};r&&(D.data=r),"number"==typeof h?D.mipmap=Fl[h]:"boolean"==typeof h&&(D.mipmap=h),this.texture=e.texture(D)}return $f(t,[{key:"get",value:function(){return this.texture}},{key:"update",value:function(){this.texture._texture.bind()}},{key:"resize",value:function(t){var e=t.width,n=t.height;this.texture.resize(e,n),this.width=e,this.height=n}},{key:"destroy",value:function(){this.texture.destroy()}}]),t}(),ld=function(){function t(){var e=this;Kf(this,t),this.supportWebGPU=!1,this.useWGSL=!1,this.$canvas=void 0,this.gl=void 0,this.inited=void 0,this.createModel=function(){var t=Xf(al().mark((function t(n){return al().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!n.uniforms){t.next=3;break}return t.next=3,Promise.all(Object.keys(n.uniforms).map(function(){var t=Xf(al().mark((function t(e){var r;return al().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!n.uniforms[e]||void 0===n.uniforms[e].load){t.next=5;break}return t.next=3,n.uniforms[e].load();case 3:r=t.sent,n.uniforms[e]=r;case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 3:return t.abrupt("return",new cd(e.gl,n));case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.createAttribute=function(t){return new Cl(e.gl,t)},this.createBuffer=function(t){return new Kl(e.gl,t)},this.createElements=function(t){return new ed(e.gl,t)},this.createTexture2D=function(t){return new fd(e.gl,t)},this.createFramebuffer=function(t){return new nd(e.gl,t)},this.useFramebuffer=function(t,n){e.gl({framebuffer:t?t.get():null})(n)},this.createComputeModel=function(){var t=Xf(al().mark((function t(n){return al().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new td(e.gl,n));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.clear=function(t){var n=t.color,r=t.depth,o=t.stencil,i=t.framebuffer,a=void 0===i?null:i,u={color:n,depth:r,stencil:o};u.framebuffer=null===a?a:a.get(),e.gl.clear(u)},this.setScissor=function(t){e.gl&&e.gl._gl&&(t.enable&&t.box?(e.gl._gl.enable(Qf.SCISSOR_TEST),e.gl._gl.scissor(t.box.x,t.box.y,t.box.width,t.box.height)):e.gl._gl.disable(Qf.SCISSOR_TEST),e.gl._refresh())},this.viewport=function(t){var n=t.x,r=t.y,o=t.width,i=t.height;e.gl&&e.gl._gl&&(e.gl._gl.viewport(n,r,o,i),e.gl._refresh())},this.readPixels=function(t){var n=t.framebuffer,r={x:t.x,y:t.y,width:t.width,height:t.height};return n&&(r.framebuffer=n.get()),e.gl.read(r)},this.getCanvas=function(){return e.$canvas},this.getGLContext=function(){return e.gl._gl},this.destroy=function(){e.gl&&(e.gl.destroy(),e.inited=!1)}}var e;return $f(t,[{key:"init",value:(e=Xf(al().mark((function t(e){return al().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.inited){t.next=2;break}return t.abrupt("return");case 2:return this.$canvas=e.canvas,t.next=5,new Promise((function(t,n){Rl()({canvas:e.canvas,attributes:{alpha:!0,antialias:e.antialias,premultipliedAlpha:!0},pixelRatio:1,extensions:["OES_element_index_uint","OES_texture_float","OES_standard_derivatives","angle_instanced_arrays"],optionalExtensions:["EXT_texture_filter_anisotropic","EXT_blend_minmax","WEBGL_depth_texture"],profile:!0,onDone:function(e,r){!e&&r||n(e),t(r)}})}));case 5:this.gl=t.sent,this.inited=!0;case 7:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"isFloatSupported",value:function(){return this.gl.limits.readFloat}},{key:"beginFrame",value:function(){}},{key:"endFrame",value:function(){}}]),t}(),dd=function(){function t(){Kf(this,t),this.engine=void 0,this.configService=new hl}return $f(t,[{key:"setConfig",value:function(t){this.configService.set(t)}},{key:"setEngine",value:function(t){this.engine=t}},{key:"createEntity",value:function(){return sl()}},{key:"createKernel",value:function(t){var e=new Ml(this.engine,this.configService);return"string"==typeof t?e.setBundle(JSON.parse(t)):e.setBundle(t),e.init(),e}},{key:"destroy",value:function(){this.engine.destroy()}}],[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=new t;return n.setConfig(e),n.setEngine(new ld),n}}]),t}(),hd=function(t,e){return t?i(t)?function(){return t}:t:function(){return e||1}},pd=function(t){for(var e=[],n=t.length,r=t[0].length,o=function(r){t.forEach((function(t,o){if(e.push(t[r]),o===n-1)for(;e.length%4!=0;)e.push(0)}))},i=0;i<r;i++)o(i);return new Float32Array(e)},vd=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),gd=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{s(r.next(t))}catch(t){i(t)}}function u(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}s((r=r.apply(t,e||[])).next())}))},md=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(u){return function(s){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=e.call(t,a)}catch(t){u=[6,t],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,s])}}},yd=function(t){function e(e){var n=t.call(this)||this;return n.maxIteration=1e3,n.gravity=10,n.speed=1,n.clustering=!1,n.clusterField="cluster",n.clusterGravity=10,n.workerEnabled=!1,n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.updateCfg(e),n}return vd(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:1e3,gravity:10,speed:1,clustering:!1,clusterGravity:10}},e.prototype.execute=function(){return gd(this,void 0,void 0,(function(){var t,e,n,r,o,a=this;return md(this,(function(u){switch(u.label){case 0:return(e=(t=this).nodes)&&0!==e.length?(t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]),n=t.center,1===e.length?(e[0].x=n[0],e[0].y=n[1],t.onLayoutEnd&&t.onLayoutEnd(),[2]):(r={},o={},e.forEach((function(t,e){i(t.x)||(t.x=Math.random()*a.width),i(t.y)||(t.y=Math.random()*a.height),r[t.id]=t,o[t.id]=e})),t.nodeMap=r,t.nodeIdxMap=o,[4,t.run()])):(t.onLayoutEnd&&t.onLayoutEnd(),[2]);case 1:return u.sent(),[2]}}))}))},e.prototype.executeWithWorker=function(t,e){return gd(this,void 0,void 0,(function(){var n,r,o,a,u,s=this;return md(this,(function(c){switch(c.label){case 0:return r=(n=this).nodes,o=n.center,r&&0!==r.length?1===r.length?(r[0].x=o[0],r[0].y=o[1],[2]):(a={},u={},r.forEach((function(t,e){i(t.x)||(t.x=Math.random()*s.width),i(t.y)||(t.y=Math.random()*s.height),a[t.id]=t,u[t.id]=e})),n.nodeMap=a,n.nodeIdxMap=u,[4,n.run(t,e)]):[2];case 1:return c.sent(),[2]}}))}))},e.prototype.run=function(t,e){return gd(this,void 0,void 0,(function(){var n,r,o,a,u,s,c,f,l,h,p,v,g,m,y,b,w,E,x,_,S,A,I,T,O,N,D=this;return md(this,(function(M){switch(M.label){case 0:for(r=(n=this).nodes,o=n.edges,a=n.maxIteration,u=n.center,s=n.height*n.width,c=Math.sqrt(s)/10,f=s/(r.length+1),l=Math.sqrt(f),h=n.speed,p=n.clustering,k=[n.clusterField],R=r,C=[],L=k.length,P={},R.forEach((function(t){k.forEach((function(e,n){if(void 0===P[t[e]]&&(P[t[e]]=Object.keys(P).length),C.push(P[t[e]]),n===L-1)for(;C.length%4!=0;)C.push(0)}))})),v={array:new Float32Array(C),count:Object.keys(P).length},g=v.array,m=v.count,r.forEach((function(t,e){var n=0,r=0;i(t.fx)&&i(t.fy)&&(n=t.fx||.001,r=t.fy||.001),g[4*e+1]=n,g[4*e+2]=r})),y=r.length,b=function(t,e){var n=[],r=[],o={},i=0;for(i=0;i<t.length;i++){var a=t[i];o[a.id]=i,n.push(a.x),n.push(a.y),n.push(0),n.push(0),r.push([])}for(i=0;i<e.length;i++){var u=e[i],s=d(u,"source"),c=d(u,"target");isNaN(o[s])||isNaN(o[c])||(r[o[s]].push(o[c]),r[o[c]].push(o[s]))}var f=0;for(i=0;i<t.length;i++){var l=n.length,h=r[i],p=h.length;n[4*i+2]=l,n[4*i+3]=p,f=Math.max(f,p);for(var v=0;v<p;++v){var g=h[v];n.push(+g)}}for(;n.length%4!=0;)n.push(0);return{maxEdgePerVetex:f,array:new Float32Array(n)}}(r,o),w=b.maxEdgePerVetex,E=b.array,x=n.workerEnabled,_=x?dd.create({canvas:t,engineOptions:{supportCompute:!0}}):dd.create({engineOptions:{supportCompute:!0}}),S=n.onLayoutEnd,A=[],I=0;I<m;I++)A.push(0,0,0,0);return T=_.createKernel('{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_K;\\nuniform float u_K2;\\nuniform vec2 u_Center;\\nuniform float u_Gravity;\\nuniform float u_ClusterGravity;\\nuniform float u_Speed;\\nuniform float u_MaxDisplace;\\nuniform float u_Clustering;\\nuniform sampler2D u_AttributeArray;\\nuniform vec2 u_AttributeArraySize;\\nvec4 getDatau_AttributeArray(vec2 address2D) {\\n return vec4(texture2D(u_AttributeArray, address2D).rgba);\\n}\\nvec4 getDatau_AttributeArray(float address1D) {\\n return getDatau_AttributeArray(addrTranslation_1Dto2D(address1D, u_AttributeArraySize));\\n}\\nvec4 getDatau_AttributeArray(int address1D) {\\n return getDatau_AttributeArray(float(address1D));\\n}\\nuniform sampler2D u_ClusterCenters;\\nuniform vec2 u_ClusterCentersSize;\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\n}\\nvec4 getDatau_ClusterCenters(float address1D) {\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\n}\\nvec4 getDatau_ClusterCenters(int address1D) {\\n return getDatau_ClusterCenters(float(address1D));\\n}\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat param = u_K2 / dist;\\nif (dist > 0.0) {dx += param * xDist;\\ndy += param * yDist;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < j) ? (1.0) : (-1.0);\\ndx += param * sign;\\ndy += param * sign;}}}}\\nreturn vec2(dx, dy);}\\nvec2 calcGravity(vec4 currentNode, vec4 nodeAttributes) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nfloat vx = currentNode.x - u_Center.x;\\nfloat vy = currentNode.y - u_Center.y;\\nfloat gf = (0.01 * u_K) * u_Gravity;\\ndx = gf * vx;\\ndy = gf * vy;\\nif (u_Clustering == 1.0) {int clusterIdx = int(nodeAttributes.x);\\nvec4 center = getDatau_ClusterCenters(clusterIdx);\\nfloat cvx = currentNode.x - center.x;\\nfloat cvy = currentNode.y - center.y;\\nfloat dist = sqrt((cvx * cvx) + (cvy * cvy)) + 0.01;\\nfloat parma = (u_K * u_ClusterGravity) / dist;\\ndx += parma * cvx;\\ndy += parma * cvy;}\\nreturn vec2(dx, dy);}\\nvec2 calcAttractive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nint arr_offset = int(floor(currentNode.z + 0.5));\\nint length = int(floor(currentNode.w + 0.5));\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + int(p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\nfloat float_j = (buf_offset == 0) ? (node_buffer.x) : ((buf_offset == 1) ? (node_buffer.y) : ((buf_offset == 2) ? (node_buffer.z) : (node_buffer.w)));\\nvec4 nextNode = getDatau_Data(int(float_j));\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat attractiveF = dist / u_K;\\nif (dist > 0.0) {dx -= xDist * attractiveF;\\ndy -= yDist * attractiveF;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < int(float_j)) ? (1.0) : (-1.0);\\ndx -= sign * attractiveF;\\ndy -= sign * attractiveF;}}}\\nreturn vec2(dx, dy);}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 currentNode = getDatau_Data(i);\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nif (i >= VERTEX_COUNT) {gl_FragColor = vec4(currentNode);\\nreturn ;}\\nvec4 nodeAttributes = getDatau_AttributeArray(i);\\nif ((nodeAttributes.y != 0.0) && (nodeAttributes.z != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes.y, nodeAttributes.z, currentNode.z, currentNode.w));\\nreturn ;}\\nvec2 repulsive = calcRepulsive(i, currentNode);\\ndx += repulsive.x;\\ndy += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode);\\ndx += attractive.x;\\ndy += attractive.y;\\nvec2 gravity = calcGravity(currentNode, nodeAttributes);\\ndx -= gravity.x;\\ndy -= gravity.y;\\ndx *= u_Speed;\\ndy *= u_Speed;\\nfloat distLength = sqrt((dx * dx) + (dy * dy));\\nif (distLength > 0.0) {float limitedDist = min(u_MaxDisplace * u_Speed, distLength);\\ngl_FragColor = vec4(vec4(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w));}if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"MAX_EDGE_PER_VERTEX","type":"Float","runtime":true},{"name":"VERTEX_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]},{"name":"u_K","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_K2","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Center","type":"vec2<f32>","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Gravity","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterGravity","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Speed","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_MaxDisplace","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Clustering","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AttributeArray","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}').setDispatch([y,1,1]).setBinding({u_Data:E,u_K:l,u_K2:f,u_Gravity:n.gravity,u_ClusterGravity:n.clusterGravity||n.gravity||1,u_Speed:h,u_MaxDisplace:c,u_Clustering:p?1:0,u_Center:u,u_AttributeArray:g,u_ClusterCenters:A,MAX_EDGE_PER_VERTEX:w,VERTEX_COUNT:y}),p&&(O=_.createKernel('{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define CLUSTER_COUNT __DefineValuePlaceholder__CLUSTER_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform sampler2D u_NodeAttributes;\\nuniform vec2 u_NodeAttributesSize;\\nvec4 getDatau_NodeAttributes(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributes, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributes(float address1D) {\\n return getDatau_NodeAttributes(addrTranslation_1Dto2D(address1D, u_NodeAttributesSize));\\n}\\nvec4 getDatau_NodeAttributes(int address1D) {\\n return getDatau_NodeAttributes(float(address1D));\\n}\\nuniform sampler2D u_ClusterCenters;\\nuniform vec2 u_ClusterCentersSize;\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\n}\\nvec4 getDatau_ClusterCenters(float address1D) {\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\n}\\nvec4 getDatau_ClusterCenters(int address1D) {\\n return getDatau_ClusterCenters(float(address1D));\\n}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 center = getDatau_ClusterCenters(i);\\nfloat sumx = 0.0;\\nfloat sumy = 0.0;\\nfloat count = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 attributes = getDatau_NodeAttributes(j);\\nint clusterIdx = int(attributes.x);\\nvec4 vertex = getDatau_Data(j);\\nif (clusterIdx == i) {sumx += vertex.x;\\nsumy += vertex.y;\\ncount += 1.0;}}\\ngl_FragColor = vec4(vec4(sumx / count, sumy / count, count, i));if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"VERTEX_COUNT","type":"Float","runtime":true},{"name":"CLUSTER_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributes","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_ClusterCenters","size":[1,1],"length":1},"needPingpong":true}}').setDispatch([m,1,1]).setBinding({u_Data:E,u_NodeAttributes:g,u_ClusterCenters:A,VERTEX_COUNT:y,CLUSTER_COUNT:m})),N=function(){return gd(D,void 0,void 0,(function(){var n,o;return md(this,(function(i){switch(i.label){case 0:n=0,i.label=1;case 1:return n<a?[4,T.execute()]:[3,6];case 2:return i.sent(),p?(O.setBinding({u_Data:T}),[4,O.execute()]):[3,4];case 3:i.sent(),T.setBinding({u_ClusterCenters:O}),i.label=4;case 4:T.setBinding({u_MaxDisplace:c*=.99}),i.label=5;case 5:return n++,[3,1];case 6:return[4,T.getOutput()];case 7:return o=i.sent(),t?e.postMessage({type:Gt,vertexEdgeData:o}):r.forEach((function(t,e){var n=o[4*e],r=o[4*e+1];t.x=n,t.y=r})),S&&S(),[2]}}))}))},[4,N()];case 1:return M.sent(),[2]}var k,R,C,L,P}))}))},e.prototype.getType=function(){return"fruchterman-gpu"},e}(t),bd=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),wd=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{s(r.next(t))}catch(t){i(t)}}function u(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}s((r=r.apply(t,e||[])).next())}))},Ed=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(u){return function(s){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=e.call(t,a)}catch(t){u=[6,t],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,s])}}},xd=function(t){function e(e){var n=t.call(this)||this;return n.maxIteration=1e3,n.edgeStrength=200,n.nodeStrength=1e3,n.coulombDisScale=.005,n.damping=.9,n.maxSpeed=1e3,n.minMovement=.5,n.interval=.02,n.factor=1,n.linkDistance=1,n.gravity=10,n.workerEnabled=!1,n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.updateCfg(e),n}return bd(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:2e3,gravity:10,clustering:!1,clusterGravity:10}},e.prototype.execute=function(){return wd(this,void 0,void 0,(function(){var t,e,n,r,o;return Ed(this,(function(a){switch(a.label){case 0:return(e=(t=this).nodes)&&0!==e.length?(t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]),n=t.center,1===e.length?(e[0].x=n[0],e[0].y=n[1],t.onLayoutEnd&&t.onLayoutEnd(),[2]):(r={},o={},e.forEach((function(e,n){i(e.x)||(e.x=Math.random()*t.width),i(e.y)||(e.y=Math.random()*t.height),r[e.id]=e,o[e.id]=n})),t.nodeMap=r,t.nodeIdxMap=o,t.nodeStrength=hd(t.nodeStrength,1),t.edgeStrength=hd(t.edgeStrength,1),[4,t.run()])):(t.onLayoutEnd&&t.onLayoutEnd(),[2]);case 1:return a.sent(),[2]}}))}))},e.prototype.executeWithWorker=function(t,e){var n=this,r=n.nodes,o=n.center;if(r&&0!==r.length){if(1===r.length)return r[0].x=o[0],void(r[0].y=o[1]);var a={},u={};r.forEach((function(t,e){i(t.x)||(t.x=Math.random()*n.width),i(t.y)||(t.y=Math.random()*n.height),a[t.id]=t,u[t.id]=e})),n.nodeMap=a,n.nodeIdxMap=u,n.nodeStrength=hd(n.nodeStrength,1),n.edgeStrength=hd(n.edgeStrength,1),n.run(t,e)}},e.prototype.run=function(t,e){return wd(this,void 0,void 0,(function(){var n,r,o,a,u,s,c,f,l,p,v,g,m,y,b,w,E,x,_,S,A,I,T,O,N,D,M,k=this;return Ed(this,(function(R){switch(R.label){case 0:for(r=(n=this).nodes,o=n.edges,a=n.maxIteration,n.width||"undefined"==typeof window||(n.width=window.innerWidth),n.height||"undefined"==typeof window||(n.height=window.innerHeight),u=r.length,n.linkDistance=hd(n.linkDistance),n.edgeStrength=hd(n.edgeStrength),s=function(t,e,n,r){var o=[],i=[],a={},u=0;for(u=0;u<t.length;u++){var s=t[u];a[s.id]=u,o.push(s.x),o.push(s.y),o.push(0),o.push(0),i.push([])}for(u=0;u<e.length;u++){var c=e[u],f=d(c,"source"),l=d(c,"target");i[a[f]].push(a[l]),i[a[f]].push(n(c)),i[a[f]].push(r(c)),i[a[f]].push(0),i[a[l]].push(a[f]),i[a[l]].push(n(c)),i[a[l]].push(r(c)),i[a[l]].push(0)}var h=0;for(u=0;u<t.length;u++){var p=o.length,v=i[u],g=v.length;o[4*u+2]=p+1048576*g/4,o[4*u+3]=0,h=Math.max(h,g/4);for(var m=0;m<g;++m){var y=v[m];o.push(+y)}}for(;o.length%4!=0;)o.push(0);return{maxEdgePerVetex:h,array:new Float32Array(o)}}(r,o,n.linkDistance,n.edgeStrength),c=s.maxEdgePerVetex,f=s.array,n.degrees=h(r.length,n.nodeIdxMap,o).map((function(t){return t.all})),l=[],p=[],v=[],g=[],m=[],y=[],b=[],n.getMass||(n.getMass=function(t){return n.degrees[n.nodeIdxMap[t.id]]||1}),w=n.gravity,E=n.center,r.forEach((function(t,e){l.push(n.getMass(t)),p.push(n.nodeStrength(t)),n.degrees[e]||(n.degrees[e]=0);var r=[E[0],E[1],w];if(n.getCenter){var o=n.getCenter(t,n.degrees[e]);o&&i(o[0])&&i(o[1])&&i(o[2])&&(r=o)}v.push(r[0]),g.push(r[1]),m.push(r[2]),i(t.fx)&&i(t.fy)?(y.push(t.fx||.001),b.push(t.fy||.001)):(y.push(0),b.push(0))})),x=pd([l,n.degrees,p,y]),_=pd([v,g,m,b]),S=n.workerEnabled,A=S?dd.create({canvas:t,engineOptions:{supportCompute:!0}}):dd.create({engineOptions:{supportCompute:!0}}),I=n.onLayoutEnd,T=[],f.forEach((function(t){T.push(t)})),O=0;O<4;O++)T.push(0);return N=A.createKernel('{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define SHIFT_20 1048576.0\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_damping;\\nuniform float u_maxSpeed;\\nuniform float u_minMovement;\\nuniform sampler2D u_AveMovement;\\nuniform vec2 u_AveMovementSize;\\nvec4 getDatau_AveMovement(vec2 address2D) {\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\n}\\nvec4 getDatau_AveMovement(float address1D) {\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\n}\\nvec4 getDatau_AveMovement(int address1D) {\\n return getDatau_AveMovement(float(address1D));\\n}\\nuniform float u_coulombDisScale;\\nuniform float u_factor;\\nuniform sampler2D u_NodeAttributeArray1;\\nuniform vec2 u_NodeAttributeArray1Size;\\nvec4 getDatau_NodeAttributeArray1(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributeArray1, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributeArray1(float address1D) {\\n return getDatau_NodeAttributeArray1(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray1Size));\\n}\\nvec4 getDatau_NodeAttributeArray1(int address1D) {\\n return getDatau_NodeAttributeArray1(float(address1D));\\n}\\nuniform sampler2D u_NodeAttributeArray2;\\nuniform vec2 u_NodeAttributeArray2Size;\\nvec4 getDatau_NodeAttributeArray2(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributeArray2, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributeArray2(float address1D) {\\n return getDatau_NodeAttributeArray2(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray2Size));\\n}\\nvec4 getDatau_NodeAttributeArray2(int address1D) {\\n return getDatau_NodeAttributeArray2(float(address1D));\\n}\\nuniform float u_interval;\\nivec2 unpack_float(float packedValue) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint packedIntValue = int(packedValue);\\nint v0 = packedIntValue / int(SHIFT_20);\\nreturn ivec2(v0, packedIntValue - (v0 * int(SHIFT_20)));}\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\nfloat vx = currentNode.x - nextNode.x;\\nfloat vy = currentNode.y - nextNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat n_dist = (dist + 0.1) * u_coulombDisScale;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nvec4 attributesi = getDatau_NodeAttributeArray1(i);\\nvec4 attributesj = getDatau_NodeAttributeArray1(j);\\nfloat massi = attributesi.x;\\nfloat nodeStrengthi = attributesi.z;\\nfloat nodeStrengthj = attributesj.z;\\nfloat nodeStrength = (nodeStrengthi + nodeStrengthj) / 2.0;\\nfloat param = (nodeStrength * u_factor) / (n_dist * n_dist);\\nax += direx * param;\\nay += direy * param;}}\\nreturn vec2(ax, ay);}\\nvec2 calcGravity(int i, vec4 currentNode, vec4 attributes2) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat vx = currentNode.x - attributes2.x;\\nfloat vy = currentNode.y - attributes2.y;\\nfloat ax = vx * attributes2.z;\\nfloat ay = vy * attributes2.z;\\nreturn vec2(ax, ay);}\\nvec2 calcAttractive(int i, vec4 currentNode, vec4 attributes1) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat mass = attributes1.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nivec2 compressed = unpack_float(currentNode.z);\\nint length = compressed.x;\\nint arr_offset = compressed.y;\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + (4 * p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\nfloat float_j = node_buffer.x;\\nvec4 nextNode = getDatau_Data(int(float_j));\\nfloat vx = nextNode.x - currentNode.x;\\nfloat vy = nextNode.y - currentNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nfloat edgeLength = node_buffer.y;\\nfloat edgeStrength = node_buffer.z;\\nfloat diff = edgeLength - dist;\\nfloat param = (diff * edgeStrength) / mass;\\nax -= direx * param;\\nay -= direy * param;}\\nreturn vec2(ax, ay);}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 currentNode = getDatau_Data(i);\\nvec4 movement = getDatau_AveMovement(0.0);\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nif ((i >= VERTEX_COUNT) || (movement.x < u_minMovement)) {gl_FragColor = vec4(currentNode);\\nreturn ;}\\nvec4 nodeAttributes1 = getDatau_NodeAttributeArray1(i);\\nvec4 nodeAttributes2 = getDatau_NodeAttributeArray2(i);\\nvec2 repulsive = calcRepulsive(i, currentNode);\\nax += repulsive.x;\\nay += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode, nodeAttributes1);\\nax += attractive.x;\\nay += attractive.y;\\nvec2 gravity = calcGravity(i, currentNode, nodeAttributes2);\\nax -= gravity.x;\\nay -= gravity.y;\\nfloat param = u_interval * u_damping;\\nfloat vx = ax * param;\\nfloat vy = ay * param;\\nfloat vlength = sqrt((vx * vx) + (vy * vy)) + 0.0001;\\nif (vlength > u_maxSpeed) {float param2 = u_maxSpeed / vlength;\\nvx = param2 * vx;\\nvy = param2 * vy;}\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0));}else {float distx = vx * u_interval;\\nfloat disty = vy * u_interval;\\nfloat distLength = sqrt((distx * distx) + (disty * disty));\\ngl_FragColor = vec4(vec4(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength));}if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"MAX_EDGE_PER_VERTEX","type":"Float","runtime":true},{"name":"VERTEX_COUNT","type":"Float","runtime":true},{"name":"SHIFT_20","type":"Float","value":1048576,"runtime":false}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]},{"name":"u_damping","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_maxSpeed","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_minMovement","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AveMovement","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_coulombDisScale","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_factor","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray1","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray2","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_interval","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}').setDispatch([u,1,1]).setBinding({u_Data:f,u_damping:n.damping,u_maxSpeed:n.maxSpeed,u_minMovement:n.minMovement,u_coulombDisScale:n.coulombDisScale,u_factor:n.factor,u_NodeAttributeArray1:x,u_NodeAttributeArray2:_,MAX_EDGE_PER_VERTEX:c,VERTEX_COUNT:u,u_AveMovement:T,u_interval:n.interval}),D=A.createKernel('{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_iter;\\nuniform sampler2D u_AveMovement;\\nuniform vec2 u_AveMovementSize;\\nvec4 getDatau_AveMovement(vec2 address2D) {\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\n}\\nvec4 getDatau_AveMovement(float address1D) {\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\n}\\nvec4 getDatau_AveMovement(int address1D) {\\n return getDatau_AveMovement(float(address1D));\\n}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat movement = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 vertex = getDatau_Data(j);\\nmovement += vertex.w;}\\nmovement = movement / float(VERTEX_COUNT);\\ngl_FragColor = vec4(vec4(movement, 0.0, 0.0, 0.0));if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"VERTEX_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_iter","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AveMovement","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_AveMovement","size":[1,1],"length":1},"needPingpong":true}}').setDispatch([1,1,1]).setBinding({u_Data:f,VERTEX_COUNT:u,u_AveMovement:[0,0,0,0]}),M=function(){return wd(k,void 0,void 0,(function(){var o,i,u;return Ed(this,(function(s){switch(s.label){case 0:o=0,s.label=1;case 1:return o<a?[4,N.execute()]:[3,5];case 2:return s.sent(),D.setBinding({u_Data:N}),[4,D.execute()];case 3:s.sent(),i=Math.max(.02,n.interval-.002*o),N.setBinding({u_interval:i,u_AveMovement:D}),s.label=4;case 4:return o++,[3,1];case 5:return[4,N.getOutput()];case 6:return u=s.sent(),t?e.postMessage({type:Gt,vertexEdgeData:u}):r.forEach((function(t,e){var n=u[4*e],r=u[4*e+1];t.x=n,t.y=r})),I&&I(),[2]}}))}))},[4,M()];case 1:return R.sent(),[2]}}))}))},e.prototype.getType=function(){return"gForce-gpu"},e}(t),_d=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Sd=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.maxIteration=100,n.gravity=10,n.comboGravity=10,n.linkDistance=10,n.alpha=1,n.alphaMin=.001,n.alphaDecay=1-Math.pow(n.alphaMin,1/300),n.alphaTarget=0,n.velocityDecay=.6,n.edgeStrength=.6,n.nodeStrength=30,n.preventOverlap=!1,n.preventNodeOverlap=!1,n.preventComboOverlap=!1,n.collideStrength=void 0,n.nodeCollideStrength=.5,n.comboCollideStrength=.5,n.comboSpacing=20,n.comboPadding=10,n.optimizeRangeFactor=1,n.onTick=function(){},n.onLayoutEnd=function(){},n.depthAttractiveForceScale=1,n.depthRepulsiveForceScale=2,n.nodes=[],n.edges=[],n.combos=[],n.comboTrees=[],n.width=300,n.height=300,n.bias=[],n.nodeMap={},n.oriComboMap={},n.indexMap={},n.comboMap={},n.previousLayouted=!1,n.updateCfg(e),n}return _d(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:100,center:[0,0],gravity:10,speed:1,comboGravity:30,preventOverlap:!1,preventComboOverlap:!0,preventNodeOverlap:!0,nodeSpacing:void 0,collideStrength:void 0,nodeCollideStrength:.5,comboCollideStrength:.5,comboSpacing:20,comboPadding:10,edgeStrength:.6,nodeStrength:30,linkDistance:10}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.center;if(t.comboTree={id:"comboTreeRoot",depth:-1,children:t.comboTrees},e&&0!==e.length){if(1===e.length)return e[0].x=n[0],e[0].y=n[1],void(t.onLayoutEnd&&t.onLayoutEnd());t.initVals(),t.run(),t.onLayoutEnd&&t.onLayoutEnd()}else t.onLayoutEnd&&t.onLayoutEnd()},e.prototype.run=function(){var t=this,e=t.nodes,n=t.previousLayouted?t.maxIteration/5:t.maxIteration;t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);var r=t.center,o=t.velocityDecay,a=t.comboMap;t.previousLayouted||t.initPos(a);for(var u=function(n){var r=[];e.forEach((function(t,e){r[e]={x:0,y:0}})),t.applyCalculate(r),t.applyComboCenterForce(r),e.forEach((function(t,e){i(t.x)&&i(t.y)&&(t.x+=r[e].x*o,t.y+=r[e].y*o)})),t.alpha+=(t.alphaTarget-t.alpha)*t.alphaDecay,t.onTick()},s=0;s<n;s++)u();var c=[0,0];e.forEach((function(t){i(t.x)&&i(t.y)&&(c[0]+=t.x,c[1]+=t.y)})),c[0]/=e.length,c[1]/=e.length;var f=[r[0]-c[0],r[1]-c[1]];e.forEach((function(t,e){i(t.x)&&i(t.y)&&(t.x+=f[0],t.y+=f[1])})),t.combos.forEach((function(t){var e=a[t.id];e&&e.empty&&(t.x=e.cx||t.x,t.y=e.cy||t.y)})),t.previousLayouted=!0},e.prototype.initVals=function(){var t=this,e=t.edges,n=t.nodes,r=t.combos,a={},u={},s={};n.forEach((function(t,e){u[t.id]=t,s[t.id]=e})),t.nodeMap=u,t.indexMap=s;var c={};r.forEach((function(t){c[t.id]=t})),t.oriComboMap=c,t.comboMap=t.getComboMap();var l=t.preventOverlap;t.preventComboOverlap=t.preventComboOverlap||l,t.preventNodeOverlap=t.preventNodeOverlap||l;var h=t.collideStrength;h&&(t.comboCollideStrength=h,t.nodeCollideStrength=h),t.comboCollideStrength=t.comboCollideStrength?t.comboCollideStrength:0,t.nodeCollideStrength=t.nodeCollideStrength?t.nodeCollideStrength:0;for(var p=0;p<e.length;++p){var v=d(e[p],"source"),g=d(e[p],"target");a[v]?a[v]++:a[v]=1,a[g]?a[g]++:a[g]=1}var m=[];for(p=0;p<e.length;++p)v=d(e[p],"source"),g=d(e[p],"target"),m[p]=a[v]/(a[v]+a[g]);this.bias=m;var y,b,w=t.nodeSize,x=t.nodeSpacing;if(b=i(x)?function(){return x}:E(x)?x:function(){return 0},this.nodeSpacing=b,w)if(E(w))y=function(t){return w(t)};else if(o(w)){var _=(w[0]>w[1]?w[0]:w[1])/2;y=function(t){return _}}else{var S=w/2;y=function(t){return S}}else y=function(t){return t.size?o(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2:f(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)/2:t.size/2:10};this.nodeSize=y;var A,I=t.comboSpacing;A=i(I)?function(){return I}:E(I)?I:function(){return 0},this.comboSpacing=A;var T,O=t.comboPadding;T=i(O)?function(){return O}:o(O)?function(){return Math.max.apply(null,O)}:E(O)?O:function(){return 0},this.comboPadding=T;var N,D=this.linkDistance;D||(D=10),N=i(D)?function(t){return D}:D,this.linkDistance=N;var M,k=this.edgeStrength;k||(k=1),M=i(k)?function(t){return k}:k,this.edgeStrength=M;var R,C=this.nodeStrength;C||(C=30),R=i(C)?function(t){return C}:C,this.nodeStrength=R},e.prototype.initPos=function(t){this.nodes.forEach((function(e,n){var r=e.comboId,o=t[r];r&&o?(e.x=o.cx+100/(n+1),e.y=o.cy+100/(n+1)):(e.x=100/(n+1),e.y=100/(n+1))}))},e.prototype.getComboMap=function(){var t=this,e=t.nodeMap,n=t.comboTrees,r=t.oriComboMap,o={};return(n||[]).forEach((function(n){var a=[];m(n,(function(n){if("node"===n.itemType)return!0;if(!r[n.id])return!0;if(void 0===o[n.id]){var u={id:n.id,name:n.id,cx:0,cy:0,count:0,depth:t.oriComboMap[n.id].depth||0,children:[]};o[n.id]=u}var s=n.children;s&&s.forEach((function(t){if(!o[t.id]&&!e[t.id])return!0;a.push(t)}));var c=o[n.id];if(c.cx=0,c.cy=0,0===a.length){c.empty=!0;var f=r[n.id];c.cx=f.x,c.cy=f.y}return a.forEach((function(t){if(c.count++,"node"!==t.itemType){var n=o[t.id];return i(n.cx)&&(c.cx+=n.cx),void(i(n.cy)&&(c.cy+=n.cy))}var r=e[t.id];r&&(i(r.x)&&(c.cx+=r.x),i(r.y)&&(c.cy+=r.y))})),c.cx/=c.count||1,c.cy/=c.count||1,c.children=a,!0}))})),o},e.prototype.applyComboCenterForce=function(t){var e=this,n=e.gravity,r=e.comboGravity||n,o=this.alpha,a=e.comboTrees,u=e.indexMap,s=e.nodeMap,c=e.comboMap;(a||[]).forEach((function(e){m(e,(function(e){if("node"===e.itemType)return!0;if(!c[e.id])return!0;var n=c[e.id],a=(n.depth+1)/10*.5,f=n.cx,l=n.cy;return n.cx=0,n.cy=0,n.children.forEach((function(e){if("node"!==e.itemType){var d=c[e.id];return d&&i(d.cx)&&(n.cx+=d.cx),void(d&&i(d.cy)&&(n.cy+=d.cy))}var h=s[e.id],p=h.x-f||.005,v=h.y-l||.005,g=Math.sqrt(p*p+v*v),m=u[h.id],y=r*o/g*a;t[m].x-=p*y,t[m].y-=v*y,i(h.x)&&(n.cx+=h.x),i(h.y)&&(n.cy+=h.y)})),n.cx/=n.count||1,n.cy/=n.count||1,!0}))}))},e.prototype.applyCalculate=function(t){var e=this,n=e.comboMap,r=e.nodes,o={};r.forEach((function(t,e){r.forEach((function(n,r){if(!(e<r)){var i=t.x-n.x||.005,a=t.y-n.y||.005,u=i*i+a*a,s=Math.sqrt(u);u<1&&(u=s),o["".concat(t.id,"-").concat(n.id)]={vx:i,vy:a,vl2:u,vl:s},o["".concat(n.id,"-").concat(t.id)]={vl2:u,vl:s,vx:-i,vy:-a}}}))})),e.updateComboSizes(n),e.calRepulsive(t,o),e.calAttractive(t,o),e.preventComboOverlap&&e.comboNonOverlapping(t,n)},e.prototype.updateComboSizes=function(t){var e=this,n=e.comboTrees,r=e.nodeMap,i=e.nodeSize,a=e.comboSpacing,u=e.comboPadding;(n||[]).forEach((function(n){var s=[];m(n,(function(n){if("node"===n.itemType)return!0;var c=t[n.id];if(!c)return!1;var f=n.children;f&&f.forEach((function(e){(t[e.id]||r[e.id])&&s.push(e)})),c.minX=1/0,c.minY=1/0,c.maxX=-1/0,c.maxY=-1/0,s.forEach((function(t){if("node"!==t.itemType)return!0;var e=r[t.id];if(!e)return!0;var n=i(e),o=e.x-n,a=e.y-n,u=e.x+n,s=e.y+n;c.minX>o&&(c.minX=o),c.minY>a&&(c.minY=a),c.maxX<u&&(c.maxX=u),c.maxY<s&&(c.maxY=s)}));var l=e.oriComboMap[n.id].size||10;o(l)&&(l=l[0]);var d=Math.max(c.maxX-c.minX,c.maxY-c.minY,l);return c.r=d/2+a(c)/2+u(c),!0}))}))},e.prototype.comboNonOverlapping=function(t,e){var n=this,r=n.comboTree,o=n.comboCollideStrength,i=n.indexMap,a=n.nodeMap;m(r,(function(n){if(!e[n.id]&&!a[n.id]&&"comboTreeRoot"!==n.id)return!1;var r=n.children;return r&&r.length>1&&r.forEach((function(n,u){if("node"===n.itemType)return!1;var s=e[n.id];s&&r.forEach((function(r,c){if(u<=c)return!1;if("node"===r.itemType)return!1;var f=e[r.id];if(!f)return!1;var l=s.cx-f.cx||.005,d=s.cy-f.cy||.005,h=l*l+d*d,p=s.r||1,v=f.r||1,g=p+v,m=v*v,y=p*p;if(h<g*g){var b=n.children;if(!b||0===b.length)return!1;var w=r.children;if(!w||0===w.length)return!1;var E=Math.sqrt(h),x=(g-E)/E*o,_=l*x,S=d*x,A=m/(y+m),I=1-A;b.forEach((function(e){if("node"!==e.itemType)return!1;if(a[e.id]){var n=i[e.id];w.forEach((function(e){if("node"!==e.itemType)return!1;if(!a[e.id])return!1;var r=i[e.id];t[n].x+=_*A,t[n].y+=S*A,t[r].x-=_*I,t[r].y-=S*I}))}}))}}))})),!0}))},e.prototype.calRepulsive=function(t,e){var n=this,r=n.nodes,o=n.width*n.optimizeRangeFactor,i=n.nodeStrength,a=n.alpha,u=n.nodeCollideStrength,s=n.preventNodeOverlap,c=n.nodeSize,f=n.nodeSpacing,l=n.depthRepulsiveForceScale,d=n.center;r.forEach((function(h,p){if(h.x&&h.y){if(d){var v=n.gravity,g=h.x-d[0]||.005,m=h.y-d[1]||.005,y=Math.sqrt(g*g+m*m);t[p].x-=g*v*a/y,t[p].y-=m*v*a/y}r.forEach((function(n,r){if(p!==r&&n.x&&n.y){var d=e["".concat(h.id,"-").concat(n.id)],v=d.vl2,g=d.vl;if(!(g>o)){var m=e["".concat(h.id,"-").concat(n.id)],y=m.vx,b=m.vy,w=Math.log(Math.abs(n.depth-h.depth)/10)+1||1;w=w<1?1:w,n.comboId!==h.comboId&&(w+=1);var E=w?Math.pow(l,w):1,x=i(n)*a/v*E;if(t[p].x+=y*x,t[p].y+=b*x,p<r&&s){var _=c(h)+f(h)||1,S=c(n)+f(n)||1,A=_+S;if(v<A*A){var I=(A-g)/g*u,T=S*S,O=T/(_*_+T),N=y*I,D=b*I;t[p].x+=N*O,t[p].y+=D*O,O=1-O,t[r].x-=N*O,t[r].y-=D*O}}}}}))}}))},e.prototype.calAttractive=function(t,e){var n=this,r=n.edges,o=n.linkDistance,a=n.alpha,u=n.edgeStrength,s=n.bias,c=n.depthAttractiveForceScale;r.forEach((function(r,f){var l=d(r,"source"),h=d(r,"target");if(l&&h&&l!==h){var p=n.indexMap[l],v=n.indexMap[h],g=n.nodeMap[l],m=n.nodeMap[h];if(g&&m){var y=g.depth===m.depth?0:Math.log(Math.abs(g.depth-m.depth)/10);g.comboId===m.comboId&&(y/=2);var b=y?Math.pow(c,y):1;if(g.comboId!==m.comboId&&1===b?b=c/2:g.comboId===m.comboId&&(b=2),i(m.x)&&i(g.x)&&i(m.y)&&i(g.y)){var w=e["".concat(h,"-").concat(l)],E=w.vl,x=w.vx,_=w.vy,S=(E-o(r))/E*a*u(r)*b,A=x*S,I=_*S,T=s[f];t[v].x-=A*T,t[v].y-=I*T,t[p].x+=A*(1-T),t[p].y+=I*(1-T)}}}}))},e.prototype.getType=function(){return"comboForce"},e}(t),Ad=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Id=function(){return Id=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Id.apply(this,arguments)},Td=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.nodes=[],n.edges=[],n.combos=[],n.comboEdges=[],n.comboPadding=10,n.comboTrees=[],n.updateCfg(e),n}return Ad(e,t),e.prototype.getDefaultCfg=function(){return{}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.center;if(e&&0!==e.length){if(1===e.length)return e[0].x=n[0],e[0].y=n[1],void(t.onLayoutEnd&&t.onLayoutEnd());t.initVals(),t.run(),t.onLayoutEnd&&t.onLayoutEnd()}else t.onLayoutEnd&&t.onLayoutEnd()},e.prototype.run=function(){var t,e=this,n=e.nodes,r=e.edges,o=e.combos,i=e.comboEdges,a=e.center,u={};n.forEach((function(t){u[t.id]=t}));var s={};o.forEach((function(t){s[t.id]=t}));var c=e.getInnerGraphs(u),f=[],l=[],d={},h=!0;this.comboTrees.forEach((function(t){var e=c[t.id],n=Id(Id({},t),{x:e.x||s[t.id].x,y:e.y||s[t.id].y,fx:e.fx||s[t.id].fx,fy:e.fy||s[t.id].fy,mass:e.mass||s[t.id].mass,size:e.size});l.push(n),isNaN(n.x)||0===n.x||isNaN(n.y)||0===n.y?(n.x=100*Math.random(),n.y=100*Math.random()):h=!1,f.push(t.id),m(t,(function(e){return e.id!==t.id&&(d[e.id]=t.id),!0}))})),n.forEach((function(t){if(!t.comboId||!s[t.comboId]){var e=Id({},t);l.push(e),isNaN(e.x)||0===e.x||isNaN(e.y)||0===e.y?(e.x=100*Math.random(),e.y=100*Math.random()):h=!1,f.push(t.id)}}));var p=[];if(r.concat(i).forEach((function(t){var e=d[t.source]||t.source,n=d[t.target]||t.target;e!==n&&f.includes(e)&&f.includes(n)&&p.push({source:e,target:n})})),null==l?void 0:l.length){if(1===l.length)l[0].x=a[0],l[0].y=a[1];else{var v={nodes:l,edges:p},g=this.outerLayout||new L({gravity:1,factor:4,linkDistance:function(t,e,n){var r,o,i=(((null===(r=e.size)||void 0===r?void 0:r[0])||30)+((null===(o=n.size)||void 0===o?void 0:o[0])||30))/2;return Math.min(1.5*i,700)}}),y=null===(t=g.getType)||void 0===t?void 0:t.call(g);g.updateCfg({center:a,kg:5,preventOverlap:!0,animate:!1}),h&&Ut[y]&&(l.length<100?new Uf:new D).layout(v),g.layout(v)}l.forEach((function(t){var e=c[t.id];if(e)e.visited=!0,e.x=t.x,e.y=t.y,e.nodes.forEach((function(e){e.x+=t.x,e.y+=t.y}));else{var n=u[t.id];n&&(n.x=t.x,n.y=t.y)}}))}for(var b=Object.keys(c),w=function(t){var e=b[t],n=c[e];if(!n)return"continue";n.nodes.forEach((function(t){n.visited||(t.x+=n.x||0,t.y+=n.y||0),u[t.id]&&(u[t.id].x=t.x,u[t.id].y=t.y)})),s[e]&&(s[e].x=n.x,s[e].y=n.y)},E=b.length-1;E>=0;E--)w(E);return{nodes:n,edges:r,combos:o,comboEdges:i}},e.prototype.getInnerGraphs=function(t){var e=this,n=e.comboTrees,r=e.nodeSize,a=e.edges,u=e.comboPadding,s=e.spacing,c={},f=this.innerLayout||new Ff({sortBy:"id"});return f.center=[0,0],f.preventOverlap=!0,f.nodeSpacing=s,(n||[]).forEach((function(e){m(e,(function(e){var n,s=(null==u?void 0:u(e))||10;if(o(s)&&(s=Math.max.apply(Math,s)),null===(n=e.children)||void 0===n?void 0:n.length){var l=e.children.map((function(e){if("combo"===e.itemType)return c[e.id];var n=t[e.id]||{};return Id(Id({},n),e)})),d=l.map((function(t){return t.id})),h={nodes:l,edges:a.filter((function(t){return d.includes(t.source)&&d.includes(t.target)}))},p=1/0;l.forEach((function(t){var e;t.size||(t.size=(null===(e=c[t.id])||void 0===e?void 0:e.size)||(null==r?void 0:r(t))||[30,30]),i(t.size)&&(t.size=[t.size,t.size]),p>t.size[0]&&(p=t.size[0]),p>t.size[1]&&(p=t.size[1])})),f.layout(h);var v=function(t){var e=1/0,n=1/0,r=-1/0,a=-1/0;return t.forEach((function(t){var u=t.size;o(u)?1===u.length&&(u=[u[0],u[0]]):i(u)?u=[u,u]:(void 0===u||isNaN(u))&&(u=[30,30]);var s=[u[0]/2,u[1]/2],c=t.x-s[0],f=t.x+s[0],l=t.y-s[1],d=t.y+s[1];e>c&&(e=c),n>l&&(n=l),r<f&&(r=f),a<d&&(a=d)})),{minX:e,minY:n,maxX:r,maxY:a}}(l),g=v.minX,m=v.minY,y=v.maxX,b=v.maxY,w={x:(y+g)/2,y:(b+m)/2};h.nodes.forEach((function(t){t.x-=w.x,t.y-=w.y}));var E=Math.max(y-g,b-m,p)+2*s;c[e.id]={id:e.id,nodes:l,size:[E,E]}}else if("combo"===e.itemType){var x=s?[2*s,2*s]:[30,30];c[e.id]={id:e.id,nodes:[],size:x}}return!0}))})),c},e.prototype.initVals=function(){var t,e,n=this,r=n.nodeSize,a=n.spacing;if(e=i(a)?function(){return a}:E(a)?a:function(){return 0},this.spacing=e,r)if(E(r))t=function(t){var n=r(t),i=e(t);return o(t.size)?((t.size[0]>t.size[1]?t.size[0]:t.size[1])+i)/2:((n||10)+i)/2};else if(o(r)){var u=(r[0]>r[1]?r[0]:r[1])/2;t=function(t){return u+e(t)/2}}else{var s=r/2;t=function(t){return s+e(t)/2}}else t=function(t){var n=e(t);return t.size?o(t.size)?((t.size[0]>t.size[1]?t.size[0]:t.size[1])+n)/2:f(t.size)?((t.size.width>t.size.height?t.size.width:t.size.height)+n)/2:(t.size+n)/2:10+n/2};this.nodeSize=t;var c,l=n.comboPadding;c=i(l)?function(){return l}:o(l)?function(){return Math.max.apply(null,l)}:E(l)?l:function(){return 0},this.comboPadding=c},e.prototype.getType=function(){return"comboCombined"},e}(t),Od=function(){function t(t){this.id=t.id||0,this.rx=t.rx,this.ry=t.ry,this.fx=0,this.fy=0,this.mass=t.mass,this.degree=t.degree,this.g=t.g||0}return t.prototype.distanceTo=function(t){var e=this.rx-t.rx,n=this.ry-t.ry;return Math.hypot(e,n)},t.prototype.setPos=function(t,e){this.rx=t,this.ry=e},t.prototype.resetForce=function(){this.fx=0,this.fy=0},t.prototype.addForce=function(t){var e=t.rx-this.rx,n=t.ry-this.ry,r=Math.hypot(e,n);r=r<1e-4?1e-4:r;var o=this.g*(this.degree+1)*(t.degree+1)/r;this.fx+=o*e/r,this.fy+=o*n/r},t.prototype.in=function(t){return t.contains(this.rx,this.ry)},t.prototype.add=function(e){var n=this.mass+e.mass;return new t({rx:(this.rx*this.mass+e.rx*e.mass)/n,ry:(this.ry*this.mass+e.ry*e.mass)/n,mass:n,degree:this.degree+e.degree})},t}();const Nd=Od;const Dd=function(){function t(t){this.xmid=t.xmid,this.ymid=t.ymid,this.length=t.length,this.massCenter=t.massCenter||[0,0],this.mass=t.mass||1}return t.prototype.getLength=function(){return this.length},t.prototype.contains=function(t,e){var n=this.length/2;return t<=this.xmid+n&&t>=this.xmid-n&&e<=this.ymid+n&&e>=this.ymid-n},t.prototype.NW=function(){return new t({xmid:this.xmid-this.length/4,ymid:this.ymid+this.length/4,length:this.length/2})},t.prototype.NE=function(){return new t({xmid:this.xmid+this.length/4,ymid:this.ymid+this.length/4,length:this.length/2})},t.prototype.SW=function(){return new t({xmid:this.xmid-this.length/4,ymid:this.ymid-this.length/4,length:this.length/2})},t.prototype.SE=function(){return new t({xmid:this.xmid+this.length/4,ymid:this.ymid-this.length/4,length:this.length/2})},t}();const Md=function(){function t(t){this.body=null,this.quad=null,this.NW=null,this.NE=null,this.SW=null,this.SE=null,this.theta=.5,null!=t&&(this.quad=t)}return t.prototype.insert=function(e){null!=this.body?this._isExternal()?(this.quad&&(this.NW=new t(this.quad.NW()),this.NE=new t(this.quad.NE()),this.SW=new t(this.quad.SW()),this.SE=new t(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)):this.body=e},t.prototype._putBody=function(t){this.quad&&(t.in(this.quad.NW())&&this.NW?this.NW.insert(t):t.in(this.quad.NE())&&this.NE?this.NE.insert(t):t.in(this.quad.SW())&&this.SW?this.SW.insert(t):t.in(this.quad.SE())&&this.SE&&this.SE.insert(t))},t.prototype._isExternal=function(){return null==this.NW&&null==this.NE&&null==this.SW&&null==this.SE},t.prototype.updateForce=function(t){null!=this.body&&t!==this.body&&(this._isExternal()||(this.quad?this.quad.getLength():0)/this.body.distanceTo(t)<this.theta?t.addForce(this.body):(this.NW&&this.NW.updateForce(t),this.NE&&this.NE.updateForce(t),this.SW&&this.SW.updateForce(t),this.SE&&this.SE.updateForce(t)))},t}();var kd=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Rd=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.width=300,n.height=300,n.nodes=[],n.edges=[],n.kr=5,n.kg=1,n.mode="normal",n.preventOverlap=!1,n.dissuadeHubs=!1,n.barnesHut=void 0,n.maxIteration=0,n.ks=.1,n.ksmax=10,n.tao=.1,n.onLayoutEnd=function(){},n.prune=void 0,n.updateCfg(e),n}return kd(e,t),e.prototype.getDefaultCfg=function(){return{}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.onLayoutEnd,r=t.prune,a=t.maxIteration;t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);for(var u=[],s=e.length,c=0;c<s;c+=1){var l=e[c],d=10,h=10;i(l.size)&&(d=l.size,h=l.size),o(l.size)?(isNaN(l.size[0])||(d=l.size[0]),isNaN(l.size[1])||(h=l.size[1])):f(l.size)&&(d=l.size.width,h=l.size.height),t.getWidth&&!isNaN(t.getWidth(l))&&(h=t.getWidth(l)),t.getHeight&&!isNaN(t.getHeight(l))&&(d=t.getHeight(l));var p=Math.max(d,h);u.push(p)}void 0===t.barnesHut&&s>250&&(t.barnesHut=!0),void 0===t.prune&&s>100&&(t.prune=!0),0!==this.maxIteration||t.prune?0===this.maxIteration&&r&&(a=100,s<=200&&s>100?a=500:s>200&&(a=950),this.maxIteration=a):(a=250,s<=200&&s>100?a=1e3:s>200&&(a=1200),this.maxIteration=a),t.kr||(t.kr=50,s>100&&s<=500?t.kr=20:s>500&&(t.kr=1)),t.kg||(t.kg=20,s>100&&s<=500?t.kg=10:s>500&&(t.kg=1)),this.nodes=t.updateNodesByForces(u),n()},e.prototype.updateNodesByForces=function(t){for(var e=this,n=e.edges,r=e.maxIteration,o=e.nodes,i=n.filter((function(t){return d(t,"source")!==d(t,"target")})),a=o.length,u=i.length,s=[],c={},f={},l=[],h=0;h<a;h+=1)c[o[h].id]=h,s[h]=0,(void 0===o[h].x||isNaN(o[h].x))&&(o[h].x=1e3*Math.random()),(void 0===o[h].y||isNaN(o[h].y))&&(o[h].y=1e3*Math.random()),l.push({x:o[h].x,y:o[h].y});for(h=0;h<u;h+=1){for(var p=void 0,v=void 0,g=0,m=0,y=0;y<a;y+=1){var b=d(i[h],"source"),w=d(i[h],"target");o[y].id===b?(p=o[y],g=y):o[y].id===w&&(v=o[y],m=y),f[h]={sourceIdx:g,targetIdx:m}}p&&(s[c[p.id]]+=1),v&&(s[c[v.id]]+=1)}var E=r;if(o=this.iterate(E,c,f,u,s,t),e.prune){for(y=0;y<u;y+=1)s[f[y].sourceIdx]<=1?(o[f[y].sourceIdx].x=o[f[y].targetIdx].x,o[f[y].sourceIdx].y=o[f[y].targetIdx].y):s[f[y].targetIdx]<=1&&(o[f[y].targetIdx].x=o[f[y].sourceIdx].x,o[f[y].targetIdx].y=o[f[y].sourceIdx].y);e.prune=!1,e.barnesHut=!1,E=100,o=this.iterate(E,c,f,u,s,t)}return o},e.prototype.iterate=function(t,e,n,r,o,i){for(var a=this,u=a.nodes,s=a.kr,c=a.preventOverlap,f=a.barnesHut,l=u.length,d=0,h=t,p=[],v=[],g=[],m=0;m<l;m+=1)if(p[2*m]=0,p[2*m+1]=0,f){var y={id:m,rx:u[m].x,ry:u[m].y,mass:1,g:s,degree:o[m]};g[m]=new Nd(y)}for(;h>0;){for(m=0;m<l;m+=1)v[2*m]=p[2*m],v[2*m+1]=p[2*m+1],p[2*m]=0,p[2*m+1]=0;p=this.getAttrForces(h,50,r,e,n,o,i,p),p=f&&(c&&h>50||!c)?this.getOptRepGraForces(p,g,o):this.getRepGraForces(h,50,p,100,i,o);var b=this.updatePos(p,v,d,o);u=b.nodes,d=b.sg,h--,a.tick&&a.tick()}return u},e.prototype.getAttrForces=function(t,e,n,r,o,i,a,u){for(var s=this,c=s.nodes,f=s.preventOverlap,l=s.dissuadeHubs,d=s.mode,h=s.prune,p=0;p<n;p+=1){var v=c[o[p].sourceIdx],g=o[p].sourceIdx,m=c[o[p].targetIdx],y=o[p].targetIdx;if(!h||!(i[g]<=1||i[y]<=1)){var b=[m.x-v.x,m.y-v.y],w=Math.hypot(b[0],b[1]);w=w<1e-4?1e-4:w,b[0]=b[0]/w,b[1]=b[1]/w,f&&t<e&&(w=w-a[g]-a[y]);var E=w,x=E;"linlog"===d&&(x=E=Math.log(1+w)),l&&(E=w/i[g],x=w/i[y]),f&&t<e&&w<=0?(E=0,x=0):f&&t<e&&w>0&&(E=w,x=w),u[2*r[v.id]]+=E*b[0],u[2*r[m.id]]-=x*b[0],u[2*r[v.id]+1]+=E*b[1],u[2*r[m.id]+1]-=x*b[1]}}return u},e.prototype.getRepGraForces=function(t,e,n,r,o,i){for(var a=this,u=a.nodes,s=a.preventOverlap,c=a.kr,f=a.kg,l=a.center,d=a.prune,h=u.length,p=0;p<h;p+=1){for(var v=p+1;v<h;v+=1)if(!d||!(i[p]<=1||i[v]<=1)){var g=[u[v].x-u[p].x,u[v].y-u[p].y],m=Math.hypot(g[0],g[1]);m=m<1e-4?1e-4:m,g[0]=g[0]/m,g[1]=g[1]/m,s&&t<e&&(m=m-o[p]-o[v]);var y=c*(i[p]+1)*(i[v]+1)/m;s&&t<e&&m<0?y=r*(i[p]+1)*(i[v]+1):s&&t<e&&0===m?y=0:s&&t<e&&m>0&&(y=c*(i[p]+1)*(i[v]+1)/m),n[2*p]-=y*g[0],n[2*v]+=y*g[0],n[2*p+1]-=y*g[1],n[2*v+1]+=y*g[1]}var b=[u[p].x-l[0],u[p].y-l[1]],w=Math.hypot(b[0],b[1]);b[0]=b[0]/w,b[1]=b[1]/w;var E=f*(i[p]+1);n[2*p]-=E*b[0],n[2*p+1]-=E*b[1]}return n},e.prototype.getOptRepGraForces=function(t,e,n){for(var r=this,o=r.nodes,i=r.kg,a=r.center,u=r.prune,s=o.length,c=9e10,f=-9e10,l=9e10,d=-9e10,h=0;h<s;h+=1)u&&n[h]<=1||(e[h].setPos(o[h].x,o[h].y),o[h].x>=f&&(f=o[h].x),o[h].x<=c&&(c=o[h].x),o[h].y>=d&&(d=o[h].y),o[h].y<=l&&(l=o[h].y));var p=Math.max(f-c,d-l),v=new Dd({xmid:(f+c)/2,ymid:(d+l)/2,length:p,massCenter:a,mass:s}),g=new Md(v);for(h=0;h<s;h+=1)u&&n[h]<=1||e[h].in(v)&&g.insert(e[h]);for(h=0;h<s;h+=1)if(!(u&&n[h]<=1)){e[h].resetForce(),g.updateForce(e[h]),t[2*h]-=e[h].fx,t[2*h+1]-=e[h].fy;var m=[o[h].x-a[0],o[h].y-a[1]],y=Math.hypot(m[0],m[1]);y=y<1e-4?1e-4:y,m[0]=m[0]/y,m[1]=m[1]/y;var b=i*(n[h]+1);t[2*h]-=b*m[0],t[2*h+1]-=b*m[1]}return t},e.prototype.updatePos=function(t,e,n,r){for(var o=this,a=o.nodes,u=o.ks,s=o.tao,c=o.prune,f=o.ksmax,l=a.length,d=[],h=[],p=0,v=0,g=0;g<l;g+=1)if(!(c&&r[g]<=1)){var m=[t[2*g]-e[2*g],t[2*g+1]-e[2*g+1]],y=Math.hypot(m[0],m[1]),b=[t[2*g]+e[2*g],t[2*g+1]+e[2*g+1]],w=Math.hypot(b[0],b[1]);d[g]=y,h[g]=w/2,p+=(r[g]+1)*d[g],v+=(r[g]+1)*h[g]}var E=n;for(n=s*v/p,0!==E&&(n=n>1.5*E?1.5*E:n),g=0;g<l;g+=1)if(!(c&&r[g]<=1||i(a[g].fx)&&i(a[g].fy))){var x=u*n/(1+n*Math.sqrt(d[g])),_=Math.hypot(t[2*g],t[2*g+1]),S=f/(_=_<1e-4?1e-4:_),A=(x=x>S?S:x)*t[2*g],I=x*t[2*g+1];a[g].x+=A,a[g].y+=I}return{nodes:a,sg:n}},e}(t),Cd=function(){return Cd=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Cd.apply(this,arguments)},Ld=function(){function t(){this.cells=[],this.columnNum=0,this.rowNum=0,this.additionColumn=[],this.additionRow=[]}return t.prototype.init=function(e,n,r){this.cells=[],this.CELL_W=r.CELL_W||t.DEFAULT_CELL_W,this.CELL_H=r.CELL_H||t.DEFAULT_CELL_H,this.columnNum=Math.ceil(e/this.CELL_W),this.rowNum=Math.ceil(n/this.CELL_H),t.MIN_DIST=Math.pow(e,2)+Math.pow(n,2);for(var o=0;o<this.columnNum;o++){for(var i=[],a=0;a<this.rowNum;a++){var u={dx:o,dy:a,x:o*this.CELL_W,y:a*this.CELL_H,occupied:!1};i.push(u)}this.cells.push(i)}},t.prototype.findGridByNodeId=function(t){for(var e,n,r=0;r<this.columnNum;r++)for(var o=0;o<this.rowNum;o++)if(this.cells[r][o].node&&(null===(n=null===(e=this.cells[r][o])||void 0===e?void 0:e.node)||void 0===n?void 0:n.id)===t)return{column:r,row:o};return null},t.prototype.sqdist=function(t,e){return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)},t.prototype.occupyNearest=function(e){for(var n,r=t.MIN_DIST,o=null,i=0;i<this.columnNum;i++)for(var a=0;a<this.rowNum;a++)!this.cells[i][a].occupied&&(n=this.sqdist(e,this.cells[i][a]))<r&&(r=n,o=this.cells[i][a]);return o&&(o.occupied=!0),o},t.prototype.insertColumn=function(t,e){if(!(e<=0)){for(var n=0;n<e;n++){this.cells[n+this.columnNum]=[];for(var r=0;r<this.rowNum;r++)this.cells[n+this.columnNum][r]={dx:n,dy:r,x:n*this.CELL_W,y:r*this.CELL_H,occupied:!1,node:null}}for(n=this.columnNum-1;n>t;n--)for(r=0;r<this.rowNum;r++)this.cells[n+e][r]=Cd(Cd({},this.cells[n][r]),{x:(n+e)*this.CELL_W,y:r*this.CELL_H}),this.cells[n][r]={x:n*this.CELL_W,y:r*this.CELL_H,occupied:!0,node:null};for(r=0;r<this.additionColumn.length;r++)this.additionColumn[r]>=t&&(this.additionColumn[r]+=e);for(n=0;n<e;n++)this.additionColumn.push(t+n+1);this.columnNum+=e}},t.prototype.insertRow=function(t,e){if(!(e<=0)){for(var n=0;n<e;n++)for(var r=0;r<this.columnNum;r++)this.cells[r][n+this.rowNum]={dx:r,dy:n,x:r*this.CELL_W,y:n*this.CELL_H,occupied:!1,node:null};for(r=0;r<this.columnNum;r++)for(n=this.rowNum-1;n>t;n--)this.cells[r][n+e]=Cd(Cd({},this.cells[r][n]),{dx:r,dy:n+e,x:r*this.CELL_W,y:(n+e)*this.CELL_H}),this.cells[r][n]={dx:r,dy:n,x:r*this.CELL_W,y:n*this.CELL_H,occupied:!1,node:null};for(n=0;n<this.additionRow.length;n++)this.additionRow[n]>=t&&(this.additionRow[n]+=e);for(r=0;r<e;r++)this.additionRow.push(t+r+1);this.rowNum+=e}},t.prototype.getNodes=function(){for(var t=[],e=0;e<this.columnNum;e++)for(var n=0;n<this.rowNum;n++)this.cells[e][n].node&&t.push(this.cells[e][n]);return t},t.MIN_DIST=50,t.DEFAULT_CELL_W=80,t.DEFAULT_CELL_H=80,t}();const Pd=Ld;var jd=1200,zd=800,Fd=1e7,Gd=10,Ud=3.141592653589793,Bd=1.5707963267948966,Vd=.375*Ud,Wd=.625*Ud,Xd=new Map,Hd=.8;function qd(t,e){var n=(Xd.get(t.id)||[]).find((function(t){return t.source===e.id||t.target===e.id})),r=t.size[0]*t.size[1],o=e.size[0]*e.size[1],i=r>o?e:t,a=r>o?t:e,u=i.x-i.size[0]/2,s=i.y-i.size[1]/2,c=i.x+i.size[0]/2,f=i.y+i.size[1]/2,l=a.x-a.size[0]/2,d=a.y-a.size[1]/2,h=a.x+a.size[0]/2,p=a.y+a.size[1]/2,v=i.x,g=i.y,m=a.x,y=a.y,b=0,w=0;if(c>=l&&h>=u&&f>=d&&p>=s)0===(w=Math.sqrt(Math.pow(m-v,2)+Math.pow(y-g,2)))&&(w=1e-7),b=1*Gd/w*100+((c<h?c:h)-(u>l?u:l))*((f<p?f:p)-(s>d?s:d)),b*=Fd;else{var E=!1,x=function(t,e,n){var r=t.x-t.size[0]/2,o=t.y-t.size[1]/2,i=t.x+t.size[0]/2,a=t.y+t.size[1]/2,u=e.x-e.size[0]/2,s=e.y-e.size[1]/2,c=e.x+e.size[0]/2,f=e.y+e.size[1]/2,l=t.x,d=t.y,h=e.x,p=e.y,v=h-l,g=Math.atan2(v,p-d),m=0,y=0,b=0,w=0;g>Bd?(y=o-f,m=u-i,b=parseFloat(y?(y/Math.cos(g)).toFixed(2):m.toFixed(2)),w=parseFloat(m?(m/Math.sin(g)).toFixed(2):y.toFixed(2))):b=w=0<g&&g<=Bd?(y=s-a)>(m=u-i)?parseFloat(y?(y/Math.cos(g)).toFixed(2):m.toFixed(2)):parseFloat(m?(m/Math.sin(g)).toFixed(2):y.toFixed(2)):g<-Bd?(y=o-f)>(m=-(c-r))?parseFloat(y?(y/Math.cos(g)).toFixed(2):m.toFixed(2)):parseFloat(m?(m/Math.sin(g)).toFixed(2):y.toFixed(2)):(y=s-a)>(m=Math.abs(v)>(i-r)/2?r-c:v)?parseFloat(y?(y/Math.cos(g)).toFixed(2):m.toFixed(2)):parseFloat(m&&0!==g?(m/Math.sin(g)).toFixed(2):y.toFixed(2));var E=parseFloat(g.toFixed(2)),x=n;return n&&(x=Vd<E&&E<Wd),{distance:Math.abs(b<w?b:w),isHoriz:x}}(i,a,E);w=x.distance,E=x.isHoriz,w<=Gd?b+=0!==w?n?Gd+1*Fd/w:Gd+Fd*Gd/w:Fd:(b+=w,n&&(b+=w*w))}return b}function Yd(t){for(var e=0,n=0;n<t.length;n++){var r=t[n];(r.x<0||r.y<0||r.x>jd||r.y>zd)&&(e+=1e12);for(var o=n+1;o<t.length;o++)e+=qd(r,t[o])}return e}function Kd(t,e,n,r){var o=new Map;n.forEach((function(t,e){o.set(t.id,t)}));var i=r.filter((function(e){return e.source===t.id||e.target===t.id}))||[],a=[];i.forEach((function(e){var n=e.source===t.id?e.target:e.source,r=o.get(n);r&&a.push(r)}));for(var u=!0,s=0;s<a.length;s++){var c=a[s],f=180*Math.atan((t.y-c.y)/(c.x-t.y)),l=180*Math.atan((e.y-c.y)/(c.x-e.y)),d=f>70&&f<110,h=l>70&&l<110;if((f<30||f>150)&&!(l<30||l>150)||f*l<0){u=!1;break}if(d&&!h||f*l<0){u=!1;break}if((c.x-t.x)*(c.x-e.x)<0){u=!1;break}if((c.y-t.y)*(c.y-e.y)<0){u=!1;break}}return u}function Zd(t,e){for(var n=!1,r=[10,-10,0,0],o=[0,0,10,-10],i=0;i<t.length;++i)for(var a=t[i],u=$d(a,t),s=0;s<r.length;s++)if(Kd(a,{x:a.x+r[s],y:a.y+o[s]},t,e)){a.x+=r[s],a.y+=o[s];var c=$d(a,t),f=Math.random();c<u||f<Hd&&f>.1?(u=c,n=!0):(a.x-=r[s],a.y-=o[s])}return Hd>.1&&(Hd*=.5),n?Yd(t):0}function $d(t,e){var n=0;(t.x<0||t.y<0||t.x+t.size[0]+20>jd||t.y+t.size[1]+20>zd)&&(n+=1e12);for(var r=0;r<e.length;++r)t.id!==e[r].id&&(n+=qd(t,e[r]));return n}var Qd=function(){return Qd=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Qd.apply(this,arguments)};function Jd(t,e){var n=t.nodes,r=t.edges,o=e.width,i=e.height;if(!(null==n?void 0:n.length))return Promise.resolve();var a=[];n.forEach((function(t){if(r.filter((function(e){return e.source===t.id||e.target===t.id})).length>1){var e=Qd({},t);delete e.size,a.push(e)}}));var u=[];r.forEach((function(t){var e=a.find((function(e){return e.id===t.source})),n=a.find((function(e){return e.id===t.target}));e&&n&&u.push(t)}));var s=new dr({type:"dagre",ranksep:e.nodeMinGap,nodesep:e.nodeMinGap}).layout({nodes:a,edges:u}).nodes;n.forEach((function(t){var e=(s||[]).find((function(e){return e.id===t.id}));t.x=(null==e?void 0:e.x)||o/2,t.y=(null==e?void 0:e.y)||i/2}));var c=JSON.parse(JSON.stringify(n)),f=JSON.parse(JSON.stringify(r)),l=Nt().nodes(c).force("link",Ct(f).id((function(t){return t.id})).distance((function(t){return u.find((function(e){return e.source===t.source&&e.target===t.target}))?30:20}))).force("charge",Dt()).force("center",Mt(o/2,i/2)).force("x",zt(o/2)).force("y",Ft(i/2)).alpha(.3).alphaDecay(.08).alphaMin(.001),d=new Promise((function(t){l.on("end",(function(){n.forEach((function(t){var e=c.find((function(e){return e.id===t.id}));e&&(t.x=e.x,t.y=e.y)}));var a=Math.min.apply(Math,n.map((function(t){return t.x}))),u=Math.max.apply(Math,n.map((function(t){return t.x}))),s=Math.min.apply(Math,n.map((function(t){return t.y}))),f=Math.max.apply(Math,n.map((function(t){return t.y}))),l=o/(u-a),d=i/(f-s);n.forEach((function(t){void 0!==t.x&&l<1&&(t.x=(t.x-a)*l),void 0!==t.y&&d<1&&(t.y=(t.y-s)*d)})),n.forEach((function(t){t.sizeTemp=t.size,t.size=[10,10]})),function(t,e){if(0===t.length)return{nodes:t,edges:e};t.forEach((function(t){var n=e.filter((function(e){return e.source===t.id||e.target===t.id}));Xd.set(t,n)})),t.sort((function(t,e){var n,r;return(null===(n=Xd.get(t.id))||void 0===n?void 0:n.length)-(null===(r=Xd.get(e.id))||void 0===r?void 0:r.length)}));for(var n=Yd(t),r=20,o=1,i=0,a=0;r>0&&!(++a>=50);){var u=Zd(t,e);0!==u&&(i=u),o=i-n,n=i,0===o?--r:r=20}t.forEach((function(t){t.x=t.x-t.size[0]/2,t.y=t.y-t.size[1]/2}))}(n,r),n.forEach((function(t){t.size=t.sizeTemp||[],delete t.sizeTemp})),function(t,e){if(!t.nodes||0===t.nodes.length)return t;var n=e.width,r=e.height,o=e.nodeMinGap,i=1e4,a=1e4;t.nodes.forEach((function(t){var e=t.size[0]||50,n=t.size[1]||50;i=Math.min(e,i),a=Math.min(n,a)}));var u=new Pd;u.init(n,r,{CELL_H:a,CELL_W:i}),t.nodes.forEach((function(t){var e=u.occupyNearest(t);e&&(e.node={id:t.id,size:t.size},t.x=e.x,t.y=e.y,t.dx=e.dx,t.dy=e.dy)}));for(var s=0;s<t.nodes.length;s++){var c=t.nodes[s],f=u.findGridByNodeId(c.id);if(!f)throw new Error("can not find node cell");var l=f.column,d=f.row;if(c.size[0]+o>i){for(var h=v=Math.ceil((c.size[0]+o)/i)-1,p=0;p<v&&u.additionColumn.indexOf(l+p+1)>-1&&!u.cells[l+p+1][d].node;p++)h--;u.insertColumn(l,h)}if(c.size[1]+o>a){var v;for(h=v=Math.ceil((c.size[1]+o)/a)-1,p=0;p<v&&u.additionRow.indexOf(d+p+1)>-1&&!u.cells[l][d+p+1].node;p++)h--;u.insertRow(d,h)}}for(s=0;s<u.columnNum;s++){var g=function(e){var n=u.cells[s][e];if(n.node){var r=t.nodes.find((function(t){var e;return t.id===(null===(e=null==n?void 0:n.node)||void 0===e?void 0:e.id)}));r&&(r.x=n.x+r.size[0]/2,r.y=n.y+r.size[1]/2)}};for(p=0;p<u.rowNum;p++)g(p)}}({nodes:n,edges:r},e),t()}))}));return d}var th=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),eh=function(t){function e(e){var n=t.call(this)||this;return n.width=300,n.height=300,n.nodeMinGap=50,n.onLayoutEnd=function(){},e&&n.updateCfg(e),n}return th(e,t),e.prototype.getDefaultCfg=function(){return{width:300,height:300,nodeMinGap:50}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.edges;return null==e||e.forEach((function(t){t.size||(t.size=[50,50])})),Jd({nodes:e,edges:n},{width:this.width,height:this.height,nodeMinGap:this.nodeMinGap}).then((function(){t.onLayoutEnd&&t.onLayoutEnd()}))},e.prototype.getType=function(){return"er"},e}(t),nh=function(){function t(t){var e=O(t.type);this.layoutInstance=new e(t)}return t.prototype.layout=function(t){return this.layoutInstance.layout(t)},t.prototype.updateCfg=function(t){this.layoutInstance.updateCfg(t)},t.prototype.init=function(t){this.correctLayers(t.nodes),this.layoutInstance.init(t)},t.prototype.correctLayers=function(t){if(null==t?void 0:t.length){var n=1/0,r=[];if(t.forEach((function(t){e(t.layer)&&(t.layer=parseInt(t.layer,10)),void 0===t.layer||isNaN(t.layer)||(r.push(t),t.layer<n&&(n=t.layer))})),n<=0){var o=Math.abs(n)+1;r.forEach((function(t){return t.layer+=o}))}}},t.prototype.execute=function(){this.layoutInstance.execute()},t.prototype.getDefaultCfg=function(){return this.layoutInstance.getDefaultCfg()},t.prototype.destroy=function(){return this.layoutInstance.destroy()},t}(),rh={force:Vt,fruchterman:Vf,forceAtlas2:Rd,gForce:L,force2:K,dagre:dr,dagreCompound:sf,circular:qt,radial:jf,concentric:Ff,grid:D,mds:Uf,comboForce:Sd,comboCombined:Td,random:k,"gForce-gpu":xd,"fruchterman-gpu":yd,er:eh}})(),r})()));
2
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.layout=e():t.layout=e()}(self,(()=>(()=>{var t={9216:(t,e,n)=>{"use strict";n(9504),n(3982),n(721),n(5778),n(3898),n(7536),n(5834),n(6945),n(547),n(5967),n(3515),n(3042),n(4962),n(8246)},9504:(t,e,n)=>{n(2825),n(6051),n(2640),n(9518),n(8201),n(470),n(5723),n(7525),n(9788),n(1498),n(7577),n(6129),n(2802),n(7940),n(5261),n(9340),n(1584),n(7298),n(1765),n(5747),n(7451),n(2784),n(2809),n(7454),n(3053),n(8032),n(7551),n(2929),n(215),n(6183),n(8190),n(476),n(948),n(942),n(2870),n(2212),n(4230),n(9754),n(2811),n(3998),n(1769),n(8789),n(2848),n(1762),n(1323),n(6063),n(3282),n(6816),n(1854),n(3303),n(4421),n(2203),n(1028),n(6818),n(5557),n(7938),n(8316),n(7937),n(637),n(8219),n(9029),n(3157),n(9791),n(2296),n(4555),n(6505),n(4722),n(9713),n(7392),n(4687),n(3684),n(3339),n(4148),n(7754),n(4094),n(8781),n(5013),n(3735),n(8723),n(2247),n(9689),n(9003),n(9026),n(4088),n(535),n(5788),n(7878),n(5119),n(3135),n(5015),n(8059),n(646),n(5377),n(9879),n(5305),n(6341),n(5915),n(4488),n(9281),n(163),n(6668),n(7139),n(6408),n(8686),n(5480),n(9121),n(914),n(7742),n(7843),n(6441),n(429),n(2214),n(498),n(6349),n(3742),n(9604),n(2592),n(9290),n(9363),n(3871),n(8632),n(1838),n(3421),n(6144),n(8275),n(2552),n(3077),n(1031),n(8916),n(8978),n(8531),n(7323),n(3704),n(3153),n(8812),n(2636),n(1602),n(377),t.exports=n(2845)},721:(t,e,n)=>{n(7744),t.exports=n(2845).Array.flatMap},3982:(t,e,n)=>{n(5448),t.exports=n(2845).Array.includes},3515:(t,e,n)=>{n(8938),t.exports=n(2845).Object.entries},547:(t,e,n)=>{n(7819),t.exports=n(2845).Object.getOwnPropertyDescriptors},5967:(t,e,n)=>{n(6572),t.exports=n(2845).Object.values},3042:(t,e,n)=>{"use strict";n(7843),n(8228),t.exports=n(2845).Promise.finally},3898:(t,e,n)=>{n(3336),t.exports=n(2845).String.padEnd},5778:(t,e,n)=>{n(3718),t.exports=n(2845).String.padStart},5834:(t,e,n)=>{n(6642),t.exports=n(2845).String.trimRight},7536:(t,e,n)=>{n(7831),t.exports=n(2845).String.trimLeft},6945:(t,e,n)=>{n(9956),t.exports=n(7686).f("asyncIterator")},2680:(t,e,n)=>{n(8358),t.exports=n(3142).global},3749:t=>{t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},8891:(t,e,n)=>{var r=n(2799);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},3142:t=>{var e=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=e)},5526:(t,e,n)=>{var r=n(3749);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},7498:(t,e,n)=>{t.exports=!n(9880)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},2004:(t,e,n)=>{var r=n(2799),o=n(5505).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},2069:(t,e,n)=>{var r=n(5505),o=n(3142),i=n(5526),a=n(5954),u=n(9761),s="prototype",c=function(t,e,n){var f,l,d,h=t&c.F,p=t&c.G,v=t&c.S,g=t&c.P,m=t&c.B,y=t&c.W,b=p?o:o[e]||(o[e]={}),w=b[s],E=p?r:v?r[e]:(r[e]||{})[s];for(f in p&&(n=e),n)(l=!h&&E&&void 0!==E[f])&&u(b,f)||(d=l?E[f]:n[f],b[f]=p&&"function"!=typeof E[f]?n[f]:m&&l?i(d,r):y&&E[f]==d?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e[s]=t[s],e}(d):g&&"function"==typeof d?i(Function.call,d):d,g&&((b.virtual||(b.virtual={}))[f]=d,t&c.R&&w&&!w[f]&&a(w,f,d)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},9880:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},5505:t=>{var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},9761:t=>{var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},5954:(t,e,n)=>{var r=n(5584),o=n(5734);t.exports=n(7498)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},4053:(t,e,n)=>{t.exports=!n(7498)&&!n(9880)((function(){return 7!=Object.defineProperty(n(2004)("div"),"a",{get:function(){return 7}}).a}))},2799:t=>{t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},5584:(t,e,n)=>{var r=n(8891),o=n(4053),i=n(923),a=Object.defineProperty;e.f=n(7498)?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},5734:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},923:(t,e,n)=>{var r=n(2799);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},8358:(t,e,n)=>{var r=n(2069);r(r.G,{global:n(5505)})},1464:t=>{t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},8347:(t,e,n)=>{var r=n(1669);t.exports=function(t,e){if("number"!=typeof t&&"Number"!=r(t))throw TypeError(e);return+t}},4691:(t,e,n)=>{var r=n(341)("unscopables"),o=Array.prototype;null==o[r]&&n(913)(o,r,{}),t.exports=function(t){o[r][t]=!0}},178:(t,e,n)=>{"use strict";var r=n(8016)(!0);t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},6903:t=>{t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},486:(t,e,n)=>{var r=n(1255);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},1064:(t,e,n)=>{"use strict";var r=n(7583),o=n(9260),i=n(8087);t.exports=[].copyWithin||function(t,e){var n=r(this),a=i(n.length),u=o(t,a),s=o(e,a),c=arguments.length>2?arguments[2]:void 0,f=Math.min((void 0===c?a:o(c,a))-s,a-u),l=1;for(s<u&&u<s+f&&(l=-1,s+=f-1,u+=f-1);f-- >0;)s in n?n[u]=n[s]:delete n[u],u+=l,s+=l;return n}},8676:(t,e,n)=>{"use strict";var r=n(7583),o=n(9260),i=n(8087);t.exports=function(t){for(var e=r(this),n=i(e.length),a=arguments.length,u=o(a>1?arguments[1]:void 0,n),s=a>2?arguments[2]:void 0,c=void 0===s?n:o(s,n);c>u;)e[u++]=t;return e}},4538:(t,e,n)=>{var r=n(8182),o=n(8087),i=n(9260);t.exports=function(t){return function(e,n,a){var u,s=r(e),c=o(s.length),f=i(a,c);if(t&&n!=n){for(;c>f;)if((u=s[f++])!=u)return!0}else for(;c>f;f++)if((t||f in s)&&s[f]===n)return t||f||0;return!t&&-1}}},7622:(t,e,n)=>{var r=n(994),o=n(8579),i=n(7583),a=n(8087),u=n(6699);t.exports=function(t,e){var n=1==t,s=2==t,c=3==t,f=4==t,l=6==t,d=5==t||l,h=e||u;return function(e,u,p){for(var v,g,m=i(e),y=o(m),b=r(u,p,3),w=a(y.length),E=0,x=n?h(e,w):s?h(e,0):void 0;w>E;E++)if((d||E in y)&&(g=b(v=y[E],E,m),t))if(n)x[E]=g;else if(g)switch(t){case 3:return!0;case 5:return v;case 6:return E;case 2:x.push(v)}else if(f)return!1;return l?-1:c||f?f:x}}},5336:(t,e,n)=>{var r=n(1464),o=n(7583),i=n(8579),a=n(8087);t.exports=function(t,e,n,u,s){r(e);var c=o(t),f=i(c),l=a(c.length),d=s?l-1:0,h=s?-1:1;if(n<2)for(;;){if(d in f){u=f[d],d+=h;break}if(d+=h,s?d<0:l<=d)throw TypeError("Reduce of empty array with no initial value")}for(;s?d>=0:l>d;d+=h)d in f&&(u=e(u,f[d],d,c));return u}},7600:(t,e,n)=>{var r=n(1255),o=n(7183),i=n(341)("species");t.exports=function(t){var e;return o(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!o(e.prototype)||(e=void 0),r(e)&&null===(e=e[i])&&(e=void 0)),void 0===e?Array:e}},6699:(t,e,n)=>{var r=n(7600);t.exports=function(t,e){return new(r(t))(e)}},8366:(t,e,n)=>{"use strict";var r=n(1464),o=n(1255),i=n(8262),a=[].slice,u={};t.exports=Function.bind||function(t){var e=r(this),n=a.call(arguments,1),s=function(){var r=n.concat(a.call(arguments));return this instanceof s?function(t,e,n){if(!(e in u)){for(var r=[],o=0;o<e;o++)r[o]="a["+o+"]";u[e]=Function("F,a","return new F("+r.join(",")+")")}return u[e](t,n)}(e,r.length,r):i(e,r,t)};return o(e.prototype)&&(s.prototype=e.prototype),s}},4939:(t,e,n)=>{var r=n(1669),o=n(341)("toStringTag"),i="Arguments"==r(function(){return arguments}());t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),o))?n:i?r(e):"Object"==(a=r(e))&&"function"==typeof e.callee?"Arguments":a}},1669:t=>{var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},3050:(t,e,n)=>{"use strict";var r=n(3886).f,o=n(9055),i=n(8565),a=n(994),u=n(6903),s=n(9822),c=n(966),f=n(8782),l=n(4412),d=n(1216),h=n(4278).fastKey,p=n(4664),v=d?"_s":"size",g=function(t,e){var n,r=h(e);if("F"!==r)return t._i[r];for(n=t._f;n;n=n.n)if(n.k==e)return n};t.exports={getConstructor:function(t,e,n,c){var f=t((function(t,r){u(t,f,e,"_i"),t._t=e,t._i=o(null),t._f=void 0,t._l=void 0,t[v]=0,null!=r&&s(r,n,t[c],t)}));return i(f.prototype,{clear:function(){for(var t=p(this,e),n=t._i,r=t._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];t._f=t._l=void 0,t[v]=0},delete:function(t){var n=p(this,e),r=g(n,t);if(r){var o=r.n,i=r.p;delete n._i[r.i],r.r=!0,i&&(i.n=o),o&&(o.p=i),n._f==r&&(n._f=o),n._l==r&&(n._l=i),n[v]--}return!!r},forEach:function(t){p(this,e);for(var n,r=a(t,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(t){return!!g(p(this,e),t)}}),d&&r(f.prototype,"size",{get:function(){return p(this,e)[v]}}),f},def:function(t,e,n){var r,o,i=g(t,e);return i?i.v=n:(t._l=i={i:o=h(e,!0),k:e,v:n,p:r=t._l,n:void 0,r:!1},t._f||(t._f=i),r&&(r.n=i),t[v]++,"F"!==o&&(t._i[o]=i)),t},getEntry:g,setStrong:function(t,e,n){c(t,e,(function(t,n){this._t=p(t,e),this._k=n,this._l=void 0}),(function(){for(var t=this,e=t._k,n=t._l;n&&n.r;)n=n.p;return t._t&&(t._l=n=n?n.n:t._t._f)?f(0,"keys"==e?n.k:"values"==e?n.v:[n.k,n.v]):(t._t=void 0,f(1))}),n?"entries":"values",!n,!0),l(e)}}},1990:(t,e,n)=>{"use strict";var r=n(8565),o=n(4278).getWeak,i=n(486),a=n(1255),u=n(6903),s=n(9822),c=n(7622),f=n(7384),l=n(4664),d=c(5),h=c(6),p=0,v=function(t){return t._l||(t._l=new g)},g=function(){this.a=[]},m=function(t,e){return d(t.a,(function(t){return t[0]===e}))};g.prototype={get:function(t){var e=m(this,t);if(e)return e[1]},has:function(t){return!!m(this,t)},set:function(t,e){var n=m(this,t);n?n[1]=e:this.a.push([t,e])},delete:function(t){var e=h(this.a,(function(e){return e[0]===t}));return~e&&this.a.splice(e,1),!!~e}},t.exports={getConstructor:function(t,e,n,i){var c=t((function(t,r){u(t,c,e,"_i"),t._t=e,t._i=p++,t._l=void 0,null!=r&&s(r,n,t[i],t)}));return r(c.prototype,{delete:function(t){if(!a(t))return!1;var n=o(t);return!0===n?v(l(this,e)).delete(t):n&&f(n,this._i)&&delete n[this._i]},has:function(t){if(!a(t))return!1;var n=o(t);return!0===n?v(l(this,e)).has(t):n&&f(n,this._i)}}),c},def:function(t,e,n){var r=o(i(e),!0);return!0===r?v(t).set(e,n):r[t._i]=n,t},ufstore:v}},859:(t,e,n)=>{"use strict";var r=n(7571),o=n(7044),i=n(6476),a=n(8565),u=n(4278),s=n(9822),c=n(6903),f=n(1255),l=n(5338),d=n(2803),h=n(5837),p=n(116);t.exports=function(t,e,n,v,g,m){var y=r[t],b=y,w=g?"set":"add",E=b&&b.prototype,x={},_=function(t){var e=E[t];i(E,t,"delete"==t||"has"==t?function(t){return!(m&&!f(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return m&&!f(t)?void 0:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,n){return e.call(this,0===t?0:t,n),this})};if("function"==typeof b&&(m||E.forEach&&!l((function(){(new b).entries().next()})))){var S=new b,A=S[w](m?{}:-0,1)!=S,I=l((function(){S.has(1)})),T=d((function(t){new b(t)})),O=!m&&l((function(){for(var t=new b,e=5;e--;)t[w](e,e);return!t.has(-0)}));T||((b=e((function(e,n){c(e,b,t);var r=p(new y,e,b);return null!=n&&s(n,g,r[w],r),r}))).prototype=E,E.constructor=b),(I||O)&&(_("delete"),_("has"),g&&_("get")),(O||A)&&_(w),m&&E.clear&&delete E.clear}else b=v.getConstructor(e,t,g,w),a(b.prototype,n),u.NEED=!0;return h(b,t),x[t]=b,o(o.G+o.W+o.F*(b!=y),x),m||v.setStrong(b,t,g),b}},2845:t=>{var e=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=e)},1395:(t,e,n)=>{"use strict";var r=n(3886),o=n(8328);t.exports=function(t,e,n){e in t?r.f(t,e,o(0,n)):t[e]=n}},994:(t,e,n)=>{var r=n(1464);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},4506:(t,e,n)=>{"use strict";var r=n(5338),o=Date.prototype.getTime,i=Date.prototype.toISOString,a=function(t){return t>9?t:"0"+t};t.exports=r((function(){return"0385-07-25T07:06:39.999Z"!=i.call(new Date(-50000000000001))}))||!r((function(){i.call(new Date(NaN))}))?function(){if(!isFinite(o.call(this)))throw RangeError("Invalid time value");var t=this,e=t.getUTCFullYear(),n=t.getUTCMilliseconds(),r=e<0?"-":e>9999?"+":"";return r+("00000"+Math.abs(e)).slice(r?-6:-4)+"-"+a(t.getUTCMonth()+1)+"-"+a(t.getUTCDate())+"T"+a(t.getUTCHours())+":"+a(t.getUTCMinutes())+":"+a(t.getUTCSeconds())+"."+(n>99?n:"0"+a(n))+"Z"}:i},9514:(t,e,n)=>{"use strict";var r=n(486),o=n(4467),i="number";t.exports=function(t){if("string"!==t&&t!==i&&"default"!==t)throw TypeError("Incorrect hint");return o(r(this),t!=i)}},5091:t=>{t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},1216:(t,e,n)=>{t.exports=!n(5338)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},3438:(t,e,n)=>{var r=n(1255),o=n(7571).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},9824:t=>{t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},6397:(t,e,n)=>{var r=n(9804),o=n(3844),i=n(4179);t.exports=function(t){var e=r(t),n=o.f;if(n)for(var a,u=n(t),s=i.f,c=0;u.length>c;)s.call(t,a=u[c++])&&e.push(a);return e}},7044:(t,e,n)=>{var r=n(7571),o=n(2845),i=n(913),a=n(6476),u=n(994),s="prototype",c=function(t,e,n){var f,l,d,h,p=t&c.F,v=t&c.G,g=t&c.S,m=t&c.P,y=t&c.B,b=v?r:g?r[e]||(r[e]={}):(r[e]||{})[s],w=v?o:o[e]||(o[e]={}),E=w[s]||(w[s]={});for(f in v&&(n=e),n)d=((l=!p&&b&&void 0!==b[f])?b:n)[f],h=y&&l?u(d,r):m&&"function"==typeof d?u(Function.call,d):d,b&&a(b,f,d,t&c.U),w[f]!=d&&i(w,f,h),m&&E[f]!=d&&(E[f]=d)};r.core=o,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},2910:(t,e,n)=>{var r=n(341)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,!"/./"[t](e)}catch(t){}}return!0}},5338:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},6719:(t,e,n)=>{"use strict";n(7139);var r=n(6476),o=n(913),i=n(5338),a=n(5091),u=n(341),s=n(9020),c=u("species"),f=!i((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),l=function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();t.exports=function(t,e,n){var d=u(t),h=!i((function(){var e={};return e[d]=function(){return 7},7!=""[t](e)})),p=h?!i((function(){var e=!1,n=/a/;return n.exec=function(){return e=!0,null},"split"===t&&(n.constructor={},n.constructor[c]=function(){return n}),n[d](""),!e})):void 0;if(!h||!p||"replace"===t&&!f||"split"===t&&!l){var v=/./[d],g=n(a,d,""[t],(function(t,e,n,r,o){return e.exec===s?h&&!o?{done:!0,value:v.call(e,n,r)}:{done:!0,value:t.call(n,e,r)}:{done:!1}})),m=g[0],y=g[1];r(String.prototype,t,m),o(RegExp.prototype,d,2==e?function(t,e){return y.call(t,this,e)}:function(t){return y.call(t,this)})}}},3649:(t,e,n)=>{"use strict";var r=n(486);t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},6806:(t,e,n)=>{"use strict";var r=n(7183),o=n(1255),i=n(8087),a=n(994),u=n(341)("isConcatSpreadable");t.exports=function t(e,n,s,c,f,l,d,h){for(var p,v,g=f,m=0,y=!!d&&a(d,h,3);m<c;){if(m in s){if(p=y?y(s[m],m,n):s[m],v=!1,o(p)&&(v=void 0!==(v=p[u])?!!v:r(p)),v&&l>0)g=t(e,n,p,i(p.length),g,l-1)-1;else{if(g>=9007199254740991)throw TypeError();e[g]=p}g++}m++}return g}},9822:(t,e,n)=>{var r=n(994),o=n(4902),i=n(9981),a=n(486),u=n(8087),s=n(9685),c={},f={},l=t.exports=function(t,e,n,l,d){var h,p,v,g,m=d?function(){return t}:s(t),y=r(n,l,e?2:1),b=0;if("function"!=typeof m)throw TypeError(t+" is not iterable!");if(i(m)){for(h=u(t.length);h>b;b++)if((g=e?y(a(p=t[b])[0],p[1]):y(t[b]))===c||g===f)return g}else for(v=m.call(t);!(p=v.next()).done;)if((g=o(v,y,p.value,e))===c||g===f)return g};l.BREAK=c,l.RETURN=f},8454:(t,e,n)=>{t.exports=n(5570)("native-function-to-string",Function.toString)},7571:t=>{var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},7384:t=>{var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},913:(t,e,n)=>{var r=n(3886),o=n(8328);t.exports=n(1216)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},7680:(t,e,n)=>{var r=n(7571).document;t.exports=r&&r.documentElement},6252:(t,e,n)=>{t.exports=!n(1216)&&!n(5338)((function(){return 7!=Object.defineProperty(n(3438)("div"),"a",{get:function(){return 7}}).a}))},116:(t,e,n)=>{var r=n(1255),o=n(473).set;t.exports=function(t,e,n){var i,a=e.constructor;return a!==n&&"function"==typeof a&&(i=a.prototype)!==n.prototype&&r(i)&&o&&o(t,i),t}},8262:t=>{t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},8579:(t,e,n)=>{var r=n(1669);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},9981:(t,e,n)=>{var r=n(9740),o=n(341)("iterator"),i=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||i[o]===t)}},7183:(t,e,n)=>{var r=n(1669);t.exports=Array.isArray||function(t){return"Array"==r(t)}},1272:(t,e,n)=>{var r=n(1255),o=Math.floor;t.exports=function(t){return!r(t)&&isFinite(t)&&o(t)===t}},1255:t=>{t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},8990:(t,e,n)=>{var r=n(1255),o=n(1669),i=n(341)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[i])?!!e:"RegExp"==o(t))}},4902:(t,e,n)=>{var r=n(486);t.exports=function(t,e,n,o){try{return o?e(r(n)[0],n[1]):e(n)}catch(e){var i=t.return;throw void 0!==i&&r(i.call(t)),e}}},4529:(t,e,n)=>{"use strict";var r=n(9055),o=n(8328),i=n(5837),a={};n(913)(a,n(341)("iterator"),(function(){return this})),t.exports=function(t,e,n){t.prototype=r(a,{next:o(1,n)}),i(t,e+" Iterator")}},966:(t,e,n)=>{"use strict";var r=n(2725),o=n(7044),i=n(6476),a=n(913),u=n(9740),s=n(4529),c=n(5837),f=n(9881),l=n(341)("iterator"),d=!([].keys&&"next"in[].keys()),h="keys",p="values",v=function(){return this};t.exports=function(t,e,n,g,m,y,b){s(n,e,g);var w,E,x,_=function(t){if(!d&&t in T)return T[t];switch(t){case h:case p:return function(){return new n(this,t)}}return function(){return new n(this,t)}},S=e+" Iterator",A=m==p,I=!1,T=t.prototype,O=T[l]||T["@@iterator"]||m&&T[m],N=O||_(m),D=m?A?_("entries"):N:void 0,M="Array"==e&&T.entries||O;if(M&&(x=f(M.call(new t)))!==Object.prototype&&x.next&&(c(x,S,!0),r||"function"==typeof x[l]||a(x,l,v)),A&&O&&O.name!==p&&(I=!0,N=function(){return O.call(this)}),r&&!b||!d&&!I&&T[l]||a(T,l,N),u[e]=N,u[S]=v,m)if(w={values:A?N:_(p),keys:y?N:_(h),entries:D},b)for(E in w)E in T||i(T,E,w[E]);else o(o.P+o.F*(d||I),e,w);return w}},2803:(t,e,n)=>{var r=n(341)("iterator"),o=!1;try{var i=[7][r]();i.return=function(){o=!0},Array.from(i,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!o)return!1;var n=!1;try{var i=[7],a=i[r]();a.next=function(){return{done:n=!0}},i[r]=function(){return a},t(i)}catch(t){}return n}},8782:t=>{t.exports=function(t,e){return{value:e,done:!!t}}},9740:t=>{t.exports={}},2725:t=>{t.exports=!1},959:t=>{var e=Math.expm1;t.exports=!e||e(10)>22025.465794806718||e(10)<22025.465794806718||-2e-17!=e(-2e-17)?function(t){return 0==(t=+t)?t:t>-1e-6&&t<1e-6?t+t*t/2:Math.exp(t)-1}:e},7682:(t,e,n)=>{var r=n(2987),o=Math.pow,i=o(2,-52),a=o(2,-23),u=o(2,127)*(2-a),s=o(2,-126);t.exports=Math.fround||function(t){var e,n,o=Math.abs(t),c=r(t);return o<s?c*(o/s/a+1/i-1/i)*s*a:(n=(e=(1+a/i)*o)-(e-o))>u||n!=n?c*(1/0):c*n}},1618:t=>{t.exports=Math.log1p||function(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},2987:t=>{t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},4278:(t,e,n)=>{var r=n(4316)("meta"),o=n(1255),i=n(7384),a=n(3886).f,u=0,s=Object.isExtensible||function(){return!0},c=!n(5338)((function(){return s(Object.preventExtensions({}))})),f=function(t){a(t,r,{value:{i:"O"+ ++u,w:{}}})},l=t.exports={KEY:r,NEED:!1,fastKey:function(t,e){if(!o(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!i(t,r)){if(!s(t))return"F";if(!e)return"E";f(t)}return t[r].i},getWeak:function(t,e){if(!i(t,r)){if(!s(t))return!0;if(!e)return!1;f(t)}return t[r].w},onFreeze:function(t){return c&&l.NEED&&s(t)&&!i(t,r)&&f(t),t}}},7485:(t,e,n)=>{var r=n(7571),o=n(7225).set,i=r.MutationObserver||r.WebKitMutationObserver,a=r.process,u=r.Promise,s="process"==n(1669)(a);t.exports=function(){var t,e,n,c=function(){var r,o;for(s&&(r=a.domain)&&r.exit();t;){o=t.fn,t=t.next;try{o()}catch(r){throw t?n():e=void 0,r}}e=void 0,r&&r.enter()};if(s)n=function(){a.nextTick(c)};else if(!i||r.navigator&&r.navigator.standalone)if(u&&u.resolve){var f=u.resolve(void 0);n=function(){f.then(c)}}else n=function(){o.call(r,c)};else{var l=!0,d=document.createTextNode("");new i(c).observe(d,{characterData:!0}),n=function(){d.data=l=!l}}return function(r){var o={fn:r,next:void 0};e&&(e.next=o),t||(t=o,n()),e=o}}},449:(t,e,n)=>{"use strict";var r=n(1464);function o(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)}t.exports.f=function(t){return new o(t)}},4643:(t,e,n)=>{"use strict";var r=n(1216),o=n(9804),i=n(3844),a=n(4179),u=n(7583),s=n(8579),c=Object.assign;t.exports=!c||n(5338)((function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!=c({},t)[n]||Object.keys(c({},e)).join("")!=r}))?function(t,e){for(var n=u(t),c=arguments.length,f=1,l=i.f,d=a.f;c>f;)for(var h,p=s(arguments[f++]),v=l?o(p).concat(l(p)):o(p),g=v.length,m=0;g>m;)h=v[m++],r&&!d.call(p,h)||(n[h]=p[h]);return n}:c},9055:(t,e,n)=>{var r=n(486),o=n(6283),i=n(9824),a=n(3574)("IE_PROTO"),u=function(){},s="prototype",c=function(){var t,e=n(3438)("iframe"),r=i.length;for(e.style.display="none",n(7680).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),c=t.F;r--;)delete c[s][i[r]];return c()};t.exports=Object.create||function(t,e){var n;return null!==t?(u[s]=r(t),n=new u,u[s]=null,n[a]=t):n=c(),void 0===e?n:o(n,e)}},3886:(t,e,n)=>{var r=n(486),o=n(6252),i=n(4467),a=Object.defineProperty;e.f=n(1216)?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},6283:(t,e,n)=>{var r=n(3886),o=n(486),i=n(9804);t.exports=n(1216)?Object.defineProperties:function(t,e){o(t);for(var n,a=i(e),u=a.length,s=0;u>s;)r.f(t,n=a[s++],e[n]);return t}},5385:(t,e,n)=>{var r=n(4179),o=n(8328),i=n(8182),a=n(4467),u=n(7384),s=n(6252),c=Object.getOwnPropertyDescriptor;e.f=n(1216)?c:function(t,e){if(t=i(t),e=a(e,!0),s)try{return c(t,e)}catch(t){}if(u(t,e))return o(!r.f.call(t,e),t[e])}},3473:(t,e,n)=>{var r=n(8182),o=n(6907).f,i={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"[object Window]"==i.call(t)?function(t){try{return o(t)}catch(t){return a.slice()}}(t):o(r(t))}},6907:(t,e,n)=>{var r=n(946),o=n(9824).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},3844:(t,e)=>{e.f=Object.getOwnPropertySymbols},9881:(t,e,n)=>{var r=n(7384),o=n(7583),i=n(3574)("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),r(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},946:(t,e,n)=>{var r=n(7384),o=n(8182),i=n(4538)(!1),a=n(3574)("IE_PROTO");t.exports=function(t,e){var n,u=o(t),s=0,c=[];for(n in u)n!=a&&r(u,n)&&c.push(n);for(;e.length>s;)r(u,n=e[s++])&&(~i(c,n)||c.push(n));return c}},9804:(t,e,n)=>{var r=n(946),o=n(9824);t.exports=Object.keys||function(t){return r(t,o)}},4179:(t,e)=>{e.f={}.propertyIsEnumerable},381:(t,e,n)=>{var r=n(7044),o=n(2845),i=n(5338);t.exports=function(t,e){var n=(o.Object||{})[t]||Object[t],a={};a[t]=e(n),r(r.S+r.F*i((function(){n(1)})),"Object",a)}},6460:(t,e,n)=>{var r=n(1216),o=n(9804),i=n(8182),a=n(4179).f;t.exports=function(t){return function(e){for(var n,u=i(e),s=o(u),c=s.length,f=0,l=[];c>f;)n=s[f++],r&&!a.call(u,n)||l.push(t?[n,u[n]]:u[n]);return l}}},8125:(t,e,n)=>{var r=n(6907),o=n(3844),i=n(486),a=n(7571).Reflect;t.exports=a&&a.ownKeys||function(t){var e=r.f(i(t)),n=o.f;return n?e.concat(n(t)):e}},1885:(t,e,n)=>{var r=n(7571).parseFloat,o=n(4961).trim;t.exports=1/r(n(1644)+"-0")!=-1/0?function(t){var e=o(String(t),3),n=r(e);return 0===n&&"-"==e.charAt(0)?-0:n}:r},343:(t,e,n)=>{var r=n(7571).parseInt,o=n(4961).trim,i=n(1644),a=/^[-+]?0[xX]/;t.exports=8!==r(i+"08")||22!==r(i+"0x16")?function(t,e){var n=o(String(t),3);return r(n,e>>>0||(a.test(n)?16:10))}:r},9696:t=>{t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},909:(t,e,n)=>{var r=n(486),o=n(1255),i=n(449);t.exports=function(t,e){if(r(t),o(e)&&e.constructor===t)return e;var n=i.f(t);return(0,n.resolve)(e),n.promise}},8328:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},8565:(t,e,n)=>{var r=n(6476);t.exports=function(t,e,n){for(var o in e)r(t,o,e[o],n);return t}},6476:(t,e,n)=>{var r=n(7571),o=n(913),i=n(7384),a=n(4316)("src"),u=n(8454),s="toString",c=(""+u).split(s);n(2845).inspectSource=function(t){return u.call(t)},(t.exports=function(t,e,n,u){var s="function"==typeof n;s&&(i(n,"name")||o(n,"name",e)),t[e]!==n&&(s&&(i(n,a)||o(n,a,t[e]?""+t[e]:c.join(String(e)))),t===r?t[e]=n:u?t[e]?t[e]=n:o(t,e,n):(delete t[e],o(t,e,n)))})(Function.prototype,s,(function(){return"function"==typeof this&&this[a]||u.call(this)}))},2968:(t,e,n)=>{"use strict";var r=n(4939),o=RegExp.prototype.exec;t.exports=function(t,e){var n=t.exec;if("function"==typeof n){var i=n.call(t,e);if("object"!=typeof i)throw new TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==r(t))throw new TypeError("RegExp#exec called on incompatible receiver");return o.call(t,e)}},9020:(t,e,n)=>{"use strict";var r,o,i=n(3649),a=RegExp.prototype.exec,u=String.prototype.replace,s=a,c="lastIndex",f=(r=/a/,o=/b*/g,a.call(r,"a"),a.call(o,"a"),0!==r[c]||0!==o[c]),l=void 0!==/()??/.exec("")[1];(f||l)&&(s=function(t){var e,n,r,o,s=this;return l&&(n=new RegExp("^"+s.source+"$(?!\\s)",i.call(s))),f&&(e=s[c]),r=a.call(s,t),f&&r&&(s[c]=s.global?r.index+r[0].length:e),l&&r&&r.length>1&&u.call(r[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r}),t.exports=s},6962:t=>{t.exports=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}},473:(t,e,n)=>{var r=n(1255),o=n(486),i=function(t,e){if(o(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,r){try{(r=n(994)(Function.call,n(5385).f(Object.prototype,"__proto__").set,2))(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,n){return i(t,n),e?t.__proto__=n:r(t,n),t}}({},!1):void 0),check:i}},4412:(t,e,n)=>{"use strict";var r=n(7571),o=n(3886),i=n(1216),a=n(341)("species");t.exports=function(t){var e=r[t];i&&e&&!e[a]&&o.f(e,a,{configurable:!0,get:function(){return this}})}},5837:(t,e,n)=>{var r=n(3886).f,o=n(7384),i=n(341)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},3574:(t,e,n)=>{var r=n(5570)("keys"),o=n(4316);t.exports=function(t){return r[t]||(r[t]=o(t))}},5570:(t,e,n)=>{var r=n(2845),o=n(7571),i="__core-js_shared__",a=o[i]||(o[i]={});(t.exports=function(t,e){return a[t]||(a[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n(2725)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},8713:(t,e,n)=>{var r=n(486),o=n(1464),i=n(341)("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||null==(n=r(a)[i])?e:o(n)}},5296:(t,e,n)=>{"use strict";var r=n(5338);t.exports=function(t,e){return!!t&&r((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},8016:(t,e,n)=>{var r=n(5845),o=n(5091);t.exports=function(t){return function(e,n){var i,a,u=String(o(e)),s=r(n),c=u.length;return s<0||s>=c?t?"":void 0:(i=u.charCodeAt(s))<55296||i>56319||s+1===c||(a=u.charCodeAt(s+1))<56320||a>57343?t?u.charAt(s):i:t?u.slice(s,s+2):a-56320+(i-55296<<10)+65536}}},5692:(t,e,n)=>{var r=n(8990),o=n(5091);t.exports=function(t,e,n){if(r(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(o(t))}},5264:(t,e,n)=>{var r=n(7044),o=n(5338),i=n(5091),a=/"/g,u=function(t,e,n,r){var o=String(i(t)),u="<"+e;return""!==n&&(u+=" "+n+'="'+String(r).replace(a,"&quot;")+'"'),u+">"+o+"</"+e+">"};t.exports=function(t,e){var n={};n[t]=e(u),r(r.P+r.F*o((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3})),"String",n)}},8261:(t,e,n)=>{var r=n(8087),o=n(5458),i=n(5091);t.exports=function(t,e,n,a){var u=String(i(t)),s=u.length,c=void 0===n?" ":String(n),f=r(e);if(f<=s||""==c)return u;var l=f-s,d=o.call(c,Math.ceil(l/c.length));return d.length>l&&(d=d.slice(0,l)),a?d+u:u+d}},5458:(t,e,n)=>{"use strict";var r=n(5845),o=n(5091);t.exports=function(t){var e=String(o(this)),n="",i=r(t);if(i<0||i==1/0)throw RangeError("Count can't be negative");for(;i>0;(i>>>=1)&&(e+=e))1&i&&(n+=e);return n}},4961:(t,e,n)=>{var r=n(7044),o=n(5091),i=n(5338),a=n(1644),u="["+a+"]",s=RegExp("^"+u+u+"*"),c=RegExp(u+u+"*$"),f=function(t,e,n){var o={},u=i((function(){return!!a[t]()||"​…"!="​…"[t]()})),s=o[t]=u?e(l):a[t];n&&(o[n]=s),r(r.P+r.F*u,"String",o)},l=f.trim=function(t,e){return t=String(o(t)),1&e&&(t=t.replace(s,"")),2&e&&(t=t.replace(c,"")),t};t.exports=f},1644:t=>{t.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},7225:(t,e,n)=>{var r,o,i,a=n(994),u=n(8262),s=n(7680),c=n(3438),f=n(7571),l=f.process,d=f.setImmediate,h=f.clearImmediate,p=f.MessageChannel,v=f.Dispatch,g=0,m={},y="onreadystatechange",b=function(){var t=+this;if(m.hasOwnProperty(t)){var e=m[t];delete m[t],e()}},w=function(t){b.call(t.data)};d&&h||(d=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return m[++g]=function(){u("function"==typeof t?t:Function(t),e)},r(g),g},h=function(t){delete m[t]},"process"==n(1669)(l)?r=function(t){l.nextTick(a(b,t,1))}:v&&v.now?r=function(t){v.now(a(b,t,1))}:p?(i=(o=new p).port2,o.port1.onmessage=w,r=a(i.postMessage,i,1)):f.addEventListener&&"function"==typeof postMessage&&!f.importScripts?(r=function(t){f.postMessage(t+"","*")},f.addEventListener("message",w,!1)):r=y in c("script")?function(t){s.appendChild(c("script"))[y]=function(){s.removeChild(this),b.call(t)}}:function(t){setTimeout(a(b,t,1),0)}),t.exports={set:d,clear:h}},9260:(t,e,n)=>{var r=n(5845),o=Math.max,i=Math.min;t.exports=function(t,e){return(t=r(t))<0?o(t+e,0):i(t,e)}},5e3:(t,e,n)=>{var r=n(5845),o=n(8087);t.exports=function(t){if(void 0===t)return 0;var e=r(t),n=o(e);if(e!==n)throw RangeError("Wrong length!");return n}},5845:t=>{var e=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:e)(t)}},8182:(t,e,n)=>{var r=n(8579),o=n(5091);t.exports=function(t){return r(o(t))}},8087:(t,e,n)=>{var r=n(5845),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},7583:(t,e,n)=>{var r=n(5091);t.exports=function(t){return Object(r(t))}},4467:(t,e,n)=>{var r=n(1255);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},1063:(t,e,n)=>{"use strict";if(n(1216)){var r=n(2725),o=n(7571),i=n(5338),a=n(7044),u=n(604),s=n(1541),c=n(994),f=n(6903),l=n(8328),d=n(913),h=n(8565),p=n(5845),v=n(8087),g=n(5e3),m=n(9260),y=n(4467),b=n(7384),w=n(4939),E=n(1255),x=n(7583),_=n(9981),S=n(9055),A=n(9881),I=n(6907).f,T=n(9685),O=n(4316),N=n(341),D=n(7622),M=n(4538),k=n(8713),R=n(163),C=n(9740),L=n(2803),P=n(4412),j=n(8676),z=n(1064),F=n(3886),G=n(5385),U=F.f,B=G.f,V=o.RangeError,W=o.TypeError,X=o.Uint8Array,H="ArrayBuffer",q="Shared"+H,Y="BYTES_PER_ELEMENT",K="prototype",Z=Array[K],$=s.ArrayBuffer,Q=s.DataView,J=D(0),tt=D(2),et=D(3),nt=D(4),rt=D(5),ot=D(6),it=M(!0),at=M(!1),ut=R.values,st=R.keys,ct=R.entries,ft=Z.lastIndexOf,lt=Z.reduce,dt=Z.reduceRight,ht=Z.join,pt=Z.sort,vt=Z.slice,gt=Z.toString,mt=Z.toLocaleString,yt=N("iterator"),bt=N("toStringTag"),wt=O("typed_constructor"),Et=O("def_constructor"),xt=u.CONSTR,_t=u.TYPED,St=u.VIEW,At="Wrong length!",It=D(1,(function(t,e){return Mt(k(t,t[Et]),e)})),Tt=i((function(){return 1===new X(new Uint16Array([1]).buffer)[0]})),Ot=!!X&&!!X[K].set&&i((function(){new X(1).set({})})),Nt=function(t,e){var n=p(t);if(n<0||n%e)throw V("Wrong offset!");return n},Dt=function(t){if(E(t)&&_t in t)return t;throw W(t+" is not a typed array!")},Mt=function(t,e){if(!E(t)||!(wt in t))throw W("It is not a typed array constructor!");return new t(e)},kt=function(t,e){return Rt(k(t,t[Et]),e)},Rt=function(t,e){for(var n=0,r=e.length,o=Mt(t,r);r>n;)o[n]=e[n++];return o},Ct=function(t,e,n){U(t,e,{get:function(){return this._d[n]}})},Lt=function(t){var e,n,r,o,i,a,u=x(t),s=arguments.length,f=s>1?arguments[1]:void 0,l=void 0!==f,d=T(u);if(null!=d&&!_(d)){for(a=d.call(u),r=[],e=0;!(i=a.next()).done;e++)r.push(i.value);u=r}for(l&&s>2&&(f=c(f,arguments[2],2)),e=0,n=v(u.length),o=Mt(this,n);n>e;e++)o[e]=l?f(u[e],e):u[e];return o},Pt=function(){for(var t=0,e=arguments.length,n=Mt(this,e);e>t;)n[t]=arguments[t++];return n},jt=!!X&&i((function(){mt.call(new X(1))})),zt=function(){return mt.apply(jt?vt.call(Dt(this)):Dt(this),arguments)},Ft={copyWithin:function(t,e){return z.call(Dt(this),t,e,arguments.length>2?arguments[2]:void 0)},every:function(t){return nt(Dt(this),t,arguments.length>1?arguments[1]:void 0)},fill:function(t){return j.apply(Dt(this),arguments)},filter:function(t){return kt(this,tt(Dt(this),t,arguments.length>1?arguments[1]:void 0))},find:function(t){return rt(Dt(this),t,arguments.length>1?arguments[1]:void 0)},findIndex:function(t){return ot(Dt(this),t,arguments.length>1?arguments[1]:void 0)},forEach:function(t){J(Dt(this),t,arguments.length>1?arguments[1]:void 0)},indexOf:function(t){return at(Dt(this),t,arguments.length>1?arguments[1]:void 0)},includes:function(t){return it(Dt(this),t,arguments.length>1?arguments[1]:void 0)},join:function(t){return ht.apply(Dt(this),arguments)},lastIndexOf:function(t){return ft.apply(Dt(this),arguments)},map:function(t){return It(Dt(this),t,arguments.length>1?arguments[1]:void 0)},reduce:function(t){return lt.apply(Dt(this),arguments)},reduceRight:function(t){return dt.apply(Dt(this),arguments)},reverse:function(){for(var t,e=this,n=Dt(e).length,r=Math.floor(n/2),o=0;o<r;)t=e[o],e[o++]=e[--n],e[n]=t;return e},some:function(t){return et(Dt(this),t,arguments.length>1?arguments[1]:void 0)},sort:function(t){return pt.call(Dt(this),t)},subarray:function(t,e){var n=Dt(this),r=n.length,o=m(t,r);return new(k(n,n[Et]))(n.buffer,n.byteOffset+o*n.BYTES_PER_ELEMENT,v((void 0===e?r:m(e,r))-o))}},Gt=function(t,e){return kt(this,vt.call(Dt(this),t,e))},Ut=function(t){Dt(this);var e=Nt(arguments[1],1),n=this.length,r=x(t),o=v(r.length),i=0;if(o+e>n)throw V(At);for(;i<o;)this[e+i]=r[i++]},Bt={entries:function(){return ct.call(Dt(this))},keys:function(){return st.call(Dt(this))},values:function(){return ut.call(Dt(this))}},Vt=function(t,e){return E(t)&&t[_t]&&"symbol"!=typeof e&&e in t&&String(+e)==String(e)},Wt=function(t,e){return Vt(t,e=y(e,!0))?l(2,t[e]):B(t,e)},Xt=function(t,e,n){return!(Vt(t,e=y(e,!0))&&E(n)&&b(n,"value"))||b(n,"get")||b(n,"set")||n.configurable||b(n,"writable")&&!n.writable||b(n,"enumerable")&&!n.enumerable?U(t,e,n):(t[e]=n.value,t)};xt||(G.f=Wt,F.f=Xt),a(a.S+a.F*!xt,"Object",{getOwnPropertyDescriptor:Wt,defineProperty:Xt}),i((function(){gt.call({})}))&&(gt=mt=function(){return ht.call(this)});var Ht=h({},Ft);h(Ht,Bt),d(Ht,yt,Bt.values),h(Ht,{slice:Gt,set:Ut,constructor:function(){},toString:gt,toLocaleString:zt}),Ct(Ht,"buffer","b"),Ct(Ht,"byteOffset","o"),Ct(Ht,"byteLength","l"),Ct(Ht,"length","e"),U(Ht,bt,{get:function(){return this[_t]}}),t.exports=function(t,e,n,s){var c=t+((s=!!s)?"Clamped":"")+"Array",l="get"+t,h="set"+t,p=o[c],m=p||{},y=p&&A(p),b=!p||!u.ABV,x={},_=p&&p[K],T=function(t,n){U(t,n,{get:function(){return function(t,n){var r=t._d;return r.v[l](n*e+r.o,Tt)}(this,n)},set:function(t){return function(t,n,r){var o=t._d;s&&(r=(r=Math.round(r))<0?0:r>255?255:255&r),o.v[h](n*e+o.o,r,Tt)}(this,n,t)},enumerable:!0})};b?(p=n((function(t,n,r,o){f(t,p,c,"_d");var i,a,u,s,l=0,h=0;if(E(n)){if(!(n instanceof $||(s=w(n))==H||s==q))return _t in n?Rt(p,n):Lt.call(p,n);i=n,h=Nt(r,e);var m=n.byteLength;if(void 0===o){if(m%e)throw V(At);if((a=m-h)<0)throw V(At)}else if((a=v(o)*e)+h>m)throw V(At);u=a/e}else u=g(n),i=new $(a=u*e);for(d(t,"_d",{b:i,o:h,l:a,e:u,v:new Q(i)});l<u;)T(t,l++)})),_=p[K]=S(Ht),d(_,"constructor",p)):i((function(){p(1)}))&&i((function(){new p(-1)}))&&L((function(t){new p,new p(null),new p(1.5),new p(t)}),!0)||(p=n((function(t,n,r,o){var i;return f(t,p,c),E(n)?n instanceof $||(i=w(n))==H||i==q?void 0!==o?new m(n,Nt(r,e),o):void 0!==r?new m(n,Nt(r,e)):new m(n):_t in n?Rt(p,n):Lt.call(p,n):new m(g(n))})),J(y!==Function.prototype?I(m).concat(I(y)):I(m),(function(t){t in p||d(p,t,m[t])})),p[K]=_,r||(_.constructor=p));var O=_[yt],N=!!O&&("values"==O.name||null==O.name),D=Bt.values;d(p,wt,!0),d(_,_t,c),d(_,St,!0),d(_,Et,p),(s?new p(1)[bt]==c:bt in _)||U(_,bt,{get:function(){return c}}),x[c]=p,a(a.G+a.W+a.F*(p!=m),x),a(a.S,c,{BYTES_PER_ELEMENT:e}),a(a.S+a.F*i((function(){m.of.call(p,1)})),c,{from:Lt,of:Pt}),Y in _||d(_,Y,e),a(a.P,c,Ft),P(c),a(a.P+a.F*Ot,c,{set:Ut}),a(a.P+a.F*!N,c,Bt),r||_.toString==gt||(_.toString=gt),a(a.P+a.F*i((function(){new p(1).slice()})),c,{slice:Gt}),a(a.P+a.F*(i((function(){return[1,2].toLocaleString()!=new p([1,2]).toLocaleString()}))||!i((function(){_.toLocaleString.call([1,2])}))),c,{toLocaleString:zt}),C[c]=N?O:D,r||N||d(_,yt,D)}}else t.exports=function(){}},1541:(t,e,n)=>{"use strict";var r=n(7571),o=n(1216),i=n(2725),a=n(604),u=n(913),s=n(8565),c=n(5338),f=n(6903),l=n(5845),d=n(8087),h=n(5e3),p=n(6907).f,v=n(3886).f,g=n(8676),m=n(5837),y="ArrayBuffer",b="DataView",w="prototype",E="Wrong index!",x=r[y],_=r[b],S=r.Math,A=r.RangeError,I=r.Infinity,T=x,O=S.abs,N=S.pow,D=S.floor,M=S.log,k=S.LN2,R="buffer",C="byteLength",L="byteOffset",P=o?"_b":R,j=o?"_l":C,z=o?"_o":L;function F(t,e,n){var r,o,i,a=new Array(n),u=8*n-e-1,s=(1<<u)-1,c=s>>1,f=23===e?N(2,-24)-N(2,-77):0,l=0,d=t<0||0===t&&1/t<0?1:0;for((t=O(t))!=t||t===I?(o=t!=t?1:0,r=s):(r=D(M(t)/k),t*(i=N(2,-r))<1&&(r--,i*=2),(t+=r+c>=1?f/i:f*N(2,1-c))*i>=2&&(r++,i/=2),r+c>=s?(o=0,r=s):r+c>=1?(o=(t*i-1)*N(2,e),r+=c):(o=t*N(2,c-1)*N(2,e),r=0));e>=8;a[l++]=255&o,o/=256,e-=8);for(r=r<<e|o,u+=e;u>0;a[l++]=255&r,r/=256,u-=8);return a[--l]|=128*d,a}function G(t,e,n){var r,o=8*n-e-1,i=(1<<o)-1,a=i>>1,u=o-7,s=n-1,c=t[s--],f=127&c;for(c>>=7;u>0;f=256*f+t[s],s--,u-=8);for(r=f&(1<<-u)-1,f>>=-u,u+=e;u>0;r=256*r+t[s],s--,u-=8);if(0===f)f=1-a;else{if(f===i)return r?NaN:c?-I:I;r+=N(2,e),f-=a}return(c?-1:1)*r*N(2,f-e)}function U(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]}function B(t){return[255&t]}function V(t){return[255&t,t>>8&255]}function W(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function X(t){return F(t,52,8)}function H(t){return F(t,23,4)}function q(t,e,n){v(t[w],e,{get:function(){return this[n]}})}function Y(t,e,n,r){var o=h(+n);if(o+e>t[j])throw A(E);var i=t[P]._b,a=o+t[z],u=i.slice(a,a+e);return r?u:u.reverse()}function K(t,e,n,r,o,i){var a=h(+n);if(a+e>t[j])throw A(E);for(var u=t[P]._b,s=a+t[z],c=r(+o),f=0;f<e;f++)u[s+f]=c[i?f:e-f-1]}if(a.ABV){if(!c((function(){x(1)}))||!c((function(){new x(-1)}))||c((function(){return new x,new x(1.5),new x(NaN),x.name!=y}))){for(var Z,$=(x=function(t){return f(this,x),new T(h(t))})[w]=T[w],Q=p(T),J=0;Q.length>J;)(Z=Q[J++])in x||u(x,Z,T[Z]);i||($.constructor=x)}var tt=new _(new x(2)),et=_[w].setInt8;tt.setInt8(0,2147483648),tt.setInt8(1,2147483649),!tt.getInt8(0)&&tt.getInt8(1)||s(_[w],{setInt8:function(t,e){et.call(this,t,e<<24>>24)},setUint8:function(t,e){et.call(this,t,e<<24>>24)}},!0)}else x=function(t){f(this,x,y);var e=h(t);this._b=g.call(new Array(e),0),this[j]=e},_=function(t,e,n){f(this,_,b),f(t,x,b);var r=t[j],o=l(e);if(o<0||o>r)throw A("Wrong offset!");if(o+(n=void 0===n?r-o:d(n))>r)throw A("Wrong length!");this[P]=t,this[z]=o,this[j]=n},o&&(q(x,C,"_l"),q(_,R,"_b"),q(_,C,"_l"),q(_,L,"_o")),s(_[w],{getInt8:function(t){return Y(this,1,t)[0]<<24>>24},getUint8:function(t){return Y(this,1,t)[0]},getInt16:function(t){var e=Y(this,2,t,arguments[1]);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=Y(this,2,t,arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return U(Y(this,4,t,arguments[1]))},getUint32:function(t){return U(Y(this,4,t,arguments[1]))>>>0},getFloat32:function(t){return G(Y(this,4,t,arguments[1]),23,4)},getFloat64:function(t){return G(Y(this,8,t,arguments[1]),52,8)},setInt8:function(t,e){K(this,1,t,B,e)},setUint8:function(t,e){K(this,1,t,B,e)},setInt16:function(t,e){K(this,2,t,V,e,arguments[2])},setUint16:function(t,e){K(this,2,t,V,e,arguments[2])},setInt32:function(t,e){K(this,4,t,W,e,arguments[2])},setUint32:function(t,e){K(this,4,t,W,e,arguments[2])},setFloat32:function(t,e){K(this,4,t,H,e,arguments[2])},setFloat64:function(t,e){K(this,8,t,X,e,arguments[2])}});m(x,y),m(_,b),u(_[w],a.VIEW,!0),e[y]=x,e[b]=_},604:(t,e,n)=>{for(var r,o=n(7571),i=n(913),a=n(4316),u=a("typed_array"),s=a("view"),c=!(!o.ArrayBuffer||!o.DataView),f=c,l=0,d="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");l<9;)(r=o[d[l++]])?(i(r.prototype,u,!0),i(r.prototype,s,!0)):f=!1;t.exports={ABV:c,CONSTR:f,TYPED:u,VIEW:s}},4316:t=>{var e=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+n).toString(36))}},2541:(t,e,n)=>{var r=n(7571).navigator;t.exports=r&&r.userAgent||""},4664:(t,e,n)=>{var r=n(1255);t.exports=function(t,e){if(!r(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t}},6262:(t,e,n)=>{var r=n(7571),o=n(2845),i=n(2725),a=n(7686),u=n(3886).f;t.exports=function(t){var e=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||u(e,t,{value:a.f(t)})}},7686:(t,e,n)=>{e.f=n(341)},341:(t,e,n)=>{var r=n(5570)("wks"),o=n(4316),i=n(7571).Symbol,a="function"==typeof i;(t.exports=function(t){return r[t]||(r[t]=a&&i[t]||(a?i:o)("Symbol."+t))}).store=r},9685:(t,e,n)=>{var r=n(4939),o=n(341)("iterator"),i=n(9740);t.exports=n(2845).getIteratorMethod=function(t){if(null!=t)return t[o]||t["@@iterator"]||i[r(t)]}},5305:(t,e,n)=>{var r=n(7044);r(r.P,"Array",{copyWithin:n(1064)}),n(4691)("copyWithin")},5015:(t,e,n)=>{"use strict";var r=n(7044),o=n(7622)(4);r(r.P+r.F*!n(5296)([].every,!0),"Array",{every:function(t){return o(this,t,arguments[1])}})},6341:(t,e,n)=>{var r=n(7044);r(r.P,"Array",{fill:n(8676)}),n(4691)("fill")},5119:(t,e,n)=>{"use strict";var r=n(7044),o=n(7622)(2);r(r.P+r.F*!n(5296)([].filter,!0),"Array",{filter:function(t){return o(this,t,arguments[1])}})},4488:(t,e,n)=>{"use strict";var r=n(7044),o=n(7622)(6),i="findIndex",a=!0;i in[]&&Array(1)[i]((function(){a=!1})),r(r.P+r.F*a,"Array",{findIndex:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),n(4691)(i)},5915:(t,e,n)=>{"use strict";var r=n(7044),o=n(7622)(5),i="find",a=!0;i in[]&&Array(1)[i]((function(){a=!1})),r(r.P+r.F*a,"Array",{find:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),n(4691)(i)},5788:(t,e,n)=>{"use strict";var r=n(7044),o=n(7622)(0),i=n(5296)([].forEach,!0);r(r.P+r.F*!i,"Array",{forEach:function(t){return o(this,t,arguments[1])}})},9689:(t,e,n)=>{"use strict";var r=n(994),o=n(7044),i=n(7583),a=n(4902),u=n(9981),s=n(8087),c=n(1395),f=n(9685);o(o.S+o.F*!n(2803)((function(t){Array.from(t)})),"Array",{from:function(t){var e,n,o,l,d=i(t),h="function"==typeof this?this:Array,p=arguments.length,v=p>1?arguments[1]:void 0,g=void 0!==v,m=0,y=f(d);if(g&&(v=r(v,p>2?arguments[2]:void 0,2)),null==y||h==Array&&u(y))for(n=new h(e=s(d.length));e>m;m++)c(n,m,g?v(d[m],m):d[m]);else for(l=y.call(d),n=new h;!(o=l.next()).done;m++)c(n,m,g?a(l,v,[o.value,m],!0):o.value);return n.length=m,n}})},5377:(t,e,n)=>{"use strict";var r=n(7044),o=n(4538)(!1),i=[].indexOf,a=!!i&&1/[1].indexOf(1,-0)<0;r(r.P+r.F*(a||!n(5296)(i)),"Array",{indexOf:function(t){return a?i.apply(this,arguments)||0:o(this,t,arguments[1])}})},2247:(t,e,n)=>{var r=n(7044);r(r.S,"Array",{isArray:n(7183)})},163:(t,e,n)=>{"use strict";var r=n(4691),o=n(8782),i=n(9740),a=n(8182);t.exports=n(966)(Array,"Array",(function(t,e){this._t=a(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,o(1)):o(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])}),"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},9026:(t,e,n)=>{"use strict";var r=n(7044),o=n(8182),i=[].join;r(r.P+r.F*(n(8579)!=Object||!n(5296)(i)),"Array",{join:function(t){return i.call(o(this),void 0===t?",":t)}})},9879:(t,e,n)=>{"use strict";var r=n(7044),o=n(8182),i=n(5845),a=n(8087),u=[].lastIndexOf,s=!!u&&1/[1].lastIndexOf(1,-0)<0;r(r.P+r.F*(s||!n(5296)(u)),"Array",{lastIndexOf:function(t){if(s)return u.apply(this,arguments)||0;var e=o(this),n=a(e.length),r=n-1;for(arguments.length>1&&(r=Math.min(r,i(arguments[1]))),r<0&&(r=n+r);r>=0;r--)if(r in e&&e[r]===t)return r||0;return-1}})},7878:(t,e,n)=>{"use strict";var r=n(7044),o=n(7622)(1);r(r.P+r.F*!n(5296)([].map,!0),"Array",{map:function(t){return o(this,t,arguments[1])}})},9003:(t,e,n)=>{"use strict";var r=n(7044),o=n(1395);r(r.S+r.F*n(5338)((function(){function t(){}return!(Array.of.call(t)instanceof t)})),"Array",{of:function(){for(var t=0,e=arguments.length,n=new("function"==typeof this?this:Array)(e);e>t;)o(n,t,arguments[t++]);return n.length=e,n}})},646:(t,e,n)=>{"use strict";var r=n(7044),o=n(5336);r(r.P+r.F*!n(5296)([].reduceRight,!0),"Array",{reduceRight:function(t){return o(this,t,arguments.length,arguments[1],!0)}})},8059:(t,e,n)=>{"use strict";var r=n(7044),o=n(5336);r(r.P+r.F*!n(5296)([].reduce,!0),"Array",{reduce:function(t){return o(this,t,arguments.length,arguments[1],!1)}})},4088:(t,e,n)=>{"use strict";var r=n(7044),o=n(7680),i=n(1669),a=n(9260),u=n(8087),s=[].slice;r(r.P+r.F*n(5338)((function(){o&&s.call(o)})),"Array",{slice:function(t,e){var n=u(this.length),r=i(this);if(e=void 0===e?n:e,"Array"==r)return s.call(this,t,e);for(var o=a(t,n),c=a(e,n),f=u(c-o),l=new Array(f),d=0;d<f;d++)l[d]="String"==r?this.charAt(o+d):this[o+d];return l}})},3135:(t,e,n)=>{"use strict";var r=n(7044),o=n(7622)(3);r(r.P+r.F*!n(5296)([].some,!0),"Array",{some:function(t){return o(this,t,arguments[1])}})},535:(t,e,n)=>{"use strict";var r=n(7044),o=n(1464),i=n(7583),a=n(5338),u=[].sort,s=[1,2,3];r(r.P+r.F*(a((function(){s.sort(void 0)}))||!a((function(){s.sort(null)}))||!n(5296)(u)),"Array",{sort:function(t){return void 0===t?u.call(i(this)):u.call(i(this),o(t))}})},9281:(t,e,n)=>{n(4412)("Array")},4094:(t,e,n)=>{var r=n(7044);r(r.S,"Date",{now:function(){return(new Date).getTime()}})},5013:(t,e,n)=>{var r=n(7044),o=n(4506);r(r.P+r.F*(Date.prototype.toISOString!==o),"Date",{toISOString:o})},8781:(t,e,n)=>{"use strict";var r=n(7044),o=n(7583),i=n(4467);r(r.P+r.F*n(5338)((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})})),"Date",{toJSON:function(t){var e=o(this),n=i(e);return"number"!=typeof n||isFinite(n)?e.toISOString():null}})},8723:(t,e,n)=>{var r=n(341)("toPrimitive"),o=Date.prototype;r in o||n(913)(o,r,n(9514))},3735:(t,e,n)=>{var r=Date.prototype,o="Invalid Date",i="toString",a=r[i],u=r.getTime;new Date(NaN)+""!=o&&n(6476)(r,i,(function(){var t=u.call(this);return t==t?a.call(this):o}))},1765:(t,e,n)=>{var r=n(7044);r(r.P,"Function",{bind:n(8366)})},7451:(t,e,n)=>{"use strict";var r=n(1255),o=n(9881),i=n(341)("hasInstance"),a=Function.prototype;i in a||n(3886).f(a,i,{value:function(t){if("function"!=typeof this||!r(t))return!1;if(!r(this.prototype))return t instanceof this;for(;t=o(t);)if(this.prototype===t)return!0;return!1}})},5747:(t,e,n)=>{var r=n(3886).f,o=Function.prototype,i=/^\s*function ([^ (]*)/,a="name";a in o||n(1216)&&r(o,a,{configurable:!0,get:function(){try{return(""+this).match(i)[1]}catch(t){return""}}})},6441:(t,e,n)=>{"use strict";var r=n(3050),o=n(4664),i="Map";t.exports=n(859)(i,(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{get:function(t){var e=r.getEntry(o(this,i),t);return e&&e.v},set:function(t,e){return r.def(o(this,i),0===t?0:t,e)}},r,!0)},2212:(t,e,n)=>{var r=n(7044),o=n(1618),i=Math.sqrt,a=Math.acosh;r(r.S+r.F*!(a&&710==Math.floor(a(Number.MAX_VALUE))&&a(1/0)==1/0),"Math",{acosh:function(t){return(t=+t)<1?NaN:t>94906265.62425156?Math.log(t)+Math.LN2:o(t-1+i(t-1)*i(t+1))}})},4230:(t,e,n)=>{var r=n(7044),o=Math.asinh;r(r.S+r.F*!(o&&1/o(0)>0),"Math",{asinh:function t(e){return isFinite(e=+e)&&0!=e?e<0?-t(-e):Math.log(e+Math.sqrt(e*e+1)):e}})},9754:(t,e,n)=>{var r=n(7044),o=Math.atanh;r(r.S+r.F*!(o&&1/o(-0)<0),"Math",{atanh:function(t){return 0==(t=+t)?t:Math.log((1+t)/(1-t))/2}})},2811:(t,e,n)=>{var r=n(7044),o=n(2987);r(r.S,"Math",{cbrt:function(t){return o(t=+t)*Math.pow(Math.abs(t),1/3)}})},3998:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{clz32:function(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},1769:(t,e,n)=>{var r=n(7044),o=Math.exp;r(r.S,"Math",{cosh:function(t){return(o(t=+t)+o(-t))/2}})},8789:(t,e,n)=>{var r=n(7044),o=n(959);r(r.S+r.F*(o!=Math.expm1),"Math",{expm1:o})},2848:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{fround:n(7682)})},1762:(t,e,n)=>{var r=n(7044),o=Math.abs;r(r.S,"Math",{hypot:function(t,e){for(var n,r,i=0,a=0,u=arguments.length,s=0;a<u;)s<(n=o(arguments[a++]))?(i=i*(r=s/n)*r+1,s=n):i+=n>0?(r=n/s)*r:n;return s===1/0?1/0:s*Math.sqrt(i)}})},1323:(t,e,n)=>{var r=n(7044),o=Math.imul;r(r.S+r.F*n(5338)((function(){return-5!=o(4294967295,5)||2!=o.length})),"Math",{imul:function(t,e){var n=65535,r=+t,o=+e,i=n&r,a=n&o;return 0|i*a+((n&r>>>16)*a+i*(n&o>>>16)<<16>>>0)}})},6063:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{log10:function(t){return Math.log(t)*Math.LOG10E}})},3282:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{log1p:n(1618)})},6816:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}})},1854:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{sign:n(2987)})},3303:(t,e,n)=>{var r=n(7044),o=n(959),i=Math.exp;r(r.S+r.F*n(5338)((function(){return-2e-17!=!Math.sinh(-2e-17)})),"Math",{sinh:function(t){return Math.abs(t=+t)<1?(o(t)-o(-t))/2:(i(t-1)-i(-t-1))*(Math.E/2)}})},4421:(t,e,n)=>{var r=n(7044),o=n(959),i=Math.exp;r(r.S,"Math",{tanh:function(t){var e=o(t=+t),n=o(-t);return e==1/0?1:n==1/0?-1:(e-n)/(i(t)+i(-t))}})},2203:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{trunc:function(t){return(t>0?Math.floor:Math.ceil)(t)}})},7454:(t,e,n)=>{"use strict";var r=n(7571),o=n(7384),i=n(1669),a=n(116),u=n(4467),s=n(5338),c=n(6907).f,f=n(5385).f,l=n(3886).f,d=n(4961).trim,h="Number",p=r[h],v=p,g=p.prototype,m=i(n(9055)(g))==h,y="trim"in String.prototype,b=function(t){var e=u(t,!1);if("string"==typeof e&&e.length>2){var n,r,o,i=(e=y?e.trim():d(e,3)).charCodeAt(0);if(43===i||45===i){if(88===(n=e.charCodeAt(2))||120===n)return NaN}else if(48===i){switch(e.charCodeAt(1)){case 66:case 98:r=2,o=49;break;case 79:case 111:r=8,o=55;break;default:return+e}for(var a,s=e.slice(2),c=0,f=s.length;c<f;c++)if((a=s.charCodeAt(c))<48||a>o)return NaN;return parseInt(s,r)}}return+e};if(!p(" 0o1")||!p("0b1")||p("+0x1")){p=function(t){var e=arguments.length<1?0:t,n=this;return n instanceof p&&(m?s((function(){g.valueOf.call(n)})):i(n)!=h)?a(new v(b(e)),n,p):b(e)};for(var w,E=n(1216)?c(v):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),x=0;E.length>x;x++)o(v,w=E[x])&&!o(p,w)&&l(p,w,f(v,w));p.prototype=g,g.constructor=p,n(6476)(r,h,p)}},7551:(t,e,n)=>{var r=n(7044);r(r.S,"Number",{EPSILON:Math.pow(2,-52)})},2929:(t,e,n)=>{var r=n(7044),o=n(7571).isFinite;r(r.S,"Number",{isFinite:function(t){return"number"==typeof t&&o(t)}})},215:(t,e,n)=>{var r=n(7044);r(r.S,"Number",{isInteger:n(1272)})},6183:(t,e,n)=>{var r=n(7044);r(r.S,"Number",{isNaN:function(t){return t!=t}})},8190:(t,e,n)=>{var r=n(7044),o=n(1272),i=Math.abs;r(r.S,"Number",{isSafeInteger:function(t){return o(t)&&i(t)<=9007199254740991}})},476:(t,e,n)=>{var r=n(7044);r(r.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},948:(t,e,n)=>{var r=n(7044);r(r.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},942:(t,e,n)=>{var r=n(7044),o=n(1885);r(r.S+r.F*(Number.parseFloat!=o),"Number",{parseFloat:o})},2870:(t,e,n)=>{var r=n(7044),o=n(343);r(r.S+r.F*(Number.parseInt!=o),"Number",{parseInt:o})},3053:(t,e,n)=>{"use strict";var r=n(7044),o=n(5845),i=n(8347),a=n(5458),u=1..toFixed,s=Math.floor,c=[0,0,0,0,0,0],f="Number.toFixed: incorrect invocation!",l="0",d=function(t,e){for(var n=-1,r=e;++n<6;)r+=t*c[n],c[n]=r%1e7,r=s(r/1e7)},h=function(t){for(var e=6,n=0;--e>=0;)n+=c[e],c[e]=s(n/t),n=n%t*1e7},p=function(){for(var t=6,e="";--t>=0;)if(""!==e||0===t||0!==c[t]){var n=String(c[t]);e=""===e?n:e+a.call(l,7-n.length)+n}return e},v=function(t,e,n){return 0===e?n:e%2==1?v(t,e-1,n*t):v(t*t,e/2,n)};r(r.P+r.F*(!!u&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!n(5338)((function(){u.call({})}))),"Number",{toFixed:function(t){var e,n,r,u,s=i(this,f),c=o(t),g="",m=l;if(c<0||c>20)throw RangeError(f);if(s!=s)return"NaN";if(s<=-1e21||s>=1e21)return String(s);if(s<0&&(g="-",s=-s),s>1e-21)if(e=function(t){for(var e=0,n=t;n>=4096;)e+=12,n/=4096;for(;n>=2;)e+=1,n/=2;return e}(s*v(2,69,1))-69,n=e<0?s*v(2,-e,1):s/v(2,e,1),n*=4503599627370496,(e=52-e)>0){for(d(0,n),r=c;r>=7;)d(1e7,0),r-=7;for(d(v(10,r,1),0),r=e-1;r>=23;)h(1<<23),r-=23;h(1<<r),d(1,1),h(2),m=p()}else d(0,n),d(1<<-e,0),m=p()+a.call(l,c);return c>0?g+((u=m.length)<=c?"0."+a.call(l,c-u)+m:m.slice(0,u-c)+"."+m.slice(u-c)):g+m}})},8032:(t,e,n)=>{"use strict";var r=n(7044),o=n(5338),i=n(8347),a=1..toPrecision;r(r.P+r.F*(o((function(){return"1"!==a.call(1,void 0)}))||!o((function(){a.call({})}))),"Number",{toPrecision:function(t){var e=i(this,"Number#toPrecision: incorrect invocation!");return void 0===t?a.call(e):a.call(e,t)}})},5261:(t,e,n)=>{var r=n(7044);r(r.S+r.F,"Object",{assign:n(4643)})},6051:(t,e,n)=>{var r=n(7044);r(r.S,"Object",{create:n(9055)})},9518:(t,e,n)=>{var r=n(7044);r(r.S+r.F*!n(1216),"Object",{defineProperties:n(6283)})},2640:(t,e,n)=>{var r=n(7044);r(r.S+r.F*!n(1216),"Object",{defineProperty:n(3886).f})},9788:(t,e,n)=>{var r=n(1255),o=n(4278).onFreeze;n(381)("freeze",(function(t){return function(e){return t&&r(e)?t(o(e)):e}}))},8201:(t,e,n)=>{var r=n(8182),o=n(5385).f;n(381)("getOwnPropertyDescriptor",(function(){return function(t,e){return o(r(t),e)}}))},7525:(t,e,n)=>{n(381)("getOwnPropertyNames",(function(){return n(3473).f}))},470:(t,e,n)=>{var r=n(7583),o=n(9881);n(381)("getPrototypeOf",(function(){return function(t){return o(r(t))}}))},7940:(t,e,n)=>{var r=n(1255);n(381)("isExtensible",(function(t){return function(e){return!!r(e)&&(!t||t(e))}}))},6129:(t,e,n)=>{var r=n(1255);n(381)("isFrozen",(function(t){return function(e){return!r(e)||!!t&&t(e)}}))},2802:(t,e,n)=>{var r=n(1255);n(381)("isSealed",(function(t){return function(e){return!r(e)||!!t&&t(e)}}))},9340:(t,e,n)=>{var r=n(7044);r(r.S,"Object",{is:n(6962)})},5723:(t,e,n)=>{var r=n(7583),o=n(9804);n(381)("keys",(function(){return function(t){return o(r(t))}}))},7577:(t,e,n)=>{var r=n(1255),o=n(4278).onFreeze;n(381)("preventExtensions",(function(t){return function(e){return t&&r(e)?t(o(e)):e}}))},1498:(t,e,n)=>{var r=n(1255),o=n(4278).onFreeze;n(381)("seal",(function(t){return function(e){return t&&r(e)?t(o(e)):e}}))},1584:(t,e,n)=>{var r=n(7044);r(r.S,"Object",{setPrototypeOf:n(473).set})},7298:(t,e,n)=>{"use strict";var r=n(4939),o={};o[n(341)("toStringTag")]="z",o+""!="[object z]"&&n(6476)(Object.prototype,"toString",(function(){return"[object "+r(this)+"]"}),!0)},2809:(t,e,n)=>{var r=n(7044),o=n(1885);r(r.G+r.F*(parseFloat!=o),{parseFloat:o})},2784:(t,e,n)=>{var r=n(7044),o=n(343);r(r.G+r.F*(parseInt!=o),{parseInt:o})},7843:(t,e,n)=>{"use strict";var r,o,i,a,u=n(2725),s=n(7571),c=n(994),f=n(4939),l=n(7044),d=n(1255),h=n(1464),p=n(6903),v=n(9822),g=n(8713),m=n(7225).set,y=n(7485)(),b=n(449),w=n(9696),E=n(2541),x=n(909),_="Promise",S=s.TypeError,A=s.process,I=A&&A.versions,T=I&&I.v8||"",O=s[_],N="process"==f(A),D=function(){},M=o=b.f,k=!!function(){try{var t=O.resolve(1),e=(t.constructor={})[n(341)("species")]=function(t){t(D,D)};return(N||"function"==typeof PromiseRejectionEvent)&&t.then(D)instanceof e&&0!==T.indexOf("6.6")&&-1===E.indexOf("Chrome/66")}catch(t){}}(),R=function(t){var e;return!(!d(t)||"function"!=typeof(e=t.then))&&e},C=function(t,e){if(!t._n){t._n=!0;var n=t._c;y((function(){for(var r=t._v,o=1==t._s,i=0,a=function(e){var n,i,a,u=o?e.ok:e.fail,s=e.resolve,c=e.reject,f=e.domain;try{u?(o||(2==t._h&&j(t),t._h=1),!0===u?n=r:(f&&f.enter(),n=u(r),f&&(f.exit(),a=!0)),n===e.promise?c(S("Promise-chain cycle")):(i=R(n))?i.call(n,s,c):s(n)):c(r)}catch(t){f&&!a&&f.exit(),c(t)}};n.length>i;)a(n[i++]);t._c=[],t._n=!1,e&&!t._h&&L(t)}))}},L=function(t){m.call(s,(function(){var e,n,r,o=t._v,i=P(t);if(i&&(e=w((function(){N?A.emit("unhandledRejection",o,t):(n=s.onunhandledrejection)?n({promise:t,reason:o}):(r=s.console)&&r.error&&r.error("Unhandled promise rejection",o)})),t._h=N||P(t)?2:1),t._a=void 0,i&&e.e)throw e.v}))},P=function(t){return 1!==t._h&&0===(t._a||t._c).length},j=function(t){m.call(s,(function(){var e;N?A.emit("rejectionHandled",t):(e=s.onrejectionhandled)&&e({promise:t,reason:t._v})}))},z=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),C(e,!0))},F=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw S("Promise can't be resolved itself");(e=R(t))?y((function(){var r={_w:n,_d:!1};try{e.call(t,c(F,r,1),c(z,r,1))}catch(t){z.call(r,t)}})):(n._v=t,n._s=1,C(n,!1))}catch(t){z.call({_w:n,_d:!1},t)}}};k||(O=function(t){p(this,O,_,"_h"),h(t),r.call(this);try{t(c(F,this,1),c(z,this,1))}catch(t){z.call(this,t)}},(r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(8565)(O.prototype,{then:function(t,e){var n=M(g(this,O));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=N?A.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&C(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),i=function(){var t=new r;this.promise=t,this.resolve=c(F,t,1),this.reject=c(z,t,1)},b.f=M=function(t){return t===O||t===a?new i(t):o(t)}),l(l.G+l.W+l.F*!k,{Promise:O}),n(5837)(O,_),n(4412)(_),a=n(2845)[_],l(l.S+l.F*!k,_,{reject:function(t){var e=M(this);return(0,e.reject)(t),e.promise}}),l(l.S+l.F*(u||!k),_,{resolve:function(t){return x(u&&this===a?O:this,t)}}),l(l.S+l.F*!(k&&n(2803)((function(t){O.all(t).catch(D)}))),_,{all:function(t){var e=this,n=M(e),r=n.resolve,o=n.reject,i=w((function(){var n=[],i=0,a=1;v(t,!1,(function(t){var u=i++,s=!1;n.push(void 0),a++,e.resolve(t).then((function(t){s||(s=!0,n[u]=t,--a||r(n))}),o)})),--a||r(n)}));return i.e&&o(i.v),n.promise},race:function(t){var e=this,n=M(e),r=n.reject,o=w((function(){v(t,!1,(function(t){e.resolve(t).then(n.resolve,r)}))}));return o.e&&r(o.v),n.promise}})},8275:(t,e,n)=>{var r=n(7044),o=n(1464),i=n(486),a=(n(7571).Reflect||{}).apply,u=Function.apply;r(r.S+r.F*!n(5338)((function(){a((function(){}))})),"Reflect",{apply:function(t,e,n){var r=o(t),s=i(n);return a?a(r,e,s):u.call(r,e,s)}})},2552:(t,e,n)=>{var r=n(7044),o=n(9055),i=n(1464),a=n(486),u=n(1255),s=n(5338),c=n(8366),f=(n(7571).Reflect||{}).construct,l=s((function(){function t(){}return!(f((function(){}),[],t)instanceof t)})),d=!s((function(){f((function(){}))}));r(r.S+r.F*(l||d),"Reflect",{construct:function(t,e){i(t),a(e);var n=arguments.length<3?t:i(arguments[2]);if(d&&!l)return f(t,e,n);if(t==n){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var r=[null];return r.push.apply(r,e),new(c.apply(t,r))}var s=n.prototype,h=o(u(s)?s:Object.prototype),p=Function.apply.call(t,h,e);return u(p)?p:h}})},3077:(t,e,n)=>{var r=n(3886),o=n(7044),i=n(486),a=n(4467);o(o.S+o.F*n(5338)((function(){Reflect.defineProperty(r.f({},1,{value:1}),1,{value:2})})),"Reflect",{defineProperty:function(t,e,n){i(t),e=a(e,!0),i(n);try{return r.f(t,e,n),!0}catch(t){return!1}}})},1031:(t,e,n)=>{var r=n(7044),o=n(5385).f,i=n(486);r(r.S,"Reflect",{deleteProperty:function(t,e){var n=o(i(t),e);return!(n&&!n.configurable)&&delete t[e]}})},8916:(t,e,n)=>{"use strict";var r=n(7044),o=n(486),i=function(t){this._t=o(t),this._i=0;var e,n=this._k=[];for(e in t)n.push(e)};n(4529)(i,"Object",(function(){var t,e=this,n=e._k;do{if(e._i>=n.length)return{value:void 0,done:!0}}while(!((t=n[e._i++])in e._t));return{value:t,done:!1}})),r(r.S,"Reflect",{enumerate:function(t){return new i(t)}})},8531:(t,e,n)=>{var r=n(5385),o=n(7044),i=n(486);o(o.S,"Reflect",{getOwnPropertyDescriptor:function(t,e){return r.f(i(t),e)}})},7323:(t,e,n)=>{var r=n(7044),o=n(9881),i=n(486);r(r.S,"Reflect",{getPrototypeOf:function(t){return o(i(t))}})},8978:(t,e,n)=>{var r=n(5385),o=n(9881),i=n(7384),a=n(7044),u=n(1255),s=n(486);a(a.S,"Reflect",{get:function t(e,n){var a,c,f=arguments.length<3?e:arguments[2];return s(e)===f?e[n]:(a=r.f(e,n))?i(a,"value")?a.value:void 0!==a.get?a.get.call(f):void 0:u(c=o(e))?t(c,n,f):void 0}})},3704:(t,e,n)=>{var r=n(7044);r(r.S,"Reflect",{has:function(t,e){return e in t}})},3153:(t,e,n)=>{var r=n(7044),o=n(486),i=Object.isExtensible;r(r.S,"Reflect",{isExtensible:function(t){return o(t),!i||i(t)}})},8812:(t,e,n)=>{var r=n(7044);r(r.S,"Reflect",{ownKeys:n(8125)})},2636:(t,e,n)=>{var r=n(7044),o=n(486),i=Object.preventExtensions;r(r.S,"Reflect",{preventExtensions:function(t){o(t);try{return i&&i(t),!0}catch(t){return!1}}})},377:(t,e,n)=>{var r=n(7044),o=n(473);o&&r(r.S,"Reflect",{setPrototypeOf:function(t,e){o.check(t,e);try{return o.set(t,e),!0}catch(t){return!1}}})},1602:(t,e,n)=>{var r=n(3886),o=n(5385),i=n(9881),a=n(7384),u=n(7044),s=n(8328),c=n(486),f=n(1255);u(u.S,"Reflect",{set:function t(e,n,u){var l,d,h=arguments.length<4?e:arguments[3],p=o.f(c(e),n);if(!p){if(f(d=i(e)))return t(d,n,u,h);p=s(0)}if(a(p,"value")){if(!1===p.writable||!f(h))return!1;if(l=o.f(h,n)){if(l.get||l.set||!1===l.writable)return!1;l.value=u,r.f(h,n,l)}else r.f(h,n,s(0,u));return!0}return void 0!==p.set&&(p.set.call(h,u),!0)}})},6668:(t,e,n)=>{var r=n(7571),o=n(116),i=n(3886).f,a=n(6907).f,u=n(8990),s=n(3649),c=r.RegExp,f=c,l=c.prototype,d=/a/g,h=/a/g,p=new c(d)!==d;if(n(1216)&&(!p||n(5338)((function(){return h[n(341)("match")]=!1,c(d)!=d||c(h)==h||"/a/i"!=c(d,"i")})))){c=function(t,e){var n=this instanceof c,r=u(t),i=void 0===e;return!n&&r&&t.constructor===c&&i?t:o(p?new f(r&&!i?t.source:t,e):f((r=t instanceof c)?t.source:t,r&&i?s.call(t):e),n?this:l,c)};for(var v=function(t){t in c||i(c,t,{configurable:!0,get:function(){return f[t]},set:function(e){f[t]=e}})},g=a(f),m=0;g.length>m;)v(g[m++]);l.constructor=c,c.prototype=l,n(6476)(r,"RegExp",c)}n(4412)("RegExp")},7139:(t,e,n)=>{"use strict";var r=n(9020);n(7044)({target:"RegExp",proto:!0,forced:r!==/./.exec},{exec:r})},8686:(t,e,n)=>{n(1216)&&"g"!=/./g.flags&&n(3886).f(RegExp.prototype,"flags",{configurable:!0,get:n(3649)})},5480:(t,e,n)=>{"use strict";var r=n(486),o=n(8087),i=n(178),a=n(2968);n(6719)("match",1,(function(t,e,n,u){return[function(n){var r=t(this),o=null==n?void 0:n[e];return void 0!==o?o.call(n,r):new RegExp(n)[e](String(r))},function(t){var e=u(n,t,this);if(e.done)return e.value;var s=r(t),c=String(this);if(!s.global)return a(s,c);var f=s.unicode;s.lastIndex=0;for(var l,d=[],h=0;null!==(l=a(s,c));){var p=String(l[0]);d[h]=p,""===p&&(s.lastIndex=i(c,o(s.lastIndex),f)),h++}return 0===h?null:d}]}))},9121:(t,e,n)=>{"use strict";var r=n(486),o=n(7583),i=n(8087),a=n(5845),u=n(178),s=n(2968),c=Math.max,f=Math.min,l=Math.floor,d=/\$([$&`']|\d\d?|<[^>]*>)/g,h=/\$([$&`']|\d\d?)/g;n(6719)("replace",2,(function(t,e,n,p){return[function(r,o){var i=t(this),a=null==r?void 0:r[e];return void 0!==a?a.call(r,i,o):n.call(String(i),r,o)},function(t,e){var o=p(n,t,this,e);if(o.done)return o.value;var l=r(t),d=String(this),h="function"==typeof e;h||(e=String(e));var g=l.global;if(g){var m=l.unicode;l.lastIndex=0}for(var y=[];;){var b=s(l,d);if(null===b)break;if(y.push(b),!g)break;""===String(b[0])&&(l.lastIndex=u(d,i(l.lastIndex),m))}for(var w,E="",x=0,_=0;_<y.length;_++){b=y[_];for(var S=String(b[0]),A=c(f(a(b.index),d.length),0),I=[],T=1;T<b.length;T++)I.push(void 0===(w=b[T])?w:String(w));var O=b.groups;if(h){var N=[S].concat(I,A,d);void 0!==O&&N.push(O);var D=String(e.apply(void 0,N))}else D=v(S,d,A,I,O,e);A>=x&&(E+=d.slice(x,A)+D,x=A+S.length)}return E+d.slice(x)}];function v(t,e,r,i,a,u){var s=r+t.length,c=i.length,f=h;return void 0!==a&&(a=o(a),f=d),n.call(u,f,(function(n,o){var u;switch(o.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,r);case"'":return e.slice(s);case"<":u=a[o.slice(1,-1)];break;default:var f=+o;if(0===f)return n;if(f>c){var d=l(f/10);return 0===d?n:d<=c?void 0===i[d-1]?o.charAt(1):i[d-1]+o.charAt(1):n}u=i[f-1]}return void 0===u?"":u}))}}))},914:(t,e,n)=>{"use strict";var r=n(486),o=n(6962),i=n(2968);n(6719)("search",1,(function(t,e,n,a){return[function(n){var r=t(this),o=null==n?void 0:n[e];return void 0!==o?o.call(n,r):new RegExp(n)[e](String(r))},function(t){var e=a(n,t,this);if(e.done)return e.value;var u=r(t),s=String(this),c=u.lastIndex;o(c,0)||(u.lastIndex=0);var f=i(u,s);return o(u.lastIndex,c)||(u.lastIndex=c),null===f?-1:f.index}]}))},7742:(t,e,n)=>{"use strict";var r=n(8990),o=n(486),i=n(8713),a=n(178),u=n(8087),s=n(2968),c=n(9020),f=n(5338),l=Math.min,d=[].push,h="split",p="length",v="lastIndex",g=4294967295,m=!f((function(){RegExp(g,"y")}));n(6719)("split",2,(function(t,e,n,f){var y;return y="c"=="abbc"[h](/(b)*/)[1]||4!="test"[h](/(?:)/,-1)[p]||2!="ab"[h](/(?:ab)*/)[p]||4!="."[h](/(.?)(.?)/)[p]||"."[h](/()()/)[p]>1||""[h](/.?/)[p]?function(t,e){var o=String(this);if(void 0===t&&0===e)return[];if(!r(t))return n.call(o,t,e);for(var i,a,u,s=[],f=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),l=0,h=void 0===e?g:e>>>0,m=new RegExp(t.source,f+"g");(i=c.call(m,o))&&!((a=m[v])>l&&(s.push(o.slice(l,i.index)),i[p]>1&&i.index<o[p]&&d.apply(s,i.slice(1)),u=i[0][p],l=a,s[p]>=h));)m[v]===i.index&&m[v]++;return l===o[p]?!u&&m.test("")||s.push(""):s.push(o.slice(l)),s[p]>h?s.slice(0,h):s}:"0"[h](void 0,0)[p]?function(t,e){return void 0===t&&0===e?[]:n.call(this,t,e)}:n,[function(n,r){var o=t(this),i=null==n?void 0:n[e];return void 0!==i?i.call(n,o,r):y.call(String(o),n,r)},function(t,e){var r=f(y,t,this,e,y!==n);if(r.done)return r.value;var c=o(t),d=String(this),h=i(c,RegExp),p=c.unicode,v=(c.ignoreCase?"i":"")+(c.multiline?"m":"")+(c.unicode?"u":"")+(m?"y":"g"),b=new h(m?c:"^(?:"+c.source+")",v),w=void 0===e?g:e>>>0;if(0===w)return[];if(0===d.length)return null===s(b,d)?[d]:[];for(var E=0,x=0,_=[];x<d.length;){b.lastIndex=m?x:0;var S,A=s(b,m?d:d.slice(x));if(null===A||(S=l(u(b.lastIndex+(m?0:x)),d.length))===E)x=a(d,x,p);else{if(_.push(d.slice(E,x)),_.length===w)return _;for(var I=1;I<=A.length-1;I++)if(_.push(A[I]),_.length===w)return _;x=E=S}}return _.push(d.slice(E)),_}]}))},6408:(t,e,n)=>{"use strict";n(8686);var r=n(486),o=n(3649),i=n(1216),a="toString",u=/./[a],s=function(t){n(6476)(RegExp.prototype,a,t,!0)};n(5338)((function(){return"/a/b"!=u.call({source:"a",flags:"b"})}))?s((function(){var t=r(this);return"/".concat(t.source,"/","flags"in t?t.flags:!i&&t instanceof RegExp?o.call(t):void 0)})):u.name!=a&&s((function(){return u.call(this)}))},429:(t,e,n)=>{"use strict";var r=n(3050),o=n(4664);t.exports=n(859)("Set",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(t){return r.def(o(this,"Set"),t=0===t?0:t,t)}},r)},3157:(t,e,n)=>{"use strict";n(5264)("anchor",(function(t){return function(e){return t(this,"a","name",e)}}))},9791:(t,e,n)=>{"use strict";n(5264)("big",(function(t){return function(){return t(this,"big","","")}}))},2296:(t,e,n)=>{"use strict";n(5264)("blink",(function(t){return function(){return t(this,"blink","","")}}))},4555:(t,e,n)=>{"use strict";n(5264)("bold",(function(t){return function(){return t(this,"b","","")}}))},8316:(t,e,n)=>{"use strict";var r=n(7044),o=n(8016)(!1);r(r.P,"String",{codePointAt:function(t){return o(this,t)}})},7937:(t,e,n)=>{"use strict";var r=n(7044),o=n(8087),i=n(5692),a="endsWith",u=""[a];r(r.P+r.F*n(2910)(a),"String",{endsWith:function(t){var e=i(this,t,a),n=arguments.length>1?arguments[1]:void 0,r=o(e.length),s=void 0===n?r:Math.min(o(n),r),c=String(t);return u?u.call(e,c,s):e.slice(s-c.length,s)===c}})},6505:(t,e,n)=>{"use strict";n(5264)("fixed",(function(t){return function(){return t(this,"tt","","")}}))},4722:(t,e,n)=>{"use strict";n(5264)("fontcolor",(function(t){return function(e){return t(this,"font","color",e)}}))},9713:(t,e,n)=>{"use strict";n(5264)("fontsize",(function(t){return function(e){return t(this,"font","size",e)}}))},1028:(t,e,n)=>{var r=n(7044),o=n(9260),i=String.fromCharCode,a=String.fromCodePoint;r(r.S+r.F*(!!a&&1!=a.length),"String",{fromCodePoint:function(t){for(var e,n=[],r=arguments.length,a=0;r>a;){if(e=+arguments[a++],o(e,1114111)!==e)throw RangeError(e+" is not a valid code point");n.push(e<65536?i(e):i(55296+((e-=65536)>>10),e%1024+56320))}return n.join("")}})},637:(t,e,n)=>{"use strict";var r=n(7044),o=n(5692),i="includes";r(r.P+r.F*n(2910)(i),"String",{includes:function(t){return!!~o(this,t,i).indexOf(t,arguments.length>1?arguments[1]:void 0)}})},7392:(t,e,n)=>{"use strict";n(5264)("italics",(function(t){return function(){return t(this,"i","","")}}))},7938:(t,e,n)=>{"use strict";var r=n(8016)(!0);n(966)(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})}))},4687:(t,e,n)=>{"use strict";n(5264)("link",(function(t){return function(e){return t(this,"a","href",e)}}))},6818:(t,e,n)=>{var r=n(7044),o=n(8182),i=n(8087);r(r.S,"String",{raw:function(t){for(var e=o(t.raw),n=i(e.length),r=arguments.length,a=[],u=0;n>u;)a.push(String(e[u++])),u<r&&a.push(String(arguments[u]));return a.join("")}})},8219:(t,e,n)=>{var r=n(7044);r(r.P,"String",{repeat:n(5458)})},3684:(t,e,n)=>{"use strict";n(5264)("small",(function(t){return function(){return t(this,"small","","")}}))},9029:(t,e,n)=>{"use strict";var r=n(7044),o=n(8087),i=n(5692),a="startsWith",u=""[a];r(r.P+r.F*n(2910)(a),"String",{startsWith:function(t){var e=i(this,t,a),n=o(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),r=String(t);return u?u.call(e,r,n):e.slice(n,n+r.length)===r}})},3339:(t,e,n)=>{"use strict";n(5264)("strike",(function(t){return function(){return t(this,"strike","","")}}))},4148:(t,e,n)=>{"use strict";n(5264)("sub",(function(t){return function(){return t(this,"sub","","")}}))},7754:(t,e,n)=>{"use strict";n(5264)("sup",(function(t){return function(){return t(this,"sup","","")}}))},5557:(t,e,n)=>{"use strict";n(4961)("trim",(function(t){return function(){return t(this,3)}}))},2825:(t,e,n)=>{"use strict";var r=n(7571),o=n(7384),i=n(1216),a=n(7044),u=n(6476),s=n(4278).KEY,c=n(5338),f=n(5570),l=n(5837),d=n(4316),h=n(341),p=n(7686),v=n(6262),g=n(6397),m=n(7183),y=n(486),b=n(1255),w=n(7583),E=n(8182),x=n(4467),_=n(8328),S=n(9055),A=n(3473),I=n(5385),T=n(3844),O=n(3886),N=n(9804),D=I.f,M=O.f,k=A.f,R=r.Symbol,C=r.JSON,L=C&&C.stringify,P="prototype",j=h("_hidden"),z=h("toPrimitive"),F={}.propertyIsEnumerable,G=f("symbol-registry"),U=f("symbols"),B=f("op-symbols"),V=Object[P],W="function"==typeof R&&!!T.f,X=r.QObject,H=!X||!X[P]||!X[P].findChild,q=i&&c((function(){return 7!=S(M({},"a",{get:function(){return M(this,"a",{value:7}).a}})).a}))?function(t,e,n){var r=D(V,e);r&&delete V[e],M(t,e,n),r&&t!==V&&M(V,e,r)}:M,Y=function(t){var e=U[t]=S(R[P]);return e._k=t,e},K=W&&"symbol"==typeof R.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof R},Z=function(t,e,n){return t===V&&Z(B,e,n),y(t),e=x(e,!0),y(n),o(U,e)?(n.enumerable?(o(t,j)&&t[j][e]&&(t[j][e]=!1),n=S(n,{enumerable:_(0,!1)})):(o(t,j)||M(t,j,_(1,{})),t[j][e]=!0),q(t,e,n)):M(t,e,n)},$=function(t,e){y(t);for(var n,r=g(e=E(e)),o=0,i=r.length;i>o;)Z(t,n=r[o++],e[n]);return t},Q=function(t){var e=F.call(this,t=x(t,!0));return!(this===V&&o(U,t)&&!o(B,t))&&(!(e||!o(this,t)||!o(U,t)||o(this,j)&&this[j][t])||e)},J=function(t,e){if(t=E(t),e=x(e,!0),t!==V||!o(U,e)||o(B,e)){var n=D(t,e);return!n||!o(U,e)||o(t,j)&&t[j][e]||(n.enumerable=!0),n}},tt=function(t){for(var e,n=k(E(t)),r=[],i=0;n.length>i;)o(U,e=n[i++])||e==j||e==s||r.push(e);return r},et=function(t){for(var e,n=t===V,r=k(n?B:E(t)),i=[],a=0;r.length>a;)!o(U,e=r[a++])||n&&!o(V,e)||i.push(U[e]);return i};W||(u((R=function(){if(this instanceof R)throw TypeError("Symbol is not a constructor!");var t=d(arguments.length>0?arguments[0]:void 0),e=function(n){this===V&&e.call(B,n),o(this,j)&&o(this[j],t)&&(this[j][t]=!1),q(this,t,_(1,n))};return i&&H&&q(V,t,{configurable:!0,set:e}),Y(t)})[P],"toString",(function(){return this._k})),I.f=J,O.f=Z,n(6907).f=A.f=tt,n(4179).f=Q,T.f=et,i&&!n(2725)&&u(V,"propertyIsEnumerable",Q,!0),p.f=function(t){return Y(h(t))}),a(a.G+a.W+a.F*!W,{Symbol:R});for(var nt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),rt=0;nt.length>rt;)h(nt[rt++]);for(var ot=N(h.store),it=0;ot.length>it;)v(ot[it++]);a(a.S+a.F*!W,"Symbol",{for:function(t){return o(G,t+="")?G[t]:G[t]=R(t)},keyFor:function(t){if(!K(t))throw TypeError(t+" is not a symbol!");for(var e in G)if(G[e]===t)return e},useSetter:function(){H=!0},useSimple:function(){H=!1}}),a(a.S+a.F*!W,"Object",{create:function(t,e){return void 0===e?S(t):$(S(t),e)},defineProperty:Z,defineProperties:$,getOwnPropertyDescriptor:J,getOwnPropertyNames:tt,getOwnPropertySymbols:et});var at=c((function(){T.f(1)}));a(a.S+a.F*at,"Object",{getOwnPropertySymbols:function(t){return T.f(w(t))}}),C&&a(a.S+a.F*(!W||c((function(){var t=R();return"[null]"!=L([t])||"{}"!=L({a:t})||"{}"!=L(Object(t))}))),"JSON",{stringify:function(t){for(var e,n,r=[t],o=1;arguments.length>o;)r.push(arguments[o++]);if(n=e=r[1],(b(e)||void 0!==t)&&!K(t))return m(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!K(e))return e}),r[1]=e,L.apply(C,r)}}),R[P][z]||n(913)(R[P],z,R[P].valueOf),l(R,"Symbol"),l(Math,"Math",!0),l(r.JSON,"JSON",!0)},6349:(t,e,n)=>{"use strict";var r=n(7044),o=n(604),i=n(1541),a=n(486),u=n(9260),s=n(8087),c=n(1255),f=n(7571).ArrayBuffer,l=n(8713),d=i.ArrayBuffer,h=i.DataView,p=o.ABV&&f.isView,v=d.prototype.slice,g=o.VIEW,m="ArrayBuffer";r(r.G+r.W+r.F*(f!==d),{ArrayBuffer:d}),r(r.S+r.F*!o.CONSTR,m,{isView:function(t){return p&&p(t)||c(t)&&g in t}}),r(r.P+r.U+r.F*n(5338)((function(){return!new d(2).slice(1,void 0).byteLength})),m,{slice:function(t,e){if(void 0!==v&&void 0===e)return v.call(a(this),t);for(var n=a(this).byteLength,r=u(t,n),o=u(void 0===e?n:e,n),i=new(l(this,d))(s(o-r)),c=new h(this),f=new h(i),p=0;r<o;)f.setUint8(p++,c.getUint8(r++));return i}}),n(4412)(m)},3742:(t,e,n)=>{var r=n(7044);r(r.G+r.W+r.F*!n(604).ABV,{DataView:n(1541).DataView})},3421:(t,e,n)=>{n(1063)("Float32",4,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},6144:(t,e,n)=>{n(1063)("Float64",8,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},9363:(t,e,n)=>{n(1063)("Int16",2,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},8632:(t,e,n)=>{n(1063)("Int32",4,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},9604:(t,e,n)=>{n(1063)("Int8",1,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},3871:(t,e,n)=>{n(1063)("Uint16",2,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},1838:(t,e,n)=>{n(1063)("Uint32",4,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},2592:(t,e,n)=>{n(1063)("Uint8",1,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},9290:(t,e,n)=>{n(1063)("Uint8",1,(function(t){return function(e,n,r){return t(this,e,n,r)}}),!0)},2214:(t,e,n)=>{"use strict";var r,o=n(7571),i=n(7622)(0),a=n(6476),u=n(4278),s=n(4643),c=n(1990),f=n(1255),l=n(4664),d=n(4664),h=!o.ActiveXObject&&"ActiveXObject"in o,p="WeakMap",v=u.getWeak,g=Object.isExtensible,m=c.ufstore,y=function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},b={get:function(t){if(f(t)){var e=v(t);return!0===e?m(l(this,p)).get(t):e?e[this._i]:void 0}},set:function(t,e){return c.def(l(this,p),t,e)}},w=t.exports=n(859)(p,y,b,c,!0,!0);d&&h&&(s((r=c.getConstructor(y,p)).prototype,b),u.NEED=!0,i(["delete","has","get","set"],(function(t){var e=w.prototype,n=e[t];a(e,t,(function(e,o){if(f(e)&&!g(e)){this._f||(this._f=new r);var i=this._f[t](e,o);return"set"==t?this:i}return n.call(this,e,o)}))})))},498:(t,e,n)=>{"use strict";var r=n(1990),o=n(4664),i="WeakSet";n(859)(i,(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(t){return r.def(o(this,i),t,!0)}},r,!1,!0)},7744:(t,e,n)=>{"use strict";var r=n(7044),o=n(6806),i=n(7583),a=n(8087),u=n(1464),s=n(6699);r(r.P,"Array",{flatMap:function(t){var e,n,r=i(this);return u(t),e=a(r.length),n=s(r,0),o(n,r,r,e,0,1,t,arguments[1]),n}}),n(4691)("flatMap")},5448:(t,e,n)=>{"use strict";var r=n(7044),o=n(4538)(!0);r(r.P,"Array",{includes:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),n(4691)("includes")},8938:(t,e,n)=>{var r=n(7044),o=n(6460)(!0);r(r.S,"Object",{entries:function(t){return o(t)}})},7819:(t,e,n)=>{var r=n(7044),o=n(8125),i=n(8182),a=n(5385),u=n(1395);r(r.S,"Object",{getOwnPropertyDescriptors:function(t){for(var e,n,r=i(t),s=a.f,c=o(r),f={},l=0;c.length>l;)void 0!==(n=s(r,e=c[l++]))&&u(f,e,n);return f}})},6572:(t,e,n)=>{var r=n(7044),o=n(6460)(!1);r(r.S,"Object",{values:function(t){return o(t)}})},8228:(t,e,n)=>{"use strict";var r=n(7044),o=n(2845),i=n(7571),a=n(8713),u=n(909);r(r.P+r.R,"Promise",{finally:function(t){var e=a(this,o.Promise||i.Promise),n="function"==typeof t;return this.then(n?function(n){return u(e,t()).then((function(){return n}))}:t,n?function(n){return u(e,t()).then((function(){throw n}))}:t)}})},3336:(t,e,n)=>{"use strict";var r=n(7044),o=n(8261),i=n(2541),a=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(i);r(r.P+r.F*a,"String",{padEnd:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0,!1)}})},3718:(t,e,n)=>{"use strict";var r=n(7044),o=n(8261),i=n(2541),a=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(i);r(r.P+r.F*a,"String",{padStart:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0,!0)}})},7831:(t,e,n)=>{"use strict";n(4961)("trimLeft",(function(t){return function(){return t(this,1)}}),"trimStart")},6642:(t,e,n)=>{"use strict";n(4961)("trimRight",(function(t){return function(){return t(this,2)}}),"trimEnd")},9956:(t,e,n)=>{n(6262)("asyncIterator")},4367:(t,e,n)=>{for(var r=n(163),o=n(9804),i=n(6476),a=n(7571),u=n(913),s=n(9740),c=n(341),f=c("iterator"),l=c("toStringTag"),d=s.Array,h={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},p=o(h),v=0;v<p.length;v++){var g,m=p[v],y=h[m],b=a[m],w=b&&b.prototype;if(w&&(w[f]||u(w,f,d),w[l]||u(w,l,m),s[m]=d,y))for(g in r)w[g]||i(w,g,r[g],!0)}},4433:(t,e,n)=>{var r=n(7044),o=n(7225);r(r.G+r.B,{setImmediate:o.set,clearImmediate:o.clear})},110:(t,e,n)=>{var r=n(7571),o=n(7044),i=n(2541),a=[].slice,u=/MSIE .\./.test(i),s=function(t){return function(e,n){var r=arguments.length>2,o=!!r&&a.call(arguments,2);return t(r?function(){("function"==typeof e?e:Function(e)).apply(this,o)}:e,n)}};o(o.G+o.B+o.F*u,{setTimeout:s(r.setTimeout),setInterval:s(r.setInterval)})},4962:(t,e,n)=>{n(110),n(4433),n(4367),t.exports=n(2845)},1869:(t,e,n)=>{var r=n(3152).Symbol;t.exports=r},6756:(t,e,n)=>{var r=n(1869),o=n(2533),i=n(4702),a=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?o(t):i(t)}},766:(t,e,n)=>{var r=n(6756),o=n(1156),i=n(3913),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exports=function(t){return i(t)&&o(t.length)&&!!a[r(t)]}},8342:t=>{t.exports=function(t){return function(e){return t(e)}}},7675:(t,e,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=r},9217:(t,e,n)=>{var r=n(1030)(Object.getPrototypeOf,Object);t.exports=r},2533:(t,e,n)=>{var r=n(1869),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,u=r?r.toStringTag:void 0;t.exports=function(t){var e=i.call(t,u),n=t[u];try{t[u]=void 0;var r=!0}catch(t){}var o=a.call(t);return r&&(e?t[u]=n:delete t[u]),o}},2495:(t,e,n)=>{t=n.nmd(t);var r=n(7675),o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,a=i&&i.exports===o&&r.process,u=function(){try{return i&&i.require&&i.require("util").types||a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=u},4702:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},1030:t=>{t.exports=function(t,e){return function(n){return t(e(n))}}},3152:(t,e,n)=>{var r=n(7675),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i},744:t=>{var e=Array.isArray;t.exports=e},1156:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},8868:(t,e,n)=>{var r=n(6756),o=n(3913);t.exports=function(t){return"number"==typeof t||o(t)&&"[object Number]"==r(t)}},3913:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},9308:(t,e,n)=>{var r=n(6756),o=n(9217),i=n(3913),a=Function.prototype,u=Object.prototype,s=a.toString,c=u.hasOwnProperty,f=s.call(Object);t.exports=function(t){if(!i(t)||"[object Object]"!=r(t))return!1;var e=o(t);if(null===e)return!0;var n=c.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&s.call(n)==f}},8397:(t,e,n)=>{var r=n(766),o=n(8342),i=n(2495),a=i&&i.isTypedArray,u=a?o(a):r;t.exports=u},8246:t=>{var e=function(t){"use strict";var e,n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),u=new D(r||[]);return o(a,"_invoke",{value:I(t,n,u)}),a}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=f;var d="suspendedStart",h="suspendedYield",p="executing",v="completed",g={};function m(){}function y(){}function b(){}var w={};c(w,a,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(M([])));x&&x!==n&&r.call(x,a)&&(w=x);var _=b.prototype=m.prototype=Object.create(w);function S(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function n(o,i,a,u){var s=l(t[o],t,i);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==typeof f&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,u)}))}u(s.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function I(t,e,n){var r=d;return function(o,i){if(r===p)throw new Error("Generator is already running");if(r===v){if("throw"===o)throw i;return k()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=T(a,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var s=l(t,e,n);if("normal"===s.type){if(r=n.done?v:h,s.arg===g)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r=v,n.method="throw",n.arg=s.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=l(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function M(t){if(t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}return{next:k}}function k(){return{value:e,done:!0}}return y.prototype=b,o(_,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:y,configurable:!0}),y.displayName=c(b,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,s,"GeneratorFunction")),t.prototype=Object.create(_),t},t.awrap=function(t){return{__await:t}},S(A.prototype),c(A.prototype,u,(function(){return this})),t.AsyncIterator=A,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new A(f(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(_),c(_,s,"Generator"),c(_,a,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=M,D.prototype={constructor:D,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(N),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return u.type="throw",u.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),N(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;N(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},6377:function(t){t.exports=function(){"use strict";var t=function(t){return t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Float32Array||t instanceof Float64Array||t instanceof Uint8ClampedArray},e=function(t,e){for(var n=Object.keys(e),r=0;r<n.length;++r)t[n[r]]=e[n[r]];return t},n="\n";function r(t){var e=new Error("(regl) "+t);throw console.error(e),e}function o(t,e){t||r(e)}function i(t){return t?": "+t:""}function a(t,e){switch(e){case"number":return"number"==typeof t;case"object":return"object"==typeof t;case"string":return"string"==typeof t;case"boolean":return"boolean"==typeof t;case"function":return"function"==typeof t;case"undefined":return void 0===t;case"symbol":return"symbol"==typeof t}}function u(t,e,n){e.indexOf(t)<0&&r("invalid value"+i(n)+". must be one of: "+e)}var s=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function c(t,e){for(t+="";t.length<e;)t=" "+t;return t}function f(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function l(t,e){this.number=t,this.line=e,this.errors=[]}function d(t,e,n){this.file=t,this.line=e,this.message=n}function h(){var t=new Error,e=(t.stack||t).toString(),n=/compileProcedure.*\n\s*at.*\((.*)\)/.exec(e);if(n)return n[1];var r=/compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(e);return r?r[1]:"unknown"}function p(){var t=new Error,e=(t.stack||t).toString(),n=/at REGLCommand.*\n\s+at.*\((.*)\)/.exec(e);if(n)return n[1];var r=/at REGLCommand.*\n\s+at\s+(.*)\n/.exec(e);return r?r[1]:"unknown"}function v(t,e){var n,r=t.split("\n"),o=1,i=0,a={unknown:new f,0:new f};a.unknown.name=a[0].name=e||h(),a.unknown.lines.push(new l(0,""));for(var u=0;u<r.length;++u){var s=r[u],c=/^\s*#\s*(\w+)\s+(.+)\s*$/.exec(s);if(c)switch(c[1]){case"line":var d=/(\d+)(\s+\d+)?/.exec(c[2]);d&&(o=0|d[1],d[2]&&((i=0|d[2])in a||(a[i]=new f)));break;case"define":var p=/SHADER_NAME(_B64)?\s+(.*)$/.exec(c[2]);p&&(a[i].name=p[1]?(n=p[2],"undefined"!=typeof atob?atob(n):"base64:"+n):p[2])}a[i].lines.push(new l(o++,s))}return Object.keys(a).forEach((function(t){var e=a[t];e.lines.forEach((function(t){e.index[t.number]=t}))})),a}function g(t){t._commandRef=h()}function m(t,e){var n=p();r(t+" in command "+(e||h())+("unknown"===n?"":" called from "+n))}function y(t,e,n,r){a(t,e)||m("invalid parameter type"+i(n)+". expected "+e+", got "+typeof t,r||h())}var b=33071,w=32819,E=32820,x=33635,_=34042,S={};function A(t,e){return t===E||t===w||t===x?2:t===_?4:S[t]*e}function I(t){return!(t&t-1||!t)}S[5120]=S[5121]=1,S[5122]=S[5123]=S[36193]=S[x]=S[w]=S[E]=2,S[5124]=S[5125]=S[5126]=S[_]=4;var T=e(o,{optional:function(t){t()},raise:r,commandRaise:m,command:function(t,e,n){t||m(e,n||h())},parameter:function(t,e,n){t in e||r("unknown parameter ("+t+")"+i(n)+". possible values: "+Object.keys(e).join())},commandParameter:function(t,e,n,r){t in e||m("unknown parameter ("+t+")"+i(n)+". possible values: "+Object.keys(e).join(),r||h())},constructor:function(t){Object.keys(t).forEach((function(t){s.indexOf(t)<0&&r('invalid regl constructor argument "'+t+'". must be one of '+s)}))},type:function(t,e,n){a(t,e)||r("invalid parameter type"+i(n)+". expected "+e+", got "+typeof t)},commandType:y,isTypedArray:function(e,n){t(e)||r("invalid parameter type"+i(n)+". must be a typed array")},nni:function(t,e){t>=0&&(0|t)===t||r("invalid parameter type, ("+t+")"+i(e)+". must be a nonnegative integer")},oneOf:u,shaderError:function(t,e,r,i,a){if(!t.getShaderParameter(e,t.COMPILE_STATUS)){var u=t.getShaderInfoLog(e),s=i===t.FRAGMENT_SHADER?"fragment":"vertex";y(r,"string",s+" shader source must be a string",a);var f=v(r,a),l=function(t){var e=[];return t.split("\n").forEach((function(t){if(!(t.length<5)){var n=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(t);n?e.push(new d(0|n[1],0|n[2],n[3].trim())):t.length>0&&e.push(new d("unknown",0,t))}})),e}(u);(function(t,e){e.forEach((function(e){var n=t[e.file];if(n){var r=n.index[e.line];if(r)return r.errors.push(e),void(n.hasErrors=!0)}t.unknown.hasErrors=!0,t.unknown.lines[0].errors.push(e)}))})(f,l),Object.keys(f).forEach((function(t){var e=f[t];if(e.hasErrors){var r=[""],o=[""];i("file number "+t+": "+e.name+"\n","color:red;text-decoration:underline;font-weight:bold"),e.lines.forEach((function(t){if(t.errors.length>0){i(c(t.number,4)+"| ","background-color:yellow; font-weight:bold"),i(t.line+n,"color:red; background-color:yellow; font-weight:bold");var e=0;t.errors.forEach((function(r){var o=r.message,a=/^\s*'(.*)'\s*:\s*(.*)$/.exec(o);if(a){var u=a[1];o=a[2],"assign"===u&&(u="="),e=Math.max(t.line.indexOf(u,e),0)}else e=0;i(c("| ",6)),i(c("^^^",e+3)+n,"font-weight:bold"),i(c("| ",6)),i(o+n,"font-weight:bold")})),i(c("| ",6)+n)}else i(c(t.number,4)+"| "),i(t.line+n,"color:red")})),"undefined"==typeof document||window.chrome?console.log(r.join("")):(o[0]=r.join("%c"),console.log.apply(console,o))}function i(t,e){r.push(t),o.push(e||"")}})),o.raise("Error compiling "+s+" shader, "+f[0].name)}},linkError:function(t,e,r,i,a){if(!t.getProgramParameter(e,t.LINK_STATUS)){var u=t.getProgramInfoLog(e),s=v(r,a),c='Error linking program with vertex shader, "'+v(i,a)[0].name+'", and fragment shader "'+s[0].name+'"';"undefined"!=typeof document?console.log("%c"+c+"\n%c"+u,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(c+n+u),o.raise(c)}},callSite:p,saveCommandRef:g,saveDrawInfo:function(t,e,n,r){function o(t){return t?r.id(t):0}function i(t,e){Object.keys(e).forEach((function(e){t[r.id(e)]=!0}))}g(t),t._fragId=o(t.static.frag),t._vertId=o(t.static.vert);var a=t._uniformSet={};i(a,e.static),i(a,e.dynamic);var u=t._attributeSet={};i(u,n.static),i(u,n.dynamic),t._hasCount="count"in t.static||"count"in t.dynamic||"elements"in t.static||"elements"in t.dynamic},framebufferFormat:function(t,e,n){t.texture?u(t.texture._texture.internalformat,e,"unsupported texture format for attachment"):u(t.renderbuffer._renderbuffer.format,n,"unsupported renderbuffer format for attachment")},guessCommand:h,texture2D:function(t,e,n){var r,i=e.width,a=e.height,u=e.channels;o(i>0&&i<=n.maxTextureSize&&a>0&&a<=n.maxTextureSize,"invalid texture shape"),t.wrapS===b&&t.wrapT===b||o(I(i)&&I(a),"incompatible wrap mode for texture, both width and height must be power of 2"),1===e.mipmask?1!==i&&1!==a&&o(9984!==t.minFilter&&9986!==t.minFilter&&9985!==t.minFilter&&9987!==t.minFilter,"min filter requires mipmap"):(o(I(i)&&I(a),"texture must be a square power of 2 to support mipmapping"),o(e.mipmask===(i<<1)-1,"missing or incomplete mipmap data")),5126===e.type&&(n.extensions.indexOf("oes_texture_float_linear")<0&&o(9728===t.minFilter&&9728===t.magFilter,"filter not supported, must enable oes_texture_float_linear"),o(!t.genMipmaps,"mipmap generation not supported with float textures"));var s=e.images;for(r=0;r<16;++r)if(s[r]){var c=i>>r,f=a>>r;o(e.mipmask&1<<r,"missing mipmap data");var l=s[r];if(o(l.width===c&&l.height===f,"invalid shape for mip images"),o(l.format===e.format&&l.internalformat===e.internalformat&&l.type===e.type,"incompatible type for mip image"),l.compressed);else if(l.data){var d=Math.ceil(A(l.type,u)*c/l.unpackAlignment)*l.unpackAlignment;o(l.data.byteLength===d*f,"invalid data for image, buffer size is inconsistent with image format")}else l.element||l.copy}else t.genMipmaps||o(0==(e.mipmask&1<<r),"extra mipmap data");e.compressed&&o(!t.genMipmaps,"mipmap generation for compressed images not supported")},textureCube:function(t,e,n,r){var i=t.width,a=t.height,u=t.channels;o(i>0&&i<=r.maxTextureSize&&a>0&&a<=r.maxTextureSize,"invalid texture shape"),o(i===a,"cube map must be square"),o(e.wrapS===b&&e.wrapT===b,"wrap mode not supported by cube map");for(var s=0;s<n.length;++s){var c=n[s];o(c.width===i&&c.height===a,"inconsistent cube map face shape"),e.genMipmaps&&(o(!c.compressed,"can not generate mipmap for compressed textures"),o(1===c.mipmask,"can not specify mipmaps and generate mipmaps"));for(var f=c.images,l=0;l<16;++l){var d=f[l];if(d){var h=i>>l,p=a>>l;o(c.mipmask&1<<l,"missing mipmap data"),o(d.width===h&&d.height===p,"invalid shape for mip images"),o(d.format===t.format&&d.internalformat===t.internalformat&&d.type===t.type,"incompatible type for mip image"),d.compressed||(d.data?o(d.data.byteLength===h*p*Math.max(A(d.type,u),d.unpackAlignment),"invalid data for image, buffer size is inconsistent with image format"):d.element||d.copy)}}}}}),O=0;function N(t,e){this.id=O++,this.type=t,this.data=e}function D(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function M(t){if(0===t.length)return[];var e=t.charAt(0),n=t.charAt(t.length-1);if(t.length>1&&e===n&&('"'===e||"'"===e))return['"'+D(t.substr(1,t.length-2))+'"'];var r=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(t);if(r)return M(t.substr(0,r.index)).concat(M(r[1])).concat(M(t.substr(r.index+r[0].length)));var o=t.split(".");if(1===o.length)return['"'+D(t)+'"'];for(var i=[],a=0;a<o.length;++a)i=i.concat(M(o[a]));return i}function k(t){return"["+M(t).join("][")+"]"}var R={DynamicVariable:N,define:function(t,e){return new N(t,k(e+""))},isDynamic:function(t){return"function"==typeof t&&!t._reglType||t instanceof N},unbox:function t(e,n){return"function"==typeof e?new N(0,e):"number"==typeof e||"boolean"==typeof e?new N(5,e):Array.isArray(e)?new N(6,e.map(((e,r)=>t(e,n+"["+r+"]")))):e instanceof N?e:void T(!1,"invalid option type in uniform "+n)},accessor:k},C={next:"function"==typeof requestAnimationFrame?function(t){return requestAnimationFrame(t)}:function(t){return setTimeout(t,16)},cancel:"function"==typeof cancelAnimationFrame?function(t){return cancelAnimationFrame(t)}:clearTimeout},L="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date};function P(t){return"string"==typeof t?t.split():(T(Array.isArray(t),"invalid extension array"),t)}function j(t){return"string"==typeof t?(T("undefined"!=typeof document,"not supported outside of DOM"),document.querySelector(t)):t}function z(t){var n,r,o,i,a,u=t||{},s={},c=[],f=[],l="undefined"==typeof window?1:window.devicePixelRatio,d=!1,h=function(t){t&&T.raise(t)},p=function(){};if("string"==typeof u?(T("undefined"!=typeof document,"selector queries only supported in DOM enviroments"),n=document.querySelector(u),T(n,"invalid query string for element")):"object"==typeof u?"string"==typeof(a=u).nodeName&&"function"==typeof a.appendChild&&"function"==typeof a.getBoundingClientRect?n=u:function(t){return"function"==typeof t.drawArrays||"function"==typeof t.drawElements}(u)?o=(i=u).canvas:(T.constructor(u),"gl"in u?i=u.gl:"canvas"in u?o=j(u.canvas):"container"in u&&(r=j(u.container)),"attributes"in u&&(s=u.attributes,T.type(s,"object","invalid context attributes")),"extensions"in u&&(c=P(u.extensions)),"optionalExtensions"in u&&(f=P(u.optionalExtensions)),"onDone"in u&&(T.type(u.onDone,"function","invalid or missing onDone callback"),h=u.onDone),"profile"in u&&(d=!!u.profile),"pixelRatio"in u&&(l=+u.pixelRatio,T(l>0,"invalid pixel ratio"))):T.raise("invalid arguments to regl"),n&&("canvas"===n.nodeName.toLowerCase()?o=n:r=n),!i){if(!o){T("undefined"!=typeof document,"must manually specify webgl context outside of DOM environments");var v=function(t,n,r){var o,i=document.createElement("canvas");function a(){var n=window.innerWidth,o=window.innerHeight;if(t!==document.body){var a=t.getBoundingClientRect();n=a.right-a.left,o=a.bottom-a.top}i.width=r*n,i.height=r*o,e(i.style,{width:n+"px",height:o+"px"})}return e(i.style,{border:0,margin:0,padding:0,top:0,left:0}),t.appendChild(i),t===document.body&&(i.style.position="absolute",e(t.style,{margin:0,padding:0})),t!==document.body&&"function"==typeof ResizeObserver?(o=new ResizeObserver((function(){setTimeout(a)}))).observe(t):window.addEventListener("resize",a,!1),a(),{canvas:i,onDestroy:function(){o?o.disconnect():window.removeEventListener("resize",a),t.removeChild(i)}}}(r||document.body,0,l);if(!v)return null;o=v.canvas,p=v.onDestroy}void 0===s.premultipliedAlpha&&(s.premultipliedAlpha=!0),i=function(t,e){function n(n){try{return t.getContext(n,e)}catch(t){return null}}return n("webgl")||n("experimental-webgl")||n("webgl-experimental")}(o,s)}return i?{gl:i,canvas:o,container:r,extensions:c,optionalExtensions:f,pixelRatio:l,profile:d,onDone:h,onDestroy:p}:(p(),h("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function F(t,e){for(var n=Array(t),r=0;r<t;++r)n[r]=e(r);return n}function G(t){var e,n;return e=(t>65535)<<4,e|=n=((t>>>=e)>255)<<3,e|=n=((t>>>=n)>15)<<2,(e|=n=((t>>>=n)>3)<<1)|(t>>>=n)>>1}function U(){var t=F(8,(function(){return[]}));function e(e){var n=function(t){for(var e=16;e<=1<<28;e*=16)if(t<=e)return e;return 0}(e),r=t[G(n)>>2];return r.length>0?r.pop():new ArrayBuffer(n)}function n(e){t[G(e.byteLength)>>2].push(e)}return{alloc:e,free:n,allocType:function(t,n){var r=null;switch(t){case 5120:r=new Int8Array(e(n),0,n);break;case 5121:r=new Uint8Array(e(n),0,n);break;case 5122:r=new Int16Array(e(2*n),0,n);break;case 5123:r=new Uint16Array(e(2*n),0,n);break;case 5124:r=new Int32Array(e(4*n),0,n);break;case 5125:r=new Uint32Array(e(4*n),0,n);break;case 5126:r=new Float32Array(e(4*n),0,n);break;default:return null}return r.length!==n?r.subarray(0,n):r},freeType:function(t){n(t.buffer)}}}var B=U();B.zero=U();var V=3553,W=6408,X=5126,H=36160;function q(e){return!!e&&"object"==typeof e&&Array.isArray(e.shape)&&Array.isArray(e.stride)&&"number"==typeof e.offset&&e.shape.length===e.stride.length&&(Array.isArray(e.data)||t(e.data))}var Y=function(t){return Object.keys(t).map((function(e){return t[e]}))},K={shape:function(t){for(var e=[],n=t;n.length;n=n[0])e.push(n.length);return e},flatten:function(t,e,n,r){var o=1;if(e.length)for(var i=0;i<e.length;++i)o*=e[i];else o=0;var a=r||B.allocType(n,o);switch(e.length){case 0:break;case 1:!function(t,e,n){for(var r=0;r<e;++r)n[r]=t[r]}(t,e[0],a);break;case 2:!function(t,e,n,r){for(var o=0,i=0;i<e;++i)for(var a=t[i],u=0;u<n;++u)r[o++]=a[u]}(t,e[0],e[1],a);break;case 3:Z(t,e[0],e[1],e[2],a,0);break;default:$(t,e,0,a,0)}return a}};function Z(t,e,n,r,o,i){for(var a=i,u=0;u<e;++u)for(var s=t[u],c=0;c<n;++c)for(var f=s[c],l=0;l<r;++l)o[a++]=f[l]}function $(t,e,n,r,o){for(var i=1,a=n+1;a<e.length;++a)i*=e[a];var u=e[n];if(e.length-n==4){var s=e[n+1],c=e[n+2],f=e[n+3];for(a=0;a<u;++a)Z(t[a],s,c,f,r,o),o+=i}else for(a=0;a<u;++a)$(t[a],e,n+1,r,o),o+=i}var Q={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},J={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},tt={dynamic:35048,stream:35040,static:35044},et=K.flatten,nt=K.shape,rt=35044,ot=35040,it=5121,at=5126,ut=[];function st(t){return 0|Q[Object.prototype.toString.call(t)]}function ct(t,e){for(var n=0;n<e.length;++n)t[n]=e[n]}function ft(t,e,n,r,o,i,a){for(var u=0,s=0;s<n;++s)for(var c=0;c<r;++c)t[u++]=e[o*s+i*c+a]}ut[5120]=1,ut[5122]=2,ut[5124]=4,ut[5121]=1,ut[5123]=2,ut[5125]=4,ut[5126]=4;var lt={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},dt=0,ht=1,pt=4,vt=5120,gt=5121,mt=5122,yt=5123,bt=5124,wt=5125,Et=34963,xt=35040,_t=35044;var St=new Float32Array(1),At=new Uint32Array(St.buffer),It=5123;function Tt(t){for(var e=B.allocType(It,t.length),n=0;n<t.length;++n)if(isNaN(t[n]))e[n]=65535;else if(t[n]===1/0)e[n]=31744;else if(t[n]===-1/0)e[n]=64512;else{St[0]=t[n];var r=At[0],o=r>>>31<<15,i=(r<<1>>>24)-127,a=r>>13&1023;if(i<-24)e[n]=o;else if(i<-14){var u=-14-i;e[n]=o+(a+1024>>u)}else e[n]=i>15?o+31744:o+(i+15<<10)+a}return e}function Ot(e){return Array.isArray(e)||t(e)}var Nt=function(t){return!(t&t-1||!t)},Dt=34467,Mt=3553,kt=34067,Rt=34069,Ct=6408,Lt=6406,Pt=6407,jt=6409,zt=6410,Ft=32854,Gt=32855,Ut=36194,Bt=32819,Vt=32820,Wt=33635,Xt=34042,Ht=6402,qt=34041,Yt=35904,Kt=35906,Zt=36193,$t=33776,Qt=33777,Jt=33778,te=33779,ee=35986,ne=35987,re=34798,oe=35840,ie=35841,ae=35842,ue=35843,se=36196,ce=5121,fe=5123,le=5125,de=5126,he=10242,pe=10243,ve=10497,ge=33071,me=33648,ye=10240,be=10241,we=9728,Ee=9729,xe=9984,_e=9985,Se=9986,Ae=9987,Ie=33170,Te=4352,Oe=4353,Ne=4354,De=34046,Me=3317,ke=37440,Re=37441,Ce=37443,Le=37444,Pe=33984,je=[xe,Se,_e,Ae],ze=[0,jt,zt,Pt,Ct],Fe={};function Ge(t){return"[object "+t+"]"}Fe[jt]=Fe[Lt]=Fe[Ht]=1,Fe[qt]=Fe[zt]=2,Fe[Pt]=Fe[Yt]=3,Fe[Ct]=Fe[Kt]=4;var Ue=Ge("HTMLCanvasElement"),Be=Ge("OffscreenCanvas"),Ve=Ge("CanvasRenderingContext2D"),We=Ge("ImageBitmap"),Xe=Ge("HTMLImageElement"),He=Ge("HTMLVideoElement"),qe=Object.keys(Q).concat([Ue,Be,Ve,We,Xe,He]),Ye=[];Ye[ce]=1,Ye[de]=4,Ye[Zt]=2,Ye[fe]=2,Ye[le]=4;var Ke=[];function Ze(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function $e(t){return!!Array.isArray(t)&&!(0===t.length||!Ot(t[0]))}function Qe(t){return Object.prototype.toString.call(t)}function Je(t){return Qe(t)===Ue}function tn(t){return Qe(t)===Be}function en(t){if(!t)return!1;var e=Qe(t);return qe.indexOf(e)>=0||Ze(t)||$e(t)||q(t)}function nn(t){return 0|Q[Object.prototype.toString.call(t)]}function rn(t,e){return B.allocType(t.type===Zt?de:t.type,e)}function on(t,e){t.type===Zt?(t.data=Tt(e),B.freeType(e)):t.data=e}function an(t,e,n,r,o,i){var a;if(a=void 0!==Ke[t]?Ke[t]:Fe[t]*Ye[e],i&&(a*=6),o){for(var u=0,s=n;s>=1;)u+=a*s*s,s/=2;return u}return a*n*r}function un(n,r,o,i,a,u,s){var c={"don't care":Te,"dont care":Te,nice:Ne,fast:Oe},f={repeat:ve,clamp:ge,mirror:me},l={nearest:we,linear:Ee},d=e({mipmap:Ae,"nearest mipmap nearest":xe,"linear mipmap nearest":_e,"nearest mipmap linear":Se,"linear mipmap linear":Ae},l),h={none:0,browser:Le},p={uint8:ce,rgba4:Bt,rgb565:Wt,"rgb5 a1":Vt},v={alpha:Lt,luminance:jt,"luminance alpha":zt,rgb:Pt,rgba:Ct,rgba4:Ft,"rgb5 a1":Gt,rgb565:Ut},g={};r.ext_srgb&&(v.srgb=Yt,v.srgba=Kt),r.oes_texture_float&&(p.float32=p.float=de),r.oes_texture_half_float&&(p.float16=p["half float"]=Zt),r.webgl_depth_texture&&(e(v,{depth:Ht,"depth stencil":qt}),e(p,{uint16:fe,uint32:le,"depth stencil":Xt})),r.webgl_compressed_texture_s3tc&&e(g,{"rgb s3tc dxt1":$t,"rgba s3tc dxt1":Qt,"rgba s3tc dxt3":Jt,"rgba s3tc dxt5":te}),r.webgl_compressed_texture_atc&&e(g,{"rgb atc":ee,"rgba atc explicit alpha":ne,"rgba atc interpolated alpha":re}),r.webgl_compressed_texture_pvrtc&&e(g,{"rgb pvrtc 4bppv1":oe,"rgb pvrtc 2bppv1":ie,"rgba pvrtc 4bppv1":ae,"rgba pvrtc 2bppv1":ue}),r.webgl_compressed_texture_etc1&&(g["rgb etc1"]=se);var m=Array.prototype.slice.call(n.getParameter(Dt));Object.keys(g).forEach((function(t){var e=g[t];m.indexOf(e)>=0&&(v[t]=e)}));var y=Object.keys(v);o.textureFormats=y;var b=[];Object.keys(v).forEach((function(t){var e=v[t];b[e]=t}));var w=[];Object.keys(p).forEach((function(t){var e=p[t];w[e]=t}));var E=[];Object.keys(l).forEach((function(t){var e=l[t];E[e]=t}));var x=[];Object.keys(d).forEach((function(t){var e=d[t];x[e]=t}));var _=[];Object.keys(f).forEach((function(t){var e=f[t];_[e]=t}));var S=y.reduce((function(t,e){var n=v[e];return n===jt||n===Lt||n===jt||n===zt||n===Ht||n===qt||r.ext_srgb&&(n===Yt||n===Kt)?t[n]=n:n===Gt||e.indexOf("rgba")>=0?t[n]=Ct:t[n]=Pt,t}),{});function A(){this.internalformat=Ct,this.format=Ct,this.type=ce,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=Le,this.width=0,this.height=0,this.channels=0}function I(t,e){t.internalformat=e.internalformat,t.format=e.format,t.type=e.type,t.compressed=e.compressed,t.premultiplyAlpha=e.premultiplyAlpha,t.flipY=e.flipY,t.unpackAlignment=e.unpackAlignment,t.colorSpace=e.colorSpace,t.width=e.width,t.height=e.height,t.channels=e.channels}function O(t,e){if("object"==typeof e&&e){if("premultiplyAlpha"in e&&(T.type(e.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),t.premultiplyAlpha=e.premultiplyAlpha),"flipY"in e&&(T.type(e.flipY,"boolean","invalid texture flip"),t.flipY=e.flipY),"alignment"in e&&(T.oneOf(e.alignment,[1,2,4,8],"invalid texture unpack alignment"),t.unpackAlignment=e.alignment),"colorSpace"in e&&(T.parameter(e.colorSpace,h,"invalid colorSpace"),t.colorSpace=h[e.colorSpace]),"type"in e){var n=e.type;T(r.oes_texture_float||!("float"===n||"float32"===n),"you must enable the OES_texture_float extension in order to use floating point textures."),T(r.oes_texture_half_float||!("half float"===n||"float16"===n),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),T(r.webgl_depth_texture||!("uint16"===n||"uint32"===n||"depth stencil"===n),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),T.parameter(n,p,"invalid texture type"),t.type=p[n]}var i=t.width,a=t.height,u=t.channels,s=!1;"shape"in e?(T(Array.isArray(e.shape)&&e.shape.length>=2,"shape must be an array"),i=e.shape[0],a=e.shape[1],3===e.shape.length&&(u=e.shape[2],T(u>0&&u<=4,"invalid number of channels"),s=!0),T(i>=0&&i<=o.maxTextureSize,"invalid width"),T(a>=0&&a<=o.maxTextureSize,"invalid height")):("radius"in e&&(i=a=e.radius,T(i>=0&&i<=o.maxTextureSize,"invalid radius")),"width"in e&&(i=e.width,T(i>=0&&i<=o.maxTextureSize,"invalid width")),"height"in e&&(a=e.height,T(a>=0&&a<=o.maxTextureSize,"invalid height")),"channels"in e&&(u=e.channels,T(u>0&&u<=4,"invalid number of channels"),s=!0)),t.width=0|i,t.height=0|a,t.channels=0|u;var c=!1;if("format"in e){var f=e.format;T(r.webgl_depth_texture||!("depth"===f||"depth stencil"===f),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),T.parameter(f,v,"invalid texture format");var l=t.internalformat=v[f];t.format=S[l],f in p&&("type"in e||(t.type=p[f])),f in g&&(t.compressed=!0),c=!0}!s&&c?t.channels=Fe[t.format]:s&&!c?t.channels!==ze[t.format]&&(t.format=t.internalformat=ze[t.channels]):c&&s&&T(t.channels===Fe[t.format],"number of channels inconsistent with specified format")}}function N(t){n.pixelStorei(ke,t.flipY),n.pixelStorei(Re,t.premultiplyAlpha),n.pixelStorei(Ce,t.colorSpace),n.pixelStorei(Me,t.unpackAlignment)}function D(){A.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function M(e,n){var r=null;if(en(n)?r=n:n&&(T.type(n,"object","invalid pixel data type"),O(e,n),"x"in n&&(e.xOffset=0|n.x),"y"in n&&(e.yOffset=0|n.y),en(n.data)&&(r=n.data)),T(!e.compressed||r instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),n.copy){T(!r,"can not specify copy and data field for the same texture");var i=a.viewportWidth,u=a.viewportHeight;e.width=e.width||i-e.xOffset,e.height=e.height||u-e.yOffset,e.needsCopy=!0,T(e.xOffset>=0&&e.xOffset<i&&e.yOffset>=0&&e.yOffset<u&&e.width>0&&e.width<=i&&e.height>0&&e.height<=u,"copy texture read out of bounds")}else if(r){if(t(r))e.channels=e.channels||4,e.data=r,"type"in n||e.type!==ce||(e.type=nn(r));else if(Ze(r))e.channels=e.channels||4,function(t,e){var n=e.length;switch(t.type){case ce:case fe:case le:case de:var r=B.allocType(t.type,n);r.set(e),t.data=r;break;case Zt:t.data=Tt(e);break;default:T.raise("unsupported texture type, must specify a typed array")}}(e,r),e.alignment=1,e.needsFree=!0;else if(q(r)){var s=r.data;Array.isArray(s)||e.type!==ce||(e.type=nn(s));var c,f,l,d,h,p,v=r.shape,g=r.stride;3===v.length?(l=v[2],p=g[2]):(T(2===v.length,"invalid ndarray pixel data, must be 2 or 3D"),l=1,p=1),c=v[0],f=v[1],d=g[0],h=g[1],e.alignment=1,e.width=c,e.height=f,e.channels=l,e.format=e.internalformat=ze[l],e.needsFree=!0,function(t,e,n,r,o,i){for(var a=t.width,u=t.height,s=t.channels,c=rn(t,a*u*s),f=0,l=0;l<u;++l)for(var d=0;d<a;++d)for(var h=0;h<s;++h)c[f++]=e[n*d+r*l+o*h+i];on(t,c)}(e,s,d,h,p,r.offset)}else if(Je(r)||tn(r)||Qe(r)===Ve)Je(r)||tn(r)?e.element=r:e.element=r.canvas,e.width=e.element.width,e.height=e.element.height,e.channels=4;else if(function(t){return Qe(t)===We}(r))e.element=r,e.width=r.width,e.height=r.height,e.channels=4;else if(function(t){return Qe(t)===Xe}(r))e.element=r,e.width=r.naturalWidth,e.height=r.naturalHeight,e.channels=4;else if(function(t){return Qe(t)===He}(r))e.element=r,e.width=r.videoWidth,e.height=r.videoHeight,e.channels=4;else if($e(r)){var m=e.width||r[0].length,y=e.height||r.length,b=e.channels;b=Ot(r[0][0])?b||r[0][0].length:b||1;for(var w=K.shape(r),E=1,x=0;x<w.length;++x)E*=w[x];var _=rn(e,E);K.flatten(r,w,"",_),on(e,_),e.alignment=1,e.width=m,e.height=y,e.channels=b,e.format=e.internalformat=ze[b],e.needsFree=!0}}else e.width=e.width||1,e.height=e.height||1,e.channels=e.channels||4;e.type===de?T(o.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):e.type===Zt&&T(o.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function k(t,e,r){var o=t.element,a=t.data,u=t.internalformat,s=t.format,c=t.type,f=t.width,l=t.height;N(t),o?n.texImage2D(e,r,s,s,c,o):t.compressed?n.compressedTexImage2D(e,r,u,f,l,0,a):t.needsCopy?(i(),n.copyTexImage2D(e,r,s,t.xOffset,t.yOffset,f,l,0)):n.texImage2D(e,r,s,f,l,0,s,c,a||null)}function R(t,e,r,o,a){var u=t.element,s=t.data,c=t.internalformat,f=t.format,l=t.type,d=t.width,h=t.height;N(t),u?n.texSubImage2D(e,a,r,o,f,l,u):t.compressed?n.compressedTexSubImage2D(e,a,r,o,c,d,h,s):t.needsCopy?(i(),n.copyTexSubImage2D(e,a,r,o,t.xOffset,t.yOffset,d,h)):n.texSubImage2D(e,a,r,o,d,h,f,l,s)}var C=[];function L(){return C.pop()||new D}function P(t){t.needsFree&&B.freeType(t.data),D.call(t),C.push(t)}function j(){A.call(this),this.genMipmaps=!1,this.mipmapHint=Te,this.mipmask=0,this.images=Array(16)}function z(t,e,n){var r=t.images[0]=L();t.mipmask=1,r.width=t.width=e,r.height=t.height=n,r.channels=t.channels=4}function F(t,e){var n=null;if(en(e))I(n=t.images[0]=L(),t),M(n,e),t.mipmask=1;else if(O(t,e),Array.isArray(e.mipmap))for(var r=e.mipmap,o=0;o<r.length;++o)I(n=t.images[o]=L(),t),n.width>>=o,n.height>>=o,M(n,r[o]),t.mipmask|=1<<o;else I(n=t.images[0]=L(),t),M(n,e),t.mipmask=1;I(t,t.images[0]),!t.compressed||t.internalformat!==$t&&t.internalformat!==Qt&&t.internalformat!==Jt&&t.internalformat!==te||T(t.width%4==0&&t.height%4==0,"for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4")}function G(t,e){for(var n=t.images,r=0;r<n.length;++r){if(!n[r])return;k(n[r],e,r)}}var U=[];function V(){var t=U.pop()||new j;A.call(t),t.mipmask=0;for(var e=0;e<16;++e)t.images[e]=null;return t}function W(t){for(var e=t.images,n=0;n<e.length;++n)e[n]&&P(e[n]),e[n]=null;U.push(t)}function X(){this.minFilter=we,this.magFilter=we,this.wrapS=ge,this.wrapT=ge,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=Te}function H(t,e){if("min"in e){var n=e.min;T.parameter(n,d),t.minFilter=d[n],je.indexOf(t.minFilter)>=0&&!("faces"in e)&&(t.genMipmaps=!0)}if("mag"in e){var r=e.mag;T.parameter(r,l),t.magFilter=l[r]}var i=t.wrapS,a=t.wrapT;if("wrap"in e){var u=e.wrap;"string"==typeof u?(T.parameter(u,f),i=a=f[u]):Array.isArray(u)&&(T.parameter(u[0],f),T.parameter(u[1],f),i=f[u[0]],a=f[u[1]])}else{if("wrapS"in e){var s=e.wrapS;T.parameter(s,f),i=f[s]}if("wrapT"in e){var h=e.wrapT;T.parameter(h,f),a=f[h]}}if(t.wrapS=i,t.wrapT=a,"anisotropic"in e){var p=e.anisotropic;T("number"==typeof p&&p>=1&&p<=o.maxAnisotropic,"aniso samples must be between 1 and "),t.anisotropic=e.anisotropic}if("mipmap"in e){var v=!1;switch(typeof e.mipmap){case"string":T.parameter(e.mipmap,c,"invalid mipmap hint"),t.mipmapHint=c[e.mipmap],t.genMipmaps=!0,v=!0;break;case"boolean":v=t.genMipmaps=e.mipmap;break;case"object":T(Array.isArray(e.mipmap),"invalid mipmap type"),t.genMipmaps=!1,v=!0;break;default:T.raise("invalid mipmap type")}v&&!("min"in e)&&(t.minFilter=xe)}}function Z(t,e){n.texParameteri(e,be,t.minFilter),n.texParameteri(e,ye,t.magFilter),n.texParameteri(e,he,t.wrapS),n.texParameteri(e,pe,t.wrapT),r.ext_texture_filter_anisotropic&&n.texParameteri(e,De,t.anisotropic),t.genMipmaps&&(n.hint(Ie,t.mipmapHint),n.generateMipmap(e))}var $=0,Q={},J=o.maxTextureUnits,tt=Array(J).map((function(){return null}));function et(t){A.call(this),this.mipmask=0,this.internalformat=Ct,this.id=$++,this.refCount=1,this.target=t,this.texture=n.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new X,s.profile&&(this.stats={size:0})}function nt(t){n.activeTexture(Pe),n.bindTexture(t.target,t.texture)}function rt(){var t=tt[0];t?n.bindTexture(t.target,t.texture):n.bindTexture(Mt,null)}function ot(t){var e=t.texture;T(e,"must not double destroy texture");var r=t.unit,o=t.target;r>=0&&(n.activeTexture(Pe+r),n.bindTexture(o,null),tt[r]=null),n.deleteTexture(e),t.texture=null,t.params=null,t.pixels=null,t.refCount=0,delete Q[t.id],u.textureCount--}return e(et.prototype,{bind:function(){var t=this;t.bindCount+=1;var e=t.unit;if(e<0){for(var r=0;r<J;++r){var o=tt[r];if(o){if(o.bindCount>0)continue;o.unit=-1}tt[r]=t,e=r;break}e>=J&&T.raise("insufficient number of texture units"),s.profile&&u.maxTextureUnits<e+1&&(u.maxTextureUnits=e+1),t.unit=e,n.activeTexture(Pe+e),n.bindTexture(t.target,t.texture)}return e},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&ot(this)}}),s.profile&&(u.getTotalTextureSize=function(){var t=0;return Object.keys(Q).forEach((function(e){t+=Q[e].stats.size})),t}),{create2D:function(t,e){var r=new et(Mt);function i(t,e){var n=r.texInfo;X.call(n);var a=V();return"number"==typeof t?z(a,0|t,"number"==typeof e?0|e:0|t):t?(T.type(t,"object","invalid arguments to regl.texture"),H(n,t),F(a,t)):z(a,1,1),n.genMipmaps&&(a.mipmask=(a.width<<1)-1),r.mipmask=a.mipmask,I(r,a),T.texture2D(n,a,o),r.internalformat=a.internalformat,i.width=a.width,i.height=a.height,nt(r),G(a,Mt),Z(n,Mt),rt(),W(a),s.profile&&(r.stats.size=an(r.internalformat,r.type,a.width,a.height,n.genMipmaps,!1)),i.format=b[r.internalformat],i.type=w[r.type],i.mag=E[n.magFilter],i.min=x[n.minFilter],i.wrapS=_[n.wrapS],i.wrapT=_[n.wrapT],i}return Q[r.id]=r,u.textureCount++,i(t,e),i.subimage=function(t,e,n,o){T(!!t,"must specify image data");var a=0|e,u=0|n,s=0|o,c=L();return I(c,r),c.width=0,c.height=0,M(c,t),c.width=c.width||(r.width>>s)-a,c.height=c.height||(r.height>>s)-u,T(r.type===c.type&&r.format===c.format&&r.internalformat===c.internalformat,"incompatible format for texture.subimage"),T(a>=0&&u>=0&&a+c.width<=r.width&&u+c.height<=r.height,"texture.subimage write out of bounds"),T(r.mipmask&1<<s,"missing mipmap data"),T(c.data||c.element||c.needsCopy,"missing image data"),nt(r),R(c,Mt,a,u,s),rt(),P(c),i},i.resize=function(t,e){var o=0|t,a=0|e||o;if(o===r.width&&a===r.height)return i;i.width=r.width=o,i.height=r.height=a,nt(r);for(var u=0;r.mipmask>>u;++u){var c=o>>u,f=a>>u;if(!c||!f)break;n.texImage2D(Mt,u,r.format,c,f,0,r.format,r.type,null)}return rt(),s.profile&&(r.stats.size=an(r.internalformat,r.type,o,a,!1,!1)),i},i._reglType="texture2d",i._texture=r,s.profile&&(i.stats=r.stats),i.destroy=function(){r.decRef()},i},createCube:function(t,e,r,i,a,c){var f=new et(kt);Q[f.id]=f,u.cubeCount++;var l=new Array(6);function d(t,e,n,r,i,a){var u,c=f.texInfo;for(X.call(c),u=0;u<6;++u)l[u]=V();if("number"!=typeof t&&t)if("object"==typeof t)if(e)F(l[0],t),F(l[1],e),F(l[2],n),F(l[3],r),F(l[4],i),F(l[5],a);else if(H(c,t),O(f,t),"faces"in t){var h=t.faces;for(T(Array.isArray(h)&&6===h.length,"cube faces must be a length 6 array"),u=0;u<6;++u)T("object"==typeof h[u]&&!!h[u],"invalid input for cube map face"),I(l[u],f),F(l[u],h[u])}else for(u=0;u<6;++u)F(l[u],t);else T.raise("invalid arguments to cube map");else{var p=0|t||1;for(u=0;u<6;++u)z(l[u],p,p)}for(I(f,l[0]),o.npotTextureCube||T(Nt(f.width)&&Nt(f.height),"your browser does not support non power or two texture dimensions"),c.genMipmaps?f.mipmask=(l[0].width<<1)-1:f.mipmask=l[0].mipmask,T.textureCube(f,c,l,o),f.internalformat=l[0].internalformat,d.width=l[0].width,d.height=l[0].height,nt(f),u=0;u<6;++u)G(l[u],Rt+u);for(Z(c,kt),rt(),s.profile&&(f.stats.size=an(f.internalformat,f.type,d.width,d.height,c.genMipmaps,!0)),d.format=b[f.internalformat],d.type=w[f.type],d.mag=E[c.magFilter],d.min=x[c.minFilter],d.wrapS=_[c.wrapS],d.wrapT=_[c.wrapT],u=0;u<6;++u)W(l[u]);return d}return d(t,e,r,i,a,c),d.subimage=function(t,e,n,r,o){T(!!e,"must specify image data"),T("number"==typeof t&&t===(0|t)&&t>=0&&t<6,"invalid face");var i=0|n,a=0|r,u=0|o,s=L();return I(s,f),s.width=0,s.height=0,M(s,e),s.width=s.width||(f.width>>u)-i,s.height=s.height||(f.height>>u)-a,T(f.type===s.type&&f.format===s.format&&f.internalformat===s.internalformat,"incompatible format for texture.subimage"),T(i>=0&&a>=0&&i+s.width<=f.width&&a+s.height<=f.height,"texture.subimage write out of bounds"),T(f.mipmask&1<<u,"missing mipmap data"),T(s.data||s.element||s.needsCopy,"missing image data"),nt(f),R(s,Rt+t,i,a,u),rt(),P(s),d},d.resize=function(t){var e=0|t;if(e!==f.width){d.width=f.width=e,d.height=f.height=e,nt(f);for(var r=0;r<6;++r)for(var o=0;f.mipmask>>o;++o)n.texImage2D(Rt+r,o,f.format,e>>o,e>>o,0,f.format,f.type,null);return rt(),s.profile&&(f.stats.size=an(f.internalformat,f.type,d.width,d.height,!1,!0)),d}},d._reglType="textureCube",d._texture=f,s.profile&&(d.stats=f.stats),d.destroy=function(){f.decRef()},d},clear:function(){for(var t=0;t<J;++t)n.activeTexture(Pe+t),n.bindTexture(Mt,null),tt[t]=null;Y(Q).forEach(ot),u.cubeCount=0,u.textureCount=0},getTexture:function(t){return null},restore:function(){for(var t=0;t<J;++t){var e=tt[t];e&&(e.bindCount=0,e.unit=-1,tt[t]=null)}Y(Q).forEach((function(t){t.texture=n.createTexture(),n.bindTexture(t.target,t.texture);for(var e=0;e<32;++e)if(0!=(t.mipmask&1<<e))if(t.target===Mt)n.texImage2D(Mt,e,t.internalformat,t.width>>e,t.height>>e,0,t.internalformat,t.type,null);else for(var r=0;r<6;++r)n.texImage2D(Rt+r,e,t.internalformat,t.width>>e,t.height>>e,0,t.internalformat,t.type,null);Z(t.texInfo,t.target)}))},refresh:function(){for(var t=0;t<J;++t){var e=tt[t];e&&(e.bindCount=0,e.unit=-1,tt[t]=null),n.activeTexture(Pe+t),n.bindTexture(Mt,null),n.bindTexture(kt,null)}}}}Ke[Ft]=2,Ke[Gt]=2,Ke[Ut]=2,Ke[qt]=4,Ke[$t]=.5,Ke[Qt]=.5,Ke[Jt]=1,Ke[te]=1,Ke[ee]=.5,Ke[ne]=1,Ke[re]=1,Ke[oe]=.5,Ke[ie]=.25,Ke[ae]=.5,Ke[ue]=.25,Ke[se]=.5;var sn=36161,cn=32854,fn=[];function ln(t,e,n){return fn[t]*e*n}fn[32854]=2,fn[32855]=2,fn[36194]=2,fn[33189]=2,fn[36168]=1,fn[34041]=4,fn[35907]=4,fn[34836]=16,fn[34842]=8,fn[34843]=6;var dn=36160,hn=36161,pn=3553,vn=34069,gn=36064,mn=36096,yn=36128,bn=33306,wn=36053,En=6402,xn=[6407,6408],_n=[];_n[6408]=4,_n[6407]=3;var Sn=[];Sn[5121]=1,Sn[5126]=4,Sn[36193]=2;var An=33189,In=36168,Tn=34041,On=[32854,32855,36194,35907,34842,34843,34836],Nn={};Nn[wn]="complete",Nn[36054]="incomplete attachment",Nn[36057]="incomplete dimensions",Nn[36055]="incomplete, missing attachment",Nn[36061]="unsupported";var Dn=5126,Mn=34962;function kn(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=Dn,this.offset=0,this.stride=0,this.divisor=0}var Rn=35632,Cn=35633,Ln=35718,Pn=35721;var jn=6408,zn=5121,Fn=3333,Gn=5126;function Un(e,n,r,o,i,a,u){function s(s){var c;null===n.next?(T(i.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),c=zn):(T(null!==n.next.colorAttachments[0].texture,"You cannot read from a renderbuffer"),c=n.next.colorAttachments[0].texture._texture.type,a.oes_texture_float?(T(c===zn||c===Gn,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),c===Gn&&T(u.readFloat,"Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):T(c===zn,"Reading from a framebuffer is only allowed for the type 'uint8'"));var f=0,l=0,d=o.framebufferWidth,h=o.framebufferHeight,p=null;t(s)?p=s:s&&(T.type(s,"object","invalid arguments to regl.read()"),f=0|s.x,l=0|s.y,T(f>=0&&f<o.framebufferWidth,"invalid x offset for regl.read"),T(l>=0&&l<o.framebufferHeight,"invalid y offset for regl.read"),d=0|(s.width||o.framebufferWidth-f),h=0|(s.height||o.framebufferHeight-l),p=s.data||null),p&&(c===zn?T(p instanceof Uint8Array,"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"):c===Gn&&T(p instanceof Float32Array,"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'")),T(d>0&&d+f<=o.framebufferWidth,"invalid width for read pixels"),T(h>0&&h+l<=o.framebufferHeight,"invalid height for read pixels"),r();var v=d*h*4;return p||(c===zn?p=new Uint8Array(v):c===Gn&&(p=p||new Float32Array(v))),T.isTypedArray(p,"data buffer for regl.read() must be a typedarray"),T(p.byteLength>=v,"data buffer for regl.read() too small"),e.pixelStorei(Fn,4),e.readPixels(f,l,d,h,jn,c,p),p}return function(t){return t&&"framebuffer"in t?function(t){var e;return n.setFBO({framebuffer:t.framebuffer},(function(){e=s(t)})),e}(t):s(t)}}function Bn(t){return Array.prototype.slice.call(t)}function Vn(t){return Bn(t).join("")}var Wn="xyzw".split(""),Xn=5121,Hn=1,qn=2,Yn=0,Kn=1,Zn=2,$n=3,Qn=4,Jn=5,tr=6,er="dither",nr="blend.enable",rr="blend.color",or="blend.equation",ir="blend.func",ar="depth.enable",ur="depth.func",sr="depth.range",cr="depth.mask",fr="colorMask",lr="cull.enable",dr="cull.face",hr="frontFace",pr="lineWidth",vr="polygonOffset.enable",gr="polygonOffset.offset",mr="sample.alpha",yr="sample.enable",br="sample.coverage",wr="stencil.enable",Er="stencil.mask",xr="stencil.func",_r="stencil.opFront",Sr="stencil.opBack",Ar="scissor.enable",Ir="scissor.box",Tr="viewport",Or="profile",Nr="framebuffer",Dr="vert",Mr="frag",kr="elements",Rr="primitive",Cr="count",Lr="offset",Pr="instances",jr="vao",zr="Width",Fr="Height",Gr=Nr+zr,Ur=Nr+Fr,Br=Tr+zr,Vr=Tr+Fr,Wr="drawingBuffer",Xr=Wr+zr,Hr=Wr+Fr,qr=[ir,or,xr,_r,Sr,br,Tr,Ir,gr],Yr=34962,Kr=34963,Zr=3553,$r=34067,Qr=2884,Jr=3042,to=3024,eo=2960,no=2929,ro=3089,oo=32823,io=32926,ao=32928,uo=5126,so=35664,co=35665,fo=35666,lo=5124,ho=35667,po=35668,vo=35669,go=35670,mo=35671,yo=35672,bo=35673,wo=35674,Eo=35675,xo=35676,_o=35678,So=35680,Ao=4,Io=1028,To=1029,Oo=2304,No=2305,Do=32775,Mo=32776,ko=519,Ro=7680,Co=0,Lo=1,Po=32774,jo=513,zo=36160,Fo=36064,Go={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},Uo=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],Bo={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Vo={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Wo={frag:35632,vert:35633},Xo={cw:Oo,ccw:No};function Ho(e){return Array.isArray(e)||t(e)||q(e)}function qo(t){return t.sort((function(t,e){return t===Tr?-1:e===Tr?1:t<e?-1:1}))}function Yo(t,e,n,r){this.thisDep=t,this.contextDep=e,this.propDep=n,this.append=r}function Ko(t){return t&&!(t.thisDep||t.contextDep||t.propDep)}function Zo(t){return new Yo(!1,!1,!1,t)}function $o(t,e){var n=t.type;if(n===Yn){var r=t.data.length;return new Yo(!0,r>=1,r>=2,e)}if(n===Qn){var o=t.data;return new Yo(o.thisDep,o.contextDep,o.propDep,e)}if(n===Jn)return new Yo(!1,!1,!1,e);if(n===tr){for(var i=!1,a=!1,u=!1,s=0;s<t.data.length;++s){var c=t.data[s];if(c.type===Kn)u=!0;else if(c.type===Zn)a=!0;else if(c.type===$n)i=!0;else if(c.type===Yn){i=!0;var f=c.data;f>=1&&(a=!0),f>=2&&(u=!0)}else c.type===Qn&&(i=i||c.data.thisDep,a=a||c.data.contextDep,u=u||c.data.propDep)}return new Yo(i,a,u,e)}return new Yo(n===$n,n===Zn,n===Kn,e)}var Qo=new Yo(!1,!1,!1,(function(){}));function Jo(t,n,r,o,i,a,u,s,c,f,l,d,h,p,v){var g=f.Record,m={add:32774,subtract:32778,"reverse subtract":32779};r.ext_blend_minmax&&(m.min=Do,m.max=Mo);var y=r.angle_instanced_arrays,b=r.webgl_draw_buffers,w={dirty:!0,profile:v.profile},E={},x=[],_={},S={};function A(t){return t.replace(".","_")}function I(t,e,n){var r=A(t);x.push(t),E[r]=w[r]=!!n,_[r]=e}function O(t,e,n){var r=A(t);x.push(t),Array.isArray(n)?(w[r]=n.slice(),E[r]=n.slice()):w[r]=E[r]=n,S[r]=e}I(er,to),I(nr,Jr),O(rr,"blendColor",[0,0,0,0]),O(or,"blendEquationSeparate",[Po,Po]),O(ir,"blendFuncSeparate",[Lo,Co,Lo,Co]),I(ar,no,!0),O(ur,"depthFunc",jo),O(sr,"depthRange",[0,1]),O(cr,"depthMask",!0),O(fr,fr,[!0,!0,!0,!0]),I(lr,Qr),O(dr,"cullFace",To),O(hr,hr,No),O(pr,pr,1),I(vr,oo),O(gr,"polygonOffset",[0,0]),I(mr,io),I(yr,ao),O(br,"sampleCoverage",[1,!1]),I(wr,eo),O(Er,"stencilMask",-1),O(xr,"stencilFunc",[ko,0,-1]),O(_r,"stencilOpSeparate",[Io,Ro,Ro,Ro]),O(Sr,"stencilOpSeparate",[To,Ro,Ro,Ro]),I(Ar,ro),O(Ir,"scissor",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]),O(Tr,Tr,[0,0,t.drawingBufferWidth,t.drawingBufferHeight]);var N={gl:t,context:h,strings:n,next:E,current:w,draw:d,elements:a,buffer:i,shader:l,attributes:f.state,vao:f,uniforms:c,framebuffer:s,extensions:r,timer:p,isBufferArgs:Ho},D={primTypes:lt,compareFuncs:Bo,blendFuncs:Go,blendEquations:m,stencilOps:Vo,glTypes:J,orientationType:Xo};T.optional((function(){N.isArrayLike=Ot})),b&&(D.backBuffer=[To],D.drawBuffer=F(o.maxDrawbuffers,(function(t){return 0===t?[0]:F(t,(function(t){return Fo+t}))})));var M=0;function k(){var t=function(){var t=0,n=[],r=[];function o(){var n=[],r=[];return e((function(){n.push.apply(n,Bn(arguments))}),{def:function(){var e="v"+t++;return r.push(e),arguments.length>0&&(n.push(e,"="),n.push.apply(n,Bn(arguments)),n.push(";")),e},toString:function(){return Vn([r.length>0?"var "+r.join(",")+";":"",Vn(n)])}})}function i(){var t=o(),n=o(),r=t.toString,i=n.toString;function a(e,r){n(e,r,"=",t.def(e,r),";")}return e((function(){t.apply(t,Bn(arguments))}),{def:t.def,entry:t,exit:n,save:a,set:function(e,n,r){a(e,n),t(e,n,"=",r,";")},toString:function(){return r()+i()}})}var a=o(),u={};return{global:a,link:function(e){for(var o=0;o<r.length;++o)if(r[o]===e)return n[o];var i="g"+t++;return n.push(i),r.push(e),i},block:o,proc:function(t,n){var r=[];function o(){var t="a"+r.length;return r.push(t),t}n=n||0;for(var a=0;a<n;++a)o();var s=i(),c=s.toString;return u[t]=e(s,{arg:o,toString:function(){return Vn(["function(",r.join(),"){",c(),"}"])}})},scope:i,cond:function(){var t=Vn(arguments),n=i(),r=i(),o=n.toString,a=r.toString;return e(n,{then:function(){return n.apply(n,Bn(arguments)),this},else:function(){return r.apply(r,Bn(arguments)),this},toString:function(){var e=a();return e&&(e="else{"+e+"}"),Vn(["if(",t,"){",o(),"}",e])}})},compile:function(){var t=['"use strict";',a,"return {"];Object.keys(u).forEach((function(e){t.push('"',e,'":',u[e].toString(),",")})),t.push("}");var e=Vn(t).replace(/;/g,";\n").replace(/}/g,"}\n").replace(/{/g,"{\n");return Function.apply(null,n.concat(e)).apply(null,r)}}}(),r=t.link,o=t.global;t.id=M++,t.batchId="0";var i=r(N),a=t.shared={props:"a0"};Object.keys(N).forEach((function(t){a[t]=o.def(i,".",t)})),T.optional((function(){t.CHECK=r(T),t.commandStr=T.guessCommand(),t.command=r(t.commandStr),t.assert=function(t,e,n){t("if(!(",e,"))",this.CHECK,".commandRaise(",r(n),",",this.command,");")},D.invalidBlendCombinations=Uo}));var u=t.next={},s=t.current={};Object.keys(S).forEach((function(t){Array.isArray(w[t])&&(u[t]=o.def(a.next,".",t),s[t]=o.def(a.current,".",t))}));var c=t.constants={};Object.keys(D).forEach((function(t){c[t]=o.def(JSON.stringify(D[t]))})),t.invoke=function(e,n){switch(n.type){case Yn:var o=["this",a.context,a.props,t.batchId];return e.def(r(n.data),".call(",o.slice(0,Math.max(n.data.length+1,4)),")");case Kn:return e.def(a.props,n.data);case Zn:return e.def(a.context,n.data);case $n:return e.def("this",n.data);case Qn:return n.data.append(t,e),n.data.ref;case Jn:return n.data.toString();case tr:return n.data.map((function(n){return t.invoke(e,n)}))}},t.attribCache={};var l={};return t.scopeAttrib=function(t){var e=n.id(t);if(e in l)return l[e];var o=f.scope[e];return o||(o=f.scope[e]=new g),l[e]=r(o)},t}function C(t,e,u,c,d){var h=t.static,p=t.dynamic;T.optional((function(){var t=[Nr,Dr,Mr,kr,Rr,Lr,Cr,Pr,Or,jr].concat(x);function e(e){Object.keys(e).forEach((function(e){T.command(t.indexOf(e)>=0,'unknown parameter "'+e+'"',d.commandStr)}))}e(h),e(p)}));var v=function(t,e){var n=t.static;if("string"==typeof n[Mr]&&"string"==typeof n[Dr]){if(Object.keys(e.dynamic).length>0)return null;var r=e.static,o=Object.keys(r);if(o.length>0&&"number"==typeof r[o[0]]){for(var i=[],a=0;a<o.length;++a)T("number"==typeof r[o[a]],"must specify all vertex attribute locations when using vaos"),i.push([0|r[o[a]],o[a]]);return i}}return null}(t,e),b=function(t,e){var n=t.static,r=t.dynamic;if(Nr in n){var o=n[Nr];return o?(o=s.getFramebuffer(o),T.command(o,"invalid framebuffer object"),Zo((function(t,e){var n=t.link(o),r=t.shared;e.set(r.framebuffer,".next",n);var i=r.context;return e.set(i,"."+Gr,n+".width"),e.set(i,"."+Ur,n+".height"),n}))):Zo((function(t,e){var n=t.shared;e.set(n.framebuffer,".next","null");var r=n.context;return e.set(r,"."+Gr,r+"."+Xr),e.set(r,"."+Ur,r+"."+Hr),"null"}))}if(Nr in r){var i=r[Nr];return $o(i,(function(t,e){var n=t.invoke(e,i),r=t.shared,o=r.framebuffer,a=e.def(o,".getFramebuffer(",n,")");T.optional((function(){t.assert(e,"!"+n+"||"+a,"invalid framebuffer object")})),e.set(o,".next",a);var u=r.context;return e.set(u,"."+Gr,a+"?"+a+".width:"+u+"."+Xr),e.set(u,"."+Ur,a+"?"+a+".height:"+u+"."+Hr),a}))}return null}(t),w=function(t,e,n){var r=t.static,o=t.dynamic;function i(t){if(t in r){var i=r[t];T.commandType(i,"object","invalid "+t,n.commandStr);var a,u,s=!0,c=0|i.x,f=0|i.y;return"width"in i?(a=0|i.width,T.command(a>=0,"invalid "+t,n.commandStr)):s=!1,"height"in i?(u=0|i.height,T.command(u>=0,"invalid "+t,n.commandStr)):s=!1,new Yo(!s&&e&&e.thisDep,!s&&e&&e.contextDep,!s&&e&&e.propDep,(function(t,e){var n=t.shared.context,r=a;"width"in i||(r=e.def(n,".",Gr,"-",c));var o=u;return"height"in i||(o=e.def(n,".",Ur,"-",f)),[c,f,r,o]}))}if(t in o){var l=o[t],d=$o(l,(function(e,n){var r=e.invoke(n,l);T.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)}));var o=e.shared.context,i=n.def(r,".x|0"),a=n.def(r,".y|0"),u=n.def('"width" in ',r,"?",r,".width|0:","(",o,".",Gr,"-",i,")"),s=n.def('"height" in ',r,"?",r,".height|0:","(",o,".",Ur,"-",a,")");return T.optional((function(){e.assert(n,u+">=0&&"+s+">=0","invalid "+t)})),[i,a,u,s]}));return e&&(d.thisDep=d.thisDep||e.thisDep,d.contextDep=d.contextDep||e.contextDep,d.propDep=d.propDep||e.propDep),d}return e?new Yo(e.thisDep,e.contextDep,e.propDep,(function(t,e){var n=t.shared.context;return[0,0,e.def(n,".",Gr),e.def(n,".",Ur)]})):null}var a=i(Tr);if(a){var u=a;a=new Yo(a.thisDep,a.contextDep,a.propDep,(function(t,e){var n=u.append(t,e),r=t.shared.context;return e.set(r,"."+Br,n[2]),e.set(r,"."+Vr,n[3]),n}))}return{viewport:a,scissor_box:i(Ir)}}(t,b,d),E=function(t,e){var n=t.static,r=t.dynamic,o=function(){if(kr in n){var t=n[kr];Ho(t)?t=a.getElements(a.create(t,!0)):t&&(t=a.getElements(t),T.command(t,"invalid elements",e.commandStr));var o=Zo((function(e,n){if(t){var r=e.link(t);return e.ELEMENTS=r,r}return e.ELEMENTS=null,null}));return o.value=t,o}if(kr in r){var i=r[kr];return $o(i,(function(t,e){var n=t.shared,r=n.isBufferArgs,o=n.elements,a=t.invoke(e,i),u=e.def("null"),s=e.def(r,"(",a,")"),c=t.cond(s).then(u,"=",o,".createStream(",a,");").else(u,"=",o,".getElements(",a,");");return T.optional((function(){t.assert(c.else,"!"+a+"||"+u,"invalid elements")})),e.entry(c),e.exit(t.cond(s).then(o,".destroyStream(",u,");")),t.ELEMENTS=u,u}))}return null}();function i(t,i){if(t in n){var a=0|n[t];return T.command(!i||a>=0,"invalid "+t,e.commandStr),Zo((function(t,e){return i&&(t.OFFSET=a),a}))}if(t in r){var u=r[t];return $o(u,(function(e,n){var r=e.invoke(n,u);return i&&(e.OFFSET=r,T.optional((function(){e.assert(n,r+">=0","invalid "+t)}))),r}))}return i&&o?Zo((function(t,e){return t.OFFSET="0",0})):null}var u=i(Lr,!0);return{elements:o,primitive:function(){if(Rr in n){var t=n[Rr];return T.commandParameter(t,lt,"invalid primitve",e.commandStr),Zo((function(e,n){return lt[t]}))}if(Rr in r){var i=r[Rr];return $o(i,(function(t,e){var n=t.constants.primTypes,r=t.invoke(e,i);return T.optional((function(){t.assert(e,r+" in "+n,"invalid primitive, must be one of "+Object.keys(lt))})),e.def(n,"[",r,"]")}))}return o?Ko(o)?o.value?Zo((function(t,e){return e.def(t.ELEMENTS,".primType")})):Zo((function(){return Ao})):new Yo(o.thisDep,o.contextDep,o.propDep,(function(t,e){var n=t.ELEMENTS;return e.def(n,"?",n,".primType:",Ao)})):null}(),count:function(){if(Cr in n){var t=0|n[Cr];return T.command("number"==typeof t&&t>=0,"invalid vertex count",e.commandStr),Zo((function(){return t}))}if(Cr in r){var i=r[Cr];return $o(i,(function(t,e){var n=t.invoke(e,i);return T.optional((function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">=0&&"+n+"===("+n+"|0)","invalid vertex count")})),n}))}if(o){if(Ko(o)){if(o)return u?new Yo(u.thisDep,u.contextDep,u.propDep,(function(t,e){var n=e.def(t.ELEMENTS,".vertCount-",t.OFFSET);return T.optional((function(){t.assert(e,n+">=0","invalid vertex offset/element buffer too small")})),n})):Zo((function(t,e){return e.def(t.ELEMENTS,".vertCount")}));var a=Zo((function(){return-1}));return T.optional((function(){a.MISSING=!0})),a}var s=new Yo(o.thisDep||u.thisDep,o.contextDep||u.contextDep,o.propDep||u.propDep,(function(t,e){var n=t.ELEMENTS;return t.OFFSET?e.def(n,"?",n,".vertCount-",t.OFFSET,":-1"):e.def(n,"?",n,".vertCount:-1")}));return T.optional((function(){s.DYNAMIC=!0})),s}return null}(),instances:i(Pr,!1),offset:u}}(t,d),_=function(t,e){var n=t.static,r=t.dynamic,i={};return x.forEach((function(t){var a=A(t);function u(e,o){if(t in n){var u=e(n[t]);i[a]=Zo((function(){return u}))}else if(t in r){var s=r[t];i[a]=$o(s,(function(t,e){return o(t,e,t.invoke(e,s))}))}}switch(t){case lr:case nr:case er:case wr:case ar:case Ar:case vr:case mr:case yr:case cr:return u((function(n){return T.commandType(n,"boolean",t,e.commandStr),n}),(function(e,n,r){return T.optional((function(){e.assert(n,"typeof "+r+'==="boolean"',"invalid flag "+t,e.commandStr)})),r}));case ur:return u((function(n){return T.commandParameter(n,Bo,"invalid "+t,e.commandStr),Bo[n]}),(function(e,n,r){var o=e.constants.compareFuncs;return T.optional((function(){e.assert(n,r+" in "+o,"invalid "+t+", must be one of "+Object.keys(Bo))})),n.def(o,"[",r,"]")}));case sr:return u((function(t){return T.command(Ot(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]&&t[0]<=t[1],"depth range is 2d array",e.commandStr),t}),(function(t,e,n){return T.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===2&&typeof "+n+'[0]==="number"&&typeof '+n+'[1]==="number"&&'+n+"[0]<="+n+"[1]","depth range must be a 2d array")})),[e.def("+",n,"[0]"),e.def("+",n,"[1]")]}));case ir:return u((function(t){T.commandType(t,"object","blend.func",e.commandStr);var n="srcRGB"in t?t.srcRGB:t.src,r="srcAlpha"in t?t.srcAlpha:t.src,o="dstRGB"in t?t.dstRGB:t.dst,i="dstAlpha"in t?t.dstAlpha:t.dst;return T.commandParameter(n,Go,a+".srcRGB",e.commandStr),T.commandParameter(r,Go,a+".srcAlpha",e.commandStr),T.commandParameter(o,Go,a+".dstRGB",e.commandStr),T.commandParameter(i,Go,a+".dstAlpha",e.commandStr),T.command(-1===Uo.indexOf(n+", "+o),"unallowed blending combination (srcRGB, dstRGB) = ("+n+", "+o+")",e.commandStr),[Go[n],Go[o],Go[r],Go[i]]}),(function(e,n,r){var o=e.constants.blendFuncs;function i(i,a){var u=n.def('"',i,a,'" in ',r,"?",r,".",i,a,":",r,".",i);return T.optional((function(){e.assert(n,u+" in "+o,"invalid "+t+"."+i+a+", must be one of "+Object.keys(Go))})),u}T.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid blend func, must be an object")}));var a=i("src","RGB"),u=i("dst","RGB");T.optional((function(){var t=e.constants.invalidBlendCombinations;e.assert(n,t+".indexOf("+a+'+", "+'+u+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")}));var s=n.def(o,"[",a,"]"),c=n.def(o,"[",i("src","Alpha"),"]");return[s,n.def(o,"[",u,"]"),c,n.def(o,"[",i("dst","Alpha"),"]")]}));case or:return u((function(n){return"string"==typeof n?(T.commandParameter(n,m,"invalid "+t,e.commandStr),[m[n],m[n]]):"object"==typeof n?(T.commandParameter(n.rgb,m,t+".rgb",e.commandStr),T.commandParameter(n.alpha,m,t+".alpha",e.commandStr),[m[n.rgb],m[n.alpha]]):void T.commandRaise("invalid blend.equation",e.commandStr)}),(function(e,n,r){var o=e.constants.blendEquations,i=n.def(),a=n.def(),u=e.cond("typeof ",r,'==="string"');return T.optional((function(){function n(t,n,r){e.assert(t,r+" in "+o,"invalid "+n+", must be one of "+Object.keys(m))}n(u.then,t,r),e.assert(u.else,r+"&&typeof "+r+'==="object"',"invalid "+t),n(u.else,t+".rgb",r+".rgb"),n(u.else,t+".alpha",r+".alpha")})),u.then(i,"=",a,"=",o,"[",r,"];"),u.else(i,"=",o,"[",r,".rgb];",a,"=",o,"[",r,".alpha];"),n(u),[i,a]}));case rr:return u((function(t){return T.command(Ot(t)&&4===t.length,"blend.color must be a 4d array",e.commandStr),F(4,(function(e){return+t[e]}))}),(function(t,e,n){return T.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","blend.color must be a 4d array")})),F(4,(function(t){return e.def("+",n,"[",t,"]")}))}));case Er:return u((function(t){return T.commandType(t,"number",a,e.commandStr),0|t}),(function(t,e,n){return T.optional((function(){t.assert(e,"typeof "+n+'==="number"',"invalid stencil.mask")})),e.def(n,"|0")}));case xr:return u((function(n){T.commandType(n,"object",a,e.commandStr);var r=n.cmp||"keep",o=n.ref||0,i="mask"in n?n.mask:-1;return T.commandParameter(r,Bo,t+".cmp",e.commandStr),T.commandType(o,"number",t+".ref",e.commandStr),T.commandType(i,"number",t+".mask",e.commandStr),[Bo[r],o,i]}),(function(t,e,n){var r=t.constants.compareFuncs;return T.optional((function(){function o(){t.assert(e,Array.prototype.join.call(arguments,""),"invalid stencil.func")}o(n+"&&typeof ",n,'==="object"'),o('!("cmp" in ',n,")||(",n,".cmp in ",r,")")})),[e.def('"cmp" in ',n,"?",r,"[",n,".cmp]",":",Ro),e.def(n,".ref|0"),e.def('"mask" in ',n,"?",n,".mask|0:-1")]}));case _r:case Sr:return u((function(n){T.commandType(n,"object",a,e.commandStr);var r=n.fail||"keep",o=n.zfail||"keep",i=n.zpass||"keep";return T.commandParameter(r,Vo,t+".fail",e.commandStr),T.commandParameter(o,Vo,t+".zfail",e.commandStr),T.commandParameter(i,Vo,t+".zpass",e.commandStr),[t===Sr?To:Io,Vo[r],Vo[o],Vo[i]]}),(function(e,n,r){var o=e.constants.stencilOps;function i(i){return T.optional((function(){e.assert(n,'!("'+i+'" in '+r+")||("+r+"."+i+" in "+o+")","invalid "+t+"."+i+", must be one of "+Object.keys(Vo))})),n.def('"',i,'" in ',r,"?",o,"[",r,".",i,"]:",Ro)}return T.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)})),[t===Sr?To:Io,i("fail"),i("zfail"),i("zpass")]}));case gr:return u((function(t){T.commandType(t,"object",a,e.commandStr);var n=0|t.factor,r=0|t.units;return T.commandType(n,"number",a+".factor",e.commandStr),T.commandType(r,"number",a+".units",e.commandStr),[n,r]}),(function(e,n,r){return T.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)})),[n.def(r,".factor|0"),n.def(r,".units|0")]}));case dr:return u((function(t){var n=0;return"front"===t?n=Io:"back"===t&&(n=To),T.command(!!n,a,e.commandStr),n}),(function(t,e,n){return T.optional((function(){t.assert(e,n+'==="front"||'+n+'==="back"',"invalid cull.face")})),e.def(n,'==="front"?',Io,":",To)}));case pr:return u((function(t){return T.command("number"==typeof t&&t>=o.lineWidthDims[0]&&t<=o.lineWidthDims[1],"invalid line width, must be a positive number between "+o.lineWidthDims[0]+" and "+o.lineWidthDims[1],e.commandStr),t}),(function(t,e,n){return T.optional((function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">="+o.lineWidthDims[0]+"&&"+n+"<="+o.lineWidthDims[1],"invalid line width")})),n}));case hr:return u((function(t){return T.commandParameter(t,Xo,a,e.commandStr),Xo[t]}),(function(t,e,n){return T.optional((function(){t.assert(e,n+'==="cw"||'+n+'==="ccw"',"invalid frontFace, must be one of cw,ccw")})),e.def(n+'==="cw"?'+Oo+":"+No)}));case fr:return u((function(t){return T.command(Ot(t)&&4===t.length,"color.mask must be length 4 array",e.commandStr),t.map((function(t){return!!t}))}),(function(t,e,n){return T.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","invalid color.mask")})),F(4,(function(t){return"!!"+n+"["+t+"]"}))}));case br:return u((function(t){T.command("object"==typeof t&&t,a,e.commandStr);var n="value"in t?t.value:1,r=!!t.invert;return T.command("number"==typeof n&&n>=0&&n<=1,"sample.coverage.value must be a number between 0 and 1",e.commandStr),[n,r]}),(function(t,e,n){return T.optional((function(){t.assert(e,n+"&&typeof "+n+'==="object"',"invalid sample.coverage")})),[e.def('"value" in ',n,"?+",n,".value:1"),e.def("!!",n,".invert")]}))}})),i}(t,d),S=function(t,e,r){var o=t.static,i=t.dynamic;function a(t){if(t in o){var e=n.id(o[t]);T.optional((function(){l.shader(Wo[t],e,T.guessCommand())}));var r=Zo((function(){return e}));return r.id=e,r}if(t in i){var a=i[t];return $o(a,(function(e,n){var r=e.invoke(n,a),o=n.def(e.shared.strings,".id(",r,")");return T.optional((function(){n(e.shared.shader,".shader(",Wo[t],",",o,",",e.command,");")})),o}))}return null}var u,s=a(Mr),c=a(Dr),f=null;return Ko(s)&&Ko(c)?(f=l.program(c.id,s.id,null,r),u=Zo((function(t,e){return t.link(f)}))):u=new Yo(s&&s.thisDep||c&&c.thisDep,s&&s.contextDep||c&&c.contextDep,s&&s.propDep||c&&c.propDep,(function(t,e){var n,r=t.shared.shader;n=s?s.append(t,e):e.def(r,".",Mr);var o=r+".program("+(c?c.append(t,e):e.def(r,".",Dr))+","+n;return T.optional((function(){o+=","+t.command})),e.def(o+")")})),{frag:s,vert:c,progVar:u,program:f}}(t,0,v);function I(t){var e=w[t];e&&(_[t]=e)}I(Tr),I(A(Ir));var O=Object.keys(_).length>0,N={framebuffer:b,draw:E,shader:S,state:_,dirty:O,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(N.profile=function(t){var e,n=t.static,r=t.dynamic;if(Or in n){var o=!!n[Or];(e=Zo((function(t,e){return o}))).enable=o}else if(Or in r){var i=r[Or];e=$o(i,(function(t,e){return t.invoke(e,i)}))}return e}(t),N.uniforms=function(t,e){var n=t.static,r=t.dynamic,o={};return Object.keys(n).forEach((function(t){var r,i=n[t];if("number"==typeof i||"boolean"==typeof i)r=Zo((function(){return i}));else if("function"==typeof i){var a=i._reglType;"texture2d"===a||"textureCube"===a?r=Zo((function(t){return t.link(i)})):"framebuffer"===a||"framebufferCube"===a?(T.command(i.color.length>0,'missing color attachment for framebuffer sent to uniform "'+t+'"',e.commandStr),r=Zo((function(t){return t.link(i.color[0])}))):T.commandRaise('invalid data for uniform "'+t+'"',e.commandStr)}else Ot(i)?r=Zo((function(e){return e.global.def("[",F(i.length,(function(n){return T.command("number"==typeof i[n]||"boolean"==typeof i[n],"invalid uniform "+t,e.commandStr),i[n]})),"]")})):T.commandRaise('invalid or missing data for uniform "'+t+'"',e.commandStr);r.value=i,o[t]=r})),Object.keys(r).forEach((function(t){var e=r[t];o[t]=$o(e,(function(t,n){return t.invoke(n,e)}))})),o}(u,d),N.drawVAO=N.scopeVAO=function(t,e){var n=t.static,r=t.dynamic;if(jr in n){var o=n[jr];return null!==o&&null===f.getVAO(o)&&(o=f.createVAO(o)),Zo((function(t){return t.link(f.getVAO(o))}))}if(jr in r){var i=r[jr];return $o(i,(function(t,e){var n=t.invoke(e,i);return e.def(t.shared.vao+".getVAO("+n+")")}))}return null}(t),!N.drawVAO&&S.program&&!v&&r.angle_instanced_arrays){var D=!0,M=S.program.attributes.map((function(t){var n=e.static[t];return D=D&&!!n,n}));if(D&&M.length>0){var k=f.getVAO(f.createVAO(M));N.drawVAO=new Yo(null,null,null,(function(t,e){return t.link(k)})),N.useVAO=!0}}return v?N.useVAO=!0:N.attributes=function(t,e){var r=t.static,o=t.dynamic,a={};return Object.keys(r).forEach((function(t){var o=r[t],u=n.id(t),s=new g;if(Ho(o))s.state=Hn,s.buffer=i.getBuffer(i.create(o,Yr,!1,!0)),s.type=0;else{var c=i.getBuffer(o);if(c)s.state=Hn,s.buffer=c,s.type=0;else if(T.command("object"==typeof o&&o,"invalid data for attribute "+t,e.commandStr),"constant"in o){var f=o.constant;s.buffer="null",s.state=qn,"number"==typeof f?s.x=f:(T.command(Ot(f)&&f.length>0&&f.length<=4,"invalid constant for attribute "+t,e.commandStr),Wn.forEach((function(t,e){e<f.length&&(s[t]=f[e])})))}else{c=Ho(o.buffer)?i.getBuffer(i.create(o.buffer,Yr,!1,!0)):i.getBuffer(o.buffer),T.command(!!c,'missing buffer for attribute "'+t+'"',e.commandStr);var l=0|o.offset;T.command(l>=0,'invalid offset for attribute "'+t+'"',e.commandStr);var d=0|o.stride;T.command(d>=0&&d<256,'invalid stride for attribute "'+t+'", must be integer betweeen [0, 255]',e.commandStr);var h=0|o.size;T.command(!("size"in o)||h>0&&h<=4,'invalid size for attribute "'+t+'", must be 1,2,3,4',e.commandStr);var p=!!o.normalized,v=0;"type"in o&&(T.commandParameter(o.type,J,"invalid type for attribute "+t,e.commandStr),v=J[o.type]);var m=0|o.divisor;"divisor"in o&&(T.command(0===m||y,'cannot specify divisor for attribute "'+t+'", instancing not supported',e.commandStr),T.command(m>=0,'invalid divisor for attribute "'+t+'"',e.commandStr)),T.optional((function(){var n=e.commandStr,r=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(o).forEach((function(e){T.command(r.indexOf(e)>=0,'unknown parameter "'+e+'" for attribute pointer "'+t+'" (valid parameters are '+r+")",n)}))})),s.buffer=c,s.state=Hn,s.size=h,s.normalized=p,s.type=v||c.dtype,s.offset=l,s.stride=d,s.divisor=m}}a[t]=Zo((function(t,e){var n=t.attribCache;if(u in n)return n[u];var r={isStream:!1};return Object.keys(s).forEach((function(t){r[t]=s[t]})),s.buffer&&(r.buffer=t.link(s.buffer),r.type=r.type||r.buffer+".dtype"),n[u]=r,r}))})),Object.keys(o).forEach((function(t){var e=o[t];a[t]=$o(e,(function(n,r){var o=n.invoke(r,e),i=n.shared,a=n.constants,u=i.isBufferArgs,s=i.buffer;T.optional((function(){n.assert(r,o+"&&(typeof "+o+'==="object"||typeof '+o+'==="function")&&('+u+"("+o+")||"+s+".getBuffer("+o+")||"+s+".getBuffer("+o+".buffer)||"+u+"("+o+'.buffer)||("constant" in '+o+"&&(typeof "+o+'.constant==="number"||'+i.isArrayLike+"("+o+".constant))))",'invalid dynamic attribute "'+t+'"')}));var c={isStream:r.def(!1)},f=new g;f.state=Hn,Object.keys(f).forEach((function(t){c[t]=r.def(""+f[t])}));var l=c.buffer,d=c.type;function h(t){r(c[t],"=",o,".",t,"|0;")}return r("if(",u,"(",o,")){",c.isStream,"=true;",l,"=",s,".createStream(",Yr,",",o,");",d,"=",l,".dtype;","}else{",l,"=",s,".getBuffer(",o,");","if(",l,"){",d,"=",l,".dtype;",'}else if("constant" in ',o,"){",c.state,"=",qn,";","if(typeof "+o+'.constant === "number"){',c[Wn[0]],"=",o,".constant;",Wn.slice(1).map((function(t){return c[t]})).join("="),"=0;","}else{",Wn.map((function(t,e){return c[t]+"="+o+".constant.length>"+e+"?"+o+".constant["+e+"]:0;"})).join(""),"}}else{","if(",u,"(",o,".buffer)){",l,"=",s,".createStream(",Yr,",",o,".buffer);","}else{",l,"=",s,".getBuffer(",o,".buffer);","}",d,'="type" in ',o,"?",a.glTypes,"[",o,".type]:",l,".dtype;",c.normalized,"=!!",o,".normalized;"),h("size"),h("offset"),h("stride"),h("divisor"),r("}}"),r.exit("if(",c.isStream,"){",s,".destroyStream(",l,");","}"),c}))})),a}(e,d),N.context=function(t){var e=t.static,n=t.dynamic,r={};return Object.keys(e).forEach((function(t){var n=e[t];r[t]=Zo((function(t,e){return"number"==typeof n||"boolean"==typeof n?""+n:t.link(n)}))})),Object.keys(n).forEach((function(t){var e=n[t];r[t]=$o(e,(function(t,n){return t.invoke(n,e)}))})),r}(c),N}function L(t,e,n){var r=t.shared.context,o=t.scope();Object.keys(n).forEach((function(i){e.save(r,"."+i);var a=n[i].append(t,e);Array.isArray(a)?o(r,".",i,"=[",a.join(),"];"):o(r,".",i,"=",a,";")})),e(o)}function P(t,e,n,r){var o,i=t.shared,a=i.gl,u=i.framebuffer;b&&(o=e.def(i.extensions,".webgl_draw_buffers"));var s,c=t.constants,f=c.drawBuffer,l=c.backBuffer;s=n?n.append(t,e):e.def(u,".next"),r||e("if(",s,"!==",u,".cur){"),e("if(",s,"){",a,".bindFramebuffer(",zo,",",s,".framebuffer);"),b&&e(o,".drawBuffersWEBGL(",f,"[",s,".colorAttachments.length]);"),e("}else{",a,".bindFramebuffer(",zo,",null);"),b&&e(o,".drawBuffersWEBGL(",l,");"),e("}",u,".cur=",s,";"),r||e("}")}function j(t,e,n){var r=t.shared,o=r.gl,i=t.current,a=t.next,u=r.current,s=r.next,c=t.cond(u,".dirty");x.forEach((function(e){var r,f,l=A(e);if(!(l in n.state))if(l in a){r=a[l],f=i[l];var d=F(w[l].length,(function(t){return c.def(r,"[",t,"]")}));c(t.cond(d.map((function(t,e){return t+"!=="+f+"["+e+"]"})).join("||")).then(o,".",S[l],"(",d,");",d.map((function(t,e){return f+"["+e+"]="+t})).join(";"),";"))}else{r=c.def(s,".",l);var h=t.cond(r,"!==",u,".",l);c(h),l in _?h(t.cond(r).then(o,".enable(",_[l],");").else(o,".disable(",_[l],");"),u,".",l,"=",r,";"):h(o,".",S[l],"(",r,");",u,".",l,"=",r,";")}})),0===Object.keys(n.state).length&&c(u,".dirty=false;"),e(c)}function z(t,e,n,r){var o=t.shared,i=t.current,a=o.current,u=o.gl;qo(Object.keys(n)).forEach((function(o){var s=n[o];if(!r||r(s)){var c=s.append(t,e);if(_[o]){var f=_[o];Ko(s)?e(u,c?".enable(":".disable(",f,");"):e(t.cond(c).then(u,".enable(",f,");").else(u,".disable(",f,");")),e(a,".",o,"=",c,";")}else if(Ot(c)){var l=i[o];e(u,".",S[o],"(",c,");",c.map((function(t,e){return l+"["+e+"]="+t})).join(";"),";")}else e(u,".",S[o],"(",c,");",a,".",o,"=",c,";")}}))}function G(t,e){y&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function U(t,e,n,r,o){var i,a,u,s=t.shared,c=t.stats,f=s.current,l=s.timer,d=n.profile;function h(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function v(t){t(i=e.def(),"=",h(),";"),"string"==typeof o?t(c,".count+=",o,";"):t(c,".count++;"),p&&(r?t(a=e.def(),"=",l,".getNumPendingQueries();"):t(l,".beginQuery(",c,");"))}function g(t){t(c,".cpuTime+=",h(),"-",i,";"),p&&(r?t(l,".pushScopeStats(",a,",",l,".getNumPendingQueries(),",c,");"):t(l,".endQuery();"))}function m(t){var n=e.def(f,".profile");e(f,".profile=",t,";"),e.exit(f,".profile=",n,";")}if(d){if(Ko(d))return void(d.enable?(v(e),g(e.exit),m("true")):m("false"));m(u=d.append(t,e))}else u=e.def(f,".profile");var y=t.block();v(y),e("if(",u,"){",y,"}");var b=t.block();g(b),e.exit("if(",u,"){",b,"}")}function B(t,e,n,r,o){var i=t.shared;r.forEach((function(r){var a,u=r.name,s=n.attributes[u];if(s){if(!o(s))return;a=s.append(t,e)}else{if(!o(Qo))return;var c=t.scopeAttrib(u);T.optional((function(){t.assert(e,c+".state","missing attribute "+u)})),a={},Object.keys(new g).forEach((function(t){a[t]=e.def(c,".",t)}))}!function(n,r,o){var a=i.gl,u=e.def(n,".location"),s=e.def(i.attributes,"[",u,"]"),c=o.state,f=o.buffer,l=[o.x,o.y,o.z,o.w],d=["buffer","normalized","offset","stride"];function h(){e("if(!",s,".buffer){",a,".enableVertexAttribArray(",u,");}");var n,i=o.type;if(n=o.size?e.def(o.size,"||",r):r,e("if(",s,".type!==",i,"||",s,".size!==",n,"||",d.map((function(t){return s+"."+t+"!=="+o[t]})).join("||"),"){",a,".bindBuffer(",Yr,",",f,".buffer);",a,".vertexAttribPointer(",[u,n,i,o.normalized,o.stride,o.offset],");",s,".type=",i,";",s,".size=",n,";",d.map((function(t){return s+"."+t+"="+o[t]+";"})).join(""),"}"),y){var c=o.divisor;e("if(",s,".divisor!==",c,"){",t.instancing,".vertexAttribDivisorANGLE(",[u,c],");",s,".divisor=",c,";}")}}function p(){e("if(",s,".buffer){",a,".disableVertexAttribArray(",u,");",s,".buffer=null;","}if(",Wn.map((function(t,e){return s+"."+t+"!=="+l[e]})).join("||"),"){",a,".vertexAttrib4f(",u,",",l,");",Wn.map((function(t,e){return s+"."+t+"="+l[e]+";"})).join(""),"}")}c===Hn?h():c===qn?p():(e("if(",c,"===",Hn,"){"),h(),e("}else{"),p(),e("}"))}(t.link(r),function(t){switch(t){case so:case ho:case mo:return 2;case co:case po:case yo:return 3;case fo:case vo:case bo:return 4;default:return 1}}(r.info.type),a)}))}function V(t,e,r,o,i){for(var a,u=t.shared,s=u.gl,c=0;c<o.length;++c){var f,l=o[c],d=l.name,h=l.info.type,p=r.uniforms[d],v=t.link(l)+".location";if(p){if(!i(p))continue;if(Ko(p)){var g=p.value;if(T.command(null!=g,'missing uniform "'+d+'"',t.commandStr),h===_o||h===So){T.command("function"==typeof g&&(h===_o&&("texture2d"===g._reglType||"framebuffer"===g._reglType)||h===So&&("textureCube"===g._reglType||"framebufferCube"===g._reglType)),"invalid texture for uniform "+d,t.commandStr);var m=t.link(g._texture||g.color[0]._texture);e(s,".uniform1i(",v,",",m+".bind());"),e.exit(m,".unbind();")}else if(h===wo||h===Eo||h===xo){T.optional((function(){T.command(Ot(g),"invalid matrix for uniform "+d,t.commandStr),T.command(h===wo&&4===g.length||h===Eo&&9===g.length||h===xo&&16===g.length,"invalid length for matrix uniform "+d,t.commandStr)}));var y=t.global.def("new Float32Array(["+Array.prototype.slice.call(g)+"])"),b=2;h===Eo?b=3:h===xo&&(b=4),e(s,".uniformMatrix",b,"fv(",v,",false,",y,");")}else{switch(h){case uo:T.commandType(g,"number","uniform "+d,t.commandStr),a="1f";break;case so:T.command(Ot(g)&&2===g.length,"uniform "+d,t.commandStr),a="2f";break;case co:T.command(Ot(g)&&3===g.length,"uniform "+d,t.commandStr),a="3f";break;case fo:T.command(Ot(g)&&4===g.length,"uniform "+d,t.commandStr),a="4f";break;case go:T.commandType(g,"boolean","uniform "+d,t.commandStr),a="1i";break;case lo:T.commandType(g,"number","uniform "+d,t.commandStr),a="1i";break;case mo:case ho:T.command(Ot(g)&&2===g.length,"uniform "+d,t.commandStr),a="2i";break;case yo:case po:T.command(Ot(g)&&3===g.length,"uniform "+d,t.commandStr),a="3i";break;case bo:case vo:T.command(Ot(g)&&4===g.length,"uniform "+d,t.commandStr),a="4i"}e(s,".uniform",a,"(",v,",",Ot(g)?Array.prototype.slice.call(g):g,");")}continue}f=p.append(t,e)}else{if(!i(Qo))continue;f=e.def(u.uniforms,"[",n.id(d),"]")}h===_o?(T(!Array.isArray(f),"must specify a scalar prop for textures"),e("if(",f,"&&",f,'._reglType==="framebuffer"){',f,"=",f,".color[0];","}")):h===So&&(T(!Array.isArray(f),"must specify a scalar prop for cube maps"),e("if(",f,"&&",f,'._reglType==="framebufferCube"){',f,"=",f,".color[0];","}")),T.optional((function(){function n(n,r){t.assert(e,n,'bad data or missing for uniform "'+d+'". '+r)}function r(t){T(!Array.isArray(f),"must not specify an array type for uniform"),n("typeof "+f+'==="'+t+'"',"invalid type, expected "+t)}function o(e,r){Array.isArray(f)?T(f.length===e,"must have length "+e):n(u.isArrayLike+"("+f+")&&"+f+".length==="+e,"invalid vector, should have length "+e,t.commandStr)}function i(e){T(!Array.isArray(f),"must not specify a value type"),n("typeof "+f+'==="function"&&'+f+'._reglType==="texture'+(e===Zr?"2d":"Cube")+'"',"invalid texture type",t.commandStr)}switch(h){case lo:r("number");break;case ho:o(2);break;case po:o(3);break;case vo:o(4);break;case uo:r("number");break;case so:o(2);break;case co:o(3);break;case fo:o(4);break;case go:r("boolean");break;case mo:o(2);break;case yo:o(3);break;case bo:case wo:o(4);break;case Eo:o(9);break;case xo:o(16);break;case _o:i(Zr);break;case So:i($r)}}));var w=1;switch(h){case _o:case So:var E=e.def(f,"._texture");e(s,".uniform1i(",v,",",E,".bind());"),e.exit(E,".unbind();");continue;case lo:case go:a="1i";break;case ho:case mo:a="2i",w=2;break;case po:case yo:a="3i",w=3;break;case vo:case bo:a="4i",w=4;break;case uo:a="1f";break;case so:a="2f",w=2;break;case co:a="3f",w=3;break;case fo:a="4f",w=4;break;case wo:a="Matrix2fv";break;case Eo:a="Matrix3fv";break;case xo:a="Matrix4fv"}if(e(s,".uniform",a,"(",v,","),"M"===a.charAt(0)){var x=Math.pow(h-wo+2,2),_=t.global.def("new Float32Array(",x,")");Array.isArray(f)?e("false,(",F(x,(function(t){return _+"["+t+"]="+f[t]})),",",_,")"):e("false,(Array.isArray(",f,")||",f," instanceof Float32Array)?",f,":(",F(x,(function(t){return _+"["+t+"]="+f+"["+t+"]"})),",",_,")")}else w>1?e(F(w,(function(t){return Array.isArray(f)?f[t]:f+"["+t+"]"}))):(T(!Array.isArray(f),"uniform value must not be an array"),e(f));e(");")}}function W(t,e,n,r){var o=t.shared,i=o.gl,a=o.draw,u=r.draw;var s=function(){var o,s=u.elements,c=e;return s?((s.contextDep&&r.contextDynamic||s.propDep)&&(c=n),o=s.append(t,c)):o=c.def(a,".",kr),o&&c("if("+o+")"+i+".bindBuffer("+Kr+","+o+".buffer.buffer);"),o}();function c(o){var i=u[o];return i?i.contextDep&&r.contextDynamic||i.propDep?i.append(t,n):i.append(t,e):e.def(a,".",o)}var f,l,d=c(Rr),h=c(Lr),p=function(){var o,i=u.count,s=e;return i?((i.contextDep&&r.contextDynamic||i.propDep)&&(s=n),o=i.append(t,s),T.optional((function(){i.MISSING&&t.assert(e,"false","missing vertex count"),i.DYNAMIC&&t.assert(s,o+">=0","missing vertex count")}))):(o=s.def(a,".",Cr),T.optional((function(){t.assert(s,o+">=0","missing vertex count")}))),o}();if("number"==typeof p){if(0===p)return}else n("if(",p,"){"),n.exit("}");y&&(f=c(Pr),l=t.instancing);var v=s+".type",g=u.elements&&Ko(u.elements);function m(){function t(){n(l,".drawElementsInstancedANGLE(",[d,p,v,h+"<<(("+v+"-"+Xn+")>>1)",f],");")}function e(){n(l,".drawArraysInstancedANGLE(",[d,h,p,f],");")}s?g?t():(n("if(",s,"){"),t(),n("}else{"),e(),n("}")):e()}function b(){function t(){n(i+".drawElements("+[d,p,v,h+"<<(("+v+"-"+Xn+")>>1)"]+");")}function e(){n(i+".drawArrays("+[d,h,p]+");")}s?g?t():(n("if(",s,"){"),t(),n("}else{"),e(),n("}")):e()}y&&("number"!=typeof f||f>=0)?"string"==typeof f?(n("if(",f,">0){"),m(),n("}else if(",f,"<0){"),b(),n("}")):m():b()}function X(t,e,n,r,o){var i=k(),a=i.proc("body",o);return T.optional((function(){i.commandStr=e.commandStr,i.command=i.link(e.commandStr)})),y&&(i.instancing=a.def(i.shared.extensions,".angle_instanced_arrays")),t(i,a,n,r),i.compile().body}function H(t,e,n,r){G(t,e),n.useVAO?n.drawVAO?e(t.shared.vao,".setVAO(",n.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),B(t,e,n,r.attributes,(function(){return!0}))),V(t,e,n,r.uniforms,(function(){return!0})),W(t,e,e,n)}function q(t,e,n,r){function o(){return!0}t.batchId="a1",G(t,e),B(t,e,n,r.attributes,o),V(t,e,n,r.uniforms,o),W(t,e,e,n)}function Y(t,e,n,r){G(t,e);var o=n.contextDep,i=e.def(),a=e.def();t.shared.props=a,t.batchId=i;var u=t.scope(),s=t.scope();function c(t){return t.contextDep&&o||t.propDep}function f(t){return!c(t)}if(e(u.entry,"for(",i,"=0;",i,"<","a1",";++",i,"){",a,"=","a0","[",i,"];",s,"}",u.exit),n.needsContext&&L(t,s,n.context),n.needsFramebuffer&&P(t,s,n.framebuffer),z(t,s,n.state,c),n.profile&&c(n.profile)&&U(t,s,n,!1,!0),r)n.useVAO?n.drawVAO?c(n.drawVAO)?s(t.shared.vao,".setVAO(",n.drawVAO.append(t,s),");"):u(t.shared.vao,".setVAO(",n.drawVAO.append(t,u),");"):u(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(u(t.shared.vao,".setVAO(null);"),B(t,u,n,r.attributes,f),B(t,s,n,r.attributes,c)),V(t,u,n,r.uniforms,f),V(t,s,n,r.uniforms,c),W(t,u,s,n);else{var l=t.global.def("{}"),d=n.shader.progVar.append(t,s),h=s.def(d,".id"),p=s.def(l,"[",h,"]");s(t.shared.gl,".useProgram(",d,".program);","if(!",p,"){",p,"=",l,"[",h,"]=",t.link((function(e){return X(q,t,n,e,2)})),"(",d,");}",p,".call(this,a0[",i,"],",i,");")}}function K(t,e,n){var r=e.static[n];if(r&&function(t){if("object"==typeof t&&!Ot(t)){for(var e=Object.keys(t),n=0;n<e.length;++n)if(R.isDynamic(t[e[n]]))return!0;return!1}}(r)){var o=t.global,i=Object.keys(r),a=!1,u=!1,s=!1,c=t.global.def("{}");i.forEach((function(e){var n=r[e];if(R.isDynamic(n)){"function"==typeof n&&(n=r[e]=R.unbox(n));var i=$o(n,null);a=a||i.thisDep,s=s||i.propDep,u=u||i.contextDep}else{switch(o(c,".",e,"="),typeof n){case"number":o(n);break;case"string":o('"',n,'"');break;case"object":Array.isArray(n)&&o("[",n.join(),"]");break;default:o(t.link(n))}o(";")}})),e.dynamic[n]=new R.DynamicVariable(Qn,{thisDep:a,contextDep:u,propDep:s,ref:c,append:function(t,e){i.forEach((function(n){var o=r[n];if(R.isDynamic(o)){var i=t.invoke(e,o);e(c,".",n,"=",i,";")}}))}}),delete e.static[n]}}return{next:E,current:w,procs:function(){var t=k(),e=t.proc("poll"),n=t.proc("refresh"),i=t.block();e(i),n(i);var a,u=t.shared,s=u.gl,c=u.next,f=u.current;i(f,".dirty=false;"),P(t,e),P(t,n,null,!0),y&&(a=t.link(y)),r.oes_vertex_array_object&&n(t.link(r.oes_vertex_array_object),".bindVertexArrayOES(null);");for(var l=0;l<o.maxAttributes;++l){var d=n.def(u.attributes,"[",l,"]"),h=t.cond(d,".buffer");h.then(s,".enableVertexAttribArray(",l,");",s,".bindBuffer(",Yr,",",d,".buffer.buffer);",s,".vertexAttribPointer(",l,",",d,".size,",d,".type,",d,".normalized,",d,".stride,",d,".offset);").else(s,".disableVertexAttribArray(",l,");",s,".vertexAttrib4f(",l,",",d,".x,",d,".y,",d,".z,",d,".w);",d,".buffer=null;"),n(h),y&&n(a,".vertexAttribDivisorANGLE(",l,",",d,".divisor);")}return n(t.shared.vao,".currentVAO=null;",t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"),Object.keys(_).forEach((function(r){var o=_[r],a=i.def(c,".",r),u=t.block();u("if(",a,"){",s,".enable(",o,")}else{",s,".disable(",o,")}",f,".",r,"=",a,";"),n(u),e("if(",a,"!==",f,".",r,"){",u,"}")})),Object.keys(S).forEach((function(r){var o,a,u=S[r],l=w[r],d=t.block();if(d(s,".",u,"("),Ot(l)){var h=l.length;o=t.global.def(c,".",r),a=t.global.def(f,".",r),d(F(h,(function(t){return o+"["+t+"]"})),");",F(h,(function(t){return a+"["+t+"]="+o+"["+t+"];"})).join("")),e("if(",F(h,(function(t){return o+"["+t+"]!=="+a+"["+t+"]"})).join("||"),"){",d,"}")}else o=i.def(c,".",r),a=i.def(f,".",r),d(o,");",f,".",r,"=",o,";"),e("if(",o,"!==",a,"){",d,"}");n(d)})),t.compile()}(),compile:function(t,r,o,i,a){var u=k();u.stats=u.link(a),Object.keys(r.static).forEach((function(t){K(u,r,t)})),qr.forEach((function(e){K(u,t,e)}));var s=C(t,r,o,i,u);return function(t,e){var n=t.proc("draw",1);G(t,n),L(t,n,e.context),P(t,n,e.framebuffer),j(t,n,e),z(t,n,e.state),U(t,n,e,!1,!0);var r=e.shader.progVar.append(t,n);if(n(t.shared.gl,".useProgram(",r,".program);"),e.shader.program)H(t,n,e,e.shader.program);else{n(t.shared.vao,".setVAO(null);");var o=t.global.def("{}"),i=n.def(r,".id"),a=n.def(o,"[",i,"]");n(t.cond(a).then(a,".call(this,a0);").else(a,"=",o,"[",i,"]=",t.link((function(n){return X(H,t,e,n,1)})),"(",r,");",a,".call(this,a0);"))}Object.keys(e.state).length>0&&n(t.shared.current,".dirty=true;")}(u,s),function(t,e){var r=t.proc("scope",3);t.batchId="a2";var o=t.shared,i=o.current;function a(n){var i=e.shader[n];i&&r.set(o.shader,"."+n,i.append(t,r))}L(t,r,e.context),e.framebuffer&&e.framebuffer.append(t,r),qo(Object.keys(e.state)).forEach((function(n){var i=e.state[n].append(t,r);Ot(i)?i.forEach((function(e,o){r.set(t.next[n],"["+o+"]",e)})):r.set(o.next,"."+n,i)})),U(t,r,e,!0,!0),[kr,Lr,Cr,Pr,Rr].forEach((function(n){var i=e.draw[n];i&&r.set(o.draw,"."+n,""+i.append(t,r))})),Object.keys(e.uniforms).forEach((function(i){var a=e.uniforms[i].append(t,r);Array.isArray(a)&&(a="["+a.join()+"]"),r.set(o.uniforms,"["+n.id(i)+"]",a)})),Object.keys(e.attributes).forEach((function(n){var o=e.attributes[n].append(t,r),i=t.scopeAttrib(n);Object.keys(new g).forEach((function(t){r.set(i,"."+t,o[t])}))})),e.scopeVAO&&r.set(o.vao,".targetVAO",e.scopeVAO.append(t,r)),a(Dr),a(Mr),Object.keys(e.state).length>0&&(r(i,".dirty=true;"),r.exit(i,".dirty=true;")),r("a1(",t.shared.context,",a0,",t.batchId,");")}(u,s),function(t,e){var n=t.proc("batch",2);t.batchId="0",G(t,n);var r=!1,o=!0;Object.keys(e.context).forEach((function(t){r=r||e.context[t].propDep})),r||(L(t,n,e.context),o=!1);var i=e.framebuffer,a=!1;function u(t){return t.contextDep&&r||t.propDep}i?(i.propDep?r=a=!0:i.contextDep&&r&&(a=!0),a||P(t,n,i)):P(t,n,null),e.state.viewport&&e.state.viewport.propDep&&(r=!0),j(t,n,e),z(t,n,e.state,(function(t){return!u(t)})),e.profile&&u(e.profile)||U(t,n,e,!1,"a1"),e.contextDep=r,e.needsContext=o,e.needsFramebuffer=a;var s=e.shader.progVar;if(s.contextDep&&r||s.propDep)Y(t,n,e,null);else{var c=s.append(t,n);if(n(t.shared.gl,".useProgram(",c,".program);"),e.shader.program)Y(t,n,e,e.shader.program);else{n(t.shared.vao,".setVAO(null);");var f=t.global.def("{}"),l=n.def(c,".id"),d=n.def(f,"[",l,"]");n(t.cond(d).then(d,".call(this,a0,a1);").else(d,"=",f,"[",l,"]=",t.link((function(n){return X(Y,t,e,n,2)})),"(",c,");",d,".call(this,a0,a1);"))}}Object.keys(e.state).length>0&&n(t.shared.current,".dirty=true;")}(u,s),e(u.compile(),{destroy:function(){s.shader.program.destroy()}})}}}var ti=function(t,e){if(!e.ext_disjoint_timer_query)return null;var n=[];function r(t){n.push(t)}var o=[];function i(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var a=[];function u(t){a.push(t)}var s=[];function c(t,e,n){var r=a.pop()||new i;r.startQueryIndex=t,r.endQueryIndex=e,r.sum=0,r.stats=n,s.push(r)}var f=[],l=[];return{beginQuery:function(t){var r=n.pop()||e.ext_disjoint_timer_query.createQueryEXT();e.ext_disjoint_timer_query.beginQueryEXT(35007,r),o.push(r),c(o.length-1,o.length,t)},endQuery:function(){e.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:c,update:function(){var t,n,i=o.length;if(0!==i){l.length=Math.max(l.length,i+1),f.length=Math.max(f.length,i+1),f[0]=0,l[0]=0;var a=0;for(t=0,n=0;n<o.length;++n){var c=o[n];e.ext_disjoint_timer_query.getQueryObjectEXT(c,34919)?(a+=e.ext_disjoint_timer_query.getQueryObjectEXT(c,34918),r(c)):o[t++]=c,f[n+1]=a,l[n+1]=t}for(o.length=t,t=0,n=0;n<s.length;++n){var d=s[n],h=d.startQueryIndex,p=d.endQueryIndex;d.sum+=f[p]-f[h];var v=l[h],g=l[p];g===v?(d.stats.gpuTime+=d.sum/1e6,u(d)):(d.startQueryIndex=v,d.endQueryIndex=g,s[t++]=d)}s.length=t}},getNumPendingQueries:function(){return o.length},clear:function(){n.push.apply(n,o);for(var t=0;t<n.length;t++)e.ext_disjoint_timer_query.deleteQueryEXT(n[t]);o.length=0,n.length=0},restore:function(){o.length=0,n.length=0}}},ei="webglcontextlost",ni="webglcontextrestored";function ri(t,e){for(var n=0;n<t.length;++n)if(t[n]===e)return n;return-1}return function(n){var r=z(n);if(!r)return null;var o=r.gl,i=o.getContextAttributes(),a=o.isContextLost(),u=function(t,e){var n={};function r(e){T.type(e,"string","extension name must be string");var r,o=e.toLowerCase();try{r=n[o]=t.getExtension(o)}catch(t){}return!!r}for(var o=0;o<e.extensions.length;++o){var i=e.extensions[o];if(!r(i))return e.onDestroy(),e.onDone('"'+i+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return e.optionalExtensions.forEach(r),{extensions:n,restore:function(){Object.keys(n).forEach((function(t){if(n[t]&&!r(t))throw new Error("(regl): error restoring extension "+t)}))}}}(o,r);if(!u)return null;var s,c,f=(s={"":0},c=[""],{id:function(t){var e=s[t];return e||(e=s[t]=c.length,c.push(t),e)},str:function(t){return c[t]}}),l={vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},d=u.extensions,h=ti(0,d),p=L(),v=o.drawingBufferWidth,g=o.drawingBufferHeight,m={tick:0,time:0,viewportWidth:v,viewportHeight:g,framebufferWidth:v,framebufferHeight:g,drawingBufferWidth:v,drawingBufferHeight:g,pixelRatio:r.pixelRatio},y=function(t,e){var n=1;e.ext_texture_filter_anisotropic&&(n=t.getParameter(34047));var r=1,o=1;e.webgl_draw_buffers&&(r=t.getParameter(34852),o=t.getParameter(36063));var i=!!e.oes_texture_float;if(i){var a=t.createTexture();t.bindTexture(V,a),t.texImage2D(V,0,W,1,1,0,W,X,null);var u=t.createFramebuffer();if(t.bindFramebuffer(H,u),t.framebufferTexture2D(H,36064,V,a,0),t.bindTexture(V,null),36053!==t.checkFramebufferStatus(H))i=!1;else{t.viewport(0,0,1,1),t.clearColor(1,0,0,1),t.clear(16384);var s=B.allocType(X,4);t.readPixels(0,0,1,1,W,X,s),t.getError()?i=!1:(t.deleteFramebuffer(u),t.deleteTexture(a),i=1===s[0]),B.freeType(s)}}var c=!0;if("undefined"==typeof navigator||!(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent))){var f=t.createTexture(),l=B.allocType(5121,36);t.activeTexture(33984),t.bindTexture(34067,f),t.texImage2D(34069,0,W,3,3,0,W,5121,l),B.freeType(l),t.bindTexture(34067,null),t.deleteTexture(f),c=!t.getError()}return{colorBits:[t.getParameter(3410),t.getParameter(3411),t.getParameter(3412),t.getParameter(3413)],depthBits:t.getParameter(3414),stencilBits:t.getParameter(3415),subpixelBits:t.getParameter(3408),extensions:Object.keys(e).filter((function(t){return!!e[t]})),maxAnisotropic:n,maxDrawbuffers:r,maxColorAttachments:o,pointSizeDims:t.getParameter(33901),lineWidthDims:t.getParameter(33902),maxViewportDims:t.getParameter(3386),maxCombinedTextureUnits:t.getParameter(35661),maxCubeMapSize:t.getParameter(34076),maxRenderbufferSize:t.getParameter(34024),maxTextureUnits:t.getParameter(34930),maxTextureSize:t.getParameter(3379),maxAttributes:t.getParameter(34921),maxVertexUniforms:t.getParameter(36347),maxVertexTextureUnits:t.getParameter(35660),maxVaryingVectors:t.getParameter(36348),maxFragmentUniforms:t.getParameter(36349),glsl:t.getParameter(35724),renderer:t.getParameter(7937),vendor:t.getParameter(7936),version:t.getParameter(7938),readFloat:i,npotTextureCube:c}}(o,d),b=function(e,n,r,o){var i=0,a={};function u(t){this.id=i++,this.buffer=e.createBuffer(),this.type=t,this.usage=rt,this.byteLength=0,this.dimension=1,this.dtype=it,this.persistentData=null,r.profile&&(this.stats={size:0})}u.prototype.bind=function(){e.bindBuffer(this.type,this.buffer)},u.prototype.destroy=function(){l(this)};var s=[];function c(t,n,r){t.byteLength=n.byteLength,e.bufferData(t.type,n,r)}function f(e,n,r,o,i,a){var u,s;if(e.usage=r,Array.isArray(n)){if(e.dtype=o||at,n.length>0)if(Array.isArray(n[0])){u=nt(n);for(var f=1,l=1;l<u.length;++l)f*=u[l];e.dimension=f,c(e,s=et(n,u,e.dtype),r),a?e.persistentData=s:B.freeType(s)}else if("number"==typeof n[0]){e.dimension=i;var d=B.allocType(e.dtype,n.length);ct(d,n),c(e,d,r),a?e.persistentData=d:B.freeType(d)}else t(n[0])?(e.dimension=n[0].length,e.dtype=o||st(n[0])||at,c(e,s=et(n,[n.length,n[0].length],e.dtype),r),a?e.persistentData=s:B.freeType(s)):T.raise("invalid buffer data")}else if(t(n))e.dtype=o||st(n),e.dimension=i,c(e,n,r),a&&(e.persistentData=new Uint8Array(new Uint8Array(n.buffer)));else if(q(n)){u=n.shape;var h=n.stride,p=n.offset,v=0,g=0,m=0,y=0;1===u.length?(v=u[0],g=1,m=h[0],y=0):2===u.length?(v=u[0],g=u[1],m=h[0],y=h[1]):T.raise("invalid shape"),e.dtype=o||st(n.data)||at,e.dimension=g;var b=B.allocType(e.dtype,v*g);ft(b,n.data,v,g,m,y,p),c(e,b,r),a?e.persistentData=b:B.freeType(b)}else n instanceof ArrayBuffer?(e.dtype=it,e.dimension=i,c(e,n,r),a&&(e.persistentData=new Uint8Array(new Uint8Array(n)))):T.raise("invalid buffer data")}function l(t){n.bufferCount--,o(t);var r=t.buffer;T(r,"buffer must not be deleted already"),e.deleteBuffer(r),t.buffer=null,delete a[t.id]}return r.profile&&(n.getTotalBufferSize=function(){var t=0;return Object.keys(a).forEach((function(e){t+=a[e].stats.size})),t}),{create:function(o,i,s,c){n.bufferCount++;var d=new u(i);function h(n){var o=rt,i=null,a=0,u=0,s=1;return Array.isArray(n)||t(n)||q(n)||n instanceof ArrayBuffer?i=n:"number"==typeof n?a=0|n:n&&(T.type(n,"object","buffer arguments must be an object, a number or an array"),"data"in n&&(T(null===i||Array.isArray(i)||t(i)||q(i),"invalid data for buffer"),i=n.data),"usage"in n&&(T.parameter(n.usage,tt,"invalid buffer usage"),o=tt[n.usage]),"type"in n&&(T.parameter(n.type,J,"invalid buffer type"),u=J[n.type]),"dimension"in n&&(T.type(n.dimension,"number","invalid dimension"),s=0|n.dimension),"length"in n&&(T.nni(a,"buffer length must be a nonnegative integer"),a=0|n.length)),d.bind(),i?f(d,i,o,u,s,c):(a&&e.bufferData(d.type,a,o),d.dtype=u||it,d.usage=o,d.dimension=s,d.byteLength=a),r.profile&&(d.stats.size=d.byteLength*ut[d.dtype]),h}function p(t,n){T(n+t.byteLength<=d.byteLength,"invalid buffer subdata call, buffer is too small. Can't write data of size "+t.byteLength+" starting from offset "+n+" to a buffer of size "+d.byteLength),e.bufferSubData(d.type,n,t)}return a[d.id]=d,s||h(o),h._reglType="buffer",h._buffer=d,h.subdata=function(e,n){var r,o=0|(n||0);if(d.bind(),t(e)||e instanceof ArrayBuffer)p(e,o);else if(Array.isArray(e)){if(e.length>0)if("number"==typeof e[0]){var i=B.allocType(d.dtype,e.length);ct(i,e),p(i,o),B.freeType(i)}else if(Array.isArray(e[0])||t(e[0])){r=nt(e);var a=et(e,r,d.dtype);p(a,o),B.freeType(a)}else T.raise("invalid buffer data")}else if(q(e)){r=e.shape;var u=e.stride,s=0,c=0,f=0,l=0;1===r.length?(s=r[0],c=1,f=u[0],l=0):2===r.length?(s=r[0],c=r[1],f=u[0],l=u[1]):T.raise("invalid shape");var v=Array.isArray(e.data)?d.dtype:st(e.data),g=B.allocType(v,s*c);ft(g,e.data,s,c,f,l,e.offset),p(g,o),B.freeType(g)}else T.raise("invalid data for buffer subdata");return h},r.profile&&(h.stats=d.stats),h.destroy=function(){l(d)},h},createStream:function(t,e){var n=s.pop();return n||(n=new u(t)),n.bind(),f(n,e,ot,0,1,!1),n},destroyStream:function(t){s.push(t)},clear:function(){Y(a).forEach(l),s.forEach(l)},getBuffer:function(t){return t&&t._buffer instanceof u?t._buffer:null},restore:function(){Y(a).forEach((function(t){t.buffer=e.createBuffer(),e.bindBuffer(t.type,t.buffer),e.bufferData(t.type,t.persistentData||t.byteLength,t.usage)}))},_initBuffer:f}}(o,l,r,(function(t){return w.destroyBuffer(t)})),w=function(e,n,r,o,i){for(var a=r.maxAttributes,u=new Array(a),s=0;s<a;++s)u[s]=new kn;var c=0,f={},l={Record:kn,scope:{},state:u,currentVAO:null,targetVAO:null,restore:d()?function(){d()&&Y(f).forEach((function(t){t.refresh()}))}:function(){},createVAO:function(e){var r=new p;function u(e){T(Array.isArray(e),"arguments to vertex array constructor must be an array"),T(e.length<a,"too many attributes"),T(e.length>0,"must specify at least one attribute");var o={},s=r.attributes;s.length=e.length;for(var c=0;c<e.length;++c){var f,l=e[c],d=s[c]=new kn,h=l.data||l;Array.isArray(h)||t(h)||q(h)?(r.buffers[c]&&(f=r.buffers[c],t(h)&&f._buffer.byteLength>=h.byteLength?f.subdata(h):(f.destroy(),r.buffers[c]=null)),r.buffers[c]||(f=r.buffers[c]=i.create(l,Mn,!1,!0)),d.buffer=i.getBuffer(f),d.size=0|d.buffer.dimension,d.normalized=!1,d.type=d.buffer.dtype,d.offset=0,d.stride=0,d.divisor=0,d.state=1,o[c]=1):i.getBuffer(l)?(d.buffer=i.getBuffer(l),d.size=0|d.buffer.dimension,d.normalized=!1,d.type=d.buffer.dtype,d.offset=0,d.stride=0,d.divisor=0,d.state=1):i.getBuffer(l.buffer)?(d.buffer=i.getBuffer(l.buffer),d.size=0|(+l.size||d.buffer.dimension),d.normalized=!!l.normalized||!1,"type"in l?(T.parameter(l.type,J,"invalid buffer type"),d.type=J[l.type]):d.type=d.buffer.dtype,d.offset=0|(l.offset||0),d.stride=0|(l.stride||0),d.divisor=0|(l.divisor||0),d.state=1,T(d.size>=1&&d.size<=4,"size must be between 1 and 4"),T(d.offset>=0,"invalid offset"),T(d.stride>=0&&d.stride<=255,"stride must be between 0 and 255"),T(d.divisor>=0,"divisor must be positive"),T(!d.divisor||!!n.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in l?(T(c>0,"first attribute must not be a constant"),d.x=+l.x||0,d.y=+l.y||0,d.z=+l.z||0,d.w=+l.w||0,d.state=2):T(!1,"invalid attribute spec for location "+c)}for(var p=0;p<r.buffers.length;++p)!o[p]&&r.buffers[p]&&(r.buffers[p].destroy(),r.buffers[p]=null);return r.refresh(),u}return o.vaoCount+=1,u.destroy=function(){for(var t=0;t<r.buffers.length;++t)r.buffers[t]&&r.buffers[t].destroy();r.buffers.length=0,r.destroy()},u._vao=r,u._reglType="vao",u(e)},getVAO:function(t){return"function"==typeof t&&t._vao?t._vao:null},destroyBuffer:function(t){for(var n=0;n<u.length;++n){var r=u[n];r.buffer===t&&(e.disableVertexAttribArray(n),r.buffer=null)}},setVAO:d()?function(t){if(t!==l.currentVAO){var e=d();t?e.bindVertexArrayOES(t.vao):e.bindVertexArrayOES(null),l.currentVAO=t}}:function(t){if(t!==l.currentVAO){if(t)t.bindAttrs();else for(var n=h(),r=0;r<u.length;++r){var o=u[r];o.buffer?(e.enableVertexAttribArray(r),e.vertexAttribPointer(r,o.size,o.type,o.normalized,o.stride,o.offfset),n&&o.divisor&&n.vertexAttribDivisorANGLE(r,o.divisor)):(e.disableVertexAttribArray(r),e.vertexAttrib4f(r,o.x,o.y,o.z,o.w))}l.currentVAO=t}},clear:d()?function(){Y(f).forEach((function(t){t.destroy()}))}:function(){}};function d(){return n.oes_vertex_array_object}function h(){return n.angle_instanced_arrays}function p(){this.id=++c,this.attributes=[];var t=d();this.vao=t?t.createVertexArrayOES():null,f[this.id]=this,this.buffers=[]}return p.prototype.bindAttrs=function(){for(var t=h(),n=this.attributes,r=0;r<n.length;++r){var o=n[r];o.buffer?(e.enableVertexAttribArray(r),e.bindBuffer(Mn,o.buffer.buffer),e.vertexAttribPointer(r,o.size,o.type,o.normalized,o.stride,o.offset),t&&o.divisor&&t.vertexAttribDivisorANGLE(r,o.divisor)):(e.disableVertexAttribArray(r),e.vertexAttrib4f(r,o.x,o.y,o.z,o.w))}for(var i=n.length;i<a;++i)e.disableVertexAttribArray(i)},p.prototype.refresh=function(){var t=d();t&&(t.bindVertexArrayOES(this.vao),this.bindAttrs(),l.currentVAO=this)},p.prototype.destroy=function(){if(this.vao){var t=d();this===l.currentVAO&&(l.currentVAO=null,t.bindVertexArrayOES(null)),t.deleteVertexArrayOES(this.vao),this.vao=null}f[this.id]&&(delete f[this.id],o.vaoCount-=1)},l}(o,d,y,l,b),E=function(e,n,r,o){var i={},a=0,u={uint8:gt,uint16:yt};function s(t){this.id=a++,i[this.id]=this,this.buffer=t,this.primType=pt,this.vertCount=0,this.type=0}n.oes_element_index_uint&&(u.uint32=wt),s.prototype.bind=function(){this.buffer.bind()};var c=[];function f(o,i,a,u,s,c,f){var l;if(o.buffer.bind(),i){var d=f;f||t(i)&&(!q(i)||t(i.data))||(d=n.oes_element_index_uint?wt:yt),r._initBuffer(o.buffer,i,a,d,3)}else e.bufferData(Et,c,a),o.buffer.dtype=l||gt,o.buffer.usage=a,o.buffer.dimension=3,o.buffer.byteLength=c;if(l=f,!f){switch(o.buffer.dtype){case gt:case vt:l=gt;break;case yt:case mt:l=yt;break;case wt:case bt:l=wt;break;default:T.raise("unsupported type for element array")}o.buffer.dtype=l}o.type=l,T(l!==wt||!!n.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var h=s;h<0&&(h=o.buffer.byteLength,l===yt?h>>=1:l===wt&&(h>>=2)),o.vertCount=h;var p=u;if(u<0){p=pt;var v=o.buffer.dimension;1===v&&(p=dt),2===v&&(p=ht),3===v&&(p=pt)}o.primType=p}function l(t){o.elementsCount--,T(null!==t.buffer,"must not double destroy elements"),delete i[t.id],t.buffer.destroy(),t.buffer=null}return{create:function(e,n){var i=r.create(null,Et,!0),a=new s(i._buffer);function c(e){if(e)if("number"==typeof e)i(e),a.primType=pt,a.vertCount=0|e,a.type=gt;else{var n=null,r=_t,o=-1,s=-1,l=0,d=0;Array.isArray(e)||t(e)||q(e)?n=e:(T.type(e,"object","invalid arguments for elements"),"data"in e&&(n=e.data,T(Array.isArray(n)||t(n)||q(n),"invalid data for element buffer")),"usage"in e&&(T.parameter(e.usage,tt,"invalid element buffer usage"),r=tt[e.usage]),"primitive"in e&&(T.parameter(e.primitive,lt,"invalid element buffer primitive"),o=lt[e.primitive]),"count"in e&&(T("number"==typeof e.count&&e.count>=0,"invalid vertex count for elements"),s=0|e.count),"type"in e&&(T.parameter(e.type,u,"invalid buffer type"),d=u[e.type]),"length"in e?l=0|e.length:(l=s,d===yt||d===mt?l*=2:d!==wt&&d!==bt||(l*=4))),f(a,n,r,o,s,l,d)}else i(),a.primType=pt,a.vertCount=0,a.type=gt;return c}return o.elementsCount++,c(e),c._reglType="elements",c._elements=a,c.subdata=function(t,e){return i.subdata(t,e),c},c.destroy=function(){l(a)},c},createStream:function(t){var e=c.pop();return e||(e=new s(r.create(null,Et,!0,!1)._buffer)),f(e,t,xt,-1,-1,0,0),e},destroyStream:function(t){c.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof s?t._elements:null},clear:function(){Y(i).forEach(l)}}}(o,d,b,l),x=function(t,n,r,o){var i={},a={};function u(t,e,n,r){this.name=t,this.id=e,this.location=n,this.info=r}function s(t,e){for(var n=0;n<t.length;++n)if(t[n].id===e.id)return void(t[n].location=e.location);t.push(e)}function c(e,r,o){var u=e===Rn?i:a,s=u[r];if(!s){var c=n.str(r);s=t.createShader(e),t.shaderSource(s,c),t.compileShader(s),T.shaderError(t,s,c,e,o),u[r]=s}return s}var f={},l=[],d=0;function h(t,e){this.id=d++,this.fragId=t,this.vertId=e,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,o.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function p(e,r,i){var a,f,l=c(Rn,e.fragId),d=c(Cn,e.vertId),h=e.program=t.createProgram();if(t.attachShader(h,l),t.attachShader(h,d),i)for(a=0;a<i.length;++a){var p=i[a];t.bindAttribLocation(h,p[0],p[1])}t.linkProgram(h),T.linkError(t,h,n.str(e.fragId),n.str(e.vertId),r);var v=t.getProgramParameter(h,Ln);o.profile&&(e.stats.uniformsCount=v);var g=e.uniforms;for(a=0;a<v;++a)if(f=t.getActiveUniform(h,a))if(f.size>1)for(var m=0;m<f.size;++m){var y=f.name.replace("[0]","["+m+"]");s(g,new u(y,n.id(y),t.getUniformLocation(h,y),f))}else s(g,new u(f.name,n.id(f.name),t.getUniformLocation(h,f.name),f));var b=t.getProgramParameter(h,Pn);o.profile&&(e.stats.attributesCount=b);var w=e.attributes;for(a=0;a<b;++a)(f=t.getActiveAttrib(h,a))&&s(w,new u(f.name,n.id(f.name),t.getAttribLocation(h,f.name),f))}return o.profile&&(r.getMaxUniformsCount=function(){var t=0;return l.forEach((function(e){e.stats.uniformsCount>t&&(t=e.stats.uniformsCount)})),t},r.getMaxAttributesCount=function(){var t=0;return l.forEach((function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)})),t}),{clear:function(){var e=t.deleteShader.bind(t);Y(i).forEach(e),i={},Y(a).forEach(e),a={},l.forEach((function(e){t.deleteProgram(e.program)})),l.length=0,f={},r.shaderCount=0},program:function(n,o,u,s){T.command(n>=0,"missing vertex shader",u),T.command(o>=0,"missing fragment shader",u);var c=f[o];c||(c=f[o]={});var d=c[n];if(d&&(d.refCount++,!s))return d;var v=new h(o,n);return r.shaderCount++,p(v,u,s),d||(c[n]=v),l.push(v),e(v,{destroy:function(){if(v.refCount--,v.refCount<=0){t.deleteProgram(v.program);var e=l.indexOf(v);l.splice(e,1),r.shaderCount--}c[v.vertId].refCount<=0&&(t.deleteShader(a[v.vertId]),delete a[v.vertId],delete f[v.fragId][v.vertId]),Object.keys(f[v.fragId]).length||(t.deleteShader(i[v.fragId]),delete i[v.fragId],delete f[v.fragId])}})},restore:function(){i={},a={};for(var t=0;t<l.length;++t)p(l[t],null,l[t].attributes.map((function(t){return[t.location,t.name]})))},shader:c,frag:-1,vert:-1}}(o,f,l,r),_=un(o,d,y,(function(){I.procs.poll()}),m,l,r),S=function(t,e,n,r,o){var i={rgba4:cn,rgb565:36194,"rgb5 a1":32855,depth:33189,stencil:36168,"depth stencil":34041};e.ext_srgb&&(i.srgba=35907),e.ext_color_buffer_half_float&&(i.rgba16f=34842,i.rgb16f=34843),e.webgl_color_buffer_float&&(i.rgba32f=34836);var a=[];Object.keys(i).forEach((function(t){var e=i[t];a[e]=t}));var u=0,s={};function c(t){this.id=u++,this.refCount=1,this.renderbuffer=t,this.format=cn,this.width=0,this.height=0,o.profile&&(this.stats={size:0})}function f(e){var n=e.renderbuffer;T(n,"must not double destroy renderbuffer"),t.bindRenderbuffer(sn,null),t.deleteRenderbuffer(n),e.renderbuffer=null,e.refCount=0,delete s[e.id],r.renderbufferCount--}return c.prototype.decRef=function(){--this.refCount<=0&&f(this)},o.profile&&(r.getTotalRenderbufferSize=function(){var t=0;return Object.keys(s).forEach((function(e){t+=s[e].stats.size})),t}),{create:function(e,u){var f=new c(t.createRenderbuffer());function l(e,r){var u=0,s=0,c=cn;if("object"==typeof e&&e){var d=e;if("shape"in d){var h=d.shape;T(Array.isArray(h)&&h.length>=2,"invalid renderbuffer shape"),u=0|h[0],s=0|h[1]}else"radius"in d&&(u=s=0|d.radius),"width"in d&&(u=0|d.width),"height"in d&&(s=0|d.height);"format"in d&&(T.parameter(d.format,i,"invalid renderbuffer format"),c=i[d.format])}else"number"==typeof e?(u=0|e,s="number"==typeof r?0|r:u):e?T.raise("invalid arguments to renderbuffer constructor"):u=s=1;if(T(u>0&&s>0&&u<=n.maxRenderbufferSize&&s<=n.maxRenderbufferSize,"invalid renderbuffer size"),u!==f.width||s!==f.height||c!==f.format)return l.width=f.width=u,l.height=f.height=s,f.format=c,t.bindRenderbuffer(sn,f.renderbuffer),t.renderbufferStorage(sn,c,u,s),T(0===t.getError(),"invalid render buffer format"),o.profile&&(f.stats.size=ln(f.format,f.width,f.height)),l.format=a[f.format],l}return s[f.id]=f,r.renderbufferCount++,l(e,u),l.resize=function(e,r){var i=0|e,a=0|r||i;return i===f.width&&a===f.height||(T(i>0&&a>0&&i<=n.maxRenderbufferSize&&a<=n.maxRenderbufferSize,"invalid renderbuffer size"),l.width=f.width=i,l.height=f.height=a,t.bindRenderbuffer(sn,f.renderbuffer),t.renderbufferStorage(sn,f.format,i,a),T(0===t.getError(),"invalid render buffer format"),o.profile&&(f.stats.size=ln(f.format,f.width,f.height))),l},l._reglType="renderbuffer",l._renderbuffer=f,o.profile&&(l.stats=f.stats),l.destroy=function(){f.decRef()},l},clear:function(){Y(s).forEach(f)},restore:function(){Y(s).forEach((function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(sn,e.renderbuffer),t.renderbufferStorage(sn,e.format,e.width,e.height)})),t.bindRenderbuffer(sn,null)}}}(o,d,y,l,r),A=function(t,n,r,o,i,a){var u={cur:null,next:null,dirty:!1,setFBO:null},s=["rgba"],c=["rgba4","rgb565","rgb5 a1"];n.ext_srgb&&c.push("srgba"),n.ext_color_buffer_half_float&&c.push("rgba16f","rgb16f"),n.webgl_color_buffer_float&&c.push("rgba32f");var f=["uint8"];function l(t,e,n){this.target=t,this.texture=e,this.renderbuffer=n;var r=0,o=0;e?(r=e.width,o=e.height):n&&(r=n.width,o=n.height),this.width=r,this.height=o}function d(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function h(t,e,n){if(t)if(t.texture){var r=t.texture._texture,o=Math.max(1,r.width),i=Math.max(1,r.height);T(o===e&&i===n,"inconsistent width/height for supplied texture"),r.refCount+=1}else{var a=t.renderbuffer._renderbuffer;T(a.width===e&&a.height===n,"inconsistent width/height for renderbuffer"),a.refCount+=1}}function p(e,n){n&&(n.texture?t.framebufferTexture2D(dn,e,n.target,n.texture._texture.texture,0):t.framebufferRenderbuffer(dn,e,hn,n.renderbuffer._renderbuffer.renderbuffer))}function v(t){var e=pn,n=null,r=null,o=t;"object"==typeof t&&(o=t.data,"target"in t&&(e=0|t.target)),T.type(o,"function","invalid attachment data");var i=o._reglType;return"texture2d"===i?(n=o,T(e===pn)):"textureCube"===i?(n=o,T(e>=vn&&e<vn+6,"invalid cube map target")):"renderbuffer"===i?(r=o,e=hn):T.raise("invalid regl object for attachment"),new l(e,n,r)}function g(t,e,n,r,a){if(n){var u=o.create2D({width:t,height:e,format:r,type:a});return u._texture.refCount=0,new l(pn,u,null)}var s=i.create({width:t,height:e,format:r});return s._renderbuffer.refCount=0,new l(hn,null,s)}function m(t){return t&&(t.texture||t.renderbuffer)}function y(t,e,n){t&&(t.texture?t.texture.resize(e,n):t.renderbuffer&&t.renderbuffer.resize(e,n),t.width=e,t.height=n)}n.oes_texture_half_float&&f.push("half float","float16"),n.oes_texture_float&&f.push("float","float32");var b=0,w={};function E(){this.id=b++,w[this.id]=this,this.framebuffer=t.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function x(t){t.colorAttachments.forEach(d),d(t.depthAttachment),d(t.stencilAttachment),d(t.depthStencilAttachment)}function _(e){var n=e.framebuffer;T(n,"must not double destroy framebuffer"),t.deleteFramebuffer(n),e.framebuffer=null,a.framebufferCount--,delete w[e.id]}function S(e){var n;t.bindFramebuffer(dn,e.framebuffer);var o=e.colorAttachments;for(n=0;n<o.length;++n)p(gn+n,o[n]);for(n=o.length;n<r.maxColorAttachments;++n)t.framebufferTexture2D(dn,gn+n,pn,null,0);t.framebufferTexture2D(dn,bn,pn,null,0),t.framebufferTexture2D(dn,mn,pn,null,0),t.framebufferTexture2D(dn,yn,pn,null,0),p(mn,e.depthAttachment),p(yn,e.stencilAttachment),p(bn,e.depthStencilAttachment);var i=t.checkFramebufferStatus(dn);t.isContextLost()||i===wn||T.raise("framebuffer configuration not supported, status = "+Nn[i]),t.bindFramebuffer(dn,u.next?u.next.framebuffer:null),u.cur=u.next,t.getError()}function A(t,o){var i=new E;function l(t,e){var o;T(u.next!==i,"can not update framebuffer which is currently in use");var a=0,d=0,p=!0,y=!0,b=null,w=!0,E="rgba",_="uint8",A=1,I=null,O=null,N=null,D=!1;if("number"==typeof t)a=0|t,d=0|e||a;else if(t){T.type(t,"object","invalid arguments for framebuffer");var M=t;if("shape"in M){var k=M.shape;T(Array.isArray(k)&&k.length>=2,"invalid shape for framebuffer"),a=k[0],d=k[1]}else"radius"in M&&(a=d=M.radius),"width"in M&&(a=M.width),"height"in M&&(d=M.height);("color"in M||"colors"in M)&&(b=M.color||M.colors,Array.isArray(b)&&T(1===b.length||n.webgl_draw_buffers,"multiple render targets not supported")),b||("colorCount"in M&&(A=0|M.colorCount,T(A>0,"invalid color buffer count")),"colorTexture"in M&&(w=!!M.colorTexture,E="rgba4"),"colorType"in M&&(_=M.colorType,w?(T(n.oes_texture_float||!("float"===_||"float32"===_),"you must enable OES_texture_float in order to use floating point framebuffer objects"),T(n.oes_texture_half_float||!("half float"===_||"float16"===_),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):"half float"===_||"float16"===_?(T(n.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),E="rgba16f"):"float"!==_&&"float32"!==_||(T(n.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),E="rgba32f"),T.oneOf(_,f,"invalid color type")),"colorFormat"in M&&(E=M.colorFormat,s.indexOf(E)>=0?w=!0:c.indexOf(E)>=0?w=!1:w?T.oneOf(M.colorFormat,s,"invalid color format for texture"):T.oneOf(M.colorFormat,c,"invalid color format for renderbuffer"))),("depthTexture"in M||"depthStencilTexture"in M)&&(D=!(!M.depthTexture&&!M.depthStencilTexture),T(!D||n.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in M&&("boolean"==typeof M.depth?p=M.depth:(I=M.depth,y=!1)),"stencil"in M&&("boolean"==typeof M.stencil?y=M.stencil:(O=M.stencil,p=!1)),"depthStencil"in M&&("boolean"==typeof M.depthStencil?p=y=M.depthStencil:(N=M.depthStencil,p=!1,y=!1))}else a=d=1;var R=null,C=null,L=null,P=null;if(Array.isArray(b))R=b.map(v);else if(b)R=[v(b)];else for(R=new Array(A),o=0;o<A;++o)R[o]=g(a,d,w,E,_);T(n.webgl_draw_buffers||R.length<=1,"you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers."),T(R.length<=r.maxColorAttachments,"too many color attachments, not supported"),a=a||R[0].width,d=d||R[0].height,I?C=v(I):p&&!y&&(C=g(a,d,D,"depth","uint32")),O?L=v(O):y&&!p&&(L=g(a,d,!1,"stencil","uint8")),N?P=v(N):!I&&!O&&y&&p&&(P=g(a,d,D,"depth stencil","depth stencil")),T(!!I+!!O+!!N<=1,"invalid framebuffer configuration, can specify exactly one depth/stencil attachment");var j=null;for(o=0;o<R.length;++o)if(h(R[o],a,d),T(!R[o]||R[o].texture&&xn.indexOf(R[o].texture._texture.format)>=0||R[o].renderbuffer&&On.indexOf(R[o].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+o+" is invalid"),R[o]&&R[o].texture){var z=_n[R[o].texture._texture.format]*Sn[R[o].texture._texture.type];null===j?j=z:T(j===z,"all color attachments much have the same number of bits per pixel.")}return h(C,a,d),T(!C||C.texture&&C.texture._texture.format===En||C.renderbuffer&&C.renderbuffer._renderbuffer.format===An,"invalid depth attachment for framebuffer object"),h(L,a,d),T(!L||L.renderbuffer&&L.renderbuffer._renderbuffer.format===In,"invalid stencil attachment for framebuffer object"),h(P,a,d),T(!P||P.texture&&P.texture._texture.format===Tn||P.renderbuffer&&P.renderbuffer._renderbuffer.format===Tn,"invalid depth-stencil attachment for framebuffer object"),x(i),i.width=a,i.height=d,i.colorAttachments=R,i.depthAttachment=C,i.stencilAttachment=L,i.depthStencilAttachment=P,l.color=R.map(m),l.depth=m(C),l.stencil=m(L),l.depthStencil=m(P),l.width=i.width,l.height=i.height,S(i),l}return a.framebufferCount++,l(t,o),e(l,{resize:function(t,e){T(u.next!==i,"can not resize a framebuffer which is currently in use");var n=Math.max(0|t,1),r=Math.max(0|e||n,1);if(n===i.width&&r===i.height)return l;for(var o=i.colorAttachments,a=0;a<o.length;++a)y(o[a],n,r);return y(i.depthAttachment,n,r),y(i.stencilAttachment,n,r),y(i.depthStencilAttachment,n,r),i.width=l.width=n,i.height=l.height=r,S(i),l},_reglType:"framebuffer",_framebuffer:i,destroy:function(){_(i),x(i)},use:function(t){u.setFBO({framebuffer:l},t)}})}return e(u,{getFramebuffer:function(t){if("function"==typeof t&&"framebuffer"===t._reglType){var e=t._framebuffer;if(e instanceof E)return e}return null},create:A,createCube:function(t){var i=Array(6);function a(t){var r;T(i.indexOf(u.next)<0,"can not update framebuffer which is currently in use");var c,l={color:null},d=0,h=null,p="rgba",v="uint8",g=1;if("number"==typeof t)d=0|t;else if(t){T.type(t,"object","invalid arguments for framebuffer");var m=t;if("shape"in m){var y=m.shape;T(Array.isArray(y)&&y.length>=2,"invalid shape for framebuffer"),T(y[0]===y[1],"cube framebuffer must be square"),d=y[0]}else"radius"in m&&(d=0|m.radius),"width"in m?(d=0|m.width,"height"in m&&T(m.height===d,"must be square")):"height"in m&&(d=0|m.height);("color"in m||"colors"in m)&&(h=m.color||m.colors,Array.isArray(h)&&T(1===h.length||n.webgl_draw_buffers,"multiple render targets not supported")),h||("colorCount"in m&&(g=0|m.colorCount,T(g>0,"invalid color buffer count")),"colorType"in m&&(T.oneOf(m.colorType,f,"invalid color type"),v=m.colorType),"colorFormat"in m&&(p=m.colorFormat,T.oneOf(m.colorFormat,s,"invalid color format for texture"))),"depth"in m&&(l.depth=m.depth),"stencil"in m&&(l.stencil=m.stencil),"depthStencil"in m&&(l.depthStencil=m.depthStencil)}else d=1;if(h)if(Array.isArray(h))for(c=[],r=0;r<h.length;++r)c[r]=h[r];else c=[h];else{c=Array(g);var b={radius:d,format:p,type:v};for(r=0;r<g;++r)c[r]=o.createCube(b)}for(l.color=Array(c.length),r=0;r<c.length;++r){var w=c[r];T("function"==typeof w&&"textureCube"===w._reglType,"invalid cube map"),d=d||w.width,T(w.width===d&&w.height===d,"invalid cube map shape"),l.color[r]={target:vn,data:c[r]}}for(r=0;r<6;++r){for(var E=0;E<c.length;++E)l.color[E].target=vn+r;r>0&&(l.depth=i[0].depth,l.stencil=i[0].stencil,l.depthStencil=i[0].depthStencil),i[r]?i[r](l):i[r]=A(l)}return e(a,{width:d,height:d,color:c})}return a(t),e(a,{faces:i,resize:function(t){var e,n=0|t;if(T(n>0&&n<=r.maxCubeMapSize,"invalid radius for cube fbo"),n===a.width)return a;var o=a.color;for(e=0;e<o.length;++e)o[e].resize(n);for(e=0;e<6;++e)i[e].resize(n);return a.width=a.height=n,a},_reglType:"framebufferCube",destroy:function(){i.forEach((function(t){t.destroy()}))}})},clear:function(){Y(w).forEach(_)},restore:function(){u.cur=null,u.next=null,u.dirty=!0,Y(w).forEach((function(e){e.framebuffer=t.createFramebuffer(),S(e)}))}})}(o,d,y,_,S,l),I=Jo(o,f,d,y,b,E,0,A,{},w,x,{elements:null,primitive:4,count:-1,offset:0,instances:-1},m,h,r),O=Un(o,A,I.procs.poll,m,i,d,y),N=I.next,D=o.canvas,M=[],k=[],P=[],j=[r.onDestroy],F=null;function G(){if(0===M.length)return h&&h.update(),void(F=null);F=C.next(G),Ot();for(var t=M.length-1;t>=0;--t){var e=M[t];e&&e(m,null,0)}o.flush(),h&&h.update()}function U(){!F&&M.length>0&&(F=C.next(G))}function K(){F&&(C.cancel(G),F=null)}function Z(t){t.preventDefault(),a=!0,K(),k.forEach((function(t){t()}))}function $(t){o.getError(),a=!1,u.restore(),x.restore(),b.restore(),_.restore(),S.restore(),A.restore(),w.restore(),h&&h.restore(),I.procs.refresh(),U(),P.forEach((function(t){t()}))}function Q(t){function n(t,e){var n={},r={};return Object.keys(t).forEach((function(o){var i=t[o];if(R.isDynamic(i))r[o]=R.unbox(i,o);else{if(e&&Array.isArray(i))for(var a=0;a<i.length;++a)if(R.isDynamic(i[a]))return void(r[o]=R.unbox(i,o));n[o]=i}})),{dynamic:r,static:n}}T(!!t,"invalid args to regl({...})"),T.type(t,"object","invalid args to regl({...})");var r=n(t.context||{},!0),o=n(t.uniforms||{},!0),i=n(t.attributes||{},!1),u=n(function(t){var n=e({},t);function r(t){if(t in n){var e=n[t];delete n[t],Object.keys(e).forEach((function(r){n[t+"."+r]=e[r]}))}}return delete n.uniforms,delete n.attributes,delete n.context,delete n.vao,"stencil"in n&&n.stencil.op&&(n.stencil.opBack=n.stencil.opFront=n.stencil.op,delete n.stencil.op),r("blend"),r("depth"),r("cull"),r("stencil"),r("polygonOffset"),r("scissor"),r("sample"),"vao"in t&&(n.vao=t.vao),n}(t),!1),s={gpuTime:0,cpuTime:0,count:0},c=I.compile(u,i,o,r,s),f=c.draw,l=c.batch,d=c.scope,h=[];return e((function(t,e){var n;if(a&&T.raise("context lost"),"function"==typeof t)return d.call(this,null,t,0);if("function"==typeof e)if("number"==typeof t)for(n=0;n<t;++n)d.call(this,null,e,n);else{if(!Array.isArray(t))return d.call(this,t,e,0);for(n=0;n<t.length;++n)d.call(this,t[n],e,n)}else if("number"==typeof t){if(t>0)return l.call(this,function(t){for(;h.length<t;)h.push(null);return h}(0|t),0|t)}else{if(!Array.isArray(t))return f.call(this,t);if(t.length)return l.call(this,t,t.length)}}),{stats:s,destroy:function(){c.destroy()}})}D&&(D.addEventListener(ei,Z,!1),D.addEventListener(ni,$,!1));var St=A.setFBO=Q({framebuffer:R.define.call(null,1,"framebuffer")});function At(t,e){var n=0;I.procs.poll();var r=e.color;r&&(o.clearColor(+r[0]||0,+r[1]||0,+r[2]||0,+r[3]||0),n|=16384),"depth"in e&&(o.clearDepth(+e.depth),n|=256),"stencil"in e&&(o.clearStencil(0|e.stencil),n|=1024),T(!!n,"called regl.clear with no buffer specified"),o.clear(n)}function It(t){return T.type(t,"function","regl.frame() callback must be a function"),M.push(t),U(),{cancel:function(){var e=ri(M,t);T(e>=0,"cannot cancel a frame twice"),M[e]=function t(){var e=ri(M,t);M[e]=M[M.length-1],M.length-=1,M.length<=0&&K()}}}}function Tt(){var t=N.viewport,e=N.scissor_box;t[0]=t[1]=e[0]=e[1]=0,m.viewportWidth=m.framebufferWidth=m.drawingBufferWidth=t[2]=e[2]=o.drawingBufferWidth,m.viewportHeight=m.framebufferHeight=m.drawingBufferHeight=t[3]=e[3]=o.drawingBufferHeight}function Ot(){m.tick+=1,m.time=Dt(),Tt(),I.procs.poll()}function Nt(){_.refresh(),Tt(),I.procs.refresh(),h&&h.update()}function Dt(){return(L()-p)/1e3}Nt();var Mt=e(Q,{clear:function(t){if(T("object"==typeof t&&t,"regl.clear() takes an object as input"),"framebuffer"in t)if(t.framebuffer&&"framebufferCube"===t.framebuffer_reglType)for(var n=0;n<6;++n)St(e({framebuffer:t.framebuffer.faces[n]},t),At);else St(t,At);else At(0,t)},prop:R.define.bind(null,1),context:R.define.bind(null,2),this:R.define.bind(null,3),draw:Q({}),buffer:function(t){return b.create(t,34962,!1,!1)},elements:function(t){return E.create(t,!1)},texture:_.create2D,cube:_.createCube,renderbuffer:S.create,framebuffer:A.create,framebufferCube:A.createCube,vao:w.createVAO,attributes:i,frame:It,on:function(t,e){var n;switch(T.type(e,"function","listener callback must be a function"),t){case"frame":return It(e);case"lost":n=k;break;case"restore":n=P;break;case"destroy":n=j;break;default:T.raise("invalid event, must be one of frame,lost,restore,destroy")}return n.push(e),{cancel:function(){for(var t=0;t<n.length;++t)if(n[t]===e)return n[t]=n[n.length-1],void n.pop()}}},limits:y,hasExtension:function(t){return y.extensions.indexOf(t.toLowerCase())>=0},read:O,destroy:function(){M.length=0,K(),D&&(D.removeEventListener(ei,Z),D.removeEventListener(ni,$)),x.clear(),A.clear(),S.clear(),_.clear(),E.clear(),b.clear(),w.clear(),h&&h.clear(),j.forEach((function(t){t()}))},_gl:o,_refresh:Nt,poll:function(){Ot(),h&&h.update()},now:Dt,stats:l});return r.onDone(null,Mt),Mt}}()},8982:(t,e,n)=>{var r=n(4075).default;function o(){"use strict";t.exports=o=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var e={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},u="function"==typeof Symbol?Symbol:{},s=u.iterator||"@@iterator",c=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var o=e&&e.prototype instanceof v?e:v,i=Object.create(o.prototype),u=new O(r||[]);return a(i,"_invoke",{value:S(t,n,u)}),i}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var p={};function v(){}function g(){}function m(){}var y={};l(y,s,(function(){return this}));var b=Object.getPrototypeOf,w=b&&b(b(N([])));w&&w!==n&&i.call(w,s)&&(y=w);var E=m.prototype=v.prototype=Object.create(y);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function n(o,a,u,s){var c=h(t[o],t,a);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==r(l)&&i.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,u,s)}),(function(t){n("throw",t,u,s)})):e.resolve(l).then((function(t){f.value=t,u(f)}),(function(t){return n("throw",t,u,s)}))}s(c.arg)}var o;a(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}})}function S(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=A(a,n);if(u){if(u===p)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=h(t,e,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===p)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}function A(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,A(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var o=h(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,p;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function N(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(i.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return r.next=r}}return{next:D}}function D(){return{value:void 0,done:!0}}return g.prototype=m,a(E,"constructor",{value:m,configurable:!0}),a(m,"constructor",{value:g,configurable:!0}),g.displayName=l(m,f,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,l(t,f,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},x(_.prototype),l(_.prototype,c,(function(){return this})),e.AsyncIterator=_,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new _(d(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(E),l(E,f,"Generator"),l(E,s,(function(){return this})),l(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=N,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(T),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var u=i.call(o,"catchLoc"),s=i.call(o,"finallyLoc");if(u&&s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:N(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},4075:t=>{function e(n){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},6298:(t,e,n)=>{var r=n(8982)();t.exports=r;try{regeneratorRuntime=r}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={id:r,loaded:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var r={};return(()=>{"use strict";n(9216);var t,e=(t=n(2680))&&t.__esModule?t:{default:t};e.default._babelPolyfill&&"undefined"!=typeof console&&console.warn&&console.warn("@babel/polyfill is loaded more than once on this page. This is probably not desirable/intended and may have consequences if different versions of the polyfills are applied sequentially. If you do need to load the polyfill more than once, use @babel/polyfill/noConflict instead to bypass the warning."),e.default._babelPolyfill=!0})(),(()=>{"use strict";n.r(r),n.d(r,{CircularLayout:()=>qt,ComboCombinedLayout:()=>Td,ComboForceLayout:()=>Sd,ConcentricLayout:()=>Ff,DagreCompoundLayout:()=>sf,DagreLayout:()=>dr,ERLayout:()=>eh,Force2Layout:()=>K,ForceAtlas2Layout:()=>Rd,ForceLayout:()=>Vt,FruchtermanGPULayout:()=>yd,FruchtermanLayout:()=>Vf,GForceGPULayout:()=>xd,GForceLayout:()=>L,GridLayout:()=>D,Layout:()=>nh,Layouts:()=>rh,MDSLayout:()=>Uf,RadialLayout:()=>jf,RandomLayout:()=>k,getLayoutByName:()=>O,registerLayout:()=>I,unRegisterLayout:()=>T});var t=function(){function t(){this.nodes=[],this.edges=[],this.combos=[],this.comboEdges=[],this.hiddenNodes=[],this.hiddenEdges=[],this.hiddenCombos=[],this.vedges=[],this.positions=[],this.destroyed=!1,this.onLayoutEnd=function(){}}return t.prototype.layout=function(t){return this.init(t),this.execute(!0)},t.prototype.init=function(t){this.nodes=t.nodes||[],this.edges=t.edges||[],this.combos=t.combos||[],this.comboEdges=t.comboEdges||[],this.hiddenNodes=t.hiddenNodes||[],this.hiddenEdges=t.hiddenEdges||[],this.hiddenCombos=t.hiddenCombos||[],this.vedges=t.vedges||[]},t.prototype.execute=function(t){},t.prototype.executeWithWorker=function(){},t.prototype.getDefaultCfg=function(){return{}},t.prototype.updateCfg=function(t){t&&Object.assign(this,t)},t.prototype.getType=function(){return"base"},t.prototype.destroy=function(){this.nodes=null,this.edges=null,this.combos=null,this.positions=null,this.destroyed=!0},t}(),e=function(t){return"string"==typeof t},o=(Object.create(null),Array.isArray),i=function(t){return"number"==typeof t},a=function(t){return Number.isNaN(Number(t))};function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}var s,c=function(){return c=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},c.apply(this,arguments)},f=function(t){return null!==t&&"object"===u(t)},l=function t(e){if(null===e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array){var n=[];return e.forEach((function(t){n.push(t)})),n.map((function(e){return t(e)}))}if("object"===u(e)&&Object.keys(e).length){var r=c({},e);return Object.keys(r).forEach((function(e){r[e]=t(r[e])})),r}return e},d=function(t,e){var n=t[e];return f(n)?n.cell:n},h=function(t,e,n){for(var r=[],o=0;o<t;o++)r[o]={in:0,out:0,all:0};return n?(n.forEach((function(t){var n=d(t,"source"),o=d(t,"target");n&&r[e[n]]&&(r[e[n]].out+=1,r[e[n]].all+=1),o&&r[e[o]]&&(r[e[o]].in+=1,r[e[o]].all+=1)})),r):r},p=function(t){for(var e=[],n=t.length,r=0;r<n;r+=1){e[r]=[];for(var o=0;o<n;o+=1)r===o?e[r][o]=0:0!==t[r][o]&&t[r][o]?e[r][o]=t[r][o]:e[r][o]=1/0}for(var i=0;i<n;i+=1)for(r=0;r<n;r+=1)for(o=0;o<n;o+=1)e[r][o]>e[r][i]+e[i][o]&&(e[r][o]=e[r][i]+e[i][o]);return e},v=function(t,e){var n=t.nodes,r=t.edges,o=[],i={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach((function(t,e){i[t.id]=e,o.push([])})),null==r||r.forEach((function(t){var n=d(t,"source"),r=d(t,"target"),a=i[n],u=i[r];void 0!==a&&void 0!==u&&(o[a][u]=1,e||(o[u][a]=1))})),o},g=function t(e,n){if(e&&e.children)for(var r=e.children.length-1;r>=0;r--)if(!t(e.children[r],n))return;return!!n(e)},m=function(t,e){"function"==typeof e&&g(t,e)},y=function(t){var e={x:0,y:0};t.forEach((function(t){e.x+=t.x||0,e.y+=t.y||0}));var n=t.length||1;return{x:e.x/n,y:e.y/n}},b=function(t,e,n){var r,o;return"source"===t?(null===(r=null==n?void 0:n.find((function(t){return t.target===e.id})))||void 0===r?void 0:r.source)||{}:(null===(o=null==n?void 0:n.find((function(t){return t.source===e.id})))||void 0===o?void 0:o.target)||{}},w=function(t,e,n){var r=[];switch(t){case"source":r=null==n?void 0:n.filter((function(t){return t.source===e.id})).map((function(t){return t.target}));break;case"target":r=null==n?void 0:n.filter((function(t){return t.target===e.id})).map((function(t){return t.source}));break;case"both":r=null==n?void 0:n.filter((function(t){return t.source===e.id})).map((function(t){return t.target})).concat(null==n?void 0:n.filter((function(t){return t.target===e.id})).map((function(t){return t.source})))}var o=new Set(r);return Array.from(o)},E=function(t){return"function"==typeof t},x=function(t,e,n){return n||(i(t)?function(){return t}:function(){return e})},_=function(t,e,n){return void 0===n&&(n=!0),e||0===e?E(e)?e:i(e)?function(){return e}:o(e)?function(){if(n){var r=Math.max.apply(Math,e);return isNaN(r)?t:r}return e}:f(e)?function(){if(n){var r=Math.max(e.width,e.height);return isNaN(r)?t:r}return[e.width,e.height]}:function(){return t}:function(e){return e.size?o(e.size)?e.size[0]>e.size[1]?e.size[0]:e.size[1]:f(e.size)?e.size.width>e.size.height?e.size.width:e.size.height:e.size:t}},S=(s=function(t,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},s(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),A=new Map,I=function(e,n){if(A.get(e)&&console.warn("The layout with the name ".concat(e," exists already, it will be overridden")),f(n)){var r=function(t){function e(e){var r,o,i=r=t.call(this)||this,a={},u=Object.assign({},i.getDefaultCfg(),(null===(o=n.getDefaultCfg)||void 0===o?void 0:o.call(n))||{});return Object.assign(a,u,n,e),Object.keys(a).forEach((function(t){var e=a[t];i[t]=e})),r}return S(e,t),e}(t);A.set(e,r)}else A.set(e,n);return A.get(e)},T=function(t){A.has(t)&&A.delete(t)},O=function(t){return A.has(t)?A.get(t):null},N=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),D=function(t){function n(e){var n=t.call(this)||this;return n.begin=[0,0],n.preventOverlap=!0,n.preventOverlapPadding=10,n.condense=!1,n.sortBy="degree",n.nodes=[],n.edges=[],n.width=300,n.height=300,n.row=0,n.col=0,n.cellWidth=0,n.cellHeight=0,n.cellUsed={},n.id2manPos={},n.onLayoutEnd=function(){},n.updateCfg(e),n}return N(n,t),n.prototype.getDefaultCfg=function(){return{begin:[0,0],preventOverlap:!0,preventOverlapPadding:10,condense:!1,rows:void 0,cols:void 0,position:void 0,sortBy:"degree",nodeSize:30}},n.prototype.execute=function(){var t=this,n=t.nodes,r=t.edges,i=t.begin,u=n.length;if(0===u)return t.onLayoutEnd&&t.onLayoutEnd(),{nodes:n,edges:r};if(1===u)return n[0].x=i[0],n[0].y=i[1],t.onLayoutEnd&&t.onLayoutEnd(),{nodes:n,edges:r};var s=t.sortBy,c=t.width,f=t.height,l=t.condense,d=t.preventOverlapPadding,p=t.preventOverlap,v=t.nodeSpacing,g=t.nodeSize,m=[];n.forEach((function(t){m.push(t)}));var y={};if(m.forEach((function(t,e){y[t.id]=e})),("degree"===s||!e(s)||void 0===m[0][s])&&(s="degree",a(n[0].degree))){var b=h(m.length,y,r);m.forEach((function(t,e){t.degree=b[e].all}))}m.sort((function(t,e){return e[s]-t[s]})),c||"undefined"==typeof window||(c=window.innerWidth),f||"undefined"==typeof window||(f=window.innerHeight);var w=t.rows,E=null!=t.cols?t.cols:t.columns;if(t.cells=u,null!=w&&null!=E?(t.rows=w,t.cols=E):null!=w&&null==E?(t.rows=w,t.cols=Math.ceil(t.cells/t.rows)):null==w&&null!=E?(t.cols=E,t.rows=Math.ceil(t.cells/t.cols)):(t.splits=Math.sqrt(t.cells*t.height/t.width),t.rows=Math.round(t.splits),t.cols=Math.round(t.width/t.height*t.splits)),t.rows=Math.max(t.rows,1),t.cols=Math.max(t.cols,1),t.cols*t.rows>t.cells)((S=t.small())-1)*(x=t.large())>=t.cells?t.small(S-1):(x-1)*S>=t.cells&&t.large(x-1);else for(;t.cols*t.rows<t.cells;){var x,S=t.small();((x=t.large())+1)*S>=t.cells?t.large(x+1):t.small(S+1)}if(t.cellWidth=c/t.cols,t.cellHeight=f/t.rows,l&&(t.cellWidth=0,t.cellHeight=0),p||v){var A=_(10,v),I=_(30,g,!1);m.forEach((function(e){e.x&&e.y||(e.x=0,e.y=0);var n,r,i=I(e)||30;o(i)?(n=i[0],r=i[1]):(n=i,r=i);var a=void 0!==A?A(e):d,u=n+a,s=r+a;t.cellWidth=Math.max(t.cellWidth,u),t.cellHeight=Math.max(t.cellHeight,s)}))}t.cellUsed={},t.row=0,t.col=0,t.id2manPos={};for(var T=0;T<m.length;T++){var O=m[T],N=void 0;if(t.position&&(N=t.position(O)),N&&(void 0!==N.row||void 0!==N.col)){var D={row:N.row,col:N.col};if(void 0===D.col)for(D.col=0;t.used(D.row,D.col);)D.col++;else if(void 0===D.row)for(D.row=0;t.used(D.row,D.col);)D.row++;t.id2manPos[O.id]=D,t.use(D.row,D.col)}t.getPos(O)}return t.onLayoutEnd&&t.onLayoutEnd(),{edges:r,nodes:m}},n.prototype.small=function(t){var e,n=this,r=n.rows||5,o=n.cols||5;return null==t?e=Math.min(r,o):Math.min(r,o)===n.rows?n.rows=t:n.cols=t,e},n.prototype.large=function(t){var e,n=this,r=n.rows||5,o=n.cols||5;return null==t?e=Math.max(r,o):Math.max(r,o)===n.rows?n.rows=t:n.cols=t,e},n.prototype.used=function(t,e){return this.cellUsed["c-".concat(t,"-").concat(e)]||!1},n.prototype.use=function(t,e){this.cellUsed["c-".concat(t,"-").concat(e)]=!0},n.prototype.moveToNextCell=function(){var t=this,e=t.cols||5;t.col++,t.col>=e&&(t.col=0,t.row++)},n.prototype.getPos=function(t){var e,n,r=this,o=r.begin,i=r.cellWidth,a=r.cellHeight,u=r.id2manPos[t.id];if(u)e=u.col*i+i/2+o[0],n=u.row*a+a/2+o[1];else{for(;r.used(r.row,r.col);)r.moveToNextCell();e=r.col*i+i/2+o[0],n=r.row*a+a/2+o[1],r.use(r.row,r.col),r.moveToNextCell()}t.x=e,t.y=n},n.prototype.getType=function(){return"grid"},n}(t),M=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),k=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.width=300,n.height=300,n.nodes=[],n.edges=[],n.onLayoutEnd=function(){},n.updateCfg(e),n}return M(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],width:300,height:300}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.center;return t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),e&&e.forEach((function(e){e.x=.9*(Math.random()-.5)*t.width+n[0],e.y=.9*(Math.random()-.5)*t.height+n[1]})),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:this.edges}},e.prototype.getType=function(){return"random"},e}(t),R=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),C=function(t,e){return t?i(t)?function(e){return t}:t:function(t){return e||1}},L=function(t){function e(e){var n=t.call(this)||this;return n.maxIteration=500,n.workerEnabled=!1,n.edgeStrength=200,n.nodeStrength=1e3,n.coulombDisScale=.005,n.damping=.9,n.maxSpeed=1e3,n.minMovement=.5,n.interval=.02,n.factor=1,n.linkDistance=1,n.gravity=10,n.preventOverlap=!0,n.collideStrength=1,n.tick=function(){},n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.animate=!0,n.updateCfg(e),n}return R(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},e.prototype.execute=function(){var t,e,n=this,r=n.nodes;if(void 0!==n.timeInterval&&"undefined"!=typeof window&&window.clearInterval(n.timeInterval),r&&0!==r.length){n.width||"undefined"==typeof window||(n.width=window.innerWidth),n.height||"undefined"==typeof window||(n.height=window.innerHeight),n.center||(n.center=[n.width/2,n.height/2]);var a=n.center;if(1===r.length)return r[0].x=a[0],r[0].y=a[1],void(null===(e=n.onLayoutEnd)||void 0===e||e.call(n));var u={},s={};r.forEach((function(t,e){i(t.x)||(t.x=Math.random()*n.width),i(t.y)||(t.y=Math.random()*n.height),u[t.id]=t,s[t.id]=e})),n.nodeMap=u,n.nodeIdxMap=s,n.linkDistance=C(n.linkDistance,1),n.nodeStrength=C(n.nodeStrength,1),n.edgeStrength=C(n.edgeStrength,1);var c,l=n.nodeSize;if(n.preventOverlap){var d,p=n.nodeSpacing;d=i(p)?function(){return p}:E(p)?p:function(){return 0},c=l?o(l)?function(t){return Math.max(l[0],l[1])+d(t)}:function(t){return l+d(t)}:function(t){return t.size?o(t.size)?Math.max(t.size[0],t.size[1])+d(t):f(t.size)?Math.max(t.size.width,t.size.height)+d(t):t.size+d(t):10+d(t)}}n.nodeSize=c;var v=n.edges;n.degrees=h(r.length,n.nodeIdxMap,v),n.getMass||(n.getMass=function(t){return t.mass||n.degrees[n.nodeIdxMap[t.id]].all||1}),n.run()}else null===(t=n.onLayoutEnd)||void 0===t||t.call(n)},e.prototype.run=function(){var t,e=this,n=e.maxIteration,r=e.nodes,o=e.workerEnabled,i=e.minMovement,a=e.animate;if(r)if(o||!a){for(var u=0;u<n;u++){var s=e.runOneStep(u);if(e.reachMoveThreshold(r,s,i))break}null===(t=e.onLayoutEnd)||void 0===t||t.call(e)}else{if("undefined"==typeof window)return;var c=0;this.timeInterval=window.setInterval((function(){var t,o;if(r){var a=e.runOneStep(c)||[];e.reachMoveThreshold(r,a,i)&&(null===(t=e.onLayoutEnd)||void 0===t||t.call(e),window.clearInterval(e.timeInterval)),++c>=n&&(null===(o=e.onLayoutEnd)||void 0===o||o.call(e),window.clearInterval(e.timeInterval))}}),0)}},e.prototype.reachMoveThreshold=function(t,e,n){var r=0;return t.forEach((function(t,n){var o=t.x-e[n].x,i=t.y-e[n].y;r+=Math.sqrt(o*o+i*i)})),(r/=t.length)<n},e.prototype.runOneStep=function(t){var e,n=this,r=n.nodes,o=n.edges,i=[],a=[];if(r){r.forEach((function(t,e){i[2*e]=0,i[2*e+1]=0,a[2*e]=0,a[2*e+1]=0})),n.calRepulsive(i,r),o&&n.calAttractive(i,o),n.calGravity(i,r);var u=Math.max(.02,n.interval-.002*t);n.updateVelocity(i,a,u,r);var s=[];return r.forEach((function(t){s.push({x:t.x,y:t.y})})),n.updatePosition(a,u,r),null===(e=n.tick)||void 0===e||e.call(n),s}},e.prototype.calRepulsive=function(t,e){var n=this,r=n.getMass,o=n.factor,i=n.coulombDisScale,a=n.preventOverlap,u=n.collideStrength,s=void 0===u?1:u,c=n.nodeStrength,f=n.nodeSize;e.forEach((function(n,u){var l=r?r(n):1;e.forEach((function(e,d){if(!(u>=d)){var h=n.x-e.x,p=n.y-e.y;0===h&&0===p&&(h=.01*Math.random(),p=.01*Math.random());var v=h*h+p*p,g=Math.sqrt(v),m=(g+.1)*i,y=h/g,b=p/g,w=.5*(c(n)+c(e))*o/(m*m),E=r?r(e):1;if(t[2*u]+=y*w,t[2*u+1]+=b*w,t[2*d]-=y*w,t[2*d+1]-=b*w,a&&(f(n)+f(e))/2>g){var x=s*(c(n)+c(e))*.5/v;t[2*u]+=y*x/l,t[2*u+1]+=b*x/l,t[2*d]-=y*x/E,t[2*d+1]-=b*x/E}}}))}))},e.prototype.calAttractive=function(t,e){var n=this,r=n.nodeMap,o=n.nodeIdxMap,i=n.linkDistance,a=n.edgeStrength,u=n.nodeSize,s=n.getMass;e.forEach((function(e,n){var c=d(e,"source"),f=d(e,"target"),l=r[c],h=r[f],p=h.x-l.x,v=h.y-l.y;0===p&&0===v&&(p=.01*Math.random(),v=.01*Math.random());var g=Math.sqrt(p*p+v*v),m=p/g,y=v/g,b=((i(e,l,h)||1+(u(l)+u(h)||0)/2)-g)*a(e),w=o[c],E=o[f],x=s?s(l):1,_=s?s(h):1;t[2*w]-=m*b/x,t[2*w+1]-=y*b/x,t[2*E]+=m*b/_,t[2*E+1]+=y*b/_}))},e.prototype.calGravity=function(t,e){for(var n=this,r=n.center,o=n.gravity,a=n.degrees,u=e.length,s=0;s<u;s++){var c=e[s],f=c.x-r[0],l=c.y-r[1],d=o;if(n.getCenter){var h=n.getCenter(c,a[s].all);h&&i(h[0])&&i(h[1])&&i(h[2])&&(f=c.x-h[0],l=c.y-h[1],d=h[2])}d&&(t[2*s]-=d*f,t[2*s+1]-=d*l)}},e.prototype.updateVelocity=function(t,e,n,r){var o=this,i=n*o.damping;r.forEach((function(n,r){var a=t[2*r]*i||.01,u=t[2*r+1]*i||.01,s=Math.sqrt(a*a+u*u);if(s>o.maxSpeed){var c=o.maxSpeed/s;a*=c,u*=c}e[2*r]=a,e[2*r+1]=u}))},e.prototype.updatePosition=function(t,e,n){n.forEach((function(n,r){if(i(n.fx)&&i(n.fy))return n.x=n.fx,void(n.y=n.fy);var o=t[2*r]*e,a=t[2*r+1]*e;n.x+=o,n.y+=a}))},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){var t=this;t.stop(),t.tick=null,t.nodes=null,t.edges=null,t.destroyed=!0},e.prototype.getType=function(){return"gForce"},e}(t);function P(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var o,i,a,u,s,c,f,l,d,h=t._root,p={data:r},v=t._x0,g=t._y0,m=t._x1,y=t._y1;if(!h)return t._root=p,t;for(;h.length;)if((c=e>=(i=(v+m)/2))?v=i:m=i,(f=n>=(a=(g+y)/2))?g=a:y=a,o=h,!(h=h[l=f<<1|c]))return o[l]=p,t;if(u=+t._x.call(null,h.data),s=+t._y.call(null,h.data),e===u&&n===s)return p.next=h,o?o[l]=p:t._root=p,t;do{o=o?o[l]=new Array(4):t._root=new Array(4),(c=e>=(i=(v+m)/2))?v=i:m=i,(f=n>=(a=(g+y)/2))?g=a:y=a}while((l=f<<1|c)==(d=(s>=a)<<1|u>=i));return o[d]=h,o[l]=p,t}function j(t,e,n,r,o){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=o}function z(t){return t[0]}function F(t){return t[1]}function G(t,e,n){var r=new U(null==e?z:e,null==n?F:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function U(t,e,n,r,o,i){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=o,this._y1=i,this._root=void 0}function B(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var V=G.prototype=U.prototype;function W(t){var e=0,n=0,r=0;if(t.length){for(var o=0;o<4;o++)(i=t[o])&&i.weight&&(e+=i.weight,n+=i.x*i.weight,r+=i.y*i.weight);t.x=n/e,t.y=r/e,t.weight=e}else{var i=t;t.x=i.data.x,t.y=i.data.y,t.weight=i.data.weight}}V.copy=function(){var t,e,n=new U(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=B(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var o=0;o<4;++o)(e=r.source[o])&&(e.length?t.push({source:e,target:r.target[o]=new Array(4)}):r.target[o]=B(e));return n},V.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return P(this.cover(e,n),e,n,t)},V.addAll=function(t){var e,n,r,o,i=t.length,a=new Array(i),u=new Array(i),s=1/0,c=1/0,f=-1/0,l=-1/0;for(n=0;n<i;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(o=+this._y.call(null,e))||(a[n]=r,u[n]=o,r<s&&(s=r),r>f&&(f=r),o<c&&(c=o),o>l&&(l=o));if(s>f||c>l)return this;for(this.cover(s,c).cover(f,l),n=0;n<i;++n)P(this,a[n],u[n],t[n]);return this},V.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,o=this._x1,i=this._y1;if(isNaN(n))o=(n=Math.floor(t))+1,i=(r=Math.floor(e))+1;else{for(var a,u,s=o-n||1,c=this._root;n>t||t>=o||r>e||e>=i;)switch(u=(e<r)<<1|t<n,(a=new Array(4))[u]=c,c=a,s*=2,u){case 0:o=n+s,i=r+s;break;case 1:n=o-s,i=r+s;break;case 2:o=n+s,r=i-s;break;case 3:n=o-s,r=i-s}this._root&&this._root.length&&(this._root=c)}return this._x0=n,this._y0=r,this._x1=o,this._y1=i,this},V.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},V.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},V.find=function(t,e,n){var r,o,i,a,u,s,c,f=this._x0,l=this._y0,d=this._x1,h=this._y1,p=[],v=this._root;for(v&&p.push(new j(v,f,l,d,h)),null==n?n=1/0:(f=t-n,l=e-n,d=t+n,h=e+n,n*=n);s=p.pop();)if(!(!(v=s.node)||(o=s.x0)>d||(i=s.y0)>h||(a=s.x1)<f||(u=s.y1)<l))if(v.length){var g=(o+a)/2,m=(i+u)/2;p.push(new j(v[3],g,m,a,u),new j(v[2],o,m,g,u),new j(v[1],g,i,a,m),new j(v[0],o,i,g,m)),(c=(e>=m)<<1|t>=g)&&(s=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=s)}else{var y=t-+this._x.call(null,v.data),b=e-+this._y.call(null,v.data),w=y*y+b*b;if(w<n){var E=Math.sqrt(n=w);f=t-E,l=e-E,d=t+E,h=e+E,r=v.data}}return r},V.remove=function(t){if(isNaN(i=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,n,r,o,i,a,u,s,c,f,l,d,h=this._root,p=this._x0,v=this._y0,g=this._x1,m=this._y1;if(!h)return this;if(h.length)for(;;){if((c=i>=(u=(p+g)/2))?p=u:g=u,(f=a>=(s=(v+m)/2))?v=s:m=s,e=h,!(h=h[l=f<<1|c]))return this;if(!h.length)break;(e[l+1&3]||e[l+2&3]||e[l+3&3])&&(n=e,d=l)}for(;h.data!==t;)if(r=h,!(h=h.next))return this;return(o=h.next)&&delete h.next,r?(o?r.next=o:delete r.next,this):e?(o?e[l]=o:delete e[l],(h=e[0]||e[1]||e[2]||e[3])&&h===(e[3]||e[2]||e[1]||e[0])&&!h.length&&(n?n[d]=h:this._root=h),this):(this._root=o,this)},V.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},V.root=function(){return this._root},V.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},V.visit=function(t){var e,n,r,o,i,a,u=[],s=this._root;for(s&&u.push(new j(s,this._x0,this._y0,this._x1,this._y1));e=u.pop();)if(!t(s=e.node,r=e.x0,o=e.y0,i=e.x1,a=e.y1)&&s.length){var c=(r+i)/2,f=(o+a)/2;(n=s[3])&&u.push(new j(n,c,f,i,a)),(n=s[2])&&u.push(new j(n,r,f,c,a)),(n=s[1])&&u.push(new j(n,c,o,i,f)),(n=s[0])&&u.push(new j(n,r,o,c,f))}return this},V.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new j(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var o=e.node;if(o.length){var i,a=e.x0,u=e.y0,s=e.x1,c=e.y1,f=(a+s)/2,l=(u+c)/2;(i=o[0])&&n.push(new j(i,a,u,f,l)),(i=o[1])&&n.push(new j(i,f,u,s,l)),(i=o[2])&&n.push(new j(i,a,l,f,c)),(i=o[3])&&n.push(new j(i,f,l,s,c))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},V.x=function(t){return arguments.length?(this._x=t,this):this._x},V.y=function(t){return arguments.length?(this._y=t,this):this._y};var X=function(t,e,n,r,o,i){var a=i.x-t.x||.1,u=i.y-t.y||.1,s=r-e,c=a*a+u*u,f=Math.sqrt(c)*c;if(s*s*.81<c){var l=t.weight/f;return i.vx+=a*l,i.vy+=u*l,!0}if(t.length)return!1;t.data!==i&&(l=t.data.weight/f,i.vx+=a*l,i.vy+=u*l)},H=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),q=function(){return q=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},q.apply(this,arguments)},Y=function(t,e){return t?i(t)?function(e){return t}:t:function(t){return e||1}},K=function(t){function e(e){var n=t.call(this)||this;n.maxIteration=1e3,n.workerEnabled=!1,n.edgeStrength=200,n.nodeStrength=1e3,n.coulombDisScale=.005,n.damping=.9,n.maxSpeed=500,n.minMovement=.4,n.interval=.02,n.factor=1,n.linkDistance=200,n.gravity=0,n.clusterNodeStrength=20,n.preventOverlap=!0,n.distanceThresholdMode="mean",n.tick=function(){},n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.judgingDistance=0,n.centripetalOptions={leaf:2,single:2,others:1,center:function(t){return{x:n.width/2,y:n.height/2}}};var r=e.getMass;return n.propsGetMass=r,n.updateCfg(e),n}return H(e,t),e.prototype.getCentripetalOptions=function(){var t,e=this,n=e.leafCluster,r=e.clustering,o=e.nodeClusterBy,i=e.nodes,a=e.nodeMap,u=e.clusterNodeStrength,s=function(t){return"function"==typeof u?u(t):u},c={};if(n){t=this.getSameTypeLeafMap()||{};var f=Array.from(new Set(null==i?void 0:i.map((function(t){return t[o]}))))||[];c={single:100,leaf:function(e,n,r){var o=t[e.id]||{},i=o.relativeLeafNodes,a=o.sameTypeLeafNodes;return(null==a?void 0:a.length)===(null==i?void 0:i.length)||1===(null==f?void 0:f.length)?1:s(e)},others:1,center:function(e,n,r){var o,i,a=((null===(o=e.data)||void 0===o?void 0:o.layout)||{}).degree;if(!a)return{x:100,y:100};if(1===a){var u=(t[e.id]||{}).sameTypeLeafNodes,s=void 0===u?[]:u;1===s.length?i=void 0:s.length>1&&(i=y(s))}else i=void 0;return{x:null==i?void 0:i.x,y:null==i?void 0:i.y}}}}if(r){t||(t=this.getSameTypeLeafMap());var l=Array.from(new Set(i.map((function(t,e){return t[o]})))).filter((function(t){return void 0!==t})),d={};l.forEach((function(t){var e=i.filter((function(e){return e[o]===t})).map((function(t){return a[t.id]}));d[t]=y(e)})),c={single:function(t){return s(t)},leaf:function(t){return s(t)},others:function(t){return s(t)},center:function(t,e,n){var r=d[t[o]];return{x:null==r?void 0:r.x,y:null==r?void 0:r.y}}}}this.centripetalOptions=q(q({},this.centripetalOptions),c);var h=this.centripetalOptions,p=h.leaf,v=h.single,g=h.others;p&&"function"!=typeof p&&(this.centripetalOptions.leaf=function(){return p}),v&&"function"!=typeof v&&(this.centripetalOptions.single=function(){return v}),g&&"function"!=typeof g&&(this.centripetalOptions.others=function(){return g})},e.prototype.updateCfg=function(t){t&&Object.assign(this,t)},e.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},e.prototype.execute=function(){console.log("here111");var t=this;t.stop();var e=t.nodes,n=t.edges,r=t.defSpringLen;if(t.judgingDistance=0,e&&0!==e.length){t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]);var a=t.center;if(1===e.length)return e[0].x=a[0],e[0].y=a[1],void t.onLayoutEnd([q({},e[0])]);t.degreesMap=function(t,e){var n={};return t.forEach((function(t){n[t.id]={in:0,out:0,all:0}})),e?(e.forEach((function(t){var e=d(t,"source"),r=d(t,"target");e&&(n[e].out+=1,n[e].all+=1),r&&(n[r].in+=1,n[r].all+=1)})),n):n}(e,n),t.propsGetMass?t.getMass=t.propsGetMass:t.getMass=function(e){var n=1;i(e.mass)&&(n=e.mass);var r=t.degreesMap[e.id].all;return!r||r<5?n:5*r*n};var u,s=t.nodeSize;if(t.preventOverlap){var c,l=t.nodeSpacing;c=i(l)?function(){return l}:E(l)?l:function(){return 0},u=s?o(s)?function(t){return Math.max(s[0],s[1])+c(t)}:function(t){return s+c(t)}:function(t){return t.size?o(t.size)?Math.max(t.size[0],t.size[1])+c(t):f(t.size)?Math.max(t.size.width,t.size.height)+c(t):t.size+c(t):10+c(t)}}t.nodeSize=u,t.linkDistance=Y(t.linkDistance,1),t.nodeStrength=Y(t.nodeStrength,1),t.edgeStrength=Y(t.edgeStrength,1);var h={},p={};e.forEach((function(e,r){i(e.x)||(e.x=Math.random()*t.width),i(e.y)||(e.y=Math.random()*t.height);var o=t.degreesMap[e.id];h[e.id]=q(q({},e),{data:q(q({},e.data),{size:t.nodeSize(e)||30,layout:{inDegree:o.in,outDegree:o.out,degree:o.all,tDegree:o.in,sDegree:o.out,force:{mass:t.getMass(e),nodeStrength:t.nodeStrength(e,n)}}})}),p[e.id]=r})),t.nodeMap=h,t.nodeIdxMap=p,t.edgeInfos=[],null==n||n.forEach((function(e){var n=h[e.source],o=h[e.target];n&&o?t.edgeInfos.push({edgeStrength:t.edgeStrength(e),linkDistance:r?r(q(q({},e),{source:n,target:o}),n,o):t.linkDistance(e,n,o)||1+(s(n)+s(n)||0)/2}):elf.edgeInfos.push({})})),this.getCentripetalOptions(),t.onLayoutEnd=t.onLayoutEnd||function(){},t.run()}else t.onLayoutEnd([])},e.prototype.run=function(){var t=this,e=t.maxIteration,n=t.nodes,r=t.workerEnabled,o=t.minMovement,i=t.animate,a=t.nodeMap;if(n){var u=[];n.forEach((function(t,e){u[2*e]=0,u[2*e+1]=0}));var s=e;if(r||!i){for(var c=0;(t.judgingDistance>o||c<1)&&c<s;c++)t.runOneStep(c,u);t.onLayoutEnd(Object.values(a))}else{if("undefined"==typeof window)return;var f=0;this.timeInterval=window.setInterval((function(){n&&(t.runOneStep(f,u),(++f>=s||t.judgingDistance<o)&&(t.onLayoutEnd(Object.values(a)),window.clearInterval(t.timeInterval)))}),0)}}},e.prototype.runOneStep=function(t,e){var n,r=this,o=r.nodes,i=r.edges,a=(r.nodeMap,r.monitor),u=[];if(null==o?void 0:o.length){r.calRepulsive(u),i&&r.calAttractive(u),r.calGravity(u),r.attractToSide(u);var s=r.interval;r.updateVelocity(u,e,s),r.updatePosition(e,s),null===(n=r.tick)||void 0===n||n.call(r),a&&a({energy:this.calTotalEnergy(u),nodes:o,edges:i,iterations:t})}},e.prototype.calTotalEnergy=function(t){var e=this.nodes,n=this.nodeMap;if(!(null==e?void 0:e.length))return 0;var r=0;return e.forEach((function(e,o){var i=t[2*o],a=t[2*o+1],u=i*i+a*a,s=n[e.id].data.layout.force.mass;r+=(void 0===s?1:s)*u*.5})),r},e.prototype.calRepulsive=function(t){var e=this,n=e.nodes,r=e.nodeMap,o=e.factor,i=e.coulombDisScale;e.nodeSize,function(t,e,n,r,o){var i=n/r,a=t.map((function(t,n){var r=e[t.id],o=r.data,a=r.x,u=r.y,s=r.size,c=o.layout.force.nodeStrength;return{x:a,y:u,size:s,index:n,vx:0,vy:0,weight:i*c}})),u=G(a,(function(t){return t.x}),(function(t){return t.y})).visitAfter(W);a.forEach((function(t){!function(t,e){e.visit((function(e,n,r,o,i){return X(e,n,r,o,i,t)}))}(t,u)})),a.map((function(n,r){var i=e[t[r].id].data.layout.force.mass,a=void 0===i?1:i;o[2*r]=n.vx/a,o[2*r+1]=n.vy/a}))}(n,r,o,i*i,t)},e.prototype.calAttractive=function(t){var e=this,n=e.edges,r=e.nodeMap,o=e.nodeIdxMap,i=e.edgeInfos;e.nodeSize,n.forEach((function(e,n){var a=d(e,"source"),u=d(e,"target"),s=r[a],c=r[u];if(s&&c){var f=c.x-s.x,l=c.y-s.y;f||l||(f=.01*Math.random(),l=.01*Math.random());var h=Math.sqrt(f*f+l*l),p=f/h,v=l/h,g=i[n]||{},m=g.linkDistance,y=void 0===m?200:m,b=g.edgeStrength,w=(y-h)*(void 0===b?200:b),E=1/(s.data.layout.force.mass||1),x=1/(c.data.layout.force.mass||1),_=p*w,S=v*w,A=2*o[a],I=2*o[u];t[A]-=_*E,t[A+1]-=S*E,t[I]+=_*x,t[I+1]+=S*x}}))},e.prototype.calGravity=function(t){var e,n=this,r=n.nodes,o=n.edges,a=void 0===o?[]:o,u=n.nodeMap,s=n.width,c=n.height,f=n.center,l=n.gravity,d=n.degreesMap,h=n.centripetalOptions;if(r)for(var p=r.length,v=0;v<p;v++){var g=2*v,m=u[r[v].id],y=m.data.layout.force.mass,b=void 0===y?1:y,w=0,E=0,x=l,_=d[m.id],S=_.in,A=_.out,I=_.all,T=null===(e=n.getCenter)||void 0===e?void 0:e.call(n,m,I);if(T){var O=T[0],N=T[1],D=T[2];w=m.x-O,E=m.y-N,x=D}else w=m.x-f[0],E=m.y-f[1];if(x&&(t[g]-=x*w/b,t[g+1]-=x*E/b),h){var M=h.leaf,k=h.single,R=h.others,C=h.center,L=(null==C?void 0:C(m,r,a,s,c))||{x:0,y:0,centerStrength:0},P=L.x,j=L.y,z=L.centerStrength;if(!i(P)||!i(j))continue;var F=(m.x-P)/b,G=(m.y-j)/b;if(z&&(t[g]-=z*F,t[g+1]-=z*G),0===I){var U=k(m);if(!U)continue;t[g]-=U*F,t[g+1]-=U*G;continue}if(0===S||0===A){var B=M(m,r,a);if(!B)continue;t[g]-=B*F,t[g+1]-=B*G;continue}var V=R(m);if(!V)continue;t[g]-=V*F,t[g+1]-=V*G}}},e.prototype.attractToSide=function(t){var e=this,n=e.defSideCoe,r=e.height,o=e.nodes,i=e.edges;if(n&&"function"==typeof n&&(null==o?void 0:o.length)){var a={};i.forEach((function(t){var e=t.source,n=t.target;a[e.id]=a[e.id]||[],a[e.id].push(t),a[n.id]=a[n.id]||[],a[n.id].push(t)})),o.forEach((function(e,o){var i=n(e,a[e.id]||[]);if(0!==i){var u=i>0?0:r,s=Math.abs(i);t[2*o+1]-=s*(u-e.y)}}))}},e.prototype.updateVelocity=function(t,e,n){var r=this,o=r.nodes,i=r.damping,a=r.maxSpeed;(null==o?void 0:o.length)&&o.forEach((function(r,o){var u=(e[2*o]+t[2*o]*n)*i||.01,s=(e[2*o+1]+t[2*o+1]*n)*i||.01,c=Math.sqrt(u*u+s*s);if(c>a){var f=a/c;u*=f,s*=f}e[2*o]=u,e[2*o+1]=s}))},e.prototype.updatePosition=function(t,e){var n=this,r=n.nodes,o=n.distanceThresholdMode,a=n.nodeMap;if(null==r?void 0:r.length){var u=0;"max"===o?n.judgingDistance=-1/0:"min"===o&&(n.judgingDistance=1/0),r.forEach((function(r,s){var c=a[r.id];if(i(r.fx)&&i(r.fy))return r.x=r.fx,r.y=r.fy,c.x=r.x,void(c.y=r.y);var f=t[2*s]*e,l=t[2*s+1]*e;r.x+=f,r.y+=l,c.x=r.x,c.y=r.y;var d=Math.sqrt(f*f+l*l);switch(o){case"max":n.judgingDistance<d&&(n.judgingDistance=d);break;case"min":n.judgingDistance>d&&(n.judgingDistance=d);break;default:u+=d}})),o&&"mean"!==o||(n.judgingDistance=u/r.length)}else this.judgingDistance=0},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){var t=this;t.stop(),t.tick=null,t.nodes=null,t.edges=null,t.destroyed=!0},e.prototype.getType=function(){return"force2"},e.prototype.getSameTypeLeafMap=function(){var t=this,e=t.nodeClusterBy,n=t.nodes,r=t.edges,o=t.nodeMap,i=t.degreesMap;if(null==n?void 0:n.length){var a={};return n.forEach((function(t,n){1===i[t.id].all&&(a[t.id]=function(t,e,n,r,o,i){var a=o[e.id],u=a.in,s=a.out,c=e,f=[];0===u?(c=b("source",e,n),f=w("both",c,n).map((function(t){return i[t]}))):0===s&&(c=b("target",e,n),f=w("both",c,n).map((function(t){return i[t]}))),f=f.filter((function(t){return o[t.id]&&(0===o[t.id].in||0===o[t.id].out)}));var l=function(t,e,n,r,o){var i=n[e]||"",a=(null==r?void 0:r.filter((function(t){return t[e]===i})))||[];return a=a.filter((function(t){var e,n;return 0===(null===(e=o[t.id])||void 0===e?void 0:e.in)||0===(null===(n=o[t.id])||void 0===n?void 0:n.out)})),a}(0,r,e,f,o);return{coreNode:c,relativeLeafNodes:f,sameTypeLeafNodes:l}}(0,t,r,e,i,o))})),a}},e}(t);function Z(t){return function(){return t}}function $(t){return 1e-6*(t()-.5)}var Q={value:()=>{}};function J(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new tt(r)}function tt(t){this._=t}function et(t,e){for(var n,r=0,o=t.length;r<o;++r)if((n=t[r]).name===e)return n.value}function nt(t,e,n){for(var r=0,o=t.length;r<o;++r)if(t[r].name===e){t[r]=Q,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}tt.prototype=J.prototype={constructor:tt,on:function(t,e){var n,r,o=this._,i=(r=o,(t+"").trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),a=-1,u=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a<u;)if(n=(t=i[a]).type)o[n]=nt(o[n],t.name,e);else if(null==e)for(n in o)o[n]=nt(o[n],t.name,null);return this}for(;++a<u;)if((n=(t=i[a]).type)&&(n=et(o[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new tt(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,o=new Array(n),i=0;i<n;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=0,n=(r=this._[t]).length;i<n;++i)r[i].value.apply(e,o)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],o=0,i=r.length;o<i;++o)r[o].value.apply(e,n)}};const rt=J;var ot,it,at=0,ut=0,st=0,ct=1e3,ft=0,lt=0,dt=0,ht="object"==typeof performance&&performance.now?performance:Date,pt="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function vt(){return lt||(pt(gt),lt=ht.now()+dt)}function gt(){lt=0}function mt(){this._call=this._time=this._next=null}function yt(t,e,n){var r=new mt;return r.restart(t,e,n),r}function bt(){lt=(ft=ht.now())+dt,at=ut=0;try{!function(){vt(),++at;for(var t,e=ot;e;)(t=lt-e._time)>=0&&e._call.call(null,t),e=e._next;--at}()}finally{at=0,function(){for(var t,e,n=ot,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:ot=e);it=t,Et(r)}(),lt=0}}function wt(){var t=ht.now(),e=t-ft;e>ct&&(dt-=e,ft=t)}function Et(t){at||(ut&&(ut=clearTimeout(ut)),t-lt>24?(t<1/0&&(ut=setTimeout(bt,t-ht.now()-dt)),st&&(st=clearInterval(st))):(st||(ft=ht.now(),st=setInterval(wt,ct)),at=1,pt(bt)))}mt.prototype=yt.prototype={constructor:mt,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?vt():+n)+(null==e?0:+e),this._next||it===this||(it?it._next=this:ot=this,it=this),this._call=t,this._time=n,Et()},stop:function(){this._call&&(this._call=null,this._time=1/0,Et())}};const xt=1664525,_t=1013904223,St=4294967296;function At(t){return t.x}function It(t){return t.y}var Tt=10,Ot=Math.PI*(3-Math.sqrt(5));function Nt(t){var e,n=1,r=.001,o=1-Math.pow(r,1/300),i=0,a=.6,u=new Map,s=yt(l),c=rt("tick","end"),f=function(){let t=1;return()=>(t=(xt*t+_t)%St)/St}();function l(){d(),c.call("tick",e),n<r&&(s.stop(),c.call("end",e))}function d(r){var s,c,f=t.length;void 0===r&&(r=1);for(var l=0;l<r;++l)for(n+=(i-n)*o,u.forEach((function(t){t(n)})),s=0;s<f;++s)null==(c=t[s]).fx?c.x+=c.vx*=a:(c.x=c.fx,c.vx=0),null==c.fy?c.y+=c.vy*=a:(c.y=c.fy,c.vy=0);return e}function h(){for(var e,n=0,r=t.length;n<r;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var o=Tt*Math.sqrt(.5+n),i=n*Ot;e.x=o*Math.cos(i),e.y=o*Math.sin(i)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function p(e){return e.initialize&&e.initialize(t,f),e}return null==t&&(t=[]),h(),e={tick:d,restart:function(){return s.restart(l),e},stop:function(){return s.stop(),e},nodes:function(n){return arguments.length?(t=n,h(),u.forEach(p),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(r=+t,e):r},alphaDecay:function(t){return arguments.length?(o=+t,e):+o},alphaTarget:function(t){return arguments.length?(i=+t,e):i},velocityDecay:function(t){return arguments.length?(a=1-t,e):1-a},randomSource:function(t){return arguments.length?(f=t,u.forEach(p),e):f},force:function(t,n){return arguments.length>1?(null==n?u.delete(t):u.set(t,p(n)),e):u.get(t)},find:function(e,n,r){var o,i,a,u,s,c=0,f=t.length;for(null==r?r=1/0:r*=r,c=0;c<f;++c)(a=(o=e-(u=t[c]).x)*o+(i=n-u.y)*i)<r&&(s=u,r=a);return s},on:function(t,n){return arguments.length>1?(c.on(t,n),e):c.on(t)}}}function Dt(){var t,e,n,r,o,i=Z(-30),a=1,u=1/0,s=.81;function c(n){var o,i=t.length,a=G(t,At,It).visitAfter(l);for(r=n,o=0;o<i;++o)e=t[o],a.visit(d)}function f(){if(t){var e,n,r=t.length;for(o=new Array(r),e=0;e<r;++e)n=t[e],o[n.index]=+i(n,e,t)}}function l(t){var e,n,r,i,a,u=0,s=0;if(t.length){for(r=i=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(u+=e.value,s+=n,r+=n*e.x,i+=n*e.y);t.x=r/s,t.y=i/s}else{(e=t).x=e.data.x,e.y=e.data.y;do{u+=o[e.data.index]}while(e=e.next)}t.value=u}function d(t,i,c,f){if(!t.value)return!0;var l=t.x-e.x,d=t.y-e.y,h=f-i,p=l*l+d*d;if(h*h/s<p)return p<u&&(0===l&&(p+=(l=$(n))*l),0===d&&(p+=(d=$(n))*d),p<a&&(p=Math.sqrt(a*p)),e.vx+=l*t.value*r/p,e.vy+=d*t.value*r/p),!0;if(!(t.length||p>=u)){(t.data!==e||t.next)&&(0===l&&(p+=(l=$(n))*l),0===d&&(p+=(d=$(n))*d),p<a&&(p=Math.sqrt(a*p)));do{t.data!==e&&(h=o[t.data.index]*r/p,e.vx+=l*h,e.vy+=d*h)}while(t=t.next)}}return c.initialize=function(e,r){t=e,n=r,f()},c.strength=function(t){return arguments.length?(i="function"==typeof t?t:Z(+t),f(),c):i},c.distanceMin=function(t){return arguments.length?(a=t*t,c):Math.sqrt(a)},c.distanceMax=function(t){return arguments.length?(u=t*t,c):Math.sqrt(u)},c.theta=function(t){return arguments.length?(s=t*t,c):Math.sqrt(s)},c}function Mt(t,e){var n,r=1;function o(){var o,i,a=n.length,u=0,s=0;for(o=0;o<a;++o)u+=(i=n[o]).x,s+=i.y;for(u=(u/a-t)*r,s=(s/a-e)*r,o=0;o<a;++o)(i=n[o]).x-=u,i.y-=s}return null==t&&(t=0),null==e&&(e=0),o.initialize=function(t){n=t},o.x=function(e){return arguments.length?(t=+e,o):t},o.y=function(t){return arguments.length?(e=+t,o):e},o.strength=function(t){return arguments.length?(r=+t,o):r},o}function kt(t){return t.index}function Rt(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}function Ct(t){var e,n,r,o,i,a,u=kt,s=function(t){return 1/Math.min(o[t.source.index],o[t.target.index])},c=Z(30),f=1;function l(r){for(var o=0,u=t.length;o<f;++o)for(var s,c,l,d,h,p,v,g=0;g<u;++g)c=(s=t[g]).source,d=(l=s.target).x+l.vx-c.x-c.vx||$(a),h=l.y+l.vy-c.y-c.vy||$(a),d*=p=((p=Math.sqrt(d*d+h*h))-n[g])/p*r*e[g],h*=p,l.vx-=d*(v=i[g]),l.vy-=h*v,c.vx+=d*(v=1-v),c.vy+=h*v}function d(){if(r){var a,s,c=r.length,f=t.length,l=new Map(r.map(((t,e)=>[u(t,e,r),t])));for(a=0,o=new Array(c);a<f;++a)(s=t[a]).index=a,"object"!=typeof s.source&&(s.source=Rt(l,s.source)),"object"!=typeof s.target&&(s.target=Rt(l,s.target)),o[s.source.index]=(o[s.source.index]||0)+1,o[s.target.index]=(o[s.target.index]||0)+1;for(a=0,i=new Array(f);a<f;++a)s=t[a],i[a]=o[s.source.index]/(o[s.source.index]+o[s.target.index]);e=new Array(f),h(),n=new Array(f),p()}}function h(){if(r)for(var n=0,o=t.length;n<o;++n)e[n]=+s(t[n],n,t)}function p(){if(r)for(var e=0,o=t.length;e<o;++e)n[e]=+c(t[e],e,t)}return null==t&&(t=[]),l.initialize=function(t,e){r=t,a=e,d()},l.links=function(e){return arguments.length?(t=e,d(),l):t},l.id=function(t){return arguments.length?(u=t,l):u},l.iterations=function(t){return arguments.length?(f=+t,l):f},l.strength=function(t){return arguments.length?(s="function"==typeof t?t:Z(+t),h(),l):s},l.distance=function(t){return arguments.length?(c="function"==typeof t?t:Z(+t),p(),l):c},l}function Lt(t){return t.x+t.vx}function Pt(t){return t.y+t.vy}function jt(t){var e,n,r,o=1,i=1;function a(){for(var t,a,s,c,f,l,d,h=e.length,p=0;p<i;++p)for(a=G(e,Lt,Pt).visitAfter(u),t=0;t<h;++t)s=e[t],l=n[s.index],d=l*l,c=s.x+s.vx,f=s.y+s.vy,a.visit(v);function v(t,e,n,i,a){var u=t.data,h=t.r,p=l+h;if(!u)return e>c+p||i<c-p||n>f+p||a<f-p;if(u.index>s.index){var v=c-u.x-u.vx,g=f-u.y-u.vy,m=v*v+g*g;m<p*p&&(0===v&&(m+=(v=$(r))*v),0===g&&(m+=(g=$(r))*g),m=(p-(m=Math.sqrt(m)))/m*o,s.vx+=(v*=m)*(p=(h*=h)/(d+h)),s.vy+=(g*=m)*p,u.vx-=v*(p=1-p),u.vy-=g*p)}}}function u(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function s(){if(e){var r,o,i=e.length;for(n=new Array(i),r=0;r<i;++r)o=e[r],n[o.index]=+t(o,r,e)}}return"function"!=typeof t&&(t=Z(null==t?1:+t)),a.initialize=function(t,n){e=t,r=n,s()},a.iterations=function(t){return arguments.length?(i=+t,a):i},a.strength=function(t){return arguments.length?(o=+t,a):o},a.radius=function(e){return arguments.length?(t="function"==typeof e?e:Z(+e),s(),a):t},a}function zt(t){var e,n,r,o=Z(.1);function i(t){for(var o,i=0,a=e.length;i<a;++i)(o=e[i]).vx+=(r[i]-o.x)*n[i]*t}function a(){if(e){var i,a=e.length;for(n=new Array(a),r=new Array(a),i=0;i<a;++i)n[i]=isNaN(r[i]=+t(e[i],i,e))?0:+o(e[i],i,e)}}return"function"!=typeof t&&(t=Z(null==t?0:+t)),i.initialize=function(t){e=t,a()},i.strength=function(t){return arguments.length?(o="function"==typeof t?t:Z(+t),a(),i):o},i.x=function(e){return arguments.length?(t="function"==typeof e?e:Z(+e),a(),i):t},i}function Ft(t){var e,n,r,o=Z(.1);function i(t){for(var o,i=0,a=e.length;i<a;++i)(o=e[i]).vy+=(r[i]-o.y)*n[i]*t}function a(){if(e){var i,a=e.length;for(n=new Array(a),r=new Array(a),i=0;i<a;++i)n[i]=isNaN(r[i]=+t(e[i],i,e))?0:+o(e[i],i,e)}}return"function"!=typeof t&&(t=Z(null==t?0:+t)),i.initialize=function(t){e=t,a()},i.strength=function(t){return arguments.length?(o="function"==typeof t?t:Z(+t),a(),i):o},i.y=function(e){return arguments.length?(t="function"==typeof e?e:Z(+e),a(),i):t},i}var Gt="GPU_LAYOUT_END",Ut={gForce:!0,force2:!0,fruchterman:!0,forceAtlas2:!0,force:!0,"graphin-force":!0},Bt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vt=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.nodeStrength=null,n.edgeStrength=null,n.preventOverlap=!1,n.clusterNodeStrength=null,n.clusterEdgeStrength=null,n.clusterEdgeDistance=null,n.clusterNodeSize=null,n.clusterFociStrength=null,n.linkDistance=50,n.alphaDecay=.028,n.alphaMin=.001,n.alpha=.3,n.collideStrength=1,n.workerEnabled=!1,n.tick=function(){},n.onLayoutEnd=function(){},n.ticking=void 0,e&&n.updateCfg(e),n}return Bt(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],nodeStrength:null,edgeStrength:null,preventOverlap:!1,nodeSize:void 0,nodeSpacing:void 0,linkDistance:50,forceSimulation:null,alphaDecay:.028,alphaMin:.001,alpha:.3,collideStrength:1,clustering:!1,clusterNodeStrength:-1,clusterEdgeStrength:.1,clusterEdgeDistance:100,clusterFociStrength:.8,clusterNodeSize:10,tick:function(){},onLayoutEnd:function(){},workerEnabled:!1}},e.prototype.init=function(t){var e=this;e.nodes=t.nodes||[];var n=t.edges||[];e.edges=n.map((function(t){var e={},n=["targetNode","sourceNode","startPoint","endPoint"];return Object.keys(t).forEach((function(r){n.indexOf(r)>-1||(e[r]=t[r])})),e})),e.ticking=!1},e.prototype.execute=function(t){var e=this,n=e.nodes,r=e.edges;if(!e.ticking){var o=e.forceSimulation,i=e.alphaMin,a=e.alphaDecay,u=e.alpha;if(o)t&&(e.clustering&&e.clusterForce&&(e.clusterForce.nodes(n),e.clusterForce.links(r)),o.nodes(n),r&&e.edgeForce?e.edgeForce.links(r):r&&!e.edgeForce&&(f=Ct().id((function(t){return t.id})).links(r),e.edgeStrength&&f.strength(e.edgeStrength),e.linkDistance&&f.distance(e.linkDistance),e.edgeForce=f,o.force("link",f))),e.preventOverlap&&e.overlapProcess(o),o.alpha(u).restart(),this.ticking=!0;else try{var s=Dt();if(e.nodeStrength&&s.strength(e.nodeStrength),o=Nt().nodes(n),e.clustering){var c=function(){function t(t){return function(){return t}}var e,n=function(t){return t.cluster},r=t(1),o=t(-1),i=t(100),a=t(.1),u=[0,0],s=[],c={},f=[],l=100,h=100,p={none:{x:0,y:0}},v=[],g="force",m=!0,y=.1;function b(t){if(!m)return b;e.tick(),E();for(var r=0,o=s.length,i=void 0,a=t*y;r<o;++r)(i=s[r]).vx+=(p[n(i)].x-i.x)*a,i.vy+=(p[n(i)].y-i.y)*a}function w(){s&&function(){if(s&&s.length){if(void 0===n(s[0]))throw Error("Couldnt find the grouping attribute for the nodes. Make sure to set it up with forceInABox.groupBy('clusterAttr') before calling .links()");var t,u,p,g,m,y=(t=[],u=[],p={},m=[],g=function(t){var e={};return t.forEach((function(t){var r=n(t);e[r]||(e[r]={count:0,sumforceNodeSize:0})})),t.forEach((function(t){var o=n(t),i=r(t),a=e[o];a.count=a.count+1,a.sumforceNodeSize=a.sumforceNodeSize+Math.PI*(i*i)*1.3,e[o]=a})),e}(s),m=function(t){var e={},r=[];return t.forEach((function(t){var r=function(t){var e=d(t,"source"),r=d(t,"target"),o=n(c[e]),i=n(c[r]);return o<=i?"".concat(o,"~").concat(i):"".concat(i,"~").concat(o)}(t),o=0;void 0!==e[r]&&(o=e[r]),o+=1,e[r]=o})),Object.entries(e).forEach((function(t){var e=t[0],n=t[1],o=e.split("~")[0],i=e.split("~")[1];void 0!==o&&void 0!==i&&r.push({source:o,target:i,count:n})})),r}(f),Object.keys(g).forEach((function(e,n){var r=g[e];t.push({id:e,size:r.count,r:Math.sqrt(r.sumforceNodeSize/Math.PI)}),p[e]=n})),m.forEach((function(t){var e=d(t,"source"),n=d(t,"target"),r=p[e],o=p[n];void 0!==r&&void 0!==o&&u.push({source:r,target:o,count:t.count})})),{nodes:t,links:u});e=Nt(y.nodes).force("x",zt(l).strength(.1)).force("y",Ft(h).strength(.1)).force("collide",jt((function(t){return t.r})).iterations(4)).force("charge",Dt().strength(o)).force("links",Ct(y.nodes.length?y.links:[]).distance(i).strength(a)),v=e.nodes(),E()}}()}function E(){return p={none:{x:0,y:0}},v.forEach((function(t){p[t.id]={x:t.x-u[0],y:t.y-u[1]}})),p}return b.initialize=function(t){s=t,w()},b.template=function(t){return arguments.length?(g=t,w(),b):g},b.groupBy=function(t){return arguments.length?"string"==typeof t?(n=function(e){return e[t]},b):(n=t,b):n},b.enableGrouping=function(t){return arguments.length?(m=t,b):m},b.strength=function(t){return arguments.length?(y=t,b):y},b.centerX=function(t){return arguments.length?(l=t,b):l},b.centerY=function(t){return arguments.length?(h=t,b):h},b.nodes=function(t){return arguments.length?(function(t){c={},t.forEach((function(t){c[t.id]=t}))}(t||[]),s=t||[],b):s},b.links=function(t){return arguments.length?(f=t||[],w(),b):f},b.forceNodeSize=function(e){return arguments.length?(r="function"==typeof e?e:t(+e),w(),b):r},b.nodeSize=b.forceNodeSize,b.forceCharge=function(e){return arguments.length?(o="function"==typeof e?e:t(+e),w(),b):o},b.forceLinkDistance=function(e){return arguments.length?(i="function"==typeof e?e:t(+e),w(),b):i},b.forceLinkStrength=function(e){return arguments.length?(a="function"==typeof e?e:t(+e),w(),b):a},b.offset=function(t){return arguments.length?(u=t,b):u},b.getFocis=E,b}();c.centerX(e.center[0]).centerY(e.center[1]).template("force").strength(e.clusterFociStrength),r&&c.links(r),n&&c.nodes(n),c.forceLinkDistance(e.clusterEdgeDistance).forceLinkStrength(e.clusterEdgeStrength).forceCharge(e.clusterNodeStrength).forceNodeSize(e.clusterNodeSize),e.clusterForce=c,o.force("group",c)}if(o.force("center",Mt(e.center[0],e.center[1])).force("charge",s).alpha(u).alphaDecay(a).alphaMin(i),e.preventOverlap&&e.overlapProcess(o),r){var f=Ct().id((function(t){return t.id})).links(r);e.edgeStrength&&f.strength(e.edgeStrength),e.linkDistance&&f.distance(e.linkDistance),e.edgeForce=f,o.force("link",f)}if(e.workerEnabled&&!Wt()&&(e.workerEnabled=!1,console.warn("workerEnabled option is only supported when running in web worker.")),e.workerEnabled){o.stop();for(var l=function(t){var e=t.alphaMin(),n=t.alphaTarget(),r=t.alpha(),o=Math.log((e-n)/(r-n))/Math.log(1-t.alphaDecay());return Math.ceil(o)}(o),h=1;h<=l;h++)o.tick(),postMessage({nodes:n,currentTick:h,totalTicks:l,type:"LAYOUT_TICK"},void 0);e.ticking=!1}else o.on("tick",(function(){e.tick()})).on("end",(function(){e.ticking=!1,e.onLayoutEnd&&e.onLayoutEnd()})),e.ticking=!0;e.forceSimulation=o,e.ticking=!0}catch(t){e.ticking=!1,console.warn(t)}}},e.prototype.overlapProcess=function(t){var e,n,r=this,a=r.nodeSize,u=r.nodeSpacing,s=r.collideStrength;if(n=i(u)?function(){return u}:E(u)?u:function(){return 0},a)if(E(a))e=function(t){return a(t)+n(t)};else if(o(a)){var c=(a[0]>a[1]?a[0]:a[1])/2;e=function(t){return c+n(t)}}else if(i(a)){var l=a/2;e=function(t){return l+n(t)}}else e=function(){return 10};else e=function(t){return t.size?o(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2+n(t):f(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)/2+n(t):t.size/2+n(t):10+n(t)};t.force("collisionForce",jt(e).strength(s))},e.prototype.updateCfg=function(t){var e=this;e.ticking&&(e.forceSimulation.stop(),e.ticking=!1),e.forceSimulation=null,Object.assign(e,t)},e.prototype.destroy=function(){var t=this;t.ticking&&(t.forceSimulation.stop(),t.ticking=!1),t.nodes=null,t.edges=null,t.destroyed=!0},e}(t);function Wt(){return"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope}var Xt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function Ht(t,e){var n=t.degree,r=e.degree;return n<r?-1:n>r?1:0}var qt=function(t){function e(e){var n=t.call(this)||this;return n.radius=null,n.nodeSize=void 0,n.startRadius=null,n.endRadius=null,n.startAngle=0,n.endAngle=2*Math.PI,n.clockwise=!0,n.divisions=1,n.ordering=null,n.angleRatio=1,n.nodes=[],n.edges=[],n.nodeMap={},n.degrees=[],n.width=300,n.height=300,n.updateCfg(e),n}return Xt(e,t),e.prototype.getDefaultCfg=function(){return{radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1}},e.prototype.execute=function(){var t,e=this,n=e.nodes,r=e.edges,o=n.length;if(0!==o){e.width||"undefined"==typeof window||(e.width=window.innerWidth),e.height||"undefined"==typeof window||(e.height=window.innerHeight),e.center||(e.center=[e.width/2,e.height/2]);var i=e.center;if(1===o)return n[0].x=i[0],n[0].y=i[1],void(e.onLayoutEnd&&e.onLayoutEnd());var a=e.radius,u=e.startRadius,s=e.endRadius,c=e.divisions,f=e.startAngle,l=e.endAngle,d=e.angleRatio,p=e.ordering,v=e.clockwise,g=e.nodeSpacing,m=e.nodeSize,y=(l-f)/o,b={};n.forEach((function(t,e){b[t.id]=e})),e.nodeMap=b;var w=h(n.length,b,r);if(e.degrees=w,g){var E=_(10,g),x=_(10,m),S=-1/0;n.forEach((function(t){var e=x(t);S<e&&(S=e)}));var A=0;n.forEach((function(t,e){A+=0===e?S||10:(E(t)||0)+(S||10)})),a=A/(2*Math.PI)}else a||u||s?!u&&s?u=s:u&&!s&&(s=u):a=e.height>e.width?e.width/2:e.height/2;var I=y*d,T=[];T="topology"===p?e.topologyOrdering():"topology-directed"===p?e.topologyOrdering(!0):"degree"===p?e.degreeOrdering():n;for(var O=Math.ceil(o/c),N=0;N<o;++N){var D=a;D||null===u||null===s||(D=u+N*(s-u)/(o-1)),D||(D=10+100*N/(o-1));var M=f+N%O*I+2*Math.PI/c*Math.floor(N/O);v||(M=l-N%O*I-2*Math.PI/c*Math.floor(N/O)),T[N].x=i[0]+Math.cos(M)*D,T[N].y=i[1]+Math.sin(M)*D,T[N].weight=w[N].all}return null===(t=e.onLayoutEnd)||void 0===t||t.call(e),{nodes:T,edges:this.edges}}e.onLayoutEnd&&e.onLayoutEnd()},e.prototype.topologyOrdering=function(t){void 0===t&&(t=!1);var e=this,n=e.degrees,r=e.edges,o=e.nodes,i=l(o),a=e.nodeMap,u=[i[0]],s=[o[0]],c=[],f=o.length;c[0]=!0,function(t,e,n,r){t.forEach((function(e,n){t[n].children=[],t[n].parent=[]})),r?e.forEach((function(e){var r=d(e,"source"),o=d(e,"target"),i=0;r&&(i=n[r]);var a=0;o&&(a=n[o]);var u=t[i].children,s=t[a].parent;u.push(t[a].id),s.push(t[i].id)})):e.forEach((function(e){var r=d(e,"source"),o=d(e,"target"),i=0;r&&(i=n[r]);var a=0;o&&(a=n[o]);var u=t[i].children,s=t[a].children;u.push(t[a].id),s.push(t[i].id)}))}(i,r,a,t);var h=0;return i.forEach((function(t,e){if(0!==e)if(e!==f-1&&n[e].all===n[e+1].all&&!function(t,e,n){for(var r=n.length,o=0;o<r;o++){var i=d(n[o],"source"),a=d(n[o],"target");if(t.id===i&&e.id===a||e.id===i&&t.id===a)return!0}return!1}(u[h],t,r)||c[e]){for(var l=u[h].children,p=!1,v=0;v<l.length;v++){var g=a[l[v]];if(n[g].all===n[e].all&&!c[g]){u.push(i[g]),s.push(o[a[i[g].id]]),c[g]=!0,p=!0;break}}for(var m=0;!p&&(c[m]||(u.push(i[m]),s.push(o[a[i[m].id]]),c[m]=!0,p=!0),++m!==f););}else u.push(t),s.push(o[a[t.id]]),c[e]=!0,h++})),s},e.prototype.degreeOrdering=function(){var t=this.nodes,e=[],n=this.degrees;return t.forEach((function(t,r){t.degree=n[r].all,e.push(t)})),e.sort(Ht),e},e.prototype.getType=function(){return"circular"},e}(t),Yt=function(t,e){if("next"!==t&&"prev"!==t)return e},Kt=function(t){t.prev.next=t.next,t.next.prev=t.prev,delete t.next,delete t.prev};const Zt=function(){function t(){var t={};t.prev=t,t.next=t.prev,this.shortcut=t}return t.prototype.dequeue=function(){var t=this.shortcut,e=t.prev;if(e&&e!==t)return Kt(e),e},t.prototype.enqueue=function(t){var e=this.shortcut;t.prev&&t.next&&Kt(t),t.next=e.next,e.next.prev=t,e.next=t,t.prev=e},t.prototype.toString=function(){for(var t=[],e=this.shortcut,n=e.prev;n!==e;)t.push(JSON.stringify(n,Yt)),n=null==n?void 0:n.prev;return"[".concat(t.join(", "),"]")},t}();var $t;function Qt(t,e){var n=t.get(e)||0;t.set(e,n+1)}function Jt(t,e){var n=t.get(e);void 0!==n&&((n-=1)>0?t.set(e,n):t.delete(e))}function te(t,e,n,r){var o=String(e),i=String(n);if(!t&&o>i){var a=o;o=i,i=a}return o+$t.EDGE_KEY_DELIM+i+$t.EDGE_KEY_DELIM+(void 0===r?$t.DEFAULT_EDGE_NAME:r)}function ee(t,e,n,r){var o=String(e),i=String(n),a={v:e,w:n};if(!t&&o>i){var u=a.v;a.v=a.w,a.w=u}return void 0!==r&&(a.name=r),a}function ne(t,e){return te(t,e.v,e.w,e.name)}function re(t){return"function"==typeof t}!function(t){t.DEFAULT_EDGE_NAME="\0",t.GRAPH_NODE="\0",t.EDGE_KEY_DELIM=""}($t||($t={}));var oe=function(t){return t.nodes().map((function(e){var n={id:e,value:t.node(e),parent:t.parent(e)};return void 0===n.value&&delete n.value,void 0===n.parent&&delete n.parent,n}))},ie=function(t){return t.edges().map((function(e){var n=t.edge(e),r={v:e.v,w:e.w,value:n,name:e.name};return void 0===r.name&&delete r.name,void 0===r.value&&delete r.value,r}))};function ae(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ue(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ae(Object(n),!0).forEach((function(e){se(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ae(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function se(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ce(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var fe={compound:!1,multigraph:!1,directed:!0},le=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.directed=!0,this.multigraph=!1,this.compound=!1,this.GRAPH_NODE=$t.GRAPH_NODE,this.label=void 0,this.nodeCountNum=0,this.edgeCountNum=0,this.defaultNodeLabelFn=function(){},this.defaultEdgeLabelFn=function(){},this.parentMap=void 0,this.childrenMap=void 0,this.nodesLabelMap=new Map,this.inEdgesMap=new Map,this.outEdgesMap=new Map,this.predecessorsMap=new Map,this.successorsMap=new Map,this.edgesMap=new Map,this.edgesLabelsMap=new Map,this.isDirected=function(){return e.directed},this.isMultigraph=function(){return e.multigraph},this.isCompound=function(){return e.compound},this.setGraph=function(t){return e.label=t,e},this.graph=function(){return e.label},this.setDefaultNodeLabel=function(t){return re(t)?e.defaultNodeLabelFn=t:e.defaultNodeLabelFn=function(){return t},e},this.nodeCount=function(){return e.nodeCountNum},this.node=function(t){return e.nodesLabelMap.get(t)},this.nodes=function(){return Array.from(e.nodesLabelMap.keys())},this.sources=function(){return e.nodes().filter((function(t){var n;return!(null===(n=e.inEdgesMap.get(t))||void 0===n?void 0:n.size)}))},this.sinks=function(){return e.nodes().filter((function(t){var n;return!(null===(n=e.outEdgesMap.get(t))||void 0===n?void 0:n.size)}))},this.setNodes=function(t,n){return t.map((function(t){return e.setNode(t,n)})),e},this.hasNode=function(t){return e.nodesLabelMap.has(t)},this.checkCompound=function(){if(!e.isCompound())throw new Error("Cannot construct parent-children relations in a non-compound graph")},this.parent=function(t){if(e.isCompound()){var n,r=null===(n=e.parentMap)||void 0===n?void 0:n.get(t);if(r!==e.GRAPH_NODE)return r}},this.removeFromParentsChildList=function(t){var n=e.parentMap.get(t);e.childrenMap.get(n).delete(t)},this.setParent=function(t,n){var r,o;e.checkCompound();for(var i=void 0===n?e.GRAPH_NODE:n,a=e.parent(i);a;){if(t===a)throw new Error("Setting "+n+" as parent of "+t+" would create a cycle");a=e.parent(a)}n&&e.setNode(n),e.setNode(t),e.removeFromParentsChildList(t),null===(r=e.parentMap)||void 0===r||r.set(t,i);var u=e.childrenMap.get(i);return u.set(t,!0),null===(o=e.childrenMap)||void 0===o||o.set(i,u),e},this.children=function(t){var n=void 0===t?e.GRAPH_NODE:t;if(e.isCompound()){var r,o=null===(r=e.childrenMap)||void 0===r?void 0:r.get(n);return o?Array.from(o.keys()):void 0}return n===e.GRAPH_NODE?e.nodes():t&&e.hasNode(t)?[]:void 0},this.predecessors=function(t){var n=e.predecessorsMap.get(t);return n?Array.from(n.keys()):void 0},this.successors=function(t){var n=e.successorsMap.get(t);return n?Array.from(n.keys()):void 0},this.neighbors=function(t){var n;if(e.hasNode(t))return Array.from(new Set(null===(n=e.predecessors(t))||void 0===n?void 0:n.concat(e.successors(t))))},this.isLeaf=function(t){var n,r;return e.isDirected()?!(null===(r=e.successors(t))||void 0===r?void 0:r.length):!(null===(n=e.neighbors(t))||void 0===n?void 0:n.length)},this.filterNodes=function(n){var r=e.directed,o=e.multigraph,i=e.compound,a=new t({directed:r,multigraph:o,compound:i});return a.setGraph(e.graph()),e.nodes().forEach((function(t){n(t)&&a.setNode(t,e.node(t))})),e.edges().forEach((function(t){a.hasNode(t.v)&&a.hasNode(t.w)&&a.setEdgeObj(t,e.edge(t))})),i&&a.nodes().forEach((function(t){a.setParent(t,function(t){for(var n=e.parent(t);void 0!==n&&!a.hasNode(n);)n=e.parent(n);return n}(t))})),a},this.setDefaultEdgeLabel=function(t){return re(t)?e.defaultEdgeLabelFn=t:e.defaultEdgeLabelFn=function(){return t},e},this.edgeCount=function(){return e.edgeCountNum},this.setEdgeObj=function(t,n){return e.setEdge(t.v,t.w,n,t.name)},this.setPath=function(t,n){return t.reduce((function(t,r){return e.setEdge(t,r,n),r})),e},this.edgeFromArgs=function(t,n,r){return e.edge({v:t,w:n,name:r})},this.edge=function(t){return e.edgesLabelsMap.get(ne(e.isDirected(),t))},this.hasEdge=function(t,n,r){return e.edgesLabelsMap.has(ne(e.isDirected(),{v:t,w:n,name:r}))},this.removeEdgeObj=function(t){var n=t.v,r=t.w,o=t.name;return e.removeEdge(n,r,o)},this.edges=function(){return Array.from(e.edgesMap.values())},this.inEdges=function(t,n){var r=e.inEdgesMap.get(t);if(r)return Array.from(r.values()).filter((function(t){return!n||t.v===n}))},this.outEdges=function(t,n){var r=e.outEdgesMap.get(t);if(r)return Array.from(r.values()).filter((function(t){return!n||t.w===n}))},this.nodeEdges=function(t,n){var r;if(e.hasNode(t))return null===(r=e.inEdges(t,n))||void 0===r?void 0:r.concat(e.outEdges(t,n))},this.toJSON=function(){return void 0===(n={options:{directed:(t=e).isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:oe(t),edges:ie(t),value:t.graph()}).value&&delete n.value,n;var t,n},this.nodeInDegree=function(t){var n=e.inEdgesMap.get(t);return n?n.size:0},this.nodeOutDegree=function(t){var n=e.outEdgesMap.get(t);return n?n.size:0},this.nodeDegree=function(t){return e.nodeInDegree(t)+e.nodeOutDegree(t)},this.source=function(t){return t.v},this.target=function(t){return t.w};var r=ue(ue({},fe),n);this.compound=r.compound,this.directed=r.directed,this.multigraph=r.multigraph,this.compound&&(this.parentMap=new Map,this.childrenMap=new Map)}var e,n;return e=t,n=[{key:"setNode",value:function(t,e){var n,r=this.nodesLabelMap,o=this.defaultNodeLabelFn,i=this.isCompound,a=this.parentMap,u=this.childrenMap,s=this.inEdgesMap,c=this.outEdgesMap,f=this.predecessorsMap,l=this.successorsMap;return r.has(t)?(void 0!==e&&r.set(t,e),this):(r.set(t,e||o(t)),i()&&(null==a||a.set(t,this.GRAPH_NODE),null==u||u.set(t,new Map),(null==u?void 0:u.has(this.GRAPH_NODE))||null==u||u.set(this.GRAPH_NODE,new Map),null==u||null===(n=u.get(this.GRAPH_NODE))||void 0===n||n.set(t,!0)),[s,c,f,l].forEach((function(e){return e.set(t,new Map)})),this.nodeCountNum+=1,this)}},{key:"removeNode",value:function(t){var e=this;if(this.hasNode(t)){var n,r,o,i=function(t){e.removeEdge(t.v,t.w,t.name)},a=this.inEdgesMap,u=this.outEdgesMap,s=this.predecessorsMap,c=this.successorsMap,f=this.nodesLabelMap;this.isCompound()&&(this.removeFromParentsChildList(t),null===(n=this.parentMap)||void 0===n||n.delete(t),null===(r=this.children(t))||void 0===r||r.forEach((function(t){return e.setParent(t)})),null===(o=this.childrenMap)||void 0===o||o.delete(t));var l=a.get(t),d=u.get(t);Array.from(l.values()).forEach((function(t){return i(t)})),Array.from(d.values()).forEach((function(t){return i(t)})),f.delete(t),a.delete(t),u.delete(t),s.delete(t),c.delete(t),this.nodeCountNum-=1}return this}},{key:"setEdge",value:function(t,e,n,r){var o,i,a=ee(this.isDirected(),t,e,r),u=ne(this.isDirected(),a),s=a.v,c=a.w;if(this.edgesLabelsMap.has(u))return this.edgesLabelsMap.set(u,n),this;if(void 0!==r&&!this.isMultigraph())throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(s),this.setNode(c),this.edgesLabelsMap.set(u,n||this.defaultEdgeLabelFn(s,c,r)),Object.freeze(a),this.edgesMap.set(u,a);var f=this.predecessorsMap.get(c),l=this.successorsMap.get(s);return Qt(f,s),Qt(l,c),null===(o=this.inEdgesMap.get(c))||void 0===o||o.set(u,a),null===(i=this.outEdgesMap.get(s))||void 0===i||i.set(u,a),this.edgeCountNum+=1,this}},{key:"removeEdge",value:function(t,e,n){var r=te(this.isDirected(),t,e,n);if(this.edgesMap.get(r)){var o=ee(this.isDirected(),t,e,n),i=o.v,a=o.w;this.edgesLabelsMap.delete(r),this.edgesMap.delete(r);var u=this.predecessorsMap.get(a),s=this.successorsMap.get(i);Jt(u,i),Jt(s,a),this.inEdgesMap.get(a).delete(r),this.outEdgesMap.get(i).delete(r),this.edgeCountNum-=1}return this}}],n&&ce(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();le.fromJSON=function(t){var e=new le(t.options);return void 0!==t.value&&e.setGraph(t.value),t.nodes.forEach((function(t){e.setNode(t.id,t.value),t.parent&&e.setParent(t.id,t.parent)})),t.edges.forEach((function(t){e.setEdge(t.v,t.w,t.value,t.name)})),e},Error;var de=function t(e,n,r,o,i,a){o.includes(n)||(o.push(n),r||a.push(n),i(n).forEach((function(n){return t(e,n,r,o,i,a)})),r&&a.push(n))};const he=function(t,e,n){var r=Array.isArray(e)?e:[e],o=function(e){return t.isDirected()?t.successors(e):t.neighbors(e)},i=[],a=[];return r.forEach((function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);de(t,e,"post"===n,a,o,i)})),i};var pe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ve=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return pe(e,t),e}(Zt),ge=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return pe(e,t),e}(le),me=function(){return 1},ye=function(t,e,n,r,o){var i,a,u=[];return null===(i=t.inEdges(r.v))||void 0===i||i.forEach((function(r){var i=t.edge(r),a=t.node(r.v);o&&u.push({v:r.v,w:r.w,in:0,out:0}),void 0===a.out&&(a.out=0),a.out-=i,be(e,n,a)})),null===(a=t.outEdges(r.v))||void 0===a||a.forEach((function(r){var o=t.edge(r),i=r.w,a=t.node(i);void 0===a.in&&(a.in=0),a.in-=o,be(e,n,a)})),t.removeNode(r.v),o?u:void 0},be=function(t,e,n){n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)};const we=function(t,e){var n;if(t.nodeCount()<=1)return[];var r=function(t,e){var n=new ge,r=0,o=0;t.nodes().forEach((function(t){n.setNode(t,{v:t,in:0,out:0})})),t.edges().forEach((function(t){var i=n.edge(t)||0,a=(null==e?void 0:e(t))||1,u=i+a;n.setEdge(t.v,t.w,u),o=Math.max(o,n.node(t.v).out+=a),r=Math.max(r,n.node(t.w).in+=a)}));for(var i=[],a=o+r+3,u=0;u<a;u++)i.push(new ve);var s=r+1;return n.nodes().forEach((function(t){be(i,s,n.node(t))})),{buckets:i,zeroIdx:s,graph:n}}(t,e||me);return null===(n=function(t,e,n){for(var r,o=[],i=e[e.length-1],a=e[0];t.nodeCount();){for(;r=a.dequeue();)ye(t,e,n,r);for(;r=i.dequeue();)ye(t,e,n,r);if(t.nodeCount())for(var u=e.length-2;u>0;--u)if(r=e[u].dequeue()){o=o.concat(ye(t,e,n,r,!0));break}}return o}(r.graph,r.buckets,r.zeroIdx).map((function(e){return t.outEdges(e.v,e.w)})))||void 0===n?void 0:n.flat()};var Ee=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ee(e,t),e}(le),_e=function(t,e,n,r){var o;do{o="".concat(r).concat(Math.random())}while(t.hasNode(o));return n.dummy=e,t.setNode(o,n),o},Se=function(t){var e=new xe({multigraph:t.isMultigraph()}).setGraph(t.graph());return t.nodes().forEach((function(n){var r;(null===(r=t.children(n))||void 0===r?void 0:r.length)||e.setNode(n,t.node(n))})),t.edges().forEach((function(n){e.setEdgeObj(n,t.edge(n))})),e},Ae=function(t,e){var n,r,o=Number(t.x),i=Number(t.y),a=Number(e.x)-o,u=Number(e.y)-i,s=Number(t.width)/2,c=Number(t.height)/2;return a||u?(Math.abs(u)*s>Math.abs(a)*c?(u<0&&(c=-c),n=c*a/u,r=c):(a<0&&(s=-s),n=s,r=s*u/a),{x:o+n,y:i+r}):{x:0,y:0}},Ie=function(t){for(var e=[],n=Oe(t)+1,r=0;r<n;r++)e.push([]);for(t.nodes().forEach((function(n){var r=t.node(n);if(r){var o=r.rank;void 0!==o&&e[o]&&e[o].push(n)}})),r=0;r<n;r++)e[r]=e[r].sort((function(e,n){var r,o,i,a;return i=null===(r=t.node(e))||void 0===r?void 0:r.order,a=null===(o=t.node(n))||void 0===o?void 0:o.order,Number(i)-Number(a)}));return e},Te=function(t,e,n,r){var o={width:0,height:0};return i(n)&&i(r)&&(o.rank=n,o.order=r),_e(t,"border",o,e)},Oe=function(t){var e;return t.nodes().forEach((function(n){var r,o=null===(r=t.node(n))||void 0===r?void 0:r.rank;void 0!==o&&(void 0===e||o>e)&&(e=o)})),e||(e=0),e},Ne=function(t,e){var n=Date.now();try{return e()}finally{console.log("".concat(t," time: ").concat(Date.now()-n,"ms"))}},De=function(t,e){return e()},Me=function(t,e){return t.reduce((function(t,n){return e(t)>e(n)?n:t}))};const ke=function(t){t.graph().dummyChains=[],t.edges().forEach((function(e){return function(t,e){var n=e.v,r=t.node(n).rank,o=e.w,i=t.node(o).rank,a=e.name,u=t.edge(e),s=u.labelRank;if(i!==r+1){t.removeEdgeObj(e);var c,f,l,d=t.graph();for(l=0,++r;r<i;++l,++r)u.points=[],c=_e(t,"edge",f={edgeLabel:u,width:0,height:0,edgeObj:e,rank:r},"_d"),r===s&&(f.width=u.width,f.height=u.height,f.dummy="edge-label",f.labelpos=u.labelpos),t.setEdge(n,c,{weight:u.weight},a),0===l&&(d.dummyChains||(d.dummyChains=[]),d.dummyChains.push(c)),n=c;t.setEdge(n,o,{weight:u.weight},a)}}(t,e)}))};var Re=function(t){var e,n={},r=function e(r){var o,i,a=t.node(r);return a?n[r]?a.rank:(n[r]=!0,null===(o=t.outEdges(r))||void 0===o||o.forEach((function(n){var r=e(n.w)-t.edge(n).minlen;r&&(void 0===i||r<i)&&(i=r)})),i||(i=0),a.rank=i,i):0};null===(e=t.sources())||void 0===e||e.forEach((function(t){return r(t)}))},Ce=function(t){var e,n,r={},o=function e(o){var i,a,u=t.node(o);return u?r[o]?u.rank:(r[o]=!0,null===(i=t.outEdges(o))||void 0===i||i.forEach((function(n){var r=e(n.w)-t.edge(n).minlen;r&&(void 0===a||r<a)&&(a=r)})),a||(a=0),(void 0===n||a<n)&&(n=a),u.rank=a,a):0};null===(e=t.sources())||void 0===e||e.forEach((function(e){t.node(e)&&o(e)})),void 0===n&&(n=0);var i={},a=function e(n,r){var o,a=t.node(n),u=isNaN(a.layer)?r:a.layer;(void 0===a.rank||a.rank<u)&&(a.rank=u),i[n]||(i[n]=!0,null===(o=t.outEdges(n))||void 0===o||o.map((function(n){e(n.w,u+t.edge(n).minlen)})))};t.nodes().forEach((function(e){var r=t.node(e);r&&(isNaN(r.layer)?r.rank-=n:a(e,r.layer))}))},Le=function(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen},Pe=function(t,e){return t.nodes().forEach((function n(r){e.nodeEdges(r).forEach((function(o){var i=o.v,a=r===i?o.w:i;t.hasNode(a)||Le(e,o)||(t.setNode(a,{}),t.setEdge(r,a,{}),n(a))}))})),t.nodeCount()},je=function(t,e){return t.nodes().forEach((function n(r){var o;null===(o=e.nodeEdges(r))||void 0===o||o.forEach((function(o){var i=o.v,a=r===i?o.w:i;t.hasNode(a)||void 0===e.node(a).layer&&Le(e,o)||(t.setNode(a,{}),t.setEdge(r,a,{}),n(a))}))})),t.nodeCount()},ze=function(t,e){return Me(e.edges(),(function(n){return t.hasNode(n.v)!==t.hasNode(n.w)?Le(e,n):1/0}))},Fe=function(t,e,n){t.nodes().forEach((function(t){e.node(t).rank||(e.node(t).rank=0),e.node(t).rank+=n}))},Ge=function(t,e){return he(t,e,"pre")},Ue=function(t,e){return he(t,e,"post")},Be=function(t,e){var n=Ue(t,t.nodes());null==(n=null==n?void 0:n.slice(0,(null==n?void 0:n.length)-1))||n.forEach((function(n){Ve(t,e,n)}))},Ve=function(t,e,n){var r=t.node(n).parent;t.edgeFromArgs(n,r).cutvalue=We(t,e,n)},We=function(t,e,n){var r,o=t.node(n).parent,i=!0,a=e.edgeFromArgs(n,o),u=0;return a||(i=!1,a=e.edgeFromArgs(o,n)),u=a.weight,null===(r=e.nodeEdges(n))||void 0===r||r.forEach((function(r){var a=r.v===n,s=a?r.w:r.v;if(s!==o){var c=a===i,f=e.edge(r).weight;if(u+=c?f:-f,$e(t,n,s)){var l=t.edgeFromArgs(n,s).cutvalue;u+=c?-l:l}}})),u},Xe=function(t,e){void 0===e&&(e=t.nodes()[0]),He(t,{},1,e)},He=function t(e,n,r,o,i){var a,u=r,s=r,c=e.node(o);return n[o]=!0,null===(a=e.neighbors(o))||void 0===a||a.forEach((function(r){n[r]||(s=t(e,n,s,r,o))})),c.low=u,c.lim=s++,i?c.parent=i:delete c.parent,s},qe=function(t){return t.edges().find((function(e){return t.edge(e).cutvalue<0}))},Ye=function(t,e,n){var r=n.v,o=n.w;e.hasEdge(r,o)||(r=n.w,o=n.v);var i=t.node(r),a=t.node(o),u=i,s=!1;i.lim>a.lim&&(u=a,s=!0);var c=e.edges().filter((function(e){return s===Qe(t,t.node(e.v),u)&&s!==Qe(t,t.node(e.w),u)}));return Me(c,(function(t){return Le(e,t)}))},Ke=function(t,e,n,r){var o=n.v,i=n.w;t.removeEdge(o,i),t.setEdge(r.v,r.w,{}),Xe(t),Be(t,e),Ze(t,e)},Ze=function(t,e){var n=t.nodes().find((function(t){var n;return!(null===(n=e.node(t))||void 0===n?void 0:n.parent)})),r=Ge(t,n);null==(r=null==r?void 0:r.slice(1))||r.forEach((function(n){var r=t.node(n).parent,o=e.edgeFromArgs(n,r),i=!1;o||(o=e.edgeFromArgs(r,n),i=!0),e.node(n).rank=e.node(r).rank+(i?o.minlen:-o.minlen)}))},$e=function(t,e,n){return t.hasEdge(e,n)},Qe=function(t,e,n){return n.low<=e.lim&&e.lim<=n.lim};const Je=function(t){var e=function(t){var e=(new xe).setGraph(t.graph());return t.nodes().forEach((function(n){e.setNode(n,t.node(n))})),t.edges().forEach((function(n){var r=e.edgeFromArgs(n.v,n.w)||{weight:0,minlen:1},o=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})})),e}(t);Re(e);var n,r,o=function(t){var e,n,r=new xe({directed:!1}),o=t.nodes()[0],i=t.nodeCount();for(r.setNode(o,{});Pe(r,t)<i;)e=ze(r,t),n=r.hasNode(e.v)?Le(t,e):-Le(t,e),Fe(r,t,n);return r}(e);for(Xe(o),Be(o,e);n=qe(o);)r=Ye(o,e,n),Ke(o,e,n,r)};var tn=Re,en=function(t){Ce(t),function(t){var e,n,r=new xe({directed:!1}),o=t.nodes()[0],i=t.nodes().filter((function(e){return!!t.node(e)})).length;for(r.setNode(o,{});je(r,t)<i;)e=ze(r,t),n=r.hasNode(e.v)?Le(t,e):-Le(t,e),Fe(r,t,n)}(t)};const nn=function(t){switch(t.graph().ranker){case"network-simplex":!function(t){Je(t)}(t);break;case"tight-tree":default:en(t);break;case"longest-path":tn(t)}};var rn=function t(e,n,r,o,i,a,u){var s=e.children(u);if(null==s?void 0:s.length){var c=Te(e,"_bt"),f=Te(e,"_bb"),l=e.node(u);e.setParent(c,u),l.borderTop=c,e.setParent(f,u),l.borderBottom=f,null==s||s.forEach((function(s){t(e,n,r,o,i,a,s);var l=e.node(s),d=l.borderTop?l.borderTop:s,h=l.borderBottom?l.borderBottom:s,p=l.borderTop?o:2*o,v=d!==h?1:i-a[u]+1;e.setEdge(c,d,{minlen:v,weight:p,nestingEdge:!0}),e.setEdge(h,f,{minlen:v,weight:p,nestingEdge:!0})})),e.parent(u)||e.setEdge(n,c,{weight:0,minlen:i+a[u]})}else u!==n&&e.setEdge(n,u,{weight:0,minlen:r})},on=function(t){var e,n={},r=function e(r,o){var i=t.children(r);null==i||i.forEach((function(t){return e(t,o+1)})),n[r]=o};return null===(e=t.children())||void 0===e||e.forEach((function(t){return r(t,1)})),n};const an=function(t){var e,n=_e(t,"root",{},"_root"),r=on(t),o=Math.max.apply(Math,Object.values(r));Math.abs(o)===1/0&&(o=1);var i=o-1,a=2*i+1;t.graph().nestingRoot=n,t.edges().forEach((function(e){t.edge(e).minlen*=a}));var u=function(t){var e=0;return t.edges().forEach((function(n){e+=t.edge(n).weight})),e}(t)+1;null===(e=t.children())||void 0===e||e.forEach((function(e){rn(t,n,a,u,i,r,e)})),t.graph().nodeRankFactor=a};var un=function(t,e,n,r,o,i){var a={rank:i,borderType:e,width:0,height:0},u=o[e][i-1],s=_e(t,"border",a,n);o[e][i]=s,t.setParent(s,r),u&&t.setEdge(u,s,{weight:1})};const sn=function(t){var e,n=function e(n){var r=t.children(n),o=t.node(n);if((null==r?void 0:r.length)&&r.forEach((function(t){return e(t)})),o.hasOwnProperty("minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,a=o.maxRank+1;i<a;i+=1)un(t,"borderLeft","_bl",n,o,i),un(t,"borderRight","_br",n,o,i)}};null===(e=t.children())||void 0===e||e.forEach((function(t){return n(t)}))};var cn=function(t){t.nodes().forEach((function(e){fn(t.node(e))})),t.edges().forEach((function(e){fn(t.edge(e))}))},fn=function(t){var e=t.width;t.width=t.height,t.height=e},ln=function(t){(null==t?void 0:t.y)&&(t.y=-t.y)},dn=function(t){var e=t.x;t.x=t.y,t.y=e};const hn=function(t){var e,n=null===(e=t.graph().rankdir)||void 0===e?void 0:e.toLowerCase();"bt"!==n&&"rl"!==n||function(t){t.nodes().forEach((function(e){ln(t.node(e))})),t.edges().forEach((function(e){var n,r=t.edge(e);null===(n=r.points)||void 0===n||n.forEach((function(t){return ln(t)})),r.hasOwnProperty("y")&&ln(r)}))}(t),"lr"!==n&&"rl"!==n||(function(t){t.nodes().forEach((function(e){dn(t.node(e))})),t.edges().forEach((function(e){var n,r=t.edge(e);null===(n=r.points)||void 0===n||n.forEach((function(t){return dn(t)})),r.hasOwnProperty("x")&&dn(r)}))}(t),cn(t))};var pn={}.toString;const vn=function(t){return Array.isArray?Array.isArray(t):function(t,e){return pn.call(t)==="[object "+e+"]"}(t,"Array")},gn=function(t){if(vn(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},mn=function(t){for(var e={},n=t.nodes().filter((function(e){var n;return!(null===(n=t.children(e))||void 0===n?void 0:n.length)})),r=n.map((function(e){return t.node(e).rank})),o=gn(r),i=[],a=0;a<o+1;a++)i.push([]);var u=n.sort((function(e,n){return t.node(e).rank-t.node(n).rank})),s=u.filter((function(e){return void 0!==t.node(e).fixorder})),c=s.sort((function(e,n){return t.node(e).fixorder-t.node(n).fixorder}));return null==c||c.forEach((function(n){isNaN(t.node(n).rank)||i[t.node(n).rank].push(n),e[n]=!0})),null==u||u.forEach((function n(r){var o;if(!e.hasOwnProperty(r)){e[r]=!0;var a=t.node(r);isNaN(a.rank)||i[a.rank].push(r),null===(o=t.successors(r))||void 0===o||o.forEach((function(t){return n(t)}))}})),i};var yn=function(t,e,n){for(var r=function(t,e){return null==t?void 0:t.reduce((function(t,n,r){return t[n]=e[r],t}),{})}(n,n.map((function(t,e){return e}))),o=e.map((function(e){var n,o=null===(n=t.outEdges(e))||void 0===n?void 0:n.map((function(e){return{pos:r[e.w]||0,weight:t.edge(e).weight}}));return null==o?void 0:o.sort((function(t,e){return t.pos-e.pos}))})),i=o.flat().filter((function(t){return void 0!==t})),a=1;a<n.length;)a<<=1;var u=2*a-1;a-=1;var s=Array(u).fill(0,0,u),c=0;return null==i||i.forEach((function(t){if(t){var e=t.pos+a;s[e]+=t.weight;for(var n=0;e>0;)e%2&&(n+=s[e+1]),s[e=e-1>>1]+=t.weight;c+=t.weight*n}})),c};const bn=function(t,e){for(var n=0,r=1;r<(null==e?void 0:e.length);r+=1)n+=yn(t,e[r-1],e[r]);return n};const wn=function(t,e,n){var r=function(t){for(var e;t.hasNode(e="_root".concat(Math.random())););return e}(t),o=new xe({compound:!0}).setGraph({root:r}).setDefaultNodeLabel((function(e){return t.node(e)}));return t.nodes().forEach((function(i){var a,u=t.node(i),s=t.parent(i);(u.rank===e||u.minRank<=e&&e<=u.maxRank)&&(o.setNode(i),o.setParent(i,s||r),null===(a=t[n](i))||void 0===a||a.forEach((function(e){var n=e.v===i?e.w:e.v,r=o.edgeFromArgs(n,i),a=void 0!==r?r.weight:0;o.setEdge(n,i,{weight:t.edge(e).weight+a})})),u.hasOwnProperty("minRank")&&o.setNode(i,{borderLeft:u.borderLeft[e],borderRight:u.borderRight[e]}))})),o};var En=function(t,e){var n,r=0,o=0;t.weight&&(r+=t.barycenter*t.weight,o+=t.weight),e.weight&&(r+=e.barycenter*e.weight,o+=e.weight),t.vs=null===(n=e.vs)||void 0===n?void 0:n.concat(t.vs),t.barycenter=r/o,t.weight=o,t.i=Math.min(e.i,t.i),e.merged=!0};const xn=function(t,e){var n,r,o,i={};return null==t||t.forEach((function(t,e){i[t.v]={i:e,indegree:0,in:[],out:[],vs:[t.v]};var n=i[t.v];void 0!==t.barycenter&&(n.barycenter=t.barycenter,n.weight=t.weight)})),null===(n=e.edges())||void 0===n||n.forEach((function(t){var e=i[t.v],n=i[t.w];void 0!==e&&void 0!==n&&(n.indegree++,e.out.push(i[t.w]))})),function(t){for(var e,n,r=[],o=function(){var o=t.pop();r.push(o),null===(e=o.in.reverse())||void 0===e||e.forEach((function(t){return(e=o,function(t){t.merged||(void 0===t.barycenter||void 0===e.barycenter||t.barycenter>=e.barycenter)&&En(e,t)})(t);var e})),null===(n=o.out)||void 0===n||n.forEach((function(e){return(n=o,function(e){e.in.push(n),0==--e.indegree&&t.push(e)})(e);var n}))};null==t?void 0:t.length;)o();var i=r.filter((function(t){return!t.merged})),a=["vs","i","barycenter","weight"];return i.map((function(t){var e={};return null==a||a.forEach((function(n){void 0!==t[n]&&(e[n]=t[n])})),e}))}(null===(o=(r=Object.values(i)).filter)||void 0===o?void 0:o.call(r,(function(t){return!t.indegree})))};var _n=function(t,e,n){for(var r,o=n;e.length&&(r=e[e.length-1]).i<=o;)e.pop(),null==t||t.push(r.vs),o++;return o};const Sn=function(t,e,n,r){var o=function(t,e){var n={lhs:[],rhs:[]};return null==t||t.forEach((function(t){var e,o;o=(e=t).hasOwnProperty("fixorder")&&!isNaN(e.fixorder),(r?!o&&e.hasOwnProperty("barycenter"):o||e.hasOwnProperty("barycenter"))?n.lhs.push(t):n.rhs.push(t)})),n}(t),i=o.lhs,a=o.rhs.sort((function(t,e){return-t.i- -e.i})),u=[],s=0,c=0,f=0;null==i||i.sort(function(t,e){return function(n,r){if(void 0!==n.fixorder&&void 0!==r.fixorder)return n.fixorder-r.fixorder;if(n.barycenter<r.barycenter)return-1;if(n.barycenter>r.barycenter)return 1;if(e&&void 0!==n.order&&void 0!==r.order){if(n.order<r.order)return-1;if(n.order>r.order)return 1}return t?r.i-n.i:n.i-r.i}}(!!e,!!n)),f=_n(u,a,f),null==i||i.forEach((function(t){var e;f+=null===(e=t.vs)||void 0===e?void 0:e.length,u.push(t.vs),s+=t.barycenter*t.weight,c+=t.weight,f=_n(u,a,f)}));var l={vs:u.flat()};return c&&(l.barycenter=s/c,l.weight=c),l};const An=function t(e,n,r,o,i,a){var u,s,c,f,l=e.children(n),d=e.node(n),h=d?d.borderLeft:void 0,p=d?d.borderRight:void 0,v={};h&&(l=null==l?void 0:l.filter((function(t){return t!==h&&t!==p})));var g=function(t,e){return e.map((function(e){var n=t.inEdges(e);if(!(null==n?void 0:n.length))return{v:e};var r={sum:0,weight:0};return null==n||n.forEach((function(e){var n=t.edge(e),o=t.node(e.v);r.sum+=n.weight*o.order,r.weight+=n.weight})),{v:e,barycenter:r.sum/r.weight,weight:r.weight}}))}(e,l||[]);null==g||g.forEach((function(n){var i,u,s;if(null===(i=e.children(n.v))||void 0===i?void 0:i.length){var c=t(e,n.v,r,o,a);v[n.v]=c,c.hasOwnProperty("barycenter")&&(s=c,void 0!==(u=n).barycenter?(u.barycenter=(u.barycenter*u.weight+s.barycenter*s.weight)/(u.weight+s.weight),u.weight+=s.weight):(u.barycenter=s.barycenter,u.weight=s.weight))}}));var m=xn(g,r);(function(t,e){null==t||t.forEach((function(t){var n,r=null===(n=t.vs)||void 0===n?void 0:n.map((function(t){return e[t]?e[t].vs:t}));t.vs=r.flat()}))})(m,v),null===(u=m.filter((function(t){return t.vs.length>0})))||void 0===u||u.forEach((function(t){var n=e.node(t.vs[0]);n&&(t.fixorder=n.fixorder,t.order=n.order)}));var y=Sn(m,o,i,a);if(h&&(y.vs=[h,y.vs,p].flat(),null===(s=e.predecessors(h))||void 0===s?void 0:s.length)){var b=e.node((null===(c=e.predecessors(h))||void 0===c?void 0:c[0])||""),w=e.node((null===(f=e.predecessors(p))||void 0===f?void 0:f[0])||"");y.hasOwnProperty("barycenter")||(y.barycenter=0,y.weight=0),y.barycenter=(y.barycenter*y.weight+b.order+w.order)/(y.weight+2),y.weight+=2}return y};var In=function(t,e,n){return e.map((function(e){return wn(t,e,n)}))},Tn=function(t,e,n,r){var o=new xe;null==t||t.forEach((function(t){for(var i,a=t.graph().root,u=An(t,a,o,e,n,r),s=0;s<(null===(i=u.vs)||void 0===i?void 0:i.length);s++){var c=t.node(u.vs[s]);c&&(c.order=s)}!function(t,e,n){var r,o={};null==n||n.forEach((function(n){for(var i,a,u=t.parent(n);u;){if((i=t.parent(u))?(a=o[i],o[i]=u):(a=r,r=u),a&&a!==u)return void e.setEdge(a,u);u=i}}))}(t,o,u.vs)}))},On=function(t,e){null==e||e.forEach((function(e){null==e||e.forEach((function(e,n){t.node(e).order=n}))}))};const Nn=function(t){if(vn(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])};var Dn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Mn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Dn(e,t),e}(le),kn=function(t,e){var n={};function r(e,r,o,i,a){for(var u,s,c,f=r;f<o;f++)c=e[f],(null===(u=t.node(c))||void 0===u?void 0:u.dummy)&&(null===(s=t.predecessors(c))||void 0===s||s.forEach((function(e){var r=t.node(e);r.dummy&&(r.order<i||r.order>a)&&Cn(n,e,c)})))}function o(t,e){var n=function(t){return JSON.stringify(t.slice(1))}(t);e.get(n)||(r.apply(void 0,t),e.set(n,!0))}return(null==e?void 0:e.length)&&e.reduce((function(e,n){var r,i=-1,a=0,u=new Map;return null==n||n.forEach((function(s,c){var f;if("border"===(null===(f=t.node(s))||void 0===f?void 0:f.dummy)){var l=t.predecessors(s)||[];l.length&&(r=t.node(l[0]).order,o([n,a,c,i,r],u),a=c,i=r)}o([n,a,n.length,r,e.length],u)})),n})),n},Rn=function(t,e){var n,r;if(null===(n=t.node(e))||void 0===n?void 0:n.dummy)return null===(r=t.predecessors(e))||void 0===r?void 0:r.find((function(e){return t.node(e).dummy}))},Cn=function(t,e,n){var r=e,o=n;if(r>o){var i=r;r=o,o=i}var a=t[r];a||(t[r]=a={}),a[o]=!0},Ln=function(t,e,n){var r=e;return r>n&&(r=n),!!t[r]},Pn=function(t,e,n,r){var o=new Mn,i=t.graph(),a=jn(i.nodesep,i.edgesep,r);return null==e||e.forEach((function(e){var r;null==e||e.forEach((function(e){var i=n[e];if(o.setNode(i),r){var u=n[r],s=o.edgeFromArgs(u,i);o.setEdge(u,i,Math.max(a(t,e,r),s||0))}r=e}))})),o};var jn=function(t,e,n){return function(r,o,i){var a,u=r.node(o),s=r.node(i),c=0;if(c+=u.width/2,u.hasOwnProperty("labelpos"))switch((u.labelpos||"").toLowerCase()){case"l":a=-u.width/2;break;case"r":a=u.width/2}if(a&&(c+=n?a:-a),a=0,c+=(u.dummy?e:t)/2,c+=(s.dummy?e:t)/2,c+=s.width/2,s.labelpos)switch((s.labelpos||"").toLowerCase()){case"l":a=s.width/2;break;case"r":a=-s.width/2}return a&&(c+=n?a:-a),a=0,c}},zn=function(t,e){return t.node(e).width||0},Fn=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))};const Gn=function(t){var e,n=Se(t);!function(t){var e=Ie(t),n=t.graph().ranksep,r=0;null==e||e.forEach((function(e){var o=e.map((function(e){return t.node(e).height})),i=Math.max.apply(Math,Fn(Fn([],o,!1),[0],!1));null==e||e.forEach((function(e){t.node(e).y=r+i/2})),r+=i+n}))}(n);var r=function(t){var e=Ie(t),n=Object.assign(function(t,e){var n={};return(null==e?void 0:e.length)&&e.reduce((function(e,r){var o=0,i=0,a=e.length,u=null==r?void 0:r[(null==r?void 0:r.length)-1];return null==r||r.forEach((function(e,s){var c,f=Rn(t,e),l=f?t.node(f).order:a;(f||e===u)&&(null===(c=r.slice(i,s+1))||void 0===c||c.forEach((function(e){var r;null===(r=t.predecessors(e))||void 0===r||r.forEach((function(r){var i,a=t.node(r),u=a.order;!(u<o||l<u)||a.dummy&&(null===(i=t.node(e))||void 0===i?void 0:i.dummy)||Cn(n,r,e)}))})),i=s+1,o=l)})),r})),n}(t,e),kn(t,e)),r={},o=[];["u","d"].forEach((function(i){o="u"===i?e:Object.values(e).reverse(),["l","r"].forEach((function(e){"r"===e&&(o=o.map((function(t){return Object.values(t).reverse()})));var a=("u"===i?t.predecessors:t.successors).bind(t),u=function(t,e,n,r){var o={},i={},a={};return null==e||e.forEach((function(t){null==t||t.forEach((function(t,e){o[t]=t,i[t]=t,a[t]=e}))})),null==e||e.forEach((function(t){var e=-1;null==t||t.forEach((function(t){var u=r(t);if(u.length){u=u.sort((function(t,e){return a[t]-a[e]}));for(var s=(u.length-1)/2,c=Math.floor(s),f=Math.ceil(s);c<=f;++c){var l=u[c];i[t]===t&&e<a[l]&&!Ln(n,t,l)&&(i[l]=t,i[t]=o[t]=o[l],e=a[l])}}}))})),{root:o,align:i}}(0,o,n,a),s=function(t,e,n,r,o){var i,a={},u=Pn(t,e,n,o),s=o?"borderLeft":"borderRight",c=function(t,e){for(var n=u.nodes(),r=n.pop(),o={};r;)o[r]?t(r):(o[r]=!0,n.push(r),n=n.concat(e(r))),r=n.pop()};return c((function(t){a[t]=(u.inEdges(t)||[]).reduce((function(t,e){return Math.max(t,(a[e.v]||0)+u.edge(e))}),0)}),u.predecessors.bind(u)),c((function(e){var n=(u.outEdges(e)||[]).reduce((function(t,e){return Math.min(t,(a[e.w]||0)-u.edge(e))}),Number.POSITIVE_INFINITY),r=t.node(e);n!==Number.POSITIVE_INFINITY&&r.borderType!==s&&(a[e]=Math.max(a[e],n))}),u.successors.bind(u)),null===(i=Object.values(r))||void 0===i||i.forEach((function(t){a[t]=a[n[t]]})),a}(t,o,u.root,u.align,"r"===e);"r"===e&&Object.keys(s).forEach((function(t){return s[t]=-s[t]})),r[i+e]=s}))}));var i=function(t,e){return Me(Object.values(e),(function(e){var n,r=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;return null===(n=Object.keys(e))||void 0===n||n.forEach((function(n){var i=e[n],a=zn(t,n)/2;r=Math.max(i+a,r),o=Math.min(i-a,o)})),r-o}))}(t,r);return i&&function(t,e){var n=Object.values(e),r=Nn(n),o=gn(n);["u","d"].forEach((function(n){["l","r"].forEach((function(i){var a,u=n+i,s=t[u];if(s!==e){var c=Object.values(s);(a="l"===i?r-Nn(c):o-gn(c))&&(t[u]={},Object.keys(s).forEach((function(e){t[u][e]=s[e]+a})))}}))}))}(r,i),function(t,e){var n={};return Object.keys(t.ul).forEach((function(r){if(e)n[r]=t[e.toLowerCase()][r];else{var o=Object.values(t).map((function(t){return t[r]}));n[r]=(o[0]+o[1])/2}})),n}(r,t.graph().align)}(n);null===(e=Object.keys(r))||void 0===e||e.forEach((function(t){n.node(t).x=r[t]}))};var Un=function(){return Un=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Un.apply(this,arguments)},Bn=function(t,e,n){e(" removeSelfEdges",(function(){ir(t)})),e(" acyclic",(function(){!function(t){var e="greedy"===t.graph().acyclicer?we(t,function(t){return function(e){var n;return(null===(n=t.edge(e))||void 0===n?void 0:n.weight)||1}}(t)):function(t){var e=[],n={},r={};return t.nodes().forEach((function o(i){var a;r[i]||(r[i]=!0,n[i]=!0,null===(a=t.outEdges(i))||void 0===a||a.forEach((function(t){n[t.w]?e.push(t):o(t.w)})),delete n[i])})),e}(t);null==e||e.forEach((function(e){var n=t.edge(e);t.removeEdgeObj(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,"rev-".concat(Math.random()))}))}(t)})),e(" nestingGraph.run",(function(){an(t)})),e(" rank",(function(){nn(Se(t))})),e(" injectEdgeLabelProxies",(function(){$n(t)})),e(" removeEmptyRanks",(function(){!function(t){var e=t.nodes(),n=e.filter((function(e){var n;return void 0!==(null===(n=t.node(e))||void 0===n?void 0:n.rank)})).map((function(e){return t.node(e).rank})),r=Math.min.apply(Math,n),o=[];e.forEach((function(e){var n,i=((null===(n=t.node(e))||void 0===n?void 0:n.rank)||0)-r;o[i]||(o[i]=[]),o[i].push(e)}));for(var i=0,a=t.graph().nodeRankFactor||0,u=0;u<o.length;u++){var s=o[u];void 0===s?u%a!=0&&(i-=1):i&&(null==s||s.forEach((function(e){var n=t.node(e);n&&(n.rank=n.rank||0,n.rank+=i)})))}}(t)})),e(" nestingGraph.cleanup",(function(){!function(t){var e=t.graph();e.nestingRoot&&t.removeNode(e.nestingRoot),delete e.nestingRoot,t.edges().forEach((function(e){t.edge(e).nestingEdge&&t.removeEdgeObj(e)}))}(t)})),e(" normalizeRanks",(function(){!function(t){var e=t.nodes().filter((function(e){var n;return void 0!==(null===(n=t.node(e))||void 0===n?void 0:n.rank)})).map((function(e){return t.node(e).rank})),n=Math.min.apply(Math,e);t.nodes().forEach((function(e){var r=t.node(e);r.hasOwnProperty("rank")&&n!==1/0&&(r.rank-=n)}))}(t)})),e(" assignRankMinMax",(function(){Qn(t)})),e(" removeEdgeLabelProxies",(function(){Jn(t)})),e(" normalize.run",(function(){ke(t)})),e(" parentDummyChains",(function(){!function(t){var e,n=function(t){var e,n={},r=0;return null===(e=t.children())||void 0===e||e.forEach((function e(o){var i,a=r;null===(i=t.children(o))||void 0===i||i.forEach(e),n[o]={low:a,lim:r++}})),n}(t);null===(e=t.graph().dummyChains)||void 0===e||e.forEach((function(e){var r,o,i=e,a=t.node(i),u=a.edgeObj;if(u)for(var s=function(t,e,n,r){var o,i,a=[],u=[],s=Math.min(e[n].low,e[r].low),c=Math.max(e[n].lim,e[r].lim);o=n;do{o=t.parent(o),a.push(o)}while(o&&(e[o].low>s||c>e[o].lim));for(i=o,o=r;o&&o!==i;)u.push(o),o=t.parent(o);return{lca:i,path:a.concat(u.reverse())}}(t,n,u.v,u.w),c=s.path,f=s.lca,l=0,d=c[l],h=!0;i!==u.w;){if(a=t.node(i),h){for(;d!==f&&(null===(r=t.node(d))||void 0===r?void 0:r.maxRank)<a.rank;)d=c[++l];d===f&&(h=!1)}if(!h){for(;l<c.length-1&&(null===(o=t.node(c[l+1]))||void 0===o?void 0:o.minRank)<=a.rank;)l++;d=c[l]}t.setParent(i,d),i=t.successors(i)[0]}}))}(t)})),e(" addBorderSegments",(function(){sn(t)})),n&&n.keepNodeOrder&&e(" initDataOrder",(function(){!function(t,e){for(var n=t.nodes().filter((function(e){var n;return!(null===(n=t.children(e))||void 0===n?void 0:n.length)})),r=n.map((function(e){return t.node(e).rank})),o=Math.max.apply(Math,r),i=[],a=0;a<o+1;a++)i[a]=[];null==e||e.forEach((function(e){var n=t.node(e);n&&!(null==n?void 0:n.dummy)&&(isNaN(n.rank)||(n.fixorder=i[n.rank].length,i[n.rank].push(e)))}))}(t,n.nodeOrder)})),e(" order",(function(){!function(t,e){for(var n=Oe(t),r=[],o=[],i=1;i<n+1;i++)r.push(i);for(i=n-1;i>-1;i--)o.push(i);var a=In(t,r,"inEdges"),u=In(t,o,"outEdges"),s=mn(t);On(t,s);for(var c,f=Number.POSITIVE_INFINITY,d=(i=0,0);d<4;++i,++d)Tn(i%2?a:u,i%4>=2,!1,e),s=Ie(t),(h=bn(t,s))<f&&(d=0,c=l(s),f=h);for(s=mn(t),On(t,s),i=0,d=0;d<4;++i,++d){var h;Tn(i%2?a:u,i%4>=2,!0,e),s=Ie(t),(h=bn(t,s))<f&&(d=0,c=l(s),f=h)}On(t,c)}(t,null==n?void 0:n.keepNodeOrder)})),e(" insertSelfEdges",(function(){ar(t)})),e(" adjustCoordinateSystem",(function(){!function(t){var e,n=null===(e=t.graph().rankdir)||void 0===e?void 0:e.toLowerCase();"lr"!==n&&"rl"!==n||cn(t)}(t)})),e(" position",(function(){Gn(t)})),e(" positionSelfEdges",(function(){ur(t)})),e(" removeBorderNodes",(function(){or(t)})),e(" normalize.undo",(function(){!function(t){var e;null===(e=t.graph().dummyChains)||void 0===e||e.forEach((function(e){var n,r=t.node(e),o=r.edgeLabel;r.edgeObj&&t.setEdgeObj(r.edgeObj,o);for(var i=e;r.dummy;)n=t.successors(i)[0],t.removeNode(i),o.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(o.x=r.x,o.y=r.y,o.width=r.width,o.height=r.height),i=n,r=t.node(i)}))}(t)})),e(" fixupEdgeLabelCoords",(function(){nr(t)})),e(" undoCoordinateSystem",(function(){hn(t)})),e(" translateGraph",(function(){tr(t)})),e(" assignNodeIntersects",(function(){er(t)})),e(" reversePoints",(function(){rr(t)})),e(" acyclic.undo",(function(){!function(t){t.edges().forEach((function(e){var n=t.edge(e);if(n.reversed){t.removeEdgeObj(e);var r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}}))}(t)}))},Vn=["nodesep","edgesep","ranksep","marginx","marginy"],Wn={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Xn=["acyclicer","ranker","rankdir","align"],Hn=["width","height","layer","fixorder"],qn={width:0,height:0},Yn=["minlen","weight","width","height","labeloffset"],Kn={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Zn=["labelpos"],$n=function(t){t.edges().forEach((function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),o={e,rank:(t.node(e.w).rank-r.rank)/2+r.rank};_e(t,"edge-proxy",o,"_ep")}}))},Qn=function(t){var e=0;t.nodes().forEach((function(n){var r,o,i=t.node(n);i.borderTop&&(i.minRank=null===(r=t.node(i.borderTop))||void 0===r?void 0:r.rank,i.maxRank=null===(o=t.node(i.borderBottom))||void 0===o?void 0:o.rank,e=Math.max(e,i.maxRank||-1/0))})),t.graph().maxRank=e},Jn=function(t){t.nodes().forEach((function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))}))},tr=function(t){var e,n,r=0,o=0,i=t.graph(),a=i.marginx||0,u=i.marginy||0,s=function(t){if(t){var i=t.x,a=t.y,u=t.width,s=t.height;isNaN(i)||isNaN(u)||(void 0===e&&(e=i-u/2),e=Math.min(e,i-u/2),r=Math.max(r,i+u/2)),isNaN(a)||isNaN(s)||(void 0===n&&(n=a-s/2),n=Math.min(n,a-s/2),o=Math.max(o,a+s/2))}};t.nodes().forEach((function(e){s(t.node(e))})),t.edges().forEach((function(e){var n=t.edge(e);(null==n?void 0:n.hasOwnProperty("x"))&&s(n)})),e-=a,n-=u,t.nodes().forEach((function(r){var o=t.node(r);o&&(o.x-=e,o.y-=n)})),t.edges().forEach((function(r){var o,i=t.edge(r);null===(o=i.points)||void 0===o||o.forEach((function(t){t.x-=e,t.y-=n})),i.hasOwnProperty("x")&&(i.x-=e),i.hasOwnProperty("y")&&(i.y-=n)})),i.width=r-e+a,i.height=o-n+u},er=function(t){t.edges().forEach((function(e){var n,r,o=t.edge(e),i=t.node(e.v),a=t.node(e.w);o.points?(n=o.points[0],r=o.points[o.points.length-1]):(o.points=[],n=a,r=i),o.points.unshift(Ae(i,n)),o.points.push(Ae(a,r))}))},nr=function(t){t.edges().forEach((function(e){var n=t.edge(e);if(null==n?void 0:n.hasOwnProperty("x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))},rr=function(t){t.edges().forEach((function(e){var n,r=t.edge(e);r.reversed&&(null===(n=r.points)||void 0===n||n.reverse())}))},or=function(t){t.nodes().forEach((function(e){var n,r,o;if(null===(n=t.children(e))||void 0===n?void 0:n.length){var i=t.node(e),a=t.node(i.borderTop),u=t.node(i.borderBottom),s=t.node(i.borderLeft[(null===(r=i.borderLeft)||void 0===r?void 0:r.length)-1]),c=t.node(i.borderRight[(null===(o=i.borderRight)||void 0===o?void 0:o.length)-1]);i.width=Math.abs((null==c?void 0:c.x)-(null==s?void 0:s.x))||10,i.height=Math.abs((null==u?void 0:u.y)-(null==a?void 0:a.y))||10,i.x=((null==s?void 0:s.x)||0)+i.width/2,i.y=((null==a?void 0:a.y)||0)+i.height/2}})),t.nodes().forEach((function(e){var n;"border"===(null===(n=t.node(e))||void 0===n?void 0:n.dummy)&&t.removeNode(e)}))},ir=function(t){t.edges().forEach((function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e,label:t.edge(e)}),t.removeEdgeObj(e)}}))},ar=function(t){var e=Ie(t);null==e||e.forEach((function(e){var n=0;null==e||e.forEach((function(e,r){var o,i=t.node(e);i.order=r+n,null===(o=i.selfEdges)||void 0===o||o.forEach((function(e){_e(t,"selfedge",{width:e.label.width,height:e.label.height,rank:i.rank,order:r+ ++n,e:e.e,label:e.label},"_se")})),delete i.selfEdges}))}))},ur=function(t){t.nodes().forEach((function(e){var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),o=r.x+r.width/2,i=r.y,a=n.x-o,u=r.height/2;t.setEdgeObj(n.e,n.label),t.removeNode(e),n.label.points=[{x:o+2*a/3,y:i-u},{x:o+5*a/6,y:i-u},{y:i,x:o+a},{x:o+5*a/6,y:i+u},{x:o+2*a/3,y:i+u}],n.label.x=n.x,n.label.y=n.y}}))},sr=function(t,e){var n={};return null==e||e.forEach((function(e){void 0!==t[e]&&(n[e]=+t[e])})),n},cr=function(t){void 0===t&&(t={});var e={};return Object.keys(t).forEach((function(n){e[n.toLowerCase()]=t[n]})),e};const fr=function(t,e){var n=e&&e.debugTiming?Ne:De;n("layout",(function(){e&&!e.keepNodeOrder&&e.prevGraph&&n(" inheritOrder",(function(){var n,r;n=t,r=e.prevGraph,n.nodes().forEach((function(t){var e=n.node(t),o=r.node(t);void 0!==o?(e.fixorder=o._order,delete o._order):delete e.fixorder}))}));var r=n(" buildLayoutGraph",(function(){return function(t){var e=new xe({multigraph:!0,compound:!0}),n=cr(t.graph()),r={};return null==Xn||Xn.forEach((function(t){void 0!==n[t]&&(r[t]=n[t])})),e.setGraph(Object.assign({},Wn,sr(n,Vn),r)),t.nodes().forEach((function(n){var r=cr(t.node(n)),o=Un(Un({},qn),r),i=sr(o,Hn);e.setNode(n,i),e.setParent(n,t.parent(n))})),t.edges().forEach((function(n){var r=cr(t.edge(n)),o={};null==Zn||Zn.forEach((function(t){void 0!==r[t]&&(o[t]=r[t])})),e.setEdgeObj(n,Object.assign({},Kn,sr(r,Yn),o))})),e}(t)}));e&&!1===e.edgeLabelSpace||n(" makeSpaceForEdgeLabels",(function(){!function(t){var e=t.graph();e.ranksep||(e.ranksep=0),e.ranksep/=2,t.nodes().forEach((function(e){var n=t.node(e);isNaN(n.layer)||n.layer||(n.layer=0)})),t.edges().forEach((function(n){var r,o=t.edge(n);o.minlen*=2,"c"!==(null===(r=o.labelpos)||void 0===r?void 0:r.toLowerCase())&&("TB"===e.rankdir||"BT"===e.rankdir?o.width+=o.labeloffset:o.height+=o.labeloffset)}))}(r)}));try{n(" runLayout",(function(){Bn(r,n,e)}))}catch(t){if("Not possible to find intersection inside of the rectangle"===t.message)return void 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:\n",t);throw t}n(" updateInputGraph",(function(){!function(t,e){t.nodes().forEach((function(n){var r,o=t.node(n);if(o){var i=e.node(n);o.x=i.x,o.y=i.y,o._order=i.order,o._rank=i.rank,(null===(r=e.children(n))||void 0===r?void 0:r.length)&&(o.width=i.width,o.height=i.height)}})),t.edges().forEach((function(n){var r=t.edge(n),o=e.edge(n);r.points=o?o.points:[],o&&o.hasOwnProperty("x")&&(r.x=o.x,r.y=o.y)})),t.graph().width=e.graph().width,t.graph().height=e.graph().height}(t,r)}))}))};var lr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),dr=function(t){function n(e){var n=t.call(this)||this;return n.rankdir="TB",n.nodesep=50,n.ranksep=50,n.controlPoints=!1,n.sortByCombo=!1,n.edgeLabelSpace=!0,n.radial=!1,n.nodes=[],n.edges=[],n.onLayoutEnd=function(){},n.layoutNode=function(t){var e=n.nodes.find((function(e){return e.id===t}));return!e||!1!==e.layout},n.updateCfg(e),n}return lr(n,t),n.prototype.getDefaultCfg=function(){return{rankdir:"TB",align:void 0,nodeSize:void 0,nodesepFunc:void 0,ranksepFunc:void 0,nodesep:50,ranksep:50,controlPoints:!1,radial:!1,focusNode:null}},n.prototype.execute=function(){var t,n,r,a,u=this,s=this,c=s.nodes,l=s.nodeSize,h=s.rankdir,p=s.combos,v=s.begin,g=s.radial,m=s.comboEdges,y=void 0===m?[]:m,b=s.vedges,w=void 0===b?[]:b;if(c){var E=s.edges||[],_=new xe({multigraph:!0,compound:!0});s.nodeMap={};var S={};c.forEach((function(t){s.nodeMap[t.id]=t,t.comboId&&(S[t.comboId]=S[t.comboId]||[],S[t.comboId].push(t.id))}));var A,I=[],T={};(null===(t=s.nodeOrder)||void 0===t?void 0:t.length)?(s.nodeOrder.forEach((function(t){T[t]=!0,I.push(s.nodeMap[t])})),c.forEach((function(t){T[t.id]||I.push(t)}))):I=c,A=l?o(l)?function(){return l}:function(){return[l,l]}:function(t){return t.size?o(t.size)?t.size:f(t.size)?[t.size.width||40,t.size.height||40]:[t.size,t.size]:[40,40]};var O=x(s.ranksep,50,s.ranksepFunc),N=x(s.nodesep,50,s.nodesepFunc),D=N,M=O;"LR"!==h&&"RL"!==h||(D=O,M=N),_.setDefaultEdgeLabel((function(){return{}})),_.setGraph(s);var k={};this.sortByCombo&&p&&p.forEach((function(t){if(k[t.id]=t,t.collapsed){var e=A(t),n=M(t),r=D(t),o=e[0]+2*r,i=e[1]+2*n;_.setNode(t.id,{width:o,height:i})}t.parentId&&(k[t.parentId]||_.setNode(t.parentId,{}),_.setParent(t.id,t.parentId))})),I.filter((function(t){return!1!==t.layout})).forEach((function(t){var e=A(t),n=M(t),r=D(t),o=e[0]+2*r,a=e[1]+2*n,s=t.layer;i(s)?_.setNode(t.id,{width:o,height:a,layer:s}):_.setNode(t.id,{width:o,height:a}),u.sortByCombo&&t.comboId&&(k[t.comboId]||(k[t.comboId]={id:t.comboId},_.setNode(t.comboId,{})),_.setParent(t.id,t.comboId))})),E.forEach((function(t){var e=d(t,"source"),n=d(t,"target");u.layoutNode(e)&&u.layoutNode(n)&&_.setEdge(e,n,{weight:t.weight||1})})),null===(n=null==y?void 0:y.concat(w||[]))||void 0===n||n.forEach((function(t){var e,n,r=t.source,o=t.target,i=(null===(e=k[r])||void 0===e?void 0:e.collapsed)?[r]:S[r]||[r],a=(null===(n=k[o])||void 0===n?void 0:n.collapsed)?[o]:S[o]||[o];i.forEach((function(e){a.forEach((function(n){_.setEdge(e,n,{weight:t.weight||1})}))}))}));var R=void 0;(null===(r=s.preset)||void 0===r?void 0:r.nodes)&&(R=new xe({multigraph:!0,compound:!0}),s.preset.nodes.forEach((function(t){null==R||R.setNode(t.id,t)}))),fr(_,{prevGraph:R,edgeLabelSpace:s.edgeLabelSpace,keepNodeOrder:Boolean(!!s.nodeOrder),nodeOrder:s.nodeOrder});var C=[0,0];if(v){var L=1/0,P=1/0;_.nodes().forEach((function(t){var e=_.node(t);L>e.x&&(L=e.x),P>e.y&&(P=e.y)})),_.edges().forEach((function(t){var e;null===(e=_.edge(t).points)||void 0===e||e.forEach((function(t){L>t.x&&(L=t.x),P>t.y&&(P=t.y)}))})),C[0]=v[0]-L,C[1]=v[1]-P}var j="LR"===h||"RL"===h;if(g){var z=this,F=z.focusNode,G=z.ranksep,U=z.getRadialPos,B=e(F)?F:null==F?void 0:F.id,V=B?null===(a=_.node(B))||void 0===a?void 0:a._rank:0,W=[],X=j?"y":"x",H=j?"height":"width",q=1/0,Y=-1/0;_.nodes().forEach((function(t){var e=_.node(t);if(s.nodeMap[t]){var n=N(s.nodeMap[t]);if(0===V)W[e._rank]||(W[e._rank]={nodes:[],totalWidth:0,maxSize:-1/0}),W[e._rank].nodes.push(t),W[e._rank].totalWidth+=2*n+e[H],W[e._rank].maxSize<Math.max(e.width,e.height)&&(W[e._rank].maxSize=Math.max(e.width,e.height));else{var r=e._rank-V;if(0===r)W[r]||(W[r]={nodes:[],totalWidth:0,maxSize:-1/0}),W[r].nodes.push(t),W[r].totalWidth+=2*n+e[H],W[r].maxSize<Math.max(e.width,e.height)&&(W[r].maxSize=Math.max(e.width,e.height));else{var o=Math.abs(r);W[o]||(W[o]={left:[],right:[],totalWidth:0,maxSize:-1/0}),W[o].totalWidth+=2*n+e[H],W[o].maxSize<Math.max(e.width,e.height)&&(W[o].maxSize=Math.max(e.width,e.height)),r<0?W[o].left.push(t):W[o].right.push(t)}}var i=e[X]-e[H]/2-n,a=e[X]+e[H]/2+n;i<q&&(q=i),a>Y&&(Y=a)}}));var K=G||50,Z={},$=(Y-q)/.9,Q=[.5*(q+Y-$),.5*(q+Y+$)],J=function(t,e,n,r){void 0===n&&(n=-1/0),void 0===r&&(r=[0,1]);var o=n;return t.forEach((function(t){var n=_.node(t);Z[t]=e;var i=U(n[X],Q,$,e,r),a=i.x,u=i.y;if(s.nodeMap[t]){s.nodeMap[t].x=a+C[0],s.nodeMap[t].y=u+C[1],s.nodeMap[t]._order=n._order;var c=O(s.nodeMap[t]);o<c&&(o=c)}})),o},tt=!0;W.forEach((function(t){var e,n,r,o,i,a,u;if((null===(e=null==t?void 0:t.nodes)||void 0===e?void 0:e.length)||(null===(n=null==t?void 0:t.left)||void 0===n?void 0:n.length)||(null===(r=null==t?void 0:t.right)||void 0===r?void 0:r.length)){if(tt&&1===t.nodes.length){var c=t.nodes[0];if(!s.nodeMap[c])return;return s.nodeMap[c].x=C[0],s.nodeMap[c].y=C[1],Z[t.nodes[0]]=0,K=O(s.nodeMap[c]),void(tt=!1)}K=Math.max(K,t.totalWidth/(2*Math.PI));var f=-1/0;if(0===V||(null===(o=t.nodes)||void 0===o?void 0:o.length))f=J(t.nodes,K,f,[0,1]);else{var l=(null===(i=t.left)||void 0===i?void 0:i.length)/((null===(a=t.left)||void 0===a?void 0:a.length)+(null===(u=t.right)||void 0===u?void 0:u.length));f=J(t.left,K,f,[0,l]),f=J(t.right,K,f,[l+.05,1])}K+=f,tt=!1,t.maxSize}})),_.edges().forEach((function(t){var e,n,r,o=_.edge(t),i=E.findIndex((function(e){var n=d(e,"source"),r=d(e,"target");return n===t.v&&r===t.w}));if(!(i<=-1)&&s.edgeLabelSpace&&s.controlPoints&&"loop"!==E[i].type){var a="x"===X?"y":"x",u=null===(e=null==o?void 0:o.points)||void 0===e?void 0:e.slice(1,o.points.length-1),c=[],f=null===(n=_.node(t.v))||void 0===n?void 0:n[a],l=f-(null===(r=_.node(t.w))||void 0===r?void 0:r[a]),h=Z[t.v],p=h-Z[t.w];null==u||u.forEach((function(t){var e=(t[a]-f)/l*p+h,n=U(t[X],Q,$,e);c.push({x:n.x+C[0],y:n.y+C[1]})})),E[i].controlPoints=c}}))}else{var et=new Set,nt="BT"===h||"RL"===h?function(t,e){return e-t}:function(t,e){return t-e};_.nodes().forEach((function(t){var e=_.node(t);if(e){var n=u.nodeMap[t];n||(n=null==p?void 0:p.find((function(e){return e.id===t}))),n&&(n.x=e.x+C[0],n.y=e.y+C[1],n._order=e._order,et.add(j?n.x:n.y))}}));var rt=Array.from(et).sort(nt),ot=j?function(t,e){return t.x!==e.x}:function(t,e){return t.y!==e.y},it=j?function(t,e,n){var r=Math.max(e.y,n.y),o=Math.min(e.y,n.y);return t.filter((function(t){return t.y<=r&&t.y>=o}))}:function(t,e,n){var r=Math.max(e.x,n.x),o=Math.min(e.x,n.x);return t.filter((function(t){return t.x<=r&&t.x>=o}))};_.edges().forEach((function(t){var e,n=_.edge(t),r=E.findIndex((function(e){var n=d(e,"source"),r=d(e,"target");return n===t.v&&r===t.w}));if(!(r<=-1)&&s.edgeLabelSpace&&s.controlPoints&&"loop"!==E[r].type){null===(e=null==n?void 0:n.points)||void 0===e||e.forEach((function(t){t.x+=C[0],t.y+=C[1]}));var o=s.nodeMap[t.v],i=s.nodeMap[t.w];E[r].controlPoints=hr(null==n?void 0:n.points,o,i,rt,j,ot,it)}}))}return s.onLayoutEnd&&s.onLayoutEnd(),{nodes:c,edges:E}}},n.prototype.getRadialPos=function(t,e,n,r,o){void 0===o&&(o=[0,1]);var i=(t-e[0])/n,a=2*(i=i*(o[1]-o[0])+o[0])*Math.PI;return{x:Math.cos(a)*r,y:Math.sin(a)*r}},n.prototype.getType=function(){return"dagre"},n}(t),hr=function(t,e,n,r,o,i,a){var u=(null==t?void 0:t.slice(1,t.length-1))||[];if(e&&n){var s=e.x,c=e.y,f=n.x,l=n.y;if(o&&(s=e.y,c=e.x,f=n.y,l=n.x),l!==c&&s!==f){var d=r.indexOf(c),h=r[d+1];if(h){var p=u[0],v=o?{x:(c+h)/2,y:(null==p?void 0:p.y)||f}:{x:(null==p?void 0:p.x)||f,y:(c+h)/2};p&&!i(p,v)||u.unshift(v)}var g=r.indexOf(l),m=Math.abs(g-d);if(1===m)(u=a(u,e,n)).length||u.push(o?{x:(c+l)/2,y:s}:{x:s,y:(c+l)/2});else if(m>1){var y=r[g-1];if(y){var b=u[u.length-1],w=o?{x:(l+y)/2,y:(null==b?void 0:b.y)||f}:{x:(null==b?void 0:b.x)||s,y:(l+y)/2};b&&!i(b,w)||u.push(w)}}}}return u};const pr={graph:{meta:{rankDir:"TB",nodeSep:50,rankSep:50,edgeSep:5,align:void 0}},subScene:{meta:{paddingTop:20,paddingBottom:20,paddingLeft:20,paddingRight:20,labelHeight:20}},nodeSize:{meta:{width:100,maxLabelWidth:0,height:20},node:{width:80,height:20,labelOffset:10,maxLabelWidth:40},bridge:{width:5,height:5,radius:2,labelOffset:0}}};function vr(t={},e=pr){var n,r,o,i;const a=JSON.parse(JSON.stringify(e)),u=(null===(n=null==t?void 0:t.graph)||void 0===n?void 0:n.meta)||{},s=(null===(r=null==t?void 0:t.subScene)||void 0===r?void 0:r.meta)||{},c=(null===(o=null==t?void 0:t.nodeSize)||void 0===o?void 0:o.meta)||{},f=(null===(i=null==t?void 0:t.nodeSize)||void 0===i?void 0:i.node)||{},l=a.nodeSize.bridge;return{graph:{meta:Object.assign(a.graph.meta,u)},subScene:{meta:Object.assign(a.subScene.meta,s)},nodeSize:{meta:Object.assign(a.nodeSize.meta,c),node:Object.assign(a.nodeSize.node,f),bridge:l}}}function gr(t){return`◬${t}◬`}const mr=gr("ROOT"),yr=gr("BRIDGE_GRAPH");var br,wr,Er,xr;!function(t){t[t.META=0]="META",t[t.NODE=1]="NODE",t[t.BRIDGE=2]="BRIDGE"}(br||(br={})),function(t){t[t.INCLUDE=0]="INCLUDE",t[t.EXCLUDE=1]="EXCLUDE",t[t.UNSPECIFIED=2]="UNSPECIFIED"}(wr||(wr={})),function(t){t[t.META=0]="META",t[t.CORE=1]="CORE",t[t.BRIDGE=2]="BRIDGE"}(Er||(Er={})),function(t){t[t.META=0]="META",t[t.OP=1]="OP",t[t.SERIES=2]="SERIES"}(xr||(xr={}));var _r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{};function Sr(t,e){return t(e={exports:{}},e.exports),e.exports}var Ar=function(t,e){return t===e||t!=t&&e!=e},Ir=function(t,e){for(var n=t.length;n--;)if(Ar(t[n][0],e))return n;return-1},Tr=Array.prototype.splice;function Or(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Or.prototype.clear=function(){this.__data__=[],this.size=0},Or.prototype.delete=function(t){var e=this.__data__,n=Ir(e,t);return!(n<0||(n==e.length-1?e.pop():Tr.call(e,n,1),--this.size,0))},Or.prototype.get=function(t){var e=this.__data__,n=Ir(e,t);return n<0?void 0:e[n][1]},Or.prototype.has=function(t){return Ir(this.__data__,t)>-1},Or.prototype.set=function(t,e){var n=this.__data__,r=Ir(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var Nr,Dr=Or,Mr="object"==typeof _r&&_r&&_r.Object===Object&&_r,kr="object"==typeof self&&self&&self.Object===Object&&self,Rr=Mr||kr||Function("return this")(),Cr=Rr.Symbol,Lr=Object.prototype,Pr=Lr.hasOwnProperty,jr=Lr.toString,zr=Cr?Cr.toStringTag:void 0,Fr=Object.prototype.toString,Gr=Cr?Cr.toStringTag:void 0,Ur=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Gr&&Gr in Object(t)?function(t){var e=Pr.call(t,zr),n=t[zr];try{t[zr]=void 0;var r=!0}catch(t){}var o=jr.call(t);return r&&(e?t[zr]=n:delete t[zr]),o}(t):function(t){return Fr.call(t)}(t)},Br=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},Vr=function(t){if(!Br(t))return!1;var e=Ur(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},Wr=Rr["__core-js_shared__"],Xr=(Nr=/[^.]+$/.exec(Wr&&Wr.keys&&Wr.keys.IE_PROTO||""))?"Symbol(src)_1."+Nr:"",Hr=Function.prototype.toString,qr=function(t){if(null!=t){try{return Hr.call(t)}catch(t){}try{return t+""}catch(t){}}return""},Yr=/^\[object .+?Constructor\]$/,Kr=Function.prototype,Zr=Object.prototype,$r=Kr.toString,Qr=Zr.hasOwnProperty,Jr=RegExp("^"+$r.call(Qr).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),to=function(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!Br(t)||function(t){return!!Xr&&Xr in t}(t))&&(Vr(t)?Jr:Yr).test(qr(t))}(n)?n:void 0},eo=to(Rr,"Map"),no=to(Object,"create"),ro=Object.prototype.hasOwnProperty,oo=Object.prototype.hasOwnProperty;function io(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}io.prototype.clear=function(){this.__data__=no?no(null):{},this.size=0},io.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},io.prototype.get=function(t){var e=this.__data__;if(no){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return ro.call(e,t)?e[t]:void 0},io.prototype.has=function(t){var e=this.__data__;return no?void 0!==e[t]:oo.call(e,t)},io.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=no&&void 0===e?"__lodash_hash_undefined__":e,this};var ao=io,uo=function(t,e){var n=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?n["string"==typeof e?"string":"hash"]:n.map};function so(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}so.prototype.clear=function(){this.size=0,this.__data__={hash:new ao,map:new(eo||Dr),string:new ao}},so.prototype.delete=function(t){var e=uo(this,t).delete(t);return this.size-=e?1:0,e},so.prototype.get=function(t){return uo(this,t).get(t)},so.prototype.has=function(t){return uo(this,t).has(t)},so.prototype.set=function(t,e){var n=uo(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};var co=so;function fo(t){var e=this.__data__=new Dr(t);this.size=e.size}fo.prototype.clear=function(){this.__data__=new Dr,this.size=0},fo.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},fo.prototype.get=function(t){return this.__data__.get(t)},fo.prototype.has=function(t){return this.__data__.has(t)},fo.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Dr){var r=n.__data__;if(!eo||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new co(r)}return n.set(t,e),this.size=n.size,this};var lo=fo,ho=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t},po=function(){try{var t=to(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),vo=function(t,e,n){"__proto__"==e&&po?po(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n},go=Object.prototype.hasOwnProperty,mo=function(t,e,n){var r=t[e];go.call(t,e)&&Ar(r,n)&&(void 0!==n||e in t)||vo(t,e,n)},yo=function(t,e,n,r){var o=!n;n||(n={});for(var i=-1,a=e.length;++i<a;){var u=e[i],s=r?r(n[u],t[u],u,n,t):void 0;void 0===s&&(s=t[u]),o?vo(n,u,s):mo(n,u,s)}return n},bo=function(t){return null!=t&&"object"==typeof t},wo=function(t){return bo(t)&&"[object Arguments]"==Ur(t)},Eo=Object.prototype,xo=Eo.hasOwnProperty,_o=Eo.propertyIsEnumerable,So=wo(function(){return arguments}())?wo:function(t){return bo(t)&&xo.call(t,"callee")&&!_o.call(t,"callee")},Ao=Array.isArray,Io=function(){return!1},To=Sr((function(t,e){var n=e&&!e.nodeType&&e,r=n&&t&&!t.nodeType&&t,o=r&&r.exports===n?Rr.Buffer:void 0,i=(o?o.isBuffer:void 0)||Io;t.exports=i})),Oo=/^(?:0|[1-9]\d*)$/,No=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&Oo.test(t))&&t>-1&&t%1==0&&t<e},Do=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},Mo={};Mo["[object Float32Array]"]=Mo["[object Float64Array]"]=Mo["[object Int8Array]"]=Mo["[object Int16Array]"]=Mo["[object Int32Array]"]=Mo["[object Uint8Array]"]=Mo["[object Uint8ClampedArray]"]=Mo["[object Uint16Array]"]=Mo["[object Uint32Array]"]=!0,Mo["[object Arguments]"]=Mo["[object Array]"]=Mo["[object ArrayBuffer]"]=Mo["[object Boolean]"]=Mo["[object DataView]"]=Mo["[object Date]"]=Mo["[object Error]"]=Mo["[object Function]"]=Mo["[object Map]"]=Mo["[object Number]"]=Mo["[object Object]"]=Mo["[object RegExp]"]=Mo["[object Set]"]=Mo["[object String]"]=Mo["[object WeakMap]"]=!1;var ko=function(t){return function(e){return t(e)}},Ro=Sr((function(t,e){var n=e&&!e.nodeType&&e,r=n&&t&&!t.nodeType&&t,o=r&&r.exports===n&&Mr.process,i=function(){try{return r&&r.require&&r.require("util").types||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=i})),Co=Ro&&Ro.isTypedArray,Lo=Co?ko(Co):function(t){return bo(t)&&Do(t.length)&&!!Mo[Ur(t)]},Po=Object.prototype.hasOwnProperty,jo=function(t,e){var n=Ao(t),r=!n&&So(t),o=!n&&!r&&To(t),i=!n&&!r&&!o&&Lo(t),a=n||r||o||i,u=a?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],s=u.length;for(var c in t)!e&&!Po.call(t,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||No(c,s))||u.push(c);return u},zo=Object.prototype,Fo=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||zo)},Go=function(t,e){return function(n){return t(e(n))}},Uo=Go(Object.keys,Object),Bo=Object.prototype.hasOwnProperty,Vo=function(t){if(!Fo(t))return Uo(t);var e=[];for(var n in Object(t))Bo.call(t,n)&&"constructor"!=n&&e.push(n);return e},Wo=function(t){return null!=t&&Do(t.length)&&!Vr(t)},Xo=function(t){return Wo(t)?jo(t):Vo(t)},Ho=Object.prototype.hasOwnProperty,qo=function(t){return Wo(t)?jo(t,!0):function(t){if(!Br(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=Fo(t),n=[];for(var r in t)("constructor"!=r||!e&&Ho.call(t,r))&&n.push(r);return n}(t)},Yo=Sr((function(t,e){var n=e&&!e.nodeType&&e,r=n&&t&&!t.nodeType&&t,o=r&&r.exports===n?Rr.Buffer:void 0,i=o?o.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=i?i(n):new t.constructor(n);return t.copy(r),r}})),Ko=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e},Zo=function(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var a=t[n];e(a,n,t)&&(i[o++]=a)}return i},$o=function(){return[]},Qo=Object.prototype.propertyIsEnumerable,Jo=Object.getOwnPropertySymbols,ti=Jo?function(t){return null==t?[]:(t=Object(t),Zo(Jo(t),(function(e){return Qo.call(t,e)})))}:$o,ei=function(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t},ni=Go(Object.getPrototypeOf,Object),ri=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)ei(e,ti(t)),t=ni(t);return e}:$o,oi=function(t,e,n){var r=e(t);return Ao(t)?r:ei(r,n(t))},ii=function(t){return oi(t,Xo,ti)},ai=function(t){return oi(t,qo,ri)},ui=to(Rr,"DataView"),si=to(Rr,"Promise"),ci=to(Rr,"Set"),fi=to(Rr,"WeakMap"),li=qr(ui),di=qr(eo),hi=qr(si),pi=qr(ci),vi=qr(fi),gi=Ur;(ui&&"[object DataView]"!=gi(new ui(new ArrayBuffer(1)))||eo&&"[object Map]"!=gi(new eo)||si&&"[object Promise]"!=gi(si.resolve())||ci&&"[object Set]"!=gi(new ci)||fi&&"[object WeakMap]"!=gi(new fi))&&(gi=function(t){var e=Ur(t),n="[object Object]"==e?t.constructor:void 0,r=n?qr(n):"";if(r)switch(r){case li:return"[object DataView]";case di:return"[object Map]";case hi:return"[object Promise]";case pi:return"[object Set]";case vi:return"[object WeakMap]"}return e});var mi=gi,yi=Object.prototype.hasOwnProperty,bi=Rr.Uint8Array,wi=function(t){var e=new t.constructor(t.byteLength);return new bi(e).set(new bi(t)),e},Ei=/\w*$/,xi=Cr?Cr.prototype:void 0,_i=xi?xi.valueOf:void 0,Si=function(t,e){var n=e?wi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)},Ai=Object.create,Ii=function(){function t(){}return function(e){if(!Br(e))return{};if(Ai)return Ai(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}(),Ti=function(t){return"function"!=typeof t.constructor||Fo(t)?{}:Ii(ni(t))},Oi=Ro&&Ro.isMap,Ni=Oi?ko(Oi):function(t){return bo(t)&&"[object Map]"==mi(t)},Di=Ro&&Ro.isSet,Mi=Di?ko(Di):function(t){return bo(t)&&"[object Set]"==mi(t)},ki={};ki["[object Arguments]"]=ki["[object Array]"]=ki["[object ArrayBuffer]"]=ki["[object DataView]"]=ki["[object Boolean]"]=ki["[object Date]"]=ki["[object Float32Array]"]=ki["[object Float64Array]"]=ki["[object Int8Array]"]=ki["[object Int16Array]"]=ki["[object Int32Array]"]=ki["[object Map]"]=ki["[object Number]"]=ki["[object Object]"]=ki["[object RegExp]"]=ki["[object Set]"]=ki["[object String]"]=ki["[object Symbol]"]=ki["[object Uint8Array]"]=ki["[object Uint8ClampedArray]"]=ki["[object Uint16Array]"]=ki["[object Uint32Array]"]=!0,ki["[object Error]"]=ki["[object Function]"]=ki["[object WeakMap]"]=!1;var Ri=function t(e,n,r,o,i,a){var u,s=1&n,c=2&n,f=4&n;if(r&&(u=i?r(e,o,i,a):r(e)),void 0!==u)return u;if(!Br(e))return e;var l=Ao(e);if(l){if(u=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&yi.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(e),!s)return Ko(e,u)}else{var d=mi(e),h="[object Function]"==d||"[object GeneratorFunction]"==d;if(To(e))return Yo(e,s);if("[object Object]"==d||"[object Arguments]"==d||h&&!i){if(u=c||h?{}:Ti(e),!s)return c?function(t,e){return yo(t,ri(t),e)}(e,function(t,e){return t&&yo(e,qo(e),t)}(u,e)):function(t,e){return yo(t,ti(t),e)}(e,function(t,e){return t&&yo(e,Xo(e),t)}(u,e))}else{if(!ki[d])return i?e:{};u=function(t,e,n){var r=t.constructor;switch(e){case"[object ArrayBuffer]":return wi(t);case"[object Boolean]":case"[object Date]":return new r(+t);case"[object DataView]":return function(t,e){var n=e?wi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Si(t,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(t);case"[object RegExp]":return function(t){var e=new t.constructor(t.source,Ei.exec(t));return e.lastIndex=t.lastIndex,e}(t);case"[object Symbol]":return function(t){return _i?Object(_i.call(t)):{}}(t)}}(e,d,s)}}a||(a=new lo);var p=a.get(e);if(p)return p;a.set(e,u),Mi(e)?e.forEach((function(o){u.add(t(o,n,r,o,e,a))})):Ni(e)&&e.forEach((function(o,i){u.set(i,t(o,n,r,i,e,a))}));var v=l?void 0:(f?c?ai:ii:c?qo:Xo)(e);return ho(v||e,(function(o,i){v&&(o=e[i=o]),mo(u,i,t(o,n,r,i,e,a))})),u},Ci=function(t){return function(){return t}},Li=function(t,e,n){for(var r=-1,o=Object(t),i=n(t),a=i.length;a--;){var u=i[++r];if(!1===e(o[u],u,o))break}return t},Pi=function(t,e){return t&&Li(t,e,Xo)},ji=function(t,e){return function(e,n){if(null==e)return e;if(!Wo(e))return t(e,n);for(var r=e.length,o=-1,i=Object(e);++o<r&&!1!==n(i[o],o,i););return e}}(Pi),zi=function(t){return t},Fi=function(t){return"function"==typeof t?t:zi},Gi=function(t,e){return(Ao(t)?ho:ji)(t,Fi(e))},Ui=Gi,Bi=function(t,e){var n=[];return ji(t,(function(t,r,o){e(t,r,o)&&n.push(t)})),n};function Vi(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new co;++e<n;)this.add(t[e])}Vi.prototype.add=Vi.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Vi.prototype.has=function(t){return this.__data__.has(t)};var Wi=Vi,Xi=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1},Hi=function(t,e){return t.has(e)},qi=function(t,e,n,r,o,i){var a=1&n,u=t.length,s=e.length;if(u!=s&&!(a&&s>u))return!1;var c=i.get(t),f=i.get(e);if(c&&f)return c==e&&f==t;var l=-1,d=!0,h=2&n?new Wi:void 0;for(i.set(t,e),i.set(e,t);++l<u;){var p=t[l],v=e[l];if(r)var g=a?r(v,p,l,e,t,i):r(p,v,l,t,e,i);if(void 0!==g){if(g)continue;d=!1;break}if(h){if(!Xi(e,(function(t,e){if(!Hi(h,e)&&(p===t||o(p,t,n,r,i)))return h.push(e)}))){d=!1;break}}else if(p!==v&&!o(p,v,n,r,i)){d=!1;break}}return i.delete(t),i.delete(e),d},Yi=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n},Ki=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n},Zi=Cr?Cr.prototype:void 0,$i=Zi?Zi.valueOf:void 0,Qi=function(t,e,n,r,o,i,a){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!i(new bi(t),new bi(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Ar(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var u=Yi;case"[object Set]":var s=1&r;if(u||(u=Ki),t.size!=e.size&&!s)return!1;var c=a.get(t);if(c)return c==e;r|=2,a.set(t,e);var f=qi(u(t),u(e),r,o,i,a);return a.delete(t),f;case"[object Symbol]":if($i)return $i.call(t)==$i.call(e)}return!1},Ji=Object.prototype.hasOwnProperty,ta=Object.prototype.hasOwnProperty,ea=function t(e,n,r,o,i){return e===n||(null==e||null==n||!bo(e)&&!bo(n)?e!=e&&n!=n:function(t,e,n,r,o,i){var a=Ao(t),u=Ao(e),s=a?"[object Array]":mi(t),c=u?"[object Array]":mi(e),f="[object Object]"==(s="[object Arguments]"==s?"[object Object]":s),l="[object Object]"==(c="[object Arguments]"==c?"[object Object]":c),d=s==c;if(d&&To(t)){if(!To(e))return!1;a=!0,f=!1}if(d&&!f)return i||(i=new lo),a||Lo(t)?qi(t,e,n,r,o,i):Qi(t,e,s,n,r,o,i);if(!(1&n)){var h=f&&ta.call(t,"__wrapped__"),p=l&&ta.call(e,"__wrapped__");if(h||p){var v=h?t.value():t,g=p?e.value():e;return i||(i=new lo),o(v,g,n,r,i)}}return!!d&&(i||(i=new lo),function(t,e,n,r,o,i){var a=1&n,u=ii(t),s=u.length;if(s!=ii(e).length&&!a)return!1;for(var c=s;c--;){var f=u[c];if(!(a?f in e:Ji.call(e,f)))return!1}var l=i.get(t),d=i.get(e);if(l&&d)return l==e&&d==t;var h=!0;i.set(t,e),i.set(e,t);for(var p=a;++c<s;){var v=t[f=u[c]],g=e[f];if(r)var m=a?r(g,v,f,e,t,i):r(v,g,f,t,e,i);if(!(void 0===m?v===g||o(v,g,n,r,i):m)){h=!1;break}p||(p="constructor"==f)}if(h&&!p){var y=t.constructor,b=e.constructor;y==b||!("constructor"in t)||!("constructor"in e)||"function"==typeof y&&y instanceof y&&"function"==typeof b&&b instanceof b||(h=!1)}return i.delete(t),i.delete(e),h}(t,e,n,r,o,i))}(e,n,r,o,t,i))},na=function(t){return t==t&&!Br(t)},ra=function(t,e){return function(n){return null!=n&&n[t]===e&&(void 0!==e||t in Object(n))}},oa=function(t){return"symbol"==typeof t||bo(t)&&"[object Symbol]"==Ur(t)},ia=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,aa=/^\w*$/,ua=function(t,e){if(Ao(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!oa(t))||aa.test(t)||!ia.test(t)||null!=e&&t in Object(e)};function sa(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=t.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(sa.Cache||co),n}sa.Cache=co;var ca,fa=sa,la=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,da=/\\(\\)?/g,ha=function(t){var e=fa((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(la,(function(t,n,r,o){e.push(r?o.replace(da,"$1"):n||t)})),e}),(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}(),pa=function(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o},va=Cr?Cr.prototype:void 0,ga=va?va.toString:void 0,ma=function t(e){if("string"==typeof e)return e;if(Ao(e))return pa(e,t)+"";if(oa(e))return ga?ga.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n},ya=function(t){return null==t?"":ma(t)},ba=function(t,e){return Ao(t)?t:ua(t,e)?[t]:ha(ya(t))},wa=function(t){if("string"==typeof t||oa(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e},Ea=function(t,e){for(var n=0,r=(e=ba(e,t)).length;null!=t&&n<r;)t=t[wa(e[n++])];return n&&n==r?t:void 0},xa=function(t,e){return null!=t&&e in Object(t)},_a=function(t,e,n){for(var r=-1,o=(e=ba(e,t)).length,i=!1;++r<o;){var a=wa(e[r]);if(!(i=null!=t&&n(t,a)))break;t=t[a]}return i||++r!=o?i:!!(o=null==t?0:t.length)&&Do(o)&&No(a,o)&&(Ao(t)||So(t))},Sa=function(t,e){return null!=t&&_a(t,e,xa)},Aa=function(t){return function(e){return null==e?void 0:e[t]}},Ia=function(t){return"function"==typeof t?t:null==t?zi:"object"==typeof t?Ao(t)?function(t,e){return ua(t)&&na(e)?ra(wa(t),e):function(n){var r=function(t,e,n){var r=null==t?void 0:Ea(t,e);return void 0===r?void 0:r}(n,t);return void 0===r&&r===e?Sa(n,t):ea(e,r,3)}}(t[0],t[1]):function(t){var e=function(t){for(var e=Xo(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,na(o)]}return e}(t);return 1==e.length&&e[0][2]?ra(e[0][0],e[0][1]):function(n){return n===t||function(t,e,n,r){var o=n.length,i=o;if(null==t)return!i;for(t=Object(t);o--;){var a=n[o];if(a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++o<i;){var u=(a=n[o])[0],s=t[u],c=a[1];if(a[2]){if(void 0===s&&!(u in t))return!1}else{var f,l=new lo;if(!(void 0===f?ea(c,s,3,r,l):f))return!1}}return!0}(n,0,e)}}(t):function(t){return ua(t)?Aa(wa(t)):function(t){return function(e){return Ea(e,t)}}(t)}(t)},Ta=function(t,e){return(Ao(t)?Zo:Bi)(t,Ia(e))},Oa=Object.prototype.hasOwnProperty,Na=function(t,e){return null!=t&&Oa.call(t,e)},Da=function(t,e){return null!=t&&_a(t,e,Na)},Ma=Object.prototype.hasOwnProperty,ka=function(t){return void 0===t},Ra=function(t,e){var n=-1,r=Wo(t)?Array(t.length):[];return ji(t,(function(t,o,i){r[++n]=e(t,o,i)})),r},Ca=function(t,e){return(Ao(t)?pa:Ra)(t,Ia(e))},La=function(t,e,n,r){var o=-1,i=null==t?0:t.length;for(r&&i&&(n=t[++o]);++o<i;)n=e(n,t[o],o,t);return n},Pa=function(t,e,n,r,o){return o(t,(function(t,o,i){n=r?(r=!1,t):e(n,t,o,i)})),n},ja=function(t,e,n){var r=Ao(t)?La:Pa,o=arguments.length<3;return r(t,Ia(e),n,o,ji)},za=Aa("length"),Fa=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),Ga="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Ua="\\ud83c[\\udffb-\\udfff]",Ba="[^\\ud800-\\udfff]",Va="(?:\\ud83c[\\udde6-\\uddff]){2}",Wa="[\\ud800-\\udbff][\\udc00-\\udfff]",Xa="(?:"+Ga+"|"+Ua+")?",Ha="[\\ufe0e\\ufe0f]?"+Xa+"(?:\\u200d(?:"+[Ba,Va,Wa].join("|")+")[\\ufe0e\\ufe0f]?"+Xa+")*",qa="(?:"+[Ba+Ga+"?",Ga,Va,Wa,"[\\ud800-\\udfff]"].join("|")+")",Ya=RegExp(Ua+"(?="+Ua+")|"+qa+Ha,"g"),Ka=Cr?Cr.isConcatSpreadable:void 0,Za=function(t){return Ao(t)||So(t)||!!(Ka&&t&&t[Ka])},$a=function t(e,n,r,o,i){var a=-1,u=e.length;for(r||(r=Za),i||(i=[]);++a<u;){var s=e[a];n>0&&r(s)?n>1?t(s,n-1,r,o,i):ei(i,s):o||(i[i.length]=s)}return i},Qa=Math.max,Ja=function(t,e,n){return e=Qa(void 0===e?t.length-1:e,0),function(){for(var r=arguments,o=-1,i=Qa(r.length-e,0),a=Array(i);++o<i;)a[o]=r[e+o];o=-1;for(var u=Array(e+1);++o<e;)u[o]=r[o];return u[e]=n(a),function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}(t,this,u)}},tu=po?function(t,e){return po(t,"toString",{configurable:!0,enumerable:!1,value:Ci(e),writable:!0})}:zi,eu=Date.now,nu=function(t){var e=0,n=0;return function(){var r=eu(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(tu),ru=function(t,e){return nu(Ja(t,e,zi),t+"")},ou=function(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i<o;)if(e(t[i],i,t))return i;return-1},iu=function(t){return t!=t},au=function(t,e){return!(null==t||!t.length)&&function(t,e,n){return e==e?function(t,e,n){for(var r=-1,o=t.length;++r<o;)if(t[r]===e)return r;return-1}(t,e):ou(t,iu,0)}(t,e)>-1},uu=ci&&1/Ki(new ci([,-0]))[1]==1/0?function(t){return new ci(t)}:function(){},su=function(t){return bo(t)&&Wo(t)},cu=ru((function(t){return function(t,e,n){var r=-1,o=au,i=t.length,a=!0,u=[],s=u;if(i>=200){var c=uu(t);if(c)return Ki(c);a=!1,o=Hi,s=new Wi}else s=u;t:for(;++r<i;){var f=t[r],l=f;if(f=0!==f?f:0,a&&l==l){for(var d=s.length;d--;)if(s[d]===l)continue t;u.push(f)}else o(s,l,n)||(s!==u&&s.push(l),u.push(f))}return u}($a(t,1,su,!0))})),fu=function(t){return null==t?[]:function(t,e){return pa(e,(function(e){return t[e]}))}(t,Xo(t))};try{ca={clone:function(t){return Ri(t,4)},constant:Ci,each:Ui,filter:Ta,has:Da,isArray:Ao,isEmpty:function(t){if(null==t)return!0;if(Wo(t)&&(Ao(t)||"string"==typeof t||"function"==typeof t.splice||To(t)||Lo(t)||So(t)))return!t.length;var e=mi(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(Fo(t))return!Vo(t).length;for(var n in t)if(Ma.call(t,n))return!1;return!0},isFunction:Vr,isUndefined:ka,keys:Xo,map:Ca,reduce:ja,size:function(t){if(null==t)return 0;if(Wo(t))return function(t){return"string"==typeof t||!Ao(t)&&bo(t)&&"[object String]"==Ur(t)}(t)?function(t){return function(t){return Fa.test(t)}(t)?function(t){for(var e=Ya.lastIndex=0;Ya.test(t);)++e;return e}(t):za(t)}(t):t.length;var e=mi(t);return"[object Map]"==e||"[object Set]"==e?t.size:Vo(t).length},transform:function(t,e,n){var r=Ao(t),o=r||To(t)||Lo(t);if(e=Ia(e),null==n){var i=t&&t.constructor;n=o?r?new i:[]:Br(t)&&Vr(i)?Ii(ni(t)):{}}return(o?ho:Pi)(t,(function(t,r,o){return e(n,t,r,o)})),n},union:cu,values:fu}}catch(pr){}ca||(ca=window._);var lu=ca,du=hu;function hu(t){this._isDirected=!lu.has(t,"directed")||t.directed,this._isMultigraph=!!lu.has(t,"multigraph")&&t.multigraph,this._isCompound=!!lu.has(t,"compound")&&t.compound,this._label=void 0,this._defaultNodeLabelFn=lu.constant(void 0),this._defaultEdgeLabelFn=lu.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function pu(t,e){t[e]?t[e]++:t[e]=1}function vu(t,e){--t[e]||delete t[e]}function gu(t,e,n,r){var o=""+e,i=""+n;if(!t&&o>i){var a=o;o=i,i=a}return o+""+i+""+(lu.isUndefined(r)?"\0":r)}function mu(t,e){return gu(t,e.v,e.w,e.name)}hu.prototype._nodeCount=0,hu.prototype._edgeCount=0,hu.prototype.isDirected=function(){return this._isDirected},hu.prototype.isMultigraph=function(){return this._isMultigraph},hu.prototype.isCompound=function(){return this._isCompound},hu.prototype.setGraph=function(t){return this._label=t,this},hu.prototype.graph=function(){return this._label},hu.prototype.setDefaultNodeLabel=function(t){return lu.isFunction(t)||(t=lu.constant(t)),this._defaultNodeLabelFn=t,this},hu.prototype.nodeCount=function(){return this._nodeCount},hu.prototype.nodes=function(){return lu.keys(this._nodes)},hu.prototype.sources=function(){var t=this;return lu.filter(this.nodes(),(function(e){return lu.isEmpty(t._in[e])}))},hu.prototype.sinks=function(){var t=this;return lu.filter(this.nodes(),(function(e){return lu.isEmpty(t._out[e])}))},hu.prototype.setNodes=function(t,e){var n=arguments,r=this;return lu.each(t,(function(t){n.length>1?r.setNode(t,e):r.setNode(t)})),this},hu.prototype.setNode=function(t,e){return lu.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},hu.prototype.node=function(t){return this._nodes[t]},hu.prototype.hasNode=function(t){return lu.has(this._nodes,t)},hu.prototype.removeNode=function(t){var e=this;if(lu.has(this._nodes,t)){var n=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],lu.each(this.children(t),(function(t){e.setParent(t)})),delete this._children[t]),lu.each(lu.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],lu.each(lu.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},hu.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(lu.isUndefined(e))e="\0";else{for(var n=e+="";!lu.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},hu.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},hu.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if("\0"!==e)return e}},hu.prototype.children=function(t){if(lu.isUndefined(t)&&(t="\0"),this._isCompound){var e=this._children[t];if(e)return lu.keys(e)}else{if("\0"===t)return this.nodes();if(this.hasNode(t))return[]}},hu.prototype.predecessors=function(t){var e=this._preds[t];if(e)return lu.keys(e)},hu.prototype.successors=function(t){var e=this._sucs[t];if(e)return lu.keys(e)},hu.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return lu.union(e,this.successors(t))},hu.prototype.isLeaf=function(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length},hu.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var n=this;lu.each(this._nodes,(function(n,r){t(r)&&e.setNode(r,n)})),lu.each(this._edgeObjs,(function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,n.edge(t))}));var r={};function o(t){var i=n.parent(t);return void 0===i||e.hasNode(i)?(r[t]=i,i):i in r?r[i]:o(i)}return this._isCompound&&lu.each(e.nodes(),(function(t){e.setParent(t,o(t))})),e},hu.prototype.setDefaultEdgeLabel=function(t){return lu.isFunction(t)||(t=lu.constant(t)),this._defaultEdgeLabelFn=t,this},hu.prototype.edgeCount=function(){return this._edgeCount},hu.prototype.edges=function(){return lu.values(this._edgeObjs)},hu.prototype.setPath=function(t,e){var n=this,r=arguments;return lu.reduce(t,(function(t,o){return r.length>1?n.setEdge(t,o,e):n.setEdge(t,o),o})),this},hu.prototype.setEdge=function(){var t,e,n,r,o=!1,i=arguments[0];"object"==typeof i&&null!==i&&"v"in i?(t=i.v,e=i.w,n=i.name,2===arguments.length&&(r=arguments[1],o=!0)):(t=i,e=arguments[1],n=arguments[3],arguments.length>2&&(r=arguments[2],o=!0)),t=""+t,e=""+e,lu.isUndefined(n)||(n=""+n);var a=gu(this._isDirected,t,e,n);if(lu.has(this._edgeLabels,a))return o&&(this._edgeLabels[a]=r),this;if(!lu.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[a]=o?r:this._defaultEdgeLabelFn(t,e,n);var u=function(t,e,n,r){var o=""+e,i=""+n;if(!t&&o>i){var a=o;o=i,i=a}var u={v:o,w:i};return r&&(u.name=r),u}(this._isDirected,t,e,n);return t=u.v,e=u.w,Object.freeze(u),this._edgeObjs[a]=u,pu(this._preds[e],t),pu(this._sucs[t],e),this._in[e][a]=u,this._out[t][a]=u,this._edgeCount++,this},hu.prototype.edge=function(t,e,n){var r=1===arguments.length?mu(this._isDirected,arguments[0]):gu(this._isDirected,t,e,n);return this._edgeLabels[r]},hu.prototype.hasEdge=function(t,e,n){var r=1===arguments.length?mu(this._isDirected,arguments[0]):gu(this._isDirected,t,e,n);return lu.has(this._edgeLabels,r)},hu.prototype.removeEdge=function(t,e,n){var r=1===arguments.length?mu(this._isDirected,arguments[0]):gu(this._isDirected,t,e,n),o=this._edgeObjs[r];return o&&(t=o.v,e=o.w,delete this._edgeLabels[r],delete this._edgeObjs[r],vu(this._preds[e],t),vu(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this},hu.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var r=lu.values(n);return e?lu.filter(r,(function(t){return t.v===e})):r}},hu.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var r=lu.values(n);return e?lu.filter(r,(function(t){return t.w===e})):r}},hu.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))};var yu={Graph:du,version:"2.1.8"},bu={write:function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:wu(t),edges:Eu(t)};return lu.isUndefined(t.graph())||(e.value=lu.clone(t.graph())),e},read:function(t){var e=new du(t.options).setGraph(t.value);return lu.each(t.nodes,(function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)})),lu.each(t.edges,(function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)})),e}};function wu(t){return lu.map(t.nodes(),(function(e){var n=t.node(e),r=t.parent(e),o={v:e};return lu.isUndefined(n)||(o.value=n),lu.isUndefined(r)||(o.parent=r),o}))}function Eu(t){return lu.map(t.edges(),(function(e){var n=t.edge(e),r={v:e.v,w:e.w};return lu.isUndefined(e.name)||(r.name=e.name),lu.isUndefined(n)||(r.value=n),r}))}var xu=_u;function _u(){this._arr=[],this._keyIndices={}}_u.prototype.size=function(){return this._arr.length},_u.prototype.keys=function(){return this._arr.map((function(t){return t.key}))},_u.prototype.has=function(t){return lu.has(this._keyIndices,t)},_u.prototype.priority=function(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority},_u.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},_u.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!lu.has(n,t)){var r=this._arr,o=r.length;return n[t]=o,r.push({key:t,priority:e}),this._decrease(o),!0}return!1},_u.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},_u.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)},_u.prototype._heapify=function(t){var e=this._arr,n=2*t,r=n+1,o=t;n<e.length&&(o=e[n].priority<e[o].priority?n:o,r<e.length&&(o=e[r].priority<e[o].priority?r:o),o!==t&&(this._swap(t,o),this._heapify(o)))},_u.prototype._decrease=function(t){for(var e,n=this._arr,r=n[t].priority;0!==t&&!(n[e=t>>1].priority<r);)this._swap(t,e),t=e},_u.prototype._swap=function(t,e){var n=this._arr,r=this._keyIndices,o=n[t],i=n[e];n[t]=i,n[e]=o,r[i.key]=t,r[o.key]=e};var Su=function(t,e,n,r){return function(t,e,n,r){var o,i,a={},u=new xu,s=function(t){var e=t.v!==o?t.v:t.w,r=a[e],s=n(t),c=i.distance+s;if(s<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+t+" Weight: "+s);c<r.distance&&(r.distance=c,r.predecessor=o,u.decrease(e,c))};for(t.nodes().forEach((function(t){var n=t===e?0:Number.POSITIVE_INFINITY;a[t]={distance:n},u.add(t,n)}));u.size()>0&&(o=u.removeMin(),(i=a[o]).distance!==Number.POSITIVE_INFINITY);)r(o).forEach(s);return a}(t,String(e),n||Au,r||function(e){return t.outEdges(e)})},Au=lu.constant(1),Iu=function(t){var e=0,n=[],r={},o=[];function i(a){var u=r[a]={onStack:!0,lowlink:e,index:e++};if(n.push(a),t.successors(a).forEach((function(t){lu.has(r,t)?r[t].onStack&&(u.lowlink=Math.min(u.lowlink,r[t].index)):(i(t),u.lowlink=Math.min(u.lowlink,r[t].lowlink))})),u.lowlink===u.index){var s,c=[];do{s=n.pop(),r[s].onStack=!1,c.push(s)}while(a!==s);o.push(c)}}return t.nodes().forEach((function(t){lu.has(r,t)||i(t)})),o},Tu=lu.constant(1),Ou=Nu;function Nu(t){var e={},n={},r=[];if(lu.each(t.sinks(),(function o(i){if(lu.has(n,i))throw new Du;lu.has(e,i)||(n[i]=!0,e[i]=!0,lu.each(t.predecessors(i),o),delete n[i],r.push(i))})),lu.size(e)!==t.nodeCount())throw new Du;return r}function Du(){}Nu.CycleException=Du,Du.prototype=new Error;var Mu=function(t,e,n){lu.isArray(e)||(e=[e]);var r=(t.isDirected()?t.successors:t.neighbors).bind(t),o=[],i={};return lu.each(e,(function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);ku(t,e,"post"===n,i,r,o)})),o};function ku(t,e,n,r,o,i){lu.has(r,e)||(r[e]=!0,n||i.push(e),lu.each(o(e),(function(e){ku(t,e,n,r,o,i)})),n&&i.push(e))}var Ru,Cu={Graph:yu.Graph,json:bu,alg:{components:function(t){var e,n={},r=[];function o(r){lu.has(n,r)||(n[r]=!0,e.push(r),lu.each(t.successors(r),o),lu.each(t.predecessors(r),o))}return lu.each(t.nodes(),(function(t){e=[],o(t),e.length&&r.push(e)})),r},dijkstra:Su,dijkstraAll:function(t,e,n){return lu.transform(t.nodes(),(function(r,o){r[o]=Su(t,o,e,n)}),{})},findCycles:function(t){return lu.filter(Iu(t),(function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])}))},floydWarshall:function(t,e,n){return function(t,e,n){var r={},o=t.nodes();return o.forEach((function(t){r[t]={},r[t][t]={distance:0},o.forEach((function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})})),n(t).forEach((function(n){var o=n.v===t?n.w:n.v,i=e(n);r[t][o]={distance:i,predecessor:t}}))})),o.forEach((function(t){var e=r[t];o.forEach((function(n){var i=r[n];o.forEach((function(n){var r=i[t],o=e[n],a=i[n],u=r.distance+o.distance;u<a.distance&&(a.distance=u,a.predecessor=o.predecessor)}))}))})),r}(t,e||Tu,n||function(e){return t.outEdges(e)})},isAcyclic:function(t){try{Ou(t)}catch(t){if(t instanceof Ou.CycleException)return!1;throw t}return!0},postorder:function(t,e){return Mu(t,e,"post")},preorder:function(t,e){return Mu(t,e,"pre")},prim:function(t,e){var n,r=new du,o={},i=new xu;function a(t){var r=t.v===n?t.w:t.v,a=i.priority(r);if(void 0!==a){var u=e(t);u<a&&(o[r]=n,i.decrease(r,u))}}if(0===t.nodeCount())return r;lu.each(t.nodes(),(function(t){i.add(t,Number.POSITIVE_INFINITY),r.setNode(t)})),i.decrease(t.nodes()[0],0);for(var u=!1;i.size()>0;){if(n=i.removeMin(),lu.has(o,n))r.setEdge(n,o[n]);else{if(u)throw new Error("Input graph is not connected: "+t);u=!0}t.nodeEdges(n).forEach(a)}return r},tarjan:Iu,topsort:Ou},version:yu.version};try{Ru=Cu}catch(pr){}Ru||(Ru=window.graphlib);var Lu,Pu=Ru,ju=function(t,e,n){if(!Br(n))return!1;var r=typeof e;return!!("number"==r?Wo(n)&&No(e,n.length):"string"==r&&e in n)&&Ar(n[e],t)},zu=Object.prototype,Fu=zu.hasOwnProperty,Gu=ru((function(t,e){t=Object(t);var n=-1,r=e.length,o=r>2?e[2]:void 0;for(o&&ju(e[0],e[1],o)&&(r=1);++n<r;)for(var i=e[n],a=qo(i),u=-1,s=a.length;++u<s;){var c=a[u],f=t[c];(void 0===f||Ar(f,zu[c])&&!Fu.call(t,c))&&(t[c]=i[c])}return t})),Uu=/^\s+|\s+$/g,Bu=/^[-+]0x[0-9a-f]+$/i,Vu=/^0b[01]+$/i,Wu=/^0o[0-7]+$/i,Xu=parseInt,Hu=function(t){return t?1/0===(t=function(t){if("number"==typeof t)return t;if(oa(t))return NaN;if(Br(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Br(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(Uu,"");var n=Vu.test(t);return n||Wu.test(t)?Xu(t.slice(2),n?2:8):Bu.test(t)?NaN:+t}(t))||-1/0===t?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0},qu=Math.max,Yu=function(t,e,n){var r=Object(t);if(!Wo(t)){var o=Ia(e);t=Xo(t),e=function(t){return o(r[t],t,r)}}var i=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:function(t){var e=Hu(t),n=e%1;return e==e?n?e-n:e:0}(n);return o<0&&(o=qu(r+o,0)),ou(t,Ia(e),o)}(t,e,n);return i>-1?r[o?t[i]:i]:void 0},Ku=function(t){return null!=t&&t.length?$a(t,1):[]},Zu=function(t,e,n){for(var r=-1,o=t.length;++r<o;){var i=t[r],a=e(i);if(null!=a&&(void 0===u?a==a&&!oa(a):n(a,u)))var u=a,s=i}return s},$u=function(t,e){return t>e},Qu=function(t,e,n){(void 0!==n&&!Ar(t[e],n)||void 0===n&&!(e in t))&&vo(t,e,n)},Ju=Function.prototype,ts=Object.prototype,es=Ju.toString,ns=ts.hasOwnProperty,rs=es.call(Object),os=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]},is=function t(e,n,r,o,i){e!==n&&Li(n,(function(a,u){if(i||(i=new lo),Br(a))!function(t,e,n,r,o,i,a){var u=os(t,n),s=os(e,n),c=a.get(s);if(c)Qu(t,n,c);else{var f=i?i(u,s,n+"",t,e,a):void 0,l=void 0===f;if(l){var d=Ao(s),h=!d&&To(s),p=!d&&!h&&Lo(s);f=s,d||h||p?Ao(u)?f=u:su(u)?f=Ko(u):h?(l=!1,f=Yo(s,!0)):p?(l=!1,f=Si(s,!0)):f=[]:function(t){if(!bo(t)||"[object Object]"!=Ur(t))return!1;var e=ni(t);if(null===e)return!0;var n=ns.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&es.call(n)==rs}(s)||So(s)?(f=u,So(u)?f=function(t){return yo(t,qo(t))}(u):Br(u)&&!Vr(u)||(f=Ti(s))):l=!1}l&&(a.set(s,f),o(f,s,r,i,a),a.delete(s)),Qu(t,n,f)}}(e,n,u,r,t,o,i);else{var s=o?o(os(e,u),a,u+"",e,n,i):void 0;void 0===s&&(s=a),Qu(e,u,s)}}),qo)},as=function(t){return ru((function(e,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(i=t.length>3&&"function"==typeof i?(o--,i):void 0,a&&ju(n[0],n[1],a)&&(i=o<3?void 0:i,o=1),e=Object(e);++r<o;){var u=n[r];u&&t(e,u,r)}return e}))}((function(t,e,n){is(t,e,n)})),us=function(t,e){return t<e},ss=function(t,e,n,r){if(!Br(t))return t;for(var o=-1,i=(e=ba(e,t)).length,a=i-1,u=t;null!=u&&++o<i;){var s=wa(e[o]),c=n;if("__proto__"===s||"constructor"===s||"prototype"===s)return t;if(o!=a){var f=u[s];void 0===(c=r?r(f,s,u):void 0)&&(c=Br(f)?f:No(e[o+1])?[]:{})}mo(u,s,c),u=u[s]}return t},cs=function(t){return nu(Ja(t,void 0,Ku),t+"")}((function(t,e){return null==t?{}:function(t,e){return function(t,e,n){for(var r=-1,o=e.length,i={};++r<o;){var a=e[r],u=Ea(t,a);n(0,a)&&ss(i,ba(a,t),u)}return i}(t,e,(function(e,n){return Sa(t,n)}))}(t,e)})),fs=Math.ceil,ls=Math.max,ds=function(t,e){if(t!==e){var n=void 0!==t,r=null===t,o=t==t,i=oa(t),a=void 0!==e,u=null===e,s=e==e,c=oa(e);if(!u&&!c&&!i&&t>e||i&&a&&s&&!u&&!c||r&&a&&s||!n&&s||!o)return 1;if(!r&&!i&&!c&&t<e||c&&n&&o&&!r&&!i||u&&n&&o||!a&&o||!s)return-1}return 0},hs=ru((function(t,e){if(null==t)return[];var n=e.length;return n>1&&ju(t,e[0],e[1])?e=[]:n>2&&ju(e[0],e[1],e[2])&&(e=[e[0]]),function(t,e,n){e=e.length?pa(e,(function(t){return Ao(t)?function(e){return Ea(e,1===t.length?t[0]:t)}:t})):[zi];var r=-1;e=pa(e,ko(Ia));var o=Ra(t,(function(t,n,o){return{criteria:pa(e,(function(e){return e(t)})),index:++r,value:t}}));return function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(o,(function(t,e){return function(t,e,n){for(var r=-1,o=t.criteria,i=e.criteria,a=o.length,u=n.length;++r<a;){var s=ds(o[r],i[r]);if(s)return r>=u?s:s*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}(t,$a(e,1),[])})),ps=0;try{Lu={cloneDeep:function(t){return Ri(t,5)},constant:Ci,defaults:Gu,each:Ui,filter:Ta,find:Yu,flatten:Ku,forEach:Gi,forIn:function(t,e){return null==t?t:Li(t,Fi(e),qo)},has:Da,isUndefined:ka,last:function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0},map:Ca,mapValues:function(t,e){var n={};return e=Ia(e),Pi(t,(function(t,r,o){vo(n,r,e(t,r,o))})),n},max:function(t){return t&&t.length?Zu(t,zi,$u):void 0},merge:as,min:function(t){return t&&t.length?Zu(t,zi,us):void 0},minBy:function(t,e){return t&&t.length?Zu(t,Ia(e),us):void 0},now:function(){return Rr.Date.now()},pick:cs,range:function(t,e,n){return n&&"number"!=typeof n&&ju(t,e,n)&&(e=n=void 0),t=Hu(t),void 0===e?(e=t,t=0):e=Hu(e),function(t,e,n,r){for(var o=-1,i=ls(fs((e-t)/(n||1)),0),a=Array(i);i--;)a[++o]=t,t+=n;return a}(t,e,n=void 0===n?t<e?1:-1:Hu(n))},reduce:ja,sortBy:hs,uniqueId:function(t){var e=++ps;return ya(t)+e},values:fu,zipObject:function(t,e){return function(t,e,n){for(var r=-1,o=t.length,i=e.length,a={};++r<o;){var u=r<i?e[r]:void 0;n(a,t[r],u)}return a}(t||[],e||[],mo)}}}catch(pr){}Lu||(Lu=window._);var vs=Lu,gs=ms;function ms(){var t={};t._next=t._prev=t,this._sentinel=t}function ys(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function bs(t,e){if("_next"!==t&&"_prev"!==t)return e}ms.prototype.dequeue=function(){var t=this._sentinel,e=t._prev;if(e!==t)return ys(e),e},ms.prototype.enqueue=function(t){var e=this._sentinel;t._prev&&t._next&&ys(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e},ms.prototype.toString=function(){for(var t=[],e=this._sentinel,n=e._prev;n!==e;)t.push(JSON.stringify(n,bs)),n=n._prev;return"["+t.join(", ")+"]"};var ws=Pu.Graph,Es=vs.constant(1);function xs(t,e,n,r,o){var i=o?[]:void 0;return vs.forEach(t.inEdges(r.v),(function(r){var a=t.edge(r),u=t.node(r.v);o&&i.push({v:r.v,w:r.w}),u.out-=a,_s(e,n,u)})),vs.forEach(t.outEdges(r.v),(function(r){var o=t.edge(r),i=r.w,a=t.node(i);a.in-=o,_s(e,n,a)})),t.removeNode(r.v),i}function _s(t,e,n){n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)}var Ss=Pu.Graph,As={addDummyNode:Is,simplify:function(t){var e=(new Ss).setGraph(t.graph());return vs.forEach(t.nodes(),(function(n){e.setNode(n,t.node(n))})),vs.forEach(t.edges(),(function(n){var r=e.edge(n.v,n.w)||{weight:0,minlen:1},o=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})})),e},asNonCompoundGraph:function(t){var e=new Ss({multigraph:t.isMultigraph()}).setGraph(t.graph());return vs.forEach(t.nodes(),(function(n){t.children(n).length||e.setNode(n,t.node(n))})),vs.forEach(t.edges(),(function(n){e.setEdge(n,t.edge(n))})),e},successorWeights:function(t){var e=vs.map(t.nodes(),(function(e){var n={};return vs.forEach(t.outEdges(e),(function(e){n[e.w]=(n[e.w]||0)+t.edge(e).weight})),n}));return vs.zipObject(t.nodes(),e)},predecessorWeights:function(t){var e=vs.map(t.nodes(),(function(e){var n={};return vs.forEach(t.inEdges(e),(function(e){n[e.v]=(n[e.v]||0)+t.edge(e).weight})),n}));return vs.zipObject(t.nodes(),e)},intersectRect:function(t,e){var n,r,o=t.x,i=t.y,a=e.x-o,u=e.y-i,s=t.width/2,c=t.height/2;if(!a&&!u)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(u)*s>Math.abs(a)*c?(u<0&&(c=-c),n=c*a/u,r=c):(a<0&&(s=-s),n=s,r=s*u/a),{x:o+n,y:i+r}},buildLayerMatrix:function(t){var e=vs.map(vs.range(Ts(t)+1),(function(){return[]}));return vs.forEach(t.nodes(),(function(n){var r=t.node(n),o=r.rank;vs.isUndefined(o)||(e[o][r.order]=n)})),e},normalizeRanks:function(t){var e=vs.min(vs.map(t.nodes(),(function(e){return t.node(e).rank})));vs.forEach(t.nodes(),(function(n){var r=t.node(n);vs.has(r,"rank")&&(r.rank-=e)}))},removeEmptyRanks:function(t){var e=vs.min(vs.map(t.nodes(),(function(e){return t.node(e).rank}))),n=[];vs.forEach(t.nodes(),(function(r){var o=t.node(r).rank-e;n[o]||(n[o]=[]),n[o].push(r)}));var r=0,o=t.graph().nodeRankFactor;vs.forEach(n,(function(e,n){vs.isUndefined(e)&&n%o!=0?--r:r&&vs.forEach(e,(function(e){t.node(e).rank+=r}))}))},addBorderNode:function(t,e,n,r){var o={width:0,height:0};return arguments.length>=4&&(o.rank=n,o.order=r),Is(t,"border",o,e)},maxRank:Ts,partition:function(t,e){var n={lhs:[],rhs:[]};return vs.forEach(t,(function(t){e(t)?n.lhs.push(t):n.rhs.push(t)})),n},time:function(t,e){var n=vs.now();try{return e()}finally{console.log(t+" time: "+(vs.now()-n)+"ms")}},notime:function(t,e){return e()}};function Is(t,e,n,r){var o;do{o=vs.uniqueId(r)}while(t.hasNode(o));return n.dummy=e,t.setNode(o,n),o}function Ts(t){return vs.max(vs.map(t.nodes(),(function(e){var n=t.node(e).rank;if(!vs.isUndefined(n))return n})))}var Os=function(t){var e={};vs.forEach(t.sources(),(function n(r){var o=t.node(r);if(vs.has(e,r))return o.rank;e[r]=!0;var i=vs.min(vs.map(t.outEdges(r),(function(e){return n(e.w)-t.edge(e).minlen})));return i!==Number.POSITIVE_INFINITY&&null!=i||(i=0),o.rank=i}))},Ns=function(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen},Ds=Pu.Graph,Ms=Ns,ks=function(t){var e,n,r=new Ds({directed:!1}),o=t.nodes()[0],i=t.nodeCount();for(r.setNode(o,{});Rs(r,t)<i;)e=Cs(r,t),n=r.hasNode(e.v)?Ms(t,e):-Ms(t,e),Ls(r,t,n);return r};function Rs(t,e){return vs.forEach(t.nodes(),(function n(r){vs.forEach(e.nodeEdges(r),(function(o){var i=o.v,a=r===i?o.w:i;t.hasNode(a)||Ms(e,o)||(t.setNode(a,{}),t.setEdge(r,a,{}),n(a))}))})),t.nodeCount()}function Cs(t,e){return vs.minBy(e.edges(),(function(n){if(t.hasNode(n.v)!==t.hasNode(n.w))return Ms(e,n)}))}function Ls(t,e,n){vs.forEach(t.nodes(),(function(t){e.node(t).rank+=n}))}var Ps=Ns,js=Os,zs=Pu.alg.preorder,Fs=Pu.alg.postorder,Gs=As.simplify,Us=Bs;function Bs(t){t=Gs(t),js(t);var e,n=ks(t);for(Xs(n),Vs(n,t);e=qs(n);)Ks(n,t,e,Ys(n,t,e))}function Vs(t,e){var n=Fs(t,t.nodes());n=n.slice(0,n.length-1),vs.forEach(n,(function(n){!function(t,e,n){var r=t.node(n).parent;t.edge(n,r).cutvalue=Ws(t,e,n)}(t,e,n)}))}function Ws(t,e,n){var r=t.node(n).parent,o=!0,i=e.edge(n,r),a=0;return i||(o=!1,i=e.edge(r,n)),a=i.weight,vs.forEach(e.nodeEdges(n),(function(i){var u,s,c=i.v===n,f=c?i.w:i.v;if(f!==r){var l=c===o,d=e.edge(i).weight;if(a+=l?d:-d,u=n,s=f,t.hasEdge(u,s)){var h=t.edge(n,f).cutvalue;a+=l?-h:h}}})),a}function Xs(t,e){arguments.length<2&&(e=t.nodes()[0]),Hs(t,{},1,e)}function Hs(t,e,n,r,o){var i=n,a=t.node(r);return e[r]=!0,vs.forEach(t.neighbors(r),(function(o){vs.has(e,o)||(n=Hs(t,e,n,o,r))})),a.low=i,a.lim=n++,o?a.parent=o:delete a.parent,n}function qs(t){return vs.find(t.edges(),(function(e){return t.edge(e).cutvalue<0}))}function Ys(t,e,n){var r=n.v,o=n.w;e.hasEdge(r,o)||(r=n.w,o=n.v);var i=t.node(r),a=t.node(o),u=i,s=!1;i.lim>a.lim&&(u=a,s=!0);var c=vs.filter(e.edges(),(function(e){return s===Zs(0,t.node(e.v),u)&&s!==Zs(0,t.node(e.w),u)}));return vs.minBy(c,(function(t){return Ps(e,t)}))}function Ks(t,e,n,r){var o=n.v,i=n.w;t.removeEdge(o,i),t.setEdge(r.v,r.w,{}),Xs(t),Vs(t,e),function(t,e){var n=vs.find(t.nodes(),(function(t){return!e.node(t).parent})),r=zs(t,n);r=r.slice(1),vs.forEach(r,(function(n){var r=t.node(n).parent,o=e.edge(n,r),i=!1;o||(o=e.edge(r,n),i=!0),e.node(n).rank=e.node(r).rank+(i?o.minlen:-o.minlen)}))}(t,e)}function Zs(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}Bs.initLowLimValues=Xs,Bs.initCutValues=Vs,Bs.calcCutValue=Ws,Bs.leaveEdge=qs,Bs.enterEdge=Ys,Bs.exchangeEdges=Ks;var $s=Os,Qs=$s;var Js=function(t){var e=As.addDummyNode(t,"root",{},"_root"),n=function(t){var e={};function n(r,o){var i=t.children(r);i&&i.length&&vs.forEach(i,(function(t){n(t,o+1)})),e[r]=o}return vs.forEach(t.children(),(function(t){n(t,1)})),e}(t),r=vs.max(vs.values(n))-1,o=2*r+1;t.graph().nestingRoot=e,vs.forEach(t.edges(),(function(e){t.edge(e).minlen*=o}));var i=function(t){return vs.reduce(t.edges(),(function(e,n){return e+t.edge(n).weight}),0)}(t)+1;vs.forEach(t.children(),(function(a){tc(t,e,o,i,r,n,a)})),t.graph().nodeRankFactor=o};function tc(t,e,n,r,o,i,a){var u=t.children(a);if(u.length){var s=As.addBorderNode(t,"_bt"),c=As.addBorderNode(t,"_bb"),f=t.node(a);t.setParent(s,a),f.borderTop=s,t.setParent(c,a),f.borderBottom=c,vs.forEach(u,(function(u){tc(t,e,n,r,o,i,u);var f=t.node(u),l=f.borderTop?f.borderTop:u,d=f.borderBottom?f.borderBottom:u,h=f.borderTop?r:2*r,p=l!==d?1:o-i[a]+1;t.setEdge(s,l,{weight:h,minlen:p,nestingEdge:!0}),t.setEdge(d,c,{weight:h,minlen:p,nestingEdge:!0})})),t.parent(a)||t.setEdge(e,s,{weight:0,minlen:o+i[a]})}else a!==e&&t.setEdge(e,a,{weight:0,minlen:n})}function ec(t,e,n,r,o,i){var a={width:0,height:0,rank:i,borderType:e},u=o[e][i-1],s=As.addDummyNode(t,"border",a,n);o[e][i]=s,t.setParent(s,r),u&&t.setEdge(u,s,{weight:1})}function nc(t){vs.forEach(t.nodes(),(function(e){rc(t.node(e))})),vs.forEach(t.edges(),(function(e){rc(t.edge(e))}))}function rc(t){var e=t.width;t.width=t.height,t.height=e}function oc(t){t.y=-t.y}function ic(t){var e=t.x;t.x=t.y,t.y=e}var ac=function(t,e){for(var n=0,r=1;r<e.length;++r)n+=uc(t,e[r-1],e[r]);return n};function uc(t,e,n){for(var r=vs.zipObject(n,vs.map(n,(function(t,e){return e}))),o=vs.flatten(vs.map(e,(function(e){return vs.sortBy(vs.map(t.outEdges(e),(function(e){return{pos:r[e.w],weight:t.edge(e).weight}})),"pos")})),!0),i=1;i<n.length;)i<<=1;var a=2*i-1;i-=1;var u=vs.map(new Array(a),(function(){return 0})),s=0;return vs.forEach(o.forEach((function(t){var e=t.pos+i;u[e]+=t.weight;for(var n=0;e>0;)e%2&&(n+=u[e+1]),u[e=e-1>>1]+=t.weight;s+=t.weight*n}))),s}function sc(t,e,n){for(var r;e.length&&(r=vs.last(e)).i<=n;)e.pop(),t.push(r.vs),n++;return n}var cc=function t(e,n,r,o){var i=e.children(n),a=e.node(n),u=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,c={};u&&(i=vs.filter(i,(function(t){return t!==u&&t!==s})));var f=function(t,e){return vs.map(e,(function(e){var n=t.inEdges(e);if(n.length){var r=vs.reduce(n,(function(e,n){var r=t.edge(n),o=t.node(n.v);return{sum:e.sum+r.weight*o.order,weight:e.weight+r.weight}}),{sum:0,weight:0});return{v:e,barycenter:r.sum/r.weight,weight:r.weight}}return{v:e}}))}(e,i);vs.forEach(f,(function(n){if(e.children(n.v).length){var i=t(e,n.v,r,o);c[n.v]=i,vs.has(i,"barycenter")&&(a=n,u=i,vs.isUndefined(a.barycenter)?(a.barycenter=u.barycenter,a.weight=u.weight):(a.barycenter=(a.barycenter*a.weight+u.barycenter*u.weight)/(a.weight+u.weight),a.weight+=u.weight))}var a,u}));var l=function(t,e){var n={};return vs.forEach(t,(function(t,e){var r=n[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};vs.isUndefined(t.barycenter)||(r.barycenter=t.barycenter,r.weight=t.weight)})),vs.forEach(e.edges(),(function(t){var e=n[t.v],r=n[t.w];vs.isUndefined(e)||vs.isUndefined(r)||(r.indegree++,e.out.push(n[t.w]))})),function(t){var e=[];function n(t){return function(e){e.merged||(vs.isUndefined(e.barycenter)||vs.isUndefined(t.barycenter)||e.barycenter>=t.barycenter)&&function(t,e){var n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}(t,e)}}function r(e){return function(n){n.in.push(e),0==--n.indegree&&t.push(n)}}for(;t.length;){var o=t.pop();e.push(o),vs.forEach(o.in.reverse(),n(o)),vs.forEach(o.out,r(o))}return vs.map(vs.filter(e,(function(t){return!t.merged})),(function(t){return vs.pick(t,["vs","i","barycenter","weight"])}))}(vs.filter(n,(function(t){return!t.indegree})))}(f,r);!function(t,e){vs.forEach(t,(function(t){t.vs=vs.flatten(t.vs.map((function(t){return e[t]?e[t].vs:t})),!0)}))}(l,c);var d=function(t,e){var n,r=As.partition(t,(function(t){return vs.has(t,"barycenter")})),o=r.lhs,i=vs.sortBy(r.rhs,(function(t){return-t.i})),a=[],u=0,s=0,c=0;o.sort((n=!!e,function(t,e){return t.barycenter<e.barycenter?-1:t.barycenter>e.barycenter?1:n?e.i-t.i:t.i-e.i})),c=sc(a,i,c),vs.forEach(o,(function(t){c+=t.vs.length,a.push(t.vs),u+=t.barycenter*t.weight,s+=t.weight,c=sc(a,i,c)}));var f={vs:vs.flatten(a,!0)};return s&&(f.barycenter=u/s,f.weight=s),f}(l,o);if(u&&(d.vs=vs.flatten([u,d.vs,s],!0),e.predecessors(u).length)){var h=e.node(e.predecessors(u)[0]),p=e.node(e.predecessors(s)[0]);vs.has(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+h.order+p.order)/(d.weight+2),d.weight+=2}return d},fc=Pu.Graph,lc=Pu.Graph;function dc(t,e,n){return vs.map(e,(function(e){return function(t,e,n){var r=function(t){for(var e;t.hasNode(e=vs.uniqueId("_root")););return e}(t),o=new fc({compound:!0}).setGraph({root:r}).setDefaultNodeLabel((function(e){return t.node(e)}));return vs.forEach(t.nodes(),(function(i){var a=t.node(i),u=t.parent(i);(a.rank===e||a.minRank<=e&&e<=a.maxRank)&&(o.setNode(i),o.setParent(i,u||r),vs.forEach(t[n](i),(function(e){var n=e.v===i?e.w:e.v,r=o.edge(n,i),a=vs.isUndefined(r)?0:r.weight;o.setEdge(n,i,{weight:t.edge(e).weight+a})})),vs.has(a,"minRank")&&o.setNode(i,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))})),o}(t,e,n)}))}function hc(t,e){var n=new lc;vs.forEach(t,(function(t){var r=t.graph().root,o=cc(t,r,n,e);vs.forEach(o.vs,(function(e,n){t.node(e).order=n})),function(t,e,n){var r,o={};vs.forEach(n,(function(n){for(var i,a,u=t.parent(n);u;){if((i=t.parent(u))?(a=o[i],o[i]=u):(a=r,r=u),a&&a!==u)return void e.setEdge(a,u);u=i}}))}(t,n,o.vs)}))}function pc(t,e){vs.forEach(e,(function(e){vs.forEach(e,(function(e,n){t.node(e).order=n}))}))}var vc=Pu.Graph;function gc(t,e,n){if(e>n){var r=e;e=n,n=r}var o=t[e];o||(t[e]=o={}),o[n]=!0}function mc(t,e,n){if(e>n){var r=e;e=n,n=r}return vs.has(t[e],n)}var yc=As.normalizeRanks,bc=As.removeEmptyRanks,wc=As,Ec=Pu.Graph,xc=["nodesep","edgesep","ranksep","marginx","marginy"],_c={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Sc=["acyclicer","ranker","rankdir","align"],Ac=["width","height"],Ic={width:0,height:0},Tc=["minlen","weight","width","height","labeloffset"],Oc={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Nc=["labelpos"];function Dc(t,e){return vs.mapValues(vs.pick(t,e),Number)}function Mc(t){var e={};return vs.forEach(t,(function(t,n){e[n.toLowerCase()]=t})),e}var kc=Pu.Graph,Rc={graphlib:Pu,layout:function(t,e){var n=e&&e.debugTiming?wc.time:wc.notime;n("layout",(function(){var e=n(" buildLayoutGraph",(function(){return function(t){var e=new Ec({multigraph:!0,compound:!0}),n=Mc(t.graph());return e.setGraph(vs.merge({},_c,Dc(n,xc),vs.pick(n,Sc))),vs.forEach(t.nodes(),(function(n){var r=Mc(t.node(n));e.setNode(n,vs.defaults(Dc(r,Ac),Ic)),e.setParent(n,t.parent(n))})),vs.forEach(t.edges(),(function(n){var r=Mc(t.edge(n));e.setEdge(n,vs.merge({},Oc,Dc(r,Tc),vs.pick(r,Nc)))})),e}(t)}));n(" runLayout",(function(){!function(t,e){e(" makeSpaceForEdgeLabels",(function(){!function(t){var e=t.graph();e.ranksep/=2,vs.forEach(t.edges(),(function(n){var r=t.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(t)})),e(" removeSelfEdges",(function(){!function(t){vs.forEach(t.edges(),(function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}}))}(t)})),e(" acyclic",(function(){!function(t){var e="greedy"===t.graph().acyclicer?function(t,e){if(t.nodeCount()<=1)return[];var n=function(t,e){var n=new ws,r=0,o=0;vs.forEach(t.nodes(),(function(t){n.setNode(t,{v:t,in:0,out:0})})),vs.forEach(t.edges(),(function(t){var i=n.edge(t.v,t.w)||0,a=e(t),u=i+a;n.setEdge(t.v,t.w,u),o=Math.max(o,n.node(t.v).out+=a),r=Math.max(r,n.node(t.w).in+=a)}));var i=vs.range(o+r+3).map((function(){return new gs})),a=r+1;return vs.forEach(n.nodes(),(function(t){_s(i,a,n.node(t))})),{graph:n,buckets:i,zeroIdx:a}}(t,e||Es),r=function(t,e,n){for(var r,o=[],i=e[e.length-1],a=e[0];t.nodeCount();){for(;r=a.dequeue();)xs(t,e,n,r);for(;r=i.dequeue();)xs(t,e,n,r);if(t.nodeCount())for(var u=e.length-2;u>0;--u)if(r=e[u].dequeue()){o=o.concat(xs(t,e,n,r,!0));break}}return o}(n.graph,n.buckets,n.zeroIdx);return vs.flatten(vs.map(r,(function(e){return t.outEdges(e.v,e.w)})),!0)}(t,function(t){return function(e){return t.edge(e).weight}}(t)):function(t){var e=[],n={},r={};return vs.forEach(t.nodes(),(function o(i){vs.has(r,i)||(r[i]=!0,n[i]=!0,vs.forEach(t.outEdges(i),(function(t){vs.has(n,t.w)?e.push(t):o(t.w)})),delete n[i])})),e}(t);vs.forEach(e,(function(e){var n=t.edge(e);t.removeEdge(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,vs.uniqueId("rev"))}))}(t)})),e(" nestingGraph.run",(function(){Js(t)})),e(" rank",(function(){!function(t){switch(t.graph().ranker){case"network-simplex":default:!function(t){Us(t)}(t);break;case"tight-tree":!function(t){$s(t),ks(t)}(t);break;case"longest-path":Qs(t)}}(wc.asNonCompoundGraph(t))})),e(" injectEdgeLabelProxies",(function(){!function(t){vs.forEach(t.edges(),(function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),o={rank:(t.node(e.w).rank-r.rank)/2+r.rank,e};wc.addDummyNode(t,"edge-proxy",o,"_ep")}}))}(t)})),e(" removeEmptyRanks",(function(){bc(t)})),e(" nestingGraph.cleanup",(function(){!function(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,vs.forEach(t.edges(),(function(e){t.edge(e).nestingEdge&&t.removeEdge(e)}))}(t)})),e(" normalizeRanks",(function(){yc(t)})),e(" assignRankMinMax",(function(){!function(t){var e=0;vs.forEach(t.nodes(),(function(n){var r=t.node(n);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,e=vs.max(e,r.maxRank))})),t.graph().maxRank=e}(t)})),e(" removeEdgeLabelProxies",(function(){!function(t){vs.forEach(t.nodes(),(function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))}))}(t)})),e(" normalize.run",(function(){!function(t){t.graph().dummyChains=[],vs.forEach(t.edges(),(function(e){!function(t,e){var n,r,o,i=e.v,a=t.node(i).rank,u=e.w,s=t.node(u).rank,c=e.name,f=t.edge(e),l=f.labelRank;if(s!==a+1){for(t.removeEdge(e),o=0,++a;a<s;++o,++a)f.points=[],r={width:0,height:0,edgeLabel:f,edgeObj:e,rank:a},n=As.addDummyNode(t,"edge",r,"_d"),a===l&&(r.width=f.width,r.height=f.height,r.dummy="edge-label",r.labelpos=f.labelpos),t.setEdge(i,n,{weight:f.weight},c),0===o&&t.graph().dummyChains.push(n),i=n;t.setEdge(i,u,{weight:f.weight},c)}}(t,e)}))}(t)})),e(" parentDummyChains",(function(){!function(t){var e=function(t){var e={},n=0;return vs.forEach(t.children(),(function r(o){var i=n;vs.forEach(t.children(o),r),e[o]={low:i,lim:n++}})),e}(t);vs.forEach(t.graph().dummyChains,(function(n){for(var r=t.node(n),o=r.edgeObj,i=function(t,e,n,r){var o,i,a=[],u=[],s=Math.min(e[n].low,e[r].low),c=Math.max(e[n].lim,e[r].lim);o=n;do{o=t.parent(o),a.push(o)}while(o&&(e[o].low>s||c>e[o].lim));for(i=o,o=r;(o=t.parent(o))!==i;)u.push(o);return{path:a.concat(u.reverse()),lca:i}}(t,e,o.v,o.w),a=i.path,u=i.lca,s=0,c=a[s],f=!0;n!==o.w;){if(r=t.node(n),f){for(;(c=a[s])!==u&&t.node(c).maxRank<r.rank;)s++;c===u&&(f=!1)}if(!f){for(;s<a.length-1&&t.node(c=a[s+1]).minRank<=r.rank;)s++;c=a[s]}t.setParent(n,c),n=t.successors(n)[0]}}))}(t)})),e(" addBorderSegments",(function(){!function(t){vs.forEach(t.children(),(function e(n){var r=t.children(n),o=t.node(n);if(r.length&&vs.forEach(r,e),vs.has(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,a=o.maxRank+1;i<a;++i)ec(t,"borderLeft","_bl",n,o,i),ec(t,"borderRight","_br",n,o,i)}}))}(t)})),e(" order",(function(){!function(t){var e=As.maxRank(t),n=dc(t,vs.range(1,e+1),"inEdges"),r=dc(t,vs.range(e-1,-1,-1),"outEdges"),o=function(t){var e={},n=vs.filter(t.nodes(),(function(e){return!t.children(e).length})),r=vs.max(vs.map(n,(function(e){return t.node(e).rank}))),o=vs.map(vs.range(r+1),(function(){return[]})),i=vs.sortBy(n,(function(e){return t.node(e).rank}));return vs.forEach(i,(function n(r){if(!vs.has(e,r)){e[r]=!0;var i=t.node(r);o[i.rank].push(r),vs.forEach(t.successors(r),n)}})),o}(t);pc(t,o);for(var i,a=Number.POSITIVE_INFINITY,u=0,s=0;s<4;++u,++s){hc(u%2?n:r,u%4>=2),o=As.buildLayerMatrix(t);var c=ac(t,o);c<a&&(s=0,i=vs.cloneDeep(o),a=c)}pc(t,i)}(t)})),e(" insertSelfEdges",(function(){!function(t){var e=wc.buildLayerMatrix(t);vs.forEach(e,(function(e){var n=0;vs.forEach(e,(function(e,r){var o=t.node(e);o.order=r+n,vs.forEach(o.selfEdges,(function(e){wc.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:r+ ++n,e:e.e,label:e.label},"_se")})),delete o.selfEdges}))}))}(t)})),e(" adjustCoordinateSystem",(function(){!function(t){var e=t.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||nc(t)}(t)})),e(" position",(function(){!function(t){(function(t){var e=As.buildLayerMatrix(t),n=t.graph().ranksep,r=0;vs.forEach(e,(function(e){var o=vs.max(vs.map(e,(function(e){return t.node(e).height})));vs.forEach(e,(function(e){t.node(e).y=r+o/2})),r+=o+n}))})(t=As.asNonCompoundGraph(t)),vs.forEach(function(t){var e,n=As.buildLayerMatrix(t),r=vs.merge(function(t,e){var n={};return vs.reduce(e,(function(e,r){var o=0,i=0,a=e.length,u=vs.last(r);return vs.forEach(r,(function(e,s){var c=function(t,e){if(t.node(e).dummy)return vs.find(t.predecessors(e),(function(e){return t.node(e).dummy}))}(t,e),f=c?t.node(c).order:a;(c||e===u)&&(vs.forEach(r.slice(i,s+1),(function(e){vs.forEach(t.predecessors(e),(function(r){var i=t.node(r),a=i.order;!(a<o||f<a)||i.dummy&&t.node(e).dummy||gc(n,r,e)}))})),i=s+1,o=f)})),r})),n}(t,n),function(t,e){var n={};function r(e,r,o,i,a){var u;vs.forEach(vs.range(r,o),(function(r){u=e[r],t.node(u).dummy&&vs.forEach(t.predecessors(u),(function(e){var r=t.node(e);r.dummy&&(r.order<i||r.order>a)&&gc(n,e,u)}))}))}return vs.reduce(e,(function(e,n){var o,i=-1,a=0;return vs.forEach(n,(function(u,s){if("border"===t.node(u).dummy){var c=t.predecessors(u);c.length&&(o=t.node(c[0]).order,r(n,a,s,i,o),a=s,i=o)}r(n,a,n.length,o,e.length)})),n})),n}(t,n)),o={};vs.forEach(["u","d"],(function(i){e="u"===i?n:vs.values(n).reverse(),vs.forEach(["l","r"],(function(n){"r"===n&&(e=vs.map(e,(function(t){return vs.values(t).reverse()})));var a=("u"===i?t.predecessors:t.successors).bind(t),u=function(t,e,n,r){var o={},i={},a={};return vs.forEach(e,(function(t){vs.forEach(t,(function(t,e){o[t]=t,i[t]=t,a[t]=e}))})),vs.forEach(e,(function(t){var e=-1;vs.forEach(t,(function(t){var u=r(t);if(u.length)for(var s=((u=vs.sortBy(u,(function(t){return a[t]}))).length-1)/2,c=Math.floor(s),f=Math.ceil(s);c<=f;++c){var l=u[c];i[t]===t&&e<a[l]&&!mc(n,t,l)&&(i[l]=t,i[t]=o[t]=o[l],e=a[l])}}))})),{root:o,align:i}}(0,e,r,a),s=function(t,e,n,r,o){var i={},a=function(t,e,n,r){var o=new vc,i=t.graph(),a=function(t,e,n){return function(r,o,i){var a,u=r.node(o),s=r.node(i),c=0;if(c+=u.width/2,vs.has(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":a=-u.width/2;break;case"r":a=u.width/2}if(a&&(c+=n?a:-a),a=0,c+=(u.dummy?e:t)/2,c+=(s.dummy?e:t)/2,c+=s.width/2,vs.has(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":a=s.width/2;break;case"r":a=-s.width/2}return a&&(c+=n?a:-a),a=0,c}}(i.nodesep,i.edgesep,r);return vs.forEach(e,(function(e){var r;vs.forEach(e,(function(e){var i=n[e];if(o.setNode(i),r){var u=n[r],s=o.edge(u,i);o.setEdge(u,i,Math.max(a(t,e,r),s||0))}r=e}))})),o}(t,e,n,o),u=o?"borderLeft":"borderRight";function s(t,e){for(var n=a.nodes(),r=n.pop(),o={};r;)o[r]?t(r):(o[r]=!0,n.push(r),n=n.concat(e(r))),r=n.pop()}return s((function(t){i[t]=a.inEdges(t).reduce((function(t,e){return Math.max(t,i[e.v]+a.edge(e))}),0)}),a.predecessors.bind(a)),s((function(e){var n=a.outEdges(e).reduce((function(t,e){return Math.min(t,i[e.w]-a.edge(e))}),Number.POSITIVE_INFINITY),r=t.node(e);n!==Number.POSITIVE_INFINITY&&r.borderType!==u&&(i[e]=Math.max(i[e],n))}),a.successors.bind(a)),vs.forEach(r,(function(t){i[t]=i[n[t]]})),i}(t,e,u.root,u.align,"r"===n);"r"===n&&(s=vs.mapValues(s,(function(t){return-t}))),o[i+n]=s}))}));var i=function(t,e){return vs.minBy(vs.values(e),(function(e){var n=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY;return vs.forIn(e,(function(e,o){var i=function(t,e){return t.node(e).width}(t,o)/2;n=Math.max(e+i,n),r=Math.min(e-i,r)})),n-r}))}(t,o);return function(t,e){var n=vs.values(e),r=vs.min(n),o=vs.max(n);vs.forEach(["u","d"],(function(n){vs.forEach(["l","r"],(function(i){var a,u=n+i,s=t[u];if(s!==e){var c=vs.values(s);(a="l"===i?r-vs.min(c):o-vs.max(c))&&(t[u]=vs.mapValues(s,(function(t){return t+a})))}}))}))}(o,i),function(t,e){return vs.mapValues(t.ul,(function(n,r){if(e)return t[e.toLowerCase()][r];var o=vs.sortBy(vs.map(t,r));return(o[1]+o[2])/2}))}(o,t.graph().align)}(t),(function(e,n){t.node(n).x=e}))}(t)})),e(" positionSelfEdges",(function(){!function(t){vs.forEach(t.nodes(),(function(e){var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),o=r.x+r.width/2,i=r.y,a=n.x-o,u=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:o+2*a/3,y:i-u},{x:o+5*a/6,y:i-u},{x:o+a,y:i},{x:o+5*a/6,y:i+u},{x:o+2*a/3,y:i+u}],n.label.x=n.x,n.label.y=n.y}}))}(t)})),e(" removeBorderNodes",(function(){!function(t){vs.forEach(t.nodes(),(function(e){if(t.children(e).length){var n=t.node(e),r=t.node(n.borderTop),o=t.node(n.borderBottom),i=t.node(vs.last(n.borderLeft)),a=t.node(vs.last(n.borderRight));n.width=Math.abs(a.x-i.x),n.height=Math.abs(o.y-r.y),n.x=i.x+n.width/2,n.y=r.y+n.height/2}})),vs.forEach(t.nodes(),(function(e){"border"===t.node(e).dummy&&t.removeNode(e)}))}(t)})),e(" normalize.undo",(function(){!function(t){vs.forEach(t.graph().dummyChains,(function(e){var n,r=t.node(e),o=r.edgeLabel;for(t.setEdge(r.edgeObj,o);r.dummy;)n=t.successors(e)[0],t.removeNode(e),o.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(o.x=r.x,o.y=r.y,o.width=r.width,o.height=r.height),e=n,r=t.node(e)}))}(t)})),e(" fixupEdgeLabelCoords",(function(){!function(t){vs.forEach(t.edges(),(function(e){var n=t.edge(e);if(vs.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(t)})),e(" undoCoordinateSystem",(function(){!function(t){var e=t.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(t){vs.forEach(t.nodes(),(function(e){oc(t.node(e))})),vs.forEach(t.edges(),(function(e){var n=t.edge(e);vs.forEach(n.points,oc),vs.has(n,"y")&&oc(n)}))}(t),"lr"!==e&&"rl"!==e||(function(t){vs.forEach(t.nodes(),(function(e){ic(t.node(e))})),vs.forEach(t.edges(),(function(e){var n=t.edge(e);vs.forEach(n.points,ic),vs.has(n,"x")&&ic(n)}))}(t),nc(t))}(t)})),e(" translateGraph",(function(){!function(t){var e=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,o=0,i=t.graph(),a=i.marginx||0,u=i.marginy||0;function s(t){var i=t.x,a=t.y,u=t.width,s=t.height;e=Math.min(e,i-u/2),n=Math.max(n,i+u/2),r=Math.min(r,a-s/2),o=Math.max(o,a+s/2)}vs.forEach(t.nodes(),(function(e){s(t.node(e))})),vs.forEach(t.edges(),(function(e){var n=t.edge(e);vs.has(n,"x")&&s(n)})),e-=a,r-=u,vs.forEach(t.nodes(),(function(n){var o=t.node(n);o.x-=e,o.y-=r})),vs.forEach(t.edges(),(function(n){var o=t.edge(n);vs.forEach(o.points,(function(t){t.x-=e,t.y-=r})),vs.has(o,"x")&&(o.x-=e),vs.has(o,"y")&&(o.y-=r)})),i.width=n-e+a,i.height=o-r+u}(t)})),e(" assignNodeIntersects",(function(){!function(t){vs.forEach(t.edges(),(function(e){var n,r,o=t.edge(e),i=t.node(e.v),a=t.node(e.w);o.points?(n=o.points[0],r=o.points[o.points.length-1]):(o.points=[],n=a,r=i),o.points.unshift(wc.intersectRect(i,n)),o.points.push(wc.intersectRect(a,r))}))}(t)})),e(" reversePoints",(function(){!function(t){vs.forEach(t.edges(),(function(e){var n=t.edge(e);n.reversed&&n.points.reverse()}))}(t)})),e(" acyclic.undo",(function(){!function(t){vs.forEach(t.edges(),(function(e){var n=t.edge(e);if(n.reversed){t.removeEdge(e);var r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}}))}(t)}))}(e,n)})),n(" updateInputGraph",(function(){!function(t,e){vs.forEach(t.nodes(),(function(n){var r=t.node(n),o=e.node(n);r&&(r.x=o.x,r.y=o.y,e.children(n).length&&(r.width=o.width,r.height=o.height))})),vs.forEach(t.edges(),(function(n){var r=t.edge(n),o=e.edge(n);r.points=o.points,vs.has(o,"x")&&(r.x=o.x,r.y=o.y)})),t.graph().width=e.graph().width,t.graph().height=e.graph().height}(t,e)}))}))},debug:{debugOrdering:function(t){var e=As.buildLayerMatrix(t),n=new kc({compound:!0,multigraph:!0}).setGraph({});return vs.forEach(t.nodes(),(function(e){n.setNode(e,{label:e}),n.setParent(e,"layer"+t.node(e).rank)})),vs.forEach(t.edges(),(function(t){n.setEdge(t.v,t.w,{},t.name)})),vs.forEach(e,(function(t,e){var r="layer"+e;n.setNode(r,{rank:"same"}),vs.reduce(t,(function(t,e){return n.setEdge(t,e,{style:"invis"}),e}))})),n}},util:{time:As.time,notime:As.notime},version:"0.8.5"},Cc=Rc.graphlib,Lc=Rc.layout;class Pc{constructor(t){this.cardinality=1,this.include=wr.UNSPECIFIED,this.isGroupNode=!1,this.parentNode=null,this.type=br.NODE,this.name=t.name,this.attr=t.attr||{},this.inputs=t.inputs,this.path=t.path||[],this.width=t.width,this.height=t.height}}class jc{constructor(){this.nodes={},this.edges=[],this.nodes={},this.edges=[]}}class zc{constructor(t,e={}){this.attr=null,this.bridgeGraph=null,this.cardinality=0,this.depth=1,this.include=wr.UNSPECIFIED,this.isGroupNode=!0,this.parentNode=null,this.type=br.META,this.path=[],this.name=t,this.metaGraph=Bc(t,Er.META,e)}getFirstChild(){return this.metaGraph.node(this.metaGraph.nodes()[0])}getChildren(){return this.metaGraph.nodes().map((t=>this.metaGraph.node(t)))}leaves(){let t,e=[],n=[this];for(;n.length;){let r=n.shift();r.isGroupNode?(t=r.metaGraph,t.nodes().forEach((e=>n.push(t.node(e))))):e.push(r.name)}return e}}class Fc{constructor(t,e){this.v=t,this.w=e,this.baseEdgeList=[],this.inbound=null,this.name=null}addBaseEdge(t,e){this.baseEdgeList.push(t)}}function Gc(t,e={}){return new zc(t,e)}function Uc(t,e){return new Fc(t,e)}function Bc(t,e,n){const r=n||{},o=new Cc.Graph(r);return o.setGraph({name:t,rankdir:r.rankdir,type:e,align:r.align}),o}class Vc{constructor(t={}){this.graphOptions=t,this.index={},this.graphOptions.compound=!0,this.root=Gc(mr,this.graphOptions),this.index[mr]=this.root}getNodeMap(){return this.index}node(t){return this.index[t]}setNode(t,e){this.index[t]=e}getBridgeGraph(t){const e=this.index[t];if(!e)throw Error("Could not find node in hierarchy: "+t);if(!("metaGraph"in e))return null;const n=e;if(n.bridgeGraph)return n.bridgeGraph;const r=Bc(yr,Er.BRIDGE,this.graphOptions);if(n.bridgeGraph=r,!e.parentNode||!("metaGraph"in e.parentNode))return r;const o=e.parentNode;return[o.metaGraph,this.getBridgeGraph(o.name)].forEach((e=>{e.edges().filter((e=>e.v===t||e.w===t)).forEach((n=>{const o=n.w===t;e.edge(n).baseEdgeList.forEach((e=>{const[i,a]=o?[e.w,n.v]:[e.v,n.w],u=this.getChildName(t,i),s={v:o?a:u,w:o?u:a};let c=r.edge(s);c||(c=Uc(s.v,s.w),c.inbound=o,r.setEdge(s.v,s.w,c)),c.addBaseEdge(e,this)}))}))})),r}getChildName(t,e){let n=this.index[e];for(;n;){if(n.parentNode&&n.parentNode.name===t)return n.name;n=n.parentNode}throw Error("Could not find immediate child for descendant: "+e)}getPredecessors(t){const e=this.index[t];if(!e)throw Error("Could not find node with name: "+t);return this.getOneWayEdges(e,!0)}getSuccessors(t){const e=this.index[t];if(!e)throw Error("Could not find node with name: "+t);return this.getOneWayEdges(e,!1)}getOneWayEdges(t,e){const n=[];if(!t.parentNode||!t.parentNode.isGroupNode)return n;const r=t.parentNode,o=r.metaGraph,i=this.getBridgeGraph(r.name);return Wc(o,t,e,n),Wc(i,t,e,n),n}}function Wc(t,e,n,r){(n?t.inEdges(e.name):t.outEdges(e.name)).forEach((e=>{const n=t.edge(e);r.push(n)}))}class Xc{constructor(t){this.hierarchy=t,this.index={},this.hasSubHierarchy={},this.root=new Yc(this.hierarchy.root,this.hierarchy.graphOptions),this.index[t.root.name]=this.root,this.buildSubHierarchy(t.root.name),this.root.expanded=!0}getRenderInfoNodes(){return Object.values(this.index)}getSubHierarchy(){return this.hasSubHierarchy}buildSubHierarchy(t){if(t in this.hasSubHierarchy)return;this.hasSubHierarchy[t]=!0;const e=this.index[t];if(e.node.type!==br.META)return;const n=e,r=n.node.metaGraph,o=n.coreGraph;r.nodes().forEach((t=>{const e=this.getOrCreateRenderNodeByName(t);o.setNode(t,e)})),r.edges().forEach((t=>{const e=r.edge(t),n=new qc(e);o.setEdge(t.v,t.w,n)}));const i=n.node.parentNode;if(!i)return;const a=this.getRenderNodeByName(i.name),u=(t,...e)=>e.concat([t?"IN":"OUT"]).join("~~"),s=this.hierarchy.getBridgeGraph(t);s.edges().forEach((e=>{const n=s.edge(e),c=!!r.node(e.w),[f,l]=c?[e.w,e.v]:[e.v,e.w],d=e=>{const n=c?{v:e,w:t}:{v:t,w:e};return a.coreGraph.edge(n)};let h=d(l);h||(h=d(u(c,l,i.name)));const p=u(c,t),v=u(c,l,t);let g=o.node(v);if(!g){let t=o.node(p);if(!t){const e={name:p,type:br.BRIDGE,isGroupNode:!1,cardinality:0,parentNode:null,include:wr.UNSPECIFIED,inbound:c,attr:{}};t=new Hc(e),this.index[p]=t,o.setNode(p,t)}const e={name:v,type:br.BRIDGE,isGroupNode:!1,cardinality:1,parentNode:null,include:wr.UNSPECIFIED,inbound:c,attr:{}};g=new Hc(e),this.index[v]=g,o.setNode(v,g),o.setParent(v,p),t.node.cardinality++}const m=new qc(n);m.adjoiningMetaEdge=h,c?o.setEdge(v,f,m):o.setEdge(f,v,m)}))}getOrCreateRenderNodeByName(t){if(!t)return null;if(t in this.index)return this.index[t];const e=this.getNodeByName(t);return e?(this.index[t]=e.isGroupNode?new Yc(e,this.hierarchy.graphOptions):new Hc(e),this.index[t]):null}getRenderNodeByName(t){return this.index[t]}getNodeByName(t){return this.hierarchy.node(t)}}class Hc{constructor(t){this.node=t,this.expanded=!1,this.x=0,this.y=0,this.coreBox={width:0,height:0},this.outboxWidth=0,this.labelOffset=0,this.radius=0,this.labelHeight=0,this.paddingTop=0,this.paddingLeft=0,this.paddingRight=0,this.paddingBottom=0,this.width=t.width||0,this.height=t.height||0,this.displayName=t.name,this.attr=t.attr}}class qc{constructor(t){this.metaEdge=t,this.adjoiningMetaEdge=null,this.weight=1,this.points=[]}}class Yc extends Hc{constructor(t,e){super(t);const n=t.metaGraph.graph();e.compound=!0,this.coreGraph=Bc(n.name,Er.CORE,e)}}function Kc(t,e){t.node.isGroupNode&&function(t,e){const n=vr(e);t.coreGraph.nodes().map((e=>t.coreGraph.node(e))).forEach((t=>{var r,o,i,a,u,s;const{height:c,width:f}=t;switch(t.node.type){case br.NODE:Object.assign(t,n.nodeSize.node),t.height=c||n.nodeSize.node.height,t.width=f||n.nodeSize.node.width;break;case br.BRIDGE:Object.assign(t,n.nodeSize.bridge);break;case br.META:t.expanded?Kc(t,e):(Object.assign(t,n.nodeSize.meta),t.height=n.nodeSize.meta.height,t.width=n.nodeSize.meta.width);break;default:throw Error("Unrecognized node type: "+t.node.type)}if(!t.expanded){const n=t.attr;!function(t,e=!1){if(t.coreBox.width=t.width,t.coreBox.height=t.height,!e){const e=`${t.displayName}`.length,n=3;t.width=Math.max(t.coreBox.width,e*n)}}(t,e&&(0===t.node.type&&!!(null===(o=null===(r=null==e?void 0:e.nodeSize)||void 0===r?void 0:r.meta)||void 0===o?void 0:o.width)||1===t.node.type&&(!!(null===(a=null===(i=null==e?void 0:e.nodeSize)||void 0===i?void 0:i.node)||void 0===a?void 0:a.width)||!!n.width)||2===t.node.type&&!!(null===(s=null===(u=null==e?void 0:e.nodeSize)||void 0===u?void 0:u.bridge)||void 0===s?void 0:s.width)))}}))}(t,e),t.node.type===br.META&&function(t,e){const n=vr(e),r=n.subScene.meta;Object.assign(t,r);const{nodeSep:o,rankSep:i,edgeSep:a,align:u}=n.graph.meta,s={nodesep:o,ranksep:i,edgesep:a,align:u};Object.assign(t.coreBox,function(t,e){const{ranksep:n,nodesep:r,edgesep:o,align:i}=e;Object.assign(t.graph(),{ranksep:n,nodesep:r,edgesep:o,align:i});const a=[];if(t.nodes().forEach((e=>{t.node(e).node.type!==br.BRIDGE&&a.push(e)})),!a.length)return{width:0,height:0};Lc(t);let u=1/0,s=1/0,c=-1/0,f=-1/0;return a.forEach((e=>{const n=t.node(e),r=.5*n.width,o=n.x-r,i=n.x+r;u=o<u?o:u,c=i>c?i:c;const a=.5*n.height,l=n.y-a,d=n.y+a;s=l<s?l:s,f=d>f?d:f})),t.edges().forEach((e=>{const n=t.edge(e),r=t.node(n.metaEdge.v),o=t.node(n.metaEdge.w);if(3===n.points.length&&function(t){let e=Zc(t[0],t[1]);for(let n=1;n<t.length-1;n++){const r=Zc(t[n],t[n+1]);if(Math.abs(r-e)>1)return!1;e=r}return!0}(n.points)){if(null!=r){const t=r.expanded?r.x:$c(r);n.points[0].x=t}if(null!=o){const t=o.expanded?o.x:$c(o);n.points[2].x=t}n.points=[n.points[0],n.points[1]]}const i=n.points[n.points.length-2];null!=o&&(n.points[n.points.length-1]=Qc(i,o));const a=n.points[1];null!=r&&(n.points[0]=Qc(a,r)),n.points.forEach((t=>{u=t.x<u?t.x:u,c=t.x>c?t.x:c,s=t.y<s?t.y:s,f=t.y>f?t.y:f}))})),t.nodes().forEach((e=>{const n=t.node(e);n.x-=u,n.y-=s})),t.edges().forEach((e=>{t.edge(e).points.forEach((t=>{t.x-=u,t.y-=s}))})),{width:c-u,height:f-s}}(t.coreGraph,s));let c=0;t.coreGraph.nodeCount()>0&&c++;const f=c<=1?0:c;t.coreBox.width+=f+f,t.coreBox.height=r.labelHeight+t.coreBox.height,t.width=t.coreBox.width+r.paddingLeft+r.paddingRight,t.height=t.paddingTop+t.coreBox.height+t.paddingBottom}(t,e)}function Zc(t,e){const n=e.x-t.x,r=e.y-t.y;return 180*Math.atan(r/n)/Math.PI}function $c(t){return t.expanded?t.x:t.x-t.width/2+0+t.coreBox.width/2}function Qc(t,e){const n=e.expanded?e.x:$c(e),r=e.y,o=t.x-n,i=t.y-r;let a,u,s=e.expanded?e.width:e.coreBox.width,c=e.expanded?e.height:e.coreBox.height;return Math.abs(i)*s/2>Math.abs(o)*c/2?(i<0&&(c=-c),a=0===i?0:c/2*o/i,u=c/2):(o<0&&(s=-s),a=s/2,u=0===o?0:s/2*i/o),{x:n+a,y:r+u}}function Jc(t,e,n){var r,o,i,a;const u=t.nodes.filter(((t,e,n)=>n.findIndex((e=>e.id===t.id))!==e)).map((t=>t.id));if(u.length)throw new Error(`Duplicated ids found: ${u.join(", ")}`);const s=function(t){const e={nodes:[]},n=t.compound,r=Object.keys(n||{}),o=new Map,i=(t,e=[])=>{if(o.has(t))return o.get(t);for(let o=0;o<r.length;o++){let a=r[o];if(n&&-1!==n[a].indexOf(t))return e.unshift(a),i(a,e)}return 0===e.length&&o.set(t,e),e},a=e=>t.edges.filter((t=>t.w===e)).map((t=>({name:t.v})));return t.nodes.forEach((t=>{const n=t.id,r=[...i(n),n];let o=a(n);e.nodes.push({name:n,path:r,inputs:o,width:t.width,height:t.height,attr:Object.assign({},t)})})),e}(t),c=function(t,e){const n=(t,e)=>{for(let n of e.values())if(n.includes(t))return!0;return!1},r=(t,e=[])=>{if(0===Object.keys(t).length)return[...new Set(e)];const o=new Map(Object.keys(t).map((e=>[e,t[e]]))),i={};for(let[t,r]of o)n(t,o)?i[t]=r:e=e.concat(t,r);return r(i,e)};return r(t).filter((t=>e.includes(t)))}(t.compound||{},(null==e?void 0:e.expanded)||[]),f=function(t,e){return function(t){return new Xc(t)}(function(t,e){const{rankDirection:n,align:r}=e,o=new Vc({rankdir:n,align:r});return function(t,e){Object.keys(e.nodes).forEach((n=>{const r=e.nodes[n],o=r.path;let i=t.root;i.depth=Math.max(o.length,i.depth);for(let e=0;e<o.length&&(i.depth=Math.max(i.depth,o.length-e),i.cardinality+=r.cardinality,e!==o.length-1);e++){const n=o[e];let a=t.node(n);a||(a=Gc(n,t.graphOptions),a.path=r.path.slice(0,e+1),a.parentNode=i,t.setNode(n,a),i.metaGraph.setNode(n,a)),i=a}t.setNode(r.name,r),r.parentNode=i,i.metaGraph.setNode(r.name,r)}))}(o,t),function(t,e){const n=t.getNodeMap();let r=[],o=[];const i=(t,e)=>{let n=0;for(;t;)e[n++]=t.name,t=t.parentNode;return n-1};e.edges.forEach((a=>{r=[],o=[];let u=i(e.nodes[a.v],r),s=i(e.nodes[a.w],o);for(;r[u]===o[s];)if(u--,s--,u<0||s<0)throw Error("No difference found between ancestor paths.");const c=n[r[u+1]],f=r[u],l=o[s];let d=c.metaGraph.edge(f,l);d||(d=Uc(f,l),c.metaGraph.setEdge(f,l,d)),d.addBaseEdge(a,t)}))}(o,t),o}(function(t){const e=new jc;return t.nodes.map((t=>new Pc(t))).forEach((t=>{e.nodes[t.name]=t,t.inputs.forEach((n=>{!function(t,e,n){n.name!==e.name&&t.edges.push(Object.assign(Object.assign({},n.attr),{v:n.name,w:e.name}))}(e,t,n)}))})),e}(t),e))}(s,{rankDirection:(null===(o=null===(r=null==n?void 0:n.graph)||void 0===r?void 0:r.meta)||void 0===o?void 0:o.rankDir)||(null==e?void 0:e.rankDirection)||pr.graph.meta.rankDir,align:(null===(a=null===(i=null==n?void 0:n.graph)||void 0===i?void 0:i.meta)||void 0===a?void 0:a.align)||pr.graph.meta.align});return function(t,e){e.forEach((e=>{const n=t.getRenderInfoNodes().find((t=>t.displayName===e));let r=n&&n.node&&n.node.name||"";const o=t.getRenderNodeByName(r);if(!o)throw new Error(`No nodes found: ${r}`);o.expanded=!0,t.buildSubHierarchy(r)}))}(f,c),Kc(f.root,n),ef(f.root)}function tf(t,e,n,r){var o,i;let a=[];const u=(null===(o=n.find((e=>e.id===t)))||void 0===o?void 0:o.path)||[],s=(null===(i=n.find((t=>t.id===e)))||void 0===i?void 0:i.path)||[],c=[mr,...u].slice(0,u.length).reverse(),f=[mr,...s].slice(0,s.length);return c.forEach((o=>{const i=n.find((t=>t.id===o));a=a.concat(i.edges.filter((n=>n.baseEdgeList.some((n=>n.v===((null==r?void 0:r.v)||t)&&n.w===((null==r?void 0:r.w)||e))))))})),f.filter((t=>!c.includes(t))).forEach((o=>{const i=n.find((t=>t.id===o));a=a.concat(i.edges.filter((n=>n.baseEdgeList.some((n=>n.v===((null==r?void 0:r.v)||t)&&n.w===((null==r?void 0:r.w)||e))))))})),a}function ef(t){const e=t.coreGraph.nodes().map((e=>t.coreGraph.node(e)));return Object.assign(Object.assign({},nf(t)),{expanded:t.expanded,nodes:t.expanded?(n=e,n.map((t=>t.node.type===br.META?ef(t):nf(t)))):[],edges:t.expanded?rf(t):[]});var n}function nf(t){return{id:t.node.name,name:t.node.name,type:t.node.type,cardinality:t.node.cardinality,attr:t.attr,parentNodeName:t.node.parentNode?t.node.parentNode.name:null,coreBox:Object.assign({},t.coreBox),x:t.x,y:t.y,width:t.width,height:t.height,radius:t.radius,labelHeight:t.labelHeight,labelOffset:t.labelOffset,outboxWidth:t.outboxWidth,paddingLeft:t.paddingLeft,paddingTop:t.paddingTop,paddingRight:t.paddingRight,paddingBottom:t.paddingBottom,path:t.node.path}}function rf(t){return t.coreGraph.edges().map((e=>({renderInfoEdge:t.coreGraph.edge(e),edge:e}))).filter((({renderInfoEdge:t})=>t.metaEdge)).map((({edge:e,renderInfoEdge:n})=>{const r=function(t,e){const n=e.points.map((t=>Object.assign({},t)));if(e.adjoiningMetaEdge){const r=e.adjoiningMetaEdge.points,o=e.metaEdge.inbound,i=o?r[r.length-1]:r[0],a=n[o?0:n.length-1],u=t.x-t.width/2,s=t.y-t.height/2,c=i.x-u,f=i.y-s,l=-t.paddingLeft,d=-(t.paddingTop+t.labelHeight);a.x=c+l,a.y=f+d}return n}(t,n);return{adjoiningEdge:n.adjoiningMetaEdge?{w:n.adjoiningMetaEdge.metaEdge.w,v:n.adjoiningMetaEdge.metaEdge.v}:null,inbound:n.metaEdge.inbound,w:e.w,v:e.v,points:r,weight:n.weight,baseEdgeList:n.metaEdge.baseEdgeList,parentNodeName:t.node.name}}))}var of=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),af=function(){return af=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},af.apply(this,arguments)},uf=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},sf=function(t){function e(e){var n=t.call(this)||this;return n.rankdir="TB",n.nodesep=50,n.edgesep=5,n.ranksep=50,n.controlPoints=!0,n.anchorPoint=!0,n.nodes=[],n.edges=[],n.combos=[],n.onLayoutEnd=function(){},n.updateCfg(e),n}return of(e,t),e.prototype.getDefaultCfg=function(){return{rankdir:"TB",align:void 0,begin:void 0,nodeSize:void 0,nodesep:50,ranksep:50,controlPoints:!0,anchorPoint:!0}},e.prototype.init=function(t){var e=t.hiddenNodes||[],n=t.hiddenEdges||[],r=t.hiddenCombos||[];this.nodes=this.getDataByOrder((t.nodes||[]).concat(e)),this.edges=this.getDataByOrder((t.edges||[]).concat(n)),this.combos=(t.combos||[]).concat(r.map((function(t){return af(af({},t),{collapsed:!0})})))},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.edges;if(e){var r=t.getLayoutConfig(),o=function(t,e=!1){const n=JSON.parse(JSON.stringify(t)),r={nodes:[n],edges:[...n.edges]};return n.nodes.forEach((function t(e){(0===e.type||1===e.type)&&r.nodes.push(e),0===e.type&&(r.edges=r.edges.concat(e.edges)),Array.isArray(e.nodes)&&e.nodes.forEach(t)})),e&&r.nodes.forEach((t=>{const e=r.nodes.find((e=>e.id===t.parentNodeName));if(e){const n=e.x-e.width/2+e.paddingLeft,r=e.y-e.height/2+e.labelHeight+e.paddingTop;e.id!==mr&&(t.x+=n,t.y+=r),0===t.type&&t.edges.forEach((e=>{e.points.forEach((e=>{e.x+=t.x-t.width/2+t.paddingLeft,e.y+=t.y-t.height/2+t.labelHeight+t.paddingTop}))}))}})),r}(Jc(r.graphDef,r.graphOption,r.graphSettings),!0);return this.updatePosition(o),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:n}}},e.prototype.getNodePath=function(t){var e=this.nodes,n=this.combos,r=e.find((function(e){return e.id===t}));return r&&r.comboId?function t(e,r){void 0===r&&(r=[]);var o=n.find((function(t){return t.id===e}));return o?(r.unshift(e),o.parentId?t(o.parentId,r):r):r}(r.comboId,[t]):[t]},e.prototype.getLayoutConfig=function(){var t,e,n,r,i=this,a=i.nodes,u=i.edges,s=i.combos,c=i.nodeSize,l=i.rankdir,d=i.align,h=i.edgesep,p=i.nodesep,v=i.ranksep,g=i.settings,m=(s||[]).reduce((function(t,e){var n=a.filter((function(t){return t.comboId===e.id})).map((function(t){return t.id})),r=(s||[]).filter((function(t){return t.parentId===e.id})).map((function(t){return t.id}));return(n.length||r.length)&&(t[e.id]=uf(uf([],n,!0),r,!0)),t}),{});r=c?o(c)?function(){return c}:function(){return[c,c]}:function(t){return t&&t.size?o(t.size)?t.size:f(t.size)?[t.size.width||40,t.size.height||40]:[t.size,t.size]:[40,40]};var y=function(t){return t&&t.size?o(t.size)?t.size:[t.size,t.size]:[80,40]}(null==s?void 0:s[0]),b=y[0],w=y[1],E=null===(e=null===(t=i.graphSettings)||void 0===t?void 0:t.subScene)||void 0===e?void 0:e.meta,x=(null===(n=s.find((function(t){return!t.collapsed})))||void 0===n?void 0:n.padding)||[20,20,20,20],_=x[0],S=x[1],A=x[2],I=x[3],T={compound:m,nodes:uf([],(a||[]).map((function(t){var e=r(t),n=e[0],o=e[1];return af(af({},t),{width:n,height:o})})),!0),edges:uf([],(u||[]).map((function(t){return af(af({},t),{v:t.source,w:t.target})})),!0)},O={expanded:(s||[]).filter((function(t){return!t.collapsed})).map((function(t){return t.id}))},N={graph:{meta:{align:d,rankDir:l,nodeSep:p,edgeSep:h,rankSep:v}},subScene:{meta:{paddingTop:_||(null==E?void 0:E.paddingTop)||20,paddingRight:S||(null==E?void 0:E.paddingRight)||20,paddingBottom:A||(null==E?void 0:E.paddingBottom)||20,paddingLeft:I||(null==E?void 0:E.paddingLeft)||20,labelHeight:0}},nodeSize:{meta:{width:b,height:w}}},D=vr(g,af({},vr(N,pr)));return i.graphSettings=D,{graphDef:T,graphOption:O,graphSettings:D}},e.prototype.updatePosition=function(t){var e=t.nodes,n=t.edges;this.updateNodePosition(e,n),this.updateEdgePosition(e,n)},e.prototype.getBegin=function(t,e){var n=this.begin,r=[0,0];if(n){var o=1/0,i=1/0;t.forEach((function(t){o>t.x&&(o=t.x),i>t.y&&(i=t.y)})),e.forEach((function(t){t.points.forEach((function(t){o>t.x&&(o=t.x),i>t.y&&(i=t.y)}))})),r[0]=n[0]-o,r[1]=n[1]-i}return r},e.prototype.updateNodePosition=function(t,e){var n=this,r=n.combos,o=n.nodes,i=n.edges,a=n.anchorPoint,u=n.graphSettings,s=this.getBegin(t,e);t.forEach((function(t){var n,c=t.x,f=t.y,l=t.id,d=t.type,h=t.coreBox;if(d===xr.META&&l!==mr){var p=r.findIndex((function(t){return t.id===l})),v=null===(n=null==u?void 0:u.subScene)||void 0===n?void 0:n.meta;r[p].offsetX=c+s[0],r[p].offsetY=f+s[1],r[p].fixSize=[h.width,h.height],r[p].fixCollapseSize=[h.width,h.height],t.expanded?r[p].padding=[null==v?void 0:v.paddingTop,null==v?void 0:v.paddingRight,null==v?void 0:v.paddingBottom,null==v?void 0:v.paddingLeft]:r[p].padding=[0,0,0,0]}else if(d===xr.OP&&(p=o.findIndex((function(t){return t.id===l})),o[p].x=c+s[0],o[p].y=f+s[1],a)){var g=[],m=e.filter((function(t){return t.v===l})),y=e.filter((function(t){return t.w===l}));m.length>0&&m.forEach((function(e){var n=e.points[0],r=(n.x-c)/t.width+.5,o=(n.y-f)/t.height+.5;g.push([r,o]),e.baseEdgeList.forEach((function(t){var e=i.find((function(e){return e.source===t.v&&e.target===t.w}));e&&(e.sourceAnchor=g.length-1)}))})),y.length>0&&y.forEach((function(e){var n=e.points[e.points.length-1],r=(n.x-c)/t.width+.5,o=(n.y-f)/t.height+.5;g.push([r,o]),e.baseEdgeList.forEach((function(t){var e=i.find((function(e){return e.source===t.v&&e.target===t.w}));e&&(e.targetAnchor=g.length-1)}))})),o[p].anchorPoints=g.length>0?g:o[p].anchorPoints||[]}}))},e.prototype.updateEdgePosition=function(t,e){var n=this,r=n.combos,o=n.edges,i=n.controlPoints,a=this.getBegin(t,e);i&&(r.forEach((function(t){t.inEdges=[],t.outEdges=[]})),o.forEach((function(e){var o,i,u,s,c=t.find((function(t){return t.id===e.source})),f=t.find((function(t){return t.id===e.target})),l=[],d=[];if(c&&f)d=tf(null==c?void 0:c.id,null==f?void 0:f.id,t);else if(!c||!f){var h=n.getNodePath(e.source),p=n.getNodePath(e.target),v=h.reverse().slice(c?0:1).find((function(e){return t.find((function(t){return t.id===e}))})),g=p.reverse().slice(f?0:1).find((function(e){return t.find((function(t){return t.id===e}))}));c=t.find((function(t){return t.id===v})),f=t.find((function(t){return t.id===g})),d=tf(null==c?void 0:c.id,null==f?void 0:f.id,t,{v:e.source,w:e.target})}if(l=(l=d.reduce((function(t,e){return uf(uf([],t,!0),e.points.map((function(t){return af(af({},t),{x:t.x+a[0],y:t.y+a[1]})})),!0)}),[])).slice(1,-1),e.controlPoints=l,(null==f?void 0:f.type)===br.META){var m=r.findIndex((function(t){return t.id===(null==f?void 0:f.id)}));if(!r[m]||(null===(o=r[m].inEdges)||void 0===o?void 0:o.some((function(t){return t.source===c.id&&t.target===f.id}))))return;null===(i=r[m].inEdges)||void 0===i||i.push({source:c.id,target:f.id,controlPoints:l})}if((null==c?void 0:c.type)===br.META){if(m=r.findIndex((function(t){return t.id===(null==c?void 0:c.id)})),!r[m]||(null===(u=r[m].outEdges)||void 0===u?void 0:u.some((function(t){return t.source===c.id&&t.target===f.id}))))return;null===(s=r[m].outEdges)||void 0===s||s.push({source:c.id,target:f.id,controlPoints:l})}})))},e.prototype.getType=function(){return"dagreCompound"},e.prototype.getDataByOrder=function(t){return t.every((function(t){return void 0!==t.layoutOrder}))||t.forEach((function(t,e){t.layoutOrder=e})),t.sort((function(t,e){return t.layoutOrder-e.layoutOrder}))},e}(t);const cf=Object.prototype.toString;function ff(t){const e=cf.call(t);return e.endsWith("Array]")&&!e.includes("Big")}function lf(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!ff(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");if(void 0!==n.output){if(!ff(n.output))throw new TypeError("output option must be an array if specified");e=n.output}else e=new Array(t.length);var r=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!ff(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var n=e.fromIndex,r=void 0===n?0:n,o=e.toIndex,i=void 0===o?t.length:o;if(r<0||r>=t.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(i<=r||i>t.length||!Number.isInteger(i))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var a=t[r],u=r+1;u<i;u++)t[u]<a&&(a=t[u]);return a}(t),o=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!ff(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var n=e.fromIndex,r=void 0===n?0:n,o=e.toIndex,i=void 0===o?t.length:o;if(r<0||r>=t.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(i<=r||i>t.length||!Number.isInteger(i))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var a=t[r],u=r+1;u<i;u++)t[u]>a&&(a=t[u]);return a}(t);if(r===o)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var i=n.min,a=void 0===i?n.autoMinMax?r:0:i,u=n.max,s=void 0===u?n.autoMinMax?o:1:u;if(a>=s)throw new RangeError("min option must be smaller than max option");for(var c=(s-a)/(o-r),f=0;f<t.length;f++)e[f]=(t[f]-r)*c+a;return e}const df=" ".repeat(2),hf=" ".repeat(4);function pf(t,e={}){const{maxRows:n=15,maxColumns:r=10,maxNumSize:o=8,padMinus:i="auto"}=e;return`${t.constructor.name} {\n${df}[\n${hf}${function(t,e,n,r,o){const{rows:i,columns:a}=t,u=Math.min(i,e),s=Math.min(a,n),c=[];if("auto"===o){o=!1;t:for(let e=0;e<u;e++)for(let n=0;n<s;n++)if(t.get(e,n)<0){o=!0;break t}}for(let e=0;e<u;e++){let n=[];for(let i=0;i<s;i++)n.push(vf(t.get(e,i),r,o));c.push(`${n.join(" ")}`)}return s!==a&&(c[c.length-1]+=` ... ${a-n} more columns`),u!==i&&c.push(`... ${i-e} more rows`),c.join(`\n${hf}`)}(t,n,r,o,i)}\n${df}]\n${df}rows: ${t.rows}\n${df}columns: ${t.columns}\n}`}function vf(t,e,n){return(t>=0&&n?` ${gf(t,e-1)}`:gf(t,e)).padEnd(e)}function gf(t,e){let n=t.toString();if(n.length<=e)return n;let r=t.toFixed(e);if(r.length>e&&(r=t.toFixed(Math.max(0,e-(r.length-e)))),r.length<=e&&!r.startsWith("0.000")&&!r.startsWith("-0.000"))return r;let o=t.toExponential(e);return o.length>e&&(o=t.toExponential(Math.max(0,e-(o.length-e)))),o.slice(0)}function mf(t,e,n){let r=n?t.rows:t.rows-1;if(e<0||e>r)throw new RangeError("Row index out of range")}function yf(t,e,n){let r=n?t.columns:t.columns-1;if(e<0||e>r)throw new RangeError("Column index out of range")}function bf(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.columns)throw new RangeError("vector size must be the same as the number of columns");return e}function wf(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.rows)throw new RangeError("vector size must be the same as the number of rows");return e}function Ef(t,e,n,r,o){if(5!==arguments.length)throw new RangeError("expected 4 arguments");if(_f("startRow",e),_f("endRow",n),_f("startColumn",r),_f("endColumn",o),e>n||r>o||e<0||e>=t.rows||n<0||n>=t.rows||r<0||r>=t.columns||o<0||o>=t.columns)throw new RangeError("Submatrix indices are out of range")}function xf(t,e=0){let n=[];for(let r=0;r<t;r++)n.push(e);return n}function _f(t,e){if("number"!=typeof e)throw new TypeError(`${t} must be a number`)}function Sf(t){if(t.isEmpty())throw new Error("Empty matrix has no elements to index")}class Af{static from1DArray(t,e,n){if(t*e!==n.length)throw new RangeError("data length does not match given dimensions");let r=new Tf(t,e);for(let o=0;o<t;o++)for(let t=0;t<e;t++)r.set(o,t,n[o*e+t]);return r}static rowVector(t){let e=new Tf(1,t.length);for(let n=0;n<t.length;n++)e.set(0,n,t[n]);return e}static columnVector(t){let e=new Tf(t.length,1);for(let n=0;n<t.length;n++)e.set(n,0,t[n]);return e}static zeros(t,e){return new Tf(t,e)}static ones(t,e){return new Tf(t,e).fill(1)}static rand(t,e,n={}){if("object"!=typeof n)throw new TypeError("options must be an object");const{random:r=Math.random}=n;let o=new Tf(t,e);for(let n=0;n<t;n++)for(let t=0;t<e;t++)o.set(n,t,r());return o}static randInt(t,e,n={}){if("object"!=typeof n)throw new TypeError("options must be an object");const{min:r=0,max:o=1e3,random:i=Math.random}=n;if(!Number.isInteger(r))throw new TypeError("min must be an integer");if(!Number.isInteger(o))throw new TypeError("max must be an integer");if(r>=o)throw new RangeError("min must be smaller than max");let a=o-r,u=new Tf(t,e);for(let n=0;n<t;n++)for(let t=0;t<e;t++){let e=r+Math.round(i()*a);u.set(n,t,e)}return u}static eye(t,e,n){void 0===e&&(e=t),void 0===n&&(n=1);let r=Math.min(t,e),o=this.zeros(t,e);for(let t=0;t<r;t++)o.set(t,t,n);return o}static diag(t,e,n){let r=t.length;void 0===e&&(e=r),void 0===n&&(n=e);let o=Math.min(r,e,n),i=this.zeros(e,n);for(let e=0;e<o;e++)i.set(e,e,t[e]);return i}static min(t,e){t=this.checkMatrix(t),e=this.checkMatrix(e);let n=t.rows,r=t.columns,o=new Tf(n,r);for(let i=0;i<n;i++)for(let n=0;n<r;n++)o.set(i,n,Math.min(t.get(i,n),e.get(i,n)));return o}static max(t,e){t=this.checkMatrix(t),e=this.checkMatrix(e);let n=t.rows,r=t.columns,o=new this(n,r);for(let i=0;i<n;i++)for(let n=0;n<r;n++)o.set(i,n,Math.max(t.get(i,n),e.get(i,n)));return o}static checkMatrix(t){return Af.isMatrix(t)?t:new Tf(t)}static isMatrix(t){return null!=t&&"Matrix"===t.klass}get size(){return this.rows*this.columns}apply(t){if("function"!=typeof t)throw new TypeError("callback must be a function");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)t.call(this,e,n);return this}to1DArray(){let t=[];for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)t.push(this.get(e,n));return t}to2DArray(){let t=[];for(let e=0;e<this.rows;e++){t.push([]);for(let n=0;n<this.columns;n++)t[e].push(this.get(e,n))}return t}toJSON(){return this.to2DArray()}isRowVector(){return 1===this.rows}isColumnVector(){return 1===this.columns}isVector(){return 1===this.rows||1===this.columns}isSquare(){return this.rows===this.columns}isEmpty(){return 0===this.rows||0===this.columns}isSymmetric(){if(this.isSquare()){for(let t=0;t<this.rows;t++)for(let e=0;e<=t;e++)if(this.get(t,e)!==this.get(e,t))return!1;return!0}return!1}isEchelonForm(){let t=0,e=0,n=-1,r=!0,o=!1;for(;t<this.rows&&r;){for(e=0,o=!1;e<this.columns&&!1===o;)0===this.get(t,e)?e++:1===this.get(t,e)&&e>n?(o=!0,n=e):(r=!1,o=!0);t++}return r}isReducedEchelonForm(){let t=0,e=0,n=-1,r=!0,o=!1;for(;t<this.rows&&r;){for(e=0,o=!1;e<this.columns&&!1===o;)0===this.get(t,e)?e++:1===this.get(t,e)&&e>n?(o=!0,n=e):(r=!1,o=!0);for(let n=e+1;n<this.rows;n++)0!==this.get(t,n)&&(r=!1);t++}return r}echelonForm(){let t=this.clone(),e=0,n=0;for(;e<t.rows&&n<t.columns;){let r=e;for(let o=e;o<t.rows;o++)t.get(o,n)>t.get(r,n)&&(r=o);if(0===t.get(r,n))n++;else{t.swapRows(e,r);let o=t.get(e,n);for(let r=n;r<t.columns;r++)t.set(e,r,t.get(e,r)/o);for(let r=e+1;r<t.rows;r++){let o=t.get(r,n)/t.get(e,n);t.set(r,n,0);for(let i=n+1;i<t.columns;i++)t.set(r,i,t.get(r,i)-t.get(e,i)*o)}e++,n++}}return t}reducedEchelonForm(){let t=this.echelonForm(),e=t.columns,n=t.rows,r=n-1;for(;r>=0;)if(0===t.maxRow(r))r--;else{let o=0,i=!1;for(;o<n&&!1===i;)1===t.get(r,o)?i=!0:o++;for(let n=0;n<r;n++){let i=t.get(n,o);for(let a=o;a<e;a++){let e=t.get(n,a)-i*t.get(r,a);t.set(n,a,e)}}r--}return t}set(){throw new Error("set method is unimplemented")}get(){throw new Error("get method is unimplemented")}repeat(t={}){if("object"!=typeof t)throw new TypeError("options must be an object");const{rows:e=1,columns:n=1}=t;if(!Number.isInteger(e)||e<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(n)||n<=0)throw new TypeError("columns must be a positive integer");let r=new Tf(this.rows*e,this.columns*n);for(let t=0;t<e;t++)for(let e=0;e<n;e++)r.setSubMatrix(this,this.rows*t,this.columns*e);return r}fill(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,t);return this}neg(){return this.mulS(-1)}getRow(t){mf(this,t);let e=[];for(let n=0;n<this.columns;n++)e.push(this.get(t,n));return e}getRowVector(t){return Tf.rowVector(this.getRow(t))}setRow(t,e){mf(this,t),e=bf(this,e);for(let n=0;n<this.columns;n++)this.set(t,n,e[n]);return this}swapRows(t,e){mf(this,t),mf(this,e);for(let n=0;n<this.columns;n++){let r=this.get(t,n);this.set(t,n,this.get(e,n)),this.set(e,n,r)}return this}getColumn(t){yf(this,t);let e=[];for(let n=0;n<this.rows;n++)e.push(this.get(n,t));return e}getColumnVector(t){return Tf.columnVector(this.getColumn(t))}setColumn(t,e){yf(this,t),e=wf(this,e);for(let n=0;n<this.rows;n++)this.set(n,t,e[n]);return this}swapColumns(t,e){yf(this,t),yf(this,e);for(let n=0;n<this.rows;n++){let r=this.get(n,t);this.set(n,t,this.get(n,e)),this.set(n,e,r)}return this}addRowVector(t){t=bf(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t[n]);return this}subRowVector(t){t=bf(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t[n]);return this}mulRowVector(t){t=bf(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t[n]);return this}divRowVector(t){t=bf(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t[n]);return this}addColumnVector(t){t=wf(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t[e]);return this}subColumnVector(t){t=wf(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t[e]);return this}mulColumnVector(t){t=wf(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t[e]);return this}divColumnVector(t){t=wf(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t[e]);return this}mulRow(t,e){mf(this,t);for(let n=0;n<this.columns;n++)this.set(t,n,this.get(t,n)*e);return this}mulColumn(t,e){yf(this,t);for(let n=0;n<this.rows;n++)this.set(n,t,this.get(n,t)*e);return this}max(t){if(this.isEmpty())return NaN;switch(t){case"row":{const t=new Array(this.rows).fill(Number.NEGATIVE_INFINITY);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.get(e,n)>t[e]&&(t[e]=this.get(e,n));return t}case"column":{const t=new Array(this.columns).fill(Number.NEGATIVE_INFINITY);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.get(e,n)>t[n]&&(t[n]=this.get(e,n));return t}case void 0:{let t=this.get(0,0);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.get(e,n)>t&&(t=this.get(e,n));return t}default:throw new Error(`invalid option: ${t}`)}}maxIndex(){Sf(this);let t=this.get(0,0),e=[0,0];for(let n=0;n<this.rows;n++)for(let r=0;r<this.columns;r++)this.get(n,r)>t&&(t=this.get(n,r),e[0]=n,e[1]=r);return e}min(t){if(this.isEmpty())return NaN;switch(t){case"row":{const t=new Array(this.rows).fill(Number.POSITIVE_INFINITY);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.get(e,n)<t[e]&&(t[e]=this.get(e,n));return t}case"column":{const t=new Array(this.columns).fill(Number.POSITIVE_INFINITY);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.get(e,n)<t[n]&&(t[n]=this.get(e,n));return t}case void 0:{let t=this.get(0,0);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.get(e,n)<t&&(t=this.get(e,n));return t}default:throw new Error(`invalid option: ${t}`)}}minIndex(){Sf(this);let t=this.get(0,0),e=[0,0];for(let n=0;n<this.rows;n++)for(let r=0;r<this.columns;r++)this.get(n,r)<t&&(t=this.get(n,r),e[0]=n,e[1]=r);return e}maxRow(t){if(mf(this,t),this.isEmpty())return NaN;let e=this.get(t,0);for(let n=1;n<this.columns;n++)this.get(t,n)>e&&(e=this.get(t,n));return e}maxRowIndex(t){mf(this,t),Sf(this);let e=this.get(t,0),n=[t,0];for(let r=1;r<this.columns;r++)this.get(t,r)>e&&(e=this.get(t,r),n[1]=r);return n}minRow(t){if(mf(this,t),this.isEmpty())return NaN;let e=this.get(t,0);for(let n=1;n<this.columns;n++)this.get(t,n)<e&&(e=this.get(t,n));return e}minRowIndex(t){mf(this,t),Sf(this);let e=this.get(t,0),n=[t,0];for(let r=1;r<this.columns;r++)this.get(t,r)<e&&(e=this.get(t,r),n[1]=r);return n}maxColumn(t){if(yf(this,t),this.isEmpty())return NaN;let e=this.get(0,t);for(let n=1;n<this.rows;n++)this.get(n,t)>e&&(e=this.get(n,t));return e}maxColumnIndex(t){yf(this,t),Sf(this);let e=this.get(0,t),n=[0,t];for(let r=1;r<this.rows;r++)this.get(r,t)>e&&(e=this.get(r,t),n[0]=r);return n}minColumn(t){if(yf(this,t),this.isEmpty())return NaN;let e=this.get(0,t);for(let n=1;n<this.rows;n++)this.get(n,t)<e&&(e=this.get(n,t));return e}minColumnIndex(t){yf(this,t),Sf(this);let e=this.get(0,t),n=[0,t];for(let r=1;r<this.rows;r++)this.get(r,t)<e&&(e=this.get(r,t),n[0]=r);return n}diag(){let t=Math.min(this.rows,this.columns),e=[];for(let n=0;n<t;n++)e.push(this.get(n,n));return e}norm(t="frobenius"){let e=0;if("max"===t)return this.max();if("frobenius"===t){for(let t=0;t<this.rows;t++)for(let n=0;n<this.columns;n++)e+=this.get(t,n)*this.get(t,n);return Math.sqrt(e)}throw new RangeError(`unknown norm type: ${t}`)}cumulativeSum(){let t=0;for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)t+=this.get(e,n),this.set(e,n,t);return this}dot(t){Af.isMatrix(t)&&(t=t.to1DArray());let e=this.to1DArray();if(e.length!==t.length)throw new RangeError("vectors do not have the same size");let n=0;for(let r=0;r<e.length;r++)n+=e[r]*t[r];return n}mmul(t){t=Tf.checkMatrix(t);let e=this.rows,n=this.columns,r=t.columns,o=new Tf(e,r),i=new Float64Array(n);for(let a=0;a<r;a++){for(let e=0;e<n;e++)i[e]=t.get(e,a);for(let t=0;t<e;t++){let e=0;for(let r=0;r<n;r++)e+=this.get(t,r)*i[r];o.set(t,a,e)}}return o}strassen2x2(t){t=Tf.checkMatrix(t);let e=new Tf(2,2);const n=this.get(0,0),r=t.get(0,0),o=this.get(0,1),i=t.get(0,1),a=this.get(1,0),u=t.get(1,0),s=this.get(1,1),c=t.get(1,1),f=(n+s)*(r+c),l=(a+s)*r,d=n*(i-c),h=s*(u-r),p=(n+o)*c,v=f+h-p+(o-s)*(u+c),g=d+p,m=l+h,y=f-l+d+(a-n)*(r+i);return e.set(0,0,v),e.set(0,1,g),e.set(1,0,m),e.set(1,1,y),e}strassen3x3(t){t=Tf.checkMatrix(t);let e=new Tf(3,3);const n=this.get(0,0),r=this.get(0,1),o=this.get(0,2),i=this.get(1,0),a=this.get(1,1),u=this.get(1,2),s=this.get(2,0),c=this.get(2,1),f=this.get(2,2),l=t.get(0,0),d=t.get(0,1),h=t.get(0,2),p=t.get(1,0),v=t.get(1,1),g=t.get(1,2),m=t.get(2,0),y=t.get(2,1),b=t.get(2,2),w=(n-i)*(-d+v),E=(-n+i+a)*(l-d+v),x=(i+a)*(-l+d),_=n*l,S=(-n+s+c)*(l-h+g),A=(-n+s)*(h-g),I=(s+c)*(-l+h),T=(-o+c+f)*(v+m-y),O=(o-f)*(v-y),N=o*m,D=(c+f)*(-m+y),M=(-o+a+u)*(g+m-b),k=(o-u)*(g-b),R=(a+u)*(-m+b),C=_+N+r*p,L=(n+r+o-i-a-c-f)*v+E+x+_+T+N+D,P=_+S+I+(n+r+o-a-u-s-c)*g+N+M+R,j=w+a*(-l+d+p-v-g-m+b)+E+_+N+M+k,z=w+E+x+_+u*y,F=N+M+k+R+i*h,G=_+S+A+c*(-l+h+p-v-g-m+y)+T+O+N,U=T+O+N+D+s*d,B=_+S+A+I+f*b;return e.set(0,0,C),e.set(0,1,L),e.set(0,2,P),e.set(1,0,j),e.set(1,1,z),e.set(1,2,F),e.set(2,0,G),e.set(2,1,U),e.set(2,2,B),e}mmulStrassen(t){t=Tf.checkMatrix(t);let e=this.clone(),n=e.rows,r=e.columns,o=t.rows,i=t.columns;function a(t,e,n){let r=t.rows,o=t.columns;if(r===e&&o===n)return t;{let r=Af.zeros(e,n);return r=r.setSubMatrix(t,0,0),r}}r!==o&&console.warn(`Multiplying ${n} x ${r} and ${o} x ${i} matrix: dimensions do not match.`);let u=Math.max(n,o),s=Math.max(r,i);return e=a(e,u,s),function t(e,n,r,o){if(r<=512||o<=512)return e.mmul(n);r%2==1&&o%2==1?(e=a(e,r+1,o+1),n=a(n,r+1,o+1)):r%2==1?(e=a(e,r+1,o),n=a(n,r+1,o)):o%2==1&&(e=a(e,r,o+1),n=a(n,r,o+1));let i=parseInt(e.rows/2,10),u=parseInt(e.columns/2,10),s=e.subMatrix(0,i-1,0,u-1),c=n.subMatrix(0,i-1,0,u-1),f=e.subMatrix(0,i-1,u,e.columns-1),l=n.subMatrix(0,i-1,u,n.columns-1),d=e.subMatrix(i,e.rows-1,0,u-1),h=n.subMatrix(i,n.rows-1,0,u-1),p=e.subMatrix(i,e.rows-1,u,e.columns-1),v=n.subMatrix(i,n.rows-1,u,n.columns-1),g=t(Af.add(s,p),Af.add(c,v),i,u),m=t(Af.add(d,p),c,i,u),y=t(s,Af.sub(l,v),i,u),b=t(p,Af.sub(h,c),i,u),w=t(Af.add(s,f),v,i,u),E=t(Af.sub(d,s),Af.add(c,l),i,u),x=t(Af.sub(f,p),Af.add(h,v),i,u),_=Af.add(g,b);_.sub(w),_.add(x);let S=Af.add(y,w),A=Af.add(m,b),I=Af.sub(g,m);I.add(y),I.add(E);let T=Af.zeros(2*_.rows,2*_.columns);return T=T.setSubMatrix(_,0,0),T=T.setSubMatrix(S,_.rows,0),T=T.setSubMatrix(A,0,_.columns),T=T.setSubMatrix(I,_.rows,_.columns),T.subMatrix(0,r-1,0,o-1)}(e,t=a(t,u,s),u,s)}scaleRows(t={}){if("object"!=typeof t)throw new TypeError("options must be an object");const{min:e=0,max:n=1}=t;if(!Number.isFinite(e))throw new TypeError("min must be a number");if(!Number.isFinite(n))throw new TypeError("max must be a number");if(e>=n)throw new RangeError("min must be smaller than max");let r=new Tf(this.rows,this.columns);for(let t=0;t<this.rows;t++){const o=this.getRow(t);o.length>0&&lf(o,{min:e,max:n,output:o}),r.setRow(t,o)}return r}scaleColumns(t={}){if("object"!=typeof t)throw new TypeError("options must be an object");const{min:e=0,max:n=1}=t;if(!Number.isFinite(e))throw new TypeError("min must be a number");if(!Number.isFinite(n))throw new TypeError("max must be a number");if(e>=n)throw new RangeError("min must be smaller than max");let r=new Tf(this.rows,this.columns);for(let t=0;t<this.columns;t++){const o=this.getColumn(t);o.length&&lf(o,{min:e,max:n,output:o}),r.setColumn(t,o)}return r}flipRows(){const t=Math.ceil(this.columns/2);for(let e=0;e<this.rows;e++)for(let n=0;n<t;n++){let t=this.get(e,n),r=this.get(e,this.columns-1-n);this.set(e,n,r),this.set(e,this.columns-1-n,t)}return this}flipColumns(){const t=Math.ceil(this.rows/2);for(let e=0;e<this.columns;e++)for(let n=0;n<t;n++){let t=this.get(n,e),r=this.get(this.rows-1-n,e);this.set(n,e,r),this.set(this.rows-1-n,e,t)}return this}kroneckerProduct(t){t=Tf.checkMatrix(t);let e=this.rows,n=this.columns,r=t.rows,o=t.columns,i=new Tf(e*r,n*o);for(let a=0;a<e;a++)for(let e=0;e<n;e++)for(let n=0;n<r;n++)for(let u=0;u<o;u++)i.set(r*a+n,o*e+u,this.get(a,e)*t.get(n,u));return i}kroneckerSum(t){if(t=Tf.checkMatrix(t),!this.isSquare()||!t.isSquare())throw new Error("Kronecker Sum needs two Square Matrices");let e=this.rows,n=t.rows,r=this.kroneckerProduct(Tf.eye(n,n)),o=Tf.eye(e,e).kroneckerProduct(t);return r.add(o)}transpose(){let t=new Tf(this.columns,this.rows);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)t.set(n,e,this.get(e,n));return t}sortRows(t=If){for(let e=0;e<this.rows;e++)this.setRow(e,this.getRow(e).sort(t));return this}sortColumns(t=If){for(let e=0;e<this.columns;e++)this.setColumn(e,this.getColumn(e).sort(t));return this}subMatrix(t,e,n,r){Ef(this,t,e,n,r);let o=new Tf(e-t+1,r-n+1);for(let i=t;i<=e;i++)for(let e=n;e<=r;e++)o.set(i-t,e-n,this.get(i,e));return o}subMatrixRow(t,e,n){if(void 0===e&&(e=0),void 0===n&&(n=this.columns-1),e>n||e<0||e>=this.columns||n<0||n>=this.columns)throw new RangeError("Argument out of range");let r=new Tf(t.length,n-e+1);for(let o=0;o<t.length;o++)for(let i=e;i<=n;i++){if(t[o]<0||t[o]>=this.rows)throw new RangeError(`Row index out of range: ${t[o]}`);r.set(o,i-e,this.get(t[o],i))}return r}subMatrixColumn(t,e,n){if(void 0===e&&(e=0),void 0===n&&(n=this.rows-1),e>n||e<0||e>=this.rows||n<0||n>=this.rows)throw new RangeError("Argument out of range");let r=new Tf(n-e+1,t.length);for(let o=0;o<t.length;o++)for(let i=e;i<=n;i++){if(t[o]<0||t[o]>=this.columns)throw new RangeError(`Column index out of range: ${t[o]}`);r.set(i-e,o,this.get(i,t[o]))}return r}setSubMatrix(t,e,n){if((t=Tf.checkMatrix(t)).isEmpty())return this;Ef(this,e,e+t.rows-1,n,n+t.columns-1);for(let r=0;r<t.rows;r++)for(let o=0;o<t.columns;o++)this.set(e+r,n+o,t.get(r,o));return this}selection(t,e){!function(t,e){if(!ff(e))throw new TypeError("row indices must be an array");for(let n=0;n<e.length;n++)if(e[n]<0||e[n]>=t.rows)throw new RangeError("row indices are out of range")}(this,t),function(t,e){if(!ff(e))throw new TypeError("column indices must be an array");for(let n=0;n<e.length;n++)if(e[n]<0||e[n]>=t.columns)throw new RangeError("column indices are out of range")}(this,e);let n=new Tf(t.length,e.length);for(let r=0;r<t.length;r++){let o=t[r];for(let t=0;t<e.length;t++){let i=e[t];n.set(r,t,this.get(o,i))}}return n}trace(){let t=Math.min(this.rows,this.columns),e=0;for(let n=0;n<t;n++)e+=this.get(n,n);return e}clone(){let t=new Tf(this.rows,this.columns);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)t.set(e,n,this.get(e,n));return t}sum(t){switch(t){case"row":return function(t){let e=xf(t.rows);for(let n=0;n<t.rows;++n)for(let r=0;r<t.columns;++r)e[n]+=t.get(n,r);return e}(this);case"column":return function(t){let e=xf(t.columns);for(let n=0;n<t.rows;++n)for(let r=0;r<t.columns;++r)e[r]+=t.get(n,r);return e}(this);case void 0:return function(t){let e=0;for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)e+=t.get(n,r);return e}(this);default:throw new Error(`invalid option: ${t}`)}}product(t){switch(t){case"row":return function(t){let e=xf(t.rows,1);for(let n=0;n<t.rows;++n)for(let r=0;r<t.columns;++r)e[n]*=t.get(n,r);return e}(this);case"column":return function(t){let e=xf(t.columns,1);for(let n=0;n<t.rows;++n)for(let r=0;r<t.columns;++r)e[r]*=t.get(n,r);return e}(this);case void 0:return function(t){let e=1;for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)e*=t.get(n,r);return e}(this);default:throw new Error(`invalid option: ${t}`)}}mean(t){const e=this.sum(t);switch(t){case"row":for(let t=0;t<this.rows;t++)e[t]/=this.columns;return e;case"column":for(let t=0;t<this.columns;t++)e[t]/=this.rows;return e;case void 0:return e/this.size;default:throw new Error(`invalid option: ${t}`)}}variance(t,e={}){if("object"==typeof t&&(e=t,t=void 0),"object"!=typeof e)throw new TypeError("options must be an object");const{unbiased:n=!0,mean:r=this.mean(t)}=e;if("boolean"!=typeof n)throw new TypeError("unbiased must be a boolean");switch(t){case"row":if(!ff(r))throw new TypeError("mean must be an array");return function(t,e,n){const r=t.rows,o=t.columns,i=[];for(let a=0;a<r;a++){let r=0,u=0,s=0;for(let e=0;e<o;e++)s=t.get(a,e)-n[a],r+=s,u+=s*s;e?i.push((u-r*r/o)/(o-1)):i.push((u-r*r/o)/o)}return i}(this,n,r);case"column":if(!ff(r))throw new TypeError("mean must be an array");return function(t,e,n){const r=t.rows,o=t.columns,i=[];for(let a=0;a<o;a++){let o=0,u=0,s=0;for(let e=0;e<r;e++)s=t.get(e,a)-n[a],o+=s,u+=s*s;e?i.push((u-o*o/r)/(r-1)):i.push((u-o*o/r)/r)}return i}(this,n,r);case void 0:if("number"!=typeof r)throw new TypeError("mean must be a number");return function(t,e,n){const r=t.rows,o=t.columns,i=r*o;let a=0,u=0,s=0;for(let e=0;e<r;e++)for(let r=0;r<o;r++)s=t.get(e,r)-n,a+=s,u+=s*s;return e?(u-a*a/i)/(i-1):(u-a*a/i)/i}(this,n,r);default:throw new Error(`invalid option: ${t}`)}}standardDeviation(t,e){"object"==typeof t&&(e=t,t=void 0);const n=this.variance(t,e);if(void 0===t)return Math.sqrt(n);for(let t=0;t<n.length;t++)n[t]=Math.sqrt(n[t]);return n}center(t,e={}){if("object"==typeof t&&(e=t,t=void 0),"object"!=typeof e)throw new TypeError("options must be an object");const{center:n=this.mean(t)}=e;switch(t){case"row":if(!ff(n))throw new TypeError("center must be an array");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)-e[n])}(this,n),this;case"column":if(!ff(n))throw new TypeError("center must be an array");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)-e[r])}(this,n),this;case void 0:if("number"!=typeof n)throw new TypeError("center must be a number");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)-e)}(this,n),this;default:throw new Error(`invalid option: ${t}`)}}scale(t,e={}){if("object"==typeof t&&(e=t,t=void 0),"object"!=typeof e)throw new TypeError("options must be an object");let n=e.scale;switch(t){case"row":if(void 0===n)n=function(t){const e=[];for(let n=0;n<t.rows;n++){let r=0;for(let e=0;e<t.columns;e++)r+=Math.pow(t.get(n,e),2)/(t.columns-1);e.push(Math.sqrt(r))}return e}(this);else if(!ff(n))throw new TypeError("scale must be an array");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)/e[n])}(this,n),this;case"column":if(void 0===n)n=function(t){const e=[];for(let n=0;n<t.columns;n++){let r=0;for(let e=0;e<t.rows;e++)r+=Math.pow(t.get(e,n),2)/(t.rows-1);e.push(Math.sqrt(r))}return e}(this);else if(!ff(n))throw new TypeError("scale must be an array");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)/e[r])}(this,n),this;case void 0:if(void 0===n)n=function(t){const e=t.size-1;let n=0;for(let r=0;r<t.columns;r++)for(let o=0;o<t.rows;o++)n+=Math.pow(t.get(o,r),2)/e;return Math.sqrt(n)}(this);else if("number"!=typeof n)throw new TypeError("scale must be a number");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)/e)}(this,n),this;default:throw new Error(`invalid option: ${t}`)}}toString(t){return pf(this,t)}}function If(t,e){return t-e}Af.prototype.klass="Matrix","undefined"!=typeof Symbol&&(Af.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return pf(this)}),Af.random=Af.rand,Af.randomInt=Af.randInt,Af.diagonal=Af.diag,Af.prototype.diagonal=Af.prototype.diag,Af.identity=Af.eye,Af.prototype.negate=Af.prototype.neg,Af.prototype.tensorProduct=Af.prototype.kroneckerProduct;class Tf extends Af{constructor(t,e){if(super(),Tf.isMatrix(t))return t.clone();if(Number.isInteger(t)&&t>=0){if(this.data=[],!(Number.isInteger(e)&&e>=0))throw new TypeError("nColumns must be a positive integer");for(let n=0;n<t;n++)this.data.push(new Float64Array(e))}else{if(!ff(t))throw new TypeError("First argument must be a positive number or an array");{const n=t;if("number"!=typeof(e=(t=n.length)?n[0].length:0))throw new TypeError("Data must be a 2D array with at least one element");this.data=[];for(let r=0;r<t;r++){if(n[r].length!==e)throw new RangeError("Inconsistent array dimensions");if(!n[r].every((t=>"number"==typeof t)))throw new TypeError("Input data contains non-numeric values");this.data.push(Float64Array.from(n[r]))}}}this.rows=t,this.columns=e}set(t,e,n){return this.data[t][e]=n,this}get(t,e){return this.data[t][e]}removeRow(t){return mf(this,t),this.data.splice(t,1),this.rows-=1,this}addRow(t,e){return void 0===e&&(e=t,t=this.rows),mf(this,t,!0),e=Float64Array.from(bf(this,e)),this.data.splice(t,0,e),this.rows+=1,this}removeColumn(t){yf(this,t);for(let e=0;e<this.rows;e++){const n=new Float64Array(this.columns-1);for(let r=0;r<t;r++)n[r]=this.data[e][r];for(let r=t+1;r<this.columns;r++)n[r-1]=this.data[e][r];this.data[e]=n}return this.columns-=1,this}addColumn(t,e){void 0===e&&(e=t,t=this.columns),yf(this,t,!0),e=wf(this,e);for(let n=0;n<this.rows;n++){const r=new Float64Array(this.columns+1);let o=0;for(;o<t;o++)r[o]=this.data[n][o];for(r[o++]=e[n];o<this.columns+1;o++)r[o]=this.data[n][o-1];this.data[n]=r}return this.columns+=1,this}}!function(t,e){t.prototype.add=function(t){return"number"==typeof t?this.addS(t):this.addM(t)},t.prototype.addS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t);return this},t.prototype.addM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t.get(e,n));return this},t.add=function(t,n){return new e(t).add(n)},t.prototype.sub=function(t){return"number"==typeof t?this.subS(t):this.subM(t)},t.prototype.subS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t);return this},t.prototype.subM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t.get(e,n));return this},t.sub=function(t,n){return new e(t).sub(n)},t.prototype.subtract=t.prototype.sub,t.prototype.subtractS=t.prototype.subS,t.prototype.subtractM=t.prototype.subM,t.subtract=t.sub,t.prototype.mul=function(t){return"number"==typeof t?this.mulS(t):this.mulM(t)},t.prototype.mulS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t);return this},t.prototype.mulM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t.get(e,n));return this},t.mul=function(t,n){return new e(t).mul(n)},t.prototype.multiply=t.prototype.mul,t.prototype.multiplyS=t.prototype.mulS,t.prototype.multiplyM=t.prototype.mulM,t.multiply=t.mul,t.prototype.div=function(t){return"number"==typeof t?this.divS(t):this.divM(t)},t.prototype.divS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t);return this},t.prototype.divM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t.get(e,n));return this},t.div=function(t,n){return new e(t).div(n)},t.prototype.divide=t.prototype.div,t.prototype.divideS=t.prototype.divS,t.prototype.divideM=t.prototype.divM,t.divide=t.div,t.prototype.mod=function(t){return"number"==typeof t?this.modS(t):this.modM(t)},t.prototype.modS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)%t);return this},t.prototype.modM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)%t.get(e,n));return this},t.mod=function(t,n){return new e(t).mod(n)},t.prototype.modulus=t.prototype.mod,t.prototype.modulusS=t.prototype.modS,t.prototype.modulusM=t.prototype.modM,t.modulus=t.mod,t.prototype.and=function(t){return"number"==typeof t?this.andS(t):this.andM(t)},t.prototype.andS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)&t);return this},t.prototype.andM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)&t.get(e,n));return this},t.and=function(t,n){return new e(t).and(n)},t.prototype.or=function(t){return"number"==typeof t?this.orS(t):this.orM(t)},t.prototype.orS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)|t);return this},t.prototype.orM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)|t.get(e,n));return this},t.or=function(t,n){return new e(t).or(n)},t.prototype.xor=function(t){return"number"==typeof t?this.xorS(t):this.xorM(t)},t.prototype.xorS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)^t);return this},t.prototype.xorM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)^t.get(e,n));return this},t.xor=function(t,n){return new e(t).xor(n)},t.prototype.leftShift=function(t){return"number"==typeof t?this.leftShiftS(t):this.leftShiftM(t)},t.prototype.leftShiftS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)<<t);return this},t.prototype.leftShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)<<t.get(e,n));return this},t.leftShift=function(t,n){return new e(t).leftShift(n)},t.prototype.signPropagatingRightShift=function(t){return"number"==typeof t?this.signPropagatingRightShiftS(t):this.signPropagatingRightShiftM(t)},t.prototype.signPropagatingRightShiftS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>t);return this},t.prototype.signPropagatingRightShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>t.get(e,n));return this},t.signPropagatingRightShift=function(t,n){return new e(t).signPropagatingRightShift(n)},t.prototype.rightShift=function(t){return"number"==typeof t?this.rightShiftS(t):this.rightShiftM(t)},t.prototype.rightShiftS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>>t);return this},t.prototype.rightShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>>t.get(e,n));return this},t.rightShift=function(t,n){return new e(t).rightShift(n)},t.prototype.zeroFillRightShift=t.prototype.rightShift,t.prototype.zeroFillRightShiftS=t.prototype.rightShiftS,t.prototype.zeroFillRightShiftM=t.prototype.rightShiftM,t.zeroFillRightShift=t.rightShift,t.prototype.not=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,~this.get(t,e));return this},t.not=function(t){return new e(t).not()},t.prototype.abs=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.abs(this.get(t,e)));return this},t.abs=function(t){return new e(t).abs()},t.prototype.acos=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.acos(this.get(t,e)));return this},t.acos=function(t){return new e(t).acos()},t.prototype.acosh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.acosh(this.get(t,e)));return this},t.acosh=function(t){return new e(t).acosh()},t.prototype.asin=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.asin(this.get(t,e)));return this},t.asin=function(t){return new e(t).asin()},t.prototype.asinh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.asinh(this.get(t,e)));return this},t.asinh=function(t){return new e(t).asinh()},t.prototype.atan=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.atan(this.get(t,e)));return this},t.atan=function(t){return new e(t).atan()},t.prototype.atanh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.atanh(this.get(t,e)));return this},t.atanh=function(t){return new e(t).atanh()},t.prototype.cbrt=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.cbrt(this.get(t,e)));return this},t.cbrt=function(t){return new e(t).cbrt()},t.prototype.ceil=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.ceil(this.get(t,e)));return this},t.ceil=function(t){return new e(t).ceil()},t.prototype.clz32=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.clz32(this.get(t,e)));return this},t.clz32=function(t){return new e(t).clz32()},t.prototype.cos=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.cos(this.get(t,e)));return this},t.cos=function(t){return new e(t).cos()},t.prototype.cosh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.cosh(this.get(t,e)));return this},t.cosh=function(t){return new e(t).cosh()},t.prototype.exp=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.exp(this.get(t,e)));return this},t.exp=function(t){return new e(t).exp()},t.prototype.expm1=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.expm1(this.get(t,e)));return this},t.expm1=function(t){return new e(t).expm1()},t.prototype.floor=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.floor(this.get(t,e)));return this},t.floor=function(t){return new e(t).floor()},t.prototype.fround=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.fround(this.get(t,e)));return this},t.fround=function(t){return new e(t).fround()},t.prototype.log=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.log(this.get(t,e)));return this},t.log=function(t){return new e(t).log()},t.prototype.log1p=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.log1p(this.get(t,e)));return this},t.log1p=function(t){return new e(t).log1p()},t.prototype.log10=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.log10(this.get(t,e)));return this},t.log10=function(t){return new e(t).log10()},t.prototype.log2=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.log2(this.get(t,e)));return this},t.log2=function(t){return new e(t).log2()},t.prototype.round=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.round(this.get(t,e)));return this},t.round=function(t){return new e(t).round()},t.prototype.sign=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.sign(this.get(t,e)));return this},t.sign=function(t){return new e(t).sign()},t.prototype.sin=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.sin(this.get(t,e)));return this},t.sin=function(t){return new e(t).sin()},t.prototype.sinh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.sinh(this.get(t,e)));return this},t.sinh=function(t){return new e(t).sinh()},t.prototype.sqrt=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.sqrt(this.get(t,e)));return this},t.sqrt=function(t){return new e(t).sqrt()},t.prototype.tan=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.tan(this.get(t,e)));return this},t.tan=function(t){return new e(t).tan()},t.prototype.tanh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.tanh(this.get(t,e)));return this},t.tanh=function(t){return new e(t).tanh()},t.prototype.trunc=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.trunc(this.get(t,e)));return this},t.trunc=function(t){return new e(t).trunc()},t.pow=function(t,n){return new e(t).pow(n)},t.prototype.pow=function(t){return"number"==typeof t?this.powS(t):this.powM(t)},t.prototype.powS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,Math.pow(this.get(e,n),t));return this},t.prototype.powM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,Math.pow(this.get(e,n),t.get(e,n)));return this}}(Af,Tf);class Of extends Af{constructor(t){super(),this.data=t,this.rows=t.length,this.columns=t[0].length}set(t,e,n){return this.data[t][e]=n,this}get(t,e){return this.data[t][e]}}function Nf(t,e){let n=0;return Math.abs(t)>Math.abs(e)?(n=e/t,Math.abs(t)*Math.sqrt(1+n*n)):0!==e?(n=t/e,Math.abs(e)*Math.sqrt(1+n*n)):0}class Df{constructor(t,e={}){if((t=Of.checkMatrix(t)).isEmpty())throw new Error("Matrix must be non-empty");let n=t.rows,r=t.columns;const{computeLeftSingularVectors:o=!0,computeRightSingularVectors:i=!0,autoTranspose:a=!1}=e;let u,s=Boolean(o),c=Boolean(i),f=!1;if(n<r)if(a){u=t.transpose(),n=u.rows,r=u.columns,f=!0;let e=s;s=c,c=e}else u=t.clone(),console.warn("Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose");else u=t.clone();let l=Math.min(n,r),d=Math.min(n+1,r),h=new Float64Array(d),p=new Tf(n,l),v=new Tf(r,r),g=new Float64Array(r),m=new Float64Array(n),y=new Float64Array(d);for(let t=0;t<d;t++)y[t]=t;let b=Math.min(n-1,r),w=Math.max(0,Math.min(r-2,n)),E=Math.max(b,w);for(let t=0;t<E;t++){if(t<b){h[t]=0;for(let e=t;e<n;e++)h[t]=Nf(h[t],u.get(e,t));if(0!==h[t]){u.get(t,t)<0&&(h[t]=-h[t]);for(let e=t;e<n;e++)u.set(e,t,u.get(e,t)/h[t]);u.set(t,t,u.get(t,t)+1)}h[t]=-h[t]}for(let e=t+1;e<r;e++){if(t<b&&0!==h[t]){let r=0;for(let o=t;o<n;o++)r+=u.get(o,t)*u.get(o,e);r=-r/u.get(t,t);for(let o=t;o<n;o++)u.set(o,e,u.get(o,e)+r*u.get(o,t))}g[e]=u.get(t,e)}if(s&&t<b)for(let e=t;e<n;e++)p.set(e,t,u.get(e,t));if(t<w){g[t]=0;for(let e=t+1;e<r;e++)g[t]=Nf(g[t],g[e]);if(0!==g[t]){g[t+1]<0&&(g[t]=0-g[t]);for(let e=t+1;e<r;e++)g[e]/=g[t];g[t+1]+=1}if(g[t]=-g[t],t+1<n&&0!==g[t]){for(let e=t+1;e<n;e++)m[e]=0;for(let e=t+1;e<n;e++)for(let n=t+1;n<r;n++)m[e]+=g[n]*u.get(e,n);for(let e=t+1;e<r;e++){let r=-g[e]/g[t+1];for(let o=t+1;o<n;o++)u.set(o,e,u.get(o,e)+r*m[o])}}if(c)for(let e=t+1;e<r;e++)v.set(e,t,g[e])}}let x=Math.min(r,n+1);if(b<r&&(h[b]=u.get(b,b)),n<x&&(h[x-1]=0),w+1<x&&(g[w]=u.get(w,x-1)),g[x-1]=0,s){for(let t=b;t<l;t++){for(let e=0;e<n;e++)p.set(e,t,0);p.set(t,t,1)}for(let t=b-1;t>=0;t--)if(0!==h[t]){for(let e=t+1;e<l;e++){let r=0;for(let o=t;o<n;o++)r+=p.get(o,t)*p.get(o,e);r=-r/p.get(t,t);for(let o=t;o<n;o++)p.set(o,e,p.get(o,e)+r*p.get(o,t))}for(let e=t;e<n;e++)p.set(e,t,-p.get(e,t));p.set(t,t,1+p.get(t,t));for(let e=0;e<t-1;e++)p.set(e,t,0)}else{for(let e=0;e<n;e++)p.set(e,t,0);p.set(t,t,1)}}if(c)for(let t=r-1;t>=0;t--){if(t<w&&0!==g[t])for(let e=t+1;e<r;e++){let n=0;for(let o=t+1;o<r;o++)n+=v.get(o,t)*v.get(o,e);n=-n/v.get(t+1,t);for(let o=t+1;o<r;o++)v.set(o,e,v.get(o,e)+n*v.get(o,t))}for(let e=0;e<r;e++)v.set(e,t,0);v.set(t,t,1)}let _=x-1,S=0,A=Number.EPSILON;for(;x>0;){let t,e;for(t=x-2;t>=-1&&-1!==t;t--){const e=Number.MIN_VALUE+A*Math.abs(h[t]+Math.abs(h[t+1]));if(Math.abs(g[t])<=e||Number.isNaN(g[t])){g[t]=0;break}}if(t===x-2)e=4;else{let n;for(n=x-1;n>=t&&n!==t;n--){let e=(n!==x?Math.abs(g[n]):0)+(n!==t+1?Math.abs(g[n-1]):0);if(Math.abs(h[n])<=A*e){h[n]=0;break}}n===t?e=3:n===x-1?e=1:(e=2,t=n)}switch(t++,e){case 1:{let e=g[x-2];g[x-2]=0;for(let n=x-2;n>=t;n--){let o=Nf(h[n],e),i=h[n]/o,a=e/o;if(h[n]=o,n!==t&&(e=-a*g[n-1],g[n-1]=i*g[n-1]),c)for(let t=0;t<r;t++)o=i*v.get(t,n)+a*v.get(t,x-1),v.set(t,x-1,-a*v.get(t,n)+i*v.get(t,x-1)),v.set(t,n,o)}break}case 2:{let e=g[t-1];g[t-1]=0;for(let r=t;r<x;r++){let o=Nf(h[r],e),i=h[r]/o,a=e/o;if(h[r]=o,e=-a*g[r],g[r]=i*g[r],s)for(let e=0;e<n;e++)o=i*p.get(e,r)+a*p.get(e,t-1),p.set(e,t-1,-a*p.get(e,r)+i*p.get(e,t-1)),p.set(e,r,o)}break}case 3:{const e=Math.max(Math.abs(h[x-1]),Math.abs(h[x-2]),Math.abs(g[x-2]),Math.abs(h[t]),Math.abs(g[t])),o=h[x-1]/e,i=h[x-2]/e,a=g[x-2]/e,u=h[t]/e,f=g[t]/e,l=((i+o)*(i-o)+a*a)/2,d=o*a*(o*a);let m=0;0===l&&0===d||(m=l<0?0-Math.sqrt(l*l+d):Math.sqrt(l*l+d),m=d/(l+m));let y=(u+o)*(u-o)+m,b=u*f;for(let e=t;e<x-1;e++){let o=Nf(y,b);0===o&&(o=Number.MIN_VALUE);let i=y/o,a=b/o;if(e!==t&&(g[e-1]=o),y=i*h[e]+a*g[e],g[e]=i*g[e]-a*h[e],b=a*h[e+1],h[e+1]=i*h[e+1],c)for(let t=0;t<r;t++)o=i*v.get(t,e)+a*v.get(t,e+1),v.set(t,e+1,-a*v.get(t,e)+i*v.get(t,e+1)),v.set(t,e,o);if(o=Nf(y,b),0===o&&(o=Number.MIN_VALUE),i=y/o,a=b/o,h[e]=o,y=i*g[e]+a*h[e+1],h[e+1]=-a*g[e]+i*h[e+1],b=a*g[e+1],g[e+1]=i*g[e+1],s&&e<n-1)for(let t=0;t<n;t++)o=i*p.get(t,e)+a*p.get(t,e+1),p.set(t,e+1,-a*p.get(t,e)+i*p.get(t,e+1)),p.set(t,e,o)}g[x-2]=y,S+=1;break}case 4:if(h[t]<=0&&(h[t]=h[t]<0?-h[t]:0,c))for(let e=0;e<=_;e++)v.set(e,t,-v.get(e,t));for(;t<_&&!(h[t]>=h[t+1]);){let e=h[t];if(h[t]=h[t+1],h[t+1]=e,c&&t<r-1)for(let n=0;n<r;n++)e=v.get(n,t+1),v.set(n,t+1,v.get(n,t)),v.set(n,t,e);if(s&&t<n-1)for(let r=0;r<n;r++)e=p.get(r,t+1),p.set(r,t+1,p.get(r,t)),p.set(r,t,e);t++}S=0,x--}}if(f){let t=v;v=p,p=t}this.m=n,this.n=r,this.s=h,this.U=p,this.V=v}solve(t){let e=t,n=this.threshold,r=this.s.length,o=Tf.zeros(r,r);for(let t=0;t<r;t++)Math.abs(this.s[t])<=n?o.set(t,t,0):o.set(t,t,1/this.s[t]);let i=this.U,a=this.rightSingularVectors,u=a.mmul(o),s=a.rows,c=i.rows,f=Tf.zeros(s,c);for(let t=0;t<s;t++)for(let e=0;e<c;e++){let n=0;for(let o=0;o<r;o++)n+=u.get(t,o)*i.get(e,o);f.set(t,e,n)}return f.mmul(e)}solveForDiagonal(t){return this.solve(Tf.diag(t))}inverse(){let t=this.V,e=this.threshold,n=t.rows,r=t.columns,o=new Tf(n,this.s.length);for(let i=0;i<n;i++)for(let n=0;n<r;n++)Math.abs(this.s[n])>e&&o.set(i,n,t.get(i,n)/this.s[n]);let i=this.U,a=i.rows,u=i.columns,s=new Tf(n,a);for(let t=0;t<n;t++)for(let e=0;e<a;e++){let n=0;for(let r=0;r<u;r++)n+=o.get(t,r)*i.get(e,r);s.set(t,e,n)}return s}get condition(){return this.s[0]/this.s[Math.min(this.m,this.n)-1]}get norm2(){return this.s[0]}get rank(){let t=Math.max(this.m,this.n)*this.s[0]*Number.EPSILON,e=0,n=this.s;for(let r=0,o=n.length;r<o;r++)n[r]>t&&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 Tf.diag(this.s)}}var Mf=function(){function t(t){this.distances=t.distances,this.dimension=t.dimension||2,this.linkDistance=t.linkDistance}return t.prototype.layout=function(){var t=this,e=t.dimension,n=t.distances,r=t.linkDistance;try{var o=Tf.mul(Tf.pow(n,2),-.5),i=o.mean("row"),a=o.mean("column"),u=o.mean();o.add(u).subRowVector(i).subColumnVector(a);var s=new Df(o),c=Tf.sqrt(s.diagonalMatrix).diagonal();return s.leftSingularVectors.toJSON().map((function(t){return Tf.mul([t],[c]).toJSON()[0].splice(0,e)}))}catch(t){for(var f=[],l=0;l<n.length;l++){var d=Math.random()*r,h=Math.random()*r;f.push([d,h])}return f}},t}();const kf=Mf;var Rf=function(){function t(t){this.disp=[],this.positions=t.positions,this.adjMatrix=t.adjMatrix,this.focusID=t.focusID,this.radii=t.radii,this.iterations=t.iterations||10,this.height=t.height||10,this.width=t.width||10,this.speed=t.speed||100,this.gravity=t.gravity||10,this.nodeSizeFunc=t.nodeSizeFunc,this.k=t.k||5,this.strictRadial=t.strictRadial,this.nodes=t.nodes}return t.prototype.layout=function(){var t=this,e=t.positions,n=[],r=t.iterations,o=t.width/10;t.maxDisplace=o,t.disp=n;for(var i=0;i<r;i++)e.forEach((function(t,e){n[e]={x:0,y:0}})),t.getRepulsion(),t.updatePositions();return e},t.prototype.getRepulsion=function(){var t=this,e=t.positions,n=t.nodes,r=t.disp,o=t.k,i=t.radii||[];e.forEach((function(a,u){r[u]={x:0,y:0},e.forEach((function(e,s){if(u!==s&&i[u]===i[s]){var c=a[0]-e[0],f=a[1]-e[1],l=Math.sqrt(c*c+f*f);if(0===l){l=1;var d=u>s?1:-1;c=.01*d,f=.01*d}if(l<t.nodeSizeFunc(n[u])/2+t.nodeSizeFunc(n[s])/2){var h=o*o/l;r[u].x+=c/l*h,r[u].y+=f/l*h}}}))}))},t.prototype.updatePositions=function(){var t=this,e=t.positions,n=t.disp,r=t.speed,o=t.strictRadial,i=t.focusID,a=t.maxDisplace||t.width/10;o&&n.forEach((function(t,n){var r=e[n][0]-e[i][0],o=e[n][1]-e[i][1],a=Math.sqrt(r*r+o*o),u=o/a,s=-r/a,c=Math.sqrt(t.x*t.x+t.y*t.y),f=Math.acos((u*t.x+s*t.y)/c);f>Math.PI/2&&(f-=Math.PI/2,u*=-1,s*=-1);var l=Math.cos(f)*c;t.x=u*l,t.y=s*l}));var u=t.radii;e.forEach((function(t,s){if(s!==i){var c=Math.sqrt(n[s].x*n[s].x+n[s].y*n[s].y);if(c>0&&s!==i){var f=Math.min(a*(r/800),c);if(t[0]+=n[s].x/c*f,t[1]+=n[s].y/c*f,o){var l=t[0]-e[i][0],d=t[1]-e[i][1],h=Math.sqrt(l*l+d*d);l=l/h*u[s],d=d/h*u[s],t[0]=e[i][0]+l,t[1]=e[i][1]+d}}}}))},t}();const Cf=Rf;var Lf=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function Pf(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var jf=function(t){function n(e){var n=t.call(this)||this;return n.maxIteration=1e3,n.focusNode=null,n.unitRadius=null,n.linkDistance=50,n.preventOverlap=!1,n.strictRadial=!0,n.maxPreventOverlapIteration=200,n.sortStrength=10,n.nodes=[],n.edges=[],n.updateCfg(e),n}return Lf(n,t),n.prototype.getDefaultCfg=function(){return{maxIteration:1e3,focusNode:null,unitRadius:null,linkDistance:50,preventOverlap:!1,nodeSize:void 0,nodeSpacing:void 0,strictRadial:!0,maxPreventOverlapIteration:200,sortBy:void 0,sortStrength:10}},n.prototype.execute=function(){var t=this,n=t.nodes,r=t.edges||[];if(n&&0!==n.length){t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]);var u=t.center;if(1===n.length)return n[0].x=u[0],n[0].y=u[1],void(t.onLayoutEnd&&t.onLayoutEnd());var s=t.linkDistance,c=null;if(e(t.focusNode)){for(var l=!1,d=0;d<n.length;d++)n[d].id===t.focusNode&&(c=n[d],t.focusNode=c,l=!0,d=n.length);l||(c=null)}else c=t.focusNode;c||(c=n[0],t.focusNode=c);var h=function(t,e){var n=-1;return t.forEach((function(t,r){t.id===e&&(n=r)})),n}(n,c.id);h<0&&(h=0),t.focusIndex=h;var g=v({nodes:n,edges:r},!1),m=p(g),y=t.maxToFocus(m,h);t.handleInfinity(m,h,y+1),t.distances=m;var b=m[h],w=t.width||500,x=t.height||500,_=w-u[0]>u[0]?u[0]:w-u[0],S=x-u[1]>u[1]?u[1]:x-u[1];0===_&&(_=w/2),0===S&&(S=x/2);var A=S>_?_:S,I=Math.max.apply(Math,b),T=[];b.forEach((function(e,n){t.unitRadius||(t.unitRadius=A/I),T[n]=e*t.unitRadius})),t.radii=T;var O=t.eIdealDisMatrix();t.eIdealDistances=O;var N=function(t){for(var e=t.length,n=t[0].length,r=[],o=0;o<e;o++){for(var i=[],a=0;a<n;a++)0!==t[o][a]?i.push(1/(t[o][a]*t[o][a])):i.push(0);r.push(i)}return r}(O);t.weights=N;var D=new kf({linkDistance:s,distances:O}).layout();D.forEach((function(t){a(t[0])&&(t[0]=Math.random()*s),a(t[1])&&(t[1]=Math.random()*s)})),t.positions=D,D.forEach((function(t,e){n[e].x=t[0]+u[0],n[e].y=t[1]+u[1]})),D.forEach((function(t){t[0]-=D[h][0],t[1]-=D[h][1]})),t.run();var M,k=t.preventOverlap,R=t.nodeSize,C=t.strictRadial;if(k){var L,P=t.nodeSpacing;L=i(P)?function(){return P}:E(P)?P:function(){return 0},M=R?o(R)?function(t){return(R[0]>R[1]?R[0]:R[1])+L(t)}:function(t){return R+L(t)}:function(t){return t.size?o(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])+L(t):f(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)+L(t):t.size+L(t):10+L(t)};var j={nodes:n,nodeSizeFunc:M,adjMatrix:g,positions:D,radii:T,height:x,width:w,strictRadial:C,focusID:h,iterations:t.maxPreventOverlapIteration||200,k:D.length/4.5},z=new Cf(j);D=z.layout()}return D.forEach((function(t,e){n[e].x=t[0]+u[0],n[e].y=t[1]+u[1]})),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:n,edges:r}}t.onLayoutEnd&&t.onLayoutEnd()},n.prototype.run=function(){for(var t=this,e=t.maxIteration,n=t.positions||[],r=t.weights||[],o=t.eIdealDistances||[],i=t.radii||[],a=0;a<=e;a++){var u=a/e;t.oneIteration(u,n,i,o,r)}},n.prototype.oneIteration=function(t,e,n,r,o){var i=1-t,a=this.focusIndex;e.forEach((function(u,s){var c=Pf(u,[0,0]),f=0===c?0:1/c;if(s!==a){var l=0,d=0,h=0;e.forEach((function(t,e){if(s!==e){var n=Pf(u,t),i=0===n?0:1/n,a=r[e][s];h+=o[s][e],l+=o[s][e]*(t[0]+a*(u[0]-t[0])*i),d+=o[s][e]*(t[1]+a*(u[1]-t[1])*i)}}));var p=0===n[s]?0:1/n[s];h*=i,h+=t*p*p,l*=i,l+=t*p*u[0]*f,u[0]=l/h,d*=i,d+=t*p*u[1]*f,u[1]=d/h}}))},n.prototype.eIdealDisMatrix=function(){var t=this,n=t.nodes;if(!n)return[];var r=t.distances,o=t.linkDistance,i=t.radii||[],a=t.unitRadius||50,u=[];return r&&r.forEach((function(r,s){var c=[];r.forEach((function(r,u){if(s===u)c.push(0);else if(i[s]===i[u])if("data"===t.sortBy)c.push(r*(Math.abs(s-u)*t.sortStrength)/(i[s]/a));else if(t.sortBy){var f=n[s][t.sortBy]||0,l=n[u][t.sortBy]||0;e(f)&&(f=f.charCodeAt(0)),e(l)&&(l=l.charCodeAt(0)),c.push(r*(Math.abs(f-l)*t.sortStrength)/(i[s]/a))}else c.push(r*o/(i[s]/a));else{var d=(o+a)/2;c.push(r*d)}})),u.push(c)})),u},n.prototype.handleInfinity=function(t,e,n){for(var r=t.length,o=0;o<r;o++)if(t[e][o]===1/0){t[e][o]=n,t[o][e]=n;for(var i=0;i<r;i++)t[o][i]!==1/0&&t[e][i]===1/0&&(t[e][i]=n+t[o][i],t[i][e]=n+t[o][i])}for(o=0;o<r;o++)if(o!==e)for(i=0;i<r;i++)if(t[o][i]===1/0){var a=Math.abs(t[e][o]-t[e][i]);a=0===a?1:a,t[o][i]=a}},n.prototype.maxToFocus=function(t,e){for(var n=0,r=0;r<t[e].length;r++)t[e][r]!==1/0&&(n=t[e][r]>n?t[e][r]:n);return n},n.prototype.getType=function(){return"radial"},n}(t),zf=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ff=function(t){function n(e){var n=t.call(this)||this;return n.nodeSize=30,n.minNodeSpacing=10,n.nodeSpacing=10,n.preventOverlap=!1,n.equidistant=!1,n.startAngle=1.5*Math.PI,n.clockwise=!0,n.sortBy="degree",n.nodes=[],n.edges=[],n.width=300,n.height=300,n.onLayoutEnd=function(){},n.updateCfg(e),n}return zf(n,t),n.prototype.getDefaultCfg=function(){return{nodeSize:30,minNodeSpacing:10,nodeSpacing:10,preventOverlap:!1,sweep:void 0,equidistant:!1,startAngle:1.5*Math.PI,clockwise:!0,maxLevelDiff:void 0,sortBy:"degree"}},n.prototype.execute=function(){var t,n,r=this,a=r.nodes,u=r.edges,s=a.length;if(0!==s){r.width||"undefined"==typeof window||(r.width=window.innerWidth),r.height||"undefined"==typeof window||(r.height=window.innerHeight),r.center||(r.center=[r.width/2,r.height/2]);var c=r.center;if(1===s)return a[0].x=c[0],a[0].y=c[1],void(null===(n=r.onLayoutEnd)||void 0===n||n.call(r));var l,d=r.nodeSize,p=r.nodeSpacing,v=[],g=0;l=o(d)?Math.max(d[0],d[1]):d,o(p)?g=Math.max(p[0],p[1]):i(p)&&(g=p),a.forEach((function(t){v.push(t);var e=l;o(t.size)?e=Math.max(t.size[0],t.size[1]):i(t.size)?e=t.size:f(t.size)&&(e=Math.max(t.size.width,t.size.height)),l=Math.max(l,e),E(p)&&(g=Math.max(p(t),g))})),r.clockwise=void 0!==r.counterclockwise?!r.counterclockwise:r.clockwise;var m={},y={};if(v.forEach((function(t,e){m[t.id]=t,y[t.id]=e})),!("degree"!==r.sortBy&&e(r.sortBy)&&void 0!==v[0][r.sortBy]||(r.sortBy="degree",i(a[0].degree)))){var b=h(a.length,y,u);v.forEach((function(t,e){t.degree=b[e].all}))}v.sort((function(t,e){return e[r.sortBy]-t[r.sortBy]})),r.maxValueNode=v[0],r.maxLevelDiff=r.maxLevelDiff||r.maxValueNode[r.sortBy]/4;var w=[[]],x=w[0];v.forEach((function(t){if(x.length>0){var e=Math.abs(x[0][r.sortBy]-t[r.sortBy]);r.maxLevelDiff&&e>=r.maxLevelDiff&&(x=[],w.push(x))}x.push(t)}));var _=l+(g||r.minNodeSpacing);if(!r.preventOverlap){var S=w.length>0&&w[0].length>1,A=(Math.min(r.width,r.height)/2-_)/(w.length+(S?1:0));_=Math.min(_,A)}var I=0;if(w.forEach((function(t){var e=r.sweep;void 0===e&&(e=2*Math.PI-2*Math.PI/t.length);var n=t.dTheta=e/Math.max(1,t.length-1);if(t.length>1&&r.preventOverlap){var o=Math.cos(n)-Math.cos(0),i=Math.sin(n)-Math.sin(0),a=Math.sqrt(_*_/(o*o+i*i));I=Math.max(a,I)}t.r=I,I+=_})),r.equidistant){for(var T=0,O=0,N=0;N<w.length;N++){var D=w[N].r-O;T=Math.max(T,D)}O=0,w.forEach((function(t,e){0===e&&(O=t.r),t.r=O,O+=T}))}return w.forEach((function(t){var e=t.dTheta,n=t.r;t.forEach((function(t,o){var i=r.startAngle+(r.clockwise?1:-1)*e*o;t.x=c[0]+n*Math.cos(i),t.y=c[1]+n*Math.sin(i)}))})),r.onLayoutEnd&&r.onLayoutEnd(),{nodes:a,edges:u}}null===(t=r.onLayoutEnd)||void 0===t||t.call(r)},n.prototype.getType=function(){return"concentric"},n}(t),Gf=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Uf=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.linkDistance=50,n.nodes=[],n.edges=[],n.onLayoutEnd=function(){},n.updateCfg(e),n}return Gf(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],linkDistance:50}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.edges,r=void 0===n?[]:n,o=t.center;if(e&&0!==e.length){if(1===e.length)return e[0].x=o[0],e[0].y=o[1],void(t.onLayoutEnd&&t.onLayoutEnd());var i=t.linkDistance,a=v({nodes:e,edges:r},!1),u=p(a);t.handleInfinity(u);var s,c,f=(s=i,c=[],u.forEach((function(t){var e=[];t.forEach((function(t){e.push(t*s)})),c.push(e)})),c);t.scaledDistances=f;var l=t.runMDS();return t.positions=l,l.forEach((function(t,n){e[n].x=t[0]+o[0],e[n].y=t[1]+o[1]})),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:r}}t.onLayoutEnd&&t.onLayoutEnd()},e.prototype.runMDS=function(){var t=this.scaledDistances,e=Tf.mul(Tf.pow(t,2),-.5),n=e.mean("row"),r=e.mean("column"),o=e.mean();e.add(o).subRowVector(n).subColumnVector(r);var i=new Df(e),a=Tf.sqrt(i.diagonalMatrix).diagonal();return i.leftSingularVectors.toJSON().map((function(t){return Tf.mul([t],[a]).toJSON()[0].splice(0,2)}))},e.prototype.handleInfinity=function(t){var e=-999999;t.forEach((function(t){t.forEach((function(t){t!==1/0&&e<t&&(e=t)}))})),t.forEach((function(n,r){n.forEach((function(n,o){n===1/0&&(t[r][o]=e)}))}))},e.prototype.getType=function(){return"mds"},e}(t),Bf=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vf=function(t){function e(e){var n=t.call(this)||this;return n.maxIteration=1e3,n.workerEnabled=!1,n.gravity=10,n.speed=5,n.clustering=!1,n.clusterGravity=10,n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.onLayoutEnd=function(){},n.tick=function(){},n.animate=!0,n.updateCfg(e),n}return Bf(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:1e3,gravity:10,speed:1,clustering:!1,clusterGravity:10,animate:!0}},e.prototype.execute=function(){var t,e,n=this,r=this,o=r.nodes;if(void 0!==r.timeInterval&&"undefined"!=typeof window&&window.clearInterval(r.timeInterval),o&&0!==o.length){r.width||"undefined"==typeof window||(r.width=window.innerWidth),r.height||"undefined"==typeof window||(r.height=window.innerHeight),r.center||(r.center=[r.width/2,r.height/2]);var a=r.center;if(1===o.length)return o[0].x=a[0],o[0].y=a[1],void(null===(e=r.onLayoutEnd)||void 0===e||e.call(r));var u={},s={};return o.forEach((function(t,e){i(t.x)||(t.x=Math.random()*n.width),i(t.y)||(t.y=Math.random()*n.height),u[t.id]=t,s[t.id]=e})),r.nodeMap=u,r.nodeIdxMap=s,r.run()}null===(t=r.onLayoutEnd)||void 0===t||t.call(r)},e.prototype.run=function(){var t,e=this,n=e.nodes;if(n){var r=e.edges,o=e.maxIteration,i=e.workerEnabled,a=e.clustering,u=e.animate,s={};if(a&&n.forEach((function(t){void 0===s[t.cluster]&&(s[t.cluster]={name:t.cluster,cx:0,cy:0,count:0})})),i||!u){for(var c=0;c<o;c++)e.runOneStep(s);null===(t=e.onLayoutEnd)||void 0===t||t.call(e)}else{if("undefined"==typeof window)return;var f=0;this.timeInterval=window.setInterval((function(){var t;e.runOneStep(s),++f>=o&&(null===(t=e.onLayoutEnd)||void 0===t||t.call(e),window.clearInterval(e.timeInterval))}),0)}return{nodes:n,edges:r}}},e.prototype.runOneStep=function(t){var e,n=this,r=n.nodes;if(r){var o=n.edges,a=n.center,u=n.gravity,s=n.speed,c=n.clustering,f=n.height*n.width,l=Math.sqrt(f)/10,d=f/(r.length+1),h=Math.sqrt(d),p=[];if(r.forEach((function(t,e){p[e]={x:0,y:0}})),n.applyCalculate(r,o,p,h,d),c){for(var v in t)t[v].cx=0,t[v].cy=0,t[v].count=0;for(var v in r.forEach((function(e){var n=t[e.cluster];i(e.x)&&(n.cx+=e.x),i(e.y)&&(n.cy+=e.y),n.count++})),t)t[v].cx/=t[v].count,t[v].cy/=t[v].count;var g=n.clusterGravity||u;r.forEach((function(e,n){if(i(e.x)&&i(e.y)){var r=t[e.cluster],o=Math.sqrt((e.x-r.cx)*(e.x-r.cx)+(e.y-r.cy)*(e.y-r.cy)),a=h*g;p[n].x-=a*(e.x-r.cx)/o,p[n].y-=a*(e.y-r.cy)/o}}))}r.forEach((function(t,e){if(i(t.x)&&i(t.y)){var n=.01*h*u;p[e].x-=n*(t.x-a[0]),p[e].y-=n*(t.y-a[1])}})),r.forEach((function(t,e){if(i(t.fx)&&i(t.fy))return t.x=t.fx,void(t.y=t.fy);if(i(t.x)&&i(t.y)){var n=Math.sqrt(p[e].x*p[e].x+p[e].y*p[e].y);if(n>0){var r=Math.min(l*(s/800),n);t.x+=p[e].x/n*r,t.y+=p[e].y/n*r}}})),null===(e=n.tick)||void 0===e||e.call(n)}},e.prototype.applyCalculate=function(t,e,n,r,o){this.calRepulsive(t,n,o),e&&this.calAttractive(e,n,r)},e.prototype.calRepulsive=function(t,e,n){t.forEach((function(r,o){e[o]={x:0,y:0},t.forEach((function(t,a){if(o!==a&&i(r.x)&&i(t.x)&&i(r.y)&&i(t.y)){var u=r.x-t.x,s=r.y-t.y,c=u*u+s*s;if(0===c){c=1;var f=o>a?1:-1;u=.01*f,s=.01*f}var l=n/c;e[o].x+=u*l,e[o].y+=s*l}}))}))},e.prototype.calAttractive=function(t,e,n){var r=this;t.forEach((function(t){var o=d(t,"source"),a=d(t,"target");if(o&&a){var u=r.nodeIdxMap[o],s=r.nodeIdxMap[a];if(u!==s){var c=r.nodeMap[o],f=r.nodeMap[a];if(i(f.x)&&i(c.x)&&i(f.y)&&i(c.y)){var l=f.x-c.x,h=f.y-c.y,p=Math.sqrt(l*l+h*h),v=p*p/n;e[s].x-=l/p*v,e[s].y-=h/p*v,e[u].x+=l/p*v,e[u].y+=h/p*v}}}}))},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){var t=this;t.stop(),t.tick=null,t.nodes=null,t.edges=null,t.destroyed=!0},e.prototype.getType=function(){return"fruchterman"},e}(t);function Wf(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)}function Xf(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Wf(i,r,o,a,u,"next",t)}function u(t){Wf(i,r,o,a,u,"throw",t)}a(void 0)}))}}function Hf(t){return Hf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hf(t)}function qf(t){var e=function(t,e){if("object"!==Hf(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Hf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===Hf(e)?e:String(e)}function Yf(t,e,n){return(e=qf(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Kf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Zf(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,qf(r.key),r)}}function $f(t,e,n){return e&&Zf(t.prototype,e),n&&Zf(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var Qf,Jf=n(8397),tl=n.n(Jf),el=n(8868),nl=n.n(el),rl=n(744),ol=n.n(rl),il=n(6298),al=n.n(il),ul=1;function sl(){return ul++}!function(t){t[t.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",t[t.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",t[t.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC_COLOR=768]="SRC_COLOR",t[t.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.DST_COLOR=774]="DST_COLOR",t[t.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",t[t.FUNC_ADD=32774]="FUNC_ADD",t[t.BLEND_EQUATION=32777]="BLEND_EQUATION",t[t.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",t[t.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",t[t.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",t[t.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",t[t.MAX_EXT=32776]="MAX_EXT",t[t.MIN_EXT=32775]="MIN_EXT",t[t.BLEND_DST_RGB=32968]="BLEND_DST_RGB",t[t.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",t[t.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",t[t.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",t[t.CONSTANT_COLOR=32769]="CONSTANT_COLOR",t[t.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",t[t.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",t[t.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",t[t.BLEND_COLOR=32773]="BLEND_COLOR",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",t[t.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",t[t.STREAM_DRAW=35040]="STREAM_DRAW",t[t.STATIC_DRAW=35044]="STATIC_DRAW",t[t.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",t[t.BUFFER_SIZE=34660]="BUFFER_SIZE",t[t.BUFFER_USAGE=34661]="BUFFER_USAGE",t[t.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",t[t.FRONT=1028]="FRONT",t[t.BACK=1029]="BACK",t[t.FRONT_AND_BACK=1032]="FRONT_AND_BACK",t[t.CULL_FACE=2884]="CULL_FACE",t[t.BLEND=3042]="BLEND",t[t.DITHER=3024]="DITHER",t[t.STENCIL_TEST=2960]="STENCIL_TEST",t[t.DEPTH_TEST=2929]="DEPTH_TEST",t[t.SCISSOR_TEST=3089]="SCISSOR_TEST",t[t.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",t[t.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",t[t.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",t[t.NO_ERROR=0]="NO_ERROR",t[t.INVALID_ENUM=1280]="INVALID_ENUM",t[t.INVALID_VALUE=1281]="INVALID_VALUE",t[t.INVALID_OPERATION=1282]="INVALID_OPERATION",t[t.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",t[t.CW=2304]="CW",t[t.CCW=2305]="CCW",t[t.LINE_WIDTH=2849]="LINE_WIDTH",t[t.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",t[t.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",t[t.CULL_FACE_MODE=2885]="CULL_FACE_MODE",t[t.FRONT_FACE=2886]="FRONT_FACE",t[t.DEPTH_RANGE=2928]="DEPTH_RANGE",t[t.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",t[t.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",t[t.DEPTH_FUNC=2932]="DEPTH_FUNC",t[t.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",t[t.STENCIL_FUNC=2962]="STENCIL_FUNC",t[t.STENCIL_FAIL=2964]="STENCIL_FAIL",t[t.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",t[t.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",t[t.STENCIL_REF=2967]="STENCIL_REF",t[t.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",t[t.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",t[t.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",t[t.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",t[t.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",t[t.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",t[t.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",t[t.VIEWPORT=2978]="VIEWPORT",t[t.SCISSOR_BOX=3088]="SCISSOR_BOX",t[t.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",t[t.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",t[t.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",t[t.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",t[t.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",t[t.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",t[t.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",t[t.RED_BITS=3410]="RED_BITS",t[t.GREEN_BITS=3411]="GREEN_BITS",t[t.BLUE_BITS=3412]="BLUE_BITS",t[t.ALPHA_BITS=3413]="ALPHA_BITS",t[t.DEPTH_BITS=3414]="DEPTH_BITS",t[t.STENCIL_BITS=3415]="STENCIL_BITS",t[t.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",t[t.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",t[t.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",t[t.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",t[t.SAMPLES=32937]="SAMPLES",t[t.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",t[t.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",t[t.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",t[t.DONT_CARE=4352]="DONT_CARE",t[t.FASTEST=4353]="FASTEST",t[t.NICEST=4354]="NICEST",t[t.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.INT=5124]="INT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.FLOAT=5126]="FLOAT",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.ALPHA=6406]="ALPHA",t[t.RGB=6407]="RGB",t[t.RGBA=6408]="RGBA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",t[t.VERTEX_SHADER=35633]="VERTEX_SHADER",t[t.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",t[t.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",t[t.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",t[t.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",t[t.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",t[t.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",t[t.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",t[t.SHADER_TYPE=35663]="SHADER_TYPE",t[t.DELETE_STATUS=35712]="DELETE_STATUS",t[t.LINK_STATUS=35714]="LINK_STATUS",t[t.VALIDATE_STATUS=35715]="VALIDATE_STATUS",t[t.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",t[t.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",t[t.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",t[t.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",t[t.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",t[t.NEVER=512]="NEVER",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.GEQUAL=518]="GEQUAL",t[t.ALWAYS=519]="ALWAYS",t[t.KEEP=7680]="KEEP",t[t.REPLACE=7681]="REPLACE",t[t.INCR=7682]="INCR",t[t.DECR=7683]="DECR",t[t.INVERT=5386]="INVERT",t[t.INCR_WRAP=34055]="INCR_WRAP",t[t.DECR_WRAP=34056]="DECR_WRAP",t[t.VENDOR=7936]="VENDOR",t[t.RENDERER=7937]="RENDERER",t[t.VERSION=7938]="VERSION",t[t.NEAREST=9728]="NEAREST",t[t.LINEAR=9729]="LINEAR",t[t.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",t[t.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",t[t.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",t[t.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",t[t.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",t[t.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE=5890]="TEXTURE",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t[t.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",t[t.TEXTURE0=33984]="TEXTURE0",t[t.TEXTURE1=33985]="TEXTURE1",t[t.TEXTURE2=33986]="TEXTURE2",t[t.TEXTURE3=33987]="TEXTURE3",t[t.TEXTURE4=33988]="TEXTURE4",t[t.TEXTURE5=33989]="TEXTURE5",t[t.TEXTURE6=33990]="TEXTURE6",t[t.TEXTURE7=33991]="TEXTURE7",t[t.TEXTURE8=33992]="TEXTURE8",t[t.TEXTURE9=33993]="TEXTURE9",t[t.TEXTURE10=33994]="TEXTURE10",t[t.TEXTURE11=33995]="TEXTURE11",t[t.TEXTURE12=33996]="TEXTURE12",t[t.TEXTURE13=33997]="TEXTURE13",t[t.TEXTURE14=33998]="TEXTURE14",t[t.TEXTURE15=33999]="TEXTURE15",t[t.TEXTURE16=34e3]="TEXTURE16",t[t.TEXTURE17=34001]="TEXTURE17",t[t.TEXTURE18=34002]="TEXTURE18",t[t.TEXTURE19=34003]="TEXTURE19",t[t.TEXTURE20=34004]="TEXTURE20",t[t.TEXTURE21=34005]="TEXTURE21",t[t.TEXTURE22=34006]="TEXTURE22",t[t.TEXTURE23=34007]="TEXTURE23",t[t.TEXTURE24=34008]="TEXTURE24",t[t.TEXTURE25=34009]="TEXTURE25",t[t.TEXTURE26=34010]="TEXTURE26",t[t.TEXTURE27=34011]="TEXTURE27",t[t.TEXTURE28=34012]="TEXTURE28",t[t.TEXTURE29=34013]="TEXTURE29",t[t.TEXTURE30=34014]="TEXTURE30",t[t.TEXTURE31=34015]="TEXTURE31",t[t.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",t[t.REPEAT=10497]="REPEAT",t[t.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t[t.FLOAT_VEC2=35664]="FLOAT_VEC2",t[t.FLOAT_VEC3=35665]="FLOAT_VEC3",t[t.FLOAT_VEC4=35666]="FLOAT_VEC4",t[t.INT_VEC2=35667]="INT_VEC2",t[t.INT_VEC3=35668]="INT_VEC3",t[t.INT_VEC4=35669]="INT_VEC4",t[t.BOOL=35670]="BOOL",t[t.BOOL_VEC2=35671]="BOOL_VEC2",t[t.BOOL_VEC3=35672]="BOOL_VEC3",t[t.BOOL_VEC4=35673]="BOOL_VEC4",t[t.FLOAT_MAT2=35674]="FLOAT_MAT2",t[t.FLOAT_MAT3=35675]="FLOAT_MAT3",t[t.FLOAT_MAT4=35676]="FLOAT_MAT4",t[t.SAMPLER_2D=35678]="SAMPLER_2D",t[t.SAMPLER_CUBE=35680]="SAMPLER_CUBE",t[t.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",t[t.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",t[t.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",t[t.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",t[t.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",t[t.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",t[t.COMPILE_STATUS=35713]="COMPILE_STATUS",t[t.LOW_FLOAT=36336]="LOW_FLOAT",t[t.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",t[t.HIGH_FLOAT=36338]="HIGH_FLOAT",t[t.LOW_INT=36339]="LOW_INT",t[t.MEDIUM_INT=36340]="MEDIUM_INT",t[t.HIGH_INT=36341]="HIGH_INT",t[t.FRAMEBUFFER=36160]="FRAMEBUFFER",t[t.RENDERBUFFER=36161]="RENDERBUFFER",t[t.RGBA4=32854]="RGBA4",t[t.RGB5_A1=32855]="RGB5_A1",t[t.RGB565=36194]="RGB565",t[t.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",t[t.STENCIL_INDEX=6401]="STENCIL_INDEX",t[t.STENCIL_INDEX8=36168]="STENCIL_INDEX8",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",t[t.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",t[t.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",t[t.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",t[t.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",t[t.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",t[t.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",t[t.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",t[t.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",t[t.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",t[t.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",t[t.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",t[t.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",t[t.NONE=0]="NONE",t[t.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",t[t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",t[t.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",t[t.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",t[t.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",t[t.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",t[t.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",t[t.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",t[t.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",t[t.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",t[t.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",t[t.COPY_SRC=1]="COPY_SRC",t[t.COPY_DST=2]="COPY_DST",t[t.SAMPLED=4]="SAMPLED",t[t.STORAGE=8]="STORAGE",t[t.RENDER_ATTACHMENT=16]="RENDER_ATTACHMENT"}(Qf||(Qf={}));var cl,fl,ll,dl,hl=function(){function t(){Kf(this,t),this.config=void 0}return $f(t,[{key:"get",value:function(){return this.config}},{key:"set",value:function(t){this.config=t}}]),t}();function pl(){if("undefined"!=typeof document)return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}function vl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function gl(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?vl(Object(n),!0).forEach((function(e){Yf(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vl(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}"undefined"!=typeof navigator&&/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),function(t){t.Void="Void",t.Boolean="Boolean",t.Float="Float",t.Uint32="Uint32",t.Int32="Int32",t.Vector="Vector",t.Vector2Float="vec2<f32>",t.Vector3Float="vec3<f32>",t.Vector4Float="vec4<f32>",t.Vector2Boolean="vec2<bool>",t.Vector3Boolean="vec3<bool>",t.Vector4Boolean="vec4<bool>",t.Vector2Uint="vec2<u32>",t.Vector3Uint="vec3<u32>",t.Vector4Uint="vec4<u32>",t.Vector2Int="vec2<i32>",t.Vector3Int="vec3<i32>",t.Vector4Int="vec4<i32>",t.Matrix="Matrix",t.Matrix3x3Float="mat3x3<f32>",t.Matrix4x4Float="mat4x4<i32>",t.Struct="Struct",t.FloatArray="Float[]",t.Vector4FloatArray="vec4<f32>[]"}(cl||(cl={})),function(t){t.Program="Program",t.Identifier="Identifier",t.VariableDeclaration="VariableDeclaration",t.BlockStatement="BlockStatement",t.ReturnStatement="ReturnStatement",t.FunctionDeclaration="FunctionDeclaration",t.VariableDeclarator="VariableDeclarator",t.AssignmentExpression="AssignmentExpression",t.LogicalExpression="LogicalExpression",t.BinaryExpression="BinaryExpression",t.ArrayExpression="ArrayExpression",t.UnaryExpression="UnaryExpression",t.UpdateExpression="UpdateExpression",t.FunctionExpression="FunctionExpression",t.MemberExpression="MemberExpression",t.ConditionalExpression="ConditionalExpression",t.ExpressionStatement="ExpressionStatement",t.CallExpression="CallExpression",t.NumThreadStatement="NumThreadStatement",t.StorageStatement="StorageStatement",t.DoWhileStatement="DoWhileStatement",t.WhileStatement="WhileStatement",t.ForStatement="ForStatement",t.BreakStatement="BreakStatement",t.ContinueStatement="ContinueStatement",t.IfStatement="IfStatement",t.ImportedFunctionStatement="ImportedFunctionStatement"}(fl||(fl={})),function(t){t.Input="Input",t.Output="Output",t.Uniform="Uniform",t.Workgroup="Workgroup",t.UniformConstant="UniformConstant",t.Image="Image",t.StorageBuffer="StorageBuffer",t.Private="Private",t.Function="Function"}(ll||(ll={})),function(t){t.GLSL100="GLSL100",t.GLSL450="GLSL450",t.WGSL="WGSL"}(dl||(dl={}));var ml,yl,bl,wl,El,xl,_l,Sl,Al,Il,Tl,Ol,Nl,Dl,Ml=function(){function t(e,n){Kf(this,t),this.engine=e,this.configService=n,this.model=void 0,this.dirty=!0,this.compiledBundle=void 0,this.initPromise=void 0}var e,n,r;return $f(t,[{key:"init",value:function(){var t=this.configService.get(),e=t.canvas,n=t.engineOptions;this.initPromise=this.engine.init(gl({canvas:e||pl(),antialiasing:!1},n))}},{key:"setBundle",value:function(t){this.compiledBundle=JSON.parse(JSON.stringify(t))}},{key:"setDispatch",value:function(t){return this.compiledBundle.context&&(this.compiledBundle.context.dispatch=t),this}},{key:"setMaxIteration",value:function(t){return this.compiledBundle.context&&(this.compiledBundle.context.maxIteration=t),this}},{key:"setBinding",value:function(t,e){var n=this;if("string"==typeof t){var r=nl()(e)||tl()(e)||ol()(e);if(this.compiledBundle&&this.compiledBundle.context){var o=this.compiledBundle.context.defines.find((function(e){return e.name===t}));if(o)return o.value=e,this;var i=this.compiledBundle.context.uniforms.find((function(e){return e.name===t}));i&&(r?(i.data=e,i.isReferer=!1,i.storageClass===ll.Uniform?this.model&&this.model.updateUniform(t,e):this.model&&this.model.updateBuffer(t,e)):(i.isReferer=!0,i.data=e))}}else Object.keys(t).forEach((function(e){n.setBinding(e,t[e])}));return this}},{key:"execute",value:(r=Xf(al().mark((function t(){var e,n,r=this,o=arguments;return al().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=o.length>0&&void 0!==o[0]?o[0]:1,!this.dirty){t.next=6;break}return this.compiledBundle.context&&(e>1?this.compiledBundle.context.maxIteration=e:this.compiledBundle.context.maxIteration++),t.next=5,this.compile();case 5:this.dirty=!1;case 6:for(this.engine.beginFrame(),this.engine.clear({}),this.compiledBundle.context&&this.compiledBundle.context.uniforms.filter((function(t){return t.isReferer})).forEach((function(t){var e=t.data,n=t.name;r.model.confirmInput(e.model,n)})),n=0;n<e;n++)this.model.run();return this.engine.endFrame(),t.abrupt("return",this);case 12:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"getOutput",value:(n=Xf(al().mark((function t(){return al().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.model.readData());case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"compile",value:(e=Xf(al().mark((function t(){var e,n,r;return al().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.initPromise;case 2:return e=gl({},this.compiledBundle.context),n=this.engine.supportWebGPU?this.engine.useWGSL?dl.WGSL:dl.GLSL450:dl.GLSL100,r=this.compiledBundle.shaders[n],e.defines.filter((function(t){return t.runtime})).forEach((function(t){var e="".concat("__DefineValuePlaceholder__").concat(t.name);r=r.replace(e,"".concat(t.value))})),e.shader=r,e.uniforms.forEach((function(t){if(!t.data&&t.storageClass===ll.StorageBuffer){var n=1;t.type===cl.FloatArray?n=1:t.type===cl.Vector4FloatArray&&(n=4),t.data=new Float32Array(e.output.length*n).fill(0)}})),this.compiledBundle.context=e,t.next=11,this.engine.createComputeModel(this.compiledBundle.context);case 11:this.model=t.sent;case 12:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),t}(),kl=n(6377),Rl=n.n(kl),Cl=function(){function t(e,n){Kf(this,t),this.attribute=void 0,this.buffer=void 0;var r=n.buffer,o=n.offset,i=n.stride,a=n.normalized,u=n.size,s=n.divisor;this.buffer=r,this.attribute={buffer:r.get(),offset:o||0,stride:i||0,normalized:a||!1,divisor:s||0},u&&(this.attribute.size=u)}return $f(t,[{key:"get",value:function(){return this.attribute}},{key:"updateBuffer",value:function(t){this.buffer.subData(t)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),t}(),Ll=(Yf(ml={},Qf.POINTS,"points"),Yf(ml,Qf.LINES,"lines"),Yf(ml,Qf.LINE_LOOP,"line loop"),Yf(ml,Qf.LINE_STRIP,"line strip"),Yf(ml,Qf.TRIANGLES,"triangles"),Yf(ml,Qf.TRIANGLE_FAN,"triangle fan"),Yf(ml,Qf.TRIANGLE_STRIP,"triangle strip"),ml),Pl=(Yf(yl={},Qf.STATIC_DRAW,"static"),Yf(yl,Qf.DYNAMIC_DRAW,"dynamic"),Yf(yl,Qf.STREAM_DRAW,"stream"),yl),jl=(Yf(bl={},Qf.BYTE,"int8"),Yf(bl,Qf.UNSIGNED_INT,"int16"),Yf(bl,Qf.INT,"int32"),Yf(bl,Qf.UNSIGNED_BYTE,"uint8"),Yf(bl,Qf.UNSIGNED_SHORT,"uint16"),Yf(bl,Qf.UNSIGNED_INT,"uint32"),Yf(bl,Qf.FLOAT,"float"),bl),zl=(Yf(wl={},Qf.ALPHA,"alpha"),Yf(wl,Qf.LUMINANCE,"luminance"),Yf(wl,Qf.LUMINANCE_ALPHA,"luminance alpha"),Yf(wl,Qf.RGB,"rgb"),Yf(wl,Qf.RGBA,"rgba"),Yf(wl,Qf.RGBA4,"rgba4"),Yf(wl,Qf.RGB5_A1,"rgb5 a1"),Yf(wl,Qf.RGB565,"rgb565"),Yf(wl,Qf.DEPTH_COMPONENT,"depth"),Yf(wl,Qf.DEPTH_STENCIL,"depth stencil"),wl),Fl=(Yf(El={},Qf.DONT_CARE,"dont care"),Yf(El,Qf.NICEST,"nice"),Yf(El,Qf.FASTEST,"fast"),El),Gl=(Yf(xl={},Qf.NEAREST,"nearest"),Yf(xl,Qf.LINEAR,"linear"),Yf(xl,Qf.LINEAR_MIPMAP_LINEAR,"mipmap"),Yf(xl,Qf.NEAREST_MIPMAP_LINEAR,"nearest mipmap linear"),Yf(xl,Qf.LINEAR_MIPMAP_NEAREST,"linear mipmap nearest"),Yf(xl,Qf.NEAREST_MIPMAP_NEAREST,"nearest mipmap nearest"),xl),Ul=(Yf(_l={},Qf.REPEAT,"repeat"),Yf(_l,Qf.CLAMP_TO_EDGE,"clamp"),Yf(_l,Qf.MIRRORED_REPEAT,"mirror"),_l),Bl=(Yf(Sl={},Qf.NONE,"none"),Yf(Sl,Qf.BROWSER_DEFAULT_WEBGL,"browser"),Sl),Vl=(Yf(Al={},Qf.NEVER,"never"),Yf(Al,Qf.ALWAYS,"always"),Yf(Al,Qf.LESS,"less"),Yf(Al,Qf.LEQUAL,"lequal"),Yf(Al,Qf.GREATER,"greater"),Yf(Al,Qf.GEQUAL,"gequal"),Yf(Al,Qf.EQUAL,"equal"),Yf(Al,Qf.NOTEQUAL,"notequal"),Al),Wl=(Yf(Il={},Qf.FUNC_ADD,"add"),Yf(Il,Qf.MIN_EXT,"min"),Yf(Il,Qf.MAX_EXT,"max"),Yf(Il,Qf.FUNC_SUBTRACT,"subtract"),Yf(Il,Qf.FUNC_REVERSE_SUBTRACT,"reverse subtract"),Il),Xl=(Yf(Tl={},Qf.ZERO,"zero"),Yf(Tl,Qf.ONE,"one"),Yf(Tl,Qf.SRC_COLOR,"src color"),Yf(Tl,Qf.ONE_MINUS_SRC_COLOR,"one minus src color"),Yf(Tl,Qf.SRC_ALPHA,"src alpha"),Yf(Tl,Qf.ONE_MINUS_SRC_ALPHA,"one minus src alpha"),Yf(Tl,Qf.DST_COLOR,"dst color"),Yf(Tl,Qf.ONE_MINUS_DST_COLOR,"one minus dst color"),Yf(Tl,Qf.DST_ALPHA,"dst alpha"),Yf(Tl,Qf.ONE_MINUS_DST_ALPHA,"one minus dst alpha"),Yf(Tl,Qf.CONSTANT_COLOR,"constant color"),Yf(Tl,Qf.ONE_MINUS_CONSTANT_COLOR,"one minus constant color"),Yf(Tl,Qf.CONSTANT_ALPHA,"constant alpha"),Yf(Tl,Qf.ONE_MINUS_CONSTANT_ALPHA,"one minus constant alpha"),Yf(Tl,Qf.SRC_ALPHA_SATURATE,"src alpha saturate"),Tl),Hl=(Yf(Ol={},Qf.NEVER,"never"),Yf(Ol,Qf.ALWAYS,"always"),Yf(Ol,Qf.LESS,"less"),Yf(Ol,Qf.LEQUAL,"lequal"),Yf(Ol,Qf.GREATER,"greater"),Yf(Ol,Qf.GEQUAL,"gequal"),Yf(Ol,Qf.EQUAL,"equal"),Yf(Ol,Qf.NOTEQUAL,"notequal"),Ol),ql=(Yf(Nl={},Qf.ZERO,"zero"),Yf(Nl,Qf.KEEP,"keep"),Yf(Nl,Qf.REPLACE,"replace"),Yf(Nl,Qf.INVERT,"invert"),Yf(Nl,Qf.INCR,"increment"),Yf(Nl,Qf.DECR,"decrement"),Yf(Nl,Qf.INCR_WRAP,"increment wrap"),Yf(Nl,Qf.DECR_WRAP,"decrement wrap"),Nl),Yl=(Yf(Dl={},Qf.FRONT,"front"),Yf(Dl,Qf.BACK,"back"),Dl),Kl=function(){function t(e,n){Kf(this,t),this.buffer=void 0;var r=n.data,o=n.usage,i=n.type;this.buffer=e.buffer({data:r,usage:Pl[o||Qf.STATIC_DRAW],type:jl[i||Qf.UNSIGNED_BYTE]})}return $f(t,[{key:"get",value:function(){return this.buffer}},{key:"destroy",value:function(){}},{key:"subData",value:function(t){var e=t.data,n=t.offset;this.buffer.subdata(e,n)}}]),t}();function Zl(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function $l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ql(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?$l(Object(n),!0).forEach((function(e){Yf(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$l(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Jl=0,td=function(){function t(e,n){var r=this;Kf(this,t),this.reGl=e,this.context=n,this.entity=sl(),this.texFBO=void 0,this.computeCommand=void 0,this.textureCache={},this.outputTextureName=void 0,this.swapOutputTextureName=void 0,this.compiledPingpong=void 0,this.dynamicPingpong=void 0;var o={};this.context.uniforms.forEach((function(t){var e=t.name,n=t.type,i=t.data,a=t.isReferer,u=t.storageClass;if(u===ll.StorageBuffer){if(a)r.textureCache[e]={data:void 0},o["".concat(e,"Size")]=function(){return i.compiledBundle.context.output.textureSize};else{r.textureCache[e]=r.calcDataTexture(e,n,i);var s=r.textureCache[e],c=s.textureWidth,f=s.isOutput;o["".concat(e,"Size")]=[c,c],f&&(r.outputTextureName=e,r.context.needPingpong&&(r.outputTextureName="".concat(e,"Output"),r.textureCache[r.outputTextureName]=r.calcDataTexture(e,n,i)))}o[e]=function(){return r.textureCache[e].texture}}else if(u===ll.Uniform){if(i&&(Array.isArray(i)||tl()(i))&&i.length>16)throw new Error("invalid data type ".concat(n));o[e]=function(){return t.data}}}));var i=this.getOuputDataTexture(),a=i.textureWidth,u=i.texelCount;o.u_OutputTextureSize=[a,a],o.u_OutputTexelCount=u,this.context.output.textureSize=[a,a];var s={attributes:{a_Position:[[-1,1,0],[-1,-1,0],[1,1,0],[1,-1,0]],a_TexCoord:[[0,1],[0,0],[1,1],[1,0]]},frag:"#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n#else\n precision mediump float;\n#endif\n".concat(this.context.shader),uniforms:o,vert:"attribute vec3 a_Position;\nattribute vec2 a_TexCoord;\n\nvarying vec2 v_TexCoord;\n\nvoid main() {\n gl_Position = vec4(a_Position, 1.0);\n v_TexCoord = a_TexCoord;\n}",primitive:"triangle strip",count:4};this.computeCommand=this.reGl(s)}var e;return $f(t,[{key:"run",value:function(){var t=this;this.context.maxIteration>1&&this.context.needPingpong&&(this.compiledPingpong=!0),(this.compiledPingpong||this.dynamicPingpong)&&this.swap(),this.texFBO=this.reGl.framebuffer({color:this.getOuputDataTexture().texture}),this.texFBO.use((function(){t.computeCommand()}))}},{key:"readData",value:(e=Xf(al().mark((function t(){var e,n,r,o,i,a,u,s,c=this;return al().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.reGl({framebuffer:this.texFBO})((function(){e=c.reGl.read()})),!e){t.next=6;break}if(n=this.getOuputDataTexture(),r=n.originalDataLength,o=n.elementsPerTexel,i=n.typedArrayConstructor,a=void 0===i?Float32Array:i,u=[],4!==o)for(s=0;s<e.length;s+=4)1===o?u.push(e[s]):2===o?u.push(e[s],e[s+1]):u.push(e[s],e[s+1],e[s+2]);else u=e;return t.abrupt("return",new a(u.slice(0,r)));case 6:return t.abrupt("return",new Float32Array);case 7:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"confirmInput",value:function(t,e){var n;this.entity===t.entity?(this.dynamicPingpong=!0,n=this):n=t,this.textureCache[e].id=n.getOuputDataTexture().id,this.textureCache[e].texture=n.getOuputDataTexture().texture}},{key:"updateUniform",value:function(){}},{key:"updateBuffer",value:function(t,e){var n=this.context.uniforms.find((function(e){return e.name===t}));if(n){var r=this.calcDataTexture(t,n.type,e),o=r.texture,i=r.data;this.textureCache[t].data=i,this.textureCache[t].texture=o}}},{key:"destroy",value:function(){}},{key:"swap",value:function(){if(this.swapOutputTextureName||this.createSwapOutputDataTexture(),this.compiledPingpong){var t=this.context.output.name;this.textureCache[t].id=this.getOuputDataTexture().id,this.textureCache[t].texture=this.getOuputDataTexture().texture}var e=this.outputTextureName;this.outputTextureName=this.swapOutputTextureName,this.swapOutputTextureName=e}},{key:"getOuputDataTexture",value:function(){return this.textureCache[this.outputTextureName]}},{key:"createSwapOutputDataTexture",value:function(){var t=this.cloneDataTexture(this.getOuputDataTexture());this.swapOutputTextureName="".concat(this.entity,"-swap"),this.textureCache[this.swapOutputTextureName]=t}},{key:"cloneDataTexture",value:function(t){var e=t.data,n=t.textureWidth;return Ql(Ql({},t),{},{id:Jl++,texture:this.reGl.texture({width:n,height:n,data:e,type:"float"})})}},{key:"calcDataTexture",value:function(t,e,n){var r=1;e===cl.Vector4FloatArray&&(r=4);for(var o=[],i=0;i<n.length;i+=r)1===r?o.push(n[i],0,0,0):2===r?o.push(n[i],n[i+1],0,0):3===r?o.push(n[i],n[i+1],n[i+2],0):4===r&&o.push(n[i],n[i+1],n[i+2],n[i+3]);var a,u=n.length,s=Math.ceil(u/r),c=Math.ceil(Math.sqrt(s)),f=c*c;s<f&&o.push.apply(o,function(t){if(Array.isArray(t))return Zl(t)}(a=new Array(4*(f-s)).fill(0))||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(a)||function(t,e){if(t){if("string"==typeof t)return Zl(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Zl(t,e):void 0}}(a)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());var l=this.reGl.texture({width:c,height:c,data:o,type:"float"});return{id:Jl++,data:o,originalDataLength:u,typedArrayConstructor:tl()(n)?n.constructor:void 0,textureWidth:c,texture:l,texelCount:s,elementsPerTexel:r,isOutput:t===this.context.output.name}}}]),t}(),ed=function(){function t(e,n){Kf(this,t),this.elements=void 0;var r=n.data,o=n.usage,i=n.type,a=n.count;this.elements=e.elements({data:r,usage:Pl[o||Qf.STATIC_DRAW],type:jl[i||Qf.UNSIGNED_BYTE],count:a})}return $f(t,[{key:"get",value:function(){return this.elements}},{key:"subData",value:function(t){var e=t.data;this.elements.subdata(e)}},{key:"destroy",value:function(){this.elements.destroy()}}]),t}(),nd=function(){function t(e,n){Kf(this,t),this.framebuffer=void 0;var r=n.width,o=n.height,i=n.color,a=n.colors,u=(n.depth,n.stencil,{width:r,height:o});Array.isArray(a)&&(u.colors=a.map((function(t){return t.get()}))),i&&"boolean"!=typeof i&&(u.color=i.get()),this.framebuffer=e.framebuffer(u)}return $f(t,[{key:"get",value:function(){return this.framebuffer}},{key:"destroy",value:function(){this.framebuffer.destroy()}},{key:"resize",value:function(t){var e=t.width,n=t.height;this.framebuffer.resize(e,n)}}]),t}(),rd=n(9308),od=n.n(rd);function id(t){var e={};return Object.keys(t).forEach((function(n){ad(n,t[n],e,"")})),e}function ad(t,e,n,r){null===e||"number"==typeof e||"boolean"==typeof e||Array.isArray(e)&&"number"==typeof e[0]||tl()(e)||""===e||void 0!==e.resize?n["".concat(r&&r+".").concat(t)]=e:(od()(e)&&Object.keys(e).forEach((function(o){ad(o,e[o],n,"".concat(r&&r+".").concat(t))})),Array.isArray(e)&&e.forEach((function(e,o){Object.keys(e).forEach((function(i){ad(i,e[i],n,"".concat(r&&r+".").concat(t,"[").concat(o,"]"))}))})))}function ud(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function sd(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ud(Object(n),!0).forEach((function(e){Yf(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ud(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var cd=function(){function t(e,n){Kf(this,t),this.reGl=void 0,this.drawCommand=void 0,this.uniforms={},this.reGl=e;var r=n.vs,o=n.fs,i=n.defines,a=n.attributes,u=n.uniforms,s=n.primitive,c=n.count,f=n.elements,l=n.depth,d=n.blend,h=n.stencil,p=n.cull,v=n.instances,g=n.scissor,m=n.viewport,y={};u&&(this.uniforms=id(u),Object.keys(u).forEach((function(t){y[t]=e.prop(t)})));var b={};Object.keys(a).forEach((function(t){b[t]=a[t].get()}));var w=i&&this.generateDefines(i)||"",E={attributes:b,frag:"#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n#else\n precision mediump float;\n#endif\n".concat(w,"\n").concat(o),uniforms:y,vert:"\n".concat(w,"\n").concat(r),primitive:Ll[void 0===s?Qf.TRIANGLES:s]};v&&(E.instances=v),c&&(E.count=c),f&&(E.elements=f.get()),g&&(E.scissor=g),m&&(E.viewport=m),this.initDepthDrawParams({depth:l},E),this.initBlendDrawParams({blend:d},E),this.initStencilDrawParams({stencil:h},E),this.initCullDrawParams({cull:p},E),this.drawCommand=e(E)}return $f(t,[{key:"addUniforms",value:function(t){this.uniforms=sd(sd({},this.uniforms),id(t))}},{key:"draw",value:function(t){var e=sd(sd({},this.uniforms),id(t.uniforms||{})),n={};Object.keys(e).forEach((function(t){var r=Hf(e[t]);"boolean"===r||"number"===r||Array.isArray(e[t])||e[t].BYTES_PER_ELEMENT?n[t]=e[t]:"string"===r||(n[t]=e[t].get())})),this.drawCommand(n)}},{key:"destroy",value:function(){}},{key:"initDepthDrawParams",value:function(t,e){var n=t.depth;n&&(e.depth={enable:void 0===n.enable||!!n.enable,mask:void 0===n.mask||!!n.mask,func:Vl[n.func||Qf.LESS],range:n.range||[0,1]})}},{key:"initBlendDrawParams",value:function(t,e){var n=t.blend;if(n){var r=n.enable,o=n.func,i=n.equation,a=n.color,u=void 0===a?[0,0,0,0]:a;e.blend={enable:!!r,func:{srcRGB:Xl[o&&o.srcRGB||Qf.SRC_ALPHA],srcAlpha:Xl[o&&o.srcAlpha||Qf.SRC_ALPHA],dstRGB:Xl[o&&o.dstRGB||Qf.ONE_MINUS_SRC_ALPHA],dstAlpha:Xl[o&&o.dstAlpha||Qf.ONE_MINUS_SRC_ALPHA]},equation:{rgb:Wl[i&&i.rgb||Qf.FUNC_ADD],alpha:Wl[i&&i.alpha||Qf.FUNC_ADD]},color:u}}}},{key:"initStencilDrawParams",value:function(t,e){var n=t.stencil;if(n){var r=n.enable,o=n.mask,i=void 0===o?-1:o,a=n.func,u=void 0===a?{cmp:Qf.ALWAYS,ref:0,mask:-1}:a,s=n.opFront,c=void 0===s?{fail:Qf.KEEP,zfail:Qf.KEEP,zpass:Qf.KEEP}:s,f=n.opBack,l=void 0===f?{fail:Qf.KEEP,zfail:Qf.KEEP,zpass:Qf.KEEP}:f;e.stencil={enable:!!r,mask:i,func:sd(sd({},u),{},{cmp:Hl[u.cmp]}),opFront:{fail:ql[c.fail],zfail:ql[c.zfail],zpass:ql[c.zpass]},opBack:{fail:ql[l.fail],zfail:ql[l.zfail],zpass:ql[l.zpass]}}}}},{key:"initCullDrawParams",value:function(t,e){var n=t.cull;if(n){var r=n.enable,o=n.face,i=void 0===o?Qf.BACK:o;e.cull={enable:!!r,face:Yl[i]}}}},{key:"generateDefines",value:function(t){return Object.keys(t).map((function(e){return"#define ".concat(e," ").concat(Number(t[e]))})).join("\n")}}]),t}(),fd=function(){function t(e,n){Kf(this,t),this.texture=void 0,this.width=void 0,this.height=void 0;var r=n.data,o=n.type,i=void 0===o?Qf.UNSIGNED_BYTE:o,a=n.width,u=n.height,s=n.flipY,c=void 0!==s&&s,f=n.format,l=void 0===f?Qf.RGBA:f,d=n.mipmap,h=void 0!==d&&d,p=n.wrapS,v=void 0===p?Qf.CLAMP_TO_EDGE:p,g=n.wrapT,m=void 0===g?Qf.CLAMP_TO_EDGE:g,y=n.aniso,b=void 0===y?0:y,w=n.alignment,E=void 0===w?1:w,x=n.premultiplyAlpha,_=void 0!==x&&x,S=n.mag,A=void 0===S?Qf.NEAREST:S,I=n.min,T=void 0===I?Qf.NEAREST:I,O=n.colorSpace,N=void 0===O?Qf.BROWSER_DEFAULT_WEBGL:O;this.width=a,this.height=u;var D={width:a,height:u,type:jl[i],format:zl[l],wrapS:Ul[v],wrapT:Ul[m],mag:Gl[A],min:Gl[T],alignment:E,flipY:c,colorSpace:Bl[N],premultiplyAlpha:_,aniso:b};r&&(D.data=r),"number"==typeof h?D.mipmap=Fl[h]:"boolean"==typeof h&&(D.mipmap=h),this.texture=e.texture(D)}return $f(t,[{key:"get",value:function(){return this.texture}},{key:"update",value:function(){this.texture._texture.bind()}},{key:"resize",value:function(t){var e=t.width,n=t.height;this.texture.resize(e,n),this.width=e,this.height=n}},{key:"destroy",value:function(){this.texture.destroy()}}]),t}(),ld=function(){function t(){var e=this;Kf(this,t),this.supportWebGPU=!1,this.useWGSL=!1,this.$canvas=void 0,this.gl=void 0,this.inited=void 0,this.createModel=function(){var t=Xf(al().mark((function t(n){return al().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!n.uniforms){t.next=3;break}return t.next=3,Promise.all(Object.keys(n.uniforms).map(function(){var t=Xf(al().mark((function t(e){var r;return al().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!n.uniforms[e]||void 0===n.uniforms[e].load){t.next=5;break}return t.next=3,n.uniforms[e].load();case 3:r=t.sent,n.uniforms[e]=r;case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 3:return t.abrupt("return",new cd(e.gl,n));case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.createAttribute=function(t){return new Cl(e.gl,t)},this.createBuffer=function(t){return new Kl(e.gl,t)},this.createElements=function(t){return new ed(e.gl,t)},this.createTexture2D=function(t){return new fd(e.gl,t)},this.createFramebuffer=function(t){return new nd(e.gl,t)},this.useFramebuffer=function(t,n){e.gl({framebuffer:t?t.get():null})(n)},this.createComputeModel=function(){var t=Xf(al().mark((function t(n){return al().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new td(e.gl,n));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.clear=function(t){var n=t.color,r=t.depth,o=t.stencil,i=t.framebuffer,a=void 0===i?null:i,u={color:n,depth:r,stencil:o};u.framebuffer=null===a?a:a.get(),e.gl.clear(u)},this.setScissor=function(t){e.gl&&e.gl._gl&&(t.enable&&t.box?(e.gl._gl.enable(Qf.SCISSOR_TEST),e.gl._gl.scissor(t.box.x,t.box.y,t.box.width,t.box.height)):e.gl._gl.disable(Qf.SCISSOR_TEST),e.gl._refresh())},this.viewport=function(t){var n=t.x,r=t.y,o=t.width,i=t.height;e.gl&&e.gl._gl&&(e.gl._gl.viewport(n,r,o,i),e.gl._refresh())},this.readPixels=function(t){var n=t.framebuffer,r={x:t.x,y:t.y,width:t.width,height:t.height};return n&&(r.framebuffer=n.get()),e.gl.read(r)},this.getCanvas=function(){return e.$canvas},this.getGLContext=function(){return e.gl._gl},this.destroy=function(){e.gl&&(e.gl.destroy(),e.inited=!1)}}var e;return $f(t,[{key:"init",value:(e=Xf(al().mark((function t(e){return al().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.inited){t.next=2;break}return t.abrupt("return");case 2:return this.$canvas=e.canvas,t.next=5,new Promise((function(t,n){Rl()({canvas:e.canvas,attributes:{alpha:!0,antialias:e.antialias,premultipliedAlpha:!0},pixelRatio:1,extensions:["OES_element_index_uint","OES_texture_float","OES_standard_derivatives","angle_instanced_arrays"],optionalExtensions:["EXT_texture_filter_anisotropic","EXT_blend_minmax","WEBGL_depth_texture"],profile:!0,onDone:function(e,r){!e&&r||n(e),t(r)}})}));case 5:this.gl=t.sent,this.inited=!0;case 7:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"isFloatSupported",value:function(){return this.gl.limits.readFloat}},{key:"beginFrame",value:function(){}},{key:"endFrame",value:function(){}}]),t}(),dd=function(){function t(){Kf(this,t),this.engine=void 0,this.configService=new hl}return $f(t,[{key:"setConfig",value:function(t){this.configService.set(t)}},{key:"setEngine",value:function(t){this.engine=t}},{key:"createEntity",value:function(){return sl()}},{key:"createKernel",value:function(t){var e=new Ml(this.engine,this.configService);return"string"==typeof t?e.setBundle(JSON.parse(t)):e.setBundle(t),e.init(),e}},{key:"destroy",value:function(){this.engine.destroy()}}],[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=new t;return n.setConfig(e),n.setEngine(new ld),n}}]),t}(),hd=function(t,e){return t?i(t)?function(){return t}:t:function(){return e||1}},pd=function(t){for(var e=[],n=t.length,r=t[0].length,o=function(r){t.forEach((function(t,o){if(e.push(t[r]),o===n-1)for(;e.length%4!=0;)e.push(0)}))},i=0;i<r;i++)o(i);return new Float32Array(e)},vd=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),gd=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{s(r.next(t))}catch(t){i(t)}}function u(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}s((r=r.apply(t,e||[])).next())}))},md=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(u){return function(s){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=e.call(t,a)}catch(t){u=[6,t],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,s])}}},yd=function(t){function e(e){var n=t.call(this)||this;return n.maxIteration=1e3,n.gravity=10,n.speed=1,n.clustering=!1,n.clusterField="cluster",n.clusterGravity=10,n.workerEnabled=!1,n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.updateCfg(e),n}return vd(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:1e3,gravity:10,speed:1,clustering:!1,clusterGravity:10}},e.prototype.execute=function(){return gd(this,void 0,void 0,(function(){var t,e,n,r,o,a=this;return md(this,(function(u){switch(u.label){case 0:return(e=(t=this).nodes)&&0!==e.length?(t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]),n=t.center,1===e.length?(e[0].x=n[0],e[0].y=n[1],t.onLayoutEnd&&t.onLayoutEnd(),[2]):(r={},o={},e.forEach((function(t,e){i(t.x)||(t.x=Math.random()*a.width),i(t.y)||(t.y=Math.random()*a.height),r[t.id]=t,o[t.id]=e})),t.nodeMap=r,t.nodeIdxMap=o,[4,t.run()])):(t.onLayoutEnd&&t.onLayoutEnd(),[2]);case 1:return u.sent(),[2]}}))}))},e.prototype.executeWithWorker=function(t,e){return gd(this,void 0,void 0,(function(){var n,r,o,a,u,s=this;return md(this,(function(c){switch(c.label){case 0:return r=(n=this).nodes,o=n.center,r&&0!==r.length?1===r.length?(r[0].x=o[0],r[0].y=o[1],[2]):(a={},u={},r.forEach((function(t,e){i(t.x)||(t.x=Math.random()*s.width),i(t.y)||(t.y=Math.random()*s.height),a[t.id]=t,u[t.id]=e})),n.nodeMap=a,n.nodeIdxMap=u,[4,n.run(t,e)]):[2];case 1:return c.sent(),[2]}}))}))},e.prototype.run=function(t,e){return gd(this,void 0,void 0,(function(){var n,r,o,a,u,s,c,f,l,h,p,v,g,m,y,b,w,E,x,_,S,A,I,T,O,N,D=this;return md(this,(function(M){switch(M.label){case 0:for(r=(n=this).nodes,o=n.edges,a=n.maxIteration,u=n.center,s=n.height*n.width,c=Math.sqrt(s)/10,f=s/(r.length+1),l=Math.sqrt(f),h=n.speed,p=n.clustering,k=[n.clusterField],R=r,C=[],L=k.length,P={},R.forEach((function(t){k.forEach((function(e,n){if(void 0===P[t[e]]&&(P[t[e]]=Object.keys(P).length),C.push(P[t[e]]),n===L-1)for(;C.length%4!=0;)C.push(0)}))})),v={array:new Float32Array(C),count:Object.keys(P).length},g=v.array,m=v.count,r.forEach((function(t,e){var n=0,r=0;i(t.fx)&&i(t.fy)&&(n=t.fx||.001,r=t.fy||.001),g[4*e+1]=n,g[4*e+2]=r})),y=r.length,b=function(t,e){var n=[],r=[],o={},i=0;for(i=0;i<t.length;i++){var a=t[i];o[a.id]=i,n.push(a.x),n.push(a.y),n.push(0),n.push(0),r.push([])}for(i=0;i<e.length;i++){var u=e[i],s=d(u,"source"),c=d(u,"target");isNaN(o[s])||isNaN(o[c])||(r[o[s]].push(o[c]),r[o[c]].push(o[s]))}var f=0;for(i=0;i<t.length;i++){var l=n.length,h=r[i],p=h.length;n[4*i+2]=l,n[4*i+3]=p,f=Math.max(f,p);for(var v=0;v<p;++v){var g=h[v];n.push(+g)}}for(;n.length%4!=0;)n.push(0);return{maxEdgePerVetex:f,array:new Float32Array(n)}}(r,o),w=b.maxEdgePerVetex,E=b.array,x=n.workerEnabled,_=x?dd.create({canvas:t,engineOptions:{supportCompute:!0}}):dd.create({engineOptions:{supportCompute:!0}}),S=n.onLayoutEnd,A=[],I=0;I<m;I++)A.push(0,0,0,0);return T=_.createKernel('{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_K;\\nuniform float u_K2;\\nuniform vec2 u_Center;\\nuniform float u_Gravity;\\nuniform float u_ClusterGravity;\\nuniform float u_Speed;\\nuniform float u_MaxDisplace;\\nuniform float u_Clustering;\\nuniform sampler2D u_AttributeArray;\\nuniform vec2 u_AttributeArraySize;\\nvec4 getDatau_AttributeArray(vec2 address2D) {\\n return vec4(texture2D(u_AttributeArray, address2D).rgba);\\n}\\nvec4 getDatau_AttributeArray(float address1D) {\\n return getDatau_AttributeArray(addrTranslation_1Dto2D(address1D, u_AttributeArraySize));\\n}\\nvec4 getDatau_AttributeArray(int address1D) {\\n return getDatau_AttributeArray(float(address1D));\\n}\\nuniform sampler2D u_ClusterCenters;\\nuniform vec2 u_ClusterCentersSize;\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\n}\\nvec4 getDatau_ClusterCenters(float address1D) {\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\n}\\nvec4 getDatau_ClusterCenters(int address1D) {\\n return getDatau_ClusterCenters(float(address1D));\\n}\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat param = u_K2 / dist;\\nif (dist > 0.0) {dx += param * xDist;\\ndy += param * yDist;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < j) ? (1.0) : (-1.0);\\ndx += param * sign;\\ndy += param * sign;}}}}\\nreturn vec2(dx, dy);}\\nvec2 calcGravity(vec4 currentNode, vec4 nodeAttributes) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nfloat vx = currentNode.x - u_Center.x;\\nfloat vy = currentNode.y - u_Center.y;\\nfloat gf = (0.01 * u_K) * u_Gravity;\\ndx = gf * vx;\\ndy = gf * vy;\\nif (u_Clustering == 1.0) {int clusterIdx = int(nodeAttributes.x);\\nvec4 center = getDatau_ClusterCenters(clusterIdx);\\nfloat cvx = currentNode.x - center.x;\\nfloat cvy = currentNode.y - center.y;\\nfloat dist = sqrt((cvx * cvx) + (cvy * cvy)) + 0.01;\\nfloat parma = (u_K * u_ClusterGravity) / dist;\\ndx += parma * cvx;\\ndy += parma * cvy;}\\nreturn vec2(dx, dy);}\\nvec2 calcAttractive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nint arr_offset = int(floor(currentNode.z + 0.5));\\nint length = int(floor(currentNode.w + 0.5));\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + int(p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\nfloat float_j = (buf_offset == 0) ? (node_buffer.x) : ((buf_offset == 1) ? (node_buffer.y) : ((buf_offset == 2) ? (node_buffer.z) : (node_buffer.w)));\\nvec4 nextNode = getDatau_Data(int(float_j));\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat attractiveF = dist / u_K;\\nif (dist > 0.0) {dx -= xDist * attractiveF;\\ndy -= yDist * attractiveF;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < int(float_j)) ? (1.0) : (-1.0);\\ndx -= sign * attractiveF;\\ndy -= sign * attractiveF;}}}\\nreturn vec2(dx, dy);}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 currentNode = getDatau_Data(i);\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nif (i >= VERTEX_COUNT) {gl_FragColor = vec4(currentNode);\\nreturn ;}\\nvec4 nodeAttributes = getDatau_AttributeArray(i);\\nif ((nodeAttributes.y != 0.0) && (nodeAttributes.z != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes.y, nodeAttributes.z, currentNode.z, currentNode.w));\\nreturn ;}\\nvec2 repulsive = calcRepulsive(i, currentNode);\\ndx += repulsive.x;\\ndy += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode);\\ndx += attractive.x;\\ndy += attractive.y;\\nvec2 gravity = calcGravity(currentNode, nodeAttributes);\\ndx -= gravity.x;\\ndy -= gravity.y;\\ndx *= u_Speed;\\ndy *= u_Speed;\\nfloat distLength = sqrt((dx * dx) + (dy * dy));\\nif (distLength > 0.0) {float limitedDist = min(u_MaxDisplace * u_Speed, distLength);\\ngl_FragColor = vec4(vec4(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w));}if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"MAX_EDGE_PER_VERTEX","type":"Float","runtime":true},{"name":"VERTEX_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]},{"name":"u_K","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_K2","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Center","type":"vec2<f32>","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Gravity","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterGravity","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Speed","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_MaxDisplace","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Clustering","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AttributeArray","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}').setDispatch([y,1,1]).setBinding({u_Data:E,u_K:l,u_K2:f,u_Gravity:n.gravity,u_ClusterGravity:n.clusterGravity||n.gravity||1,u_Speed:h,u_MaxDisplace:c,u_Clustering:p?1:0,u_Center:u,u_AttributeArray:g,u_ClusterCenters:A,MAX_EDGE_PER_VERTEX:w,VERTEX_COUNT:y}),p&&(O=_.createKernel('{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define CLUSTER_COUNT __DefineValuePlaceholder__CLUSTER_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform sampler2D u_NodeAttributes;\\nuniform vec2 u_NodeAttributesSize;\\nvec4 getDatau_NodeAttributes(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributes, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributes(float address1D) {\\n return getDatau_NodeAttributes(addrTranslation_1Dto2D(address1D, u_NodeAttributesSize));\\n}\\nvec4 getDatau_NodeAttributes(int address1D) {\\n return getDatau_NodeAttributes(float(address1D));\\n}\\nuniform sampler2D u_ClusterCenters;\\nuniform vec2 u_ClusterCentersSize;\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\n}\\nvec4 getDatau_ClusterCenters(float address1D) {\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\n}\\nvec4 getDatau_ClusterCenters(int address1D) {\\n return getDatau_ClusterCenters(float(address1D));\\n}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 center = getDatau_ClusterCenters(i);\\nfloat sumx = 0.0;\\nfloat sumy = 0.0;\\nfloat count = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 attributes = getDatau_NodeAttributes(j);\\nint clusterIdx = int(attributes.x);\\nvec4 vertex = getDatau_Data(j);\\nif (clusterIdx == i) {sumx += vertex.x;\\nsumy += vertex.y;\\ncount += 1.0;}}\\ngl_FragColor = vec4(vec4(sumx / count, sumy / count, count, i));if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"VERTEX_COUNT","type":"Float","runtime":true},{"name":"CLUSTER_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributes","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_ClusterCenters","size":[1,1],"length":1},"needPingpong":true}}').setDispatch([m,1,1]).setBinding({u_Data:E,u_NodeAttributes:g,u_ClusterCenters:A,VERTEX_COUNT:y,CLUSTER_COUNT:m})),N=function(){return gd(D,void 0,void 0,(function(){var n,o;return md(this,(function(i){switch(i.label){case 0:n=0,i.label=1;case 1:return n<a?[4,T.execute()]:[3,6];case 2:return i.sent(),p?(O.setBinding({u_Data:T}),[4,O.execute()]):[3,4];case 3:i.sent(),T.setBinding({u_ClusterCenters:O}),i.label=4;case 4:T.setBinding({u_MaxDisplace:c*=.99}),i.label=5;case 5:return n++,[3,1];case 6:return[4,T.getOutput()];case 7:return o=i.sent(),t?e.postMessage({type:Gt,vertexEdgeData:o}):r.forEach((function(t,e){var n=o[4*e],r=o[4*e+1];t.x=n,t.y=r})),S&&S(),[2]}}))}))},[4,N()];case 1:return M.sent(),[2]}var k,R,C,L,P}))}))},e.prototype.getType=function(){return"fruchterman-gpu"},e}(t),bd=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),wd=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{s(r.next(t))}catch(t){i(t)}}function u(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}s((r=r.apply(t,e||[])).next())}))},Ed=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(u){return function(s){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=e.call(t,a)}catch(t){u=[6,t],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,s])}}},xd=function(t){function e(e){var n=t.call(this)||this;return n.maxIteration=1e3,n.edgeStrength=200,n.nodeStrength=1e3,n.coulombDisScale=.005,n.damping=.9,n.maxSpeed=1e3,n.minMovement=.5,n.interval=.02,n.factor=1,n.linkDistance=1,n.gravity=10,n.workerEnabled=!1,n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.updateCfg(e),n}return bd(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:2e3,gravity:10,clustering:!1,clusterGravity:10}},e.prototype.execute=function(){return wd(this,void 0,void 0,(function(){var t,e,n,r,o;return Ed(this,(function(a){switch(a.label){case 0:return(e=(t=this).nodes)&&0!==e.length?(t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]),n=t.center,1===e.length?(e[0].x=n[0],e[0].y=n[1],t.onLayoutEnd&&t.onLayoutEnd(),[2]):(r={},o={},e.forEach((function(e,n){i(e.x)||(e.x=Math.random()*t.width),i(e.y)||(e.y=Math.random()*t.height),r[e.id]=e,o[e.id]=n})),t.nodeMap=r,t.nodeIdxMap=o,t.nodeStrength=hd(t.nodeStrength,1),t.edgeStrength=hd(t.edgeStrength,1),[4,t.run()])):(t.onLayoutEnd&&t.onLayoutEnd(),[2]);case 1:return a.sent(),[2]}}))}))},e.prototype.executeWithWorker=function(t,e){var n=this,r=n.nodes,o=n.center;if(r&&0!==r.length){if(1===r.length)return r[0].x=o[0],void(r[0].y=o[1]);var a={},u={};r.forEach((function(t,e){i(t.x)||(t.x=Math.random()*n.width),i(t.y)||(t.y=Math.random()*n.height),a[t.id]=t,u[t.id]=e})),n.nodeMap=a,n.nodeIdxMap=u,n.nodeStrength=hd(n.nodeStrength,1),n.edgeStrength=hd(n.edgeStrength,1),n.run(t,e)}},e.prototype.run=function(t,e){return wd(this,void 0,void 0,(function(){var n,r,o,a,u,s,c,f,l,p,v,g,m,y,b,w,E,x,_,S,A,I,T,O,N,D,M,k=this;return Ed(this,(function(R){switch(R.label){case 0:for(r=(n=this).nodes,o=n.edges,a=n.maxIteration,n.width||"undefined"==typeof window||(n.width=window.innerWidth),n.height||"undefined"==typeof window||(n.height=window.innerHeight),u=r.length,n.linkDistance=hd(n.linkDistance),n.edgeStrength=hd(n.edgeStrength),s=function(t,e,n,r){var o=[],i=[],a={},u=0;for(u=0;u<t.length;u++){var s=t[u];a[s.id]=u,o.push(s.x),o.push(s.y),o.push(0),o.push(0),i.push([])}for(u=0;u<e.length;u++){var c=e[u],f=d(c,"source"),l=d(c,"target");i[a[f]].push(a[l]),i[a[f]].push(n(c)),i[a[f]].push(r(c)),i[a[f]].push(0),i[a[l]].push(a[f]),i[a[l]].push(n(c)),i[a[l]].push(r(c)),i[a[l]].push(0)}var h=0;for(u=0;u<t.length;u++){var p=o.length,v=i[u],g=v.length;o[4*u+2]=p+1048576*g/4,o[4*u+3]=0,h=Math.max(h,g/4);for(var m=0;m<g;++m){var y=v[m];o.push(+y)}}for(;o.length%4!=0;)o.push(0);return{maxEdgePerVetex:h,array:new Float32Array(o)}}(r,o,n.linkDistance,n.edgeStrength),c=s.maxEdgePerVetex,f=s.array,n.degrees=h(r.length,n.nodeIdxMap,o).map((function(t){return t.all})),l=[],p=[],v=[],g=[],m=[],y=[],b=[],n.getMass||(n.getMass=function(t){return n.degrees[n.nodeIdxMap[t.id]]||1}),w=n.gravity,E=n.center,r.forEach((function(t,e){l.push(n.getMass(t)),p.push(n.nodeStrength(t)),n.degrees[e]||(n.degrees[e]=0);var r=[E[0],E[1],w];if(n.getCenter){var o=n.getCenter(t,n.degrees[e]);o&&i(o[0])&&i(o[1])&&i(o[2])&&(r=o)}v.push(r[0]),g.push(r[1]),m.push(r[2]),i(t.fx)&&i(t.fy)?(y.push(t.fx||.001),b.push(t.fy||.001)):(y.push(0),b.push(0))})),x=pd([l,n.degrees,p,y]),_=pd([v,g,m,b]),S=n.workerEnabled,A=S?dd.create({canvas:t,engineOptions:{supportCompute:!0}}):dd.create({engineOptions:{supportCompute:!0}}),I=n.onLayoutEnd,T=[],f.forEach((function(t){T.push(t)})),O=0;O<4;O++)T.push(0);return N=A.createKernel('{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define SHIFT_20 1048576.0\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_damping;\\nuniform float u_maxSpeed;\\nuniform float u_minMovement;\\nuniform sampler2D u_AveMovement;\\nuniform vec2 u_AveMovementSize;\\nvec4 getDatau_AveMovement(vec2 address2D) {\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\n}\\nvec4 getDatau_AveMovement(float address1D) {\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\n}\\nvec4 getDatau_AveMovement(int address1D) {\\n return getDatau_AveMovement(float(address1D));\\n}\\nuniform float u_coulombDisScale;\\nuniform float u_factor;\\nuniform sampler2D u_NodeAttributeArray1;\\nuniform vec2 u_NodeAttributeArray1Size;\\nvec4 getDatau_NodeAttributeArray1(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributeArray1, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributeArray1(float address1D) {\\n return getDatau_NodeAttributeArray1(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray1Size));\\n}\\nvec4 getDatau_NodeAttributeArray1(int address1D) {\\n return getDatau_NodeAttributeArray1(float(address1D));\\n}\\nuniform sampler2D u_NodeAttributeArray2;\\nuniform vec2 u_NodeAttributeArray2Size;\\nvec4 getDatau_NodeAttributeArray2(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributeArray2, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributeArray2(float address1D) {\\n return getDatau_NodeAttributeArray2(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray2Size));\\n}\\nvec4 getDatau_NodeAttributeArray2(int address1D) {\\n return getDatau_NodeAttributeArray2(float(address1D));\\n}\\nuniform float u_interval;\\nivec2 unpack_float(float packedValue) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint packedIntValue = int(packedValue);\\nint v0 = packedIntValue / int(SHIFT_20);\\nreturn ivec2(v0, packedIntValue - (v0 * int(SHIFT_20)));}\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\nfloat vx = currentNode.x - nextNode.x;\\nfloat vy = currentNode.y - nextNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat n_dist = (dist + 0.1) * u_coulombDisScale;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nvec4 attributesi = getDatau_NodeAttributeArray1(i);\\nvec4 attributesj = getDatau_NodeAttributeArray1(j);\\nfloat massi = attributesi.x;\\nfloat nodeStrengthi = attributesi.z;\\nfloat nodeStrengthj = attributesj.z;\\nfloat nodeStrength = (nodeStrengthi + nodeStrengthj) / 2.0;\\nfloat param = (nodeStrength * u_factor) / (n_dist * n_dist);\\nax += direx * param;\\nay += direy * param;}}\\nreturn vec2(ax, ay);}\\nvec2 calcGravity(int i, vec4 currentNode, vec4 attributes2) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat vx = currentNode.x - attributes2.x;\\nfloat vy = currentNode.y - attributes2.y;\\nfloat ax = vx * attributes2.z;\\nfloat ay = vy * attributes2.z;\\nreturn vec2(ax, ay);}\\nvec2 calcAttractive(int i, vec4 currentNode, vec4 attributes1) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat mass = attributes1.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nivec2 compressed = unpack_float(currentNode.z);\\nint length = compressed.x;\\nint arr_offset = compressed.y;\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + (4 * p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\nfloat float_j = node_buffer.x;\\nvec4 nextNode = getDatau_Data(int(float_j));\\nfloat vx = nextNode.x - currentNode.x;\\nfloat vy = nextNode.y - currentNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nfloat edgeLength = node_buffer.y;\\nfloat edgeStrength = node_buffer.z;\\nfloat diff = edgeLength - dist;\\nfloat param = (diff * edgeStrength) / mass;\\nax -= direx * param;\\nay -= direy * param;}\\nreturn vec2(ax, ay);}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 currentNode = getDatau_Data(i);\\nvec4 movement = getDatau_AveMovement(0.0);\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nif ((i >= VERTEX_COUNT) || (movement.x < u_minMovement)) {gl_FragColor = vec4(currentNode);\\nreturn ;}\\nvec4 nodeAttributes1 = getDatau_NodeAttributeArray1(i);\\nvec4 nodeAttributes2 = getDatau_NodeAttributeArray2(i);\\nvec2 repulsive = calcRepulsive(i, currentNode);\\nax += repulsive.x;\\nay += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode, nodeAttributes1);\\nax += attractive.x;\\nay += attractive.y;\\nvec2 gravity = calcGravity(i, currentNode, nodeAttributes2);\\nax -= gravity.x;\\nay -= gravity.y;\\nfloat param = u_interval * u_damping;\\nfloat vx = ax * param;\\nfloat vy = ay * param;\\nfloat vlength = sqrt((vx * vx) + (vy * vy)) + 0.0001;\\nif (vlength > u_maxSpeed) {float param2 = u_maxSpeed / vlength;\\nvx = param2 * vx;\\nvy = param2 * vy;}\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0));}else {float distx = vx * u_interval;\\nfloat disty = vy * u_interval;\\nfloat distLength = sqrt((distx * distx) + (disty * disty));\\ngl_FragColor = vec4(vec4(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength));}if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"MAX_EDGE_PER_VERTEX","type":"Float","runtime":true},{"name":"VERTEX_COUNT","type":"Float","runtime":true},{"name":"SHIFT_20","type":"Float","value":1048576,"runtime":false}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]},{"name":"u_damping","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_maxSpeed","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_minMovement","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AveMovement","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_coulombDisScale","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_factor","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray1","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray2","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_interval","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}').setDispatch([u,1,1]).setBinding({u_Data:f,u_damping:n.damping,u_maxSpeed:n.maxSpeed,u_minMovement:n.minMovement,u_coulombDisScale:n.coulombDisScale,u_factor:n.factor,u_NodeAttributeArray1:x,u_NodeAttributeArray2:_,MAX_EDGE_PER_VERTEX:c,VERTEX_COUNT:u,u_AveMovement:T,u_interval:n.interval}),D=A.createKernel('{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_iter;\\nuniform sampler2D u_AveMovement;\\nuniform vec2 u_AveMovementSize;\\nvec4 getDatau_AveMovement(vec2 address2D) {\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\n}\\nvec4 getDatau_AveMovement(float address1D) {\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\n}\\nvec4 getDatau_AveMovement(int address1D) {\\n return getDatau_AveMovement(float(address1D));\\n}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat movement = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 vertex = getDatau_Data(j);\\nmovement += vertex.w;}\\nmovement = movement / float(VERTEX_COUNT);\\ngl_FragColor = vec4(vec4(movement, 0.0, 0.0, 0.0));if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"VERTEX_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_iter","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AveMovement","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_AveMovement","size":[1,1],"length":1},"needPingpong":true}}').setDispatch([1,1,1]).setBinding({u_Data:f,VERTEX_COUNT:u,u_AveMovement:[0,0,0,0]}),M=function(){return wd(k,void 0,void 0,(function(){var o,i,u;return Ed(this,(function(s){switch(s.label){case 0:o=0,s.label=1;case 1:return o<a?[4,N.execute()]:[3,5];case 2:return s.sent(),D.setBinding({u_Data:N}),[4,D.execute()];case 3:s.sent(),i=Math.max(.02,n.interval-.002*o),N.setBinding({u_interval:i,u_AveMovement:D}),s.label=4;case 4:return o++,[3,1];case 5:return[4,N.getOutput()];case 6:return u=s.sent(),t?e.postMessage({type:Gt,vertexEdgeData:u}):r.forEach((function(t,e){var n=u[4*e],r=u[4*e+1];t.x=n,t.y=r})),I&&I(),[2]}}))}))},[4,M()];case 1:return R.sent(),[2]}}))}))},e.prototype.getType=function(){return"gForce-gpu"},e}(t),_d=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Sd=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.maxIteration=100,n.gravity=10,n.comboGravity=10,n.linkDistance=10,n.alpha=1,n.alphaMin=.001,n.alphaDecay=1-Math.pow(n.alphaMin,1/300),n.alphaTarget=0,n.velocityDecay=.6,n.edgeStrength=.6,n.nodeStrength=30,n.preventOverlap=!1,n.preventNodeOverlap=!1,n.preventComboOverlap=!1,n.collideStrength=void 0,n.nodeCollideStrength=.5,n.comboCollideStrength=.5,n.comboSpacing=20,n.comboPadding=10,n.optimizeRangeFactor=1,n.onTick=function(){},n.onLayoutEnd=function(){},n.depthAttractiveForceScale=1,n.depthRepulsiveForceScale=2,n.nodes=[],n.edges=[],n.combos=[],n.comboTrees=[],n.width=300,n.height=300,n.bias=[],n.nodeMap={},n.oriComboMap={},n.indexMap={},n.comboMap={},n.previousLayouted=!1,n.updateCfg(e),n}return _d(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:100,center:[0,0],gravity:10,speed:1,comboGravity:30,preventOverlap:!1,preventComboOverlap:!0,preventNodeOverlap:!0,nodeSpacing:void 0,collideStrength:void 0,nodeCollideStrength:.5,comboCollideStrength:.5,comboSpacing:20,comboPadding:10,edgeStrength:.6,nodeStrength:30,linkDistance:10}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.center;if(t.comboTree={id:"comboTreeRoot",depth:-1,children:t.comboTrees},e&&0!==e.length){if(1===e.length)return e[0].x=n[0],e[0].y=n[1],void(t.onLayoutEnd&&t.onLayoutEnd());t.initVals(),t.run(),t.onLayoutEnd&&t.onLayoutEnd()}else t.onLayoutEnd&&t.onLayoutEnd()},e.prototype.run=function(){var t=this,e=t.nodes,n=t.previousLayouted?t.maxIteration/5:t.maxIteration;t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);var r=t.center,o=t.velocityDecay,a=t.comboMap;t.previousLayouted||t.initPos(a);for(var u=function(n){var r=[];e.forEach((function(t,e){r[e]={x:0,y:0}})),t.applyCalculate(r),t.applyComboCenterForce(r),e.forEach((function(t,e){i(t.x)&&i(t.y)&&(t.x+=r[e].x*o,t.y+=r[e].y*o)})),t.alpha+=(t.alphaTarget-t.alpha)*t.alphaDecay,t.onTick()},s=0;s<n;s++)u();var c=[0,0];e.forEach((function(t){i(t.x)&&i(t.y)&&(c[0]+=t.x,c[1]+=t.y)})),c[0]/=e.length,c[1]/=e.length;var f=[r[0]-c[0],r[1]-c[1]];e.forEach((function(t,e){i(t.x)&&i(t.y)&&(t.x+=f[0],t.y+=f[1])})),t.combos.forEach((function(t){var e=a[t.id];e&&e.empty&&(t.x=e.cx||t.x,t.y=e.cy||t.y)})),t.previousLayouted=!0},e.prototype.initVals=function(){var t=this,e=t.edges,n=t.nodes,r=t.combos,a={},u={},s={};n.forEach((function(t,e){u[t.id]=t,s[t.id]=e})),t.nodeMap=u,t.indexMap=s;var c={};r.forEach((function(t){c[t.id]=t})),t.oriComboMap=c,t.comboMap=t.getComboMap();var l=t.preventOverlap;t.preventComboOverlap=t.preventComboOverlap||l,t.preventNodeOverlap=t.preventNodeOverlap||l;var h=t.collideStrength;h&&(t.comboCollideStrength=h,t.nodeCollideStrength=h),t.comboCollideStrength=t.comboCollideStrength?t.comboCollideStrength:0,t.nodeCollideStrength=t.nodeCollideStrength?t.nodeCollideStrength:0;for(var p=0;p<e.length;++p){var v=d(e[p],"source"),g=d(e[p],"target");a[v]?a[v]++:a[v]=1,a[g]?a[g]++:a[g]=1}var m=[];for(p=0;p<e.length;++p)v=d(e[p],"source"),g=d(e[p],"target"),m[p]=a[v]/(a[v]+a[g]);this.bias=m;var y,b,w=t.nodeSize,x=t.nodeSpacing;if(b=i(x)?function(){return x}:E(x)?x:function(){return 0},this.nodeSpacing=b,w)if(E(w))y=function(t){return w(t)};else if(o(w)){var _=(w[0]>w[1]?w[0]:w[1])/2;y=function(t){return _}}else{var S=w/2;y=function(t){return S}}else y=function(t){return t.size?o(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2:f(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)/2:t.size/2:10};this.nodeSize=y;var A,I=t.comboSpacing;A=i(I)?function(){return I}:E(I)?I:function(){return 0},this.comboSpacing=A;var T,O=t.comboPadding;T=i(O)?function(){return O}:o(O)?function(){return Math.max.apply(null,O)}:E(O)?O:function(){return 0},this.comboPadding=T;var N,D=this.linkDistance;D||(D=10),N=i(D)?function(t){return D}:D,this.linkDistance=N;var M,k=this.edgeStrength;k||(k=1),M=i(k)?function(t){return k}:k,this.edgeStrength=M;var R,C=this.nodeStrength;C||(C=30),R=i(C)?function(t){return C}:C,this.nodeStrength=R},e.prototype.initPos=function(t){this.nodes.forEach((function(e,n){var r=e.comboId,o=t[r];r&&o?(e.x=o.cx+100/(n+1),e.y=o.cy+100/(n+1)):(e.x=100/(n+1),e.y=100/(n+1))}))},e.prototype.getComboMap=function(){var t=this,e=t.nodeMap,n=t.comboTrees,r=t.oriComboMap,o={};return(n||[]).forEach((function(n){var a=[];m(n,(function(n){if("node"===n.itemType)return!0;if(!r[n.id])return!0;if(void 0===o[n.id]){var u={id:n.id,name:n.id,cx:0,cy:0,count:0,depth:t.oriComboMap[n.id].depth||0,children:[]};o[n.id]=u}var s=n.children;s&&s.forEach((function(t){if(!o[t.id]&&!e[t.id])return!0;a.push(t)}));var c=o[n.id];if(c.cx=0,c.cy=0,0===a.length){c.empty=!0;var f=r[n.id];c.cx=f.x,c.cy=f.y}return a.forEach((function(t){if(c.count++,"node"!==t.itemType){var n=o[t.id];return i(n.cx)&&(c.cx+=n.cx),void(i(n.cy)&&(c.cy+=n.cy))}var r=e[t.id];r&&(i(r.x)&&(c.cx+=r.x),i(r.y)&&(c.cy+=r.y))})),c.cx/=c.count||1,c.cy/=c.count||1,c.children=a,!0}))})),o},e.prototype.applyComboCenterForce=function(t){var e=this,n=e.gravity,r=e.comboGravity||n,o=this.alpha,a=e.comboTrees,u=e.indexMap,s=e.nodeMap,c=e.comboMap;(a||[]).forEach((function(e){m(e,(function(e){if("node"===e.itemType)return!0;if(!c[e.id])return!0;var n=c[e.id],a=(n.depth+1)/10*.5,f=n.cx,l=n.cy;return n.cx=0,n.cy=0,n.children.forEach((function(e){if("node"!==e.itemType){var d=c[e.id];return d&&i(d.cx)&&(n.cx+=d.cx),void(d&&i(d.cy)&&(n.cy+=d.cy))}var h=s[e.id],p=h.x-f||.005,v=h.y-l||.005,g=Math.sqrt(p*p+v*v),m=u[h.id],y=r*o/g*a;t[m].x-=p*y,t[m].y-=v*y,i(h.x)&&(n.cx+=h.x),i(h.y)&&(n.cy+=h.y)})),n.cx/=n.count||1,n.cy/=n.count||1,!0}))}))},e.prototype.applyCalculate=function(t){var e=this,n=e.comboMap,r=e.nodes,o={};r.forEach((function(t,e){r.forEach((function(n,r){if(!(e<r)){var i=t.x-n.x||.005,a=t.y-n.y||.005,u=i*i+a*a,s=Math.sqrt(u);u<1&&(u=s),o["".concat(t.id,"-").concat(n.id)]={vx:i,vy:a,vl2:u,vl:s},o["".concat(n.id,"-").concat(t.id)]={vl2:u,vl:s,vx:-i,vy:-a}}}))})),e.updateComboSizes(n),e.calRepulsive(t,o),e.calAttractive(t,o),e.preventComboOverlap&&e.comboNonOverlapping(t,n)},e.prototype.updateComboSizes=function(t){var e=this,n=e.comboTrees,r=e.nodeMap,i=e.nodeSize,a=e.comboSpacing,u=e.comboPadding;(n||[]).forEach((function(n){var s=[];m(n,(function(n){if("node"===n.itemType)return!0;var c=t[n.id];if(!c)return!1;var f=n.children;f&&f.forEach((function(e){(t[e.id]||r[e.id])&&s.push(e)})),c.minX=1/0,c.minY=1/0,c.maxX=-1/0,c.maxY=-1/0,s.forEach((function(t){if("node"!==t.itemType)return!0;var e=r[t.id];if(!e)return!0;var n=i(e),o=e.x-n,a=e.y-n,u=e.x+n,s=e.y+n;c.minX>o&&(c.minX=o),c.minY>a&&(c.minY=a),c.maxX<u&&(c.maxX=u),c.maxY<s&&(c.maxY=s)}));var l=e.oriComboMap[n.id].size||10;o(l)&&(l=l[0]);var d=Math.max(c.maxX-c.minX,c.maxY-c.minY,l);return c.r=d/2+a(c)/2+u(c),!0}))}))},e.prototype.comboNonOverlapping=function(t,e){var n=this,r=n.comboTree,o=n.comboCollideStrength,i=n.indexMap,a=n.nodeMap;m(r,(function(n){if(!e[n.id]&&!a[n.id]&&"comboTreeRoot"!==n.id)return!1;var r=n.children;return r&&r.length>1&&r.forEach((function(n,u){if("node"===n.itemType)return!1;var s=e[n.id];s&&r.forEach((function(r,c){if(u<=c)return!1;if("node"===r.itemType)return!1;var f=e[r.id];if(!f)return!1;var l=s.cx-f.cx||.005,d=s.cy-f.cy||.005,h=l*l+d*d,p=s.r||1,v=f.r||1,g=p+v,m=v*v,y=p*p;if(h<g*g){var b=n.children;if(!b||0===b.length)return!1;var w=r.children;if(!w||0===w.length)return!1;var E=Math.sqrt(h),x=(g-E)/E*o,_=l*x,S=d*x,A=m/(y+m),I=1-A;b.forEach((function(e){if("node"!==e.itemType)return!1;if(a[e.id]){var n=i[e.id];w.forEach((function(e){if("node"!==e.itemType)return!1;if(!a[e.id])return!1;var r=i[e.id];t[n].x+=_*A,t[n].y+=S*A,t[r].x-=_*I,t[r].y-=S*I}))}}))}}))})),!0}))},e.prototype.calRepulsive=function(t,e){var n=this,r=n.nodes,o=n.width*n.optimizeRangeFactor,i=n.nodeStrength,a=n.alpha,u=n.nodeCollideStrength,s=n.preventNodeOverlap,c=n.nodeSize,f=n.nodeSpacing,l=n.depthRepulsiveForceScale,d=n.center;r.forEach((function(h,p){if(h.x&&h.y){if(d){var v=n.gravity,g=h.x-d[0]||.005,m=h.y-d[1]||.005,y=Math.sqrt(g*g+m*m);t[p].x-=g*v*a/y,t[p].y-=m*v*a/y}r.forEach((function(n,r){if(p!==r&&n.x&&n.y){var d=e["".concat(h.id,"-").concat(n.id)],v=d.vl2,g=d.vl;if(!(g>o)){var m=e["".concat(h.id,"-").concat(n.id)],y=m.vx,b=m.vy,w=Math.log(Math.abs(n.depth-h.depth)/10)+1||1;w=w<1?1:w,n.comboId!==h.comboId&&(w+=1);var E=w?Math.pow(l,w):1,x=i(n)*a/v*E;if(t[p].x+=y*x,t[p].y+=b*x,p<r&&s){var _=c(h)+f(h)||1,S=c(n)+f(n)||1,A=_+S;if(v<A*A){var I=(A-g)/g*u,T=S*S,O=T/(_*_+T),N=y*I,D=b*I;t[p].x+=N*O,t[p].y+=D*O,O=1-O,t[r].x-=N*O,t[r].y-=D*O}}}}}))}}))},e.prototype.calAttractive=function(t,e){var n=this,r=n.edges,o=n.linkDistance,a=n.alpha,u=n.edgeStrength,s=n.bias,c=n.depthAttractiveForceScale;r.forEach((function(r,f){var l=d(r,"source"),h=d(r,"target");if(l&&h&&l!==h){var p=n.indexMap[l],v=n.indexMap[h],g=n.nodeMap[l],m=n.nodeMap[h];if(g&&m){var y=g.depth===m.depth?0:Math.log(Math.abs(g.depth-m.depth)/10);g.comboId===m.comboId&&(y/=2);var b=y?Math.pow(c,y):1;if(g.comboId!==m.comboId&&1===b?b=c/2:g.comboId===m.comboId&&(b=2),i(m.x)&&i(g.x)&&i(m.y)&&i(g.y)){var w=e["".concat(h,"-").concat(l)],E=w.vl,x=w.vx,_=w.vy,S=(E-o(r))/E*a*u(r)*b,A=x*S,I=_*S,T=s[f];t[v].x-=A*T,t[v].y-=I*T,t[p].x+=A*(1-T),t[p].y+=I*(1-T)}}}}))},e.prototype.getType=function(){return"comboForce"},e}(t),Ad=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Id=function(){return Id=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Id.apply(this,arguments)},Td=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.nodes=[],n.edges=[],n.combos=[],n.comboEdges=[],n.comboPadding=10,n.comboTrees=[],n.updateCfg(e),n}return Ad(e,t),e.prototype.getDefaultCfg=function(){return{}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.center;if(e&&0!==e.length){if(1===e.length)return e[0].x=n[0],e[0].y=n[1],void(t.onLayoutEnd&&t.onLayoutEnd());t.initVals(),t.run(),t.onLayoutEnd&&t.onLayoutEnd()}else t.onLayoutEnd&&t.onLayoutEnd()},e.prototype.run=function(){var t,e=this,n=e.nodes,r=e.edges,o=e.combos,i=e.comboEdges,a=e.center,u={};n.forEach((function(t){u[t.id]=t}));var s={};o.forEach((function(t){s[t.id]=t}));var c=e.getInnerGraphs(u),f=[],l=[],d={},h=!0;this.comboTrees.forEach((function(t){var e=c[t.id],n=Id(Id({},t),{x:e.x||s[t.id].x,y:e.y||s[t.id].y,fx:e.fx||s[t.id].fx,fy:e.fy||s[t.id].fy,mass:e.mass||s[t.id].mass,size:e.size});l.push(n),isNaN(n.x)||0===n.x||isNaN(n.y)||0===n.y?(n.x=100*Math.random(),n.y=100*Math.random()):h=!1,f.push(t.id),m(t,(function(e){return e.id!==t.id&&(d[e.id]=t.id),!0}))})),n.forEach((function(t){if(!t.comboId||!s[t.comboId]){var e=Id({},t);l.push(e),isNaN(e.x)||0===e.x||isNaN(e.y)||0===e.y?(e.x=100*Math.random(),e.y=100*Math.random()):h=!1,f.push(t.id)}}));var p=[];if(r.concat(i).forEach((function(t){var e=d[t.source]||t.source,n=d[t.target]||t.target;e!==n&&f.includes(e)&&f.includes(n)&&p.push({source:e,target:n})})),null==l?void 0:l.length){if(1===l.length)l[0].x=a[0],l[0].y=a[1];else{var v={nodes:l,edges:p},g=this.outerLayout||new L({gravity:1,factor:4,linkDistance:function(t,e,n){var r,o,i=(((null===(r=e.size)||void 0===r?void 0:r[0])||30)+((null===(o=n.size)||void 0===o?void 0:o[0])||30))/2;return Math.min(1.5*i,700)}}),y=null===(t=g.getType)||void 0===t?void 0:t.call(g);g.updateCfg({center:a,kg:5,preventOverlap:!0,animate:!1}),h&&Ut[y]&&(l.length<100?new Uf:new D).layout(v),g.layout(v)}l.forEach((function(t){var e=c[t.id];if(e)e.visited=!0,e.x=t.x,e.y=t.y,e.nodes.forEach((function(e){e.x+=t.x,e.y+=t.y}));else{var n=u[t.id];n&&(n.x=t.x,n.y=t.y)}}))}for(var b=Object.keys(c),w=function(t){var e=b[t],n=c[e];if(!n)return"continue";n.nodes.forEach((function(t){n.visited||(t.x+=n.x||0,t.y+=n.y||0),u[t.id]&&(u[t.id].x=t.x,u[t.id].y=t.y)})),s[e]&&(s[e].x=n.x,s[e].y=n.y)},E=b.length-1;E>=0;E--)w(E);return{nodes:n,edges:r,combos:o,comboEdges:i}},e.prototype.getInnerGraphs=function(t){var e=this,n=e.comboTrees,r=e.nodeSize,a=e.edges,u=e.comboPadding,s=e.spacing,c={},f=this.innerLayout||new Ff({sortBy:"id"});return f.center=[0,0],f.preventOverlap=!0,f.nodeSpacing=s,(n||[]).forEach((function(e){m(e,(function(e){var n,s=(null==u?void 0:u(e))||10;if(o(s)&&(s=Math.max.apply(Math,s)),null===(n=e.children)||void 0===n?void 0:n.length){var l=e.children.map((function(e){if("combo"===e.itemType)return c[e.id];var n=t[e.id]||{};return Id(Id({},n),e)})),d=l.map((function(t){return t.id})),h={nodes:l,edges:a.filter((function(t){return d.includes(t.source)&&d.includes(t.target)}))},p=1/0;l.forEach((function(t){var e;t.size||(t.size=(null===(e=c[t.id])||void 0===e?void 0:e.size)||(null==r?void 0:r(t))||[30,30]),i(t.size)&&(t.size=[t.size,t.size]),p>t.size[0]&&(p=t.size[0]),p>t.size[1]&&(p=t.size[1])})),f.layout(h);var v=function(t){var e=1/0,n=1/0,r=-1/0,a=-1/0;return t.forEach((function(t){var u=t.size;o(u)?1===u.length&&(u=[u[0],u[0]]):i(u)?u=[u,u]:(void 0===u||isNaN(u))&&(u=[30,30]);var s=[u[0]/2,u[1]/2],c=t.x-s[0],f=t.x+s[0],l=t.y-s[1],d=t.y+s[1];e>c&&(e=c),n>l&&(n=l),r<f&&(r=f),a<d&&(a=d)})),{minX:e,minY:n,maxX:r,maxY:a}}(l),g=v.minX,m=v.minY,y=v.maxX,b=v.maxY,w={x:(y+g)/2,y:(b+m)/2};h.nodes.forEach((function(t){t.x-=w.x,t.y-=w.y}));var E=Math.max(y-g,b-m,p)+2*s;c[e.id]={id:e.id,nodes:l,size:[E,E]}}else if("combo"===e.itemType){var x=s?[2*s,2*s]:[30,30];c[e.id]={id:e.id,nodes:[],size:x}}return!0}))})),c},e.prototype.initVals=function(){var t,e,n=this,r=n.nodeSize,a=n.spacing;if(e=i(a)?function(){return a}:E(a)?a:function(){return 0},this.spacing=e,r)if(E(r))t=function(t){var n=r(t),i=e(t);return o(t.size)?((t.size[0]>t.size[1]?t.size[0]:t.size[1])+i)/2:((n||10)+i)/2};else if(o(r)){var u=(r[0]>r[1]?r[0]:r[1])/2;t=function(t){return u+e(t)/2}}else{var s=r/2;t=function(t){return s+e(t)/2}}else t=function(t){var n=e(t);return t.size?o(t.size)?((t.size[0]>t.size[1]?t.size[0]:t.size[1])+n)/2:f(t.size)?((t.size.width>t.size.height?t.size.width:t.size.height)+n)/2:(t.size+n)/2:10+n/2};this.nodeSize=t;var c,l=n.comboPadding;c=i(l)?function(){return l}:o(l)?function(){return Math.max.apply(null,l)}:E(l)?l:function(){return 0},this.comboPadding=c},e.prototype.getType=function(){return"comboCombined"},e}(t),Od=function(){function t(t){this.id=t.id||0,this.rx=t.rx,this.ry=t.ry,this.fx=0,this.fy=0,this.mass=t.mass,this.degree=t.degree,this.g=t.g||0}return t.prototype.distanceTo=function(t){var e=this.rx-t.rx,n=this.ry-t.ry;return Math.hypot(e,n)},t.prototype.setPos=function(t,e){this.rx=t,this.ry=e},t.prototype.resetForce=function(){this.fx=0,this.fy=0},t.prototype.addForce=function(t){var e=t.rx-this.rx,n=t.ry-this.ry,r=Math.hypot(e,n);r=r<1e-4?1e-4:r;var o=this.g*(this.degree+1)*(t.degree+1)/r;this.fx+=o*e/r,this.fy+=o*n/r},t.prototype.in=function(t){return t.contains(this.rx,this.ry)},t.prototype.add=function(e){var n=this.mass+e.mass;return new t({rx:(this.rx*this.mass+e.rx*e.mass)/n,ry:(this.ry*this.mass+e.ry*e.mass)/n,mass:n,degree:this.degree+e.degree})},t}();const Nd=Od;const Dd=function(){function t(t){this.xmid=t.xmid,this.ymid=t.ymid,this.length=t.length,this.massCenter=t.massCenter||[0,0],this.mass=t.mass||1}return t.prototype.getLength=function(){return this.length},t.prototype.contains=function(t,e){var n=this.length/2;return t<=this.xmid+n&&t>=this.xmid-n&&e<=this.ymid+n&&e>=this.ymid-n},t.prototype.NW=function(){return new t({xmid:this.xmid-this.length/4,ymid:this.ymid+this.length/4,length:this.length/2})},t.prototype.NE=function(){return new t({xmid:this.xmid+this.length/4,ymid:this.ymid+this.length/4,length:this.length/2})},t.prototype.SW=function(){return new t({xmid:this.xmid-this.length/4,ymid:this.ymid-this.length/4,length:this.length/2})},t.prototype.SE=function(){return new t({xmid:this.xmid+this.length/4,ymid:this.ymid-this.length/4,length:this.length/2})},t}();const Md=function(){function t(t){this.body=null,this.quad=null,this.NW=null,this.NE=null,this.SW=null,this.SE=null,this.theta=.5,null!=t&&(this.quad=t)}return t.prototype.insert=function(e){null!=this.body?this._isExternal()?(this.quad&&(this.NW=new t(this.quad.NW()),this.NE=new t(this.quad.NE()),this.SW=new t(this.quad.SW()),this.SE=new t(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)):this.body=e},t.prototype._putBody=function(t){this.quad&&(t.in(this.quad.NW())&&this.NW?this.NW.insert(t):t.in(this.quad.NE())&&this.NE?this.NE.insert(t):t.in(this.quad.SW())&&this.SW?this.SW.insert(t):t.in(this.quad.SE())&&this.SE&&this.SE.insert(t))},t.prototype._isExternal=function(){return null==this.NW&&null==this.NE&&null==this.SW&&null==this.SE},t.prototype.updateForce=function(t){null!=this.body&&t!==this.body&&(this._isExternal()||(this.quad?this.quad.getLength():0)/this.body.distanceTo(t)<this.theta?t.addForce(this.body):(this.NW&&this.NW.updateForce(t),this.NE&&this.NE.updateForce(t),this.SW&&this.SW.updateForce(t),this.SE&&this.SE.updateForce(t)))},t}();var kd=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Rd=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.width=300,n.height=300,n.nodes=[],n.edges=[],n.kr=5,n.kg=1,n.mode="normal",n.preventOverlap=!1,n.dissuadeHubs=!1,n.barnesHut=void 0,n.maxIteration=0,n.ks=.1,n.ksmax=10,n.tao=.1,n.onLayoutEnd=function(){},n.prune=void 0,n.updateCfg(e),n}return kd(e,t),e.prototype.getDefaultCfg=function(){return{}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.onLayoutEnd,r=t.prune,a=t.maxIteration;t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);for(var u=[],s=e.length,c=0;c<s;c+=1){var l=e[c],d=10,h=10;i(l.size)&&(d=l.size,h=l.size),o(l.size)?(isNaN(l.size[0])||(d=l.size[0]),isNaN(l.size[1])||(h=l.size[1])):f(l.size)&&(d=l.size.width,h=l.size.height),t.getWidth&&!isNaN(t.getWidth(l))&&(h=t.getWidth(l)),t.getHeight&&!isNaN(t.getHeight(l))&&(d=t.getHeight(l));var p=Math.max(d,h);u.push(p)}void 0===t.barnesHut&&s>250&&(t.barnesHut=!0),void 0===t.prune&&s>100&&(t.prune=!0),0!==this.maxIteration||t.prune?0===this.maxIteration&&r&&(a=100,s<=200&&s>100?a=500:s>200&&(a=950),this.maxIteration=a):(a=250,s<=200&&s>100?a=1e3:s>200&&(a=1200),this.maxIteration=a),t.kr||(t.kr=50,s>100&&s<=500?t.kr=20:s>500&&(t.kr=1)),t.kg||(t.kg=20,s>100&&s<=500?t.kg=10:s>500&&(t.kg=1)),this.nodes=t.updateNodesByForces(u),n()},e.prototype.updateNodesByForces=function(t){for(var e=this,n=e.edges,r=e.maxIteration,o=e.nodes,i=n.filter((function(t){return d(t,"source")!==d(t,"target")})),a=o.length,u=i.length,s=[],c={},f={},l=[],h=0;h<a;h+=1)c[o[h].id]=h,s[h]=0,(void 0===o[h].x||isNaN(o[h].x))&&(o[h].x=1e3*Math.random()),(void 0===o[h].y||isNaN(o[h].y))&&(o[h].y=1e3*Math.random()),l.push({x:o[h].x,y:o[h].y});for(h=0;h<u;h+=1){for(var p=void 0,v=void 0,g=0,m=0,y=0;y<a;y+=1){var b=d(i[h],"source"),w=d(i[h],"target");o[y].id===b?(p=o[y],g=y):o[y].id===w&&(v=o[y],m=y),f[h]={sourceIdx:g,targetIdx:m}}p&&(s[c[p.id]]+=1),v&&(s[c[v.id]]+=1)}var E=r;if(o=this.iterate(E,c,f,u,s,t),e.prune){for(y=0;y<u;y+=1)s[f[y].sourceIdx]<=1?(o[f[y].sourceIdx].x=o[f[y].targetIdx].x,o[f[y].sourceIdx].y=o[f[y].targetIdx].y):s[f[y].targetIdx]<=1&&(o[f[y].targetIdx].x=o[f[y].sourceIdx].x,o[f[y].targetIdx].y=o[f[y].sourceIdx].y);e.prune=!1,e.barnesHut=!1,E=100,o=this.iterate(E,c,f,u,s,t)}return o},e.prototype.iterate=function(t,e,n,r,o,i){for(var a=this,u=a.nodes,s=a.kr,c=a.preventOverlap,f=a.barnesHut,l=u.length,d=0,h=t,p=[],v=[],g=[],m=0;m<l;m+=1)if(p[2*m]=0,p[2*m+1]=0,f){var y={id:m,rx:u[m].x,ry:u[m].y,mass:1,g:s,degree:o[m]};g[m]=new Nd(y)}for(;h>0;){for(m=0;m<l;m+=1)v[2*m]=p[2*m],v[2*m+1]=p[2*m+1],p[2*m]=0,p[2*m+1]=0;p=this.getAttrForces(h,50,r,e,n,o,i,p),p=f&&(c&&h>50||!c)?this.getOptRepGraForces(p,g,o):this.getRepGraForces(h,50,p,100,i,o);var b=this.updatePos(p,v,d,o);u=b.nodes,d=b.sg,h--,a.tick&&a.tick()}return u},e.prototype.getAttrForces=function(t,e,n,r,o,i,a,u){for(var s=this,c=s.nodes,f=s.preventOverlap,l=s.dissuadeHubs,d=s.mode,h=s.prune,p=0;p<n;p+=1){var v=c[o[p].sourceIdx],g=o[p].sourceIdx,m=c[o[p].targetIdx],y=o[p].targetIdx;if(!h||!(i[g]<=1||i[y]<=1)){var b=[m.x-v.x,m.y-v.y],w=Math.hypot(b[0],b[1]);w=w<1e-4?1e-4:w,b[0]=b[0]/w,b[1]=b[1]/w,f&&t<e&&(w=w-a[g]-a[y]);var E=w,x=E;"linlog"===d&&(x=E=Math.log(1+w)),l&&(E=w/i[g],x=w/i[y]),f&&t<e&&w<=0?(E=0,x=0):f&&t<e&&w>0&&(E=w,x=w),u[2*r[v.id]]+=E*b[0],u[2*r[m.id]]-=x*b[0],u[2*r[v.id]+1]+=E*b[1],u[2*r[m.id]+1]-=x*b[1]}}return u},e.prototype.getRepGraForces=function(t,e,n,r,o,i){for(var a=this,u=a.nodes,s=a.preventOverlap,c=a.kr,f=a.kg,l=a.center,d=a.prune,h=u.length,p=0;p<h;p+=1){for(var v=p+1;v<h;v+=1)if(!d||!(i[p]<=1||i[v]<=1)){var g=[u[v].x-u[p].x,u[v].y-u[p].y],m=Math.hypot(g[0],g[1]);m=m<1e-4?1e-4:m,g[0]=g[0]/m,g[1]=g[1]/m,s&&t<e&&(m=m-o[p]-o[v]);var y=c*(i[p]+1)*(i[v]+1)/m;s&&t<e&&m<0?y=r*(i[p]+1)*(i[v]+1):s&&t<e&&0===m?y=0:s&&t<e&&m>0&&(y=c*(i[p]+1)*(i[v]+1)/m),n[2*p]-=y*g[0],n[2*v]+=y*g[0],n[2*p+1]-=y*g[1],n[2*v+1]+=y*g[1]}var b=[u[p].x-l[0],u[p].y-l[1]],w=Math.hypot(b[0],b[1]);b[0]=b[0]/w,b[1]=b[1]/w;var E=f*(i[p]+1);n[2*p]-=E*b[0],n[2*p+1]-=E*b[1]}return n},e.prototype.getOptRepGraForces=function(t,e,n){for(var r=this,o=r.nodes,i=r.kg,a=r.center,u=r.prune,s=o.length,c=9e10,f=-9e10,l=9e10,d=-9e10,h=0;h<s;h+=1)u&&n[h]<=1||(e[h].setPos(o[h].x,o[h].y),o[h].x>=f&&(f=o[h].x),o[h].x<=c&&(c=o[h].x),o[h].y>=d&&(d=o[h].y),o[h].y<=l&&(l=o[h].y));var p=Math.max(f-c,d-l),v=new Dd({xmid:(f+c)/2,ymid:(d+l)/2,length:p,massCenter:a,mass:s}),g=new Md(v);for(h=0;h<s;h+=1)u&&n[h]<=1||e[h].in(v)&&g.insert(e[h]);for(h=0;h<s;h+=1)if(!(u&&n[h]<=1)){e[h].resetForce(),g.updateForce(e[h]),t[2*h]-=e[h].fx,t[2*h+1]-=e[h].fy;var m=[o[h].x-a[0],o[h].y-a[1]],y=Math.hypot(m[0],m[1]);y=y<1e-4?1e-4:y,m[0]=m[0]/y,m[1]=m[1]/y;var b=i*(n[h]+1);t[2*h]-=b*m[0],t[2*h+1]-=b*m[1]}return t},e.prototype.updatePos=function(t,e,n,r){for(var o=this,a=o.nodes,u=o.ks,s=o.tao,c=o.prune,f=o.ksmax,l=a.length,d=[],h=[],p=0,v=0,g=0;g<l;g+=1)if(!(c&&r[g]<=1)){var m=[t[2*g]-e[2*g],t[2*g+1]-e[2*g+1]],y=Math.hypot(m[0],m[1]),b=[t[2*g]+e[2*g],t[2*g+1]+e[2*g+1]],w=Math.hypot(b[0],b[1]);d[g]=y,h[g]=w/2,p+=(r[g]+1)*d[g],v+=(r[g]+1)*h[g]}var E=n;for(n=s*v/p,0!==E&&(n=n>1.5*E?1.5*E:n),g=0;g<l;g+=1)if(!(c&&r[g]<=1||i(a[g].fx)&&i(a[g].fy))){var x=u*n/(1+n*Math.sqrt(d[g])),_=Math.hypot(t[2*g],t[2*g+1]),S=f/(_=_<1e-4?1e-4:_),A=(x=x>S?S:x)*t[2*g],I=x*t[2*g+1];a[g].x+=A,a[g].y+=I}return{nodes:a,sg:n}},e}(t),Cd=function(){return Cd=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Cd.apply(this,arguments)},Ld=function(){function t(){this.cells=[],this.columnNum=0,this.rowNum=0,this.additionColumn=[],this.additionRow=[]}return t.prototype.init=function(e,n,r){this.cells=[],this.CELL_W=r.CELL_W||t.DEFAULT_CELL_W,this.CELL_H=r.CELL_H||t.DEFAULT_CELL_H,this.columnNum=Math.ceil(e/this.CELL_W),this.rowNum=Math.ceil(n/this.CELL_H),t.MIN_DIST=Math.pow(e,2)+Math.pow(n,2);for(var o=0;o<this.columnNum;o++){for(var i=[],a=0;a<this.rowNum;a++){var u={dx:o,dy:a,x:o*this.CELL_W,y:a*this.CELL_H,occupied:!1};i.push(u)}this.cells.push(i)}},t.prototype.findGridByNodeId=function(t){for(var e,n,r=0;r<this.columnNum;r++)for(var o=0;o<this.rowNum;o++)if(this.cells[r][o].node&&(null===(n=null===(e=this.cells[r][o])||void 0===e?void 0:e.node)||void 0===n?void 0:n.id)===t)return{column:r,row:o};return null},t.prototype.sqdist=function(t,e){return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)},t.prototype.occupyNearest=function(e){for(var n,r=t.MIN_DIST,o=null,i=0;i<this.columnNum;i++)for(var a=0;a<this.rowNum;a++)!this.cells[i][a].occupied&&(n=this.sqdist(e,this.cells[i][a]))<r&&(r=n,o=this.cells[i][a]);return o&&(o.occupied=!0),o},t.prototype.insertColumn=function(t,e){if(!(e<=0)){for(var n=0;n<e;n++){this.cells[n+this.columnNum]=[];for(var r=0;r<this.rowNum;r++)this.cells[n+this.columnNum][r]={dx:n,dy:r,x:n*this.CELL_W,y:r*this.CELL_H,occupied:!1,node:null}}for(n=this.columnNum-1;n>t;n--)for(r=0;r<this.rowNum;r++)this.cells[n+e][r]=Cd(Cd({},this.cells[n][r]),{x:(n+e)*this.CELL_W,y:r*this.CELL_H}),this.cells[n][r]={x:n*this.CELL_W,y:r*this.CELL_H,occupied:!0,node:null};for(r=0;r<this.additionColumn.length;r++)this.additionColumn[r]>=t&&(this.additionColumn[r]+=e);for(n=0;n<e;n++)this.additionColumn.push(t+n+1);this.columnNum+=e}},t.prototype.insertRow=function(t,e){if(!(e<=0)){for(var n=0;n<e;n++)for(var r=0;r<this.columnNum;r++)this.cells[r][n+this.rowNum]={dx:r,dy:n,x:r*this.CELL_W,y:n*this.CELL_H,occupied:!1,node:null};for(r=0;r<this.columnNum;r++)for(n=this.rowNum-1;n>t;n--)this.cells[r][n+e]=Cd(Cd({},this.cells[r][n]),{dx:r,dy:n+e,x:r*this.CELL_W,y:(n+e)*this.CELL_H}),this.cells[r][n]={dx:r,dy:n,x:r*this.CELL_W,y:n*this.CELL_H,occupied:!1,node:null};for(n=0;n<this.additionRow.length;n++)this.additionRow[n]>=t&&(this.additionRow[n]+=e);for(r=0;r<e;r++)this.additionRow.push(t+r+1);this.rowNum+=e}},t.prototype.getNodes=function(){for(var t=[],e=0;e<this.columnNum;e++)for(var n=0;n<this.rowNum;n++)this.cells[e][n].node&&t.push(this.cells[e][n]);return t},t.MIN_DIST=50,t.DEFAULT_CELL_W=80,t.DEFAULT_CELL_H=80,t}();const Pd=Ld;var jd=1200,zd=800,Fd=1e7,Gd=10,Ud=3.141592653589793,Bd=1.5707963267948966,Vd=.375*Ud,Wd=.625*Ud,Xd=new Map,Hd=.8;function qd(t,e){var n=(Xd.get(t.id)||[]).find((function(t){return t.source===e.id||t.target===e.id})),r=t.size[0]*t.size[1],o=e.size[0]*e.size[1],i=r>o?e:t,a=r>o?t:e,u=i.x-i.size[0]/2,s=i.y-i.size[1]/2,c=i.x+i.size[0]/2,f=i.y+i.size[1]/2,l=a.x-a.size[0]/2,d=a.y-a.size[1]/2,h=a.x+a.size[0]/2,p=a.y+a.size[1]/2,v=i.x,g=i.y,m=a.x,y=a.y,b=0,w=0;if(c>=l&&h>=u&&f>=d&&p>=s)0===(w=Math.sqrt(Math.pow(m-v,2)+Math.pow(y-g,2)))&&(w=1e-7),b=1*Gd/w*100+((c<h?c:h)-(u>l?u:l))*((f<p?f:p)-(s>d?s:d)),b*=Fd;else{var E=!1,x=function(t,e,n){var r=t.x-t.size[0]/2,o=t.y-t.size[1]/2,i=t.x+t.size[0]/2,a=t.y+t.size[1]/2,u=e.x-e.size[0]/2,s=e.y-e.size[1]/2,c=e.x+e.size[0]/2,f=e.y+e.size[1]/2,l=t.x,d=t.y,h=e.x,p=e.y,v=h-l,g=Math.atan2(v,p-d),m=0,y=0,b=0,w=0;g>Bd?(y=o-f,m=u-i,b=parseFloat(y?(y/Math.cos(g)).toFixed(2):m.toFixed(2)),w=parseFloat(m?(m/Math.sin(g)).toFixed(2):y.toFixed(2))):b=w=0<g&&g<=Bd?(y=s-a)>(m=u-i)?parseFloat(y?(y/Math.cos(g)).toFixed(2):m.toFixed(2)):parseFloat(m?(m/Math.sin(g)).toFixed(2):y.toFixed(2)):g<-Bd?(y=o-f)>(m=-(c-r))?parseFloat(y?(y/Math.cos(g)).toFixed(2):m.toFixed(2)):parseFloat(m?(m/Math.sin(g)).toFixed(2):y.toFixed(2)):(y=s-a)>(m=Math.abs(v)>(i-r)/2?r-c:v)?parseFloat(y?(y/Math.cos(g)).toFixed(2):m.toFixed(2)):parseFloat(m&&0!==g?(m/Math.sin(g)).toFixed(2):y.toFixed(2));var E=parseFloat(g.toFixed(2)),x=n;return n&&(x=Vd<E&&E<Wd),{distance:Math.abs(b<w?b:w),isHoriz:x}}(i,a,E);w=x.distance,E=x.isHoriz,w<=Gd?b+=0!==w?n?Gd+1*Fd/w:Gd+Fd*Gd/w:Fd:(b+=w,n&&(b+=w*w))}return b}function Yd(t){for(var e=0,n=0;n<t.length;n++){var r=t[n];(r.x<0||r.y<0||r.x>jd||r.y>zd)&&(e+=1e12);for(var o=n+1;o<t.length;o++)e+=qd(r,t[o])}return e}function Kd(t,e,n,r){var o=new Map;n.forEach((function(t,e){o.set(t.id,t)}));var i=r.filter((function(e){return e.source===t.id||e.target===t.id}))||[],a=[];i.forEach((function(e){var n=e.source===t.id?e.target:e.source,r=o.get(n);r&&a.push(r)}));for(var u=!0,s=0;s<a.length;s++){var c=a[s],f=180*Math.atan((t.y-c.y)/(c.x-t.y)),l=180*Math.atan((e.y-c.y)/(c.x-e.y)),d=f>70&&f<110,h=l>70&&l<110;if((f<30||f>150)&&!(l<30||l>150)||f*l<0){u=!1;break}if(d&&!h||f*l<0){u=!1;break}if((c.x-t.x)*(c.x-e.x)<0){u=!1;break}if((c.y-t.y)*(c.y-e.y)<0){u=!1;break}}return u}function Zd(t,e){for(var n=!1,r=[10,-10,0,0],o=[0,0,10,-10],i=0;i<t.length;++i)for(var a=t[i],u=$d(a,t),s=0;s<r.length;s++)if(Kd(a,{x:a.x+r[s],y:a.y+o[s]},t,e)){a.x+=r[s],a.y+=o[s];var c=$d(a,t),f=Math.random();c<u||f<Hd&&f>.1?(u=c,n=!0):(a.x-=r[s],a.y-=o[s])}return Hd>.1&&(Hd*=.5),n?Yd(t):0}function $d(t,e){var n=0;(t.x<0||t.y<0||t.x+t.size[0]+20>jd||t.y+t.size[1]+20>zd)&&(n+=1e12);for(var r=0;r<e.length;++r)t.id!==e[r].id&&(n+=qd(t,e[r]));return n}var Qd=function(){return Qd=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Qd.apply(this,arguments)};function Jd(t,e){var n=t.nodes,r=t.edges,o=e.width,i=e.height;if(!(null==n?void 0:n.length))return Promise.resolve();var a=[];n.forEach((function(t){if(r.filter((function(e){return e.source===t.id||e.target===t.id})).length>1){var e=Qd({},t);delete e.size,a.push(e)}}));var u=[];r.forEach((function(t){var e=a.find((function(e){return e.id===t.source})),n=a.find((function(e){return e.id===t.target}));e&&n&&u.push(t)}));var s=new dr({type:"dagre",ranksep:e.nodeMinGap,nodesep:e.nodeMinGap}).layout({nodes:a,edges:u}).nodes;n.forEach((function(t){var e=(s||[]).find((function(e){return e.id===t.id}));t.x=(null==e?void 0:e.x)||o/2,t.y=(null==e?void 0:e.y)||i/2}));var c=JSON.parse(JSON.stringify(n)),f=JSON.parse(JSON.stringify(r)),l=Nt().nodes(c).force("link",Ct(f).id((function(t){return t.id})).distance((function(t){return u.find((function(e){return e.source===t.source&&e.target===t.target}))?30:20}))).force("charge",Dt()).force("center",Mt(o/2,i/2)).force("x",zt(o/2)).force("y",Ft(i/2)).alpha(.3).alphaDecay(.08).alphaMin(.001),d=new Promise((function(t){l.on("end",(function(){n.forEach((function(t){var e=c.find((function(e){return e.id===t.id}));e&&(t.x=e.x,t.y=e.y)}));var a=Math.min.apply(Math,n.map((function(t){return t.x}))),u=Math.max.apply(Math,n.map((function(t){return t.x}))),s=Math.min.apply(Math,n.map((function(t){return t.y}))),f=Math.max.apply(Math,n.map((function(t){return t.y}))),l=o/(u-a),d=i/(f-s);n.forEach((function(t){void 0!==t.x&&l<1&&(t.x=(t.x-a)*l),void 0!==t.y&&d<1&&(t.y=(t.y-s)*d)})),n.forEach((function(t){t.sizeTemp=t.size,t.size=[10,10]})),function(t,e){if(0===t.length)return{nodes:t,edges:e};t.forEach((function(t){var n=e.filter((function(e){return e.source===t.id||e.target===t.id}));Xd.set(t,n)})),t.sort((function(t,e){var n,r;return(null===(n=Xd.get(t.id))||void 0===n?void 0:n.length)-(null===(r=Xd.get(e.id))||void 0===r?void 0:r.length)}));for(var n=Yd(t),r=20,o=1,i=0,a=0;r>0&&!(++a>=50);){var u=Zd(t,e);0!==u&&(i=u),o=i-n,n=i,0===o?--r:r=20}t.forEach((function(t){t.x=t.x-t.size[0]/2,t.y=t.y-t.size[1]/2}))}(n,r),n.forEach((function(t){t.size=t.sizeTemp||[],delete t.sizeTemp})),function(t,e){if(!t.nodes||0===t.nodes.length)return t;var n=e.width,r=e.height,o=e.nodeMinGap,i=1e4,a=1e4;t.nodes.forEach((function(t){var e=t.size[0]||50,n=t.size[1]||50;i=Math.min(e,i),a=Math.min(n,a)}));var u=new Pd;u.init(n,r,{CELL_H:a,CELL_W:i}),t.nodes.forEach((function(t){var e=u.occupyNearest(t);e&&(e.node={id:t.id,size:t.size},t.x=e.x,t.y=e.y,t.dx=e.dx,t.dy=e.dy)}));for(var s=0;s<t.nodes.length;s++){var c=t.nodes[s],f=u.findGridByNodeId(c.id);if(!f)throw new Error("can not find node cell");var l=f.column,d=f.row;if(c.size[0]+o>i){for(var h=v=Math.ceil((c.size[0]+o)/i)-1,p=0;p<v&&u.additionColumn.indexOf(l+p+1)>-1&&!u.cells[l+p+1][d].node;p++)h--;u.insertColumn(l,h)}if(c.size[1]+o>a){var v;for(h=v=Math.ceil((c.size[1]+o)/a)-1,p=0;p<v&&u.additionRow.indexOf(d+p+1)>-1&&!u.cells[l][d+p+1].node;p++)h--;u.insertRow(d,h)}}for(s=0;s<u.columnNum;s++){var g=function(e){var n=u.cells[s][e];if(n.node){var r=t.nodes.find((function(t){var e;return t.id===(null===(e=null==n?void 0:n.node)||void 0===e?void 0:e.id)}));r&&(r.x=n.x+r.size[0]/2,r.y=n.y+r.size[1]/2)}};for(p=0;p<u.rowNum;p++)g(p)}}({nodes:n,edges:r},e),t()}))}));return d}var th=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),eh=function(t){function e(e){var n=t.call(this)||this;return n.width=300,n.height=300,n.nodeMinGap=50,n.onLayoutEnd=function(){},e&&n.updateCfg(e),n}return th(e,t),e.prototype.getDefaultCfg=function(){return{width:300,height:300,nodeMinGap:50}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.edges;return null==e||e.forEach((function(t){t.size||(t.size=[50,50])})),Jd({nodes:e,edges:n},{width:this.width,height:this.height,nodeMinGap:this.nodeMinGap}).then((function(){t.onLayoutEnd&&t.onLayoutEnd()}))},e.prototype.getType=function(){return"er"},e}(t),nh=function(){function t(t){var e=O(t.type);this.layoutInstance=new e(t)}return t.prototype.layout=function(t){return this.layoutInstance.layout(t)},t.prototype.updateCfg=function(t){this.layoutInstance.updateCfg(t)},t.prototype.init=function(t){this.correctLayers(t.nodes),this.layoutInstance.init(t)},t.prototype.correctLayers=function(t){if(null==t?void 0:t.length){var n=1/0,r=[];if(t.forEach((function(t){e(t.layer)&&(t.layer=parseInt(t.layer,10)),void 0===t.layer||isNaN(t.layer)||(r.push(t),t.layer<n&&(n=t.layer))})),n<=0){var o=Math.abs(n)+1;r.forEach((function(t){return t.layer+=o}))}}},t.prototype.execute=function(){this.layoutInstance.execute()},t.prototype.getDefaultCfg=function(){return this.layoutInstance.getDefaultCfg()},t.prototype.destroy=function(){return this.layoutInstance.destroy()},t}(),rh={force:Vt,fruchterman:Vf,forceAtlas2:Rd,gForce:L,force2:K,dagre:dr,dagreCompound:sf,circular:qt,radial:jf,concentric:Ff,grid:D,mds:Uf,comboForce:Sd,comboCombined:Td,random:k,"gForce-gpu":xd,"fruchterman-gpu":yd,er:eh}})(),r})()));
3
3
  //# sourceMappingURL=layout.min.js.map