@antv/layout 0.3.15 → 0.3.17-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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={1983:(t,e,n)=>{"use strict";n(6266),n(990),n(911),n(4160),n(6197),n(6728),n(4039),n(3568),n(8051),n(8250),n(5434),n(4952),n(6337),n(5666)},6266:(t,e,n)=>{n(5767),n(8132),n(8388),n(7470),n(4882),n(1520),n(7476),n(9622),n(9375),n(3533),n(4672),n(4157),n(5095),n(9892),n(5115),n(9176),n(8838),n(6253),n(9730),n(6059),n(8377),n(1084),n(4299),n(1246),n(726),n(1901),n(5972),n(3403),n(2516),n(9371),n(6479),n(1736),n(1889),n(5177),n(6943),n(6503),n(6786),n(932),n(7526),n(1591),n(9073),n(347),n(579),n(4669),n(7710),n(5789),n(3514),n(9978),n(8472),n(6946),n(5068),n(413),n(191),n(8306),n(4564),n(9115),n(9539),n(6620),n(2850),n(823),n(7732),n(856),n(703),n(1539),n(5292),n(6629),n(3694),n(7648),n(7795),n(4531),n(3605),n(6780),n(9937),n(511),n(1822),n(9977),n(1031),n(6331),n(1560),n(774),n(522),n(8295),n(7842),n(110),n(75),n(4336),n(1802),n(8837),n(6773),n(5745),n(3057),n(3750),n(3369),n(9564),n(2e3),n(8977),n(2310),n(4899),n(1842),n(6997),n(3946),n(8269),n(6108),n(6774),n(1466),n(9357),n(6142),n(1876),n(851),n(8416),n(8184),n(147),n(9192),n(142),n(1786),n(5368),n(6964),n(2152),n(4821),n(9103),n(1303),n(3318),n(162),n(3834),n(1572),n(2139),n(685),n(5535),n(7347),n(3049),n(6633),n(8989),n(8270),n(4510),n(3984),n(5769),n(55),n(6014),t.exports=n(5645)},911:(t,e,n)=>{n(1268),t.exports=n(5645).Array.flatMap},990:(t,e,n)=>{n(2773),t.exports=n(5645).Array.includes},5434:(t,e,n)=>{n(3276),t.exports=n(5645).Object.entries},8051:(t,e,n)=>{n(8351),t.exports=n(5645).Object.getOwnPropertyDescriptors},8250:(t,e,n)=>{n(6409),t.exports=n(5645).Object.values},4952:(t,e,n)=>{"use strict";n(851),n(9865),t.exports=n(5645).Promise.finally},6197:(t,e,n)=>{n(2770),t.exports=n(5645).String.padEnd},4160:(t,e,n)=>{n(1784),t.exports=n(5645).String.padStart},4039:(t,e,n)=>{n(4325),t.exports=n(5645).String.trimRight},6728:(t,e,n)=>{n(5869),t.exports=n(5645).String.trimLeft},3568:(t,e,n)=>{n(9665),t.exports=n(8787).f("asyncIterator")},115:(t,e,n)=>{n(4579),t.exports=n(1327).global},5663:t=>{t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},2159:(t,e,n)=>{var r=n(6727);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},1327:t=>{var e=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=e)},9216:(t,e,n)=>{var r=n(5663);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)}}},9666:(t,e,n)=>{t.exports=!n(7929)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},7467:(t,e,n)=>{var r=n(6727),o=n(3938).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},3856:(t,e,n)=>{var r=n(3938),o=n(1327),i=n(9216),a=n(1818),u=n(7069),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},7929:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},3938: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)},7069:t=>{var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},1818:(t,e,n)=>{var r=n(4743),o=n(3101);t.exports=n(9666)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},3758:(t,e,n)=>{t.exports=!n(9666)&&!n(7929)((function(){return 7!=Object.defineProperty(n(7467)("div"),"a",{get:function(){return 7}}).a}))},6727:t=>{t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},4743:(t,e,n)=>{var r=n(2159),o=n(3758),i=n(3206),a=Object.defineProperty;e.f=n(9666)?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}},3101:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},3206:(t,e,n)=>{var r=n(6727);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")}},4579:(t,e,n)=>{var r=n(3856);r(r.G,{global:n(3938)})},4963:t=>{t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},3365:(t,e,n)=>{var r=n(2032);t.exports=function(t,e){if("number"!=typeof t&&"Number"!=r(t))throw TypeError(e);return+t}},7722:(t,e,n)=>{var r=n(6314)("unscopables"),o=Array.prototype;null==o[r]&&n(7728)(o,r,{}),t.exports=function(t){o[r][t]=!0}},6793:(t,e,n)=>{"use strict";var r=n(4496)(!0);t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},3328: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}},7007:(t,e,n)=>{var r=n(5286);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},5216:(t,e,n)=>{"use strict";var r=n(508),o=n(2337),i=n(875);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}},6852:(t,e,n)=>{"use strict";var r=n(508),o=n(2337),i=n(875);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}},9315:(t,e,n)=>{var r=n(2110),o=n(875),i=n(2337);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}}},50:(t,e,n)=>{var r=n(741),o=n(9797),i=n(508),a=n(875),u=n(6886);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}}},7628:(t,e,n)=>{var r=n(4963),o=n(508),i=n(9797),a=n(875);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}},2736:(t,e,n)=>{var r=n(5286),o=n(4302),i=n(6314)("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}},6886:(t,e,n)=>{var r=n(2736);t.exports=function(t,e){return new(r(t))(e)}},4398:(t,e,n)=>{"use strict";var r=n(4963),o=n(5286),i=n(7242),a=[].slice,u={},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)};t.exports=Function.bind||function(t){var e=r(this),n=a.call(arguments,1),u=function(){var r=n.concat(a.call(arguments));return this instanceof u?s(e,r.length,r):i(e,r,t)};return o(e.prototype)&&(u.prototype=e.prototype),u}},1488:(t,e,n)=>{var r=n(2032),o=n(6314)("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}},2032:t=>{var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},9824:(t,e,n)=>{"use strict";var r=n(9275).f,o=n(2503),i=n(4408),a=n(741),u=n(3328),s=n(3531),c=n(2923),f=n(5436),l=n(2974),d=n(7057),h=n(4728).fastKey,p=n(1616),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)}}},3657:(t,e,n)=>{"use strict";var r=n(4408),o=n(4728).getWeak,i=n(7007),a=n(5286),u=n(3328),s=n(3531),c=n(50),f=n(9181),l=n(1616),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}},5795:(t,e,n)=>{"use strict";var r=n(3816),o=n(2985),i=n(7234),a=n(4408),u=n(4728),s=n(3531),c=n(3328),f=n(5286),l=n(4253),d=n(7462),h=n(2943),p=n(266);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}},5645:t=>{var e=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=e)},2811:(t,e,n)=>{"use strict";var r=n(9275),o=n(681);t.exports=function(t,e,n){e in t?r.f(t,e,o(0,n)):t[e]=n}},741:(t,e,n)=>{var r=n(4963);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)}}},3537:(t,e,n)=>{"use strict";var r=n(4253),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},870:(t,e,n)=>{"use strict";var r=n(7007),o=n(1689),i="number";t.exports=function(t){if("string"!==t&&t!==i&&"default"!==t)throw TypeError("Incorrect hint");return o(r(this),t!=i)}},1355:t=>{t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},7057:(t,e,n)=>{t.exports=!n(4253)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},2457:(t,e,n)=>{var r=n(5286),o=n(3816).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},4430:t=>{t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},5541:(t,e,n)=>{var r=n(7184),o=n(4548),i=n(4682);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}},2985:(t,e,n)=>{var r=n(3816),o=n(5645),i=n(7728),a=n(7234),u=n(741),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},8852:(t,e,n)=>{var r=n(6314)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,!"/./"[t](e)}catch(t){}}return!0}},4253:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},8082:(t,e,n)=>{"use strict";n(8269);var r=n(7234),o=n(7728),i=n(4253),a=n(1355),u=n(6314),s=n(1165),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)})}}},3218:(t,e,n)=>{"use strict";var r=n(7007);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}},3325:(t,e,n)=>{"use strict";var r=n(4302),o=n(5286),i=n(875),a=n(741),u=n(6314)("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}},3531:(t,e,n)=>{var r=n(741),o=n(8851),i=n(6555),a=n(7007),u=n(875),s=n(9002),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},18:(t,e,n)=>{t.exports=n(3825)("native-function-to-string",Function.toString)},3816: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)},9181:t=>{var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},7728:(t,e,n)=>{var r=n(9275),o=n(681);t.exports=n(7057)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},639:(t,e,n)=>{var r=n(3816).document;t.exports=r&&r.documentElement},1734:(t,e,n)=>{t.exports=!n(7057)&&!n(4253)((function(){return 7!=Object.defineProperty(n(2457)("div"),"a",{get:function(){return 7}}).a}))},266:(t,e,n)=>{var r=n(5286),o=n(7375).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}},7242: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)}},9797:(t,e,n)=>{var r=n(2032);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},6555:(t,e,n)=>{var r=n(2803),o=n(6314)("iterator"),i=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||i[o]===t)}},4302:(t,e,n)=>{var r=n(2032);t.exports=Array.isArray||function(t){return"Array"==r(t)}},8367:(t,e,n)=>{var r=n(5286),o=Math.floor;t.exports=function(t){return!r(t)&&isFinite(t)&&o(t)===t}},5286:t=>{t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},5364:(t,e,n)=>{var r=n(5286),o=n(2032),i=n(6314)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[i])?!!e:"RegExp"==o(t))}},8851:(t,e,n)=>{var r=n(7007);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}}},9988:(t,e,n)=>{"use strict";var r=n(2503),o=n(681),i=n(2943),a={};n(7728)(a,n(6314)("iterator"),(function(){return this})),t.exports=function(t,e,n){t.prototype=r(a,{next:o(1,n)}),i(t,e+" Iterator")}},2923:(t,e,n)=>{"use strict";var r=n(4461),o=n(2985),i=n(7234),a=n(7728),u=n(2803),s=n(9988),c=n(2943),f=n(468),l=n(6314)("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}},7462:(t,e,n)=>{var r=n(6314)("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}},5436:t=>{t.exports=function(t,e){return{value:e,done:!!t}}},2803:t=>{t.exports={}},4461:t=>{t.exports=!1},3086: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},4934:(t,e,n)=>{var r=n(1801),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}},6206:t=>{t.exports=Math.log1p||function(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},1801:t=>{t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},4728:(t,e,n)=>{var r=n(3953)("meta"),o=n(5286),i=n(9181),a=n(9275).f,u=0,s=Object.isExtensible||function(){return!0},c=!n(4253)((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}}},4351:(t,e,n)=>{var r=n(3816),o=n(4193).set,i=r.MutationObserver||r.WebKitMutationObserver,a=r.process,u=r.Promise,s="process"==n(2032)(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}}},3499:(t,e,n)=>{"use strict";var r=n(4963);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)}},5345:(t,e,n)=>{"use strict";var r=n(7057),o=n(7184),i=n(4548),a=n(4682),u=n(508),s=n(9797),c=Object.assign;t.exports=!c||n(4253)((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},2503:(t,e,n)=>{var r=n(7007),o=n(5588),i=n(4430),a=n(9335)("IE_PROTO"),u=function(){},s="prototype",c=function(){var t,e=n(2457)("iframe"),r=i.length;for(e.style.display="none",n(639).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)}},9275:(t,e,n)=>{var r=n(7007),o=n(1734),i=n(1689),a=Object.defineProperty;e.f=n(7057)?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}},5588:(t,e,n)=>{var r=n(9275),o=n(7007),i=n(7184);t.exports=n(7057)?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}},8693:(t,e,n)=>{var r=n(4682),o=n(681),i=n(2110),a=n(1689),u=n(9181),s=n(1734),c=Object.getOwnPropertyDescriptor;e.f=n(7057)?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])}},9327:(t,e,n)=>{var r=n(2110),o=n(616).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))}},616:(t,e,n)=>{var r=n(189),o=n(4430).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},4548:(t,e)=>{e.f=Object.getOwnPropertySymbols},468:(t,e,n)=>{var r=n(9181),o=n(508),i=n(9335)("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}},189:(t,e,n)=>{var r=n(9181),o=n(2110),i=n(9315)(!1),a=n(9335)("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}},7184:(t,e,n)=>{var r=n(189),o=n(4430);t.exports=Object.keys||function(t){return r(t,o)}},4682:(t,e)=>{e.f={}.propertyIsEnumerable},3160:(t,e,n)=>{var r=n(2985),o=n(5645),i=n(4253);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)}},1131:(t,e,n)=>{var r=n(7057),o=n(7184),i=n(2110),a=n(4682).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}}},7643:(t,e,n)=>{var r=n(616),o=n(4548),i=n(7007),a=n(3816).Reflect;t.exports=a&&a.ownKeys||function(t){var e=r.f(i(t)),n=o.f;return n?e.concat(n(t)):e}},7743:(t,e,n)=>{var r=n(3816).parseFloat,o=n(9599).trim;t.exports=1/r(n(4644)+"-0")!=-1/0?function(t){var e=o(String(t),3),n=r(e);return 0===n&&"-"==e.charAt(0)?-0:n}:r},5960:(t,e,n)=>{var r=n(3816).parseInt,o=n(9599).trim,i=n(4644),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},188:t=>{t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},94:(t,e,n)=>{var r=n(7007),o=n(5286),i=n(3499);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}},681:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},4408:(t,e,n)=>{var r=n(7234);t.exports=function(t,e,n){for(var o in e)r(t,o,e[o],n);return t}},7234:(t,e,n)=>{var r=n(3816),o=n(7728),i=n(9181),a=n(3953)("src"),u=n(18),s="toString",c=(""+u).split(s);n(5645).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)}))},7787:(t,e,n)=>{"use strict";var r=n(1488),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)}},1165:(t,e,n)=>{"use strict";var r,o,i=n(3218),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},7195:t=>{t.exports=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}},7375:(t,e,n)=>{var r=n(5286),o=n(7007),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(741)(Function.call,n(8693).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}},2974:(t,e,n)=>{"use strict";var r=n(3816),o=n(9275),i=n(7057),a=n(6314)("species");t.exports=function(t){var e=r[t];i&&e&&!e[a]&&o.f(e,a,{configurable:!0,get:function(){return this}})}},2943:(t,e,n)=>{var r=n(9275).f,o=n(9181),i=n(6314)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},9335:(t,e,n)=>{var r=n(3825)("keys"),o=n(3953);t.exports=function(t){return r[t]||(r[t]=o(t))}},3825:(t,e,n)=>{var r=n(5645),o=n(3816),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(4461)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},8364:(t,e,n)=>{var r=n(7007),o=n(4963),i=n(6314)("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||null==(n=r(a)[i])?e:o(n)}},7717:(t,e,n)=>{"use strict";var r=n(4253);t.exports=function(t,e){return!!t&&r((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},4496:(t,e,n)=>{var r=n(1467),o=n(1355);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}}},2094:(t,e,n)=>{var r=n(5364),o=n(1355);t.exports=function(t,e,n){if(r(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(o(t))}},9395:(t,e,n)=>{var r=n(2985),o=n(4253),i=n(1355),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)}},5442:(t,e,n)=>{var r=n(875),o=n(8595),i=n(1355);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}},8595:(t,e,n)=>{"use strict";var r=n(1467),o=n(1355);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}},9599:(t,e,n)=>{var r=n(2985),o=n(1355),i=n(4253),a=n(4644),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},4644:t=>{t.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},4193:(t,e,n)=>{var r,o,i,a=n(741),u=n(7242),s=n(639),c=n(2457),f=n(3816),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(2032)(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}},2337:(t,e,n)=>{var r=n(1467),o=Math.max,i=Math.min;t.exports=function(t,e){return(t=r(t))<0?o(t+e,0):i(t,e)}},4843:(t,e,n)=>{var r=n(1467),o=n(875);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}},1467:t=>{var e=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:e)(t)}},2110:(t,e,n)=>{var r=n(9797),o=n(1355);t.exports=function(t){return r(o(t))}},875:(t,e,n)=>{var r=n(1467),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},508:(t,e,n)=>{var r=n(1355);t.exports=function(t){return Object(r(t))}},1689:(t,e,n)=>{var r=n(5286);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")}},8440:(t,e,n)=>{"use strict";if(n(7057)){var r=n(4461),o=n(3816),i=n(4253),a=n(2985),u=n(9383),s=n(1125),c=n(741),f=n(3328),l=n(681),d=n(7728),h=n(4408),p=n(1467),v=n(875),g=n(4843),m=n(2337),y=n(1689),b=n(9181),w=n(1488),E=n(5286),x=n(508),_=n(6555),S=n(2503),A=n(468),I=n(616).f,T=n(9002),O=n(3953),N=n(6314),D=n(50),M=n(9315),k=n(8364),R=n(6997),C=n(2803),L=n(7462),P=n(2974),j=n(6852),z=n(5216),F=n(9275),G=n(8693),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(){}},1125:(t,e,n)=>{"use strict";var r=n(3816),o=n(7057),i=n(4461),a=n(9383),u=n(7728),s=n(4408),c=n(4253),f=n(3328),l=n(1467),d=n(875),h=n(4843),p=n(616).f,v=n(9275).f,g=n(6852),m=n(2943),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]=_},9383:(t,e,n)=>{for(var r,o=n(3816),i=n(7728),a=n(3953),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}},3953:t=>{var e=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+n).toString(36))}},575:(t,e,n)=>{var r=n(3816).navigator;t.exports=r&&r.userAgent||""},1616:(t,e,n)=>{var r=n(5286);t.exports=function(t,e){if(!r(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t}},6074:(t,e,n)=>{var r=n(3816),o=n(5645),i=n(4461),a=n(8787),u=n(9275).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)})}},8787:(t,e,n)=>{e.f=n(6314)},6314:(t,e,n)=>{var r=n(3825)("wks"),o=n(3953),i=n(3816).Symbol,a="function"==typeof i;(t.exports=function(t){return r[t]||(r[t]=a&&i[t]||(a?i:o)("Symbol."+t))}).store=r},9002:(t,e,n)=>{var r=n(1488),o=n(6314)("iterator"),i=n(2803);t.exports=n(5645).getIteratorMethod=function(t){if(null!=t)return t[o]||t["@@iterator"]||i[r(t)]}},2e3:(t,e,n)=>{var r=n(2985);r(r.P,"Array",{copyWithin:n(5216)}),n(7722)("copyWithin")},5745:(t,e,n)=>{"use strict";var r=n(2985),o=n(50)(4);r(r.P+r.F*!n(7717)([].every,!0),"Array",{every:function(t){return o(this,t,arguments[1])}})},8977:(t,e,n)=>{var r=n(2985);r(r.P,"Array",{fill:n(6852)}),n(7722)("fill")},8837:(t,e,n)=>{"use strict";var r=n(2985),o=n(50)(2);r(r.P+r.F*!n(7717)([].filter,!0),"Array",{filter:function(t){return o(this,t,arguments[1])}})},4899:(t,e,n)=>{"use strict";var r=n(2985),o=n(50)(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(7722)(i)},2310:(t,e,n)=>{"use strict";var r=n(2985),o=n(50)(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(7722)(i)},4336:(t,e,n)=>{"use strict";var r=n(2985),o=n(50)(0),i=n(7717)([].forEach,!0);r(r.P+r.F*!i,"Array",{forEach:function(t){return o(this,t,arguments[1])}})},522:(t,e,n)=>{"use strict";var r=n(741),o=n(2985),i=n(508),a=n(8851),u=n(6555),s=n(875),c=n(2811),f=n(9002);o(o.S+o.F*!n(7462)((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}})},3369:(t,e,n)=>{"use strict";var r=n(2985),o=n(9315)(!1),i=[].indexOf,a=!!i&&1/[1].indexOf(1,-0)<0;r(r.P+r.F*(a||!n(7717)(i)),"Array",{indexOf:function(t){return a?i.apply(this,arguments)||0:o(this,t,arguments[1])}})},774:(t,e,n)=>{var r=n(2985);r(r.S,"Array",{isArray:n(4302)})},6997:(t,e,n)=>{"use strict";var r=n(7722),o=n(5436),i=n(2803),a=n(2110);t.exports=n(2923)(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")},7842:(t,e,n)=>{"use strict";var r=n(2985),o=n(2110),i=[].join;r(r.P+r.F*(n(9797)!=Object||!n(7717)(i)),"Array",{join:function(t){return i.call(o(this),void 0===t?",":t)}})},9564:(t,e,n)=>{"use strict";var r=n(2985),o=n(2110),i=n(1467),a=n(875),u=[].lastIndexOf,s=!!u&&1/[1].lastIndexOf(1,-0)<0;r(r.P+r.F*(s||!n(7717)(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}})},1802:(t,e,n)=>{"use strict";var r=n(2985),o=n(50)(1);r(r.P+r.F*!n(7717)([].map,!0),"Array",{map:function(t){return o(this,t,arguments[1])}})},8295:(t,e,n)=>{"use strict";var r=n(2985),o=n(2811);r(r.S+r.F*n(4253)((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}})},3750:(t,e,n)=>{"use strict";var r=n(2985),o=n(7628);r(r.P+r.F*!n(7717)([].reduceRight,!0),"Array",{reduceRight:function(t){return o(this,t,arguments.length,arguments[1],!0)}})},3057:(t,e,n)=>{"use strict";var r=n(2985),o=n(7628);r(r.P+r.F*!n(7717)([].reduce,!0),"Array",{reduce:function(t){return o(this,t,arguments.length,arguments[1],!1)}})},110:(t,e,n)=>{"use strict";var r=n(2985),o=n(639),i=n(2032),a=n(2337),u=n(875),s=[].slice;r(r.P+r.F*n(4253)((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}})},6773:(t,e,n)=>{"use strict";var r=n(2985),o=n(50)(3);r(r.P+r.F*!n(7717)([].some,!0),"Array",{some:function(t){return o(this,t,arguments[1])}})},75:(t,e,n)=>{"use strict";var r=n(2985),o=n(4963),i=n(508),a=n(4253),u=[].sort,s=[1,2,3];r(r.P+r.F*(a((function(){s.sort(void 0)}))||!a((function(){s.sort(null)}))||!n(7717)(u)),"Array",{sort:function(t){return void 0===t?u.call(i(this)):u.call(i(this),o(t))}})},1842:(t,e,n)=>{n(2974)("Array")},1822:(t,e,n)=>{var r=n(2985);r(r.S,"Date",{now:function(){return(new Date).getTime()}})},1031:(t,e,n)=>{var r=n(2985),o=n(3537);r(r.P+r.F*(Date.prototype.toISOString!==o),"Date",{toISOString:o})},9977:(t,e,n)=>{"use strict";var r=n(2985),o=n(508),i=n(1689);r(r.P+r.F*n(4253)((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}})},1560:(t,e,n)=>{var r=n(6314)("toPrimitive"),o=Date.prototype;r in o||n(7728)(o,r,n(870))},6331:(t,e,n)=>{var r=Date.prototype,o="Invalid Date",i="toString",a=r[i],u=r.getTime;new Date(NaN)+""!=o&&n(7234)(r,i,(function(){var t=u.call(this);return t==t?a.call(this):o}))},9730:(t,e,n)=>{var r=n(2985);r(r.P,"Function",{bind:n(4398)})},8377:(t,e,n)=>{"use strict";var r=n(5286),o=n(468),i=n(6314)("hasInstance"),a=Function.prototype;i in a||n(9275).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}})},6059:(t,e,n)=>{var r=n(9275).f,o=Function.prototype,i=/^\s*function ([^ (]*)/,a="name";a in o||n(7057)&&r(o,a,{configurable:!0,get:function(){try{return(""+this).match(i)[1]}catch(t){return""}}})},8416:(t,e,n)=>{"use strict";var r=n(9824),o=n(1616),i="Map";t.exports=n(5795)(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)},6503:(t,e,n)=>{var r=n(2985),o=n(6206),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))}})},6786:(t,e,n)=>{var r=n(2985),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}})},932:(t,e,n)=>{var r=n(2985),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}})},7526:(t,e,n)=>{var r=n(2985),o=n(1801);r(r.S,"Math",{cbrt:function(t){return o(t=+t)*Math.pow(Math.abs(t),1/3)}})},1591:(t,e,n)=>{var r=n(2985);r(r.S,"Math",{clz32:function(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},9073:(t,e,n)=>{var r=n(2985),o=Math.exp;r(r.S,"Math",{cosh:function(t){return(o(t=+t)+o(-t))/2}})},347:(t,e,n)=>{var r=n(2985),o=n(3086);r(r.S+r.F*(o!=Math.expm1),"Math",{expm1:o})},579:(t,e,n)=>{var r=n(2985);r(r.S,"Math",{fround:n(4934)})},4669:(t,e,n)=>{var r=n(2985),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)}})},7710:(t,e,n)=>{var r=n(2985),o=Math.imul;r(r.S+r.F*n(4253)((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)}})},5789:(t,e,n)=>{var r=n(2985);r(r.S,"Math",{log10:function(t){return Math.log(t)*Math.LOG10E}})},3514:(t,e,n)=>{var r=n(2985);r(r.S,"Math",{log1p:n(6206)})},9978:(t,e,n)=>{var r=n(2985);r(r.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}})},8472:(t,e,n)=>{var r=n(2985);r(r.S,"Math",{sign:n(1801)})},6946:(t,e,n)=>{var r=n(2985),o=n(3086),i=Math.exp;r(r.S+r.F*n(4253)((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)}})},5068:(t,e,n)=>{var r=n(2985),o=n(3086),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))}})},413:(t,e,n)=>{var r=n(2985);r(r.S,"Math",{trunc:function(t){return(t>0?Math.floor:Math.ceil)(t)}})},1246:(t,e,n)=>{"use strict";var r=n(3816),o=n(9181),i=n(2032),a=n(266),u=n(1689),s=n(4253),c=n(616).f,f=n(8693).f,l=n(9275).f,d=n(9599).trim,h="Number",p=r[h],v=p,g=p.prototype,m=i(n(2503)(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(7057)?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(7234)(r,h,p)}},5972:(t,e,n)=>{var r=n(2985);r(r.S,"Number",{EPSILON:Math.pow(2,-52)})},3403:(t,e,n)=>{var r=n(2985),o=n(3816).isFinite;r(r.S,"Number",{isFinite:function(t){return"number"==typeof t&&o(t)}})},2516:(t,e,n)=>{var r=n(2985);r(r.S,"Number",{isInteger:n(8367)})},9371:(t,e,n)=>{var r=n(2985);r(r.S,"Number",{isNaN:function(t){return t!=t}})},6479:(t,e,n)=>{var r=n(2985),o=n(8367),i=Math.abs;r(r.S,"Number",{isSafeInteger:function(t){return o(t)&&i(t)<=9007199254740991}})},1736:(t,e,n)=>{var r=n(2985);r(r.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},1889:(t,e,n)=>{var r=n(2985);r(r.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},5177:(t,e,n)=>{var r=n(2985),o=n(7743);r(r.S+r.F*(Number.parseFloat!=o),"Number",{parseFloat:o})},6943:(t,e,n)=>{var r=n(2985),o=n(5960);r(r.S+r.F*(Number.parseInt!=o),"Number",{parseInt:o})},726:(t,e,n)=>{"use strict";var r=n(2985),o=n(1467),i=n(3365),a=n(8595),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(4253)((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}})},1901:(t,e,n)=>{"use strict";var r=n(2985),o=n(4253),i=n(3365),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)}})},5115:(t,e,n)=>{var r=n(2985);r(r.S+r.F,"Object",{assign:n(5345)})},8132:(t,e,n)=>{var r=n(2985);r(r.S,"Object",{create:n(2503)})},7470:(t,e,n)=>{var r=n(2985);r(r.S+r.F*!n(7057),"Object",{defineProperties:n(5588)})},8388:(t,e,n)=>{var r=n(2985);r(r.S+r.F*!n(7057),"Object",{defineProperty:n(9275).f})},9375:(t,e,n)=>{var r=n(5286),o=n(4728).onFreeze;n(3160)("freeze",(function(t){return function(e){return t&&r(e)?t(o(e)):e}}))},4882:(t,e,n)=>{var r=n(2110),o=n(8693).f;n(3160)("getOwnPropertyDescriptor",(function(){return function(t,e){return o(r(t),e)}}))},9622:(t,e,n)=>{n(3160)("getOwnPropertyNames",(function(){return n(9327).f}))},1520:(t,e,n)=>{var r=n(508),o=n(468);n(3160)("getPrototypeOf",(function(){return function(t){return o(r(t))}}))},9892:(t,e,n)=>{var r=n(5286);n(3160)("isExtensible",(function(t){return function(e){return!!r(e)&&(!t||t(e))}}))},4157:(t,e,n)=>{var r=n(5286);n(3160)("isFrozen",(function(t){return function(e){return!r(e)||!!t&&t(e)}}))},5095:(t,e,n)=>{var r=n(5286);n(3160)("isSealed",(function(t){return function(e){return!r(e)||!!t&&t(e)}}))},9176:(t,e,n)=>{var r=n(2985);r(r.S,"Object",{is:n(7195)})},7476:(t,e,n)=>{var r=n(508),o=n(7184);n(3160)("keys",(function(){return function(t){return o(r(t))}}))},4672:(t,e,n)=>{var r=n(5286),o=n(4728).onFreeze;n(3160)("preventExtensions",(function(t){return function(e){return t&&r(e)?t(o(e)):e}}))},3533:(t,e,n)=>{var r=n(5286),o=n(4728).onFreeze;n(3160)("seal",(function(t){return function(e){return t&&r(e)?t(o(e)):e}}))},8838:(t,e,n)=>{var r=n(2985);r(r.S,"Object",{setPrototypeOf:n(7375).set})},6253:(t,e,n)=>{"use strict";var r=n(1488),o={};o[n(6314)("toStringTag")]="z",o+""!="[object z]"&&n(7234)(Object.prototype,"toString",(function(){return"[object "+r(this)+"]"}),!0)},4299:(t,e,n)=>{var r=n(2985),o=n(7743);r(r.G+r.F*(parseFloat!=o),{parseFloat:o})},1084:(t,e,n)=>{var r=n(2985),o=n(5960);r(r.G+r.F*(parseInt!=o),{parseInt:o})},851:(t,e,n)=>{"use strict";var r,o,i,a,u=n(4461),s=n(3816),c=n(741),f=n(1488),l=n(2985),d=n(5286),h=n(4963),p=n(3328),v=n(3531),g=n(8364),m=n(4193).set,y=n(4351)(),b=n(3499),w=n(188),E=n(575),x=n(94),_="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(6314)("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(4408)(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(2943)(O,_),n(2974)(_),a=n(5645)[_],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(7462)((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}})},1572:(t,e,n)=>{var r=n(2985),o=n(4963),i=n(7007),a=(n(3816).Reflect||{}).apply,u=Function.apply;r(r.S+r.F*!n(4253)((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)}})},2139:(t,e,n)=>{var r=n(2985),o=n(2503),i=n(4963),a=n(7007),u=n(5286),s=n(4253),c=n(4398),f=(n(3816).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}})},685:(t,e,n)=>{var r=n(9275),o=n(2985),i=n(7007),a=n(1689);o(o.S+o.F*n(4253)((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}}})},5535:(t,e,n)=>{var r=n(2985),o=n(8693).f,i=n(7007);r(r.S,"Reflect",{deleteProperty:function(t,e){var n=o(i(t),e);return!(n&&!n.configurable)&&delete t[e]}})},7347:(t,e,n)=>{"use strict";var r=n(2985),o=n(7007),i=function(t){this._t=o(t),this._i=0;var e,n=this._k=[];for(e in t)n.push(e)};n(9988)(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)}})},6633:(t,e,n)=>{var r=n(8693),o=n(2985),i=n(7007);o(o.S,"Reflect",{getOwnPropertyDescriptor:function(t,e){return r.f(i(t),e)}})},8989:(t,e,n)=>{var r=n(2985),o=n(468),i=n(7007);r(r.S,"Reflect",{getPrototypeOf:function(t){return o(i(t))}})},3049:(t,e,n)=>{var r=n(8693),o=n(468),i=n(9181),a=n(2985),u=n(5286),s=n(7007);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}})},8270:(t,e,n)=>{var r=n(2985);r(r.S,"Reflect",{has:function(t,e){return e in t}})},4510:(t,e,n)=>{var r=n(2985),o=n(7007),i=Object.isExtensible;r(r.S,"Reflect",{isExtensible:function(t){return o(t),!i||i(t)}})},3984:(t,e,n)=>{var r=n(2985);r(r.S,"Reflect",{ownKeys:n(7643)})},5769:(t,e,n)=>{var r=n(2985),o=n(7007),i=Object.preventExtensions;r(r.S,"Reflect",{preventExtensions:function(t){o(t);try{return i&&i(t),!0}catch(t){return!1}}})},6014:(t,e,n)=>{var r=n(2985),o=n(7375);o&&r(r.S,"Reflect",{setPrototypeOf:function(t,e){o.check(t,e);try{return o.set(t,e),!0}catch(t){return!1}}})},55:(t,e,n)=>{var r=n(9275),o=n(8693),i=n(468),a=n(9181),u=n(2985),s=n(681),c=n(7007),f=n(5286);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)}})},3946:(t,e,n)=>{var r=n(3816),o=n(266),i=n(9275).f,a=n(616).f,u=n(5364),s=n(3218),c=r.RegExp,f=c,l=c.prototype,d=/a/g,h=/a/g,p=new c(d)!==d;if(n(7057)&&(!p||n(4253)((function(){return h[n(6314)("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(7234)(r,"RegExp",c)}n(2974)("RegExp")},8269:(t,e,n)=>{"use strict";var r=n(1165);n(2985)({target:"RegExp",proto:!0,forced:r!==/./.exec},{exec:r})},6774:(t,e,n)=>{n(7057)&&"g"!=/./g.flags&&n(9275).f(RegExp.prototype,"flags",{configurable:!0,get:n(3218)})},1466:(t,e,n)=>{"use strict";var r=n(7007),o=n(875),i=n(6793),a=n(7787);n(8082)("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}]}))},9357:(t,e,n)=>{"use strict";var r=n(7007),o=n(508),i=n(875),a=n(1467),u=n(6793),s=n(7787),c=Math.max,f=Math.min,l=Math.floor,d=/\$([$&`']|\d\d?|<[^>]*>)/g,h=/\$([$&`']|\d\d?)/g;n(8082)("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}))}}))},6142:(t,e,n)=>{"use strict";var r=n(7007),o=n(7195),i=n(7787);n(8082)("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}]}))},1876:(t,e,n)=>{"use strict";var r=n(5364),o=n(7007),i=n(8364),a=n(6793),u=n(875),s=n(7787),c=n(1165),f=n(4253),l=Math.min,d=[].push,h="split",p="length",v="lastIndex",g=4294967295,m=!f((function(){RegExp(g,"y")}));n(8082)("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)),_}]}))},6108:(t,e,n)=>{"use strict";n(6774);var r=n(7007),o=n(3218),i=n(7057),a="toString",u=/./[a],s=function(t){n(7234)(RegExp.prototype,a,t,!0)};n(4253)((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)}))},8184:(t,e,n)=>{"use strict";var r=n(9824),o=n(1616);t.exports=n(5795)("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)},856:(t,e,n)=>{"use strict";n(9395)("anchor",(function(t){return function(e){return t(this,"a","name",e)}}))},703:(t,e,n)=>{"use strict";n(9395)("big",(function(t){return function(){return t(this,"big","","")}}))},1539:(t,e,n)=>{"use strict";n(9395)("blink",(function(t){return function(){return t(this,"blink","","")}}))},5292:(t,e,n)=>{"use strict";n(9395)("bold",(function(t){return function(){return t(this,"b","","")}}))},9539:(t,e,n)=>{"use strict";var r=n(2985),o=n(4496)(!1);r(r.P,"String",{codePointAt:function(t){return o(this,t)}})},6620:(t,e,n)=>{"use strict";var r=n(2985),o=n(875),i=n(2094),a="endsWith",u=""[a];r(r.P+r.F*n(8852)(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}})},6629:(t,e,n)=>{"use strict";n(9395)("fixed",(function(t){return function(){return t(this,"tt","","")}}))},3694:(t,e,n)=>{"use strict";n(9395)("fontcolor",(function(t){return function(e){return t(this,"font","color",e)}}))},7648:(t,e,n)=>{"use strict";n(9395)("fontsize",(function(t){return function(e){return t(this,"font","size",e)}}))},191:(t,e,n)=>{var r=n(2985),o=n(2337),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("")}})},2850:(t,e,n)=>{"use strict";var r=n(2985),o=n(2094),i="includes";r(r.P+r.F*n(8852)(i),"String",{includes:function(t){return!!~o(this,t,i).indexOf(t,arguments.length>1?arguments[1]:void 0)}})},7795:(t,e,n)=>{"use strict";n(9395)("italics",(function(t){return function(){return t(this,"i","","")}}))},9115:(t,e,n)=>{"use strict";var r=n(4496)(!0);n(2923)(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})}))},4531:(t,e,n)=>{"use strict";n(9395)("link",(function(t){return function(e){return t(this,"a","href",e)}}))},8306:(t,e,n)=>{var r=n(2985),o=n(2110),i=n(875);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("")}})},823:(t,e,n)=>{var r=n(2985);r(r.P,"String",{repeat:n(8595)})},3605:(t,e,n)=>{"use strict";n(9395)("small",(function(t){return function(){return t(this,"small","","")}}))},7732:(t,e,n)=>{"use strict";var r=n(2985),o=n(875),i=n(2094),a="startsWith",u=""[a];r(r.P+r.F*n(8852)(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}})},6780:(t,e,n)=>{"use strict";n(9395)("strike",(function(t){return function(){return t(this,"strike","","")}}))},9937:(t,e,n)=>{"use strict";n(9395)("sub",(function(t){return function(){return t(this,"sub","","")}}))},511:(t,e,n)=>{"use strict";n(9395)("sup",(function(t){return function(){return t(this,"sup","","")}}))},4564:(t,e,n)=>{"use strict";n(9599)("trim",(function(t){return function(){return t(this,3)}}))},5767:(t,e,n)=>{"use strict";var r=n(3816),o=n(9181),i=n(7057),a=n(2985),u=n(7234),s=n(4728).KEY,c=n(4253),f=n(3825),l=n(2943),d=n(3953),h=n(6314),p=n(8787),v=n(6074),g=n(5541),m=n(4302),y=n(7007),b=n(5286),w=n(508),E=n(2110),x=n(1689),_=n(681),S=n(2503),A=n(9327),I=n(8693),T=n(4548),O=n(9275),N=n(7184),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(616).f=A.f=tt,n(4682).f=Q,T.f=et,i&&!n(4461)&&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(7728)(R[P],z,R[P].valueOf),l(R,"Symbol"),l(Math,"Math",!0),l(r.JSON,"JSON",!0)},142:(t,e,n)=>{"use strict";var r=n(2985),o=n(9383),i=n(1125),a=n(7007),u=n(2337),s=n(875),c=n(5286),f=n(3816).ArrayBuffer,l=n(8364),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(4253)((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(2974)(m)},1786:(t,e,n)=>{var r=n(2985);r(r.G+r.W+r.F*!n(9383).ABV,{DataView:n(1125).DataView})},162:(t,e,n)=>{n(8440)("Float32",4,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},3834:(t,e,n)=>{n(8440)("Float64",8,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},4821:(t,e,n)=>{n(8440)("Int16",2,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},1303:(t,e,n)=>{n(8440)("Int32",4,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},5368:(t,e,n)=>{n(8440)("Int8",1,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},9103:(t,e,n)=>{n(8440)("Uint16",2,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},3318:(t,e,n)=>{n(8440)("Uint32",4,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},6964:(t,e,n)=>{n(8440)("Uint8",1,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},2152:(t,e,n)=>{n(8440)("Uint8",1,(function(t){return function(e,n,r){return t(this,e,n,r)}}),!0)},147:(t,e,n)=>{"use strict";var r,o=n(3816),i=n(50)(0),a=n(7234),u=n(4728),s=n(5345),c=n(3657),f=n(5286),l=n(1616),d=n(1616),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(5795)(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)}))})))},9192:(t,e,n)=>{"use strict";var r=n(3657),o=n(1616),i="WeakSet";n(5795)(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)},1268:(t,e,n)=>{"use strict";var r=n(2985),o=n(3325),i=n(508),a=n(875),u=n(4963),s=n(6886);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(7722)("flatMap")},2773:(t,e,n)=>{"use strict";var r=n(2985),o=n(9315)(!0);r(r.P,"Array",{includes:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),n(7722)("includes")},3276:(t,e,n)=>{var r=n(2985),o=n(1131)(!0);r(r.S,"Object",{entries:function(t){return o(t)}})},8351:(t,e,n)=>{var r=n(2985),o=n(7643),i=n(2110),a=n(8693),u=n(2811);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}})},6409:(t,e,n)=>{var r=n(2985),o=n(1131)(!1);r(r.S,"Object",{values:function(t){return o(t)}})},9865:(t,e,n)=>{"use strict";var r=n(2985),o=n(5645),i=n(3816),a=n(8364),u=n(94);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)}})},2770:(t,e,n)=>{"use strict";var r=n(2985),o=n(5442),i=n(575),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)}})},1784:(t,e,n)=>{"use strict";var r=n(2985),o=n(5442),i=n(575),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)}})},5869:(t,e,n)=>{"use strict";n(9599)("trimLeft",(function(t){return function(){return t(this,1)}}),"trimStart")},4325:(t,e,n)=>{"use strict";n(9599)("trimRight",(function(t){return function(){return t(this,2)}}),"trimEnd")},9665:(t,e,n)=>{n(6074)("asyncIterator")},1181:(t,e,n)=>{for(var r=n(6997),o=n(7184),i=n(7234),a=n(3816),u=n(7728),s=n(2803),c=n(6314),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)}},4633:(t,e,n)=>{var r=n(2985),o=n(4193);r(r.G+r.B,{setImmediate:o.set,clearImmediate:o.clear})},2564:(t,e,n)=>{var r=n(3816),o=n(2985),i=n(575),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)})},6337:(t,e,n)=>{n(2564),n(4633),n(1181),t.exports=n(5645)},2705:(t,e,n)=>{var r=n(5639).Symbol;t.exports=r},4239:(t,e,n)=>{var r=n(2705),o=n(9607),i=n(2333),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)}},8749:(t,e,n)=>{var r=n(4239),o=n(1780),i=n(7005),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)]}},7518:t=>{t.exports=function(t){return function(e){return t(e)}}},1957:(t,e,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=r},5924:(t,e,n)=>{var r=n(5569)(Object.getPrototypeOf,Object);t.exports=r},9607:(t,e,n)=>{var r=n(2705),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}},1167:(t,e,n)=>{t=n.nmd(t);var r=n(1957),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},2333:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},5569:t=>{t.exports=function(t,e){return function(n){return t(e(n))}}},5639:(t,e,n)=>{var r=n(1957),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i},1469:t=>{var e=Array.isArray;t.exports=e},1780:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},1763:(t,e,n)=>{var r=n(4239),o=n(7005);t.exports=function(t){return"number"==typeof t||o(t)&&"[object Number]"==r(t)}},7005:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},8630:(t,e,n)=>{var r=n(4239),o=n(5924),i=n(7005),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}},6719:(t,e,n)=>{var r=n(8749),o=n(7518),i=n(1167),a=i&&i.isTypedArray,u=a?o(a):r;t.exports=u},5666: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)}},1550: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=9728,E=9984,x=9985,_=9986,S=9987,A=5126,I=32819,T=32820,O=33635,N=34042,D={};function M(t,e){return t===T||t===I||t===O?2:t===N?4:D[t]*e}function k(t){return!(t&t-1||!t)}D[5120]=D[5121]=1,D[5122]=D[5123]=D[36193]=D[O]=D[I]=D[T]=2,D[5124]=D[5125]=D[A]=D[N]=4;var R=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(k(i)&&k(a),"incompatible wrap mode for texture, both width and height must be power of 2"),1===e.mipmask?1!==i&&1!==a&&o(t.minFilter!==E&&t.minFilter!==_&&t.minFilter!==x&&t.minFilter!==S,"min filter requires mipmap"):(o(k(i)&&k(a),"texture must be a square power of 2 to support mipmapping"),o(e.mipmask===(i<<1)-1,"missing or incomplete mipmap data")),e.type===A&&(n.extensions.indexOf("oes_texture_float_linear")<0&&o(t.minFilter===w&&t.magFilter===w,"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(M(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(M(d.type,u),d.unpackAlignment),"invalid data for image, buffer size is inconsistent with image format"):d.element||d.copy)}}}}}),C=0,L=0,P=5,j=6;function z(t,e){this.id=C++,this.type=t,this.data=e}function F(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function G(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['"'+F(t.substr(1,t.length-2))+'"'];var r=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(t);if(r)return G(t.substr(0,r.index)).concat(G(r[1])).concat(G(t.substr(r.index+r[0].length)));var o=t.split(".");if(1===o.length)return['"'+F(t)+'"'];for(var i=[],a=0;a<o.length;++a)i=i.concat(G(o[a]));return i}function U(t){return"["+G(t).join("][")+"]"}var B={DynamicVariable:z,define:function(t,e){return new z(t,U(e+""))},isDynamic:function(t){return"function"==typeof t&&!t._reglType||t instanceof z},unbox:function t(e,n){return"function"==typeof e?new z(L,e):"number"==typeof e||"boolean"==typeof e?new z(P,e):Array.isArray(e)?new z(j,e.map(((e,r)=>t(e,n+"["+r+"]")))):e instanceof z?e:void R(!1,"invalid option type in uniform "+n)},accessor:U},V={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},W="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date};function X(t){return"string"==typeof t?t.split():(R(Array.isArray(t),"invalid extension array"),t)}function H(t){return"string"==typeof t?(R("undefined"!=typeof document,"not supported outside of DOM"),document.querySelector(t)):t}function q(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&&R.raise(t)},p=function(){};if("string"==typeof u?(R("undefined"!=typeof document,"selector queries only supported in DOM enviroments"),n=document.querySelector(u),R(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:(R.constructor(u),"gl"in u?i=u.gl:"canvas"in u?o=H(u.canvas):"container"in u&&(r=H(u.container)),"attributes"in u&&(s=u.attributes,R.type(s,"object","invalid context attributes")),"extensions"in u&&(c=X(u.extensions)),"optionalExtensions"in u&&(f=X(u.optionalExtensions)),"onDone"in u&&(R.type(u.onDone,"function","invalid or missing onDone callback"),h=u.onDone),"profile"in u&&(d=!!u.profile),"pixelRatio"in u&&(l=+u.pixelRatio,R(l>0,"invalid pixel ratio"))):R.raise("invalid arguments to regl"),n&&("canvas"===n.nodeName.toLowerCase()?o=n:r=n),!i){if(!o){R("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 Y(t,e){for(var n=Array(t),r=0;r<t;++r)n[r]=e(r);return n}var K=5120,Z=5121,$=5122,Q=5123,J=5124,tt=5125,et=5126;function nt(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 rt(){var t=Y(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[nt(n)>>2];return r.length>0?r.pop():new ArrayBuffer(n)}function n(e){t[nt(e.byteLength)>>2].push(e)}return{alloc:e,free:n,allocType:function(t,n){var r=null;switch(t){case K:r=new Int8Array(e(n),0,n);break;case Z:r=new Uint8Array(e(n),0,n);break;case $:r=new Int16Array(e(2*n),0,n);break;case Q:r=new Uint16Array(e(2*n),0,n);break;case J:r=new Int32Array(e(4*n),0,n);break;case tt:r=new Uint32Array(e(4*n),0,n);break;case et: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 ot=rt();ot.zero=rt();var it=3553,at=6408,ut=5126,st=36160,ct=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(it,a),t.texImage2D(it,0,at,1,1,0,at,ut,null);var u=t.createFramebuffer();if(t.bindFramebuffer(st,u),t.framebufferTexture2D(st,36064,it,a,0),t.bindTexture(it,null),36053!==t.checkFramebufferStatus(st))i=!1;else{t.viewport(0,0,1,1),t.clearColor(1,0,0,1),t.clear(16384);var s=ot.allocType(ut,4);t.readPixels(0,0,1,1,at,ut,s),t.getError()?i=!1:(t.deleteFramebuffer(u),t.deleteTexture(a),i=1===s[0]),ot.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=ot.allocType(5121,36);t.activeTexture(33984),t.bindTexture(34067,f),t.texImage2D(34069,0,at,3,3,0,at,5121,l),ot.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}};function ft(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 lt=function(t){return Object.keys(t).map((function(e){return t[e]}))},dt={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||ot.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:ht(t,e[0],e[1],e[2],a,0);break;default:pt(t,e,0,a,0)}return a}};function ht(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 pt(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)ht(t[a],s,c,f,r,o),o+=i}else for(a=0;a<u;++a)pt(t[a],e,n+1,r,o),o+=i}var vt={"[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},gt={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},mt={dynamic:35048,stream:35040,static:35044},yt=dt.flatten,bt=dt.shape,wt=35044,Et=35040,xt=5121,_t=5126,St=[];function At(t){return 0|vt[Object.prototype.toString.call(t)]}function It(t,e){for(var n=0;n<e.length;++n)t[n]=e[n]}function Tt(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]}St[5120]=1,St[5122]=2,St[5124]=4,St[5121]=1,St[5123]=2,St[5125]=4,St[5126]=4;var Ot={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Nt=0,Dt=1,Mt=4,kt=5120,Rt=5121,Ct=5122,Lt=5123,Pt=5124,jt=5125,zt=34963,Ft=35040,Gt=35044;var Ut=new Float32Array(1),Bt=new Uint32Array(Ut.buffer),Vt=5123;function Wt(t){for(var e=ot.allocType(Vt,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{Ut[0]=t[n];var r=Bt[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 Xt(e){return Array.isArray(e)||t(e)}var Ht=function(t){return!(t&t-1||!t)},qt=34467,Yt=3553,Kt=34067,Zt=34069,$t=6408,Qt=6406,Jt=6407,te=6409,ee=6410,ne=32854,re=32855,oe=36194,ie=32819,ae=32820,ue=33635,se=34042,ce=6402,fe=34041,le=35904,de=35906,he=36193,pe=33776,ve=33777,ge=33778,me=33779,ye=35986,be=35987,we=34798,Ee=35840,xe=35841,_e=35842,Se=35843,Ae=36196,Ie=5121,Te=5123,Oe=5125,Ne=5126,De=10242,Me=10243,ke=10497,Re=33071,Ce=33648,Le=10240,Pe=10241,je=9728,ze=9729,Fe=9984,Ge=9985,Ue=9986,Be=9987,Ve=33170,We=4352,Xe=4353,He=4354,qe=34046,Ye=3317,Ke=37440,Ze=37441,$e=37443,Qe=37444,Je=33984,tn=[Fe,Ue,Ge,Be],en=[0,te,ee,Jt,$t],nn={};function rn(t){return"[object "+t+"]"}nn[te]=nn[Qt]=nn[ce]=1,nn[fe]=nn[ee]=2,nn[Jt]=nn[le]=3,nn[$t]=nn[de]=4;var on=rn("HTMLCanvasElement"),an=rn("OffscreenCanvas"),un=rn("CanvasRenderingContext2D"),sn=rn("ImageBitmap"),cn=rn("HTMLImageElement"),fn=rn("HTMLVideoElement"),ln=Object.keys(vt).concat([on,an,un,sn,cn,fn]),dn=[];dn[Ie]=1,dn[Ne]=4,dn[he]=2,dn[Te]=2,dn[Oe]=4;var hn=[];function pn(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function vn(t){return!!Array.isArray(t)&&!(0===t.length||!Xt(t[0]))}function gn(t){return Object.prototype.toString.call(t)}function mn(t){return gn(t)===on}function yn(t){return gn(t)===an}function bn(t){if(!t)return!1;var e=gn(t);return ln.indexOf(e)>=0||pn(t)||vn(t)||ft(t)}function wn(t){return 0|vt[Object.prototype.toString.call(t)]}function En(t,e){return ot.allocType(t.type===he?Ne:t.type,e)}function xn(t,e){t.type===he?(t.data=Wt(e),ot.freeType(e)):t.data=e}function _n(t,e,n,r,o,i){var a;if(a=void 0!==hn[t]?hn[t]:nn[t]*dn[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 Sn(n,r,o,i,a,u,s){var c={"don't care":We,"dont care":We,nice:He,fast:Xe},f={repeat:ke,clamp:Re,mirror:Ce},l={nearest:je,linear:ze},d=e({mipmap:Be,"nearest mipmap nearest":Fe,"linear mipmap nearest":Ge,"nearest mipmap linear":Ue,"linear mipmap linear":Be},l),h={none:0,browser:Qe},p={uint8:Ie,rgba4:ie,rgb565:ue,"rgb5 a1":ae},v={alpha:Qt,luminance:te,"luminance alpha":ee,rgb:Jt,rgba:$t,rgba4:ne,"rgb5 a1":re,rgb565:oe},g={};r.ext_srgb&&(v.srgb=le,v.srgba=de),r.oes_texture_float&&(p.float32=p.float=Ne),r.oes_texture_half_float&&(p.float16=p["half float"]=he),r.webgl_depth_texture&&(e(v,{depth:ce,"depth stencil":fe}),e(p,{uint16:Te,uint32:Oe,"depth stencil":se})),r.webgl_compressed_texture_s3tc&&e(g,{"rgb s3tc dxt1":pe,"rgba s3tc dxt1":ve,"rgba s3tc dxt3":ge,"rgba s3tc dxt5":me}),r.webgl_compressed_texture_atc&&e(g,{"rgb atc":ye,"rgba atc explicit alpha":be,"rgba atc interpolated alpha":we}),r.webgl_compressed_texture_pvrtc&&e(g,{"rgb pvrtc 4bppv1":Ee,"rgb pvrtc 2bppv1":xe,"rgba pvrtc 4bppv1":_e,"rgba pvrtc 2bppv1":Se}),r.webgl_compressed_texture_etc1&&(g["rgb etc1"]=Ae);var m=Array.prototype.slice.call(n.getParameter(qt));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===te||n===Qt||n===te||n===ee||n===ce||n===fe||r.ext_srgb&&(n===le||n===de)?t[n]=n:n===re||e.indexOf("rgba")>=0?t[n]=$t:t[n]=Jt,t}),{});function A(){this.internalformat=$t,this.format=$t,this.type=Ie,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=Qe,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 T(t,e){if("object"==typeof e&&e){if("premultiplyAlpha"in e&&(R.type(e.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),t.premultiplyAlpha=e.premultiplyAlpha),"flipY"in e&&(R.type(e.flipY,"boolean","invalid texture flip"),t.flipY=e.flipY),"alignment"in e&&(R.oneOf(e.alignment,[1,2,4,8],"invalid texture unpack alignment"),t.unpackAlignment=e.alignment),"colorSpace"in e&&(R.parameter(e.colorSpace,h,"invalid colorSpace"),t.colorSpace=h[e.colorSpace]),"type"in e){var n=e.type;R(r.oes_texture_float||!("float"===n||"float32"===n),"you must enable the OES_texture_float extension in order to use floating point textures."),R(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."),R(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."),R.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?(R(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],R(u>0&&u<=4,"invalid number of channels"),s=!0),R(i>=0&&i<=o.maxTextureSize,"invalid width"),R(a>=0&&a<=o.maxTextureSize,"invalid height")):("radius"in e&&(i=a=e.radius,R(i>=0&&i<=o.maxTextureSize,"invalid radius")),"width"in e&&(i=e.width,R(i>=0&&i<=o.maxTextureSize,"invalid width")),"height"in e&&(a=e.height,R(a>=0&&a<=o.maxTextureSize,"invalid height")),"channels"in e&&(u=e.channels,R(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;R(r.webgl_depth_texture||!("depth"===f||"depth stencil"===f),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),R.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=nn[t.format]:s&&!c?t.channels!==en[t.format]&&(t.format=t.internalformat=en[t.channels]):c&&s&&R(t.channels===nn[t.format],"number of channels inconsistent with specified format")}}function O(t){n.pixelStorei(Ke,t.flipY),n.pixelStorei(Ze,t.premultiplyAlpha),n.pixelStorei($e,t.colorSpace),n.pixelStorei(Ye,t.unpackAlignment)}function N(){A.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function D(e,n){var r=null;if(bn(n)?r=n:n&&(R.type(n,"object","invalid pixel data type"),T(e,n),"x"in n&&(e.xOffset=0|n.x),"y"in n&&(e.yOffset=0|n.y),bn(n.data)&&(r=n.data)),R(!e.compressed||r instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),n.copy){R(!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,R(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!==Ie||(e.type=wn(r));else if(pn(r))e.channels=e.channels||4,function(t,e){var n=e.length;switch(t.type){case Ie:case Te:case Oe:case Ne:var r=ot.allocType(t.type,n);r.set(e),t.data=r;break;case he:t.data=Wt(e);break;default:R.raise("unsupported texture type, must specify a typed array")}}(e,r),e.alignment=1,e.needsFree=!0;else if(ft(r)){var s=r.data;Array.isArray(s)||e.type!==Ie||(e.type=wn(s));var c,f,l,d,h,p,v=r.shape,g=r.stride;3===v.length?(l=v[2],p=g[2]):(R(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=en[l],e.needsFree=!0,function(t,e,n,r,o,i){for(var a=t.width,u=t.height,s=t.channels,c=En(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];xn(t,c)}(e,s,d,h,p,r.offset)}else if(mn(r)||yn(r)||gn(r)===un)mn(r)||yn(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 gn(t)===sn}(r))e.element=r,e.width=r.width,e.height=r.height,e.channels=4;else if(function(t){return gn(t)===cn}(r))e.element=r,e.width=r.naturalWidth,e.height=r.naturalHeight,e.channels=4;else if(function(t){return gn(t)===fn}(r))e.element=r,e.width=r.videoWidth,e.height=r.videoHeight,e.channels=4;else if(vn(r)){var m=e.width||r[0].length,y=e.height||r.length,b=e.channels;b=Xt(r[0][0])?b||r[0][0].length:b||1;for(var w=dt.shape(r),E=1,x=0;x<w.length;++x)E*=w[x];var _=En(e,E);dt.flatten(r,w,"",_),xn(e,_),e.alignment=1,e.width=m,e.height=y,e.channels=b,e.format=e.internalformat=en[b],e.needsFree=!0}}else e.width=e.width||1,e.height=e.height||1,e.channels=e.channels||4;e.type===Ne?R(o.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):e.type===he&&R(o.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function M(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;O(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 k(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;O(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 N}function P(t){t.needsFree&&ot.freeType(t.data),N.call(t),C.push(t)}function j(){A.call(this),this.genMipmaps=!1,this.mipmapHint=We,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(bn(e))I(n=t.images[0]=L(),t),D(n,e),t.mipmask=1;else if(T(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,D(n,r[o]),t.mipmask|=1<<o;else I(n=t.images[0]=L(),t),D(n,e),t.mipmask=1;I(t,t.images[0]),!t.compressed||t.internalformat!==pe&&t.internalformat!==ve&&t.internalformat!==ge&&t.internalformat!==me||R(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;M(n[r],e,r)}}var U=[];function B(){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 V(t){for(var e=t.images,n=0;n<e.length;++n)e[n]&&P(e[n]),e[n]=null;U.push(t)}function W(){this.minFilter=je,this.magFilter=je,this.wrapS=Re,this.wrapT=Re,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=We}function X(t,e){if("min"in e){var n=e.min;R.parameter(n,d),t.minFilter=d[n],tn.indexOf(t.minFilter)>=0&&!("faces"in e)&&(t.genMipmaps=!0)}if("mag"in e){var r=e.mag;R.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?(R.parameter(u,f),i=a=f[u]):Array.isArray(u)&&(R.parameter(u[0],f),R.parameter(u[1],f),i=f[u[0]],a=f[u[1]])}else{if("wrapS"in e){var s=e.wrapS;R.parameter(s,f),i=f[s]}if("wrapT"in e){var h=e.wrapT;R.parameter(h,f),a=f[h]}}if(t.wrapS=i,t.wrapT=a,"anisotropic"in e){var p=e.anisotropic;R("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":R.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":R(Array.isArray(e.mipmap),"invalid mipmap type"),t.genMipmaps=!1,v=!0;break;default:R.raise("invalid mipmap type")}v&&!("min"in e)&&(t.minFilter=Fe)}}function H(t,e){n.texParameteri(e,Pe,t.minFilter),n.texParameteri(e,Le,t.magFilter),n.texParameteri(e,De,t.wrapS),n.texParameteri(e,Me,t.wrapT),r.ext_texture_filter_anisotropic&&n.texParameteri(e,qe,t.anisotropic),t.genMipmaps&&(n.hint(Ve,t.mipmapHint),n.generateMipmap(e))}var q=0,Y={},K=o.maxTextureUnits,Z=Array(K).map((function(){return null}));function $(t){A.call(this),this.mipmask=0,this.internalformat=$t,this.id=q++,this.refCount=1,this.target=t,this.texture=n.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new W,s.profile&&(this.stats={size:0})}function Q(t){n.activeTexture(Je),n.bindTexture(t.target,t.texture)}function J(){var t=Z[0];t?n.bindTexture(t.target,t.texture):n.bindTexture(Yt,null)}function tt(t){var e=t.texture;R(e,"must not double destroy texture");var r=t.unit,o=t.target;r>=0&&(n.activeTexture(Je+r),n.bindTexture(o,null),Z[r]=null),n.deleteTexture(e),t.texture=null,t.params=null,t.pixels=null,t.refCount=0,delete Y[t.id],u.textureCount--}return e($.prototype,{bind:function(){var t=this;t.bindCount+=1;var e=t.unit;if(e<0){for(var r=0;r<K;++r){var o=Z[r];if(o){if(o.bindCount>0)continue;o.unit=-1}Z[r]=t,e=r;break}e>=K&&R.raise("insufficient number of texture units"),s.profile&&u.maxTextureUnits<e+1&&(u.maxTextureUnits=e+1),t.unit=e,n.activeTexture(Je+e),n.bindTexture(t.target,t.texture)}return e},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&tt(this)}}),s.profile&&(u.getTotalTextureSize=function(){var t=0;return Object.keys(Y).forEach((function(e){t+=Y[e].stats.size})),t}),{create2D:function(t,e){var r=new $(Yt);function i(t,e){var n=r.texInfo;W.call(n);var a=B();return"number"==typeof t?z(a,0|t,"number"==typeof e?0|e:0|t):t?(R.type(t,"object","invalid arguments to regl.texture"),X(n,t),F(a,t)):z(a,1,1),n.genMipmaps&&(a.mipmask=(a.width<<1)-1),r.mipmask=a.mipmask,I(r,a),R.texture2D(n,a,o),r.internalformat=a.internalformat,i.width=a.width,i.height=a.height,Q(r),G(a,Yt),H(n,Yt),J(),V(a),s.profile&&(r.stats.size=_n(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 Y[r.id]=r,u.textureCount++,i(t,e),i.subimage=function(t,e,n,o){R(!!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,D(c,t),c.width=c.width||(r.width>>s)-a,c.height=c.height||(r.height>>s)-u,R(r.type===c.type&&r.format===c.format&&r.internalformat===c.internalformat,"incompatible format for texture.subimage"),R(a>=0&&u>=0&&a+c.width<=r.width&&u+c.height<=r.height,"texture.subimage write out of bounds"),R(r.mipmask&1<<s,"missing mipmap data"),R(c.data||c.element||c.needsCopy,"missing image data"),Q(r),k(c,Yt,a,u,s),J(),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,Q(r);for(var u=0;r.mipmask>>u;++u){var c=o>>u,f=a>>u;if(!c||!f)break;n.texImage2D(Yt,u,r.format,c,f,0,r.format,r.type,null)}return J(),s.profile&&(r.stats.size=_n(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 $(Kt);Y[f.id]=f,u.cubeCount++;var l=new Array(6);function d(t,e,n,r,i,a){var u,c=f.texInfo;for(W.call(c),u=0;u<6;++u)l[u]=B();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(X(c,t),T(f,t),"faces"in t){var h=t.faces;for(R(Array.isArray(h)&&6===h.length,"cube faces must be a length 6 array"),u=0;u<6;++u)R("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 R.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||R(Ht(f.width)&&Ht(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,R.textureCube(f,c,l,o),f.internalformat=l[0].internalformat,d.width=l[0].width,d.height=l[0].height,Q(f),u=0;u<6;++u)G(l[u],Zt+u);for(H(c,Kt),J(),s.profile&&(f.stats.size=_n(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)V(l[u]);return d}return d(t,e,r,i,a,c),d.subimage=function(t,e,n,r,o){R(!!e,"must specify image data"),R("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,D(s,e),s.width=s.width||(f.width>>u)-i,s.height=s.height||(f.height>>u)-a,R(f.type===s.type&&f.format===s.format&&f.internalformat===s.internalformat,"incompatible format for texture.subimage"),R(i>=0&&a>=0&&i+s.width<=f.width&&a+s.height<=f.height,"texture.subimage write out of bounds"),R(f.mipmask&1<<u,"missing mipmap data"),R(s.data||s.element||s.needsCopy,"missing image data"),Q(f),k(s,Zt+t,i,a,u),J(),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,Q(f);for(var r=0;r<6;++r)for(var o=0;f.mipmask>>o;++o)n.texImage2D(Zt+r,o,f.format,e>>o,e>>o,0,f.format,f.type,null);return J(),s.profile&&(f.stats.size=_n(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<K;++t)n.activeTexture(Je+t),n.bindTexture(Yt,null),Z[t]=null;lt(Y).forEach(tt),u.cubeCount=0,u.textureCount=0},getTexture:function(t){return null},restore:function(){for(var t=0;t<K;++t){var e=Z[t];e&&(e.bindCount=0,e.unit=-1,Z[t]=null)}lt(Y).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===Yt)n.texImage2D(Yt,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(Zt+r,e,t.internalformat,t.width>>e,t.height>>e,0,t.internalformat,t.type,null);H(t.texInfo,t.target)}))},refresh:function(){for(var t=0;t<K;++t){var e=Z[t];e&&(e.bindCount=0,e.unit=-1,Z[t]=null),n.activeTexture(Je+t),n.bindTexture(Yt,null),n.bindTexture(Kt,null)}}}}hn[ne]=2,hn[re]=2,hn[oe]=2,hn[fe]=4,hn[pe]=.5,hn[ve]=.5,hn[ge]=1,hn[me]=1,hn[ye]=.5,hn[be]=1,hn[we]=1,hn[Ee]=.5,hn[xe]=.25,hn[_e]=.5,hn[Se]=.25,hn[Ae]=.5;var An=36161,In=32854,Tn=[];function On(t,e,n){return Tn[t]*e*n}Tn[In]=2,Tn[32855]=2,Tn[36194]=2,Tn[33189]=2,Tn[36168]=1,Tn[34041]=4,Tn[35907]=4,Tn[34836]=16,Tn[34842]=8,Tn[34843]=6;var Nn=function(t,e,n,r,o){var i={rgba4:In,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=In,this.width=0,this.height=0,o.profile&&(this.stats={size:0})}function f(e){var n=e.renderbuffer;R(n,"must not double destroy renderbuffer"),t.bindRenderbuffer(An,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=In;if("object"==typeof e&&e){var d=e;if("shape"in d){var h=d.shape;R(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&&(R.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?R.raise("invalid arguments to renderbuffer constructor"):u=s=1;if(R(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(An,f.renderbuffer),t.renderbufferStorage(An,c,u,s),R(0===t.getError(),"invalid render buffer format"),o.profile&&(f.stats.size=On(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||(R(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(An,f.renderbuffer),t.renderbufferStorage(An,f.format,i,a),R(0===t.getError(),"invalid render buffer format"),o.profile&&(f.stats.size=On(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(){lt(s).forEach(f)},restore:function(){lt(s).forEach((function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(An,e.renderbuffer),t.renderbufferStorage(An,e.format,e.width,e.height)})),t.bindRenderbuffer(An,null)}}},Dn=36160,Mn=36161,kn=3553,Rn=34069,Cn=36064,Ln=36096,Pn=36128,jn=33306,zn=36053,Fn=6402,Gn=[6407,6408],Un=[];Un[6408]=4,Un[6407]=3;var Bn=[];Bn[5121]=1,Bn[5126]=4,Bn[36193]=2;var Vn=33189,Wn=36168,Xn=34041,Hn=[32854,32855,36194,35907,34842,34843,34836],qn={};qn[zn]="complete",qn[36054]="incomplete attachment",qn[36057]="incomplete dimensions",qn[36055]="incomplete, missing attachment",qn[36061]="unsupported";var Yn=5126,Kn=34962;function Zn(){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=Yn,this.offset=0,this.stride=0,this.divisor=0}var $n=35632,Qn=35633,Jn=35718,tr=35721;var er=6408,nr=5121,rr=3333,or=5126;function ir(e,n,r,o,i,a,u){function s(s){var c;null===n.next?(R(i.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),c=nr):(R(null!==n.next.colorAttachments[0].texture,"You cannot read from a renderbuffer"),c=n.next.colorAttachments[0].texture._texture.type,a.oes_texture_float?(R(c===nr||c===or,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),c===or&&R(u.readFloat,"Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):R(c===nr,"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&&(R.type(s,"object","invalid arguments to regl.read()"),f=0|s.x,l=0|s.y,R(f>=0&&f<o.framebufferWidth,"invalid x offset for regl.read"),R(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===nr?R(p instanceof Uint8Array,"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"):c===or&&R(p instanceof Float32Array,"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'")),R(d>0&&d+f<=o.framebufferWidth,"invalid width for read pixels"),R(h>0&&h+l<=o.framebufferHeight,"invalid height for read pixels"),r();var v=d*h*4;return p||(c===nr?p=new Uint8Array(v):c===or&&(p=p||new Float32Array(v))),R.isTypedArray(p,"data buffer for regl.read() must be a typedarray"),R(p.byteLength>=v,"data buffer for regl.read() too small"),e.pixelStorei(rr,4),e.readPixels(f,l,d,h,er,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 ar(t){return Array.prototype.slice.call(t)}function ur(t){return ar(t).join("")}var sr="xyzw".split(""),cr=5121,fr=1,lr=2,dr=0,hr=1,pr=2,vr=3,gr=4,mr=5,yr=6,br="dither",wr="blend.enable",Er="blend.color",xr="blend.equation",_r="blend.func",Sr="depth.enable",Ar="depth.func",Ir="depth.range",Tr="depth.mask",Or="colorMask",Nr="cull.enable",Dr="cull.face",Mr="frontFace",kr="lineWidth",Rr="polygonOffset.enable",Cr="polygonOffset.offset",Lr="sample.alpha",Pr="sample.enable",jr="sample.coverage",zr="stencil.enable",Fr="stencil.mask",Gr="stencil.func",Ur="stencil.opFront",Br="stencil.opBack",Vr="scissor.enable",Wr="scissor.box",Xr="viewport",Hr="profile",qr="framebuffer",Yr="vert",Kr="frag",Zr="elements",$r="primitive",Qr="count",Jr="offset",to="instances",eo="vao",no="Width",ro="Height",oo=qr+no,io=qr+ro,ao=Xr+no,uo=Xr+ro,so="drawingBuffer",co=so+no,fo=so+ro,lo=[_r,xr,Gr,Ur,Br,jr,Xr,Wr,Cr],ho=34962,po=34963,vo=3553,go=34067,mo=2884,yo=3042,bo=3024,wo=2960,Eo=2929,xo=3089,_o=32823,So=32926,Ao=32928,Io=5126,To=35664,Oo=35665,No=35666,Do=5124,Mo=35667,ko=35668,Ro=35669,Co=35670,Lo=35671,Po=35672,jo=35673,zo=35674,Fo=35675,Go=35676,Uo=35678,Bo=35680,Vo=4,Wo=1028,Xo=1029,Ho=2304,qo=2305,Yo=32775,Ko=32776,Zo=519,$o=7680,Qo=0,Jo=1,ti=32774,ei=513,ni=36160,ri=36064,oi={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},ii=["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"],ai={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},ui={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},si={frag:35632,vert:35633},ci={cw:Ho,ccw:qo};function fi(e){return Array.isArray(e)||t(e)||ft(e)}function li(t){return t.sort((function(t,e){return t===Xr?-1:e===Xr?1:t<e?-1:1}))}function di(t,e,n,r){this.thisDep=t,this.contextDep=e,this.propDep=n,this.append=r}function hi(t){return t&&!(t.thisDep||t.contextDep||t.propDep)}function pi(t){return new di(!1,!1,!1,t)}function vi(t,e){var n=t.type;if(n===dr){var r=t.data.length;return new di(!0,r>=1,r>=2,e)}if(n===gr){var o=t.data;return new di(o.thisDep,o.contextDep,o.propDep,e)}if(n===mr)return new di(!1,!1,!1,e);if(n===yr){for(var i=!1,a=!1,u=!1,s=0;s<t.data.length;++s){var c=t.data[s];if(c.type===hr)u=!0;else if(c.type===pr)a=!0;else if(c.type===vr)i=!0;else if(c.type===dr){i=!0;var f=c.data;f>=1&&(a=!0),f>=2&&(u=!0)}else c.type===gr&&(i=i||c.data.thisDep,a=a||c.data.contextDep,u=u||c.data.propDep)}return new di(i,a,u,e)}return new di(n===vr,n===pr,n===hr,e)}var gi=new di(!1,!1,!1,(function(){}));function mi(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=Yo,m.max=Ko);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 T(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(br,bo),I(wr,yo),T(Er,"blendColor",[0,0,0,0]),T(xr,"blendEquationSeparate",[ti,ti]),T(_r,"blendFuncSeparate",[Jo,Qo,Jo,Qo]),I(Sr,Eo,!0),T(Ar,"depthFunc",ei),T(Ir,"depthRange",[0,1]),T(Tr,"depthMask",!0),T(Or,Or,[!0,!0,!0,!0]),I(Nr,mo),T(Dr,"cullFace",Xo),T(Mr,Mr,qo),T(kr,kr,1),I(Rr,_o),T(Cr,"polygonOffset",[0,0]),I(Lr,So),I(Pr,Ao),T(jr,"sampleCoverage",[1,!1]),I(zr,wo),T(Fr,"stencilMask",-1),T(Gr,"stencilFunc",[Zo,0,-1]),T(Ur,"stencilOpSeparate",[Wo,$o,$o,$o]),T(Br,"stencilOpSeparate",[Xo,$o,$o,$o]),I(Vr,xo),T(Wr,"scissor",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]),T(Xr,Xr,[0,0,t.drawingBufferWidth,t.drawingBufferHeight]);var O={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:fi},N={primTypes:Ot,compareFuncs:ai,blendFuncs:oi,blendEquations:m,stencilOps:ui,glTypes:gt,orientationType:ci};R.optional((function(){O.isArrayLike=Xt})),b&&(N.backBuffer=[Xo],N.drawBuffer=Y(o.maxDrawbuffers,(function(t){return 0===t?[0]:Y(t,(function(t){return ri+t}))})));var D=0;function M(){var t=function(){var t=0,n=[],r=[];function o(){var n=[],r=[];return e((function(){n.push.apply(n,ar(arguments))}),{def:function(){var e="v"+t++;return r.push(e),arguments.length>0&&(n.push(e,"="),n.push.apply(n,ar(arguments)),n.push(";")),e},toString:function(){return ur([r.length>0?"var "+r.join(",")+";":"",ur(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,ar(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 ur(["function(",r.join(),"){",c(),"}"])}})},scope:i,cond:function(){var t=ur(arguments),n=i(),r=i(),o=n.toString,a=r.toString;return e(n,{then:function(){return n.apply(n,ar(arguments)),this},else:function(){return r.apply(r,ar(arguments)),this},toString:function(){var e=a();return e&&(e="else{"+e+"}"),ur(["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=ur(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=D++,t.batchId="0";var i=r(O),a=t.shared={props:"a0"};Object.keys(O).forEach((function(t){a[t]=o.def(i,".",t)})),R.optional((function(){t.CHECK=r(R),t.commandStr=R.guessCommand(),t.command=r(t.commandStr),t.assert=function(t,e,n){t("if(!(",e,"))",this.CHECK,".commandRaise(",r(n),",",this.command,");")},N.invalidBlendCombinations=ii}));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(N).forEach((function(t){c[t]=o.def(JSON.stringify(N[t]))})),t.invoke=function(e,n){switch(n.type){case dr: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 hr:return e.def(a.props,n.data);case pr:return e.def(a.context,n.data);case vr:return e.def("this",n.data);case gr:return n.data.append(t,e),n.data.ref;case mr:return n.data.toString();case yr: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 k(t,e,u,c,d){var h=t.static,p=t.dynamic;R.optional((function(){var t=[qr,Yr,Kr,Zr,$r,Jr,Qr,to,Hr,eo].concat(x);function e(e){Object.keys(e).forEach((function(e){R.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[Kr]&&"string"==typeof n[Yr]){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)R("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(qr in n){var o=n[qr];return o?(o=s.getFramebuffer(o),R.command(o,"invalid framebuffer object"),pi((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,"."+oo,n+".width"),e.set(i,"."+io,n+".height"),n}))):pi((function(t,e){var n=t.shared;e.set(n.framebuffer,".next","null");var r=n.context;return e.set(r,"."+oo,r+"."+co),e.set(r,"."+io,r+"."+fo),"null"}))}if(qr in r){var i=r[qr];return vi(i,(function(t,e){var n=t.invoke(e,i),r=t.shared,o=r.framebuffer,a=e.def(o,".getFramebuffer(",n,")");R.optional((function(){t.assert(e,"!"+n+"||"+a,"invalid framebuffer object")})),e.set(o,".next",a);var u=r.context;return e.set(u,"."+oo,a+"?"+a+".width:"+u+"."+co),e.set(u,"."+io,a+"?"+a+".height:"+u+"."+fo),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];R.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,R.command(a>=0,"invalid "+t,n.commandStr)):s=!1,"height"in i?(u=0|i.height,R.command(u>=0,"invalid "+t,n.commandStr)):s=!1,new di(!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,".",oo,"-",c));var o=u;return"height"in i||(o=e.def(n,".",io,"-",f)),[c,f,r,o]}))}if(t in o){var l=o[t],d=vi(l,(function(e,n){var r=e.invoke(n,l);R.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,".",oo,"-",i,")"),s=n.def('"height" in ',r,"?",r,".height|0:","(",o,".",io,"-",a,")");return R.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 di(e.thisDep,e.contextDep,e.propDep,(function(t,e){var n=t.shared.context;return[0,0,e.def(n,".",oo),e.def(n,".",io)]})):null}var a=i(Xr);if(a){var u=a;a=new di(a.thisDep,a.contextDep,a.propDep,(function(t,e){var n=u.append(t,e),r=t.shared.context;return e.set(r,"."+ao,n[2]),e.set(r,"."+uo,n[3]),n}))}return{viewport:a,scissor_box:i(Wr)}}(t,b,d),E=function(t,e){var n=t.static,r=t.dynamic,o=function(){if(Zr in n){var t=n[Zr];fi(t)?t=a.getElements(a.create(t,!0)):t&&(t=a.getElements(t),R.command(t,"invalid elements",e.commandStr));var o=pi((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(Zr in r){var i=r[Zr];return vi(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 R.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 R.command(!i||a>=0,"invalid "+t,e.commandStr),pi((function(t,e){return i&&(t.OFFSET=a),a}))}if(t in r){var u=r[t];return vi(u,(function(e,n){var r=e.invoke(n,u);return i&&(e.OFFSET=r,R.optional((function(){e.assert(n,r+">=0","invalid "+t)}))),r}))}return i&&o?pi((function(t,e){return t.OFFSET="0",0})):null}var u=i(Jr,!0);return{elements:o,primitive:function(){if($r in n){var t=n[$r];return R.commandParameter(t,Ot,"invalid primitve",e.commandStr),pi((function(e,n){return Ot[t]}))}if($r in r){var i=r[$r];return vi(i,(function(t,e){var n=t.constants.primTypes,r=t.invoke(e,i);return R.optional((function(){t.assert(e,r+" in "+n,"invalid primitive, must be one of "+Object.keys(Ot))})),e.def(n,"[",r,"]")}))}return o?hi(o)?o.value?pi((function(t,e){return e.def(t.ELEMENTS,".primType")})):pi((function(){return Vo})):new di(o.thisDep,o.contextDep,o.propDep,(function(t,e){var n=t.ELEMENTS;return e.def(n,"?",n,".primType:",Vo)})):null}(),count:function(){if(Qr in n){var t=0|n[Qr];return R.command("number"==typeof t&&t>=0,"invalid vertex count",e.commandStr),pi((function(){return t}))}if(Qr in r){var i=r[Qr];return vi(i,(function(t,e){var n=t.invoke(e,i);return R.optional((function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">=0&&"+n+"===("+n+"|0)","invalid vertex count")})),n}))}if(o){if(hi(o)){if(o)return u?new di(u.thisDep,u.contextDep,u.propDep,(function(t,e){var n=e.def(t.ELEMENTS,".vertCount-",t.OFFSET);return R.optional((function(){t.assert(e,n+">=0","invalid vertex offset/element buffer too small")})),n})):pi((function(t,e){return e.def(t.ELEMENTS,".vertCount")}));var a=pi((function(){return-1}));return R.optional((function(){a.MISSING=!0})),a}var s=new di(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 R.optional((function(){s.DYNAMIC=!0})),s}return null}(),instances:i(to,!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]=pi((function(){return u}))}else if(t in r){var s=r[t];i[a]=vi(s,(function(t,e){return o(t,e,t.invoke(e,s))}))}}switch(t){case Nr:case wr:case br:case zr:case Sr:case Vr:case Rr:case Lr:case Pr:case Tr:return u((function(n){return R.commandType(n,"boolean",t,e.commandStr),n}),(function(e,n,r){return R.optional((function(){e.assert(n,"typeof "+r+'==="boolean"',"invalid flag "+t,e.commandStr)})),r}));case Ar:return u((function(n){return R.commandParameter(n,ai,"invalid "+t,e.commandStr),ai[n]}),(function(e,n,r){var o=e.constants.compareFuncs;return R.optional((function(){e.assert(n,r+" in "+o,"invalid "+t+", must be one of "+Object.keys(ai))})),n.def(o,"[",r,"]")}));case Ir:return u((function(t){return R.command(Xt(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 R.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 _r:return u((function(t){R.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 R.commandParameter(n,oi,a+".srcRGB",e.commandStr),R.commandParameter(r,oi,a+".srcAlpha",e.commandStr),R.commandParameter(o,oi,a+".dstRGB",e.commandStr),R.commandParameter(i,oi,a+".dstAlpha",e.commandStr),R.command(-1===ii.indexOf(n+", "+o),"unallowed blending combination (srcRGB, dstRGB) = ("+n+", "+o+")",e.commandStr),[oi[n],oi[o],oi[r],oi[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 R.optional((function(){e.assert(n,u+" in "+o,"invalid "+t+"."+i+a+", must be one of "+Object.keys(oi))})),u}R.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");R.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 xr:return u((function(n){return"string"==typeof n?(R.commandParameter(n,m,"invalid "+t,e.commandStr),[m[n],m[n]]):"object"==typeof n?(R.commandParameter(n.rgb,m,t+".rgb",e.commandStr),R.commandParameter(n.alpha,m,t+".alpha",e.commandStr),[m[n.rgb],m[n.alpha]]):void R.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 R.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 Er:return u((function(t){return R.command(Xt(t)&&4===t.length,"blend.color must be a 4d array",e.commandStr),Y(4,(function(e){return+t[e]}))}),(function(t,e,n){return R.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","blend.color must be a 4d array")})),Y(4,(function(t){return e.def("+",n,"[",t,"]")}))}));case Fr:return u((function(t){return R.commandType(t,"number",a,e.commandStr),0|t}),(function(t,e,n){return R.optional((function(){t.assert(e,"typeof "+n+'==="number"',"invalid stencil.mask")})),e.def(n,"|0")}));case Gr:return u((function(n){R.commandType(n,"object",a,e.commandStr);var r=n.cmp||"keep",o=n.ref||0,i="mask"in n?n.mask:-1;return R.commandParameter(r,ai,t+".cmp",e.commandStr),R.commandType(o,"number",t+".ref",e.commandStr),R.commandType(i,"number",t+".mask",e.commandStr),[ai[r],o,i]}),(function(t,e,n){var r=t.constants.compareFuncs;return R.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]",":",$o),e.def(n,".ref|0"),e.def('"mask" in ',n,"?",n,".mask|0:-1")]}));case Ur:case Br:return u((function(n){R.commandType(n,"object",a,e.commandStr);var r=n.fail||"keep",o=n.zfail||"keep",i=n.zpass||"keep";return R.commandParameter(r,ui,t+".fail",e.commandStr),R.commandParameter(o,ui,t+".zfail",e.commandStr),R.commandParameter(i,ui,t+".zpass",e.commandStr),[t===Br?Xo:Wo,ui[r],ui[o],ui[i]]}),(function(e,n,r){var o=e.constants.stencilOps;function i(i){return R.optional((function(){e.assert(n,'!("'+i+'" in '+r+")||("+r+"."+i+" in "+o+")","invalid "+t+"."+i+", must be one of "+Object.keys(ui))})),n.def('"',i,'" in ',r,"?",o,"[",r,".",i,"]:",$o)}return R.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)})),[t===Br?Xo:Wo,i("fail"),i("zfail"),i("zpass")]}));case Cr:return u((function(t){R.commandType(t,"object",a,e.commandStr);var n=0|t.factor,r=0|t.units;return R.commandType(n,"number",a+".factor",e.commandStr),R.commandType(r,"number",a+".units",e.commandStr),[n,r]}),(function(e,n,r){return R.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=Wo:"back"===t&&(n=Xo),R.command(!!n,a,e.commandStr),n}),(function(t,e,n){return R.optional((function(){t.assert(e,n+'==="front"||'+n+'==="back"',"invalid cull.face")})),e.def(n,'==="front"?',Wo,":",Xo)}));case kr:return u((function(t){return R.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 R.optional((function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">="+o.lineWidthDims[0]+"&&"+n+"<="+o.lineWidthDims[1],"invalid line width")})),n}));case Mr:return u((function(t){return R.commandParameter(t,ci,a,e.commandStr),ci[t]}),(function(t,e,n){return R.optional((function(){t.assert(e,n+'==="cw"||'+n+'==="ccw"',"invalid frontFace, must be one of cw,ccw")})),e.def(n+'==="cw"?'+Ho+":"+qo)}));case Or:return u((function(t){return R.command(Xt(t)&&4===t.length,"color.mask must be length 4 array",e.commandStr),t.map((function(t){return!!t}))}),(function(t,e,n){return R.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","invalid color.mask")})),Y(4,(function(t){return"!!"+n+"["+t+"]"}))}));case jr:return u((function(t){R.command("object"==typeof t&&t,a,e.commandStr);var n="value"in t?t.value:1,r=!!t.invert;return R.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 R.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]);R.optional((function(){l.shader(si[t],e,R.guessCommand())}));var r=pi((function(){return e}));return r.id=e,r}if(t in i){var a=i[t];return vi(a,(function(e,n){var r=e.invoke(n,a),o=n.def(e.shared.strings,".id(",r,")");return R.optional((function(){n(e.shared.shader,".shader(",si[t],",",o,",",e.command,");")})),o}))}return null}var u,s=a(Kr),c=a(Yr),f=null;return hi(s)&&hi(c)?(f=l.program(c.id,s.id,null,r),u=pi((function(t,e){return t.link(f)}))):u=new di(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,".",Kr);var o=r+".program("+(c?c.append(t,e):e.def(r,".",Yr))+","+n;return R.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(Xr),I(A(Wr));var T=Object.keys(_).length>0,O={framebuffer:b,draw:E,shader:S,state:_,dirty:T,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(O.profile=function(t){var e,n=t.static,r=t.dynamic;if(Hr in n){var o=!!n[Hr];(e=pi((function(t,e){return o}))).enable=o}else if(Hr in r){var i=r[Hr];e=vi(i,(function(t,e){return t.invoke(e,i)}))}return e}(t),O.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=pi((function(){return i}));else if("function"==typeof i){var a=i._reglType;"texture2d"===a||"textureCube"===a?r=pi((function(t){return t.link(i)})):"framebuffer"===a||"framebufferCube"===a?(R.command(i.color.length>0,'missing color attachment for framebuffer sent to uniform "'+t+'"',e.commandStr),r=pi((function(t){return t.link(i.color[0])}))):R.commandRaise('invalid data for uniform "'+t+'"',e.commandStr)}else Xt(i)?r=pi((function(e){return e.global.def("[",Y(i.length,(function(n){return R.command("number"==typeof i[n]||"boolean"==typeof i[n],"invalid uniform "+t,e.commandStr),i[n]})),"]")})):R.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]=vi(e,(function(t,n){return t.invoke(n,e)}))})),o}(u,d),O.drawVAO=O.scopeVAO=function(t,e){var n=t.static,r=t.dynamic;if(eo in n){var o=n[eo];return null!==o&&null===f.getVAO(o)&&(o=f.createVAO(o)),pi((function(t){return t.link(f.getVAO(o))}))}if(eo in r){var i=r[eo];return vi(i,(function(t,e){var n=t.invoke(e,i);return e.def(t.shared.vao+".getVAO("+n+")")}))}return null}(t),!O.drawVAO&&S.program&&!v&&r.angle_instanced_arrays){var N=!0,D=S.program.attributes.map((function(t){var n=e.static[t];return N=N&&!!n,n}));if(N&&D.length>0){var M=f.getVAO(f.createVAO(D));O.drawVAO=new di(null,null,null,(function(t,e){return t.link(M)})),O.useVAO=!0}}return v?O.useVAO=!0:O.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(fi(o))s.state=fr,s.buffer=i.getBuffer(i.create(o,ho,!1,!0)),s.type=0;else{var c=i.getBuffer(o);if(c)s.state=fr,s.buffer=c,s.type=0;else if(R.command("object"==typeof o&&o,"invalid data for attribute "+t,e.commandStr),"constant"in o){var f=o.constant;s.buffer="null",s.state=lr,"number"==typeof f?s.x=f:(R.command(Xt(f)&&f.length>0&&f.length<=4,"invalid constant for attribute "+t,e.commandStr),sr.forEach((function(t,e){e<f.length&&(s[t]=f[e])})))}else{c=fi(o.buffer)?i.getBuffer(i.create(o.buffer,ho,!1,!0)):i.getBuffer(o.buffer),R.command(!!c,'missing buffer for attribute "'+t+'"',e.commandStr);var l=0|o.offset;R.command(l>=0,'invalid offset for attribute "'+t+'"',e.commandStr);var d=0|o.stride;R.command(d>=0&&d<256,'invalid stride for attribute "'+t+'", must be integer betweeen [0, 255]',e.commandStr);var h=0|o.size;R.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&&(R.commandParameter(o.type,gt,"invalid type for attribute "+t,e.commandStr),v=gt[o.type]);var m=0|o.divisor;"divisor"in o&&(R.command(0===m||y,'cannot specify divisor for attribute "'+t+'", instancing not supported',e.commandStr),R.command(m>=0,'invalid divisor for attribute "'+t+'"',e.commandStr)),R.optional((function(){var n=e.commandStr,r=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(o).forEach((function(e){R.command(r.indexOf(e)>=0,'unknown parameter "'+e+'" for attribute pointer "'+t+'" (valid parameters are '+r+")",n)}))})),s.buffer=c,s.state=fr,s.size=h,s.normalized=p,s.type=v||c.dtype,s.offset=l,s.stride=d,s.divisor=m}}a[t]=pi((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]=vi(e,(function(n,r){var o=n.invoke(r,e),i=n.shared,a=n.constants,u=i.isBufferArgs,s=i.buffer;R.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=fr,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(",ho,",",o,");",d,"=",l,".dtype;","}else{",l,"=",s,".getBuffer(",o,");","if(",l,"){",d,"=",l,".dtype;",'}else if("constant" in ',o,"){",c.state,"=",lr,";","if(typeof "+o+'.constant === "number"){',c[sr[0]],"=",o,".constant;",sr.slice(1).map((function(t){return c[t]})).join("="),"=0;","}else{",sr.map((function(t,e){return c[t]+"="+o+".constant.length>"+e+"?"+o+".constant["+e+"]:0;"})).join(""),"}}else{","if(",u,"(",o,".buffer)){",l,"=",s,".createStream(",ho,",",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),O.context=function(t){var e=t.static,n=t.dynamic,r={};return Object.keys(e).forEach((function(t){var n=e[t];r[t]=pi((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]=vi(e,(function(t,n){return t.invoke(n,e)}))})),r}(c),O}function C(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 L(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(",ni,",",s,".framebuffer);"),b&&e(o,".drawBuffersWEBGL(",f,"[",s,".colorAttachments.length]);"),e("}else{",a,".bindFramebuffer(",ni,",null);"),b&&e(o,".drawBuffersWEBGL(",l,");"),e("}",u,".cur=",s,";"),r||e("}")}function P(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=Y(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 j(t,e,n,r){var o=t.shared,i=t.current,a=o.current,u=o.gl;li(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];hi(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(Xt(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 z(t,e){y&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function F(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(hi(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 G(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(gi))return;var c=t.scopeAttrib(u);R.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(",ho,",",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(",sr.map((function(t,e){return s+"."+t+"!=="+l[e]})).join("||"),"){",a,".vertexAttrib4f(",u,",",l,");",sr.map((function(t,e){return s+"."+t+"="+l[e]+";"})).join(""),"}")}c===fr?h():c===lr?p():(e("if(",c,"===",fr,"){"),h(),e("}else{"),p(),e("}"))}(t.link(r),function(t){switch(t){case To:case Mo:case Lo:return 2;case Oo:case ko:case Po:return 3;case No:case Ro:case jo:return 4;default:return 1}}(r.info.type),a)}))}function U(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(hi(p)){var g=p.value;if(R.command(null!=g,'missing uniform "'+d+'"',t.commandStr),h===Uo||h===Bo){R.command("function"==typeof g&&(h===Uo&&("texture2d"===g._reglType||"framebuffer"===g._reglType)||h===Bo&&("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===zo||h===Fo||h===Go){R.optional((function(){R.command(Xt(g),"invalid matrix for uniform "+d,t.commandStr),R.command(h===zo&&4===g.length||h===Fo&&9===g.length||h===Go&&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===Fo?b=3:h===Go&&(b=4),e(s,".uniformMatrix",b,"fv(",v,",false,",y,");")}else{switch(h){case Io:R.commandType(g,"number","uniform "+d,t.commandStr),a="1f";break;case To:R.command(Xt(g)&&2===g.length,"uniform "+d,t.commandStr),a="2f";break;case Oo:R.command(Xt(g)&&3===g.length,"uniform "+d,t.commandStr),a="3f";break;case No:R.command(Xt(g)&&4===g.length,"uniform "+d,t.commandStr),a="4f";break;case Co:R.commandType(g,"boolean","uniform "+d,t.commandStr),a="1i";break;case Do:R.commandType(g,"number","uniform "+d,t.commandStr),a="1i";break;case Lo:case Mo:R.command(Xt(g)&&2===g.length,"uniform "+d,t.commandStr),a="2i";break;case Po:case ko:R.command(Xt(g)&&3===g.length,"uniform "+d,t.commandStr),a="3i";break;case jo:case Ro:R.command(Xt(g)&&4===g.length,"uniform "+d,t.commandStr),a="4i"}e(s,".uniform",a,"(",v,",",Xt(g)?Array.prototype.slice.call(g):g,");")}continue}f=p.append(t,e)}else{if(!i(gi))continue;f=e.def(u.uniforms,"[",n.id(d),"]")}h===Uo?(R(!Array.isArray(f),"must specify a scalar prop for textures"),e("if(",f,"&&",f,'._reglType==="framebuffer"){',f,"=",f,".color[0];","}")):h===Bo&&(R(!Array.isArray(f),"must specify a scalar prop for cube maps"),e("if(",f,"&&",f,'._reglType==="framebufferCube"){',f,"=",f,".color[0];","}")),R.optional((function(){function n(n,r){t.assert(e,n,'bad data or missing for uniform "'+d+'". '+r)}function r(t){R(!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)?R(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){R(!Array.isArray(f),"must not specify a value type"),n("typeof "+f+'==="function"&&'+f+'._reglType==="texture'+(e===vo?"2d":"Cube")+'"',"invalid texture type",t.commandStr)}switch(h){case Do:r("number");break;case Mo:o(2);break;case ko:o(3);break;case Ro:o(4);break;case Io:r("number");break;case To:o(2);break;case Oo:o(3);break;case No:o(4);break;case Co:r("boolean");break;case Lo:o(2);break;case Po:o(3);break;case jo:case zo:o(4);break;case Fo:o(9);break;case Go:o(16);break;case Uo:i(vo);break;case Bo:i(go)}}));var w=1;switch(h){case Uo:case Bo:var E=e.def(f,"._texture");e(s,".uniform1i(",v,",",E,".bind());"),e.exit(E,".unbind();");continue;case Do:case Co:a="1i";break;case Mo:case Lo:a="2i",w=2;break;case ko:case Po:a="3i",w=3;break;case Ro:case jo:a="4i",w=4;break;case Io:a="1f";break;case To:a="2f",w=2;break;case Oo:a="3f",w=3;break;case No:a="4f",w=4;break;case zo:a="Matrix2fv";break;case Fo:a="Matrix3fv";break;case Go:a="Matrix4fv"}if(e(s,".uniform",a,"(",v,","),"M"===a.charAt(0)){var x=Math.pow(h-zo+2,2),_=t.global.def("new Float32Array(",x,")");Array.isArray(f)?e("false,(",Y(x,(function(t){return _+"["+t+"]="+f[t]})),",",_,")"):e("false,(Array.isArray(",f,")||",f," instanceof Float32Array)?",f,":(",Y(x,(function(t){return _+"["+t+"]="+f+"["+t+"]"})),",",_,")")}else w>1?e(Y(w,(function(t){return Array.isArray(f)?f[t]:f+"["+t+"]"}))):(R(!Array.isArray(f),"uniform value must not be an array"),e(f));e(");")}}function V(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,".",Zr),o&&c("if("+o+")"+i+".bindBuffer("+po+","+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($r),h=c(Jr),p=function(){var o,i=u.count,s=e;return i?((i.contextDep&&r.contextDynamic||i.propDep)&&(s=n),o=i.append(t,s),R.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,".",Qr),R.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(to),l=t.instancing);var v=s+".type",g=u.elements&&hi(u.elements);function m(){function t(){n(l,".drawElementsInstancedANGLE(",[d,p,v,h+"<<(("+v+"-"+cr+")>>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+"-"+cr+")>>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 W(t,e,n,r,o){var i=M(),a=i.proc("body",o);return R.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 X(t,e,n,r){z(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);"),G(t,e,n,r.attributes,(function(){return!0}))),U(t,e,n,r.uniforms,(function(){return!0})),V(t,e,e,n)}function H(t,e,n,r){function o(){return!0}t.batchId="a1",z(t,e),G(t,e,n,r.attributes,o),U(t,e,n,r.uniforms,o),V(t,e,e,n)}function q(t,e,n,r){z(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&&C(t,s,n.context),n.needsFramebuffer&&L(t,s,n.framebuffer),j(t,s,n.state,c),n.profile&&c(n.profile)&&F(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);"),G(t,u,n,r.attributes,f),G(t,s,n,r.attributes,c)),U(t,u,n,r.uniforms,f),U(t,s,n,r.uniforms,c),V(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 W(H,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&&!Xt(t)){for(var e=Object.keys(t),n=0;n<e.length;++n)if(B.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(B.isDynamic(n)){"function"==typeof n&&(n=r[e]=B.unbox(n));var i=vi(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 B.DynamicVariable(gr,{thisDep:a,contextDep:u,propDep:s,ref:c,append:function(t,e){i.forEach((function(n){var o=r[n];if(B.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=M(),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;"),L(t,e),L(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(",ho,",",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,"("),Xt(l)){var h=l.length;o=t.global.def(c,".",r),a=t.global.def(f,".",r),d(Y(h,(function(t){return o+"["+t+"]"})),");",Y(h,(function(t){return a+"["+t+"]="+o+"["+t+"];"})).join("")),e("if(",Y(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=M();u.stats=u.link(a),Object.keys(r.static).forEach((function(t){K(u,r,t)})),lo.forEach((function(e){K(u,t,e)}));var s=k(t,r,o,i,u);return function(t,e){var n=t.proc("draw",1);z(t,n),C(t,n,e.context),L(t,n,e.framebuffer),P(t,n,e),j(t,n,e.state),F(t,n,e,!1,!0);var r=e.shader.progVar.append(t,n);if(n(t.shared.gl,".useProgram(",r,".program);"),e.shader.program)X(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 W(X,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))}C(t,r,e.context),e.framebuffer&&e.framebuffer.append(t,r),li(Object.keys(e.state)).forEach((function(n){var i=e.state[n].append(t,r);Xt(i)?i.forEach((function(e,o){r.set(t.next[n],"["+o+"]",e)})):r.set(o.next,"."+n,i)})),F(t,r,e,!0,!0),[Zr,Jr,Qr,to,$r].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(Yr),a(Kr),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",z(t,n);var r=!1,o=!0;Object.keys(e.context).forEach((function(t){r=r||e.context[t].propDep})),r||(C(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||L(t,n,i)):L(t,n,null),e.state.viewport&&e.state.viewport.propDep&&(r=!0),P(t,n,e),j(t,n,e.state,(function(t){return!u(t)})),e.profile&&u(e.profile)||F(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)q(t,n,e,null);else{var c=s.append(t,n);if(n(t.shared.gl,".useProgram(",c,".program);"),e.shader.program)q(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 W(q,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 yi=34918,bi=34919,wi=35007,Ei=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(wi,r),o.push(r),c(o.length-1,o.length,t)},endQuery:function(){e.ext_disjoint_timer_query.endQueryEXT(wi)},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,bi)?(a+=e.ext_disjoint_timer_query.getQueryObjectEXT(c,yi),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}}},xi=16384,_i=256,Si=1024,Ai=34962,Ii="webglcontextlost",Ti="webglcontextrestored",Oi=1,Ni=2,Di=3;function Mi(t,e){for(var n=0;n<t.length;++n)if(t[n]===e)return n;return-1}return function(n){var r=q(n);if(!r)return null;var o=r.gl,i=o.getContextAttributes(),a=o.isContextLost(),u=function(t,e){var n={};function r(e){R.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=Ei(o,d),p=W(),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=ct(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=wt,this.byteLength=0,this.dimension=1,this.dtype=xt,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||_t,n.length>0)if(Array.isArray(n[0])){u=bt(n);for(var f=1,l=1;l<u.length;++l)f*=u[l];e.dimension=f,c(e,s=yt(n,u,e.dtype),r),a?e.persistentData=s:ot.freeType(s)}else if("number"==typeof n[0]){e.dimension=i;var d=ot.allocType(e.dtype,n.length);It(d,n),c(e,d,r),a?e.persistentData=d:ot.freeType(d)}else t(n[0])?(e.dimension=n[0].length,e.dtype=o||At(n[0])||_t,c(e,s=yt(n,[n.length,n[0].length],e.dtype),r),a?e.persistentData=s:ot.freeType(s)):R.raise("invalid buffer data")}else if(t(n))e.dtype=o||At(n),e.dimension=i,c(e,n,r),a&&(e.persistentData=new Uint8Array(new Uint8Array(n.buffer)));else if(ft(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]):R.raise("invalid shape"),e.dtype=o||At(n.data)||_t,e.dimension=g;var b=ot.allocType(e.dtype,v*g);Tt(b,n.data,v,g,m,y,p),c(e,b,r),a?e.persistentData=b:ot.freeType(b)}else n instanceof ArrayBuffer?(e.dtype=xt,e.dimension=i,c(e,n,r),a&&(e.persistentData=new Uint8Array(new Uint8Array(n)))):R.raise("invalid buffer data")}function l(t){n.bufferCount--,o(t);var r=t.buffer;R(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=wt,i=null,a=0,u=0,s=1;return Array.isArray(n)||t(n)||ft(n)||n instanceof ArrayBuffer?i=n:"number"==typeof n?a=0|n:n&&(R.type(n,"object","buffer arguments must be an object, a number or an array"),"data"in n&&(R(null===i||Array.isArray(i)||t(i)||ft(i),"invalid data for buffer"),i=n.data),"usage"in n&&(R.parameter(n.usage,mt,"invalid buffer usage"),o=mt[n.usage]),"type"in n&&(R.parameter(n.type,gt,"invalid buffer type"),u=gt[n.type]),"dimension"in n&&(R.type(n.dimension,"number","invalid dimension"),s=0|n.dimension),"length"in n&&(R.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||xt,d.usage=o,d.dimension=s,d.byteLength=a),r.profile&&(d.stats.size=d.byteLength*St[d.dtype]),h}function p(t,n){R(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=ot.allocType(d.dtype,e.length);It(i,e),p(i,o),ot.freeType(i)}else if(Array.isArray(e[0])||t(e[0])){r=bt(e);var a=yt(e,r,d.dtype);p(a,o),ot.freeType(a)}else R.raise("invalid buffer data")}else if(ft(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]):R.raise("invalid shape");var v=Array.isArray(e.data)?d.dtype:At(e.data),g=ot.allocType(v,s*c);Tt(g,e.data,s,c,f,l,e.offset),p(g,o),ot.freeType(g)}else R.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,Et,0,1,!1),n},destroyStream:function(t){s.push(t)},clear:function(){lt(a).forEach(l),s.forEach(l)},getBuffer:function(t){return t&&t._buffer instanceof u?t._buffer:null},restore:function(){lt(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 Zn;var c=0,f={},l={Record:Zn,scope:{},state:u,currentVAO:null,targetVAO:null,restore:d()?function(){d()&&lt(f).forEach((function(t){t.refresh()}))}:function(){},createVAO:function(e){var r=new p;function u(e){R(Array.isArray(e),"arguments to vertex array constructor must be an array"),R(e.length<a,"too many attributes"),R(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 Zn,h=l.data||l;Array.isArray(h)||t(h)||ft(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,Kn,!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?(R.parameter(l.type,gt,"invalid buffer type"),d.type=gt[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,R(d.size>=1&&d.size<=4,"size must be between 1 and 4"),R(d.offset>=0,"invalid offset"),R(d.stride>=0&&d.stride<=255,"stride must be between 0 and 255"),R(d.divisor>=0,"divisor must be positive"),R(!d.divisor||!!n.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in l?(R(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):R(!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(){lt(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(Kn,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:Rt,uint16:Lt};function s(t){this.id=a++,i[this.id]=this,this.buffer=t,this.primType=Mt,this.vertCount=0,this.type=0}n.oes_element_index_uint&&(u.uint32=jt),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)&&(!ft(i)||t(i.data))||(d=n.oes_element_index_uint?jt:Lt),r._initBuffer(o.buffer,i,a,d,3)}else e.bufferData(zt,c,a),o.buffer.dtype=l||Rt,o.buffer.usage=a,o.buffer.dimension=3,o.buffer.byteLength=c;if(l=f,!f){switch(o.buffer.dtype){case Rt:case kt:l=Rt;break;case Lt:case Ct:l=Lt;break;case jt:case Pt:l=jt;break;default:R.raise("unsupported type for element array")}o.buffer.dtype=l}o.type=l,R(l!==jt||!!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===Lt?h>>=1:l===jt&&(h>>=2)),o.vertCount=h;var p=u;if(u<0){p=Mt;var v=o.buffer.dimension;1===v&&(p=Nt),2===v&&(p=Dt),3===v&&(p=Mt)}o.primType=p}function l(t){o.elementsCount--,R(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,zt,!0),a=new s(i._buffer);function c(e){if(e)if("number"==typeof e)i(e),a.primType=Mt,a.vertCount=0|e,a.type=Rt;else{var n=null,r=Gt,o=-1,s=-1,l=0,d=0;Array.isArray(e)||t(e)||ft(e)?n=e:(R.type(e,"object","invalid arguments for elements"),"data"in e&&(n=e.data,R(Array.isArray(n)||t(n)||ft(n),"invalid data for element buffer")),"usage"in e&&(R.parameter(e.usage,mt,"invalid element buffer usage"),r=mt[e.usage]),"primitive"in e&&(R.parameter(e.primitive,Ot,"invalid element buffer primitive"),o=Ot[e.primitive]),"count"in e&&(R("number"==typeof e.count&&e.count>=0,"invalid vertex count for elements"),s=0|e.count),"type"in e&&(R.parameter(e.type,u,"invalid buffer type"),d=u[e.type]),"length"in e?l=0|e.length:(l=s,d===Lt||d===Ct?l*=2:d!==jt&&d!==Pt||(l*=4))),f(a,n,r,o,s,l,d)}else i(),a.primType=Mt,a.vertCount=0,a.type=Rt;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,zt,!0,!1)._buffer)),f(e,t,Ft,-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(){lt(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===$n?i:a,s=u[r];if(!s){var c=n.str(r);s=t.createShader(e),t.shaderSource(s,c),t.compileShader(s),R.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($n,e.fragId),d=c(Qn,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),R.linkError(t,h,n.str(e.fragId),n.str(e.vertId),r);var v=t.getProgramParameter(h,Jn);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,tr);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);lt(i).forEach(e),i={},lt(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){R.command(n>=0,"missing vertex shader",u),R.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),_=Sn(o,d,y,(function(){I.procs.poll()}),m,l,r),S=Nn(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);R(o===e&&i===n,"inconsistent width/height for supplied texture"),r.refCount+=1}else{var a=t.renderbuffer._renderbuffer;R(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,Mn,n.renderbuffer._renderbuffer.renderbuffer))}function v(t){var e=kn,n=null,r=null,o=t;"object"==typeof t&&(o=t.data,"target"in t&&(e=0|t.target)),R.type(o,"function","invalid attachment data");var i=o._reglType;return"texture2d"===i?(n=o,R(e===kn)):"textureCube"===i?(n=o,R(e>=Rn&&e<Rn+6,"invalid cube map target")):"renderbuffer"===i?(r=o,e=Mn):R.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(kn,u,null)}var s=i.create({width:t,height:e,format:r});return s._renderbuffer.refCount=0,new l(Mn,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;R(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(Cn+n,o[n]);for(n=o.length;n<r.maxColorAttachments;++n)t.framebufferTexture2D(Dn,Cn+n,kn,null,0);t.framebufferTexture2D(Dn,jn,kn,null,0),t.framebufferTexture2D(Dn,Ln,kn,null,0),t.framebufferTexture2D(Dn,Pn,kn,null,0),p(Ln,e.depthAttachment),p(Pn,e.stencilAttachment),p(jn,e.depthStencilAttachment);var i=t.checkFramebufferStatus(Dn);t.isContextLost()||i===zn||R.raise("framebuffer configuration not supported, status = "+qn[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;R(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,T=null,O=null,N=!1;if("number"==typeof t)a=0|t,d=0|e||a;else if(t){R.type(t,"object","invalid arguments for framebuffer");var D=t;if("shape"in D){var M=D.shape;R(Array.isArray(M)&&M.length>=2,"invalid shape for framebuffer"),a=M[0],d=M[1]}else"radius"in D&&(a=d=D.radius),"width"in D&&(a=D.width),"height"in D&&(d=D.height);("color"in D||"colors"in D)&&(b=D.color||D.colors,Array.isArray(b)&&R(1===b.length||n.webgl_draw_buffers,"multiple render targets not supported")),b||("colorCount"in D&&(A=0|D.colorCount,R(A>0,"invalid color buffer count")),"colorTexture"in D&&(w=!!D.colorTexture,E="rgba4"),"colorType"in D&&(_=D.colorType,w?(R(n.oes_texture_float||!("float"===_||"float32"===_),"you must enable OES_texture_float in order to use floating point framebuffer objects"),R(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"===_?(R(n.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),E="rgba16f"):"float"!==_&&"float32"!==_||(R(n.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),E="rgba32f"),R.oneOf(_,f,"invalid color type")),"colorFormat"in D&&(E=D.colorFormat,s.indexOf(E)>=0?w=!0:c.indexOf(E)>=0?w=!1:w?R.oneOf(D.colorFormat,s,"invalid color format for texture"):R.oneOf(D.colorFormat,c,"invalid color format for renderbuffer"))),("depthTexture"in D||"depthStencilTexture"in D)&&(N=!(!D.depthTexture&&!D.depthStencilTexture),R(!N||n.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in D&&("boolean"==typeof D.depth?p=D.depth:(I=D.depth,y=!1)),"stencil"in D&&("boolean"==typeof D.stencil?y=D.stencil:(T=D.stencil,p=!1)),"depthStencil"in D&&("boolean"==typeof D.depthStencil?p=y=D.depthStencil:(O=D.depthStencil,p=!1,y=!1))}else a=d=1;var k=null,C=null,L=null,P=null;if(Array.isArray(b))k=b.map(v);else if(b)k=[v(b)];else for(k=new Array(A),o=0;o<A;++o)k[o]=g(a,d,w,E,_);R(n.webgl_draw_buffers||k.length<=1,"you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers."),R(k.length<=r.maxColorAttachments,"too many color attachments, not supported"),a=a||k[0].width,d=d||k[0].height,I?C=v(I):p&&!y&&(C=g(a,d,N,"depth","uint32")),T?L=v(T):y&&!p&&(L=g(a,d,!1,"stencil","uint8")),O?P=v(O):!I&&!T&&y&&p&&(P=g(a,d,N,"depth stencil","depth stencil")),R(!!I+!!T+!!O<=1,"invalid framebuffer configuration, can specify exactly one depth/stencil attachment");var j=null;for(o=0;o<k.length;++o)if(h(k[o],a,d),R(!k[o]||k[o].texture&&Gn.indexOf(k[o].texture._texture.format)>=0||k[o].renderbuffer&&Hn.indexOf(k[o].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+o+" is invalid"),k[o]&&k[o].texture){var z=Un[k[o].texture._texture.format]*Bn[k[o].texture._texture.type];null===j?j=z:R(j===z,"all color attachments much have the same number of bits per pixel.")}return h(C,a,d),R(!C||C.texture&&C.texture._texture.format===Fn||C.renderbuffer&&C.renderbuffer._renderbuffer.format===Vn,"invalid depth attachment for framebuffer object"),h(L,a,d),R(!L||L.renderbuffer&&L.renderbuffer._renderbuffer.format===Wn,"invalid stencil attachment for framebuffer object"),h(P,a,d),R(!P||P.texture&&P.texture._texture.format===Xn||P.renderbuffer&&P.renderbuffer._renderbuffer.format===Xn,"invalid depth-stencil attachment for framebuffer object"),x(i),i.width=a,i.height=d,i.colorAttachments=k,i.depthAttachment=C,i.stencilAttachment=L,i.depthStencilAttachment=P,l.color=k.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){R(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;R(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){R.type(t,"object","invalid arguments for framebuffer");var m=t;if("shape"in m){var y=m.shape;R(Array.isArray(y)&&y.length>=2,"invalid shape for framebuffer"),R(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&&R(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)&&R(1===h.length||n.webgl_draw_buffers,"multiple render targets not supported")),h||("colorCount"in m&&(g=0|m.colorCount,R(g>0,"invalid color buffer count")),"colorType"in m&&(R.oneOf(m.colorType,f,"invalid color type"),v=m.colorType),"colorFormat"in m&&(p=m.colorFormat,R.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];R("function"==typeof w&&"textureCube"===w._reglType,"invalid cube map"),d=d||w.width,R(w.width===d&&w.height===d,"invalid cube map shape"),l.color[r]={target:Rn,data:c[r]}}for(r=0;r<6;++r){for(var E=0;E<c.length;++E)l.color[E].target=Rn+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(R(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(){lt(w).forEach(_)},restore:function(){u.cur=null,u.next=null,u.dirty=!0,lt(w).forEach((function(e){e.framebuffer=t.createFramebuffer(),S(e)}))}})}(o,d,y,_,S,l),I=mi(o,f,d,y,b,E,0,A,{},w,x,{elements:null,primitive:4,count:-1,offset:0,instances:-1},m,h,r),T=ir(o,A,I.procs.poll,m,i,d,y),O=I.next,N=o.canvas,D=[],M=[],k=[],C=[r.onDestroy],L=null;function P(){if(0===D.length)return h&&h.update(),void(L=null);L=V.next(P),Z();for(var t=D.length-1;t>=0;--t){var e=D[t];e&&e(m,null,0)}o.flush(),h&&h.update()}function j(){!L&&D.length>0&&(L=V.next(P))}function z(){L&&(V.cancel(P),L=null)}function F(t){t.preventDefault(),a=!0,z(),M.forEach((function(t){t()}))}function G(t){o.getError(),a=!1,u.restore(),x.restore(),b.restore(),_.restore(),S.restore(),A.restore(),w.restore(),h&&h.restore(),I.procs.refresh(),j(),k.forEach((function(t){t()}))}function U(t){function n(t,e){var n={},r={};return Object.keys(t).forEach((function(o){var i=t[o];if(B.isDynamic(i))r[o]=B.unbox(i,o);else{if(e&&Array.isArray(i))for(var a=0;a<i.length;++a)if(B.isDynamic(i[a]))return void(r[o]=B.unbox(i,o));n[o]=i}})),{dynamic:r,static:n}}R(!!t,"invalid args to regl({...})"),R.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&&R.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()}})}N&&(N.addEventListener(Ii,F,!1),N.addEventListener(Ti,G,!1));var X=A.setFBO=U({framebuffer:B.define.call(null,Oi,"framebuffer")});function H(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|=xi),"depth"in e&&(o.clearDepth(+e.depth),n|=_i),"stencil"in e&&(o.clearStencil(0|e.stencil),n|=Si),R(!!n,"called regl.clear with no buffer specified"),o.clear(n)}function Y(t){return R.type(t,"function","regl.frame() callback must be a function"),D.push(t),j(),{cancel:function(){var e=Mi(D,t);R(e>=0,"cannot cancel a frame twice"),D[e]=function t(){var e=Mi(D,t);D[e]=D[D.length-1],D.length-=1,D.length<=0&&z()}}}}function K(){var t=O.viewport,e=O.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 Z(){m.tick+=1,m.time=Q(),K(),I.procs.poll()}function $(){_.refresh(),K(),I.procs.refresh(),h&&h.update()}function Q(){return(W()-p)/1e3}$();var J=e(U,{clear:function(t){if(R("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)X(e({framebuffer:t.framebuffer.faces[n]},t),H);else X(t,H);else H(0,t)},prop:B.define.bind(null,Oi),context:B.define.bind(null,Ni),this:B.define.bind(null,Di),draw:U({}),buffer:function(t){return b.create(t,Ai,!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:Y,on:function(t,e){var n;switch(R.type(e,"function","listener callback must be a function"),t){case"frame":return Y(e);case"lost":n=M;break;case"restore":n=k;break;case"destroy":n=C;break;default:R.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:T,destroy:function(){D.length=0,z(),N&&(N.removeEventListener(Ii,F),N.removeEventListener(Ti,G)),x.clear(),A.clear(),S.clear(),_.clear(),E.clear(),b.clear(),w.clear(),h&&h.clear(),C.forEach((function(t){t()}))},_gl:o,_refresh:$,poll:function(){Z(),h&&h.update()},now:Q,stats:l});return r.onDone(null,J),J}}()},7061:(t,e,n)=>{var r=n(8698).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},8698: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},4687:(t,e,n)=>{var r=n(7061)();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(1983);var t,e=(t=n(115))&&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:()=>jf,DagreCompoundLayout:()=>af,DagreLayout:()=>sr,ERLayout:()=>ih,Force2Layout:()=>K,ForceAtlas2Layout:()=>Rd,ForceLayout:()=>Vt,FruchtermanGPULayout:()=>yd,FruchtermanLayout:()=>Uf,GForceGPULayout:()=>xd,GForceLayout:()=>L,GridLayout:()=>D,Layout:()=>ah,Layouts:()=>uh,MDSLayout:()=>Ff,RadialLayout:()=>Lf,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=t.call(this)||this,o=r,i={},a=o.getDefaultCfg();return Object.assign(i,a,n,e),Object.keys(i).forEach((function(t){var e=i[t];o[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(){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,n){i(e.x)||(e.x=Math.random()*t.width),i(e.y)||(e.y=Math.random()*t.height);var r=t.degreesMap[e.id];h[e.id]=q(q({},e),{data:q(q({},e.data),{size:t.nodeSize(e)||30,layout:{inDegree:r.in,outDegree:r.out,degree:r.all,tDegree:r.in,sDegree:r.out,force:{mass:t.getMass(e),nodeStrength:t.nodeStrength(e)}}})}),p[e.id]=n})),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.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}))},ae=function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:oe(t),edges:ie(t),value:t.graph()};return void 0===e.value&&delete e.value,e};function ue(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 se(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ue(Object(n),!0).forEach((function(e){ce(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ue(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ce(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fe(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 le={compound:!1,multigraph:!1,directed:!0},de=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 ae(e)},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=se(se({},le),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&&fe(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();de.fromJSON=function(t){var e=new de(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 he=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 pe=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);he(t,e,"post"===n,a,o,i)})),i};var ve=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)}}(),ge=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ve(e,t),e}(Zt),me=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ve(e,t),e}(de),ye=function(){return 1},be=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,we(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,we(e,n,a)})),t.removeNode(r.v),o?u:void 0},we=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 Ee=function(t,e){var n;if(t.nodeCount()<=1)return[];var r=function(t,e){var n=new me,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 ge);var s=r+1;return n.nodes().forEach((function(t){we(i,s,n.node(t))})),{buckets:i,zeroIdx:s,graph:n}}(t,e||ye);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();)be(t,e,n,r);for(;r=i.dequeue();)be(t,e,n,r);if(t.nodeCount())for(var u=e.length-2;u>0;--u)if(r=e[u].dequeue()){o=o.concat(be(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 xe=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)}}(),_e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return xe(e,t),e}(de),Se=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},Ae=function(t){var e=new _e({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},Ie=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}},Te=function(t){for(var e=[],n=Ne(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},Oe=function(t,e,n,r){var o={width:0,height:0};return i(n)&&i(r)&&(o.rank=n,o.order=r),Se(t,"border",o,e)},Ne=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},De=function(t,e){var n=Date.now();try{return e()}finally{console.log("".concat(t," time: ").concat(Date.now()-n,"ms"))}},Me=function(t,e){return e()},ke=function(t,e){return t.reduce((function(t,n){return e(t)>e(n)?n:t}))};const Re=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=Se(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 Ce=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)}))},Le=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))}))},Pe=function(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen},je=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)||Pe(e,o)||(t.setNode(a,{}),t.setEdge(r,a,{}),n(a))}))})),t.nodeCount()},ze=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&&Pe(e,o)||(t.setNode(a,{}),t.setEdge(r,a,{}),n(a))}))})),t.nodeCount()},Fe=function(t,e){return ke(e.edges(),(function(n){return t.hasNode(n.v)!==t.hasNode(n.w)?Pe(e,n):1/0}))},Ge=function(t,e,n){t.nodes().forEach((function(t){e.node(t).rank||(e.node(t).rank=0),e.node(t).rank+=n}))},Ue=function(t,e){return pe(t,e,"pre")},Be=function(t,e){return pe(t,e,"post")},Ve=function(t,e){var n=Be(t,t.nodes());null==(n=null==n?void 0:n.slice(0,(null==n?void 0:n.length)-1))||n.forEach((function(n){We(t,e,n)}))},We=function(t,e,n){var r=t.node(n).parent;t.edgeFromArgs(n,r).cutvalue=Xe(t,e,n)},Xe=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,Qe(t,n,s)){var l=t.edgeFromArgs(n,s).cutvalue;u+=c?-l:l}}})),u},He=function(t,e){void 0===e&&(e=t.nodes()[0]),qe(t,{},1,e)},qe=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},Ye=function(t){return t.edges().find((function(e){return t.edge(e).cutvalue<0}))},Ke=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===Je(t,t.node(e.v),u)&&s!==Je(t,t.node(e.w),u)}));return ke(c,(function(t){return Pe(e,t)}))},Ze=function(t,e,n,r){var o=n.v,i=n.w;t.removeEdge(o,i),t.setEdge(r.v,r.w,{}),He(t),Ve(t,e),$e(t,e)},$e=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=Ue(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)}))},Qe=function(t,e,n){return t.hasEdge(e,n)},Je=function(t,e,n){return n.low<=e.lim&&e.lim<=n.lim};const tn=function(t){var e=function(t){var e=(new _e).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);Ce(e);var n,r,o=function(t){var e,n,r=new _e({directed:!1}),o=t.nodes()[0],i=t.nodeCount();for(r.setNode(o,{});je(r,t)<i;)e=Fe(r,t),n=r.hasNode(e.v)?Pe(t,e):-Pe(t,e),Ge(r,t,n);return r}(e);for(He(o),Ve(o,e);n=Ye(o);)r=Ke(o,e,n),Ze(o,e,n,r)};var en=Ce,nn=function(t){Le(t),function(t){var e,n,r=new _e({directed:!1}),o=t.nodes()[0],i=t.nodes().filter((function(e){return!!t.node(e)})).length;for(r.setNode(o,{});ze(r,t)<i;)e=Fe(r,t),n=r.hasNode(e.v)?Pe(t,e):-Pe(t,e),Ge(r,t,n)}(t)};const rn=function(t){switch(t.graph().ranker){case"network-simplex":!function(t){tn(t)}(t);break;case"tight-tree":default:nn(t);break;case"longest-path":en(t)}};var on=function t(e,n,r,o,i,a,u){var s=e.children(u);if(null==s?void 0:s.length){var c=Oe(e,"_bt"),f=Oe(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})},an=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 un=function(t){var e,n=Se(t,"root",{},"_root"),r=an(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){on(t,n,a,u,i,r,e)})),t.graph().nodeRankFactor=a};var sn=function(t,e,n,r,o,i){var a={rank:i,borderType:e,width:0,height:0},u=o[e][i-1],s=Se(t,"border",a,n);o[e][i]=s,t.setParent(s,r),u&&t.setEdge(u,s,{weight:1})};const cn=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)sn(t,"borderLeft","_bl",n,o,i),sn(t,"borderRight","_br",n,o,i)}};null===(e=t.children())||void 0===e||e.forEach((function(t){return n(t)}))};var fn=function(t){t.nodes().forEach((function(e){ln(t.node(e))})),t.edges().forEach((function(e){ln(t.edge(e))}))},ln=function(t){var e=t.width;t.width=t.height,t.height=e},dn=function(t){(null==t?void 0:t.y)&&(t.y=-t.y)},hn=function(t){var e=t.x;t.x=t.y,t.y=e};const pn=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){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("y")&&dn(r)}))}(t),"lr"!==n&&"rl"!==n||(function(t){t.nodes().forEach((function(e){hn(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 hn(t)})),r.hasOwnProperty("x")&&hn(r)}))}(t),fn(t))},vn=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=Math.max.apply(Math,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 gn=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 mn=function(t,e){for(var n=0,r=1;r<(null==e?void 0:e.length);r+=1)n+=gn(t,e[r-1],e[r]);return n};const yn=function(t,e,n){var r=function(t){for(var e;t.hasNode(e="_root".concat(Math.random())););return e}(t),o=new _e({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 bn=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 wn=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)&&bn(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 En=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 xn=function(t,e,n,r){var o=function(t,e){var n={lhs:[],rhs:[]};return null==t||t.forEach((function(t){var e;e=t,(r?e.hasOwnProperty("barycenter"):e.hasOwnProperty("fixorder")&&!isNaN(e.fixorder)||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=En(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=En(u,a,f)}));var l={vs:u.flat()};return c&&(l.barycenter=s/c,l.weight=c),l};const _n=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=wn(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=xn(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 Sn=function(t,e,n){return e.map((function(e){return yn(t,e,n)}))},An=function(t,e,n,r){var o=new _e;null==t||t.forEach((function(t){for(var i,a=t.graph().root,u=_n(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)}))},In=function(t,e){null==e||e.forEach((function(e){null==e||e.forEach((function(e,n){t.node(e).order=n}))}))};var Tn=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)}}(),On=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Tn(e,t),e}(de),Nn=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}))},Dn=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},Mn=function(t,e,n){var r=e;return r>n&&(r=n),!!t[r]},kn=function(t,e,n,r){var o=new On,i=t.graph(),a=Rn(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 Rn=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}},Cn=function(t,e){return t.node(e).width||0},Ln=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 Pn=function(t){var e,n=Ae(t);!function(t){var e=Te(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,Ln(Ln([],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=Te(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=Nn(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)||Dn(n,r,e)}))})),i=s+1,o=l)})),r})),n}(t,e),function(t,e){var n={},r=function(e,r,o,i,a){for(var u,s=[],c=r;c<o;c++)s.push(c);s.forEach((function(r){var o,s;u=e[r],(null===(o=t.node(u))||void 0===o?void 0:o.dummy)&&(null===(s=t.predecessors(u))||void 0===s||s.forEach((function(e){var r=t.node(e);r.dummy&&(r.order<i||r.order>a)&&Dn(n,e,u)})))}))};return(null==e?void 0:e.length)&&e.reduce((function(e,n){var o,i=-1,a=0;return null==n||n.forEach((function(u,s){var c;if("border"===(null===(c=t.node(u))||void 0===c?void 0:c.dummy)){var f=t.predecessors(u)||[];f.length&&(o=t.node(f[0]).order,r(n,a,s,i,o),a=s,i=o)}r(n,a,n.length,o,e.length)})),n})),n}(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]&&!Mn(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=kn(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 ke(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=Cn(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=Math.min.apply(Math,n),o=Math.max.apply(Math,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-Math.min.apply(Math,c):o-Math.max.apply(Math,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 jn=function(){return jn=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},jn.apply(this,arguments)},zn=function(t,e,n){e(" removeSelfEdges",(function(){er(t)})),e(" acyclic",(function(){!function(t){var e="greedy"===t.graph().acyclicer?Ee(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(){un(t)})),e(" rank",(function(){rn(Ae(t))})),e(" injectEdgeLabelProxies",(function(){qn(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(){Yn(t)})),e(" removeEdgeLabelProxies",(function(){Kn(t)})),e(" normalize.run",(function(){Re(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(){cn(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=Ne(t),r=[],o=[],i=1;i<n+1;i++)r.push(i);for(i=n-1;i>-1;i--)o.push(i);var a=Sn(t,r,"inEdges"),u=Sn(t,o,"outEdges"),s=vn(t);In(t,s);for(var c,f=Number.POSITIVE_INFINITY,d=(i=0,0);d<4;++i,++d)An(i%2?a:u,i%4>=2,!1,e),s=Te(t),(h=mn(t,s))<f&&(d=0,c=l(s),f=h);for(s=vn(t),In(t,s),i=0,d=0;d<4;++i,++d){var h;An(i%2?a:u,i%4>=2,!0,e),s=Te(t),(h=mn(t,s))<f&&(d=0,c=l(s),f=h)}In(t,c)}(t,null==n?void 0:n.keepNodeOrder)})),e(" insertSelfEdges",(function(){nr(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||fn(t)}(t)})),e(" position",(function(){Pn(t)})),e(" positionSelfEdges",(function(){rr(t)})),e(" removeBorderNodes",(function(){tr(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(){Qn(t)})),e(" undoCoordinateSystem",(function(){pn(t)})),e(" translateGraph",(function(){Zn(t)})),e(" assignNodeIntersects",(function(){$n(t)})),e(" reversePoints",(function(){Jn(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)}))},Fn=["nodesep","edgesep","ranksep","marginx","marginy"],Gn={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Un=["acyclicer","ranker","rankdir","align"],Bn=["width","height","layer","fixorder"],Vn={width:0,height:0},Wn=["minlen","weight","width","height","labeloffset"],Xn={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Hn=["labelpos"],qn=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};Se(t,"edge-proxy",o,"_ep")}}))},Yn=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},Kn=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))}))},Zn=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},$n=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(Ie(i,n)),o.points.push(Ie(a,r))}))},Qn=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}}))},Jn=function(t){t.edges().forEach((function(e){var n,r=t.edge(e);r.reversed&&(null===(n=r.points)||void 0===n||n.reverse())}))},tr=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)}))},er=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)}}))},nr=function(t){var e=Te(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){Se(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}))}))},rr=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}}))},or=function(t,e){var n={};return null==e||e.forEach((function(e){void 0!==t[e]&&(n[e]=+t[e])})),n},ir=function(t){void 0===t&&(t={});var e={};return Object.keys(t).forEach((function(n){e[n.toLowerCase()]=t[n]})),e};const ar=function(t,e){var n=e&&e.debugTiming?De:Me;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 _e({multigraph:!0,compound:!0}),n=ir(t.graph()),r={};return null==Un||Un.forEach((function(t){void 0!==n[t]&&(r[t]=n[t])})),e.setGraph(Object.assign({},Gn,or(n,Fn),r)),t.nodes().forEach((function(n){var r=ir(t.node(n)),o=jn(jn({},Vn),r),i=or(o,Bn);e.setNode(n,i),e.setParent(n,t.parent(n))})),t.edges().forEach((function(n){var r=ir(t.edge(n)),o={};null==Hn||Hn.forEach((function(t){void 0!==r[t]&&(o[t]=r[t])})),e.setEdgeObj(n,Object.assign({},Xn,or(r,Wn),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(){zn(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 ur=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)}}(),sr=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 ur(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=this,u=this,s=u.nodes,c=u.nodeSize,l=u.rankdir,h=u.combos,p=u.begin,v=u.radial,g=u.comboEdges,m=void 0===g?[]:g,y=u.vedges,b=void 0===y?[]:y;if(s){var w=u.edges||[],E=new _e({multigraph:!0,compound:!0});u.nodeMap={};var _,S={};s.forEach((function(t){u.nodeMap[t.id]=t,t.comboId&&(S[t.comboId]=S[t.comboId]||[],S[t.comboId].push(t.id))})),_=c?o(c)?function(){return c}:function(){return[c,c]}: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 A=x(u.ranksep,50,u.ranksepFunc),I=x(u.nodesep,50,u.nodesepFunc),T=I,O=A;"LR"!==l&&"RL"!==l||(T=A,O=I),E.setDefaultEdgeLabel((function(){return{}})),E.setGraph(u);var N={};this.sortByCombo&&h&&h.forEach((function(t){if(N[t.id]=t,t.collapsed){var e=_(t),n=O(t),r=T(t),o=e[0]+2*r,i=e[1]+2*n;E.setNode(t.id,{width:o,height:i})}t.parentId&&(N[t.parentId]||E.setNode(t.parentId,{}),E.setParent(t.id,t.parentId))})),s.filter((function(t){return!1!==t.layout})).forEach((function(t){var e=_(t),n=O(t),r=T(t),o=e[0]+2*r,u=e[1]+2*n,s=t.layer;i(s)?E.setNode(t.id,{width:o,height:u,layer:s}):E.setNode(t.id,{width:o,height:u}),a.sortByCombo&&t.comboId&&(N[t.comboId]||(N[t.comboId]={id:t.comboId},E.setNode(t.comboId,{})),E.setParent(t.id,t.comboId))})),w.forEach((function(t){var e=d(t,"source"),n=d(t,"target");a.layoutNode(e)&&a.layoutNode(n)&&E.setEdge(e,n,{weight:t.weight||1})})),null===(t=null==m?void 0:m.concat(b||[]))||void 0===t||t.forEach((function(t){var e,n,r=t.source,o=t.target,i=(null===(e=N[r])||void 0===e?void 0:e.collapsed)?[r]:S[r]||[r],a=(null===(n=N[o])||void 0===n?void 0:n.collapsed)?[o]:S[o]||[o];i.forEach((function(e){a.forEach((function(n){E.setEdge(e,n,{weight:t.weight||1})}))}))}));var D=void 0;(null===(n=u.preset)||void 0===n?void 0:n.nodes)&&(D=new _e({multigraph:!0,compound:!0}),u.preset.nodes.forEach((function(t){null==D||D.setNode(t.id,t)}))),ar(E,{prevGraph:D,edgeLabelSpace:u.edgeLabelSpace,keepNodeOrder:Boolean(!!u.nodeOrder),nodeOrder:u.nodeOrder});var M=[0,0];if(p){var k=1/0,R=1/0;E.nodes().forEach((function(t){var e=E.node(t);k>e.x&&(k=e.x),R>e.y&&(R=e.y)})),E.edges().forEach((function(t){var e;null===(e=E.edge(t).points)||void 0===e||e.forEach((function(t){k>t.x&&(k=t.x),R>t.y&&(R=t.y)}))})),M[0]=p[0]-k,M[1]=p[1]-R}if(v){var C=this,L=C.focusNode,P=C.ranksep,j=C.getRadialPos,z=e(L)?L:null==L?void 0:L.id,F=z?null===(r=E.node(z))||void 0===r?void 0:r._rank:0,G=[],U="LR"===l||"RL"===l,B=U?"y":"x",V=U?"height":"width",W=1/0,X=-1/0;E.nodes().forEach((function(t){var e=E.node(t),n=s.findIndex((function(e){return e.id===t}));if(s[n]){var r=I(s[n]);if(0===F)G[e._rank]||(G[e._rank]={nodes:[],totalWidth:0,maxSize:-1/0}),G[e._rank].nodes.push(t),G[e._rank].totalWidth+=2*r+e[V],G[e._rank].maxSize<Math.max(e.width,e.height)&&(G[e._rank].maxSize=Math.max(e.width,e.height));else{var o=e._rank-F;if(0===o)G[o]||(G[o]={nodes:[],totalWidth:0,maxSize:-1/0}),G[o].nodes.push(t),G[o].totalWidth+=2*r+e[V],G[o].maxSize<Math.max(e.width,e.height)&&(G[o].maxSize=Math.max(e.width,e.height));else{var i=Math.abs(o);G[i]||(G[i]={left:[],right:[],totalWidth:0,maxSize:-1/0}),G[i].totalWidth+=2*r+e[V],G[i].maxSize<Math.max(e.width,e.height)&&(G[i].maxSize=Math.max(e.width,e.height)),o<0?G[i].left.push(t):G[i].right.push(t)}}var a=e[B]-e[V]/2-r,u=e[B]+e[V]/2+r;a<W&&(W=a),u>X&&(X=u)}}));var H=P||50,q={},Y=(X-W)/.9,K=[.5*(W+X-Y),.5*(W+X+Y)],Z=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=E.node(t);q[t]=e;var i=j(n[B],K,Y,e,r),a=i.x,u=i.y,c=s.findIndex((function(e){return e.id===t}));if(s[c]){s[c].x=a+M[0],s[c].y=u+M[1],s[c]._order=n._order;var f=A(s[c]);o<f&&(o=f)}})),o},$=!0;G.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($&&1===t.nodes.length){var c=s.findIndex((function(e){return e.id===t.nodes[0]}));if(c<=-1)return;return s[c].x=M[0],s[c].y=M[1],q[t.nodes[0]]=0,H=A(s[c]),void($=!1)}H=Math.max(H,t.totalWidth/(2*Math.PI));var f=-1/0;if(0===F||(null===(o=t.nodes)||void 0===o?void 0:o.length))f=Z(t.nodes,H,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=Z(t.left,H,f,[0,l]),f=Z(t.right,H,f,[l+.05,1])}H+=f,$=!1,t.maxSize}})),E.edges().forEach((function(t){var e,n,r,o=E.edge(t),i=w.findIndex((function(e){var n=d(e,"source"),r=d(e,"target");return n===t.v&&r===t.w}));if(!(i<=-1)&&u.edgeLabelSpace&&u.controlPoints&&"loop"!==w[i].type){var a="x"===B?"y":"x",s=null===(e=null==o?void 0:o.points)||void 0===e?void 0:e.slice(1,o.points.length-1),c=[],f=null===(n=E.node(t.v))||void 0===n?void 0:n[a],l=f-(null===(r=E.node(t.w))||void 0===r?void 0:r[a]),h=q[t.v],p=h-q[t.w];null==s||s.forEach((function(t){var e=(t[a]-f)/l*p+h,n=j(t[B],K,Y,e);c.push({x:n.x+M[0],y:n.y+M[1]})})),w[i].controlPoints=c}}))}else E.nodes().forEach((function(t){var e=E.node(t);if(e){var n=a.nodeMap[t];n||(n=null==h?void 0:h.find((function(e){return e.id===t}))),n&&(n.x=e.x+M[0],n.y=e.y+M[1],n._order=e._order)}})),E.edges().forEach((function(t){var e,n=E.edge(t),r=w.findIndex((function(e){var n=d(e,"source"),r=d(e,"target");return n===t.v&&r===t.w}));r<=-1||u.edgeLabelSpace&&u.controlPoints&&"loop"!==w[r].type&&(w[r].controlPoints=(null===(e=null==n?void 0:n.points)||void 0===e?void 0:e.slice(1,n.points.length-1))||[],w[r].controlPoints.forEach((function(t){t.x+=M[0],t.y+=M[1]})))}));return u.onLayoutEnd&&u.onLayoutEnd(),{nodes:s,edges:w}}},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);const cr={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 fr(t={},e=cr){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 lr(t){return`◬${t}◬`}const dr=lr("ROOT"),hr=lr("BRIDGE_GRAPH");var pr,vr,gr,mr;!function(t){t[t.META=0]="META",t[t.NODE=1]="NODE",t[t.BRIDGE=2]="BRIDGE"}(pr||(pr={})),function(t){t[t.INCLUDE=0]="INCLUDE",t[t.EXCLUDE=1]="EXCLUDE",t[t.UNSPECIFIED=2]="UNSPECIFIED"}(vr||(vr={})),function(t){t[t.META=0]="META",t[t.CORE=1]="CORE",t[t.BRIDGE=2]="BRIDGE"}(gr||(gr={})),function(t){t[t.META=0]="META",t[t.OP=1]="OP",t[t.SERIES=2]="SERIES"}(mr||(mr={}));var yr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{};function br(t,e){return t(e={exports:{}},e.exports),e.exports}var wr=function(t,e){return t===e||t!=t&&e!=e},Er=function(t,e){for(var n=t.length;n--;)if(wr(t[n][0],e))return n;return-1},xr=Array.prototype.splice;function _r(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])}}_r.prototype.clear=function(){this.__data__=[],this.size=0},_r.prototype.delete=function(t){var e=this.__data__,n=Er(e,t);return!(n<0||(n==e.length-1?e.pop():xr.call(e,n,1),--this.size,0))},_r.prototype.get=function(t){var e=this.__data__,n=Er(e,t);return n<0?void 0:e[n][1]},_r.prototype.has=function(t){return Er(this.__data__,t)>-1},_r.prototype.set=function(t,e){var n=this.__data__,r=Er(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var Sr,Ar=_r,Ir="object"==typeof yr&&yr&&yr.Object===Object&&yr,Tr="object"==typeof self&&self&&self.Object===Object&&self,Or=Ir||Tr||Function("return this")(),Nr=Or.Symbol,Dr=Object.prototype,Mr=Dr.hasOwnProperty,kr=Dr.toString,Rr=Nr?Nr.toStringTag:void 0,Cr=Object.prototype.toString,Lr=Nr?Nr.toStringTag:void 0,Pr=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Lr&&Lr in Object(t)?function(t){var e=Mr.call(t,Rr),n=t[Rr];try{t[Rr]=void 0;var r=!0}catch(t){}var o=kr.call(t);return r&&(e?t[Rr]=n:delete t[Rr]),o}(t):function(t){return Cr.call(t)}(t)},jr=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},zr=function(t){if(!jr(t))return!1;var e=Pr(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},Fr=Or["__core-js_shared__"],Gr=(Sr=/[^.]+$/.exec(Fr&&Fr.keys&&Fr.keys.IE_PROTO||""))?"Symbol(src)_1."+Sr:"",Ur=Function.prototype.toString,Br=function(t){if(null!=t){try{return Ur.call(t)}catch(t){}try{return t+""}catch(t){}}return""},Vr=/^\[object .+?Constructor\]$/,Wr=Function.prototype,Xr=Object.prototype,Hr=Wr.toString,qr=Xr.hasOwnProperty,Yr=RegExp("^"+Hr.call(qr).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Kr=function(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!jr(t)||function(t){return!!Gr&&Gr in t}(t))&&(zr(t)?Yr:Vr).test(Br(t))}(n)?n:void 0},Zr=Kr(Or,"Map"),$r=Kr(Object,"create"),Qr=Object.prototype.hasOwnProperty,Jr=Object.prototype.hasOwnProperty;function to(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])}}to.prototype.clear=function(){this.__data__=$r?$r(null):{},this.size=0},to.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},to.prototype.get=function(t){var e=this.__data__;if($r){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return Qr.call(e,t)?e[t]:void 0},to.prototype.has=function(t){var e=this.__data__;return $r?void 0!==e[t]:Jr.call(e,t)},to.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=$r&&void 0===e?"__lodash_hash_undefined__":e,this};var eo=to,no=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 ro(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])}}ro.prototype.clear=function(){this.size=0,this.__data__={hash:new eo,map:new(Zr||Ar),string:new eo}},ro.prototype.delete=function(t){var e=no(this,t).delete(t);return this.size-=e?1:0,e},ro.prototype.get=function(t){return no(this,t).get(t)},ro.prototype.has=function(t){return no(this,t).has(t)},ro.prototype.set=function(t,e){var n=no(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};var oo=ro;function io(t){var e=this.__data__=new Ar(t);this.size=e.size}io.prototype.clear=function(){this.__data__=new Ar,this.size=0},io.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},io.prototype.get=function(t){return this.__data__.get(t)},io.prototype.has=function(t){return this.__data__.has(t)},io.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Ar){var r=n.__data__;if(!Zr||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new oo(r)}return n.set(t,e),this.size=n.size,this};var ao=io,uo=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t},so=function(){try{var t=Kr(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),co=function(t,e,n){"__proto__"==e&&so?so(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n},fo=Object.prototype.hasOwnProperty,lo=function(t,e,n){var r=t[e];fo.call(t,e)&&wr(r,n)&&(void 0!==n||e in t)||co(t,e,n)},ho=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?co(n,u,s):lo(n,u,s)}return n},po=function(t){return null!=t&&"object"==typeof t},vo=function(t){return po(t)&&"[object Arguments]"==Pr(t)},go=Object.prototype,mo=go.hasOwnProperty,yo=go.propertyIsEnumerable,bo=vo(function(){return arguments}())?vo:function(t){return po(t)&&mo.call(t,"callee")&&!yo.call(t,"callee")},wo=Array.isArray,Eo=function(){return!1},xo=br((function(t,e){var n=e&&!e.nodeType&&e,r=n&&t&&!t.nodeType&&t,o=r&&r.exports===n?Or.Buffer:void 0,i=(o?o.isBuffer:void 0)||Eo;t.exports=i})),_o=/^(?:0|[1-9]\d*)$/,So=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&_o.test(t))&&t>-1&&t%1==0&&t<e},Ao=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},Io={};Io["[object Float32Array]"]=Io["[object Float64Array]"]=Io["[object Int8Array]"]=Io["[object Int16Array]"]=Io["[object Int32Array]"]=Io["[object Uint8Array]"]=Io["[object Uint8ClampedArray]"]=Io["[object Uint16Array]"]=Io["[object Uint32Array]"]=!0,Io["[object Arguments]"]=Io["[object Array]"]=Io["[object ArrayBuffer]"]=Io["[object Boolean]"]=Io["[object DataView]"]=Io["[object Date]"]=Io["[object Error]"]=Io["[object Function]"]=Io["[object Map]"]=Io["[object Number]"]=Io["[object Object]"]=Io["[object RegExp]"]=Io["[object Set]"]=Io["[object String]"]=Io["[object WeakMap]"]=!1;var To=function(t){return function(e){return t(e)}},Oo=br((function(t,e){var n=e&&!e.nodeType&&e,r=n&&t&&!t.nodeType&&t,o=r&&r.exports===n&&Ir.process,i=function(){try{return r&&r.require&&r.require("util").types||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=i})),No=Oo&&Oo.isTypedArray,Do=No?To(No):function(t){return po(t)&&Ao(t.length)&&!!Io[Pr(t)]},Mo=Object.prototype.hasOwnProperty,ko=function(t,e){var n=wo(t),r=!n&&bo(t),o=!n&&!r&&xo(t),i=!n&&!r&&!o&&Do(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&&!Mo.call(t,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||So(c,s))||u.push(c);return u},Ro=Object.prototype,Co=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Ro)},Lo=function(t,e){return function(n){return t(e(n))}},Po=Lo(Object.keys,Object),jo=Object.prototype.hasOwnProperty,zo=function(t){if(!Co(t))return Po(t);var e=[];for(var n in Object(t))jo.call(t,n)&&"constructor"!=n&&e.push(n);return e},Fo=function(t){return null!=t&&Ao(t.length)&&!zr(t)},Go=function(t){return Fo(t)?ko(t):zo(t)},Uo=Object.prototype.hasOwnProperty,Bo=function(t){return Fo(t)?ko(t,!0):function(t){if(!jr(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=Co(t),n=[];for(var r in t)("constructor"!=r||!e&&Uo.call(t,r))&&n.push(r);return n}(t)},Vo=br((function(t,e){var n=e&&!e.nodeType&&e,r=n&&t&&!t.nodeType&&t,o=r&&r.exports===n?Or.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}})),Wo=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e},Xo=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},Ho=function(){return[]},qo=Object.prototype.propertyIsEnumerable,Yo=Object.getOwnPropertySymbols,Ko=Yo?function(t){return null==t?[]:(t=Object(t),Xo(Yo(t),(function(e){return qo.call(t,e)})))}:Ho,Zo=function(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t},$o=Lo(Object.getPrototypeOf,Object),Qo=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)Zo(e,Ko(t)),t=$o(t);return e}:Ho,Jo=function(t,e,n){var r=e(t);return wo(t)?r:Zo(r,n(t))},ti=function(t){return Jo(t,Go,Ko)},ei=function(t){return Jo(t,Bo,Qo)},ni=Kr(Or,"DataView"),ri=Kr(Or,"Promise"),oi=Kr(Or,"Set"),ii=Kr(Or,"WeakMap"),ai=Br(ni),ui=Br(Zr),si=Br(ri),ci=Br(oi),fi=Br(ii),li=Pr;(ni&&"[object DataView]"!=li(new ni(new ArrayBuffer(1)))||Zr&&"[object Map]"!=li(new Zr)||ri&&"[object Promise]"!=li(ri.resolve())||oi&&"[object Set]"!=li(new oi)||ii&&"[object WeakMap]"!=li(new ii))&&(li=function(t){var e=Pr(t),n="[object Object]"==e?t.constructor:void 0,r=n?Br(n):"";if(r)switch(r){case ai:return"[object DataView]";case ui:return"[object Map]";case si:return"[object Promise]";case ci:return"[object Set]";case fi:return"[object WeakMap]"}return e});var di=li,hi=Object.prototype.hasOwnProperty,pi=Or.Uint8Array,vi=function(t){var e=new t.constructor(t.byteLength);return new pi(e).set(new pi(t)),e},gi=/\w*$/,mi=Nr?Nr.prototype:void 0,yi=mi?mi.valueOf:void 0,bi=function(t,e){var n=e?vi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)},wi=Object.create,Ei=function(){function t(){}return function(e){if(!jr(e))return{};if(wi)return wi(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}(),xi=function(t){return"function"!=typeof t.constructor||Co(t)?{}:Ei($o(t))},_i=Oo&&Oo.isMap,Si=_i?To(_i):function(t){return po(t)&&"[object Map]"==di(t)},Ai=Oo&&Oo.isSet,Ii=Ai?To(Ai):function(t){return po(t)&&"[object Set]"==di(t)},Ti={};Ti["[object Arguments]"]=Ti["[object Array]"]=Ti["[object ArrayBuffer]"]=Ti["[object DataView]"]=Ti["[object Boolean]"]=Ti["[object Date]"]=Ti["[object Float32Array]"]=Ti["[object Float64Array]"]=Ti["[object Int8Array]"]=Ti["[object Int16Array]"]=Ti["[object Int32Array]"]=Ti["[object Map]"]=Ti["[object Number]"]=Ti["[object Object]"]=Ti["[object RegExp]"]=Ti["[object Set]"]=Ti["[object String]"]=Ti["[object Symbol]"]=Ti["[object Uint8Array]"]=Ti["[object Uint8ClampedArray]"]=Ti["[object Uint16Array]"]=Ti["[object Uint32Array]"]=!0,Ti["[object Error]"]=Ti["[object Function]"]=Ti["[object WeakMap]"]=!1;var Oi=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(!jr(e))return e;var l=wo(e);if(l){if(u=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&hi.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(e),!s)return Wo(e,u)}else{var d=di(e),h="[object Function]"==d||"[object GeneratorFunction]"==d;if(xo(e))return Vo(e,s);if("[object Object]"==d||"[object Arguments]"==d||h&&!i){if(u=c||h?{}:xi(e),!s)return c?function(t,e){return ho(t,Qo(t),e)}(e,function(t,e){return t&&ho(e,Bo(e),t)}(u,e)):function(t,e){return ho(t,Ko(t),e)}(e,function(t,e){return t&&ho(e,Go(e),t)}(u,e))}else{if(!Ti[d])return i?e:{};u=function(t,e,n){var r=t.constructor;switch(e){case"[object ArrayBuffer]":return vi(t);case"[object Boolean]":case"[object Date]":return new r(+t);case"[object DataView]":return function(t,e){var n=e?vi(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 bi(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,gi.exec(t));return e.lastIndex=t.lastIndex,e}(t);case"[object Symbol]":return function(t){return yi?Object(yi.call(t)):{}}(t)}}(e,d,s)}}a||(a=new ao);var p=a.get(e);if(p)return p;a.set(e,u),Ii(e)?e.forEach((function(o){u.add(t(o,n,r,o,e,a))})):Si(e)&&e.forEach((function(o,i){u.set(i,t(o,n,r,i,e,a))}));var v=l?void 0:(f?c?ei:ti:c?Bo:Go)(e);return uo(v||e,(function(o,i){v&&(o=e[i=o]),lo(u,i,t(o,n,r,i,e,a))})),u},Ni=function(t){return function(){return t}},Di=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},Mi=function(t,e){return t&&Di(t,e,Go)},ki=function(t,e){return function(e,n){if(null==e)return e;if(!Fo(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}}(Mi),Ri=function(t){return t},Ci=function(t){return"function"==typeof t?t:Ri},Li=function(t,e){return(wo(t)?uo:ki)(t,Ci(e))},Pi=Li,ji=function(t,e){var n=[];return ki(t,(function(t,r,o){e(t,r,o)&&n.push(t)})),n};function zi(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new oo;++e<n;)this.add(t[e])}zi.prototype.add=zi.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},zi.prototype.has=function(t){return this.__data__.has(t)};var Fi=zi,Gi=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},Ui=function(t,e){return t.has(e)},Bi=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 Fi: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(!Gi(e,(function(t,e){if(!Ui(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},Vi=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n},Wi=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n},Xi=Nr?Nr.prototype:void 0,Hi=Xi?Xi.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 pi(t),new pi(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return wr(+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=Vi;case"[object Set]":var s=1&r;if(u||(u=Wi),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=Bi(u(t),u(e),r,o,i,a);return a.delete(t),f;case"[object Symbol]":if(Hi)return Hi.call(t)==Hi.call(e)}return!1},Yi=Object.prototype.hasOwnProperty,Ki=Object.prototype.hasOwnProperty,Zi=function t(e,n,r,o,i){return e===n||(null==e||null==n||!po(e)&&!po(n)?e!=e&&n!=n:function(t,e,n,r,o,i){var a=wo(t),u=wo(e),s=a?"[object Array]":di(t),c=u?"[object Array]":di(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&&xo(t)){if(!xo(e))return!1;a=!0,f=!1}if(d&&!f)return i||(i=new ao),a||Do(t)?Bi(t,e,n,r,o,i):qi(t,e,s,n,r,o,i);if(!(1&n)){var h=f&&Ki.call(t,"__wrapped__"),p=l&&Ki.call(e,"__wrapped__");if(h||p){var v=h?t.value():t,g=p?e.value():e;return i||(i=new ao),o(v,g,n,r,i)}}return!!d&&(i||(i=new ao),function(t,e,n,r,o,i){var a=1&n,u=ti(t),s=u.length;if(s!=ti(e).length&&!a)return!1;for(var c=s;c--;){var f=u[c];if(!(a?f in e:Yi.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))},$i=function(t){return t==t&&!jr(t)},Qi=function(t,e){return function(n){return null!=n&&n[t]===e&&(void 0!==e||t in Object(n))}},Ji=function(t){return"symbol"==typeof t||po(t)&&"[object Symbol]"==Pr(t)},ta=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ea=/^\w*$/,na=function(t,e){if(wo(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Ji(t))||ea.test(t)||!ta.test(t)||null!=e&&t in Object(e)};function ra(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(ra.Cache||oo),n}ra.Cache=oo;var oa,ia=ra,aa=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ua=/\\(\\)?/g,sa=function(t){var e=ia((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(aa,(function(t,n,r,o){e.push(r?o.replace(ua,"$1"):n||t)})),e}),(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}(),ca=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},fa=Nr?Nr.prototype:void 0,la=fa?fa.toString:void 0,da=function t(e){if("string"==typeof e)return e;if(wo(e))return ca(e,t)+"";if(Ji(e))return la?la.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n},ha=function(t){return null==t?"":da(t)},pa=function(t,e){return wo(t)?t:na(t,e)?[t]:sa(ha(t))},va=function(t){if("string"==typeof t||Ji(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e},ga=function(t,e){for(var n=0,r=(e=pa(e,t)).length;null!=t&&n<r;)t=t[va(e[n++])];return n&&n==r?t:void 0},ma=function(t,e){return null!=t&&e in Object(t)},ya=function(t,e,n){for(var r=-1,o=(e=pa(e,t)).length,i=!1;++r<o;){var a=va(e[r]);if(!(i=null!=t&&n(t,a)))break;t=t[a]}return i||++r!=o?i:!!(o=null==t?0:t.length)&&Ao(o)&&So(a,o)&&(wo(t)||bo(t))},ba=function(t,e){return null!=t&&ya(t,e,ma)},wa=function(t){return function(e){return null==e?void 0:e[t]}},Ea=function(t){return"function"==typeof t?t:null==t?Ri:"object"==typeof t?wo(t)?function(t,e){return na(t)&&$i(e)?Qi(va(t),e):function(n){var r=function(t,e,n){var r=null==t?void 0:ga(t,e);return void 0===r?void 0:r}(n,t);return void 0===r&&r===e?ba(n,t):Zi(e,r,3)}}(t[0],t[1]):function(t){var e=function(t){for(var e=Go(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,$i(o)]}return e}(t);return 1==e.length&&e[0][2]?Qi(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 ao;if(!(void 0===f?Zi(c,s,3,r,l):f))return!1}}return!0}(n,0,e)}}(t):function(t){return na(t)?wa(va(t)):function(t){return function(e){return ga(e,t)}}(t)}(t)},xa=function(t,e){return(wo(t)?Xo:ji)(t,Ea(e))},_a=Object.prototype.hasOwnProperty,Sa=function(t,e){return null!=t&&_a.call(t,e)},Aa=function(t,e){return null!=t&&ya(t,e,Sa)},Ia=Object.prototype.hasOwnProperty,Ta=function(t){return void 0===t},Oa=function(t,e){var n=-1,r=Fo(t)?Array(t.length):[];return ki(t,(function(t,o,i){r[++n]=e(t,o,i)})),r},Na=function(t,e){return(wo(t)?ca:Oa)(t,Ea(e))},Da=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},Ma=function(t,e,n,r,o){return o(t,(function(t,o,i){n=r?(r=!1,t):e(n,t,o,i)})),n},ka=function(t,e,n){var r=wo(t)?Da:Ma,o=arguments.length<3;return r(t,Ea(e),n,o,ki)},Ra=wa("length"),Ca=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),La="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Pa="\\ud83c[\\udffb-\\udfff]",ja="[^\\ud800-\\udfff]",za="(?:\\ud83c[\\udde6-\\uddff]){2}",Fa="[\\ud800-\\udbff][\\udc00-\\udfff]",Ga="(?:"+La+"|"+Pa+")?",Ua="[\\ufe0e\\ufe0f]?"+Ga+"(?:\\u200d(?:"+[ja,za,Fa].join("|")+")[\\ufe0e\\ufe0f]?"+Ga+")*",Ba="(?:"+[ja+La+"?",La,za,Fa,"[\\ud800-\\udfff]"].join("|")+")",Va=RegExp(Pa+"(?="+Pa+")|"+Ba+Ua,"g"),Wa=Nr?Nr.isConcatSpreadable:void 0,Xa=function(t){return wo(t)||bo(t)||!!(Wa&&t&&t[Wa])},Ha=function t(e,n,r,o,i){var a=-1,u=e.length;for(r||(r=Xa),i||(i=[]);++a<u;){var s=e[a];n>0&&r(s)?n>1?t(s,n-1,r,o,i):Zo(i,s):o||(i[i.length]=s)}return i},qa=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)},Ya=Math.max,Ka=function(t,e,n){return e=Ya(void 0===e?t.length-1:e,0),function(){for(var r=arguments,o=-1,i=Ya(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),qa(t,this,u)}},Za=so?function(t,e){return so(t,"toString",{configurable:!0,enumerable:!1,value:Ni(e),writable:!0})}:Ri,$a=Date.now,Qa=function(t){var e=0,n=0;return function(){var r=$a(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(Za),Ja=function(t,e){return Qa(Ka(t,e,Ri),t+"")},tu=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},eu=function(t){return t!=t},nu=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):tu(t,eu,0)}(t,e)>-1},ru=oi&&1/Wi(new oi([,-0]))[1]==1/0?function(t){return new oi(t)}:function(){},ou=function(t){return po(t)&&Fo(t)},iu=Ja((function(t){return function(t,e,n){var r=-1,o=nu,i=t.length,a=!0,u=[],s=u;if(i>=200){var c=ru(t);if(c)return Wi(c);a=!1,o=Ui,s=new Fi}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}(Ha(t,1,ou,!0))})),au=function(t){return null==t?[]:function(t,e){return ca(e,(function(e){return t[e]}))}(t,Go(t))};try{oa={clone:function(t){return Oi(t,4)},constant:Ni,each:Pi,filter:xa,has:Aa,isArray:wo,isEmpty:function(t){if(null==t)return!0;if(Fo(t)&&(wo(t)||"string"==typeof t||"function"==typeof t.splice||xo(t)||Do(t)||bo(t)))return!t.length;var e=di(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(Co(t))return!zo(t).length;for(var n in t)if(Ia.call(t,n))return!1;return!0},isFunction:zr,isUndefined:Ta,keys:Go,map:Na,reduce:ka,size:function(t){if(null==t)return 0;if(Fo(t))return function(t){return"string"==typeof t||!wo(t)&&po(t)&&"[object String]"==Pr(t)}(t)?function(t){return function(t){return Ca.test(t)}(t)?function(t){for(var e=Va.lastIndex=0;Va.test(t);)++e;return e}(t):Ra(t)}(t):t.length;var e=di(t);return"[object Map]"==e||"[object Set]"==e?t.size:zo(t).length},transform:function(t,e,n){var r=wo(t),o=r||xo(t)||Do(t);if(e=Ea(e),null==n){var i=t&&t.constructor;n=o?r?new i:[]:jr(t)&&zr(i)?Ei($o(t)):{}}return(o?uo:Mi)(t,(function(t,r,o){return e(n,t,r,o)})),n},union:iu,values:au}}catch(cr){}oa||(oa=window._);var uu=oa,su=cu;function cu(t){this._isDirected=!uu.has(t,"directed")||t.directed,this._isMultigraph=!!uu.has(t,"multigraph")&&t.multigraph,this._isCompound=!!uu.has(t,"compound")&&t.compound,this._label=void 0,this._defaultNodeLabelFn=uu.constant(void 0),this._defaultEdgeLabelFn=uu.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 fu(t,e){t[e]?t[e]++:t[e]=1}function lu(t,e){--t[e]||delete t[e]}function du(t,e,n,r){var o=""+e,i=""+n;if(!t&&o>i){var a=o;o=i,i=a}return o+""+i+""+(uu.isUndefined(r)?"\0":r)}function hu(t,e){return du(t,e.v,e.w,e.name)}cu.prototype._nodeCount=0,cu.prototype._edgeCount=0,cu.prototype.isDirected=function(){return this._isDirected},cu.prototype.isMultigraph=function(){return this._isMultigraph},cu.prototype.isCompound=function(){return this._isCompound},cu.prototype.setGraph=function(t){return this._label=t,this},cu.prototype.graph=function(){return this._label},cu.prototype.setDefaultNodeLabel=function(t){return uu.isFunction(t)||(t=uu.constant(t)),this._defaultNodeLabelFn=t,this},cu.prototype.nodeCount=function(){return this._nodeCount},cu.prototype.nodes=function(){return uu.keys(this._nodes)},cu.prototype.sources=function(){var t=this;return uu.filter(this.nodes(),(function(e){return uu.isEmpty(t._in[e])}))},cu.prototype.sinks=function(){var t=this;return uu.filter(this.nodes(),(function(e){return uu.isEmpty(t._out[e])}))},cu.prototype.setNodes=function(t,e){var n=arguments,r=this;return uu.each(t,(function(t){n.length>1?r.setNode(t,e):r.setNode(t)})),this},cu.prototype.setNode=function(t,e){return uu.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)},cu.prototype.node=function(t){return this._nodes[t]},cu.prototype.hasNode=function(t){return uu.has(this._nodes,t)},cu.prototype.removeNode=function(t){var e=this;if(uu.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],uu.each(this.children(t),(function(t){e.setParent(t)})),delete this._children[t]),uu.each(uu.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],uu.each(uu.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},cu.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(uu.isUndefined(e))e="\0";else{for(var n=e+="";!uu.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},cu.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},cu.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if("\0"!==e)return e}},cu.prototype.children=function(t){if(uu.isUndefined(t)&&(t="\0"),this._isCompound){var e=this._children[t];if(e)return uu.keys(e)}else{if("\0"===t)return this.nodes();if(this.hasNode(t))return[]}},cu.prototype.predecessors=function(t){var e=this._preds[t];if(e)return uu.keys(e)},cu.prototype.successors=function(t){var e=this._sucs[t];if(e)return uu.keys(e)},cu.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return uu.union(e,this.successors(t))},cu.prototype.isLeaf=function(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length},cu.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;uu.each(this._nodes,(function(n,r){t(r)&&e.setNode(r,n)})),uu.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&&uu.each(e.nodes(),(function(t){e.setParent(t,o(t))})),e},cu.prototype.setDefaultEdgeLabel=function(t){return uu.isFunction(t)||(t=uu.constant(t)),this._defaultEdgeLabelFn=t,this},cu.prototype.edgeCount=function(){return this._edgeCount},cu.prototype.edges=function(){return uu.values(this._edgeObjs)},cu.prototype.setPath=function(t,e){var n=this,r=arguments;return uu.reduce(t,(function(t,o){return r.length>1?n.setEdge(t,o,e):n.setEdge(t,o),o})),this},cu.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,uu.isUndefined(n)||(n=""+n);var a=du(this._isDirected,t,e,n);if(uu.has(this._edgeLabels,a))return o&&(this._edgeLabels[a]=r),this;if(!uu.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,fu(this._preds[e],t),fu(this._sucs[t],e),this._in[e][a]=u,this._out[t][a]=u,this._edgeCount++,this},cu.prototype.edge=function(t,e,n){var r=1===arguments.length?hu(this._isDirected,arguments[0]):du(this._isDirected,t,e,n);return this._edgeLabels[r]},cu.prototype.hasEdge=function(t,e,n){var r=1===arguments.length?hu(this._isDirected,arguments[0]):du(this._isDirected,t,e,n);return uu.has(this._edgeLabels,r)},cu.prototype.removeEdge=function(t,e,n){var r=1===arguments.length?hu(this._isDirected,arguments[0]):du(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],lu(this._preds[e],t),lu(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this},cu.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var r=uu.values(n);return e?uu.filter(r,(function(t){return t.v===e})):r}},cu.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var r=uu.values(n);return e?uu.filter(r,(function(t){return t.w===e})):r}},cu.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))};var pu={Graph:su,version:"2.1.8"},vu={write:function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:gu(t),edges:mu(t)};return uu.isUndefined(t.graph())||(e.value=uu.clone(t.graph())),e},read:function(t){var e=new su(t.options).setGraph(t.value);return uu.each(t.nodes,(function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)})),uu.each(t.edges,(function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)})),e}};function gu(t){return uu.map(t.nodes(),(function(e){var n=t.node(e),r=t.parent(e),o={v:e};return uu.isUndefined(n)||(o.value=n),uu.isUndefined(r)||(o.parent=r),o}))}function mu(t){return uu.map(t.edges(),(function(e){var n=t.edge(e),r={v:e.v,w:e.w};return uu.isUndefined(e.name)||(r.name=e.name),uu.isUndefined(n)||(r.value=n),r}))}var yu=bu;function bu(){this._arr=[],this._keyIndices={}}bu.prototype.size=function(){return this._arr.length},bu.prototype.keys=function(){return this._arr.map((function(t){return t.key}))},bu.prototype.has=function(t){return uu.has(this._keyIndices,t)},bu.prototype.priority=function(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority},bu.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},bu.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!uu.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},bu.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},bu.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)},bu.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)))},bu.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},bu.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 wu=function(t,e,n,r){return function(t,e,n,r){var o,i,a={},u=new yu,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||Eu,r||function(e){return t.outEdges(e)})},Eu=uu.constant(1),xu=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){uu.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){uu.has(r,t)||i(t)})),o},_u=uu.constant(1),Su=Au;function Au(t){var e={},n={},r=[];if(uu.each(t.sinks(),(function o(i){if(uu.has(n,i))throw new Iu;uu.has(e,i)||(n[i]=!0,e[i]=!0,uu.each(t.predecessors(i),o),delete n[i],r.push(i))})),uu.size(e)!==t.nodeCount())throw new Iu;return r}function Iu(){}Au.CycleException=Iu,Iu.prototype=new Error;var Tu=function(t,e,n){uu.isArray(e)||(e=[e]);var r=(t.isDirected()?t.successors:t.neighbors).bind(t),o=[],i={};return uu.each(e,(function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);Ou(t,e,"post"===n,i,r,o)})),o};function Ou(t,e,n,r,o,i){uu.has(r,e)||(r[e]=!0,n||i.push(e),uu.each(o(e),(function(e){Ou(t,e,n,r,o,i)})),n&&i.push(e))}var Nu,Du={Graph:pu.Graph,json:vu,alg:{components:function(t){var e,n={},r=[];function o(r){uu.has(n,r)||(n[r]=!0,e.push(r),uu.each(t.successors(r),o),uu.each(t.predecessors(r),o))}return uu.each(t.nodes(),(function(t){e=[],o(t),e.length&&r.push(e)})),r},dijkstra:wu,dijkstraAll:function(t,e,n){return uu.transform(t.nodes(),(function(r,o){r[o]=wu(t,o,e,n)}),{})},findCycles:function(t){return uu.filter(xu(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||_u,n||function(e){return t.outEdges(e)})},isAcyclic:function(t){try{Su(t)}catch(t){if(t instanceof Su.CycleException)return!1;throw t}return!0},postorder:function(t,e){return Tu(t,e,"post")},preorder:function(t,e){return Tu(t,e,"pre")},prim:function(t,e){var n,r=new su,o={},i=new yu;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;uu.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(),uu.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:xu,topsort:Su},version:pu.version};try{Nu=Du}catch(cr){}Nu||(Nu=window.graphlib);var Mu,ku=Nu,Ru=function(t,e,n){if(!jr(n))return!1;var r=typeof e;return!!("number"==r?Fo(n)&&So(e,n.length):"string"==r&&e in n)&&wr(n[e],t)},Cu=Object.prototype,Lu=Cu.hasOwnProperty,Pu=Ja((function(t,e){t=Object(t);var n=-1,r=e.length,o=r>2?e[2]:void 0;for(o&&Ru(e[0],e[1],o)&&(r=1);++n<r;)for(var i=e[n],a=Bo(i),u=-1,s=a.length;++u<s;){var c=a[u],f=t[c];(void 0===f||wr(f,Cu[c])&&!Lu.call(t,c))&&(t[c]=i[c])}return t})),ju=/^\s+|\s+$/g,zu=/^[-+]0x[0-9a-f]+$/i,Fu=/^0b[01]+$/i,Gu=/^0o[0-7]+$/i,Uu=parseInt,Bu=function(t){return t?1/0===(t=function(t){if("number"==typeof t)return t;if(Ji(t))return NaN;if(jr(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=jr(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(ju,"");var n=Fu.test(t);return n||Gu.test(t)?Uu(t.slice(2),n?2:8):zu.test(t)?NaN:+t}(t))||-1/0===t?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0},Vu=Math.max,Wu=function(t,e,n){var r=Object(t);if(!Fo(t)){var o=Ea(e);t=Go(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=Bu(t),n=e%1;return e==e?n?e-n:e:0}(n);return o<0&&(o=Vu(r+o,0)),tu(t,Ea(e),o)}(t,e,n);return i>-1?r[o?t[i]:i]:void 0},Xu=function(t){return null!=t&&t.length?Ha(t,1):[]},Hu=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&&!Ji(a):n(a,u)))var u=a,s=i}return s},qu=function(t,e){return t>e},Yu=function(t,e,n){(void 0!==n&&!wr(t[e],n)||void 0===n&&!(e in t))&&co(t,e,n)},Ku=Function.prototype,Zu=Object.prototype,$u=Ku.toString,Qu=Zu.hasOwnProperty,Ju=$u.call(Object),ts=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]},es=function t(e,n,r,o,i){e!==n&&Di(n,(function(a,u){if(i||(i=new ao),jr(a))!function(t,e,n,r,o,i,a){var u=ts(t,n),s=ts(e,n),c=a.get(s);if(c)Yu(t,n,c);else{var f=i?i(u,s,n+"",t,e,a):void 0,l=void 0===f;if(l){var d=wo(s),h=!d&&xo(s),p=!d&&!h&&Do(s);f=s,d||h||p?wo(u)?f=u:ou(u)?f=Wo(u):h?(l=!1,f=Vo(s,!0)):p?(l=!1,f=bi(s,!0)):f=[]:function(t){if(!po(t)||"[object Object]"!=Pr(t))return!1;var e=$o(t);if(null===e)return!0;var n=Qu.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&$u.call(n)==Ju}(s)||bo(s)?(f=u,bo(u)?f=function(t){return ho(t,Bo(t))}(u):jr(u)&&!zr(u)||(f=xi(s))):l=!1}l&&(a.set(s,f),o(f,s,r,i,a),a.delete(s)),Yu(t,n,f)}}(e,n,u,r,t,o,i);else{var s=o?o(ts(e,u),a,u+"",e,n,i):void 0;void 0===s&&(s=a),Yu(e,u,s)}}),Bo)},ns=function(t){return Ja((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&&Ru(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){es(t,e,n)})),rs=function(t,e){return t<e},os=function(t,e,n,r){if(!jr(t))return t;for(var o=-1,i=(e=pa(e,t)).length,a=i-1,u=t;null!=u&&++o<i;){var s=va(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=jr(f)?f:So(e[o+1])?[]:{})}lo(u,s,c),u=u[s]}return t},is=function(t){return Qa(Ka(t,void 0,Xu),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=ga(t,a);n(0,a)&&os(i,pa(a,t),u)}return i}(t,e,(function(e,n){return ba(t,n)}))}(t,e)})),as=Math.ceil,us=Math.max,ss=function(t,e){if(t!==e){var n=void 0!==t,r=null===t,o=t==t,i=Ji(t),a=void 0!==e,u=null===e,s=e==e,c=Ji(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},cs=Ja((function(t,e){if(null==t)return[];var n=e.length;return n>1&&Ru(t,e[0],e[1])?e=[]:n>2&&Ru(e[0],e[1],e[2])&&(e=[e[0]]),function(t,e,n){e=e.length?ca(e,(function(t){return wo(t)?function(e){return ga(e,1===t.length?t[0]:t)}:t})):[Ri];var r=-1;e=ca(e,To(Ea));var o=Oa(t,(function(t,n,o){return{criteria:ca(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=ss(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,Ha(e,1),[])})),fs=0;try{Mu={cloneDeep:function(t){return Oi(t,5)},constant:Ni,defaults:Pu,each:Pi,filter:xa,find:Wu,flatten:Xu,forEach:Li,forIn:function(t,e){return null==t?t:Di(t,Ci(e),Bo)},has:Aa,isUndefined:Ta,last:function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0},map:Na,mapValues:function(t,e){var n={};return e=Ea(e),Mi(t,(function(t,r,o){co(n,r,e(t,r,o))})),n},max:function(t){return t&&t.length?Hu(t,Ri,qu):void 0},merge:ns,min:function(t){return t&&t.length?Hu(t,Ri,rs):void 0},minBy:function(t,e){return t&&t.length?Hu(t,Ea(e),rs):void 0},now:function(){return Or.Date.now()},pick:is,range:function(t,e,n){return n&&"number"!=typeof n&&Ru(t,e,n)&&(e=n=void 0),t=Bu(t),void 0===e?(e=t,t=0):e=Bu(e),function(t,e,n,r){for(var o=-1,i=us(as((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:Bu(n))},reduce:ka,sortBy:cs,uniqueId:function(t){var e=++fs;return ha(t)+e},values:au,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||[],lo)}}}catch(cr){}Mu||(Mu=window._);var ls=Mu,ds=hs;function hs(){var t={};t._next=t._prev=t,this._sentinel=t}function ps(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function vs(t,e){if("_next"!==t&&"_prev"!==t)return e}hs.prototype.dequeue=function(){var t=this._sentinel,e=t._prev;if(e!==t)return ps(e),e},hs.prototype.enqueue=function(t){var e=this._sentinel;t._prev&&t._next&&ps(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e},hs.prototype.toString=function(){for(var t=[],e=this._sentinel,n=e._prev;n!==e;)t.push(JSON.stringify(n,vs)),n=n._prev;return"["+t.join(", ")+"]"};var gs=ku.Graph,ms=ls.constant(1);function ys(t,e,n,r,o){var i=o?[]:void 0;return ls.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,bs(e,n,u)})),ls.forEach(t.outEdges(r.v),(function(r){var o=t.edge(r),i=r.w,a=t.node(i);a.in-=o,bs(e,n,a)})),t.removeNode(r.v),i}function bs(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 ws=ku.Graph,Es={addDummyNode:xs,simplify:function(t){var e=(new ws).setGraph(t.graph());return ls.forEach(t.nodes(),(function(n){e.setNode(n,t.node(n))})),ls.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 ws({multigraph:t.isMultigraph()}).setGraph(t.graph());return ls.forEach(t.nodes(),(function(n){t.children(n).length||e.setNode(n,t.node(n))})),ls.forEach(t.edges(),(function(n){e.setEdge(n,t.edge(n))})),e},successorWeights:function(t){var e=ls.map(t.nodes(),(function(e){var n={};return ls.forEach(t.outEdges(e),(function(e){n[e.w]=(n[e.w]||0)+t.edge(e).weight})),n}));return ls.zipObject(t.nodes(),e)},predecessorWeights:function(t){var e=ls.map(t.nodes(),(function(e){var n={};return ls.forEach(t.inEdges(e),(function(e){n[e.v]=(n[e.v]||0)+t.edge(e).weight})),n}));return ls.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=ls.map(ls.range(_s(t)+1),(function(){return[]}));return ls.forEach(t.nodes(),(function(n){var r=t.node(n),o=r.rank;ls.isUndefined(o)||(e[o][r.order]=n)})),e},normalizeRanks:function(t){var e=ls.min(ls.map(t.nodes(),(function(e){return t.node(e).rank})));ls.forEach(t.nodes(),(function(n){var r=t.node(n);ls.has(r,"rank")&&(r.rank-=e)}))},removeEmptyRanks:function(t){var e=ls.min(ls.map(t.nodes(),(function(e){return t.node(e).rank}))),n=[];ls.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;ls.forEach(n,(function(e,n){ls.isUndefined(e)&&n%o!=0?--r:r&&ls.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),xs(t,"border",o,e)},maxRank:_s,partition:function(t,e){var n={lhs:[],rhs:[]};return ls.forEach(t,(function(t){e(t)?n.lhs.push(t):n.rhs.push(t)})),n},time:function(t,e){var n=ls.now();try{return e()}finally{console.log(t+" time: "+(ls.now()-n)+"ms")}},notime:function(t,e){return e()}};function xs(t,e,n,r){var o;do{o=ls.uniqueId(r)}while(t.hasNode(o));return n.dummy=e,t.setNode(o,n),o}function _s(t){return ls.max(ls.map(t.nodes(),(function(e){var n=t.node(e).rank;if(!ls.isUndefined(n))return n})))}var Ss=function(t){var e={};ls.forEach(t.sources(),(function n(r){var o=t.node(r);if(ls.has(e,r))return o.rank;e[r]=!0;var i=ls.min(ls.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}))},As=function(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen},Is=ku.Graph,Ts=As,Os=function(t){var e,n,r=new Is({directed:!1}),o=t.nodes()[0],i=t.nodeCount();for(r.setNode(o,{});Ns(r,t)<i;)e=Ds(r,t),n=r.hasNode(e.v)?Ts(t,e):-Ts(t,e),Ms(r,t,n);return r};function Ns(t,e){return ls.forEach(t.nodes(),(function n(r){ls.forEach(e.nodeEdges(r),(function(o){var i=o.v,a=r===i?o.w:i;t.hasNode(a)||Ts(e,o)||(t.setNode(a,{}),t.setEdge(r,a,{}),n(a))}))})),t.nodeCount()}function Ds(t,e){return ls.minBy(e.edges(),(function(n){if(t.hasNode(n.v)!==t.hasNode(n.w))return Ts(e,n)}))}function Ms(t,e,n){ls.forEach(t.nodes(),(function(t){e.node(t).rank+=n}))}var ks=As,Rs=Ss,Cs=ku.alg.preorder,Ls=ku.alg.postorder,Ps=Es.simplify,js=zs;function zs(t){t=Ps(t),Rs(t);var e,n=Os(t);for(Us(n),Fs(n,t);e=Vs(n);)Xs(n,t,e,Ws(n,t,e))}function Fs(t,e){var n=Ls(t,t.nodes());n=n.slice(0,n.length-1),ls.forEach(n,(function(n){!function(t,e,n){var r=t.node(n).parent;t.edge(n,r).cutvalue=Gs(t,e,n)}(t,e,n)}))}function Gs(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,ls.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 Us(t,e){arguments.length<2&&(e=t.nodes()[0]),Bs(t,{},1,e)}function Bs(t,e,n,r,o){var i=n,a=t.node(r);return e[r]=!0,ls.forEach(t.neighbors(r),(function(o){ls.has(e,o)||(n=Bs(t,e,n,o,r))})),a.low=i,a.lim=n++,o?a.parent=o:delete a.parent,n}function Vs(t){return ls.find(t.edges(),(function(e){return t.edge(e).cutvalue<0}))}function Ws(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=ls.filter(e.edges(),(function(e){return s===Hs(0,t.node(e.v),u)&&s!==Hs(0,t.node(e.w),u)}));return ls.minBy(c,(function(t){return ks(e,t)}))}function Xs(t,e,n,r){var o=n.v,i=n.w;t.removeEdge(o,i),t.setEdge(r.v,r.w,{}),Us(t),Fs(t,e),function(t,e){var n=ls.find(t.nodes(),(function(t){return!e.node(t).parent})),r=Cs(t,n);r=r.slice(1),ls.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 Hs(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}zs.initLowLimValues=Us,zs.initCutValues=Fs,zs.calcCutValue=Gs,zs.leaveEdge=Vs,zs.enterEdge=Ws,zs.exchangeEdges=Xs;var qs=Ss,Ys=qs;var Ks=function(t){var e=Es.addDummyNode(t,"root",{},"_root"),n=function(t){var e={};function n(r,o){var i=t.children(r);i&&i.length&&ls.forEach(i,(function(t){n(t,o+1)})),e[r]=o}return ls.forEach(t.children(),(function(t){n(t,1)})),e}(t),r=ls.max(ls.values(n))-1,o=2*r+1;t.graph().nestingRoot=e,ls.forEach(t.edges(),(function(e){t.edge(e).minlen*=o}));var i=function(t){return ls.reduce(t.edges(),(function(e,n){return e+t.edge(n).weight}),0)}(t)+1;ls.forEach(t.children(),(function(a){Zs(t,e,o,i,r,n,a)})),t.graph().nodeRankFactor=o};function Zs(t,e,n,r,o,i,a){var u=t.children(a);if(u.length){var s=Es.addBorderNode(t,"_bt"),c=Es.addBorderNode(t,"_bb"),f=t.node(a);t.setParent(s,a),f.borderTop=s,t.setParent(c,a),f.borderBottom=c,ls.forEach(u,(function(u){Zs(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 $s(t,e,n,r,o,i){var a={width:0,height:0,rank:i,borderType:e},u=o[e][i-1],s=Es.addDummyNode(t,"border",a,n);o[e][i]=s,t.setParent(s,r),u&&t.setEdge(u,s,{weight:1})}function Qs(t){ls.forEach(t.nodes(),(function(e){Js(t.node(e))})),ls.forEach(t.edges(),(function(e){Js(t.edge(e))}))}function Js(t){var e=t.width;t.width=t.height,t.height=e}function tc(t){t.y=-t.y}function ec(t){var e=t.x;t.x=t.y,t.y=e}var nc=function(t,e){for(var n=0,r=1;r<e.length;++r)n+=rc(t,e[r-1],e[r]);return n};function rc(t,e,n){for(var r=ls.zipObject(n,ls.map(n,(function(t,e){return e}))),o=ls.flatten(ls.map(e,(function(e){return ls.sortBy(ls.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=ls.map(new Array(a),(function(){return 0})),s=0;return ls.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 oc(t,e,n){for(var r;e.length&&(r=ls.last(e)).i<=n;)e.pop(),t.push(r.vs),n++;return n}var ic=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=ls.filter(i,(function(t){return t!==u&&t!==s})));var f=function(t,e){return ls.map(e,(function(e){var n=t.inEdges(e);if(n.length){var r=ls.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);ls.forEach(f,(function(n){if(e.children(n.v).length){var i=t(e,n.v,r,o);c[n.v]=i,ls.has(i,"barycenter")&&(a=n,u=i,ls.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 ls.forEach(t,(function(t,e){var r=n[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};ls.isUndefined(t.barycenter)||(r.barycenter=t.barycenter,r.weight=t.weight)})),ls.forEach(e.edges(),(function(t){var e=n[t.v],r=n[t.w];ls.isUndefined(e)||ls.isUndefined(r)||(r.indegree++,e.out.push(n[t.w]))})),function(t){var e=[];function n(t){return function(e){e.merged||(ls.isUndefined(e.barycenter)||ls.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),ls.forEach(o.in.reverse(),n(o)),ls.forEach(o.out,r(o))}return ls.map(ls.filter(e,(function(t){return!t.merged})),(function(t){return ls.pick(t,["vs","i","barycenter","weight"])}))}(ls.filter(n,(function(t){return!t.indegree})))}(f,r);!function(t,e){ls.forEach(t,(function(t){t.vs=ls.flatten(t.vs.map((function(t){return e[t]?e[t].vs:t})),!0)}))}(l,c);var d=function(t,e){var n,r=Es.partition(t,(function(t){return ls.has(t,"barycenter")})),o=r.lhs,i=ls.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=oc(a,i,c),ls.forEach(o,(function(t){c+=t.vs.length,a.push(t.vs),u+=t.barycenter*t.weight,s+=t.weight,c=oc(a,i,c)}));var f={vs:ls.flatten(a,!0)};return s&&(f.barycenter=u/s,f.weight=s),f}(l,o);if(u&&(d.vs=ls.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]);ls.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},ac=ku.Graph,uc=function(t,e,n){var r=function(t){for(var e;t.hasNode(e=ls.uniqueId("_root")););return e}(t),o=new ac({compound:!0}).setGraph({root:r}).setDefaultNodeLabel((function(e){return t.node(e)}));return ls.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),ls.forEach(t[n](i),(function(e){var n=e.v===i?e.w:e.v,r=o.edge(n,i),a=ls.isUndefined(r)?0:r.weight;o.setEdge(n,i,{weight:t.edge(e).weight+a})})),ls.has(a,"minRank")&&o.setNode(i,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))})),o},sc=function(t,e,n){var r,o={};ls.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}}))},cc=ku.Graph;function fc(t,e,n){return ls.map(e,(function(e){return uc(t,e,n)}))}function lc(t,e){var n=new cc;ls.forEach(t,(function(t){var r=t.graph().root,o=ic(t,r,n,e);ls.forEach(o.vs,(function(e,n){t.node(e).order=n})),sc(t,n,o.vs)}))}function dc(t,e){ls.forEach(e,(function(e){ls.forEach(e,(function(e,n){t.node(e).order=n}))}))}var hc=ku.Graph;function pc(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 vc(t,e,n){if(e>n){var r=e;e=n,n=r}return ls.has(t[e],n)}var gc=Es.normalizeRanks,mc=Es.removeEmptyRanks,yc=Es,bc=ku.Graph,wc=["nodesep","edgesep","ranksep","marginx","marginy"],Ec={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},xc=["acyclicer","ranker","rankdir","align"],_c=["width","height"],Sc={width:0,height:0},Ac=["minlen","weight","width","height","labeloffset"],Ic={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Tc=["labelpos"];function Oc(t,e){return ls.mapValues(ls.pick(t,e),Number)}function Nc(t){var e={};return ls.forEach(t,(function(t,n){e[n.toLowerCase()]=t})),e}var Dc=ku.Graph,Mc={graphlib:ku,layout:function(t,e){var n=e&&e.debugTiming?yc.time:yc.notime;n("layout",(function(){var e=n(" buildLayoutGraph",(function(){return function(t){var e=new bc({multigraph:!0,compound:!0}),n=Nc(t.graph());return e.setGraph(ls.merge({},Ec,Oc(n,wc),ls.pick(n,xc))),ls.forEach(t.nodes(),(function(n){var r=Nc(t.node(n));e.setNode(n,ls.defaults(Oc(r,_c),Sc)),e.setParent(n,t.parent(n))})),ls.forEach(t.edges(),(function(n){var r=Nc(t.edge(n));e.setEdge(n,ls.merge({},Ic,Oc(r,Ac),ls.pick(r,Tc)))})),e}(t)}));n(" runLayout",(function(){!function(t,e){e(" makeSpaceForEdgeLabels",(function(){!function(t){var e=t.graph();e.ranksep/=2,ls.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){ls.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 gs,r=0,o=0;ls.forEach(t.nodes(),(function(t){n.setNode(t,{v:t,in:0,out:0})})),ls.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=ls.range(o+r+3).map((function(){return new ds})),a=r+1;return ls.forEach(n.nodes(),(function(t){bs(i,a,n.node(t))})),{graph:n,buckets:i,zeroIdx:a}}(t,e||ms),r=function(t,e,n){for(var r,o=[],i=e[e.length-1],a=e[0];t.nodeCount();){for(;r=a.dequeue();)ys(t,e,n,r);for(;r=i.dequeue();)ys(t,e,n,r);if(t.nodeCount())for(var u=e.length-2;u>0;--u)if(r=e[u].dequeue()){o=o.concat(ys(t,e,n,r,!0));break}}return o}(n.graph,n.buckets,n.zeroIdx);return ls.flatten(ls.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 ls.forEach(t.nodes(),(function o(i){ls.has(r,i)||(r[i]=!0,n[i]=!0,ls.forEach(t.outEdges(i),(function(t){ls.has(n,t.w)?e.push(t):o(t.w)})),delete n[i])})),e}(t);ls.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,ls.uniqueId("rev"))}))}(t)})),e(" nestingGraph.run",(function(){Ks(t)})),e(" rank",(function(){!function(t){switch(t.graph().ranker){case"network-simplex":default:!function(t){js(t)}(t);break;case"tight-tree":!function(t){qs(t),Os(t)}(t);break;case"longest-path":Ys(t)}}(yc.asNonCompoundGraph(t))})),e(" injectEdgeLabelProxies",(function(){!function(t){ls.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};yc.addDummyNode(t,"edge-proxy",o,"_ep")}}))}(t)})),e(" removeEmptyRanks",(function(){mc(t)})),e(" nestingGraph.cleanup",(function(){!function(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,ls.forEach(t.edges(),(function(e){t.edge(e).nestingEdge&&t.removeEdge(e)}))}(t)})),e(" normalizeRanks",(function(){gc(t)})),e(" assignRankMinMax",(function(){!function(t){var e=0;ls.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=ls.max(e,r.maxRank))})),t.graph().maxRank=e}(t)})),e(" removeEdgeLabelProxies",(function(){!function(t){ls.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=[],ls.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=Es.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 ls.forEach(t.children(),(function r(o){var i=n;ls.forEach(t.children(o),r),e[o]={low:i,lim:n++}})),e}(t);ls.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){ls.forEach(t.children(),(function e(n){var r=t.children(n),o=t.node(n);if(r.length&&ls.forEach(r,e),ls.has(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,a=o.maxRank+1;i<a;++i)$s(t,"borderLeft","_bl",n,o,i),$s(t,"borderRight","_br",n,o,i)}}))}(t)})),e(" order",(function(){!function(t){var e=Es.maxRank(t),n=fc(t,ls.range(1,e+1),"inEdges"),r=fc(t,ls.range(e-1,-1,-1),"outEdges"),o=function(t){var e={},n=ls.filter(t.nodes(),(function(e){return!t.children(e).length})),r=ls.max(ls.map(n,(function(e){return t.node(e).rank}))),o=ls.map(ls.range(r+1),(function(){return[]})),i=ls.sortBy(n,(function(e){return t.node(e).rank}));return ls.forEach(i,(function n(r){if(!ls.has(e,r)){e[r]=!0;var i=t.node(r);o[i.rank].push(r),ls.forEach(t.successors(r),n)}})),o}(t);dc(t,o);for(var i,a=Number.POSITIVE_INFINITY,u=0,s=0;s<4;++u,++s){lc(u%2?n:r,u%4>=2),o=Es.buildLayerMatrix(t);var c=nc(t,o);c<a&&(s=0,i=ls.cloneDeep(o),a=c)}dc(t,i)}(t)})),e(" insertSelfEdges",(function(){!function(t){var e=yc.buildLayerMatrix(t);ls.forEach(e,(function(e){var n=0;ls.forEach(e,(function(e,r){var o=t.node(e);o.order=r+n,ls.forEach(o.selfEdges,(function(e){yc.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||Qs(t)}(t)})),e(" position",(function(){!function(t){(function(t){var e=Es.buildLayerMatrix(t),n=t.graph().ranksep,r=0;ls.forEach(e,(function(e){var o=ls.max(ls.map(e,(function(e){return t.node(e).height})));ls.forEach(e,(function(e){t.node(e).y=r+o/2})),r+=o+n}))})(t=Es.asNonCompoundGraph(t)),ls.forEach(function(t){var e,n=Es.buildLayerMatrix(t),r=ls.merge(function(t,e){var n={};return ls.reduce(e,(function(e,r){var o=0,i=0,a=e.length,u=ls.last(r);return ls.forEach(r,(function(e,s){var c=function(t,e){if(t.node(e).dummy)return ls.find(t.predecessors(e),(function(e){return t.node(e).dummy}))}(t,e),f=c?t.node(c).order:a;(c||e===u)&&(ls.forEach(r.slice(i,s+1),(function(e){ls.forEach(t.predecessors(e),(function(r){var i=t.node(r),a=i.order;!(a<o||f<a)||i.dummy&&t.node(e).dummy||pc(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;ls.forEach(ls.range(r,o),(function(r){u=e[r],t.node(u).dummy&&ls.forEach(t.predecessors(u),(function(e){var r=t.node(e);r.dummy&&(r.order<i||r.order>a)&&pc(n,e,u)}))}))}return ls.reduce(e,(function(e,n){var o,i=-1,a=0;return ls.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={};ls.forEach(["u","d"],(function(i){e="u"===i?n:ls.values(n).reverse(),ls.forEach(["l","r"],(function(n){"r"===n&&(e=ls.map(e,(function(t){return ls.values(t).reverse()})));var a=("u"===i?t.predecessors:t.successors).bind(t),u=function(t,e,n,r){var o={},i={},a={};return ls.forEach(e,(function(t){ls.forEach(t,(function(t,e){o[t]=t,i[t]=t,a[t]=e}))})),ls.forEach(e,(function(t){var e=-1;ls.forEach(t,(function(t){var u=r(t);if(u.length)for(var s=((u=ls.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]&&!vc(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 hc,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,ls.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,ls.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 ls.forEach(e,(function(e){var r;ls.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)),ls.forEach(r,(function(t){i[t]=i[n[t]]})),i}(t,e,u.root,u.align,"r"===n);"r"===n&&(s=ls.mapValues(s,(function(t){return-t}))),o[i+n]=s}))}));var i=function(t,e){return ls.minBy(ls.values(e),(function(e){var n=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY;return ls.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=ls.values(e),r=ls.min(n),o=ls.max(n);ls.forEach(["u","d"],(function(n){ls.forEach(["l","r"],(function(i){var a,u=n+i,s=t[u];if(s!==e){var c=ls.values(s);(a="l"===i?r-ls.min(c):o-ls.max(c))&&(t[u]=ls.mapValues(s,(function(t){return t+a})))}}))}))}(o,i),function(t,e){return ls.mapValues(t.ul,(function(n,r){if(e)return t[e.toLowerCase()][r];var o=ls.sortBy(ls.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){ls.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){ls.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(ls.last(n.borderLeft)),a=t.node(ls.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}})),ls.forEach(t.nodes(),(function(e){"border"===t.node(e).dummy&&t.removeNode(e)}))}(t)})),e(" normalize.undo",(function(){!function(t){ls.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){ls.forEach(t.edges(),(function(e){var n=t.edge(e);if(ls.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){ls.forEach(t.nodes(),(function(e){tc(t.node(e))})),ls.forEach(t.edges(),(function(e){var n=t.edge(e);ls.forEach(n.points,tc),ls.has(n,"y")&&tc(n)}))}(t),"lr"!==e&&"rl"!==e||(function(t){ls.forEach(t.nodes(),(function(e){ec(t.node(e))})),ls.forEach(t.edges(),(function(e){var n=t.edge(e);ls.forEach(n.points,ec),ls.has(n,"x")&&ec(n)}))}(t),Qs(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)}ls.forEach(t.nodes(),(function(e){s(t.node(e))})),ls.forEach(t.edges(),(function(e){var n=t.edge(e);ls.has(n,"x")&&s(n)})),e-=a,r-=u,ls.forEach(t.nodes(),(function(n){var o=t.node(n);o.x-=e,o.y-=r})),ls.forEach(t.edges(),(function(n){var o=t.edge(n);ls.forEach(o.points,(function(t){t.x-=e,t.y-=r})),ls.has(o,"x")&&(o.x-=e),ls.has(o,"y")&&(o.y-=r)})),i.width=n-e+a,i.height=o-r+u}(t)})),e(" assignNodeIntersects",(function(){!function(t){ls.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(yc.intersectRect(i,n)),o.points.push(yc.intersectRect(a,r))}))}(t)})),e(" reversePoints",(function(){!function(t){ls.forEach(t.edges(),(function(e){var n=t.edge(e);n.reversed&&n.points.reverse()}))}(t)})),e(" acyclic.undo",(function(){!function(t){ls.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){ls.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))})),ls.forEach(t.edges(),(function(n){var r=t.edge(n),o=e.edge(n);r.points=o.points,ls.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=Es.buildLayerMatrix(t),n=new Dc({compound:!0,multigraph:!0}).setGraph({});return ls.forEach(t.nodes(),(function(e){n.setNode(e,{label:e}),n.setParent(e,"layer"+t.node(e).rank)})),ls.forEach(t.edges(),(function(t){n.setEdge(t.v,t.w,{},t.name)})),ls.forEach(e,(function(t,e){var r="layer"+e;n.setNode(r,{rank:"same"}),ls.reduce(t,(function(t,e){return n.setEdge(t,e,{style:"invis"}),e}))})),n}},util:{time:Es.time,notime:Es.notime},version:"0.8.5"},kc=Mc.graphlib,Rc=Mc.layout;class Cc{constructor(t){this.cardinality=1,this.include=vr.UNSPECIFIED,this.isGroupNode=!1,this.parentNode=null,this.type=pr.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 Lc{constructor(){this.nodes={},this.edges=[],this.nodes={},this.edges=[]}}class Pc{constructor(t,e={}){this.attr=null,this.bridgeGraph=null,this.cardinality=0,this.depth=1,this.include=vr.UNSPECIFIED,this.isGroupNode=!0,this.parentNode=null,this.type=pr.META,this.path=[],this.name=t,this.metaGraph=Gc(t,gr.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 jc{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 zc(t,e={}){return new Pc(t,e)}function Fc(t,e){return new jc(t,e)}function Gc(t,e,n){const r=n||{},o=new kc.Graph(r);return o.setGraph({name:t,rankdir:r.rankdir,type:e,align:r.align}),o}class Uc{constructor(t={}){this.graphOptions=t,this.index={},this.graphOptions.compound=!0,this.root=zc(dr,this.graphOptions),this.index[dr]=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=Gc(hr,gr.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=Fc(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 Bc(o,t,e,n),Bc(i,t,e,n),n}}function Bc(t,e,n,r){(n?t.inEdges(e.name):t.outEdges(e.name)).forEach((e=>{const n=t.edge(e);r.push(n)}))}class Vc{constructor(t){this.hierarchy=t,this.index={},this.hasSubHierarchy={},this.root=new Hc(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!==pr.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 Xc(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:pr.BRIDGE,isGroupNode:!1,cardinality:0,parentNode:null,include:vr.UNSPECIFIED,inbound:c,attr:{}};t=new Wc(e),this.index[p]=t,o.setNode(p,t)}const e={name:v,type:pr.BRIDGE,isGroupNode:!1,cardinality:1,parentNode:null,include:vr.UNSPECIFIED,inbound:c,attr:{}};g=new Wc(e),this.index[v]=g,o.setNode(v,g),o.setParent(v,p),t.node.cardinality++}const m=new Xc(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 Hc(e,this.hierarchy.graphOptions):new Wc(e),this.index[t]):null}getRenderNodeByName(t){return this.index[t]}getNodeByName(t){return this.hierarchy.node(t)}}class Wc{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 Xc{constructor(t){this.metaEdge=t,this.adjoiningMetaEdge=null,this.weight=1,this.points=[]}}class Hc extends Wc{constructor(t,e){super(t);const n=t.metaGraph.graph();e.compound=!0,this.coreGraph=Gc(n.name,gr.CORE,e)}}function qc(t,e){t.node.isGroupNode&&function(t,e){const n=fr(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 pr.NODE:Object.assign(t,n.nodeSize.node),t.height=c||n.nodeSize.node.height,t.width=f||n.nodeSize.node.width;break;case pr.BRIDGE:Object.assign(t,n.nodeSize.bridge);break;case pr.META:t.expanded?qc(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===pr.META&&function(t,e){const n=fr(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!==pr.BRIDGE&&a.push(e)})),!a.length)return{width:0,height:0};Rc(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=Yc(t[0],t[1]);for(let n=1;n<t.length-1;n++){const r=Yc(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:Kc(r);n.points[0].x=t}if(null!=o){const t=o.expanded?o.x:Kc(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]=Zc(i,o));const a=n.points[1];null!=r&&(n.points[0]=Zc(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 Yc(t,e){const n=e.x-t.x,r=e.y-t.y;return 180*Math.atan(r/n)/Math.PI}function Kc(t){return t.expanded?t.x:t.x-t.width/2+0+t.coreBox.width/2}function Zc(t,e){const n=e.expanded?e.x:Kc(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 $c(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 Vc(t)}(function(t,e){const{rankDirection:n,align:r}=e,o=new Uc({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=zc(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=Fc(f,l),c.metaGraph.setEdge(f,l,d)),d.addBaseEdge(a,t)}))}(o,t),o}(function(t){const e=new Lc;return t.nodes.map((t=>new Cc(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)||cr.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)||cr.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),qc(f.root,n),Jc(f.root)}function Qc(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=[dr,...u].slice(0,u.length).reverse(),f=[dr,...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 Jc(t){const e=t.coreGraph.nodes().map((e=>t.coreGraph.node(e)));return Object.assign(Object.assign({},tf(t)),{expanded:t.expanded,nodes:t.expanded?(n=e,n.map((t=>t.node.type===pr.META?Jc(t):tf(t)))):[],edges:t.expanded?ef(t):[]});var n}function tf(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 ef(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 nf=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)}}(),rf=function(){return rf=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},rf.apply(this,arguments)},of=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))},af=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 nf(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 rf(rf({},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!==dr&&(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}($c(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]=of(of([],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:of([],(a||[]).map((function(t){var e=r(t),n=e[0],o=e[1];return rf(rf({},t),{width:n,height:o})})),!0),edges:of([],(u||[]).map((function(t){return rf(rf({},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=fr(g,rf({},fr(N,cr)));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===mr.META&&l!==dr){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===mr.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=Qc(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=Qc(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 of(of([],t,!0),e.points.map((function(t){return rf(rf({},t),{x:t.x+a[0],y:t.y+a[1]})})),!0)}),[])).slice(1,-1),e.controlPoints=l,(null==f?void 0:f.type)===pr.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)===pr.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 uf=Object.prototype.toString;function sf(t){return uf.call(t).endsWith("Array]")}function cf(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!sf(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(!sf(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(!sf(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(!sf(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 ff=" ".repeat(2),lf=" ".repeat(4);function df(t,e={}){const{maxRows:n=15,maxColumns:r=10,maxNumSize:o=8,padMinus:i="auto"}=e;return`${t.constructor.name} {\n${ff}[\n${lf}${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(hf(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${lf}`)}(t,n,r,o,i)}\n${ff}]\n${ff}rows: ${t.rows}\n${ff}columns: ${t.columns}\n}`}function hf(t,e,n){return(t>=0&&n?` ${pf(t,e-1)}`:pf(t,e)).padEnd(e)}function pf(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 vf(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 gf(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 mf(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 yf(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 bf(t,e,n,r,o){if(5!==arguments.length)throw new RangeError("expected 4 arguments");if(Ef("startRow",e),Ef("endRow",n),Ef("startColumn",r),Ef("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 wf(t,e=0){let n=[];for(let r=0;r<t;r++)n.push(e);return n}function Ef(t,e){if("number"!=typeof e)throw new TypeError(`${t} must be a number`)}function xf(t){if(t.isEmpty())throw new Error("Empty matrix has no elements to index")}class _f{static from1DArray(t,e,n){if(t*e!==n.length)throw new RangeError("data length does not match given dimensions");let r=new Af(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 Af(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 Af(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 Af(t,e)}static ones(t,e){return new Af(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 Af(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 Af(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 Af(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 _f.isMatrix(t)?t:new Af(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 Af(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){vf(this,t);let e=[];for(let n=0;n<this.columns;n++)e.push(this.get(t,n));return e}getRowVector(t){return Af.rowVector(this.getRow(t))}setRow(t,e){vf(this,t),e=mf(this,e);for(let n=0;n<this.columns;n++)this.set(t,n,e[n]);return this}swapRows(t,e){vf(this,t),vf(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){gf(this,t);let e=[];for(let n=0;n<this.rows;n++)e.push(this.get(n,t));return e}getColumnVector(t){return Af.columnVector(this.getColumn(t))}setColumn(t,e){gf(this,t),e=yf(this,e);for(let n=0;n<this.rows;n++)this.set(n,t,e[n]);return this}swapColumns(t,e){gf(this,t),gf(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=mf(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=mf(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=mf(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=mf(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=yf(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=yf(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=yf(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=yf(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){vf(this,t);for(let n=0;n<this.columns;n++)this.set(t,n,this.get(t,n)*e);return this}mulColumn(t,e){gf(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(){xf(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(){xf(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(vf(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){vf(this,t),xf(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(vf(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){vf(this,t),xf(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(gf(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){gf(this,t),xf(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(gf(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){gf(this,t),xf(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){_f.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=Af.checkMatrix(t);let e=this.rows,n=this.columns,r=t.columns,o=new Af(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=Af.checkMatrix(t);let e=new Af(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=Af.checkMatrix(t);let e=new Af(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=Af.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=_f.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(_f.add(s,p),_f.add(c,v),i,u),m=t(_f.add(d,p),c,i,u),y=t(s,_f.sub(l,v),i,u),b=t(p,_f.sub(h,c),i,u),w=t(_f.add(s,f),v,i,u),E=t(_f.sub(d,s),_f.add(c,l),i,u),x=t(_f.sub(f,p),_f.add(h,v),i,u),_=_f.add(g,b);_.sub(w),_.add(x);let S=_f.add(y,w),A=_f.add(m,b),I=_f.sub(g,m);I.add(y),I.add(E);let T=_f.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 Af(this.rows,this.columns);for(let t=0;t<this.rows;t++){const o=this.getRow(t);o.length>0&&cf(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 Af(this.rows,this.columns);for(let t=0;t<this.columns;t++){const o=this.getColumn(t);o.length&&cf(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=Af.checkMatrix(t);let e=this.rows,n=this.columns,r=t.rows,o=t.columns,i=new Af(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=Af.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(Af.eye(n,n)),o=Af.eye(e,e).kroneckerProduct(t);return r.add(o)}transpose(){let t=new Af(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=Sf){for(let e=0;e<this.rows;e++)this.setRow(e,this.getRow(e).sort(t));return this}sortColumns(t=Sf){for(let e=0;e<this.columns;e++)this.setColumn(e,this.getColumn(e).sort(t));return this}subMatrix(t,e,n,r){bf(this,t,e,n,r);let o=new Af(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 Af(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 Af(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=Af.checkMatrix(t)).isEmpty())return this;bf(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(!sf(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(!sf(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 Af(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 Af(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=wf(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=wf(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=wf(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=wf(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(!sf(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(!sf(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(!sf(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(!sf(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(!sf(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(!sf(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 df(this,t)}}function Sf(t,e){return t-e}_f.prototype.klass="Matrix","undefined"!=typeof Symbol&&(_f.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return df(this)}),_f.random=_f.rand,_f.randomInt=_f.randInt,_f.diagonal=_f.diag,_f.prototype.diagonal=_f.prototype.diag,_f.identity=_f.eye,_f.prototype.negate=_f.prototype.neg,_f.prototype.tensorProduct=_f.prototype.kroneckerProduct;class Af extends _f{constructor(t,e){if(super(),Af.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(!sf(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 vf(this,t),this.data.splice(t,1),this.rows-=1,this}addRow(t,e){return void 0===e&&(e=t,t=this.rows),vf(this,t,!0),e=Float64Array.from(mf(this,e)),this.data.splice(t,0,e),this.rows+=1,this}removeColumn(t){gf(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),gf(this,t,!0),e=yf(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}}(_f,Af);class If extends _f{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 Tf(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 Of{constructor(t,e={}){if((t=If.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 Af(n,l),v=new Af(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]=Tf(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]=Tf(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=Tf(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=Tf(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=Tf(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=Tf(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=Af.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=Af.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(Af.diag(t))}inverse(){let t=this.V,e=this.threshold,n=t.rows,r=t.columns,o=new Af(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 Af(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 Af.diag(this.s)}}var Nf=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=Af.mul(Af.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 Of(o),c=Af.sqrt(s.diagonalMatrix).diagonal();return s.leftSingularVectors.toJSON().map((function(t){return Af.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 Df=Nf;var Mf=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 kf=Mf;var Rf=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 Cf(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var Lf=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 Rf(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 Df({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 kf(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=Cf(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=Cf(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),Pf=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)}}(),jf=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 Pf(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),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 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 zf(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=Af.mul(Af.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 Of(e),a=Af.sqrt(i.diagonalMatrix).diagonal();return i.leftSingularVectors.toJSON().map((function(t){return Af.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),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.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 Gf(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 Bf(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 Vf(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Bf(i,r,o,a,u,"next",t)}function u(t){Bf(i,r,o,a,u,"throw",t)}a(void 0)}))}}function Wf(t){return Wf="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},Wf(t)}function Xf(t){var e=function(t,e){if("object"!==Wf(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Wf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===Wf(e)?e:String(e)}function Hf(t,e,n){return(e=Xf(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Yf(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,Xf(r.key),r)}}function Kf(t,e,n){return e&&Yf(t.prototype,e),n&&Yf(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var Zf,$f=n(6719),Qf=n.n($f),Jf=n(1763),tl=n.n(Jf),el=n(1469),nl=n.n(el),rl=n(4687),ol=n.n(rl),il=1;function al(){return il++}!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"}(Zf||(Zf={}));var ul,sl,cl,fl,ll=function(){function t(){qf(this,t),this.config=void 0}return Kf(t,[{key:"get",value:function(){return this.config}},{key:"set",value:function(t){this.config=t}}]),t}();function dl(){if("undefined"!=typeof document)return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}function hl(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 pl(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?hl(Object(n),!0).forEach((function(e){Hf(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):hl(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>[]"}(ul||(ul={})),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"}(sl||(sl={})),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"}(cl||(cl={})),function(t){t.GLSL100="GLSL100",t.GLSL450="GLSL450",t.WGSL="WGSL"}(fl||(fl={}));var vl,gl,ml,yl,bl,wl,El,xl,_l,Sl,Al,Il,Tl,Ol,Nl=function(){function t(e,n){qf(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 Kf(t,[{key:"init",value:function(){var t=this.configService.get(),e=t.canvas,n=t.engineOptions;this.initPromise=this.engine.init(pl({canvas:e||dl(),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=tl()(e)||Qf()(e)||nl()(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===cl.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=Vf(ol().mark((function t(){var e,n,r=this,o=arguments;return ol().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=Vf(ol().mark((function t(){return ol().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=Vf(ol().mark((function t(){var e,n,r;return ol().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.initPromise;case 2:return e=pl({},this.compiledBundle.context),n=this.engine.supportWebGPU?this.engine.useWGSL?fl.WGSL:fl.GLSL450:fl.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===cl.StorageBuffer){var n=1;t.type===ul.FloatArray?n=1:t.type===ul.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}(),Dl=n(1550),Ml=n.n(Dl),kl=function(){function t(e,n){qf(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 Kf(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}(),Rl=(Hf(vl={},Zf.POINTS,"points"),Hf(vl,Zf.LINES,"lines"),Hf(vl,Zf.LINE_LOOP,"line loop"),Hf(vl,Zf.LINE_STRIP,"line strip"),Hf(vl,Zf.TRIANGLES,"triangles"),Hf(vl,Zf.TRIANGLE_FAN,"triangle fan"),Hf(vl,Zf.TRIANGLE_STRIP,"triangle strip"),vl),Cl=(Hf(gl={},Zf.STATIC_DRAW,"static"),Hf(gl,Zf.DYNAMIC_DRAW,"dynamic"),Hf(gl,Zf.STREAM_DRAW,"stream"),gl),Ll=(Hf(ml={},Zf.BYTE,"int8"),Hf(ml,Zf.UNSIGNED_INT,"int16"),Hf(ml,Zf.INT,"int32"),Hf(ml,Zf.UNSIGNED_BYTE,"uint8"),Hf(ml,Zf.UNSIGNED_SHORT,"uint16"),Hf(ml,Zf.UNSIGNED_INT,"uint32"),Hf(ml,Zf.FLOAT,"float"),ml),Pl=(Hf(yl={},Zf.ALPHA,"alpha"),Hf(yl,Zf.LUMINANCE,"luminance"),Hf(yl,Zf.LUMINANCE_ALPHA,"luminance alpha"),Hf(yl,Zf.RGB,"rgb"),Hf(yl,Zf.RGBA,"rgba"),Hf(yl,Zf.RGBA4,"rgba4"),Hf(yl,Zf.RGB5_A1,"rgb5 a1"),Hf(yl,Zf.RGB565,"rgb565"),Hf(yl,Zf.DEPTH_COMPONENT,"depth"),Hf(yl,Zf.DEPTH_STENCIL,"depth stencil"),yl),jl=(Hf(bl={},Zf.DONT_CARE,"dont care"),Hf(bl,Zf.NICEST,"nice"),Hf(bl,Zf.FASTEST,"fast"),bl),zl=(Hf(wl={},Zf.NEAREST,"nearest"),Hf(wl,Zf.LINEAR,"linear"),Hf(wl,Zf.LINEAR_MIPMAP_LINEAR,"mipmap"),Hf(wl,Zf.NEAREST_MIPMAP_LINEAR,"nearest mipmap linear"),Hf(wl,Zf.LINEAR_MIPMAP_NEAREST,"linear mipmap nearest"),Hf(wl,Zf.NEAREST_MIPMAP_NEAREST,"nearest mipmap nearest"),wl),Fl=(Hf(El={},Zf.REPEAT,"repeat"),Hf(El,Zf.CLAMP_TO_EDGE,"clamp"),Hf(El,Zf.MIRRORED_REPEAT,"mirror"),El),Gl=(Hf(xl={},Zf.NONE,"none"),Hf(xl,Zf.BROWSER_DEFAULT_WEBGL,"browser"),xl),Ul=(Hf(_l={},Zf.NEVER,"never"),Hf(_l,Zf.ALWAYS,"always"),Hf(_l,Zf.LESS,"less"),Hf(_l,Zf.LEQUAL,"lequal"),Hf(_l,Zf.GREATER,"greater"),Hf(_l,Zf.GEQUAL,"gequal"),Hf(_l,Zf.EQUAL,"equal"),Hf(_l,Zf.NOTEQUAL,"notequal"),_l),Bl=(Hf(Sl={},Zf.FUNC_ADD,"add"),Hf(Sl,Zf.MIN_EXT,"min"),Hf(Sl,Zf.MAX_EXT,"max"),Hf(Sl,Zf.FUNC_SUBTRACT,"subtract"),Hf(Sl,Zf.FUNC_REVERSE_SUBTRACT,"reverse subtract"),Sl),Vl=(Hf(Al={},Zf.ZERO,"zero"),Hf(Al,Zf.ONE,"one"),Hf(Al,Zf.SRC_COLOR,"src color"),Hf(Al,Zf.ONE_MINUS_SRC_COLOR,"one minus src color"),Hf(Al,Zf.SRC_ALPHA,"src alpha"),Hf(Al,Zf.ONE_MINUS_SRC_ALPHA,"one minus src alpha"),Hf(Al,Zf.DST_COLOR,"dst color"),Hf(Al,Zf.ONE_MINUS_DST_COLOR,"one minus dst color"),Hf(Al,Zf.DST_ALPHA,"dst alpha"),Hf(Al,Zf.ONE_MINUS_DST_ALPHA,"one minus dst alpha"),Hf(Al,Zf.CONSTANT_COLOR,"constant color"),Hf(Al,Zf.ONE_MINUS_CONSTANT_COLOR,"one minus constant color"),Hf(Al,Zf.CONSTANT_ALPHA,"constant alpha"),Hf(Al,Zf.ONE_MINUS_CONSTANT_ALPHA,"one minus constant alpha"),Hf(Al,Zf.SRC_ALPHA_SATURATE,"src alpha saturate"),Al),Wl=(Hf(Il={},Zf.NEVER,"never"),Hf(Il,Zf.ALWAYS,"always"),Hf(Il,Zf.LESS,"less"),Hf(Il,Zf.LEQUAL,"lequal"),Hf(Il,Zf.GREATER,"greater"),Hf(Il,Zf.GEQUAL,"gequal"),Hf(Il,Zf.EQUAL,"equal"),Hf(Il,Zf.NOTEQUAL,"notequal"),Il),Xl=(Hf(Tl={},Zf.ZERO,"zero"),Hf(Tl,Zf.KEEP,"keep"),Hf(Tl,Zf.REPLACE,"replace"),Hf(Tl,Zf.INVERT,"invert"),Hf(Tl,Zf.INCR,"increment"),Hf(Tl,Zf.DECR,"decrement"),Hf(Tl,Zf.INCR_WRAP,"increment wrap"),Hf(Tl,Zf.DECR_WRAP,"decrement wrap"),Tl),Hl=(Hf(Ol={},Zf.FRONT,"front"),Hf(Ol,Zf.BACK,"back"),Ol),ql=function(){function t(e,n){qf(this,t),this.buffer=void 0;var r=n.data,o=n.usage,i=n.type;this.buffer=e.buffer({data:r,usage:Cl[o||Zf.STATIC_DRAW],type:Ll[i||Zf.UNSIGNED_BYTE]})}return Kf(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 Yl(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 Kl(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 Zl(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Kl(Object(n),!0).forEach((function(e){Hf(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Kl(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var $l="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}",Ql=0,Jl=!1,td=function(){function t(e,n){var r=this;qf(this,t),this.reGl=e,this.context=n,this.entity=al(),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===cl.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 Jl&&console.log("[".concat(r.entity,"]: ").concat(e," ").concat(r.textureCache[e].id)),r.textureCache[e].texture}}else if(u===cl.Uniform){if(i&&(Array.isArray(i)||Qf()(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:$l,primitive:"triangle strip",count:4};this.computeCommand=this.reGl(s)}var e;return Kf(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()})),Jl&&console.log("[".concat(this.entity,"]: output ").concat(this.getOuputDataTexture().id))}},{key:"readData",value:(e=Vf(ol().mark((function t(){var e,n,r,o,i,a,u,s,c=this;return ol().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,Jl&&console.log("[".concat(this.entity,"]: confirm input ").concat(e," from model ").concat(n.entity,", ").concat(n.getOuputDataTexture().id))}},{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,Jl&&console.log("[".concat(this.entity,"]: after swap, output ").concat(this.getOuputDataTexture().id))}},{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 Zl(Zl({},t),{},{id:Ql++,texture:this.reGl.texture({width:n,height:n,data:e,type:"float"})})}},{key:"calcDataTexture",value:function(t,e,n){var r=1;e===ul.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 Yl(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 Yl(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)?Yl(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:Ql++,data:o,originalDataLength:u,typedArrayConstructor:Qf()(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){qf(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:Cl[o||Zf.STATIC_DRAW],type:Ll[i||Zf.UNSIGNED_BYTE],count:a})}return Kf(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){qf(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 Kf(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(8630),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]||Qf()(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){Hf(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){qf(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:Rl[void 0===s?Zf.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 Kf(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=Wf(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:Ul[n.func||Zf.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:Vl[o&&o.srcRGB||Zf.SRC_ALPHA],srcAlpha:Vl[o&&o.srcAlpha||Zf.SRC_ALPHA],dstRGB:Vl[o&&o.dstRGB||Zf.ONE_MINUS_SRC_ALPHA],dstAlpha:Vl[o&&o.dstAlpha||Zf.ONE_MINUS_SRC_ALPHA]},equation:{rgb:Bl[i&&i.rgb||Zf.FUNC_ADD],alpha:Bl[i&&i.alpha||Zf.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:Zf.ALWAYS,ref:0,mask:-1}:a,s=n.opFront,c=void 0===s?{fail:Zf.KEEP,zfail:Zf.KEEP,zpass:Zf.KEEP}:s,f=n.opBack,l=void 0===f?{fail:Zf.KEEP,zfail:Zf.KEEP,zpass:Zf.KEEP}:f;e.stencil={enable:!!r,mask:i,func:sd(sd({},u),{},{cmp:Wl[u.cmp]}),opFront:{fail:Xl[c.fail],zfail:Xl[c.zfail],zpass:Xl[c.zpass]},opBack:{fail:Xl[l.fail],zfail:Xl[l.zfail],zpass:Xl[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?Zf.BACK:o;e.cull={enable:!!r,face:Hl[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){qf(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?Zf.UNSIGNED_BYTE:o,a=n.width,u=n.height,s=n.flipY,c=void 0!==s&&s,f=n.format,l=void 0===f?Zf.RGBA:f,d=n.mipmap,h=void 0!==d&&d,p=n.wrapS,v=void 0===p?Zf.CLAMP_TO_EDGE:p,g=n.wrapT,m=void 0===g?Zf.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?Zf.NEAREST:S,I=n.min,T=void 0===I?Zf.NEAREST:I,O=n.colorSpace,N=void 0===O?Zf.BROWSER_DEFAULT_WEBGL:O;this.width=a,this.height=u;var D={width:a,height:u,type:Ll[i],format:Pl[l],wrapS:Fl[v],wrapT:Fl[m],mag:zl[A],min:zl[T],alignment:E,flipY:c,colorSpace:Gl[N],premultiplyAlpha:_,aniso:b};r&&(D.data=r),"number"==typeof h?D.mipmap=jl[h]:"boolean"==typeof h&&(D.mipmap=h),this.texture=e.texture(D)}return Kf(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;qf(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=Vf(ol().mark((function t(n){return ol().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=Vf(ol().mark((function t(e){var r;return ol().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 kl(e.gl,t)},this.createBuffer=function(t){return new ql(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=Vf(ol().mark((function t(n){return ol().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(Zf.SCISSOR_TEST),e.gl._gl.scissor(t.box.x,t.box.y,t.box.width,t.box.height)):e.gl._gl.disable(Zf.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 Kf(t,[{key:"init",value:(e=Vf(ol().mark((function t(e){return ol().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){Ml()({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(){qf(this,t),this.engine=void 0,this.configService=new ll}return Kf(t,[{key:"setConfig",value:function(t){this.configService.set(t)}},{key:"setEngine",value:function(t){this.engine=t}},{key:"createEntity",value:function(){return al()}},{key:"createKernel",value:function(t){var e=new Nl(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 Ff: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 jf({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=10,qd=10,Yd=.8,Kd=.1,Zd=.5;function $d(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 Qd(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+=$d(r,t[o])}return e}function Jd(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 th(t,e){for(var n=!1,r=1*Hd,o=1*qd,i=[r,-r,0,0],a=[0,0,o,-o],u=0;u<t.length;++u)for(var s=t[u],c=eh(s,t),f=0;f<i.length;f++)if(Jd(s,{x:s.x+i[f],y:s.y+a[f]},t,e)){s.x+=i[f],s.y+=a[f];var l=eh(s,t),d=Math.random();l<c||d<Yd&&d>Kd?(c=l,n=!0):(s.x-=i[f],s.y-=a[f])}return Yd>Kd&&(Yd*=Zd),n?Qd(t):0}function eh(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+=$d(t,e[r]));return n}const nh=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=Qd(t),r=20,o=1,i=0,a=0;r>0&&!(++a>=50);){var u=th(t,e);0!==u&&(i=u),o=i-n,n=i,0===o?--r:r=20}return t.forEach((function(t){t.x=t.x-t.size[0]/2,t.y=t.y-t.size[1]/2})),{nodes:t,edges:e}};var rh=function(){return rh=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},rh.apply(this,arguments)};var oh=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)}}(),ih=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 oh(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])})),function(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=rh({},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 sr({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]})),nh(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}({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),ah=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}(),uh={force:Vt,fruchterman:Uf,forceAtlas2:Rd,gForce:L,force2:K,dagre:sr,dagreCompound:af,circular:qt,radial:Lf,concentric:jf,grid:D,mds:Ff,comboForce:Sd,comboCombined:Td,random:k,"gForce-gpu":xd,"fruchterman-gpu":yd,er:ih}})(),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={1983:(t,e,n)=>{"use strict";n(6266),n(990),n(911),n(4160),n(6197),n(6728),n(4039),n(3568),n(8051),n(8250),n(5434),n(4952),n(6337),n(5666)},6266:(t,e,n)=>{n(5767),n(8132),n(8388),n(7470),n(4882),n(1520),n(7476),n(9622),n(9375),n(3533),n(4672),n(4157),n(5095),n(9892),n(5115),n(9176),n(8838),n(6253),n(9730),n(6059),n(8377),n(1084),n(4299),n(1246),n(726),n(1901),n(5972),n(3403),n(2516),n(9371),n(6479),n(1736),n(1889),n(5177),n(6943),n(6503),n(6786),n(932),n(7526),n(1591),n(9073),n(347),n(579),n(4669),n(7710),n(5789),n(3514),n(9978),n(8472),n(6946),n(5068),n(413),n(191),n(8306),n(4564),n(9115),n(9539),n(6620),n(2850),n(823),n(7732),n(856),n(703),n(1539),n(5292),n(6629),n(3694),n(7648),n(7795),n(4531),n(3605),n(6780),n(9937),n(511),n(1822),n(9977),n(1031),n(6331),n(1560),n(774),n(522),n(8295),n(7842),n(110),n(75),n(4336),n(1802),n(8837),n(6773),n(5745),n(3057),n(3750),n(3369),n(9564),n(2e3),n(8977),n(2310),n(4899),n(1842),n(6997),n(3946),n(8269),n(6108),n(6774),n(1466),n(9357),n(6142),n(1876),n(851),n(8416),n(8184),n(147),n(9192),n(142),n(1786),n(5368),n(6964),n(2152),n(4821),n(9103),n(1303),n(3318),n(162),n(3834),n(1572),n(2139),n(685),n(5535),n(7347),n(3049),n(6633),n(8989),n(8270),n(4510),n(3984),n(5769),n(55),n(6014),t.exports=n(5645)},911:(t,e,n)=>{n(1268),t.exports=n(5645).Array.flatMap},990:(t,e,n)=>{n(2773),t.exports=n(5645).Array.includes},5434:(t,e,n)=>{n(3276),t.exports=n(5645).Object.entries},8051:(t,e,n)=>{n(8351),t.exports=n(5645).Object.getOwnPropertyDescriptors},8250:(t,e,n)=>{n(6409),t.exports=n(5645).Object.values},4952:(t,e,n)=>{"use strict";n(851),n(9865),t.exports=n(5645).Promise.finally},6197:(t,e,n)=>{n(2770),t.exports=n(5645).String.padEnd},4160:(t,e,n)=>{n(1784),t.exports=n(5645).String.padStart},4039:(t,e,n)=>{n(4325),t.exports=n(5645).String.trimRight},6728:(t,e,n)=>{n(5869),t.exports=n(5645).String.trimLeft},3568:(t,e,n)=>{n(9665),t.exports=n(8787).f("asyncIterator")},115:(t,e,n)=>{n(4579),t.exports=n(1327).global},5663:t=>{t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},2159:(t,e,n)=>{var r=n(6727);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},1327:t=>{var e=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=e)},9216:(t,e,n)=>{var r=n(5663);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)}}},9666:(t,e,n)=>{t.exports=!n(7929)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},7467:(t,e,n)=>{var r=n(6727),o=n(3938).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},3856:(t,e,n)=>{var r=n(3938),o=n(1327),i=n(9216),a=n(1818),u=n(7069),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},7929:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},3938: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)},7069:t=>{var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},1818:(t,e,n)=>{var r=n(4743),o=n(3101);t.exports=n(9666)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},3758:(t,e,n)=>{t.exports=!n(9666)&&!n(7929)((function(){return 7!=Object.defineProperty(n(7467)("div"),"a",{get:function(){return 7}}).a}))},6727:t=>{t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},4743:(t,e,n)=>{var r=n(2159),o=n(3758),i=n(3206),a=Object.defineProperty;e.f=n(9666)?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}},3101:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},3206:(t,e,n)=>{var r=n(6727);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")}},4579:(t,e,n)=>{var r=n(3856);r(r.G,{global:n(3938)})},4963:t=>{t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},3365:(t,e,n)=>{var r=n(2032);t.exports=function(t,e){if("number"!=typeof t&&"Number"!=r(t))throw TypeError(e);return+t}},7722:(t,e,n)=>{var r=n(6314)("unscopables"),o=Array.prototype;null==o[r]&&n(7728)(o,r,{}),t.exports=function(t){o[r][t]=!0}},6793:(t,e,n)=>{"use strict";var r=n(4496)(!0);t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},3328: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}},7007:(t,e,n)=>{var r=n(5286);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},5216:(t,e,n)=>{"use strict";var r=n(508),o=n(2337),i=n(875);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}},6852:(t,e,n)=>{"use strict";var r=n(508),o=n(2337),i=n(875);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}},9315:(t,e,n)=>{var r=n(2110),o=n(875),i=n(2337);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}}},50:(t,e,n)=>{var r=n(741),o=n(9797),i=n(508),a=n(875),u=n(6886);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}}},7628:(t,e,n)=>{var r=n(4963),o=n(508),i=n(9797),a=n(875);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}},2736:(t,e,n)=>{var r=n(5286),o=n(4302),i=n(6314)("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}},6886:(t,e,n)=>{var r=n(2736);t.exports=function(t,e){return new(r(t))(e)}},4398:(t,e,n)=>{"use strict";var r=n(4963),o=n(5286),i=n(7242),a=[].slice,u={},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)};t.exports=Function.bind||function(t){var e=r(this),n=a.call(arguments,1),u=function(){var r=n.concat(a.call(arguments));return this instanceof u?s(e,r.length,r):i(e,r,t)};return o(e.prototype)&&(u.prototype=e.prototype),u}},1488:(t,e,n)=>{var r=n(2032),o=n(6314)("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}},2032:t=>{var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},9824:(t,e,n)=>{"use strict";var r=n(9275).f,o=n(2503),i=n(4408),a=n(741),u=n(3328),s=n(3531),c=n(2923),f=n(5436),l=n(2974),d=n(7057),h=n(4728).fastKey,p=n(1616),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)}}},3657:(t,e,n)=>{"use strict";var r=n(4408),o=n(4728).getWeak,i=n(7007),a=n(5286),u=n(3328),s=n(3531),c=n(50),f=n(9181),l=n(1616),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}},5795:(t,e,n)=>{"use strict";var r=n(3816),o=n(2985),i=n(7234),a=n(4408),u=n(4728),s=n(3531),c=n(3328),f=n(5286),l=n(4253),d=n(7462),h=n(2943),p=n(266);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}},5645:t=>{var e=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=e)},2811:(t,e,n)=>{"use strict";var r=n(9275),o=n(681);t.exports=function(t,e,n){e in t?r.f(t,e,o(0,n)):t[e]=n}},741:(t,e,n)=>{var r=n(4963);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)}}},3537:(t,e,n)=>{"use strict";var r=n(4253),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},870:(t,e,n)=>{"use strict";var r=n(7007),o=n(1689),i="number";t.exports=function(t){if("string"!==t&&t!==i&&"default"!==t)throw TypeError("Incorrect hint");return o(r(this),t!=i)}},1355:t=>{t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},7057:(t,e,n)=>{t.exports=!n(4253)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},2457:(t,e,n)=>{var r=n(5286),o=n(3816).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},4430:t=>{t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},5541:(t,e,n)=>{var r=n(7184),o=n(4548),i=n(4682);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}},2985:(t,e,n)=>{var r=n(3816),o=n(5645),i=n(7728),a=n(7234),u=n(741),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},8852:(t,e,n)=>{var r=n(6314)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,!"/./"[t](e)}catch(t){}}return!0}},4253:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},8082:(t,e,n)=>{"use strict";n(8269);var r=n(7234),o=n(7728),i=n(4253),a=n(1355),u=n(6314),s=n(1165),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)})}}},3218:(t,e,n)=>{"use strict";var r=n(7007);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}},3325:(t,e,n)=>{"use strict";var r=n(4302),o=n(5286),i=n(875),a=n(741),u=n(6314)("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}},3531:(t,e,n)=>{var r=n(741),o=n(8851),i=n(6555),a=n(7007),u=n(875),s=n(9002),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},18:(t,e,n)=>{t.exports=n(3825)("native-function-to-string",Function.toString)},3816: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)},9181:t=>{var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},7728:(t,e,n)=>{var r=n(9275),o=n(681);t.exports=n(7057)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},639:(t,e,n)=>{var r=n(3816).document;t.exports=r&&r.documentElement},1734:(t,e,n)=>{t.exports=!n(7057)&&!n(4253)((function(){return 7!=Object.defineProperty(n(2457)("div"),"a",{get:function(){return 7}}).a}))},266:(t,e,n)=>{var r=n(5286),o=n(7375).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}},7242: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)}},9797:(t,e,n)=>{var r=n(2032);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},6555:(t,e,n)=>{var r=n(2803),o=n(6314)("iterator"),i=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||i[o]===t)}},4302:(t,e,n)=>{var r=n(2032);t.exports=Array.isArray||function(t){return"Array"==r(t)}},8367:(t,e,n)=>{var r=n(5286),o=Math.floor;t.exports=function(t){return!r(t)&&isFinite(t)&&o(t)===t}},5286:t=>{t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},5364:(t,e,n)=>{var r=n(5286),o=n(2032),i=n(6314)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[i])?!!e:"RegExp"==o(t))}},8851:(t,e,n)=>{var r=n(7007);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}}},9988:(t,e,n)=>{"use strict";var r=n(2503),o=n(681),i=n(2943),a={};n(7728)(a,n(6314)("iterator"),(function(){return this})),t.exports=function(t,e,n){t.prototype=r(a,{next:o(1,n)}),i(t,e+" Iterator")}},2923:(t,e,n)=>{"use strict";var r=n(4461),o=n(2985),i=n(7234),a=n(7728),u=n(2803),s=n(9988),c=n(2943),f=n(468),l=n(6314)("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}},7462:(t,e,n)=>{var r=n(6314)("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}},5436:t=>{t.exports=function(t,e){return{value:e,done:!!t}}},2803:t=>{t.exports={}},4461:t=>{t.exports=!1},3086: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},4934:(t,e,n)=>{var r=n(1801),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}},6206:t=>{t.exports=Math.log1p||function(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},1801:t=>{t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},4728:(t,e,n)=>{var r=n(3953)("meta"),o=n(5286),i=n(9181),a=n(9275).f,u=0,s=Object.isExtensible||function(){return!0},c=!n(4253)((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}}},4351:(t,e,n)=>{var r=n(3816),o=n(4193).set,i=r.MutationObserver||r.WebKitMutationObserver,a=r.process,u=r.Promise,s="process"==n(2032)(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}}},3499:(t,e,n)=>{"use strict";var r=n(4963);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)}},5345:(t,e,n)=>{"use strict";var r=n(7057),o=n(7184),i=n(4548),a=n(4682),u=n(508),s=n(9797),c=Object.assign;t.exports=!c||n(4253)((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},2503:(t,e,n)=>{var r=n(7007),o=n(5588),i=n(4430),a=n(9335)("IE_PROTO"),u=function(){},s="prototype",c=function(){var t,e=n(2457)("iframe"),r=i.length;for(e.style.display="none",n(639).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)}},9275:(t,e,n)=>{var r=n(7007),o=n(1734),i=n(1689),a=Object.defineProperty;e.f=n(7057)?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}},5588:(t,e,n)=>{var r=n(9275),o=n(7007),i=n(7184);t.exports=n(7057)?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}},8693:(t,e,n)=>{var r=n(4682),o=n(681),i=n(2110),a=n(1689),u=n(9181),s=n(1734),c=Object.getOwnPropertyDescriptor;e.f=n(7057)?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])}},9327:(t,e,n)=>{var r=n(2110),o=n(616).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))}},616:(t,e,n)=>{var r=n(189),o=n(4430).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},4548:(t,e)=>{e.f=Object.getOwnPropertySymbols},468:(t,e,n)=>{var r=n(9181),o=n(508),i=n(9335)("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}},189:(t,e,n)=>{var r=n(9181),o=n(2110),i=n(9315)(!1),a=n(9335)("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}},7184:(t,e,n)=>{var r=n(189),o=n(4430);t.exports=Object.keys||function(t){return r(t,o)}},4682:(t,e)=>{e.f={}.propertyIsEnumerable},3160:(t,e,n)=>{var r=n(2985),o=n(5645),i=n(4253);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)}},1131:(t,e,n)=>{var r=n(7057),o=n(7184),i=n(2110),a=n(4682).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}}},7643:(t,e,n)=>{var r=n(616),o=n(4548),i=n(7007),a=n(3816).Reflect;t.exports=a&&a.ownKeys||function(t){var e=r.f(i(t)),n=o.f;return n?e.concat(n(t)):e}},7743:(t,e,n)=>{var r=n(3816).parseFloat,o=n(9599).trim;t.exports=1/r(n(4644)+"-0")!=-1/0?function(t){var e=o(String(t),3),n=r(e);return 0===n&&"-"==e.charAt(0)?-0:n}:r},5960:(t,e,n)=>{var r=n(3816).parseInt,o=n(9599).trim,i=n(4644),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},188:t=>{t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},94:(t,e,n)=>{var r=n(7007),o=n(5286),i=n(3499);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}},681:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},4408:(t,e,n)=>{var r=n(7234);t.exports=function(t,e,n){for(var o in e)r(t,o,e[o],n);return t}},7234:(t,e,n)=>{var r=n(3816),o=n(7728),i=n(9181),a=n(3953)("src"),u=n(18),s="toString",c=(""+u).split(s);n(5645).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)}))},7787:(t,e,n)=>{"use strict";var r=n(1488),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)}},1165:(t,e,n)=>{"use strict";var r,o,i=n(3218),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},7195:t=>{t.exports=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}},7375:(t,e,n)=>{var r=n(5286),o=n(7007),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(741)(Function.call,n(8693).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}},2974:(t,e,n)=>{"use strict";var r=n(3816),o=n(9275),i=n(7057),a=n(6314)("species");t.exports=function(t){var e=r[t];i&&e&&!e[a]&&o.f(e,a,{configurable:!0,get:function(){return this}})}},2943:(t,e,n)=>{var r=n(9275).f,o=n(9181),i=n(6314)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},9335:(t,e,n)=>{var r=n(3825)("keys"),o=n(3953);t.exports=function(t){return r[t]||(r[t]=o(t))}},3825:(t,e,n)=>{var r=n(5645),o=n(3816),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(4461)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},8364:(t,e,n)=>{var r=n(7007),o=n(4963),i=n(6314)("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||null==(n=r(a)[i])?e:o(n)}},7717:(t,e,n)=>{"use strict";var r=n(4253);t.exports=function(t,e){return!!t&&r((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},4496:(t,e,n)=>{var r=n(1467),o=n(1355);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}}},2094:(t,e,n)=>{var r=n(5364),o=n(1355);t.exports=function(t,e,n){if(r(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(o(t))}},9395:(t,e,n)=>{var r=n(2985),o=n(4253),i=n(1355),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)}},5442:(t,e,n)=>{var r=n(875),o=n(8595),i=n(1355);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}},8595:(t,e,n)=>{"use strict";var r=n(1467),o=n(1355);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}},9599:(t,e,n)=>{var r=n(2985),o=n(1355),i=n(4253),a=n(4644),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},4644:t=>{t.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},4193:(t,e,n)=>{var r,o,i,a=n(741),u=n(7242),s=n(639),c=n(2457),f=n(3816),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(2032)(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}},2337:(t,e,n)=>{var r=n(1467),o=Math.max,i=Math.min;t.exports=function(t,e){return(t=r(t))<0?o(t+e,0):i(t,e)}},4843:(t,e,n)=>{var r=n(1467),o=n(875);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}},1467:t=>{var e=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:e)(t)}},2110:(t,e,n)=>{var r=n(9797),o=n(1355);t.exports=function(t){return r(o(t))}},875:(t,e,n)=>{var r=n(1467),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},508:(t,e,n)=>{var r=n(1355);t.exports=function(t){return Object(r(t))}},1689:(t,e,n)=>{var r=n(5286);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")}},8440:(t,e,n)=>{"use strict";if(n(7057)){var r=n(4461),o=n(3816),i=n(4253),a=n(2985),u=n(9383),s=n(1125),c=n(741),f=n(3328),l=n(681),d=n(7728),h=n(4408),p=n(1467),v=n(875),g=n(4843),m=n(2337),y=n(1689),b=n(9181),w=n(1488),E=n(5286),x=n(508),_=n(6555),S=n(2503),A=n(468),I=n(616).f,T=n(9002),O=n(3953),N=n(6314),D=n(50),M=n(9315),k=n(8364),R=n(6997),C=n(2803),L=n(7462),P=n(2974),j=n(6852),z=n(5216),F=n(9275),G=n(8693),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(){}},1125:(t,e,n)=>{"use strict";var r=n(3816),o=n(7057),i=n(4461),a=n(9383),u=n(7728),s=n(4408),c=n(4253),f=n(3328),l=n(1467),d=n(875),h=n(4843),p=n(616).f,v=n(9275).f,g=n(6852),m=n(2943),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]=_},9383:(t,e,n)=>{for(var r,o=n(3816),i=n(7728),a=n(3953),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}},3953:t=>{var e=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+n).toString(36))}},575:(t,e,n)=>{var r=n(3816).navigator;t.exports=r&&r.userAgent||""},1616:(t,e,n)=>{var r=n(5286);t.exports=function(t,e){if(!r(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t}},6074:(t,e,n)=>{var r=n(3816),o=n(5645),i=n(4461),a=n(8787),u=n(9275).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)})}},8787:(t,e,n)=>{e.f=n(6314)},6314:(t,e,n)=>{var r=n(3825)("wks"),o=n(3953),i=n(3816).Symbol,a="function"==typeof i;(t.exports=function(t){return r[t]||(r[t]=a&&i[t]||(a?i:o)("Symbol."+t))}).store=r},9002:(t,e,n)=>{var r=n(1488),o=n(6314)("iterator"),i=n(2803);t.exports=n(5645).getIteratorMethod=function(t){if(null!=t)return t[o]||t["@@iterator"]||i[r(t)]}},2e3:(t,e,n)=>{var r=n(2985);r(r.P,"Array",{copyWithin:n(5216)}),n(7722)("copyWithin")},5745:(t,e,n)=>{"use strict";var r=n(2985),o=n(50)(4);r(r.P+r.F*!n(7717)([].every,!0),"Array",{every:function(t){return o(this,t,arguments[1])}})},8977:(t,e,n)=>{var r=n(2985);r(r.P,"Array",{fill:n(6852)}),n(7722)("fill")},8837:(t,e,n)=>{"use strict";var r=n(2985),o=n(50)(2);r(r.P+r.F*!n(7717)([].filter,!0),"Array",{filter:function(t){return o(this,t,arguments[1])}})},4899:(t,e,n)=>{"use strict";var r=n(2985),o=n(50)(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(7722)(i)},2310:(t,e,n)=>{"use strict";var r=n(2985),o=n(50)(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(7722)(i)},4336:(t,e,n)=>{"use strict";var r=n(2985),o=n(50)(0),i=n(7717)([].forEach,!0);r(r.P+r.F*!i,"Array",{forEach:function(t){return o(this,t,arguments[1])}})},522:(t,e,n)=>{"use strict";var r=n(741),o=n(2985),i=n(508),a=n(8851),u=n(6555),s=n(875),c=n(2811),f=n(9002);o(o.S+o.F*!n(7462)((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}})},3369:(t,e,n)=>{"use strict";var r=n(2985),o=n(9315)(!1),i=[].indexOf,a=!!i&&1/[1].indexOf(1,-0)<0;r(r.P+r.F*(a||!n(7717)(i)),"Array",{indexOf:function(t){return a?i.apply(this,arguments)||0:o(this,t,arguments[1])}})},774:(t,e,n)=>{var r=n(2985);r(r.S,"Array",{isArray:n(4302)})},6997:(t,e,n)=>{"use strict";var r=n(7722),o=n(5436),i=n(2803),a=n(2110);t.exports=n(2923)(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")},7842:(t,e,n)=>{"use strict";var r=n(2985),o=n(2110),i=[].join;r(r.P+r.F*(n(9797)!=Object||!n(7717)(i)),"Array",{join:function(t){return i.call(o(this),void 0===t?",":t)}})},9564:(t,e,n)=>{"use strict";var r=n(2985),o=n(2110),i=n(1467),a=n(875),u=[].lastIndexOf,s=!!u&&1/[1].lastIndexOf(1,-0)<0;r(r.P+r.F*(s||!n(7717)(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}})},1802:(t,e,n)=>{"use strict";var r=n(2985),o=n(50)(1);r(r.P+r.F*!n(7717)([].map,!0),"Array",{map:function(t){return o(this,t,arguments[1])}})},8295:(t,e,n)=>{"use strict";var r=n(2985),o=n(2811);r(r.S+r.F*n(4253)((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}})},3750:(t,e,n)=>{"use strict";var r=n(2985),o=n(7628);r(r.P+r.F*!n(7717)([].reduceRight,!0),"Array",{reduceRight:function(t){return o(this,t,arguments.length,arguments[1],!0)}})},3057:(t,e,n)=>{"use strict";var r=n(2985),o=n(7628);r(r.P+r.F*!n(7717)([].reduce,!0),"Array",{reduce:function(t){return o(this,t,arguments.length,arguments[1],!1)}})},110:(t,e,n)=>{"use strict";var r=n(2985),o=n(639),i=n(2032),a=n(2337),u=n(875),s=[].slice;r(r.P+r.F*n(4253)((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}})},6773:(t,e,n)=>{"use strict";var r=n(2985),o=n(50)(3);r(r.P+r.F*!n(7717)([].some,!0),"Array",{some:function(t){return o(this,t,arguments[1])}})},75:(t,e,n)=>{"use strict";var r=n(2985),o=n(4963),i=n(508),a=n(4253),u=[].sort,s=[1,2,3];r(r.P+r.F*(a((function(){s.sort(void 0)}))||!a((function(){s.sort(null)}))||!n(7717)(u)),"Array",{sort:function(t){return void 0===t?u.call(i(this)):u.call(i(this),o(t))}})},1842:(t,e,n)=>{n(2974)("Array")},1822:(t,e,n)=>{var r=n(2985);r(r.S,"Date",{now:function(){return(new Date).getTime()}})},1031:(t,e,n)=>{var r=n(2985),o=n(3537);r(r.P+r.F*(Date.prototype.toISOString!==o),"Date",{toISOString:o})},9977:(t,e,n)=>{"use strict";var r=n(2985),o=n(508),i=n(1689);r(r.P+r.F*n(4253)((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}})},1560:(t,e,n)=>{var r=n(6314)("toPrimitive"),o=Date.prototype;r in o||n(7728)(o,r,n(870))},6331:(t,e,n)=>{var r=Date.prototype,o="Invalid Date",i="toString",a=r[i],u=r.getTime;new Date(NaN)+""!=o&&n(7234)(r,i,(function(){var t=u.call(this);return t==t?a.call(this):o}))},9730:(t,e,n)=>{var r=n(2985);r(r.P,"Function",{bind:n(4398)})},8377:(t,e,n)=>{"use strict";var r=n(5286),o=n(468),i=n(6314)("hasInstance"),a=Function.prototype;i in a||n(9275).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}})},6059:(t,e,n)=>{var r=n(9275).f,o=Function.prototype,i=/^\s*function ([^ (]*)/,a="name";a in o||n(7057)&&r(o,a,{configurable:!0,get:function(){try{return(""+this).match(i)[1]}catch(t){return""}}})},8416:(t,e,n)=>{"use strict";var r=n(9824),o=n(1616),i="Map";t.exports=n(5795)(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)},6503:(t,e,n)=>{var r=n(2985),o=n(6206),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))}})},6786:(t,e,n)=>{var r=n(2985),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}})},932:(t,e,n)=>{var r=n(2985),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}})},7526:(t,e,n)=>{var r=n(2985),o=n(1801);r(r.S,"Math",{cbrt:function(t){return o(t=+t)*Math.pow(Math.abs(t),1/3)}})},1591:(t,e,n)=>{var r=n(2985);r(r.S,"Math",{clz32:function(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},9073:(t,e,n)=>{var r=n(2985),o=Math.exp;r(r.S,"Math",{cosh:function(t){return(o(t=+t)+o(-t))/2}})},347:(t,e,n)=>{var r=n(2985),o=n(3086);r(r.S+r.F*(o!=Math.expm1),"Math",{expm1:o})},579:(t,e,n)=>{var r=n(2985);r(r.S,"Math",{fround:n(4934)})},4669:(t,e,n)=>{var r=n(2985),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)}})},7710:(t,e,n)=>{var r=n(2985),o=Math.imul;r(r.S+r.F*n(4253)((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)}})},5789:(t,e,n)=>{var r=n(2985);r(r.S,"Math",{log10:function(t){return Math.log(t)*Math.LOG10E}})},3514:(t,e,n)=>{var r=n(2985);r(r.S,"Math",{log1p:n(6206)})},9978:(t,e,n)=>{var r=n(2985);r(r.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}})},8472:(t,e,n)=>{var r=n(2985);r(r.S,"Math",{sign:n(1801)})},6946:(t,e,n)=>{var r=n(2985),o=n(3086),i=Math.exp;r(r.S+r.F*n(4253)((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)}})},5068:(t,e,n)=>{var r=n(2985),o=n(3086),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))}})},413:(t,e,n)=>{var r=n(2985);r(r.S,"Math",{trunc:function(t){return(t>0?Math.floor:Math.ceil)(t)}})},1246:(t,e,n)=>{"use strict";var r=n(3816),o=n(9181),i=n(2032),a=n(266),u=n(1689),s=n(4253),c=n(616).f,f=n(8693).f,l=n(9275).f,d=n(9599).trim,h="Number",p=r[h],v=p,g=p.prototype,m=i(n(2503)(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(7057)?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(7234)(r,h,p)}},5972:(t,e,n)=>{var r=n(2985);r(r.S,"Number",{EPSILON:Math.pow(2,-52)})},3403:(t,e,n)=>{var r=n(2985),o=n(3816).isFinite;r(r.S,"Number",{isFinite:function(t){return"number"==typeof t&&o(t)}})},2516:(t,e,n)=>{var r=n(2985);r(r.S,"Number",{isInteger:n(8367)})},9371:(t,e,n)=>{var r=n(2985);r(r.S,"Number",{isNaN:function(t){return t!=t}})},6479:(t,e,n)=>{var r=n(2985),o=n(8367),i=Math.abs;r(r.S,"Number",{isSafeInteger:function(t){return o(t)&&i(t)<=9007199254740991}})},1736:(t,e,n)=>{var r=n(2985);r(r.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},1889:(t,e,n)=>{var r=n(2985);r(r.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},5177:(t,e,n)=>{var r=n(2985),o=n(7743);r(r.S+r.F*(Number.parseFloat!=o),"Number",{parseFloat:o})},6943:(t,e,n)=>{var r=n(2985),o=n(5960);r(r.S+r.F*(Number.parseInt!=o),"Number",{parseInt:o})},726:(t,e,n)=>{"use strict";var r=n(2985),o=n(1467),i=n(3365),a=n(8595),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(4253)((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}})},1901:(t,e,n)=>{"use strict";var r=n(2985),o=n(4253),i=n(3365),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)}})},5115:(t,e,n)=>{var r=n(2985);r(r.S+r.F,"Object",{assign:n(5345)})},8132:(t,e,n)=>{var r=n(2985);r(r.S,"Object",{create:n(2503)})},7470:(t,e,n)=>{var r=n(2985);r(r.S+r.F*!n(7057),"Object",{defineProperties:n(5588)})},8388:(t,e,n)=>{var r=n(2985);r(r.S+r.F*!n(7057),"Object",{defineProperty:n(9275).f})},9375:(t,e,n)=>{var r=n(5286),o=n(4728).onFreeze;n(3160)("freeze",(function(t){return function(e){return t&&r(e)?t(o(e)):e}}))},4882:(t,e,n)=>{var r=n(2110),o=n(8693).f;n(3160)("getOwnPropertyDescriptor",(function(){return function(t,e){return o(r(t),e)}}))},9622:(t,e,n)=>{n(3160)("getOwnPropertyNames",(function(){return n(9327).f}))},1520:(t,e,n)=>{var r=n(508),o=n(468);n(3160)("getPrototypeOf",(function(){return function(t){return o(r(t))}}))},9892:(t,e,n)=>{var r=n(5286);n(3160)("isExtensible",(function(t){return function(e){return!!r(e)&&(!t||t(e))}}))},4157:(t,e,n)=>{var r=n(5286);n(3160)("isFrozen",(function(t){return function(e){return!r(e)||!!t&&t(e)}}))},5095:(t,e,n)=>{var r=n(5286);n(3160)("isSealed",(function(t){return function(e){return!r(e)||!!t&&t(e)}}))},9176:(t,e,n)=>{var r=n(2985);r(r.S,"Object",{is:n(7195)})},7476:(t,e,n)=>{var r=n(508),o=n(7184);n(3160)("keys",(function(){return function(t){return o(r(t))}}))},4672:(t,e,n)=>{var r=n(5286),o=n(4728).onFreeze;n(3160)("preventExtensions",(function(t){return function(e){return t&&r(e)?t(o(e)):e}}))},3533:(t,e,n)=>{var r=n(5286),o=n(4728).onFreeze;n(3160)("seal",(function(t){return function(e){return t&&r(e)?t(o(e)):e}}))},8838:(t,e,n)=>{var r=n(2985);r(r.S,"Object",{setPrototypeOf:n(7375).set})},6253:(t,e,n)=>{"use strict";var r=n(1488),o={};o[n(6314)("toStringTag")]="z",o+""!="[object z]"&&n(7234)(Object.prototype,"toString",(function(){return"[object "+r(this)+"]"}),!0)},4299:(t,e,n)=>{var r=n(2985),o=n(7743);r(r.G+r.F*(parseFloat!=o),{parseFloat:o})},1084:(t,e,n)=>{var r=n(2985),o=n(5960);r(r.G+r.F*(parseInt!=o),{parseInt:o})},851:(t,e,n)=>{"use strict";var r,o,i,a,u=n(4461),s=n(3816),c=n(741),f=n(1488),l=n(2985),d=n(5286),h=n(4963),p=n(3328),v=n(3531),g=n(8364),m=n(4193).set,y=n(4351)(),b=n(3499),w=n(188),E=n(575),x=n(94),_="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(6314)("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(4408)(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(2943)(O,_),n(2974)(_),a=n(5645)[_],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(7462)((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}})},1572:(t,e,n)=>{var r=n(2985),o=n(4963),i=n(7007),a=(n(3816).Reflect||{}).apply,u=Function.apply;r(r.S+r.F*!n(4253)((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)}})},2139:(t,e,n)=>{var r=n(2985),o=n(2503),i=n(4963),a=n(7007),u=n(5286),s=n(4253),c=n(4398),f=(n(3816).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}})},685:(t,e,n)=>{var r=n(9275),o=n(2985),i=n(7007),a=n(1689);o(o.S+o.F*n(4253)((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}}})},5535:(t,e,n)=>{var r=n(2985),o=n(8693).f,i=n(7007);r(r.S,"Reflect",{deleteProperty:function(t,e){var n=o(i(t),e);return!(n&&!n.configurable)&&delete t[e]}})},7347:(t,e,n)=>{"use strict";var r=n(2985),o=n(7007),i=function(t){this._t=o(t),this._i=0;var e,n=this._k=[];for(e in t)n.push(e)};n(9988)(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)}})},6633:(t,e,n)=>{var r=n(8693),o=n(2985),i=n(7007);o(o.S,"Reflect",{getOwnPropertyDescriptor:function(t,e){return r.f(i(t),e)}})},8989:(t,e,n)=>{var r=n(2985),o=n(468),i=n(7007);r(r.S,"Reflect",{getPrototypeOf:function(t){return o(i(t))}})},3049:(t,e,n)=>{var r=n(8693),o=n(468),i=n(9181),a=n(2985),u=n(5286),s=n(7007);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}})},8270:(t,e,n)=>{var r=n(2985);r(r.S,"Reflect",{has:function(t,e){return e in t}})},4510:(t,e,n)=>{var r=n(2985),o=n(7007),i=Object.isExtensible;r(r.S,"Reflect",{isExtensible:function(t){return o(t),!i||i(t)}})},3984:(t,e,n)=>{var r=n(2985);r(r.S,"Reflect",{ownKeys:n(7643)})},5769:(t,e,n)=>{var r=n(2985),o=n(7007),i=Object.preventExtensions;r(r.S,"Reflect",{preventExtensions:function(t){o(t);try{return i&&i(t),!0}catch(t){return!1}}})},6014:(t,e,n)=>{var r=n(2985),o=n(7375);o&&r(r.S,"Reflect",{setPrototypeOf:function(t,e){o.check(t,e);try{return o.set(t,e),!0}catch(t){return!1}}})},55:(t,e,n)=>{var r=n(9275),o=n(8693),i=n(468),a=n(9181),u=n(2985),s=n(681),c=n(7007),f=n(5286);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)}})},3946:(t,e,n)=>{var r=n(3816),o=n(266),i=n(9275).f,a=n(616).f,u=n(5364),s=n(3218),c=r.RegExp,f=c,l=c.prototype,d=/a/g,h=/a/g,p=new c(d)!==d;if(n(7057)&&(!p||n(4253)((function(){return h[n(6314)("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(7234)(r,"RegExp",c)}n(2974)("RegExp")},8269:(t,e,n)=>{"use strict";var r=n(1165);n(2985)({target:"RegExp",proto:!0,forced:r!==/./.exec},{exec:r})},6774:(t,e,n)=>{n(7057)&&"g"!=/./g.flags&&n(9275).f(RegExp.prototype,"flags",{configurable:!0,get:n(3218)})},1466:(t,e,n)=>{"use strict";var r=n(7007),o=n(875),i=n(6793),a=n(7787);n(8082)("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}]}))},9357:(t,e,n)=>{"use strict";var r=n(7007),o=n(508),i=n(875),a=n(1467),u=n(6793),s=n(7787),c=Math.max,f=Math.min,l=Math.floor,d=/\$([$&`']|\d\d?|<[^>]*>)/g,h=/\$([$&`']|\d\d?)/g;n(8082)("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}))}}))},6142:(t,e,n)=>{"use strict";var r=n(7007),o=n(7195),i=n(7787);n(8082)("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}]}))},1876:(t,e,n)=>{"use strict";var r=n(5364),o=n(7007),i=n(8364),a=n(6793),u=n(875),s=n(7787),c=n(1165),f=n(4253),l=Math.min,d=[].push,h="split",p="length",v="lastIndex",g=4294967295,m=!f((function(){RegExp(g,"y")}));n(8082)("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)),_}]}))},6108:(t,e,n)=>{"use strict";n(6774);var r=n(7007),o=n(3218),i=n(7057),a="toString",u=/./[a],s=function(t){n(7234)(RegExp.prototype,a,t,!0)};n(4253)((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)}))},8184:(t,e,n)=>{"use strict";var r=n(9824),o=n(1616);t.exports=n(5795)("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)},856:(t,e,n)=>{"use strict";n(9395)("anchor",(function(t){return function(e){return t(this,"a","name",e)}}))},703:(t,e,n)=>{"use strict";n(9395)("big",(function(t){return function(){return t(this,"big","","")}}))},1539:(t,e,n)=>{"use strict";n(9395)("blink",(function(t){return function(){return t(this,"blink","","")}}))},5292:(t,e,n)=>{"use strict";n(9395)("bold",(function(t){return function(){return t(this,"b","","")}}))},9539:(t,e,n)=>{"use strict";var r=n(2985),o=n(4496)(!1);r(r.P,"String",{codePointAt:function(t){return o(this,t)}})},6620:(t,e,n)=>{"use strict";var r=n(2985),o=n(875),i=n(2094),a="endsWith",u=""[a];r(r.P+r.F*n(8852)(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}})},6629:(t,e,n)=>{"use strict";n(9395)("fixed",(function(t){return function(){return t(this,"tt","","")}}))},3694:(t,e,n)=>{"use strict";n(9395)("fontcolor",(function(t){return function(e){return t(this,"font","color",e)}}))},7648:(t,e,n)=>{"use strict";n(9395)("fontsize",(function(t){return function(e){return t(this,"font","size",e)}}))},191:(t,e,n)=>{var r=n(2985),o=n(2337),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("")}})},2850:(t,e,n)=>{"use strict";var r=n(2985),o=n(2094),i="includes";r(r.P+r.F*n(8852)(i),"String",{includes:function(t){return!!~o(this,t,i).indexOf(t,arguments.length>1?arguments[1]:void 0)}})},7795:(t,e,n)=>{"use strict";n(9395)("italics",(function(t){return function(){return t(this,"i","","")}}))},9115:(t,e,n)=>{"use strict";var r=n(4496)(!0);n(2923)(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})}))},4531:(t,e,n)=>{"use strict";n(9395)("link",(function(t){return function(e){return t(this,"a","href",e)}}))},8306:(t,e,n)=>{var r=n(2985),o=n(2110),i=n(875);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("")}})},823:(t,e,n)=>{var r=n(2985);r(r.P,"String",{repeat:n(8595)})},3605:(t,e,n)=>{"use strict";n(9395)("small",(function(t){return function(){return t(this,"small","","")}}))},7732:(t,e,n)=>{"use strict";var r=n(2985),o=n(875),i=n(2094),a="startsWith",u=""[a];r(r.P+r.F*n(8852)(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}})},6780:(t,e,n)=>{"use strict";n(9395)("strike",(function(t){return function(){return t(this,"strike","","")}}))},9937:(t,e,n)=>{"use strict";n(9395)("sub",(function(t){return function(){return t(this,"sub","","")}}))},511:(t,e,n)=>{"use strict";n(9395)("sup",(function(t){return function(){return t(this,"sup","","")}}))},4564:(t,e,n)=>{"use strict";n(9599)("trim",(function(t){return function(){return t(this,3)}}))},5767:(t,e,n)=>{"use strict";var r=n(3816),o=n(9181),i=n(7057),a=n(2985),u=n(7234),s=n(4728).KEY,c=n(4253),f=n(3825),l=n(2943),d=n(3953),h=n(6314),p=n(8787),v=n(6074),g=n(5541),m=n(4302),y=n(7007),b=n(5286),w=n(508),E=n(2110),x=n(1689),_=n(681),S=n(2503),A=n(9327),I=n(8693),T=n(4548),O=n(9275),N=n(7184),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(616).f=A.f=tt,n(4682).f=Q,T.f=et,i&&!n(4461)&&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(7728)(R[P],z,R[P].valueOf),l(R,"Symbol"),l(Math,"Math",!0),l(r.JSON,"JSON",!0)},142:(t,e,n)=>{"use strict";var r=n(2985),o=n(9383),i=n(1125),a=n(7007),u=n(2337),s=n(875),c=n(5286),f=n(3816).ArrayBuffer,l=n(8364),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(4253)((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(2974)(m)},1786:(t,e,n)=>{var r=n(2985);r(r.G+r.W+r.F*!n(9383).ABV,{DataView:n(1125).DataView})},162:(t,e,n)=>{n(8440)("Float32",4,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},3834:(t,e,n)=>{n(8440)("Float64",8,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},4821:(t,e,n)=>{n(8440)("Int16",2,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},1303:(t,e,n)=>{n(8440)("Int32",4,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},5368:(t,e,n)=>{n(8440)("Int8",1,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},9103:(t,e,n)=>{n(8440)("Uint16",2,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},3318:(t,e,n)=>{n(8440)("Uint32",4,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},6964:(t,e,n)=>{n(8440)("Uint8",1,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},2152:(t,e,n)=>{n(8440)("Uint8",1,(function(t){return function(e,n,r){return t(this,e,n,r)}}),!0)},147:(t,e,n)=>{"use strict";var r,o=n(3816),i=n(50)(0),a=n(7234),u=n(4728),s=n(5345),c=n(3657),f=n(5286),l=n(1616),d=n(1616),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(5795)(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)}))})))},9192:(t,e,n)=>{"use strict";var r=n(3657),o=n(1616),i="WeakSet";n(5795)(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)},1268:(t,e,n)=>{"use strict";var r=n(2985),o=n(3325),i=n(508),a=n(875),u=n(4963),s=n(6886);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(7722)("flatMap")},2773:(t,e,n)=>{"use strict";var r=n(2985),o=n(9315)(!0);r(r.P,"Array",{includes:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),n(7722)("includes")},3276:(t,e,n)=>{var r=n(2985),o=n(1131)(!0);r(r.S,"Object",{entries:function(t){return o(t)}})},8351:(t,e,n)=>{var r=n(2985),o=n(7643),i=n(2110),a=n(8693),u=n(2811);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}})},6409:(t,e,n)=>{var r=n(2985),o=n(1131)(!1);r(r.S,"Object",{values:function(t){return o(t)}})},9865:(t,e,n)=>{"use strict";var r=n(2985),o=n(5645),i=n(3816),a=n(8364),u=n(94);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)}})},2770:(t,e,n)=>{"use strict";var r=n(2985),o=n(5442),i=n(575),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)}})},1784:(t,e,n)=>{"use strict";var r=n(2985),o=n(5442),i=n(575),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)}})},5869:(t,e,n)=>{"use strict";n(9599)("trimLeft",(function(t){return function(){return t(this,1)}}),"trimStart")},4325:(t,e,n)=>{"use strict";n(9599)("trimRight",(function(t){return function(){return t(this,2)}}),"trimEnd")},9665:(t,e,n)=>{n(6074)("asyncIterator")},1181:(t,e,n)=>{for(var r=n(6997),o=n(7184),i=n(7234),a=n(3816),u=n(7728),s=n(2803),c=n(6314),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)}},4633:(t,e,n)=>{var r=n(2985),o=n(4193);r(r.G+r.B,{setImmediate:o.set,clearImmediate:o.clear})},2564:(t,e,n)=>{var r=n(3816),o=n(2985),i=n(575),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)})},6337:(t,e,n)=>{n(2564),n(4633),n(1181),t.exports=n(5645)},2705:(t,e,n)=>{var r=n(5639).Symbol;t.exports=r},4239:(t,e,n)=>{var r=n(2705),o=n(9607),i=n(2333),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)}},8749:(t,e,n)=>{var r=n(4239),o=n(1780),i=n(7005),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)]}},7518:t=>{t.exports=function(t){return function(e){return t(e)}}},1957:(t,e,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=r},5924:(t,e,n)=>{var r=n(5569)(Object.getPrototypeOf,Object);t.exports=r},9607:(t,e,n)=>{var r=n(2705),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}},1167:(t,e,n)=>{t=n.nmd(t);var r=n(1957),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},2333:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},5569:t=>{t.exports=function(t,e){return function(n){return t(e(n))}}},5639:(t,e,n)=>{var r=n(1957),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i},1469:t=>{var e=Array.isArray;t.exports=e},1780:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},1763:(t,e,n)=>{var r=n(4239),o=n(7005);t.exports=function(t){return"number"==typeof t||o(t)&&"[object Number]"==r(t)}},7005:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},8630:(t,e,n)=>{var r=n(4239),o=n(5924),i=n(7005),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}},6719:(t,e,n)=>{var r=n(8749),o=n(7518),i=n(1167),a=i&&i.isTypedArray,u=a?o(a):r;t.exports=u},5666: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)}},1550: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=9728,E=9984,x=9985,_=9986,S=9987,A=5126,I=32819,T=32820,O=33635,N=34042,D={};function M(t,e){return t===T||t===I||t===O?2:t===N?4:D[t]*e}function k(t){return!(t&t-1||!t)}D[5120]=D[5121]=1,D[5122]=D[5123]=D[36193]=D[O]=D[I]=D[T]=2,D[5124]=D[5125]=D[A]=D[N]=4;var R=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(k(i)&&k(a),"incompatible wrap mode for texture, both width and height must be power of 2"),1===e.mipmask?1!==i&&1!==a&&o(t.minFilter!==E&&t.minFilter!==_&&t.minFilter!==x&&t.minFilter!==S,"min filter requires mipmap"):(o(k(i)&&k(a),"texture must be a square power of 2 to support mipmapping"),o(e.mipmask===(i<<1)-1,"missing or incomplete mipmap data")),e.type===A&&(n.extensions.indexOf("oes_texture_float_linear")<0&&o(t.minFilter===w&&t.magFilter===w,"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(M(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(M(d.type,u),d.unpackAlignment),"invalid data for image, buffer size is inconsistent with image format"):d.element||d.copy)}}}}}),C=0,L=0,P=5,j=6;function z(t,e){this.id=C++,this.type=t,this.data=e}function F(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function G(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['"'+F(t.substr(1,t.length-2))+'"'];var r=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(t);if(r)return G(t.substr(0,r.index)).concat(G(r[1])).concat(G(t.substr(r.index+r[0].length)));var o=t.split(".");if(1===o.length)return['"'+F(t)+'"'];for(var i=[],a=0;a<o.length;++a)i=i.concat(G(o[a]));return i}function U(t){return"["+G(t).join("][")+"]"}var B={DynamicVariable:z,define:function(t,e){return new z(t,U(e+""))},isDynamic:function(t){return"function"==typeof t&&!t._reglType||t instanceof z},unbox:function t(e,n){return"function"==typeof e?new z(L,e):"number"==typeof e||"boolean"==typeof e?new z(P,e):Array.isArray(e)?new z(j,e.map(((e,r)=>t(e,n+"["+r+"]")))):e instanceof z?e:void R(!1,"invalid option type in uniform "+n)},accessor:U},V={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},W="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date};function X(t){return"string"==typeof t?t.split():(R(Array.isArray(t),"invalid extension array"),t)}function H(t){return"string"==typeof t?(R("undefined"!=typeof document,"not supported outside of DOM"),document.querySelector(t)):t}function q(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&&R.raise(t)},p=function(){};if("string"==typeof u?(R("undefined"!=typeof document,"selector queries only supported in DOM enviroments"),n=document.querySelector(u),R(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:(R.constructor(u),"gl"in u?i=u.gl:"canvas"in u?o=H(u.canvas):"container"in u&&(r=H(u.container)),"attributes"in u&&(s=u.attributes,R.type(s,"object","invalid context attributes")),"extensions"in u&&(c=X(u.extensions)),"optionalExtensions"in u&&(f=X(u.optionalExtensions)),"onDone"in u&&(R.type(u.onDone,"function","invalid or missing onDone callback"),h=u.onDone),"profile"in u&&(d=!!u.profile),"pixelRatio"in u&&(l=+u.pixelRatio,R(l>0,"invalid pixel ratio"))):R.raise("invalid arguments to regl"),n&&("canvas"===n.nodeName.toLowerCase()?o=n:r=n),!i){if(!o){R("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 Y(t,e){for(var n=Array(t),r=0;r<t;++r)n[r]=e(r);return n}var K=5120,Z=5121,$=5122,Q=5123,J=5124,tt=5125,et=5126;function nt(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 rt(){var t=Y(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[nt(n)>>2];return r.length>0?r.pop():new ArrayBuffer(n)}function n(e){t[nt(e.byteLength)>>2].push(e)}return{alloc:e,free:n,allocType:function(t,n){var r=null;switch(t){case K:r=new Int8Array(e(n),0,n);break;case Z:r=new Uint8Array(e(n),0,n);break;case $:r=new Int16Array(e(2*n),0,n);break;case Q:r=new Uint16Array(e(2*n),0,n);break;case J:r=new Int32Array(e(4*n),0,n);break;case tt:r=new Uint32Array(e(4*n),0,n);break;case et: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 ot=rt();ot.zero=rt();var it=3553,at=6408,ut=5126,st=36160,ct=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(it,a),t.texImage2D(it,0,at,1,1,0,at,ut,null);var u=t.createFramebuffer();if(t.bindFramebuffer(st,u),t.framebufferTexture2D(st,36064,it,a,0),t.bindTexture(it,null),36053!==t.checkFramebufferStatus(st))i=!1;else{t.viewport(0,0,1,1),t.clearColor(1,0,0,1),t.clear(16384);var s=ot.allocType(ut,4);t.readPixels(0,0,1,1,at,ut,s),t.getError()?i=!1:(t.deleteFramebuffer(u),t.deleteTexture(a),i=1===s[0]),ot.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=ot.allocType(5121,36);t.activeTexture(33984),t.bindTexture(34067,f),t.texImage2D(34069,0,at,3,3,0,at,5121,l),ot.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}};function ft(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 lt=function(t){return Object.keys(t).map((function(e){return t[e]}))},dt={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||ot.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:ht(t,e[0],e[1],e[2],a,0);break;default:pt(t,e,0,a,0)}return a}};function ht(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 pt(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)ht(t[a],s,c,f,r,o),o+=i}else for(a=0;a<u;++a)pt(t[a],e,n+1,r,o),o+=i}var vt={"[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},gt={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},mt={dynamic:35048,stream:35040,static:35044},yt=dt.flatten,bt=dt.shape,wt=35044,Et=35040,xt=5121,_t=5126,St=[];function At(t){return 0|vt[Object.prototype.toString.call(t)]}function It(t,e){for(var n=0;n<e.length;++n)t[n]=e[n]}function Tt(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]}St[5120]=1,St[5122]=2,St[5124]=4,St[5121]=1,St[5123]=2,St[5125]=4,St[5126]=4;var Ot={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Nt=0,Dt=1,Mt=4,kt=5120,Rt=5121,Ct=5122,Lt=5123,Pt=5124,jt=5125,zt=34963,Ft=35040,Gt=35044;var Ut=new Float32Array(1),Bt=new Uint32Array(Ut.buffer),Vt=5123;function Wt(t){for(var e=ot.allocType(Vt,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{Ut[0]=t[n];var r=Bt[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 Xt(e){return Array.isArray(e)||t(e)}var Ht=function(t){return!(t&t-1||!t)},qt=34467,Yt=3553,Kt=34067,Zt=34069,$t=6408,Qt=6406,Jt=6407,te=6409,ee=6410,ne=32854,re=32855,oe=36194,ie=32819,ae=32820,ue=33635,se=34042,ce=6402,fe=34041,le=35904,de=35906,he=36193,pe=33776,ve=33777,ge=33778,me=33779,ye=35986,be=35987,we=34798,Ee=35840,xe=35841,_e=35842,Se=35843,Ae=36196,Ie=5121,Te=5123,Oe=5125,Ne=5126,De=10242,Me=10243,ke=10497,Re=33071,Ce=33648,Le=10240,Pe=10241,je=9728,ze=9729,Fe=9984,Ge=9985,Ue=9986,Be=9987,Ve=33170,We=4352,Xe=4353,He=4354,qe=34046,Ye=3317,Ke=37440,Ze=37441,$e=37443,Qe=37444,Je=33984,tn=[Fe,Ue,Ge,Be],en=[0,te,ee,Jt,$t],nn={};function rn(t){return"[object "+t+"]"}nn[te]=nn[Qt]=nn[ce]=1,nn[fe]=nn[ee]=2,nn[Jt]=nn[le]=3,nn[$t]=nn[de]=4;var on=rn("HTMLCanvasElement"),an=rn("OffscreenCanvas"),un=rn("CanvasRenderingContext2D"),sn=rn("ImageBitmap"),cn=rn("HTMLImageElement"),fn=rn("HTMLVideoElement"),ln=Object.keys(vt).concat([on,an,un,sn,cn,fn]),dn=[];dn[Ie]=1,dn[Ne]=4,dn[he]=2,dn[Te]=2,dn[Oe]=4;var hn=[];function pn(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function vn(t){return!!Array.isArray(t)&&!(0===t.length||!Xt(t[0]))}function gn(t){return Object.prototype.toString.call(t)}function mn(t){return gn(t)===on}function yn(t){return gn(t)===an}function bn(t){if(!t)return!1;var e=gn(t);return ln.indexOf(e)>=0||pn(t)||vn(t)||ft(t)}function wn(t){return 0|vt[Object.prototype.toString.call(t)]}function En(t,e){return ot.allocType(t.type===he?Ne:t.type,e)}function xn(t,e){t.type===he?(t.data=Wt(e),ot.freeType(e)):t.data=e}function _n(t,e,n,r,o,i){var a;if(a=void 0!==hn[t]?hn[t]:nn[t]*dn[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 Sn(n,r,o,i,a,u,s){var c={"don't care":We,"dont care":We,nice:He,fast:Xe},f={repeat:ke,clamp:Re,mirror:Ce},l={nearest:je,linear:ze},d=e({mipmap:Be,"nearest mipmap nearest":Fe,"linear mipmap nearest":Ge,"nearest mipmap linear":Ue,"linear mipmap linear":Be},l),h={none:0,browser:Qe},p={uint8:Ie,rgba4:ie,rgb565:ue,"rgb5 a1":ae},v={alpha:Qt,luminance:te,"luminance alpha":ee,rgb:Jt,rgba:$t,rgba4:ne,"rgb5 a1":re,rgb565:oe},g={};r.ext_srgb&&(v.srgb=le,v.srgba=de),r.oes_texture_float&&(p.float32=p.float=Ne),r.oes_texture_half_float&&(p.float16=p["half float"]=he),r.webgl_depth_texture&&(e(v,{depth:ce,"depth stencil":fe}),e(p,{uint16:Te,uint32:Oe,"depth stencil":se})),r.webgl_compressed_texture_s3tc&&e(g,{"rgb s3tc dxt1":pe,"rgba s3tc dxt1":ve,"rgba s3tc dxt3":ge,"rgba s3tc dxt5":me}),r.webgl_compressed_texture_atc&&e(g,{"rgb atc":ye,"rgba atc explicit alpha":be,"rgba atc interpolated alpha":we}),r.webgl_compressed_texture_pvrtc&&e(g,{"rgb pvrtc 4bppv1":Ee,"rgb pvrtc 2bppv1":xe,"rgba pvrtc 4bppv1":_e,"rgba pvrtc 2bppv1":Se}),r.webgl_compressed_texture_etc1&&(g["rgb etc1"]=Ae);var m=Array.prototype.slice.call(n.getParameter(qt));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===te||n===Qt||n===te||n===ee||n===ce||n===fe||r.ext_srgb&&(n===le||n===de)?t[n]=n:n===re||e.indexOf("rgba")>=0?t[n]=$t:t[n]=Jt,t}),{});function A(){this.internalformat=$t,this.format=$t,this.type=Ie,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=Qe,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 T(t,e){if("object"==typeof e&&e){if("premultiplyAlpha"in e&&(R.type(e.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),t.premultiplyAlpha=e.premultiplyAlpha),"flipY"in e&&(R.type(e.flipY,"boolean","invalid texture flip"),t.flipY=e.flipY),"alignment"in e&&(R.oneOf(e.alignment,[1,2,4,8],"invalid texture unpack alignment"),t.unpackAlignment=e.alignment),"colorSpace"in e&&(R.parameter(e.colorSpace,h,"invalid colorSpace"),t.colorSpace=h[e.colorSpace]),"type"in e){var n=e.type;R(r.oes_texture_float||!("float"===n||"float32"===n),"you must enable the OES_texture_float extension in order to use floating point textures."),R(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."),R(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."),R.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?(R(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],R(u>0&&u<=4,"invalid number of channels"),s=!0),R(i>=0&&i<=o.maxTextureSize,"invalid width"),R(a>=0&&a<=o.maxTextureSize,"invalid height")):("radius"in e&&(i=a=e.radius,R(i>=0&&i<=o.maxTextureSize,"invalid radius")),"width"in e&&(i=e.width,R(i>=0&&i<=o.maxTextureSize,"invalid width")),"height"in e&&(a=e.height,R(a>=0&&a<=o.maxTextureSize,"invalid height")),"channels"in e&&(u=e.channels,R(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;R(r.webgl_depth_texture||!("depth"===f||"depth stencil"===f),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),R.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=nn[t.format]:s&&!c?t.channels!==en[t.format]&&(t.format=t.internalformat=en[t.channels]):c&&s&&R(t.channels===nn[t.format],"number of channels inconsistent with specified format")}}function O(t){n.pixelStorei(Ke,t.flipY),n.pixelStorei(Ze,t.premultiplyAlpha),n.pixelStorei($e,t.colorSpace),n.pixelStorei(Ye,t.unpackAlignment)}function N(){A.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function D(e,n){var r=null;if(bn(n)?r=n:n&&(R.type(n,"object","invalid pixel data type"),T(e,n),"x"in n&&(e.xOffset=0|n.x),"y"in n&&(e.yOffset=0|n.y),bn(n.data)&&(r=n.data)),R(!e.compressed||r instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),n.copy){R(!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,R(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!==Ie||(e.type=wn(r));else if(pn(r))e.channels=e.channels||4,function(t,e){var n=e.length;switch(t.type){case Ie:case Te:case Oe:case Ne:var r=ot.allocType(t.type,n);r.set(e),t.data=r;break;case he:t.data=Wt(e);break;default:R.raise("unsupported texture type, must specify a typed array")}}(e,r),e.alignment=1,e.needsFree=!0;else if(ft(r)){var s=r.data;Array.isArray(s)||e.type!==Ie||(e.type=wn(s));var c,f,l,d,h,p,v=r.shape,g=r.stride;3===v.length?(l=v[2],p=g[2]):(R(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=en[l],e.needsFree=!0,function(t,e,n,r,o,i){for(var a=t.width,u=t.height,s=t.channels,c=En(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];xn(t,c)}(e,s,d,h,p,r.offset)}else if(mn(r)||yn(r)||gn(r)===un)mn(r)||yn(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 gn(t)===sn}(r))e.element=r,e.width=r.width,e.height=r.height,e.channels=4;else if(function(t){return gn(t)===cn}(r))e.element=r,e.width=r.naturalWidth,e.height=r.naturalHeight,e.channels=4;else if(function(t){return gn(t)===fn}(r))e.element=r,e.width=r.videoWidth,e.height=r.videoHeight,e.channels=4;else if(vn(r)){var m=e.width||r[0].length,y=e.height||r.length,b=e.channels;b=Xt(r[0][0])?b||r[0][0].length:b||1;for(var w=dt.shape(r),E=1,x=0;x<w.length;++x)E*=w[x];var _=En(e,E);dt.flatten(r,w,"",_),xn(e,_),e.alignment=1,e.width=m,e.height=y,e.channels=b,e.format=e.internalformat=en[b],e.needsFree=!0}}else e.width=e.width||1,e.height=e.height||1,e.channels=e.channels||4;e.type===Ne?R(o.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):e.type===he&&R(o.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function M(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;O(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 k(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;O(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 N}function P(t){t.needsFree&&ot.freeType(t.data),N.call(t),C.push(t)}function j(){A.call(this),this.genMipmaps=!1,this.mipmapHint=We,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(bn(e))I(n=t.images[0]=L(),t),D(n,e),t.mipmask=1;else if(T(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,D(n,r[o]),t.mipmask|=1<<o;else I(n=t.images[0]=L(),t),D(n,e),t.mipmask=1;I(t,t.images[0]),!t.compressed||t.internalformat!==pe&&t.internalformat!==ve&&t.internalformat!==ge&&t.internalformat!==me||R(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;M(n[r],e,r)}}var U=[];function B(){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 V(t){for(var e=t.images,n=0;n<e.length;++n)e[n]&&P(e[n]),e[n]=null;U.push(t)}function W(){this.minFilter=je,this.magFilter=je,this.wrapS=Re,this.wrapT=Re,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=We}function X(t,e){if("min"in e){var n=e.min;R.parameter(n,d),t.minFilter=d[n],tn.indexOf(t.minFilter)>=0&&!("faces"in e)&&(t.genMipmaps=!0)}if("mag"in e){var r=e.mag;R.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?(R.parameter(u,f),i=a=f[u]):Array.isArray(u)&&(R.parameter(u[0],f),R.parameter(u[1],f),i=f[u[0]],a=f[u[1]])}else{if("wrapS"in e){var s=e.wrapS;R.parameter(s,f),i=f[s]}if("wrapT"in e){var h=e.wrapT;R.parameter(h,f),a=f[h]}}if(t.wrapS=i,t.wrapT=a,"anisotropic"in e){var p=e.anisotropic;R("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":R.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":R(Array.isArray(e.mipmap),"invalid mipmap type"),t.genMipmaps=!1,v=!0;break;default:R.raise("invalid mipmap type")}v&&!("min"in e)&&(t.minFilter=Fe)}}function H(t,e){n.texParameteri(e,Pe,t.minFilter),n.texParameteri(e,Le,t.magFilter),n.texParameteri(e,De,t.wrapS),n.texParameteri(e,Me,t.wrapT),r.ext_texture_filter_anisotropic&&n.texParameteri(e,qe,t.anisotropic),t.genMipmaps&&(n.hint(Ve,t.mipmapHint),n.generateMipmap(e))}var q=0,Y={},K=o.maxTextureUnits,Z=Array(K).map((function(){return null}));function $(t){A.call(this),this.mipmask=0,this.internalformat=$t,this.id=q++,this.refCount=1,this.target=t,this.texture=n.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new W,s.profile&&(this.stats={size:0})}function Q(t){n.activeTexture(Je),n.bindTexture(t.target,t.texture)}function J(){var t=Z[0];t?n.bindTexture(t.target,t.texture):n.bindTexture(Yt,null)}function tt(t){var e=t.texture;R(e,"must not double destroy texture");var r=t.unit,o=t.target;r>=0&&(n.activeTexture(Je+r),n.bindTexture(o,null),Z[r]=null),n.deleteTexture(e),t.texture=null,t.params=null,t.pixels=null,t.refCount=0,delete Y[t.id],u.textureCount--}return e($.prototype,{bind:function(){var t=this;t.bindCount+=1;var e=t.unit;if(e<0){for(var r=0;r<K;++r){var o=Z[r];if(o){if(o.bindCount>0)continue;o.unit=-1}Z[r]=t,e=r;break}e>=K&&R.raise("insufficient number of texture units"),s.profile&&u.maxTextureUnits<e+1&&(u.maxTextureUnits=e+1),t.unit=e,n.activeTexture(Je+e),n.bindTexture(t.target,t.texture)}return e},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&tt(this)}}),s.profile&&(u.getTotalTextureSize=function(){var t=0;return Object.keys(Y).forEach((function(e){t+=Y[e].stats.size})),t}),{create2D:function(t,e){var r=new $(Yt);function i(t,e){var n=r.texInfo;W.call(n);var a=B();return"number"==typeof t?z(a,0|t,"number"==typeof e?0|e:0|t):t?(R.type(t,"object","invalid arguments to regl.texture"),X(n,t),F(a,t)):z(a,1,1),n.genMipmaps&&(a.mipmask=(a.width<<1)-1),r.mipmask=a.mipmask,I(r,a),R.texture2D(n,a,o),r.internalformat=a.internalformat,i.width=a.width,i.height=a.height,Q(r),G(a,Yt),H(n,Yt),J(),V(a),s.profile&&(r.stats.size=_n(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 Y[r.id]=r,u.textureCount++,i(t,e),i.subimage=function(t,e,n,o){R(!!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,D(c,t),c.width=c.width||(r.width>>s)-a,c.height=c.height||(r.height>>s)-u,R(r.type===c.type&&r.format===c.format&&r.internalformat===c.internalformat,"incompatible format for texture.subimage"),R(a>=0&&u>=0&&a+c.width<=r.width&&u+c.height<=r.height,"texture.subimage write out of bounds"),R(r.mipmask&1<<s,"missing mipmap data"),R(c.data||c.element||c.needsCopy,"missing image data"),Q(r),k(c,Yt,a,u,s),J(),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,Q(r);for(var u=0;r.mipmask>>u;++u){var c=o>>u,f=a>>u;if(!c||!f)break;n.texImage2D(Yt,u,r.format,c,f,0,r.format,r.type,null)}return J(),s.profile&&(r.stats.size=_n(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 $(Kt);Y[f.id]=f,u.cubeCount++;var l=new Array(6);function d(t,e,n,r,i,a){var u,c=f.texInfo;for(W.call(c),u=0;u<6;++u)l[u]=B();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(X(c,t),T(f,t),"faces"in t){var h=t.faces;for(R(Array.isArray(h)&&6===h.length,"cube faces must be a length 6 array"),u=0;u<6;++u)R("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 R.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||R(Ht(f.width)&&Ht(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,R.textureCube(f,c,l,o),f.internalformat=l[0].internalformat,d.width=l[0].width,d.height=l[0].height,Q(f),u=0;u<6;++u)G(l[u],Zt+u);for(H(c,Kt),J(),s.profile&&(f.stats.size=_n(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)V(l[u]);return d}return d(t,e,r,i,a,c),d.subimage=function(t,e,n,r,o){R(!!e,"must specify image data"),R("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,D(s,e),s.width=s.width||(f.width>>u)-i,s.height=s.height||(f.height>>u)-a,R(f.type===s.type&&f.format===s.format&&f.internalformat===s.internalformat,"incompatible format for texture.subimage"),R(i>=0&&a>=0&&i+s.width<=f.width&&a+s.height<=f.height,"texture.subimage write out of bounds"),R(f.mipmask&1<<u,"missing mipmap data"),R(s.data||s.element||s.needsCopy,"missing image data"),Q(f),k(s,Zt+t,i,a,u),J(),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,Q(f);for(var r=0;r<6;++r)for(var o=0;f.mipmask>>o;++o)n.texImage2D(Zt+r,o,f.format,e>>o,e>>o,0,f.format,f.type,null);return J(),s.profile&&(f.stats.size=_n(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<K;++t)n.activeTexture(Je+t),n.bindTexture(Yt,null),Z[t]=null;lt(Y).forEach(tt),u.cubeCount=0,u.textureCount=0},getTexture:function(t){return null},restore:function(){for(var t=0;t<K;++t){var e=Z[t];e&&(e.bindCount=0,e.unit=-1,Z[t]=null)}lt(Y).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===Yt)n.texImage2D(Yt,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(Zt+r,e,t.internalformat,t.width>>e,t.height>>e,0,t.internalformat,t.type,null);H(t.texInfo,t.target)}))},refresh:function(){for(var t=0;t<K;++t){var e=Z[t];e&&(e.bindCount=0,e.unit=-1,Z[t]=null),n.activeTexture(Je+t),n.bindTexture(Yt,null),n.bindTexture(Kt,null)}}}}hn[ne]=2,hn[re]=2,hn[oe]=2,hn[fe]=4,hn[pe]=.5,hn[ve]=.5,hn[ge]=1,hn[me]=1,hn[ye]=.5,hn[be]=1,hn[we]=1,hn[Ee]=.5,hn[xe]=.25,hn[_e]=.5,hn[Se]=.25,hn[Ae]=.5;var An=36161,In=32854,Tn=[];function On(t,e,n){return Tn[t]*e*n}Tn[In]=2,Tn[32855]=2,Tn[36194]=2,Tn[33189]=2,Tn[36168]=1,Tn[34041]=4,Tn[35907]=4,Tn[34836]=16,Tn[34842]=8,Tn[34843]=6;var Nn=function(t,e,n,r,o){var i={rgba4:In,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=In,this.width=0,this.height=0,o.profile&&(this.stats={size:0})}function f(e){var n=e.renderbuffer;R(n,"must not double destroy renderbuffer"),t.bindRenderbuffer(An,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=In;if("object"==typeof e&&e){var d=e;if("shape"in d){var h=d.shape;R(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&&(R.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?R.raise("invalid arguments to renderbuffer constructor"):u=s=1;if(R(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(An,f.renderbuffer),t.renderbufferStorage(An,c,u,s),R(0===t.getError(),"invalid render buffer format"),o.profile&&(f.stats.size=On(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||(R(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(An,f.renderbuffer),t.renderbufferStorage(An,f.format,i,a),R(0===t.getError(),"invalid render buffer format"),o.profile&&(f.stats.size=On(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(){lt(s).forEach(f)},restore:function(){lt(s).forEach((function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(An,e.renderbuffer),t.renderbufferStorage(An,e.format,e.width,e.height)})),t.bindRenderbuffer(An,null)}}},Dn=36160,Mn=36161,kn=3553,Rn=34069,Cn=36064,Ln=36096,Pn=36128,jn=33306,zn=36053,Fn=6402,Gn=[6407,6408],Un=[];Un[6408]=4,Un[6407]=3;var Bn=[];Bn[5121]=1,Bn[5126]=4,Bn[36193]=2;var Vn=33189,Wn=36168,Xn=34041,Hn=[32854,32855,36194,35907,34842,34843,34836],qn={};qn[zn]="complete",qn[36054]="incomplete attachment",qn[36057]="incomplete dimensions",qn[36055]="incomplete, missing attachment",qn[36061]="unsupported";var Yn=5126,Kn=34962;function Zn(){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=Yn,this.offset=0,this.stride=0,this.divisor=0}var $n=35632,Qn=35633,Jn=35718,tr=35721;var er=6408,nr=5121,rr=3333,or=5126;function ir(e,n,r,o,i,a,u){function s(s){var c;null===n.next?(R(i.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),c=nr):(R(null!==n.next.colorAttachments[0].texture,"You cannot read from a renderbuffer"),c=n.next.colorAttachments[0].texture._texture.type,a.oes_texture_float?(R(c===nr||c===or,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),c===or&&R(u.readFloat,"Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):R(c===nr,"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&&(R.type(s,"object","invalid arguments to regl.read()"),f=0|s.x,l=0|s.y,R(f>=0&&f<o.framebufferWidth,"invalid x offset for regl.read"),R(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===nr?R(p instanceof Uint8Array,"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"):c===or&&R(p instanceof Float32Array,"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'")),R(d>0&&d+f<=o.framebufferWidth,"invalid width for read pixels"),R(h>0&&h+l<=o.framebufferHeight,"invalid height for read pixels"),r();var v=d*h*4;return p||(c===nr?p=new Uint8Array(v):c===or&&(p=p||new Float32Array(v))),R.isTypedArray(p,"data buffer for regl.read() must be a typedarray"),R(p.byteLength>=v,"data buffer for regl.read() too small"),e.pixelStorei(rr,4),e.readPixels(f,l,d,h,er,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 ar(t){return Array.prototype.slice.call(t)}function ur(t){return ar(t).join("")}var sr="xyzw".split(""),cr=5121,fr=1,lr=2,dr=0,hr=1,pr=2,vr=3,gr=4,mr=5,yr=6,br="dither",wr="blend.enable",Er="blend.color",xr="blend.equation",_r="blend.func",Sr="depth.enable",Ar="depth.func",Ir="depth.range",Tr="depth.mask",Or="colorMask",Nr="cull.enable",Dr="cull.face",Mr="frontFace",kr="lineWidth",Rr="polygonOffset.enable",Cr="polygonOffset.offset",Lr="sample.alpha",Pr="sample.enable",jr="sample.coverage",zr="stencil.enable",Fr="stencil.mask",Gr="stencil.func",Ur="stencil.opFront",Br="stencil.opBack",Vr="scissor.enable",Wr="scissor.box",Xr="viewport",Hr="profile",qr="framebuffer",Yr="vert",Kr="frag",Zr="elements",$r="primitive",Qr="count",Jr="offset",to="instances",eo="vao",no="Width",ro="Height",oo=qr+no,io=qr+ro,ao=Xr+no,uo=Xr+ro,so="drawingBuffer",co=so+no,fo=so+ro,lo=[_r,xr,Gr,Ur,Br,jr,Xr,Wr,Cr],ho=34962,po=34963,vo=3553,go=34067,mo=2884,yo=3042,bo=3024,wo=2960,Eo=2929,xo=3089,_o=32823,So=32926,Ao=32928,Io=5126,To=35664,Oo=35665,No=35666,Do=5124,Mo=35667,ko=35668,Ro=35669,Co=35670,Lo=35671,Po=35672,jo=35673,zo=35674,Fo=35675,Go=35676,Uo=35678,Bo=35680,Vo=4,Wo=1028,Xo=1029,Ho=2304,qo=2305,Yo=32775,Ko=32776,Zo=519,$o=7680,Qo=0,Jo=1,ti=32774,ei=513,ni=36160,ri=36064,oi={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},ii=["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"],ai={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},ui={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},si={frag:35632,vert:35633},ci={cw:Ho,ccw:qo};function fi(e){return Array.isArray(e)||t(e)||ft(e)}function li(t){return t.sort((function(t,e){return t===Xr?-1:e===Xr?1:t<e?-1:1}))}function di(t,e,n,r){this.thisDep=t,this.contextDep=e,this.propDep=n,this.append=r}function hi(t){return t&&!(t.thisDep||t.contextDep||t.propDep)}function pi(t){return new di(!1,!1,!1,t)}function vi(t,e){var n=t.type;if(n===dr){var r=t.data.length;return new di(!0,r>=1,r>=2,e)}if(n===gr){var o=t.data;return new di(o.thisDep,o.contextDep,o.propDep,e)}if(n===mr)return new di(!1,!1,!1,e);if(n===yr){for(var i=!1,a=!1,u=!1,s=0;s<t.data.length;++s){var c=t.data[s];if(c.type===hr)u=!0;else if(c.type===pr)a=!0;else if(c.type===vr)i=!0;else if(c.type===dr){i=!0;var f=c.data;f>=1&&(a=!0),f>=2&&(u=!0)}else c.type===gr&&(i=i||c.data.thisDep,a=a||c.data.contextDep,u=u||c.data.propDep)}return new di(i,a,u,e)}return new di(n===vr,n===pr,n===hr,e)}var gi=new di(!1,!1,!1,(function(){}));function mi(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=Yo,m.max=Ko);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 T(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(br,bo),I(wr,yo),T(Er,"blendColor",[0,0,0,0]),T(xr,"blendEquationSeparate",[ti,ti]),T(_r,"blendFuncSeparate",[Jo,Qo,Jo,Qo]),I(Sr,Eo,!0),T(Ar,"depthFunc",ei),T(Ir,"depthRange",[0,1]),T(Tr,"depthMask",!0),T(Or,Or,[!0,!0,!0,!0]),I(Nr,mo),T(Dr,"cullFace",Xo),T(Mr,Mr,qo),T(kr,kr,1),I(Rr,_o),T(Cr,"polygonOffset",[0,0]),I(Lr,So),I(Pr,Ao),T(jr,"sampleCoverage",[1,!1]),I(zr,wo),T(Fr,"stencilMask",-1),T(Gr,"stencilFunc",[Zo,0,-1]),T(Ur,"stencilOpSeparate",[Wo,$o,$o,$o]),T(Br,"stencilOpSeparate",[Xo,$o,$o,$o]),I(Vr,xo),T(Wr,"scissor",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]),T(Xr,Xr,[0,0,t.drawingBufferWidth,t.drawingBufferHeight]);var O={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:fi},N={primTypes:Ot,compareFuncs:ai,blendFuncs:oi,blendEquations:m,stencilOps:ui,glTypes:gt,orientationType:ci};R.optional((function(){O.isArrayLike=Xt})),b&&(N.backBuffer=[Xo],N.drawBuffer=Y(o.maxDrawbuffers,(function(t){return 0===t?[0]:Y(t,(function(t){return ri+t}))})));var D=0;function M(){var t=function(){var t=0,n=[],r=[];function o(){var n=[],r=[];return e((function(){n.push.apply(n,ar(arguments))}),{def:function(){var e="v"+t++;return r.push(e),arguments.length>0&&(n.push(e,"="),n.push.apply(n,ar(arguments)),n.push(";")),e},toString:function(){return ur([r.length>0?"var "+r.join(",")+";":"",ur(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,ar(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 ur(["function(",r.join(),"){",c(),"}"])}})},scope:i,cond:function(){var t=ur(arguments),n=i(),r=i(),o=n.toString,a=r.toString;return e(n,{then:function(){return n.apply(n,ar(arguments)),this},else:function(){return r.apply(r,ar(arguments)),this},toString:function(){var e=a();return e&&(e="else{"+e+"}"),ur(["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=ur(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=D++,t.batchId="0";var i=r(O),a=t.shared={props:"a0"};Object.keys(O).forEach((function(t){a[t]=o.def(i,".",t)})),R.optional((function(){t.CHECK=r(R),t.commandStr=R.guessCommand(),t.command=r(t.commandStr),t.assert=function(t,e,n){t("if(!(",e,"))",this.CHECK,".commandRaise(",r(n),",",this.command,");")},N.invalidBlendCombinations=ii}));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(N).forEach((function(t){c[t]=o.def(JSON.stringify(N[t]))})),t.invoke=function(e,n){switch(n.type){case dr: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 hr:return e.def(a.props,n.data);case pr:return e.def(a.context,n.data);case vr:return e.def("this",n.data);case gr:return n.data.append(t,e),n.data.ref;case mr:return n.data.toString();case yr: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 k(t,e,u,c,d){var h=t.static,p=t.dynamic;R.optional((function(){var t=[qr,Yr,Kr,Zr,$r,Jr,Qr,to,Hr,eo].concat(x);function e(e){Object.keys(e).forEach((function(e){R.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[Kr]&&"string"==typeof n[Yr]){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)R("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(qr in n){var o=n[qr];return o?(o=s.getFramebuffer(o),R.command(o,"invalid framebuffer object"),pi((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,"."+oo,n+".width"),e.set(i,"."+io,n+".height"),n}))):pi((function(t,e){var n=t.shared;e.set(n.framebuffer,".next","null");var r=n.context;return e.set(r,"."+oo,r+"."+co),e.set(r,"."+io,r+"."+fo),"null"}))}if(qr in r){var i=r[qr];return vi(i,(function(t,e){var n=t.invoke(e,i),r=t.shared,o=r.framebuffer,a=e.def(o,".getFramebuffer(",n,")");R.optional((function(){t.assert(e,"!"+n+"||"+a,"invalid framebuffer object")})),e.set(o,".next",a);var u=r.context;return e.set(u,"."+oo,a+"?"+a+".width:"+u+"."+co),e.set(u,"."+io,a+"?"+a+".height:"+u+"."+fo),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];R.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,R.command(a>=0,"invalid "+t,n.commandStr)):s=!1,"height"in i?(u=0|i.height,R.command(u>=0,"invalid "+t,n.commandStr)):s=!1,new di(!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,".",oo,"-",c));var o=u;return"height"in i||(o=e.def(n,".",io,"-",f)),[c,f,r,o]}))}if(t in o){var l=o[t],d=vi(l,(function(e,n){var r=e.invoke(n,l);R.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,".",oo,"-",i,")"),s=n.def('"height" in ',r,"?",r,".height|0:","(",o,".",io,"-",a,")");return R.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 di(e.thisDep,e.contextDep,e.propDep,(function(t,e){var n=t.shared.context;return[0,0,e.def(n,".",oo),e.def(n,".",io)]})):null}var a=i(Xr);if(a){var u=a;a=new di(a.thisDep,a.contextDep,a.propDep,(function(t,e){var n=u.append(t,e),r=t.shared.context;return e.set(r,"."+ao,n[2]),e.set(r,"."+uo,n[3]),n}))}return{viewport:a,scissor_box:i(Wr)}}(t,b,d),E=function(t,e){var n=t.static,r=t.dynamic,o=function(){if(Zr in n){var t=n[Zr];fi(t)?t=a.getElements(a.create(t,!0)):t&&(t=a.getElements(t),R.command(t,"invalid elements",e.commandStr));var o=pi((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(Zr in r){var i=r[Zr];return vi(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 R.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 R.command(!i||a>=0,"invalid "+t,e.commandStr),pi((function(t,e){return i&&(t.OFFSET=a),a}))}if(t in r){var u=r[t];return vi(u,(function(e,n){var r=e.invoke(n,u);return i&&(e.OFFSET=r,R.optional((function(){e.assert(n,r+">=0","invalid "+t)}))),r}))}return i&&o?pi((function(t,e){return t.OFFSET="0",0})):null}var u=i(Jr,!0);return{elements:o,primitive:function(){if($r in n){var t=n[$r];return R.commandParameter(t,Ot,"invalid primitve",e.commandStr),pi((function(e,n){return Ot[t]}))}if($r in r){var i=r[$r];return vi(i,(function(t,e){var n=t.constants.primTypes,r=t.invoke(e,i);return R.optional((function(){t.assert(e,r+" in "+n,"invalid primitive, must be one of "+Object.keys(Ot))})),e.def(n,"[",r,"]")}))}return o?hi(o)?o.value?pi((function(t,e){return e.def(t.ELEMENTS,".primType")})):pi((function(){return Vo})):new di(o.thisDep,o.contextDep,o.propDep,(function(t,e){var n=t.ELEMENTS;return e.def(n,"?",n,".primType:",Vo)})):null}(),count:function(){if(Qr in n){var t=0|n[Qr];return R.command("number"==typeof t&&t>=0,"invalid vertex count",e.commandStr),pi((function(){return t}))}if(Qr in r){var i=r[Qr];return vi(i,(function(t,e){var n=t.invoke(e,i);return R.optional((function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">=0&&"+n+"===("+n+"|0)","invalid vertex count")})),n}))}if(o){if(hi(o)){if(o)return u?new di(u.thisDep,u.contextDep,u.propDep,(function(t,e){var n=e.def(t.ELEMENTS,".vertCount-",t.OFFSET);return R.optional((function(){t.assert(e,n+">=0","invalid vertex offset/element buffer too small")})),n})):pi((function(t,e){return e.def(t.ELEMENTS,".vertCount")}));var a=pi((function(){return-1}));return R.optional((function(){a.MISSING=!0})),a}var s=new di(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 R.optional((function(){s.DYNAMIC=!0})),s}return null}(),instances:i(to,!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]=pi((function(){return u}))}else if(t in r){var s=r[t];i[a]=vi(s,(function(t,e){return o(t,e,t.invoke(e,s))}))}}switch(t){case Nr:case wr:case br:case zr:case Sr:case Vr:case Rr:case Lr:case Pr:case Tr:return u((function(n){return R.commandType(n,"boolean",t,e.commandStr),n}),(function(e,n,r){return R.optional((function(){e.assert(n,"typeof "+r+'==="boolean"',"invalid flag "+t,e.commandStr)})),r}));case Ar:return u((function(n){return R.commandParameter(n,ai,"invalid "+t,e.commandStr),ai[n]}),(function(e,n,r){var o=e.constants.compareFuncs;return R.optional((function(){e.assert(n,r+" in "+o,"invalid "+t+", must be one of "+Object.keys(ai))})),n.def(o,"[",r,"]")}));case Ir:return u((function(t){return R.command(Xt(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 R.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 _r:return u((function(t){R.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 R.commandParameter(n,oi,a+".srcRGB",e.commandStr),R.commandParameter(r,oi,a+".srcAlpha",e.commandStr),R.commandParameter(o,oi,a+".dstRGB",e.commandStr),R.commandParameter(i,oi,a+".dstAlpha",e.commandStr),R.command(-1===ii.indexOf(n+", "+o),"unallowed blending combination (srcRGB, dstRGB) = ("+n+", "+o+")",e.commandStr),[oi[n],oi[o],oi[r],oi[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 R.optional((function(){e.assert(n,u+" in "+o,"invalid "+t+"."+i+a+", must be one of "+Object.keys(oi))})),u}R.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");R.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 xr:return u((function(n){return"string"==typeof n?(R.commandParameter(n,m,"invalid "+t,e.commandStr),[m[n],m[n]]):"object"==typeof n?(R.commandParameter(n.rgb,m,t+".rgb",e.commandStr),R.commandParameter(n.alpha,m,t+".alpha",e.commandStr),[m[n.rgb],m[n.alpha]]):void R.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 R.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 Er:return u((function(t){return R.command(Xt(t)&&4===t.length,"blend.color must be a 4d array",e.commandStr),Y(4,(function(e){return+t[e]}))}),(function(t,e,n){return R.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","blend.color must be a 4d array")})),Y(4,(function(t){return e.def("+",n,"[",t,"]")}))}));case Fr:return u((function(t){return R.commandType(t,"number",a,e.commandStr),0|t}),(function(t,e,n){return R.optional((function(){t.assert(e,"typeof "+n+'==="number"',"invalid stencil.mask")})),e.def(n,"|0")}));case Gr:return u((function(n){R.commandType(n,"object",a,e.commandStr);var r=n.cmp||"keep",o=n.ref||0,i="mask"in n?n.mask:-1;return R.commandParameter(r,ai,t+".cmp",e.commandStr),R.commandType(o,"number",t+".ref",e.commandStr),R.commandType(i,"number",t+".mask",e.commandStr),[ai[r],o,i]}),(function(t,e,n){var r=t.constants.compareFuncs;return R.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]",":",$o),e.def(n,".ref|0"),e.def('"mask" in ',n,"?",n,".mask|0:-1")]}));case Ur:case Br:return u((function(n){R.commandType(n,"object",a,e.commandStr);var r=n.fail||"keep",o=n.zfail||"keep",i=n.zpass||"keep";return R.commandParameter(r,ui,t+".fail",e.commandStr),R.commandParameter(o,ui,t+".zfail",e.commandStr),R.commandParameter(i,ui,t+".zpass",e.commandStr),[t===Br?Xo:Wo,ui[r],ui[o],ui[i]]}),(function(e,n,r){var o=e.constants.stencilOps;function i(i){return R.optional((function(){e.assert(n,'!("'+i+'" in '+r+")||("+r+"."+i+" in "+o+")","invalid "+t+"."+i+", must be one of "+Object.keys(ui))})),n.def('"',i,'" in ',r,"?",o,"[",r,".",i,"]:",$o)}return R.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)})),[t===Br?Xo:Wo,i("fail"),i("zfail"),i("zpass")]}));case Cr:return u((function(t){R.commandType(t,"object",a,e.commandStr);var n=0|t.factor,r=0|t.units;return R.commandType(n,"number",a+".factor",e.commandStr),R.commandType(r,"number",a+".units",e.commandStr),[n,r]}),(function(e,n,r){return R.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=Wo:"back"===t&&(n=Xo),R.command(!!n,a,e.commandStr),n}),(function(t,e,n){return R.optional((function(){t.assert(e,n+'==="front"||'+n+'==="back"',"invalid cull.face")})),e.def(n,'==="front"?',Wo,":",Xo)}));case kr:return u((function(t){return R.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 R.optional((function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">="+o.lineWidthDims[0]+"&&"+n+"<="+o.lineWidthDims[1],"invalid line width")})),n}));case Mr:return u((function(t){return R.commandParameter(t,ci,a,e.commandStr),ci[t]}),(function(t,e,n){return R.optional((function(){t.assert(e,n+'==="cw"||'+n+'==="ccw"',"invalid frontFace, must be one of cw,ccw")})),e.def(n+'==="cw"?'+Ho+":"+qo)}));case Or:return u((function(t){return R.command(Xt(t)&&4===t.length,"color.mask must be length 4 array",e.commandStr),t.map((function(t){return!!t}))}),(function(t,e,n){return R.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","invalid color.mask")})),Y(4,(function(t){return"!!"+n+"["+t+"]"}))}));case jr:return u((function(t){R.command("object"==typeof t&&t,a,e.commandStr);var n="value"in t?t.value:1,r=!!t.invert;return R.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 R.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]);R.optional((function(){l.shader(si[t],e,R.guessCommand())}));var r=pi((function(){return e}));return r.id=e,r}if(t in i){var a=i[t];return vi(a,(function(e,n){var r=e.invoke(n,a),o=n.def(e.shared.strings,".id(",r,")");return R.optional((function(){n(e.shared.shader,".shader(",si[t],",",o,",",e.command,");")})),o}))}return null}var u,s=a(Kr),c=a(Yr),f=null;return hi(s)&&hi(c)?(f=l.program(c.id,s.id,null,r),u=pi((function(t,e){return t.link(f)}))):u=new di(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,".",Kr);var o=r+".program("+(c?c.append(t,e):e.def(r,".",Yr))+","+n;return R.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(Xr),I(A(Wr));var T=Object.keys(_).length>0,O={framebuffer:b,draw:E,shader:S,state:_,dirty:T,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(O.profile=function(t){var e,n=t.static,r=t.dynamic;if(Hr in n){var o=!!n[Hr];(e=pi((function(t,e){return o}))).enable=o}else if(Hr in r){var i=r[Hr];e=vi(i,(function(t,e){return t.invoke(e,i)}))}return e}(t),O.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=pi((function(){return i}));else if("function"==typeof i){var a=i._reglType;"texture2d"===a||"textureCube"===a?r=pi((function(t){return t.link(i)})):"framebuffer"===a||"framebufferCube"===a?(R.command(i.color.length>0,'missing color attachment for framebuffer sent to uniform "'+t+'"',e.commandStr),r=pi((function(t){return t.link(i.color[0])}))):R.commandRaise('invalid data for uniform "'+t+'"',e.commandStr)}else Xt(i)?r=pi((function(e){return e.global.def("[",Y(i.length,(function(n){return R.command("number"==typeof i[n]||"boolean"==typeof i[n],"invalid uniform "+t,e.commandStr),i[n]})),"]")})):R.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]=vi(e,(function(t,n){return t.invoke(n,e)}))})),o}(u,d),O.drawVAO=O.scopeVAO=function(t,e){var n=t.static,r=t.dynamic;if(eo in n){var o=n[eo];return null!==o&&null===f.getVAO(o)&&(o=f.createVAO(o)),pi((function(t){return t.link(f.getVAO(o))}))}if(eo in r){var i=r[eo];return vi(i,(function(t,e){var n=t.invoke(e,i);return e.def(t.shared.vao+".getVAO("+n+")")}))}return null}(t),!O.drawVAO&&S.program&&!v&&r.angle_instanced_arrays){var N=!0,D=S.program.attributes.map((function(t){var n=e.static[t];return N=N&&!!n,n}));if(N&&D.length>0){var M=f.getVAO(f.createVAO(D));O.drawVAO=new di(null,null,null,(function(t,e){return t.link(M)})),O.useVAO=!0}}return v?O.useVAO=!0:O.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(fi(o))s.state=fr,s.buffer=i.getBuffer(i.create(o,ho,!1,!0)),s.type=0;else{var c=i.getBuffer(o);if(c)s.state=fr,s.buffer=c,s.type=0;else if(R.command("object"==typeof o&&o,"invalid data for attribute "+t,e.commandStr),"constant"in o){var f=o.constant;s.buffer="null",s.state=lr,"number"==typeof f?s.x=f:(R.command(Xt(f)&&f.length>0&&f.length<=4,"invalid constant for attribute "+t,e.commandStr),sr.forEach((function(t,e){e<f.length&&(s[t]=f[e])})))}else{c=fi(o.buffer)?i.getBuffer(i.create(o.buffer,ho,!1,!0)):i.getBuffer(o.buffer),R.command(!!c,'missing buffer for attribute "'+t+'"',e.commandStr);var l=0|o.offset;R.command(l>=0,'invalid offset for attribute "'+t+'"',e.commandStr);var d=0|o.stride;R.command(d>=0&&d<256,'invalid stride for attribute "'+t+'", must be integer betweeen [0, 255]',e.commandStr);var h=0|o.size;R.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&&(R.commandParameter(o.type,gt,"invalid type for attribute "+t,e.commandStr),v=gt[o.type]);var m=0|o.divisor;"divisor"in o&&(R.command(0===m||y,'cannot specify divisor for attribute "'+t+'", instancing not supported',e.commandStr),R.command(m>=0,'invalid divisor for attribute "'+t+'"',e.commandStr)),R.optional((function(){var n=e.commandStr,r=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(o).forEach((function(e){R.command(r.indexOf(e)>=0,'unknown parameter "'+e+'" for attribute pointer "'+t+'" (valid parameters are '+r+")",n)}))})),s.buffer=c,s.state=fr,s.size=h,s.normalized=p,s.type=v||c.dtype,s.offset=l,s.stride=d,s.divisor=m}}a[t]=pi((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]=vi(e,(function(n,r){var o=n.invoke(r,e),i=n.shared,a=n.constants,u=i.isBufferArgs,s=i.buffer;R.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=fr,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(",ho,",",o,");",d,"=",l,".dtype;","}else{",l,"=",s,".getBuffer(",o,");","if(",l,"){",d,"=",l,".dtype;",'}else if("constant" in ',o,"){",c.state,"=",lr,";","if(typeof "+o+'.constant === "number"){',c[sr[0]],"=",o,".constant;",sr.slice(1).map((function(t){return c[t]})).join("="),"=0;","}else{",sr.map((function(t,e){return c[t]+"="+o+".constant.length>"+e+"?"+o+".constant["+e+"]:0;"})).join(""),"}}else{","if(",u,"(",o,".buffer)){",l,"=",s,".createStream(",ho,",",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),O.context=function(t){var e=t.static,n=t.dynamic,r={};return Object.keys(e).forEach((function(t){var n=e[t];r[t]=pi((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]=vi(e,(function(t,n){return t.invoke(n,e)}))})),r}(c),O}function C(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 L(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(",ni,",",s,".framebuffer);"),b&&e(o,".drawBuffersWEBGL(",f,"[",s,".colorAttachments.length]);"),e("}else{",a,".bindFramebuffer(",ni,",null);"),b&&e(o,".drawBuffersWEBGL(",l,");"),e("}",u,".cur=",s,";"),r||e("}")}function P(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=Y(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 j(t,e,n,r){var o=t.shared,i=t.current,a=o.current,u=o.gl;li(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];hi(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(Xt(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 z(t,e){y&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function F(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(hi(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 G(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(gi))return;var c=t.scopeAttrib(u);R.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(",ho,",",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(",sr.map((function(t,e){return s+"."+t+"!=="+l[e]})).join("||"),"){",a,".vertexAttrib4f(",u,",",l,");",sr.map((function(t,e){return s+"."+t+"="+l[e]+";"})).join(""),"}")}c===fr?h():c===lr?p():(e("if(",c,"===",fr,"){"),h(),e("}else{"),p(),e("}"))}(t.link(r),function(t){switch(t){case To:case Mo:case Lo:return 2;case Oo:case ko:case Po:return 3;case No:case Ro:case jo:return 4;default:return 1}}(r.info.type),a)}))}function U(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(hi(p)){var g=p.value;if(R.command(null!=g,'missing uniform "'+d+'"',t.commandStr),h===Uo||h===Bo){R.command("function"==typeof g&&(h===Uo&&("texture2d"===g._reglType||"framebuffer"===g._reglType)||h===Bo&&("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===zo||h===Fo||h===Go){R.optional((function(){R.command(Xt(g),"invalid matrix for uniform "+d,t.commandStr),R.command(h===zo&&4===g.length||h===Fo&&9===g.length||h===Go&&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===Fo?b=3:h===Go&&(b=4),e(s,".uniformMatrix",b,"fv(",v,",false,",y,");")}else{switch(h){case Io:R.commandType(g,"number","uniform "+d,t.commandStr),a="1f";break;case To:R.command(Xt(g)&&2===g.length,"uniform "+d,t.commandStr),a="2f";break;case Oo:R.command(Xt(g)&&3===g.length,"uniform "+d,t.commandStr),a="3f";break;case No:R.command(Xt(g)&&4===g.length,"uniform "+d,t.commandStr),a="4f";break;case Co:R.commandType(g,"boolean","uniform "+d,t.commandStr),a="1i";break;case Do:R.commandType(g,"number","uniform "+d,t.commandStr),a="1i";break;case Lo:case Mo:R.command(Xt(g)&&2===g.length,"uniform "+d,t.commandStr),a="2i";break;case Po:case ko:R.command(Xt(g)&&3===g.length,"uniform "+d,t.commandStr),a="3i";break;case jo:case Ro:R.command(Xt(g)&&4===g.length,"uniform "+d,t.commandStr),a="4i"}e(s,".uniform",a,"(",v,",",Xt(g)?Array.prototype.slice.call(g):g,");")}continue}f=p.append(t,e)}else{if(!i(gi))continue;f=e.def(u.uniforms,"[",n.id(d),"]")}h===Uo?(R(!Array.isArray(f),"must specify a scalar prop for textures"),e("if(",f,"&&",f,'._reglType==="framebuffer"){',f,"=",f,".color[0];","}")):h===Bo&&(R(!Array.isArray(f),"must specify a scalar prop for cube maps"),e("if(",f,"&&",f,'._reglType==="framebufferCube"){',f,"=",f,".color[0];","}")),R.optional((function(){function n(n,r){t.assert(e,n,'bad data or missing for uniform "'+d+'". '+r)}function r(t){R(!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)?R(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){R(!Array.isArray(f),"must not specify a value type"),n("typeof "+f+'==="function"&&'+f+'._reglType==="texture'+(e===vo?"2d":"Cube")+'"',"invalid texture type",t.commandStr)}switch(h){case Do:r("number");break;case Mo:o(2);break;case ko:o(3);break;case Ro:o(4);break;case Io:r("number");break;case To:o(2);break;case Oo:o(3);break;case No:o(4);break;case Co:r("boolean");break;case Lo:o(2);break;case Po:o(3);break;case jo:case zo:o(4);break;case Fo:o(9);break;case Go:o(16);break;case Uo:i(vo);break;case Bo:i(go)}}));var w=1;switch(h){case Uo:case Bo:var E=e.def(f,"._texture");e(s,".uniform1i(",v,",",E,".bind());"),e.exit(E,".unbind();");continue;case Do:case Co:a="1i";break;case Mo:case Lo:a="2i",w=2;break;case ko:case Po:a="3i",w=3;break;case Ro:case jo:a="4i",w=4;break;case Io:a="1f";break;case To:a="2f",w=2;break;case Oo:a="3f",w=3;break;case No:a="4f",w=4;break;case zo:a="Matrix2fv";break;case Fo:a="Matrix3fv";break;case Go:a="Matrix4fv"}if(e(s,".uniform",a,"(",v,","),"M"===a.charAt(0)){var x=Math.pow(h-zo+2,2),_=t.global.def("new Float32Array(",x,")");Array.isArray(f)?e("false,(",Y(x,(function(t){return _+"["+t+"]="+f[t]})),",",_,")"):e("false,(Array.isArray(",f,")||",f," instanceof Float32Array)?",f,":(",Y(x,(function(t){return _+"["+t+"]="+f+"["+t+"]"})),",",_,")")}else w>1?e(Y(w,(function(t){return Array.isArray(f)?f[t]:f+"["+t+"]"}))):(R(!Array.isArray(f),"uniform value must not be an array"),e(f));e(");")}}function V(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,".",Zr),o&&c("if("+o+")"+i+".bindBuffer("+po+","+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($r),h=c(Jr),p=function(){var o,i=u.count,s=e;return i?((i.contextDep&&r.contextDynamic||i.propDep)&&(s=n),o=i.append(t,s),R.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,".",Qr),R.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(to),l=t.instancing);var v=s+".type",g=u.elements&&hi(u.elements);function m(){function t(){n(l,".drawElementsInstancedANGLE(",[d,p,v,h+"<<(("+v+"-"+cr+")>>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+"-"+cr+")>>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 W(t,e,n,r,o){var i=M(),a=i.proc("body",o);return R.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 X(t,e,n,r){z(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);"),G(t,e,n,r.attributes,(function(){return!0}))),U(t,e,n,r.uniforms,(function(){return!0})),V(t,e,e,n)}function H(t,e,n,r){function o(){return!0}t.batchId="a1",z(t,e),G(t,e,n,r.attributes,o),U(t,e,n,r.uniforms,o),V(t,e,e,n)}function q(t,e,n,r){z(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&&C(t,s,n.context),n.needsFramebuffer&&L(t,s,n.framebuffer),j(t,s,n.state,c),n.profile&&c(n.profile)&&F(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);"),G(t,u,n,r.attributes,f),G(t,s,n,r.attributes,c)),U(t,u,n,r.uniforms,f),U(t,s,n,r.uniforms,c),V(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 W(H,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&&!Xt(t)){for(var e=Object.keys(t),n=0;n<e.length;++n)if(B.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(B.isDynamic(n)){"function"==typeof n&&(n=r[e]=B.unbox(n));var i=vi(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 B.DynamicVariable(gr,{thisDep:a,contextDep:u,propDep:s,ref:c,append:function(t,e){i.forEach((function(n){var o=r[n];if(B.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=M(),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;"),L(t,e),L(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(",ho,",",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,"("),Xt(l)){var h=l.length;o=t.global.def(c,".",r),a=t.global.def(f,".",r),d(Y(h,(function(t){return o+"["+t+"]"})),");",Y(h,(function(t){return a+"["+t+"]="+o+"["+t+"];"})).join("")),e("if(",Y(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=M();u.stats=u.link(a),Object.keys(r.static).forEach((function(t){K(u,r,t)})),lo.forEach((function(e){K(u,t,e)}));var s=k(t,r,o,i,u);return function(t,e){var n=t.proc("draw",1);z(t,n),C(t,n,e.context),L(t,n,e.framebuffer),P(t,n,e),j(t,n,e.state),F(t,n,e,!1,!0);var r=e.shader.progVar.append(t,n);if(n(t.shared.gl,".useProgram(",r,".program);"),e.shader.program)X(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 W(X,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))}C(t,r,e.context),e.framebuffer&&e.framebuffer.append(t,r),li(Object.keys(e.state)).forEach((function(n){var i=e.state[n].append(t,r);Xt(i)?i.forEach((function(e,o){r.set(t.next[n],"["+o+"]",e)})):r.set(o.next,"."+n,i)})),F(t,r,e,!0,!0),[Zr,Jr,Qr,to,$r].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(Yr),a(Kr),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",z(t,n);var r=!1,o=!0;Object.keys(e.context).forEach((function(t){r=r||e.context[t].propDep})),r||(C(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||L(t,n,i)):L(t,n,null),e.state.viewport&&e.state.viewport.propDep&&(r=!0),P(t,n,e),j(t,n,e.state,(function(t){return!u(t)})),e.profile&&u(e.profile)||F(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)q(t,n,e,null);else{var c=s.append(t,n);if(n(t.shared.gl,".useProgram(",c,".program);"),e.shader.program)q(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 W(q,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 yi=34918,bi=34919,wi=35007,Ei=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(wi,r),o.push(r),c(o.length-1,o.length,t)},endQuery:function(){e.ext_disjoint_timer_query.endQueryEXT(wi)},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,bi)?(a+=e.ext_disjoint_timer_query.getQueryObjectEXT(c,yi),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}}},xi=16384,_i=256,Si=1024,Ai=34962,Ii="webglcontextlost",Ti="webglcontextrestored",Oi=1,Ni=2,Di=3;function Mi(t,e){for(var n=0;n<t.length;++n)if(t[n]===e)return n;return-1}return function(n){var r=q(n);if(!r)return null;var o=r.gl,i=o.getContextAttributes(),a=o.isContextLost(),u=function(t,e){var n={};function r(e){R.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=Ei(o,d),p=W(),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=ct(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=wt,this.byteLength=0,this.dimension=1,this.dtype=xt,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||_t,n.length>0)if(Array.isArray(n[0])){u=bt(n);for(var f=1,l=1;l<u.length;++l)f*=u[l];e.dimension=f,c(e,s=yt(n,u,e.dtype),r),a?e.persistentData=s:ot.freeType(s)}else if("number"==typeof n[0]){e.dimension=i;var d=ot.allocType(e.dtype,n.length);It(d,n),c(e,d,r),a?e.persistentData=d:ot.freeType(d)}else t(n[0])?(e.dimension=n[0].length,e.dtype=o||At(n[0])||_t,c(e,s=yt(n,[n.length,n[0].length],e.dtype),r),a?e.persistentData=s:ot.freeType(s)):R.raise("invalid buffer data")}else if(t(n))e.dtype=o||At(n),e.dimension=i,c(e,n,r),a&&(e.persistentData=new Uint8Array(new Uint8Array(n.buffer)));else if(ft(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]):R.raise("invalid shape"),e.dtype=o||At(n.data)||_t,e.dimension=g;var b=ot.allocType(e.dtype,v*g);Tt(b,n.data,v,g,m,y,p),c(e,b,r),a?e.persistentData=b:ot.freeType(b)}else n instanceof ArrayBuffer?(e.dtype=xt,e.dimension=i,c(e,n,r),a&&(e.persistentData=new Uint8Array(new Uint8Array(n)))):R.raise("invalid buffer data")}function l(t){n.bufferCount--,o(t);var r=t.buffer;R(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=wt,i=null,a=0,u=0,s=1;return Array.isArray(n)||t(n)||ft(n)||n instanceof ArrayBuffer?i=n:"number"==typeof n?a=0|n:n&&(R.type(n,"object","buffer arguments must be an object, a number or an array"),"data"in n&&(R(null===i||Array.isArray(i)||t(i)||ft(i),"invalid data for buffer"),i=n.data),"usage"in n&&(R.parameter(n.usage,mt,"invalid buffer usage"),o=mt[n.usage]),"type"in n&&(R.parameter(n.type,gt,"invalid buffer type"),u=gt[n.type]),"dimension"in n&&(R.type(n.dimension,"number","invalid dimension"),s=0|n.dimension),"length"in n&&(R.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||xt,d.usage=o,d.dimension=s,d.byteLength=a),r.profile&&(d.stats.size=d.byteLength*St[d.dtype]),h}function p(t,n){R(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=ot.allocType(d.dtype,e.length);It(i,e),p(i,o),ot.freeType(i)}else if(Array.isArray(e[0])||t(e[0])){r=bt(e);var a=yt(e,r,d.dtype);p(a,o),ot.freeType(a)}else R.raise("invalid buffer data")}else if(ft(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]):R.raise("invalid shape");var v=Array.isArray(e.data)?d.dtype:At(e.data),g=ot.allocType(v,s*c);Tt(g,e.data,s,c,f,l,e.offset),p(g,o),ot.freeType(g)}else R.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,Et,0,1,!1),n},destroyStream:function(t){s.push(t)},clear:function(){lt(a).forEach(l),s.forEach(l)},getBuffer:function(t){return t&&t._buffer instanceof u?t._buffer:null},restore:function(){lt(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 Zn;var c=0,f={},l={Record:Zn,scope:{},state:u,currentVAO:null,targetVAO:null,restore:d()?function(){d()&&lt(f).forEach((function(t){t.refresh()}))}:function(){},createVAO:function(e){var r=new p;function u(e){R(Array.isArray(e),"arguments to vertex array constructor must be an array"),R(e.length<a,"too many attributes"),R(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 Zn,h=l.data||l;Array.isArray(h)||t(h)||ft(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,Kn,!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?(R.parameter(l.type,gt,"invalid buffer type"),d.type=gt[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,R(d.size>=1&&d.size<=4,"size must be between 1 and 4"),R(d.offset>=0,"invalid offset"),R(d.stride>=0&&d.stride<=255,"stride must be between 0 and 255"),R(d.divisor>=0,"divisor must be positive"),R(!d.divisor||!!n.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in l?(R(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):R(!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(){lt(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(Kn,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:Rt,uint16:Lt};function s(t){this.id=a++,i[this.id]=this,this.buffer=t,this.primType=Mt,this.vertCount=0,this.type=0}n.oes_element_index_uint&&(u.uint32=jt),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)&&(!ft(i)||t(i.data))||(d=n.oes_element_index_uint?jt:Lt),r._initBuffer(o.buffer,i,a,d,3)}else e.bufferData(zt,c,a),o.buffer.dtype=l||Rt,o.buffer.usage=a,o.buffer.dimension=3,o.buffer.byteLength=c;if(l=f,!f){switch(o.buffer.dtype){case Rt:case kt:l=Rt;break;case Lt:case Ct:l=Lt;break;case jt:case Pt:l=jt;break;default:R.raise("unsupported type for element array")}o.buffer.dtype=l}o.type=l,R(l!==jt||!!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===Lt?h>>=1:l===jt&&(h>>=2)),o.vertCount=h;var p=u;if(u<0){p=Mt;var v=o.buffer.dimension;1===v&&(p=Nt),2===v&&(p=Dt),3===v&&(p=Mt)}o.primType=p}function l(t){o.elementsCount--,R(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,zt,!0),a=new s(i._buffer);function c(e){if(e)if("number"==typeof e)i(e),a.primType=Mt,a.vertCount=0|e,a.type=Rt;else{var n=null,r=Gt,o=-1,s=-1,l=0,d=0;Array.isArray(e)||t(e)||ft(e)?n=e:(R.type(e,"object","invalid arguments for elements"),"data"in e&&(n=e.data,R(Array.isArray(n)||t(n)||ft(n),"invalid data for element buffer")),"usage"in e&&(R.parameter(e.usage,mt,"invalid element buffer usage"),r=mt[e.usage]),"primitive"in e&&(R.parameter(e.primitive,Ot,"invalid element buffer primitive"),o=Ot[e.primitive]),"count"in e&&(R("number"==typeof e.count&&e.count>=0,"invalid vertex count for elements"),s=0|e.count),"type"in e&&(R.parameter(e.type,u,"invalid buffer type"),d=u[e.type]),"length"in e?l=0|e.length:(l=s,d===Lt||d===Ct?l*=2:d!==jt&&d!==Pt||(l*=4))),f(a,n,r,o,s,l,d)}else i(),a.primType=Mt,a.vertCount=0,a.type=Rt;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,zt,!0,!1)._buffer)),f(e,t,Ft,-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(){lt(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===$n?i:a,s=u[r];if(!s){var c=n.str(r);s=t.createShader(e),t.shaderSource(s,c),t.compileShader(s),R.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($n,e.fragId),d=c(Qn,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),R.linkError(t,h,n.str(e.fragId),n.str(e.vertId),r);var v=t.getProgramParameter(h,Jn);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,tr);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);lt(i).forEach(e),i={},lt(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){R.command(n>=0,"missing vertex shader",u),R.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),_=Sn(o,d,y,(function(){I.procs.poll()}),m,l,r),S=Nn(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);R(o===e&&i===n,"inconsistent width/height for supplied texture"),r.refCount+=1}else{var a=t.renderbuffer._renderbuffer;R(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,Mn,n.renderbuffer._renderbuffer.renderbuffer))}function v(t){var e=kn,n=null,r=null,o=t;"object"==typeof t&&(o=t.data,"target"in t&&(e=0|t.target)),R.type(o,"function","invalid attachment data");var i=o._reglType;return"texture2d"===i?(n=o,R(e===kn)):"textureCube"===i?(n=o,R(e>=Rn&&e<Rn+6,"invalid cube map target")):"renderbuffer"===i?(r=o,e=Mn):R.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(kn,u,null)}var s=i.create({width:t,height:e,format:r});return s._renderbuffer.refCount=0,new l(Mn,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;R(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(Cn+n,o[n]);for(n=o.length;n<r.maxColorAttachments;++n)t.framebufferTexture2D(Dn,Cn+n,kn,null,0);t.framebufferTexture2D(Dn,jn,kn,null,0),t.framebufferTexture2D(Dn,Ln,kn,null,0),t.framebufferTexture2D(Dn,Pn,kn,null,0),p(Ln,e.depthAttachment),p(Pn,e.stencilAttachment),p(jn,e.depthStencilAttachment);var i=t.checkFramebufferStatus(Dn);t.isContextLost()||i===zn||R.raise("framebuffer configuration not supported, status = "+qn[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;R(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,T=null,O=null,N=!1;if("number"==typeof t)a=0|t,d=0|e||a;else if(t){R.type(t,"object","invalid arguments for framebuffer");var D=t;if("shape"in D){var M=D.shape;R(Array.isArray(M)&&M.length>=2,"invalid shape for framebuffer"),a=M[0],d=M[1]}else"radius"in D&&(a=d=D.radius),"width"in D&&(a=D.width),"height"in D&&(d=D.height);("color"in D||"colors"in D)&&(b=D.color||D.colors,Array.isArray(b)&&R(1===b.length||n.webgl_draw_buffers,"multiple render targets not supported")),b||("colorCount"in D&&(A=0|D.colorCount,R(A>0,"invalid color buffer count")),"colorTexture"in D&&(w=!!D.colorTexture,E="rgba4"),"colorType"in D&&(_=D.colorType,w?(R(n.oes_texture_float||!("float"===_||"float32"===_),"you must enable OES_texture_float in order to use floating point framebuffer objects"),R(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"===_?(R(n.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),E="rgba16f"):"float"!==_&&"float32"!==_||(R(n.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),E="rgba32f"),R.oneOf(_,f,"invalid color type")),"colorFormat"in D&&(E=D.colorFormat,s.indexOf(E)>=0?w=!0:c.indexOf(E)>=0?w=!1:w?R.oneOf(D.colorFormat,s,"invalid color format for texture"):R.oneOf(D.colorFormat,c,"invalid color format for renderbuffer"))),("depthTexture"in D||"depthStencilTexture"in D)&&(N=!(!D.depthTexture&&!D.depthStencilTexture),R(!N||n.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in D&&("boolean"==typeof D.depth?p=D.depth:(I=D.depth,y=!1)),"stencil"in D&&("boolean"==typeof D.stencil?y=D.stencil:(T=D.stencil,p=!1)),"depthStencil"in D&&("boolean"==typeof D.depthStencil?p=y=D.depthStencil:(O=D.depthStencil,p=!1,y=!1))}else a=d=1;var k=null,C=null,L=null,P=null;if(Array.isArray(b))k=b.map(v);else if(b)k=[v(b)];else for(k=new Array(A),o=0;o<A;++o)k[o]=g(a,d,w,E,_);R(n.webgl_draw_buffers||k.length<=1,"you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers."),R(k.length<=r.maxColorAttachments,"too many color attachments, not supported"),a=a||k[0].width,d=d||k[0].height,I?C=v(I):p&&!y&&(C=g(a,d,N,"depth","uint32")),T?L=v(T):y&&!p&&(L=g(a,d,!1,"stencil","uint8")),O?P=v(O):!I&&!T&&y&&p&&(P=g(a,d,N,"depth stencil","depth stencil")),R(!!I+!!T+!!O<=1,"invalid framebuffer configuration, can specify exactly one depth/stencil attachment");var j=null;for(o=0;o<k.length;++o)if(h(k[o],a,d),R(!k[o]||k[o].texture&&Gn.indexOf(k[o].texture._texture.format)>=0||k[o].renderbuffer&&Hn.indexOf(k[o].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+o+" is invalid"),k[o]&&k[o].texture){var z=Un[k[o].texture._texture.format]*Bn[k[o].texture._texture.type];null===j?j=z:R(j===z,"all color attachments much have the same number of bits per pixel.")}return h(C,a,d),R(!C||C.texture&&C.texture._texture.format===Fn||C.renderbuffer&&C.renderbuffer._renderbuffer.format===Vn,"invalid depth attachment for framebuffer object"),h(L,a,d),R(!L||L.renderbuffer&&L.renderbuffer._renderbuffer.format===Wn,"invalid stencil attachment for framebuffer object"),h(P,a,d),R(!P||P.texture&&P.texture._texture.format===Xn||P.renderbuffer&&P.renderbuffer._renderbuffer.format===Xn,"invalid depth-stencil attachment for framebuffer object"),x(i),i.width=a,i.height=d,i.colorAttachments=k,i.depthAttachment=C,i.stencilAttachment=L,i.depthStencilAttachment=P,l.color=k.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){R(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;R(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){R.type(t,"object","invalid arguments for framebuffer");var m=t;if("shape"in m){var y=m.shape;R(Array.isArray(y)&&y.length>=2,"invalid shape for framebuffer"),R(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&&R(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)&&R(1===h.length||n.webgl_draw_buffers,"multiple render targets not supported")),h||("colorCount"in m&&(g=0|m.colorCount,R(g>0,"invalid color buffer count")),"colorType"in m&&(R.oneOf(m.colorType,f,"invalid color type"),v=m.colorType),"colorFormat"in m&&(p=m.colorFormat,R.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];R("function"==typeof w&&"textureCube"===w._reglType,"invalid cube map"),d=d||w.width,R(w.width===d&&w.height===d,"invalid cube map shape"),l.color[r]={target:Rn,data:c[r]}}for(r=0;r<6;++r){for(var E=0;E<c.length;++E)l.color[E].target=Rn+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(R(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(){lt(w).forEach(_)},restore:function(){u.cur=null,u.next=null,u.dirty=!0,lt(w).forEach((function(e){e.framebuffer=t.createFramebuffer(),S(e)}))}})}(o,d,y,_,S,l),I=mi(o,f,d,y,b,E,0,A,{},w,x,{elements:null,primitive:4,count:-1,offset:0,instances:-1},m,h,r),T=ir(o,A,I.procs.poll,m,i,d,y),O=I.next,N=o.canvas,D=[],M=[],k=[],C=[r.onDestroy],L=null;function P(){if(0===D.length)return h&&h.update(),void(L=null);L=V.next(P),Z();for(var t=D.length-1;t>=0;--t){var e=D[t];e&&e(m,null,0)}o.flush(),h&&h.update()}function j(){!L&&D.length>0&&(L=V.next(P))}function z(){L&&(V.cancel(P),L=null)}function F(t){t.preventDefault(),a=!0,z(),M.forEach((function(t){t()}))}function G(t){o.getError(),a=!1,u.restore(),x.restore(),b.restore(),_.restore(),S.restore(),A.restore(),w.restore(),h&&h.restore(),I.procs.refresh(),j(),k.forEach((function(t){t()}))}function U(t){function n(t,e){var n={},r={};return Object.keys(t).forEach((function(o){var i=t[o];if(B.isDynamic(i))r[o]=B.unbox(i,o);else{if(e&&Array.isArray(i))for(var a=0;a<i.length;++a)if(B.isDynamic(i[a]))return void(r[o]=B.unbox(i,o));n[o]=i}})),{dynamic:r,static:n}}R(!!t,"invalid args to regl({...})"),R.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&&R.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()}})}N&&(N.addEventListener(Ii,F,!1),N.addEventListener(Ti,G,!1));var X=A.setFBO=U({framebuffer:B.define.call(null,Oi,"framebuffer")});function H(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|=xi),"depth"in e&&(o.clearDepth(+e.depth),n|=_i),"stencil"in e&&(o.clearStencil(0|e.stencil),n|=Si),R(!!n,"called regl.clear with no buffer specified"),o.clear(n)}function Y(t){return R.type(t,"function","regl.frame() callback must be a function"),D.push(t),j(),{cancel:function(){var e=Mi(D,t);R(e>=0,"cannot cancel a frame twice"),D[e]=function t(){var e=Mi(D,t);D[e]=D[D.length-1],D.length-=1,D.length<=0&&z()}}}}function K(){var t=O.viewport,e=O.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 Z(){m.tick+=1,m.time=Q(),K(),I.procs.poll()}function $(){_.refresh(),K(),I.procs.refresh(),h&&h.update()}function Q(){return(W()-p)/1e3}$();var J=e(U,{clear:function(t){if(R("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)X(e({framebuffer:t.framebuffer.faces[n]},t),H);else X(t,H);else H(0,t)},prop:B.define.bind(null,Oi),context:B.define.bind(null,Ni),this:B.define.bind(null,Di),draw:U({}),buffer:function(t){return b.create(t,Ai,!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:Y,on:function(t,e){var n;switch(R.type(e,"function","listener callback must be a function"),t){case"frame":return Y(e);case"lost":n=M;break;case"restore":n=k;break;case"destroy":n=C;break;default:R.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:T,destroy:function(){D.length=0,z(),N&&(N.removeEventListener(Ii,F),N.removeEventListener(Ti,G)),x.clear(),A.clear(),S.clear(),_.clear(),E.clear(),b.clear(),w.clear(),h&&h.clear(),C.forEach((function(t){t()}))},_gl:o,_refresh:$,poll:function(){Z(),h&&h.update()},now:Q,stats:l});return r.onDone(null,J),J}}()},7061:(t,e,n)=>{var r=n(8698).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},8698: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},4687:(t,e,n)=>{var r=n(7061)();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(1983);var t,e=(t=n(115))&&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:()=>Od,ComboForceLayout:()=>Ad,ConcentricLayout:()=>zf,DagreCompoundLayout:()=>uf,DagreLayout:()=>cr,ERLayout:()=>ah,Force2Layout:()=>K,ForceAtlas2Layout:()=>Cd,ForceLayout:()=>Vt,FruchtermanGPULayout:()=>bd,FruchtermanLayout:()=>Bf,GForceGPULayout:()=>_d,GForceLayout:()=>L,GridLayout:()=>D,Layout:()=>uh,Layouts:()=>sh,MDSLayout:()=>Gf,RadialLayout:()=>Pf,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=t.call(this)||this,o=r,i={},a=o.getDefaultCfg();return Object.assign(i,a,n,e),Object.keys(i).forEach((function(t){var e=i[t];o[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(){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,n){i(e.x)||(e.x=Math.random()*t.width),i(e.y)||(e.y=Math.random()*t.height);var r=t.degreesMap[e.id];h[e.id]=q(q({},e),{data:q(q({},e.data),{size:t.nodeSize(e)||30,layout:{inDegree:r.in,outDegree:r.out,degree:r.all,tDegree:r.in,sDegree:r.out,force:{mass:t.getMass(e),nodeStrength:t.nodeStrength(e)}}})}),p[e.id]=n})),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.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}))},ae=function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:oe(t),edges:ie(t),value:t.graph()};return void 0===e.value&&delete e.value,e};function ue(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 se(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ue(Object(n),!0).forEach((function(e){ce(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ue(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ce(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fe(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 le={compound:!1,multigraph:!1,directed:!0},de=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 ae(e)},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=se(se({},le),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&&fe(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();de.fromJSON=function(t){var e=new de(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 he=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 pe=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);he(t,e,"post"===n,a,o,i)})),i};var ve=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)}}(),ge=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ve(e,t),e}(Zt),me=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ve(e,t),e}(de),ye=function(){return 1},be=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,we(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,we(e,n,a)})),t.removeNode(r.v),o?u:void 0},we=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 Ee=function(t,e){var n;if(t.nodeCount()<=1)return[];var r=function(t,e){var n=new me,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 ge);var s=r+1;return n.nodes().forEach((function(t){we(i,s,n.node(t))})),{buckets:i,zeroIdx:s,graph:n}}(t,e||ye);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();)be(t,e,n,r);for(;r=i.dequeue();)be(t,e,n,r);if(t.nodeCount())for(var u=e.length-2;u>0;--u)if(r=e[u].dequeue()){o=o.concat(be(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 xe=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)}}(),_e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return xe(e,t),e}(de),Se=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},Ae=function(t){var e=new _e({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},Ie=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}},Te=function(t){for(var e=[],n=Ne(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},Oe=function(t,e,n,r){var o={width:0,height:0};return i(n)&&i(r)&&(o.rank=n,o.order=r),Se(t,"border",o,e)},Ne=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},De=function(t,e){var n=Date.now();try{return e()}finally{console.log("".concat(t," time: ").concat(Date.now()-n,"ms"))}},Me=function(t,e){return e()},ke=function(t,e){return t.reduce((function(t,n){return e(t)>e(n)?n:t}))};const Re=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=Se(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 Ce=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)}))},Le=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))}))},Pe=function(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen},je=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)||Pe(e,o)||(t.setNode(a,{}),t.setEdge(r,a,{}),n(a))}))})),t.nodeCount()},ze=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&&Pe(e,o)||(t.setNode(a,{}),t.setEdge(r,a,{}),n(a))}))})),t.nodeCount()},Fe=function(t,e){return ke(e.edges(),(function(n){return t.hasNode(n.v)!==t.hasNode(n.w)?Pe(e,n):1/0}))},Ge=function(t,e,n){t.nodes().forEach((function(t){e.node(t).rank||(e.node(t).rank=0),e.node(t).rank+=n}))},Ue=function(t,e){return pe(t,e,"pre")},Be=function(t,e){return pe(t,e,"post")},Ve=function(t,e){var n=Be(t,t.nodes());null==(n=null==n?void 0:n.slice(0,(null==n?void 0:n.length)-1))||n.forEach((function(n){We(t,e,n)}))},We=function(t,e,n){var r=t.node(n).parent;t.edgeFromArgs(n,r).cutvalue=Xe(t,e,n)},Xe=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,Qe(t,n,s)){var l=t.edgeFromArgs(n,s).cutvalue;u+=c?-l:l}}})),u},He=function(t,e){void 0===e&&(e=t.nodes()[0]),qe(t,{},1,e)},qe=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},Ye=function(t){return t.edges().find((function(e){return t.edge(e).cutvalue<0}))},Ke=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===Je(t,t.node(e.v),u)&&s!==Je(t,t.node(e.w),u)}));return ke(c,(function(t){return Pe(e,t)}))},Ze=function(t,e,n,r){var o=n.v,i=n.w;t.removeEdge(o,i),t.setEdge(r.v,r.w,{}),He(t),Ve(t,e),$e(t,e)},$e=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=Ue(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)}))},Qe=function(t,e,n){return t.hasEdge(e,n)},Je=function(t,e,n){return n.low<=e.lim&&e.lim<=n.lim};const tn=function(t){var e=function(t){var e=(new _e).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);Ce(e);var n,r,o=function(t){var e,n,r=new _e({directed:!1}),o=t.nodes()[0],i=t.nodeCount();for(r.setNode(o,{});je(r,t)<i;)e=Fe(r,t),n=r.hasNode(e.v)?Pe(t,e):-Pe(t,e),Ge(r,t,n);return r}(e);for(He(o),Ve(o,e);n=Ye(o);)r=Ke(o,e,n),Ze(o,e,n,r)};var en=Ce,nn=function(t){Le(t),function(t){var e,n,r=new _e({directed:!1}),o=t.nodes()[0],i=t.nodes().filter((function(e){return!!t.node(e)})).length;for(r.setNode(o,{});ze(r,t)<i;)e=Fe(r,t),n=r.hasNode(e.v)?Pe(t,e):-Pe(t,e),Ge(r,t,n)}(t)};const rn=function(t){switch(t.graph().ranker){case"network-simplex":!function(t){tn(t)}(t);break;case"tight-tree":default:nn(t);break;case"longest-path":en(t)}};var on=function t(e,n,r,o,i,a,u){var s=e.children(u);if(null==s?void 0:s.length){var c=Oe(e,"_bt"),f=Oe(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})},an=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 un=function(t){var e,n=Se(t,"root",{},"_root"),r=an(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){on(t,n,a,u,i,r,e)})),t.graph().nodeRankFactor=a};var sn=function(t,e,n,r,o,i){var a={rank:i,borderType:e,width:0,height:0},u=o[e][i-1],s=Se(t,"border",a,n);o[e][i]=s,t.setParent(s,r),u&&t.setEdge(u,s,{weight:1})};const cn=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)sn(t,"borderLeft","_bl",n,o,i),sn(t,"borderRight","_br",n,o,i)}};null===(e=t.children())||void 0===e||e.forEach((function(t){return n(t)}))};var fn=function(t){t.nodes().forEach((function(e){ln(t.node(e))})),t.edges().forEach((function(e){ln(t.edge(e))}))},ln=function(t){var e=t.width;t.width=t.height,t.height=e},dn=function(t){(null==t?void 0:t.y)&&(t.y=-t.y)},hn=function(t){var e=t.x;t.x=t.y,t.y=e};const pn=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){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("y")&&dn(r)}))}(t),"lr"!==n&&"rl"!==n||(function(t){t.nodes().forEach((function(e){hn(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 hn(t)})),r.hasOwnProperty("x")&&hn(r)}))}(t),fn(t))},vn=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=Math.max.apply(Math,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 gn=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 mn=function(t,e){for(var n=0,r=1;r<(null==e?void 0:e.length);r+=1)n+=gn(t,e[r-1],e[r]);return n};const yn=function(t,e,n){var r=function(t){for(var e;t.hasNode(e="_root".concat(Math.random())););return e}(t),o=new _e({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 bn=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 wn=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)&&bn(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 En=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 xn=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=En(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=En(u,a,f)}));var l={vs:u.flat()};return c&&(l.barycenter=s/c,l.weight=c),l};const _n=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=wn(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=xn(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 Sn=function(t,e,n){return e.map((function(e){return yn(t,e,n)}))},An=function(t,e,n,r){var o=new _e;null==t||t.forEach((function(t){for(var i,a=t.graph().root,u=_n(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)}))},In=function(t,e){null==e||e.forEach((function(e){null==e||e.forEach((function(e,n){t.node(e).order=n}))}))};var Tn=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)}}(),On=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Tn(e,t),e}(de),Nn=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)&&Mn(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},Dn=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}))},Mn=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},kn=function(t,e,n){var r=e;return r>n&&(r=n),!!t[r]},Rn=function(t,e,n,r){var o=new On,i=t.graph(),a=Cn(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 Cn=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}},Ln=function(t,e){return t.node(e).width||0},Pn=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 jn=function(t){var e,n=Ae(t);!function(t){var e=Te(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,Pn(Pn([],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=Te(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=Dn(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)||Mn(n,r,e)}))})),i=s+1,o=l)})),r})),n}(t,e),Nn(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]&&!kn(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=Rn(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 ke(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=Ln(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=Math.min.apply(Math,n),o=Math.max.apply(Math,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-Math.min.apply(Math,c):o-Math.max.apply(Math,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 zn=function(){return zn=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},zn.apply(this,arguments)},Fn=function(t,e,n){e(" removeSelfEdges",(function(){nr(t)})),e(" acyclic",(function(){!function(t){var e="greedy"===t.graph().acyclicer?Ee(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(){un(t)})),e(" rank",(function(){rn(Ae(t))})),e(" injectEdgeLabelProxies",(function(){Yn(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(){Kn(t)})),e(" removeEdgeLabelProxies",(function(){Zn(t)})),e(" normalize.run",(function(){Re(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(){cn(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=Ne(t),r=[],o=[],i=1;i<n+1;i++)r.push(i);for(i=n-1;i>-1;i--)o.push(i);var a=Sn(t,r,"inEdges"),u=Sn(t,o,"outEdges"),s=vn(t);In(t,s);for(var c,f=Number.POSITIVE_INFINITY,d=(i=0,0);d<4;++i,++d)An(i%2?a:u,i%4>=2,!1,e),s=Te(t),(h=mn(t,s))<f&&(d=0,c=l(s),f=h);for(s=vn(t),In(t,s),i=0,d=0;d<4;++i,++d){var h;An(i%2?a:u,i%4>=2,!0,e),s=Te(t),(h=mn(t,s))<f&&(d=0,c=l(s),f=h)}In(t,c)}(t,null==n?void 0:n.keepNodeOrder)})),e(" insertSelfEdges",(function(){rr(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||fn(t)}(t)})),e(" position",(function(){jn(t)})),e(" positionSelfEdges",(function(){or(t)})),e(" removeBorderNodes",(function(){er(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(){Jn(t)})),e(" undoCoordinateSystem",(function(){pn(t)})),e(" translateGraph",(function(){$n(t)})),e(" assignNodeIntersects",(function(){Qn(t)})),e(" reversePoints",(function(){tr(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)}))},Gn=["nodesep","edgesep","ranksep","marginx","marginy"],Un={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Bn=["acyclicer","ranker","rankdir","align"],Vn=["width","height","layer","fixorder"],Wn={width:0,height:0},Xn=["minlen","weight","width","height","labeloffset"],Hn={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},qn=["labelpos"],Yn=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};Se(t,"edge-proxy",o,"_ep")}}))},Kn=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},Zn=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))}))},$n=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},Qn=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(Ie(i,n)),o.points.push(Ie(a,r))}))},Jn=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}}))},tr=function(t){t.edges().forEach((function(e){var n,r=t.edge(e);r.reversed&&(null===(n=r.points)||void 0===n||n.reverse())}))},er=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)}))},nr=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)}}))},rr=function(t){var e=Te(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){Se(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}))}))},or=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}}))},ir=function(t,e){var n={};return null==e||e.forEach((function(e){void 0!==t[e]&&(n[e]=+t[e])})),n},ar=function(t){void 0===t&&(t={});var e={};return Object.keys(t).forEach((function(n){e[n.toLowerCase()]=t[n]})),e};const ur=function(t,e){var n=e&&e.debugTiming?De:Me;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 _e({multigraph:!0,compound:!0}),n=ar(t.graph()),r={};return null==Bn||Bn.forEach((function(t){void 0!==n[t]&&(r[t]=n[t])})),e.setGraph(Object.assign({},Un,ir(n,Gn),r)),t.nodes().forEach((function(n){var r=ar(t.node(n)),o=zn(zn({},Wn),r),i=ir(o,Vn);e.setNode(n,i),e.setParent(n,t.parent(n))})),t.edges().forEach((function(n){var r=ar(t.edge(n)),o={};null==qn||qn.forEach((function(t){void 0!==r[t]&&(o[t]=r[t])})),e.setEdgeObj(n,Object.assign({},Hn,ir(r,Xn),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(){Fn(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 sr=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)}}(),cr=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 sr(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=this,u=this,s=u.nodes,c=u.nodeSize,l=u.rankdir,h=u.combos,p=u.begin,v=u.radial,g=u.comboEdges,m=void 0===g?[]:g,y=u.vedges,b=void 0===y?[]:y;if(s){var w=u.edges||[],E=new _e({multigraph:!0,compound:!0});u.nodeMap={};var _,S={};s.forEach((function(t){u.nodeMap[t.id]=t,t.comboId&&(S[t.comboId]=S[t.comboId]||[],S[t.comboId].push(t.id))})),_=c?o(c)?function(){return c}:function(){return[c,c]}: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 A=x(u.ranksep,50,u.ranksepFunc),I=x(u.nodesep,50,u.nodesepFunc),T=I,O=A;"LR"!==l&&"RL"!==l||(T=A,O=I),E.setDefaultEdgeLabel((function(){return{}})),E.setGraph(u);var N={};this.sortByCombo&&h&&h.forEach((function(t){if(N[t.id]=t,t.collapsed){var e=_(t),n=O(t),r=T(t),o=e[0]+2*r,i=e[1]+2*n;E.setNode(t.id,{width:o,height:i})}t.parentId&&(N[t.parentId]||E.setNode(t.parentId,{}),E.setParent(t.id,t.parentId))})),s.filter((function(t){return!1!==t.layout})).forEach((function(t){var e=_(t),n=O(t),r=T(t),o=e[0]+2*r,u=e[1]+2*n,s=t.layer;i(s)?E.setNode(t.id,{width:o,height:u,layer:s}):E.setNode(t.id,{width:o,height:u}),a.sortByCombo&&t.comboId&&(N[t.comboId]||(N[t.comboId]={id:t.comboId},E.setNode(t.comboId,{})),E.setParent(t.id,t.comboId))})),w.forEach((function(t){var e=d(t,"source"),n=d(t,"target");a.layoutNode(e)&&a.layoutNode(n)&&E.setEdge(e,n,{weight:t.weight||1})})),null===(t=null==m?void 0:m.concat(b||[]))||void 0===t||t.forEach((function(t){var e,n,r=t.source,o=t.target,i=(null===(e=N[r])||void 0===e?void 0:e.collapsed)?[r]:S[r]||[r],a=(null===(n=N[o])||void 0===n?void 0:n.collapsed)?[o]:S[o]||[o];i.forEach((function(e){a.forEach((function(n){E.setEdge(e,n,{weight:t.weight||1})}))}))}));var D=void 0;(null===(n=u.preset)||void 0===n?void 0:n.nodes)&&(D=new _e({multigraph:!0,compound:!0}),u.preset.nodes.forEach((function(t){null==D||D.setNode(t.id,t)}))),ur(E,{prevGraph:D,edgeLabelSpace:u.edgeLabelSpace,keepNodeOrder:Boolean(!!u.nodeOrder),nodeOrder:u.nodeOrder});var M=[0,0];if(p){var k=1/0,R=1/0;E.nodes().forEach((function(t){var e=E.node(t);k>e.x&&(k=e.x),R>e.y&&(R=e.y)})),E.edges().forEach((function(t){var e;null===(e=E.edge(t).points)||void 0===e||e.forEach((function(t){k>t.x&&(k=t.x),R>t.y&&(R=t.y)}))})),M[0]=p[0]-k,M[1]=p[1]-R}var C="LR"===l||"RL"===l;if(v){var L=this,P=L.focusNode,j=L.ranksep,z=L.getRadialPos,F=e(P)?P:null==P?void 0:P.id,G=F?null===(r=E.node(F))||void 0===r?void 0:r._rank:0,U=[],B=C?"y":"x",V=C?"height":"width",W=1/0,X=-1/0;E.nodes().forEach((function(t){var e=E.node(t),n=s.findIndex((function(e){return e.id===t}));if(s[n]){var r=I(s[n]);if(0===G)U[e._rank]||(U[e._rank]={nodes:[],totalWidth:0,maxSize:-1/0}),U[e._rank].nodes.push(t),U[e._rank].totalWidth+=2*r+e[V],U[e._rank].maxSize<Math.max(e.width,e.height)&&(U[e._rank].maxSize=Math.max(e.width,e.height));else{var o=e._rank-G;if(0===o)U[o]||(U[o]={nodes:[],totalWidth:0,maxSize:-1/0}),U[o].nodes.push(t),U[o].totalWidth+=2*r+e[V],U[o].maxSize<Math.max(e.width,e.height)&&(U[o].maxSize=Math.max(e.width,e.height));else{var i=Math.abs(o);U[i]||(U[i]={left:[],right:[],totalWidth:0,maxSize:-1/0}),U[i].totalWidth+=2*r+e[V],U[i].maxSize<Math.max(e.width,e.height)&&(U[i].maxSize=Math.max(e.width,e.height)),o<0?U[i].left.push(t):U[i].right.push(t)}}var a=e[B]-e[V]/2-r,u=e[B]+e[V]/2+r;a<W&&(W=a),u>X&&(X=u)}}));var H=j||50,q={},Y=(X-W)/.9,K=[.5*(W+X-Y),.5*(W+X+Y)],Z=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=E.node(t);q[t]=e;var i=z(n[B],K,Y,e,r),a=i.x,u=i.y,c=s.findIndex((function(e){return e.id===t}));if(s[c]){s[c].x=a+M[0],s[c].y=u+M[1],s[c]._order=n._order;var f=A(s[c]);o<f&&(o=f)}})),o},$=!0;U.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($&&1===t.nodes.length){var c=s.findIndex((function(e){return e.id===t.nodes[0]}));if(c<=-1)return;return s[c].x=M[0],s[c].y=M[1],q[t.nodes[0]]=0,H=A(s[c]),void($=!1)}H=Math.max(H,t.totalWidth/(2*Math.PI));var f=-1/0;if(0===G||(null===(o=t.nodes)||void 0===o?void 0:o.length))f=Z(t.nodes,H,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=Z(t.left,H,f,[0,l]),f=Z(t.right,H,f,[l+.05,1])}H+=f,$=!1,t.maxSize}})),E.edges().forEach((function(t){var e,n,r,o=E.edge(t),i=w.findIndex((function(e){var n=d(e,"source"),r=d(e,"target");return n===t.v&&r===t.w}));if(!(i<=-1)&&u.edgeLabelSpace&&u.controlPoints&&"loop"!==w[i].type){var a="x"===B?"y":"x",s=null===(e=null==o?void 0:o.points)||void 0===e?void 0:e.slice(1,o.points.length-1),c=[],f=null===(n=E.node(t.v))||void 0===n?void 0:n[a],l=f-(null===(r=E.node(t.w))||void 0===r?void 0:r[a]),h=q[t.v],p=h-q[t.w];null==s||s.forEach((function(t){var e=(t[a]-f)/l*p+h,n=z(t[B],K,Y,e);c.push({x:n.x+M[0],y:n.y+M[1]})})),w[i].controlPoints=c}}))}else{var Q=new Set,J="BT"===l||"RL"===l?function(t,e){return e-t}:function(t,e){return t-e};E.nodes().forEach((function(t){var e=E.node(t);if(e){var n=a.nodeMap[t];n||(n=null==h?void 0:h.find((function(e){return e.id===t}))),n&&(n.x=e.x+M[0],n.y=e.y+M[1],n._order=e._order,Q.add(C?n.x:n.y))}}));var tt=Array.from(Q).sort(J);E.edges().forEach((function(t){var e,n=E.edge(t),r=w.findIndex((function(e){var n=d(e,"source"),r=d(e,"target");return n===t.v&&r===t.w}));if(!(r<=-1)&&u.edgeLabelSpace&&u.controlPoints&&"loop"!==w[r].type){w[r].controlPoints=(null===(e=null==n?void 0:n.points)||void 0===e?void 0:e.slice(1,n.points.length-1))||[];var o=u.nodeMap[t.v],i=u.nodeMap[t.w];if(o&&i){var a=o.x,s=o.y,c=i.x,f=i.y;if(C&&(a=o.y,s=o.x,c=i.y,f=i.x),f!==s&&a!==c){var l=tt[tt.indexOf(s)+1];if(l){var h=w[r].controlPoints[0],p=C?{x:(s+l)/2,y:(null==h?void 0:h.x)||c}:{x:(null==h?void 0:h.x)||c,y:(s+l)/2};h&&h.y===p.y||w[r].controlPoints.unshift(p)}}}w[r].controlPoints.forEach((function(t){t.x+=M[0],t.y+=M[1]}))}}))}return u.onLayoutEnd&&u.onLayoutEnd(),{nodes:s,edges:w}}},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);const fr={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 lr(t={},e=fr){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 dr(t){return`◬${t}◬`}const hr=dr("ROOT"),pr=dr("BRIDGE_GRAPH");var vr,gr,mr,yr;!function(t){t[t.META=0]="META",t[t.NODE=1]="NODE",t[t.BRIDGE=2]="BRIDGE"}(vr||(vr={})),function(t){t[t.INCLUDE=0]="INCLUDE",t[t.EXCLUDE=1]="EXCLUDE",t[t.UNSPECIFIED=2]="UNSPECIFIED"}(gr||(gr={})),function(t){t[t.META=0]="META",t[t.CORE=1]="CORE",t[t.BRIDGE=2]="BRIDGE"}(mr||(mr={})),function(t){t[t.META=0]="META",t[t.OP=1]="OP",t[t.SERIES=2]="SERIES"}(yr||(yr={}));var br="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{};function wr(t,e){return t(e={exports:{}},e.exports),e.exports}var Er=function(t,e){return t===e||t!=t&&e!=e},xr=function(t,e){for(var n=t.length;n--;)if(Er(t[n][0],e))return n;return-1},_r=Array.prototype.splice;function Sr(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])}}Sr.prototype.clear=function(){this.__data__=[],this.size=0},Sr.prototype.delete=function(t){var e=this.__data__,n=xr(e,t);return!(n<0||(n==e.length-1?e.pop():_r.call(e,n,1),--this.size,0))},Sr.prototype.get=function(t){var e=this.__data__,n=xr(e,t);return n<0?void 0:e[n][1]},Sr.prototype.has=function(t){return xr(this.__data__,t)>-1},Sr.prototype.set=function(t,e){var n=this.__data__,r=xr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var Ar,Ir=Sr,Tr="object"==typeof br&&br&&br.Object===Object&&br,Or="object"==typeof self&&self&&self.Object===Object&&self,Nr=Tr||Or||Function("return this")(),Dr=Nr.Symbol,Mr=Object.prototype,kr=Mr.hasOwnProperty,Rr=Mr.toString,Cr=Dr?Dr.toStringTag:void 0,Lr=Object.prototype.toString,Pr=Dr?Dr.toStringTag:void 0,jr=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Pr&&Pr in Object(t)?function(t){var e=kr.call(t,Cr),n=t[Cr];try{t[Cr]=void 0;var r=!0}catch(t){}var o=Rr.call(t);return r&&(e?t[Cr]=n:delete t[Cr]),o}(t):function(t){return Lr.call(t)}(t)},zr=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},Fr=function(t){if(!zr(t))return!1;var e=jr(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},Gr=Nr["__core-js_shared__"],Ur=(Ar=/[^.]+$/.exec(Gr&&Gr.keys&&Gr.keys.IE_PROTO||""))?"Symbol(src)_1."+Ar:"",Br=Function.prototype.toString,Vr=function(t){if(null!=t){try{return Br.call(t)}catch(t){}try{return t+""}catch(t){}}return""},Wr=/^\[object .+?Constructor\]$/,Xr=Function.prototype,Hr=Object.prototype,qr=Xr.toString,Yr=Hr.hasOwnProperty,Kr=RegExp("^"+qr.call(Yr).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Zr=function(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!zr(t)||function(t){return!!Ur&&Ur in t}(t))&&(Fr(t)?Kr:Wr).test(Vr(t))}(n)?n:void 0},$r=Zr(Nr,"Map"),Qr=Zr(Object,"create"),Jr=Object.prototype.hasOwnProperty,to=Object.prototype.hasOwnProperty;function eo(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])}}eo.prototype.clear=function(){this.__data__=Qr?Qr(null):{},this.size=0},eo.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},eo.prototype.get=function(t){var e=this.__data__;if(Qr){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return Jr.call(e,t)?e[t]:void 0},eo.prototype.has=function(t){var e=this.__data__;return Qr?void 0!==e[t]:to.call(e,t)},eo.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Qr&&void 0===e?"__lodash_hash_undefined__":e,this};var no=eo,ro=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 oo(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])}}oo.prototype.clear=function(){this.size=0,this.__data__={hash:new no,map:new($r||Ir),string:new no}},oo.prototype.delete=function(t){var e=ro(this,t).delete(t);return this.size-=e?1:0,e},oo.prototype.get=function(t){return ro(this,t).get(t)},oo.prototype.has=function(t){return ro(this,t).has(t)},oo.prototype.set=function(t,e){var n=ro(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};var io=oo;function ao(t){var e=this.__data__=new Ir(t);this.size=e.size}ao.prototype.clear=function(){this.__data__=new Ir,this.size=0},ao.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},ao.prototype.get=function(t){return this.__data__.get(t)},ao.prototype.has=function(t){return this.__data__.has(t)},ao.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Ir){var r=n.__data__;if(!$r||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new io(r)}return n.set(t,e),this.size=n.size,this};var uo=ao,so=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t},co=function(){try{var t=Zr(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),fo=function(t,e,n){"__proto__"==e&&co?co(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n},lo=Object.prototype.hasOwnProperty,ho=function(t,e,n){var r=t[e];lo.call(t,e)&&Er(r,n)&&(void 0!==n||e in t)||fo(t,e,n)},po=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?fo(n,u,s):ho(n,u,s)}return n},vo=function(t){return null!=t&&"object"==typeof t},go=function(t){return vo(t)&&"[object Arguments]"==jr(t)},mo=Object.prototype,yo=mo.hasOwnProperty,bo=mo.propertyIsEnumerable,wo=go(function(){return arguments}())?go:function(t){return vo(t)&&yo.call(t,"callee")&&!bo.call(t,"callee")},Eo=Array.isArray,xo=function(){return!1},_o=wr((function(t,e){var n=e&&!e.nodeType&&e,r=n&&t&&!t.nodeType&&t,o=r&&r.exports===n?Nr.Buffer:void 0,i=(o?o.isBuffer:void 0)||xo;t.exports=i})),So=/^(?:0|[1-9]\d*)$/,Ao=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&So.test(t))&&t>-1&&t%1==0&&t<e},Io=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},To={};To["[object Float32Array]"]=To["[object Float64Array]"]=To["[object Int8Array]"]=To["[object Int16Array]"]=To["[object Int32Array]"]=To["[object Uint8Array]"]=To["[object Uint8ClampedArray]"]=To["[object Uint16Array]"]=To["[object Uint32Array]"]=!0,To["[object Arguments]"]=To["[object Array]"]=To["[object ArrayBuffer]"]=To["[object Boolean]"]=To["[object DataView]"]=To["[object Date]"]=To["[object Error]"]=To["[object Function]"]=To["[object Map]"]=To["[object Number]"]=To["[object Object]"]=To["[object RegExp]"]=To["[object Set]"]=To["[object String]"]=To["[object WeakMap]"]=!1;var Oo=function(t){return function(e){return t(e)}},No=wr((function(t,e){var n=e&&!e.nodeType&&e,r=n&&t&&!t.nodeType&&t,o=r&&r.exports===n&&Tr.process,i=function(){try{return r&&r.require&&r.require("util").types||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=i})),Do=No&&No.isTypedArray,Mo=Do?Oo(Do):function(t){return vo(t)&&Io(t.length)&&!!To[jr(t)]},ko=Object.prototype.hasOwnProperty,Ro=function(t,e){var n=Eo(t),r=!n&&wo(t),o=!n&&!r&&_o(t),i=!n&&!r&&!o&&Mo(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&&!ko.call(t,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Ao(c,s))||u.push(c);return u},Co=Object.prototype,Lo=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Co)},Po=function(t,e){return function(n){return t(e(n))}},jo=Po(Object.keys,Object),zo=Object.prototype.hasOwnProperty,Fo=function(t){if(!Lo(t))return jo(t);var e=[];for(var n in Object(t))zo.call(t,n)&&"constructor"!=n&&e.push(n);return e},Go=function(t){return null!=t&&Io(t.length)&&!Fr(t)},Uo=function(t){return Go(t)?Ro(t):Fo(t)},Bo=Object.prototype.hasOwnProperty,Vo=function(t){return Go(t)?Ro(t,!0):function(t){if(!zr(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=Lo(t),n=[];for(var r in t)("constructor"!=r||!e&&Bo.call(t,r))&&n.push(r);return n}(t)},Wo=wr((function(t,e){var n=e&&!e.nodeType&&e,r=n&&t&&!t.nodeType&&t,o=r&&r.exports===n?Nr.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}})),Xo=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e},Ho=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},qo=function(){return[]},Yo=Object.prototype.propertyIsEnumerable,Ko=Object.getOwnPropertySymbols,Zo=Ko?function(t){return null==t?[]:(t=Object(t),Ho(Ko(t),(function(e){return Yo.call(t,e)})))}:qo,$o=function(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t},Qo=Po(Object.getPrototypeOf,Object),Jo=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)$o(e,Zo(t)),t=Qo(t);return e}:qo,ti=function(t,e,n){var r=e(t);return Eo(t)?r:$o(r,n(t))},ei=function(t){return ti(t,Uo,Zo)},ni=function(t){return ti(t,Vo,Jo)},ri=Zr(Nr,"DataView"),oi=Zr(Nr,"Promise"),ii=Zr(Nr,"Set"),ai=Zr(Nr,"WeakMap"),ui=Vr(ri),si=Vr($r),ci=Vr(oi),fi=Vr(ii),li=Vr(ai),di=jr;(ri&&"[object DataView]"!=di(new ri(new ArrayBuffer(1)))||$r&&"[object Map]"!=di(new $r)||oi&&"[object Promise]"!=di(oi.resolve())||ii&&"[object Set]"!=di(new ii)||ai&&"[object WeakMap]"!=di(new ai))&&(di=function(t){var e=jr(t),n="[object Object]"==e?t.constructor:void 0,r=n?Vr(n):"";if(r)switch(r){case ui:return"[object DataView]";case si:return"[object Map]";case ci:return"[object Promise]";case fi:return"[object Set]";case li:return"[object WeakMap]"}return e});var hi=di,pi=Object.prototype.hasOwnProperty,vi=Nr.Uint8Array,gi=function(t){var e=new t.constructor(t.byteLength);return new vi(e).set(new vi(t)),e},mi=/\w*$/,yi=Dr?Dr.prototype:void 0,bi=yi?yi.valueOf:void 0,wi=function(t,e){var n=e?gi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)},Ei=Object.create,xi=function(){function t(){}return function(e){if(!zr(e))return{};if(Ei)return Ei(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}(),_i=function(t){return"function"!=typeof t.constructor||Lo(t)?{}:xi(Qo(t))},Si=No&&No.isMap,Ai=Si?Oo(Si):function(t){return vo(t)&&"[object Map]"==hi(t)},Ii=No&&No.isSet,Ti=Ii?Oo(Ii):function(t){return vo(t)&&"[object Set]"==hi(t)},Oi={};Oi["[object Arguments]"]=Oi["[object Array]"]=Oi["[object ArrayBuffer]"]=Oi["[object DataView]"]=Oi["[object Boolean]"]=Oi["[object Date]"]=Oi["[object Float32Array]"]=Oi["[object Float64Array]"]=Oi["[object Int8Array]"]=Oi["[object Int16Array]"]=Oi["[object Int32Array]"]=Oi["[object Map]"]=Oi["[object Number]"]=Oi["[object Object]"]=Oi["[object RegExp]"]=Oi["[object Set]"]=Oi["[object String]"]=Oi["[object Symbol]"]=Oi["[object Uint8Array]"]=Oi["[object Uint8ClampedArray]"]=Oi["[object Uint16Array]"]=Oi["[object Uint32Array]"]=!0,Oi["[object Error]"]=Oi["[object Function]"]=Oi["[object WeakMap]"]=!1;var Ni=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(!zr(e))return e;var l=Eo(e);if(l){if(u=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&pi.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(e),!s)return Xo(e,u)}else{var d=hi(e),h="[object Function]"==d||"[object GeneratorFunction]"==d;if(_o(e))return Wo(e,s);if("[object Object]"==d||"[object Arguments]"==d||h&&!i){if(u=c||h?{}:_i(e),!s)return c?function(t,e){return po(t,Jo(t),e)}(e,function(t,e){return t&&po(e,Vo(e),t)}(u,e)):function(t,e){return po(t,Zo(t),e)}(e,function(t,e){return t&&po(e,Uo(e),t)}(u,e))}else{if(!Oi[d])return i?e:{};u=function(t,e,n){var r=t.constructor;switch(e){case"[object ArrayBuffer]":return gi(t);case"[object Boolean]":case"[object Date]":return new r(+t);case"[object DataView]":return function(t,e){var n=e?gi(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 wi(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,mi.exec(t));return e.lastIndex=t.lastIndex,e}(t);case"[object Symbol]":return function(t){return bi?Object(bi.call(t)):{}}(t)}}(e,d,s)}}a||(a=new uo);var p=a.get(e);if(p)return p;a.set(e,u),Ti(e)?e.forEach((function(o){u.add(t(o,n,r,o,e,a))})):Ai(e)&&e.forEach((function(o,i){u.set(i,t(o,n,r,i,e,a))}));var v=l?void 0:(f?c?ni:ei:c?Vo:Uo)(e);return so(v||e,(function(o,i){v&&(o=e[i=o]),ho(u,i,t(o,n,r,i,e,a))})),u},Di=function(t){return function(){return t}},Mi=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},ki=function(t,e){return t&&Mi(t,e,Uo)},Ri=function(t,e){return function(e,n){if(null==e)return e;if(!Go(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}}(ki),Ci=function(t){return t},Li=function(t){return"function"==typeof t?t:Ci},Pi=function(t,e){return(Eo(t)?so:Ri)(t,Li(e))},ji=Pi,zi=function(t,e){var n=[];return Ri(t,(function(t,r,o){e(t,r,o)&&n.push(t)})),n};function Fi(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new io;++e<n;)this.add(t[e])}Fi.prototype.add=Fi.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Fi.prototype.has=function(t){return this.__data__.has(t)};var Gi=Fi,Ui=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},Bi=function(t,e){return t.has(e)},Vi=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 Gi: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(!Ui(e,(function(t,e){if(!Bi(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},Wi=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n},Xi=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n},Hi=Dr?Dr.prototype:void 0,qi=Hi?Hi.valueOf:void 0,Yi=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 vi(t),new vi(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Er(+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=Wi;case"[object Set]":var s=1&r;if(u||(u=Xi),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=Vi(u(t),u(e),r,o,i,a);return a.delete(t),f;case"[object Symbol]":if(qi)return qi.call(t)==qi.call(e)}return!1},Ki=Object.prototype.hasOwnProperty,Zi=Object.prototype.hasOwnProperty,$i=function t(e,n,r,o,i){return e===n||(null==e||null==n||!vo(e)&&!vo(n)?e!=e&&n!=n:function(t,e,n,r,o,i){var a=Eo(t),u=Eo(e),s=a?"[object Array]":hi(t),c=u?"[object Array]":hi(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&&_o(t)){if(!_o(e))return!1;a=!0,f=!1}if(d&&!f)return i||(i=new uo),a||Mo(t)?Vi(t,e,n,r,o,i):Yi(t,e,s,n,r,o,i);if(!(1&n)){var h=f&&Zi.call(t,"__wrapped__"),p=l&&Zi.call(e,"__wrapped__");if(h||p){var v=h?t.value():t,g=p?e.value():e;return i||(i=new uo),o(v,g,n,r,i)}}return!!d&&(i||(i=new uo),function(t,e,n,r,o,i){var a=1&n,u=ei(t),s=u.length;if(s!=ei(e).length&&!a)return!1;for(var c=s;c--;){var f=u[c];if(!(a?f in e:Ki.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))},Qi=function(t){return t==t&&!zr(t)},Ji=function(t,e){return function(n){return null!=n&&n[t]===e&&(void 0!==e||t in Object(n))}},ta=function(t){return"symbol"==typeof t||vo(t)&&"[object Symbol]"==jr(t)},ea=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,na=/^\w*$/,ra=function(t,e){if(Eo(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!ta(t))||na.test(t)||!ea.test(t)||null!=e&&t in Object(e)};function oa(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(oa.Cache||io),n}oa.Cache=io;var ia,aa=oa,ua=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,sa=/\\(\\)?/g,ca=function(t){var e=aa((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(ua,(function(t,n,r,o){e.push(r?o.replace(sa,"$1"):n||t)})),e}),(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}(),fa=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},la=Dr?Dr.prototype:void 0,da=la?la.toString:void 0,ha=function t(e){if("string"==typeof e)return e;if(Eo(e))return fa(e,t)+"";if(ta(e))return da?da.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n},pa=function(t){return null==t?"":ha(t)},va=function(t,e){return Eo(t)?t:ra(t,e)?[t]:ca(pa(t))},ga=function(t){if("string"==typeof t||ta(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e},ma=function(t,e){for(var n=0,r=(e=va(e,t)).length;null!=t&&n<r;)t=t[ga(e[n++])];return n&&n==r?t:void 0},ya=function(t,e){return null!=t&&e in Object(t)},ba=function(t,e,n){for(var r=-1,o=(e=va(e,t)).length,i=!1;++r<o;){var a=ga(e[r]);if(!(i=null!=t&&n(t,a)))break;t=t[a]}return i||++r!=o?i:!!(o=null==t?0:t.length)&&Io(o)&&Ao(a,o)&&(Eo(t)||wo(t))},wa=function(t,e){return null!=t&&ba(t,e,ya)},Ea=function(t){return function(e){return null==e?void 0:e[t]}},xa=function(t){return"function"==typeof t?t:null==t?Ci:"object"==typeof t?Eo(t)?function(t,e){return ra(t)&&Qi(e)?Ji(ga(t),e):function(n){var r=function(t,e,n){var r=null==t?void 0:ma(t,e);return void 0===r?void 0:r}(n,t);return void 0===r&&r===e?wa(n,t):$i(e,r,3)}}(t[0],t[1]):function(t){var e=function(t){for(var e=Uo(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,Qi(o)]}return e}(t);return 1==e.length&&e[0][2]?Ji(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 uo;if(!(void 0===f?$i(c,s,3,r,l):f))return!1}}return!0}(n,0,e)}}(t):function(t){return ra(t)?Ea(ga(t)):function(t){return function(e){return ma(e,t)}}(t)}(t)},_a=function(t,e){return(Eo(t)?Ho:zi)(t,xa(e))},Sa=Object.prototype.hasOwnProperty,Aa=function(t,e){return null!=t&&Sa.call(t,e)},Ia=function(t,e){return null!=t&&ba(t,e,Aa)},Ta=Object.prototype.hasOwnProperty,Oa=function(t){return void 0===t},Na=function(t,e){var n=-1,r=Go(t)?Array(t.length):[];return Ri(t,(function(t,o,i){r[++n]=e(t,o,i)})),r},Da=function(t,e){return(Eo(t)?fa:Na)(t,xa(e))},Ma=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},ka=function(t,e,n,r,o){return o(t,(function(t,o,i){n=r?(r=!1,t):e(n,t,o,i)})),n},Ra=function(t,e,n){var r=Eo(t)?Ma:ka,o=arguments.length<3;return r(t,xa(e),n,o,Ri)},Ca=Ea("length"),La=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),Pa="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",ja="\\ud83c[\\udffb-\\udfff]",za="[^\\ud800-\\udfff]",Fa="(?:\\ud83c[\\udde6-\\uddff]){2}",Ga="[\\ud800-\\udbff][\\udc00-\\udfff]",Ua="(?:"+Pa+"|"+ja+")?",Ba="[\\ufe0e\\ufe0f]?"+Ua+"(?:\\u200d(?:"+[za,Fa,Ga].join("|")+")[\\ufe0e\\ufe0f]?"+Ua+")*",Va="(?:"+[za+Pa+"?",Pa,Fa,Ga,"[\\ud800-\\udfff]"].join("|")+")",Wa=RegExp(ja+"(?="+ja+")|"+Va+Ba,"g"),Xa=Dr?Dr.isConcatSpreadable:void 0,Ha=function(t){return Eo(t)||wo(t)||!!(Xa&&t&&t[Xa])},qa=function t(e,n,r,o,i){var a=-1,u=e.length;for(r||(r=Ha),i||(i=[]);++a<u;){var s=e[a];n>0&&r(s)?n>1?t(s,n-1,r,o,i):$o(i,s):o||(i[i.length]=s)}return i},Ya=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)},Ka=Math.max,Za=function(t,e,n){return e=Ka(void 0===e?t.length-1:e,0),function(){for(var r=arguments,o=-1,i=Ka(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),Ya(t,this,u)}},$a=co?function(t,e){return co(t,"toString",{configurable:!0,enumerable:!1,value:Di(e),writable:!0})}:Ci,Qa=Date.now,Ja=function(t){var e=0,n=0;return function(){var r=Qa(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}($a),tu=function(t,e){return Ja(Za(t,e,Ci),t+"")},eu=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},nu=function(t){return t!=t},ru=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):eu(t,nu,0)}(t,e)>-1},ou=ii&&1/Xi(new ii([,-0]))[1]==1/0?function(t){return new ii(t)}:function(){},iu=function(t){return vo(t)&&Go(t)},au=tu((function(t){return function(t,e,n){var r=-1,o=ru,i=t.length,a=!0,u=[],s=u;if(i>=200){var c=ou(t);if(c)return Xi(c);a=!1,o=Bi,s=new Gi}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}(qa(t,1,iu,!0))})),uu=function(t){return null==t?[]:function(t,e){return fa(e,(function(e){return t[e]}))}(t,Uo(t))};try{ia={clone:function(t){return Ni(t,4)},constant:Di,each:ji,filter:_a,has:Ia,isArray:Eo,isEmpty:function(t){if(null==t)return!0;if(Go(t)&&(Eo(t)||"string"==typeof t||"function"==typeof t.splice||_o(t)||Mo(t)||wo(t)))return!t.length;var e=hi(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(Lo(t))return!Fo(t).length;for(var n in t)if(Ta.call(t,n))return!1;return!0},isFunction:Fr,isUndefined:Oa,keys:Uo,map:Da,reduce:Ra,size:function(t){if(null==t)return 0;if(Go(t))return function(t){return"string"==typeof t||!Eo(t)&&vo(t)&&"[object String]"==jr(t)}(t)?function(t){return function(t){return La.test(t)}(t)?function(t){for(var e=Wa.lastIndex=0;Wa.test(t);)++e;return e}(t):Ca(t)}(t):t.length;var e=hi(t);return"[object Map]"==e||"[object Set]"==e?t.size:Fo(t).length},transform:function(t,e,n){var r=Eo(t),o=r||_o(t)||Mo(t);if(e=xa(e),null==n){var i=t&&t.constructor;n=o?r?new i:[]:zr(t)&&Fr(i)?xi(Qo(t)):{}}return(o?so:ki)(t,(function(t,r,o){return e(n,t,r,o)})),n},union:au,values:uu}}catch(fr){}ia||(ia=window._);var su=ia,cu=fu;function fu(t){this._isDirected=!su.has(t,"directed")||t.directed,this._isMultigraph=!!su.has(t,"multigraph")&&t.multigraph,this._isCompound=!!su.has(t,"compound")&&t.compound,this._label=void 0,this._defaultNodeLabelFn=su.constant(void 0),this._defaultEdgeLabelFn=su.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 lu(t,e){t[e]?t[e]++:t[e]=1}function du(t,e){--t[e]||delete t[e]}function hu(t,e,n,r){var o=""+e,i=""+n;if(!t&&o>i){var a=o;o=i,i=a}return o+""+i+""+(su.isUndefined(r)?"\0":r)}function pu(t,e){return hu(t,e.v,e.w,e.name)}fu.prototype._nodeCount=0,fu.prototype._edgeCount=0,fu.prototype.isDirected=function(){return this._isDirected},fu.prototype.isMultigraph=function(){return this._isMultigraph},fu.prototype.isCompound=function(){return this._isCompound},fu.prototype.setGraph=function(t){return this._label=t,this},fu.prototype.graph=function(){return this._label},fu.prototype.setDefaultNodeLabel=function(t){return su.isFunction(t)||(t=su.constant(t)),this._defaultNodeLabelFn=t,this},fu.prototype.nodeCount=function(){return this._nodeCount},fu.prototype.nodes=function(){return su.keys(this._nodes)},fu.prototype.sources=function(){var t=this;return su.filter(this.nodes(),(function(e){return su.isEmpty(t._in[e])}))},fu.prototype.sinks=function(){var t=this;return su.filter(this.nodes(),(function(e){return su.isEmpty(t._out[e])}))},fu.prototype.setNodes=function(t,e){var n=arguments,r=this;return su.each(t,(function(t){n.length>1?r.setNode(t,e):r.setNode(t)})),this},fu.prototype.setNode=function(t,e){return su.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)},fu.prototype.node=function(t){return this._nodes[t]},fu.prototype.hasNode=function(t){return su.has(this._nodes,t)},fu.prototype.removeNode=function(t){var e=this;if(su.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],su.each(this.children(t),(function(t){e.setParent(t)})),delete this._children[t]),su.each(su.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],su.each(su.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},fu.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(su.isUndefined(e))e="\0";else{for(var n=e+="";!su.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},fu.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},fu.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if("\0"!==e)return e}},fu.prototype.children=function(t){if(su.isUndefined(t)&&(t="\0"),this._isCompound){var e=this._children[t];if(e)return su.keys(e)}else{if("\0"===t)return this.nodes();if(this.hasNode(t))return[]}},fu.prototype.predecessors=function(t){var e=this._preds[t];if(e)return su.keys(e)},fu.prototype.successors=function(t){var e=this._sucs[t];if(e)return su.keys(e)},fu.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return su.union(e,this.successors(t))},fu.prototype.isLeaf=function(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length},fu.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;su.each(this._nodes,(function(n,r){t(r)&&e.setNode(r,n)})),su.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&&su.each(e.nodes(),(function(t){e.setParent(t,o(t))})),e},fu.prototype.setDefaultEdgeLabel=function(t){return su.isFunction(t)||(t=su.constant(t)),this._defaultEdgeLabelFn=t,this},fu.prototype.edgeCount=function(){return this._edgeCount},fu.prototype.edges=function(){return su.values(this._edgeObjs)},fu.prototype.setPath=function(t,e){var n=this,r=arguments;return su.reduce(t,(function(t,o){return r.length>1?n.setEdge(t,o,e):n.setEdge(t,o),o})),this},fu.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,su.isUndefined(n)||(n=""+n);var a=hu(this._isDirected,t,e,n);if(su.has(this._edgeLabels,a))return o&&(this._edgeLabels[a]=r),this;if(!su.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,lu(this._preds[e],t),lu(this._sucs[t],e),this._in[e][a]=u,this._out[t][a]=u,this._edgeCount++,this},fu.prototype.edge=function(t,e,n){var r=1===arguments.length?pu(this._isDirected,arguments[0]):hu(this._isDirected,t,e,n);return this._edgeLabels[r]},fu.prototype.hasEdge=function(t,e,n){var r=1===arguments.length?pu(this._isDirected,arguments[0]):hu(this._isDirected,t,e,n);return su.has(this._edgeLabels,r)},fu.prototype.removeEdge=function(t,e,n){var r=1===arguments.length?pu(this._isDirected,arguments[0]):hu(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],du(this._preds[e],t),du(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this},fu.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var r=su.values(n);return e?su.filter(r,(function(t){return t.v===e})):r}},fu.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var r=su.values(n);return e?su.filter(r,(function(t){return t.w===e})):r}},fu.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))};var vu={Graph:cu,version:"2.1.8"},gu={write:function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:mu(t),edges:yu(t)};return su.isUndefined(t.graph())||(e.value=su.clone(t.graph())),e},read:function(t){var e=new cu(t.options).setGraph(t.value);return su.each(t.nodes,(function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)})),su.each(t.edges,(function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)})),e}};function mu(t){return su.map(t.nodes(),(function(e){var n=t.node(e),r=t.parent(e),o={v:e};return su.isUndefined(n)||(o.value=n),su.isUndefined(r)||(o.parent=r),o}))}function yu(t){return su.map(t.edges(),(function(e){var n=t.edge(e),r={v:e.v,w:e.w};return su.isUndefined(e.name)||(r.name=e.name),su.isUndefined(n)||(r.value=n),r}))}var bu=wu;function wu(){this._arr=[],this._keyIndices={}}wu.prototype.size=function(){return this._arr.length},wu.prototype.keys=function(){return this._arr.map((function(t){return t.key}))},wu.prototype.has=function(t){return su.has(this._keyIndices,t)},wu.prototype.priority=function(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority},wu.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},wu.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!su.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},wu.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},wu.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)},wu.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)))},wu.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},wu.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 Eu=function(t,e,n,r){return function(t,e,n,r){var o,i,a={},u=new bu,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||xu,r||function(e){return t.outEdges(e)})},xu=su.constant(1),_u=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){su.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){su.has(r,t)||i(t)})),o},Su=su.constant(1),Au=Iu;function Iu(t){var e={},n={},r=[];if(su.each(t.sinks(),(function o(i){if(su.has(n,i))throw new Tu;su.has(e,i)||(n[i]=!0,e[i]=!0,su.each(t.predecessors(i),o),delete n[i],r.push(i))})),su.size(e)!==t.nodeCount())throw new Tu;return r}function Tu(){}Iu.CycleException=Tu,Tu.prototype=new Error;var Ou=function(t,e,n){su.isArray(e)||(e=[e]);var r=(t.isDirected()?t.successors:t.neighbors).bind(t),o=[],i={};return su.each(e,(function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);Nu(t,e,"post"===n,i,r,o)})),o};function Nu(t,e,n,r,o,i){su.has(r,e)||(r[e]=!0,n||i.push(e),su.each(o(e),(function(e){Nu(t,e,n,r,o,i)})),n&&i.push(e))}var Du,Mu={Graph:vu.Graph,json:gu,alg:{components:function(t){var e,n={},r=[];function o(r){su.has(n,r)||(n[r]=!0,e.push(r),su.each(t.successors(r),o),su.each(t.predecessors(r),o))}return su.each(t.nodes(),(function(t){e=[],o(t),e.length&&r.push(e)})),r},dijkstra:Eu,dijkstraAll:function(t,e,n){return su.transform(t.nodes(),(function(r,o){r[o]=Eu(t,o,e,n)}),{})},findCycles:function(t){return su.filter(_u(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||Su,n||function(e){return t.outEdges(e)})},isAcyclic:function(t){try{Au(t)}catch(t){if(t instanceof Au.CycleException)return!1;throw t}return!0},postorder:function(t,e){return Ou(t,e,"post")},preorder:function(t,e){return Ou(t,e,"pre")},prim:function(t,e){var n,r=new cu,o={},i=new bu;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;su.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(),su.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:_u,topsort:Au},version:vu.version};try{Du=Mu}catch(fr){}Du||(Du=window.graphlib);var ku,Ru=Du,Cu=function(t,e,n){if(!zr(n))return!1;var r=typeof e;return!!("number"==r?Go(n)&&Ao(e,n.length):"string"==r&&e in n)&&Er(n[e],t)},Lu=Object.prototype,Pu=Lu.hasOwnProperty,ju=tu((function(t,e){t=Object(t);var n=-1,r=e.length,o=r>2?e[2]:void 0;for(o&&Cu(e[0],e[1],o)&&(r=1);++n<r;)for(var i=e[n],a=Vo(i),u=-1,s=a.length;++u<s;){var c=a[u],f=t[c];(void 0===f||Er(f,Lu[c])&&!Pu.call(t,c))&&(t[c]=i[c])}return t})),zu=/^\s+|\s+$/g,Fu=/^[-+]0x[0-9a-f]+$/i,Gu=/^0b[01]+$/i,Uu=/^0o[0-7]+$/i,Bu=parseInt,Vu=function(t){return t?1/0===(t=function(t){if("number"==typeof t)return t;if(ta(t))return NaN;if(zr(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=zr(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(zu,"");var n=Gu.test(t);return n||Uu.test(t)?Bu(t.slice(2),n?2:8):Fu.test(t)?NaN:+t}(t))||-1/0===t?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0},Wu=Math.max,Xu=function(t,e,n){var r=Object(t);if(!Go(t)){var o=xa(e);t=Uo(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=Vu(t),n=e%1;return e==e?n?e-n:e:0}(n);return o<0&&(o=Wu(r+o,0)),eu(t,xa(e),o)}(t,e,n);return i>-1?r[o?t[i]:i]:void 0},Hu=function(t){return null!=t&&t.length?qa(t,1):[]},qu=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&&!ta(a):n(a,u)))var u=a,s=i}return s},Yu=function(t,e){return t>e},Ku=function(t,e,n){(void 0!==n&&!Er(t[e],n)||void 0===n&&!(e in t))&&fo(t,e,n)},Zu=Function.prototype,$u=Object.prototype,Qu=Zu.toString,Ju=$u.hasOwnProperty,ts=Qu.call(Object),es=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]},ns=function t(e,n,r,o,i){e!==n&&Mi(n,(function(a,u){if(i||(i=new uo),zr(a))!function(t,e,n,r,o,i,a){var u=es(t,n),s=es(e,n),c=a.get(s);if(c)Ku(t,n,c);else{var f=i?i(u,s,n+"",t,e,a):void 0,l=void 0===f;if(l){var d=Eo(s),h=!d&&_o(s),p=!d&&!h&&Mo(s);f=s,d||h||p?Eo(u)?f=u:iu(u)?f=Xo(u):h?(l=!1,f=Wo(s,!0)):p?(l=!1,f=wi(s,!0)):f=[]:function(t){if(!vo(t)||"[object Object]"!=jr(t))return!1;var e=Qo(t);if(null===e)return!0;var n=Ju.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Qu.call(n)==ts}(s)||wo(s)?(f=u,wo(u)?f=function(t){return po(t,Vo(t))}(u):zr(u)&&!Fr(u)||(f=_i(s))):l=!1}l&&(a.set(s,f),o(f,s,r,i,a),a.delete(s)),Ku(t,n,f)}}(e,n,u,r,t,o,i);else{var s=o?o(es(e,u),a,u+"",e,n,i):void 0;void 0===s&&(s=a),Ku(e,u,s)}}),Vo)},rs=function(t){return tu((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&&Cu(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){ns(t,e,n)})),os=function(t,e){return t<e},is=function(t,e,n,r){if(!zr(t))return t;for(var o=-1,i=(e=va(e,t)).length,a=i-1,u=t;null!=u&&++o<i;){var s=ga(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=zr(f)?f:Ao(e[o+1])?[]:{})}ho(u,s,c),u=u[s]}return t},as=function(t){return Ja(Za(t,void 0,Hu),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=ma(t,a);n(0,a)&&is(i,va(a,t),u)}return i}(t,e,(function(e,n){return wa(t,n)}))}(t,e)})),us=Math.ceil,ss=Math.max,cs=function(t,e){if(t!==e){var n=void 0!==t,r=null===t,o=t==t,i=ta(t),a=void 0!==e,u=null===e,s=e==e,c=ta(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},fs=tu((function(t,e){if(null==t)return[];var n=e.length;return n>1&&Cu(t,e[0],e[1])?e=[]:n>2&&Cu(e[0],e[1],e[2])&&(e=[e[0]]),function(t,e,n){e=e.length?fa(e,(function(t){return Eo(t)?function(e){return ma(e,1===t.length?t[0]:t)}:t})):[Ci];var r=-1;e=fa(e,Oo(xa));var o=Na(t,(function(t,n,o){return{criteria:fa(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=cs(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,qa(e,1),[])})),ls=0;try{ku={cloneDeep:function(t){return Ni(t,5)},constant:Di,defaults:ju,each:ji,filter:_a,find:Xu,flatten:Hu,forEach:Pi,forIn:function(t,e){return null==t?t:Mi(t,Li(e),Vo)},has:Ia,isUndefined:Oa,last:function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0},map:Da,mapValues:function(t,e){var n={};return e=xa(e),ki(t,(function(t,r,o){fo(n,r,e(t,r,o))})),n},max:function(t){return t&&t.length?qu(t,Ci,Yu):void 0},merge:rs,min:function(t){return t&&t.length?qu(t,Ci,os):void 0},minBy:function(t,e){return t&&t.length?qu(t,xa(e),os):void 0},now:function(){return Nr.Date.now()},pick:as,range:function(t,e,n){return n&&"number"!=typeof n&&Cu(t,e,n)&&(e=n=void 0),t=Vu(t),void 0===e?(e=t,t=0):e=Vu(e),function(t,e,n,r){for(var o=-1,i=ss(us((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:Vu(n))},reduce:Ra,sortBy:fs,uniqueId:function(t){var e=++ls;return pa(t)+e},values:uu,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||[],ho)}}}catch(fr){}ku||(ku=window._);var ds=ku,hs=ps;function ps(){var t={};t._next=t._prev=t,this._sentinel=t}function vs(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function gs(t,e){if("_next"!==t&&"_prev"!==t)return e}ps.prototype.dequeue=function(){var t=this._sentinel,e=t._prev;if(e!==t)return vs(e),e},ps.prototype.enqueue=function(t){var e=this._sentinel;t._prev&&t._next&&vs(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e},ps.prototype.toString=function(){for(var t=[],e=this._sentinel,n=e._prev;n!==e;)t.push(JSON.stringify(n,gs)),n=n._prev;return"["+t.join(", ")+"]"};var ms=Ru.Graph,ys=ds.constant(1);function bs(t,e,n,r,o){var i=o?[]:void 0;return ds.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,ws(e,n,u)})),ds.forEach(t.outEdges(r.v),(function(r){var o=t.edge(r),i=r.w,a=t.node(i);a.in-=o,ws(e,n,a)})),t.removeNode(r.v),i}function ws(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 Es=Ru.Graph,xs={addDummyNode:_s,simplify:function(t){var e=(new Es).setGraph(t.graph());return ds.forEach(t.nodes(),(function(n){e.setNode(n,t.node(n))})),ds.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 Es({multigraph:t.isMultigraph()}).setGraph(t.graph());return ds.forEach(t.nodes(),(function(n){t.children(n).length||e.setNode(n,t.node(n))})),ds.forEach(t.edges(),(function(n){e.setEdge(n,t.edge(n))})),e},successorWeights:function(t){var e=ds.map(t.nodes(),(function(e){var n={};return ds.forEach(t.outEdges(e),(function(e){n[e.w]=(n[e.w]||0)+t.edge(e).weight})),n}));return ds.zipObject(t.nodes(),e)},predecessorWeights:function(t){var e=ds.map(t.nodes(),(function(e){var n={};return ds.forEach(t.inEdges(e),(function(e){n[e.v]=(n[e.v]||0)+t.edge(e).weight})),n}));return ds.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=ds.map(ds.range(Ss(t)+1),(function(){return[]}));return ds.forEach(t.nodes(),(function(n){var r=t.node(n),o=r.rank;ds.isUndefined(o)||(e[o][r.order]=n)})),e},normalizeRanks:function(t){var e=ds.min(ds.map(t.nodes(),(function(e){return t.node(e).rank})));ds.forEach(t.nodes(),(function(n){var r=t.node(n);ds.has(r,"rank")&&(r.rank-=e)}))},removeEmptyRanks:function(t){var e=ds.min(ds.map(t.nodes(),(function(e){return t.node(e).rank}))),n=[];ds.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;ds.forEach(n,(function(e,n){ds.isUndefined(e)&&n%o!=0?--r:r&&ds.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),_s(t,"border",o,e)},maxRank:Ss,partition:function(t,e){var n={lhs:[],rhs:[]};return ds.forEach(t,(function(t){e(t)?n.lhs.push(t):n.rhs.push(t)})),n},time:function(t,e){var n=ds.now();try{return e()}finally{console.log(t+" time: "+(ds.now()-n)+"ms")}},notime:function(t,e){return e()}};function _s(t,e,n,r){var o;do{o=ds.uniqueId(r)}while(t.hasNode(o));return n.dummy=e,t.setNode(o,n),o}function Ss(t){return ds.max(ds.map(t.nodes(),(function(e){var n=t.node(e).rank;if(!ds.isUndefined(n))return n})))}var As=function(t){var e={};ds.forEach(t.sources(),(function n(r){var o=t.node(r);if(ds.has(e,r))return o.rank;e[r]=!0;var i=ds.min(ds.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}))},Is=function(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen},Ts=Ru.Graph,Os=Is,Ns=function(t){var e,n,r=new Ts({directed:!1}),o=t.nodes()[0],i=t.nodeCount();for(r.setNode(o,{});Ds(r,t)<i;)e=Ms(r,t),n=r.hasNode(e.v)?Os(t,e):-Os(t,e),ks(r,t,n);return r};function Ds(t,e){return ds.forEach(t.nodes(),(function n(r){ds.forEach(e.nodeEdges(r),(function(o){var i=o.v,a=r===i?o.w:i;t.hasNode(a)||Os(e,o)||(t.setNode(a,{}),t.setEdge(r,a,{}),n(a))}))})),t.nodeCount()}function Ms(t,e){return ds.minBy(e.edges(),(function(n){if(t.hasNode(n.v)!==t.hasNode(n.w))return Os(e,n)}))}function ks(t,e,n){ds.forEach(t.nodes(),(function(t){e.node(t).rank+=n}))}var Rs=Is,Cs=As,Ls=Ru.alg.preorder,Ps=Ru.alg.postorder,js=xs.simplify,zs=Fs;function Fs(t){t=js(t),Cs(t);var e,n=Ns(t);for(Bs(n),Gs(n,t);e=Ws(n);)Hs(n,t,e,Xs(n,t,e))}function Gs(t,e){var n=Ps(t,t.nodes());n=n.slice(0,n.length-1),ds.forEach(n,(function(n){!function(t,e,n){var r=t.node(n).parent;t.edge(n,r).cutvalue=Us(t,e,n)}(t,e,n)}))}function Us(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,ds.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 Bs(t,e){arguments.length<2&&(e=t.nodes()[0]),Vs(t,{},1,e)}function Vs(t,e,n,r,o){var i=n,a=t.node(r);return e[r]=!0,ds.forEach(t.neighbors(r),(function(o){ds.has(e,o)||(n=Vs(t,e,n,o,r))})),a.low=i,a.lim=n++,o?a.parent=o:delete a.parent,n}function Ws(t){return ds.find(t.edges(),(function(e){return t.edge(e).cutvalue<0}))}function Xs(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=ds.filter(e.edges(),(function(e){return s===qs(0,t.node(e.v),u)&&s!==qs(0,t.node(e.w),u)}));return ds.minBy(c,(function(t){return Rs(e,t)}))}function Hs(t,e,n,r){var o=n.v,i=n.w;t.removeEdge(o,i),t.setEdge(r.v,r.w,{}),Bs(t),Gs(t,e),function(t,e){var n=ds.find(t.nodes(),(function(t){return!e.node(t).parent})),r=Ls(t,n);r=r.slice(1),ds.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 qs(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}Fs.initLowLimValues=Bs,Fs.initCutValues=Gs,Fs.calcCutValue=Us,Fs.leaveEdge=Ws,Fs.enterEdge=Xs,Fs.exchangeEdges=Hs;var Ys=As,Ks=Ys;var Zs=function(t){var e=xs.addDummyNode(t,"root",{},"_root"),n=function(t){var e={};function n(r,o){var i=t.children(r);i&&i.length&&ds.forEach(i,(function(t){n(t,o+1)})),e[r]=o}return ds.forEach(t.children(),(function(t){n(t,1)})),e}(t),r=ds.max(ds.values(n))-1,o=2*r+1;t.graph().nestingRoot=e,ds.forEach(t.edges(),(function(e){t.edge(e).minlen*=o}));var i=function(t){return ds.reduce(t.edges(),(function(e,n){return e+t.edge(n).weight}),0)}(t)+1;ds.forEach(t.children(),(function(a){$s(t,e,o,i,r,n,a)})),t.graph().nodeRankFactor=o};function $s(t,e,n,r,o,i,a){var u=t.children(a);if(u.length){var s=xs.addBorderNode(t,"_bt"),c=xs.addBorderNode(t,"_bb"),f=t.node(a);t.setParent(s,a),f.borderTop=s,t.setParent(c,a),f.borderBottom=c,ds.forEach(u,(function(u){$s(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 Qs(t,e,n,r,o,i){var a={width:0,height:0,rank:i,borderType:e},u=o[e][i-1],s=xs.addDummyNode(t,"border",a,n);o[e][i]=s,t.setParent(s,r),u&&t.setEdge(u,s,{weight:1})}function Js(t){ds.forEach(t.nodes(),(function(e){tc(t.node(e))})),ds.forEach(t.edges(),(function(e){tc(t.edge(e))}))}function tc(t){var e=t.width;t.width=t.height,t.height=e}function ec(t){t.y=-t.y}function nc(t){var e=t.x;t.x=t.y,t.y=e}var rc=function(t,e){for(var n=0,r=1;r<e.length;++r)n+=oc(t,e[r-1],e[r]);return n};function oc(t,e,n){for(var r=ds.zipObject(n,ds.map(n,(function(t,e){return e}))),o=ds.flatten(ds.map(e,(function(e){return ds.sortBy(ds.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=ds.map(new Array(a),(function(){return 0})),s=0;return ds.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 ic(t,e,n){for(var r;e.length&&(r=ds.last(e)).i<=n;)e.pop(),t.push(r.vs),n++;return n}var ac=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=ds.filter(i,(function(t){return t!==u&&t!==s})));var f=function(t,e){return ds.map(e,(function(e){var n=t.inEdges(e);if(n.length){var r=ds.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);ds.forEach(f,(function(n){if(e.children(n.v).length){var i=t(e,n.v,r,o);c[n.v]=i,ds.has(i,"barycenter")&&(a=n,u=i,ds.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 ds.forEach(t,(function(t,e){var r=n[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};ds.isUndefined(t.barycenter)||(r.barycenter=t.barycenter,r.weight=t.weight)})),ds.forEach(e.edges(),(function(t){var e=n[t.v],r=n[t.w];ds.isUndefined(e)||ds.isUndefined(r)||(r.indegree++,e.out.push(n[t.w]))})),function(t){var e=[];function n(t){return function(e){e.merged||(ds.isUndefined(e.barycenter)||ds.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),ds.forEach(o.in.reverse(),n(o)),ds.forEach(o.out,r(o))}return ds.map(ds.filter(e,(function(t){return!t.merged})),(function(t){return ds.pick(t,["vs","i","barycenter","weight"])}))}(ds.filter(n,(function(t){return!t.indegree})))}(f,r);!function(t,e){ds.forEach(t,(function(t){t.vs=ds.flatten(t.vs.map((function(t){return e[t]?e[t].vs:t})),!0)}))}(l,c);var d=function(t,e){var n,r=xs.partition(t,(function(t){return ds.has(t,"barycenter")})),o=r.lhs,i=ds.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=ic(a,i,c),ds.forEach(o,(function(t){c+=t.vs.length,a.push(t.vs),u+=t.barycenter*t.weight,s+=t.weight,c=ic(a,i,c)}));var f={vs:ds.flatten(a,!0)};return s&&(f.barycenter=u/s,f.weight=s),f}(l,o);if(u&&(d.vs=ds.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]);ds.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},uc=Ru.Graph,sc=function(t,e,n){var r=function(t){for(var e;t.hasNode(e=ds.uniqueId("_root")););return e}(t),o=new uc({compound:!0}).setGraph({root:r}).setDefaultNodeLabel((function(e){return t.node(e)}));return ds.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),ds.forEach(t[n](i),(function(e){var n=e.v===i?e.w:e.v,r=o.edge(n,i),a=ds.isUndefined(r)?0:r.weight;o.setEdge(n,i,{weight:t.edge(e).weight+a})})),ds.has(a,"minRank")&&o.setNode(i,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))})),o},cc=function(t,e,n){var r,o={};ds.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}}))},fc=Ru.Graph;function lc(t,e,n){return ds.map(e,(function(e){return sc(t,e,n)}))}function dc(t,e){var n=new fc;ds.forEach(t,(function(t){var r=t.graph().root,o=ac(t,r,n,e);ds.forEach(o.vs,(function(e,n){t.node(e).order=n})),cc(t,n,o.vs)}))}function hc(t,e){ds.forEach(e,(function(e){ds.forEach(e,(function(e,n){t.node(e).order=n}))}))}var pc=Ru.Graph;function vc(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 gc(t,e,n){if(e>n){var r=e;e=n,n=r}return ds.has(t[e],n)}var mc=xs.normalizeRanks,yc=xs.removeEmptyRanks,bc=xs,wc=Ru.Graph,Ec=["nodesep","edgesep","ranksep","marginx","marginy"],xc={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},_c=["acyclicer","ranker","rankdir","align"],Sc=["width","height"],Ac={width:0,height:0},Ic=["minlen","weight","width","height","labeloffset"],Tc={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Oc=["labelpos"];function Nc(t,e){return ds.mapValues(ds.pick(t,e),Number)}function Dc(t){var e={};return ds.forEach(t,(function(t,n){e[n.toLowerCase()]=t})),e}var Mc=Ru.Graph,kc={graphlib:Ru,layout:function(t,e){var n=e&&e.debugTiming?bc.time:bc.notime;n("layout",(function(){var e=n(" buildLayoutGraph",(function(){return function(t){var e=new wc({multigraph:!0,compound:!0}),n=Dc(t.graph());return e.setGraph(ds.merge({},xc,Nc(n,Ec),ds.pick(n,_c))),ds.forEach(t.nodes(),(function(n){var r=Dc(t.node(n));e.setNode(n,ds.defaults(Nc(r,Sc),Ac)),e.setParent(n,t.parent(n))})),ds.forEach(t.edges(),(function(n){var r=Dc(t.edge(n));e.setEdge(n,ds.merge({},Tc,Nc(r,Ic),ds.pick(r,Oc)))})),e}(t)}));n(" runLayout",(function(){!function(t,e){e(" makeSpaceForEdgeLabels",(function(){!function(t){var e=t.graph();e.ranksep/=2,ds.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){ds.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 ms,r=0,o=0;ds.forEach(t.nodes(),(function(t){n.setNode(t,{v:t,in:0,out:0})})),ds.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=ds.range(o+r+3).map((function(){return new hs})),a=r+1;return ds.forEach(n.nodes(),(function(t){ws(i,a,n.node(t))})),{graph:n,buckets:i,zeroIdx:a}}(t,e||ys),r=function(t,e,n){for(var r,o=[],i=e[e.length-1],a=e[0];t.nodeCount();){for(;r=a.dequeue();)bs(t,e,n,r);for(;r=i.dequeue();)bs(t,e,n,r);if(t.nodeCount())for(var u=e.length-2;u>0;--u)if(r=e[u].dequeue()){o=o.concat(bs(t,e,n,r,!0));break}}return o}(n.graph,n.buckets,n.zeroIdx);return ds.flatten(ds.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 ds.forEach(t.nodes(),(function o(i){ds.has(r,i)||(r[i]=!0,n[i]=!0,ds.forEach(t.outEdges(i),(function(t){ds.has(n,t.w)?e.push(t):o(t.w)})),delete n[i])})),e}(t);ds.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,ds.uniqueId("rev"))}))}(t)})),e(" nestingGraph.run",(function(){Zs(t)})),e(" rank",(function(){!function(t){switch(t.graph().ranker){case"network-simplex":default:!function(t){zs(t)}(t);break;case"tight-tree":!function(t){Ys(t),Ns(t)}(t);break;case"longest-path":Ks(t)}}(bc.asNonCompoundGraph(t))})),e(" injectEdgeLabelProxies",(function(){!function(t){ds.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};bc.addDummyNode(t,"edge-proxy",o,"_ep")}}))}(t)})),e(" removeEmptyRanks",(function(){yc(t)})),e(" nestingGraph.cleanup",(function(){!function(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,ds.forEach(t.edges(),(function(e){t.edge(e).nestingEdge&&t.removeEdge(e)}))}(t)})),e(" normalizeRanks",(function(){mc(t)})),e(" assignRankMinMax",(function(){!function(t){var e=0;ds.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=ds.max(e,r.maxRank))})),t.graph().maxRank=e}(t)})),e(" removeEdgeLabelProxies",(function(){!function(t){ds.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=[],ds.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=xs.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 ds.forEach(t.children(),(function r(o){var i=n;ds.forEach(t.children(o),r),e[o]={low:i,lim:n++}})),e}(t);ds.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){ds.forEach(t.children(),(function e(n){var r=t.children(n),o=t.node(n);if(r.length&&ds.forEach(r,e),ds.has(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,a=o.maxRank+1;i<a;++i)Qs(t,"borderLeft","_bl",n,o,i),Qs(t,"borderRight","_br",n,o,i)}}))}(t)})),e(" order",(function(){!function(t){var e=xs.maxRank(t),n=lc(t,ds.range(1,e+1),"inEdges"),r=lc(t,ds.range(e-1,-1,-1),"outEdges"),o=function(t){var e={},n=ds.filter(t.nodes(),(function(e){return!t.children(e).length})),r=ds.max(ds.map(n,(function(e){return t.node(e).rank}))),o=ds.map(ds.range(r+1),(function(){return[]})),i=ds.sortBy(n,(function(e){return t.node(e).rank}));return ds.forEach(i,(function n(r){if(!ds.has(e,r)){e[r]=!0;var i=t.node(r);o[i.rank].push(r),ds.forEach(t.successors(r),n)}})),o}(t);hc(t,o);for(var i,a=Number.POSITIVE_INFINITY,u=0,s=0;s<4;++u,++s){dc(u%2?n:r,u%4>=2),o=xs.buildLayerMatrix(t);var c=rc(t,o);c<a&&(s=0,i=ds.cloneDeep(o),a=c)}hc(t,i)}(t)})),e(" insertSelfEdges",(function(){!function(t){var e=bc.buildLayerMatrix(t);ds.forEach(e,(function(e){var n=0;ds.forEach(e,(function(e,r){var o=t.node(e);o.order=r+n,ds.forEach(o.selfEdges,(function(e){bc.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||Js(t)}(t)})),e(" position",(function(){!function(t){(function(t){var e=xs.buildLayerMatrix(t),n=t.graph().ranksep,r=0;ds.forEach(e,(function(e){var o=ds.max(ds.map(e,(function(e){return t.node(e).height})));ds.forEach(e,(function(e){t.node(e).y=r+o/2})),r+=o+n}))})(t=xs.asNonCompoundGraph(t)),ds.forEach(function(t){var e,n=xs.buildLayerMatrix(t),r=ds.merge(function(t,e){var n={};return ds.reduce(e,(function(e,r){var o=0,i=0,a=e.length,u=ds.last(r);return ds.forEach(r,(function(e,s){var c=function(t,e){if(t.node(e).dummy)return ds.find(t.predecessors(e),(function(e){return t.node(e).dummy}))}(t,e),f=c?t.node(c).order:a;(c||e===u)&&(ds.forEach(r.slice(i,s+1),(function(e){ds.forEach(t.predecessors(e),(function(r){var i=t.node(r),a=i.order;!(a<o||f<a)||i.dummy&&t.node(e).dummy||vc(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;ds.forEach(ds.range(r,o),(function(r){u=e[r],t.node(u).dummy&&ds.forEach(t.predecessors(u),(function(e){var r=t.node(e);r.dummy&&(r.order<i||r.order>a)&&vc(n,e,u)}))}))}return ds.reduce(e,(function(e,n){var o,i=-1,a=0;return ds.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={};ds.forEach(["u","d"],(function(i){e="u"===i?n:ds.values(n).reverse(),ds.forEach(["l","r"],(function(n){"r"===n&&(e=ds.map(e,(function(t){return ds.values(t).reverse()})));var a=("u"===i?t.predecessors:t.successors).bind(t),u=function(t,e,n,r){var o={},i={},a={};return ds.forEach(e,(function(t){ds.forEach(t,(function(t,e){o[t]=t,i[t]=t,a[t]=e}))})),ds.forEach(e,(function(t){var e=-1;ds.forEach(t,(function(t){var u=r(t);if(u.length)for(var s=((u=ds.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]&&!gc(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 pc,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,ds.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,ds.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 ds.forEach(e,(function(e){var r;ds.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)),ds.forEach(r,(function(t){i[t]=i[n[t]]})),i}(t,e,u.root,u.align,"r"===n);"r"===n&&(s=ds.mapValues(s,(function(t){return-t}))),o[i+n]=s}))}));var i=function(t,e){return ds.minBy(ds.values(e),(function(e){var n=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY;return ds.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=ds.values(e),r=ds.min(n),o=ds.max(n);ds.forEach(["u","d"],(function(n){ds.forEach(["l","r"],(function(i){var a,u=n+i,s=t[u];if(s!==e){var c=ds.values(s);(a="l"===i?r-ds.min(c):o-ds.max(c))&&(t[u]=ds.mapValues(s,(function(t){return t+a})))}}))}))}(o,i),function(t,e){return ds.mapValues(t.ul,(function(n,r){if(e)return t[e.toLowerCase()][r];var o=ds.sortBy(ds.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){ds.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){ds.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(ds.last(n.borderLeft)),a=t.node(ds.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}})),ds.forEach(t.nodes(),(function(e){"border"===t.node(e).dummy&&t.removeNode(e)}))}(t)})),e(" normalize.undo",(function(){!function(t){ds.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){ds.forEach(t.edges(),(function(e){var n=t.edge(e);if(ds.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){ds.forEach(t.nodes(),(function(e){ec(t.node(e))})),ds.forEach(t.edges(),(function(e){var n=t.edge(e);ds.forEach(n.points,ec),ds.has(n,"y")&&ec(n)}))}(t),"lr"!==e&&"rl"!==e||(function(t){ds.forEach(t.nodes(),(function(e){nc(t.node(e))})),ds.forEach(t.edges(),(function(e){var n=t.edge(e);ds.forEach(n.points,nc),ds.has(n,"x")&&nc(n)}))}(t),Js(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)}ds.forEach(t.nodes(),(function(e){s(t.node(e))})),ds.forEach(t.edges(),(function(e){var n=t.edge(e);ds.has(n,"x")&&s(n)})),e-=a,r-=u,ds.forEach(t.nodes(),(function(n){var o=t.node(n);o.x-=e,o.y-=r})),ds.forEach(t.edges(),(function(n){var o=t.edge(n);ds.forEach(o.points,(function(t){t.x-=e,t.y-=r})),ds.has(o,"x")&&(o.x-=e),ds.has(o,"y")&&(o.y-=r)})),i.width=n-e+a,i.height=o-r+u}(t)})),e(" assignNodeIntersects",(function(){!function(t){ds.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(bc.intersectRect(i,n)),o.points.push(bc.intersectRect(a,r))}))}(t)})),e(" reversePoints",(function(){!function(t){ds.forEach(t.edges(),(function(e){var n=t.edge(e);n.reversed&&n.points.reverse()}))}(t)})),e(" acyclic.undo",(function(){!function(t){ds.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){ds.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))})),ds.forEach(t.edges(),(function(n){var r=t.edge(n),o=e.edge(n);r.points=o.points,ds.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=xs.buildLayerMatrix(t),n=new Mc({compound:!0,multigraph:!0}).setGraph({});return ds.forEach(t.nodes(),(function(e){n.setNode(e,{label:e}),n.setParent(e,"layer"+t.node(e).rank)})),ds.forEach(t.edges(),(function(t){n.setEdge(t.v,t.w,{},t.name)})),ds.forEach(e,(function(t,e){var r="layer"+e;n.setNode(r,{rank:"same"}),ds.reduce(t,(function(t,e){return n.setEdge(t,e,{style:"invis"}),e}))})),n}},util:{time:xs.time,notime:xs.notime},version:"0.8.5"},Rc=kc.graphlib,Cc=kc.layout;class Lc{constructor(t){this.cardinality=1,this.include=gr.UNSPECIFIED,this.isGroupNode=!1,this.parentNode=null,this.type=vr.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 Pc{constructor(){this.nodes={},this.edges=[],this.nodes={},this.edges=[]}}class jc{constructor(t,e={}){this.attr=null,this.bridgeGraph=null,this.cardinality=0,this.depth=1,this.include=gr.UNSPECIFIED,this.isGroupNode=!0,this.parentNode=null,this.type=vr.META,this.path=[],this.name=t,this.metaGraph=Uc(t,mr.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 zc{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 Fc(t,e={}){return new jc(t,e)}function Gc(t,e){return new zc(t,e)}function Uc(t,e,n){const r=n||{},o=new Rc.Graph(r);return o.setGraph({name:t,rankdir:r.rankdir,type:e,align:r.align}),o}class Bc{constructor(t={}){this.graphOptions=t,this.index={},this.graphOptions.compound=!0,this.root=Fc(hr,this.graphOptions),this.index[hr]=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=Uc(pr,mr.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=Gc(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 Vc(o,t,e,n),Vc(i,t,e,n),n}}function Vc(t,e,n,r){(n?t.inEdges(e.name):t.outEdges(e.name)).forEach((e=>{const n=t.edge(e);r.push(n)}))}class Wc{constructor(t){this.hierarchy=t,this.index={},this.hasSubHierarchy={},this.root=new qc(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!==vr.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 Hc(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:vr.BRIDGE,isGroupNode:!1,cardinality:0,parentNode:null,include:gr.UNSPECIFIED,inbound:c,attr:{}};t=new Xc(e),this.index[p]=t,o.setNode(p,t)}const e={name:v,type:vr.BRIDGE,isGroupNode:!1,cardinality:1,parentNode:null,include:gr.UNSPECIFIED,inbound:c,attr:{}};g=new Xc(e),this.index[v]=g,o.setNode(v,g),o.setParent(v,p),t.node.cardinality++}const m=new Hc(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 qc(e,this.hierarchy.graphOptions):new Xc(e),this.index[t]):null}getRenderNodeByName(t){return this.index[t]}getNodeByName(t){return this.hierarchy.node(t)}}class Xc{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 Hc{constructor(t){this.metaEdge=t,this.adjoiningMetaEdge=null,this.weight=1,this.points=[]}}class qc extends Xc{constructor(t,e){super(t);const n=t.metaGraph.graph();e.compound=!0,this.coreGraph=Uc(n.name,mr.CORE,e)}}function Yc(t,e){t.node.isGroupNode&&function(t,e){const n=lr(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 vr.NODE:Object.assign(t,n.nodeSize.node),t.height=c||n.nodeSize.node.height,t.width=f||n.nodeSize.node.width;break;case vr.BRIDGE:Object.assign(t,n.nodeSize.bridge);break;case vr.META:t.expanded?Yc(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===vr.META&&function(t,e){const n=lr(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!==vr.BRIDGE&&a.push(e)})),!a.length)return{width:0,height:0};Cc(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=Kc(t[0],t[1]);for(let n=1;n<t.length-1;n++){const r=Kc(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:Zc(r);n.points[0].x=t}if(null!=o){const t=o.expanded?o.x:Zc(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]=$c(i,o));const a=n.points[1];null!=r&&(n.points[0]=$c(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 Kc(t,e){const n=e.x-t.x,r=e.y-t.y;return 180*Math.atan(r/n)/Math.PI}function Zc(t){return t.expanded?t.x:t.x-t.width/2+0+t.coreBox.width/2}function $c(t,e){const n=e.expanded?e.x:Zc(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 Qc(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 Wc(t)}(function(t,e){const{rankDirection:n,align:r}=e,o=new Bc({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=Fc(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=Gc(f,l),c.metaGraph.setEdge(f,l,d)),d.addBaseEdge(a,t)}))}(o,t),o}(function(t){const e=new Pc;return t.nodes.map((t=>new Lc(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)||fr.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)||fr.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),Yc(f.root,n),tf(f.root)}function Jc(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=[hr,...u].slice(0,u.length).reverse(),f=[hr,...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 tf(t){const e=t.coreGraph.nodes().map((e=>t.coreGraph.node(e)));return Object.assign(Object.assign({},ef(t)),{expanded:t.expanded,nodes:t.expanded?(n=e,n.map((t=>t.node.type===vr.META?tf(t):ef(t)))):[],edges:t.expanded?nf(t):[]});var n}function ef(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 nf(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 rf=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)}}(),of=function(){return of=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},of.apply(this,arguments)},af=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))},uf=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 rf(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 of(of({},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!==hr&&(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}(Qc(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]=af(af([],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:af([],(a||[]).map((function(t){var e=r(t),n=e[0],o=e[1];return of(of({},t),{width:n,height:o})})),!0),edges:af([],(u||[]).map((function(t){return of(of({},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=lr(g,of({},lr(N,fr)));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===yr.META&&l!==hr){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===yr.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=Jc(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=Jc(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 af(af([],t,!0),e.points.map((function(t){return of(of({},t),{x:t.x+a[0],y:t.y+a[1]})})),!0)}),[])).slice(1,-1),e.controlPoints=l,(null==f?void 0:f.type)===vr.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)===vr.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 sf=Object.prototype.toString;function cf(t){return sf.call(t).endsWith("Array]")}function ff(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!cf(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(!cf(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(!cf(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(!cf(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 lf=" ".repeat(2),df=" ".repeat(4);function hf(t,e={}){const{maxRows:n=15,maxColumns:r=10,maxNumSize:o=8,padMinus:i="auto"}=e;return`${t.constructor.name} {\n${lf}[\n${df}${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(pf(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${df}`)}(t,n,r,o,i)}\n${lf}]\n${lf}rows: ${t.rows}\n${lf}columns: ${t.columns}\n}`}function pf(t,e,n){return(t>=0&&n?` ${vf(t,e-1)}`:vf(t,e)).padEnd(e)}function vf(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 gf(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 mf(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 yf(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 bf(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 wf(t,e,n,r,o){if(5!==arguments.length)throw new RangeError("expected 4 arguments");if(xf("startRow",e),xf("endRow",n),xf("startColumn",r),xf("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 Ef(t,e=0){let n=[];for(let r=0;r<t;r++)n.push(e);return n}function xf(t,e){if("number"!=typeof e)throw new TypeError(`${t} must be a number`)}function _f(t){if(t.isEmpty())throw new Error("Empty matrix has no elements to index")}class Sf{static from1DArray(t,e,n){if(t*e!==n.length)throw new RangeError("data length does not match given dimensions");let r=new If(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 If(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 If(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 If(t,e)}static ones(t,e){return new If(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 If(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 If(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 If(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 Sf.isMatrix(t)?t:new If(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 If(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){gf(this,t);let e=[];for(let n=0;n<this.columns;n++)e.push(this.get(t,n));return e}getRowVector(t){return If.rowVector(this.getRow(t))}setRow(t,e){gf(this,t),e=yf(this,e);for(let n=0;n<this.columns;n++)this.set(t,n,e[n]);return this}swapRows(t,e){gf(this,t),gf(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){mf(this,t);let e=[];for(let n=0;n<this.rows;n++)e.push(this.get(n,t));return e}getColumnVector(t){return If.columnVector(this.getColumn(t))}setColumn(t,e){mf(this,t),e=bf(this,e);for(let n=0;n<this.rows;n++)this.set(n,t,e[n]);return this}swapColumns(t,e){mf(this,t),mf(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=yf(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=yf(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=yf(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=yf(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=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[e]);return this}subColumnVector(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[e]);return this}mulColumnVector(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[e]);return this}divColumnVector(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[e]);return this}mulRow(t,e){gf(this,t);for(let n=0;n<this.columns;n++)this.set(t,n,this.get(t,n)*e);return this}mulColumn(t,e){mf(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(){_f(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(){_f(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(gf(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){gf(this,t),_f(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(gf(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){gf(this,t),_f(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(mf(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){mf(this,t),_f(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(mf(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){mf(this,t),_f(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){Sf.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=If.checkMatrix(t);let e=this.rows,n=this.columns,r=t.columns,o=new If(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=If.checkMatrix(t);let e=new If(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=If.checkMatrix(t);let e=new If(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=If.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=Sf.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(Sf.add(s,p),Sf.add(c,v),i,u),m=t(Sf.add(d,p),c,i,u),y=t(s,Sf.sub(l,v),i,u),b=t(p,Sf.sub(h,c),i,u),w=t(Sf.add(s,f),v,i,u),E=t(Sf.sub(d,s),Sf.add(c,l),i,u),x=t(Sf.sub(f,p),Sf.add(h,v),i,u),_=Sf.add(g,b);_.sub(w),_.add(x);let S=Sf.add(y,w),A=Sf.add(m,b),I=Sf.sub(g,m);I.add(y),I.add(E);let T=Sf.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 If(this.rows,this.columns);for(let t=0;t<this.rows;t++){const o=this.getRow(t);o.length>0&&ff(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 If(this.rows,this.columns);for(let t=0;t<this.columns;t++){const o=this.getColumn(t);o.length&&ff(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=If.checkMatrix(t);let e=this.rows,n=this.columns,r=t.rows,o=t.columns,i=new If(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=If.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(If.eye(n,n)),o=If.eye(e,e).kroneckerProduct(t);return r.add(o)}transpose(){let t=new If(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=Af){for(let e=0;e<this.rows;e++)this.setRow(e,this.getRow(e).sort(t));return this}sortColumns(t=Af){for(let e=0;e<this.columns;e++)this.setColumn(e,this.getColumn(e).sort(t));return this}subMatrix(t,e,n,r){wf(this,t,e,n,r);let o=new If(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 If(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 If(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=If.checkMatrix(t)).isEmpty())return this;wf(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(!cf(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(!cf(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 If(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 If(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=Ef(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=Ef(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=Ef(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=Ef(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(!cf(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(!cf(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(!cf(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(!cf(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(!cf(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(!cf(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 hf(this,t)}}function Af(t,e){return t-e}Sf.prototype.klass="Matrix","undefined"!=typeof Symbol&&(Sf.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return hf(this)}),Sf.random=Sf.rand,Sf.randomInt=Sf.randInt,Sf.diagonal=Sf.diag,Sf.prototype.diagonal=Sf.prototype.diag,Sf.identity=Sf.eye,Sf.prototype.negate=Sf.prototype.neg,Sf.prototype.tensorProduct=Sf.prototype.kroneckerProduct;class If extends Sf{constructor(t,e){if(super(),If.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(!cf(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 gf(this,t),this.data.splice(t,1),this.rows-=1,this}addRow(t,e){return void 0===e&&(e=t,t=this.rows),gf(this,t,!0),e=Float64Array.from(yf(this,e)),this.data.splice(t,0,e),this.rows+=1,this}removeColumn(t){mf(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),mf(this,t,!0),e=bf(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}}(Sf,If);class Tf extends Sf{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 Of(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 Nf{constructor(t,e={}){if((t=Tf.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 If(n,l),v=new If(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]=Of(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]=Of(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=Of(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=Of(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=Of(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=Of(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=If.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=If.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(If.diag(t))}inverse(){let t=this.V,e=this.threshold,n=t.rows,r=t.columns,o=new If(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 If(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 If.diag(this.s)}}var Df=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=If.mul(If.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 Nf(o),c=If.sqrt(s.diagonalMatrix).diagonal();return s.leftSingularVectors.toJSON().map((function(t){return If.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 Mf=Df;var kf=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 Rf=kf;var Cf=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 Lf(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var Pf=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 Cf(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 Mf({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 Rf(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=Lf(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=Lf(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),jf=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)}}(),zf=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 jf(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),Ff=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)}}(),Gf=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 Ff(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=If.mul(If.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 Nf(e),a=If.sqrt(i.diagonalMatrix).diagonal();return i.leftSingularVectors.toJSON().map((function(t){return If.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),Uf=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)}}(),Bf=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 Uf(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 Vf(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 Wf(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Vf(i,r,o,a,u,"next",t)}function u(t){Vf(i,r,o,a,u,"throw",t)}a(void 0)}))}}function Xf(t){return Xf="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},Xf(t)}function Hf(t){var e=function(t,e){if("object"!==Xf(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Xf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===Xf(e)?e:String(e)}function qf(t,e,n){return(e=Hf(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Yf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Kf(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,Hf(r.key),r)}}function Zf(t,e,n){return e&&Kf(t.prototype,e),n&&Kf(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var $f,Qf=n(6719),Jf=n.n(Qf),tl=n(1763),el=n.n(tl),nl=n(1469),rl=n.n(nl),ol=n(4687),il=n.n(ol),al=1;function ul(){return al++}!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"}($f||($f={}));var sl,cl,fl,ll,dl=function(){function t(){Yf(this,t),this.config=void 0}return Zf(t,[{key:"get",value:function(){return this.config}},{key:"set",value:function(t){this.config=t}}]),t}();function hl(){if("undefined"!=typeof document)return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}function pl(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 vl(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?pl(Object(n),!0).forEach((function(e){qf(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):pl(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>[]"}(sl||(sl={})),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"}(cl||(cl={})),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"}(fl||(fl={})),function(t){t.GLSL100="GLSL100",t.GLSL450="GLSL450",t.WGSL="WGSL"}(ll||(ll={}));var gl,ml,yl,bl,wl,El,xl,_l,Sl,Al,Il,Tl,Ol,Nl,Dl=function(){function t(e,n){Yf(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 Zf(t,[{key:"init",value:function(){var t=this.configService.get(),e=t.canvas,n=t.engineOptions;this.initPromise=this.engine.init(vl({canvas:e||hl(),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=el()(e)||Jf()(e)||rl()(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===fl.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=Wf(il().mark((function t(){var e,n,r=this,o=arguments;return il().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=Wf(il().mark((function t(){return il().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=Wf(il().mark((function t(){var e,n,r;return il().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.initPromise;case 2:return e=vl({},this.compiledBundle.context),n=this.engine.supportWebGPU?this.engine.useWGSL?ll.WGSL:ll.GLSL450:ll.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===fl.StorageBuffer){var n=1;t.type===sl.FloatArray?n=1:t.type===sl.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}(),Ml=n(1550),kl=n.n(Ml),Rl=function(){function t(e,n){Yf(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 Zf(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}(),Cl=(qf(gl={},$f.POINTS,"points"),qf(gl,$f.LINES,"lines"),qf(gl,$f.LINE_LOOP,"line loop"),qf(gl,$f.LINE_STRIP,"line strip"),qf(gl,$f.TRIANGLES,"triangles"),qf(gl,$f.TRIANGLE_FAN,"triangle fan"),qf(gl,$f.TRIANGLE_STRIP,"triangle strip"),gl),Ll=(qf(ml={},$f.STATIC_DRAW,"static"),qf(ml,$f.DYNAMIC_DRAW,"dynamic"),qf(ml,$f.STREAM_DRAW,"stream"),ml),Pl=(qf(yl={},$f.BYTE,"int8"),qf(yl,$f.UNSIGNED_INT,"int16"),qf(yl,$f.INT,"int32"),qf(yl,$f.UNSIGNED_BYTE,"uint8"),qf(yl,$f.UNSIGNED_SHORT,"uint16"),qf(yl,$f.UNSIGNED_INT,"uint32"),qf(yl,$f.FLOAT,"float"),yl),jl=(qf(bl={},$f.ALPHA,"alpha"),qf(bl,$f.LUMINANCE,"luminance"),qf(bl,$f.LUMINANCE_ALPHA,"luminance alpha"),qf(bl,$f.RGB,"rgb"),qf(bl,$f.RGBA,"rgba"),qf(bl,$f.RGBA4,"rgba4"),qf(bl,$f.RGB5_A1,"rgb5 a1"),qf(bl,$f.RGB565,"rgb565"),qf(bl,$f.DEPTH_COMPONENT,"depth"),qf(bl,$f.DEPTH_STENCIL,"depth stencil"),bl),zl=(qf(wl={},$f.DONT_CARE,"dont care"),qf(wl,$f.NICEST,"nice"),qf(wl,$f.FASTEST,"fast"),wl),Fl=(qf(El={},$f.NEAREST,"nearest"),qf(El,$f.LINEAR,"linear"),qf(El,$f.LINEAR_MIPMAP_LINEAR,"mipmap"),qf(El,$f.NEAREST_MIPMAP_LINEAR,"nearest mipmap linear"),qf(El,$f.LINEAR_MIPMAP_NEAREST,"linear mipmap nearest"),qf(El,$f.NEAREST_MIPMAP_NEAREST,"nearest mipmap nearest"),El),Gl=(qf(xl={},$f.REPEAT,"repeat"),qf(xl,$f.CLAMP_TO_EDGE,"clamp"),qf(xl,$f.MIRRORED_REPEAT,"mirror"),xl),Ul=(qf(_l={},$f.NONE,"none"),qf(_l,$f.BROWSER_DEFAULT_WEBGL,"browser"),_l),Bl=(qf(Sl={},$f.NEVER,"never"),qf(Sl,$f.ALWAYS,"always"),qf(Sl,$f.LESS,"less"),qf(Sl,$f.LEQUAL,"lequal"),qf(Sl,$f.GREATER,"greater"),qf(Sl,$f.GEQUAL,"gequal"),qf(Sl,$f.EQUAL,"equal"),qf(Sl,$f.NOTEQUAL,"notequal"),Sl),Vl=(qf(Al={},$f.FUNC_ADD,"add"),qf(Al,$f.MIN_EXT,"min"),qf(Al,$f.MAX_EXT,"max"),qf(Al,$f.FUNC_SUBTRACT,"subtract"),qf(Al,$f.FUNC_REVERSE_SUBTRACT,"reverse subtract"),Al),Wl=(qf(Il={},$f.ZERO,"zero"),qf(Il,$f.ONE,"one"),qf(Il,$f.SRC_COLOR,"src color"),qf(Il,$f.ONE_MINUS_SRC_COLOR,"one minus src color"),qf(Il,$f.SRC_ALPHA,"src alpha"),qf(Il,$f.ONE_MINUS_SRC_ALPHA,"one minus src alpha"),qf(Il,$f.DST_COLOR,"dst color"),qf(Il,$f.ONE_MINUS_DST_COLOR,"one minus dst color"),qf(Il,$f.DST_ALPHA,"dst alpha"),qf(Il,$f.ONE_MINUS_DST_ALPHA,"one minus dst alpha"),qf(Il,$f.CONSTANT_COLOR,"constant color"),qf(Il,$f.ONE_MINUS_CONSTANT_COLOR,"one minus constant color"),qf(Il,$f.CONSTANT_ALPHA,"constant alpha"),qf(Il,$f.ONE_MINUS_CONSTANT_ALPHA,"one minus constant alpha"),qf(Il,$f.SRC_ALPHA_SATURATE,"src alpha saturate"),Il),Xl=(qf(Tl={},$f.NEVER,"never"),qf(Tl,$f.ALWAYS,"always"),qf(Tl,$f.LESS,"less"),qf(Tl,$f.LEQUAL,"lequal"),qf(Tl,$f.GREATER,"greater"),qf(Tl,$f.GEQUAL,"gequal"),qf(Tl,$f.EQUAL,"equal"),qf(Tl,$f.NOTEQUAL,"notequal"),Tl),Hl=(qf(Ol={},$f.ZERO,"zero"),qf(Ol,$f.KEEP,"keep"),qf(Ol,$f.REPLACE,"replace"),qf(Ol,$f.INVERT,"invert"),qf(Ol,$f.INCR,"increment"),qf(Ol,$f.DECR,"decrement"),qf(Ol,$f.INCR_WRAP,"increment wrap"),qf(Ol,$f.DECR_WRAP,"decrement wrap"),Ol),ql=(qf(Nl={},$f.FRONT,"front"),qf(Nl,$f.BACK,"back"),Nl),Yl=function(){function t(e,n){Yf(this,t),this.buffer=void 0;var r=n.data,o=n.usage,i=n.type;this.buffer=e.buffer({data:r,usage:Ll[o||$f.STATIC_DRAW],type:Pl[i||$f.UNSIGNED_BYTE]})}return Zf(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 Kl(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 Zl(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 $l(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Zl(Object(n),!0).forEach((function(e){qf(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Zl(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Ql="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}",Jl=0,td=!1,ed=function(){function t(e,n){var r=this;Yf(this,t),this.reGl=e,this.context=n,this.entity=ul(),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===fl.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 td&&console.log("[".concat(r.entity,"]: ").concat(e," ").concat(r.textureCache[e].id)),r.textureCache[e].texture}}else if(u===fl.Uniform){if(i&&(Array.isArray(i)||Jf()(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:Ql,primitive:"triangle strip",count:4};this.computeCommand=this.reGl(s)}var e;return Zf(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()})),td&&console.log("[".concat(this.entity,"]: output ").concat(this.getOuputDataTexture().id))}},{key:"readData",value:(e=Wf(il().mark((function t(){var e,n,r,o,i,a,u,s,c=this;return il().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,td&&console.log("[".concat(this.entity,"]: confirm input ").concat(e," from model ").concat(n.entity,", ").concat(n.getOuputDataTexture().id))}},{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,td&&console.log("[".concat(this.entity,"]: after swap, output ").concat(this.getOuputDataTexture().id))}},{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 $l($l({},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===sl.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 Kl(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 Kl(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)?Kl(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:Jf()(n)?n.constructor:void 0,textureWidth:c,texture:l,texelCount:s,elementsPerTexel:r,isOutput:t===this.context.output.name}}}]),t}(),nd=function(){function t(e,n){Yf(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:Ll[o||$f.STATIC_DRAW],type:Pl[i||$f.UNSIGNED_BYTE],count:a})}return Zf(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}(),rd=function(){function t(e,n){Yf(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 Zf(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}(),od=n(8630),id=n.n(od);function ad(t){var e={};return Object.keys(t).forEach((function(n){ud(n,t[n],e,"")})),e}function ud(t,e,n,r){null===e||"number"==typeof e||"boolean"==typeof e||Array.isArray(e)&&"number"==typeof e[0]||Jf()(e)||""===e||void 0!==e.resize?n["".concat(r&&r+".").concat(t)]=e:(id()(e)&&Object.keys(e).forEach((function(o){ud(o,e[o],n,"".concat(r&&r+".").concat(t))})),Array.isArray(e)&&e.forEach((function(e,o){Object.keys(e).forEach((function(i){ud(i,e[i],n,"".concat(r&&r+".").concat(t,"[").concat(o,"]"))}))})))}function sd(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 cd(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?sd(Object(n),!0).forEach((function(e){qf(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):sd(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var fd=function(){function t(e,n){Yf(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=ad(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:Cl[void 0===s?$f.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 Zf(t,[{key:"addUniforms",value:function(t){this.uniforms=cd(cd({},this.uniforms),ad(t))}},{key:"draw",value:function(t){var e=cd(cd({},this.uniforms),ad(t.uniforms||{})),n={};Object.keys(e).forEach((function(t){var r=Xf(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:Bl[n.func||$f.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:Wl[o&&o.srcRGB||$f.SRC_ALPHA],srcAlpha:Wl[o&&o.srcAlpha||$f.SRC_ALPHA],dstRGB:Wl[o&&o.dstRGB||$f.ONE_MINUS_SRC_ALPHA],dstAlpha:Wl[o&&o.dstAlpha||$f.ONE_MINUS_SRC_ALPHA]},equation:{rgb:Vl[i&&i.rgb||$f.FUNC_ADD],alpha:Vl[i&&i.alpha||$f.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:$f.ALWAYS,ref:0,mask:-1}:a,s=n.opFront,c=void 0===s?{fail:$f.KEEP,zfail:$f.KEEP,zpass:$f.KEEP}:s,f=n.opBack,l=void 0===f?{fail:$f.KEEP,zfail:$f.KEEP,zpass:$f.KEEP}:f;e.stencil={enable:!!r,mask:i,func:cd(cd({},u),{},{cmp:Xl[u.cmp]}),opFront:{fail:Hl[c.fail],zfail:Hl[c.zfail],zpass:Hl[c.zpass]},opBack:{fail:Hl[l.fail],zfail:Hl[l.zfail],zpass:Hl[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?$f.BACK:o;e.cull={enable:!!r,face:ql[i]}}}},{key:"generateDefines",value:function(t){return Object.keys(t).map((function(e){return"#define ".concat(e," ").concat(Number(t[e]))})).join("\n")}}]),t}(),ld=function(){function t(e,n){Yf(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?$f.UNSIGNED_BYTE:o,a=n.width,u=n.height,s=n.flipY,c=void 0!==s&&s,f=n.format,l=void 0===f?$f.RGBA:f,d=n.mipmap,h=void 0!==d&&d,p=n.wrapS,v=void 0===p?$f.CLAMP_TO_EDGE:p,g=n.wrapT,m=void 0===g?$f.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?$f.NEAREST:S,I=n.min,T=void 0===I?$f.NEAREST:I,O=n.colorSpace,N=void 0===O?$f.BROWSER_DEFAULT_WEBGL:O;this.width=a,this.height=u;var D={width:a,height:u,type:Pl[i],format:jl[l],wrapS:Gl[v],wrapT:Gl[m],mag:Fl[A],min:Fl[T],alignment:E,flipY:c,colorSpace:Ul[N],premultiplyAlpha:_,aniso:b};r&&(D.data=r),"number"==typeof h?D.mipmap=zl[h]:"boolean"==typeof h&&(D.mipmap=h),this.texture=e.texture(D)}return Zf(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}(),dd=function(){function t(){var e=this;Yf(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=Wf(il().mark((function t(n){return il().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=Wf(il().mark((function t(e){var r;return il().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 fd(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 Rl(e.gl,t)},this.createBuffer=function(t){return new Yl(e.gl,t)},this.createElements=function(t){return new nd(e.gl,t)},this.createTexture2D=function(t){return new ld(e.gl,t)},this.createFramebuffer=function(t){return new rd(e.gl,t)},this.useFramebuffer=function(t,n){e.gl({framebuffer:t?t.get():null})(n)},this.createComputeModel=function(){var t=Wf(il().mark((function t(n){return il().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new ed(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($f.SCISSOR_TEST),e.gl._gl.scissor(t.box.x,t.box.y,t.box.width,t.box.height)):e.gl._gl.disable($f.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 Zf(t,[{key:"init",value:(e=Wf(il().mark((function t(e){return il().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){kl()({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}(),hd=function(){function t(){Yf(this,t),this.engine=void 0,this.configService=new dl}return Zf(t,[{key:"setConfig",value:function(t){this.configService.set(t)}},{key:"setEngine",value:function(t){this.engine=t}},{key:"createEntity",value:function(){return ul()}},{key:"createKernel",value:function(t){var e=new Dl(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 dd),n}}]),t}(),pd=function(t,e){return t?i(t)?function(){return t}:t:function(){return e||1}},vd=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)},gd=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)}}(),md=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())}))},yd=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])}}},bd=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 gd(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:1e3,gravity:10,speed:1,clustering:!1,clusterGravity:10}},e.prototype.execute=function(){return md(this,void 0,void 0,(function(){var t,e,n,r,o,a=this;return yd(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 md(this,void 0,void 0,(function(){var n,r,o,a,u,s=this;return yd(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 md(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 yd(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?hd.create({canvas:t,engineOptions:{supportCompute:!0}}):hd.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 md(D,void 0,void 0,(function(){var n,o;return yd(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),wd=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)}}(),Ed=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())}))},xd=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])}}},_d=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 wd(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:2e3,gravity:10,clustering:!1,clusterGravity:10}},e.prototype.execute=function(){return Ed(this,void 0,void 0,(function(){var t,e,n,r,o;return xd(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=pd(t.nodeStrength,1),t.edgeStrength=pd(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=pd(n.nodeStrength,1),n.edgeStrength=pd(n.edgeStrength,1),n.run(t,e)}},e.prototype.run=function(t,e){return Ed(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 xd(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=pd(n.linkDistance),n.edgeStrength=pd(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=vd([l,n.degrees,p,y]),_=vd([v,g,m,b]),S=n.workerEnabled,A=S?hd.create({canvas:t,engineOptions:{supportCompute:!0}}):hd.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 Ed(k,void 0,void 0,(function(){var o,i,u;return xd(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),Sd=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)}}(),Ad=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 Sd(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),Id=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)}}(),Td=function(){return Td=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},Td.apply(this,arguments)},Od=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 Id(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=Td(Td({},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=Td({},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 Gf: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 zf({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 Td(Td({},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),Nd=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 Dd=Nd;const Md=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 kd=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 Rd=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)}}(),Cd=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 Rd(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 Dd(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 Md({xmid:(f+c)/2,ymid:(d+l)/2,length:p,massCenter:a,mass:s}),g=new kd(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),Ld=function(){return Ld=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},Ld.apply(this,arguments)},Pd=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]=Ld(Ld({},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]=Ld(Ld({},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 jd=Pd;var zd=1200,Fd=800,Gd=1e7,Ud=10,Bd=3.141592653589793,Vd=1.5707963267948966,Wd=.375*Bd,Xd=.625*Bd,Hd=new Map,qd=10,Yd=10,Kd=.8,Zd=.1,$d=.5;function Qd(t,e){var n=(Hd.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*Ud/w*100+((c<h?c:h)-(u>l?u:l))*((f<p?f:p)-(s>d?s:d)),b*=Gd;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>Vd?(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<=Vd?(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<-Vd?(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=Wd<E&&E<Xd),{distance:Math.abs(b<w?b:w),isHoriz:x}}(i,a,E);w=x.distance,E=x.isHoriz,w<=Ud?b+=0!==w?n?Ud+1*Gd/w:Ud+Gd*Ud/w:Gd:(b+=w,n&&(b+=w*w))}return b}function Jd(t){for(var e=0,n=0;n<t.length;n++){var r=t[n];(r.x<0||r.y<0||r.x>zd||r.y>Fd)&&(e+=1e12);for(var o=n+1;o<t.length;o++)e+=Qd(r,t[o])}return e}function th(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 eh(t,e){for(var n=!1,r=1*qd,o=1*Yd,i=[r,-r,0,0],a=[0,0,o,-o],u=0;u<t.length;++u)for(var s=t[u],c=nh(s,t),f=0;f<i.length;f++)if(th(s,{x:s.x+i[f],y:s.y+a[f]},t,e)){s.x+=i[f],s.y+=a[f];var l=nh(s,t),d=Math.random();l<c||d<Kd&&d>Zd?(c=l,n=!0):(s.x-=i[f],s.y-=a[f])}return Kd>Zd&&(Kd*=$d),n?Jd(t):0}function nh(t,e){var n=0;(t.x<0||t.y<0||t.x+t.size[0]+20>zd||t.y+t.size[1]+20>Fd)&&(n+=1e12);for(var r=0;r<e.length;++r)t.id!==e[r].id&&(n+=Qd(t,e[r]));return n}const rh=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}));Hd.set(t,n)})),t.sort((function(t,e){var n,r;return(null===(n=Hd.get(t.id))||void 0===n?void 0:n.length)-(null===(r=Hd.get(e.id))||void 0===r?void 0:r.length)}));for(var n=Jd(t),r=20,o=1,i=0,a=0;r>0&&!(++a>=50);){var u=eh(t,e);0!==u&&(i=u),o=i-n,n=i,0===o?--r:r=20}return t.forEach((function(t){t.x=t.x-t.size[0]/2,t.y=t.y-t.size[1]/2})),{nodes:t,edges:e}};var oh=function(){return oh=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},oh.apply(this,arguments)};var ih=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)}}(),ah=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 ih(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])})),function(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=oh({},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 cr({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]})),rh(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 jd;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}({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),uh=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}(),sh={force:Vt,fruchterman:Bf,forceAtlas2:Cd,gForce:L,force2:K,dagre:cr,dagreCompound:uf,circular:qt,radial:Pf,concentric:zf,grid:D,mds:Gf,comboForce:Ad,comboCombined:Od,random:k,"gForce-gpu":_d,"fruchterman-gpu":bd,er:ah}})(),r})()));
3
3
  //# sourceMappingURL=layout.min.js.map